diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-06-15 00:20:18 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-06-20 23:43:42 +0300 |
commit | 043d2acf57227db1fdaaa620b2a420acfaa56d6e (patch) | |
tree | 62781bcd3cced3a546cde2fca0924afeb3eb4969 /net/netfilter | |
parent | e26d3009efda338f19016df4175f354a9bd0a4ab (diff) | |
download | linux-043d2acf57227db1fdaaa620b2a420acfaa56d6e.tar.xz |
netfilter: nf_tables: drop module reference after updating chain
Otherwise the module reference counter is leaked.
Fixes b9703ed44ffb ("netfilter: nf_tables: support for adding new devices to an existing netdev chain")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0d293eab310b..c1db2f4b2aa4 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -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); |