diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2013-11-08 13:26:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-11 01:25:28 -0500 |
commit | f8c31c8f80dd882f7eb49276989a4078d33d67a7 (patch) | |
tree | cbbd640b1bd677ad0ef7d38bc826ac96e0d0633a /net/ipv6/ip6_flowlabel.c | |
parent | e267cb960ab790c94a5019272c0e4dac95dc4dba (diff) |
ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh
Fixes a suspicious rcu derference warning.
Cc: Florent Fourcot <florent.fourcot@enst-bretagne.fr>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_flowlabel.c')
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
457 | if (room > FL_MAX_SIZE - FL_MAX_PER_SOCK) | 457 | if (room > FL_MAX_SIZE - FL_MAX_PER_SOCK) |
458 | return 0; | 458 | return 0; |
459 | 459 | ||
460 | rcu_read_lock_bh(); | ||
460 | for_each_sk_fl_rcu(np, sfl) | 461 | for_each_sk_fl_rcu(np, sfl) |
461 | count++; | 462 | count++; |
463 | rcu_read_unlock_bh(); | ||
462 | 464 | ||
463 | if (room <= 0 || | 465 | if (room <= 0 || |
464 | ((count >= FL_MAX_PER_SOCK || | 466 | ((count >= FL_MAX_PER_SOCK || |