From nobody Mon Aug 3 16:02:25 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 4hDLzP5JKCz6mQkR for ; Mon, 03 Aug 2026 16:02:25 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hDLzP3VzBz3PdM for ; Mon, 03 Aug 2026 16:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785772945; 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=bbgfSMKbfrsFQuPPSVDarN4TfQICP6nhChDhzzgCJv4=; b=A8OMV9A9M+PkX+Jm6QQK0W75e/ivhSyermRlZ0L0ZzB+9ctixcF0oCYtVin79ab/3goP50 1k7X+ET6+jrNx8nJQO6soTMWJob5OJ/R8KcErZzpERhmZgeeG/0OIbThonL18/ks3hhjEx pOpWs6DdFmLQdWmFXujPBk2wfpuV9cR2aSQ8OK7rjq4LPi18aXLQmKkklNeer3tHwMEAPU XjVPiF/0m5kjL6jtAsgqA3ZGo17ZZoUzW21iCTg3s/eQoBH81z0V0m0EeZCQWAaHZiezqx ebAapcSR0AAJm2EBWPWzJ+ZL8h+Si7+hhoihhIEYs+LDVoZx3o5Xa/MI1gATxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785772945; a=rsa-sha256; cv=none; b=cDmS9qszpsQWnpOOE9m7XYn9/KbPrT/0CZHTZYWTNjMcHrlqKAtY/vYqo7fTdq01/j8hoS jVvWjG4VyTwvXuVfceIhJ1ktMb3KZ2X6Ed4Mtc1+YENn+3r80E7hh+6xrXQA45v6RK8OQG 4A0RqpQn1ZkTWiwYgnDz4CedQwiJS87JZz05p42oo3Vqn4dBfj/5gbi3JSsnnmNSubrQGI lt2I27huEurjev7eMkQtKSRXy8LYDuiiry2vXXepxm3CGr5Ld7uPelfsM2aBTXBgDPBcbW m7LQeHVQRd8P0GSxcHDxVd0q1RcCkFkDQQphkbs+2qq/ezaFRuGdNePW0qLX7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785772945; 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=bbgfSMKbfrsFQuPPSVDarN4TfQICP6nhChDhzzgCJv4=; b=lDcnOoPXRKylSPm4r81S2U5lgYi1hRFsA0Ua77zdxvJd0Jrv5+WLpZXuBZ8u5OxH4AvnVJ aal2gr0ZMsVcLNUKk64oqiv7/TDGzWKjYj7XJvF+dOBz2rdQOCIn7sMykjqiv8xg//WWKz tXsGkwHGpXyG+onnsTYzlGW/8l11LwLTYy8zs5l+b4qsOa8OlbTTkFX+yPMuV/RaiuuWnp /LqZSu1qoUBnu1PT0woll3gnM00S/1XkD1TPJm8oqhaA5R2pKktTWD8IwDt47rmyd1QGlE zMhptgULkYlIHHeYUTlSvwFqllKtP3ejBfHf4aJcjN8JZ6P5awts5k8Qao70xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hDLzP2S8Lz16gm for ; Mon, 03 Aug 2026 16:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 408dd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 03 Aug 2026 16:02:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d2a5b5a86a92 - main - pf: attempt to handle overlapping group and interface names 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 List-Id: 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2a5b5a86a92e86f77737273ab4b2e99da63c21d Auto-Submitted: auto-generated Date: Mon, 03 Aug 2026 16:02:25 +0000 Message-Id: <6a70bb91.408dd.508f1181@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d2a5b5a86a92e86f77737273ab4b2e99da63c21d commit d2a5b5a86a92e86f77737273ab4b2e99da63c21d Author: Kristof Provost AuthorDate: 2026-08-03 14:05:28 +0000 Commit: Kristof Provost CommitDate: 2026-08-03 16:01:52 +0000 pf: attempt to handle overlapping group and interface names pf assumes that network groups and network interfaces share a namespace (that is, a name is unused, a group or an interface, never both a the same time). Unfortunately this assumption was broken when interface renaming was introduced. Attempt to cope with this rather than panicking. Note that this is a band-aid, not a full solution. The correct fix is for the network stack to go back to enforcing a single namespace for groups and interfaces. PR: 297220 Reported by: Robert Morris MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_if.c | 19 +++++++++++++------ tests/sys/netpfil/pf/names.sh | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c index 507879004b17..3993a3ee4c13 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -664,12 +664,19 @@ pfi_kkif_update(struct pfi_kkif *kif) } /* again for all groups kif is member of */ - if (kif->pfik_ifp != NULL) { - CK_STAILQ_FOREACH(ifgl, &kif->pfik_ifp->if_groups, ifgl_next) - if (ifgl->ifgl_group->ifg_pf_kif) { - pfi_kkif_update((struct pfi_kkif *) - ifgl->ifgl_group->ifg_pf_kif); - } + if (kif->pfik_ifp == NULL) + return; + + CK_STAILQ_FOREACH(ifgl, &kif->pfik_ifp->if_groups, ifgl_next) { + if (strcmp(ifgl->ifgl_group->ifg_group, kif->pfik_name) == 0) { + printf("pf: WARNING conflicting group / interface name %s\n", + kif->pfik_name); + continue; + } + if (ifgl->ifgl_group->ifg_pf_kif) { + pfi_kkif_update((struct pfi_kkif *) + ifgl->ifgl_group->ifg_pf_kif); + } } } diff --git a/tests/sys/netpfil/pf/names.sh b/tests/sys/netpfil/pf/names.sh index c6f2a06c15f9..eb5c9a2a6ac5 100644 --- a/tests/sys/netpfil/pf/names.sh +++ b/tests/sys/netpfil/pf/names.sh @@ -134,9 +134,32 @@ start_number_cleanup() pft_cleanup } +atf_test_case "overlap" "cleanup" +overlap_head() +{ + atf_set descr 'Create a group and an interface with the same name' + atf_set require.user root +} + +overlap_body() +{ + pft_init + + epair=$(vnet_mkepair) + # Overlap with the implicit 'epair' group. + # See PR 297220, this can panic. + ifconfig ${epair}a name epair +} + +overlap_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "names" atf_add_test_case "group" atf_add_test_case "start_number" + atf_add_test_case "overlap" }