From nobody Tue Jul 15 10:07:56 2025 X-Original-To: dev-commits-src-all@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 4bhFHd0Wnsz62DgT; Tue, 15 Jul 2025 10:07:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhFHc3QqBz3f7b; Tue, 15 Jul 2025 10:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574076; 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=ANn5Ox+AOVTH0NIxyHPRTXkNKT36/VWGDqcdueFdmQc=; b=J2wqNaKrLd4AkLs7CCz3ki8xY9NTaHBfBSK0hVQUg1dUBb4BsMrurL1arw/3J6CKxnMTZF ISLjnbWdKz4p9itpqyKxgsGWGOlrdpfSvrR32O/7g+5qQ0wQW2LA/kre+Z1p8DpML8DylZ vIuNn2daaPoJibt0xW72NJKrPXF061vnt7T6BdUZlEoJhyg7Nqsu3FbZq67vZNEIqOaR7w MDlZtLIgXqKNxsyQUOe0muGlZ2bHFG/n89aWW/CNGqa81TlSuwE+EGiokjd37dzNcsTqEv XuOSFMTffxXhU7IzKuPcrxDTFiKpbaUZ+yFuCROkDPYoiZVZdVxXmJN4Hj0f/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752574076; 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=ANn5Ox+AOVTH0NIxyHPRTXkNKT36/VWGDqcdueFdmQc=; b=cdbOmoD1Br+z+udPcXJd4dD3gGy+RVok9kGIB29nIEN8lIxpO8swdkPZVsj4t+CVX2NtIj jp1tV/Ih/YQIBqAqw2+dm6CyW6VWiPu5ewEJ8IqS0oX7ncIG76YqwTZIXY0NLPQPBiR4KY 7mS0JaTsmib9JwDvPM9tZR2MoTQdOJwM8X6vhynknP2pbx4E/WBwadpv6YCw7MrAgDxBdX 29ydJVPzWnyYyelU1WW05m2EoMAR7iL/0RmYP2nV9N5MYs9aPkg1m+72TjYG041nirj10L 23v9SPuUpm+Uf9jRTHYMlCTiZ/M0vpNS4BcHDzl6xZHbg4DwAKBCybKgtNicEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752574076; a=rsa-sha256; cv=none; b=ublJ0DipoVTvaSsGPbeHg7XvyVoTpNhzDhxA1+BdCQfU6ajWGuAxlUl4SVNDpsATtV7p/7 n0g6V+WR4MFt65sLcwLsEsnNYpG7WHXje+LC7XBynkCzi5baFCbR0m5+ogT4oc2IdDBiyf qJ/XoY8btcH4tRLOnxdsZ355xIeVXpF8lNOwKkKHAg4Eve4VSN0ZIwCW6CmKaspiTA3sDQ YjGKGB6MzedQk2zT7mBBWDiN4kAl6to1FsKYKIf82b6gwUfs+DUVlPUQrRw2S+kxaCYkh5 dye0I5G7spgyZC3HW1JRV1EA0QSKssJZNlfUli+pyov8CdWjCtad6REMwDu4vQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4bhFHc2pH5zbbr; Tue, 15 Jul 2025 10:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56FA7u6x027988; Tue, 15 Jul 2025 10:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56FA7ug5027985; Tue, 15 Jul 2025 10:07:56 GMT (envelope-from git) Date: Tue, 15 Jul 2025 10:07:56 GMT Message-Id: <202507151007.56FA7ug5027985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7b0b4fca080e - main - pfctl: getifaddrs() can return entries where ifa_addr is NULL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 7b0b4fca080e818e5cf2559453345b6057d33064 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b0b4fca080e818e5cf2559453345b6057d33064 commit 7b0b4fca080e818e5cf2559453345b6057d33064 Author: Kristof Provost AuthorDate: 2025-07-08 09:48:52 +0000 Commit: Kristof Provost CommitDate: 2025-07-15 07:55:30 +0000 pfctl: getifaddrs() can return entries where ifa_addr is NULL Check for this before accessing anything in ifa_addr. ok claudio@ Obtained from: OpenBSD, benno , ff7f497850 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index bd2c10c8080f..cc2b03ec211f 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1483,7 +1483,8 @@ ifa_load(void) err(1, "getifaddrs"); for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (!(ifa->ifa_addr->sa_family == AF_INET || + if (ifa->ifa_addr == NULL || + !(ifa->ifa_addr->sa_family == AF_INET || ifa->ifa_addr->sa_family == AF_INET6 || ifa->ifa_addr->sa_family == AF_LINK)) continue;