connector: use nlmsg_len() to check message length
authorMathias Krause <minipli@googlemail.com>
Mon, 30 Sep 2013 20:03:07 +0000 (22:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Nov 2013 12:31:02 +0000 (04:31 -0800)
commit69b9c5ea567e5c9b202b3e5bcac3c2eb72270e0b
tree55fd165c516942c1e433d69e2ced45498930e411
parent39283085a92262f9446b95d36df9724902b7579a
connector: use nlmsg_len() to check message length

[ Upstream commit 162b2bedc084d2d908a04c93383ba02348b648b0 ]

The current code tests the length of the whole netlink message to be
at least as long to fit a cn_msg. This is wrong as nlmsg_len includes
the length of the netlink message header. Use nlmsg_len() instead to
fix this "off-by-NLMSG_HDRLEN" size check.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/connector/connector.c