From: Hannes Frederic Sowa Date: Fri, 8 Nov 2013 18:26:21 +0000 (+0100) Subject: ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8c31c8f80dd882f7eb49276989a4078d33d67a7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh Fixes a suspicious rcu derference warning. Cc: Florent Fourcot Signed-off-by: Hannes Frederic Sowa Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 98fdcc6f51b1..e7fb7106550f 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c @@ -457,8 +457,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 ||