Skip to content

Commit 043d2ac

Browse files
committed
netfilter: nf_tables: drop module reference after updating chain
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]>
1 parent e26d300 commit 043d2ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,6 +2667,8 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
26672667
nft_trans_basechain(trans) = basechain;
26682668
INIT_LIST_HEAD(&nft_trans_chain_hooks(trans));
26692669
list_splice(&hook.list, &nft_trans_chain_hooks(trans));
2670+
if (nla[NFTA_CHAIN_HOOK])
2671+
module_put(hook.type->owner);
26702672

26712673
nft_trans_commit_list_add_tail(ctx->net, trans);
26722674

0 commit comments

Comments
 (0)