From nobody Thu Nov 19 17:58:00 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jVmQx1clfz71ZCm for ; Thu, 19 Nov 2026 17:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jVmQw54rhz4V3v for ; Thu, 19 Nov 2026 17:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795111080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CSzrvc2q8jSsM6GAg2W0GstXcrBiFQmTVZ3M86YmLv0=; b=F4XsCu4GcQnDMe/9aEShbXCH/Q9NcG7xMjq18F8jXcb/5NNPwYl+34T462UU/3nxbQpNrR mJD9MKynwgVvRhgyxEQmkJxpceHzleJO0vK3zF7+0Oojt0iwyS6Zq+A+FQ+RQebmnyqKXx J2WNzWL5jOivVrx4KofEX0W9+UU6kljXUCNDPRK4pM2dfv46NrNxsdJd2DouPOIBefzP7T leqJLl9MfrYG8umVkpXb5rDTl2mhsrVjZkabTJ/HQSmIDz3a9hzdJoAnweEwTci6J9KOnD ZHrkCEPP1l7n29dBIrHtqSDsy62a/y+XtW+sGPIJmxZZO25aGEUCCyrYnrbskQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795111080; b=ss8ZoBUkoei6YnfZAPs84R82CoYoPvX7oTzEv/r8y4hQbrdJixsgkwkNbyrGFO0xMWhSxa Vn4OEBIcK4mQ3IvCTSuy1axmxroVQBjVTjdbB+22beNu2cEW4q2+prGqJOz5F3NJty/pmi sy8HcweG/JiUby5PtB8tl8BzUCRMP7dgxTV0HSzZ2V3zbIwTikPwKBp32HNYpiqk+FnZBd ojZ3Rda010C4+MUJ1yfvVpEHZo7p3nJlgvbHzjJO85RGfLCxP/C5bxccapTtee4ES12GsT S10TUz4eDHqr2UBtPjnJ/ActYLVmgfUYwru6C/a6GaM38GiGfb7cEQwwt60zdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795111080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CSzrvc2q8jSsM6GAg2W0GstXcrBiFQmTVZ3M86YmLv0=; b=U9ih43vf2efi9F7uiVTrKDaAsKQRvu2LB0/XciOmTZmWJ+ADZwv0C0JENvW0DxDy7nKwzu u/K/FIb2bI+GEYT/Nix5Oexl8gz0vNb2JrcL1L9+t6vquF+VXhI84f7zamjt1Ya8YjbrIw nsNB3HsnEtawHxD0PwfkbocApj/Zfz2F2kup76FvXMzidw1LXeJ5IQYQoES+ILE7QvTofj 50NHc5WxKiFcFATINFLv3BkYFMfpJtUPA6lc9pAFO7k65zXBk7wNusfcLFiWMcnjQy2NAK xzvWixc2CsxMuUoDUPpIzIu4d0QxNT3WPkfapqgbdpy5aNBvo/cMTTGoXs1oog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jVmQw4lvhz1B78 for ; Thu, 19 Nov 2026 17:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1b1e0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 19 Nov 2026 17:58:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 8364b6bc0c36 - main - ipfw: fix off-by-one in the IP_FW_XADD rule count check List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8364b6bc0c36ab66f71cb2b3e00479326132c80f Auto-Submitted: auto-generated Date: Thu, 19 Nov 2026 17:58:00 +0000 Message-Id: <6aff38a8.1b1e0.20cefa8d@gitrepo.freebsd.org> The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=8364b6bc0c36ab66f71cb2b3e00479326132c80f commit 8364b6bc0c36ab66f71cb2b3e00479326132c80f Author: Maxim Konovalov AuthorDate: 2026-11-17 02:22:18 +0000 Commit: Maxim Konovalov CommitDate: 2026-11-19 17:57:21 +0000 ipfw: fix off-by-one in the IP_FW_XADD rule count check Restore the pre-4a77657cbc0 ">=" comparison, otherwise parse_rules_v1() writes one rule_check_info beyond the allocated buffer. Do the same in ip_fw_compat.c, which has a copy of the loop but is not built at the moment. stable/14 is not affected. Reviewed by: ae Fixes: 4a77657cbc0 ("ipfw: migrate ipfw to 32-bit size rule numbers") MFC after: 1 week MFC to: stable/15 Found with: Claude Code Opus 5.5 Differential Revision: https://reviews.freebsd.org/D61727 --- sys/netpfil/ipfw/ip_fw_compat.c | 2 +- sys/netpfil/ipfw/ip_fw_sockopt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_compat.c b/sys/netpfil/ipfw/ip_fw_compat.c index 590159411509..3f4ed9411be7 100644 --- a/sys/netpfil/ipfw/ip_fw_compat.c +++ b/sys/netpfil/ipfw/ip_fw_compat.c @@ -309,7 +309,7 @@ parse_rules_v0(struct ip_fw_chain *chain, ip_fw3_opheader *op3, r = (struct ip_fw_rule *)(ctlv + 1); while (clen > 0) { rsize = RULEUSIZE1(r); - if (rsize > clen || count > ctlv->count) { + if (rsize > clen || count >= ctlv->count) { error = EINVAL; break; } diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c index a5892bb387e5..458e8ba9cc30 100644 --- a/sys/netpfil/ipfw/ip_fw_sockopt.c +++ b/sys/netpfil/ipfw/ip_fw_sockopt.c @@ -2424,7 +2424,7 @@ parse_rules_v1(struct ip_fw_chain *chain, ip_fw3_opheader *op3, r = (struct ip_fw_rule *)(ctlv + 1); while (clen > 0) { rsize = RULEUSIZE1(r); - if (rsize > clen || count > ctlv->count) { + if (rsize > clen || count >= ctlv->count) { error = EINVAL; break; }