]> granicus.if.org Git - ipset/commit
netfilter: ipset: add resched points during set listing
authorFlorian Westphal <fw@strlen.de>
Thu, 4 Jan 2018 12:24:44 +0000 (13:24 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 4 Jan 2018 12:24:44 +0000 (13:24 +0100)
commit56004fb77322d454e72187394a1f17e457cb3e04
tree6a462cda469e73ad5f7cd95f8e839f3358f947da
parentad92ed77e77fe421a86f0fde907c51286ed47928
netfilter: ipset: add resched points during set listing

When sets are extremely large we can get softlockup during ipset -L.
We could fix this by adding cond_resched_rcu() at the right location
during iteration, but this only works if RCU nesting depth is 1.

At this time entire variant->list() is called under under rcu_read_lock_bh.
This used to be a read_lock_bh() but as rcu doesn't really lock anything,
it does not appear to be needed, so remove it (ipset increments set
reference count before this, so a set deletion should not be possible).

Reported-by: Li Shuang <shuali@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
kernel/net/netfilter/ipset/ip_set_bitmap_gen.h
kernel/net/netfilter/ipset/ip_set_core.c
kernel/net/netfilter/ipset/ip_set_hash_gen.h