Commit 2f0513d4 authored by Stéphane Veyret's avatar Stéphane Veyret Committed by Pablo Neira Ayuso

netfilter: nft_ct: fix null pointer in ct expectations support

nf_ct_helper_ext_add may return null, which must then be checked.

Fixes: 857b4602 ("netfilter: nft_ct: add ct expectations support")
Reported-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarStéphane Veyret <sveyret@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 72c5e118
......@@ -1232,6 +1232,10 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
help = nfct_help(ct);
if (!help)
help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
if (!help) {
regs->verdict.code = NF_DROP;
return;
}
if (help->expecting[NF_CT_EXPECT_CLASS_DEFAULT] >= priv->size) {
regs->verdict.code = NFT_BREAK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment