From: Jozsef Kadlecsik Date: Tue, 6 Jan 2015 07:32:28 +0000 (+0100) Subject: Missing rcu_read_lock() and _unlock() in mtype_list() fixed X-Git-Tag: pablo~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f75e3aac454ba977822a675acff21aa88608baa;p=ipset Missing rcu_read_lock() and _unlock() in mtype_list() fixed --- diff --git a/kernel/net/netfilter/ipset/ip_set_hash_gen.h b/kernel/net/netfilter/ipset/ip_set_hash_gen.h index 5617dbb..9570dee 100644 --- a/kernel/net/netfilter/ipset/ip_set_hash_gen.h +++ b/kernel/net/netfilter/ipset/ip_set_hash_gen.h @@ -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; }