From nobody Fri Mar 18 01:14:23 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 E792E1A13A1A for ; Fri, 18 Mar 2022 01:14:23 +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 4KKQyl4MJSz3FM8 for ; Fri, 18 Mar 2022 01:14:23 +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 75BEF156CB for ; Fri, 18 Mar 2022 01:14:23 +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 22I1EN9g078441 for ; Fri, 18 Mar 2022 01:14:23 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22I1ENaT078440 for bugs@FreeBSD.org; Fri, 18 Mar 2022 01:14:23 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 262590] [pf] Anchor "blacklistd/*" not correctly shown in pfctl -a \* -s rules Date: Fri, 18 Mar 2022 01:14:23 +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 Only Me 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=1647566063; 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=UMel3P361Ht44xFJPUMTnYgCB5PoZYWLJgMCQEaVuxc=; b=EbU6i0N1XjgZEh6kMPzF6DbHPfnJzLDGheDLTl4It5e1YSlu/I5Yj7Scjw9I0gK0W4VF9i omajJ83UTWMoLIRnrpDM6P8zDfxxjiefBemIuQBTXTJ2MQc6Jqmf/tvFAVZRjdunL5j5Pk TGsMcsGhqHElxo7eLerv5STJPJAnIchoqfkjnNGTmva0ueA8ilASjE8COI8gKyqFbjY2zD Omgxw+GmhjFpIxTG/PxxFZev9/iH2MAniQ8RtmtulODoToRUgu7tdxuhAbsrtDGndAp5MR eoQw6L3yXF/Hsa9fqRL/dPYWy9wdk5VFMDnEGMai+G5KsI+z4l0DWlUuIVs/Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647566063; a=rsa-sha256; cv=none; b=KTVkXh+xIOYJosqcPIq+zxcxeE5OtHu08UOaZHyo+X0Z4ATSmSNmJ6aU8am0tec3zMZWsb gzBPAuWamyW+RcSUQAaT/g/AMZ9wZEOScicJzpPsQRSzS2tc6WgltyiN0Y1Foy3ZPaJKlZ FzP4HVax8TxYCn8o67Vq8+GaCx9AId9xdsYH9pFjTT7aaoF0HkVYGBELjtHhjfYZjENw1p CTO3SGTm3i3xOjx9vGb8liSyz8VUVxVwgKQCSPiNGKuDZ46zP99RvDNskQD3d48uIgaH73 AVG/n6CgNo9ymCu7UmWGve5FpVAZoIcvQplhWk7u/5kXmfnlwLSLyH856kc/sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262590 --- Comment #5 from Matteo Riondato --- Yes, all of these work now, but the following still doesn't work, which is = what I meant to highlight in this issue, but I did not explain myself well. 1) Create the following pf.conf: pass from any to any anchor "parent/*" block in proto tcp from any to any port 12345 2) Load the rules in this pf.conf:=20 # pfctl -f pf.conf 3) Notice how the rules are already not printed correctly: # pfctl -a \* -s rules pass all flags S/SA keep state anchor "*" all { pfctl: DIOCGETRULES: Invalid argument } block drop in proto tcp from any to any port =3D 12345 # 4) Now create the following file child.pf: block in proto udp from any to any port 23456 anchor child { block in proto icmp } block in proto tcp from any to any port 34567 5) Load the rules of child.pf into the "parent" rule: # pfctl -a parent -f child.pf 6) Notice how the rules are not printed correctly, with the "child" anchor = not even being mentioned, but also none of the rules inside the "parent" anchor= but outside of "child" pass all flags S/SA keep state anchor "*" all { pfctl: DIOCGETRULES: Invalid argument } block drop in proto tcp from any to any port =3D 12345 There are multiple issues here, but one of them is that the way the pointer= p is updatde around line 1250 of pfctl.c is not correct, and it is what is causing the use of "*" instead of "parent" as anchorname in the next recurs= ive call to pfctl_show_rules, and it is such use that causes the "DIOGETRULES: Invalid argument" error. Note that even fixing this specific issue about p would not be sufficient, because the next call would still not be able to p= rint "child" and the rules in it. --=20 You are receiving this mail because: You are the assignee for the bug.=