Skip to contentSkip to conversation

Patch "net: fix a race in dst_release()" has been added to the 4.2-stable tree

PATCH [email protected] 1 participant 1 message Nov 17, 2015

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: fix a race in dst_release()

to the 4.2-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-fix-a-race-in-dst_release.patch
and it can be found in the queue-4.2 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 Tue Nov 17 14:34:38 PST 2015

From: Eric Dumazet <[email protected]>
Date: Mon, 9 Nov 2015 17:51:23 -0800
Subject: net: fix a race in dst_release()

From: Eric Dumazet <[email protected]>

[ Upstream commit d69bbf88c8d0b367cf3e3a052f6daadf630ee566 ]

Only cpu seeing dst refcount going to 0 can safely dereference dst->flags.

Otherwise an other cpu might already have freed the dst.

Fixes 27b75c95f10d ("net: avoid RCU for NOCACHE dst")
---
 net/core/dst.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dst.c +1 -1
@@ -287,7 +287,7 @@ void dst_release(struct dst_entry *dst)
 		if (unlikely(newrefcnt < 0))
 			net_warn_ratelimited("%s: dst:%p refcnt:%d\n",
 					     __func__, dst, newrefcnt);
-		if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
+		if (!newrefcnt && unlikely(dst->flags & DST_NOCACHE))
 			call_rcu(&dst->rcu_head, dst_destroy_rcu);
 	}
 }

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

queue-4.2/ipv6-gre-support-sit-encapsulation.patch queue-4.2/ipmr-fix-possible-race-resulting-from-improper-usage-of-ip_inc_stats_bh-in-preemptible-context.patch queue-4.2/net-avoid-null-deref-in-inet_ctl_sock_destroy.patch queue-4.2/net-fix-a-race-in-dst_release.patch queue-4.2/sit-fix-sit0-percpu-double-allocations.patch