From nobody Wed Jan 14 08:06:15 2026 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 4drdwm3Z16z6PL9s for ; Wed, 14 Jan 2026 08:06:16 +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" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4drdwm0h1fz3KYT for ; Wed, 14 Jan 2026 08:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768377976; 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=X0nWyvvsYbiyZtqWv+/loJki0qriNUjVYmSs4ZF40OM=; b=cw0kmwUat2B1h1o07bbA9ccS/vfaSo0b/5ovre5d33/Sj82Lfgyl7F5AWY1UWjQu7K62RL GeP9X5+flB2uypKW4Vt8MfL86gIQ09AIGhX91rDr5jnjwcH0/jrXJnA2+bRKi7PX1lzuaM RtP7PQ79mUYmeDfbK8jGRCdvRaNHl3hxmO24SRwmRn+SbUvq6WOKT/B46sqvUpWBhYgy9g CePUSdevuTa1AC/os20DrjBWyLmJ6E3uUtAVlmLOw9N+JfQYEEuBqxeEDJKihpMabra4ng Yg0kDJNNuNJ7l1mCdX1F0Tz/8TjKcwMmRIIL8CVauhawbA6WwVoFUnxve9ZH5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768377976; 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=X0nWyvvsYbiyZtqWv+/loJki0qriNUjVYmSs4ZF40OM=; b=qpZufT562mFQu/zjWI+YXFEqXGPjZqujzbsKdN2XWqR2mywKzQGJ4ZVFfe3CFB0Gb2urXr TN82p1ytL3jWgolFYpBdY9x2Vrxn8HHS8irsfbcFFY9VjksDpncJsWFItge9AtjnMndYA1 +3OJEH5QG8zfC1PQZduu2pji8R+jGtWXe3aT+UstaUHuuMj+Pk1srf4M8uVaMDPEqr0mlG /kNa87EGByWUzrNyHrD4H2qPrszPFyikJVB6UwI0WliZImcuZW+vg7uN9tJFfavT9i7ciP wSdbyYekDEx9Et/iwJJxUobaYqYsQboO2vobF+/h3+ixEBVdiaob0Yp0XBVAKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768377976; a=rsa-sha256; cv=none; b=DmEmSabtGoRJMgHmq0gqS115QmYERR2zRecRzIVS4q5h4iGLD+7G0yO6L3uonH15Er/pZn eaHxHNto+9N9LcP/k4TO1VGpGiQCUWfG/7QQSDN94JXZ1IjbSOA+g8iE7ZuDRaB4uMddSJ 48YjHtNhWkP1QnE+x1wgjsNsTmmN5aJF5DpiwgFHQTUlOAXwEh5WLpT/B8nCwKcuR1OX5z LJrx7Myt96TlSp3JjBp9QVrNNIJ02uRcDVKslAWxY/1pHb6ChJrFbOH5tZ4a+POwRQUJb5 4O9Ml1vNEykYEJilt0UidzUTlhhLqDy8G9yerUT0qo6Up+sEZ3HRksTQUvPz2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4drdwl745szq5L for ; Wed, 14 Jan 2026 08:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b5cc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 14 Jan 2026 08:06:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1ee4405a00d7 - main - pf: avoid a shadowed variable in the pf_create_state() source limiter handling 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: 1ee4405a00d7bcfa5545bba7a78b71cdd4cfdc20 Auto-Submitted: auto-generated Date: Wed, 14 Jan 2026 08:06:15 +0000 Message-Id: <69674e77.b5cc.350cc295@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee4405a00d7bcfa5545bba7a78b71cdd4cfdc20 commit 1ee4405a00d7bcfa5545bba7a78b71cdd4cfdc20 Author: Kristof Provost AuthorDate: 2026-01-12 16:19:52 +0000 Commit: Kristof Provost CommitDate: 2026-01-14 06:44:43 +0000 pf: avoid a shadowed variable in the pf_create_state() source limiter handling the code that unwinds state creation when something fails needed the pf_source variable at the function scope to be set, but this was masked by a declaration in the scope that sets up the source limiting. this results in a NULL deref in the unwind code when it needs to clean up the accounting for a source limiter. i found it funny that i left this comment for myself in the unwinding code: /* who needs KASSERTS when we have NULL derefs */ ok jmatthew@ Obtained from: OpenBSD, dlg , fc9311361f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 88b110d744ee..79948b218428 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6846,9 +6846,9 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, srlim = ctx->sourcelim; if (srlim != NULL) { - struct pf_source *sr = ctx->source; unsigned int gen; + sr = ctx->source; if (sr == NULL) { sr = malloc(sizeof(*sr), M_PF_SOURCE_LIM, M_NOWAIT | M_ZERO); if (sr == NULL) {