summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2023-12-19 19:44:49 +0100
committerLee Jones <joneslee@google.com>2024-01-09 14:57:44 +0000
commitdfa6393ce089bdcad040a809817805c0ca47c8dc (patch)
tree40a145c3d260633f3483e3a1d408a5692146b60c
parent04b9052b04532c5f01ad731fdb73b846aedbc912 (diff)
downloadcommon-dfa6393ce089bdcad040a809817805c0ca47c8dc.tar.gz
UPSTREAM: netfilter: nf_tables: skip set commit for deleted/destroyed sets
commit 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a upstream. 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. Bug: 318548348 Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Reported-by: Kevin Rich <kevinrich1337@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 0105571f80edb96f81bb4bbdd5233a9130dc345b) Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: Ie733688e27d9568d797fc1bc477261883b7dc8c1
-rw-r--r--net/netfilter/nf_tables_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 78b268bd7f01..1bfdf34ef778 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -8360,7 +8360,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);