From nobody Wed Nov 20 12:36:21 2024 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 4XtgpG1RW4z5dhxf; Wed, 20 Nov 2024 12:36:22 +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 4XtgpG0k8Sz4rxH; Wed, 20 Nov 2024 12:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732106182; 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=IK+1gjqi0yUkCyV4jHYSjqjOTiF4ltERYA4i+mk7lU0=; b=kRaImamUhIL8ZPsgwVcfRo96Rdk5dhCXjgezv3QrPDbJQnh39tg3afWbVAUFU+TVzixU8s CvVWv+dcI8cvyVL74dAdjocOQBM++C8QzLT2329VBU2zKHAXQBlGRQLfyX3qhd2HdJu6JG ZigICGDeVGuZSQhgn6XEqdtxoo9pxmBpzufJn+PjLaDqbFxbZ2ygEUyUc1MnXfaTRjdNzh 0oNORuytq4ZN8CIz3zfaDU/N51d3H+blU7cqfNuMc0kj8qNiyB9FYgN4Nh0biYyrNCZzow afyln2UjQRpoPYC9xfFtdIW6a97MPiN0xAPODrzi6F8VpC7pzOPzDqH2cya7Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732106182; 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=IK+1gjqi0yUkCyV4jHYSjqjOTiF4ltERYA4i+mk7lU0=; b=MfUpm3v+vSvVV8uFsjqMUFgPajUS+ScIL3JypbZJBagKSwVLJ2OljEAUIxR/RW9B19RcoV 0KAXX50eBODzSm50D3Y3DO6t5axSe/zr5hB9L3EXteHfaSibqjS9m+rwLcavhLN86iFt5r n8p37GzwqclXn6Uk38rkGHJoSL6tckt2scQqs+eZclNojvYXxuIwIXQrLWGX5fVoECn1+j 1VG7XpZEez6rW8qZ0isFBn2XrtzLUSnOLwg8EvYuPM5IcN4Zk4xfnkyIercPxbKrI8mzhi keuHBYiIqLyMZLNsxP9iq7FfTFnaLbakisQzONbAWKSbjuaCeKt0TCABpdzL8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732106182; a=rsa-sha256; cv=none; b=X4LJMYXdyqrlHjK99+4UUcRjO3r7TlSrRbrq2dh+GjVQ42cL5cCw2QN4cBEhBSBoF+DP36 JwGL7tykk2L2SInGj98qIexz+yc1cNZF5GjiUKFNuoBB7RXW7o5y9sdYM+uRztdH4YiDap qN+TKFsoYBgDGXw1hK6sVeO4Kx7XzYHQuGwJwtZHdlLixPQQklLRF/SwN+S53y2vI4PP7E OQXx4FX75N0RPSBsgllpybDiuqwEfRuhTqfZ3sqeTfaTkmM5nAM8oy4yyCklbG5r95oK9U D4Kd+Ws8LxWpYRQ/nzjzF3AZmWsjlccN2Kcyj1kIJQMYz2PxhSeRIy1o8z/gXQ== 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 4XtgpG0JKdztTk; Wed, 20 Nov 2024 12:36:22 +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 4AKCaLOI004346; Wed, 20 Nov 2024 12:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AKCaLcm004343; Wed, 20 Nov 2024 12:36:21 GMT (envelope-from git) Date: Wed, 20 Nov 2024 12:36:21 GMT Message-Id: <202411201236.4AKCaLcm004343@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: 81f7ad324dd0 - main - pf: add missing unlock 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: 81f7ad324dd0cc4f2c090c1504230f4e2d58fb54 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81f7ad324dd0cc4f2c090c1504230f4e2d58fb54 commit 81f7ad324dd0cc4f2c090c1504230f4e2d58fb54 Author: Kristof Provost AuthorDate: 2024-11-20 10:45:39 +0000 Commit: Kristof Provost CommitDate: 2024-11-20 12:35:53 +0000 pf: add missing unlock If we fail to unshare the mbuf we forgot to unlock the rules. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index daf3fcf567ad..39913014334d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9043,8 +9043,10 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 if (__predict_false(! M_WRITABLE(*m0))) { *m0 = m_unshare(*m0, M_NOWAIT); - if (*m0 == NULL) + if (*m0 == NULL) { + PF_RULES_RUNLOCK(); return (PF_DROP); + } } pf_init_pdesc(&pd, *m0);