Skip to contentSkip to conversation

netfilter: nf_tables: remove leftover set_update_list

PATCH New Pablo Neira Ayuso 1 participant 2 messages Aug 21

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/2 netfilter: nf_tables: remove leftover set_update_list

This list has been moved to per-netns, remove onstack list which is not used anymore.

Fixes b343ededb3f9 netfilter: nf_tables: move set_update_list to nftables per-netns
---
 net/netfilter/nf_tables_api.c | 1 -
 1 file changed, 1 deletion(-)
net/netfilter/nf_tables_api.c +0 -1
index 20c562174b27..f89605e68ba1 100644
@@ -11291,7 +11291,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
 {
 	struct nftables_pernet *nft_net = nft_pernet(net);
 	struct nft_trans *trans, *next;
-	LIST_HEAD(set_update_list);
 	struct nft_trans_elem *te;
 	struct nft_ctx ctx = {
 		.net = net,
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH 2/2 netfilter: nf_tables: set on dead bit when performing early element removal

.commit call for sets is skipped if set->dead flag is set on, but this flag is set on later in the commit path.

This also reintroduces the bug fixed in commit 7315dc1e122c8 ("netfilter: nf_tables: skip set commit for deleted/destroyed sets").

Fixes 1e3b9e1c77fe ("netfilter: nf_tables: call set ops .commit when building new ruleset blob")
---
 net/netfilter/nf_tables_api.c | 4 ++++
 1 file changed, 4 insertions(+)
net/netfilter/nf_tables_api.c +4 -0
index f89605e68ba1..765a92fa90d6 100644
@@ -10874,6 +10874,10 @@ static void nft_set_commit_update(struct nft_ctx *ctx,
 		nft_ctx_update(ctx, trans);
 
 		switch (trans->msg_type) {
+		case NFT_MSG_DELSET:
+		case NFT_MSG_DESTROYSET:
+			nft_trans_set(trans)->dead = 1;
+			break;
 		case NFT_MSG_DELSETELEM:
 			te = nft_trans_container_elem(trans);
 			if (!te->set->ops->commit)
Signature · 1 line
2.47.3