Skip to contentSkip to conversation

Patch "net: vrf: Reset rt6i_idev in local dst after put" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Mar 27, 2017

Subsystems (3)
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: vrf: Reset rt6i_idev in local dst after put

to the 4.10-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-vrf-reset-rt6i_idev-in-local-dst-after-put.patch
and it can be found in the queue-4.10 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 Mon Mar 27 18:18:08 CEST 2017

From: David Ahern <[email protected]>
Date: Fri, 17 Mar 2017 16:07:11 -0700
Subject: net: vrf: Reset rt6i_idev in local dst after put

From: David Ahern <[email protected]>

[ Upstream commit 3dc857f0e8fc22610a59cbb346ba62c6e921863f ]

The VRF driver takes a reference to the inet6_dev on the VRF device for its rt6_local dst when handling local traffic through the VRF device as a loopback. When the device is deleted the driver does a put on the idev but does not reset rt6i_idev in the rt6_info struct. When the dst is destroyed, dst_destroy calls ip6_dst_destroy which does a second put for what is essentially the same reference causing it to be prematurely freed. Reset rt6i_idev after the put in the vrf driver.

Fixes b4869aa2f881e ("net: vrf: ipv6 support for local traffic to

local addresses")

---
 drivers/net/vrf.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/vrf.c +3 -1
@@ -462,8 +462,10 @@ static void vrf_rt6_release(struct net_d
 	}
 
 	if (rt6_local) {
-		if (rt6_local->rt6i_idev)
+		if (rt6_local->rt6i_idev) {
 			in6_dev_put(rt6_local->rt6i_idev);
+			rt6_local->rt6i_idev = NULL;
+		}
 
 		dst = &rt6_local->dst;
 		dev_put(dst->dev);

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

queue-4.10/net-vrf-reset-rt6i_idev-in-local-dst-after-put.patch