]> Pileus Git - ~andy/linux/blobdiff - net/ipv6/ip6_flowlabel.c
ipv6: protect for_each_sk_fl_rcu in mem_check with rcu_read_lock_bh
[~andy/linux] / net / ipv6 / ip6_flowlabel.c
index 98fdcc6f51b149d4f6019f25ab865f954c93d405..e7fb7106550f1d0c45bfa59b341681175be588b2 100644 (file)
@@ -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 ||