Skip to content

Commit 2f0513d

Browse files
sveyretummakynes
authored andcommitted
netfilter: nft_ct: fix null pointer in ct expectations support
nf_ct_helper_ext_add may return null, which must then be checked. Fixes: 857b460 ("netfilter: nft_ct: add ct expectations support") Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Stéphane Veyret <sveyret@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 72c5e11 commit 2f0513d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎net/netfilter/nft_ct.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,10 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
12321232
help = nfct_help(ct);
12331233
if (!help)
12341234
help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
1235+
if (!help) {
1236+
regs->verdict.code = NF_DROP;
1237+
return;
1238+
}
12351239

12361240
if (help->expecting[NF_CT_EXPECT_CLASS_DEFAULT] >= priv->size) {
12371241
regs->verdict.code = NFT_BREAK;

0 commit comments

Comments
 (0)