]> granicus.if.org Git - ipset/commitdiff
Missing rcu_read_lock() and _unlock() in mtype_list() fixed
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 6 Jan 2015 07:32:28 +0000 (08:32 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 6 Jan 2015 07:32:28 +0000 (08:32 +0100)
kernel/net/netfilter/ipset/ip_set_hash_gen.h

index 5617dbbb550d180b35078dfa00b2cdc751dbd972..9570dee7f18202ddf572ee4ca6214005c9d0ad54 100644 (file)
@@ -1100,6 +1100,8 @@ mtype_list(const struct ip_set *set,
 
        pr_debug("list hash set %s\n", set->name);
        t = (const struct htable *) cb->args[IPSET_CB_PRIVATE];
+       /* Expire may replace a hbucket with another one */
+       rcu_read_lock();
        for (; cb->args[IPSET_CB_ARG0] < jhash_size(t->htable_bits);
             cb->args[IPSET_CB_ARG0]++) {
                incomplete = skb_tail_pointer(skb);
@@ -1150,6 +1152,7 @@ nla_put_failure:
                ipset_nest_end(skb, atd);
        }
 out:
+       rcu_read_unlock();
        return ret;
 }