Skip to content

Commit 04f10f1

Browse files
committed
netfilter: nf_tables: discard table flag update with pending basechain 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]>
1 parent 9fe6c5a commit 04f10f1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/netfilter/nf_tables_api.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,11 @@ static bool nft_table_pending_update(const struct nft_ctx *ctx)
962962
return true;
963963

964964
list_for_each_entry(trans, &ctx->net->nft.commit_list, list) {
965-
if ((trans->msg_type == NFT_MSG_NEWCHAIN ||
966-
trans->msg_type == NFT_MSG_DELCHAIN) &&
967-
trans->ctx.table == ctx->table &&
968-
nft_trans_chain_update(trans))
965+
if (trans->ctx.table == ctx->table &&
966+
((trans->msg_type == NFT_MSG_NEWCHAIN &&
967+
nft_trans_chain_update(trans)) ||
968+
(trans->msg_type == NFT_MSG_DELCHAIN &&
969+
nft_is_base_chain(trans->ctx.chain))))
969970
return true;
970971
}
971972

0 commit comments

Comments
 (0)