Skip to contentSkip to conversation

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

PATCH [email protected] 1 participant 1 message Dec 6, 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 3.14-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-3.14 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 Sat Dec 5 21:06:41 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
@@ -283,7 +283,7 @@ void dst_release(struct dst_entry *dst)
 
 		newrefcnt = atomic_dec_return(&dst->__refcnt);
 		WARN_ON(newrefcnt < 0);
-		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-3.14/ipmr-fix-possible-race-resulting-from-improper-usage-of-ip_inc_stats_bh-in-preemptible-context.patch queue-3.14/net-avoid-null-deref-in-inet_ctl_sock_destroy.patch queue-3.14/net-fix-a-race-in-dst_release.patch