aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/veth.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2012-02-15 04:09:46 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-29 16:33:46 -0800
commit497f51fc64d0bce7f1a40ebed20b2ba5090777a3 (patch)
tree9a99e9b4ae7b081fa497421bc94e1099c6b7aa55 /drivers/net/veth.c
parent32fa5d83232b026092505e9165e119e5806b930d (diff)
downloadkernel_samsung_smdk4412-497f51fc64d0bce7f1a40ebed20b2ba5090777a3.zip
kernel_samsung_smdk4412-497f51fc64d0bce7f1a40ebed20b2ba5090777a3.tar.gz
kernel_samsung_smdk4412-497f51fc64d0bce7f1a40ebed20b2ba5090777a3.tar.bz2
veth: Enforce minimum size of VETH_INFO_PEER
[ Upstream commit 237114384ab22c174ec4641e809f8e6cbcfce774 ] VETH_INFO_PEER carries struct ifinfomsg plus optional IFLA attributes. A minimal size of sizeof(struct ifinfomsg) must be enforced or we may risk accessing that struct beyond the limits of the netlink message. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r--drivers/net/veth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 4bf7c6d..6c0a3b0 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -421,7 +421,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
unregister_netdevice_queue(peer, head);
}
-static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
+static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = {
+ [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) },
+};
static struct rtnl_link_ops veth_link_ops = {
.kind = DRV_NAME,