Skip to content

Commit

Permalink
netfilter: nf_tables: drop module reference after updating chain
Browse files Browse the repository at this point in the history
Otherwise the module reference counter is leaked.

Fixes b9703ed ("netfilter: nf_tables: support for adding new devices to an existing netdev chain")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
ummakynes committed Jun 20, 2023
1 parent e26d300 commit 043d2ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,8 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
nft_trans_basechain(trans) = basechain;
INIT_LIST_HEAD(&nft_trans_chain_hooks(trans));
list_splice(&hook.list, &nft_trans_chain_hooks(trans));
if (nla[NFTA_CHAIN_HOOK])
module_put(hook.type->owner);

nft_trans_commit_list_add_tail(ctx->net, trans);

Expand Down

0 comments on commit 043d2ac

Please sign in to comment.