diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2026-06-26 13:40:42 +0200 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2026-06-30 06:37:12 +0200 |
| commit | bf5355cfdede3e30b30e63a5a74f6bdaafb26082 (patch) | |
| tree | d1434b641e73960ac8e981cfd23ef516944c6d87 | |
| parent | e5e24a365a5e024efef63cc49abb345fbd4852c5 (diff) | |
netfilter: nfnetlink_cthelper: cap to maximum number of expectation per master
If userspace helper policy updates sets maximum number of expectation to
zero, cap it to NF_CT_EXPECT_MAX_CNT (255) on updates too.
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>
| -rw-r--r-- | net/netfilter/nfnetlink_cthelper.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index f1460b683d7a..2cbcca9110db 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -163,6 +163,8 @@ nfnl_cthelper_expect_policy(struct nf_conntrack_expect_policy *expect_policy, tb[NFCTH_POLICY_NAME], NF_CT_HELPER_NAME_LEN); expect_policy->max_expected = ntohl(nla_get_be32(tb[NFCTH_POLICY_EXPECT_MAX])); + if (!expect_policy->max_expected) + expect_policy->max_expected = NF_CT_EXPECT_MAX_CNT; if (expect_policy->max_expected > NF_CT_EXPECT_MAX_CNT) return -EINVAL; |
