Skip to content

Commit 2aef1b1

Browse files
Li Xiasonggregkh
authored andcommitted
netfilter: nft_ct: fix missing expect put in obj eval
commit 19f94b6 upstream. nft_ct_expect_obj_eval() allocates an expectation and may call nf_ct_expect_related(), but never drops its local reference. Add nf_ct_expect_put(exp) before return to balance allocation. Fixes: 857b460 ("netfilter: nft_ct: add ct expectations support") Cc: stable@vger.kernel.org Signed-off-by: Li Xiasong <lixiasong1@huawei.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 81aec88 commit 2aef1b1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/netfilter/nft_ct.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,8 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
13631363

13641364
if (nf_ct_expect_related(exp, 0) != 0)
13651365
regs->verdict.code = NF_DROP;
1366+
1367+
nf_ct_expect_put(exp);
13661368
}
13671369

13681370
static const struct nla_policy nft_ct_expect_policy[NFTA_CT_EXPECT_MAX + 1] = {

0 commit comments

Comments
 (0)