[PATCH nf 0/5] netfilter: ipset fixes and rhastable prep work

Florian Westphal <[email protected]> Thu, 30 Jul 2026 20:38:48 +0200
Newsgroups gmane.comp.security.firewalls.netfilter.devel
Message-ID <[email protected]>
This series contains a few fixes and prepation work for the
ipset rhashtable conversion.  The rhashtable conversion patch set is
too large to post in one pile and has one external dependency that is not
yet in nf (queued in crypto tree).

I discussed this with Jozsef and we think that targeting the rhashtable
conversion to nf tree is preferrable to nf-next due to the volume of LLM
reports.

1) Rework ipset CIDR bookkeeping with an RCU-based method to ensure
safety on weakly-ordered architectures. Replace in-place updates with
structure replacement. From Jozsef Kadlecsik.

2) Switch ext_size to atomic64_t in ipset to prevent races during parallel
updates.  Also from Jozsef.

3) Add small wrappers for hash and bucket sizes in netfilter ipset. Prepare
for rhashtable conversion.

4) Add and use mtype_del_cidr_all helper in netfilter ipset. Reduce size of
upcoming rhashtable conversion.

5) Switch ipset destruction to use RCU work. Fix a bug where rhashtable
destruction triggered a sleeping function. Enable future decoupling of set
destruction and GC work.

Florian Westphal (3):
  netfilter: ipset: add small wrappers for hash and bucket sizes
  netfilter: ipset: add and use mtype_del_cidr_all helper
  netfilter: ipset: switch to rcu work

Jozsef Kadlecsik (2):
  netfilter: ipset: rework cidr bookkeeping
  netfilter: ipset: switch ext_size to atomic64_t

 include/linux/netfilter/ipset/ip_set.h       |   6 +-
 net/netfilter/ipset/ip_set_bitmap_gen.h      |   4 +-
 net/netfilter/ipset/ip_set_core.c            |  52 ++--
 net/netfilter/ipset/ip_set_hash_gen.h        | 304 +++++++++++++------
 net/netfilter/ipset/ip_set_hash_ipportnet.c  |   4 +-
 net/netfilter/ipset/ip_set_hash_net.c        |   4 +-
 net/netfilter/ipset/ip_set_hash_netiface.c   |   4 +-
 net/netfilter/ipset/ip_set_hash_netnet.c     |  12 +-
 net/netfilter/ipset/ip_set_hash_netport.c    |   4 +-
 net/netfilter/ipset/ip_set_hash_netportnet.c |  12 +-
 net/netfilter/ipset/ip_set_list_set.c        |   4 +-
 11 files changed, 266 insertions(+), 144 deletions(-)

-- 
2.54.0