From nobody Thu May 5 08:16:51 2022 X-Original-To: dev-commits-src-main@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 3BDAF1AC83E4; Thu, 5 May 2022 08:16:52 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kv64417FHz3QgW; Thu, 5 May 2022 08:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651738612; 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=wuI/RLwxFRnkL8LktNdZj8S6qLpH16FVy8dTbgWMU+A=; b=mLQUlBtDBA8eO+CDzItXeA69ZYj9wMprSJjWQmmJ3gMHaNdp4hydY36bshHOVAk1A35JYV SPxqDjrD5RaQor+i4AohIhGVzoywqQz3HTchSlyNHK+t2VO28z5OYl16K0ACxiMdhrabKP qOfmBXsvEW3Qfu4RDFMrc37al4sznGX089thjrVqePaGBmFpmTEQsyb8tZ6UDNhBv5k/aI h8CqkbMNx4D9VLEW30YRHmOD2o1OWllWVGzOh5Wd3svenPSFfAVYbw0viQbvwkBn+sS5Ls 9C1MnHD3gy0gcW3FyUhLC+giUEEn+YwqBhOl3l+7qZFCokc5nD5/XEAzyUDhSA== 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 0711223D9A; Thu, 5 May 2022 08:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2458GphP099343; Thu, 5 May 2022 08:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2458GpuV099342; Thu, 5 May 2022 08:16:51 GMT (envelope-from git) Date: Thu, 5 May 2022 08:16:51 GMT Message-Id: <202205050816.2458GpuV099342@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: 27407a6adc79 - main - pf: clear PF_TAG_DUMMYNET for dummynet fast path List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 27407a6adc793bdfaef8a86ece32fb1b461429f0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651738612; 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=wuI/RLwxFRnkL8LktNdZj8S6qLpH16FVy8dTbgWMU+A=; b=UDZpTHkT8Ydg+u7t+kpdGDc1eyhrQtGhXrKGdJ4q0lx7Sy7hUd/Q/tIEcxe94U1jKrhwYK KkHJQk4cBy/SOGN+1v4oI/f7Xd1P/Nfqq4Ym3T9dVpkjSMAp2CkoRpiIreS2hpSN4oAuny iE4DtYzCz9nO6UoWWoosU8QlaxFE1RffzOwxzLV5eM5kz1N0+u5Pkx+J+iAZdJSvGCPBFx PHSQkxdJKy4o9gPx7FIuiUhpfgqAItJJS0TV9rSuaMGq/4codhw7MiUHe8BOoyswhuQchF 62EeiZl3Th1IryGx6JamNHDDENhQ5bnHNAc2Xw+raK6ek1y9Z/lsJGpeH7BeiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651738612; a=rsa-sha256; cv=none; b=LU2mKMLORiLS0wuzrlq1tTd02Agpb7MoZ3xrcI+XeK1w/hea89ozFT6nwLF6QzIwpmarsM rCK9aMIWIKrZifOKG8XKaIQWu1ePflerpI7jayVJQqrI8awtLL5rCGWUfVY+FmDzzF0zDv lxrTObm2Kiow3Yyp6aRMDuyMFTMT/4PrZdt+5HJXcdWEs/YKbEdfIvAmviptw4OnNxWT9H HM1qlI0CVBS2g02QLfEX95vUjTz7ph+hEkUdOrVEQbzxImmjMfwGy1BmJXN72uAVrNkLMW /2zCvS9aujdNh+joH+5FVd2vrj6Z7pfo2ZShvIyfZx78UXWoWtZGyvFrHWawVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27407a6adc793bdfaef8a86ece32fb1b461429f0 commit 27407a6adc793bdfaef8a86ece32fb1b461429f0 Author: Kristof Provost AuthorDate: 2022-05-05 07:21:32 +0000 Commit: Kristof Provost CommitDate: 2022-05-05 07:21:32 +0000 pf: clear PF_TAG_DUMMYNET for dummynet fast path ip_dn_io_ptr() (i.e. dummynet_io()) can return the mbuf immediately (as opposed to owning it and later passing it through dummynet_send(), which returns it to pf_test()). In that case we must clear the PF_TAG_DUMMYNET flag to ensure we don't skip any subsequent firewall passes. This can happen if we process a packet in PFIL_IN, set PF_TAG_DUMMYNET on it, pass it to ip_dn_io_ptr() but have it returned immediately. The packet continues its normal path, eventually hitting pf_test(dir=PFIL_OUT), where we'd skip when we're not supposed to. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5eee9dcf5b91..b0d8d8c6e017 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7300,6 +7300,8 @@ done: ip_dn_io_ptr(m0, &dnflow); if (*m0 == NULL) action = PF_DROP; + else + pd.pf_mtag->flags &= ~PF_TAG_DUMMYNET; } } break; @@ -7758,6 +7760,8 @@ done: ip_dn_io_ptr(m0, &dnflow); if (*m0 == NULL) action = PF_DROP; + else + pd.pf_mtag->flags &= ~PF_TAG_DUMMYNET; } } break;