From: Pablo Neira Ayuso Date: Tue, 19 Dec 2023 18:44:49 +0000 (+0100) Subject: netfilter: nf_tables: skip set commit for deleted/destroyed sets X-Git-Tag: archive/raspbian/6.1.69-1+rpi1^2~44 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=64dad8ab94487ba541fcc7d6ad56450430735d49;p=linux.git netfilter: nf_tables: skip set commit for deleted/destroyed sets Origin: https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git/commit/?id=7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a NFT_MSG_DELSET deactivates all elements in the set, skip set->ops->commit() to avoid the unnecessary clone (for the pipapo case) as well as the sync GC cycle, which could deactivate again expired elements in such set. Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Reported-by: Kevin Rich Signed-off-by: Pablo Neira Ayuso Gbp-Pq: Topic bugfix/all Gbp-Pq: Name netfilter-nf_tables-skip-set-commit-for-deleted-dest.patch --- diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 05fa5141af5..3d6ebb9877a 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9480,7 +9480,7 @@ static void nft_set_commit_update(struct list_head *set_update_list) list_for_each_entry_safe(set, next, set_update_list, pending_update) { list_del_init(&set->pending_update); - if (!set->ops->commit) + if (!set->ops->commit || set->dead) continue; set->ops->commit(set);