netfilter: nf_tables: skip set commit for deleted/destroyed sets
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 19 Dec 2023 18:44:49 +0000 (19:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:19:44 +0000 (15:19 +0100)
commitb7f1c01b55ad2a5da12f08e5ec3c76dabb99882a
tree0048515eba43bb2b1941ed6c6a5dfe865a30cdb1
parente904e81fd3c2cbe322779b36d12c039a9c7b19af
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.

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>
net/netfilter/nf_tables_api.c