Skip to contentSkip to conversation

Patch "net: Zero ifla_vf_info in rtnl_fill_vfinfo()" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message Jun 29, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: Zero ifla_vf_info in rtnl_fill_vfinfo()

to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-zero-ifla_vf_info-in-rtnl_fill_vfinfo.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Jun 29 18:58:00 CEST 2017

From: "Mintz, Yuval" <[email protected]>
Date: Wed, 7 Jun 2017 21:00:33 +0300
Subject: net: Zero ifla_vf_info in rtnl_fill_vfinfo()

From: "Mintz, Yuval" <[email protected]>

[ Upstream commit 0eed9cf58446b28b233388b7f224cbca268b6986 ]

Some of the structure's fields are not initialized by the rtnetlink. If driver doesn't set those in ndo_get_vf_config(), they'd leak memory to user.

---
 net/core/rtnetlink.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/core/rtnetlink.c +2 -1
@@ -1127,6 +1127,8 @@ static noinline_for_stack int rtnl_fill_
 	struct ifla_vf_mac vf_mac;
 	struct ifla_vf_info ivi;
 
+	memset(&ivi, 0, sizeof(ivi));
+
 	/* Not all SR-IOV capable drivers support the
 	 * spoofcheck and "RSS query enable" query.  Preset to
 	 * -1 so the user space tool can detect that the driver
@@ -1135,7 +1137,6 @@ static noinline_for_stack int rtnl_fill_
 	ivi.spoofchk = -1;
 	ivi.rss_query_en = -1;
 	ivi.trusted = -1;
-	memset(ivi.mac, 0, sizeof(ivi.mac));
 	/* The default value for VF link state is "auto"
 	 * IFLA_VF_LINK_STATE_AUTO which equals zero
 	 */

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/net-zero-ifla_vf_info-in-rtnl_fill_vfinfo.patch