From nobody Fri Jul 4 09:22:34 2025 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 4bYSpM29MDz61GZt; Fri, 04 Jul 2025 09:22:35 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYSpL5STNz3pl6; Fri, 04 Jul 2025 09:22:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751620954; 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=QVUrzGIbQZHZiL9sl0Ko2VJGYaC6lWsB/0sEfyGfyyQ=; b=ILYceHXq/CqhSKsb7kvgqektnKM8nO9BTD25mrSYXxfSjjAHrb6vU0PzrMeYJOe11uCQWr sBDyXntGuKmCRbCe+Y53dUKaHWFa2/FfQjjvYNaJOyGmL4M+DZBev/loEZ+1PiPoxIvpKL vyRv1tTRr5zhX/lpykS3UGgSCokUu4xmLpaAJmLm23bCnHCBjUqNnQsU91RVM4VGGZ7Nxl EAFPBsYYu+SVFGfZRGyvoOINbrBdCEmvJYoHHUdcjPhr9sFEC3aRRSiVgOp6ovPNSKPyGK bOyVrHv48HoCh7YX3jb6QOdWadAJ001hDrCuL/LyIm+pzhhxjz6tAUqKy8rMpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751620954; 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=QVUrzGIbQZHZiL9sl0Ko2VJGYaC6lWsB/0sEfyGfyyQ=; b=wYZm3UMsOrzFMyywriWuDsBVT3c7Tn5NjKsr1kpXu2ehwunfb8hWhvc919i7LVBeb+LP80 nA0sOPEpOIMgawz7DWtihpP2dq5VU90xWfC+vfOE01VKH/jFrC2OT9Tkmgi3TaomFduQQD +aUg11toBecZiuDeOr76yY9niH8IqucS4x2x2PulwRol9jMPOdWHEZFIoYpUfWweCodWuH +sL8HPXpSIeyfVfyLKWcAXTCaOs4hkvENnDE+qtcMEP+rVXXAUGIYEjECgk5b0fMG2mf8j 4EB839dgVsfo6oXlgGKdTrW3W7gecGil+QzX1ECK+oMBxtHYJfrMmYW6Bf43RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751620954; a=rsa-sha256; cv=none; b=ZvUm1a8t5cvmkbremKKjVOMyFHHeP687jHk+ZGGCyuwcGrsH2EqMxpymgtPAHvXChQG7zr 6licxwSCsCc1IPQ66mWTiuU9GnsQ0HajZn6MLw14qZZrFJCCwYdVKGyGDbND95Qr+0gyM8 Fo6061IFLQ+lxoypqjUXz1xFY0nE6TgfAEHhN7gFAoTQdg2A0XXZuKk6MLB3Pel+X6pGnF 4FryssTk1VUjU+TzU+fCj68NGATARygSj+jx7jsjEouV5aF72nkr9YDuECntFcPy+FZhz2 MBzkLnTdpLh8+eBFziBgbZXuuYV/FtBgn84/U69yMktZAYuilj5M0TRKaOcZ5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYSpL53M3zlS1; Fri, 04 Jul 2025 09:22:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5649MYou055643; Fri, 4 Jul 2025 09:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5649MYfC055640; Fri, 4 Jul 2025 09:22:34 GMT (envelope-from git) Date: Fri, 4 Jul 2025 09:22:34 GMT Message-Id: <202507040922.5649MYfC055640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b168cac06613 - main - pf: honor quick on anchor rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b168cac06613733c56e59edc6afc8388d60e203e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b168cac06613733c56e59edc6afc8388d60e203e commit b168cac06613733c56e59edc6afc8388d60e203e Author: Kristof Provost AuthorDate: 2025-06-30 12:31:24 +0000 Commit: Kristof Provost CommitDate: 2025-07-04 08:31:10 +0000 pf: honor quick on anchor rules Regression has been introduced in version 1.1024 (a 6.2 time frame). It's been discovered and reported by Fabian Mueller-Knapp. Fair amount of credit goes to kn@, benno@ and henning@ for pointing me to releveant section of pf.conf(5). Fabian and kn@ also did test the patch. OK kn@, henning@ Obtained from: OpenBSD, sashan , 7e89334d42 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index accc811a12ba..04f9f7a9d67d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4676,10 +4676,11 @@ pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) } else { rv = pf_match_rule(ctx, &r->anchor->ruleset); /* - * Unless there was an error inside the anchor, - * retain its quick state. + * Unless errors occured, stop iff any rule matched + * within quick anchors. */ - if (rv != PF_TEST_FAIL && r->quick == PF_TEST_QUICK) + if (rv != PF_TEST_FAIL && r->quick == PF_TEST_QUICK && + *ctx->am == r) rv = PF_TEST_QUICK; }