connector: use nlmsg_len() to check message length
authorMathias Krause <minipli@googlemail.com>
Mon, 30 Sep 2013 20:03:07 +0000 (22:03 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 28 Nov 2013 14:01:57 +0000 (14:01 +0000)
commitc92d60f0b331feafbf42a33aa6e17cdc2d7448c9
treeaf34a133d108e36238fc916275a48e096e7b40bb
parent5bf019ebfa38379d51698b7f0fefcd44d6f0447d
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.

Cc: stable@vger.kernel.org # v2.6.14+
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/connector/connector.c