diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-02-14 23:09:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-15 14:59:20 -0500 |
commit | 237114384ab22c174ec4641e809f8e6cbcfce774 (patch) | |
tree | 9571ac28f82724a140367ad754b4946a889f2b70 /drivers/net | |
parent | 78a5249fc9dc0f8c70221751dc79b6d918e5ee9a (diff) |
veth: Enforce minimum size of VETH_INFO_PEER
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/veth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 49f4667e1fa3..4a3402898f2a 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -422,7 +422,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head) | |||
422 | unregister_netdevice_queue(peer, head); | 422 | unregister_netdevice_queue(peer, head); |
423 | } | 423 | } |
424 | 424 | ||
425 | static const struct nla_policy veth_policy[VETH_INFO_MAX + 1]; | 425 | static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = { |
426 | [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) }, | ||
427 | }; | ||
426 | 428 | ||
427 | static struct rtnl_link_ops veth_link_ops = { | 429 | static struct rtnl_link_ops veth_link_ops = { |
428 | .kind = DRV_NAME, | 430 | .kind = DRV_NAME, |