Skip to contentSkip to conversation

netfilter: nfnetlink_cthelper: cap to maximum number of expectation per master on updates

PATCH New Pablo Neira Ayuso 1 participant 1 message Jul 1

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nfnetlink_cthelper: cap to maximum number of expectation per master on updates

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")
---
 net/netfilter/nfnetlink_cthelper.c | 2 ++
 1 file changed, 2 insertions(+)
net/netfilter/nfnetlink_cthelper.c +2 -0
index f1460b683d7a..c71966ca9955 100644
@@ -314,6 +314,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;
 
Signature · 1 line
2.47.3