mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
netfilter: nf_tables: possible module reference underflow in error path
dst->ops is set on when nft_expr_clone() fails, but module refcount has
not been bumped yet, therefore nft_expr_destroy() leads to module
reference underflow.
Fixes: 8cfd9b0f85
("netfilter: nftables: generalize set expressions support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
4963674c2e
commit
c485c35ff6
@ -5601,7 +5601,7 @@ int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,
|
||||
|
||||
err = nft_expr_clone(expr, set->exprs[i]);
|
||||
if (err < 0) {
|
||||
nft_expr_destroy(ctx, expr);
|
||||
kfree(expr);
|
||||
goto err_expr;
|
||||
}
|
||||
expr_array[i] = expr;
|
||||
|
Loading…
Reference in New Issue
Block a user