From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 997BA3E1713; Tue, 30 Jun 2026 04:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782795216; cv=none; b=UxGetSmZKpk4971HUZZDF0pDBzYVC0lh4vApvbnEY3OUwZG++fEIoDVmdIFtrFN2DhTbycxl2tIOhcNh/a5cWV6F7RefwfqaWezm1ae3qKOso3KSb+uAWry3xVFSADglQaJO8irGSPrOM1ORRTJQnKaHvPoZz6AxX79Qkc0FRlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782795216; c=relaxed/simple; bh=pZLjoefpfTg6pOCJ9kYrVSGsXvqoWWnmOxFkw1P6aZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ROA5oVjPxy6Y6XLJ8vtjFvO1PucXM1oeb6C0h/TAvGzoZBhuwp38OLoi1gw7NES565K4Xj7EI4dfvdeOWnUxMj3fLY1BlUywuiGwPFHAUArCrLgQRCzlVdW4+R3vQPnYc466QJExHpozaSnrLUlV8PAkSjdyd74KfcA+Yqj6Hvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc; arc=none smtp.client-ip=91.216.245.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id 652006032C; Tue, 30 Jun 2026 06:53:34 +0200 (CEST) From: Florian Westphal To: Cc: Paolo Abeni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , , pablo@netfilter.org Subject: [PATCH net 5/9] netfilter: nfnetlink_cthelper: cap to maximum number of expectation per master Date: Tue, 30 Jun 2026 06:52:39 +0200 Message-ID: <20260630045243.2657-6-fw@strlen.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260630045243.2657-1-fw@strlen.de> References: <20260630045243.2657-1-fw@strlen.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Pablo Neira Ayuso 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 Signed-off-by: Florian Westphal --- net/netfilter/nfnetlink_cthelper.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.53.0