From nobody Thu May 28 11:37:33 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 4gR4Gj5l6mz6fZsD for ; Thu, 28 May 2026 11:37:33 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gR4Gj5Ckfz3MWB for ; Thu, 28 May 2026 11:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779968253; 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=yq02nScmxDSuhSMbOjZ5krv0qUCXYjoG0gkT6WB23l8=; b=vJTYrURaIJBqjU96RFPATOaDawYyobXLPsTRTg6ZRxeGW4sHSL4m3kA0EtK3wiv0jINjRi YBJYDrPO/w7p9pC95xT71tjx9U6cPYnpPpY3GKxYPdGCL28hyJKRK/kaKii+OjVvoZEjg7 NE5dZPom3LYcgjbl7sM+PC/fnLPaKLOs1NRYNxzCDITi3eq1U4pm8Ouf5dW8QHSXUOw52/ B+jj0W8F2bXMdsWFNrCqEZVZ++w7KWkfzhG0Z7m3MPi+wzqzcGnRhYaafeEGbLEHZUHk8t HrSC+yasLVp1t/z7wtr2PUkrmOxBCx6TZZ+nXkolBUQSV2edW6BHeSH0OVFOLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779968253; a=rsa-sha256; cv=none; b=sr2bHv0wOx/+Rwwde2rm/THAuwjgFPo/wkS5a1L5KeAJIisos9HFqATo2BJLRK6QuuuT0W 6T6TDvgbIx/j+QzYhYtE6Otko/5EZ36HDCPElmTjdNpL2B1tmpOgdR9N8m2riQKwqyitQj s17wX1iI2PITFj5Ol2+wsYXphExh/UE/7COVFP5s1MIM9Exv13HNcZOJjuQGM5QFLs/Th7 z1bgxklbYTdLop8nHaiWewlLucjHKVyZ/J2VYU2jc3nU7quMTe4JVU///iNwvOuTRG4Sq9 407eDUj96+Keuuh4ajbqHVvZZmJbXNrHuAM7y2K5NQ/5AHbTixZOkRhy+MkDFg== 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=1779968253; 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=yq02nScmxDSuhSMbOjZ5krv0qUCXYjoG0gkT6WB23l8=; b=YGRToiokqrQ4NFEvCDKddnU1QDRoKpUvBaSGsNCdl2qqCubRa/gLEwmkVF45onAqSJUD61 K79Iq4fjhq4/ORsrgnd1LUFYsVFsqymqs4CRGUvm8/ETt/NQfHue67CGNqP9bL9p7154BJ 1T8HhIvNR+y1Yji4RoxYcAlUlUyvH0OjthBIby+cSTl/+THLhDbURbt8wd0nfs85zSfWJJ zjalNTn3gsbtC3xqP9rG8cjf7U8tg/1M5Uq6SbmHzNjqmz1oMfOKHeyhJKykKaMVZF8elY /KFer25Ej/h323tHiro8x7urz9DYgzkJ50fk1jBlobJz/2rmhXcjNrco8aU5nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gR4Gj4YxWzlT4 for ; Thu, 28 May 2026 11:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f9a4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 28 May 2026 11:37:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 45aaba521c3b - stable/15 - pf: fix incorrect table decoding in netlink 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/15 X-Git-Reftype: branch X-Git-Commit: 45aaba521c3b7abd39dc9e8f5ed0e9521fee57c3 Auto-Submitted: auto-generated Date: Thu, 28 May 2026 11:37:33 +0000 Message-Id: <6a1828fd.3f9a4.542e9e5d@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=45aaba521c3b7abd39dc9e8f5ed0e9521fee57c3 commit 45aaba521c3b7abd39dc9e8f5ed0e9521fee57c3 Author: Kristof Provost AuthorDate: 2026-05-21 08:13:24 +0000 Commit: Kristof Provost CommitDate: 2026-05-28 11:36:43 +0000 pf: fix incorrect table decoding in netlink We used nla_p_table for pfr_table structures, but this netlink decoder was intended for pfioc_table and decoded an extra field, outside of pfr_table. This allowed userspace to write (slightly) outside of pfr_table. Use a separate nlattr_parser for pfr_table. PR: 295218 Reported by: Robert Morris MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 64327f769cee0c26e1b81e6195a5092498b10403) --- sys/netpfil/pf/pf_nl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 168c6ac63d90..c09b204bcc66 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -2138,7 +2138,14 @@ nlattr_get_pfr_addr(struct nlattr *nla, struct nl_pstate *npt, const void *arg, return (0); } -NL_DECLARE_ATTR_PARSER(nested_table_parser, nla_p_table); +#define _OUT(_field) offsetof(struct pfr_table, _field) +static const struct nlattr_parser nla_p_pfrtable[] = { + { .type = PF_T_ANCHOR, .off = _OUT(pfrt_anchor), .arg = (void *)MAXPATHLEN, .cb = nlattr_get_chara }, + { .type = PF_T_NAME, .off = _OUT(pfrt_name), .arg = (void *)PF_TABLE_NAME_SIZE, .cb = nlattr_get_chara }, + { .type = PF_T_TABLE_FLAGS, .off = _OUT(pfrt_flags), .cb = nlattr_get_uint32 }, +}; +#undef _OUT +NL_DECLARE_ATTR_PARSER(nested_table_parser, nla_p_pfrtable); #define _OUT(_field) offsetof(struct nl_parsed_table_addrs, _field) static const struct nlattr_parser nla_p_table_addr[] = {