From nobody Thu May 21 21:20:05 2026 X-Original-To: dev-commits-src-main@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 4gM1X51rblz6dyxX for ; Thu, 21 May 2026 21:20:05 +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 4gM1X51P67z49v5 for ; Thu, 21 May 2026 21:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779398405; 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=c3xfRQE63F3Wr3vXcyEzl8MfgEBWbEt0m92YAPUJmUQ=; b=vUdfGoYk4hgvxXc6/aQuqf48kbWbx3rJ2zUT7V1LapTk+27RxnEBloBsq75PHrEvWVJlCt lQrs//qUXo8h+Rqneca9F81xCRi6ZvfgtInnnjouaO7/ik2xbJOunYTxpalkFzhj6icYGQ 3Lf4TgHd78QPCq5fb9N8LtLVH3S5JgYpJukVVr06mKv92cmz9wnq5LID7CxUh0bjDZUV7Y kraW0QyJkx9lBRIgSFLD0Lqur7TwE1ERLwkNfYhQtqmbJw03HiqHcjC9rSKgC3MQUQbClR CTS6P9gJpAOjd2NsFWWEGMNOcPsMsnFtmNxcUucnJpqnXPfwM+y4ftbJsibdTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779398405; a=rsa-sha256; cv=none; b=k/JVUh51gFAfTFxo95lyjC4kx/sEX7tyR6+xZcpssxrFVHDunRAl46T3DB4FKaApLMRind PgTjK1lWnnDxUfS5fuomnPmkyelA4lcumlYV1zmxK0heyKAjG21EEmtsB8b3wor/xZw/pz nGwWodLSuffWbnLcnVMXj1kybXX4lrE5Pk1wGBl8o5cGlhKakihCYThFzPsOHc+hUtnmP8 uNnZBw9bTkS8JD02/9pyu1V//puPt9kNM+QoFx60CFjuYf49GG9NQRi4hFb0dRwtBnc2nN MIGSa6Ca9iJLFTk4mT1aFtW0OLoEWx8zmTWoCEcLqRY2eTyy4SMmVZNQkMkdiA== 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=1779398405; 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=c3xfRQE63F3Wr3vXcyEzl8MfgEBWbEt0m92YAPUJmUQ=; b=HQhyhcvGhhvK7oxeJj7QaNRUBGWz7rL4pC9uSr60q7b4Y8R0tVVAhfoIxX8ovpeo+KmltG z+7Hb/+evchc0R01X8q5xYivVSSB3HJkpZ1+cauObgk6i32H57GjvngSg7p8IJ5ey2Q1dQ wdCrHAMNKpELc0oWsGiE1DOMFpDlpVIkeWNb74hEq8hFTDZvPNS/kBGx2qUnGa57u53ukp ZJ4qzJcl91hc9WcS+0w/tTwwTgO/pPaCaBHrcfvAehCfdJCucofXxE7cj017UYfocUZE+l I3ra44hVOd/8VuYJnX7IQysr1O0f9ydpIht67Xk2iPT4vYKkfxjPhiHF6PBNoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gM1X50pFRzqQZ for ; Thu, 21 May 2026 21:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d8e4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 21 May 2026 21:20:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 64327f769cee - main - pf: fix incorrect table decoding in netlink List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 64327f769cee0c26e1b81e6195a5092498b10403 Auto-Submitted: auto-generated Date: Thu, 21 May 2026 21:20:05 +0000 Message-Id: <6a0f7705.1d8e4.4e2eb214@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=64327f769cee0c26e1b81e6195a5092498b10403 commit 64327f769cee0c26e1b81e6195a5092498b10403 Author: Kristof Provost AuthorDate: 2026-05-21 08:13:24 +0000 Commit: Kristof Provost CommitDate: 2026-05-21 21:19:49 +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") --- 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 d1beb7681c21..0e1c77864615 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -2189,7 +2189,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[] = {