]> git.ipfire.org Git - thirdparty/linux.git/commit
netfilter: nf_tables: adapt set backend to use GC transaction API
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Aug 2023 12:54:23 +0000 (14:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 10 Aug 2023 06:25:27 +0000 (08:25 +0200)
commitf6c383b8c31a93752a52697f8430a71dcbc46adf
treec492c243f84ad2a7363eac614bd6b02057cd9c1b
parent5f68718b34a531a556f2f50300ead2862278da26
netfilter: nf_tables: adapt set backend to use GC transaction API

Use the GC transaction API to replace the old and buggy gc API and the
busy mark approach.

No set elements are removed from async garbage collection anymore,
instead the _DEAD bit is set on so the set element is not visible from
lookup path anymore. Async GC enqueues transaction work that might be
aborted and retried later.

rbtree and pipapo set backends does not set on the _DEAD bit from the
sync GC path since this runs in control plane path where mutex is held.
In this case, set elements are deactivated, removed and then released
via RCU callback, sync GC never fails.

Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges")
Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support")
Fixes: 9d0982927e79 ("netfilter: nft_hash: add support for timeouts")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c
net/netfilter/nft_set_hash.c
net/netfilter/nft_set_pipapo.c
net/netfilter/nft_set_rbtree.c