Skip to contentSkip to conversation

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

PATCH New Pablo Neira Ayuso 1 participant 1 message Jun 26

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

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")

---
reported by sashiko in the last PR.

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