]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netfilter: nfnetlink_cthelper: cap to maximum number of expectation per master on...
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 1 Jul 2026 10:46:57 +0000 (12:46 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 3 Jul 2026 12:45:21 +0000 (14:45 +0200)
Really cap it to NF_CT_EXPECT_MAX_CNT (255) on updates.

The commit ("netfilter: nfnetlink_cthelper: cap to maximum number of
expectation per master") only covers creation of helpers, not updates.

Fixes: 397c8300972f ("netfilter: nf_conntrack_helper: cap maximum number of expectation at helper registration")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nfnetlink_cthelper.c

index 2cbcca9110dbf50448d6bb205e1fc224521f853c..f062ac21034329c824edfb4eb2d60568752d2cd0 100644 (file)
@@ -316,6 +316,8 @@ nfnl_cthelper_update_policy_one(const struct nf_conntrack_expect_policy *policy,
 
        new_policy->max_expected =
                ntohl(nla_get_be32(tb[NFCTH_POLICY_EXPECT_MAX]));
+       if (!new_policy->max_expected)
+               new_policy->max_expected = NF_CT_EXPECT_MAX_CNT;
        if (new_policy->max_expected > NF_CT_EXPECT_MAX_CNT)
                return -EINVAL;