Skip to content

Commit

Permalink
netfilter: nf_tables: discard table flag update with pending basechai…
Browse files Browse the repository at this point in the history
…n deletion

jira VULN-5118
cve CVE-2024-35897
commit-author Pablo Neira Ayuso <[email protected]>
commit 1bc83a0

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]>
(cherry picked from commit 1bc83a0)
	Signed-off-by: Greg Rose <[email protected]>
  • Loading branch information
gvrose8192 committed Nov 14, 2024
1 parent 996a58e commit 0c3116e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,11 @@ static bool nft_table_pending_update(const struct nft_ctx *ctx)
return true;

list_for_each_entry(trans, &ctx->net->nft.commit_list, list) {
if ((trans->msg_type == NFT_MSG_NEWCHAIN ||
trans->msg_type == NFT_MSG_DELCHAIN) &&
trans->ctx.table == ctx->table &&
nft_trans_chain_update(trans))
if (trans->ctx.table == ctx->table &&
((trans->msg_type == NFT_MSG_NEWCHAIN &&
nft_trans_chain_update(trans)) ||
(trans->msg_type == NFT_MSG_DELCHAIN &&
nft_is_base_chain(trans->ctx.chain))))
return true;
}

Expand Down

0 comments on commit 0c3116e

Please sign in to comment.