mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
netfilter: nf_tables: mark set as dead when unbinding anonymous set with timeout
commit552705a365
upstream. While the rhashtable set gc runs asynchronously, a race allows it to collect elements from anonymous sets with timeouts while it is being released from the commit path. Mingi Cho originally reported this issue in a different path in 6.1.x with a pipapo set with low timeouts which is not possible upstream since7395dfacff
("netfilter: nf_tables: use timestamp to check for set element timeout"). Fix this by setting on the dead flag for anonymous sets to skip async gc in this case. According to08e4c8c591
("netfilter: nf_tables: mark newset as dead on transaction abort"), Florian plans to accelerate abort path by releasing objects via workqueue, therefore, this sets on the dead flag for abort path too. Cc: stable@vger.kernel.org Fixes:5f68718b34
("netfilter: nf_tables: GC transaction API to avoid race with control plane") Reported-by: Mingi Cho <mgcho.minic@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f381224482
commit
291cca3581
1 changed files with 1 additions and 0 deletions
|
@ -5062,6 +5062,7 @@ static void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set,
|
||||||
|
|
||||||
if (list_empty(&set->bindings) && nft_set_is_anonymous(set)) {
|
if (list_empty(&set->bindings) && nft_set_is_anonymous(set)) {
|
||||||
list_del_rcu(&set->list);
|
list_del_rcu(&set->list);
|
||||||
|
set->dead = 1;
|
||||||
if (event)
|
if (event)
|
||||||
nf_tables_set_notify(ctx, set, NFT_MSG_DELSET,
|
nf_tables_set_notify(ctx, set, NFT_MSG_DELSET,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in a new issue