Skip to contentSkip to conversation

net: rtnl: info leak in rtnl_fill_vfinfo()

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 13, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 79aab093a0b5 ('net: Update API for VF vlan protocol 802.1ad support')
net/core/rtnetlink.c +2 -0
index b06d2f4..fb7348f 100644
@@ -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 
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Thu, 13 Oct 2016 11:45:28 +0300

Quoted 5 lines

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 79aab093a0b5 ('net: Update API for VF vlan protocol 802.1ad support')

Applied, thanks Dan.