Commit 775f4f05 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

net: rtnl: info leak in rtnl_fill_vfinfo()

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: 79aab093 ('net: Update API for VF vlan protocol 802.1ad support')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73076162
...@@ -1144,6 +1144,8 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb, ...@@ -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)) if (dev->netdev_ops->ndo_get_vf_config(dev, vfs_num, &ivi))
return 0; return 0;
memset(&vf_vlan_info, 0, sizeof(vf_vlan_info));
vf_mac.vf = vf_mac.vf =
vf_vlan.vf = vf_vlan.vf =
vf_vlan_info.vf = vf_vlan_info.vf =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment