From nobody Thu Mar 17 17:39:43 2022 X-Original-To: bugs@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 E18311A2DF9D for ; Thu, 17 Mar 2022 17:39:43 +0000 (UTC) (envelope-from bugzilla-noreply@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 4KKDt73wzJz4ZnV for ; Thu, 17 Mar 2022 17:39:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 6352E6CFD for ; Thu, 17 Mar 2022 17:39:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 22HHdh6w018106 for ; Thu, 17 Mar 2022 17:39:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22HHdh0o018105 for bugs@FreeBSD.org; Thu, 17 Mar 2022 17:39:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 262622] [pf][patch] fix showing rules in (some) nested anchors Date: Thu, 17 Mar 2022 17:39:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: matteo@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647538783; 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: in-reply-to:in-reply-to:references:references; bh=puzM6o4CmRPGI9TUyM8f7DST5VD8hKjcJYo6ABkbDfA=; b=BmdKwjINGRn/DgPJKnm2cNa1aliaD+h3EMNSbyAVp3F2ySigtNHAkcWfBgy9vPv92fbC+q kGbJqoRHOrB9kEtA3RNxmnqPegMwx9959J7ZJpVBUzWA0aV+uqlO5uQT8XhQr9Fq3vDRMC VggJv0B/b4yRcTym222MnVgazbpkLydASCWE6XiMQ/eMgk1+M48Rnk7eOCAyPmrgtc78mx e9eMThRxWb7RMDWNslvrdVmRHDg6GBA8igLI8RiNsDc43oa+iL4ayawiCNCtAruQv4Gxgn 8uYuKCvPh9Ro3ZrDRTJwC0KYkekiQNIeeO8PrLTRz3rJhNwpX7ZQKZJYr63yYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647538783; a=rsa-sha256; cv=none; b=sx8GR5Cr3dWX8te2EdcHTorFfCsMuXAPug5hMOSQsxSAIwjHi5XtR0uVSQsrCBS5hPAFCe q+RQoFJNmvQFFFzcDPsQ+9lQGugqXo4MJo5eCLvBxj32Gwz3Wkb0ECol9n2KqIRd3zjQbh tmG7dt7V3CqFOOV9pLOFP8q59qcALqhtpGEsSmF5wPfFyJQCLMu/trr4U7lG9N6mtwsJsu B4hpU58p00Sq8P/7Gk8oEW6DC09Tv6UEPGbIWLLnf2WQnKYe626XxEOXrNS5B8/5ckLcCP dd14eOjieSHgKpzwkSuQiD9DyWv0qVDPWBmKJvT0cYX2IwkXkeGMpxpAH7NsLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262622 --- Comment #7 from Matteo Riondato --- (In reply to Kristof Provost from comment #6) This fixes the issue I outline here (but my patch already did that, and it = is simpler: I don't think copying anchor_name is needed, as least for this specific issue). The issue in bug #262590 is a little subtler:=20 1) we don't recursively print rules in anchors included in pf.conf with a wildcard, for example, using "anchor blacklistd/*". Here is the output from "pfctl -a "*" -sr" with a pfctl patched with your patch: anchor "*" in on lagg0 all { pfctl: DIOCGETRULES: Invalid argument } Note that that "*" is wrong, it should be "blacklistd", but the assignment = of p around line 1250 of pfctl.c is too naive, as it should take into account the current values of path and of anchor_call before deciding what path/anchorn= ame to use next (indeed the error is due to pfctl_get_rules_info being called w= ith a path of "*") 2) we don't recursively print rules in other cases, but it is a little weird when it happens, as it only happens in some cases. For example (with pfctl patched with you patch): On one hand: # /usr/obj/usr/src/amd64.amd64/sbin/pfctl/pfctl -a "blacklistd/*" -sr # (no output) but there is a nested anchor "2200" under "blacklistd", and its rules shoul= d be printed by the above command. Indeed, if we try to print its rules directly= it works: # /usr/obj/usr/src/amd64.amd64/sbin/pfctl/pfctl -a "blacklistd/2200" -sr block drop in quick proto tcp from to any port =3D 2200 # Although, it is really weird, because the following works: # /usr/obj/usr/src/amd64.amd64/sbin/pfctl/pfctl -a "test/*" -sr anchor "test2" all { block drop in proto udp from any to any port =3D 3999 } # In any case, the situation there is more complex than what is addressed with this patch, which is still needed independently. --=20 You are receiving this mail because: You are the assignee for the bug.=