From nobody Tue Aug 11 08:42:43 2026 X-Original-To: dev-commits-src-branches@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 4hK4rM5b11z6XCB4 for ; Tue, 11 Aug 2026 08:42:43 +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 4hK4rM2VQyz43RG for ; Tue, 11 Aug 2026 08:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786437763; 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=M2ZkhQWLlYa769XvFpwvmMFHQVjzuVLzCIUVusievyU=; b=GslKaVmlVFI8bE2t/LGpmEiSN+CqdxDkIOlbS2KikZdxCUZkIVdEjoxMwfHn784SAc4+Bm Cd7m/DaL1yJA7xBFg7Ltjjf96YrHZT0kKFQY1s8Pt89eT4CgEYSwbRM+pMsanYGuZ2kAmF Tkdf3YKRtT1AFjxYVI/BEROCoONoyPHFqrZCarRnEa46Jdl9RV8tIWVas8AwNg+cloAI0o 9cRXudWABmuoL05+jLB9O/Hv5Q8HT42Gqhnl59NF8tebsVntkI/RhA/R508XCA25AwAH0y 2antrWpGswd3MXGgD0hGcWVPMcwMvfwaEQ6adirOhaLPIOzT9Y4QuIJS5Z0J7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786437763; a=rsa-sha256; cv=none; b=fLMxQNKvNlFLTXyo9URM+I6qiaQwYmflOSwQpHN4ZFbwASGNXIxjVzbwQeX3EcdtVe5XYJ H77KbBS9KYbhzUUB+hhov2RIySOShDB7IVcA5RWfuJf8NYsSC4JJ78DgslcMPqg2qoELG6 YCedJFluvrufPFqL7bUG/UNTexaeVki6CqHZHUfss7UQjlVJwPEBFBrFF+Qiaoco4GdVEc 71ESX8LjDXQKcs4Do5p8mIdOs4df6Wsl0JZJ5X2eHhTyGVqMcZSboW/FwVqzRLrRHCspJq lgiu6OJ2XFr9wREXjLScLCnLFI7FXbaZl6DqHOkLNXt+P7yJadwWM+io0/5MHQ== 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=1786437763; 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=M2ZkhQWLlYa769XvFpwvmMFHQVjzuVLzCIUVusievyU=; b=OtQOtVCEixYYiXw3CEnFT7VuHi5C5DLfMj48B80pqiQE7qxV4nNODFTDA9nNTpP7qeb+XD 5pgOiqLTPEqcb356bW1kYgQw2aQJeuPTTSXjltOa/DKZJnRzlnq7dUVpYITOr/wy7O/qty qCeWHxYyiINGK8tC+mMoXpfSs44B5v2lFpMUysOkqtRBMntzofUo79mSjLI8nYaJRGfVqr fhoa+Y7N+sk5lBf1MXhKtCPqUgiyI6DWPPD6G+aMPtka3AY7wkEcevSBYk4MulQyUNPIet hAPF0EAf4oxmIQZpwfoQck8yGydeuhrmDYrHb/mi5Fj9S+U1pkXYvywq5vsAHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hK4rM1LVGznrX for ; Tue, 11 Aug 2026 08:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30eaf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 11 Aug 2026 08:42:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 71ac7ff5d6f9 - stable/14 - pf: attempt to handle overlapping group and interface names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 71ac7ff5d6f97d0f49b72922bcaca191ff7677d2 Auto-Submitted: auto-generated Date: Tue, 11 Aug 2026 08:42:43 +0000 Message-Id: <6a7ae083.30eaf.343d69b2@gitrepo.freebsd.org> The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=71ac7ff5d6f97d0f49b72922bcaca191ff7677d2 commit 71ac7ff5d6f97d0f49b72922bcaca191ff7677d2 Author: Kristof Provost AuthorDate: 2026-08-03 14:05:28 +0000 Commit: Kristof Provost CommitDate: 2026-08-11 08:34:13 +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") (cherry picked from commit d2a5b5a86a92e86f77737273ab4b2e99da63c21d) --- 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 3c5bcc95f7cf..a5f26b5624bd 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -608,12 +608,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" }