Skip to content

Commit 1bc83a0

Browse files
committed
netfilter: nf_tables: discard table flag update with pending basechain deletion
Hook unregistration is deferred to the commit phase, same occurs with hook updates triggered by the table dormant flag. When both commands are combined, this results in deleting a basechain while leaving its hook still registered in the core. Fixes: 179d9ba ("netfilter: nf_tables: fix table flag updates") Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 2422501 commit 1bc83a0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,10 +1209,11 @@ static bool nft_table_pending_update(const struct nft_ctx *ctx)
12091209
return true;
12101210

12111211
list_for_each_entry(trans, &nft_net->commit_list, list) {
1212-
if ((trans->msg_type == NFT_MSG_NEWCHAIN ||
1213-
trans->msg_type == NFT_MSG_DELCHAIN) &&
1214-
trans->ctx.table == ctx->table &&
1215-
nft_trans_chain_update(trans))
1212+
if (trans->ctx.table == ctx->table &&
1213+
((trans->msg_type == NFT_MSG_NEWCHAIN &&
1214+
nft_trans_chain_update(trans)) ||
1215+
(trans->msg_type == NFT_MSG_DELCHAIN &&
1216+
nft_is_base_chain(trans->ctx.chain))))
12161217
return true;
12171218
}
12181219

0 commit comments

Comments
 (0)