diff mbox series

[SRU,Jammy,OEM-6.1,Lunar,Mantic,1/1] netfilter: nf_tables: skip set commit for deleted/destroyed sets

Message ID 20240104194250.1880571-2-cascardo@canonical.com
State New
Headers show
Series CVE-2024-0193 | expand

Commit Message

Thadeu Lima de Souza Cascardo Jan. 4, 2024, 7:42 p.m. UTC
From: Pablo Neira Ayuso <pablo@netfilter.org>

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>
(cherry picked from commit 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a netfilter/nf.git)
CVE-2024-0193
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 315172b299fa..2b068f7b8cbc 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -9831,7 +9831,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);