[3.11.y.z extended stable] Patch "ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed Dec 11 14:39:18 UTC 2013


This is a note to let you know that I have just added a patch titled

    ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From ed9b61d2b08dc93d38bbd92137f5d0648d9a3fbb Mon Sep 17 00:00:00 2001
From: Hannes Frederic Sowa <hannes at stressinduktion.org>
Date: Fri, 8 Nov 2013 19:26:21 +0100
Subject: ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh

commit f8c31c8f80dd882f7eb49276989a4078d33d67a7 upstream.

Fixes a suspicious rcu derference warning.

Cc: Florent Fourcot <florent.fourcot at enst-bretagne.fr>
Signed-off-by: Hannes Frederic Sowa <hannes at stressinduktion.org>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 net/ipv6/ip6_flowlabel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 46e8843..f0ccdb7 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -453,8 +453,10 @@ static int mem_check(struct sock *sk)
 	if (room > FL_MAX_SIZE - FL_MAX_PER_SOCK)
 		return 0;

+	rcu_read_lock_bh();
 	for_each_sk_fl_rcu(np, sfl)
 		count++;
+	rcu_read_unlock_bh();

 	if (room <= 0 ||
 	    ((count >= FL_MAX_PER_SOCK ||
--
1.8.3.2





More information about the kernel-team mailing list