netfilter: nf_tables: possible module reference underflow in error path
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 9 Aug 2022 15:23:52 +0000 (17:23 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 10 Aug 2022 15:06:05 +0000 (17:06 +0200)
commitc485c35ff6783ccd12c160fcac6a0e504e83e0bf
tree45fa7249eea21ad991362492888fb28a3548c775
parent4963674c2e71fc062f8f089f0f58ffbb5533060b
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: 8cfd9b0f8515 ("netfilter: nftables: generalize set expressions support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c