Skip to content

Commit

Permalink
net: rtnl: info leak in rtnl_fill_vfinfo()
Browse files Browse the repository at this point in the history
The "vf_vlan_info" struct ends with a 2 byte struct hole so we have to
memset it to ensure that no stack information is revealed to user space.

Fixes: 79aab09 ('net: Update API for VF vlan protocol 802.1ad support')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Oct 13, 2016
1 parent 7307616 commit 775f4f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,8 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
if (dev->netdev_ops->ndo_get_vf_config(dev, vfs_num, &ivi))
return 0;

memset(&vf_vlan_info, 0, sizeof(vf_vlan_info));

vf_mac.vf =
vf_vlan.vf =
vf_vlan_info.vf =
Expand Down

0 comments on commit 775f4f0

Please sign in to comment.