From nobody Mon Dec 15 10:37:54 2025 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 4dVGjZ4YH7z6Ky2J for ; Mon, 15 Dec 2025 10:37:54 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVGjZ32Wzz3rSM for ; Mon, 15 Dec 2025 10:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795074; 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=GF8Vluzasv0biQLVXcLNHY0KoE6NF8ovJxxw1zRemNY=; b=NMk0G3ZUM5WbQZpZ4/olZek0HD4DDASUi0V94pMn+bCG+o9hgYsXCy2RhJlQb+SHKJ/NlX TIwaDLiJfUeVf8Vv4QYWeQhtAjrc1but1rZ1Au0vgiK+mKEZ4kWriLhyQfBP8O5whVtuvD Z0MUY4g+1vwXXgNgp35rWr+lKhgRY7XsKwKoPUBDmRgTmRTEJBk/4GQWy25StMqWTPqGTj lvMuqEh0jWUGk6CWAx8PBj7gQ3eUKtOXbeFp7umEYDy56cJkhecRo2GigHc2lti5n2Yyx6 oLeANXFnT+QcRLGGkjuSTnIg4mYGLr3NxHaKdVGUYABph14pJKFAuSRw6nnAEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795074; 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=GF8Vluzasv0biQLVXcLNHY0KoE6NF8ovJxxw1zRemNY=; b=pIe/dSzUOhMpItMt8bsV9t/pWD3R9Pg0xc4AJcEPbkc9OHbiwlaLZ22LFXsg4VvlSDXhYy WYA++ocNpJxmcM4+/S3BynJeMYWomY1CEeVJpolpvB3osqiYDvPfb0YW60EGQa+Z/vsIeR xKZROWBXPfg8Km4iZhs9WWeKlxLtRKlVSIzPNxJOBAGaUwQSMSUFWecyzZQvZhKbP6fMuk b3RqTZWJk2CSrd//0NipFqm4Mc63h94IkRB+UgBA9AFglvcCU8k7O5EoR/EF2ACBOBniza DK70/D3LgfrnG3NjyuXxaZ4YopVM7bkYZeGEtCTS0Y5SReiwD1GwZsyAt64JYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765795074; a=rsa-sha256; cv=none; b=iKcMOuivdN4jXRfcBYitahC2BjcQrPTp4TmI6AV2HVdiFgiVSGY7DyORs64klpFsmk1nEA ChnGuHDt5AwEQStBrqEOmAOfTvChpQ9N8pvs5aV9eNHxjHXpd/jLkT7WLg1+lTBJrVt9li Pvddbo49ajMe3hyR1+46nhz8s5wQ7sw8R1E6gO7vcpCnTQx+kUxDuIa2I6x9+GbswB+pZB YnPiPLU3BB+B7JCt2bqqpaWzoJMD9cuMU/Z5y7atFhjxHL0/4mhTvcadqzKVps6Hhxs5G+ SsU7hX63Xki1nrDF73z7WH1dvgSTathqdvkXB4s8u+z+pSK+fYC3X+YeWHSGcQ== 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 4dVGjZ2TKpz1gR for ; Mon, 15 Dec 2025 10:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8895 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 10:37:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3c0942f99209 - stable/15 - vm_fault: only rely on PG_ZERO when the page was newly allocated 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3c0942f99209cb95be64c95322b5f99b575db6b3 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 10:37:54 +0000 Message-Id: <693fe502.8895.44c9f2d5@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3c0942f99209cb95be64c95322b5f99b575db6b3 commit 3c0942f99209cb95be64c95322b5f99b575db6b3 Author: Konstantin Belousov AuthorDate: 2025-11-28 15:57:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-15 10:33:11 +0000 vm_fault: only rely on PG_ZERO when the page was newly allocated (cherry picked from commit cff67bc43df14d492ccc08ec92fddceadd069953) --- sys/vm/vm_fault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 3bf16778d987..f7318f96f709 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -138,6 +138,7 @@ struct faultstate { vm_object_t object; vm_pindex_t pindex; vm_page_t m; + bool m_needs_zeroing; /* Top-level map object. */ vm_object_t first_object; @@ -273,6 +274,7 @@ static void vm_fault_deallocate(struct faultstate *fs) { + fs->m_needs_zeroing = true; vm_fault_page_release(&fs->m_cow); vm_fault_page_release(&fs->m); vm_object_pip_wakeup(fs->object); @@ -1219,7 +1221,7 @@ vm_fault_zerofill(struct faultstate *fs) /* * Zero the page if necessary and mark it valid. */ - if ((fs->m->flags & PG_ZERO) == 0) { + if (fs->m_needs_zeroing) { pmap_zero_page(fs->m); } else { #ifdef INVARIANTS @@ -1352,6 +1354,7 @@ vm_fault_allocate(struct faultstate *fs, struct pctrie_iter *pages) vm_waitpfault(dset, vm_pfault_oom_wait * hz); return (FAULT_RESTART); } + fs->m_needs_zeroing = (fs->m->flags & PG_ZERO) == 0; fs->oom_started = false; return (FAULT_CONTINUE); @@ -1686,6 +1689,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, fs.fault_flags = fault_flags; fs.map = map; fs.lookup_still_valid = false; + fs.m_needs_zeroing = true; fs.oom_started = false; fs.nera = -1; fs.can_read_lock = true; From nobody Mon Dec 15 10:37:53 2025 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 4dVGjf66W4z6Kxx2 for ; Mon, 15 Dec 2025 10:37:58 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVGjf2plJz3rSf for ; Mon, 15 Dec 2025 10:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795078; 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=x6i6gVG0Lm2c66MZY8dnRdq1NvG9Lv2nf4b4EnX+sOg=; b=NJrnfYij8Cb+MgbuEPfI2AgRNjZR1btv31brKvNrIkQOYCqgt/yEYUK3ASF/bGqZVkIdNl kMxHzmGwG0kyT+QHI5wptIoCnQHvDKwgHQB3GZ0YLfFjnPLWCgiOmiX4SjoMyLThN3d0Bb LjzfyO9ynhlGGkG4VMHMzBlQ5eAQF/mzmWWCgjr5HoRxa7tjWCvaap4V/o9x50sJUEKT7T YqmgMEM7oJFRRXhkdjv3JKf/4jS1VZMswCJmyNSmqZPzP1ubv9gtLpnFDvHXLysDZEx/M4 Ai+7radUApXgl8s78hHwdNu7LZuk/GrbtlTJCtRHzHdIJYTdKcr+kbzoobTXOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795078; 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=x6i6gVG0Lm2c66MZY8dnRdq1NvG9Lv2nf4b4EnX+sOg=; b=IRU2xecVLvVAar4XhBGylw9WvAxt/m4RHIMhu54+nfednJWTHViJCFCspRfs5K18M6gtTy vig6tpEPYe00HK92evZV5kSyMp2Dseaf9hS6GXIT/V0zfw3XGmgi4Hagu5JBTpL3qZuY8d agvtLo6cQxB16zD/4HMIzLcS+Z+I7WqSm0SlQU1h5ssNT43kGFi+AVNITYmbGNwRqOEYyM ALok+seLEEutkljOf2lPgstBowz/XFY9SFy/MlTGvsaph4LcJEdL++vA24mtDdBNvY/k7T AE9b2+D8NCNRofU6yRJ3Z3gwHNHBfwgBevt/IoDx/p5u/7OvOQgyHeUZPWWSYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765795078; a=rsa-sha256; cv=none; b=JerLZB72aSCuDinu1TCW2rJwjTO+3bHoZ53J4806nfO2InDOm67P1ZKMKjXdwwiHuhItnS SyvlNiLieVzyFG6VscktuRH8Py8WynpUya1M36ZN3bp+5LtlaOR6Eh1LKBGvT5BTJOZxTr qtpWijzfpe/FbdO+DIx+D8TcShVNvAgxQiycoPdJAetxpgrcCvMoXLu0nrP5Io17pDCaHZ kP5immNKKVc3J7auXjj059HZhPrmMdR1CwayrtoOyYrSGh9CB1jTs3VjlboS6vOwyDnsxT cDV7DIjSRQNmyKz+7hCBdvd5gjSK9lvd8fc9TRe2HhaKsKqxrFZOANaazfvAtA== 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 4dVGjf2KdQz1Hx for ; Mon, 15 Dec 2025 10:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 478af by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 10:37:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 64b3757b4d85 - stable/15 - vm_page.h: remove no longer defined (P) locking annotation 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 64b3757b4d85eaa6332241f6b3d1038aafa7ad33 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 10:37:53 +0000 Message-Id: <693fe501.478af.47b8a569@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=64b3757b4d85eaa6332241f6b3d1038aafa7ad33 commit 64b3757b4d85eaa6332241f6b3d1038aafa7ad33 Author: Konstantin Belousov AuthorDate: 2025-11-27 20:39:45 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-15 10:33:11 +0000 vm_page.h: remove no longer defined (P) locking annotation (cherry picked from commit 636ee0269db04ce22a0f5e32723bab79be69443d) --- sys/vm/vm_page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 8f2d5aee3cd4..0a143544e907 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -230,7 +230,7 @@ struct vm_page { } uma; } plinks; vm_object_t object; /* which object am I in (O) */ - vm_pindex_t pindex; /* offset into object (O,P) */ + vm_pindex_t pindex; /* offset into object (O) */ vm_paddr_t phys_addr; /* physical address of page (C) */ struct md_page md; /* machine dependent stuff */ u_int ref_count; /* page references (A) */ @@ -238,7 +238,7 @@ struct vm_page { union vm_page_astate a; /* state accessed atomically (A) */ uint8_t order; /* index of the buddy queue (F) */ uint8_t pool; /* vm_phys freepool index (F) */ - uint8_t flags; /* page PG_* flags (P) */ + uint8_t flags; /* page PG_* flags */ uint8_t oflags; /* page VPO_* flags (O) */ int8_t psind; /* pagesizes[] index (O) */ int8_t segind; /* vm_phys segment index (C) */ From nobody Mon Dec 15 10:42:27 2025 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 4dVGpq3RXjz6KyCn for ; Mon, 15 Dec 2025 10:42:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVGpq1fnTz3sNv for ; Mon, 15 Dec 2025 10:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795347; 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=R0WjG73lsa1CUy3y/5+rAdWlEStXzwpHKUvUhwFJ8AM=; b=YGrNVMNOG2Dm1Va3i+dHCA0SWRC9EpgZwyPpnWc+1qei212UR8J6NRXL3bxReSmDK/98j6 e8A1tO3/zKQcJcQBXlTyGJNyJJLTTKFIhZi+fZ/XbkSItPxeWQi0RbV5E3lIrGn3xCl2M3 mULI14Zi0z0Wg8tUG++UON3/jWxLbbONJZL3spjZObWtZMxIQ8jgoIlT5aZYXDk1qkxyto 1vtGnxCDc/caTNK6R/99J5na+sAR0Fz3T0XgRwciXz5tXs8eJzv4hlV0cMb1EZwrOVOGAO TTXVvGYmMqzv3y81/ShS7p3UXSwKF9y5v7pUcLb2x5PqAiJOSJ8cmeC96FnnrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795347; 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=R0WjG73lsa1CUy3y/5+rAdWlEStXzwpHKUvUhwFJ8AM=; b=xVP31sOPopuJaDQvcWbBZDzKBy4050e3nbg0+jJ5CZlkx8jJR3/cJlKdiSDw1ZhR8xrndR 50vNGtTsPUhgg0MCW4/mFInSsw3iEZxct/z4vqgUFOMli8YXg6U6jvZOeW2lpEcYm8Fk6d NGSXDax9Bt64qdGQy/QmdBInqWRyBsCXLsW0KCizy8rS5tkWJXXDTqIHnVd01dP0k9k9Jp MGJbpV04weIaufwvdycaNyNG7VyoVJ7z3xG0XPVPuMInjwitDqCYLPvn91tZadmcPWshfD +0I6A+j9gL+6+Z4GdLXyJozjTteMMSXQJGXCT6wegTXity3nM15ET58WDLlesg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765795347; a=rsa-sha256; cv=none; b=cLzqU42/T1Vf+oVAO6VoOyTVsW7RFmg4PRd04qvpZUzJOYMM04c75lV++CLiyoOF0b7OZy 66mBLo3btEers496WyMBSrR+eosrvLYIeUZIu+Xqf6UCWC9+yZ/Sh14yYArl5sSqpXd2Gn MDYBVYOejR3NWcAI9avuZtaFmTofrfqByxrGFEkyILWV7CPZbElRvAmNSeC2hE068J6SRT lkZF2TILL8UZYhvk53NNj52Q8uBtrlrsNwfDynDYO2zkHysJgE5c0/pYoTXoJLfDBMqDC7 SnnriqLvfzyWguQ1wdzsyA+WVkCkiaFUM7Efy1Jpv9oRjNF0VV5s8Kvi8pnkgA== 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 4dVGpq10k4z1hB for ; Mon, 15 Dec 2025 10:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8278 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 10:42:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 76dc56765afd - stable/14 - vm_page.h: remove no longer defined (P) locking annotation 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 76dc56765afdb5d7d44df83f91585357d4757568 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 10:42:27 +0000 Message-Id: <693fe613.8278.426620b7@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=76dc56765afdb5d7d44df83f91585357d4757568 commit 76dc56765afdb5d7d44df83f91585357d4757568 Author: Konstantin Belousov AuthorDate: 2025-11-27 20:39:45 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-15 10:38:58 +0000 vm_page.h: remove no longer defined (P) locking annotation (cherry picked from commit 636ee0269db04ce22a0f5e32723bab79be69443d) --- sys/vm/vm_page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index e8d1497e2afc..bcbe64bb5eb9 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -237,7 +237,7 @@ struct vm_page { } plinks; TAILQ_ENTRY(vm_page) listq; /* pages in same object (O) */ vm_object_t object; /* which object am I in (O) */ - vm_pindex_t pindex; /* offset into object (O,P) */ + vm_pindex_t pindex; /* offset into object (O) */ vm_paddr_t phys_addr; /* physical address of page (C) */ struct md_page md; /* machine dependent stuff */ u_int ref_count; /* page references (A) */ @@ -245,7 +245,7 @@ struct vm_page { union vm_page_astate a; /* state accessed atomically (A) */ uint8_t order; /* index of the buddy queue (F) */ uint8_t pool; /* vm_phys freepool index (F) */ - uint8_t flags; /* page PG_* flags (P) */ + uint8_t flags; /* page PG_* flags */ uint8_t oflags; /* page VPO_* flags (O) */ int8_t psind; /* pagesizes[] index (O) */ int8_t segind; /* vm_phys segment index (C) */ From nobody Mon Dec 15 10:42:28 2025 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 4dVGpr3lLTz6Kxxd for ; Mon, 15 Dec 2025 10:42:28 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVGpr28zKz3sJB for ; Mon, 15 Dec 2025 10:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795348; 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=qCGVPjLSIUaixTgekY/YVLwPWAhWhN2TF4V3QTZSuPE=; b=J6ItRzMXvzgdPuDrsx3Mgl8CCE+1CqKfHrAGyFXnqH9s+vuNiPkqtjLJqaGKOijXpQEBk1 uOmitHKOqc+uuHvtDOnmtC3GiUfpFkQo9FSgXgjdCJjmc4PoVuzwTRkSz+F+Ox7L1Vhbyk 7byrORapUwOszIieLJlZ2w7kWOgDT97f/AvkjAJhEaNrzq1jnba8Mb2hV+0YPT9j8S9Ufs WECqe65djr7d6ruyUYy5v2xJdadkwOrAfCPA0EO6Z03yZyqC8Pz/1Y6aj+LKbrznRpDrFD Zp4cS4wG//Oto7eZj9zkNcAodqQZtraMO4xC/B12HinApfRaAD/NmWRAdReiNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765795348; 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=qCGVPjLSIUaixTgekY/YVLwPWAhWhN2TF4V3QTZSuPE=; b=FI1zSQCrmBXTa7mK/cr7w+JMtt6IUNK2q0UpV5FqchLph731LpiLFFhKREL6DW35HNNX8d GbSO7MdAHdu7pkZAvwQdSag7jB9t7LiyRCL0u7NK5YOgP4vLZ49evkQJHWFBzhJb/9/j8r ePrr2lbmt0+HfcLa13/Q+BgstsHloDw6/c2Kac7BAtORhJW8+zEXNPfIh8AuXsnMwnMVSB 6Zicg7KB3xBvGBavxYNc1wbsa2UJzf3mnny4uymVhMqG+VYjyUWSFvgnOzaEGxpqW6Fh8S Gt7aJ8udWX6Xs1RxYmqinvrX5csJsrVXIfp5ChnMR2wH5CKf8o4k/3JlWHxf7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765795348; a=rsa-sha256; cv=none; b=d2pa+Q7HZOiIxUexGAwR6ggh+LWP/HDieHK4uvfdNjA9OfI4s5ElkCv4tsL8kgayWV24hU nRzrl/hvZwzUgWwcwVYAfgQpOKHR+meE5gSsrksb/sNUenYtckM2hffMb4loMwHbrksmzy 156gtje+Wk7vQipdA1Kl34wnWrXE4l4e1SPgnK0WqQTfVy1lHMm5jMRsBu6fyNAEfq5aXT 8paDluEAf5Ta480AEaQFOc6Xd1IGliDn6kY5iAAT2r6GwcT6I6Qv15u8UktFQNbAV+QzSL yFG2CgQ95ABjYt0upeMIEG8e95RMNV0U28+XCyV7tx/7wfZL/+Z86Yi8/cvcbA== 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 4dVGpr1ljcz1VZ for ; Mon, 15 Dec 2025 10:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47ac8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 10:42:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 99f641267d44 - stable/14 - vm_fault: only rely on PG_ZERO when the page was newly allocated 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99f641267d449f26a2e13449964f29d17897c29f Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 10:42:28 +0000 Message-Id: <693fe614.47ac8.b86187a@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=99f641267d449f26a2e13449964f29d17897c29f commit 99f641267d449f26a2e13449964f29d17897c29f Author: Konstantin Belousov AuthorDate: 2025-11-28 15:57:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-15 10:38:58 +0000 vm_fault: only rely on PG_ZERO when the page was newly allocated (cherry picked from commit cff67bc43df14d492ccc08ec92fddceadd069953) --- sys/vm/vm_fault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 9f7176eebabb..87744e2d3210 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -137,6 +137,7 @@ struct faultstate { vm_object_t object; vm_pindex_t pindex; vm_page_t m; + bool m_needs_zeroing; /* Top-level map object. */ vm_object_t first_object; @@ -272,6 +273,7 @@ static void vm_fault_deallocate(struct faultstate *fs) { + fs->m_needs_zeroing = true; vm_fault_page_release(&fs->m_cow); vm_fault_page_release(&fs->m); vm_object_pip_wakeup(fs->object); @@ -1205,7 +1207,7 @@ vm_fault_zerofill(struct faultstate *fs) /* * Zero the page if necessary and mark it valid. */ - if ((fs->m->flags & PG_ZERO) == 0) { + if (fs->m_needs_zeroing) { pmap_zero_page(fs->m); } else { VM_CNT_INC(v_ozfod); @@ -1319,6 +1321,7 @@ vm_fault_allocate(struct faultstate *fs) vm_waitpfault(dset, vm_pfault_oom_wait * hz); return (FAULT_RESTART); } + fs->m_needs_zeroing = (fs->m->flags & PG_ZERO) == 0; fs->oom_started = false; return (FAULT_CONTINUE); @@ -1650,6 +1653,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, fs.fault_flags = fault_flags; fs.map = map; fs.lookup_still_valid = false; + fs.m_needs_zeroing = true; fs.oom_started = false; fs.nera = -1; fs.can_read_lock = true; From nobody Mon Dec 15 13:30:15 2025 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 4dVLXS1YSgz6Khfr for ; Mon, 15 Dec 2025 13:30: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVLXS06gjz49fK for ; Mon, 15 Dec 2025 13:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765805416; 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=RSAI+5LFSjw9SdiGHmLfvyAuX59jGxcoR14bXALLxsE=; b=As13C5LBKVexXcoaWWxrCx80XvAbQTMQ6SfJ9xeA/vvvj/JksN0ZUIixURuzHeiltZGofD Gj4abW+AVQuEIP8Kpci1IA7wqVPsnuOgzIuaWq9VIR4+9tWHz4As7Y6bzwCbczhSWj8dWq xwTKgh2advCry9tF/FYiyAupLZq9xJR2K5rhd3w6GNPPo4V7c1jy74jsY0KtkNPuwAGSqn r9z8MNR8I2C/venPwVzD0QwG8Qi2KFi9msU2W1EhwdKEy4b4ba2fE94J6b7OvMKtLH+E+3 FRjEKxdujeZM4GR1Pmd7crfhcmSX+ctXoXVGs5zctmO1e/XGZbTFcIQmAhIvOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765805416; 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=RSAI+5LFSjw9SdiGHmLfvyAuX59jGxcoR14bXALLxsE=; b=KrtwlIxKEgclB+lrBBY49+3uJ0TNBS2jlAgM69tWTH/twCKkySOXze7ro63cpHKnuA1N1K vH9f3HD4mNaXePU5hma1u0WA/yph8F2AFlThIbijryKtY5T0Hd3kq19sMGP04GCNU/ipoP DpmhN4SAz3a0ihtUv45RR3dO8oTNy26SA/4zQSMwb1sbhFw/2kW9rwoR7nBnjO0UBGPp/E L3ldq0MG/KewuHa3H8Sc1+3VJH9qgpvtKpgHc4cySrSTjgnAY3DmYCZzVrH0T1thGbbdE1 SC6aMFg0Y1iBSdGSo69phUjci/HDBfGsI6uMUyR+ysexiF11NfbjCmJRFmNNLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765805416; a=rsa-sha256; cv=none; b=N5Rz3z44IjwMr+fjiH+mmuQhW9KBXrAfGmPv5SyfiBM1ku/KvUh0xhGaBp1Bbhh4X48pgk CrNnDS9SBS6h7JvQUAUEV9/vDVN1bckLRaIxolzK3D/fNh3FInxy71BCrl6t375tr13Ovy cabusE74H8C53NnGjpbJgA1TmXd98Kl8cBXo5/8iURL3w1o6pCTQpedmsgVNcaKeiK3cAn iRmphQqwv+i1bdThyDdNbiG41x/qFOz1MV6XoWuCfBGUmancPA3bh54WbumhT2YGwRUl21 x3VstiFO1DeP1g3mbPbndU0T748r6gBrWJXl2u2YMi8m/XA5r/RG9MYxCzCWkQ== 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 4dVLXR6G2Vz5l0 for ; Mon, 15 Dec 2025 13:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3199b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 13:30:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6043e26b902b - stable/15 - sndctl(8): Do not free and re-open device 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6043e26b902bacf301b0d4360a84085292608a10 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 13:30:15 +0000 Message-Id: <69400d67.3199b.4d55d2ed@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6043e26b902bacf301b0d4360a84085292608a10 commit 6043e26b902bacf301b0d4360a84085292608a10 Author: Christos Margiolis AuthorDate: 2025-12-06 14:28:08 +0000 Commit: Christos Margiolis CommitDate: 2025-12-15 13:29:22 +0000 sndctl(8): Do not free and re-open device There was a reason for this, but it does not apply anymore. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54031 (cherry picked from commit 643a606fa2742b94f6eca620119b7d2686ca9cd3) --- usr.sbin/sndctl/sndctl.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/usr.sbin/sndctl/sndctl.c b/usr.sbin/sndctl/sndctl.c index 6977f0ab0ebe..e6dac67e2ea7 100644 --- a/usr.sbin/sndctl/sndctl.c +++ b/usr.sbin/sndctl/sndctl.c @@ -992,17 +992,10 @@ next: argv++; } - free_dev(dp); - if (show) { - /* - * Re-read dev to reflect new state in case we changed some - * property. - */ - dp = read_dev(path); print_dev(dp); - free_dev(dp); } + free_dev(dp); return (0); } From nobody Mon Dec 15 13:30:16 2025 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 4dVLXT1tHPz6Khyh for ; Mon, 15 Dec 2025 13:30:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVLXT05jcz49xx for ; Mon, 15 Dec 2025 13:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765805417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SksW6USwR5A1AAW03Mg4vTtl6ixmHtql8cYAgYffziw=; b=eZPRv8OFGANiBh4dcDgFPsbNzqUXpLR2uyzQZcN4bGuYL7IbZA17DS8BadIBbn7KPk/cRU ovoSJQvgOD+QZoyaV27154GlSOptGUVeuLBiST1t104Hpgmhjnjpo1uXi9zUuQOQJqrwA0 +R+3ecG5UABMxnhAQWuhyjcGAT125Qek38fA79n7nihNnQe7RT1CdlWc2O3puTYh9hMM8C H5X7OZ6+k0pAqoIrBmXJ5AXrrj/qmMy+Pn83H9QtXHrPv2EuqQwUCYK1pLEm3chmWx4rKV nt5ZJvTUq7Dp/tSyVKFI3fihtno8J/j/HEfHhqGGCnBaAn9kePDws+SmQZd4PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765805417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SksW6USwR5A1AAW03Mg4vTtl6ixmHtql8cYAgYffziw=; b=gGiodZeYm5V+6nW+D5opcJRuOstNHupIzWDeXHt6fYjohg17kR0Rq/OIw7zkIjEYuvN1DR pl+7HI6A8VLCiTPEjmRUd/sHIUvkPaYnj+cjKFhkHsHPOwpeOpmvPXjRyyr8ipDOkZ84lg TA/wIDKWj6M6QQ4OEKhCfajSLtzKdf2IrVlwVxpRb/we5FSXQq5tpM0y2aap7PTRembOOH esiW1Lydvl31shqlH38KvVs8IY4pm7Syw2llYLcvROSScFI79r425Tm8RF89tIXsFtK35S C8/z5GAU4BODqPIYnnv+P1P5etAhY1kR5Hss43apgqdGEjXr5SmFXAcSZQ7k/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765805417; a=rsa-sha256; cv=none; b=S5rGutBUamRkc6eT+XKre28j3w1S8KaC8ru89mGH1JfzKEhm/AqhBKmEYPbi3CYZOy28kb o1tk+kQQ20AwyNrnBBAc09OVtosnhhA+kzAWcwCScU4UCilNWa9pjyO5rv2iI8CBkd0PIE 8QPncGMqKxM/kiphKYyqw5/0R/V/F+f/tDA0wzZu6zF1LZtVXGrAUr9HPxGUaHMq3LjdKw RRmAi3BePPWLE5PGSRAEtc3fZW2jLKp24EMsNwodqEzus7qDRrErzYyoiQ6BqdlyjBBMVv tMkY1SNqYGfm7Bj/CaKqm7P6nv1YUP5XosT+zmph4mIBT6vpNbTpJ6z/39xpAQ== 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 4dVLXS6lMqz5l1 for ; Mon, 15 Dec 2025 13:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32081 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 13:30:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Goran=?utf-8?Q? Meki=C4=87?= From: Christos Margiolis Subject: git: 164d03e30812 - stable/15 - sound examples: Check if setting property was successful 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 164d03e30812b623b06cb3b82436386ae1f52db7 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 13:30:16 +0000 Message-Id: <69400d68.32081.4b5f0abc@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=164d03e30812b623b06cb3b82436386ae1f52db7 commit 164d03e30812b623b06cb3b82436386ae1f52db7 Author: Goran Mekić AuthorDate: 2025-12-08 17:20:34 +0000 Commit: Christos Margiolis CommitDate: 2025-12-15 13:29:56 +0000 sound examples: Check if setting property was successful MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D54038 (cherry picked from commit ebe7b241662be3941e462be9f228fcad1b67073a) --- share/examples/sound/oss.h | 22 ++++++++++++++++++---- share/examples/sound/simple.c | 4 ++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/share/examples/sound/oss.h b/share/examples/sound/oss.h index e1ba4165810f..cf38b8de2b0c 100644 --- a/share/examples/sound/oss.h +++ b/share/examples/sound/oss.h @@ -112,16 +112,28 @@ oss_init(struct config *config) } /* Set sample format */ - if (ioctl(config->fd, SNDCTL_DSP_SETFMT, &config->format) < 0) + tmp = config->format; + if (ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp) < 0) err(1, "Unable to set sample format"); + if (tmp != config->format) + warnx("Format: requested=%08x, got=%08x", config->format, tmp); + config->format = tmp; /* Set sample channels */ - if (ioctl(config->fd, SNDCTL_DSP_CHANNELS, &config->audio_info.max_channels) < 0) + tmp = config->audio_info.max_channels; + if (ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0) err(1, "Unable to set channels"); + if (tmp != config->audio_info.max_channels) + warnx("Channels: requested=%d, got=%d", config->audio_info.max_channels, tmp); + config->audio_info.max_channels = tmp; /* Set sample rate */ + tmp = config->sample_rate; if (ioctl(config->fd, SNDCTL_DSP_SPEED, &config->sample_rate) < 0) err(1, "Unable to set sample rate"); + if (tmp != config->sample_rate) + warnx("Sample rate: requested=%d, got=%d", config->sample_rate, tmp); + config->sample_rate = tmp; /* Calculate sample size */ switch (config->format) { @@ -197,10 +209,12 @@ oss_init(struct config *config) config->chsamples = config->sample_count / config->audio_info.max_channels; printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, " - "samples: %d\n", + "samples: %d, channels: %d, sample size: %d, sample rate: %d, " + "format: %08x\n", config->buffer_info.bytes, config->buffer_info.fragments, config->buffer_info.fragsize, config->buffer_info.fragstotal, - config->sample_count); + config->sample_count, config->audio_info.max_channels, + config->sample_size, config->sample_rate, config->format); /* Set trigger direction and mmap protection */ switch (config->mode & O_ACCMODE) { diff --git a/share/examples/sound/simple.c b/share/examples/sound/simple.c index e458841f596a..78f9d848bcec 100644 --- a/share/examples/sound/simple.c +++ b/share/examples/sound/simple.c @@ -29,6 +29,7 @@ * SUCH DAMAGE. */ +#include #include "oss.h" /* @@ -115,6 +116,9 @@ main(int argc, char *argv[]) int rc, bytes; oss_init(&config); + if (config.format != AFMT_S32_NE) + errx(1, "Device doesn't support signed 32bit samples. " + "Check with 'sndctl' if it can be configured for 's32le' format."); bytes = config.buffer_info.bytes; channels = malloc(bytes); From nobody Mon Dec 15 14:14:06 2025 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 4dVMW24NfMz6KmT1 for ; Mon, 15 Dec 2025 14:14:06 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMW23w31z3LJk for ; Mon, 15 Dec 2025 14:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808046; 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=Gk7w6OkZLchFvLxXRyX7BIgmFa8Tp5BHDT54uqDEgyw=; b=N5iiDa4dOhWWJJar3Ct6Yiv0sFXwupyu1bzzlXgbL9X5cyvw6EBEYAy+b14iZ0Q8e7S6+k 4okeZBZ4Xm2+nC9jHn+OhsLqTRJhpq0+7WzGTesr96aLnB2NhMpiJzzkzodLoJcLIIf+sW cXoReR+U5hCbAMWpSZFpI4g3NUeZdbAl8pagfvsytumilV3cn6r666/5ug+YAxeSNDAeW6 pypP8zmwc+M0Wb2bXmQIU5vB+I/O7iOfMPQkCpETnkodJFwxQG5c6fEUxi0C9+hes8YOga 5WKU5+hfF+YxfXt+LecGKuhRMkBs/6OtDAI1NJ15Nv5eUtLWK5vh6DNP9Ezwbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808046; 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=Gk7w6OkZLchFvLxXRyX7BIgmFa8Tp5BHDT54uqDEgyw=; b=ElFoUldbXUY4SKtFWKhPc/qwscgHY1mIwXQkwuJUJuQFrhYD0R7KtEo7JxRdiW7Pg/bBxx nrSvqYB2uhlMnnDjKp9LXvROBt+i3J5LOIcu2wnwM/di9ntlLKUnBPLQcca+TXMBbLdO8a bd0A7UuEea5x56nd1OqqLRa59yAqf4R5ozJGAIUDznv2gsLm/fab4W1Q+ZW8p/9m3f7RTL KWCmNas94AmBOj0XDTzvS97nMqZlzTk9+E1fRSPUSthwyk3ABfunsnFXAbJTeu67eTvCC8 ZmL6oc1yivP6h1P2tU+Lb7mDqyx5y3IXTYU4Ye1OLG+Zhskz/y9Z2yOzk3Kceg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808046; a=rsa-sha256; cv=none; b=vMQaUo2jAZ9/+rgTRaRR9cg6W+VURXVg6mlyCXmlO5yL27qqEPktcX1Zd+b3NBkqUhMdpp jfud9urcBF4MQK2t7ADaNhdlvVp1dYwogyr1bEI0/Mo0yAi+XkM8Ko/1c2Jh2euZkWTGWh iir9bzh3RYxF5PenEODpuNdobl/b4jNgdcYbNMIDwf9xy4ykXr/IhC20h6wg0fzFB175rn skEYe16kJ/mWi1WudoXH8KumHBFJm+issrfj/NBk3erUV1CErLIhGWh4nRnnyG28SXETd+ uMXEcP0X1lCEJkhNQGU/OBRbuTZpjLVF/UeGkayPAN77k3cRf4Z+C966KzVzAQ== 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 4dVMW23Wg3z78c for ; Mon, 15 Dec 2025 14:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35728 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:14:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2dd40f6cc09d - stable/14 - rtsold: Fix a buffer leak if we fail to read the default router sysctl 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2dd40f6cc09d74d59a4f04180d9174403f4f3fa3 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:14:06 +0000 Message-Id: <694017ae.35728.30f5439a@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2dd40f6cc09d74d59a4f04180d9174403f4f3fa3 commit 2dd40f6cc09d74d59a4f04180d9174403f4f3fa3 Author: Mark Johnston AuthorDate: 2025-12-04 15:00:46 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:12:39 +0000 rtsold: Fix a buffer leak if we fail to read the default router sysctl MFC after: 1 week Reported by: Kevin Day (cherry picked from commit 792221630bf4e58fcd923547bab689f4497613d8) --- usr.sbin/rtsold/cap_sendmsg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rtsold/cap_sendmsg.c b/usr.sbin/rtsold/cap_sendmsg.c index 6e7f156fbe62..36c68b7ba78d 100644 --- a/usr.sbin/rtsold/cap_sendmsg.c +++ b/usr.sbin/rtsold/cap_sendmsg.c @@ -151,8 +151,10 @@ probe_defrouters(uint32_t ifindex, uint32_t linkid) buf = malloc(len); if (buf == NULL) return (-1); - if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) { + free(buf); return (-1); + } ep = (struct in6_defrouter *)(void *)(buf + len); for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { if (ifindex != p->if_index) From nobody Mon Dec 15 14:14:05 2025 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 4dVMW65qlTz6KmLD for ; Mon, 15 Dec 2025 14:14:10 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMW63N3yz3LbK for ; Mon, 15 Dec 2025 14:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808050; 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=T75lTHMwrOU2GWO16QWQ5UCPWbFYiGgvd4UTYBZ7w28=; b=Sya4f2ePgl0KTu1PbwIYhcryEM7EcZiDWI4R2wJKAi8GAeXJ5WnP7thT61yHKebv4gmP+s ffc1U5X8phuM2VUiLrcf2iGBiAd9NZqC+b/MjWUW1+6Uh4vewmHzzznci4bNfJhoZBTHQV RuSeWd+FR1rdWeSv2PkO5QoVzLm7BjGuDIb12LfMNcbgLGkgkEQVqrmjZo3MOMFITU9alM uXfb4dDT/Y4giZhnoL0ZPLFwpqYtFe+88iDtr6Nmdfuq6pfvUUSFSUA2EDY3FANVQGyiWH sjjiGMB8rFZDrYWbSGimk0a0KIZCpXohVciIKkOSdpexsB47UQxySa2LK8raiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808050; 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=T75lTHMwrOU2GWO16QWQ5UCPWbFYiGgvd4UTYBZ7w28=; b=uGVpzgMcJXXAomtYAkc75WWLDaljrjRcF8nKxYq9KizOl9u8TGTf+PMY/7dLd5LpkfXnJY I7vR/6gZOXqoErwm/ZiVis453k2R1xvUT5EfuWbJIDvR+rCrl6hsgli1Byl1p6nDRHh298 YnsH5Cd5xMnMaSrtPkBrOQUpeN+lImbDMoWeSwwvvY2RzE8lio0TY1a5fhChUbyJdZcUKp LjCs+y4KFEeiNy5+CE1/SNsMpzw58/ntgkqkHwXwlAdr6wCF81oTxPaJQ+mJrxxt/zy13L rzeaUbrelFLoSAkOpRduT/nwZ8OhDz4L+hpzvF9ivAI7+48AQw2qyM8WabkJ3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808050; a=rsa-sha256; cv=none; b=ptkcPxv/qazSlG2hVoKzS6WDxOF6k8TklQVTyZoZJw41Th0/k7opBhmyEzla//V6y+ME83 uMlKNW7qGOSLFrPOIBQFC+itpUtgc0K4+f1OSIXO2xAY/2Nv7ZyQmkXlDq4jzaYkuw6BZ8 Iq2UyzIUL3FbFlPj2xIcpcznwhh4vvUBFj19AfbJsHclV6Dd2xWKg9E3NYrhHLoU8wXacl uy/UZ2ANZXMlAfo42RU7HZcU2ShExBRFxRc4k1NW7Y/CgkwqqSJWFy5vlhrYLjzFbzxgkM YOQD/OVbb8usI0dt1Cg9CvpuaZaBCsSPMLm9+KCUes6tCBh9WF4DjXxQzb1Whw== 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 4dVMW62lQ0z7Wd for ; Mon, 15 Dec 2025 14:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35172 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:14:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f6ad204da856 - stable/14 - libkern: Avoid a one-byte OOB access in strndup() 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f6ad204da856e722b4995f929a09c96ccc38d537 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:14:05 +0000 Message-Id: <694017ad.35172.319c6355@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f6ad204da856e722b4995f929a09c96ccc38d537 commit f6ad204da856e722b4995f929a09c96ccc38d537 Author: Mark Johnston AuthorDate: 2025-12-08 14:08:22 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:12:39 +0000 libkern: Avoid a one-byte OOB access in strndup() If the length of the string is maxlen, we would end up copying maxlen+1 bytes, which violates the contract of the function. The result is the same since that extra byte is overwritten. Reported by: Kevin Day Reviewed by: imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54093 (cherry picked from commit 73586fcea630c2c4fb83e966920c039aee8a5fc9) --- sys/libkern/strndup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/libkern/strndup.c b/sys/libkern/strndup.c index 9065153d7232..eb4bd88fa42b 100644 --- a/sys/libkern/strndup.c +++ b/sys/libkern/strndup.c @@ -41,9 +41,9 @@ strndup(const char *string, size_t maxlen, struct malloc_type *type) size_t len; char *copy; - len = strnlen(string, maxlen) + 1; - copy = malloc(len, type, M_WAITOK); + len = strnlen(string, maxlen); + copy = malloc(len + 1, type, M_WAITOK); memcpy(copy, string, len); - copy[len - 1] = '\0'; + copy[len] = '\0'; return (copy); } From nobody Mon Dec 15 14:16:12 2025 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 4dVMYT125nz6Kmlx for ; Mon, 15 Dec 2025 14:16:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMYS6LTKz3MDM for ; Mon, 15 Dec 2025 14:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808172; 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=PxAUc9CLyjmAGlk/PiRJnLXWAxHC4DehJiGNyB5sbY0=; b=ywmDI3cRNY+NyvquQOfPDTMshltNoxAv2b+pGSR19K1l3IgB4x+AL3A11EuEek5SFKixPV HyPaFtFJlX4m33YMJ3bKXOAL/7k6PFHHPGG8SRHRcOcPb08XymiEXMSbcaR9X7R3d8/hRd fPvKhPBoN2Ud+xm6j+3ampZdttwF2URtKpDkET1cXnChQ+UMY64n38SHwGRsYsdzw3TBOb FBSs4Q8epcFr90gBk5TZ04hTBB+HYJXfeKtq/29WiqgHVQQX5nOPFAwhK+hlw9HAK9wgdR EaqwjTrvy0XAFRvydMHRdzJyBUkYwVvLmZq52loIAEQiI7ZpKM2tRbQRDajPxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808172; 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=PxAUc9CLyjmAGlk/PiRJnLXWAxHC4DehJiGNyB5sbY0=; b=Qh1lGCaxTJO0bkwT2r8vdsAa6IwW/CmGtRDB/xKPIXzhfao58NciydY6vzd0aFe8efmC+g tu5ma8YDP22dfH/iDvP1Qh8nwaFFjQUUfmkp/OqFR8d70lbae/XcVC0m4w0YXWAWs2lUjK zopB8xGVMbHF8Vnb4d16hiYdaY344U3iBF08LUTblf0ZH/rQNYQIgHOmIszy3vWoOhSxkC UehSD9KA3boUeSG/yxcjI1Whw3PRqODk1l0NdYdNlxhEufkKRU/jdrgMKnCxqaZlLk+dK2 mwEPeR2hRxf7Ky6ocu4B/ZToemUxJe56RaNZ3dI/c1sTCBN9GJnq4OtnWEDkSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808172; a=rsa-sha256; cv=none; b=oQ+T4n9UonOh7wHHLdb4DqPvd3kHnZlGIAX3t9yqRxalAIz4bHMDT1URFuw+oN5mCgcsgN fdUTI5j1hrSTixs53Crgnl4SI644mlTRZzzdVUunwH3tD3mglLh2kyP5beHSgK6O41Rqmd oKqRi9zSJWQt0J7JhlLAjKodAzTIRpr2n98UwvTOJCSt24sysaZwWJ7nfwsBNfwaziC6ek iLnfLdOlSinb7srQpWbyUNQEQq4TkWpWATq37auwHwM5E3ezF90wQMMwy90wUY58TGX/vc x/WKsXXEkaUEklu+6G+0RmUPW+jhQxHNgyXbK+7E0Qp5zqOjEfjNE+Gzs6qoow== 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 4dVMYS5CmWz7Wx for ; Mon, 15 Dec 2025 14:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35911 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:16:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d988a0c1fc4c - stable/15 - zfs: Merge commit 86b064469dc9c2 from OpenZFS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d988a0c1fc4cf75d5c4c9820fd2a5619d59ac608 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:16:12 +0000 Message-Id: <6940182c.35911.46533941@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d988a0c1fc4cf75d5c4c9820fd2a5619d59ac608 commit d988a0c1fc4cf75d5c4c9820fd2a5619d59ac608 Author: Mark Johnston AuthorDate: 2025-12-14 17:20:38 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:09:15 +0000 zfs: Merge commit 86b064469dc9c2 from OpenZFS FreeBSD: Fix a potential null dereference in zfs_freebsd_fsync() In general it's possible for a vnode to not have an associated VM object. This happens in particular with named pipes, which have some distinct VOPs, defined in zfs_fifoops. Thus, this chunk of zfs_freebsd_fsync() needs to check for the FIFO case, like other vm_object_mightbedirty() callers do. (Note that vn_flush_cached_data() calls are predicated on zn_has_cached_data() returning true, and it checks for a NULL v_object pointer already.) Fixes: ef4058fcdc01838117dd93a654228bac7487a37c Reported-by: Collin Funk Reviewed-by: Sean Eric Fagan Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Mark Johnston Closes #18015 MFC after: 3 days (cherry picked from commit fa259d156d43966db95fe0f5cc15a0e6af206ff7) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 8a9d23d0d554..05ac77741d4f 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -5275,7 +5275,7 @@ zfs_freebsd_fsync(struct vop_fsync_args *ap) * Push any dirty mmap()'d data out to the DMU and ZIL, ready for * zil_commit() to be called in zfs_fsync(). */ - if (vm_object_mightbedirty(vp->v_object)) { + if (vp->v_object != NULL && vm_object_mightbedirty(vp->v_object)) { zfs_vmobject_wlock(vp->v_object); if (!vm_object_page_clean(vp->v_object, 0, 0, 0)) err = SET_ERROR(EIO); From nobody Mon Dec 15 14:16:13 2025 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 4dVMYV1yNzz6KmLj for ; Mon, 15 Dec 2025 14:16:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMYT5kGTz3M3m for ; Mon, 15 Dec 2025 14:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808173; 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=nGD7Siq8ayLcM/4bzo+d6wrba7KWqz3BNgr1Xcj1KlU=; b=A5MAbyIjzmG1dokQTCqc6NUCoR0x2G1hEFp9X9+oJVMQ9hpnspNkh90rbIpsT88hwW29Hs mfUWSbeRQLjEFmzZ1GWk+om+vYSTeM8n0KaHT/sEYs+nKUmW7Za1r8UgZiXlierkrqGOd9 aDe+E6+9fYmc9Q1R8W3B2ND7BlQpx7uy1rTxoy+CDhx5WeSmTHFWl0br66A6O694duIOxm WFKSSoWmoW1F1Yu7LHHagJiTkBDjwSSEKxUH790oXgNHKWtgHuJeDDMfQGpynsS30MahAF I+5b6CL3W9jJg7Gq5jqq8E+sy9+jKvWwpGc8+2xLxAagRj/uuL5fveY3V+2KJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808173; 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=nGD7Siq8ayLcM/4bzo+d6wrba7KWqz3BNgr1Xcj1KlU=; b=B5x/2vpyC0gVLrTBqmOTY+gCFd1gQc8OIG2ILlb2co/eo47fHDvfcO158KwKtdGXK5xJiW FyRQ7Qn7WDVIoX5TeWReYZ6fu+sLgSfZFjWnlICpNUesc+kihqQfSWrfsF5gAzzNQ+51La Ek55FmcN62DF8v/pLKtzQVU7KMB7NWI2B9tzYT/F46/Z2XkYI8sD/if5ad1nd3I4NnfuGD Q5F0WlRYX6T5HHL9rGpKp3nF3X7YG7JBKIumU/3s48tftzRgoTz4KgF33xCgQyjGlXL2Lx MJCm9jraKXjRAZBUO0C+eKaVq2gb9uwRG60SAxubaTvRtx2YbXbe5SM7PAlZLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808173; a=rsa-sha256; cv=none; b=Ew0/KG07js2LGhwgaEP2rG9DkKQq/wf7KNYGiVAhblcaJt3Qc3PjslSlH+k/fNc5Y82oqW UtRix3k7tePkrRYRmUC0YbjfLd2E6z3I0lVyUKoJCcSUCgsVOjTfm0H/8p9OIoSlDXDCVv JGE1UNzRXrkAu/Ae6TnnuPPRD/o8Bwui30fPW8C8LKXv5uaFhibdZ5OdjEhpSbUoUqGR/2 J6BQzzXJcjNcteTh1Hx17dW8WxMi7KWV36M/tE7cCXOPVz4WPs29bUQBt7isjw/qay3ZbX NiC09gjZT7pCC1v0WCzqAPgG5g+Q9RCUiW5PJIagx9ZgKSO4c/Lw098VteJLUA== 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 4dVMYT5FZWz7Wf for ; Mon, 15 Dec 2025 14:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35a0e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:16:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6162c06963ab - stable/15 - libkern: Avoid a one-byte OOB access in strndup() 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6162c06963abe3b56e7c26112052f541b4246bf7 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:16:13 +0000 Message-Id: <6940182d.35a0e.27377003@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6162c06963abe3b56e7c26112052f541b4246bf7 commit 6162c06963abe3b56e7c26112052f541b4246bf7 Author: Mark Johnston AuthorDate: 2025-12-08 14:08:22 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:09:37 +0000 libkern: Avoid a one-byte OOB access in strndup() If the length of the string is maxlen, we would end up copying maxlen+1 bytes, which violates the contract of the function. The result is the same since that extra byte is overwritten. Reported by: Kevin Day Reviewed by: imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54093 (cherry picked from commit 73586fcea630c2c4fb83e966920c039aee8a5fc9) --- sys/libkern/strndup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/libkern/strndup.c b/sys/libkern/strndup.c index 75b33339e1c7..1fbcfd28cae4 100644 --- a/sys/libkern/strndup.c +++ b/sys/libkern/strndup.c @@ -40,9 +40,9 @@ strndup(const char *string, size_t maxlen, struct malloc_type *type) size_t len; char *copy; - len = strnlen(string, maxlen) + 1; - copy = malloc(len, type, M_WAITOK); + len = strnlen(string, maxlen); + copy = malloc(len + 1, type, M_WAITOK); memcpy(copy, string, len); - copy[len - 1] = '\0'; + copy[len] = '\0'; return (copy); } From nobody Mon Dec 15 14:16:14 2025 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 4dVMYW2XXDz6KmNc for ; Mon, 15 Dec 2025 14:16:15 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMYV6j47z3MBC for ; Mon, 15 Dec 2025 14:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808175; 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=YXMM5VnGENOLweD/xeoktLb2tbW8DjrMOaTT6Gdc1ec=; b=K3YhptdzFyUb8pVll/51y1ywPp1ePy3SzM6/jROMnrv3Y+0lHdDL466tQbLOwRXQPIhlVd ZRFkenYAvdhwbgKY/3gGlLrf+/cfgyYBIv2N5zqJw9BbcBsG1oeQIsYcol6swqauyNXIjS ueaMrftIlj6hYbonBIWhMtOwcMNZBZ6LAoshKfP0SEfgCPbr6WvJ3kUDeyqMAgqjS8Su4Q InuyDvT9bKt3jSew7vWAFNlS7o21GKJpuUlRVxB9xEHgOOvtCIM6nsg+scE+5m0C53YKCo 5IFWciCjA/CtaISLjb9LfZEH+qEW+kS6mWsj79Uv1ygIf4O+UFKg9hmrkChuMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808175; 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=YXMM5VnGENOLweD/xeoktLb2tbW8DjrMOaTT6Gdc1ec=; b=K3J7sGz3WRzxMxoomXY6ksVM1vALJTX6iw3StFVpNTCGYPZGzPc8sY039YBnrE3o7J2UUU qq+oh9EmqkV9HJDenlhT03m7LvxZe4Dy7ZlFsHPcdWWRqswA4NRPq0mN1YzkEhFIIlTroO y8Yklh2foRBZZ3/LfAjQw0OMRPI/TCu0XCpeon0g5iUnH9Mq9Sv4jPRxmKCdirnCe5KtaN 0Zy8h0LUhNoCkG9kojCKUMcEewici/cNvB8vcM2WfwUzymLXeweWZQ8GWdms2UUZYrKp8o v0gbtsj69MOEo9vdrJhB0MxcrFeuuiQ9cNp49konlQYx9p8jKe4LU7Usy19BJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808175; a=rsa-sha256; cv=none; b=Ibs94MFwHdZxWYVjNMXQ5jNM2kQflpwN9hkitsjWUTzRZJRJ9OJz5HUSds2G3pN124Dhj8 ZZQ+KOnYdt+h8LezE8eTTT7EhqmH/5fkhghnFy3c+g2f21EgkFMf+YX663BD2x2yzeaLLr ohwSS4Wi44lcpO8c9KBOOvCwPM683qnUE2e82LvL9vt9b6ubdJ9cyrD1EP+0gFJAiX0/S6 3FCsH2E1u3U97x4G64fGxNIf1aEZ7JqKF62MNbDFhEZ6Jp5tczn7Jej6aCVy2LRJxAmYbn n2BZHJS1m60za9Xbarz4Rlbzo5xN30AF64B/EOLJoUU9Z8ab/ZWU3wf0jOlRzg== 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 4dVMYV62CTz7W4 for ; Mon, 15 Dec 2025 14:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34851 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:16:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 875df1296923 - stable/15 - pf: Fix an off-by-one in pf_handle_getcreators() 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 875df1296923dea30880d660f834cff43737d1f0 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:16:14 +0000 Message-Id: <6940182e.34851.ef65d9f@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=875df1296923dea30880d660f834cff43737d1f0 commit 875df1296923dea30880d660f834cff43737d1f0 Author: Mark Johnston AuthorDate: 2025-12-05 21:36:02 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:09:52 +0000 pf: Fix an off-by-one in pf_handle_getcreators() Reviewed by: kp Reported by: Kevin Day MFC after: 1 week Fixes: a7191e5d7b62 ("pf: add a way to list creator ids") Differential Revision: https://reviews.freebsd.org/D54083 (cherry picked from commit 0795e9b53cf5be68955b49dce87f4800fdfd4a89) --- sys/netpfil/pf/pf_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 73f018db0266..98d79729fb18 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -363,7 +363,7 @@ pf_handle_getcreators(struct nlmsghdr *hdr, struct nl_pstate *npt) bzero(creators, sizeof(creators)); - for (int i = 0; i < V_pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; From nobody Mon Dec 15 14:16:15 2025 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 4dVMYX3W9Gz6Kmpj for ; Mon, 15 Dec 2025 14:16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMYX097Yz3MBM for ; Mon, 15 Dec 2025 14:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808176; 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=ykgrqs1Nm0qRz+nPUwibsYT2ccf6pZuoI1kcIAUHd3U=; b=fOPcjKQfqO6KyuI2pGiaLIoolnsrUH0NUTJP+fTIEsM7TBc8j6STFamN3xhezG+iekesCd 7LWen28vOywt3MSzxtO1gnPWRdgCj/PE+ykfyNnvoFPv3YA8mF+eCS0V3RuQqGgS3eSUea H2zWxkAMe8oakzrvI/xTln3ew8ShyHiZH7PP1/hTQazpDyr2QccQLjIXUqACgxtUbZbahk 9+8Fh07sTmwi3rr+LTlNDf26tPnyP/zUMV6pZlKhfr3F7aJycvbk7rcueqWmBUQervlnjO hbsa7FSXyfWkuDXapK2ImT3MnnZZkfxAbrVgGnQwTAryEyVHQ8Yka573fiQDtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808176; 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=ykgrqs1Nm0qRz+nPUwibsYT2ccf6pZuoI1kcIAUHd3U=; b=PeBN/H2GTd/Me3l6IigayCg93mgR6V5sAGtRyzXCjr2Hsaa5KMZGQ8OaAlrq5Yhbg4+1C8 GeyTK5R71F6rDVOz7w8wUN2tzgl7beYHEFoOxIpbbDwoyGmdvnA/11JaKCQlqYhh2CmWD0 B51vVVbto5BD6UnFogkq3LAnJuvazophBmv3a7al8BN8xoro8X0SJSvnEedszIbqr0UAAI kzoSgNJ7YXRGNs+XBaMuwddAwnEbtzeFt3DL9csMI/oeRAkIzh/sY6U14+IV637k7KeUGO Tr0rnDKyJcxG7Qc4GzMUshQnsHeJ//fJ2XkXw7MN6XBUmtpt2mOSO+6hRysuEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808176; a=rsa-sha256; cv=none; b=Xf/sFkRwYAa/ci5hiz2VyzwTXeRrT9xiyLU6F4gpSpFB5rp5N+LwDluV4S3KapJsBIBA/B fGvspwhUzunbobQuVHNfb1D7b4N4YFBiKGy1I8lG+YEe74C1Ullkp3BXRO4Q65+R3wJIeh LpI6wNSznGwS8d9x2UqIKyvF5cx0uP3i8nRMrB0BhFUQSX9vZon3HliOyRKqni/AaQxQ/n AA/ZhhVbT4zhrndHBW1KTkphlyuqotd4ulEGtCt/iDS4LeQIsJKdqfnLPPixVCvGXd6voI Y71z3QEUTglgfH0BF8DonMIqA6eb5LFxWzcB6jjMpXGpqFhL+QvIXUdQ03Xrzg== 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 4dVMYW6s7Vz7Wj for ; Mon, 15 Dec 2025 14:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3572c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:16:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f7cd3d5368ca - stable/15 - linker: Avoid invoking eventhandlers on incompletely loaded files 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f7cd3d5368ca263a400b6da8eec032cb418a6a2b Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:16:15 +0000 Message-Id: <6940182f.3572c.203dc47c@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f7cd3d5368ca263a400b6da8eec032cb418a6a2b commit f7cd3d5368ca263a400b6da8eec032cb418a6a2b Author: Mark Johnston AuthorDate: 2025-11-26 18:15:48 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:10:05 +0000 linker: Avoid invoking eventhandlers on incompletely loaded files We do not invoke the kld_load eventhandler until after the file is fully linked, so don't invoke the kld_unload_try or kld_unload event handlers unless the file is fully linked either. In my case, the dtrace SDT kld_unload_try handler was running before relocations were processed against the file, and that caused problems when sdt_kld_unload_probes() accesses elements of a linker set. Move the kld_unload handler invocation earlier, to after sysuninits have been run. This is a bit more consistent with the kld_load handler. PR: 291238 Reviewed by: imp, emaste, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D53938 (cherry picked from commit 72b114169bd56ec157d746a2df87b3a4617065b3) --- sys/kern/kern_linker.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index d566bc01bc5e..5672f80b39d8 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -703,9 +703,11 @@ linker_file_unload(linker_file_t file, int flags) /* Give eventhandlers a chance to prevent the unload. */ error = 0; - EVENTHANDLER_INVOKE(kld_unload_try, file, &error); - if (error != 0) - return (EBUSY); + if ((file->flags & LINKER_FILE_LINKED) != 0) { + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + } KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -768,10 +770,12 @@ linker_file_unload(linker_file_t file, int flags) * Don't try to run SYSUNINITs if we are unloaded due to a * link error. */ - if (file->flags & LINKER_FILE_LINKED) { + if ((file->flags & LINKER_FILE_LINKED) != 0) { file->flags &= ~LINKER_FILE_LINKED; linker_file_unregister_sysctls(file); linker_file_sysuninit(file); + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); } TAILQ_REMOVE(&linker_files, file, link); @@ -788,9 +792,6 @@ linker_file_unload(linker_file_t file, int flags) LINKER_UNLOAD(file); - EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, - file->size); - if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; From nobody Mon Dec 15 14:16:17 2025 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 4dVMYY3nylz6KmXM for ; Mon, 15 Dec 2025 14:16:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMYY0h4vz3LsY for ; Mon, 15 Dec 2025 14:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808177; 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=pVna5Bgvpc/W4ErgQWhTtA+ZD8WMHfmFIVxxwhpu+oQ=; b=vm988OVur6ackjR7Z1Rhy94eCv8zcjUCunFtU5L+WDmmv1z8+WB5FuicrkapsOgzUpkEw8 nOtOVzlWfjI0MAIumMZE3hRx3u3l0/DaeXj37TPv781mKOdyLOLNyP6mDIxpVyM7ouSYeO pqz0K+BHhDCcz00MqFbMSWFQU268KYAZNJ+w0XDBPwhNP2Qcl54o5bgGtGKyY6KMhRavO+ EEHgDj9Ph53j/xs7vm0P6MzHJEEF1eZEjbGwlpG0fU6HQLVNPKErAGOzjFJ0TxPWcX8Ztk J9uPCxjpRBxvYQ7DyJ/TxzJo0SZXzg1hADMwuTgo1LRGkTjOluW07hA9bm4MoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808177; 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=pVna5Bgvpc/W4ErgQWhTtA+ZD8WMHfmFIVxxwhpu+oQ=; b=EgqE7C7+gYucOOk18xiv+ZiSmiirLGologQFBnWY5aZz+GKaJe43oC1EfMhKloSdRwpM// eb3JDQ/5AyiVmQHrUlEMVmnOGqAYMQ/jjKl4FBJgxkuLLx21IXo1UYJwB297FlSSO+hQ/c XZh7dE+lsrOX9xDfwrUJwtttCJ9ut6zMfr+sXDao5MLExjswk8qMWepgPGCr2yBYrVl91q haLTK0ghZY/XruUZ4YmTEwp+xM35GwGMbUP9GeUImL5BkzCNGfcWJbCnLsGbcZVj1cboFM +weEurkuPUa7aEyvqueopoEDQGilSkdTzxNPzPurI6pzuz0JITo4OPo/zp2OTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808177; a=rsa-sha256; cv=none; b=Jnsiq5AoRTF/+ayB/pUCbpCKsx/zsz9gdfDAeN3P9jXbaPbkIfN5UTAkxrUjHZ/EEvBm2c aKuXbXKm0Pd1kwu969mZH5m2cXNZcnw2RsMXkJ1ny5Y6meM6B9+94Mna0GPOcMvJ1inWAt QdHYaGYe061ZdqsYziE+4v8dnpYsllweisqhQhvqxUkk7jrXwPQtCGFWUinxEJuQHRud+N xteHC2vRSUCMiJZJ13nHEEqfoKyVd5PpyLBVbrIcaUdtyZJ6tfzuBYLQXhEuaw/QIqtFsM yehsKCIH89JBT8Y0HlltaaozlHZNBtpjjhyYta45Y0mEu5KsLGOcYpM81cfWaA== 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 4dVMYY0Cb3z7jW for ; Mon, 15 Dec 2025 14:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35176 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:16:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1910f18b00fc - stable/15 - pf: Fix error handling in pf_handle_get_tstats() 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1910f18b00fcda5e5b64087d5da140bc2ec7f779 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:16:17 +0000 Message-Id: <69401831.35176.5951a660@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1910f18b00fcda5e5b64087d5da140bc2ec7f779 commit 1910f18b00fcda5e5b64087d5da140bc2ec7f779 Author: Mark Johnston AuthorDate: 2025-12-08 14:09:02 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:10:13 +0000 pf: Fix error handling in pf_handle_get_tstats() - pfr_table_count() can return an error. - We must check for failure from mallocarray(M_NOWAIT). Fixes: 9e8d2962aad3 ("pf: convert DIOCRGETTSTATS to netlink") Reported by: Kevin Day Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54094 (cherry picked from commit 0f0662c6b4cc611d6e400f823656f908ffce5c04) --- sys/netpfil/pf/pf_nl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 98d79729fb18..9fc3c67bfb58 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1950,8 +1950,18 @@ pf_handle_get_tstats(struct nlmsghdr *hdr, struct nl_pstate *npt) PF_RULES_RLOCK(); n = pfr_table_count(&attrs.pfrio_table, attrs.pfrio_flags); + if (n < 0) { + PF_RULES_RUNLOCK(); + PF_TABLE_STATS_UNLOCK(); + return (EINVAL); + } pfrtstats = mallocarray(n, sizeof(struct pfr_tstats), M_PF, M_NOWAIT | M_ZERO); + if (pfrtstats == NULL) { + PF_RULES_RUNLOCK(); + PF_TABLE_STATS_UNLOCK(); + return (ENOMEM); + } error = pfr_get_tstats(&attrs.pfrio_table, pfrtstats, &n, attrs.pfrio_flags | PFR_FLAG_USERIOCTL); From nobody Mon Dec 15 14:16:18 2025 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 4dVMYZ4xTFz6Kmrc for ; Mon, 15 Dec 2025 14:16:18 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMYZ13dFz3MDq for ; Mon, 15 Dec 2025 14:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808178; 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=PINrA07mZ7vf9+G9ZmPAW2eTSt09RBl42vjxdAsWwKI=; b=N+CZqz3d7FDjB92LoKJCdp9RHW5zA8IzDJT8Woqb5tkCwZqiNwEGDgxlUPILtzN7KOsgIW +C/HZQ6n4aF4+Q3V+E4ab4Fanr2cypPzkfri1+H6B0sQanR38GwlXbgSxUjFky5VnVfIO2 yHveGWjP4Ys300Kq2w7xnKYZ1PPkPMyn+SzuivDgIHEV8L785Xiv6sVe18KcseESKPwKqJ IJpxr9uhsSO3ANPibOyneVjsYWiPqYRnHhX/hu7newbfjaxGZjxUMBpiu/PTKB1DUYIEL7 sAZq4bdVM6kYUzfjo2JbTHPZjjnaHnaZ+LDp/FGWdOlsGube/4E/+Muz98Mseg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808178; 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=PINrA07mZ7vf9+G9ZmPAW2eTSt09RBl42vjxdAsWwKI=; b=ZM42XxfwSF0y/+cSpQcgI80TSV9rvg7DHD+jvOzTPEW9EkXuIP3c/kFaccoWYg2RoNNL9N YHOYBFH6p59sHEmoYy+FCrIpqrYK/J1R7FLQhqRBoWsd5ieyia2HYjZ/dTgJSmxgRATf4B rw6mAgJ5h1V3qxyDsXuvqH16eOTPka95299baRs4iM+YT4yVIg3KQNePk0oAY201YUoRVn z4UA6P+y2X6gS2LT1O0WmUj1wayV/A0rwZ870x2vg3+5AK/zoMVHlHDL9vMOmtJah71ppN Octhl0DkGDznd2q2ov28ZYzbs+Hzf7K2bB+MVtUZsqzSQCTbKoMt90EtivZgqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808178; a=rsa-sha256; cv=none; b=Qgbah+kLIWhn0ZnV91do7dWKxSOCWcu/55IPGkd1wiHBh9WEVvonPolYSWGNknkbW/hR4I yGt/zaqBNBW1wgxckqNcaJCIaNZg0JsLa8JD7PUocF4eu2NJQNLhdz8XF5APAakp/TeNG9 182r90sZKY7CrFaeSseS6thvTSp9HWCI/nGr1ITWxYaPHrysuKulVie2jFUNijDXB5K3Y+ cI6HokSg6rcREt0MM6E13p94VM7EFjgdL4O1ghIZNUrzJDFIQoJRSJR/C5ua65JabegpF8 EVl94CZWv4R6W0ur2A23XMBE+e6dR4OZGI5TfeaHn2TYPh0JFxEeQrsst613dg== 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 4dVMYZ0bpxz7X1 for ; Mon, 15 Dec 2025 14:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35fef by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:16:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: dd38b346ad17 - stable/15 - rtsold: Fix a buffer leak if we fail to read the default router sysctl 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: dd38b346ad17faf5fc76ab288272ca0768516c4d Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:16:18 +0000 Message-Id: <69401832.35fef.6b93a347@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dd38b346ad17faf5fc76ab288272ca0768516c4d commit dd38b346ad17faf5fc76ab288272ca0768516c4d Author: Mark Johnston AuthorDate: 2025-12-04 15:00:46 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 14:10:25 +0000 rtsold: Fix a buffer leak if we fail to read the default router sysctl MFC after: 1 week Reported by: Kevin Day (cherry picked from commit 792221630bf4e58fcd923547bab689f4497613d8) --- usr.sbin/rtsold/cap_sendmsg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rtsold/cap_sendmsg.c b/usr.sbin/rtsold/cap_sendmsg.c index 6e7f156fbe62..36c68b7ba78d 100644 --- a/usr.sbin/rtsold/cap_sendmsg.c +++ b/usr.sbin/rtsold/cap_sendmsg.c @@ -151,8 +151,10 @@ probe_defrouters(uint32_t ifindex, uint32_t linkid) buf = malloc(len); if (buf == NULL) return (-1); - if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) { + free(buf); return (-1); + } ep = (struct in6_defrouter *)(void *)(buf + len); for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { if (ifindex != p->if_index) From nobody Mon Dec 15 14:23:16 2025 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 4dVMjc4JPfz6KnV2 for ; Mon, 15 Dec 2025 14:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVMjc33lQz3PhR for ; Mon, 15 Dec 2025 14:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808596; 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=/FqaQBSuGf2hrknUUkxDmJpP5P/krslFV9X9UMQSQig=; b=TvB256CSsCfCZ+wKxqd3bLw3hrR1KUFTzGf2jpHaQTBS9Lvlhe0MXfIu4hD79taHqZHHZ0 OSRcATH4PHZOSP0rHge/vdxesp3vhiLEbWbzp22REm1CGQH0lELP7HNF+b1bEbScvOyqSc jEmVlX80VFE+edM6fPPsxtNV9O5lbVX+7mX+SAavPutMqcBHaec/tdejImGJmJXZcFqUJ3 DkJ1xcnrL5AwHDD43bOMiKQr8pCJu3i7O3BKZNDeAo3G6WQQp5qXh/OrUmA/ShDkFqfcv8 ItJVirXND0mAwGmqnbRz0Wq4Z/csQ7MhXrSsWNSS201Ek6J4vbRqIM2/OIxURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765808596; 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=/FqaQBSuGf2hrknUUkxDmJpP5P/krslFV9X9UMQSQig=; b=UdsFxvX45DhXhkRfYcOSyTJFDaAjzuqYyf5MBMsmuNskIWyiBG/ZnwEP01yI6bXh+ZX994 Jwoo1RWM+Gh7ii0MDPEohesCBhzlFsJh2KbSX6WC8eylxrpK1QGgXvYzES8Zj8wTlbnB8N r6zCSQIq8BM3YgooL28hBf55RYigMsl/ePvi8shlN1MCCkLtDlEpwWYUgyoql1KNhC5Su0 ackC7F47GXSwXloSeV3zDIQkzNwczrsDmH1lo+37gbSKuaWRQCgIMZgja3iUlKDKfuxLsS OlI+gX5wcLbNZ6rvqH2oqV0MWHN8w0N1JZZKUIaoPT773FouVjv6/sdDyl7M6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765808596; a=rsa-sha256; cv=none; b=G/Tbre1v+t3FL+tBDFPubCCvyzFVdSNsQYDd4pUsiXC6BkFiuHhOh+ywh01gBcG3IgUAbM oI0zsWK8Bvip6wwKdxrET1Qq02ei8Xvf6rUz9L3gogUKBS5UPWt3b+5b1Ac4Ub1mpWoIVA Zq/USK+yqaV+4Ge7i9gLRxhEUYpj3birN1fxOs0uqnSN3NxjTR1Gii9D2K95xbRCHeq/lX gbAjzw1/VpDdPqcyWOkh9unTn07lky65rS3PcB5yoFRbN3CoknfQBLp4JwT4hJJYsFuvi0 0HBmH5THqeEUMBG8wcQgHGsVEncukoI+hpLkaHD8aNTopP/7vsqqhgvo7Kr02Q== 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 4dVMjc2Th5z7Xy for ; Mon, 15 Dec 2025 14:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3583b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:23:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 76fb453e63f2 - stable/15 - libpam: Add newline at EOF in modules.inc 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 76fb453e63f26a27e2add06b0062d9444c0dd202 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:23:16 +0000 Message-Id: <694019d4.3583b.5934c7ab@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=76fb453e63f26a27e2add06b0062d9444c0dd202 commit 76fb453e63f26a27e2add06b0062d9444c0dd202 Author: Ed Maste AuthorDate: 2025-10-15 15:30:43 +0000 Commit: Ed Maste CommitDate: 2025-12-15 14:22:20 +0000 libpam: Add newline at EOF in modules.inc (cherry picked from commit 2976a7ce2e9b0ba1f59601218583c6330776f401) --- lib/libpam/modules/modules.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpam/modules/modules.inc b/lib/libpam/modules/modules.inc index f3ab65333f4f..1e9eb8970317 100644 --- a/lib/libpam/modules/modules.inc +++ b/lib/libpam/modules/modules.inc @@ -30,4 +30,4 @@ MODULES += pam_ssh .endif MODULES += pam_tacplus MODULES += pam_unix -MODULES += pam_xdg \ No newline at end of file +MODULES += pam_xdg From nobody Mon Dec 15 14:42:51 2025 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 4dVN8C749mz6KpyM for ; Mon, 15 Dec 2025 14:42:51 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVN8C3r1Hz3RNT for ; Mon, 15 Dec 2025 14:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765809771; 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=N2ZhpSEnAFpEJjLEU7i86heC0JLdEUZsF67Szvpqobg=; b=K11O+VF9JSpMBziVkBmTRBWjLDB92/ph+UDAsGa5aZ4u+Wfsk2vNKZSlxBO6+UBxBkzb20 tB44k25OLuJ9hfnq9aKGkHVUXCu6ovnV9pkQF8g/n5w9wZYqN+9d4nS3T1gvKshlE+Aabe Zg72WcCb3r8xbmM+k129LLV8AIDbDFUbIsKPOHWAG/7Iyaze8p+xVJlej8lz3/EwyTyelW xcCsWWJgE0yhZMw+jm6yVpKYzcYlovTEbigBgt4dl6obmdfRoqMj8exJeObeXGpt9cVj2i MOEfZElToyI9ysd7PAxIAEg7L90Xymm2stHfrEfBUgtnRDc2kOehHlUYUU6ZeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765809771; 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=N2ZhpSEnAFpEJjLEU7i86heC0JLdEUZsF67Szvpqobg=; b=kpBD+qGqHpXrCJ7Ycmp3LPH0YPj8VGCGBk19JniHyTgD+94F8Y4kxT+nNSriuj33o/iQC7 tpdjyZY/oD4drfeMmKu/OSsqNyZaLWslSmOvZU089u2AGHpfwNGb9ACucEm1Y1BsPr8Xs9 5zYKWFSNYXUEXRWe9l0F1F8fz9ffr3j3o9SnOyZ2mBS29ZnoR7uCSyUcptbXZ8hHzEdLXo pGNB4X/nGznEC01wdKRNcQTK1bkmAoZwl6aZmBA7HiiD567tx7EIh0P0AtycGk10FfrnHF vQCgGCadZRTVNFUwDoZwpUdjhFsq1HZyDVJ3ZL9Xawau5Vk7jEVzp3jPOjwI9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765809771; a=rsa-sha256; cv=none; b=Fz8FjVTkzbSKRKgZowLVv9lAkhIJDPkwVE1BtDdHWByty0PrK6rZNNtJlJBgsrF2HM3a5E UUOpyKyDehUMiaHNkveY64HV5dP3fuCLB8ufI1XLWvaLTULUrXPy+ttACEQMHha9spzhBa QKlbltIOAb7B4cjfB02uOmAYXh+KVEF7zbptk0oG33+51Sv5gp/kkDIfs45JK1lOlUT61t 3XAti12Pg/J8tIZn/sArUgG741xuhijdghtrSUfIGO/qwqpIh/pKEH2NlYKdzefgaL1QMK CpLlv93x44gqkV0t+J0ozXms+8Wom/4SQmsVtCGxpG4XBaJTCLr3JjiunvqrVA== 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 4dVN8C3NvFz7YD for ; Mon, 15 Dec 2025 14:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38a88 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:42:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e69c36339eba - stable/15 - ministat: Clean up usage message, manual page, and chameleon 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e69c36339ebafc8b9b95fbf31ea22b7fded391e8 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:42:51 +0000 Message-Id: <69401e6b.38a88.59779de7@gitrepo.freebsd.org> The branch stable/15 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=e69c36339ebafc8b9b95fbf31ea22b7fded391e8 commit e69c36339ebafc8b9b95fbf31ea22b7fded391e8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-11-12 15:06:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 14:42:47 +0000 ministat: Clean up usage message, manual page, and chameleon In the manual page: - Fix synopsis and use better argument names - Improve description of flags. - In EXAMPLES, list the contents of iguana and chameleon files. - Use Rs to reference The Cartoon Guide to Statistics - Fix misc indentation and style issues - Tag SPDX MFC after: 1 week Reviewed by: bcr, ziaee Differential Revision: https://reviews.freebsd.org/D53710 (cherry picked from commit 9d17b61b2fd254b418f3dd6b7a64afbc861a57f8) --- usr.bin/ministat/chameleon | 2 +- usr.bin/ministat/ministat.1 | 146 +++++++++++++++++++++++++++++--------------- usr.bin/ministat/ministat.c | 2 +- 3 files changed, 98 insertions(+), 52 deletions(-) diff --git a/usr.bin/ministat/chameleon b/usr.bin/ministat/chameleon index ed1bfdbc4773..dfb1923c000f 100644 --- a/usr.bin/ministat/chameleon +++ b/usr.bin/ministat/chameleon @@ -1,5 +1,5 @@ 150 400 -720 +720 500 930 diff --git a/usr.bin/ministat/ministat.1 b/usr.bin/ministat/ministat.1 index cef7caa7b9d9..437fd66a1ddc 100644 --- a/usr.bin/ministat/ministat.1 +++ b/usr.bin/ministat/ministat.1 @@ -1,6 +1,7 @@ .\" -.\" Copyright (c) 2007 Poul-Henning Kamp -.\" All rights reserved. +.\" Copyright (c) 2007 Poul-Henning Kamp. All rights reserved. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 10, 2012 +.Dd November 13, 2025 .Dt MINISTAT 1 .Os .Sh NAME @@ -33,9 +34,9 @@ .Nm .Op Fl Anqs .Op Fl C Ar column -.Op Fl c Ar confidence_level -.Op Fl d Ar delimiter -.Op Fl w Op width +.Op Fl c Ar confidence +.Op Fl d Ar delimiters +.Op Fl w Ar width .Op Ar .Sh DESCRIPTION The @@ -44,10 +45,26 @@ command calculates fundamental statistical properties of numeric data in the specified files or, if no file is specified, standard input. .Pp The options are as follows: -.Bl -tag -width Fl +.Bl -tag -width "-c confidence" .It Fl A Just report the statistics of the input and relative comparisons, suppress the ASCII-art plot. +.It Fl C Ar column +Specify which column of data to use. +By default the first column in the input file(s) is used. +.It Fl c Ar confidence +Specify desired confidence level for Student's T analysis. +Possible percent values are +.Cm 80 , 90 , 95 , 98 , 99 , +and +.Cm 99.5 . +.It Fl d Ar delimiters +Specify the column delimiter characters, default is +.Ql \ \et +.Pq i.e., a space and a tab . +See +.Xr strtok 3 +for details. .It Fl n Just report the raw statistics of the input, suppress the ASCII-art plot and the relative comparisons. @@ -58,75 +75,104 @@ alongside .It Fl s Print the average/median/stddev bars on separate lines in the ASCII-art plot, to avoid overlap. -.It Fl C Ar column -Specify which column of data to use. -By default the first column in the input file(s) are used. -.It Fl c Ar confidence_level -Specify desired confidence level for Student's T analysis. -Possible values are 80, 90, 95, 98, 99 and 99.5 % -.It Fl d Ar delimiter -Specifies the column delimiter characters, default is SPACE and TAB. -See -.Xr strtok 3 -for details. .It Fl w Ar width -Width of ASCII-art plot in characters. +Set the width of the ASCII-art plot in characters. The default is the terminal width, or 74 if standard output is not a terminal. .El .Pp +.Nm +accepts up to seven input files. +.Pp +Each dataset must contain at least three values. +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Let's consider two input files. +The first one will be +.Dq iguana : +.Bd -literal -offset indent +50 +200 +150 +400 +750 +400 +150 +.Ed +.Pp +The second one will be +.Dq chameleon : +.Bd -literal -offset indent +150 +400 +720 +500 +930 +.Ed +.Pp A sample output could look like this: .Bd -literal -offset indent - $ ministat -s -w 60 iguana chameleon - x iguana - + chameleon - +------------------------------------------------------------+ - |x * x * + + x +| - | |________M______A_______________| | - | |________________M__A___________________| | - +------------------------------------------------------------+ - N Min Max Median Avg Stddev - x 7 50 750 200 300 238.04761 - + 5 150 930 500 540 299.08193 - No difference proven at 95.0% confidence +$ ministat -s -w 60 iguana chameleon +x iguana ++ chameleon ++------------------------------------------------------------+ +|x * x * + + x +| +| |________M______A_______________| | +| |________________M__A___________________| | ++------------------------------------------------------------+ + N Min Max Median Avg Stddev +x 7 50 750 200 300 238.04761 ++ 5 150 930 500 540 299.08193 +No difference proven at 95.0% confidence .Ed .Pp If .Nm tells you, as in the example above, that there is no difference -proven at 95% confidence, the two data sets you gave it are for +proven at 95% confidence, the two datasets you gave it are for all statistical purposes identical. .Pp You have the option of lowering your standards by specifying a lower confidence level: .Bd -literal -offset indent - $ ministat -s -w 60 -c 80 iguana chameleon - x iguana - + chameleon - +------------------------------------------------------------+ - |x * x * + + x +| - | |________M______A_______________| | - | |________________M__A___________________| | - +------------------------------------------------------------+ - N Min Max Median Avg Stddev - x 7 50 750 200 300 238.04761 - + 5 150 930 500 540 299.08193 - Difference at 80.0% confidence - 240 +/- 212.215 - 80% +/- 70.7384% - (Student's t, pooled s = 264.159) +$ ministat -s -w 60 -c 80 iguana chameleon +x iguana ++ chameleon ++------------------------------------------------------------+ +|x * x * + + x +| +| |________M______A_______________| | +| |________________M__A___________________| | ++------------------------------------------------------------+ + N Min Max Median Avg Stddev +x 7 50 750 200 300 238.04761 ++ 5 150 930 500 540 299.08193 +Difference at 80.0% confidence + 240 +/- 212.215 + 80% +/- 70.7384% + (Student's t, pooled s = 264.159) .Ed .Pp But a lower standard does not make your data any better, and the example is only included here to show the format of the output when a statistical difference is proven according to Student's T method. .Sh SEE ALSO -Any mathematics text on basic statistics, for instances Larry Gonicks -excellent "Cartoon Guide to Statistics" which supplied the above example. +Any mathematics text on basic statistics, for instance the following book, +which supplied the above example: +.Rs +.%A Larry Gonick +.%A Woollcott Smith +.%B The Cartoon Guide to Statistics +.%D 1993 +.%I HarperPerennial +.%O ISBN 0-06-273102-5 +.Re .Sh HISTORY The .Nm -command was written by Poul-Henning Kamp out of frustration +command was written by +.An Poul-Henning Kamp +out of frustration over all the bogus benchmark claims made by people with no understanding of the importance of uncertainty and statistics. .Pp diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index 6967841a339f..7d3232370121 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -530,7 +530,7 @@ usage(char const *whine) fprintf(stderr, "%s\n", whine); fprintf(stderr, - "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Anqs] [-w width] [file [file ...]]\n"); + "Usage: ministat [-Anqs] [-C column] [-c confidence] [-d delimiter(s)] [-w width] [file ...]]\n"); fprintf(stderr, "\tconfidence = {"); for (i = 0; i < NCONF; i++) { fprintf(stderr, "%s%g%%", From nobody Mon Dec 15 14:43:01 2025 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 4dVN8P5sX5z6Kpn6 for ; Mon, 15 Dec 2025 14:43:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVN8P4g6Kz3RZf for ; Mon, 15 Dec 2025 14:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765809781; 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=nEYfR5BKOQf3wF5RUF/TdWjJwMPp5seIJ3GDfT3sHQg=; b=tWYQMFDpXU0uLWjjYoyJXLafIKmcOuCLc3aIirKVZJKkR/3SNicsFfbmMN+lgNuzbHfYRu 3/6fxecVFfZdhZCvNFnFK73y7e+Wp8DZ5scKzN10N6BqmRZd+N+K0HZk5L0hbLknSmlO+Q gpeSrM0jKhA34OKjbyF/2/FoQ82a9WjlhA/hZIWPArk2GUl+SRfYuHhVHeNoOH1ktg3pu+ jNmGDswklyNNn/jcXmeTBjZx8CI6PBK+hDdVP29Efph5MjuQo/r39AhDFADNAStkZdCqbS 6MhRMlyFarjC9znR+OwWVQIN9v4MXOwqEm2Co3ccWg5fbDYn6kgDd4Ekh4Sp2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765809781; 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=nEYfR5BKOQf3wF5RUF/TdWjJwMPp5seIJ3GDfT3sHQg=; b=B/rQaM3tfUnkSUBBeBWDH0+30kiD9gAEHLaxOMJAw5YQ3EUfiBxGwdJPM8RXKpxDUfLbIt SOlZshX7pyXrMAFBswCUp7tGUgJSJeh4xCOJzTEma4DDxs9M7VzsZpvJlYiJUBqqglU5oB IMsuEjgei6dWsdW9eDlx+RGyzwB4X+e799LUZhDpBsrhdX5a685XGH3f0IIpOMbzR1xdS+ D4T1MQlRHpuKaCT2+9/34RGa4mI2jtgCfQW9RQE+NqJDE7VaNwa5ahVg0e69sreWm+PI1L QZhZLOp9sJWCQ28sz55tBc13MjEtZYnoXV5HXzTQjiDYVshKav6zhk107TjEHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765809781; a=rsa-sha256; cv=none; b=tgHuF8gOEb8IYaYpjuR8hINvNiLc7SwRtpRCUtmGn9KLXjAY8XOnrnFAm6NHYjCtRCxGW7 n3u+iLsRk7OpvLPZDDmqJ/Fs3mfeHAIebk3YHuh7IfX8Czh7enZFZ1uy2lHWU7tDnnWaw8 YEQwHFHPWwbrX4OI9mINPFqNbQTfGEz3DJCl07tBLVDYBmkOKlCfpt75DcSzpxaClipaEu mqanbxnKD7vBHlXzwQ0kCc0eIvICUo4So6rKUx1CnLbq9yWOxL3F0Pe8Z4hIrl/Ww2RsIp EF3UeQ8Nh+XUIoA0pbiPQlhTCkptIbIjPVob14IPKoXPHI/TdkAB6jZy4U6m0A== 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 4dVN8P40cbz8ST for ; Mon, 15 Dec 2025 14:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36a35 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:43:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: d01fd1a51fd4 - stable/14 - ministat: Clean up usage message, manual page, and chameleon 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d01fd1a51fd45cba3b3b3ed23913c4ea2be1462a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:43:01 +0000 Message-Id: <69401e75.36a35.2ac8c127@gitrepo.freebsd.org> The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=d01fd1a51fd45cba3b3b3ed23913c4ea2be1462a commit d01fd1a51fd45cba3b3b3ed23913c4ea2be1462a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-11-12 15:06:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 14:42:54 +0000 ministat: Clean up usage message, manual page, and chameleon In the manual page: - Fix synopsis and use better argument names - Improve description of flags. - In EXAMPLES, list the contents of iguana and chameleon files. - Use Rs to reference The Cartoon Guide to Statistics - Fix misc indentation and style issues - Tag SPDX MFC after: 1 week Reviewed by: bcr, ziaee Differential Revision: https://reviews.freebsd.org/D53710 (cherry picked from commit 9d17b61b2fd254b418f3dd6b7a64afbc861a57f8) --- usr.bin/ministat/chameleon | 2 +- usr.bin/ministat/ministat.1 | 146 +++++++++++++++++++++++++++++--------------- usr.bin/ministat/ministat.c | 2 +- 3 files changed, 98 insertions(+), 52 deletions(-) diff --git a/usr.bin/ministat/chameleon b/usr.bin/ministat/chameleon index ed1bfdbc4773..dfb1923c000f 100644 --- a/usr.bin/ministat/chameleon +++ b/usr.bin/ministat/chameleon @@ -1,5 +1,5 @@ 150 400 -720 +720 500 930 diff --git a/usr.bin/ministat/ministat.1 b/usr.bin/ministat/ministat.1 index cef7caa7b9d9..437fd66a1ddc 100644 --- a/usr.bin/ministat/ministat.1 +++ b/usr.bin/ministat/ministat.1 @@ -1,6 +1,7 @@ .\" -.\" Copyright (c) 2007 Poul-Henning Kamp -.\" All rights reserved. +.\" Copyright (c) 2007 Poul-Henning Kamp. All rights reserved. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 10, 2012 +.Dd November 13, 2025 .Dt MINISTAT 1 .Os .Sh NAME @@ -33,9 +34,9 @@ .Nm .Op Fl Anqs .Op Fl C Ar column -.Op Fl c Ar confidence_level -.Op Fl d Ar delimiter -.Op Fl w Op width +.Op Fl c Ar confidence +.Op Fl d Ar delimiters +.Op Fl w Ar width .Op Ar .Sh DESCRIPTION The @@ -44,10 +45,26 @@ command calculates fundamental statistical properties of numeric data in the specified files or, if no file is specified, standard input. .Pp The options are as follows: -.Bl -tag -width Fl +.Bl -tag -width "-c confidence" .It Fl A Just report the statistics of the input and relative comparisons, suppress the ASCII-art plot. +.It Fl C Ar column +Specify which column of data to use. +By default the first column in the input file(s) is used. +.It Fl c Ar confidence +Specify desired confidence level for Student's T analysis. +Possible percent values are +.Cm 80 , 90 , 95 , 98 , 99 , +and +.Cm 99.5 . +.It Fl d Ar delimiters +Specify the column delimiter characters, default is +.Ql \ \et +.Pq i.e., a space and a tab . +See +.Xr strtok 3 +for details. .It Fl n Just report the raw statistics of the input, suppress the ASCII-art plot and the relative comparisons. @@ -58,75 +75,104 @@ alongside .It Fl s Print the average/median/stddev bars on separate lines in the ASCII-art plot, to avoid overlap. -.It Fl C Ar column -Specify which column of data to use. -By default the first column in the input file(s) are used. -.It Fl c Ar confidence_level -Specify desired confidence level for Student's T analysis. -Possible values are 80, 90, 95, 98, 99 and 99.5 % -.It Fl d Ar delimiter -Specifies the column delimiter characters, default is SPACE and TAB. -See -.Xr strtok 3 -for details. .It Fl w Ar width -Width of ASCII-art plot in characters. +Set the width of the ASCII-art plot in characters. The default is the terminal width, or 74 if standard output is not a terminal. .El .Pp +.Nm +accepts up to seven input files. +.Pp +Each dataset must contain at least three values. +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Let's consider two input files. +The first one will be +.Dq iguana : +.Bd -literal -offset indent +50 +200 +150 +400 +750 +400 +150 +.Ed +.Pp +The second one will be +.Dq chameleon : +.Bd -literal -offset indent +150 +400 +720 +500 +930 +.Ed +.Pp A sample output could look like this: .Bd -literal -offset indent - $ ministat -s -w 60 iguana chameleon - x iguana - + chameleon - +------------------------------------------------------------+ - |x * x * + + x +| - | |________M______A_______________| | - | |________________M__A___________________| | - +------------------------------------------------------------+ - N Min Max Median Avg Stddev - x 7 50 750 200 300 238.04761 - + 5 150 930 500 540 299.08193 - No difference proven at 95.0% confidence +$ ministat -s -w 60 iguana chameleon +x iguana ++ chameleon ++------------------------------------------------------------+ +|x * x * + + x +| +| |________M______A_______________| | +| |________________M__A___________________| | ++------------------------------------------------------------+ + N Min Max Median Avg Stddev +x 7 50 750 200 300 238.04761 ++ 5 150 930 500 540 299.08193 +No difference proven at 95.0% confidence .Ed .Pp If .Nm tells you, as in the example above, that there is no difference -proven at 95% confidence, the two data sets you gave it are for +proven at 95% confidence, the two datasets you gave it are for all statistical purposes identical. .Pp You have the option of lowering your standards by specifying a lower confidence level: .Bd -literal -offset indent - $ ministat -s -w 60 -c 80 iguana chameleon - x iguana - + chameleon - +------------------------------------------------------------+ - |x * x * + + x +| - | |________M______A_______________| | - | |________________M__A___________________| | - +------------------------------------------------------------+ - N Min Max Median Avg Stddev - x 7 50 750 200 300 238.04761 - + 5 150 930 500 540 299.08193 - Difference at 80.0% confidence - 240 +/- 212.215 - 80% +/- 70.7384% - (Student's t, pooled s = 264.159) +$ ministat -s -w 60 -c 80 iguana chameleon +x iguana ++ chameleon ++------------------------------------------------------------+ +|x * x * + + x +| +| |________M______A_______________| | +| |________________M__A___________________| | ++------------------------------------------------------------+ + N Min Max Median Avg Stddev +x 7 50 750 200 300 238.04761 ++ 5 150 930 500 540 299.08193 +Difference at 80.0% confidence + 240 +/- 212.215 + 80% +/- 70.7384% + (Student's t, pooled s = 264.159) .Ed .Pp But a lower standard does not make your data any better, and the example is only included here to show the format of the output when a statistical difference is proven according to Student's T method. .Sh SEE ALSO -Any mathematics text on basic statistics, for instances Larry Gonicks -excellent "Cartoon Guide to Statistics" which supplied the above example. +Any mathematics text on basic statistics, for instance the following book, +which supplied the above example: +.Rs +.%A Larry Gonick +.%A Woollcott Smith +.%B The Cartoon Guide to Statistics +.%D 1993 +.%I HarperPerennial +.%O ISBN 0-06-273102-5 +.Re .Sh HISTORY The .Nm -command was written by Poul-Henning Kamp out of frustration +command was written by +.An Poul-Henning Kamp +out of frustration over all the bogus benchmark claims made by people with no understanding of the importance of uncertainty and statistics. .Pp diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index 23d4fc0271ec..808f65c63c79 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -531,7 +531,7 @@ usage(char const *whine) fprintf(stderr, "%s\n", whine); fprintf(stderr, - "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Anqs] [-w width] [file [file ...]]\n"); + "Usage: ministat [-Anqs] [-C column] [-c confidence] [-d delimiter(s)] [-w width] [file ...]]\n"); fprintf(stderr, "\tconfidence = {"); for (i = 0; i < NCONF; i++) { fprintf(stderr, "%s%g%%", From nobody Mon Dec 15 14:43:54 2025 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 4dVN9R0pHHz6Kq2F for ; Mon, 15 Dec 2025 14:43:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVN9Q5BTTz3S8f for ; Mon, 15 Dec 2025 14:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765809834; 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=BOaZ+znrcK7dCKJocwWtLNWwyGOfgfUsrw1omY0NLRw=; b=Bdvz1Tl1j5LeSuEWwLtxKujAhvaa4gt+NXUMdWx2XY3KepwukOVmnyGpBO8M+ivIzQOOC5 VJoG8zW6bmXKEoYSeymktrKG2j9DfRx+iP0hZ9UGw85ckiPxdYhPmxPWry4zCtuFMGsFWS LRMb6v/Pt0msTgq7yrpn79FQsWgaiXq3whRGRU6jTW0m8Q/RyFY0PPmH7PXnEA3rpkrgdF zGx8ux8vJUR1KEqq4+tAiHZPEskGIp2bb5EYXl3b9v7Mou8KOZLikhm2xMmasSre2DUT7H 5yyFT1aJtl8lzuxwvJm5aJTe9VPCBgulY8IcD2gvwGZqyqhb26WZdGRj+UXv7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765809834; 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=BOaZ+znrcK7dCKJocwWtLNWwyGOfgfUsrw1omY0NLRw=; b=kR7ce1E8e/fvNktm80XNFecjZUSZJfaR20B36KkSg5rQI7s8N0Z8e/FumbAsRK5UQoUSsU 7cCxIGPHQ4VTH3xHPk30CP1imrOMPEltAv0A4NjIWPLPwYz1XnqS+Z+7ScEibs7U6YhMJ2 orREv3w7YioD9BG/Ro2bMSS4RejKnGOnbigrqKhYSwZvlmI4Qr/Eim/3AcJRw+8LxZ74ih Yh0u3DZs3ycbtEAsfZ7OuFD2ygHpErq4hdi6VzcysMucaK0ubuyuTIRBKLbMSJw52U8S7x AzcQRa62lVpBpLrk23Mamz5DdW81qXvuLVI9ke065Ll0d/tEX2eoNk1A4C9Hmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765809834; a=rsa-sha256; cv=none; b=KAbeq7E/OD2EAeI6bgz83hnvyGILFIVUq3PqjBNnqg8ltYPl4m94ywM66Xt2eozleDs0Kn WFQS3eGi3i4c3JfVdm2lyFyf36BdqrgVd+6LSbExS5ApmnWcD1SU80Jyk18TOb85MMC7yX Voo0dbTwyClheTIT7URoO+FBVk7NaX/nYh/ypDlyp23wHddXnTC8fznrV2jrBKM7tajNbr c5aTs//7qSKaRDeVTI/CujOY5Nz5t9tvx4Vwc/Hrhx5SGIYtShuj/j3XmCCd3t8061wRHa HnntdFMXdqmVXzSBCZUublSP/EAyn3Awqovd06udCuL5vsQkIeeVqK2r09klwQ== 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 4dVN9Q4m12z7YG for ; Mon, 15 Dec 2025 14:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38987 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:43:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 19b642b5dc2f - stable/15 - sys: Bump 32-bit kernel removal to 16.0 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 19b642b5dc2f000de4e3e55d9da94398ecb0aca3 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:43:54 +0000 Message-Id: <69401eaa.38987.5516e4@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=19b642b5dc2f000de4e3e55d9da94398ecb0aca3 commit 19b642b5dc2f000de4e3e55d9da94398ecb0aca3 Author: Ed Maste AuthorDate: 2025-10-24 18:28:56 +0000 Commit: Ed Maste CommitDate: 2025-12-15 14:43:04 +0000 sys: Bump 32-bit kernel removal to 16.0 We are shipping at least one 32-bit kernel in FreeBSD 15.0 (i.e., armv7). Sponsored by: The FreeBSD Foundation (cherry picked from commit 7b28d549427bd85ecfae24d09da6eacb26c15822) --- sys/kern/init_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 87ffdb8dbf07..6612ac685936 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -384,7 +384,7 @@ C_SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, #if __SIZEOF_LONG__ == 4 static const char ilp32_warn[] = - "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n"; + "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 16.0.\n"; C_SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); C_SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, From nobody Mon Dec 15 14:54:35 2025 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 4dVNPm1zJKz6KqsM for ; Mon, 15 Dec 2025 14:54:36 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNPl6t9yz3T5m for ; Mon, 15 Dec 2025 14:54:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810476; 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=fhNU4gpdv1n/JYdocreTLs+3DLHoSH/q+5l0WmYDksw=; b=Jhw+SsQNFFnIaGqtifzcDZrpnmhZK0B9RFVPOs8Sgn0TPotcEyWR1N6IFR+CcXdyICqb1o kwctqcZgWnH+j7btgl4YI97C4mel9GUmL54GxCMPisW191e/lbOIPwpjuPtoylBBqpbgiK W4wN0w2DbnQ69nxkTIxnQOdHiIjoAvQon0AFhpJV56/3MezUKssOGAIXhlFh6+w1nnYkuP fLmK1k5IFAYhH8tCUiYNzBkIv3k9gF0vWB7102CsIFDBt8f3XBe2tad2o55iVUwqZTMFy2 JAlN/6M71D/XPpfkL57DuL0VKxasfg0Cq3spDmhhIp0+Mm/E4dDYlTl+LNZ5Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810476; 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=fhNU4gpdv1n/JYdocreTLs+3DLHoSH/q+5l0WmYDksw=; b=HpmTvGwd9TC6ikHBiBJWGlW8jdZGB6FUHF9v9R+BWm4qQJEaVzIRGZ9UwjYkzraERFs+0x 6GT2hbQ1ygZZxexSEyYcjzSkNWTAmV1+uygqUDwSz4m03CxmHg+okrO37V30Fo4EdPiysd VZr2bsjsJzoJqFk4PQZCh2BmvTsW7fGZ1/lsfNttD5ptz6oT/bHZqG9GzzFMbowvfMPl5B BhBBepRL+9TLSfXYPSY+U3iQ1Lv/L3GBIVDm46KU7adM3AaV8B1Vw3mQPjkTg9JtHe7/c4 AMGSXHqn+0q9AQKmubQJCZg7dirow6OfZ6bn+pOf6zUn6S6v56sX+8SaFEUGpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810476; a=rsa-sha256; cv=none; b=PzZ+NwT1HCRQop4Qj9VL1FDiqNI40XB75RcQvA1M4lCLdv2NchhK5n9FBtF8lsOzEqJNqY C+kP7AqeCVz75oayl93hVTdp7qBhjGXMDeot5AQ0D82cGHo1DApuGThdD5glh0tjn+gfJU y37X/25K/tAQMprVE7V+UkryGq4A2XTf9ZQycyI1iFlM9EhdvNrOnD8mEfwDwbZEKSfteD NUazlNyeim/5+nBDbusB98StAFDVPS/KZ2kL4SVMGayFvCbZh1WkqG0qvb86fXlJNL5zKG tyR0x6rxkkHKbivreZpXAAms8o2g8XTTjUTGFXN5cQwxDeUYUagBUkvSgIlPjw== 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 4dVNPl5vGRz8GQ for ; Mon, 15 Dec 2025 14:54:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3962d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:54:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 81b934008f94 - stable/15 - freebsd-update: Mention upgrading packages, not just ports 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 81b934008f943f1ca1d5b3b544cfbb5de83dedc4 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:54:35 +0000 Message-Id: <6940212b.3962d.29f15aee@gitrepo.freebsd.org> The branch stable/15 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=81b934008f943f1ca1d5b3b544cfbb5de83dedc4 commit 81b934008f943f1ca1d5b3b544cfbb5de83dedc4 Author: Jessica Clarke AuthorDate: 2025-12-06 00:33:20 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 14:54:23 +0000 freebsd-update: Mention upgrading packages, not just ports These days most end users are likely using pre-built packages, not locally-built ports. Thus be sure to mention this as an important case, and put it ahead of ports. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42968 (cherry picked from commit ced74610217ff0be071e4614c64a4ff66c40bc6b) --- usr.sbin/freebsd-update/freebsd-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 2f2afa38f553..d9db4fa4bf6b 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3196,8 +3196,8 @@ Kernel updates have been installed. Please reboot and run cat <<-EOF Completing this upgrade requires removing old shared object files. -Please rebuild all installed 3rd party software (e.g., programs -installed from the ports tree) and then run +Please upgrade or rebuild all installed 3rd party software (e.g., +programs installed with pkg or from the ports tree) and then run '`basename $0` [options] install' again to finish installing updates. EOF rm newfiles From nobody Mon Dec 15 14:54:36 2025 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 4dVNPn14Wfz6KqV2 for ; Mon, 15 Dec 2025 14:54:37 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNPm6zjqz3T5n for ; Mon, 15 Dec 2025 14:54:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810477; 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=FmmU2K91t09l6fJJ22qUlgXDRysR0mPe4HYApILLlnc=; b=h5mXqplvKumIQ3A+Kpyfo8wYHGRtPJAT5vdJXQmYtnOiX65peHXhH75ehBd5PP9wAMkPpu OiTjlb3XErbY5RkY5/nFU7myRSrVJw8mZUpl2EWZtXB333zO6C7vwh05zeqJtMbVoxWhzc i7opOtrXuZ81a23McbT/mM3/4nK4A0B1SK/bnhIJh7gkiqLQ1sWstGOgQqQYhbxEkR2SYA /OlqNG5lMwSmrqotUn6vngp1Lz/dGC+xKwlspO3VlzROBsQxdtuq032lWUM0IMHx28r0dS vxnySPThAO4vfVLf+HRJi7fD8vIX4vQmySUGtZhCsjYeTG0S+HY0ZBU5r8RyRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810477; 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=FmmU2K91t09l6fJJ22qUlgXDRysR0mPe4HYApILLlnc=; b=aZjluMZavNSE6g+AQwl0cVwSMKx/G8vAa3JXo+yRhIh+xMAJT/jQCSi4G5m1nSUqsyvYBk trZ4Z9Nm7Woh5S2OKMYM06yH0BQ90nz15BDVgzBcmQ2qtS+BPKL6hjyZ2fqELFGgXwZSFR x5MCw5wnoVf4KblWVFlLMv3hgKZcBmy85IjnCOYSNeKcfRUATewXyEKgGOlVlrbGHIrceW z+1LpoZUYdA+UCTn7Ag4hpEDAeqCKJWlNGbjBeoTFO78gigZqlKX+Tk6b5hTrXz/3ESV2y 1uHywPYCeic779gI4PkYAhYWqB+SvlfXSNdwOijActEbYbY4lGFeA4uX8M018g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810477; a=rsa-sha256; cv=none; b=c+ZPI5lj4Kyf4jUvcIMR3rIHfNKjKlTxxWd7qFumVShKjua+LfudHVk0pTAMYks/NDkhaT LFfYyYPfaszWmQilP0qYUF7Qn8NJtqZ5xRYFR5KflPISbps0CPbHAs72yHiivrRqT3Dy8j NAmF5YQrzCyI4g3VwsW1b/Fog+LPsfLmfL3JFJQIuXYWcyNCdtvo/IP5SQ5L6dbqkAmRwu bKOad9jIEw+1ik5oX3idNWY0h4xLjUdw9dwM2ed/nZ6dxe5DOekJC0+z9PZxL05kJHQd+q BVcUopsSuxALi4cxH8Ha85YVaFXqUSxJud8ASAtTSV1VAiFI+VgUOV2hlR/PlA== 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 4dVNPm6VDkz8Vq for ; Mon, 15 Dec 2025 14:54:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38875 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 14:54:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: e0f70ea729c5 - stable/15 - imgact_elf: Fix off-by-one in note size check 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e0f70ea729c58720f565c85690de5b39a83e640d Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 14:54:36 +0000 Message-Id: <6940212c.38875.1139fdba@gitrepo.freebsd.org> The branch stable/15 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e0f70ea729c58720f565c85690de5b39a83e640d commit e0f70ea729c58720f565c85690de5b39a83e640d Author: Jessica Clarke AuthorDate: 2025-12-08 13:01:57 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 14:54:23 +0000 imgact_elf: Fix off-by-one in note size check Prior to c86af2cc4cd1 ("imgact_elf: Check note body sizes"), this was note_name + n_namesz >= note_end, which checks that there is at least one byte after the unpadded name (which could be either padding or data), and given our notes always have data with them this was fine. However, once we started checking the padded name (note that "FreeBSD\0" is already a multiple of 4 bytes, so has no padding) and data, this turned into checking that there is at least one byte after the unpadded data, and since our ELF notes already have a multiple of 4 bytes for their data and therefore have no padding, this means that we are now checking that there is at least one byte after the ELF note, which is not going to be the case for the last ELF note. Instead, switch this to a strict greater than, as should be used when comparing one-past-the-end pointers, which both sides of the inequality are. For executables, this was generally not a problem in reality, since the last of our ELF notes is NT_FREEBSD_NOINIT_TAG, which isn't read by the kernel. However, ld-elf.so.1 (and libcompat variants), like shared libraries, only has NT_FREEBSD_ABI_TAG, which meant the kernel did not see this ELF note when directly executing it (e.g. as done by ldd), and on RISC-V this is the only branding present, so doing so would fail with ENOEXEC. This does also mean on non-RISC-V direct exec ld-elf.so.1 runs with the wrong p_osrel, but given it sets kern.proc.osrel.PID to the executable's NT_FREEBSD_ABI_TAG that it loads, this probably doesn't matter in practice. PR: 291446 Reported by: bdragon Tested by: bdragon Fixes: c86af2cc4cd1 ("imgact_elf: Check note body sizes") MFC after: 3 days (cherry picked from commit 5d58198ccc2b562098ee5fc4898013622b32b065) --- sys/kern/imgact_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index bc4fcad6c61b..e12c299172a4 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2840,7 +2840,7 @@ __elfN(parse_notes)(const struct image_params *imgp, const Elf_Note *checknote, goto nextnote; note_name = (const char *)(note + 1); if (note_name + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + - note->n_descsz >= (const char *)note_end || + note->n_descsz > (const char *)note_end || strncmp(note_vendor, note_name, checknote->n_namesz) != 0) goto nextnote; From nobody Mon Dec 15 15:03:00 2025 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 4dVNbT0qL9z6KrK6 for ; Mon, 15 Dec 2025 15:03:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNbS58KNz3VDK for ; Mon, 15 Dec 2025 15:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sqhq0O1rZRww1oSkTp31lFqgJt8XSOi+inkh5zNi+Qs=; b=PlpwEQrviCliJQcqKlMczZNAAmatEnEEUnnrCbAPtrIymfnqidpDtzEMD0WDxJsfrG19O0 UWi4ipDU4YDgrbV91ltPX8n6lLsAELiT18t4VgsdMKbXwkAU4H32GY9AUIMvaFad8d+cuP JRG7gyCQbJjw1Ca/rdKicUxdej99MnbSzwRlKIuDDUJRW4uQ33tML1hh4pQF9DlINJEhxI sooSbTLa2v23p3c05li65iYMYzY2/jXlaShQDUp2/2kiUY6Kfe+7nhfMaeYPnPiOp8NmXL 87SlXaIFEDpKhrqBEscr4Poghp1l/28QsQ/UhFXCWoZ2QJcvD2CNQ5WsqYHIrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sqhq0O1rZRww1oSkTp31lFqgJt8XSOi+inkh5zNi+Qs=; b=fhqWRqFYnt7u+zoJx1Bx3f9JKI44ry6+tm9sHCDMDitEZwwF6sNanr3ErYIaNQKZn8GrLb hAXS4MomW5JGATe+DCueJGzlb6MHoNNqUvh/fzctyajk9TKs0EWedm2U/alFzmqYq969OB n/ey9jLo99vd2elfNB6UVXJAv97rH0xMudcgRacnFxSOEE9lx8gMeUho97ohEMllCH0FpU dA8mrJ9W9OMOBhWn0u95fQKGv/lt0CmJVqP1grBek9ehTXBknaEYhDQIMO/kLK3PKZE2EG HRUkqhAjY/cyx7YQHQ3RMcJwgxmhvuNxUNvRjmEAz3iZDjgoRJBuQEWON+lqhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810980; a=rsa-sha256; cv=none; b=N0DGjAJmX1iGIcVp6lGQIcn/99lCb0SGsr9Wc3XozmN7fHBlkPnBQAlau5zOefj76mil7F GaoEvcljrllWcsMcS1RPHfktm4IFNYD6PE83U6yTdpIUKnMWjklfLGARvebmAJI80XFdDL /H5eQ4hSuSNQ5aB9MJTJy8hkT6q7lLQGBAm15nPfiXkEV7MsNu02PKjBrK+nZJ4BDJbIBC ZzZFqVgV70YbsLsjx5yYDdqHC/v8jobv/neQrhYaDMapzjdRhKEE4n0hpyguOfOWyEDgoI pLXLNb4agHSCrkOYq7gTn6XE9YnvNNHSr4Leb3jurmAwFajXV0DQql5SkkE1QQ== 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 4dVNbS4RMVz90c for ; Mon, 15 Dec 2025 15:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a4f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:03:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron From: Ed Maste Subject: git: c5445540995f - stable/15 - linuxkpi: Take const root in read-only radix tree functions 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c5445540995fd37c390ad371a2e95d300ee83988 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:03:00 +0000 Message-Id: <69402324.3a4f9.494b71e2@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c5445540995fd37c390ad371a2e95d300ee83988 commit c5445540995fd37c390ad371a2e95d300ee83988 Author: Jean-Sébastien Pédron AuthorDate: 2025-09-07 16:40:49 +0000 Commit: Ed Maste CommitDate: 2025-12-15 15:02:09 +0000 linuxkpi: Take const root in read-only radix tree functions This is a preparation step for a future addition to this file. This is also closer to what Linux does. Reviewed by: emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit cf39b51d36d82214ebdfd03055d321ddd2d85274) --- sys/compat/linuxkpi/common/include/linux/radix-tree.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_radix.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/radix-tree.h b/sys/compat/linuxkpi/common/include/linux/radix-tree.h index ea75836c26fb..1019697303db 100644 --- a/sys/compat/linuxkpi/common/include/linux/radix-tree.h +++ b/sys/compat/linuxkpi/common/include/linux/radix-tree.h @@ -74,11 +74,11 @@ radix_tree_exception(void *arg) return ((uintptr_t)arg & RADIX_TREE_ENTRY_MASK); } -void *radix_tree_lookup(struct radix_tree_root *, unsigned long); +void *radix_tree_lookup(const struct radix_tree_root *, unsigned long); void *radix_tree_delete(struct radix_tree_root *, unsigned long); int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); int radix_tree_store(struct radix_tree_root *, unsigned long, void **); -bool radix_tree_iter_find(struct radix_tree_root *, struct radix_tree_iter *, void ***); +bool radix_tree_iter_find(const struct radix_tree_root *, struct radix_tree_iter *, void ***); void radix_tree_iter_delete(struct radix_tree_root *, struct radix_tree_iter *, void **); #endif /* _LINUXKPI_LINUX_RADIX_TREE_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_radix.c b/sys/compat/linuxkpi/common/src/linux_radix.c index af53d8bff366..ee6b3a63c370 100644 --- a/sys/compat/linuxkpi/common/src/linux_radix.c +++ b/sys/compat/linuxkpi/common/src/linux_radix.c @@ -41,7 +41,7 @@ static MALLOC_DEFINE(M_RADIX, "radix", "Linux radix compat"); static inline unsigned long -radix_max(struct radix_tree_root *root) +radix_max(const struct radix_tree_root *root) { return ((1UL << (root->height * RADIX_TREE_MAP_SHIFT)) - 1UL); } @@ -64,7 +64,7 @@ radix_tree_clean_root_node(struct radix_tree_root *root) } void * -radix_tree_lookup(struct radix_tree_root *root, unsigned long index) +radix_tree_lookup(const struct radix_tree_root *root, unsigned long index) { struct radix_tree_node *node; void *item; @@ -85,8 +85,8 @@ out: } bool -radix_tree_iter_find(struct radix_tree_root *root, struct radix_tree_iter *iter, - void ***pppslot) +radix_tree_iter_find(const struct radix_tree_root *root, + struct radix_tree_iter *iter, void ***pppslot) { struct radix_tree_node *node; unsigned long index = iter->index; From nobody Mon Dec 15 15:03:01 2025 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 4dVNbV0LKcz6Krbq for ; Mon, 15 Dec 2025 15:03:02 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNbT5P13z3VRC for ; Mon, 15 Dec 2025 15:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WyD8D3Mbyi+yTJ8svtpvOlyZrs0KcpNMpjv8J4HWpCI=; b=GPAqU867HuALieNGFtuAyBF21zls+XnVICVck9a9DJINm7mbYAe7T0gpitr+druxQGrbnh 4DN0fN/jtxJMRywN6iv5YPqlx8T63iXlCUREAgfZX9j9wq8U97rg4PL48g+kX7Xsv7V7ef s6L9QQq4imr0gqdnWLddn6ur7EB19CoN9S/b059ljTATb89G1/s9CU261dVlMjkfdVfqZy ZMOOlnJREqTVz37Z/iwkZn4LYA4tp+Z7lZD53KD9qCS2eLj479cBGi5Px3+ZQEaJM4rMci wyoMUOgPXvH5QDjWl9C3bK8SXGVqSDQJHtPLOlLa51LToB/SW3vPa60rQBb/tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WyD8D3Mbyi+yTJ8svtpvOlyZrs0KcpNMpjv8J4HWpCI=; b=UQm6fwuwjiYao34GSthskep+WvIvrrOosQGDS0ZBEbhYBGDZsMbuN7vpOYzruehZxm2Fjd YAMKIcs1KtX/J356cLuPbwH5b8T2c3eSZTExhWmOhJCDpz6+s8PKxw58mW423DPIFsnD/H Ywc57OIc5+3U4NIPBTRD/xP8wNLcQvxdHKOqwFTQbYyjimqMov2p4Tk6fF4tzOJO1pGQh7 GiK6yo8HosXqy2SsU9cENKtVJE3Fg5bWH9i5mFxc3QDdH2LInMcrpRDd8gbzwvjxXLhauk yn9s7KAwhC5vb20ajDWjXONNti8z5h56kPrX/o+1GMw9u8Pl3O8jedqBeEPdFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810981; a=rsa-sha256; cv=none; b=sgSicdxkRDQuKjJj/ffD6BxN67wfApY85FvIp9yY0nygv5iLoTLWAQxNI0cGs2avWTHndd 3s4skgV0X6qlzrLBn4aHvxNIxwMy4iiRxmsIaPyPNdD891v1UOpFWom7gWqYSSW++gywbv nig9QLijQoZrsQ27MuQOm3c6XuM0J5w7yVK8wy6opdUXLvyHa6aHD+Hq+TzI4bMM+S0xBE HUbRGDYhqwU3bl5ma1FFpLfpNWKbFSMruyLtF94CwPfrgRX8+RFP1WrC4hpwcxFXU0t1LF VOd1M9RhQ2RgpCeuFMn1svGRl/icNdz7Na2FTIV7xxQk3mAPrWO9vFU1nsfG6Q== 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 4dVNbT4rg2z8lX for ; Mon, 15 Dec 2025 15:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 395de by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:03:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Alex Richardson From: Ed Maste Subject: git: 29e3479f2d30 - stable/15 - libc++: avoid use of deprecated builtin 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 29e3479f2d3068a2f3e2dbb578d3fabf6389e5a6 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:03:01 +0000 Message-Id: <69402325.395de.779b6e13@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=29e3479f2d3068a2f3e2dbb578d3fabf6389e5a6 commit 29e3479f2d3068a2f3e2dbb578d3fabf6389e5a6 Author: Alex Richardson AuthorDate: 2025-09-15 22:10:07 +0000 Commit: Ed Maste CommitDate: 2025-12-15 15:02:09 +0000 libc++: avoid use of deprecated builtin This pulls in LLVM commit accfbd4cb327411ad66c0109ba1841482b871967 to avoid the use of __libcpp_is_trivially_relocatable. This fixes building FreeBSD libc++ with clang HEAD as of today. Original commit message: [libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970) The __is_trivially_relocatable builtin has semantics that do not correspond to any current or future notion of trivial relocation. Furthermore, it currently leads to incorrect optimizations for some types on supported compilers: - Clang on Windows where types with non-trivial destructors get incorrectly optimized - AppleClang where types with non-trivial move constructors get incorrectly optimized Until there is an agreed upon and bugfree implementation of what it means to be trivially relocatable, it is safer to simply use trivially copyable instead. This doesn't leave a lot of types behind and is definitely correct. Reviewed by: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52529 (cherry picked from commit d61c75f634cf52fdef9590601d881f85275eee9a) --- .../libcxx/include/__type_traits/is_trivially_relocatable.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h b/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h index c0871731cc00..9b0e240de55f 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h @@ -11,7 +11,6 @@ #include <__config> #include <__type_traits/enable_if.h> -#include <__type_traits/integral_constant.h> #include <__type_traits/is_same.h> #include <__type_traits/is_trivially_copyable.h> @@ -23,8 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD // A type is trivially relocatable if a move construct + destroy of the original object is equivalent to // `memcpy(dst, src, sizeof(T))`. - -#if __has_builtin(__is_trivially_relocatable) +// +// Note that we don't use the __is_trivially_relocatable Clang builtin right now because it does not +// implement the semantics of any current or future trivial relocation proposal and it can lead to +// incorrect optimizations on some platforms (Windows) and supported compilers (AppleClang). +#if __has_builtin(__is_trivially_relocatable) && 0 template struct __libcpp_is_trivially_relocatable : integral_constant {}; #else From nobody Mon Dec 15 15:03:02 2025 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 4dVNbW1FN9z6KrHR for ; Mon, 15 Dec 2025 15:03:03 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNbV5mTkz3VT3 for ; Mon, 15 Dec 2025 15:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iIIyrRKmZKrFQ9GWGlzO8r1s30qc8CaOe/WFIT1uRcU=; b=xEPWDXJnm1lf83bRmw0c8aEHmGt+Cd/VfivHVrO0Gm90rgPwWel7HhWdDBuZs3QDZp8kyI Jm8PzAH3HpR7TJZ7GyixuVVrRc4qFNpD1KgqJ8/fIs5yA5yyW5hM8Skjx1SceUSYCfXWEQ exYbn0WbubvmqRG8hGYLiOICyZb5tTJLxmAbb0wqRAkNjyeJ1cDOGUrFBdPmLkja7ZOD9F qErY+7wQuM2asyJAZaYw/FDZ4pwOJhdd4/jRfPnLp6v01NlRqhtXnZSafgooTv6aw1CTfN AfWYGMSG0DWoI0J1akCdceoJo/XIvfhU0QB1DJwRCKedD04jUV9q+VGKU3e8HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iIIyrRKmZKrFQ9GWGlzO8r1s30qc8CaOe/WFIT1uRcU=; b=S1pLB95x/Qu/cyXxWtYUEAuEW3NR5oHselG/4N11D0mDGgmKeF7Oak4recEKHkvpymsap1 QkBKwPrgI9U9IszUQmiSwwUdoC1O13F/0fuVF+eotW9UOdKbe28hR6oBF9QOP/6x2k+bOb sTQkvShzFQHN15ynWs0W9NbgGr1i6LXufChhqyIDmSTOrM5GMq/Ueivlt7A3ldM2Ohcd77 GOsQ8/KqPfr/kifddMyzo1SnKc/hCqGuxxShQTrAbDzJ9ZighUxsOscbqoU15PBuKfKaUM rZkiyoN1YQXv+voZUmwJxwJpMeVM7u8N75Qu8GsvS+ir3zk4+z4bC/Ae9yWPog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810982; a=rsa-sha256; cv=none; b=TJVvzxfsenehRuK7rXJo2y9Xg+B6LH1znT08IbPC49LB72NZ3YrkwXxuM6qVv1dBoLdViF ImII6vcRQnsD82LQGjyLh42AnNPNYb7+a2lmdvVpSA0VZ7jDs8bE8ZKqQu74KaR3bx4hgw ko00j03ONVZQHmtpWBdSAkA3KTBYJDEjFEfplE9QPe+pUW7CV5wdUgMAHSWV7nobxC4M68 AswqbtXA39E8u1xqjPgIoOIR+lLqh4GVRPrro7LqptKdQ3I6totVY7s/qNC9U4Zb6Kf4kQ Gpg6Yvi3+SY5pTYumc/jp2XirIIGGmVcb593hWHUui6fFzS+y6Dg4ojia9FoRQ== 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 4dVNbV5K9pz8lY for ; Mon, 15 Dec 2025 15:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a32c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:03:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Alex Richardson From: Ed Maste Subject: git: e487653fe434 - stable/15 - libc++: avoid use of deprecated __reference_binds_to_temporary 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e487653fe43434768b533b1d7f360ec448c05b4c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:03:02 +0000 Message-Id: <69402326.3a32c.7fa3bfe1@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e487653fe43434768b533b1d7f360ec448c05b4c commit e487653fe43434768b533b1d7f360ec448c05b4c Author: Alex Richardson AuthorDate: 2025-09-15 22:11:39 +0000 Commit: Ed Maste CommitDate: 2025-12-15 15:02:09 +0000 libc++: avoid use of deprecated __reference_binds_to_temporary This was removed in upstream libc++ in commit 437ad06f762ab07d89badecdd20627db200b98d3, but as this does not apply cleanly to the current repository, I am applying the equivalent change in a minimally invasive way. This is needed to build with latest clang HEAD as of today. Reviewed by: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52530 (cherry picked from commit dee76cf2f3dace6290ccab07c2db17355994e70f) --- contrib/llvm-project/libcxx/include/tuple | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/libcxx/include/tuple b/contrib/llvm-project/libcxx/include/tuple index 081b90c7bbec..1d39974d5a6b 100644 --- a/contrib/llvm-project/libcxx/include/tuple +++ b/contrib/llvm-project/libcxx/include/tuple @@ -302,7 +302,9 @@ class __tuple_leaf { template static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() { -# if __has_keyword(__reference_binds_to_temporary) +# if __has_keyword(__reference_constructs_from_temporary) + return !__reference_constructs_from_temporary(_Hp, _Tp); +# elif __has_keyword(__reference_binds_to_temporary) return !__reference_binds_to_temporary(_Hp, _Tp); # else return true; From nobody Mon Dec 15 15:03:03 2025 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 4dVNbX31tsz6KrHT for ; Mon, 15 Dec 2025 15:03:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNbW6g6Jz3VTH for ; Mon, 15 Dec 2025 15:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y742CSHvj8nBqNwrwHzLsP/tPI6CjlfDVEHyra4VShA=; b=Pimcm/BQ2Yq6yEnbqjwM4nWk62vLKM+EoIitMWWc1KGcWWi14Svtys+UsxQcFHDzPvjcE0 Kc8Yna4aAHLDBkeUraYLjM9bO0XYuS/YDeGCMsmpyt9F5NdbS97piiahxpBfH+wcxXgQKa Hp5b1CQefrmh64dWU/XSnz4ZkhtBi+MsGX+AUI7CIaWj+sSbOSr6JqIn5uRsP1WYWOZn9t 7GrWP3SPRWpdR/r8cxyesnwDX64zI0lmcgsFBk/ZGze+SDPT4lt0s1Zij2R+xg7eSzlLNx bLZyfiW0hLi4H8URtqPxgemvdM0WNP/EdWJ4Muqqu/PVPLsd1qpMMk1CWk4cxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y742CSHvj8nBqNwrwHzLsP/tPI6CjlfDVEHyra4VShA=; b=jMRQc51aM8BN0r9c5LMD6ew2Kg0PFwWsH8Yz1Oy/itOalmPt3c4+uZhUNowSy5j6NCvNGn E+mMR8ncgSqljuMMaZIV3Vhor348A/589H8k5GxwzjFmE/HXA4+w+cPeD5UMiQ36/07mfB iy7R7gMXTPJaVrqj0zxiAqS2L5GP3gNeV59P5EmHxn/OloJOApMOILd4SYx9MnsuKJFALm blMjLqoImSOSSlgWZghW3trr1ZJG4yzcrlgxc+JSn/4M6eNCINJsj1nYC9FeThKo+xudgY 7VJxByjJMgKLXmDx/C3wssU/lvIRD+PDKXt7GIER6mpJJMpWr24zVZy+XSO/LQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810984; a=rsa-sha256; cv=none; b=CKyP1MjYDO+LORWpP+ONJH7nxqT0iswZei/8OZ/UNcwXrixRd2MfuPa1gktyeT904Cijqn 3adAb7KizQyu56mowysIP3tV16hLFAusoqTTEhxbdjJMI4wRmoOrJuOq4pcO65BVXd0w0+ Qovb7lafXHLsP2smuXLeSJPHhwPJgl7ZiRZAc1CtINIBe6iu8AlhgnJWb1LlDZZ0kb30ui +7T/yDRc7wmrl/PMAyLAxKjoErb4HuaU5HGbOpC5HrPT4TLG531HaExqLnbnHgdnxWwWI5 9AiwSSIi5zNUFtjiHQLzJ9+D+IYDlj0BOqSu7srfwmPj2erxEKe2cZx3Ou1d+A== 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 4dVNbW66L8z92w for ; Mon, 15 Dec 2025 15:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38f75 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:03:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Alex Richardson From: Ed Maste Subject: git: 703c98dc6eeb - stable/15 - libc++: Fix deprecation warnings with latest clang 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 703c98dc6eeb2b36ec94e138269a221704e55f4c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:03:03 +0000 Message-Id: <69402327.38f75.28daa245@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=703c98dc6eeb2b36ec94e138269a221704e55f4c commit 703c98dc6eeb2b36ec94e138269a221704e55f4c Author: Alex Richardson AuthorDate: 2025-09-15 22:13:46 +0000 Commit: Ed Maste CommitDate: 2025-12-15 15:02:09 +0000 libc++: Fix deprecation warnings with latest clang Latest clang has become more strict in diagnosing deprecated decls, so pull in LLVM commit 9feac2cbd0d80927ce9a8b4c3e810d2b81802d55. Original commit message: [libc++] Improve deprecated diagnostic guards. Recent Clang-21 builds improved the deprecated diagnotics. This uncovered missing guards in libc++ internally. Reviewed by: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52531 (cherry picked from commit 086ce467adec42d58414fdb4d54c2b6819cf0c07) --- contrib/llvm-project/libcxx/include/__functional/binary_function.h | 5 ++--- contrib/llvm-project/libcxx/include/__functional/unary_function.h | 5 ++--- contrib/llvm-project/libcxx/include/__functional/weak_result_type.h | 2 ++ contrib/llvm-project/libcxx/include/__memory/allocator_traits.h | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__functional/binary_function.h b/contrib/llvm-project/libcxx/include/__functional/binary_function.h index ddee3b170311..18879f65112b 100644 --- a/contrib/llvm-project/libcxx/include/__functional/binary_function.h +++ b/contrib/llvm-project/libcxx/include/__functional/binary_function.h @@ -39,11 +39,10 @@ struct __binary_function_keep_layout_base { }; #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) -_LIBCPP_DIAGNOSTIC_PUSH -_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations") +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template using __binary_function = binary_function<_Arg1, _Arg2, _Result>; -_LIBCPP_DIAGNOSTIC_POP +_LIBCPP_SUPPRESS_DEPRECATED_POP #else template using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>; diff --git a/contrib/llvm-project/libcxx/include/__functional/unary_function.h b/contrib/llvm-project/libcxx/include/__functional/unary_function.h index 69b1bc94220a..d46df2e86fbd 100644 --- a/contrib/llvm-project/libcxx/include/__functional/unary_function.h +++ b/contrib/llvm-project/libcxx/include/__functional/unary_function.h @@ -36,11 +36,10 @@ struct __unary_function_keep_layout_base { }; #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) -_LIBCPP_DIAGNOSTIC_PUSH -_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations") +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template using __unary_function = unary_function<_Arg, _Result>; -_LIBCPP_DIAGNOSTIC_POP +_LIBCPP_SUPPRESS_DEPRECATED_POP #else template using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>; diff --git a/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h b/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h index ad7a8395186c..488fec9dac21 100644 --- a/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h +++ b/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h @@ -77,6 +77,7 @@ struct __maybe_derive_from_unary_function // bool is true template struct __maybe_derive_from_unary_function<_Tp, false> {}; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template ::value> struct __maybe_derive_from_binary_function // bool is true : public __derives_from_binary_function<_Tp>::type {}; @@ -99,6 +100,7 @@ struct __weak_result_type_imp<_Tp, false> template struct __weak_result_type : public __weak_result_type_imp<_Tp> {}; +_LIBCPP_SUPPRESS_DEPRECATED_POP // 0 argument case diff --git a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h index c5fcc89327b8..f3e327edda12 100644 --- a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h +++ b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h @@ -40,6 +40,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template \ struct NAME<_Tp, __void_t > : true_type {} +_LIBCPP_SUPPRESS_DEPRECATED_PUSH // __pointer template { using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind; #endif }; +_LIBCPP_SUPPRESS_DEPRECATED_POP // __void_pointer _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer); From nobody Mon Dec 15 15:03:04 2025 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 4dVNbY3TWKz6KrfG for ; Mon, 15 Dec 2025 15:03: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNbY0Gbqz3VF6 for ; Mon, 15 Dec 2025 15:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ax9kxNE73AM6m9ONRW0IMQfG3dFYT9lAU4iU92s+pk=; b=qdgQFKzwCZt4V73LP562NhI1QkXm3yImqWSFSYRA7X0Hui319f4t1TS+Zvcfvib8FEAryP 2vNCfYicg/+I/vlz6uaegiFc2ovB73yVPU1/P8QCc7KU+Q3bYgm+pKU8unTy+rgFGkF9vA eq/b76+540KKkstg1BmdtFefZ/OXdvq4vaOWB6DKowrFOhA3KY7ep7C8x5DiDaL1TW3Vsb +MKAadhSlAwxpNC6hn+U3du1EL9Imj9eXeCjKsx9+ty1kXUxjHAwmuWLWmQE0YD/DnrQca H17tYeTxEYdZy5bt8vuqkIo9PvUIiLCcnRbq9KJCBnt5Gg6A0RQkuY+e80BH5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ax9kxNE73AM6m9ONRW0IMQfG3dFYT9lAU4iU92s+pk=; b=xKOKnuVuz2SPx5tnS23bh0qLg5w+dNfyNy+nWGipVKAlS6YQ0kjwCWQjqP/vUPEsl+WO8q I4XKFiMowxxNTltaXV0LWNcZsPWX18GIooEwIGcxuEkxpEylzUxtFH4Rv4Ww5JhI/RlBEG GcE97WDskPHDjJbUsq4VuPqJ/ppj77l7rYV59te0bRqypt2YIlYEja5bMREa5tCztTuVJQ R2Cv5Rsiy7gcqoClKPIzMdJ50kyTBUYJQhtgrBf3OA2PpuA22NtbbffQuU6uaOzVC9JM+n Bbaosyy3n77eMorxMrt4DWpqPe2PdtgBKgUYCZ2eBTSfL8gcQ47aaRokw+wbaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810985; a=rsa-sha256; cv=none; b=IDWkTAuyUDRFs20cPzo8kLfOtRYKjEcDPAYKmBKP8vLI7K8967H8R8H88njCwaGs3N1gwn 9YGEeI30mNtCKWeSB5obtNnwFbHOruEQPe1RIizu8vVRdc1s4mEaSyNVC3sBL5vApEQJXj OBpGRm0ZQnJzNYSazzBzPJdbeW/geXjxqbJ3pEIyRq5Vg0CgGUQdtOIQj8wc/N7vuRuMFA sEY5B1h66h7iVtUK8iNok4JrODr081rSwwKjifPF6isxWJUEZp/cEiNn0ouc3pcwKX0vQn n1A2rOG4ExvUiLCJkkoeh/7G+zHoQ4MXay+oLTMc5tx2MR3HCOStMsNAmGPqxA== 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 4dVNbX6whWz8j7 for ; Mon, 15 Dec 2025 15:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a8be by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:03:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Alex Richardson From: Ed Maste Subject: git: ca149d75e9bd - stable/15 - libc++: silence -Wnontrivial-memaccess warning with newer clang 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ca149d75e9bd6455abc3c74e7db160464cfabbdb Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:03:04 +0000 Message-Id: <69402328.3a8be.44f1a6d1@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ca149d75e9bd6455abc3c74e7db160464cfabbdb commit ca149d75e9bd6455abc3c74e7db160464cfabbdb Author: Alex Richardson AuthorDate: 2025-09-15 22:14:18 +0000 Commit: Ed Maste CommitDate: 2025-12-15 15:02:09 +0000 libc++: silence -Wnontrivial-memaccess warning with newer clang Apply part of LLVM commit 71315698c91d0cda054b903da0594ca6f072c350 to silence the -Wnontrivial-memaccess warning that is triggered any time this function is instantiated by user code. This fixes another buildworld failure with Clang HEAD. Original commit message: [clang] Warn about memset/memcpy to NonTriviallyCopyable types (#111434) This implements a warning that's similar to what GCC does in that context: both memcpy and memset require their first and second operand to be trivially copyable, let's warn if that's not the case. Reviewed by: emaste, dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52534 (cherry picked from commit 34a006eaa39ceb6b0a96fa386c9b9b8a44681979) --- .../llvm-project/libcxx/include/__memory/uninitialized_algorithms.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h index 7475ef5cf85d..79cab80dcf73 100644 --- a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h +++ b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h @@ -642,7 +642,8 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _ __guard.__complete(); std::__allocator_destroy(__alloc, __first, __last); } else { - __builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, sizeof(_Tp) * (__last - __first)); + // Casting to void* to suppress clang complaining that this is technically UB. + __builtin_memcpy(static_cast(const_cast<__remove_const_t<_Tp>*>(__result)), __first, sizeof(_Tp) * (__last - __first)); } } From nobody Mon Dec 15 15:02:59 2025 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 4dVNbX5Q0Hz6KrYn for ; Mon, 15 Dec 2025 15:03:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNbX4KTcz3VRr for ; Mon, 15 Dec 2025 15:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RSyw9jdYfTj63nWD4GbTeSVoo54GII8V062cDwvwJxs=; b=nId2vup+/prq714UPa1IUOWGalxHij1WdMzB8TFaDukuDOQCrO4yPl+5Fzf+tsQVyf5UQI JkBecbGIrWf3ZPiXLmQXqkYS3gO157q+VNk9EnTVQTBWPmadtcZzuHyL8rFmb334aBstDV E/fL0RNV1hxBtcTx1YNu/b11GowPTyQepdjgM41w2PGyia66cLsASMJdeplJysuKExwRO7 leFj6cWztrvAbGm/3Wm/kTywFoDGs8sHd72BTghdxCp3tDOsY5Aw5uP5h2UuqsUEWRviwT hGpNS3MILOjSD8gzKYE0O4KsI47FQpN56wZcjapDpmgPDdUL48DTCeXCR+oRlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765810984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RSyw9jdYfTj63nWD4GbTeSVoo54GII8V062cDwvwJxs=; b=Bv23vKOE6e7kZE8LLqaFMDybCKFLU9o1kit0LaKiDJ1WS5ahvAi/op91KTH0hOyCYXjdh3 QzgrSCPJF4EVQG0h8pNCwJTs2rIqCATLGkaEGC5yfczgdN6HmHwhtFpUPi93xPygM6Hg0j AflrZRDy4ARsoPzj9RFxYi7TGkVqhg3H9/lGJuYSH0W1px5cr6vW4rOukFbaEqazQuhMDS I00adskHa6XqWzfgojDJQ6SVTbesdohQC0CUH146shxzZfNo8o073vtVr4XUNXZJcpXzPG nm3GUgM9dbGr8FezRbIMjR/qWKaofUW6qQxD0dfIGakeuJUDyY1K9DgAAP3J6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765810984; a=rsa-sha256; cv=none; b=oDpFmsNkANWqLZ/elTZbaVoflz/E5hpEYM0x0S/YDsD3hjMHgj2uqx4w4dOxp2ArI7MFxf GVmO3LzbPZjyqTXzcQI1Lhz2VP0I6lx2eP5iJkyydXDfCqg1CA0Q5ZMoKw2SN7m1C1fv/f VFS5WonLzRiI3OcaXHq3c8kvxHkvfeQefxH2qGZTjc7v1sKNXPVyWdIbga4V6Mtv4qTuMa koQhsHSwCEUpHzFCXYvWN7rNyi1m2DLMNU4vj7TZhCs2+cgwoivlM7ZHsCKSb6ADtM0Ok8 UhumQKRue5I6Vy+UqceOkBkEFHUGkGxv57SmFx8PhCWW0tugl8s+egO8mAS9AA== 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 4dVNbX3lPcz92y for ; Mon, 15 Dec 2025 15:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a60a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:02:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron From: Ed Maste Subject: git: 7596061c3a39 - stable/15 - linuxkpi: Add dummy 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7596061c3a39bbacb51b772e64bb8880bf10402f Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:02:59 +0000 Message-Id: <69402323.3a60a.3d508ae6@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7596061c3a39bbacb51b772e64bb8880bf10402f commit 7596061c3a39bbacb51b772e64bb8880bf10402f Author: Jean-Sébastien Pédron AuthorDate: 2025-05-26 18:10:51 +0000 Commit: Ed Maste CommitDate: 2025-12-15 15:02:09 +0000 linuxkpi: Add dummy There are no consumers right now except the upcoming . This is meant to reproduce the same includes as Linux, in case consumers of implicitly rely on namespace pollution. Reviewed by: bz, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50851 (cherry picked from commit 112a6912e1c99439a7e2a75f3961e18f3b800c6e) --- sys/compat/linuxkpi/dummy/include/linux/percpu-defs.h | 0 sys/compat/linuxkpi/dummy/include/linux/percpu.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/sys/compat/linuxkpi/dummy/include/linux/percpu-defs.h b/sys/compat/linuxkpi/dummy/include/linux/percpu-defs.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/percpu.h b/sys/compat/linuxkpi/dummy/include/linux/percpu.h new file mode 100644 index 000000000000..e69de29bb2d1 From nobody Mon Dec 15 15:16:37 2025 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 4dVNvH1zVxz6Ks1w for ; Mon, 15 Dec 2025 15:16:43 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNvH02Sqz3Y36 for ; Mon, 15 Dec 2025 15:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765811803; 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=2V0+MlXTmCeengsvVRCJd4nq8jZ4irJwtVaLFqfJzsQ=; b=WHVqO9KBrAsI7JeMENFOJyvzvULLWLB6esVYJkT5LELj3V3W9hOuUM2Khc7cyf/Wz634y2 0CgHr5hkhZ2knD4hnYozuG8zawz13zkL2+Ff/Yi+GvHaQ4r1J9lRR4dycnUBscs75ZGppm bn6nsmOrpYjMf9O2ZmN9POQcqh1qo09zlmE6PwHE5Lk/kvxELA8cf3DrjFh24ylR2ZeMeq b8dSR0E3rxdZJZtS6ssP4IZ0qXxH6z1zIpb3D44OfMWjQm0Avj+gbvTW3DazStEqCZ/xo+ g9EABflIyc0gDX2utTXOgoMb1STItsjZWheUlJL0PEMaAKncVCIAMGKcKKizaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765811803; 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=2V0+MlXTmCeengsvVRCJd4nq8jZ4irJwtVaLFqfJzsQ=; b=CpdY1yuHbfSb18N2oby7vlSqUE9xJ3BHMkUULjyKHH7MsBgQImoP2uvd+L1erTYFU3lMMw ua4fyST0+t3MB/jvHUjBT4txTGOlLEMfLKIfWxv83oxnR7Qgphyd4s7JK9cTaq7jJTsS15 UkBKdAPDTaXidAlU/z9AhEc7sF70HUCM+xjgOk8JT7oIQhTID8wxr5Yq97TnzWGP+fulpz qPiMNszJp9XlUwUxo5mVlQM7BrcQmYmr4pXDOBYqGn9uef3CaJ3XFulLxYHBkJa7DZOzZR M2bbMEmIgtfjmRfGOFoKk5uhnURmmICahsIEfSYSTU+/X5ta/UX9q4Fh5r71Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765811803; a=rsa-sha256; cv=none; b=MAOTkpdauNP/fhQR60mK83+g/faYb5TVU2WKK8q84n+5utL2hGLITRJGOZT38kZLgg2WFD puUAZi8a/DzDo2gsCcdKNrZdH/WYT9/J9pIVAt+IIG/rxFtaQh1lruDVD9iA4SutxsxuI3 VFGkrY/hSvELWEoA9RKYMuuok6qlM++kHTkVgf1Y45TBosx/Wvltrqy0Do0J3HzzI3MvoX o5l9wUM8Pe651+WrwxP0zvKsXwNmg63k2Kyw2scWN/1mpKmI0HDwD9sJU3b1UncfGTR79u s99bF++Ach8tRCcYS6Apt3Gx4SGdl7mkvfzl5btium8hGZuG9adenVyGwhCidA== 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 4dVNvG5lYmz8tD for ; Mon, 15 Dec 2025 15:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bc9f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:16:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 20fc2b332bd2 - stable/15 - dtrace_pid.4: Document the DTrace PID provider 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 20fc2b332bd24a5e627079ac0dae148c76d81007 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:16:37 +0000 Message-Id: <69402655.3bc9f.26a64a24@gitrepo.freebsd.org> The branch stable/15 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=20fc2b332bd24a5e627079ac0dae148c76d81007 commit 20fc2b332bd24a5e627079ac0dae148c76d81007 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-11-06 22:40:41 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 15:16:32 +0000 dtrace_pid.4: Document the DTrace PID provider MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51287 (cherry picked from commit 9fe88e5503239cb65e503e3b2b7344933a888644) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 1 + share/man/man4/Makefile | 1 + share/man/man4/dtrace_pid.4 | 99 ++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 41f084cf85dd..786c3d6e50d1 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -1303,6 +1303,7 @@ in .Xr dtrace_ip 4 , .Xr dtrace_kinst 4 , .Xr dtrace_lockstat 4 , +.Xr dtrace_pid 4 , .Xr dtrace_proc 4 , .Xr dtrace_priv 4 , .Xr dtrace_profile 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 316e1263b843..2b3bf620fe48 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -1012,6 +1012,7 @@ _dtrace_provs= dtrace_audit.4 \ dtrace_kinst.4 \ dtrace_lockstat.4 \ dtrace_priv.4 \ + dtrace_pid.4 \ dtrace_proc.4 \ dtrace_profile.4 \ dtrace_sched.4 \ diff --git a/share/man/man4/dtrace_pid.4 b/share/man/man4/dtrace_pid.4 new file mode 100644 index 000000000000..1acbdd097ba8 --- /dev/null +++ b/share/man/man4/dtrace_pid.4 @@ -0,0 +1,99 @@ +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd November 6, 2025 +.Dt DTRACE_PID 4 +.Os +.Sh NAME +.Nm dtrace_pid +.Nd a DTrace provider for dynamic userspace tracing based on function boundary instrumentation +.Sh SYNOPSIS +.Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +.\" XXX: For some reason Op renders here in bold, so use literal square +.\" brackets instead. +.Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns No \&[ Ns Ar offset Ns No \&] +.Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +.Sh DESCRIPTION +The +.Nm pid +provider implements userspace dynamic tracing +by instrumenting the entry and return of functions in userspace programs. +Refer to +.Xr dtrace_fbt 4 +for more details about function boundary instrumentation. +.Pp +The +.Nm pid +provider provides the following probes: +.Bl -inset +.It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +instruments the entry of the +.Ar function . +.It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns Op Ar offset +instruments the instruction within the +.Ar function +located at +.Ar offset +bytes (expressed as a hexadecimal integer). +.It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +instruments the return from the +.Ar function . +.El +.Ss Probe Arguments +The arguments of the entry probe +.Pq Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +are the arguments of the traced function call. +.Bl -column -offset indent "Entry Probe Argument" "Definition" +.It Sy Entry Probe Argument Ta Sy Definition +.It Ft uint64_t Fa arg0 Ta Function's first argument +.It Ft uint64_t Fa arg1 Ta Function's second argument +.It Ft uint64_t Fa arg2 Ta Function's third argument +.It Fa ... Ta ... +.El +.Pp +The offset probes +.Pq Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns Op Ar offset +do not define any arguments. +Use +.Va uregs[] +to inspect the registers. +.Pp +The arguments of the return probe +.Pq Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +are the program counter and the function's return value. +.Bl -column -offset indent "Return Probe Argument" "Definition" +.It Sy Return Probe Argument Ta Sy Definition +.It Ft uint64_t Fa arg0 Ta Program counter +.It Ft uint64_t Fa arg1 Ta Function's return value +.El +.Pp +Note that all probe arguments within the +.Nm pid +provider are of type +.Ft uint64_t . +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr dtrace_fbt 4 , +.Xr dtrace_kinst 4 , +.Xr elf 5 , +.Xr d 7 , +.Xr tracing 7 +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter pid Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-pid.html +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . From nobody Mon Dec 15 15:17:12 2025 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 4dVNvr4GXGz6Krmy for ; Mon, 15 Dec 2025 15:17:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVNvr3Lklz3Y6j for ; Mon, 15 Dec 2025 15:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765811832; 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=SrJdUUwAvjWMhClR9RcumuXsUFKFALL9ZeeSLDf11LY=; b=n01AR+6Ds6gdncokxUPaSfFnpwAxqRkcpKOoBMGsCa0VJN3yWESKPoC5Has29LrN1D4m7k jnJeLtev1slRqxQno59OTCJGTKD0g8mVa2RCX4KV7rK8r8rrlpc5T1/U+r3YN5t7VWbps1 OX8jypbUdLRLgLFkEwUmMpmPEBmkmYji0pXkYbQB3im4a1wkTCOUFoQboAIWsF7pCsG6Ay tqzb3cLlNZYaJOlQ/+PXlrCuRbWKFNht13QoMcfoJfsvZfveTbjjGhwxQ7GgpierQlbgir /AlgHjqrLMf2CEb6uSF0wyPWmN9woKI5qOYGeBKhlV1y8v4B0EzIacBqVUYcAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765811832; 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=SrJdUUwAvjWMhClR9RcumuXsUFKFALL9ZeeSLDf11LY=; b=rBMHOoelEvoWIJJqQhjDhXYdegcdo8lg06z5jInbBTli6ThnZt5vZ9OrCrTlqLw5h3Zwsv SeZDQ11xlrNPtQJHpCC9ZKCroElsDb8zyQ/pOJugJT6xxYuflF0YgjTgnJqY+//+HcD98y K+kW6t2ti/AAxSRXQOGEWJ1vaeMOoEEoHbdU7pVUUAxgWOpDO3IX8OqWlq/HoF7iXFJnA9 j+++Awb0VvObXc5ZKqR2oXLc/XpbWAZyyBQ3dh9bBbuuykf57q3xdsS0HXMi4WVsiFuPts wUsA0iBo6NezqqzDhLNE3u4Pjoe2feBw/GOZj3IZz6HXC43OUkgYc3yRZaVNPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765811832; a=rsa-sha256; cv=none; b=m+awAteVxIwPmh1KPjvovcq1aBgibw29ErliqJkuQ6+26TGGDGh7RaIoi79J47lMxR0NDI yDiDHDCuhVuiSt2K2cA+nKziqUCHT4xDcfD+tPvto6Wp7NfXo+txJnKx4Ubj37IsoPobyU zZLjzhrXFQm3KwEoCaWqV1RUqLGQ4Lfod4/VD4KZRMsgK0wNFTqF99soSQ3BYepYJTM69U sMmkoOKh4u4IDDFxBEf+ZJOZNF37g7eQt8w+zYX25g2pGAj5b5lUoIXnhHxXoPnNsO5b+p DRximAHGLfJFHsc/BYjxrXeo+iFD5gcQ25hwnkuf6kVldWcL05W7uFaXSM5OZA== 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 4dVNvr2t75z9FK for ; Mon, 15 Dec 2025 15:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a650 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:17:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: ff6b04c37e78 - stable/14 - dtrace_pid.4: Document the DTrace PID provider 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ff6b04c37e780e070d871dff60370a0376efde4c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:17:12 +0000 Message-Id: <69402678.3a650.774f87d@gitrepo.freebsd.org> The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6b04c37e780e070d871dff60370a0376efde4c commit ff6b04c37e780e070d871dff60370a0376efde4c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-11-06 22:40:41 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 15:16:58 +0000 dtrace_pid.4: Document the DTrace PID provider MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51287 (cherry picked from commit 9fe88e5503239cb65e503e3b2b7344933a888644) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 1 + share/man/man4/Makefile | 1 + share/man/man4/dtrace_pid.4 | 99 ++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index ba462823a823..cefa17fd6758 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -1305,6 +1305,7 @@ in .Xr dtrace_ip 4 , .Xr dtrace_kinst 4 , .Xr dtrace_lockstat 4 , +.Xr dtrace_pid 4 , .Xr dtrace_proc 4 , .Xr dtrace_priv 4 , .Xr dtrace_sched 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 131bbd66ca26..87f493120cda 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -947,6 +947,7 @@ _dtrace_provs= dtrace_audit.4 \ dtrace_kinst.4 \ dtrace_lockstat.4 \ dtrace_priv.4 \ + dtrace_pid.4 \ dtrace_proc.4 \ dtrace_sched.4 \ dtrace_sctp.4 \ diff --git a/share/man/man4/dtrace_pid.4 b/share/man/man4/dtrace_pid.4 new file mode 100644 index 000000000000..1acbdd097ba8 --- /dev/null +++ b/share/man/man4/dtrace_pid.4 @@ -0,0 +1,99 @@ +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd November 6, 2025 +.Dt DTRACE_PID 4 +.Os +.Sh NAME +.Nm dtrace_pid +.Nd a DTrace provider for dynamic userspace tracing based on function boundary instrumentation +.Sh SYNOPSIS +.Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +.\" XXX: For some reason Op renders here in bold, so use literal square +.\" brackets instead. +.Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns No \&[ Ns Ar offset Ns No \&] +.Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +.Sh DESCRIPTION +The +.Nm pid +provider implements userspace dynamic tracing +by instrumenting the entry and return of functions in userspace programs. +Refer to +.Xr dtrace_fbt 4 +for more details about function boundary instrumentation. +.Pp +The +.Nm pid +provider provides the following probes: +.Bl -inset +.It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +instruments the entry of the +.Ar function . +.It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns Op Ar offset +instruments the instruction within the +.Ar function +located at +.Ar offset +bytes (expressed as a hexadecimal integer). +.It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +instruments the return from the +.Ar function . +.El +.Ss Probe Arguments +The arguments of the entry probe +.Pq Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +are the arguments of the traced function call. +.Bl -column -offset indent "Entry Probe Argument" "Definition" +.It Sy Entry Probe Argument Ta Sy Definition +.It Ft uint64_t Fa arg0 Ta Function's first argument +.It Ft uint64_t Fa arg1 Ta Function's second argument +.It Ft uint64_t Fa arg2 Ta Function's third argument +.It Fa ... Ta ... +.El +.Pp +The offset probes +.Pq Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns Op Ar offset +do not define any arguments. +Use +.Va uregs[] +to inspect the registers. +.Pp +The arguments of the return probe +.Pq Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +are the program counter and the function's return value. +.Bl -column -offset indent "Return Probe Argument" "Definition" +.It Sy Return Probe Argument Ta Sy Definition +.It Ft uint64_t Fa arg0 Ta Program counter +.It Ft uint64_t Fa arg1 Ta Function's return value +.El +.Pp +Note that all probe arguments within the +.Nm pid +provider are of type +.Ft uint64_t . +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr dtrace_fbt 4 , +.Xr dtrace_kinst 4 , +.Xr elf 5 , +.Xr d 7 , +.Xr tracing 7 +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter pid Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-pid.html +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . From nobody Mon Dec 15 15:47:23 2025 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 4dVPZh29wCz6Ktnd for ; Mon, 15 Dec 2025 15:47:24 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVPZg6RyMz3cnH for ; Mon, 15 Dec 2025 15:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765813643; 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=qf6QfEu2EBJ9dJQR8rPyTYgs+p6fT7gH/XE9hlMXozg=; b=vFM8Z2Fx2km+SyRZqkz9sHzl8Qo1R2192bw4B3hg+nTcWuyzdTFVSZBtPyBtSP9KekFesM A06IX0dMcWIbO/AWHEE1N+7Rr6l7SerXwwpd5wRy6e7S9/LZso+iVXRjCpudbMxtlySndX 2QuD3WA1LsDUVt5uWn8HaHPnEZ3gvI5nb1peDTHc83hbqbpkajhTbz4qu9qyLW5wUivS3O HKujTtYSzkKpy+MyY8IAbHw++CfQjRGUVUGvPBwWXzzMFPm/7tuA20oquhZ5BbqX1Cu9lh QonXZaaC3wV+ttUoKkqgjqqxUPBtZectTobuN3Zfyhan9+B3mdquMEpr//Q4Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765813643; 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=qf6QfEu2EBJ9dJQR8rPyTYgs+p6fT7gH/XE9hlMXozg=; b=tN/iovvq5JDLyrRkLl+kXhd9hXu2dajDrXzbeae9f1rOp2h5tuwMzK9S/TFBOkr/eythCA qXovrW9cptdK72D5oGBQ+I4lIRjdBTeh+/qeAqg0TVuGMc2EFdwf3IrmOGGnj01WhVhkhy Hru8eG0LVazNKedmT75N9t0f9lD+XpWEoKh4mGXZbcSMUWtmSYG/0zl/6QBh2/j1FJaZdd sZx09DSRFy+xkIu2kW66SIZYxSt72+U6uHgaLtvbTw1B2gqc2NHbrUvKcNzYjgcCoAltx+ EchJn7FSN9Ox8NQ1385B//S8N1msopwuiYBGa6to9AnLq1xFsqswldpsxx2Vuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765813643; a=rsa-sha256; cv=none; b=pz9ogWi5TAONb1mQ2nEbsnktbDvWDbsAQll/qD8KE5KUG02+U/yMZdW9HGuMNx7cEbAv+c HJoWeB+DtA/UkHE+B0p79mzc7rtrAw2GfQns0AjQMgFkRTF+2qtXOWAszv3ZsVpPYPPN5B Pl1ti8ePTH8oyS+dGsG+A9gIPv7AVloOVCFXkHjZvWjt6nwxF2Ute6tDk/DL2dTr+l9IwY A2TSOzRgeHiP0RgAa0QXbFDjIkWl/oxnr8slHJLo3iW7vUZ7b8HJjCtuXMYmtdOo0cGmr5 NTIh0FhMmGHswxBDdbZBIcbaUNZTj11hLlbwJv/eMhUCtvH88Kt2FV21xc3pxg== 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 4dVPZg55Flz9Y2 for ; Mon, 15 Dec 2025 15:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ea6c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 15:47:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bojan Novk=?utf-8?Q?ovi=C4=87?= Subject: git: 4f7436bf297b - stable/15 - amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4f7436bf297b93fd9e835ffca3d56288ce934dc5 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 15:47:23 +0000 Message-Id: <69402d8b.3ea6c.4c5a3e49@gitrepo.freebsd.org> The branch stable/15 has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=4f7436bf297b93fd9e835ffca3d56288ce934dc5 commit 4f7436bf297b93fd9e835ffca3d56288ce934dc5 Author: Bojan Novković AuthorDate: 2025-12-13 14:53:45 +0000 Commit: Bojan Novković CommitDate: 2025-12-15 15:47:00 +0000 amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map This change fixes two checks that conflated memory mapping and memory segment idenitifers. In both cases the code iterates over all memory mappings but passes the index to `vm_memseg_sysmem`, which is wrong. Fix this by passing the memory mapping's segment identifier instead. Differential Revision: https://reviews.freebsd.org/D54210 Reviewed by: markj Fixes: c76c2a19ae37 PR: 290920 (cherry picked from commit f1809eab82a796845f126b703c01d4a31ccf2193) --- sys/amd64/vmm/vmm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 6dfa33adf63c..5cb2776fe917 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -657,10 +657,10 @@ vm_iommu_map(struct vm *vm) pmap = vmspace_pmap(vm_vmspace(vm)); for (i = 0; i < VM_MAX_MEMMAPS; i++) { - if (!vm_memseg_sysmem(vm, i)) + mm = &vm->mem.mem_maps[i]; + if (!vm_memseg_sysmem(vm, mm->segid)) continue; - mm = &vm->mem.mem_maps[i]; KASSERT((mm->flags & VM_MEMMAP_F_IOMMU) == 0, ("iommu map found invalid memmap %#lx/%#lx/%#x", mm->gpa, mm->len, mm->flags)); @@ -705,10 +705,10 @@ vm_iommu_unmap(struct vm *vm) sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED); for (i = 0; i < VM_MAX_MEMMAPS; i++) { - if (!vm_memseg_sysmem(vm, i)) + mm = &vm->mem.mem_maps[i]; + if (!vm_memseg_sysmem(vm, mm->segid)) continue; - mm = &vm->mem.mem_maps[i]; if ((mm->flags & VM_MEMMAP_F_IOMMU) == 0) continue; mm->flags &= ~VM_MEMMAP_F_IOMMU; From nobody Mon Dec 15 16:11:51 2025 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 4dVQ6w1JXkz6KxMf for ; Mon, 15 Dec 2025 16:11:52 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVQ6w0V0pz3g33 for ; Mon, 15 Dec 2025 16:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815112; 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=G0rwWfmd+EEvCFCIeSsIoZ2f4ZvN+75ykyzhVb6fb6w=; b=JpUHuwkanwb1X4HIWASpVSifznK0XTWlTRxcJaNByEJKMd31RgDSTOJR78JnQGy8kU7nG1 tVcSprmim4OGhYNy6iJZGhkZRc5M9cMlkPPEMHhNoAT4kcPHn9BpDcEAurRLiyE2gWKvQ8 q9tigjG4LavjDrzzV7EaYebW5iGzooqUKXAYDAiJ9+P0HS7RLm4/vzFix4spEPlOs/bODr UsKOowxXIUhhpgHCPNZ21V8i7UDIrmJHIWHI7I2TqECreYelRNjwpeW5kzSPm15liu458R y45I3DS++QZV2fd9ZcrexCgSCj7ZAqGcMt5ABo1B+PU29KYYpmIw+iStNLfpZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815112; 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=G0rwWfmd+EEvCFCIeSsIoZ2f4ZvN+75ykyzhVb6fb6w=; b=cXPq/L86Ucr5mcZCvSwbOehcynXCjbbIXf3ZnAiMRzzjZTw4K+DyObefgATc0wQsf+/2tv F2d35kq5Z3kyBkE+N+/wU0ViCgo5bkgepaiTG6K+7hz0IyvZKTxf241T/RR3RP6lEBaKEp bh2VQcaSH8ecp4Y73Jutl7uzaMqvxANw+ap/3+dVyRjAijpzS6vw5NBLj55PQIm/pNM/MY 0UqW53gw5o81cqPkqWsbAix6oAtqEwp1SQ4UxvZ5FN76pfV666Ih5WGoB1y24ggSAMHcN3 gq+IfzuWNa0bcaLbLP1jv7t56HR6xa31FulHARBXA1tgZ/moKxNiZtm7tvyKmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765815112; a=rsa-sha256; cv=none; b=PvH6/BjNDORkWbW07AmxsA/4EPcL1Z+5/bhw5opNeMg8Ol6sP7uFyQ/eUZBdCLmnWn2abL E6vyLYTIu+qJrYV05+kDcb+z++i8u+82mXU855276mh5FSqLkZhcSzsPiYdTM7JQUwvAHK WD713x/Y/z/gLoeXUqgzD51flSoKMtsTFG/EjLzoh0/w+uCt+qsQj6fPPj0V23eScOrfkS zDBk/2MqnS7mzn9fQg5lm1AGf5PN2XlQkH7gt8zfte+pZzMO3GgIVQEtTnyMkD8Ykn8Fbt AGM9eD1rFyXDagM8Lib+dD6fVKhJIFJQDR3Hmcc57nuCVAHCbwCBAloCBRA8Ew== 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 4dVQ6v73L4zBJ0 for ; Mon, 15 Dec 2025 16:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 948f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 16:11:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 80523463ac36 - stable/14 - netmap: Fix error handling in nm_os_extmem_create() 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80523463ac36034945c2143a2ff184e1b922381c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 16:11:51 +0000 Message-Id: <69403347.948f.2038c@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=80523463ac36034945c2143a2ff184e1b922381c commit 80523463ac36034945c2143a2ff184e1b922381c Author: Mark Johnston AuthorDate: 2025-10-17 12:55:17 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 16:00:53 +0000 netmap: Fix error handling in nm_os_extmem_create() We bump the object reference count prior to mapping it into the kernel map, at which point the vm_map_entry owns the reference. Then, if vm_map_wire() fails, vm_map_remove() will release the reference, so we should avoid decrementing it in the error path. Reported by: Ilja van Sprundel Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53066 (cherry picked from commit dfc1041c08ba32f24b8050b4d635a0bbbfd9b767) --- sys/dev/netmap/netmap_freebsd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index 6448fdc74160..1df97dd91400 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -738,6 +738,7 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pools_info *pi, int *perror) out_rem: vm_map_remove(kernel_map, e->kva, e->kva + e->size); + e->obj = NULL; /* reference consumed by vm_map_remove() */ out_rel: vm_object_deallocate(e->obj); e->obj = NULL; From nobody Mon Dec 15 16:12:01 2025 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 4dVQ754nlSz6Kx2G for ; Mon, 15 Dec 2025 16:12:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVQ753yrzz3gFj for ; Mon, 15 Dec 2025 16:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815121; 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=9do7tBiZdMv7SU6mEhS93PBhHstnG4/abytB871N978=; b=gd5Y4SJQHvucUCQ7LWQs53+FhAAFfQQGMUHbDhi2EnD6DX8rPYswEOSajYTAfx2rL/7VuJ pxxLp4+qCqBRu02MGNfNhRfAgaDA5nJLuKEO3EUp+r3hFYFqkkucNgks4dLvjdTaTpUNXP Oj3B08A/5bZoQYAy6SdvzVsSsuPVQZtA49ecu9ALeiummDTrxFWwAFKbV4ciLSIz5rZr65 xOYR0u3uNLbk1nDt/K3o603rw2OE4/lO7BVd3dtBbWJToGIp4GaOA1AGUWAA0bSguQuJ/4 8dA1K/4BiSGwgpEaDSfnWfhYoOa8CMsHrXl6ul2Dlgaq4W3cyfn6BztSM9vz8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815121; 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=9do7tBiZdMv7SU6mEhS93PBhHstnG4/abytB871N978=; b=b8/Dp3utN7xbEzjbUfqcvq+Mut/4agRMEoIgSHq+j072Pc9EVZr3OGXZ2eYlRZIQDVrafB 2Sg2HQZ3zYY/AbDOMOro7JyvlSMs4HygKR5jXcduFSiJkfpd+iTvy48OqQOBbIuj+WrVRI uydfXLDeGu/CRMqTct4EfxfrJfx7udDTSEYmEWW4EzUJoSM6Y9t+1KMVk0JGDys74K0p1p DcdjHNMBUROuifujJ+YQtLx6KjKi3iAlfcIRACe4uZtCTij8XFRGDo5I9aqTTB6+lZ+Ggz zHcexZdD8OKrSrREqw+HB7fshOuflJQcxQ5g6mNrlPj7i0zfFwiGMzL7daF8HQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765815121; a=rsa-sha256; cv=none; b=Ictw/nXVrhsFJHFUNAuXHQJ7E1eF7u/8nRH4bu9Del0C09kPOBE3hdboXZS0c7yVSPmZGb TJNL46Yhhz/iufq20KajTjLYaUmlAl6jx67mjNBloAlscs7SbpWayEh8pvLVzAzmYUlHPl Z/DK4kxOCVt5aVfyHQoZpJh7MyuGppJKYwedJwjNGyQYnacVnIC+AY1gtMZLXcECnuiZsu YyNprTDWg0QSlHdSNuF0ujyuwL1Tdnsfh+00zSxEBWmhZ3gKBdbCf4BZXqm0TtJ8Smf0h2 +4skDzIj1ER1m1XknZkXhh0B2o96RPY888yJx4Kiz/ElNh79EYVNMiPKh2j2aQ== 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 4dVQ753MGlzBWQ for ; Mon, 15 Dec 2025 16:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9b86 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 16:12:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8ddb5aff83c2 - stable/13 - netmap: Fix error handling in nm_os_extmem_create() 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ddb5aff83c275866e505afaea8ebdc87bad7f57 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 16:12:01 +0000 Message-Id: <69403351.9b86.49e9cbd3@gitrepo.freebsd.org> The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ddb5aff83c275866e505afaea8ebdc87bad7f57 commit 8ddb5aff83c275866e505afaea8ebdc87bad7f57 Author: Mark Johnston AuthorDate: 2025-10-17 12:55:17 +0000 Commit: Mark Johnston CommitDate: 2025-12-15 16:00:56 +0000 netmap: Fix error handling in nm_os_extmem_create() We bump the object reference count prior to mapping it into the kernel map, at which point the vm_map_entry owns the reference. Then, if vm_map_wire() fails, vm_map_remove() will release the reference, so we should avoid decrementing it in the error path. Reported by: Ilja van Sprundel Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53066 (cherry picked from commit dfc1041c08ba32f24b8050b4d635a0bbbfd9b767) --- sys/dev/netmap/netmap_freebsd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index db317c6e28ac..8bf4b8c8e460 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -728,6 +728,7 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pools_info *pi, int *perror) out_rem: vm_map_remove(kernel_map, e->kva, e->kva + e->size); + e->obj = NULL; /* reference consumed by vm_map_remove() */ out_rel: vm_object_deallocate(e->obj); e->obj = NULL; From nobody Mon Dec 15 16:15:18 2025 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 4dVQBt4x1Yz6KxjZ for ; Mon, 15 Dec 2025 16:15:18 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVQBt4Pz5z3gwb for ; Mon, 15 Dec 2025 16:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815318; 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=6A46YwGQNbjB5TyPlu8IeEKSBDtL4wzRlw1V+6pqwHU=; b=TXf4zQr1j8QmMz81SKeMn3M8aY0026sphGBYpbiVR6S9sLcuuze3nWffxKELlR7vQYJOeh 1bBkmce/TwdHiLjA84E7V2eylBPoHxQkJPsX5WVu/3JO+AZvSBivxHJzdXQdJ/EBF/EvUS wHOjAPyl3thbgGk99RdQoAhqrOrpx9UcebxjtDls28kGdflodQteJw2tMKgEA8lWYhznma lIWT5/ArKayJtHybbXY5p7jv+FrH+7hUv8YqZFUrC4xdX4DEgwJWjegvYk18+aT50wm0BH LA+Jgs/BmQmlFYqZs/xWSl4xdDXSdFGxXtrab4pUw/tqUBQIlwtZI3amiu9Abg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815318; 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=6A46YwGQNbjB5TyPlu8IeEKSBDtL4wzRlw1V+6pqwHU=; b=Xt7RIKnBbodp0cMyBeJ+CCoM1zL/jgh5Iuv+juEknDba9Iv1qow5ZjVOoLV7Xcut/pFSv3 oXQF8xAy11NbFGelMb+3WE0op5udiC6+IW2sLysXmi4FdVIa8qMQ/V5gIIY/QJtQbvVvcN RzIfaZRHIG5qpBuduPTGo1kMK0G0de5BkdG7y5KRc/a9vemM3LLH0KpZwtHvEaRcn+re/a dxcrR48Z7GHKa8WSApFOs6og+mM5PlXcU3wkG6IwI0Cb4coL3+2jTtiRH8qvwgTDPLvsJr EZ6aQfFv4uB0VhpxTX1ip0S/BPF+cdpBo9qrNfEQsQ0PFU3q5n/5mGjQnGddeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765815318; a=rsa-sha256; cv=none; b=uNGNPt0kzAQCXSso3H1T5/6jKy7QqNfv8e2dlAF5FFdzaf7r7b7jVTdj/2XLykbc839sTq XI+mzz/k2YmQm88PY8yzDQD5Q2ZV0bYfId5CBVtFOmyzIfGi6fWhiXXGzbBpUNt034K3jW 53Uc2lJRZFYBmEOhZ7NFsUXfZ6FAgFG6VXLdlFCavdKZ9h++FyhDY4AA8ij0A+P5SQ8ke3 L68jtEOtEN/9CJ0csbBWJTsOQc8pzvXdEXsr1cIn0cSFlKOoIZw1+r+PXrGc6wMJ/84QHh y6NffhAGk2dndg58pwfsm6YquZr6rRLxkHhsV1OoCRtTxJWHFbs6LlXPzkcX8g== 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 4dVQBt3kk0zBWm for ; Mon, 15 Dec 2025 16:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8528 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 16:15:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: b8d96efdd67c - stable/15 - uio.h: Indent struct uio according to style(9) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b8d96efdd67cf60f71921309d9b40196cf375e21 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 16:15:18 +0000 Message-Id: <69403416.8528.4508c1c6@gitrepo.freebsd.org> The branch stable/15 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=b8d96efdd67cf60f71921309d9b40196cf375e21 commit b8d96efdd67cf60f71921309d9b40196cf375e21 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-12-01 18:32:21 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 16:14:57 +0000 uio.h: Indent struct uio according to style(9) Approved by: christos (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54071 (cherry picked from commit 8740d7e4d183189d259163aa30179ad14c77c0c4) --- sys/sys/uio.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/sys/uio.h b/sys/sys/uio.h index 05c1ed640b63..58bb7b13b253 100644 --- a/sys/sys/uio.h +++ b/sys/sys/uio.h @@ -50,13 +50,13 @@ typedef __off_t off_t; #ifdef _KERNEL struct uio { - struct iovec *uio_iov; /* scatter/gather list */ - int uio_iovcnt; /* length of scatter/gather list */ - off_t uio_offset; /* offset in target object */ - ssize_t uio_resid; /* remaining bytes to process */ - enum uio_seg uio_segflg; /* address space */ - enum uio_rw uio_rw; /* operation */ - struct thread *uio_td; /* owner */ + struct iovec *uio_iov; /* scatter/gather list */ + int uio_iovcnt; /* length of scatter/gather list */ + off_t uio_offset; /* offset in target object */ + ssize_t uio_resid; /* remaining bytes to process */ + enum uio_seg uio_segflg; /* address space */ + enum uio_rw uio_rw; /* operation */ + struct thread *uio_td; /* owner */ }; /* From nobody Mon Dec 15 16:15:19 2025 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 4dVQBw0lM5z6KxNj for ; Mon, 15 Dec 2025 16:15:20 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVQBv68cFz3h24 for ; Mon, 15 Dec 2025 16:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815319; 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=U4t7spe864i16bTPXzNYzGDOauxwgUs1TCugGnoQjcE=; b=E4pY0O0HiS40qXhLR0mw/jt15ofhPeAmIazic6dTN9Zu5pboQD+UiIGXb9smC7GFofbC2Y WOcQq5bdMYVuSfYeD7KSRJwY/ir2f3I3qO95MHJadjtrPqTT5DkoP6PnKge4qi1reD5zJ7 wvWJSLtMcAXZ9MXAp0ut213V1bkk2VXnSb1zhcDblCURftIaKV5C+4IOmPmxHGfFx5bIj3 L14Skcq3iuhebm5PRIQvJ5K7yAISpMuCj8xtd2piZgpl3GMGr4Cu9hqDeADfsmadC8YnYb +INcJLpAWOjqlYUlDbVsWFBsBRBbOMtNtV0ja9AEMxqoes0FHipC3QRVItqxsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765815319; 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=U4t7spe864i16bTPXzNYzGDOauxwgUs1TCugGnoQjcE=; b=MtFRUfrR1D3UG75aqFEA3A3Sb9TkGgv72JRZi2MQl1IePX1nhiivbKZszqEt0bXbQB4XxN KimK2YFJeR76yuMbTfIJijh7H8pBZGfKEfBIGfkxp/Cs1GEbjUKqC0RZrpcLt4gsd7sMrn th0yz5SssPVNsa/gb5C6DKz8iX+q1kfAUH3ax9wUUkhmkHoa9oo7AQscpb0o9BFOOF2rtD 8D0CLkbHX6imwCeBEx2mw1D/tmyu/bvaQ4l6nWjZLh9DEkY47pGr6zTBTOGW2KXBKgUEB3 iTuv3Dk1Jz02eXv3jDlNr7bXYmRb3q5srLrPqSN/7eekMr3xK7DkLSB754sS5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765815319; a=rsa-sha256; cv=none; b=TWqIcNaqij8c7VgHW0bdPSzfnv9i3a6WHibfCzQR9vkvtL/u1nFz0X7apYfY0vi/3D/6Bc nTUgKQ1XrWCQuo4qkpq7FWOvNJdQkvxjr5FOsGUZ63GvKG+8yy1Ofpg0m3bTbXlnIUQNp5 aMEV7ddZAYgw+spOAdEnaEHkXJkTILI58UIlPOwdGP5FFUzYzhsQv0Kkc/c8gkaIV2Mg38 CWZCwF3t/fyhUnWRuPuTtHw/PCsUbSRqXhn7qimY4Xov8RGPDTe4bMpmKDqRN66k67QRwe NAErwtQU8jltRJUYh0OomHgVugKqoY16UUW/8/q1BKuPwyNMWn/81tVY0AKMOQ== 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 4dVQBv5TmKzBn9 for ; Mon, 15 Dec 2025 16:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9493 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 16:15:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2c8a177e9b56 - stable/14 - uio.h: Indent struct uio according to style(9) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c8a177e9b56ec684a602dcd6c3416532e7dbb60 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 16:15:19 +0000 Message-Id: <69403417.9493.2071623@gitrepo.freebsd.org> The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=2c8a177e9b56ec684a602dcd6c3416532e7dbb60 commit 2c8a177e9b56ec684a602dcd6c3416532e7dbb60 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-12-01 18:32:21 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 16:15:14 +0000 uio.h: Indent struct uio according to style(9) Approved by: christos (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54071 (cherry picked from commit 8740d7e4d183189d259163aa30179ad14c77c0c4) --- sys/sys/uio.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/sys/uio.h b/sys/sys/uio.h index e09a41ab1045..5185fdb8b001 100644 --- a/sys/sys/uio.h +++ b/sys/sys/uio.h @@ -52,13 +52,13 @@ typedef __off_t off_t; #ifdef _KERNEL struct uio { - struct iovec *uio_iov; /* scatter/gather list */ - int uio_iovcnt; /* length of scatter/gather list */ - off_t uio_offset; /* offset in target object */ - ssize_t uio_resid; /* remaining bytes to process */ - enum uio_seg uio_segflg; /* address space */ - enum uio_rw uio_rw; /* operation */ - struct thread *uio_td; /* owner */ + struct iovec *uio_iov; /* scatter/gather list */ + int uio_iovcnt; /* length of scatter/gather list */ + off_t uio_offset; /* offset in target object */ + ssize_t uio_resid; /* remaining bytes to process */ + enum uio_seg uio_segflg; /* address space */ + enum uio_rw uio_rw; /* operation */ + struct thread *uio_td; /* owner */ }; /* From nobody Mon Dec 15 16:40:20 2025 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 4dVQlm5Nd3z6L0Cg for ; Mon, 15 Dec 2025 16:40:20 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVQlm2td8z3lGf for ; Mon, 15 Dec 2025 16:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765816820; 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=OW9HXUgqdzpJuoSpvKaXBlWljdvXD0eBZKFhePy6nYY=; b=sKw1ZRIc2lNW4+FmShY0ag8Pncbw7NpiridnOm3oFIfCd2qZ0rFEBcjA8qHXMoVERkx9wJ R157s1cnSMa/0CicIyHJIICCoADc2HgAs/+mnc+4NZjuUf3OBCOKDs6Qrl0RYL8GYhb/ro It7agOST0z6klMB0LBAV51cfqPcf4RFxfHn1o03Hx3dGFDZAjqCcDdetfV0lCaBSNGxmsQ V/SBWscHSdDTvNT6HXUhDtngslq2t2CT/vHGgOr5y59nC0OdSrb8Rj2GQQ7cw6QKFgT3pf ddIxYO8q4IQONZOgqGEhKAUpqSA3UB42gPH1L2uMlPO0r8PWxjNZwEjb3p7klw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765816820; 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=OW9HXUgqdzpJuoSpvKaXBlWljdvXD0eBZKFhePy6nYY=; b=O5kBaGznpc71rllgE9DNn5C3agR9CP4R8di80uLkMkz83ehXdzf4hWLa5g9pwhndAsATMS AJAKzBx/kEUUqfVn+AuYwu3ymQjUeN9/n8N3q3tbfdB94VrEzOzzPqUF4TXOBS4NJinqnn P4yI0v81SQi6U0dQXUQoqXwhdGbnFlUcIItVL5eBmuUn6fSfmKuSpB/wHaDzgzHcz1aCtS 0SZtCt1KL7mxCRLJ96IIlOIE8sfhqob5swnhJ03nliCUvNt3LDW8E42JvyVUNP8mU5xcze ItzukOXhZ9OyoLn1BS0w2X24HkZ1g9ydBpdL1xZTprXglF44meUEtLryyZ6mXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765816820; a=rsa-sha256; cv=none; b=HOpp0cLDE3mmQyMV7tI/53nW2jiGMNuCj/6m8uUwgQ/O+aibDbAYzaiRD3VAuvo4Nm98iA 4X2lD0GFrhqZpOcGoJz4+p9fUCWuJ55cDMawXIaveMWk7ACztF83XZB69G3NDGhJxgFyLY JogAluwWE6LU4WBhT5AYiWbZ3/rWjlzOqE5zcrlamEUNwjms9NW/07E7xivryulhVNncLw 9ykialZhu7jGnV4vUW7XVhd21DkrPs906iOHfIW5roJFTlEU5Bbibcdf3sQ1NRal/X5rWZ TXB8jOKlT/dQMuh0kwyj4rEshLs6LQnAGuyT7u6YFgG4RreGg2HAR+aZTCWCZg== 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 4dVQlm1jJwzC4Y for ; Mon, 15 Dec 2025 16:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b1c9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 16:40:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ae1f6fd47c45 - stable/14 - agp: Export intel_gtt_read_pte, required by i915kms 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ae1f6fd47c4584d1abe5ecf26f291d282e6f6a67 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 16:40:20 +0000 Message-Id: <694039f4.b1c9.2ab2188a@gitrepo.freebsd.org> The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ae1f6fd47c4584d1abe5ecf26f291d282e6f6a67 commit ae1f6fd47c4584d1abe5ecf26f291d282e6f6a67 Author: Ed Maste AuthorDate: 2025-11-25 18:40:35 +0000 Commit: Ed Maste CommitDate: 2025-12-15 16:39:56 +0000 agp: Export intel_gtt_read_pte, required by i915kms This isn't used by modern cards, but is needed for i915kms to load on a system that has agp as a module not compiled into the kernel. PR: 291214 Reviewed by: cy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53906 (cherry picked from commit a87c1e2dd8fc997d6ee603c252c543afe8a4d2a4) (cherry picked from commit 8befd2d2b6a0c5d54fa53246a89ae09009007799) --- sys/modules/agp/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/agp/Makefile b/sys/modules/agp/Makefile index c5ce53d2ef13..8841c5776920 100644 --- a/sys/modules/agp/Makefile +++ b/sys/modules/agp/Makefile @@ -37,6 +37,7 @@ EXPORT_SYMS+= intel_gtt_clear_range \ intel_gtt_install_pte \ intel_gtt_get \ intel_gtt_chipset_flush \ + intel_gtt_read_pte \ intel_gtt_unmap_memory \ intel_gtt_map_memory \ intel_gtt_insert_sg_entries \ From nobody Mon Dec 15 17:00:03 2025 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 4dVRBW1vZSz6L1Zr for ; Mon, 15 Dec 2025 17:00:03 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBW0hwVz3pGj for ; Mon, 15 Dec 2025 17:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818003; 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=WWfCLNVOXy6q/GouOUMMw6zoHBvvUvv0ZjlDqQrZrFA=; b=Ox8+Xdy8YpcwE/NOo3Xc2pM/D825gGtUUFie4BUj/mIKoAxY/UiuzPGZAs3bMgxQSSqpaE FDW/rhRNH2S2kpeDlYs7HRSbUYFiXMBXPx4HdGJPuFF/rUzdvTA3kn8jtPyCDK8GwRt5bu yfBRrmXHd8w+//C7ob8TGxzgd8H5kyk2S+Mfbn2Ri0X14MQ6tj6SJAZ/rmqbx8BLCmxtUw ZrycSMDjt5wLbX8WQXykfrel7W4/ClGkSCa6gabVu2eXpgffzT8rsCV4EPnJzZcUEo7Y5u 8+6tYiaYZrx82qXmOzN/SfNxJRsQ1JxNUnS7BKRsCL91Pc/KlowYAwYjarg8QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818003; 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=WWfCLNVOXy6q/GouOUMMw6zoHBvvUvv0ZjlDqQrZrFA=; b=uZtTfElAf3W0gwzlZ0mTRZO21jFEBfLIBBuwQLu1iISO+n8hyVxtVsBt6/Km+1VLVFeMHe r8yr8S2CAmQkjl/hic6+BG+VFAGv+HzmD6+Ef4ri27MH6KwpbEgkfPQanSSW5EC1R0hdIj 6CFix4t6cQOtUMZ4FeIO59YVSy4t6puS6m4WAUkBRyX0CC2WMlu+K0/yzljV0u8osaRDut mEU4d1sFxcXH7Tw/07CZzmq4yzZEh9TC7dcvbfcc+cwLbXigO19vDJcHPDvoPdoWS+r3WK uBixu74UZL2JJtFGE4x38of0z6mmdoj0OVMNt0fixrpOehf/+fSuegS8m5XykQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818003; a=rsa-sha256; cv=none; b=fN/O5Kk6CfmQYZ7EiFdMkv8m3PR864RAybmFruANuat5wAVyYqtnirKQr7mQk3D0fq9oxp YDObN4N/QrniJkDs7Y+7nAkSgOVFnSGU/kGSYCYQcuZljobDBqBL/xBDzy1LZGTLfBiGlh YHiT9h6FQwRM7J74Fh/j8ppQRNivhe34YpAPxikPn66NxSHjtUt52YqL2FFz7ZuBZ3OWc4 BgmWEvaYN2AVrlGEQsBDIYY0sSgprm+6s1H9OYpC4EIe0ftBpdtdu4+2fcuBfjle7XK2c6 S2bCMuVd5rrUhw0hfZ7NOq0YjFvhtBkefcuKClFKb8QzBIpz9K4vLlZRv/PorA== 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 4dVRBW0HdxzCYT for ; Mon, 15 Dec 2025 17:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dda4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d5d8583a16ef - stable/14 - rtld-elf: Pass parsed aux_info to ifunc_init 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d5d8583a16ef533dfd8e1164401c4960417014ad Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:03 +0000 Message-Id: <69403e93.dda4.50e105fe@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d5d8583a16ef533dfd8e1164401c4960417014ad commit d5d8583a16ef533dfd8e1164401c4960417014ad Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 rtld-elf: Pass parsed aux_info to ifunc_init Currently we pass the raw pointer to the on-stack auxargs. This can legitimately have fewer than AT_COUNT entries, so the use of __min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also needlessly forces the callee to iterate over the elements to find the entry for a given type. Instead we can just pass aux_info like we use for everything else. Note that the argument has been left unused by every callee since its introduction in 4352999e0e6c ("Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86.") Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46276 (cherry picked from commit 33658afd4e4d11cd71d92e52ca9da5381cdd829b) --- libexec/rtld-elf/aarch64/reloc.c | 2 +- libexec/rtld-elf/amd64/reloc.c | 2 +- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/i386/reloc.c | 2 +- libexec/rtld-elf/powerpc/reloc.c | 2 +- libexec/rtld-elf/powerpc64/reloc.c | 2 +- libexec/rtld-elf/riscv/reloc.c | 2 +- libexec/rtld-elf/rtld.c | 2 +- libexec/rtld-elf/rtld.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index 828686af8b98..c65b5dd431a0 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -352,7 +352,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index e46f6bc2e9b5..134506ae3854 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -497,7 +497,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index 6efc9f499761..6bcfaa507505 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -443,7 +443,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 361bb777315a..24c754865504 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -462,7 +462,7 @@ rtld_cpuid_count(int idx, int cnt, u_int *p) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; int cpuid_supported; diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 73a1c89991e2..859991cbe27f 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -802,7 +802,7 @@ powerpc_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 70928829aeda..71b7a361f0df 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -699,7 +699,7 @@ powerpc64_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index d806e1ec3d63..2b254803fabf 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -377,7 +377,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a49d2a6301d2..8509321b785f 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -918,7 +918,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) exit (0); } - ifunc_init(aux); + ifunc_init(aux_info); /* * Setup TLS for main thread. This must be done after the diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 8d0b8bfed2ab..527ecf9d84e7 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -446,7 +446,7 @@ int reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *); int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *); int reloc_iresolve_nonplt(Obj_Entry *, struct Struct_RtldLockState *); int reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *); -void ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]); +void ifunc_init(Elf_Auxinfo *[__min_size(AT_COUNT)]); void init_pltgot(Obj_Entry *); void allocate_initial_tls(Obj_Entry *); From nobody Mon Dec 15 17:00:04 2025 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 4dVRBX2nGNz6L1ct for ; Mon, 15 Dec 2025 17:00:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBX1G8Bz3pDP for ; Mon, 15 Dec 2025 17:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818004; 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=GBmQFScwZholm4faJLTBR7kLwaQDJHZTkoEXn13bc8w=; b=YzLTP0lelnVCiHaaVhoIna/4HicZNQIo6mKkW1P+GA15QnPgEum4/qnxVPzlpcXaI/t5e2 rfMXWvc177Vp4RNBHKf98AUNRENo08ClZrofIbvN1acboZX7iiKJhiOkqO2LQDH4JBFGGW Oo9Oc0pkYHpClczGx9TsyWiPZ+RfDSPWgWd0JmybnFpCj3N6dStAGryct3mujHZAvrEeIt acyCEqOTN1T54ARRfY8sI7x6JcwnSY50bTF5v3qCDXacWBNM+k64WaWIceqlPoKFMLIgJN U0JJ6ktQ5H5AQz5gRV7zugcHEZzOcS68vky9oHfkYToFT5nM8vjDMKMgm/pYVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818004; 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=GBmQFScwZholm4faJLTBR7kLwaQDJHZTkoEXn13bc8w=; b=Kbg8tT/XJ6vq3k7Q2MHU6s6d+Dz/CnJSE+ob4s+/9DgXAxzp5Kd/HFficxELWOYNgGgwiD DwDvwcJPyhswgK9W5MqNB5Y16RySNhxYO6qku3+awZv2YeX2a+nwyc/eKmq2ORpMQ8Uu5O zYA7CMxCAcAyXgL2NM7tF9cjesn7DWViSSPXettdDhIe8lpydzhWJQQNHNGeNyYrTjbABM oVm383LNW58O6HsXa7LCQpnh8kvG7FTaNMkOA4rGLu8Kdp462uwdlW1IKovlYLLSprZgnc AUw+bZonZYdJDmFbYHCC5cezyXm6IUhjVY9FHdXixrspyMWSiYuHXD/XCw1mpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818004; a=rsa-sha256; cv=none; b=qLl/Xz4bU/sCEvqlGn5h5TfNQoht8x1P3hImoi06NsUJTcoVmUjwiW7pfgbpdXBSSCJT5l qGunYj84HDb/TNPgESaml69Xmn0hxoSLVuofDiIATtHF4W3B/L7gFHSpW6+e7KMAFTC0W5 7CCafYrkjpj8Tj5oy0JNTVC5DxhcSXxrDXYxQ2PX+3C0E1ypCiOp6GLOa10ZpMdletFXg7 wd0WdP2PZcr5EA2bDSt1gR3MdR9JHTMe+ZDEtWP0F71IMYuVhQt12VgB4/XJ/KgeST4wBh tArSBfsLYGWgo0rfiC827b+wKoGgQFoQRIKE6JEnSMfp/vvEilRnY3/IeHToKw== 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 4dVRBX0dX4zCkd for ; Mon, 15 Dec 2025 17:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e09d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: f6ff014ba52d - stable/14 - riscv: Recognise B extension for AT_HWCAP 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f6ff014ba52de10a3a72aa9b2e331989dda9d1e8 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:04 +0000 Message-Id: <69403e94.e09d.1e529890@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f6ff014ba52de10a3a72aa9b2e331989dda9d1e8 commit f6ff014ba52de10a3a72aa9b2e331989dda9d1e8 Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 riscv: Recognise B extension for AT_HWCAP This was ratified earlier this year as an alias for Zba_Zbb_Zbs. Whilst we don't currently export multi-letter extensions, we can still export this alias in AT_HWCAP. Reviewed by: mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46277 (cherry picked from commit 228a3e73e16983bc7f985b24ef20909500792d3c) --- sys/riscv/include/elf.h | 1 + sys/riscv/riscv/identcpu.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/riscv/include/elf.h b/sys/riscv/include/elf.h index ff0f36d2efe6..a14d6859902b 100644 --- a/sys/riscv/include/elf.h +++ b/sys/riscv/include/elf.h @@ -82,5 +82,6 @@ __ElfType(Auxinfo); #define HWCAP_ISA_C HWCAP_ISA_BIT('c') #define HWCAP_ISA_G \ (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) +#define HWCAP_ISA_B HWCAP_ISA_BIT('b') #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 8f1bd7990393..6c515e2a5101 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -245,6 +245,7 @@ parse_riscv_isa(struct cpu_desc *desc, char *isa, int len) while (i < len) { switch(isa[i]) { case 'a': + case 'b': case 'c': case 'd': case 'f': From nobody Mon Dec 15 17:00:05 2025 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 4dVRBY3sRJz6L1S1 for ; Mon, 15 Dec 2025 17:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBY1c5Sz3p5Q for ; Mon, 15 Dec 2025 17:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818005; 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=K4Rq/rmmEvk+OlLRAmrRRdsf27t3rUwu4DFeJULg+zU=; b=oSPD73PfSmsQMirf8AUm0JavXjLf23S0vOuz/c2zxbBlaE2XoOhU2TlO579x5ch0LAF9e+ O4usadeCoHmcqG0pd3Roy5O1lNzobwoqMt5ZXUVBCiDXufbdQVtc20wjA+ARYS6/+r98AS SoMbVClfcGo+jN4FwgQzjTtiPFTv9w5x+4sG+r99mj89gzsbMmdpcVZDqKIxY2G9PtSuMV 4gG1dQjUo9SwvrefsBlhYFO7xSq7ANDL+5HYlWUF6ZsPGsT2X2H9uYukfmfleUbryhOEhJ 5B64bqeMuhAe53QsZcGvhr1J0dwJizlwNPxFd7dg+gVKSlCjkekSnGqkZf+dGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818005; 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=K4Rq/rmmEvk+OlLRAmrRRdsf27t3rUwu4DFeJULg+zU=; b=I77U+TOQf2EMlvDP54GNNkNDt+zsOcbk6FNnV5963WzGKcitre0WXqPOAiJ6hzpsh9ztga zsY+YDylzIm5ce7VyFd0dL3L+qmRI0t16uBXEpTAWFxhlrilPaYFLIDwo4LmGZ2nab3On1 H5hllHD/dl79Pp1JY5aqCAzsE2EyBC8j3m7pZexVRtYeFDEoVaCebh5kS8WIs/ltISIE7P eVi2uwpdSKoS73FMTJRjUO8elZpL0WQ8XZEngMB6DBx7L0Fbbj6K7ZvkaCzkEFG/JUkIAe Q78SEshBQKsBduvTRBPTv0mhmJdbOEBoOaNwFjzP8LaQjxY8RnJb9pCztCWitQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818005; a=rsa-sha256; cv=none; b=E7vw8/d7JwFPhDtvU9fW2/wofsb8ILsDPyGn5N0ernQ53TCWjoKOgrJy+jIwZv1SmsQa0K +QFtgmizbTAo+NKtc2q7ka9eesVo6B2myF4uDJNcWhuenJ+B4nZdrkviZj5xMB+LS9dXJn TCFbTy4jQjE0nyaQKE2q6/4aELukh2XXBUrzoC3YQPBtAcA5q65A7M91vOCu1n7d7DQXXP DRR1vMhSrEvn31AsgggnSOgeeS4rvTi/eQV5MtQ5xYfwoxEqNUVNSw46k5WtlFJeh0Crbk 204Wqrs9JSZmHXrMawV6n+EK53gnK0pO6zHFu8YHSau08CR8Tfd//5Sgs5FnIw== 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 4dVRBY0xbCzCnp for ; Mon, 15 Dec 2025 17:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c6f0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: f61eabc1f4cf - stable/14 - rtld-elf: Support IFUNCs on riscv 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f61eabc1f4cffaedb733262a8fd07f3011f6d827 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:05 +0000 Message-Id: <69403e95.c6f0.5943e936@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f61eabc1f4cffaedb733262a8fd07f3011f6d827 commit f61eabc1f4cffaedb733262a8fd07f3011f6d827 Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 rtld-elf: Support IFUNCs on riscv GNU/Linux has historically had the following two resolver prototypes: 1. Elf_Addr(uint64_t, void *) 2. Elf_Addr(uint64_t, void *, void *) For the former, AT_HWCAP is passed in the first argument, and NULL in the second. For the latter, AT_HWCAP is still passed, and the second argument is a pointer to their home-grown __riscv_hwprobe function. Should they want to use the third argument in future, they'll have to introduce yet another prototype to allow for later expansion, and then all users will have to check whether the second argument is NULL to know if the third argument really exists. This is all rather silly and will surely prove fun in the face of type-checking CFI. Instead, be like arm64 and just define all 8 possible general purpose register arguments up front. To naive source code that forgets non-Linux OSes exist this will be compatible with prototype 1 above, since the second argument will be 0 and it won't look further (though should we start using the second argument for something that wouldn't be true any more and it might think it's __riscv_hwprobe, but that incompatibility is one we can defer committing to, and can choose to never adopt). Until the standard interface for querying extension information[1] is settled and implemented in FreeBSD there's not much you can do in a resolver other than use HWCAP_ISA_B, but this gets the infrastructure in place for when that day comes. [1] https://github.com/riscv-non-isa/riscv-c-api-doc/pull/74 Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46278 (cherry picked from commit 729d2b16b74fa5207a12aa1de190bd930432810e) --- libexec/rtld-elf/riscv/reloc.c | 140 ++++++++++++++++++++++++++++------ libexec/rtld-elf/riscv/rtld_machdep.h | 5 +- 2 files changed, 122 insertions(+), 23 deletions(-) diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 2b254803fabf..8dd225e5a920 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -153,10 +153,20 @@ reloc_plt(Obj_Entry *obj, int flags __unused, RtldLockState *lockstate __unused) for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; - assert(ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT); - where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - *where += (Elf_Addr)obj->relocbase; + + switch (ELF_R_TYPE(rela->r_info)) { + case R_RISCV_JUMP_SLOT: + *where += (Elf_Addr)obj->relocbase; + break; + case R_RISCV_IRELATIVE: + obj->irelative = true; + break; + default: + _rtld_error("Unknown relocation type %u in PLT", + (unsigned int)ELF_R_TYPE(rela->r_info)); + return (-1); + } } return (0); @@ -188,6 +198,11 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) return (-1); } + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + obj->gnu_ifunc = true; + continue; + } + *where = (Elf_Addr)(defobj->relocbase + def->st_value); break; default: @@ -200,30 +215,89 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) return (0); } +static void +reloc_iresolve_one(Obj_Entry *obj, const Elf_Rela *rela, + RtldLockState *lockstate) +{ + Elf_Addr *where, target, *ptr; + + ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend); + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + lock_release(rtld_bind_lock, lockstate); + target = call_ifunc_resolver(ptr); + wlock_acquire(rtld_bind_lock, lockstate); + *where = target; +} + int -reloc_iresolve(Obj_Entry *obj __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; + + if (!obj->irelative) + return (0); - /* XXX not implemented */ + obj->irelative = false; + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_IRELATIVE) + reloc_iresolve_one(obj, rela, lockstate); + } return (0); } int -reloc_iresolve_nonplt(Obj_Entry *obj __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_iresolve_nonplt(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; - /* XXX not implemented */ + if (!obj->irelative_nonplt) + return (0); + + obj->irelative_nonplt = false; + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); + for (rela = obj->rela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_IRELATIVE) + reloc_iresolve_one(obj, rela, lockstate); + } return (0); } int -reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; + + if (!obj->gnu_ifunc) + return (0); - /* XXX not implemented */ + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT) { + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) + continue; + + lock_release(rtld_bind_lock, lockstate); + target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); + reloc_jmpslot(where, target, defobj, obj, + (const Elf_Rel *)rela); + } + } + obj->gnu_ifunc = false; return (0); } @@ -233,7 +307,8 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Elf_Rel *rel) { - assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT); + assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT || + ELF_R_TYPE(rel->r_info) == R_RISCV_IRELATIVE); if (*where != target && !ld_bind_not) *where = target; @@ -252,13 +327,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, const Elf_Rela *rela; const Elf_Sym *def; SymCache *cache; - Elf_Addr *where; + Elf_Addr *where, symval; unsigned long symnum; - if ((flags & SYMLOOK_IFUNC) != 0) - /* XXX not implemented */ - return (0); - /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). @@ -286,8 +357,27 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (def == NULL) return (-1); - *where = (Elf_Addr)(defobj->relocbase + def->st_value + - rela->r_addend); + /* + * If symbol is IFUNC, only perform relocation + * when caller allowed it by passing + * SYMLOOK_IFUNC flag. Skip the relocations + * otherwise. + */ + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + if ((flags & SYMLOOK_IFUNC) == 0) { + obj->non_plt_gnu_ifunc = true; + continue; + } + symval = (Elf_Addr)rtld_resolve_ifunc(defobj, + def); + } else { + if ((flags & SYMLOOK_IFUNC) != 0) + continue; + symval = (Elf_Addr)(defobj->relocbase + + def->st_value); + } + + *where = symval + rela->r_addend; break; case R_RISCV_TLS_DTPMOD64: def = find_symdef(symnum, obj, &defobj, flags, cache, @@ -366,6 +456,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, case R_RISCV_RELATIVE: *where = (Elf_Addr)(obj->relocbase + rela->r_addend); break; + case R_RISCV_IRELATIVE: + obj->irelative_nonplt = true; + break; default: rtld_printf("%s: Unhandled relocation %lu\n", obj->path, ELF_R_TYPE(rela->r_info)); @@ -376,10 +469,13 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, return (0); } +unsigned long elf_hwcap; + void -ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)]) { - + if (aux_info[AT_HWCAP] != NULL) + elf_hwcap = aux_info[AT_HWCAP]->a_un.a_val; } void diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index 381eba530c2d..d80843d2820a 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -77,8 +77,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, __asm __volatile("mv gp, %0" :: "r"(old1)); \ }) +extern unsigned long elf_hwcap; #define call_ifunc_resolver(ptr) \ - (((Elf_Addr (*)(void))ptr)()) + (((Elf_Addr (*)(unsigned long, unsigned long, unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long, \ + unsigned long))ptr)(elf_hwcap, 0, 0, 0, 0, 0, 0, 0)) /* * TLS From nobody Mon Dec 15 17:00:06 2025 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 4dVRBZ5WV9z6L1jW for ; Mon, 15 Dec 2025 17:00:06 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBZ1phyz3p7f for ; Mon, 15 Dec 2025 17:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818006; 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=HdD/CSvKtRBflJSdP66UO96/3kkyYKB1R/rVoxYU7+M=; b=u5xU8KPGz7dD013Q5EN2Nv/LidhwV7aXDGrdLbxOEX7SCqvr2pyiuUFjVIxCDfhP8uX0Rx uzSZXftiGB/GtTBqLB87WSf6L0GCbQI+8wEMmE63/2KhfpyN5fnb46PKEn3XAjLc24DODv 3OgEPpliY4NFsSL3Hs37wgTFV0udSdz0viBW2Vfq+8mN64QPGTeHxc0yEbn+x+x33hBHY6 nRsHWIEXWfJlIgdcAr0uH1iG20TUvRbJq4HeHwBpdbcovDWF6q2sgBQJ9YQB+3QF/2jesG nYmTm3kqIXOVU/0TVdKG95P4IbSTNlagbhw+b893jZ2PqlHWboeWl9qoQdGs2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818006; 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=HdD/CSvKtRBflJSdP66UO96/3kkyYKB1R/rVoxYU7+M=; b=ItwHiI3iF5tB2ptYlHxFVU00wOhq+t15evT4KeZJoVvszofRT4kd1rteTWTMNEbNVpG1Jr h8hz5Jy65o/32+ulJ5kvy9A7d04bjTRUF0TcaQ/wlmOvLVsEMuRM8OhReBF4fV4ghN6nfS a1Bo95An0OjSU6R+hnHtcKLKaAEz7/rD3+riAZtdrLUd0fFlkoAM0vosd4p7WHBWEJI+nX rJowvusePowyIWHOD48/ZkBAS1Vb2uebJ4vtKngz9YnmKoa9+nkUeofkbpWuAljqJil7MM 7eWdD2vfZFAAVbbRV01GDre2UaldeBJmmO33ota2x1O3GZxTWu/dEQe34UEwxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818006; a=rsa-sha256; cv=none; b=BpODQmIEIL2n8ymO4lb3U+ONYuc1MnPV2MU4mjn19S8OA4L300a3X9/WjN0nDk3E14Vx0G 1JIMLpAUNDb4a6raMq6sYRe57ArTSbD7tf1IB/a1fZ2OMIcwehTBl3EVWTUOyHPP++AbTy X796a1Fn6MmEgfj1g0KZ4aPj5A5mnfHOwrMscjIB7/RvjzOVrmHnHiOz1UBbOE91V7UMXK foTIXhJlwS0H6dQ4lBmVnDpk9fuQMmFfqLh+HhLc8L2wk/c5cy1P0PIDZ4LdVaO9W4/up/ iq1kvB4keAjJkEbh3tkuZGvQT7jyaSDKPs3zmspyvQqtZ+wia1eJ6iAh7SnLcg== 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 4dVRBZ1K7gzCnq for ; Mon, 15 Dec 2025 17:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dda5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: c700f3b25298 - stable/14 - riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c700f3b2529833cc0de9d2ca461bee0e44afb9cc Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:06 +0000 Message-Id: <69403e96.dda5.a7891b0@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c700f3b2529833cc0de9d2ca461bee0e44afb9cc commit c700f3b2529833cc0de9d2ca461bee0e44afb9cc Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:45 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46279 (cherry picked from commit 8afae0caf4c4816eb56b732fcd1a4b185e86098a) --- sys/riscv/include/ifunc.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/riscv/include/ifunc.h b/sys/riscv/include/ifunc.h new file mode 100644 index 000000000000..0f9747a2aa14 --- /dev/null +++ b/sys/riscv/include/ifunc.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015-2018 The FreeBSD Foundation + * Copyright (c) 2024 Jessica Clarke + * + * Part of this software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __RISCV_IFUNC_H +#define __RISCV_IFUNC_H + +#define DEFINE_IFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(void))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + static ret_type (*name##_resolver(void))args + +#define DEFINE_UIFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(unsigned long, unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long, \ + unsigned long, unsigned long))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + static ret_type (*name##_resolver(unsigned long elf_hwcap __unused, \ + unsigned long _arg2 __unused, unsigned long _arg3 __unused, \ + unsigned long _arg4 __unused, unsigned long _arg5 __unused, \ + unsigned long _arg6 __unused, unsigned long _arg7 __unused, \ + unsigned long _arg8 __unused))args + +#endif From nobody Mon Dec 15 17:00:08 2025 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 4dVRBd0G7hz6L1jZ for ; Mon, 15 Dec 2025 17:00:09 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBc2hJwz3p3Y for ; Mon, 15 Dec 2025 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818008; 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=bU941XiXlZtzcyQc2VVNcexlvgSN0bzOzurgOfPCbZc=; b=WC/D7yl9UOofZTm5W2XW0T6/8oWfhhAts8a5BTKaJ9l7exIrCHjNosK+cBP9DFVmFPT+zx PPV6j783m5aun2EaqAwZ1uE4y8j/gyTZ98kOxqZv4bobXxZTfspXF2po3T1zv0+UCHP1Rq rOgRVyccw5qRGC38V53CprUstxaBrv2OP2zgvwguEL6F36vnlBm5I3hqwUuCmn4wukXkqm SgqkhHD7Okee3k5BHxtly1PccFJ0InlT0/OSzyarpbYeLkXZxQ0Wuw26zWZwPS4Yx0HYbA iz7F+7b4IZZ0vJNTGnQAaf5nDBVmF1SInhjBpHrUjP7ZKNyjZhZ5LTGMWvzILw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818008; 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=bU941XiXlZtzcyQc2VVNcexlvgSN0bzOzurgOfPCbZc=; b=g5cc29L969IPzrnd3DQZU8CAHXV3juqIVxMuLfRI7KGWjGEUehU9kyETbZE/yB+FM6i4/k Nv3POlOOfkbN8UjViJcccjLuWF/CgWh7Q+jQEF3TFL4h/twUX8j4luBpTV7YHjXGT3pVJQ n8jkPxT2j9ofEu8LU6B8XE1qBCUuAWdmeQ1iNLQQqvZsRnO3x9b+s4AQVzWhuAEHBtrW5m cZ7UJL5ovN7R74uQ1BUqmW8MPKNdISnkMIcHineTc00dyeDKD+OTJVtcf/xe4JBSarA0CC K13VMJN5U4IXHmUhXe85UW2BMcDkXSlwWit1doZQQJK15L4v0fKgIvN1k+bBmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818008; a=rsa-sha256; cv=none; b=LU19SvJzbrbCJYshh5cy14Aw7jtZYnkcfPLdfa2syQnpG9zcxY5Huyz0SY6EOII44/iunX kNTxAx9S9DVpVG/HFlMQzrKyeZSniBmx/loElW8W+HKE7Y+OpBYNGFbIKodgbtjzTpZa5W 4ud/rVq1kg951cPMXgWPh31ylOK/Qw6EiDR3ymSxhoGg+NSuo7ANfEx/JdR+Lk5VWnQG5m +nFNt9e708MPjxSBPe0e8m852iVj0Uetvz2/RSjs8udBvEk0ix8VLYnQBC9IUWXNsqoxSj jKGjTfIhnJ3ocv2aDtB1DA+l2E4lIThMkFRzA3F3iRbX0J1JnErO1Ejf3f9QLA== 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 4dVRBc27dfzCtR for ; Mon, 15 Dec 2025 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d5e4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 0e3963317e14 - stable/14 - kldxref: Don't warn and skip file if no relocations are found 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e3963317e14ec86d0a597c91af36f043d583363 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:08 +0000 Message-Id: <69403e98.d5e4.17f07100@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=0e3963317e14ec86d0a597c91af36f043d583363 commit 0e3963317e14ec86d0a597c91af36f043d583363 Author: Jessica Clarke AuthorDate: 2024-09-10 17:56:22 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 kldxref: Don't warn and skip file if no relocations are found This case is hit for the kernel itself on riscv64, and did not used to be checked. Since the code here can already handle missing Elf_Rel and/or Elf_Rela just delete the check. Reviewed by: jhb, imp Fixes: 0299afdff145 ("kldxref: Make use of libelf to be a portable cross tool") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46517 (cherry picked from commit 05996f453de2f2c7a03437a492d9d53831fccb2e) --- usr.sbin/kldxref/ef.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index 77ddada946f2..975626e46046 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -364,11 +364,6 @@ ef_parse_dynamic(elf_file_t ef, const GElf_Phdr *phdyn) error = EFTYPE; goto out; } - if (rel_off == 0 && rela_off == 0) { - warnx("%s: no ELF relocation table found\n", ef->ef_name); - error = EFTYPE; - goto out; - } nsym = 0; for (i = 0; i < nshdr; i++) { From nobody Mon Dec 15 17:00:07 2025 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 4dVRBc1L2gz6L1Mp for ; Mon, 15 Dec 2025 17:00:08 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBb2L8xz3pDv for ; Mon, 15 Dec 2025 17:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818007; 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=zBDjoCw8D7d0cKqByc+aRge1UfokmzhVXRPVft3pABk=; b=tJBcddtvz5TYqkkU0LYlyizWTpc/x3uwqbM/6OgCYPoyO0TaQK1upD6gsbnU/dlm3r9X2H 3qdWla7+Xz3WxlKRqpLIYSAqDQ7iUyHj6uB+Jw+rZ8+8fw1WsPeJoMa4k1p4cq1gFxZYky wntjGgcSsjUsnSQ3uaAMUa4qZECjxwYJHzbXhCI5oTIHGtmhfJ+RZxflgPaA8obPs6wPkL 5Tjr72C2hF63czqfN55G950rA6h9YNGQDHJnvKR2mVYIKDbABUKYVTy4nfj3/t+EIb0Cz3 5V7fSQ+UPO+C3YmdiNWjVyz/Koy36KtVuFVi77xzOQzLwBE76CBw05GHAvMmfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818007; 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=zBDjoCw8D7d0cKqByc+aRge1UfokmzhVXRPVft3pABk=; b=GRzfDcq0XfbJUf2y5lNySpBwKECjBBVey3v7R8bCX8zlcosMlmvJV6UsxB0aJMHIw63Tqc w1lXaqhIt/O4ekEU2q/gftjinXr5ViY9oeF8dSJnvYHZiArN0y/X1FApJvJF05rK+nI1sn rQzWcA84OiLiKfz6zvzhy6j2Ct9FT0IRTncTfAc+LPSD5YcPeQ1OYMqBdGdS8aa67Hpz7d XRfZmQBBj5Mwjkzf0r05cpEHDD0E0IPMvhOZLsd8ZGVadrSIdLc9cxxiJ4gaNZvawNgIEN gRSTdzn3FtCDyfDwSVqnCP8MpFjLBI0SJM87m0vicp//0xsadOFA/SieVlphfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818007; a=rsa-sha256; cv=none; b=Y+x4aeVa01nU9fWLxr15aCJxjgD9unco/8X2D9/Z9NeIG5IyybDPzJXzuw3QydfkyjGGcn xCc1npDBy77OGa9/AgW3oDdlrq1yvuPB0fAAjcWZZsY9fmRDD20pZuYtt29FK6UyScebuw CDW+BwFdb1SiDHGnyvmV0BrO6dgqNWy6AGvMuJg+LWf8t26B7y1zp5fbIQP4A68eVypTJe +2aurYXQyGyau/oDOcZgDmEBd8NdNXr/TDmwWrOymMDFHjSg2GeqY1Gd68m1lnk15thTWw ACimk0+FaCRlIhPfFLU+wG3U3IeQIQsAVNRJc5408r6089ngRhwRMpp65nC/UA== 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 4dVRBb1msHzCtQ for ; Mon, 15 Dec 2025 17:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d3cc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a39564b58f92 - stable/14 - gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a39564b58f9253791446aa2709ae48b9bfdb7152 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:07 +0000 Message-Id: <69403e97.d3cc.bd72772@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a39564b58f9253791446aa2709ae48b9bfdb7152 commit a39564b58f9253791446aa2709ae48b9bfdb7152 Author: Jessica Clarke AuthorDate: 2024-09-02 22:21:18 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID This is a platform-independent UUID, and this is the name U-Boot uses. MFC after: 1 week (cherry picked from commit b162fc3f3094c50c8ed47ab50981c5448cf0052c) --- lib/geom/part/gpart.8 | 5 +++++ sys/geom/part/g_part.c | 1 + sys/geom/part/g_part.h | 1 + sys/geom/part/g_part_gpt.c | 2 ++ sys/sys/disk/gpt.h | 3 +++ 5 files changed, 12 insertions(+) diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8 index c424ba1157d9..176499c0d1e3 100644 --- a/lib/geom/part/gpart.8 +++ b/lib/geom/part/gpart.8 @@ -1008,6 +1008,11 @@ A illumos/Solaris partition dedicated to reserved space. The scheme-specific type is .Qq Li "!6a945a3b-1dd2-11b2-99a6-080020736631" for GPT. +.It Cm u-boot-env +A raw partition dedicated to U-Boot for storing its environment. +The scheme-specific type is +.Qq Li "!3de21764-95bd-54bd-a5c3-4abe786f38a8" +for GPT. .It Cm vmware-vmfs A partition that contains a VMware File System (VMFS). The scheme-specific types are diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 13752bbe8afe..10305ee940fe 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -131,6 +131,7 @@ struct g_part_alias_list { { "solaris-home", G_PART_ALIAS_SOLARIS_HOME }, { "solaris-altsec", G_PART_ALIAS_SOLARIS_ALTSEC }, { "solaris-reserved", G_PART_ALIAS_SOLARIS_RESERVED }, + { "u-boot-env", G_PART_ALIAS_U_BOOT_ENV }, { "vmware-reserved", G_PART_ALIAS_VMRESERVED }, { "vmware-vmfs", G_PART_ALIAS_VMFS }, { "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG }, diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h index ffeeca9022fe..13bbb1e4126a 100644 --- a/sys/geom/part/g_part.h +++ b/sys/geom/part/g_part.h @@ -103,6 +103,7 @@ enum g_part_alias { G_PART_ALIAS_SOLARIS_HOME, /* A Solaris /home partition entry. */ G_PART_ALIAS_SOLARIS_ALTSEC, /* A Solaris alternate sector partition entry. */ G_PART_ALIAS_SOLARIS_RESERVED, /* A Solaris reserved partition entry. */ + G_PART_ALIAS_U_BOOT_ENV, /* A U-Boot environment partition entry. */ G_PART_ALIAS_VMFS, /* A VMware VMFS partition entry */ G_PART_ALIAS_VMKDIAG, /* A VMware vmkDiagnostic partition entry */ G_PART_ALIAS_VMRESERVED, /* A VMware reserved partition entry */ diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index c4cc840f583d..d795ccf4332b 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -224,6 +224,7 @@ static struct uuid gpt_uuid_solaris_var = GPT_ENT_TYPE_SOLARIS_VAR; static struct uuid gpt_uuid_solaris_home = GPT_ENT_TYPE_SOLARIS_HOME; static struct uuid gpt_uuid_solaris_altsec = GPT_ENT_TYPE_SOLARIS_ALTSEC; static struct uuid gpt_uuid_solaris_reserved = GPT_ENT_TYPE_SOLARIS_RESERVED; +static struct uuid gpt_uuid_u_boot_env = GPT_ENT_TYPE_U_BOOT_ENV; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; static struct uuid gpt_uuid_vmfs = GPT_ENT_TYPE_VMFS; static struct uuid gpt_uuid_vmkdiag = GPT_ENT_TYPE_VMKDIAG; @@ -296,6 +297,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_solaris_home, G_PART_ALIAS_SOLARIS_HOME, 0 }, { &gpt_uuid_solaris_altsec, G_PART_ALIAS_SOLARIS_ALTSEC, 0 }, { &gpt_uuid_solaris_reserved, G_PART_ALIAS_SOLARIS_RESERVED, 0 }, + { &gpt_uuid_u_boot_env, G_PART_ALIAS_U_BOOT_ENV, 0 }, { &gpt_uuid_vmfs, G_PART_ALIAS_VMFS, 0 }, { &gpt_uuid_vmkdiag, G_PART_ALIAS_VMKDIAG, 0 }, { &gpt_uuid_vmreserved, G_PART_ALIAS_VMRESERVED, 0 }, diff --git a/sys/sys/disk/gpt.h b/sys/sys/disk/gpt.h index 596a5cba1681..426ae835c0c1 100644 --- a/sys/sys/disk/gpt.h +++ b/sys/sys/disk/gpt.h @@ -259,6 +259,9 @@ CTASSERT(sizeof(struct gpt_ent) == 128); #define GPT_ENT_TYPE_HIFIVE_BBL \ {0x2e54b353,0x1271,0x4842,0x80,0x6f,{0xe4,0x36,0xd6,0xaf,0x69,0x85}} +#define GPT_ENT_TYPE_U_BOOT_ENV \ + {0x3de21764,0x95bd,0x54bd,0xa5,0xc3,{0x4a,0xbe,0x78,0x6f,0x38,0xa8}} + /* * Boot partition used by GRUB 2. */ From nobody Mon Dec 15 17:00:09 2025 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 4dVRBd6LGsz6L1gB for ; Mon, 15 Dec 2025 17:00:09 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBd34YTz3pFJ for ; Mon, 15 Dec 2025 17:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818009; 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=jyJMB8pV3daSwmr3eTaLRvHlxAg2NEuKGdSDZTQh9AI=; b=UZ2BBrZx6FyaCBztaeKFY9yT3ir7XEWD3kQHYlRZUgXJxAv+d4Yecg1LMHPfQVWHsaXEad vTedqz22Nh2Bkt0bDJxbVP/5MlXdRZcUYxD/urt/RZHZv3SiBikPEZu4eTzsRncvLdYI38 +3LV1FG2nOb/JhK+qpYlRz69WJg5o+bDieheQr1zFHMOM9W88fMWWCvvZv0GhRYu0qsRRc l9Vg+R2L1nzBN7OvIfxDYxth0Sp9dt1YMGhBjr1hyi1ewFG7PxbG45IB5tD+pW1WM8UT8v VfpqXpUwbpG53rHvbA0BsyxOdROCcg7dBofoqdsDt1ZojGY7AyTCzNLFoOykeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818009; 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=jyJMB8pV3daSwmr3eTaLRvHlxAg2NEuKGdSDZTQh9AI=; b=fBJmeF/69djMyb2QPHK+ammMiFezHkzZUDjCuFq1wSqx46bYLE78wBTr0c5DyqeJtzFrt9 8RzNG4JtVMs8Wb8EgTwvOg/8TgJNy+MD0+KWBEb9Z155tp3f3oX8EcByEB7lblXN+wb7hO yDpUPUjsvK8k3zY5Me2fNb7NnlMPWBF0KrNym0UiSjSm4P27x7ZCYae7yTRC6k+68lsjBp 2TT34B/upyrumlNBBBZwTAnaJlVqXNBgwoB4LDWjmvcfTvrsKgYN302sK3bYwtTRrKreMM 6VitXf+2jPf2AGIGyZak6tHpV3go3csg5/y0Z14aSfveGTc27AWkuqxjIFlZuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818009; a=rsa-sha256; cv=none; b=n8DljmHFAH1u+zbTQQM6gABFzykT962OYnTouQ75x70k1GZzWOjKnbyRNFP4ybxs9F8m06 Ohhbu2jaOby2D8AQD7HmPH9d+R6dbwQ0UBQ+SR0pNj1NurNCm2FNEyPjRehaLJ5fXiq7+O o39hJt1R68YoxK0NXq2kir1ihHih+EOEcXS9NI3nn9NftUTQBlvUmgoz8nVkkpC5SCTDjC 36j6W1/QD3F3pMv5jfqg15aN+NaHjn+KJHWhEgO0ZzhB+yCAUiv98CM/f8RdhVazToY5s0 yAOsZJ/mGenrR17iPJRthoNAG5dPsdXepwiFR5g49EmWJ/r8XGlfNeKT/HwE0g== 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 4dVRBd2WpKzCWB for ; Mon, 15 Dec 2025 17:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b0fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: f6578a0ec7cb - stable/14 - Merge commit 88433e640ddb from upstream OpenZFS (by Jessica Clarke) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f6578a0ec7cb954059da580c22dee5bc331ee68a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:09 +0000 Message-Id: <69403e99.b0fc.70cb0d03@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f6578a0ec7cb954059da580c22dee5bc331ee68a commit f6578a0ec7cb954059da580c22dee5bc331ee68a Author: Jessica Clarke AuthorDate: 2024-09-11 17:01:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 Merge commit 88433e640ddb from upstream OpenZFS (by Jessica Clarke) sys/types32.h: Remove struct timeval32 from libspl's header (#16491) macOS Sequoia's sys/sockio.h, as included by various bootstrap tools whilst building FreeBSD, has started to include net/if.h, which then includes sys/_types/_timeval32.h and provide a conflicting definition for struct timeval32. Since this type is entirely unused within OpenZFS, simply delete the type rather than adding in some kind of OS detection. This fixes building FreeBSD on macOS Sequoia (Beta). Signed-off-by: Jessica Clarke Reviewed-by: Rob Norris Reviewed-by: Alexander Motin Reviewed-by: Tony Hutter MFC after: 1 week (cherry picked from commit 796c6031cde6dfdd92b4d178792fc0534bf788c5) --- sys/contrib/openzfs/lib/libspl/include/sys/types32.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/types32.h b/sys/contrib/openzfs/lib/libspl/include/sys/types32.h index eadc67c7122a..d065ebed03b7 100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/types32.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/types32.h @@ -65,11 +65,6 @@ typedef int32_t ssize32_t; typedef int32_t time32_t; typedef int32_t clock32_t; -struct timeval32 { - time32_t tv_sec; /* seconds */ - int32_t tv_usec; /* and microseconds */ -}; - typedef struct timespec32 { time32_t tv_sec; /* seconds */ int32_t tv_nsec; /* and nanoseconds */ From nobody Mon Dec 15 17:00:10 2025 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 4dVRBf6j07z6L1YD for ; Mon, 15 Dec 2025 17:00:10 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBf3ZC5z3pKl for ; Mon, 15 Dec 2025 17:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818010; 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=ufLAy/3ywCpullkImg0B1IO0NOhBgprDSsTtVBdiQJs=; b=j8vPkmNk6bgS4XseCrLJrb6R0wKkzD0Oujn3ieIcWhKXAgEJXhf0c8NsBTi7z+qHs2EKi7 A0ZTiCPHunOH+EfJLY6tbnUSK32TikJXSCPw8tbQ+S43SdgLscTUvYpSg87DqFlCuTs1iQ WPtgNdAbsPxI8fEJhWRhJ/tK1TOd/HWIdOlTU7LZCy6xk5PiEXK5Eo7KpaqwKnIu5p35sT i7xazPuC6VrAXu3s/M/rJXEFCewBx1eDW63LQmq3tBrH0VdvewNVViF+8q8bkOmFDHqtv/ yXCdE3ZgqjhxvBfFW45ak0+Dq0DRVMt3q9RHZcSqD//iG2OGci4ksI5S42xBPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818010; 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=ufLAy/3ywCpullkImg0B1IO0NOhBgprDSsTtVBdiQJs=; b=wc2pVT03yYfqkboVuK4J9H2A0HZtSpkeESqzBz8FZ/5zQ777CGE9T7zwAOnFC1CDA9UbOC i2GyjhxHjIzrRq7xq8J1RqxW3pyF0D1g/IkOMrUXRkArdTKvxwDUGeEN8CRg7nkhsmsOG5 duVfRd6qcwKKf7oRkYD+OIiGe5EoyNz5IpHuH0sPIXsqBzmX4JBjFIXvt64buM39+CpSYI A0itL7O1axXA2E6HSxZedWResQc0X3N3H9I+lFjoi8dReuaP0biGofe/LIcPWNYSgs4g5F BawPu6qActYzlSNZENYWsPxpyJmVJVYKuCzTLOh2L+7WruUoztJi1dBAXN7aTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818010; a=rsa-sha256; cv=none; b=Kw/LFOdm7cVKshUi1aauLZ/Mp+nXBVgTEfAomA2Tu0sWu+3xhKlfBWWY28N0sTzk7JpZgp JFfIkrQTCW1KbDeuZS+j2Xo725fCo1ThRkLGNekaGnYP0L+x/Z9zZ+ZesyukJp27YhcrIs eLMXF9vnPIF8yVO+oBwH/n7K0AnQ9tl6NHlsxRNCWVtU071QJ4N4KEu+um5jV11Re7i/Co R36CDj8Me6B1B8WalEKAn//B4SFmN6gc3YYJcHiBqKubYkIsiP6F4uGSj0Nq/RoKT7NUse pf9UEOSxNqrigaM1jHClJJYfDf5HBN2N3aJcLDjyybO0Uz6l+JM/HswFCoQShw== 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 4dVRBf2v2fzCkh for ; Mon, 15 Dec 2025 17:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c6f4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 6559b303a34b - stable/14 - lib/clang: Commit cleaned-up workaround for building on RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6559b303a34b60b2cc2836bc376bec27f3df5b8a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:10 +0000 Message-Id: <69403e9a.c6f4.14cd4b50@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6559b303a34b60b2cc2836bc376bec27f3df5b8a commit 6559b303a34b60b2cc2836bc376bec27f3df5b8a Author: Jessica Clarke AuthorDate: 2024-10-18 12:59:48 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:43 +0000 lib/clang: Commit cleaned-up workaround for building on RISC-V There is a long-standing issue on RISC-V around --gc-sections when statically linking, which affects the bootstrap build of LLVM. Since fixing this properly has remained a TODO for years, commit the workaround with documentation so that building natively from source works out of the box. PR: 258358 MFC after: 1 week (cherry picked from commit 7aa6667623bef7306009d50a571e5e8c7766a174) --- lib/clang/llvm.build.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk index 7b16f4485340..2520637e2d06 100644 --- a/lib/clang/llvm.build.mk +++ b/lib/clang/llvm.build.mk @@ -109,6 +109,14 @@ CFLAGS+= -fdata-sections LDFLAGS+= -Wl,-dead_strip .else LDFLAGS+= -Wl,--gc-sections +# XXX: --gc-sections strips the ELF brand note and on RISC-V the OS/ABI ends up +# as NONE, so for statically-linked binaries, i.e. lacking an interpreter, +# get_brandinfo finds nothing and (f)execve fails with ENOEXEC. Work around +# this by manually setting the OS/ABI field via the emulation. +.if ${MACHINE_ARCH:Mriscv64*} != "" && ${NO_SHARED:Uno:tl} != "no" && \ + (${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)) +LDFLAGS+= -Wl,-m,elf64lriscv_fbsd +.endif .endif CXXSTD?= c++17 From nobody Mon Dec 15 17:00:11 2025 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 4dVRBh0yFWz6L1gJ for ; Mon, 15 Dec 2025 17:00:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBg3ftnz3p6H for ; Mon, 15 Dec 2025 17:00:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818011; 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=tqa/qfdrWuup8Cd/2d4x996kaWz6nioAg9LuVZf0iZs=; b=ipelZPuYBLhObu8A5egXhdC9g14Nzf3R6rBMr2j3JpCKiWHy0ZLJb6ThNkA13kstIuyA2u phVFk0UE5SZ8LnKRPf4suMFT5X95lLRCnMs20C32LdEcBycRO7JQIfxagssLV3cGcntmfN JJw/xIxdUvpJnPClCA+T/lqdwJD6B5HUHA4RWq2f8+LjNla3VcZfI9kUAx0kcskRHyARq2 MXnh8O+tiBF2Tx9VHCuhRyXrl8X8CNG8oyFinV4V8nwqf6kVDvWUMB0O9PkjCHuo0T2Nj0 sHhT62PGMMEa6UO/yFhkjiipGkzFN0hvtWcfWYNtJ9zXBb9VBrnbmTq0MHmmLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818011; 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=tqa/qfdrWuup8Cd/2d4x996kaWz6nioAg9LuVZf0iZs=; b=mMnPWrnhm7j2ZUUnKlGWtVb8Wb+AJSGkG2dSIBrqAGAvRZ6gW8/poEEElIwbLi/52qCZsS aXaBaQCiL69pvYWPiaAdN8Y4wx6CgVYbaebTkZ/trXfnerG+esp6arBp8gzKvA2QlsFMmu fN31gGG7HVcEkl4Pcu+RZwygFpUSVITskZaI/KkoGJP3h4PwFAmBo4Nky5lXI+U7ElyIvk PD3dw+zMNMlprA4p8WHdJ2EWbTId30wUFuPojfkM1jDu/TpHFXsZVy+dUXyFvpsq7miUcv qrZfR2CrFcNK6B8gP2LbyxaZFnSVICjdV6OfEOiboJgPX6x9VnHf4DCJBgRZag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818011; a=rsa-sha256; cv=none; b=F9h2s+7VEX1s40jZud0wfFnz6FhTY44yz1Qeimg8ByS2kWdQof09HKwmGwAYYNVM5UAoD7 FVRPFZCZ1fiaTk42q5EtC+OxuJG48UqiESraWMwXVBE03sSuphfLwUqcEmg+VfrifJqtnR 6LDFqyh+hkFL+hnP4mOCfyt9o8KvbLX5X4UPsgNL1LUqSN4BiQVsLVnxAZTLV0vhG/0qb/ 5dxKc+vuScTTJG1b81r2jm5mpIvqxUR0VjEF4waXWopXhLPAdDx+G2Rqk7PV46tquqXr4P PnRvxKnMLBV/G+pzw02DRKnbldoZRVI/0TB+wiBx7SVd8KnLOmOI/FUPSrpsVA== 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 4dVRBg3D1XzCYX for ; Mon, 15 Dec 2025 17:00:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e18b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a06143795a22 - stable/14 - libc/csu: Support IFUNCs on riscv 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a06143795a22d8d99f1736656eaff754e81d8ab1 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:11 +0000 Message-Id: <69403e9b.e18b.24cc0f39@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a06143795a22d8d99f1736656eaff754e81d8ab1 commit a06143795a22d8d99f1736656eaff754e81d8ab1 Author: Jessica Clarke AuthorDate: 2024-10-18 18:14:58 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 libc/csu: Support IFUNCs on riscv When adding support to rtld-elf I neglected the fact that static binaries can have IFUNCs. Add support for this too. Fixes: 729d2b16b74f ("rtld-elf: Support IFUNCs on riscv") MFC after: 1 week (cherry picked from commit 1363acbf25de4c36e183cfa0b0e801d4dd9bf2ad) --- lib/libc/csu/riscv/Makefile.inc | 4 +-- lib/libc/csu/riscv/reloc.c | 63 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/lib/libc/csu/riscv/Makefile.inc b/lib/libc/csu/riscv/Makefile.inc index 2534e6579f38..5d59d40eb393 100644 --- a/lib/libc/csu/riscv/Makefile.inc +++ b/lib/libc/csu/riscv/Makefile.inc @@ -1,4 +1,4 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_RELA \ + -DINIT_IRELOCS="init_cpu_features(env)" diff --git a/lib/libc/csu/riscv/reloc.c b/lib/libc/csu/riscv/reloc.c new file mode 100644 index 000000000000..036ea3de8701 --- /dev/null +++ b/lib/libc/csu/riscv/reloc.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2019 Leandro Lupori + * Copyright (c) 2024 Jessica Clarke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +static unsigned long elf_hwcap; + +static void +init_cpu_features(char **env) +{ + const Elf_Auxinfo *aux; + + /* Find the auxiliary vector on the stack. */ + while (*env++ != 0) /* Skip over environment, and NULL terminator */ + ; + aux = (const Elf_Auxinfo *)env; + + /* Digest the auxiliary vector. */ + for (; aux->a_type != AT_NULL; aux++) { + switch (aux->a_type) { + case AT_HWCAP: + elf_hwcap = (uint32_t)aux->a_un.a_val; + break; + } + } +} + +static void +crt1_handle_rela(const Elf_Rela *r) +{ + typedef Elf_Addr (*ifunc_resolver_t)( + unsigned long, unsigned long, unsigned long, unsigned long, + unsigned long, unsigned long, unsigned long, unsigned long); + Elf_Addr *ptr, *where, target; + + switch (ELF_R_TYPE(r->r_info)) { + case R_RISCV_IRELATIVE: + ptr = (Elf_Addr *)r->r_addend; + where = (Elf_Addr *)r->r_offset; + target = ((ifunc_resolver_t)ptr)(elf_hwcap, + 0, 0, 0, 0, 0, 0, 0); + *where = target; + break; + } +} From nobody Mon Dec 15 17:00:13 2025 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 4dVRBk1JvFz6L1gK for ; Mon, 15 Dec 2025 17:00:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBj4RS9z3pCM for ; Mon, 15 Dec 2025 17:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818013; 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=lq9THnomMzXpM6FR8HkG7FlWukY+LK3U5j8AsRvVkcs=; b=rchDrwfcKGDXBnOFXMmnxlKNdulX/NdDbkg/mr+CHSm6OthdOYB2EiFh0/irR4P9Z4HrPQ 27D1+6cQhhD72yVE4wXysuQEVLn806sTUuYXoW0FN5x2NyuEuDX5V2yTIttDkCzMshLUbW Ymz/1ccs5xdz4WOKUIhpSq+iExpN2GJZvFLQXrUz36j7pU3EhsGTbGN9sONa4riJ1gN4IH cS4JUx5rHmWIb1N938yFT91Htj6XN8dbxZ+CYW3R5Indu/rTxCwM9BslGH2UFEYA+GWopE gJYO9fsdidSyfKZ/Wd9wq3W+hqbaUt1tQJ5VneGdCtNo06UwxQ1qdvd5Mg/mZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818013; 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=lq9THnomMzXpM6FR8HkG7FlWukY+LK3U5j8AsRvVkcs=; b=QQjXUzAjZMiFsoFlQGci3CUdwCSVY451WMnMTlcEUkGQtKrXWFLSh4xgJVzDz1+0krt7Wr qOCwwkD3RD5RRCWsXtpAtXNU07YEMIZhBwrinquAveL7370bjCT3iLyRBouI7dBtmD51I0 OsJVXecKr1b9FOLIon3ScQK97DfVZAg5a4LmqblPrCgv1YjyJQS9TCrQU3fRBCVY0qh6EA mpDkjyv1caLYwvlsafBFx6gIcf3xfAmz3R4DTe8PzBMBTGVU4mKFvNoF4Pzmir9wwyBSTT XGYn5Vc5yHWsIh0M+LV8R2p7dRnToJGk+EjclCMxNFvHbrOlRyGrGOadPnSCeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818013; a=rsa-sha256; cv=none; b=CIQQbvD9ufdef0dn87LZGSr9H7yE9TLS8Q0oa34aPWlmyks3h7YN1hfO2+ht8shNljWJfJ +zR29E70OueSpCrJ+DCU+E6DJ35NmcZMDTUFbWhVHOoREE7Ux6nHIvcD90VgMJgnGSCtnz gk1lgsAW4uqwNckHAbimWJ4SRP4dfcpnYvDT40Hh6gpSSvU528Fkl0FPEKvEekfqg9Ztue C9mz1CQBP2WZCnUBkhcQ/9p1/YmVrxxtCz82rbWu7o01rUwRSOSF5TilJwZ0lgdbUSY1wy qJvonefCyr4m5Z17C1H5HJem2CZ0T+J0749/wMrEQ2CLYT9kmYN8tVObnA+4ZQ== 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 4dVRBj40s9zCtX for ; Mon, 15 Dec 2025 17:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e01e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 9848c2085511 - stable/14 - tools/build/cross-build: Don't include sys/uio.h from linux limits.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9848c2085511796ebf306e2b504c12e7e6c8cccb Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:13 +0000 Message-Id: <69403e9d.e01e.16ae8ca9@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9848c2085511796ebf306e2b504c12e7e6c8cccb commit 9848c2085511796ebf306e2b504c12e7e6c8cccb Author: Jessica Clarke AuthorDate: 2024-10-18 20:39:37 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 tools/build/cross-build: Don't include sys/uio.h from linux limits.h This creates a circular dependency for OpenZFS's libspl in sys/uio.h, and it shouldn't be needed since the system limits.h already defines IOV_MAX, so delete it, and unconditionally assert that to be the case. Otherwise the re-include of libspl's sys/uio.h tries to use PAGESIZE before it has been defined by OpenZFS's own sys/param.h. Fixes: 7a7741af18d6 ("zfs: merge openzfs/zfs@b10992582") MFC after: 1 week (cherry picked from commit 0bdf2535d4f8a571cb6d230f2f19eb20a452a4f8) --- tools/build/cross-build/include/linux/limits.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/build/cross-build/include/linux/limits.h b/tools/build/cross-build/include/linux/limits.h index 5eca34b1120c..4631cabb1104 100644 --- a/tools/build/cross-build/include/linux/limits.h +++ b/tools/build/cross-build/include/linux/limits.h @@ -45,13 +45,11 @@ #if !defined(_GNU_SOURCE) #warning "Attempting to use limits.h with -std=c89/without _GNU_SOURCE, many macros will be missing" #endif +#endif /* C89 */ -#else /* Not C89 */ -/* Not C89 -> check that all macros that we expect are defined */ #ifndef IOV_MAX #error IOV_MAX should be defined #endif -#endif /* C89 */ #ifndef MAXBSIZE #define MAXBSIZE 65536 /* must be power of 2 */ @@ -83,7 +81,6 @@ #endif #include -#include /* For IOV_MAX */ /* Sanity checks for glibc */ #ifndef _GNU_SOURCE From nobody Mon Dec 15 17:00:12 2025 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 4dVRBh6ZDQz6L1YH for ; Mon, 15 Dec 2025 17:00:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBh53hqz3pVV for ; Mon, 15 Dec 2025 17:00:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818012; 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=QD5NK8yM2OwsL5EAPQgZsiyDSn8ya+LLHVCHYkL1bp8=; b=TjDc9oJwONIjDViaE7R70x20y494wmVOpmC74b4RxA+DS3PbxeKw7QHfUw4zzSFEyRxJTl tyGgnknM0Cfc57NSOw238DAz2hb2+irLXe1DJjY0RYUvKyfOTbE75I2pjaHtBwMHsCm2y9 3waBpoDmEyHF/NSCJS3wpZmBEgcA57jHgiKZpbexRML4dZciDmJdS/WpmRVfeMrhAKtIAu VRSERy1Hzjr2q4epFg3OeuSUbG92oAp9HgO90m/MSOYF/NvjrD+URKkgWgQ0ldlzNC/D+T 2WNn6w2EsNnpNtpKxQjXZwl4rqr23YbyjIpd/ctlxgk3iidlarLoCjTQr8jimw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818012; 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=QD5NK8yM2OwsL5EAPQgZsiyDSn8ya+LLHVCHYkL1bp8=; b=vpQ4pWhFL8y1k6pqIrMMpy+MKMasXbGnQC6CYg07oxBngQ3sqw0+zHwTy/RyiY+xT/bh4G 6zNlrB/Bs37dMFIRWutaO6x/9CWy+6+l9kyyJFR7ZcGQFFlfEKDv+EfQ6uY0ZHj/2BJSnm scPVOiXHiu71DxOzGRgcUpj4GaLLF9hExJluTpHD9nWH1xJfrOtP+HtDFgau5jBhq/36OB x2t72uGDc6lV8ky6uaJZ0PQiKlqaMyvA3BnvLmB5QOSPXCeHyUVpTdAvKYoHFNqx3OoK1X OCpLUuvNMQk1ocNjtBRhLDzwoiEJ6Rb6+zkXjtEuniOnehCpoF+tplqKXu50/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818012; a=rsa-sha256; cv=none; b=GsTql73hGVyzWkwmduhrCfVfJq+vJI3bjToM3sI+j6fTl5JrcYulOF8TjFdi0SsYtdnY72 w6i6GY2Y0ZcbcYo4yAJQSjHK1RhKdHHXRkxTwsUzuB0QgoMcai95yhvbvUBiMEnUNRfRKx QvseXmDmPu7dckYcdIalleH5HYlqmhhOp0UdSUZDCATknHsyiunvpP97SN5o65mnunZ5qV 1RuTU+/uwlD9Oo4XJCQSuoU/kyiufDufMg2lAIstNP9fAW2/oIsyE47umcPbTvAfn9Szne NjL2c4dXs6RjKFn2EYkz5G6JoePy7ZAg0qQXzddyATkS2vBcyXIi2LGYD0ysJA== 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 4dVRBh3cgLzCtW for ; Mon, 15 Dec 2025 17:00:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e09e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 40200fae9124 - stable/14 - depend-cleanup.sh: Clean up after riscv static binary IFUNC addition 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40200fae91243c772d444c8338ef870d3e7c46ab Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:12 +0000 Message-Id: <69403e9c.e09e.305a01e3@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=40200fae91243c772d444c8338ef870d3e7c46ab commit 40200fae91243c772d444c8338ef870d3e7c46ab Author: Jessica Clarke AuthorDate: 2024-10-18 18:15:30 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 depend-cleanup.sh: Clean up after riscv static binary IFUNC addition reloc.c is conditionally included by libc_start1.c so existing builds don't feature it in the .depend file and won't know they need to rebuild libc_start1.c. MFC after: 1 week (cherry picked from commit d41a40f484826e90ed78dce5f006712b0eeaf501) --- tools/build/depend-cleanup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 00627d551bbe..acbdfb3e92eb 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -168,6 +168,22 @@ if [ -f "$OBJTOP"/rescue/rescue/rescue.mk ] && \ run rm -f "$OBJTOP"/rescue/rescue/rescue.mk fi +# 20241018 1363acbf25de libc/csu: Support IFUNCs on riscv +if [ ${MACHINE} = riscv ]; then + for f in "$OBJTOP"/lib/libc/.depend.libc_start1.*o; do + if [ ! -f "$f" ]; then + continue + fi + if ! grep -q 'lib/libc/csu/riscv/reloc\.c' "$f"; then + echo "Removing stale dependencies and objects for libc_start1.c" + run rm -f \ + "$OBJTOP"/lib/libc/.depend.libc_start1.* \ + "$OBJTOP"/lib/libc/libc_start1.*o + break + fi + done +fi + # 20241018 5deeebd8c6ca Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 p="$OBJTOP"/lib/clang/libclang/clang/Basic f="$p"/arm_mve_builtin_sema.inc From nobody Mon Dec 15 17:00:14 2025 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 4dVRBk6Dbhz6L1W8 for ; Mon, 15 Dec 2025 17:00:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBk4z4Qz3pYC for ; Mon, 15 Dec 2025 17:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818014; 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=wd42I/G5Y4hAX5vi4uZbEMEhtptnOx/FxhG5piAv/j8=; b=fzjFoXM2W8unh/k+MTMOpoIx7laB2YESgrQVEtUzCARQN45/9nezbgOJKsyu1HbEfH3/mh 3LmnQU4NWHzT2b4wXauS6b/bjHjAckXJrM4qJlqIWHZl4VODQCMFYveL4S9q32kIFJP3YS YvVmrZ0hoThsW4BZCZbucQWe5YNSVKoTLf/ZJ0Lyo4MRys4+n2EsB1KGVHeOHNh9kDWwp/ vvF7Tsg6DuIxBIcDYHdhcE+Q/b69j87f8oi6HnYX9QehzHySisd2X4z4Qg8KiNTRcmty8R YpsNmK2oYwCX/w/sf0rNGapHuy4gOCfhOiOkTKBRUJ4XBH0B4MJywjW7oZ0lCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818014; 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=wd42I/G5Y4hAX5vi4uZbEMEhtptnOx/FxhG5piAv/j8=; b=gAvyBQPUJke+e892mhBnEKTWgFHbva2kW4kaJ/lTkEpzJ3BOhVezA6vSyq64ysuzHZJS0l J0YagYKMgnaxhlUqqWYiOpRaSQyRThhAPZcM8hzronTzLM/ylz2epd1gFtLiTfnoOqBgFx +fDeWWW06Ml3u0afWWKaTMh4Rh7kGtW1bORZhyRglTl4sh7ezMk9+Qp+Hn/0zgRxMSd66j ry0m0kQ5RXi24CZ51+wyzK+gCErw4X/NBOU2rCw+7GFyNHN+BBXWiYw+XacBVSwPKrRcx7 8IP0sAf0gCqS/v9I803t9yQS2YXzWvUGKoKI6eXNbM1h0ujbU2wbudv+OQg8sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818014; a=rsa-sha256; cv=none; b=SuXtx94GLMjVWrYgl2Hk+VFBXjq4IULlwmCcA5v45Oy9JhIf6lXKH2GvE4YJuKPtkydUtm 62SJ1n9qmmq3JUig7miK159F8WrE8QdSkjvCO/BPA79nb6Pegch0noN+fRjTD7XEP8Dm8r S3eYDfICq8/OunPJHGHoJIbvfBYC65bkijnaXNbctiCRDhXxgWHpToKjzY0CsYLRG/IASy EKi84rty9eJaesLRLaQcq8Jy6J9FYqGNglGLZL6Udz9Rj069Ws8PnswNg/UkUTBNv+75I+ nioCmcscGkNlgfgePHCnYnzofD34MO39TwQE0DpaheEF6ZvYV5HWQNjXxsdGhg== 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 4dVRBk4WsbzCns for ; Mon, 15 Dec 2025 17:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d0d1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: e4f4a057772b - stable/14 - libc/csu: Unify INIT_RELOCS across architectures 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e4f4a057772b1d5117bd54e52b8a124f7a2c4ac7 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:14 +0000 Message-Id: <69403e9e.d0d1.5bbfc7ea@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e4f4a057772b1d5117bd54e52b8a124f7a2c4ac7 commit e4f4a057772b1d5117bd54e52b8a124f7a2c4ac7 Author: Jessica Clarke AuthorDate: 2024-10-18 23:48:52 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 libc/csu: Unify INIT_RELOCS across architectures Some architectures don't need any arguments, whilst others need auxargs, which they get by passing in env thanks to INIT_RELOCS referencing the local variable in __libc_start1(_gcrt) by name. This is unnecessarily confusing, fragile (one has to look at INIT_IRELOCS's definition to see that it uses env) and duplicates code between architectures. Instead, implement it more like rtld-elf. Each architecture provides an ifunc_init that takes the auxargs directly, and those that don't need it can just ignore it. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47188 (cherry picked from commit 9684658e35ab033c79e0519e3681d9a194976b71) --- lib/libc/csu/aarch64/Makefile.inc | 3 +-- lib/libc/csu/aarch64/reloc.c | 7 +++++++ lib/libc/csu/amd64/Makefile.inc | 3 +-- lib/libc/csu/amd64/reloc.c | 4 +++- lib/libc/csu/arm/Makefile.inc | 3 +-- lib/libc/csu/i386/Makefile.inc | 3 +-- lib/libc/csu/i386/reloc.c | 4 +++- lib/libc/csu/libc_start1.c | 28 ++++++++++++++++++++-------- lib/libc/csu/powerpc/Makefile.inc | 3 +-- lib/libc/csu/powerpc64/Makefile.inc | 3 +-- lib/libc/csu/powerpc64/reloc.c | 9 +-------- lib/libc/csu/powerpcspe/Makefile.inc | 3 +-- lib/libc/csu/riscv/Makefile.inc | 3 +-- lib/libc/csu/riscv/reloc.c | 9 +-------- 14 files changed, 43 insertions(+), 42 deletions(-) diff --git a/lib/libc/csu/aarch64/Makefile.inc b/lib/libc/csu/aarch64/Makefile.inc index b3420a638164..6c315c5e2624 100644 --- a/lib/libc/csu/aarch64/Makefile.inc +++ b/lib/libc/csu/aarch64/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/aarch64/reloc.c b/lib/libc/csu/aarch64/reloc.c index ead48a8ad4fb..4ba7920bcb07 100644 --- a/lib/libc/csu/aarch64/reloc.c +++ b/lib/libc/csu/aarch64/reloc.c @@ -24,6 +24,13 @@ * SUCH DAMAGE. */ +#include + +static void +ifunc_init(const Elf_Auxinfo *aux __unused) +{ +} + static void crt1_handle_rela(const Elf_Rela *r) { diff --git a/lib/libc/csu/amd64/Makefile.inc b/lib/libc/csu/amd64/Makefile.inc index f14033217580..6c315c5e2624 100644 --- a/lib/libc/csu/amd64/Makefile.inc +++ b/lib/libc/csu/amd64/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="init_cpu_features()" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/amd64/reloc.c b/lib/libc/csu/amd64/reloc.c index 6424d69fbd5c..f1f83db9a391 100644 --- a/lib/libc/csu/amd64/reloc.c +++ b/lib/libc/csu/amd64/reloc.c @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#include + #include #include @@ -30,7 +32,7 @@ static uint32_t cpu_feature, cpu_feature2; static uint32_t cpu_stdext_feature, cpu_stdext_feature2; static void -init_cpu_features(void) +ifunc_init(const Elf_Auxinfo *aux __unused) { u_int p[4]; diff --git a/lib/libc/csu/arm/Makefile.inc b/lib/libc/csu/arm/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/arm/Makefile.inc +++ b/lib/libc/csu/arm/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/i386/Makefile.inc b/lib/libc/csu/i386/Makefile.inc index f3f8c2b176ce..32018000e1f2 100644 --- a/lib/libc/csu/i386/Makefile.inc +++ b/lib/libc/csu/i386/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_REL \ - -DINIT_IRELOCS="init_cpu_features()" +CFLAGS+= -DCRT_IRELOC_REL diff --git a/lib/libc/csu/i386/reloc.c b/lib/libc/csu/i386/reloc.c index 1c9ec173facc..7097f58d8f26 100644 --- a/lib/libc/csu/i386/reloc.c +++ b/lib/libc/csu/i386/reloc.c @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#include + #include #include @@ -30,7 +32,7 @@ static uint32_t cpu_feature, cpu_feature2; static uint32_t cpu_stdext_feature, cpu_stdext_feature2; static void -init_cpu_features(void) +ifunc_init(const Elf_Auxinfo *aux __unused) { u_int cpuid_supported, p[4]; diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index a1887a2c28c0..5b08ba03ba8c 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -138,6 +138,24 @@ handle_argv(int argc, char *argv[], char **env) } } +static void +handle_irelocs(char *env[]) +{ +#ifndef CRT_IRELOC_SUPPRESS + const Elf_Auxinfo *aux; + + /* Find the auxiliary vector on the stack. */ + while (*env++ != 0) /* Skip over environment, and NULL terminator */ + ; + aux = (const Elf_Auxinfo *)env; + + ifunc_init(aux); + process_irelocs(); +#else + (void)env; +#endif +} + void __libc_start1(int argc, char *argv[], char *env[], void (*cleanup)(void), int (*mainX)(int, char *[], char *[])) @@ -147,10 +165,7 @@ __libc_start1(int argc, char *argv[], char *env[], void (*cleanup)(void), if (&_DYNAMIC != NULL) { atexit(cleanup); } else { -#ifndef CRT_IRELOC_SUPPRESS - INIT_IRELOCS; - process_irelocs(); -#endif + handle_irelocs(env); _init_tls(); } @@ -179,10 +194,7 @@ __libc_start1_gcrt(int argc, char *argv[], char *env[], if (&_DYNAMIC != NULL) { atexit(cleanup); } else { -#ifndef CRT_IRELOC_SUPPRESS - INIT_IRELOCS; - process_irelocs(); -#endif + handle_irelocs(env); _init_tls(); } diff --git a/lib/libc/csu/powerpc/Makefile.inc b/lib/libc/csu/powerpc/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/powerpc/Makefile.inc +++ b/lib/libc/csu/powerpc/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/powerpc64/Makefile.inc b/lib/libc/csu/powerpc64/Makefile.inc index 5d59d40eb393..6c315c5e2624 100644 --- a/lib/libc/csu/powerpc64/Makefile.inc +++ b/lib/libc/csu/powerpc64/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="init_cpu_features(env)" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/powerpc64/reloc.c b/lib/libc/csu/powerpc64/reloc.c index 41419bf0e6c2..5637e6534197 100644 --- a/lib/libc/csu/powerpc64/reloc.c +++ b/lib/libc/csu/powerpc64/reloc.c @@ -24,15 +24,8 @@ static uint32_t cpu_features; static uint32_t cpu_features2; static void -init_cpu_features(char **env) +ifunc_init(const Elf_Auxinfo *aux) { - const Elf_Auxinfo *aux; - - /* Find the auxiliary vector on the stack. */ - while (*env++ != 0) /* Skip over environment, and NULL terminator */ - ; - aux = (const Elf_Auxinfo *)env; - /* Digest the auxiliary vector. */ for (; aux->a_type != AT_NULL; aux++) { switch (aux->a_type) { diff --git a/lib/libc/csu/powerpcspe/Makefile.inc b/lib/libc/csu/powerpcspe/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/powerpcspe/Makefile.inc +++ b/lib/libc/csu/powerpcspe/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/riscv/Makefile.inc b/lib/libc/csu/riscv/Makefile.inc index 5d59d40eb393..6c315c5e2624 100644 --- a/lib/libc/csu/riscv/Makefile.inc +++ b/lib/libc/csu/riscv/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="init_cpu_features(env)" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/riscv/reloc.c b/lib/libc/csu/riscv/reloc.c index 036ea3de8701..6ae85085089b 100644 --- a/lib/libc/csu/riscv/reloc.c +++ b/lib/libc/csu/riscv/reloc.c @@ -24,15 +24,8 @@ static unsigned long elf_hwcap; static void -init_cpu_features(char **env) +ifunc_init(const Elf_Auxinfo *aux) { - const Elf_Auxinfo *aux; - - /* Find the auxiliary vector on the stack. */ - while (*env++ != 0) /* Skip over environment, and NULL terminator */ - ; - aux = (const Elf_Auxinfo *)env; - /* Digest the auxiliary vector. */ for (; aux->a_type != AT_NULL; aux++) { switch (aux->a_type) { From nobody Mon Dec 15 17:00:15 2025 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 4dVRBm0hqJz6L1bD for ; Mon, 15 Dec 2025 17:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBl5TDwz3pbl for ; Mon, 15 Dec 2025 17:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818015; 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=NdWzzx1fwvbixteYgLPM67B0z/NhwpuL1aJZ2XLMQbg=; b=DcpRrtLxnXkhOuEpVXJ0oUipu8E6+aBkev4XGabCz+RD2ou+ykI9rvulmOQ3jLQ/n1j1jf 513RaIN3ECE/Ekk3oWQ2oI6ThL+MGDswl3Yjecbp0bzT6t3MJqMlqzt5w0spWeoxwK6dit rTVkc3WuM7bVo/PIdC0wb6BM6TrG3u+QD2YsM1wyRJMzL8Tan3N+iCmhlGd5TNN66yGEZv Q2OKru2d5RhGDec2AGlsRm1q28tp/gB1jt3dDl0pn7Laqe7E713feHIljm3sYSJlg3KVxA aFmNM/1QBQdVOsWUm9poNlpi/0IcysNk5EmRZ7VGtM5UFUkJaxDvXGgx8R6CQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818015; 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=NdWzzx1fwvbixteYgLPM67B0z/NhwpuL1aJZ2XLMQbg=; b=ALAOclYu4QeCOuzU00VWhsBzGwjA81bbVp8Hz12GK9aoNdgG0u0wtHu1I7d+TnyRGpcbrE npV7ZzRT0F+vupAqkFvIJYBCQBnhroB2RPMITiMTOfkyMlY0gqg4OHBUHYHSOcuRQbBQk6 wV44fJ9Yrauky5wGtYl3AwDNpRPDjKso6QHgNXcRmoZLET5FtmzOaHH3Ugd1XdZRTM+aWU +LB9GK/3vtAi1gYyYt6mYFpVYdQwkkFCFGpVOh4F5Hjk/xRd68JAr274t1ntHNqstN/07p qqj0ZaN7soOGH0poEILrHIukLEWlkx5bUBKLlgzKumIoORbtuBJO//SlV0XvVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818015; a=rsa-sha256; cv=none; b=Tc1jw4nV5TemFCUrVEj0AiEhUT3jZfS2qXlOocBaGLq+adaYJYyq+zobV1xTJhAvxjapXU jr80rG3RscZi/+ob4bkewWU5S50L5AeCOCWKEYJcLtfl6k1a3nEM+JFpZo/4uw5d4pVHWM GEXk5izwh948DRMvcqkpCCsfQF/ATbnqDU3YUKC3pRePPeCosKVpI+zWSDBMprPyIsy7Zc 5FSiNGjEOQ3l7T/5K2AVdUMvtSwzeyHHA8ah9eZyO1bxKUD9MtiIscayrq8BoxZ0tKIaBW GJLSSkbtHdbAGzMXUS+Dm5C5QI49VVw3COPd7vq1wM6CocI8t3OuMs02PuMM9w== 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 4dVRBl4xD1zCnt for ; Mon, 15 Dec 2025 17:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d36b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 735452dad4bf - stable/14 - sys/cdefs.h: Add comments to make #if/#else/#endif triple more obvious 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 735452dad4bf6275533e1d26fd098fbdbffd4d42 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:15 +0000 Message-Id: <69403e9f.d36b.67a527b0@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=735452dad4bf6275533e1d26fd098fbdbffd4d42 commit 735452dad4bf6275533e1d26fd098fbdbffd4d42 Author: Jessica Clarke AuthorDate: 2024-11-20 20:09:28 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 sys/cdefs.h: Add comments to make #if/#else/#endif triple more obvious This block has a lot of nesting, not helped by two adjacent nested blocks involving _POSIX_C_SOURCE, with only the inner one commented, looking like it's the end of the outer one. Comment the outer one as well so it's not quite so hard to figure out. MFC after: 1 week (cherry picked from commit 7a3af393d8ac2dfe72d24fe401344b60c4f87866) --- sys/sys/cdefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 209acc842839..4af38941762c 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -761,7 +761,7 @@ #undef __ISO_C_VISIBLE #define __ISO_C_VISIBLE 2011 #endif -#else +#else /* _POSIX_C_SOURCE */ /*- * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly @@ -799,7 +799,7 @@ #define __ISO_C_VISIBLE 2023 #define __EXT1_VISIBLE 1 #endif -#endif +#endif /* _POSIX_C_SOURCE */ /* User override __EXT1_VISIBLE */ #if defined(__STDC_WANT_LIB_EXT1__) From nobody Mon Dec 15 17:00:16 2025 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 4dVRBn15z8z6L1jq for ; Mon, 15 Dec 2025 17:00:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBm61qFz3pYd for ; Mon, 15 Dec 2025 17:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yAPpB/O4V5veadGBDRMVJTU8SWCmCgAgPUtU/+iZSM=; b=W4RgbKVeIz9lGFHdVmnpjYOltngurN0tlTuamusjOiLFN5DMSTGvX9FrSy5wSIDfgVCXxe QIvhShU1kUj8irWVEHWqznzxfe2DEid7uz2UgIC/EdyPGQEjf8Jzw9k+KlrCPvcXrpbR1P LlEm/YSpIBQqdiZEyC3Glr4ErQV4eoDIXaWLLUZRrq4ouYShbrU/hCL+KUsryyxUwLXdK+ XuwYHlO+XatwiINXZihLaujcG2B6c0zwwffbFUhnPUciUl9nOHVBA7S8viMR0nY/qlZOlj UMN1/ainWS3Of9hJJ3KhRFtH8BX3G1nmJhKAPbUdU0OWibM1QuErzOYgvAMSHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yAPpB/O4V5veadGBDRMVJTU8SWCmCgAgPUtU/+iZSM=; b=l1quPDwTdWFjaHCRbskvGQaNQV+s8XxAIUz7clkqLnJaRJKg2vv65TdZWHINK9X7QWFtwo wO+YGBQpNhbvo7I0r8tzHjovv4nOfH4BWvSnfyjZomc0UY3HzHh1yahL+byu4TdcvYKY62 P6VcBjNjcNCS76r0wPi83Mq7tlIWOso/z40vv9yEXtFt0Jwr/YBM6uqAgsOMGO+cvhAhI/ Sw3rMKvH+RQeDr/ump+GGN9IpTExD0h24uSR8WT8kgzEeKs1yROlTrf7zhIXb5kQ8dXmHK yBZme4jXUZsm2K/5cozAa9l8yOxdILfF8TBDSqqqbeTWftOmtla/uJ0XBVhhdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818016; a=rsa-sha256; cv=none; b=GSHrXDotJv78t0B3ZgMNzqpCONvkTUER1/HyzXh9Fh3Jz0vhR3P1kpqeKd4018sXX6W0Vp rwv8BNkmXFPrOJqiviUzAfAY/wLq3w3CnFkRqaHusz3Ly3CIcQ32t+l9D8DU7HV/TXsYSS JMYAUQlq+AmNY9orNH4lrjNw48uSy4I0lXyUQGLuPUQ+xZBOl1dZZO6F9aYA0frr0kz0B6 3oT1MKS0d18flamHxxDqbAtRGXO0qsqzduTZ3s3reJ57mifzUZMpMLuZFWX3KJhk2QdSs9 CzjZFvmXKOi3cNnyg9tBdZXqwVdQu2sOYSVhTlD1ARYUds2DhrycERB/QEx8qw== 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 4dVRBm5FJdzC64 for ; Mon, 15 Dec 2025 17:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e4d1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: David Gilbert From: Jessica Clarke Subject: git: 1327039aaf16 - stable/14 - hexdump.3: Add missing LIBRARY section 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1327039aaf1626e646516fea2c8214ceb298fe8a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:16 +0000 Message-Id: <69403ea0.e4d1.74a285c3@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=1327039aaf1626e646516fea2c8214ceb298fe8a commit 1327039aaf1626e646516fea2c8214ceb298fe8a Author: David Gilbert AuthorDate: 2024-11-21 20:23:16 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 hexdump.3: Add missing LIBRARY section All the other libutil section 3 manpages document this, and although it's heavily implied by the libutil.h header in the synopsis, we should still be explicit and consistent. PR: 280078 Reviewed by: jrtc27 MFC after: 1 week (cherry picked from commit 169e23d41f8ff16244f4fb04924fdc9828325dce) --- lib/libutil/hexdump.3 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libutil/hexdump.3 b/lib/libutil/hexdump.3 index 677bf92680a6..e5a18e201bbd 100644 --- a/lib/libutil/hexdump.3 +++ b/lib/libutil/hexdump.3 @@ -32,6 +32,8 @@ .Sh NAME .Nm hexdump .Nd "dump a block of bytes to standard out in hexadecimal form" +.Sh LIBRARY +.Lb libutil .Sh SYNOPSIS .In libutil.h .Ft void From nobody Mon Dec 15 17:00:18 2025 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 4dVRBq3Cbnz6L1YV for ; Mon, 15 Dec 2025 17:00:19 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBp6n2Fz3pfK for ; Mon, 15 Dec 2025 17:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818019; 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=XJXlyxIJNzg7RLIjlkDXM8MtXMVTPNlsW/Uw4p0UNNI=; b=bsQtiVvqa+V4SHEp3xd6lHxe4/kYn3OpoLNTi6ZXXBIC/Mw9basIhzfuiYjpxNJNytBvwl LY9J8nkbiR3Vv6/LyWFGZXZvBIvQXOZ2Qoqpt/wUnzFh7lIU3mkeNz72V1vnPLtzWFox7p jqWF/Ck7phZlEcJLoUSrKamw3+NOEF/n2KwX+dwbjiVBjWiEnSq2lzfBbph6U1wX97QnvJ DC6QAUagyiGNOlPqKkfvQZk5zlaH5nFj+lbJg537Z3OSMZ9LLxAU0VXFj2ZYK/lRQi7834 69QBge7RZsRfotdp5j3BLyMUbM19HYJuaK5VAPMJB9GO8RINUBVH2dbLdsWatQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818019; 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=XJXlyxIJNzg7RLIjlkDXM8MtXMVTPNlsW/Uw4p0UNNI=; b=FWzrnIQIMeohHIa0FZsDZkfjOIxmkBlJQxEd0x9BwW/m3bvkucqk69ltxpy+WCrapNHJ6U GsE63r3lvl7Uks19Dgzbr6AeZZy8dqecm2v/YT7V7l0lEKzY94omPBYNI1VCkR1HEnWm7D aAAEFGyk13RI70DMAtjdb9GDEleMPGh+VCpH/hJ07CRmdWU4rSGjfsZlouV8bpnijumIax kmkac+Yztx9+5Dh5iME1nyTgJTt7fq2hpxMmxbnGMxFuk+CoXbL9zA8lu8k3uW3dhyV6a8 uobVLm+/c3bfrRYlrtC/okwbPQRGS59Is7GV2idckmmzK2wgPZdUN9ztD9K28A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818019; a=rsa-sha256; cv=none; b=iOQgyoPfgFHkQQlGyImjTpC/F3UxZqzqzzh8hplXLjQn1pDqO2Go7qMejEU3D5zpw4umzD C99fAFpRVXZKkFdVsQ3R+KJtqNdk8uCKeRgvSClsyJeNK7Ff32EeyQ3kzLwOv6cz2e3hZ3 qGZG0iBUTkLHa63HmN5RreaoqLGZQxZUOlVgSLDpsO2bLCzqVBe5Un17eugnRyHOHQA8dV OGZZvlzjboWfoVPYKW8Ye2rr1A0t59aOcy0rtUaGdmmetxoHDvooyhKwU5KkW8aDRWVYAD XbaLTfgtqMK6NMl+E9Lt0Qfd887X5JMD7oS7fBskFQvvAtZ26WWYOjh1VaRmsA== 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 4dVRBp6MBXzCYc for ; Mon, 15 Dec 2025 17:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dd49 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 645c576942c9 - stable/14 - ofw: Fix inverted bcmp in ofw_bus_node_status_okay 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 645c576942c9e069974a4f8fe5bb7132e8182085 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:18 +0000 Message-Id: <69403ea2.dd49.67f0dc16@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=645c576942c9e069974a4f8fe5bb7132e8182085 commit 645c576942c9e069974a4f8fe5bb7132e8182085 Author: Jessica Clarke AuthorDate: 2024-12-17 20:51:56 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 ofw: Fix inverted bcmp in ofw_bus_node_status_okay Otherwise this matches any two-character status except for ok. Fixes: e5e94d2de987 ("Expand OpenFirmware API with ofw_bus_node_status_okay method") MFC after: 1 week (cherry picked from commit e1060f6dfd80b34cab6d439bf7420ad686ddc8f1) --- sys/dev/ofw/ofw_bus_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index d63e89e2d677..a21c5fa2735b 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -210,7 +210,7 @@ ofw_bus_node_status_okay(phandle_t node) OF_getprop(node, "status", status, OFW_STATUS_LEN); if ((len == 5 && (bcmp(status, "okay", len) == 0)) || - (len == 3 && (bcmp(status, "ok", len)))) + (len == 3 && (bcmp(status, "ok", len) == 0))) return (1); return (0); From nobody Mon Dec 15 17:00:17 2025 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 4dVRBp1SbZz6L1dQ for ; Mon, 15 Dec 2025 17:00:18 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBn649Dz3pcF for ; Mon, 15 Dec 2025 17:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818017; 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=bejPFYnMT4y04X4nuwBSY4+O8NGaFFm48pJAvm/ery8=; b=EM11b1SkPG3dvCCQts2Dl/a+TyYI+2W84Ch0LfyUiSMcztNfMwJgfmq/Ov5WwYFBJ2af7U d2B6nTllX88BPrYJSRjIMK69Ug9dumEz92f4xCnBajKDX71Ppnot3JCRQUs1tSX2qm2m+s re6HBCyXLmxsw0NaExYanxp9TYsLA7PQ9JK/PJRiJeP4qbAc7uzwaC3kCBQ474hMVh2Q1b FaajDqYZpQReuSXGf3nOAoAbvx/w4AUh+qjfgrRETeTiLPjEvgD7DfF2zD6FyZ1uvcCwcK CtP4Q7mjsfj2XStyzLOPjW4LbzyNAV5OuJt2z6CFBqbdVtBOwwc7pJ0Y+09Dqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818017; 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=bejPFYnMT4y04X4nuwBSY4+O8NGaFFm48pJAvm/ery8=; b=ds2nvFc0VOHvfvrWzvGCwcioyjLWm1HIeotD3jN+Q0A5NwbVXcyqam5E0lHbG99yNiVLzE q3rW8LkzR0M9nD2rc7ba6U3ieuGfF+C9qNCsX1M3rGeEwpdd62+CmQo6kV/MuKrZPbgrjj itDceR/gTVjr6pU8jpPeQevsZLNLaASQv6dLD5pVcPjh0U+2T/BTKD1L9YBlYFNPLZInVJ hdlMKOseaX276W5tX2C/YpRgNIONoea1bx1T8S3r4YitLKBw1WIT1gukODVyCl98PwZqTX CNN6IuFUJfDSpXJKr7fbkJ/PZCS74oVFL/BksjhHJD+kxKSDmm6AEv60PXohtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818017; a=rsa-sha256; cv=none; b=PiGcibAwWI5iV9XpG44MkrQhkZEfMN/pxvo0ReYGRXhz73QomjghnRyqG8OqrLZKI5dA8K brN/I9gf1tYXbAOEzkC6TWL97f+dg64ohwYoON0obHyawaUnTQXahciobzjbjArMC2mLRT 0xmpeP5xdQuHFNHvbjRi3j/kNGJaSYjnfqjUInyta5kCqyvTCX2SKODAori+LTbMMvmLqi VZykYu2CxG5wk24vPZua8kzKB5c523Sj6cJ/yBP9ri2AZrQB2MckEF2KRejTiV9Vn3Vlk2 KdmjSUVhDKlMkkbMAYLMVwMBjSdDTplUyX1jgLJ3VwuRJLYqksZP87S4QXPW+g== 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 4dVRBn5cM3zCYb for ; Mon, 15 Dec 2025 17:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e285 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 753dd37ab951 - stable/14 - gic_v3: Correctly handle GICC GIGR Base Address case 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 753dd37ab9519f181ca1272aa52aa5c733419f81 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:17 +0000 Message-Id: <69403ea1.e285.6617a70c@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=753dd37ab9519f181ca1272aa52aa5c733419f81 commit 753dd37ab9519f181ca1272aa52aa5c733419f81 Author: Jessica Clarke AuthorDate: 2024-12-09 21:55:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 gic_v3: Correctly handle GICC GIGR Base Address case When using the GICR Base Address field from each GICC structure instead of GICR structures, the field gives the address of a single redistributor page. However, that does not mean that they are not contiguous, and so GICR_TYPER.Last could be clear on them. Thus we must ignore GICR_TYPER.Last in this case and always treat each region as having a single page. Normally we'd do that as a result of checking against the rman's size (though that's a rather roundabout and iffy way of achieving it), but for whatever reason this is bigger on the Qualcomm Snapdragon X Elite (I assume the MADT reports GICv4 but TYPER doesn't report VLPIS and so there is a mismatch between the rman size and the stride used) and we end up walking off the region's mapping. Reviewed by: andrew, phk MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47560 (cherry picked from commit f8c90b704189c94275d22d7cc204d1d74e821d86) --- sys/arm64/arm64/gic_v3.c | 2 +- sys/arm64/arm64/gic_v3_acpi.c | 1 + sys/arm64/arm64/gic_v3_var.h | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index 9c77f6842aa4..62b5bf5eff05 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -1435,7 +1435,7 @@ gic_v3_redist_find(struct gic_v3_softc *sc) (GICR_VLPI_BASE_SIZE + GICR_RESERVED_SIZE); } } while (offset < rman_get_size(r_res) && - (typer & GICR_TYPER_LAST) == 0); + !sc->gic_redists.single && (typer & GICR_TYPER_LAST) == 0); } device_printf(sc->dev, "No Re-Distributor found for CPU%u\n", cpuid); diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index fca73010759d..3e549bded623 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -301,6 +301,7 @@ gic_v3_acpi_count_regions(device_t dev) acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, madt_count_gicc_redistrib, sc); + sc->gic_redists.single = true; } acpi_unmap_table(madt); diff --git a/sys/arm64/arm64/gic_v3_var.h b/sys/arm64/arm64/gic_v3_var.h index 1c5d354ee217..8bc0f456d91e 100644 --- a/sys/arm64/arm64/gic_v3_var.h +++ b/sys/arm64/arm64/gic_v3_var.h @@ -53,6 +53,12 @@ struct gic_redists { struct resource ** regions; /* Number of Re-Distributor regions */ u_int nregions; + /* + * Whether to treat each region as a single Re-Distributor page or a + * series of contiguous pages (i.e. from each ACPI MADT GICC's GICR + * Base Address field) + */ + bool single; /* Per-CPU Re-Distributor data */ struct redist_pcpu *pcpu; }; From nobody Mon Dec 15 17:00:19 2025 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 4dVRBr4CNNz6L1Yc for ; Mon, 15 Dec 2025 17:00:20 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBr08v3z3phj for ; Mon, 15 Dec 2025 17:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818020; 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=Jxnn/g6LYpOou6MY3BG03SuEomEKU03JKGPR2WUh4zQ=; b=Vxdz2Gh7CMtaV28GyL7ukdZxqpqvSAAc/5JRjX6qVD2fjJ8gO0/mrENVfxNAm46ZtmUH6r lcjoijNx5uej5LtofAaK+SzeuW6oeA0dE+Pz27EQmWU6x2HEe1Qrfk4w9gtfaiT1VfgOq0 f3zGGekKejT8Uf0bAB6bj3GOCX22SDZBuNdVOAzuc+qICifXhJxcxr4B+hW/gh0rJUgN9M PETKtKqrk8USvfKES/ShFYLGXOXGqVM+22lSuaMK/1Ig9eUaNBAT2xzog4f3zvMFb7BZQ3 bE0PJJV+QsL/i1jLFFCDtYQH30BmaxvdCy8jz21Fn26tU8JYx6djTJ/l93YUxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818020; 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=Jxnn/g6LYpOou6MY3BG03SuEomEKU03JKGPR2WUh4zQ=; b=yY+qN3wUnJBnL+B1UcwWgGulgioi964+O5oNFTRNrhO64pekH3L1lPCdHUILeYkg3hQvjL xFhZoB91dYUNMj6Obsr/ZDtsb6HsFdbvBRzcWcgOYMdUd3C4g818wNUgx0htjcOU82QvdX R6+QHeh+syoUmJKRoz2rE9G2N3Vo/UWa2pG/kU+OAzsgzn2cej4xkTsMtGUKvC7rU55fYc cY/EfPXhU0TSkRvg1D2/SAbkOTozocgkwIo3wk17QbWVY8U7bh/Rielh45+PBBpqR/+Dpr aqJVavs+rQqFNTGHgNU2s92lwxohJksxJNQlcXcvhnIfwlmrO3/RezC3ls9Zzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818020; a=rsa-sha256; cv=none; b=sKfR2YpIsypmEVGVLCqvGSunb4iDZuuQovWi2du/rbdKvOZR39/KytChGYi8hnqbPXlEiI bQ5u/9Fusn6bLc5BR23dWuC2uYLWmB90t2Tt9LE84Z8PRK/7ctKSDiOb3s/J82XgBX6dKg PHGWfLb5A+ihElQhOTjHhL2RuLlyvlS9qln9cJGxTnmerVUp0lMJNtZn9Bj1iDQkKEzYDF 2JG6J5sStYGR9QVffEK5yfTUroWnm7F5p6EggFxga/yh5wpIGTng+QSMyzH+FYHh6lFNrK RTHzzY9r1C9xn1LizzjRHbNgm9VDIylawzeZ3MJGtuD5EW3JYM9O7SBmhKm5lg== 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 4dVRBq6m6xzCr3 for ; Mon, 15 Dec 2025 17:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d36f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a5ccd406ddc5 - stable/14 - riscv: Fix and generalise saving TP (PCPU pointer) whilst in userspace 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5ccd406ddc5b73060e154495745651646f1dcf5 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:19 +0000 Message-Id: <69403ea3.d36f.1253e05f@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a5ccd406ddc5b73060e154495745651646f1dcf5 commit a5ccd406ddc5b73060e154495745651646f1dcf5 Author: Jessica Clarke AuthorDate: 2025-02-04 17:28:42 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 riscv: Fix and generalise saving TP (PCPU pointer) whilst in userspace In cpu_fork, we allocate sizeof(struct pcb) + sizeof(struct trapframe) space on the stack, then round it for stack alignment. This not only fails to include the space needed for TP but also doesn't round up the trapframe allocation to be stack-aligned, yet TF_SIZE does, as is the expectation of fork_trampoline and cpu_exception_handler. Given that sizeof(struct pcb) + sizeof(struct trapframe) is a multiple of 16, this causes the saved TP to be stored in the PCB's pcb_sp (the intended trapframe padding aliasing pcb_ra), which is probably harmless in practice as the PCB isn't expected to be current, but definitely not intended. In cpu_thread_alloc, we do include the 8 bytes for TP and then stack align that. This again fails to include the padding for trapframe as present in TF_SIZE, but sizeof(struct pcb) + sizeof(struct trapframe) happens to be a multiple of 16, as above, so adding 8 then rounding to stack alignment (16) includes an extra 8 bytes of padding, giving the right result for the wrong reason (and could be broken by future struct growth). Extract the calculation into a shared function that rounds correctly regardless of the struct layouts. Also introduce a new struct kernframe to encapsulate and clearly document this shared state rather than using magic constants, and also enable it to be easily extended in future, as we intend to do downstream in CheriBSD. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48799 (cherry picked from commit 21c534b9f5d5de07137f9a42e016876dd6ae66c1) --- sys/riscv/include/frame.h | 14 ++++++++++++++ sys/riscv/riscv/exception.S | 4 ++-- sys/riscv/riscv/genassym.c | 4 +++- sys/riscv/riscv/swtch.S | 2 +- sys/riscv/riscv/vm_machdep.c | 35 ++++++++++++++++++++++++----------- 5 files changed, 44 insertions(+), 15 deletions(-) diff --git a/sys/riscv/include/frame.h b/sys/riscv/include/frame.h index f134842d1c45..c70a3a48ee0a 100644 --- a/sys/riscv/include/frame.h +++ b/sys/riscv/include/frame.h @@ -57,6 +57,10 @@ struct trapframe { uint64_t tf_scause; }; +#ifdef _KERNEL +#define TF_SIZE (roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1)) +#endif + /* * Signal frame. Pushed onto user stack before calling sigcode. */ @@ -65,6 +69,16 @@ struct sigframe { ucontext_t sf_uc; /* actual saved ucontext */ }; +#ifdef _KERNEL +/* + * Kernel frame. Reserved near the top of kernel stacks for saving kernel + * state while in userspace. + */ +struct kernframe { + register_t kf_tp; +}; +#endif + #endif /* !LOCORE */ /* Definitions for syscalls */ diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index 8acb5cd691d4..eb8d92b55d05 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -53,7 +53,7 @@ .option pop /* Load our pcpu */ - ld tp, (TF_SIZE)(sp) + ld tp, (TF_SIZE + KF_TP)(sp) .endif sd t0, (TF_T + 0 * 8)(sp) @@ -139,7 +139,7 @@ csrw sscratch, t0 /* Store our pcpu */ - sd tp, (TF_SIZE)(sp) + sd tp, (TF_SIZE + KF_TP)(sp) ld tp, (TF_TP)(sp) /* And restore the user's global pointer */ diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c index 67714346cc75..2b2c558fa181 100644 --- a/sys/riscv/riscv/genassym.c +++ b/sys/riscv/riscv/genassym.c @@ -85,7 +85,7 @@ ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); -ASSYM(TF_SIZE, roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1)); +ASSYM(TF_SIZE, TF_SIZE); ASSYM(TF_RA, offsetof(struct trapframe, tf_ra)); ASSYM(TF_SP, offsetof(struct trapframe, tf_sp)); ASSYM(TF_GP, offsetof(struct trapframe, tf_gp)); @@ -98,6 +98,8 @@ ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); +ASSYM(KF_TP, offsetof(struct kernframe, kf_tp)); + ASSYM(RISCV_BOOTPARAMS_SIZE, sizeof(struct riscv_bootparams)); ASSYM(RISCV_BOOTPARAMS_KERN_L1PT, offsetof(struct riscv_bootparams, kern_l1pt)); ASSYM(RISCV_BOOTPARAMS_KERN_PHYS, offsetof(struct riscv_bootparams, kern_phys)); diff --git a/sys/riscv/riscv/swtch.S b/sys/riscv/riscv/swtch.S index 8312a6b5f347..cfd19a2d76d6 100644 --- a/sys/riscv/riscv/swtch.S +++ b/sys/riscv/riscv/swtch.S @@ -419,7 +419,7 @@ ENTRY(fork_trampoline) * Store our pcpup on stack, we will load it back * on kernel mode trap. */ - sd tp, (TF_SIZE)(sp) + sd tp, (TF_SIZE + KF_TP)(sp) ld tp, (TF_TP)(sp) /* Save kernel stack so we can use it doing a user trap */ diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c index 26b8c0dffcde..0e9a52ba89b0 100644 --- a/sys/riscv/riscv/vm_machdep.c +++ b/sys/riscv/riscv/vm_machdep.c @@ -58,6 +58,26 @@ #define TP_OFFSET 16 /* sizeof(struct tcb) */ #endif +static void +cpu_set_pcb_frame(struct thread *td) +{ + td->td_pcb = (struct pcb *)((char *)td->td_kstack + + td->td_kstack_pages * PAGE_SIZE) - 1; + + /* + * td->td_frame + TF_SIZE will be the saved kernel stack pointer whilst + * in userspace, so keep it aligned so it's also aligned when we + * subtract TF_SIZE in the trap handler (and here for the initial stack + * pointer). This also keeps the struct kernframe just afterwards + * aligned no matter what's in it or struct pcb. + * + * NB: TF_SIZE not sizeof(struct trapframe) as we need the rounded + * value to match the trap handler. + */ + td->td_frame = (struct trapframe *)(STACKALIGN( + (char *)td->td_pcb - sizeof(struct kernframe)) - TF_SIZE); +} + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -74,13 +94,12 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) /* RISCVTODO: save the FPU state here */ - pcb2 = (struct pcb *)(td2->td_kstack + - td2->td_kstack_pages * PAGE_SIZE) - 1; + cpu_set_pcb_frame(td2); - td2->td_pcb = pcb2; + pcb2 = td2->td_pcb; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); - tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); + tf = td2->td_frame; bcopy(td1->td_frame, tf, sizeof(*tf)); /* Clear syscall error flag */ @@ -92,8 +111,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) tf->tf_sstatus |= (SSTATUS_SPIE); /* Enable interrupts. */ tf->tf_sstatus &= ~(SSTATUS_SPP); /* User mode. */ - td2->td_frame = tf; - /* Set the return value registers for fork() */ td2->td_pcb->pcb_s[0] = (uintptr_t)fork_return; td2->td_pcb->pcb_s[1] = (uintptr_t)td2; @@ -217,11 +234,7 @@ cpu_thread_exit(struct thread *td) void cpu_thread_alloc(struct thread *td) { - - td->td_pcb = (struct pcb *)(td->td_kstack + - td->td_kstack_pages * PAGE_SIZE) - 1; - td->td_frame = (struct trapframe *)STACKALIGN( - (caddr_t)td->td_pcb - 8 - sizeof(struct trapframe)); + cpu_set_pcb_frame(td); } void From nobody Mon Dec 15 17:00:23 2025 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 4dVRBv2kgTz6L1pN for ; Mon, 15 Dec 2025 17:00:23 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBv1Zx4z3pld for ; Mon, 15 Dec 2025 17:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818023; 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=ZFy8H9y1N6NvoNJEOq4vish1KT/xXYyIUbFk75DN8Co=; b=J1o2S7qVLxUm9TwuITpR5O4ZIXu19m57OOETO2vez7SvNQVezDXrSZ+qgsDfgf4iP74IGM BZ9JZ9g7Hpedd40GwgQnY+/ojLCYYl75ZqiI6nTGFISFuCLHhZQY/Xu0vs/0Ej+MPBJR6U fyVooBRUzQ6tRouvI2a47+sKr5c4v5Fuwy7Xc99prCWgrd5sVAwIkk4LtzyiMckOAAp/7M kOHQzIACD4N5f4DF7YLKbFape9MR2TX80nUQQ03ATZCZCqbUmAXYZqzSl6cO4yVRA3HAfN FVzQSFRGyjYbb9GKTR+Shy/g3mNR2sl5OwXcOyvRs5x665+bnbLPoOVrRgT0Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818023; 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=ZFy8H9y1N6NvoNJEOq4vish1KT/xXYyIUbFk75DN8Co=; b=HIax7R63s8Y7ifZCiZ19WWKitr1kWHkhklH3GCY/82FNpQuowsnMzPfZi2ep7E6Bt6tub6 0GT2hPUpx4Jojuk8szzCzTAdZmr/4/PnB3W9cgDoHsDXRRmaOKBew/by25MgUkmguwEODZ ftrLvRDeokXmpgWKuC4Sv9ncleTY1YKWsQBc2SQwZpHKMap9ZvHnQY3FoRurTW3ciwapye NOZJPE4+VSdmhebXHxXQGyhEGrueNlBzML4b5zQwg5Bg0KCSERTPgFojPAfhtr9WeqyoNE on1ShFdtmPeKztZdzW/sEzP6gvBufHInnmoXUgS15aKU8pwdEShJoRWhI3wNFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818023; a=rsa-sha256; cv=none; b=m5xEXL0icz4oCZI75HLSJV1i8itdNLaIMiHFLD6mVqpLAuzwSJSi7EKdSB5D/gWYAsL7FI aK3cmAyZYWXThcfLoOT2Y3neRBcWfUEUp8Dj0D5MdbAeJBkQQdpYQVG3fBoB5CM4f17FzT tUxA3h0cn2BKHE/+b7NZtSCTXaH3wkJy4VX4YJ0qUCqu9Q3BTfztzBHizoAxXYRKkELWhs hrw8JjkEptZZljRwuDOxsI/P4DupLq1maKdsT+yGJItXp9j7sztGtzgJI46RuC7VDjIziz 5ozY9CXGxeyr6Adhcz2TtSeB27gOXV/oWwU2sLHfmgfiXVfcPSpuUBFRxPNjNA== 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 4dVRBv18shzClL for ; Mon, 15 Dec 2025 17:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e0a3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: e73457d194b0 - stable/14 - rtld-elf: Fix dlsym(3) for TLS symbols on PowerPC and RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e73457d194b000a53218a77564730e87b84f66af Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:23 +0000 Message-Id: <69403ea7.e0a3.5e8628aa@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e73457d194b000a53218a77564730e87b84f66af commit e73457d194b000a53218a77564730e87b84f66af Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 rtld-elf: Fix dlsym(3) for TLS symbols on PowerPC and RISC-V The implementation here is meant to mirror what a GOT entry for the given symbol would use for ti_offset. However, on PowerPC and RISC-V, TLS_DTV_OFFSET is non-zero, and so the GOT entries are normally biased by this, but we fail to do so here. As a result we end up getting a pointer TLS_DTV_OFFSET past where the variable actually is. (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: 5ceeeba90c6c ("Import DragonFly BSD commit") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50183 (cherry picked from commit 8ad9cec3a2cc643020a286ee68f70eb01225fbdd) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 8509321b785f..00e805c5c4c9 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4088,7 +4088,7 @@ do_dlsym(void *handle, const char *name, void *retaddr, const Ver_Entry *ve, sym = rtld_resolve_ifunc(defobj, def); else if (ELF_ST_TYPE(def->st_info) == STT_TLS) { ti.ti_module = defobj->tlsindex; - ti.ti_offset = def->st_value; + ti.ti_offset = def->st_value - TLS_DTV_OFFSET; sym = __tls_get_addr(&ti); } else sym = defobj->relocbase + def->st_value; From nobody Mon Dec 15 17:00:22 2025 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 4dVRBt3jqCz6L1bY for ; Mon, 15 Dec 2025 17:00:22 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBt1yVLz3pj9 for ; Mon, 15 Dec 2025 17:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818022; 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=gfc0snAt61es37fw0TsPaiGbKPlTtzaOcACdvJEdoA8=; b=tuOJf0xOQEIKjh9MHO2clmTz73QFJveVVdZ/qfLEVm3Vq5YSn9NuNeoe+4JsSuxgqnoaLv 5/LlJSjuWLqTGMH/xNm2UlBTNUE3AYfBYU76X4x2pBW2ybrg3lcdaaH2Q9CVwjAfbmY6ot 99z6fKfaLlLFOaVPHNcU8ciumxDaH6UyHQLzJ8/tCiMzcxgH1NL8pe4Dp/kEYsTL+NElv2 SCUUd6fkXYay9N06BHMudVlrA92aku1I7uO4y/0crESW9yCa05kovJpwoxWTNk/AFGZqmF PJsGqkCTEsk2s2/eYv2gLB7c8CyJ5oXPC+GEFpspJzo0ZS6GrOLMF/WHJ7N26w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818022; 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=gfc0snAt61es37fw0TsPaiGbKPlTtzaOcACdvJEdoA8=; b=KDeNw1JYlmn4hznoUCz9TB7ZPvDziPPrlOMJa5AFohNxUsCdxhFrdsHxKtfLGBdpAD71eH m9mU6PWgPnz+eH7WCxbBl8ShIk+3QR25i9ej4TrOHWwjhqRM0ytR1A06crM8KiY/WrrIic eXh5ujbQ+6q0NXiGrjpJKaJNX/gUetGjPV5ugp06i7BcCVM+WmqLYzhdB2hYPrh2806Sgu ihP/E4UPrK8+Mi+IFWNhFzlRIvQyHsC34CMcftx7pW0cyRCAQwymauc8SNBjf3lOn5nj8X XYXTi9rwGGChAvu6/G9TjwLkXeX5DqX4hDa7RDpRVmsLDpBfsX2h+1AZhP34cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818022; a=rsa-sha256; cv=none; b=IVbcbFoY0JHpGR/0Kb+8LFna3qnevNCJbH0pjc5lpFunlgAbtHaQ7qxPma/vXwvsEm+F9w SDHrFliT3puj9eS1JgpS0VP0DEVOa9ZFW9AANrO6SewPrkY5YjAHQRqOD09kZnDOntpyoJ H/vxXL+A1gUsZnvy5kR9RH2wTEKefO4KeQD81kbx5bZV4YQdt4J+8ByrqkVfoXhoUQVLFf oSAoC78Uu46tmtmlqBqm5piw9gAIUkGhNjuWe/IIaP0n4+Fm2oFkYykGbNwMftLq4BRe0M tmmtDNLZ4RCIdi2qLM65XNOjUyG7OGI2P78981g8UwrnVg3Ttf4xHJFZfYcbKQ== 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 4dVRBt0nTlzCWD for ; Mon, 15 Dec 2025 17:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id de21 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 11d41989cc62 - stable/14 - libc: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 11d41989cc62c8812c5f6140d1c1877575f09aad Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:22 +0000 Message-Id: <69403ea6.de21.2b71f604@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=11d41989cc62c8812c5f6140d1c1877575f09aad commit 11d41989cc62c8812c5f6140d1c1877575f09aad Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:50 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 libc: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V The implementation of dl_iterate_phdr for statically-linked binaries abuses __tls_get_addr to get to the start of the TLS block. For most architectures, tls_index's ti_offset (relocated by DTPOFF/DTPREL for GOT entries) is just the offset within that module's TLS block. However, for PowerPC and RISC-V, which have a non-zero TLS_DTV_OFFSET and thus are designed assuming DTV entries are biased by that value, ti_offset normally has TLS_DTV_OFFSET pre-subtracted. By using an offset of zero here we end up getting a pointer TLS_DTV_OFFSET past what __tls_get_addr would return for the first TLS variable. Fix this by using -TLS_DTV_OFFSET to mirror what the General Dynamic GOT entry for the first TLS variable would be. (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: dbd2053026a6 ("libc dl_iterate_phdr(): dlpi_tls_data is wrong") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50182 (cherry picked from commit 78b99f369f75f5df49b506ae750659b07ab34362) --- lib/libc/gen/dlfcn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index bffee3952e0d..ae1c8d83df19 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -229,7 +229,7 @@ _dl_iterate_phdr_locked( return (1); _once(&dl_phdr_info_once, dl_init_phdr_info); ti.ti_module = 1; - ti.ti_offset = 0; + ti.ti_offset = -TLS_DTV_OFFSET; phdr_info.dlpi_tls_data = __tls_get_addr(&ti); ret = callback(&phdr_info, sizeof(phdr_info), data); return (ret); From nobody Mon Dec 15 17:00:20 2025 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 4dVRBs5b3zz6L1pH for ; Mon, 15 Dec 2025 17:00:21 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBs0RVFz3phx for ; Mon, 15 Dec 2025 17:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818021; 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=cvBVhbSnqZdXcs/I6oiV5tb4nZ0jOQCgkfZA7Noxf8U=; b=ozOhLENUVrq4oYmBD8dRwCB68sS1b+K1vxIMmoPZ4XW7UBG4ln9JiG6+9pbUsTbuZpvg4k J9yBCM23Up7LQ5yaUolobEecpRrTthaCwtx9I8mEYHkQjd1JLF9SMY2ql+h4FdTqA/BVgO bWRcdIWV2wMAA9PQlzgyUv5THV61YwUGC/kXLrFO0RkSD1xJJD6bcDGUw0u8QJhGqaoNj7 jvpRLTB3lKCq8Edp/k2d5u528KIacXptXWqAKmtbBLWlLlkE2Ya3l5uglPsL9G4o9d+LOw A1BOiE/yKneEbFdiuPflVPdZo6dEB1a03U3qyLQ1D7z+QcIz713tgSe/Ttx5fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818021; 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=cvBVhbSnqZdXcs/I6oiV5tb4nZ0jOQCgkfZA7Noxf8U=; b=tYy2MhuWmWMNSUZD1Bn1SdoHLHJ3xFW2S9XemR95R2RulP/ZKDWaXZ8/60YbSl44GCnURq KuYiQJ8RLI4rle99/MTVEkk/9V2Dfb0wmsLN9uFOg+dePAwK4fw6Aeoy2PSrOvSVuY8y2C NJGFfTYhr1adohNDipueQjEtg3G2t7qRDw3YOMefBsISUOYjKNKVk+WHpiY+Q4YE3qYSdH QB9BgF7PlD5Wi/jBzE1MJmZLS+ZGDgTYG7J8KI1NPBO19nhCx40zGRaS8hADgGOdTxY2BA nXWGWR1Q/5gQNagOcV/gIsjfm7W2Kr1jw0pshSCXn+wRF2XmqkeTWqWNxVQYTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818021; a=rsa-sha256; cv=none; b=eaei92hr3bPnYzIgHHlsPbsQ2tbJH5Je5eB4D1r/M1PQEUSJVH2d9EfHfgmWsI21e3XNlQ X4B6w7DQQ894tm+GzdIuu3wEdTi/kCT/jK7DSDWf+jxhie9JTtpOgcmEvtS9FzacSklCVg ksV8jCTY6p6MVZ6PY6IU0SyLWoYhLt1/JuwqM0WwjYL1sNBHLeusLbXq79I1VPZ/qQMf4Q PmSvkCMHhSe61ktTer5XLBZFdh/b46Vw9wQFwextK2TeRccXZxu/rTd6N8sJV/vWsskzWr ZTiLz9YJcSSw8oAAf7DmIDHK9zszaMTWxyGYJyzXt2M8SZFyS+FWarsq/0eccg== 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 4dVRBr75XzzCkl for ; Mon, 15 Dec 2025 17:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e119 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 2ef0ba80e0b5 - stable/14 - libc: Don't bias DTV entries by TLS_DTV_OFFSET 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ef0ba80e0b51653e62cfd5623e7f6b844399440 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:20 +0000 Message-Id: <69403ea4.e119.5f3be21b@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=2ef0ba80e0b51653e62cfd5623e7f6b844399440 commit 2ef0ba80e0b51653e62cfd5623e7f6b844399440 Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:50 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 libc: Don't bias DTV entries by TLS_DTV_OFFSET PowerPC and RISC-V have a non-zero TLS_DTV_OFFSET. The intent behind this in the design is that DTV entries are biased by this, as are (in the other direction) the DTPOFF/DTPREL entries in the GOT. However, this is pretty pointless in practice, and both FreeBSD and glibc's run-time linkers don't bother to bias DTV entries, instead just adding the bias back on at the end in __tls_get_addr. In libc we also have a minimal implementation of this for statically-linked binaries, which is only in practice used for code compiled with -fPIC (not -fPIE) that is also linked without TLS relaxation support. PowerPC supports linker relaxation for TLS sequences, so this likely never gets hit there, but RISC-V does not, and so easily does if you compile an executable with -fPIC. In this implementation we add TLS_DTV_OFFSET both to the DTV entries in __libc_allocate_tls and to the result of __tls_get_addr, meaning that any TLS accesses using the General Dynamic model in static binaries on RISC-V end up off by 0x800. Historically this also did not matter as __tls_get_addr was a stub that always returned NULL, so although 6e16d0bc4376 ("Rework alignment handling in __libc_allocate_tls() for Variant I of TLS layout.") added this DTV implementation, nothing actually read the entries. However, now it's a real implementation, and dl_iterate_phdr also now relies on it, it does matter. Fix this by not biasing the DTV entries, just like RTLD. We could instead stop adding TLS_DTV_OFFSET in __tls_get_addr, but being consistent between libc and RTLD seems better. (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: ca46b5698e8a ("libc: implement __tls_get_addr() for static binaries") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50181 (cherry picked from commit d04c93a2adccb4c3a17f7391126a9246326e3fea) --- lib/libc/gen/tls.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 30b4fc583c98..8d453eccb801 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -151,7 +151,8 @@ libc_free_aligned(void *ptr) * where TP points (with bias) to TLS and TCB immediately precedes TLS without * any alignment gap[4]. Only TLS should be aligned. The TCB[0] points to DTV * vector and DTV values are biased by constant value (TLS_DTV_OFFSET) from - * real addresses[5]. + * real addresses. However, like RTLD, we don't actually bias the DTV values, + * instead we compensate in __tls_get_addr for ti_offset's bias. * * [1] Ulrich Drepper: ELF Handling for Thread-Local Storage * www.akkadia.org/drepper/tls.pdf @@ -167,8 +168,6 @@ libc_free_aligned(void *ptr) * but we must follow this rule due to suboptimal _tcb_set() * (aka _SET_TP) implementation. This function doesn't expect TP but * TCB as argument. - * - * [5] I'm not able to validate "values are biased" assertions. */ /* @@ -272,7 +271,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) /* Adjust the DTV. */ dtv = tcb[0]; - dtv[2] = (Elf_Addr)(tls + TLS_DTV_OFFSET); + dtv[2] = (Elf_Addr)tls; } else { dtv = __je_bootstrap_malloc(3 * sizeof(Elf_Addr)); if (dtv == NULL) { @@ -283,7 +282,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) tcb[0] = dtv; dtv[0] = 1; /* Generation. */ dtv[1] = 1; /* Segments count. */ - dtv[2] = (Elf_Addr)(tls + TLS_DTV_OFFSET); + dtv[2] = (Elf_Addr)tls; if (libc_tls_init_size > 0) memcpy(tls, libc_tls_init, libc_tls_init_size); From nobody Mon Dec 15 17:00:24 2025 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 4dVRBx0bz5z6L1Ng for ; Mon, 15 Dec 2025 17:00:25 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBw2QmJz3pg9 for ; Mon, 15 Dec 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818024; 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=+JOhlr8BGOYhdb43sw1Zzav5nrGPqE3p+oT6J+zMc2A=; b=I7DtWELmkk2swlnuTxFdbAE8VEqq/CDMTrMM7A8eUwQ9G4yR4UAJSZ1s756q3CCA8+wzez 8B5LIWIxXCd8CtmY7m2JibfBdTNf558RGt5rlrlJuMkuHSIraEbDyHdJc+PevdBFbkM0Fe 0GhZ6YlBC3dsju9efSUI5Lf/vCXbPkuvxnu3zEt1bVYHRikztk2on2BdVDPEIP8ZGB4Dvp wIzAcbtBNIfxBEEkOfIJETYZfaBOzlqvuMD+L1Iiw3VM8vZz7W9UY8YIoGdQiebMLQ2osG W03Sxt357g5laE2MfR8mgcQ/L1e9JhFObnd+wpahDHbXSmbGlb45tV2jWepGiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818024; 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=+JOhlr8BGOYhdb43sw1Zzav5nrGPqE3p+oT6J+zMc2A=; b=t+f+KJES6IiRgATsLz9zPFC47B38z0kivw7v17+ymzRnLAWLSHBQFpHGwL4P33cVzSs2WH Y4JM/SkxZzvn6apxlMo6dJIEcZ4k5Sx+r9+tr/hpaWqK/wzDcR2I6TnbRio5exlze91OKA XYPVaRxrt+955b+capvC5nsp7PTopEXTg+HA/w+jKVoQjJlYUtx6ytDEKh7UbUzBriFvKS Qu3JbiX/DX8vDVBVxmQlckXxcDInGvBiMpmOWT6YJSjmCuo9Jtwp5TPHma7Dl7F4hdS5TM tZxyFYVm6Z1LrFyzErjiFIUU8U6NVmaIC0WsPJcWMxayKflWAGTVVt9Q+KV33Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818024; a=rsa-sha256; cv=none; b=qjDaF8+QFmQYi1e4w6NfcY6ht8/K+4M52RG/nCOnWRYDo1le/bFigmpnH12Io0YwLLbtgN xauYsbAzHDlnG5l5KaqfUYkm6A2m+GFffTt0DsnWGxevZOvX/zxBmzy1In+YwSF4xKJO67 VpxUpSjuK/RPIC3QEBfzny0RrwWWg4ervj6TuPwDMxsEv65l8AxNOdwxQRtZgkVO3bN5W+ 08YAcOyfSzG4honbC0K7EfvwCE3wfqW3ta/sOBPBeCzw9NdS505jbUxalUtI6J5lhDGcMY Cr9Qmcj1xbPPujzP21WhFmUtLfpMr4h1JSmInV3YHsskaPwTzPInF2lpGvOPjA== 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 4dVRBw1z8MzCkm for ; Mon, 15 Dec 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e873 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 79b0a953ada4 - stable/14 - rtld-elf: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79b0a953ada4c516c43f163c51d3f083da666d59 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:24 +0000 Message-Id: <69403ea8.e873.327df7d5@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=79b0a953ada4c516c43f163c51d3f083da666d59 commit 79b0a953ada4c516c43f163c51d3f083da666d59 Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 rtld-elf: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V The implementation of dl_iterate_phdr abuses tls_get_addr_slow to get to the start of the TLS block, inlining the implementation of __tls_get_addr as if the tls_index's ti_offset were 0 (historically it called __tls_get_addr itself but changed due to locking issues). For most architectures, tls_index's ti_offset (relocated by DTPOFF/DTPREL for GOT entries) is just the offset within that module's TLS block. However, for PowerPC and RISC-V, which have a non-zero TLS_DTV_OFFSET and thus are designed assuming DTV entries are biased by that value, ti_offset normally has TLS_DTV_OFFSET pre-subtracted, but it's __tls_get_addr's responsibility to compensate for that. By using an offset of zero here, tls_get_addr_slow will return a pointer to the start of the TLS block itself, so by adding TLS_DTV_OFFSET we will point TLS_DTV_OFFSET past the module's TLS block. Fix this by removing the extra bias (the alternative would be to pass -TLS_DTV_OFFSET and keep the addition, which would more closely follow what __tls_get_addr does, but this is more direct). (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: d36d68161517 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50184 (cherry picked from commit c02aaba1b4549c1c3b1481f7c935f6cc80b98e8d) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 00e805c5c4c9..a44a5e303dcc 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4269,7 +4269,7 @@ rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info) phdr_info->dlpi_tls_modid = obj->tlsindex; dtvp = &_tcb_get()->tcb_dtv; phdr_info->dlpi_tls_data = (char *)tls_get_addr_slow(dtvp, - obj->tlsindex, 0, true) + TLS_DTV_OFFSET; + obj->tlsindex, 0, true); phdr_info->dlpi_adds = obj_loads; phdr_info->dlpi_subs = obj_loads - obj_count; } From nobody Mon Dec 15 17:00:25 2025 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 4dVRBx4t5kz6L1pR for ; Mon, 15 Dec 2025 17:00:25 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBx3SFMz3pVG for ; Mon, 15 Dec 2025 17:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818025; 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=Xx3hcXcrrfdbIOWfHu8koWnnUARaHznAO69sjXA7mIg=; b=nmRPenjVXAZidIctLcYeJ4O+YbVXv9uj3lNNRQFWuT52Txqaxe6mksendQaB1LHPjMw3Fs t2epAHVg89jQfukCPxXgtMIhROYnXocRICTSI8NkokN+hnq22uOBBF7A1ikoUW5Svp8a8O 6MmP5tir5WnCyeFt+nAaKj978NskiDRVTv/keMXSXCBSDMsasM+p26/jRswgEb2/OSavtL Y0SJXQXJBjbBxiffEJpFgQII02+DKOzzBokNAgYNKqzMBpTj2jORSv2YYppG5PrHY+Wui2 BjZfulgrenOnXpp+W3PXRXQjb2wUo2C91TFd94iTZ42jiSOo1Nk9cQgtRTZBTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818025; 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=Xx3hcXcrrfdbIOWfHu8koWnnUARaHznAO69sjXA7mIg=; b=kYycbTdMitwy6ycCNPRrWAn91gdqsSS45aPiBOeTeG6cDleVuhy3l7MbVlelfmHnZG2Y/R Isa5/h2S2bvEB0lXfsGHYQnUFZAZpHYsDsfM1ENBmkW1LwdxmfM1Ka97NTf1hhTM1GCwP7 gHNDDt94BRDVoYG8Z1xmgzrc96qpggRf2j3FSPTMpu+OnFX8+wgDtDCEk1AWgWQJ+GN0kn w+nofslvyPfMpB0dk8aIq0n3e6Fs7kVaPVEuaeHqaYzEzbwUWFiU+nOyx+sf6JIfMxiGYp u9iuEbQh6OFo0P9tvCH8dOk2S10Y3kRPdZi3i0Du9wHB3InKQcJgyOfBlS1MaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818025; a=rsa-sha256; cv=none; b=SoaV++3gMkvLYmD3qtH99I5W5F8YS80q5kFk/OAromJshTbdfkj+aC1hLhvtnfLxRiNwMl W7OFqX1SBd2zbZuxLwZqveI3gdt+0YDS7ViY0p57FZx2IYEGmWi+ej/mcBUex2Ic9H+eCC 0lKMJrarW8tlDSeSem6Ue9fT0+/u20n/WywPz+Gey9Q9DcKo6UWkgw2mZdut2CnlmyLvZM HEpYOu0jHLp2gJFDyqSyMkR6hltimVu/bQAYTkOyOkorTfuW8/yH7rXW1tOHQFIOeGHHHr kiGje0WoADgnxIUbRfAKfkWbcTHGgfmONQPdLLRj61Zw//vP4k87KENUaQs7vw== 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 4dVRBx2gVTzCr5 for ; Mon, 15 Dec 2025 17:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d0d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: f1344d0aa816 - stable/14 - rtld-elf: Fix UB for direct exec with no extra rtld arguments 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f1344d0aa816d0a2e9b316d4bd28b5f478b5d3da Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:25 +0000 Message-Id: <69403ea9.d0d2.199bac4@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f1344d0aa816d0a2e9b316d4bd28b5f478b5d3da commit f1344d0aa816d0a2e9b316d4bd28b5f478b5d3da Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 rtld-elf: Fix UB for direct exec with no extra rtld arguments If no extra rtld arguments are provided, rtld_argc will be 1 (for argv[0] and so we are shifting the entire memory range down by a single pointer. However, unlike argv and envp, auxp's entries are two pointers in size, not one, and so in this case the source and destination overlap, meaning simple assignment is UB (C99 6.5.16.1p3). On many architectures this ends up being harmless as the compiler will emit double machine word loads and stores, or if it splits them it may still schedule them such that it works in this case, but our RISC-V baseline does not include such instructions and LLVM ends up picking a schedule that copies the second word before the first word, thereby replacing the first word with a copy of the second word. This results in direct exec mode segfaulting on RISC-V when given no arguments. Fix this by using a temporary in the source and let the compiler safely elide its use. Reviewed by: kib Fixes: 0fc65b0ab82c ("Make ld-elf.so.1 directly executable.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50185 (cherry picked from commit 2b04ba6e08b983d8756552286846059507bca7a3) --- libexec/rtld-elf/rtld.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a44a5e303dcc..1a5cb0a6fce9 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -498,7 +498,7 @@ rtld_trunc_page(uintptr_t x) func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) { - Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT]; + Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT], auxtmp; Objlist_Entry *entry; Obj_Entry *last_interposer, *obj, *preload_tail; const Elf_Phdr *phdr; @@ -663,7 +663,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) dbg("move aux from %p to %p", auxpf, aux); /* XXXKIB insert place for AT_EXECPATH if not present */ for (;; auxp++, auxpf++) { - *auxp = *auxpf; + /* + * NB: Use a temporary since *auxpf and + * *auxp overlap if rtld_argc is 1 + */ + auxtmp = *auxpf; + *auxp = auxtmp; if (auxp->a_type == AT_NULL) break; } From nobody Mon Dec 15 17:00:27 2025 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 4dVRC01qBTz6L1mR for ; Mon, 15 Dec 2025 17:00:28 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBz4mH5z3pmN for ; Mon, 15 Dec 2025 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818027; 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=mXOBA6tCluzWWo7jWY4ajQl0WMKZctTWgmaS5LuZaDM=; b=dE2jIn1tZufB81YnLe/u+jHjJOuLWeIyyxa6x54y8q6D/g6HM9AZvnt3o183Mgv7Pt28FJ r9BRRpGBIO7D2sCJHgos/GB58cfHwciy148VqTlCyERdOUJdMceM4V3+1Q7zSJ2JdO6nu6 bE3i4NygL9CqvmC7YAa/IHp8G/0QveKYQhuogKKLtSRWwvur/uVwqGtENdQlutvclL9Dxk 9wqap6W5s4LmxoVkfG1lMwSYDeJbGxkfbmVB2PUcV/bbienC2illKuU8x/qdZDTrlxHI2o sVx3IBhn3eqd+T4yjlByu70mX4a0joXoRoQWLpGwKFk+HO/s8qCr5vK3UJB6hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818027; 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=mXOBA6tCluzWWo7jWY4ajQl0WMKZctTWgmaS5LuZaDM=; b=D7byhFjPBaZzGSsORLz/FJKFpecRzM1uAsm4cElwQAlxKEKd1yLZdFNOckq38n6oUJmVZB T3UYlnZOVl3WCTm4qq4+OqNlFF5tZRUYp8XovwqUiJomw+LDaz//EQa39G1XtMMeZnr4Xk AhE2p2EW+WdLCZXbjy1iVMuYQ7LwrnNmIFf4Bzh3K43/o05uXoRUw+a+iSm0AEVksIuEIX iwNhxAFMczuNqmUQjQn7hXUE9HfkzeSq6SO68SjsoUoiLGbfw5HBbkca5rf9h1m5T4QoyD cuavpnaVinkHSUmhrC27AFnhrx7cB/JmHALllOP3HnAGWybsRzNv4EltLpkx2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818027; a=rsa-sha256; cv=none; b=ZMVfaJXdPXIUA5ZsPHb08oK11D/VFJNYBCzFxedhC3JhsiasUFUFAYMjFhzP6Mh1GIMB3l f2U4oRHS/m9ZKhonUAMd5wmEKqHxGRifviDwgTRZ2ZGrD+rbkWOUuz8ASaM8f1xuAX/EU9 fEBJpKwM4pdi7Fp6IKoQXZRwtmjIPCIoJp8Xvj2m6uMLYgq+mRRsBOCuDXGoEShjkB8aG6 AdJW4KlcUHXtS2dUe/R3ebSVfewc6wAP9351TC+nVeH/FZqXOWZKzarCk9pnd9uDylZie1 A0hejhM7Nen5bjzSUlu5BJMR3AvlQDQ00LClOetR5PTmDMoLot2X3bFXFF44XQ== 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 4dVRBz4JspzClP for ; Mon, 15 Dec 2025 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e419 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: acf47e5d105e - stable/14 - rtld-elf/riscv: Don't allocate static TLS for dynamic TLS relocations 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: acf47e5d105ef05ea25b635672417a294a933e13 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:27 +0000 Message-Id: <69403eab.e419.5d04c434@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=acf47e5d105ef05ea25b635672417a294a933e13 commit acf47e5d105ef05ea25b635672417a294a933e13 Author: Jessica Clarke AuthorDate: 2025-05-28 20:22:15 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 rtld-elf/riscv: Don't allocate static TLS for dynamic TLS relocations Provided you don't run out of extra static TLS space this should work, but it's wholly unnecessary and not how things are supposed to be done. Only static TLS relocations should allocate static TLS. Reviewed by: kib Fixes: 4b1859c0e943 ("Add support for RISC-V architecture.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50563 (cherry picked from commit 03801d449a3731cb643a51625c8c4d5d07b2e54c) --- libexec/rtld-elf/riscv/reloc.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 8dd225e5a920..03d3c2d0c9ba 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -405,23 +405,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, lockstate); if (def == NULL) return (-1); - /* - * We lazily allocate offsets for static TLS as we - * see the first relocation that references the - * TLS block. This allows us to support (small - * amounts of) static TLS in dynamically loaded - * modules. If we run out of space, we generate an - * error. - */ - if (!defobj->tls_static) { - if (!allocate_tls_offset( - __DECONST(Obj_Entry *, defobj))) { - _rtld_error( - "%s: No space available for static " - "Thread Local Storage", obj->path); - return (-1); - } - } *where += (Elf_Addr)(def->st_value + rela->r_addend - TLS_DTV_OFFSET); From nobody Mon Dec 15 17:00:26 2025 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 4dVRBz2ZNHz6L1pZ for ; Mon, 15 Dec 2025 17:00:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRBy42C8z3prC for ; Mon, 15 Dec 2025 17:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818026; 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=X+Fjh74HDuuviWf/KzVGTbZIDJGHgg9xwMxOgSdDmXU=; b=HED0RuQRBMfPEkusJyPfHuYSQL0Q1uGx3+QjfeG+he+UpnKtKJOW29Okg1rudB/RAu3qkM YaRLRZCO1HiyM1JKBItJHDSFZYTeauaB138Bm5Pa1z0+1Ao8AGbqTdRNgpL5UI6ugqSClT niBqlL9IELV2haLmKf7bbH6W2wEHV3Ls8YvhVMBCd4lmJI4IkOsKtzWOFHo/MekFuWubYU kpmRnOYkv9XCV1IN7GFYa+Wf7ohbvRHKsfOnx24odm4mofrw2aI1HlzrOeNObSgiPHkcfG e4UcW0AA0PJvo9gLrEZQ75+sAfGlxmIFdQm9p1rb4IpfgxqgydPGtidx/R7M7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818026; 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=X+Fjh74HDuuviWf/KzVGTbZIDJGHgg9xwMxOgSdDmXU=; b=C4h8sYR8JV8URC2wrxfVsfWCzOcRAx+KY5hGo+0akSzYg2H2edMBSpd0uTJBPbqajVOZJz xsf/jHd+kOhK5I7p2GwuCF26mS13A4/Hb9VSDl1KWhiTTC+zUA3DwdVkJpaYwcsuTt57g/ rvfMvwQzQqXYo5tDFOyBD/keRnoXVsPmx4gMQXq54de/EigUH0lv7oxtkcgyqxcnArYZVE 6iD6ZAfzpqLwdwDk1836XvfNHJeHKUPPMxpBSIB8jWx7Fvpr02VMGSLvfQlG24fFIaeT93 cfyTs5i76faE0AlJCST3QknHiBO6Y938Chk9ogfajnMzQuzIuW/gWFRivm7ieA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818026; a=rsa-sha256; cv=none; b=JjahEah8YaWm6Bs0wC13o9kH5aepL2zU5f61jNcThusz/11IM32sb6cSIDT4dB3JfY69dE vRb/hjHy+x5H7DRLbSV0JluUIAzqYfhikmPLMAPxmJu13IxLpGBX9r18wsYPK4k4QkYNMR NbncXra64vPD0VBaH9QYmu4z2v9Yai8nRjOkqsHNsK2ATifjK25cpUey/dwkhU726qt2vc 13ElqZzqwt60BYSA/nJsyAOrdGGs1i1YeaaPne94G9nYTka77KwET2iu3+f7Wnf0Rm8gNR el9YxTNb3K5vNn2/AcGehAdH1Q7gnYgI9ymqHfbOTKQSOdIoNYdZ5LLveyyTMw== 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 4dVRBy3TtWzCkn for ; Mon, 15 Dec 2025 17:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e4d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 8e8ae9ac48cc - stable/14 - rtld-elf: Fix executable's TLS module index for direct exec 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e8ae9ac48cc59615dd83d2b5fe1368036ff8808 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:26 +0000 Message-Id: <69403eaa.e4d6.12a41f65@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8ae9ac48cc59615dd83d2b5fe1368036ff8808 commit 8e8ae9ac48cc59615dd83d2b5fe1368036ff8808 Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:44 +0000 rtld-elf: Fix executable's TLS module index for direct exec For direct exec mode we reuse map_object, but tls_max_index is initialised to 1. As a result, the executable ends up being assigned module 2 (and the generation is pointlessly incremented, unlike in digest_phdr for the normal case). For most architectures this is harmless, since TLS linker relaxation will optimise General Dynamic accesses to Initial Exec or Local Exec for executables, but on RISC-V this relaxation does not exist, yet the linker will initialise the tls_index in the GOT with module 1, and at run time the call to __tls_get_addr will fail with: ld-elf.so.1: Can't find module with TLS index 1 Fix this by making map_object use 1 for obj->tlsindex when it's loading the main executable, and don't bother to increment tls_dtv_generation either, matching digest_phdr (though that one is harmless). (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: 0fc65b0ab82c ("Make ld-elf.so.1 directly executable.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50186 (cherry picked from commit a08d92def20a41243d4afc97cf4a2124be5386b9) --- libexec/rtld-elf/map_object.c | 10 +++++++--- libexec/rtld-elf/rtld.c | 4 ++-- libexec/rtld-elf/rtld.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 06be8c02137e..d8583cb67e5a 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -60,7 +60,7 @@ phdr_in_zero_page(const Elf_Ehdr *hdr) * for the shared object. Returns NULL on failure. */ Obj_Entry * -map_object(int fd, const char *path, const struct stat *sb) +map_object(int fd, const char *path, const struct stat *sb, bool ismain) { Obj_Entry *obj; Elf_Ehdr *hdr; @@ -314,8 +314,12 @@ map_object(int fd, const char *path, const struct stat *sb) if (phinterp != NULL) obj->interp = (const char *)(obj->relocbase + phinterp->p_vaddr); if (phtls != NULL) { - tls_dtv_generation++; - obj->tlsindex = ++tls_max_index; + if (ismain) + obj->tlsindex = 1; + else { + tls_dtv_generation++; + obj->tlsindex = ++tls_max_index; + } obj->tlssize = phtls->p_memsz; obj->tlsalign = phtls->p_align; obj->tlspoffset = phtls->p_offset; diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1a5cb0a6fce9..a7fdc153eca8 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -765,7 +765,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) */ if (fd != -1) { /* Load the main program. */ dbg("loading main program"); - obj_main = map_object(fd, argv0, NULL); + obj_main = map_object(fd, argv0, NULL, true); close(fd); if (obj_main == NULL) rtld_die(); @@ -2897,7 +2897,7 @@ do_load_object(int fd, const char *name, char *path, struct stat *sbp, } dbg("loading \"%s\"", printable_path(path)); - obj = map_object(fd, printable_path(path), sbp); + obj = map_object(fd, printable_path(path), sbp, false); if (obj == NULL) return (NULL); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 527ecf9d84e7..b51bbb427a79 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -390,7 +390,7 @@ enum { void _rtld_error(const char *, ...) __printflike(1, 2) __exported; void rtld_die(void) __dead2; const char *rtld_strerror(int); -Obj_Entry *map_object(int, const char *, const struct stat *); +Obj_Entry *map_object(int, const char *, const struct stat *, bool); void *xcalloc(size_t, size_t); void *xmalloc(size_t); char *xstrdup(const char *); From nobody Mon Dec 15 17:00:29 2025 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 4dVRC22nblz6L1sg for ; Mon, 15 Dec 2025 17:00:30 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC16YS6z3pxX for ; Mon, 15 Dec 2025 17:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818030; 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=3+TTTOwSONQc19pwOWuah1r+MxSxCe9vz0dK8cAeePo=; b=iiszouTAuP5NsU2rl9Fc2kOIzEJGmHjRHVghl2U7GBk9xE1ybE9vFUgWh8vjmIhss1xU4+ X1B1gdBCs72JdKCiMkXZcqsdx98zoDN7eAC8rv167PBSfzw7VQH9jbtg4HlFwqLkbx78ng BRbYh4OTcHR9t+A2orot6wwLIsrOUekwqz3Ww7DTpUxSdK+xJIxkzlj5H+sUhdoOLys5Jw Q9itSv7b7KQuHuOpTyAla0BO611bjKLLZ7liJ6ztSyjl5B5VaapTmrAE1CsWpahC43kPoJ 4fTbV6pBxV8sw022cmHNUHbRUEnU0uqlUEph7aFr1TsdeauW1kv86KK1IYrjcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818029; 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=3+TTTOwSONQc19pwOWuah1r+MxSxCe9vz0dK8cAeePo=; b=WnfRjSJfsMsDy48UTvAEI+ZEUgHEZUzGzni0Hn8HkDQLQR09qCCE1ckOzMYyUxW/O9xRhc DU0j42hul8xKFZTYgj3yNmoYQWqH4kouF2v9C+yWB400mVGbEFgPoNeu6JHeRX4uA6cKDz vCoS3LR91suKdsz6oateXAummJGdV3nbQjQ0WQ7KfYTSQmm46am0F8xJyFT9Y3KUy48Uh0 bNXorOWHLh2KeBMRISnJPmmbFkkq0VdQ/Ja1BLa/nyLG9gRemd7rVPyVuGwuAx+2FS9Rbn vzhaTxFWIagc4r7jMoztMRPXPfel3/Brr1wRhUTWPA1SqMZpUNU2n06ANv68vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818029; a=rsa-sha256; cv=none; b=hg40bug2nI3LPK8+SHSSHswh2w/WwthgSwpB6nhTlydSP0wK6nHCQf0oCp2ULT/O+AiX/T oS4w7dgi2FyKWx7AC2w0hOkaLD/sfKGnHHVC6cDPI1AxwX0CgU/VojKmITLuJHBkMKD16Y +993NQGEKOJIDbAYFMQZJZJK5WCD8gTEaeeJxAFVKl70tntPmf/7DAxGhePTng6fnVY8Bn VyrjOyPHs46XaEpe7qGSYelDObgLGXGDC4FcAjhdpxSbXnuRr+biBfyG8cMnhUmswjyMZi g4W3sRw8C7dNmjTNRaRwGaGma+KLQ5ycXt38qxXsR4cvZ4WM9ir7CdmEO55F6w== 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 4dVRC15yJHzCWG for ; Mon, 15 Dec 2025 17:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e540 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 02cb2f8094ba - stable/14 - Revert "rtld: fix allocate_module_tls() variant I fallback to static allocation" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 02cb2f8094baab0b4299e5fcd1694d9193be14b3 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:29 +0000 Message-Id: <69403ead.e540.47a2d651@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=02cb2f8094baab0b4299e5fcd1694d9193be14b3 commit 02cb2f8094baab0b4299e5fcd1694d9193be14b3 Author: Jessica Clarke AuthorDate: 2025-05-28 20:24:52 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 Revert "rtld: fix allocate_module_tls() variant I fallback to static allocation" This was applying a NetBSD fix to FreeBSD. However, the original code was correct for FreeBSD. NetBSD's obj->tlsoffset is relative to the end of the TCB, not the TCB itself, whilst ours is relative to the TCB[1] itself. For example, our allocate_tls uses (char *)tcb + obj->tlsoffset for the memcpy and memset calls. Without this reverted, for dynamically loaded shared objects, Initial Exec accesses to TLS variables on variant I architectures (non-x86) use the correct address, whilst General Dynamic and dlsym(3) use the incorrect address (TLS_TCB_SIZE past the start). Note that, on arm64, LLVM only supports TLSDESC (including LLD) and TLSDESC will use the static resolver if the variable ends up allocated to the static TLS block, even in the presence of dlopen(3), so only dlsym(3) shows the discrepancy there. Whilst here, add a comment to explain this difference to try and avoid the same mistake being made in future. [1] In the case of variant II, it's the amount to subtract, so still positive This reverts commit e9a38ed2fa61fd264a80f24ceb35f39b0ac6463d. Reviewed by: kib (prior version) Fixes: e9a38ed2fa61 ("rtld: fix allocate_module_tls() variant I fallback to static allocation") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50565 (cherry picked from commit ccfb1c50e45dbb7fcadf7e1932f63cf1702ef13a) --- libexec/rtld-elf/rtld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a7fdc153eca8..5117448a0d28 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5378,6 +5378,9 @@ get_tls_block_ptr(void *tcb, size_t tcbsize) * it is based on tls_last_offset, and TLS offsets here are really TCB * offsets, whereas libc's tls_static_space is just the executable's static * TLS segment. + * + * NB: This differs from NetBSD's ld.elf_so, where TLS offsets are relative to + * the end of the TCB. */ void * allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) @@ -5612,7 +5615,7 @@ allocate_module_tls(int index) if (obj->tls_static) { #ifdef TLS_VARIANT_I - p = (char *)_tcb_get() + obj->tlsoffset + TLS_TCB_SIZE; + p = (char *)_tcb_get() + obj->tlsoffset; #else p = (char *)_tcb_get() - obj->tlsoffset; #endif From nobody Mon Dec 15 17:00:28 2025 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 4dVRC12m5Dz6L1l5 for ; Mon, 15 Dec 2025 17:00:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC05Zbtz3pty for ; Mon, 15 Dec 2025 17:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818028; 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=HgrYFK2Xs2w4LUEr7yft8tPGCqvuSgCwZ8gB0/bkEAA=; b=erf267T8P16mfx4/t+hHBFF64P2NLWBO5OjGuKDwEqVxADn80ocS86XYNIWlmUVfqk+qSW ob1e9QNcKnVzRK49xH1lZIguz8W9b219TUaS4Fkhg5vZ1vHD/EsEG4O2FStU17sJWa6ehO I45TWTOVA/INuAzhqu+OxtFUu33A/1OzxMtpMfOse60jy0l1wLwvFYZwOHjGzy/abwcsPq MXRR0pLHte9lA7DhHWGU2JP/pc3/1NJWMn5Ff8/k2a20DlLKngbYxoptJfkaZPvBna3rWP ba/Jv3cmmoFOWId31UyU1DCH4ZNsXJjspsH3zFcJFz56EmzPe5bhQXxxdScsTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818028; 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=HgrYFK2Xs2w4LUEr7yft8tPGCqvuSgCwZ8gB0/bkEAA=; b=LvHWOv2l4aF0LBkpeXHm0EhWKTufEpM+sfNXaHOiaLaeL77l+VHpxukDeSCOwQ236YwF5y 2y/tXTdx/2OIFdELzug7EIMULp0cWa7QyNcH93KF8Z0uUMWnm6pzl/d5bKdp+jp2Bp7HlE tjXxafkPwM457nRSOfETEbDZEZzf6iDARe1XJvDa6jxoDL6yBIastWhIf6jSr3bDr5uVqV dgUSrWWhnOYd3WTeQ4Kjzt/8/ctrbZie9KpMzILA/NA/Ujk0fPCh5vByWy03NfAsCw/Urv a/JjMw4wS/vpQfDDPANkpYetEWZe7juXn4XGe2UYoMw8QQXLVrLXQdRLhyn4Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818028; a=rsa-sha256; cv=none; b=RSlO0ZmDfMt3kgHGTYOdxdEDTMKKRaAzaAsB/Thp/sdGT6zigyVmfvRQxPClH1mXBDpmpd ZU9g1wdTlIUI4IlyjzCimfzKMv+gy9SrKUotvuNP4bMkchQEu1decQCBsTQrpTma10w2Ww YcSea4XiWlWx1BtQ7gsdNCyoYI9rRUwDa1kYhhyG6WwI+cVvoy/W/V4FnNXICEbtveXqWG Z11ET3TDd63bM76J46rSi28kPB7JrCYJ8CnUvrFo9bN9NzRbxA9b4M74fws61pelPa6xzH w4lxKC8DiHZAKbUybHSwt5+x7oMqzH429BqwKrjuveJtSPsGN8zaXBUcGdeyfg== 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 4dVRC0575lzCWF for ; Mon, 15 Dec 2025 17:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id de25 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d07b82ecbe64 - stable/14 - libc/riscv: Fix initial exec TLS mode for dynamically loaded shared objects 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d07b82ecbe64e29668b457019081846518c0e4b5 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:28 +0000 Message-Id: <69403eac.de25.29fbfe77@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d07b82ecbe64e29668b457019081846518c0e4b5 commit d07b82ecbe64e29668b457019081846518c0e4b5 Author: Jessica Clarke AuthorDate: 2025-05-28 20:23:10 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 libc/riscv: Fix initial exec TLS mode for dynamically loaded shared objects The offset here is relative to the TCB, not whatever the thread pointer points to, so as with powerpc and powerpc64 we need to account for that. However, rather than using hard-coded offsets as they did, due to predating machine/tls.h, we can just re-use _tcb_get(). Note that if libthr is used, and its initialiser has been called, it will take a different path that uses _get_static_tls_base, which works just fine on riscv (adding the offset to thr->tcb). This only affects programs that aren't linked against libthr (or that are but manage to dlopen before the initialiser is called, if that's even possible). In future this code should be made MI by just reusing _tcb_get() and checking the TLS variant (since the offset here is positive even for variant II, where it should be subtracted), but this is a targeted fix that makes it clear what's changing. Reviewed by: kib Fixes: 5d00c5a6571c ("Fix initial exec TLS mode for dynamically loaded shared objects.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50564 (cherry picked from commit 0e3dbc64d9f6c95cbb16dba60a32136ae116dada) --- lib/libc/riscv/static_tls.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libc/riscv/static_tls.h b/lib/libc/riscv/static_tls.h index ce9fa23338a6..40e9abd685e3 100644 --- a/lib/libc/riscv/static_tls.h +++ b/lib/libc/riscv/static_tls.h @@ -31,12 +31,14 @@ #ifndef _LIBC_RISCV_STATIC_TLS_H #define _LIBC_RISCV_STATIC_TLS_H +#include + static __inline uintptr_t _libc_get_static_tls_base(size_t offset) { uintptr_t tlsbase; - __asm __volatile("mv %0, tp" : "=r"(tlsbase)); + tlsbase = (uintptr_t)_tcb_get(); tlsbase += offset; return (tlsbase); } From nobody Mon Dec 15 17:00:30 2025 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 4dVRC35RMYz6L1bk for ; Mon, 15 Dec 2025 17:00:31 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC30GTPz3pmv for ; Mon, 15 Dec 2025 17:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818031; 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=Hg5jw5iJPOldTpYKPtpSUnulBwIHCt2x2FcAKdqxmto=; b=MRcP55ZEGMGOLyJNy6tfazFnc87Uajl1+MitG7xLaTjwR6mE1T7DrwXmRUcO+WG3Sd4gDz mNvAYEKFV2poWRVDBu62BROolC0lgB/vXjQDVW+erGbAAXyib597PdyMd6qDpr8zeW7ce8 VylLiPQKoi43H34Zznu2fJKspXIlwk2bcuIRNdm9xzYKTNAvPaUrUJk65SZstJ6HQ6SrDz Eh4AmRlEJcHKE6BejIMMFCG4bR0ed1GuncMXXcHrcOk85cNfHDzuGVBEoOy131I4MfF2Rk H9iz9PlKvEyhlHc4jueLev64TTzevkNPFqid+EZZ3PJg0vNi6A++3PpUioJM1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818031; 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=Hg5jw5iJPOldTpYKPtpSUnulBwIHCt2x2FcAKdqxmto=; b=F1laTomaHc4gfQLr0aU+IrefilZvck/zAsc3PtbODU2ay1N9hqg5UrOC6lxnp+rh4G1tt3 DZU7nwUzcwbbq/I7GJ18mT6SzHaFVZoLNXgRV2DzgzGomaDMpIcy5c9mOPUJRaBIzmnUd6 JWk8n0q+LlClLioPYNRIdvLCp2OAnZRh7bRy661lFa/Fjrt4S/wAoKMSsc9WsXU2DtQ3G1 atSLa4XYml8ZO4nL9mU9aPzGxsEZaCiKayITJ/+iL1eADcKQ8cLtmSx9lTJI8j+A4cjss+ fw/jiWcl2DI4AK9zaZM0wzylPXI4BlzGjZNb0tNpWOlWOAicW3wxhqDC7R/8Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818031; a=rsa-sha256; cv=none; b=y3AWchctxKsbzZ+0JG/D++hLqmTqAkrdsNgdRhY2aOAUgXk3CpwkQShSsZJWGC+GfSrQZy /SUY/fUMzWZUF9vvHl7FzoCE3mC90j8i77VMkOH1cd05bBpYlW6qOb4bG87lmuzLeg4xlG MDqGxLVVfMxZq6j7BiKfNXzzq68xWq0jf+R4YiFhntsW2aZhaUsqpPSXdI5uPfvGUxT0kE 8GX/uV9yPKjbqE+fBacvpYt8R64DWtr2b1D/JrCN0PXtolykXYjfYqmlsDLKcsFRN74246 x0BL2833PoX5R+yzn9TnYjUJDIb/O1e+B2fpqS+sP3JYFgqSEJkLnQBw6BYDqg== 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 4dVRC26wC2zCWH for ; Mon, 15 Dec 2025 17:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e90c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: dccbc59475ce - stable/14 - share: Delete bitrotted make_*_driver.sh scripts 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dccbc59475ced25a04b8bd8a58b1ceed46635857 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:30 +0000 Message-Id: <69403eae.e90c.7f70fa8b@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=dccbc59475ced25a04b8bd8a58b1ceed46635857 commit dccbc59475ced25a04b8bd8a58b1ceed46635857 Author: Jessica Clarke AuthorDate: 2025-07-10 19:36:08 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 share: Delete bitrotted make_*_driver.sh scripts These scripts have not seen the necessary changes to keep them up to date with current KPIs and coding practices. They use I/O ports directly rather than any bus abstractions, use i386 (which is on the way out for kernel configs) as the architecture of choice for generated kernel configs, use ISA KPIs, use INTR_TYPE_FAST (renamed in 2000 to INTR_FAST and removed in 2011), and likely have other issues too that render them more harm than good for the uninitiated developer looking for a driver template. If anyone wants to invest time in modernising them they can do so and bring them back, but for now delete them. Reviewed by: cperciva, imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50468 (cherry picked from commit 8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf) --- ObsoleteFiles.inc | 6 + share/examples/Makefile | 7 - share/examples/drivers/README | 42 --- share/examples/drivers/make_pseudo_driver.sh | 435 --------------------------- tools/build/mk/OptionalObsoleteFiles.inc | 4 - 5 files changed, 6 insertions(+), 488 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ce39d8eee2e4..ff44e9930315 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -69,6 +69,12 @@ OLD_FILES+=usr/include/machine/runq.h # 20250716: Remove an old manual page, vn(4) was removed in FreeBSD 5.0 OLD_FILES+=usr/share/man/man4/vn.4.gz +# 20250710: share: Delete bitrotted make_*_driver.sh scripts +OLD_FILES+=usr/share/examples/drivers/README +OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh +OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh +OLD_DIRS+=usr/share/examples/drivers + # 20250708: replace yaml.lua with lyaml OLD_FILES+=usr/share/flua/yaml.lua diff --git a/share/examples/Makefile b/share/examples/Makefile index d66019fc5063..9029cbad5900 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -11,7 +11,6 @@ LDIRS= BSD_daemon \ IPv6 \ bootforth \ csh \ - drivers \ etc \ find_interface \ flua \ @@ -74,12 +73,6 @@ SE_BOOTFORTH= \ SE_DIRS+= csh SE_CSH= dot.cshrc -SE_DIRS+= drivers -SE_DRIVERS= \ - README \ - make_device_driver.sh \ - make_pseudo_driver.sh - SE_DIRS+= etc SE_ETC= \ README.examples \ diff --git a/share/examples/drivers/README b/share/examples/drivers/README deleted file mode 100644 index 8628029a62f8..000000000000 --- a/share/examples/drivers/README +++ /dev/null @@ -1,42 +0,0 @@ - -Author: Julian Elischer - -The files in this directory are shell scripts. - -They will, when run, create an example skeleton driver -for you. You can use this driver as a starting point for -writing drivers for your own devices. They have all the hooks needed -for initialization, probing, attaching, as well as DEVFS -node creation. They also create sample ioctl commands and a sample -ioctl definition .h file in /sys/sys. In other words they are fully -functional in a 'skeleton' sort of a way. They support multiple devices -so that you may have several of your 'foobar' devices probed and attached -at once. - -I expect that these scripts will improve with time. - -At present these scripts also link the newly created driver into -the kernel sources in /sys. Possibly a better way would be -to make them interactive. (and ask what kernel tree to use as well as -a name for the driver.). - -There are presently two scripts. -One for making a real device driver for ISA devices, and -one for making a device driver for pseudo devices (e.g. /dev/null). -Hopefully they will be joined by similar scripts for creating -skeletons for PCI devices as well. - -Give them a single argument: the name of the driver. -They will use this given name in many places within the driver, -both in lower and upper case form. (conforming to normal usage). - -The skeleton driver should already link with the kernel -and in fact the shell script will compile a kernel with the new -drive linked in.. The new kernel should still be -runnable and the new driver should be -fully callable (once you get your device to probe). -You should simply edit the driver and continue to use -'make' (as done in the script) until your driver does what you want. - -The driver will end up in /sys/i386/isa for the device driver script, -and in /sys/dev for the pseudo driver script. diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh deleted file mode 100644 index 5d6d09aa9648..000000000000 --- a/share/examples/drivers/make_pseudo_driver.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/sh -# This writes a skeleton driver and puts it into the kernel tree for you -# -# arg1 is lowercase "foo" -# arg2 path to the kernel sources, "/sys" if omitted -# -# Trust me, RUN THIS SCRIPT :) -# -# -#-------cut here------------------ - -if [ "${1}X" = "X" ] -then - echo "Hey , how about some help here.. give me a device name!" - exit 1 -fi -if [ "X${2}" = "X" ]; then - TOP=`cd /sys; pwd -P` - echo "Using ${TOP} as the path to the kernel sources!" -else - TOP=${2} -fi - -for i in "" "conf" "i386" "i386/conf" "dev" "sys" "modules" -do - if [ -d ${TOP}/${i} ] - then - continue - fi - echo "${TOP}/${i}: no such directory." - echo "Please, correct the error and try again." - exit 1 -done - -UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"` - -if [ -d ${TOP}/modules/${1} ]; then - echo "There appears to already be a module called ${1}" - echo -n "Should it be overwritten? [Y]" - read VAL - if [ "-z" "$VAL" ]; then - VAL=YES - fi - case ${VAL} in - [yY]*) - echo "Cleaning up from prior runs" - rm -rf ${TOP}/dev/${1} - rm -rf ${TOP}/modules/${1} - rm ${TOP}/conf/files.${UPPER} - rm ${TOP}/i386/conf/${UPPER} - rm ${TOP}/sys/${1}io.h - ;; - *) - exit 1 - ;; - esac -fi - -echo "The following files will be created:" -echo ${TOP}/modules/${1} -echo ${TOP}/conf/files.${UPPER} -echo ${TOP}/i386/conf/${UPPER} -echo ${TOP}/dev/${1} -echo ${TOP}/dev/${1}/${1}.c -echo ${TOP}/sys/${1}io.h -echo ${TOP}/modules/${1} -echo ${TOP}/modules/${1}/Makefile - -mkdir ${TOP}/modules/${1} - -cat >${TOP}/conf/files.${UPPER} <${TOP}/i386/conf/${UPPER} <${TOP}/dev/${1}/${1}.c < -#include -#include /* SYSINIT stuff */ -#include /* SYSINIT stuff */ -#include /* cdevsw stuff */ -#include /* malloc region definitions */ -#include -#include /* ${1} IOCTL definitions */ - -#include /* DELAY() */ - -#define N${UPPER} 3 /* defines number of instances */ - -/* XXX These should be defined in terms of bus-space ops. */ -#define ${UPPER}_INB(port) inb(port) -#define ${UPPER}_OUTB(port, val) (port, (val)) - -/* Function prototypes (these should all be static) */ -static d_open_t ${1}open; -static d_close_t ${1}close; -static d_read_t ${1}read; -static d_write_t ${1}write; -static d_ioctl_t ${1}ioctl; -static d_mmap_t ${1}mmap; -static d_poll_t ${1}poll; - -#define CDEV_MAJOR 20 -static struct cdevsw ${1}_cdevsw = { - .d_version = D_VERSION, - .d_open = ${1}open, - .d_close = ${1}close, - .d_read = ${1}read, - .d_write = ${1}write, - .d_ioctl = ${1}ioctl, - .d_poll = ${1}poll, - .d_mmap = ${1}mmap, - .d_name = "${1}", -}; - -/* - * device specific Misc defines - */ -#define BUFFERSIZE 1024 -#define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */ - -/* - * One of these per allocated device - */ -struct ${1}_softc { - u_long iobase; - char buffer[BUFFERSIZE]; - struct cdev *dev; -}; - -typedef struct ${1}_softc *sc_p; - -static sc_p sca[N${UPPER}]; - -/* - * Macro to check that the unit number is valid - * Often this isn't needed as once the open() is performed, - * the unit number is pretty much safe.. The exception would be if we - * implemented devices that could "go away". in which case all these routines - * would be wise to check the number, DIAGNOSTIC or not. - */ -#define CHECKUNIT(RETVAL) \ -do { /* the do-while is a safe way to do this grouping */ \ - if (unit > N${UPPER}) { \ - printf("%s: bad unit %d\n", __func__, unit); \ - return (RETVAL); \ - } \ - if (scp == NULL) { \ - printf("%s: unit %d not attached\n", __func__, unit); \ - return (RETVAL); \ - } \ -} while (0) - -#ifdef DIAGNOSTIC -#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL) -#else /* DIAGNOSTIC */ -#define CHECKUNIT_DIAG(RETVAL) -#endif /* DIAGNOSTIC */ - -static int -${1}ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - switch (cmd) { - case DHIOCRESET: - /* whatever resets it */ - (void)scp; /* Delete this line after using scp. */ -#if 0 - ${UPPER}_OUTB(scp->iobase, 0xff); -#endif - break; - default: - return ENXIO; - } - return (0); -} - -/* - * You also need read, write, open, close routines. - * This should get you started - */ -static int -${1}open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}read(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int toread; - - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * read from buffer - */ - toread = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, toread, uio)); -} - -static int -${1}write(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int towrite; - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * write to buffer - */ - towrite = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, towrite, uio)); -} - -static int -${1}mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(-1); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ -#if 0 /* if we had a frame buffer or whatever.. do this */ - if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) { - return (-1); - } - return i386_btop((FRAMEBASE + offset)); -#else - return (-1); -#endif -} - -static int -${1}poll(struct cdev *dev, int which, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); /* this is the wrong value I'm sure */ -} - -/* - * Now for some driver initialisation. - * Occurs ONCE during boot (very early). - */ -static void -${1}_drvinit(void *unused) -{ - int unit; - sc_p scp; - - for (unit = 0; unit < N${UPPER}; unit++) { - /* - * Allocate storage for this instance . - */ - scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT | M_ZERO); - if( scp == NULL) { - printf("${1}%d failed to allocate strorage\n", unit); - return; - } - sca[unit] = scp; - scp->dev = make_dev(&${1}_cdevsw, unit, - UID_ROOT, GID_KMEM, 0640, "${1}%d", unit); - } -} - -SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR, - ${1}_drvinit, NULL); -DONE - -cat >${TOP}/sys/${1}io.h < -#endif -#include - -/* - * define an ioctl here - */ -#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */ -#endif -DONE - -if [ ! -d ${TOP}/modules/${1} ]; then - mkdir -p ${TOP}/modules/${1} -fi - -cat >${TOP}/modules/${1}/Makefile < -DONE - -echo -n "Do you want to build the '${1}' module? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - (cd ${TOP}/modules/${1}; make depend; make ) - ;; -*) -# exit - ;; -esac - -echo "" -echo -n "Do you want to build the '${UPPER}' kernel? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - ( - cd ${TOP}/i386/conf; \ - config ${UPPER}; \ - cd ${TOP}/i386/compile/${UPPER}; \ - make depend; \ - make; \ - ) - ;; -*) -# exit - ;; -esac - -#--------------end of script--------------- -# -#edit to your taste.. -# -# diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5b49c713182a..e7e723916296 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1696,9 +1696,6 @@ OLD_FILES+=usr/share/examples/diskless/README.BOOTP OLD_FILES+=usr/share/examples/diskless/README.TEMPLATING OLD_FILES+=usr/share/examples/diskless/clone_root OLD_FILES+=usr/share/examples/dma/mailer.conf -OLD_FILES+=usr/share/examples/drivers/README -OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh -OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh OLD_FILES+=usr/share/examples/dwatch/profile_template OLD_FILES+=usr/share/examples/etc/README.examples OLD_FILES+=usr/share/examples/etc/bsd-style-copyright @@ -1925,7 +1922,6 @@ OLD_DIRS+=usr/share/examples/bsdconfig OLD_DIRS+=usr/share/examples/csh OLD_DIRS+=usr/share/examples/diskless OLD_DIRS+=usr/share/examples/dma -OLD_DIRS+=usr/share/examples/drivers OLD_DIRS+=usr/share/examples/dwatch OLD_DIRS+=usr/share/examples/etc OLD_DIRS+=usr/share/examples/etc/defaults From nobody Mon Dec 15 17:00:32 2025 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 4dVRC46dkQz6L1ss for ; Mon, 15 Dec 2025 17:00:32 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC41LLWz3pvj for ; Mon, 15 Dec 2025 17:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818032; 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=Dlsk5pzyeHUfSG0yPyY3ucPdjiOB6sOKUrqyHdD25vU=; b=LQ1O00YEkg1mW23rlvEkPDNAHsCuMLzaJP+7Cb/Hw2qby0gFaTW4u2RznCiYjUDJfz59vo tM7uZ01mJQFvEB+lzhuF6raUi4NZBqUxHl4aSA8Z+qTeiCjxksH6N87CxRpahdVvfu0+SR BP6njFtRd1TDQRlcQSEOXzwF5XINnooN6LnFCGtJsyLmbBaCAANP6JGmnNGe+imCKcZdQL zYKtiat2MUAYP89VFLLwe64a8cdkfl8qZjgQY2EeJlQXo4k/olggFC7uDvLK0YPxc188vl HIshocesYzMImqPb+CSg/1N75hxTRdCjnmLnmRdAvtayW4cuH0SHlq7oASdg7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818032; 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=Dlsk5pzyeHUfSG0yPyY3ucPdjiOB6sOKUrqyHdD25vU=; b=fUw5F110LRnOABDVm36UH2GuCtRwn78ObVYxU6dj0W9XiIqxMeagirHE3e6eRV2D7/bhOl PqZq9wqDoSss3hlP4+512KvpyaxuZgRZ6ryLSkrGyGUNrHUHXYxMbOFtval5Iy3fejbukQ +ryzrmVdHFkWQYbt3uUSonY0vlNQm5LCqDy3Fdumd8Utjp5aUAAmyOi7OKXX18C2CcnqB3 S1mc3QIBsMpXTXXjEHoG2/q1H31wHXG9NljYBz5b6H0u/9F2pmFtkhgSeU4HWm/nCND7V/ BsdRvHCcDfxf8QuBLmlkZq8OVbUG+qzTWJtw9YI3R5kTJ+b8vuZ3dtjbiT7X6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818032; a=rsa-sha256; cv=none; b=fywoero37KxlQiCc78/y7Zt6pOrfVPW7ini1hLoMZQVhqydr3En6Su5LkbthFWJxlRSUM8 DTX9hgowS25XJFrD9/2fZQMeihWCoMlI9JBDACNKn60NX2Te+fRYOIglZ4dCYyLAtBL+0a Ikj2FWi4h3/EBcQJGEcK9RkbeIRuWX4Ql/FR1HsPFCPPrTeUBBNAa+Xbep5jxnUGZ8jgWy xU3cT5IHmUJDWkkW6G/Jp31L9u0vqBEWbmSKe9CoDlNfjVfG1r5wlzC76cpWO4Rq25VH0C I142MUeF1Tkm1zQh2NKqqKxSlentixDaHt5NKGHkmO3vg+L2pTPU+85J3IPWKQ== 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 4dVRC40cyHzCtf for ; Mon, 15 Dec 2025 17:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e4da by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d13a8521247f - stable/14 - sys: Delete stale comments in sys/elf_common.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d13a8521247f10deb80cff652053fd74ebd9878b Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:32 +0000 Message-Id: <69403eb0.e4da.29eda079@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d13a8521247f10deb80cff652053fd74ebd9878b commit d13a8521247f10deb80cff652053fd74ebd9878b Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 sys: Delete stale comments in sys/elf_common.h Originally the relocations for RISC-V were partitioned into dynamic and static (with those that are both being classed as dynamic), but they were packed next to each other, and so as new relocations were added they were allocated sequentially, at the end of the static block, even if really dynamic, R_RISCV_IRELATIVE being the first such case (and only one we currently have a definition for). Delete the misleading comments. Fixes: 4b88ccbc79cc ("Sync relocation definitions") MFC after: 1 week (cherry picked from commit d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c) --- sys/sys/elf_common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 0b5a91019c70..6436490a6c07 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1329,7 +1329,6 @@ typedef struct { * RISC-V relocation types. */ -/* Relocation types used by the dynamic linker. */ #define R_RISCV_NONE 0 #define R_RISCV_32 1 #define R_RISCV_64 2 @@ -1342,8 +1341,6 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 - -/* Relocation types not used by the dynamic linker. */ #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 From nobody Mon Dec 15 17:00:33 2025 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 4dVRC558nXz6L1h3 for ; Mon, 15 Dec 2025 17:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC51Qmpz3phH for ; Mon, 15 Dec 2025 17:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818033; 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=6Q6p3IbobMbZo4ZvMgMgC2s8cLyGI92lhCa1wAbQ+48=; b=Agv5SMWkozlyujc6DXz7QOVRfuKt4z3MUiof4/NGe2W7be0yUUGBMd3efCGXblzH39xiEX PnuF7rrjmavpWG+mXUwFuJcIyskZrfaed0ZdYxdP06aPHbKJvThAa4rdG6xkwSFKIhove8 TXA/+EgWfmMlqUhnemgqAZeXXmPzkEEIGd5uYGQ5r6FW4gzR2oLLZHH+1Oq0hdjDJf1zjy Se0x1aLNN/tyGqMhG+NAfcvLq89L8jQLP2hZessg+/OMO3YRm8zOKRu9ewfSJQaKeO8PYl SGyBa4IuqrI7Hp3TZpSQkYp5y9vf2BnIl7GbAUuoymnWz5GRssWdVc/AiHSfow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818033; 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=6Q6p3IbobMbZo4ZvMgMgC2s8cLyGI92lhCa1wAbQ+48=; b=fT1W1j9JmEhYyE9jstdYddcXRb4DijHqg/Njgd5TvdMZ1eiGhuG1Vs4vrJLgjSJhFOf09O FmN1K6bYAQsz6h6MsDWfSRQcYBK5kImODWP+9uitNpEWyn4zfxs56NE9A9s9P8YJVDjsLz nSHCuh7VfyXVDFjQwjMn2JEx1jKV0m+PEa/Dt/OnsmtADKKpPVl/Og/SIqOLrnO7PSJPp7 PD6um9+gG1yz6MArKr1zaoObLmocI2mkMb0maGm7z5m33jm8bCjyc1ZOiW4c8bv5zn2M2q c0PNjlivpS4GuqWnuruQnZjzfLycVLEDZ8th+vIcS2DflX0/gOTJ48Q6pRL6Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818033; a=rsa-sha256; cv=none; b=gGr17YjcHpkdvXu0niESBlwIot1m5t38FbMCp4bdb1e8xmQClnOtKXAOfIE71qwSM8c28G VJrwo/laaslr8mkyIESX508RG9hT+US1Aug4WxzyhdWXWaKGq3CEBz9w6t+x7DZJeJR9oW xXU0Jtp70epAwF9Ugnctu9O9dUtZu1KnC+EQ8gvz9YD9HJWkQtj6g1Fvz8VnQKNMlZsZXn x3NDJQ7OnuLrUU8AVQCTMwYYCnXZsuZDp/WXhAh/8DlUhDhMwHPeuGKQm/ii90ofA10hIz dB9vCsC+0sedism/3997YhKL96trXvv5DYHQDmMZDl20hHpOoL5YQLTFU/tfig== 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 4dVRC50zfKzCtg for ; Mon, 15 Dec 2025 17:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d373 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a1fed6a29cb1 - stable/14 - sys: Sync RISC-V relocations 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a1fed6a29cb1410b76d771f9699d8f26c4b01ebb Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:33 +0000 Message-Id: <69403eb1.d373.791c8156@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a1fed6a29cb1410b76d771f9699d8f26c4b01ebb commit a1fed6a29cb1410b76d771f9699d8f26c4b01ebb Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 sys: Sync RISC-V relocations MFC after: 1 week (cherry picked from commit 65bd6c7acd1fba38ce0b234d5d777a2ebad7e807) --- sys/sys/elf_common.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 6436490a6c07..5db6c14111ae 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1341,6 +1341,7 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 +#define R_RISCV_TLSDESC 12 #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 @@ -1366,10 +1367,10 @@ typedef struct { #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 +#define R_RISCV_GOT32_PCREL 41 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 -#define R_RISCV_RVC_LUI 46 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 @@ -1378,6 +1379,14 @@ typedef struct { #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 #define R_RISCV_IRELATIVE 58 +#define R_RISCV_PLT32 59 +#define R_RISCV_SET_ULEB128 60 +#define R_RISCV_SUB_ULEB128 61 +#define R_RISCV_TLSDESC_HI20 62 +#define R_RISCV_TLSDESC_LOAD_LO12 63 +#define R_RISCV_TLSDESC_ADD_LO12 64 +#define R_RISCV_TLSDESC_CALL 65 +#define R_RISCV_VENDOR 191 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From nobody Mon Dec 15 17:00:35 2025 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 4dVRC75W4Mz6L1pl for ; Mon, 15 Dec 2025 17:00:35 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC72b1Bz3pnL for ; Mon, 15 Dec 2025 17:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818035; 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=EB1Qz1/pRiC6im80Zg5iJJpi9ARN3hQkXmJGfWAAymQ=; b=M8YjyisOHqGw/E15PhNSHZPGn5UkM7p7u9M+hrvqURKTZEIDfEH0/D6IHPRkOtGUzFxzan dd+YX4EDFKVITUbngkB6a4aB2I/b3C5sra2boseYUzmEpGXs/buYPs5Fkk45NnjHX1ZuVx PCAxKwddD4LB0G0YozzjhCj9qWSc/HroWJwbwIrYTV8zwgWX6hWLG1GtwmybOPLXaubib2 w7cmhBCIBn+lhd+01hyyS2uoMKQ/CGgQ+dpsifEM+DoLXFaZN0lAv2a8jOUsKxZcJILB69 h9EKxPSO4ALSO0ZX8YvbeVhvpT1ZTYQqwAB/0VHJ0+9R3AAXzfBWUurHKl8GEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818035; 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=EB1Qz1/pRiC6im80Zg5iJJpi9ARN3hQkXmJGfWAAymQ=; b=BKh2WLHiCSeG3ldq47A1bShB3Iybk4rtuWeT2AyoBXK/aI1yopj8EualWXrQCXFB27G5Mj nyAocwRGHCQDMirSSUC/vzJcxkiJuYR/lmwjAUsakTHk7kPV94jVOF9cf9xaplZ9rkM3Cg 2fKtBz3ZICRG4dFyDAfZjhCwXioJXAs8pjxvaA+B7uCK2Caox6fSy9C7K1+YA+3vhf7YJd 9Y7jOFAAs7KwpFPpe8IJG0JeKg/QW4cXEn1WJegrLpyom8zPwYjJ9O6EkAiDk9CS8wOStr fVy55QbrdyX1W0/ZkYnzzY6L+W3A7GI0KAlWrE0VKmW+f2gFqxoldXFPcdV6bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818035; a=rsa-sha256; cv=none; b=bj10evxcz3AJE39T8QpQV2oWaKMZXsI7Uu7DxOTtEQTsOIBXENdaNK2sReOtANyubkhaAH gWcXvIaZhP2ICGNOKe6h2v553jIOZnRVHCahTt9v8tknWBAv/Ln7ahifiwGBwsDFmYy0EU 65UDhnUWP2VQq83ggjWnyAfPMYfR8ApxqEuVBZYJtq2bJjGAEkIvkReNqie0erg6A6EL7i c6pu4TgWlFNqU8LHOewi/X58i0jfMuUhraxyoSjiO01wytHJE2BT2tHq1sgXLaxyxsaQi+ P4PPDAT1xUHaO1PxpUjXBCVogUhn6j9lMrBpce/VJBovBC+cbHNEqI+nfBVjCQ== 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 4dVRC72B1xzCp0 for ; Mon, 15 Dec 2025 17:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d377 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 362eb7d34014 - stable/14 - rtld-elf: Delete unused RELOC_ALIGNED_P copies 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 362eb7d340140ba02724e275d8d5ff2e2dcdaf90 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:35 +0000 Message-Id: <69403eb3.d377.18c10398@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=362eb7d340140ba02724e275d8d5ff2e2dcdaf90 commit 362eb7d340140ba02724e275d8d5ff2e2dcdaf90 Author: Jessica Clarke AuthorDate: 2025-07-11 01:07:04 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 rtld-elf: Delete unused RELOC_ALIGNED_P copies This was copied from arm to aarch64 to riscv, but only arm uses it. MFC after: 1 week (cherry picked from commit 02d06043ba88f931f9debd5aa519fc303ca70d11) --- libexec/rtld-elf/aarch64/reloc.c | 7 ------- libexec/rtld-elf/riscv/reloc.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index c65b5dd431a0..b5f550e8bb71 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -35,13 +35,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - /* * This is not the correct prototype, but we only need it for * a function pointer to a simple asm function. diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 03d3c2d0c9ba..5542295f8811 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -41,13 +41,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - uint64_t set_gp(Obj_Entry *obj) { From nobody Mon Dec 15 17:00:34 2025 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 4dVRC66Nqxz6L1bv for ; Mon, 15 Dec 2025 17:00:34 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC61ymwz3q33 for ; Mon, 15 Dec 2025 17:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818034; 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=EkchrQ7Iam//JauKFFVmkX3QvZ2UAWCrp0ZUaeBQ0ik=; b=Fi/eLFN+IyxYxgvHyEbBcbijWfb/lDtSit7vkIrPfx7mDzkPb+TdPb4HOmW9r++d63xbjw SPP2pGYWd4vcOFBtgPBpFe/tbhEtN2Yq0+eh4ZUCpY8f0lICVgbvaLBfgyWaV8g1qM3iXo yFVae/qzGU0+G6SjjqHI+HwFbDxCPEkoJgOe3hKu5zCo1jGVREMKg2KkO/04sIa0fDwq2v N07rbhovAcQJsA+ww+WJyllkLeEoNQa/MLr46UasLw3wdlcSwU5TE/Pyz1mfyii05mrKXD 9NTxxzZxxolhrcBl9V+9Po2ebiXQ54fiuvswKHivzbjCJDrKMiFPYBnGDDO4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818034; 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=EkchrQ7Iam//JauKFFVmkX3QvZ2UAWCrp0ZUaeBQ0ik=; b=J1g4Vs1mCJGQLupBLgYv0qUdGrITkn308gKanCtEj7/Dy/gezIXS0N2hiLKQ/ojYahYc9a EZanE5G1MmcbsrL/bBcuanm+kGHUL1h+XDZ5uVmPmrBRf7inul/4mB7/E8LVHuemi/MiUw XhggaUuuBaSnCDrUHUSam6f3cwBibakDa/dwtyhXT/Vq3SOcx4A1dkrx6o6ks59X/bJlrS /ySYXLpQSEkuGjmHezdfWIzfw32jpndnG/FHC5TdQRx/he4Lo3HfdwZvEC099+f10ZV31Z j9kT4K+TFTOvSrCsjGcfetqqkLPL8YFUai0jDX/9jENsvevvpdG/8LrFy9F3Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818034; a=rsa-sha256; cv=none; b=x6jX89tXolCsD+NO9Miv8ji20f8iKSuqsyJRCAaDHsIgnybq9CqRFqX/a6u8hgeG3rlXeQ wCEiurGGSWQqr3+I3ZEMVJwy1vG2T01gWdwsTbKbXvswsfT+CjC9NKdhlgIKOaL/J3TOWz 7/OPsyN6ZvMl23jABh4KYNKrV1OrWF+kL0ODiBnwmwBXR0eD/T4BaGIXo495DvNZH7bDys fRvz1EuuY0+6RSDyR97IxXnD4LsRTBBpinsaXPdkyq1XhIbK+isWZqVe4XB6FzX9zOnykq 0a6Q1yFfbPdy/1V/onB1A8xHaKnnow7sPDMUGY0mew/9KabctaRqvtvpYtFMBA== 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 4dVRC61QSVzCYk for ; Mon, 15 Dec 2025 17:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e27b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d9bff46977de - stable/14 - sys: Various whitespace style(9) fixes for sys/elf_common.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d9bff46977de2ffa67d2876cca6c31ab6ff9b3f1 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:34 +0000 Message-Id: <69403eb2.e27b.16c56009@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d9bff46977de2ffa67d2876cca6c31ab6ff9b3f1 commit d9bff46977de2ffa67d2876cca6c31ab6ff9b3f1 Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:07 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 sys: Various whitespace style(9) fixes for sys/elf_common.h MFC after: 1 week (cherry picked from commit 22ae840b9f0ff290cb08edacf975a99d264d3a0d) --- sys/sys/elf_common.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 5db6c14111ae..83c8c58d4f4a 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -450,12 +450,12 @@ typedef struct { #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_X86_64_UNWIND 0x70000001 /* unwind information */ -#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND +#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND #define SHT_ARM_EXIDX 0x70000001 /* Exception index table. */ -#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking +#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking pre-emption map. */ -#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility +#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility attributes. */ #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details. */ #define SHT_ARM_OVERLAYSECTION 0x70000005 /* See DBGOVL for details. */ @@ -771,7 +771,7 @@ typedef struct { #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_INITFIRST 0x00000020 /* Initialize DSO first at runtime */ -#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ #define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ @@ -888,7 +888,7 @@ typedef struct { #define STV_ELIMINATE 0x6 /* Architecture specific data - st_other */ -#define STO_AARCH64_VARIANT_PCS 0x80 +#define STO_AARCH64_VARIANT_PCS 0x80 /* Special symbol table indexes. */ #define STN_UNDEF 0 /* Undefined symbol index. */ @@ -1061,11 +1061,11 @@ typedef struct { #define R_AARCH64_COPY 1024 /* Copy data from shared object */ #define R_AARCH64_GLOB_DAT 1025 /* Set GOT entry to data address */ #define R_AARCH64_JUMP_SLOT 1026 /* Set GOT entry to code address */ -#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ +#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ #define R_AARCH64_TLS_DTPREL64 1028 #define R_AARCH64_TLS_DTPMOD64 1029 -#define R_AARCH64_TLS_TPREL64 1030 -#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ +#define R_AARCH64_TLS_TPREL64 1030 +#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ #define R_AARCH64_IRELATIVE 1032 #define R_ARM_NONE 0 /* No relocation. */ @@ -1208,8 +1208,8 @@ typedef struct { #define R_MIPS_GOT_HI16 22 /* GOT HI 16 bit */ #define R_MIPS_GOT_LO16 23 /* GOT LO 16 bit */ #define R_MIPS_SUB 24 -#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ -#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ +#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ +#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ #define R_MIPS_JALR 37 #define R_MIPS_TLS_GD 42 #define R_MIPS_COPY 126 From nobody Mon Dec 15 17:00:36 2025 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 4dVRC904Lqz6L1lj for ; Mon, 15 Dec 2025 17:00:37 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC83X4Xz3pyp for ; Mon, 15 Dec 2025 17:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818036; 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=Z5b/HDj0YKjQ4o+gihjYYe42mC0PiSYFwtRe1BmqrAo=; b=uaGyqAOvy1Vi3dDiBSnPpF60bPKo3km0HKH2pZAQLrWFLJHQWnOxM+PglH15ltHue82ZH0 4Qtak7IWQTRpOMFf20apvCQXVxwu109vey1bPWK4iJ6gnJaJrLcSFs/CLB/nuAuj2Y2/a5 8WzrrvD9PjvwYUWKyyh2k7hh0jx0yc90Pd5+m1RV97ZRx6XdGCD/Px+S4h4B8IWigW6QOd iaJiBpN5ih77XVp/B/GBWevl2lb8/mmPDZlQNm8STgJTgh/VCpbabcrj1mrzLAYMAWEYdA xTpdUteGr1Cjzgm2aV0Gpb/c21WBLSoxoI6BPKNIxBwijMKaD9ExTA7QHdjlvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818036; 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=Z5b/HDj0YKjQ4o+gihjYYe42mC0PiSYFwtRe1BmqrAo=; b=Div4CMsq2gWhdBYdGNUx9Xa4pSpyAsrmjI/AyCYIs0WxSIYVfsScon3j/PD1e5rDk55IFP jqydzUIxADOny5r2apgK2PGj6VNG3AnUdUxf0d+T+pyhxM1AEZWMbCDD83cdS39gJdAB+O DL9s3zf7hayMhHC9qcIsxR56Jy91aJyjxSTs75yMePEu+JMA9jauRCHi+JjjMpy851KuQa lgggDpgNxSnBMNSUP13juFoAkmyQPAboAyuGvCTMkCocrhKfH+Dj0ONDbbsKjxvmNB0js1 ruAMqQxtfS/tblDUJLh3QxSDf6M07WxXsp8/4z3PvYGKP/AsMPc+avrU8VTE4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818036; a=rsa-sha256; cv=none; b=lDxi97kX3V4klsDwYpRu1Wlz9FdsyJ9NvTe9GkszY1wULPBNvsdP0i/t57sm9/XQ46AC8d jDiThovMswYuEuqdSxJRwN3myN4xK4di126c2MjwTP/+20sKGwQ7usU6I5CFcXgArdiD7L fGLtUlu2xgF/+KcLen16QAGF8hIlMVfKCTbbX9u1N6xiWZAy8vQiLFp2Uw4/QGHI7axhQq qUY/wnB/TJ22UIK9zYiBqJd8I5uZDFFf1yL2pKpzPeAjRQVFm8uts3gZGJVZb3Wv0jlClW oLlbbCtiBNOSYAOXdtLAmAfookuYTeky1j4pp+JD77em3A47CYWsGST4djcDSw== 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 4dVRC82zlXzCWK for ; Mon, 15 Dec 2025 17:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id de29 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 123a24445686 - stable/14 - Makefile.libcompat: Use same PATH for _lc_build-tools as _build-tools 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 123a24445686afb0c2742df53d900098d1227526 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:36 +0000 Message-Id: <69403eb4.de29.48016975@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=123a24445686afb0c2742df53d900098d1227526 commit 123a24445686afb0c2742df53d900098d1227526 Author: Jessica Clarke AuthorDate: 2025-08-22 20:46:15 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 Makefile.libcompat: Use same PATH for _lc_build-tools as _build-tools Without this, we end up with just the host's tools in PATH during _lc_build-tools. In particular, sed on GNU/Linux systems will be GNU sed, whose -i option has different semantics, and this causes the lib32 build of ncurses to fail trying to create curses.h with: sed: can't read s|...|...|g: No such file or directory This has always been a bug in Makefile.libcompat but previously it didn't end up mattering; this is the first known case. Fixes: 1cc020eba69e ("ncurses: Provide reproducible paths") MFC after: 1 week (cherry picked from commit e84374d38bc1690eb62de75874348b1cfa21ea93) --- Makefile.libcompat | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.libcompat b/Makefile.libcompat index a957c47598e6..20a030342987 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -57,6 +57,7 @@ build${libcompat}: .PHONY -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null .endif ${_+_}cd ${.CURDIR}; \ + PATH=${BPATH:Q}:${PATH:Q} \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ ${MAKE} -f Makefile.inc1 \ From nobody Mon Dec 15 17:00:37 2025 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 4dVRCC0RLsz6L1t8 for ; Mon, 15 Dec 2025 17:00:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRC94mfYz3qBl for ; Mon, 15 Dec 2025 17:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818037; 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=mD5BQBuV5RZ2oZI0vfeBjbIn6O8lz24i+Hrwr1F6af8=; b=LfDUBx8rNuzHyEg5PVnm+oD20JW6XHq0h/YeN6lfPQLv/iBj42xRvIW+naNtyBiL+WqsxI cZGKfW5xzilCHKTCaWUqOxSytt5y574b7TjBpzpmb5tmrTY+N6GoFryJHODGjhR/nc/3m1 SNSuGU5u8KjWhirwDZoA45Yqe1NIwcxBYWFjgKGGipSWZyWK7jh/R0g6DRlNT5qEsO5Svc mabbWtDWoV9mNxaev/J0lFnz8mL1B+u8kzqC9H/o7R8eM6m/w29rGGaZwj8wTCk7irqewy swpQkzEgdMvfizY4bEPWEygTfF+g5v+j1RafZid8VPARFmwhQs+CSGZEaf4dqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818037; 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=mD5BQBuV5RZ2oZI0vfeBjbIn6O8lz24i+Hrwr1F6af8=; b=Jo1hR7rqsBRHpbBb2CWkzNkIf97gN8vDQ/Br9vqMM9jN0MpVjpPR8ruESLeg8BqG9g8KaK z4VwW//xJhvk6qcyUKdEHX7J12U5Gmqsx2qjvlBJYcjWxWz1fCVskwt8/1cvNFCfc432j0 DFS9FpvFMLoIwBNxmT+ZcCYS4VJfacj0sf5mexFJgYIgK48wfJ1IqwlhmG38oTDNZHxlPY +MTCkeMfGg25zEnW+7sAZyDA+bKbnQlKQ0Um3OAeBoCcpn3waWX9AzU4GFdf33hbgQQmwN paoEvv/bXQfO1r0efrc3ACmRctqJuy8FZ9X1+1FIHMNcaCjlieuVLTNfeLCV+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818037; a=rsa-sha256; cv=none; b=Cg184hvmNdLgAuPdWA3jQ4gNWsGlkUuwuasEl9jbYzvRjfH+0iLDaVcOuLXEXIj6PvlHnD 0NKRxoqRfYa7Jp3wlTtg7TMHZd7mQWNo7XK/Op2+P5CRQ7TQC4BxA7W2LWF1G8w+MXCt51 sFPhvyKs8ObnPpGG3rEIceyO5KtlaI5A/WrAS3mlhWy0cYR1ndKDtGTB1bGSNrkdo8fH3o K7X7x8VWDZlsmySk4UKI6mnxc6F0cmrPRML1pGB5cDAbKmzDIFO27JXwkfHyTKyh9oSDR8 TfWPFA2llXF2GjxlK21jbpm1j3sDE/doUuA7hCChBcIWNBWu+F6Z3P8SUFiTnw== 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 4dVRC93jj4zCrC for ; Mon, 15 Dec 2025 17:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d74f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 3300572ffcc6 - stable/14 - bsd.compat.mk: Honour XSTRIPBIN for lib32 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3300572ffcc679457995c8ec4d9eb354cf12defc Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:37 +0000 Message-Id: <69403eb5.d74f.7bfb0751@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3300572ffcc679457995c8ec4d9eb354cf12defc commit 3300572ffcc679457995c8ec4d9eb354cf12defc Author: Jessica Clarke AuthorDate: 2025-08-22 20:46:16 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 bsd.compat.mk: Honour XSTRIPBIN for lib32 Currently we only honour XNM and XOBJCOPY, but XSTRIPBIN is important during install. Otherwise we end up using STRIPBIN for the host, not the target, which is normally the same, but may not be, especially on non-FreeBSD systems. In particular, cheribuild will build FreeBSD with STRIPBIN=/usr/bin/strip XSTRIPBIN=strip (with the latter referring to the bootstrap strip in PATH), which breaks for WITH_LIB32 when the host's /usr/bin/strip is unable to process the lib32 binaries (e.g. building arm64 FreeBSD's lib32 on an amd64 GNU/Linux system). MFC after: 1 week (cherry picked from commit ad13dc1ece2fe4a6192bceffea4a868ba6a2e0e2) --- share/mk/bsd.compat.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index 0c387bcb020c..f53b1e78a478 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -85,6 +85,7 @@ LIB32WMAKEFLAGS= \ LIB32WMAKEFLAGS+= NM="${XNM}" LIB32WMAKEFLAGS+= OBJCOPY="${XOBJCOPY}" +LIB32WMAKEFLAGS+= STRIPBIN="${XSTRIPBIN}" LIB32DTRACE= ${DTRACE} -32 LIB32_MACHINE_ABI= ${MACHINE_ABI:N*64} long32 ptr32 From nobody Mon Dec 15 17:00:39 2025 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 4dVRCD242bz6L1hF for ; Mon, 15 Dec 2025 17:00:40 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRCC5kfZz3q0K for ; Mon, 15 Dec 2025 17:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818039; 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=iB2NNc+dX/Havzp6vf2izlt+RGVGWMgx8ePhkMjVNQA=; b=KYEhFUE/Jb4t+B2CsZBBGpou5EvyLloqfya/vI25Y7OprpoDIulvmvfpECUiqdeF1xVCgt 3hj0ze3i+CIMBqBgmyllvUqjexUYI+vLsQ3hV4ax2Ze0+t47Ch77UAb3j/SrtH3T3wLJKJ ZBM3XuBvfQwu9YOAI6+8t3UUWtdB77Q2Shngoxzn0VhllLbTyTeyurrfzq1U8KB44Vw1vX 3fp8g4HjMy/flG9Py3IioLn1X4y/OKt3F6H7txJsqdsDsdrn0OAJKzfFUno7uSdnT2iVMe TWOv179lc2p/xudKnTkwbORiWA/nGL7VBk6DHoZewLn1k8dLtWzqJ83isd5QhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818039; 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=iB2NNc+dX/Havzp6vf2izlt+RGVGWMgx8ePhkMjVNQA=; b=EeOIXHDStM0KDjp9eBxaicvfngM7j+tLPgfi3jkFm5gKobr2eMwlB4dx6zr4yKWYwbi4Wm fMAfK+DN4z2APzUtTZ159lxumMV/KQ6I065RcpM2Uu9mXmbh+mdiVbSRWd3R21OwePEfE7 WW9H7ohWFn6Ygf2wt6/HaoBJ/7eMoaFEIZqoH8h11GjMjdev8Z3XjdHnL9kLPC5JH5CbQC DriJVoDjwJxMKVUB7VxlVj7tK1h9dCLXyxIg0qRjcfJriMu6opVm13WTuusw8UjnLJXD7N XXq3FHCQk2fqnWYuno5Xz19qSmf2+DpXYdwZ1aUE3IHgUCo6k/VEj4bDXtlWpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818039; a=rsa-sha256; cv=none; b=k4O3W862yWmMYqdfitrUuU7a1u5ESTqd74vaCOJr+dAt6eK0VjOCUKGBlQCm+NOM4sIo1T 95EClqcpsvJpLTrD+uR+046/ZYOIFF/Tpjxr1ngCKwkQJkastBvPNcKokt9eWyqAjQxWqJ un/rH2R+jiscziuX4+E0/kGuq57w1PiJuJk3rJellcTmO2qFz4U25I2z0ye2L9k5P+89Q/ MrunmtDeef1xeCTi8kh3Qro9h3uQqWh1hU3bujXxsho3FnizBaJSSFNi5jmnAMjMNZQqrv mNMKmjlxdPtdHyo3mXz8vx1G5b8uAZDeUATxSlNakNPj77L7wf0actU5W1JDaA== 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 4dVRCC5J0bzClX for ; Mon, 15 Dec 2025 17:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d0d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d37b3562e701 - stable/14 - imgact_elf: Fix off-by-one in note size check 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d37b3562e701ab1583ea7ae47b9bd3214ef39d37 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:39 +0000 Message-Id: <69403eb7.d0d6.25f06a1e@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d37b3562e701ab1583ea7ae47b9bd3214ef39d37 commit d37b3562e701ab1583ea7ae47b9bd3214ef39d37 Author: Jessica Clarke AuthorDate: 2025-12-08 13:01:57 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 imgact_elf: Fix off-by-one in note size check Prior to c86af2cc4cd1 ("imgact_elf: Check note body sizes"), this was note_name + n_namesz >= note_end, which checks that there is at least one byte after the unpadded name (which could be either padding or data), and given our notes always have data with them this was fine. However, once we started checking the padded name (note that "FreeBSD\0" is already a multiple of 4 bytes, so has no padding) and data, this turned into checking that there is at least one byte after the unpadded data, and since our ELF notes already have a multiple of 4 bytes for their data and therefore have no padding, this means that we are now checking that there is at least one byte after the ELF note, which is not going to be the case for the last ELF note. Instead, switch this to a strict greater than, as should be used when comparing one-past-the-end pointers, which both sides of the inequality are. For executables, this was generally not a problem in reality, since the last of our ELF notes is NT_FREEBSD_NOINIT_TAG, which isn't read by the kernel. However, ld-elf.so.1 (and libcompat variants), like shared libraries, only has NT_FREEBSD_ABI_TAG, which meant the kernel did not see this ELF note when directly executing it (e.g. as done by ldd), and on RISC-V this is the only branding present, so doing so would fail with ENOEXEC. This does also mean on non-RISC-V direct exec ld-elf.so.1 runs with the wrong p_osrel, but given it sets kern.proc.osrel.PID to the executable's NT_FREEBSD_ABI_TAG that it loads, this probably doesn't matter in practice. PR: 291446 Reported by: bdragon Tested by: bdragon Fixes: c86af2cc4cd1 ("imgact_elf: Check note body sizes") MFC after: 3 days (cherry picked from commit 5d58198ccc2b562098ee5fc4898013622b32b065) --- sys/kern/imgact_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index f73fd997594d..ea74c07cbc48 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2811,7 +2811,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, goto nextnote; note_name = (const char *)(note + 1); if (note_name + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + - note->n_descsz >= (const char *)note_end || + note->n_descsz > (const char *)note_end || strncmp(note_vendor, note_name, checknote->n_namesz) != 0) goto nextnote; From nobody Mon Dec 15 17:00:38 2025 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 4dVRCC181Mz6L1xs for ; Mon, 15 Dec 2025 17:00:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRCB569hz3q66 for ; Mon, 15 Dec 2025 17:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818038; 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=1zEdOQBmAJnBj8buWwkDtmeoQJnyYMZ1sk653CqeLRQ=; b=nhctTUO5DOnFQmWUOQKpvhpn38mte0jmGmqIui4FjY2XrB/dGgUlC6hwcYgjJgWH2HhOe9 hV9ETJLxIciZYS/s69xdSMWSLvOL+G1dgVo6z02VMUj2KeEGJ5LNw3bKC/6gIyD0q6B36v FcEPcLePg63yPIQr120NnrJwxgoMNBCQiqUmR4vRzCo4WL94+v2rz1q7iItBoxhXOA31CN nqVu6uq+SsG1Jb3q2IdIijyKa+Vrc9/66JbFZa/QZtcH2YrBLsbcX0dLNqHmPJoFLznb4M cAl18B+xb2Sd/qh8Njdq/MC1Zl0T6F5LrUuFrZ4xwf5vAUQGScfC8tQh7mTQhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818038; 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=1zEdOQBmAJnBj8buWwkDtmeoQJnyYMZ1sk653CqeLRQ=; b=m/agFL+Gbziujjx0kJzvCBIod9IzgvevYjOKDsOSTOljOlg5KKwKo2Aa4uRgATR2z6IOlD zLveb5mH7qC3jzNTQx9UE73vv29lyBUbmJrTPtFzREXnVKfVuNbgDHbmJ04c5NnEWr195p IsuNjFiviM+BprXFCLILxh6ENRER0lbquKdi8PRElhe7+rxZ3jus3cTQgLVMiuVCCqENN8 D/1Nfiwdcp/P92wu5wgNLzgRIH4hcZE0lHzrCXLXMvEKjFQtt4lD0vEJ0nFypSMzlDVl35 T2YNm0CPc8shGpIMaVPCfkXtjbBN36yAz40cMQxi4OgMzHQcLVOpnlzJZ8I5Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818038; a=rsa-sha256; cv=none; b=aR3HEJWgKf4YFJ9rgNXr7jwvWjod0lLfcU2eV8M8eeGr5mU6JkotFuAM3Hp9DL5dfiGj04 sCYzo2kihH/2PS9U7CVoI5ZInobTvRcDpclGvjeegHxeT/8z05V3He7vuPBV4FZZ6urDcJ p8Cn+x1eqO3DorctPmgYrxTKorlFhF8qy5KyPy9ldxfXMCUpIHFZ/refXclw8fBDxvCNaX EjRnS00lYEXi6naFJS5/XVg02EsX4Xd2oefOMjETP3SZOVPd49FitLXf9pPAIUxqZ87o23 xj2qMIFvLAcN+BuYfH36efULmUTzRV0l+O04KKiZnB4CzKDDf5l1jYXGR7z0yg== 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 4dVRCB4WJRzCrD for ; Mon, 15 Dec 2025 17:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c6fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 34671bb50983 - stable/14 - freebsd-update: Mention upgrading packages, not just ports 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 34671bb50983ccd21faddb5e33c02454c9065995 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:38 +0000 Message-Id: <69403eb6.c6fc.3c512d47@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=34671bb50983ccd21faddb5e33c02454c9065995 commit 34671bb50983ccd21faddb5e33c02454c9065995 Author: Jessica Clarke AuthorDate: 2025-12-06 00:33:20 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 freebsd-update: Mention upgrading packages, not just ports These days most end users are likely using pre-built packages, not locally-built ports. Thus be sure to mention this as an important case, and put it ahead of ports. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42968 (cherry picked from commit ced74610217ff0be071e4614c64a4ff66c40bc6b) --- usr.sbin/freebsd-update/freebsd-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index cf5f6373a75c..75f8aaefc8b4 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3143,8 +3143,8 @@ Kernel updates have been installed. Please reboot and run cat <<-EOF Completing this upgrade requires removing old shared object files. -Please rebuild all installed 3rd party software (e.g., programs -installed from the ports tree) and then run +Please upgrade or rebuild all installed 3rd party software (e.g., +programs installed with pkg or from the ports tree) and then run '`basename $0` [options] install' again to finish installing updates. EOF rm newfiles From nobody Mon Dec 15 17:00:40 2025 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 4dVRCF1fDtz6L1hJ for ; Mon, 15 Dec 2025 17:00:41 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRCD6cQBz3q6S for ; Mon, 15 Dec 2025 17:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hBUHF8+Z5LwdsCNVMN2nFPScjFgik/f+9N6A8PSh7IE=; b=skasI7m3KSkIDodp6AaQg0xPzyDjyfkUXm1EoUFuIS65bU+MlpoGJwYDRrnIWcifJhV9Dg xOl0A4mGnVmMOXcw1D+Jhyhh/SwTaduFPQ867uxQAzf0t16yjdulFUpxhu6W4a9vFn25R/ dR4t7QE/VS5f/oRU8ZYdkzExZ3ceDGbsUfak4Ph0Rj4BeTqu4Vbxr8t4G10dW3bqO+ATLL 7ZtChKOa8xCEOOjxi83wMXZ/GoTnsjJJ3ICvYd3uQzAOXKW9fHg0X6zf2bZmMNYlZcULkl qd9AawLmfVRi30lf5PU3YnJt/0K3u3aiXP875+zhRxzsCRdCwPsXSisfdhpzaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hBUHF8+Z5LwdsCNVMN2nFPScjFgik/f+9N6A8PSh7IE=; b=p1Hpuw8t9fJtcZ1u7CXNbE4IXgRGWD6Nxuz4sTet3dQQfLE5v4bIED5Tv4VTl3Jkuqwsop PbMsB+3x6fgkKzzaDAidWMNJIqQLS4tfAXRo9dsUvLMn5wBtk9NlozimKIZhiHjlGbix+1 NqHYc0lcyQM0ZsRWRsYPduhw+KeObbc52FUW63vr+URdZfuH7LmIUIvJBJf5uJUJVdRRNQ bKa8dznwJH9pWW5cZsaMNk/iczRBgwLc9MeiwunEFnqJRC2Jn3nToR7F40eKiIIJi4Mmfs 3KKcZJuYj/ACeoJe99KkwvAGD4QW7JZwTYvQn/ggnMk/lheDEZFKfGf4Ywj0ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818040; a=rsa-sha256; cv=none; b=OWvTerSmuiwCd/FJa5kMatD/AHOH64MRpil0c4i8sgxf+vfg1lqFWY1a3BQynVzVlu5eqK blGI1piw8cmDNiWp4dROXj3zw88XyIN5xHTmj83KLdxguCfZA1aOdthkJfTXP/21VVwY0M aSA2i/V2XCvGpoEsTYcVHu2qRdrmWkXWRciX5y55C7n78IfvVpTRWM7X15s2HEgNC2T5Kj CAJb41kYItBErBopJy1s+Qmnz34yxOI1M/yTPRz+KuSZpsavVyKqSGg4w7nXslW713Mjry dbMOzPD5UM7pGVBt7PBlPVNiX6/eoTfPTpdk4P5WluUmbCRSPKNk85z5GGQuiA== 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 4dVRCD65rWzCrG for ; Mon, 15 Dec 2025 17:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e99c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: John Baldwin From: Jessica Clarke Subject: git: 323a47103c2b - stable/14 - cross-build: Workaround system-provided strchrnul on macOS 15.4+ 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 323a47103c2b466099fb72212bf7e3507a856a43 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:40 +0000 Message-Id: <69403eb8.e99c.2015f239@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=323a47103c2b466099fb72212bf7e3507a856a43 commit 323a47103c2b466099fb72212bf7e3507a856a43 Author: John Baldwin AuthorDate: 2025-04-28 17:10:41 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:45 +0000 cross-build: Workaround system-provided strchrnul on macOS 15.4+ macOS added a native strchrnul in 15.4. There is not an easy way to detect it at compile time, so use a macro to rename our local inline version to avoid conflicts while also forcing its use during bootstrap. The local version can be removed once macOS versions older than 15.4 are no longer supported as build hosts. Co-authored by: jrtc27 Reported by: kib Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D49893 (cherry picked from commit 4e2616b74cb7eed921aa10fb776cdc2d5fd4e42f) --- tools/build/cross-build/include/mac/string.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/build/cross-build/include/mac/string.h b/tools/build/cross-build/include/mac/string.h index d7db0d3023a4..58464f1f9834 100644 --- a/tools/build/cross-build/include/mac/string.h +++ b/tools/build/cross-build/include/mac/string.h @@ -38,9 +38,12 @@ #include_next /* - * strchrnul is not provided by macOS and the strchrnul.c implementation - * can not be compiled on macOS so just provide it inline here + * strchrnul is provided by macOS 15.4 and later. However, there is + * no good way to detect the current host version at compile time, so + * provide an inline definition under an alternate name. */ +#define strchrnul(p, ch) __freebsd_strchrnul(p, ch) + static inline char * strchrnul(const char *p, int ch) { From nobody Mon Dec 15 17:00:41 2025 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 4dVRCG1VC6z6L1n9 for ; Mon, 15 Dec 2025 17:00:42 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRCF6xfZz3q6X for ; Mon, 15 Dec 2025 17:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qzNMhWTxuliT1ZdTE9qXY8nI1KM6beHU8OVtUE4eLhg=; b=XyJb93uhiqub4UuCzJqNQViu04UD5iSXwmiboEjtTjzBLP99b/pSGaQ+JxXfhSg2uOMEnM /9hAFcggbTGQHduWTtY7NUQtFUqfWJp1guYaKkUI1MiAwn1s1B9dvdlzAcKg4wcJ0KN/kG MmTX3C8Re4A77dh0kVM2B9ErZ7cIuxY64+DMu9T2kmsTxNpFxFq72F53ALcSwmkpqGD0sB T5ET63bgW2JI326/5v79XIeLkWWkKKBkw+6doierDhnpxnRadGoQxyNH84l5fFxd2Z9ESM AlB70eU997ITG4nMUmGa4HJ6VGSPxvtVL0TnA16rwL27NkjEkGJ0gcZd6MLF2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765818042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qzNMhWTxuliT1ZdTE9qXY8nI1KM6beHU8OVtUE4eLhg=; b=mHRxSYZdkHMzyqB1Ku6kgQVqkLoadxxZqQWyM3M5chW8RodUpB8jeNIGDz13V1l7jj5GDG 8CeoZQ1WJUiteD6ndidXP3b9FVsdPdCdhGlxP/qM6JwffOmEr4+kZBVVOVkhnItwkP1llV uCH2gTshDqN3XhyzlK5UljCuUcwIysQst6Qn8bUwusI2KnhG3l1ulHCzYOFNljjByzvqau utv7YXDqlztDpU2D0NpzzyJ5CSG3xYtJpPyxBiYJYrLYhPVuXrnqBFEfizihLAiJpKO9oB F5+k+Y7b7Olmmy8RC0ImF9cZ5cExtqF/ixdHcpEspzd60Rw2ld0ktUrbgtKo4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765818042; a=rsa-sha256; cv=none; b=kcnsQBVGrkla/9LrmJBKknCr7eCwxSdHK24QngzKnlLMI2hMBSLIvjWJaX66jMJin+j5P9 iN1P2UwTAy7Z8mBFmkBMm+SBIlGfiQUwMj/YPYk0JCwnGaPKs5ke5UZM2pkYujS+g/Cmuw iGHFtNJsiBz2/g01gdpxKnH4Fn2tMOE3wcxWxfQ1mIivfKRCTlL9rUrjJ3STGJ8+2DPf/9 fbJm0Uj1HQ9aKi3q6kOni2/E2ah8IUCey+d+8qYwQkwrhFmePiNjWMBCkYQEE8HL4wTgUV Yl0HAvqd7Q/2wRUniC24f6zF5tlgpPYVjVSkmtbnGqq8sEL+D+prLzqB13dykw== 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 4dVRCF6YGRzCtn for ; Mon, 15 Dec 2025 17:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id df9c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:00:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konstantin Belousov From: Jessica Clarke Subject: git: 52a61478e558 - stable/14 - cross-build: fix after the recent sqlite3 import 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 52a61478e5589be242a3b4a889da71ce533c8daf Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:00:41 +0000 Message-Id: <69403eb9.df9c.4639c275@gitrepo.freebsd.org> The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=52a61478e5589be242a3b4a889da71ce533c8daf commit 52a61478e5589be242a3b4a889da71ce533c8daf Author: Konstantin Belousov AuthorDate: 2025-07-10 21:02:37 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 16:58:46 +0000 cross-build: fix after the recent sqlite3 import Stop adding contrib/sqlite3 into the include path for usr.bin/kyua, take headers from the install sysroot env. sqilte3 now has the VERSION file, which clashes with c++ include . Submitted by: jrtc27 (see https://reviews.freebsd.org/D51217) Tested by: kib Fixes: 17f0f75308f2 ("sqlite3: Vendor import of sqlite3 3.50.2") (cherry picked from commit 09d28419c646650a77721e168ef43bc1bac96b67) --- usr.bin/kyua/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/kyua/Makefile b/usr.bin/kyua/Makefile index d1cb2a51f667..8e2c0010fb59 100644 --- a/usr.bin/kyua/Makefile +++ b/usr.bin/kyua/Makefile @@ -33,7 +33,7 @@ MAN= kyua-about.1 \ CFLAGS+= -I${KYUA_SRCDIR} -I${.CURDIR} CFLAGS+= -I${SRCTOP}/contrib/lutok/include -CFLAGS+= -I${SRCTOP}/contrib/sqlite3 +CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/private/sqlite3 # kyua uses auto_ptr CFLAGS+= -Wno-deprecated-declarations CXXSTD= c++11 From nobody Mon Dec 15 17:25:39 2025 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 4dVRm40P6Cz6L3pG for ; Mon, 15 Dec 2025 17:25:40 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRm36jRjz46fJ for ; Mon, 15 Dec 2025 17:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765819540; 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=9j/iPe8JribyDV/GZt3gUGZoPwaXBybnyjP+xZjC2lQ=; b=Rym9y3IraEZ7/zsIH3t2Lc95tpwA/d4Mxf7HSQusk+T9xup4XzC1jc9XsAzGJBX+z5/Z3p M4WHKQjKMkBYThX5Fw97w02bAG50l87JMZR5kz7X+RSw0ZS2okDDafKbumyGjDXG+rAiXZ b4JDyYd15/UN+qOhb05tI5RP3sMo07aE0Z2sf+x5RpHGMQ+N1z2cclWHaGw//kg4q0+BG2 5tB92R+ur7rdJBq4tv2gQm2KGRtgoX9XkoaBbUF4h/dcoTJQa8q3MF9AMw2QjhRwgANAro iMDXNV5YYAvgerrFraOBwi5DJ50WnaR/N+0K05BS+CbD9mCZvV9esIUmD3NF1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765819540; 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=9j/iPe8JribyDV/GZt3gUGZoPwaXBybnyjP+xZjC2lQ=; b=CVxrS4P+nE6n8n3UYbstRnEfcDeqOyplyesA8fkO4DA8wd0F0UpyWSDY0aDjLtMl/A72WN irFK1uulba/pPKreNLMhKTl37NGBRXo4wIQnvk0QscgC7i38+e5UC9wHMdU1V+RMqRiU34 8HiohlphfdIYxNWnLFGUakshnbjggq0C2HaSK4AJm77VDYZxrzkyHt4hH+dZqBf/5BdBOw DRTlrdDkOJTD7QNWpXJcaGZBB1lHQOb8xRL/DyCANY8TZoccdFTabwpPZTqNCSscWTFmm+ QVP6/Xcqw8hsFIfcUdRZeWeUnib7Dnk5OKs0F4i9uZWUnCyuv4AKsBYeu4GU/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765819540; a=rsa-sha256; cv=none; b=OBK9HU2/Sjashp1wjfyFgBFAyVJuokzyjXmzA3vm+JXzsTT7wqfIlOczKFUenPri8xqQG0 /OFI/WoBW7ibqs1fvUEnrFV4i0SQVNuOb6o3840L3A3714CRMF5uTi6sbkwIWOsMz1OhUd U7kb3yrrwcXzuuBxIkLpcIYK0c6QC1cqu7XOn4fhptcjKWPBcP99VZ5kROZDYr438H2026 i9r0LCDV/Pd2vEvpQFa7LTbVAvkN9Y7ehbc2eebXecwV/22YwMyhxxaWpbZ9uZPQDvIO0T NAKoDvBGeDVZVCKLgvyXFjJRUkb8pIkOCKNbwHt+9SW9lpZoUttlnwT7AOqjLw== 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 4dVRm36JRnzDQm for ; Mon, 15 Dec 2025 17:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2059d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:25:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2cfa240c0bda - stable/14 - vfs_cache: Fix the SDT definition of vfs:fplookup:lookup:done 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2cfa240c0bdaaf039e849fd81f4dc46c1e702663 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:25:39 +0000 Message-Id: <69404493.2059d.70794a98@gitrepo.freebsd.org> The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=2cfa240c0bdaaf039e849fd81f4dc46c1e702663 commit 2cfa240c0bdaaf039e849fd81f4dc46c1e702663 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-14 23:09:24 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 17:25:31 +0000 vfs_cache: Fix the SDT definition of vfs:fplookup:lookup:done 1. The definition lists struct nameidata as the type of the first argument. However, the actual probes always pass a variable of type struct nameidata* to SDT_PROBE3. 2. The third argument (args[2]) is actually enum cache_fpl_status. Reviewed by: markj Approved by: markj (mentor) Fixes: 07d2145a1717 vfs: add the infrastructure for lockless lookup MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51315 (cherry picked from commit 6567623f831daaffa67777d17780e8f424c1bb01) --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 21eb122c1136..0b0fbdb3cb1d 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -244,7 +244,8 @@ SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t"); -SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); +SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata *", "int", + "enum cache_fpl_status"); SDT_PROBE_DECLARE(vfs, namei, lookup, entry); SDT_PROBE_DECLARE(vfs, namei, lookup, return); From nobody Mon Dec 15 17:26:29 2025 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 4dVRn15tl9z6L3rL for ; Mon, 15 Dec 2025 17:26:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVRn15JRgz477j for ; Mon, 15 Dec 2025 17:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765819589; 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=Yy1Be4OmhrUWLqgqnKYYg5j+R6mZjS2MLg7WP3h2Bt8=; b=sngggKDMZFHMQMYuJ4ItRqtJS0+RT+c8vuZ1i/PzPBK6HzTHkom1G0TbVPS0xZnPuhhCc4 qqgn75XN/CBV0bHRGELH+U9Dfpt3ANuo2+dTCgD8riTgL1Cbrv/db+PldJMyGu3PhPFJxU 8BAxpa+bjqlkob/Yx4dEhgef7T0wNrIvgpOKBUjJisGhtGwhejq4pyTQqLQWCiBOgVNYxw y7slczb/lN2YPS0zrf9LiPgZPjSqOoRVuaPUwiBhRc/dTT7MieWS0Hk0ODjQPGp4gE8EE5 elJoyAFgMu7ZbxNKa+IL7Sa3jXq8/tScUKC3nsg6+GAuat8HCrdqhrUe3zYTRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765819589; 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=Yy1Be4OmhrUWLqgqnKYYg5j+R6mZjS2MLg7WP3h2Bt8=; b=q0jWu++5AKGs/vurEzAHuEOAAPEc3+JLMvmb1xXxUQ9hrNgdgh0HewlNbFKSfP4KeUls4l kBP0AEqrqWqC81DSV1O/MwybRQ66mt7/yKlBsmZcxsmLakTHMQJTC5oSke7PbfvZO29kRk KQOe7HFin5oKUC3hVW+hhIFd6YAO7d/badI8L/gSydhfQpXwgLCm7EUNwMo+Qgdm6xQBsL vkxqDnu4/0zlu3mDLLYuOutMlMSpvZNJQpa66bJL49ijXVfVwna01XeefnhsRQR34M6lMw Xr6LpXPDJvkRGAadYrCkX9RvBVXvUkHdKlmWQiOgXcM8EQ1DOi3TlKuDjRSxuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765819589; a=rsa-sha256; cv=none; b=arTrJQU5GMMoepHE/kfCxLzc83mna+cvpfdTWzTtwLnXGTjjmGXrqFmrjE+xrg7P7YrJRg H/veHSnBa2OqQX02pPY6T5pTh+fQE0eq3aQQ5nPi/LPbZRPDc8p+f9ywTKlXFj8c6O0Liw 2jrueUZ7eL1CcLwX7p9n45Ln1pxWIQVkzsEaQ4Z4LYK7LfYyYoekiEdFvIwFJxJsx+cuK6 SsEAM+i0vXreOcQe8csk8Tbtv+MbLx/TfCzzvKBmtWA+P5WlBia+oKJxx7mXbR7fw6NwCS 4Jfi3llx7v771FagDMW9/Kls2uhdx9OuOkqTtsQhVChOEbW3TT5ig82CQozIug== 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 4dVRn14sH4zD27 for ; Mon, 15 Dec 2025 17:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id fe78 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 17:26:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: faf64970ac80 - stable/13 - vfs_cache: Fix the SDT definition of vfs:fplookup:lookup:done 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: faf64970ac80caa5293ee58fe8614aa68d4c9b8e Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 17:26:29 +0000 Message-Id: <694044c5.fe78.2a68be91@gitrepo.freebsd.org> The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=faf64970ac80caa5293ee58fe8614aa68d4c9b8e commit faf64970ac80caa5293ee58fe8614aa68d4c9b8e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-14 23:09:24 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-12-15 17:26:14 +0000 vfs_cache: Fix the SDT definition of vfs:fplookup:lookup:done 1. The definition lists struct nameidata as the type of the first argument. However, the actual probes always pass a variable of type struct nameidata* to SDT_PROBE3. 2. The third argument (args[2]) is actually enum cache_fpl_status. Reviewed by: markj Approved by: markj (mentor) Fixes: 07d2145a1717 vfs: add the infrastructure for lockless lookup MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51315 (cherry picked from commit 6567623f831daaffa67777d17780e8f424c1bb01) --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index e6cf39c09f19..0afb65c55c5a 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -245,7 +245,8 @@ SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t"); -SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); +SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata *", "int", + "enum cache_fpl_status"); SDT_PROBE_DECLARE(vfs, namei, lookup, entry); SDT_PROBE_DECLARE(vfs, namei, lookup, return); From nobody Mon Dec 15 18:09:53 2025 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 4dVSl62N0Sz6L6bj for ; Mon, 15 Dec 2025 18:09:54 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSl56kRJz4FZy for ; Mon, 15 Dec 2025 18:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822193; 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=NQ/jkhOctAnaNIW7aTwKrLUBIxjj34tXO3BFvCXe5LQ=; b=wAvrhz+O/fhh7lB8rwf/CVTG9J2KbPqFCn+IRPmJh+NW5FDAm+cbtlHklx8sp5YVQuV4a2 h0L8NbXig1EJqjAATLRn2SmPTIj+/NhWJS6lqyo7hs6FtL4CPgAr00QpjNajF3LLgbpd7q vxAex/6WxmhhM22MmiWtytDGnNsywFZ0LgCbV90Snj0IW4ZZbQ30APqJrvV3bPfhhok/3C lHo5WLLxPP7e/VD1oJIZVw0MGO4IYNiOMTAt276yCUADqh0LvOoog7PttI+0R4ic2/Fazp pKp5NeWOrXRS9DEB2dDBjKI/LehSRYRE7xOaSjcYpjYDmcsy15u4Ous0hqr6RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822193; 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=NQ/jkhOctAnaNIW7aTwKrLUBIxjj34tXO3BFvCXe5LQ=; b=WK9DDWa/XVBBctRLoe5MECEyclKQUQC4XXUy1J8soeMHC13GUNz32jCc9MsEKKbYF+esg9 jBuRYoECqCgoRAIUzUYtQDhygqvrpRF4Pa5ENVXPuQzoehdUPWrUlnlwstki9b1o/RmTmP zBIpm8M63QfdJLwyvTF4Veo88NDXwQsbq+daLWeLIkvC8d0m/g4Ax/BaljTKXrfilfx67f dMcRSHDxp+i2DOXrZLfjGRwxmOdkE/bEWBVJvgwhCwltOq+FlAqL5k+Ds+en/wrAwhbZn1 3KhMVYrKbrNpiVBq9G0LVM/7QYqqlcEmCJyAV34f8t6hKLj5bzofDHY0s+Wkig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822193; a=rsa-sha256; cv=none; b=P9eddDAwFTEhwtozvGRbTkH+tlhYDerpDWgDMcaYlgoQikhitYKANnRCFZ33/W1gY1gqCA bcCxFtVr3UaHGQvb10/7rW1nED2/Lt8+aK5VYcEg3B/fCiJTlRSyF1erOq49JcqcQGpffz 1Oy8b8/YLC1Et/Ho7euvg4ylrtMXXdOdO0CYVdtOUy81e5CMRkNGsfWjZZ9JOK/s7eKTTC Ly3qzKCfBrazrgP5Ww/v5DAxhjhkgpYWO6WlQbpMeU6nmxwlrgvmoMSSlbCJvmo7IxBj55 62OUWg1kRHU153fuzUE76ZWrL1ERVgCDcAcu9JNAxLAfOzFK8BfRNtY79gclvw== 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 4dVSl55y9PzVls for ; Mon, 15 Dec 2025 18:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24694 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 17c0fbc240c3 - stable/15 - ath10k: update Atheros/QCA's ath10k driver 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 17c0fbc240c323a2ddeb875d2a9fcbfc2960d378 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:53 +0000 Message-Id: <69404ef1.24694.41fca89@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=17c0fbc240c323a2ddeb875d2a9fcbfc2960d378 commit 17c0fbc240c323a2ddeb875d2a9fcbfc2960d378 Author: Bjoern A. Zeeb AuthorDate: 2025-12-06 09:51:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:20 +0000 ath10k: update Atheros/QCA's ath10k driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ). Merge commit 'f4669ef6cf7860919442e67106e83f616ed36f51'. Sponsored by: The FreeBSD Foundation (cherry picked from commit 9954217599ce02fbf1772388e24e0b89663f4425) --- sys/contrib/dev/athk/ath10k/Kconfig | 7 + sys/contrib/dev/athk/ath10k/Makefile | 1 + sys/contrib/dev/athk/ath10k/ahb.c | 30 ++-- sys/contrib/dev/athk/ath10k/bmi.c | 9 +- sys/contrib/dev/athk/ath10k/ce.c | 35 ++-- sys/contrib/dev/athk/ath10k/ce.h | 2 +- sys/contrib/dev/athk/ath10k/core.c | 174 ++++++++++++++----- sys/contrib/dev/athk/ath10k/core.h | 28 ++- sys/contrib/dev/athk/ath10k/coredump.c | 3 + sys/contrib/dev/athk/ath10k/coredump.h | 7 +- sys/contrib/dev/athk/ath10k/debug.c | 62 +++---- sys/contrib/dev/athk/ath10k/debugfs_sta.c | 10 +- sys/contrib/dev/athk/ath10k/htc.c | 10 +- sys/contrib/dev/athk/ath10k/htc.h | 20 +-- sys/contrib/dev/athk/ath10k/htt.c | 3 +- sys/contrib/dev/athk/ath10k/htt.h | 18 +- sys/contrib/dev/athk/ath10k/htt_rx.c | 22 ++- sys/contrib/dev/athk/ath10k/htt_tx.c | 26 ++- sys/contrib/dev/athk/ath10k/hw.c | 64 +++---- sys/contrib/dev/athk/ath10k/hw.h | 63 ++++--- sys/contrib/dev/athk/ath10k/leds.c | 89 ++++++++++ sys/contrib/dev/athk/ath10k/leds.h | 34 ++++ sys/contrib/dev/athk/ath10k/mac.c | 265 ++++++++++++++++++----------- sys/contrib/dev/athk/ath10k/pci.c | 86 +++++----- sys/contrib/dev/athk/ath10k/pci.h | 7 +- sys/contrib/dev/athk/ath10k/qmi.c | 12 ++ sys/contrib/dev/athk/ath10k/qmi.h | 1 + sys/contrib/dev/athk/ath10k/qmi_wlfw_v01.c | 1 + sys/contrib/dev/athk/ath10k/qmi_wlfw_v01.h | 1 + sys/contrib/dev/athk/ath10k/rx_desc.h | 1 + sys/contrib/dev/athk/ath10k/sdio.c | 37 ++-- sys/contrib/dev/athk/ath10k/snoc.c | 60 ++++--- sys/contrib/dev/athk/ath10k/spectral.c | 26 +-- sys/contrib/dev/athk/ath10k/targaddrs.h | 3 + sys/contrib/dev/athk/ath10k/testmode.c | 4 +- sys/contrib/dev/athk/ath10k/thermal.c | 3 +- sys/contrib/dev/athk/ath10k/trace.c | 2 + sys/contrib/dev/athk/ath10k/trace.h | 64 +++---- sys/contrib/dev/athk/ath10k/txrx.c | 2 +- sys/contrib/dev/athk/ath10k/usb.c | 8 +- sys/contrib/dev/athk/ath10k/usb.h | 1 + sys/contrib/dev/athk/ath10k/wmi-ops.h | 32 ++++ sys/contrib/dev/athk/ath10k/wmi-tlv.c | 20 ++- sys/contrib/dev/athk/ath10k/wmi-tlv.h | 3 +- sys/contrib/dev/athk/ath10k/wmi.c | 122 ++++++++++--- sys/contrib/dev/athk/ath10k/wmi.h | 104 ++++++----- sys/contrib/dev/athk/ath10k/wow.c | 1 + 47 files changed, 1009 insertions(+), 574 deletions(-) diff --git a/sys/contrib/dev/athk/ath10k/Kconfig b/sys/contrib/dev/athk/ath10k/Kconfig index e6ea884cafc1..876aed765833 100644 --- a/sys/contrib/dev/athk/ath10k/Kconfig +++ b/sys/contrib/dev/athk/ath10k/Kconfig @@ -45,6 +45,7 @@ config ATH10K_SNOC depends on ATH10K depends on ARCH_QCOM || COMPILE_TEST depends on QCOM_SMEM + depends on QCOM_RPROC_COMMON || QCOM_RPROC_COMMON=n select QCOM_SCM select QCOM_QMI_HELPERS help @@ -67,6 +68,12 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. +config ATH10K_LEDS + bool + depends on ATH10K + depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 + default y + config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" depends on ATH10K_DEBUGFS diff --git a/sys/contrib/dev/athk/ath10k/Makefile b/sys/contrib/dev/athk/ath10k/Makefile index 7881fc25993f..28460625cdfb 100644 --- a/sys/contrib/dev/athk/ath10k/Makefile +++ b/sys/contrib/dev/athk/ath10k/Makefile @@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o ath10k_core-$(CONFIG_THERMAL) += thermal.o +ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o ath10k_core-$(CONFIG_PM) += wow.o ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o diff --git a/sys/contrib/dev/athk/ath10k/ahb.c b/sys/contrib/dev/athk/ath10k/ahb.c index 76efea2f1138..eb8b35b6224d 100644 --- a/sys/contrib/dev/athk/ath10k/ahb.c +++ b/sys/contrib/dev/athk/ath10k/ahb.c @@ -394,14 +394,14 @@ static irqreturn_t ath10k_ahb_interrupt_handler(int irq, void *arg) if (!ath10k_pci_irq_pending(ar)) return IRQ_NONE; - ath10k_pci_disable_and_clear_legacy_irq(ar); + ath10k_pci_disable_and_clear_intx_irq(ar); ath10k_pci_irq_msi_fw_mask(ar); napi_schedule(&ar->napi); return IRQ_HANDLED; } -static int ath10k_ahb_request_irq_legacy(struct ath10k *ar) +static int ath10k_ahb_request_irq_intx(struct ath10k *ar) { struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); struct ath10k_ahb *ar_ahb = ath10k_ahb_priv(ar); @@ -415,12 +415,12 @@ static int ath10k_ahb_request_irq_legacy(struct ath10k *ar) ar_ahb->irq, ret); return ret; } - ar_pci->oper_irq_mode = ATH10K_PCI_IRQ_LEGACY; + ar_pci->oper_irq_mode = ATH10K_PCI_IRQ_INTX; return 0; } -static void ath10k_ahb_release_irq_legacy(struct ath10k *ar) +static void ath10k_ahb_release_irq_intx(struct ath10k *ar) { struct ath10k_ahb *ar_ahb = ath10k_ahb_priv(ar); @@ -430,7 +430,7 @@ static void ath10k_ahb_release_irq_legacy(struct ath10k *ar) static void ath10k_ahb_irq_disable(struct ath10k *ar) { ath10k_ce_disable_interrupts(ar); - ath10k_pci_disable_and_clear_legacy_irq(ar); + ath10k_pci_disable_and_clear_intx_irq(ar); } static int ath10k_ahb_resource_init(struct ath10k *ar) @@ -497,7 +497,7 @@ static int ath10k_ahb_resource_init(struct ath10k *ar) ath10k_dbg(ar, ATH10K_DBG_BOOT, "irq: %d\n", ar_ahb->irq); - ath10k_dbg(ar, ATH10K_DBG_BOOT, "mem: 0x%pK mem_len: %lu gcc mem: 0x%pK tcsr_mem: 0x%pK\n", + ath10k_dbg(ar, ATH10K_DBG_BOOT, "mem: 0x%p mem_len: %lu gcc mem: 0x%p tcsr_mem: 0x%p\n", ar_ahb->mem, ar_ahb->mem_len, ar_ahb->gcc_mem, ar_ahb->tcsr_mem); return 0; @@ -621,7 +621,7 @@ static int ath10k_ahb_hif_start(struct ath10k *ar) ath10k_core_napi_enable(ar); ath10k_ce_enable_interrupts(ar); - ath10k_pci_enable_legacy_irq(ar); + ath10k_pci_enable_intx_irq(ar); ath10k_pci_rx_post(ar); @@ -733,7 +733,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev) int ret; struct ath10k_bus_params bus_params = {}; - hw_rev = (enum ath10k_hw_rev)of_device_get_match_data(&pdev->dev); + hw_rev = (uintptr_t)of_device_get_match_data(&pdev->dev); if (!hw_rev) { dev_err(&pdev->dev, "OF data missing\n"); return -EINVAL; @@ -775,7 +775,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev) ath10k_pci_init_napi(ar); - ret = ath10k_ahb_request_irq_legacy(ar); + ret = ath10k_ahb_request_irq_intx(ar); if (ret) goto err_free_pipes; @@ -806,7 +806,7 @@ err_halt_device: ath10k_ahb_clock_disable(ar); err_free_irq: - ath10k_ahb_release_irq_legacy(ar); + ath10k_ahb_release_irq_intx(ar); err_free_pipes: ath10k_pci_release_resource(ar); @@ -828,7 +828,7 @@ static void ath10k_ahb_remove(struct platform_device *pdev) ath10k_core_unregister(ar); ath10k_ahb_irq_disable(ar); - ath10k_ahb_release_irq_legacy(ar); + ath10k_ahb_release_irq_intx(ar); ath10k_pci_release_resource(ar); ath10k_ahb_halt_chip(ar); ath10k_ahb_clock_disable(ar); @@ -837,12 +837,12 @@ static void ath10k_ahb_remove(struct platform_device *pdev) } static struct platform_driver ath10k_ahb_driver = { - .driver = { - .name = "ath10k_ahb", + .driver = { + .name = "ath10k_ahb", .of_match_table = ath10k_ahb_of_match, }, - .probe = ath10k_ahb_probe, - .remove_new = ath10k_ahb_remove, + .probe = ath10k_ahb_probe, + .remove = ath10k_ahb_remove, }; int ath10k_ahb_init(void) diff --git a/sys/contrib/dev/athk/ath10k/bmi.c b/sys/contrib/dev/athk/ath10k/bmi.c index 12c1983b4dd6..6dd92d29f631 100644 --- a/sys/contrib/dev/athk/ath10k/bmi.c +++ b/sys/contrib/dev/athk/ath10k/bmi.c @@ -2,8 +2,11 @@ /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2014,2016-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */ +#include #include "bmi.h" #include "hif.h" #include "debug.h" @@ -360,7 +363,7 @@ static int ath10k_bmi_lz_data_large(struct ath10k *ar, const u8 *buffer, u32 len int ret; size_t buf_len; - ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%pK length %d\n", + ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%p length %d\n", buffer, length); if (ar->bmi.done_sent) { @@ -411,7 +414,7 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const u8 *buffer, u32 length) u32 txlen; int ret; - ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%pK length %d\n", + ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length %d\n", buffer, length); if (ar->bmi.done_sent) { @@ -477,7 +480,7 @@ int ath10k_bmi_fast_download(struct ath10k *ar, int ret; ath10k_dbg(ar, ATH10K_DBG_BMI, - "bmi fast download address 0x%x buffer 0x%pK length %d\n", + "bmi fast download address 0x%x buffer 0x%p length %d\n", address, buffer, length); ret = ath10k_bmi_lz_stream_start(ar, address); diff --git a/sys/contrib/dev/athk/ath10k/ce.c b/sys/contrib/dev/athk/ath10k/ce.c index 8168e20bb09a..719957ac87e4 100644 --- a/sys/contrib/dev/athk/ath10k/ce.c +++ b/sys/contrib/dev/athk/ath10k/ce.c @@ -3,8 +3,11 @@ * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */ +#include #include "hif.h" #include "ce.h" #include "debug.h" @@ -79,7 +82,7 @@ static inline u32 shadow_sr_wr_ind_addr(struct ath10k *ar, static inline unsigned int ath10k_set_ring_byte(unsigned int offset, - struct ath10k_hw_ce_regs_addr_map *addr_map) + const struct ath10k_hw_ce_regs_addr_map *addr_map) { return ((offset << addr_map->lsb) & addr_map->mask); } @@ -202,7 +205,7 @@ static inline void ath10k_ce_src_ring_dmax_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; + const struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; u32 ctrl1_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ctrl_regs->addr); @@ -216,7 +219,7 @@ static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; + const struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; u32 ctrl1_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ctrl_regs->addr); @@ -230,7 +233,7 @@ static inline void ath10k_ce_dest_ring_byte_swap_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; + const struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; u32 ctrl1_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ctrl_regs->addr); @@ -312,7 +315,7 @@ static inline void ath10k_ce_src_ring_highmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr; + const struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr; u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + srcr_wm->addr); ath10k_ce_write32(ar, ce_ctrl_addr + srcr_wm->addr, @@ -324,7 +327,7 @@ static inline void ath10k_ce_src_ring_lowmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr; + const struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr; u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + srcr_wm->addr); ath10k_ce_write32(ar, ce_ctrl_addr + srcr_wm->addr, @@ -336,7 +339,7 @@ static inline void ath10k_ce_dest_ring_highmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr; + const struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr; u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + dstr_wm->addr); ath10k_ce_write32(ar, ce_ctrl_addr + dstr_wm->addr, @@ -348,7 +351,7 @@ static inline void ath10k_ce_dest_ring_lowmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr; + const struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr; u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + dstr_wm->addr); ath10k_ce_write32(ar, ce_ctrl_addr + dstr_wm->addr, @@ -359,7 +362,7 @@ static inline void ath10k_ce_dest_ring_lowmark_set(struct ath10k *ar, static inline void ath10k_ce_copy_complete_inter_enable(struct ath10k *ar, u32 ce_ctrl_addr) { - struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie; + const struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie; u32 host_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr); @@ -371,7 +374,7 @@ static inline void ath10k_ce_copy_complete_inter_enable(struct ath10k *ar, static inline void ath10k_ce_copy_complete_intr_disable(struct ath10k *ar, u32 ce_ctrl_addr) { - struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie; + const struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie; u32 host_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr); @@ -383,7 +386,7 @@ static inline void ath10k_ce_copy_complete_intr_disable(struct ath10k *ar, static inline void ath10k_ce_watermark_intr_disable(struct ath10k *ar, u32 ce_ctrl_addr) { - struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; + const struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; u32 host_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr); @@ -395,7 +398,7 @@ static inline void ath10k_ce_watermark_intr_disable(struct ath10k *ar, static inline void ath10k_ce_error_intr_disable(struct ath10k *ar, u32 ce_ctrl_addr) { - struct ath10k_hw_ce_misc_regs *misc_regs = ar->hw_ce_regs->misc_regs; + const struct ath10k_hw_ce_misc_regs *misc_regs = ar->hw_ce_regs->misc_regs; u32 misc_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + ar->hw_ce_regs->misc_ie_addr); @@ -409,7 +412,7 @@ static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int mask) { - struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; + const struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; ath10k_ce_write32(ar, ce_ctrl_addr + wm_regs->addr, mask); } @@ -1229,7 +1232,7 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id) { struct ath10k_ce *ce = ath10k_ce_priv(ar); struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id]; - struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; + const struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; u32 ctrl_addr = ce_state->ctrl_addr; /* @@ -1387,7 +1390,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar, ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries); ath10k_dbg(ar, ATH10K_DBG_BOOT, - "boot init ce src ring id %d entries %d base_addr %pK\n", + "boot init ce src ring id %d entries %d base_addr %p\n", ce_id, nentries, src_ring->base_addr_owner_space); return 0; @@ -1425,7 +1428,7 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar, ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries); ath10k_dbg(ar, ATH10K_DBG_BOOT, - "boot ce dest ring id %d entries %d base_addr %pK\n", + "boot ce dest ring id %d entries %d base_addr %p\n", ce_id, nentries, dest_ring->base_addr_owner_space); return 0; diff --git a/sys/contrib/dev/athk/ath10k/ce.h b/sys/contrib/dev/athk/ath10k/ce.h index 666ce384a1d8..27367bd64e95 100644 --- a/sys/contrib/dev/athk/ath10k/ce.h +++ b/sys/contrib/dev/athk/ath10k/ce.h @@ -110,7 +110,7 @@ struct ath10k_ce_ring { struct ce_desc_64 *shadow_base; /* keep last */ - void *per_transfer_context[]; + void *per_transfer_context[] __counted_by(nentries); }; struct ath10k_ce_pipe { diff --git a/sys/contrib/dev/athk/ath10k/core.c b/sys/contrib/dev/athk/ath10k/core.c index 0a65d12d202c..a0407f693659 100644 --- a/sys/contrib/dev/athk/ath10k/core.c +++ b/sys/contrib/dev/athk/ath10k/core.c @@ -3,12 +3,15 @@ * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */ #if defined(__FreeBSD__) #define LINUXKPI_PARAM_PREFIX ath10k_core_ #endif +#include #include #include #if defined(__linux__) || (defined(__FreeBSD__) && defined(CONFIG_OF)) @@ -35,6 +38,7 @@ #if defined(CONFIG_FWLOG) #include "fwlog.h" #endif +#include "leds.h" unsigned int ath10k_debug_mask; EXPORT_SYMBOL(ath10k_debug_mask); @@ -76,6 +80,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca988x hw2.0", .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 1, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, @@ -83,7 +88,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 2116, .fw = { .dir = QCA988X_HW_2_0_FW_DIR, - .board = QCA988X_HW_2_0_BOARD_DATA_FILE, .board_size = QCA988X_BOARD_DATA_SZ, .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ, }, @@ -109,6 +113,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA988X_HW_2_0_VERSION, @@ -116,6 +121,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca988x hw2.0 ubiquiti", .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 0, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, @@ -123,7 +129,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 2116, .fw = { .dir = QCA988X_HW_2_0_FW_DIR, - .board = QCA988X_HW_2_0_BOARD_DATA_FILE, .board_size = QCA988X_BOARD_DATA_SZ, .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ, }, @@ -149,6 +154,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA9887_HW_1_0_VERSION, @@ -157,6 +163,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca9887 hw1.0", .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 1, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, @@ -164,7 +171,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 2116, .fw = { .dir = QCA9887_HW_1_0_FW_DIR, - .board = QCA9887_HW_1_0_BOARD_DATA_FILE, .board_size = QCA9887_BOARD_DATA_SZ, .board_ext_size = QCA9887_BOARD_EXT_DATA_SZ, }, @@ -190,6 +196,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA6174_HW_3_2_VERSION, @@ -198,13 +205,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca6174 hw3.2 sdio", .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, .uart_pin = 19, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 0, .fw = { .dir = QCA6174_HW_3_0_FW_DIR, - .board = QCA6174_HW_3_0_BOARD_DATA_FILE, .board_size = QCA6174_BOARD_DATA_SZ, .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ, }, @@ -226,6 +233,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA6174_HW_2_1_VERSION, @@ -234,13 +242,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca6164 hw2.1", .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, .uart_pin = 6, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 8124, .fw = { .dir = QCA6174_HW_2_1_FW_DIR, - .board = QCA6174_HW_2_1_BOARD_DATA_FILE, .board_size = QCA6174_BOARD_DATA_SZ, .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ, }, @@ -266,6 +274,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA6174_HW_2_1_VERSION, @@ -274,13 +283,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca6174 hw2.1", .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, .uart_pin = 6, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 8124, .fw = { .dir = QCA6174_HW_2_1_FW_DIR, - .board = QCA6174_HW_2_1_BOARD_DATA_FILE, .board_size = QCA6174_BOARD_DATA_SZ, .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ, }, @@ -306,6 +315,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA6174_HW_3_0_VERSION, @@ -314,13 +324,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca6174 hw3.0", .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, .uart_pin = 6, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 8124, .fw = { .dir = QCA6174_HW_3_0_FW_DIR, - .board = QCA6174_HW_3_0_BOARD_DATA_FILE, .board_size = QCA6174_BOARD_DATA_SZ, .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ, }, @@ -346,6 +356,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA6174_HW_3_2_VERSION, @@ -354,6 +365,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca6174 hw3.2", .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, .uart_pin = 6, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, @@ -361,7 +373,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .fw = { /* uses same binaries as hw3.0 */ .dir = QCA6174_HW_3_0_FW_DIR, - .board = QCA6174_HW_3_0_BOARD_DATA_FILE, .board_size = QCA6174_BOARD_DATA_SZ, .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ, }, @@ -390,6 +401,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = true, }, { .id = QCA99X0_HW_2_0_DEV_VERSION, @@ -398,6 +410,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca99x0 hw2.0", .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 17, .otp_exe_param = 0x00000700, .continuous_frag_desc = true, .cck_rate_map_rev2 = true, @@ -409,7 +422,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 12064, .fw = { .dir = QCA99X0_HW_2_0_FW_DIR, - .board = QCA99X0_HW_2_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, }, @@ -436,6 +448,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA9984_HW_1_0_DEV_VERSION, @@ -444,6 +457,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca9984/qca9994 hw1.0", .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, .otp_exe_param = 0x00000700, .continuous_frag_desc = true, @@ -456,8 +470,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 12064, .fw = { .dir = QCA9984_HW_1_0_FW_DIR, - .board = QCA9984_HW_1_0_BOARD_DATA_FILE, - .eboard = QCA9984_HW_1_0_EBOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, .ext_board_size = QCA99X0_EXT_BOARD_DATA_SZ, @@ -489,6 +501,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA9888_HW_2_0_DEV_VERSION, @@ -497,6 +510,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, .otp_exe_param = 0x00000700, .continuous_frag_desc = true, @@ -508,7 +522,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 12064, .fw = { .dir = QCA9888_HW_2_0_FW_DIR, - .board = QCA9888_HW_2_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, }, @@ -539,6 +552,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA9377_HW_1_0_DEV_VERSION, @@ -547,13 +561,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca9377 hw1.0", .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 6, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 8124, .fw = { .dir = QCA9377_HW_1_0_FW_DIR, - .board = QCA9377_HW_1_0_BOARD_DATA_FILE, .board_size = QCA9377_BOARD_DATA_SZ, .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ, }, @@ -579,6 +593,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -587,13 +602,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca9377 hw1.1", .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 6, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 8124, .fw = { .dir = QCA9377_HW_1_0_FW_DIR, - .board = QCA9377_HW_1_0_BOARD_DATA_FILE, .board_size = QCA9377_BOARD_DATA_SZ, .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ, }, @@ -621,6 +636,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -629,13 +645,13 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca9377 hw1.1 sdio", .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 19, + .led_pin = 0, .otp_exe_param = 0, .channel_counters_freq_hz = 88000, .max_probe_resp_desc_thres = 0, .cal_data_len = 8124, .fw = { .dir = QCA9377_HW_1_0_FW_DIR, - .board = QCA9377_HW_1_0_BOARD_DATA_FILE, .board_size = QCA9377_BOARD_DATA_SZ, .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ, }, @@ -654,6 +670,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = QCA4019_HW_1_0_DEV_VERSION, @@ -662,6 +679,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .name = "qca4019 hw1.0", .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, + .led_pin = 0, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, .otp_exe_param = 0x0010000, .continuous_frag_desc = true, @@ -674,7 +692,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .cal_data_len = 12064, .fw = { .dir = QCA4019_HW_1_0_FW_DIR, - .board = QCA4019_HW_1_0_BOARD_DATA_FILE, .board_size = QCA4019_BOARD_DATA_SZ, .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ, }, @@ -701,18 +718,22 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .mcast_frame_registration = false, }, { .id = WCN3990_HW_1_0_DEV_VERSION, .dev_id = 0, .bus = ATH10K_BUS_SNOC, .name = "wcn3990 hw1.0", + .led_pin = 0, .continuous_frag_desc = true, .tx_chain_mask = 0x7, .rx_chain_mask = 0x7, .max_spatial_stream = 4, .fw = { .dir = WCN3990_HW_1_0_FW_DIR, + .board_size = WCN3990_BOARD_DATA_SZ, + .board_ext_size = WCN3990_BOARD_EXT_DATA_SZ, }, .sw_decrypt_mcast_mgmt = true, .rx_desc_ops = &wcn3990_rx_desc_ops, @@ -734,6 +755,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = true, .use_fw_tx_credits = false, .delay_unmap_buffer = true, + .mcast_frame_registration = false, }, }; @@ -934,11 +956,20 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar, if (dir == NULL) dir = "."; + if (ar->board_name) { + snprintf(filename, sizeof(filename), "%s/%s/%s", + dir, ar->board_name, file); + ret = firmware_request_nowarn(&fw, filename, ar->dev); + ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n", + filename, ret); + if (!ret) + return fw; + } + snprintf(filename, sizeof(filename), "%s/%s", dir, file); ret = firmware_request_nowarn(&fw, filename, ar->dev); ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n", filename, ret); - if (ret) return ERR_PTR(ret); @@ -1156,8 +1187,11 @@ int ath10k_core_check_dt(struct ath10k *ar) if (!node) return -ENOENT; - of_property_read_string(node, "qcom,ath10k-calibration-variant", + of_property_read_string(node, "qcom,calibration-variant", &variant); + if (!variant) + of_property_read_string(node, "qcom,ath10k-calibration-variant", + &variant); if (!variant) return -ENODATA; @@ -1193,7 +1227,7 @@ static int ath10k_download_fw(struct ath10k *ar) } ath10k_dbg(ar, ATH10K_DBG_BOOT, - "boot uploading firmware image %pK len %d\n", + "boot uploading firmware image %p len %d\n", data, data_len); /* Check if device supports to download firmware via @@ -1296,11 +1330,6 @@ static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type) char boardname[100]; if (bd_ie_type == ATH10K_BD_IE_BOARD) { - if (!ar->hw_params.fw.board) { - ath10k_err(ar, "failed to find board file fw entry\n"); - return -EINVAL; - } - scnprintf(boardname, sizeof(boardname), "board-%s-%s.bin", ath10k_bus_str(ar->hif.bus), dev_name(ar->dev)); @@ -1310,7 +1339,7 @@ static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type) if (IS_ERR(ar->normal_mode_fw.board)) { fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, - ar->hw_params.fw.board); + ATH10K_BOARD_DATA_FILE); ar->normal_mode_fw.board = fw; } @@ -1320,13 +1349,8 @@ static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type) ar->normal_mode_fw.board_data = ar->normal_mode_fw.board->data; ar->normal_mode_fw.board_len = ar->normal_mode_fw.board->size; } else if (bd_ie_type == ATH10K_BD_IE_BOARD_EXT) { - if (!ar->hw_params.fw.eboard) { - ath10k_err(ar, "failed to find eboard file fw entry\n"); - return -EINVAL; - } - fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, - ar->hw_params.fw.eboard); + ATH10K_EBOARD_DATA_FILE); ar->normal_mode_fw.ext_board = fw; if (IS_ERR(ar->normal_mode_fw.ext_board)) return PTR_ERR(ar->normal_mode_fw.ext_board); @@ -1582,7 +1606,7 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name, bool with_chip_id) { /* strlen(',variant=') + strlen(ar->id.bdf_ext) */ - char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 }; + char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = {}; if (with_variant && ar->id.bdf_ext[0] != '\0') scnprintf(variant, sizeof(variant), ",variant=%s", @@ -1845,7 +1869,7 @@ static int ath10k_download_and_run_otp(struct ath10k *ar) if (!ar->running_fw->fw_file.otp_data || !ar->running_fw->fw_file.otp_len) { - ath10k_warn(ar, "Not running otp, calibration will be incorrect (otp-data %pK otp_len %zd)!\n", + ath10k_warn(ar, "Not running otp, calibration will be incorrect (otp-data %p otp_len %zd)!\n", ar->running_fw->fw_file.otp_data, ar->running_fw->fw_file.otp_len); return 0; @@ -2315,7 +2339,9 @@ static int ath10k_core_pre_cal_download(struct ath10k *ar) "boot did not find a pre calibration file, try DT next: %d\n", ret); - ret = ath10k_download_cal_dt(ar, "qcom,ath10k-pre-calibration-data"); + ret = ath10k_download_cal_dt(ar, "qcom,pre-calibration-data"); + if (ret == -ENOENT) + ret = ath10k_download_cal_dt(ar, "qcom,ath10k-pre-calibration-data"); if (ret) { ath10k_dbg(ar, ATH10K_DBG_BOOT, "unable to load pre cal data from DT: %d\n", ret); @@ -2393,7 +2419,9 @@ static int ath10k_download_cal_data(struct ath10k *ar) "boot did not find a calibration file, try DT next: %d\n", ret); - ret = ath10k_download_cal_dt(ar, "qcom,ath10k-calibration-data"); + ret = ath10k_download_cal_dt(ar, "qcom,calibration-data"); + if (ret == -ENOENT) + ret = ath10k_download_cal_dt(ar, "qcom,ath10k-calibration-data"); if (ret == 0) { ar->cal_mode = ATH10K_CAL_MODE_DT; goto done; @@ -2542,12 +2570,50 @@ static int ath10k_init_hw_params(struct ath10k *ar) return 0; } +static bool ath10k_core_needs_recovery(struct ath10k *ar) +{ + long time_left; + + /* Sometimes the recovery will fail and then the next all recovery fail, + * so avoid infinite recovery. + */ + if (atomic_read(&ar->fail_cont_count) >= ATH10K_RECOVERY_MAX_FAIL_COUNT) { + ath10k_err(ar, "consecutive fail %d times, will shutdown driver!", + atomic_read(&ar->fail_cont_count)); + ar->state = ATH10K_STATE_WEDGED; + return false; + } + + ath10k_dbg(ar, ATH10K_DBG_BOOT, "total recovery count: %d", ++ar->recovery_count); + + if (atomic_read(&ar->pending_recovery)) { + /* Sometimes it happened another recovery work before the previous one *** 3827 LINES SKIPPED *** From nobody Mon Dec 15 18:09:54 2025 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 4dVSl71PSfz6L6dr for ; Mon, 15 Dec 2025 18:09:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSl7079Jz4Fmg for ; Mon, 15 Dec 2025 18:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822195; 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=OpTjpByFE/pDk4iTK/h8AYn5RcQ/Xb/3RmOxwHhx96g=; b=LBFm+VKzPz3F87nrKNl9NVOf6C/RImZO0vVdZUQOdDKPm11hIpePJfmtgrHvztlMVZXuvh TfWmB8yN57JCZ0Vq5FTlNBdZeQEvw3w3RsCzeILOvBrr6OOdSX1hlY8YsGgxX/biA8J6nx ElPK0xsARobryKZ7YZAjEQ+Ejw3AikNce5WPDYhrotnobUSVVvY4nhWIwGq6HIm7qb2FgW E6w+YpNhAdlLBLxv1sxVUrmGscj6ZLgAysq7XClEtMrxo3ZcUqLfK4lOvxmPvErUltDIo9 4S4vaNUCj9ZZ07nzTVIOaeAptJefd9yLcEyjLGJxeY4NtokGqpor3e3dWyb2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822195; 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=OpTjpByFE/pDk4iTK/h8AYn5RcQ/Xb/3RmOxwHhx96g=; b=KylmKoKz4sd73Y2mqBqT+cHjC+HVQPNF4Hiu5tlpjs7Cw5eK+bjqJPjn940xKsjbH4AU9w Y32zUg4zaHeGAkPR6N0td8Moi7TFOK4GEK4XXoKRwfMo87Q/Sspl+5dX5EIiCdQsZWQvge 5D8bD2PkXhVr8te6O0RTiWovKZytO40paPdcvgBWZpOOAo16GeAC0etX5y6EtAxLla2t4o W6s/uUL3DSAsWp9XgMSy/bR3wf9RbxWnFL9IoT3er3w7U72PpHAo5WzNs/36bXxjLu5PLW UDVG8zd9BGWhSloEbEYLIrz5wEQXIFhx0FR/WciQQsF6bHFh4Yz37xiKfnZutg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822195; a=rsa-sha256; cv=none; b=qliCE3hlqaXZXt5C8q+kQh9iOeDivRa0cLy9mRQDUCEQxxgdK0fuQx7U5uTY9y4Rh09qnv 6Edh0ftSuNo78ij1m9vvCDNI50wwV9NzTZ1ITmoxQCXRmBwzPQkv7+RxzJPeiho3x2ZqC4 vhcXaO2ZeBwvwFOUNy8nBOYi5kUkGRNy8rjgCP2gGpRSgfLzbu2+V1TefjLOmXPbfDNAIl T1WrpcqKuPGA6rt04gkIRJXz/X9EF0BAdWAc6WgqsPQvGy1ijDgljvylLGiNA96sL1JM9a 1YXqf6ucHw3/PmcLyyODrFNeQx66mr3TpuzPdmndP3BBXMNM3BSZHJRF71QWeQ== 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 4dVSl66mGyzVpg for ; Mon, 15 Dec 2025 18:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24aba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 3ebd7cbfea2f - stable/15 - LinuxKPI: ath10k: adjust for led changes to keep ath10k compiling 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3ebd7cbfea2fffa27bf41c53148e51d84c315797 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:54 +0000 Message-Id: <69404ef2.24aba.5e993387@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3ebd7cbfea2fffa27bf41c53148e51d84c315797 commit 3ebd7cbfea2fffa27bf41c53148e51d84c315797 Author: Bjoern A. Zeeb AuthorDate: 2025-12-06 09:57:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:20 +0000 LinuxKPI: ath10k: adjust for led changes to keep ath10k compiling Add the conditional compile time option defaulting to off as we do not support leds in LinuxKPI to ath10k for the new file. Add empty struct gpio_led to LinuxKPI. (cherry picked from commit fe7b6fc32455389d1b8452c67e1ddcfbc4e5f5cc) --- sys/compat/linuxkpi/common/include/linux/leds.h | 5 ++++- sys/modules/ath10k/Makefile | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/leds.h b/sys/compat/linuxkpi/common/include/linux/leds.h index 89f7286f6800..b9b694f6e304 100644 --- a/sys/compat/linuxkpi/common/include/linux/leds.h +++ b/sys/compat/linuxkpi/common/include/linux/leds.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2022 Bjoern A. Zeeb + * Copyright (c) 2022-2025 Bjoern A. Zeeb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,4 +38,7 @@ struct led_classdev { void (*led_set)(struct led_classdev *, enum led_brightness); }; +struct gpio_led { +}; + #endif /* _LINUXKPI_LINUX_LEDS_H */ diff --git a/sys/modules/ath10k/Makefile b/sys/modules/ath10k/Makefile index eb02bda1699f..98df270b6791 100644 --- a/sys/modules/ath10k/Makefile +++ b/sys/modules/ath10k/Makefile @@ -3,6 +3,7 @@ DEVATH10KDIR= ${SRCTOP}/sys/contrib/dev/athk/ath10k .PATH: ${DEVATH10KDIR} WITH_CONFIG_FWLOG= 1 +WITH_LEDS= 0 KMOD= if_ath10k @@ -22,6 +23,11 @@ SRCS+= fwlog.c CFLAGS+= -DCONFIG_FWLOG=${WITH_CONFIG_FWLOG} .endif +.if defined(WITH_LEDS) && ${WITH_LEDS} > 0 +CFLAGS+= -DCONFIG_ATH10K_LEDS +SRCS+= leds.c +.endif + CFLAGS+= -DKBUILD_MODNAME='"ath10k"' CFLAGS+= -I${DEVATH10KDIR} From nobody Mon Dec 15 18:09:56 2025 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 4dVSl848S7z6L6ds for ; Mon, 15 Dec 2025 18:09:56 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSl823cPz4FbH for ; Mon, 15 Dec 2025 18:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822196; 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=TztMWzd6Cx4tSpJUA9iONiSjcJ9qRQdlHdzhPEBBChs=; b=pK7u6kGF5493OzZFpWwK0DRAmUJmRmkZaeL02Lt8YgIgiXfrNjW0Y7/BF1hguv9WtKrvjR umE1bGV9Rzt4+yZ93QtmDTkFc1Zag56+4hF1hU8t6Bc1vN5pJxuPIyAhjNwneOMuNnmEMu n7lYCoGXp35FDiRHGs8BgSeeNh31Yz0waoXE/FDbN5SUh4ykoGDOi/smoSlkwwrg/dLLcx KVN5+DgrPg2dRgcX1WDS8LuXlOSMkymjx7OmU08/Zy2NoJce9WhtAvqwKKfZdBiJOcXAz+ uUapG2NUW0Zw9A/irapyu/vF56A7Cvx8EYQg4/mU6vDrrLc5ppUDHiazbDwUZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822196; 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=TztMWzd6Cx4tSpJUA9iONiSjcJ9qRQdlHdzhPEBBChs=; b=p+U0Endzq8w9lXS1vvyiWpDuSw4EmlhuodnPWz6C0oeNpBVi6pp2EnS9iEvYGoaOoFMjY7 +G2aAXnT/Jpy8IVKN7JZGkHLcMFGfF2HUokSfQMnfw+b+3uJrJX7J2Ey4wATt75oD7oVpU nblA8GHcuPV3IVUXUx20PAmpZGIetZTApLdlRGeQshjiyDNmQSz29x7r1DsTW4trasMsQa ckQojhv/baq7N8vxxoYJiGnKwRGqHWAlh4nyqLxsRULa0r/N3QKiM+Q4xOhkPxbtXt21ZZ R08nakQEjQxMUmhAuYAsXC1N+t4FnHkGB5l/YqJnRy90Vw2lpMLS2O0SatpZDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822196; a=rsa-sha256; cv=none; b=ftgjItb2tDQED+n/tFnAwmw6HGILziYUtCUh1KCh5pTllWdGrIOj2MADSSTx7pvZfJdCtP 4ATFzgyClRi88HTEN8Qhvx0LhqZFeXtTCzvaVeD5JYMmPIED+H7yUcncDe5h9POQub2grh bg5Y5PkbvqwDjKpOECWU6sGS/7hHBAQWicEnJsfENymOo0Q8TmH+CRjyD9JNEpv+4ywIwo AppEMlyjytwf+Pgt9zKaFJsbouVfPLpfgMAj6y0syJw8S+XWOsQnv1luFb3gW9LifOxcj0 Der/tucNWJrtRDi37ZCJPumnBir7L20ULdRg25ZFhLFu0PE73AOPNTJr2UpOUw== 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 4dVSl81NDtzVpj for ; Mon, 15 Dec 2025 18:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23250 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: c439ae17b1b8 - stable/15 - ath11k: update Atheros/QCA's ath11k driver 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c439ae17b1b8dce71e36df45738c8430ec0c7a4e Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:56 +0000 Message-Id: <69404ef4.23250.21138d68@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c439ae17b1b8dce71e36df45738c8430ec0c7a4e commit c439ae17b1b8dce71e36df45738c8430ec0c7a4e Author: Bjoern A. Zeeb AuthorDate: 2025-12-06 10:16:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:20 +0000 ath11k: update Atheros/QCA's ath11k driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ). Merge commit '989a88787ef2c1a73f44b82031a6f4f4470e2676' Sponsored by: The FreeBSD Foundation (cherry picked from commit c95ea407b322379bcb3c013a2dca9a18072c1df8) --- sys/contrib/dev/athk/ath11k/Kconfig | 3 +- sys/contrib/dev/athk/ath11k/Makefile | 5 +- sys/contrib/dev/athk/ath11k/ahb.c | 149 +- sys/contrib/dev/athk/ath11k/ce.c | 19 +- sys/contrib/dev/athk/ath11k/ce.h | 8 +- sys/contrib/dev/athk/ath11k/core.c | 817 +++++++-- sys/contrib/dev/athk/ath11k/core.h | 132 +- sys/contrib/dev/athk/ath11k/coredump.c | 54 + sys/contrib/dev/athk/ath11k/coredump.h | 79 + sys/contrib/dev/athk/ath11k/dbring.c | 4 +- sys/contrib/dev/athk/ath11k/dbring.h | 1 + sys/contrib/dev/athk/ath11k/debug.c | 3 + sys/contrib/dev/athk/ath11k/debug.h | 2 +- sys/contrib/dev/athk/ath11k/debugfs.c | 228 +-- sys/contrib/dev/athk/ath11k/debugfs.h | 21 +- sys/contrib/dev/athk/ath11k/debugfs_htt_stats.c | 17 +- sys/contrib/dev/athk/ath11k/debugfs_htt_stats.h | 2 +- sys/contrib/dev/athk/ath11k/debugfs_sta.c | 42 +- sys/contrib/dev/athk/ath11k/debugfs_sta.h | 1 + sys/contrib/dev/athk/ath11k/dp.c | 42 +- sys/contrib/dev/athk/ath11k/dp.h | 32 +- sys/contrib/dev/athk/ath11k/dp_rx.c | 335 ++-- sys/contrib/dev/athk/ath11k/dp_rx.h | 3 + sys/contrib/dev/athk/ath11k/dp_tx.c | 59 +- sys/contrib/dev/athk/ath11k/dp_tx.h | 3 +- sys/contrib/dev/athk/ath11k/fw.c | 171 ++ sys/contrib/dev/athk/ath11k/fw.h | 27 + sys/contrib/dev/athk/ath11k/hal.c | 99 +- sys/contrib/dev/athk/ath11k/hal.h | 14 +- sys/contrib/dev/athk/ath11k/hal_desc.h | 1 + sys/contrib/dev/athk/ath11k/hal_rx.c | 37 +- sys/contrib/dev/athk/ath11k/hal_rx.h | 19 +- sys/contrib/dev/athk/ath11k/hal_tx.c | 2 +- sys/contrib/dev/athk/ath11k/hal_tx.h | 4 +- sys/contrib/dev/athk/ath11k/hif.h | 68 +- sys/contrib/dev/athk/ath11k/htc.c | 3 +- sys/contrib/dev/athk/ath11k/htc.h | 18 +- sys/contrib/dev/athk/ath11k/hw.c | 4 +- sys/contrib/dev/athk/ath11k/hw.h | 6 +- sys/contrib/dev/athk/ath11k/mac.c | 2038 ++++++++++++++++------- sys/contrib/dev/athk/ath11k/mac.h | 6 + sys/contrib/dev/athk/ath11k/mhi.c | 129 +- sys/contrib/dev/athk/ath11k/mhi.h | 4 +- sys/contrib/dev/athk/ath11k/p2p.c | 149 ++ sys/contrib/dev/athk/ath11k/p2p.h | 22 + sys/contrib/dev/athk/ath11k/pci.c | 311 +++- sys/contrib/dev/athk/ath11k/pci.h | 4 +- sys/contrib/dev/athk/ath11k/pcic.c | 70 +- sys/contrib/dev/athk/ath11k/peer.c | 4 +- sys/contrib/dev/athk/ath11k/peer.h | 2 +- sys/contrib/dev/athk/ath11k/qmi.c | 142 +- sys/contrib/dev/athk/ath11k/qmi.h | 12 +- sys/contrib/dev/athk/ath11k/reg.c | 398 ++++- sys/contrib/dev/athk/ath11k/reg.h | 16 +- sys/contrib/dev/athk/ath11k/rx_desc.h | 1 + sys/contrib/dev/athk/ath11k/spectral.c | 32 +- sys/contrib/dev/athk/ath11k/spectral.h | 1 + sys/contrib/dev/athk/ath11k/testmode.c | 86 +- sys/contrib/dev/athk/ath11k/testmode_i.h | 66 - sys/contrib/dev/athk/ath11k/thermal.c | 28 +- sys/contrib/dev/athk/ath11k/thermal.h | 9 +- sys/contrib/dev/athk/ath11k/trace.c | 2 + sys/contrib/dev/athk/ath11k/trace.h | 45 +- sys/contrib/dev/athk/ath11k/wmi.c | 554 +++--- sys/contrib/dev/athk/ath11k/wmi.h | 299 ++-- sys/contrib/dev/athk/ath11k/wow.c | 45 +- sys/contrib/dev/athk/ath11k/wow.h | 1 + 67 files changed, 4897 insertions(+), 2113 deletions(-) diff --git a/sys/contrib/dev/athk/ath11k/Kconfig b/sys/contrib/dev/athk/ath11k/Kconfig index ad5cc6cac05b..659ef134ef16 100644 --- a/sys/contrib/dev/athk/ath11k/Kconfig +++ b/sys/contrib/dev/athk/ath11k/Kconfig @@ -2,7 +2,7 @@ config ATH11K tristate "Qualcomm Technologies 802.11ax chipset support" depends on MAC80211 && HAS_DMA - depends on CRYPTO_MICHAEL_MIC + select CRYPTO_MICHAEL_MIC select ATH_COMMON select QCOM_QMI_HELPERS help @@ -24,6 +24,7 @@ config ATH11K_PCI select MHI_BUS select QRTR select QRTR_MHI + select PCI_PWRCTRL_PWRSEQ if HAVE_PWRCTRL help This module adds support for PCIE bus diff --git a/sys/contrib/dev/athk/ath11k/Makefile b/sys/contrib/dev/athk/ath11k/Makefile index cc47e0114595..d9092414b362 100644 --- a/sys/contrib/dev/athk/ath11k/Makefile +++ b/sys/contrib/dev/athk/ath11k/Makefile @@ -17,7 +17,9 @@ ath11k-y += core.o \ peer.o \ dbring.o \ hw.o \ - pcic.o + pcic.o \ + fw.o \ + p2p.o ath11k-$(CONFIG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o @@ -25,6 +27,7 @@ ath11k-$(CONFIG_ATH11K_TRACING) += trace.o ath11k-$(CONFIG_THERMAL) += thermal.o ath11k-$(CONFIG_ATH11K_SPECTRAL) += spectral.o ath11k-$(CONFIG_PM) += wow.o +ath11k-$(CONFIG_DEV_COREDUMP) += coredump.o obj-$(CONFIG_ATH11K_AHB) += ath11k_ahb.o ath11k_ahb-y += ahb.o diff --git a/sys/contrib/dev/athk/ath11k/ahb.c b/sys/contrib/dev/athk/ath11k/ahb.c index ceb3ccbb1827..8dfe9b40c126 100644 --- a/sys/contrib/dev/athk/ath11k/ahb.c +++ b/sys/contrib/dev/athk/ath11k/ahb.c @@ -1,15 +1,16 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include #include +#include #include #include +#include #include -#include #include #include "ahb.h" #include "debug.h" @@ -396,7 +397,7 @@ static void ath11k_ahb_stop(struct ath11k_base *ab) ath11k_ahb_ce_irqs_disable(ab); ath11k_ahb_sync_ce_irqs(ab); ath11k_ahb_kill_tasklets(ab); - del_timer_sync(&ab->rx_replenish_retry); + timer_delete_sync(&ab->rx_replenish_retry); ath11k_ce_cleanup_pipes(ab); } @@ -412,7 +413,7 @@ static int ath11k_ahb_power_up(struct ath11k_base *ab) return ret; } -static void ath11k_ahb_power_down(struct ath11k_base *ab) +static void ath11k_ahb_power_down(struct ath11k_base *ab, bool is_suspend) { struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab); @@ -441,6 +442,7 @@ static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) free_irq(ab->irq_num[irq_grp->irqs[j]], irq_grp); netif_napi_del(&irq_grp->napi); + free_netdev(irq_grp->napi_ndev); } } @@ -532,8 +534,12 @@ static int ath11k_ahb_config_ext_irq(struct ath11k_base *ab) irq_grp->ab = ab; irq_grp->grp_id = i; - init_dummy_netdev(&irq_grp->napi_ndev); - netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi, + + irq_grp->napi_ndev = alloc_netdev_dummy(0); + if (!irq_grp->napi_ndev) + return -ENOMEM; + + netif_napi_add(irq_grp->napi_ndev, &irq_grp->napi, ath11k_ahb_ext_grp_napi_poll); for (j = 0; j < ATH11K_EXT_IRQ_NUM_MAX; j++) { @@ -802,8 +808,8 @@ static int ath11k_core_get_rproc(struct ath11k_base *ab) prproc = rproc_get_by_phandle(rproc_phandle); if (!prproc) { - ath11k_err(ab, "failed to get rproc\n"); - return -EINVAL; + ath11k_dbg(ab, ATH11K_DBG_AHB, "failed to get rproc, deferring\n"); + return -EPROBE_DEFER; } ab_ahb->tgt_rproc = prproc; @@ -913,16 +919,10 @@ static int ath11k_ahb_setup_msa_resources(struct ath11k_base *ab) { struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab); struct device *dev = ab->dev; - struct device_node *node; struct resource r; int ret; - node = of_parse_phandle(dev->of_node, "memory-region", 0); - if (!node) - return -ENOENT; - - ret = of_address_to_resource(node, 0, &r); - of_node_put(node); + ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &r); if (ret) { dev_err(dev, "failed to resolve msa fixed region\n"); return ret; @@ -931,12 +931,7 @@ static int ath11k_ahb_setup_msa_resources(struct ath11k_base *ab) ab_ahb->fw.msa_paddr = r.start; ab_ahb->fw.msa_size = resource_size(&r); - node = of_parse_phandle(dev->of_node, "memory-region", 1); - if (!node) - return -ENOENT; - - ret = of_address_to_resource(node, 0, &r); - of_node_put(node); + ret = of_reserved_mem_region_to_resource(dev->of_node, 1, &r); if (ret) { dev_err(dev, "failed to resolve ce fixed region\n"); return ret; @@ -948,11 +943,41 @@ static int ath11k_ahb_setup_msa_resources(struct ath11k_base *ab) return 0; } +static int ath11k_ahb_ce_remap(struct ath11k_base *ab) +{ + const struct ce_remap *ce_remap = ab->hw_params.ce_remap; + struct platform_device *pdev = ab->pdev; + + if (!ce_remap) { + /* no separate CE register space */ + ab->mem_ce = ab->mem; + return 0; + } + + /* ce register space is moved out of wcss unlike ipq8074 or ipq6018 + * and the space is not contiguous, hence remapping the CE registers + * to a new space for accessing them. + */ + ab->mem_ce = ioremap(ce_remap->base, ce_remap->size); + if (!ab->mem_ce) { + dev_err(&pdev->dev, "ce ioremap error\n"); + return -ENOMEM; + } + + return 0; +} + +static void ath11k_ahb_ce_unmap(struct ath11k_base *ab) +{ + if (ab->hw_params.ce_remap) + iounmap(ab->mem_ce); +} + static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab) { struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab); struct device *host_dev = ab->dev; - struct platform_device_info info = {0}; + struct platform_device_info info = {}; struct iommu_domain *iommu_dom; struct platform_device *pdev; struct device_node *node; @@ -964,18 +989,18 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab) if (!ab->hw_params.fixed_fw_mem) return 0; - ret = ath11k_ahb_setup_msa_resources(ab); - if (ret) { - ath11k_err(ab, "failed to setup msa resources\n"); - return ret; - } - node = of_get_child_by_name(host_dev->of_node, "wifi-firmware"); if (!node) { ab_ahb->fw.use_tz = true; return 0; } + ret = ath11k_ahb_setup_msa_resources(ab); + if (ret) { + ath11k_err(ab, "failed to setup msa resources\n"); + return ret; + } + info.fwnode = &node->fwnode; info.parent = host_dev; info.name = node->name; @@ -995,10 +1020,10 @@ static int ath11k_ahb_fw_resources_init(struct ath11k_base *ab) ab_ahb->fw.dev = &pdev->dev; - iommu_dom = iommu_domain_alloc(&platform_bus_type); - if (!iommu_dom) { + iommu_dom = iommu_paging_domain_alloc(ab_ahb->fw.dev); + if (IS_ERR(iommu_dom)) { ath11k_err(ab, "failed to allocate iommu domain\n"); - ret = -ENOMEM; + ret = PTR_ERR(iommu_dom); goto err_unregister; } @@ -1084,19 +1109,12 @@ static int ath11k_ahb_fw_resource_deinit(struct ath11k_base *ab) static int ath11k_ahb_probe(struct platform_device *pdev) { struct ath11k_base *ab; - const struct of_device_id *of_id; const struct ath11k_hif_ops *hif_ops; const struct ath11k_pci_ops *pci_ops; enum ath11k_hw_rev hw_rev; int ret; - of_id = of_match_device(ath11k_ahb_of_match, &pdev->dev); - if (!of_id) { - dev_err(&pdev->dev, "failed to find matching device tree id\n"); - return -EINVAL; - } - - hw_rev = (enum ath11k_hw_rev)of_id->data; + hw_rev = (uintptr_t)device_get_match_data(&pdev->dev); switch (hw_rev) { case ATH11K_HW_IPQ8074: @@ -1147,25 +1165,13 @@ static int ath11k_ahb_probe(struct platform_device *pdev) if (ret) goto err_core_free; - ab->mem_ce = ab->mem; - - if (ab->hw_params.ce_remap) { - const struct ce_remap *ce_remap = ab->hw_params.ce_remap; - /* ce register space is moved out of wcss unlike ipq8074 or ipq6018 - * and the space is not contiguous, hence remapping the CE registers - * to a new space for accessing them. - */ - ab->mem_ce = ioremap(ce_remap->base, ce_remap->size); - if (!ab->mem_ce) { - dev_err(&pdev->dev, "ce ioremap error\n"); - ret = -ENOMEM; - goto err_core_free; - } - } + ret = ath11k_ahb_ce_remap(ab); + if (ret) + goto err_core_free; ret = ath11k_ahb_fw_resources_init(ab); if (ret) - goto err_core_free; + goto err_ce_unmap; ret = ath11k_ahb_setup_smp2p_handle(ab); if (ret) @@ -1217,6 +1223,9 @@ err_release_smp2p_handle: err_fw_deinit: ath11k_ahb_fw_resource_deinit(ab); +err_ce_unmap: + ath11k_ahb_ce_unmap(ab); + err_core_free: ath11k_core_free(ab); platform_set_drvdata(pdev, NULL); @@ -1249,20 +1258,18 @@ static void ath11k_ahb_free_resources(struct ath11k_base *ab) ath11k_ahb_release_smp2p_handle(ab); ath11k_ahb_fw_resource_deinit(ab); ath11k_ce_free_pipes(ab); - - if (ab->hw_params.ce_remap) - iounmap(ab->mem_ce); + ath11k_ahb_ce_unmap(ab); ath11k_core_free(ab); platform_set_drvdata(pdev, NULL); } -static int ath11k_ahb_remove(struct platform_device *pdev) +static void ath11k_ahb_remove(struct platform_device *pdev) { struct ath11k_base *ab = platform_get_drvdata(pdev); if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { - ath11k_ahb_power_down(ab); + ath11k_ahb_power_down(ab, false); ath11k_debugfs_soc_destroy(ab); ath11k_qmi_deinit_service(ab); goto qmi_fail; @@ -1272,9 +1279,8 @@ static int ath11k_ahb_remove(struct platform_device *pdev) ath11k_core_deinit(ab); qmi_fail: + ath11k_fw_destroy(ab); ath11k_ahb_free_resources(ab); - - return 0; } static void ath11k_ahb_shutdown(struct platform_device *pdev) @@ -1293,30 +1299,21 @@ static void ath11k_ahb_shutdown(struct platform_device *pdev) ath11k_core_deinit(ab); free_resources: + ath11k_fw_destroy(ab); ath11k_ahb_free_resources(ab); } static struct platform_driver ath11k_ahb_driver = { - .driver = { - .name = "ath11k", + .driver = { + .name = "ath11k", .of_match_table = ath11k_ahb_of_match, }, - .probe = ath11k_ahb_probe, + .probe = ath11k_ahb_probe, .remove = ath11k_ahb_remove, .shutdown = ath11k_ahb_shutdown, }; -static int ath11k_ahb_init(void) -{ - return platform_driver_register(&ath11k_ahb_driver); -} -module_init(ath11k_ahb_init); - -static void ath11k_ahb_exit(void) -{ - platform_driver_unregister(&ath11k_ahb_driver); -} -module_exit(ath11k_ahb_exit); +module_platform_driver(ath11k_ahb_driver); MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices"); MODULE_LICENSE("Dual BSD/GPL"); diff --git a/sys/contrib/dev/athk/ath11k/ce.c b/sys/contrib/dev/athk/ath11k/ce.c index c6a20a635016..1c1bf303ad77 100644 --- a/sys/contrib/dev/athk/ath11k/ce.c +++ b/sys/contrib/dev/athk/ath11k/ce.c @@ -1,9 +1,11 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. - * Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */ +#include #include "dp_rx.h" #include "debug.h" #include "hif.h" @@ -352,7 +354,8 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr); if (ret) { - ath11k_warn(ab, "failed to enqueue rx buf: %d\n", ret); + ath11k_dbg(ab, ATH11K_DBG_CE, "failed to enqueue rx buf: %d\n", + ret); dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); @@ -394,10 +397,6 @@ static int ath11k_ce_completed_recv_next(struct ath11k_ce_pipe *pipe, } *nbytes = ath11k_hal_ce_dst_status_get_length(desc); - if (*nbytes == 0) { - ret = -EIO; - goto err; - } *skb = pipe->dest_ring->skb[sw_index]; pipe->dest_ring->skb[sw_index] = NULL; @@ -430,8 +429,8 @@ static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) dma_unmap_single(ab->dev, ATH11K_SKB_RXCB(skb)->paddr, max_nbytes, DMA_FROM_DEVICE); - if (unlikely(max_nbytes < nbytes)) { - ath11k_warn(ab, "rxed more than expected (nbytes %d, max %d)", + if (unlikely(max_nbytes < nbytes || nbytes == 0)) { + ath11k_warn(ab, "unexpected rx length (nbytes %d, max %d)", nbytes, max_nbytes); dev_kfree_skb_any(skb); continue; @@ -556,7 +555,7 @@ static int ath11k_ce_init_ring(struct ath11k_base *ab, struct ath11k_ce_ring *ce_ring, int ce_id, enum hal_ring_type type) { - struct hal_srng_params params = { 0 }; + struct hal_srng_params params = {}; int ret; params.ring_base_paddr = ce_ring->base_addr_ce_space; @@ -908,7 +907,7 @@ EXPORT_SYMBOL(ath11k_ce_rx_post_buf); void ath11k_ce_rx_replenish_retry(struct timer_list *t) { - struct ath11k_base *ab = from_timer(ab, t, rx_replenish_retry); + struct ath11k_base *ab = timer_container_of(ab, t, rx_replenish_retry); ath11k_ce_rx_post_buf(ab); } diff --git a/sys/contrib/dev/athk/ath11k/ce.h b/sys/contrib/dev/athk/ath11k/ce.h index 1fc6360e7f01..bcde2fcf02cf 100644 --- a/sys/contrib/dev/athk/ath11k/ce.h +++ b/sys/contrib/dev/athk/ath11k/ce.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef ATH11K_CE_H @@ -145,7 +146,7 @@ struct ath11k_ce_ring { /* Host address space */ void *base_addr_owner_space_unaligned; /* CE address space */ - u32 base_addr_ce_space_unaligned; + dma_addr_t base_addr_ce_space_unaligned; /* Actual start of descriptors. * Aligned to descriptor-size boundary. @@ -155,7 +156,7 @@ struct ath11k_ce_ring { void *base_addr_owner_space; /* CE address space */ - u32 base_addr_ce_space; + dma_addr_t base_addr_ce_space; /* HAL ring id */ u32 hal_ring_id; @@ -203,9 +204,6 @@ int ath11k_ce_alloc_pipes(struct ath11k_base *ab); void ath11k_ce_free_pipes(struct ath11k_base *ab); int ath11k_ce_get_attr_flags(struct ath11k_base *ab, int ce_id); void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id); -int ath11k_ce_map_service_to_pipe(struct ath11k_base *ab, u16 service_id, - u8 *ul_pipe, u8 *dl_pipe); -int ath11k_ce_attr_attach(struct ath11k_base *ab); void ath11k_ce_get_shadow_config(struct ath11k_base *ab, u32 **shadow_cfg, u32 *shadow_cfg_len); void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab); diff --git a/sys/contrib/dev/athk/ath11k/core.c b/sys/contrib/dev/athk/ath11k/core.c index 74585169a215..cda61c23fb68 100644 --- a/sys/contrib/dev/athk/ath11k/core.c +++ b/sys/contrib/dev/athk/ath11k/core.c @@ -1,13 +1,15 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */ #if defined(__FreeBSD__) #define LINUXKPI_PARAM_PREFIX ath11k_core_ #endif +#include #include #include #include @@ -25,6 +27,7 @@ #include "debug.h" #include "hif.h" #include "wow.h" +#include "fw.h" unsigned int ath11k_debug_mask; EXPORT_SYMBOL(ath11k_debug_mask); @@ -70,7 +73,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, .single_pdev_only = false, .rxdma1_enable = true, - .num_rxmda_per_pdev = 1, + .num_rxdma_per_pdev = 1, .rx_mac_buf_ring = false, .vdev_start_delay = false, .htt_peer_map_v2 = true, @@ -130,6 +133,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tcl_ring_retry = true, .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, + .support_dual_stations = false, + .pdev_suspend = false, }, { .hw_rev = ATH11K_HW_IPQ6018_HW10, @@ -155,7 +160,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, .single_pdev_only = false, .rxdma1_enable = true, - .num_rxmda_per_pdev = 1, + .num_rxdma_per_pdev = 1, .rx_mac_buf_ring = false, .vdev_start_delay = false, .htt_peer_map_v2 = true, @@ -213,6 +218,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = false, + .support_dual_stations = false, + .pdev_suspend = false, }, { .name = "qca6390 hw2.0", @@ -238,7 +245,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, .single_pdev_only = true, .rxdma1_enable = false, - .num_rxmda_per_pdev = 2, + .num_rxdma_per_pdev = 2, .rx_mac_buf_ring = true, .vdev_start_delay = true, .htt_peer_map_v2 = false, @@ -253,7 +260,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { }, .interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_AP), + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_DEVICE) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), .supports_monitor = false, .full_monitor_mode = false, .supports_shadow_regs = true, @@ -263,7 +273,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .coldboot_cal_ftm = false, .cbcal_restart_fw = false, .fw_mem_mode = 0, - .num_vdevs = 16 + 1, + .num_vdevs = 2 + 1, .num_peers = 512, .supports_suspend = true, .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), @@ -298,6 +308,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = true, + .support_dual_stations = true, + .pdev_suspend = false, }, { .name = "qcn9074 hw1.0", @@ -322,7 +334,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .svc_to_ce_map_len = 18, .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, .rxdma1_enable = true, - .num_rxmda_per_pdev = 1, + .num_rxdma_per_pdev = 1, .rx_mac_buf_ring = false, .vdev_start_delay = false, .htt_peer_map_v2 = true, @@ -380,6 +392,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = false, + .support_dual_stations = false, + .pdev_suspend = false, }, { .name = "wcn6855 hw2.0", @@ -405,7 +419,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, .single_pdev_only = true, .rxdma1_enable = false, - .num_rxmda_per_pdev = 2, + .num_rxdma_per_pdev = 2, .rx_mac_buf_ring = true, .vdev_start_delay = true, .htt_peer_map_v2 = false, @@ -420,7 +434,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { }, .interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_AP), + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_DEVICE) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), .supports_monitor = false, .full_monitor_mode = false, .supports_shadow_regs = true, @@ -430,7 +447,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .coldboot_cal_ftm = false, .cbcal_restart_fw = false, .fw_mem_mode = 0, - .num_vdevs = 16 + 1, + .num_vdevs = 2 + 1, .num_peers = 512, .supports_suspend = true, .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), @@ -465,6 +482,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = true, + .support_dual_stations = true, + .pdev_suspend = false, }, { .name = "wcn6855 hw2.1", @@ -489,7 +508,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .svc_to_ce_map_len = 14, .single_pdev_only = true, .rxdma1_enable = false, - .num_rxmda_per_pdev = 2, + .num_rxdma_per_pdev = 2, .rx_mac_buf_ring = true, .vdev_start_delay = true, .htt_peer_map_v2 = false, @@ -504,7 +523,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { }, .interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_AP), + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_DEVICE) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), .supports_monitor = false, .supports_shadow_regs = true, .idle_ps = true, @@ -513,7 +535,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .coldboot_cal_ftm = false, .cbcal_restart_fw = false, .fw_mem_mode = 0, - .num_vdevs = 16 + 1, + .num_vdevs = 2 + 1, .num_peers = 512, .supports_suspend = true, .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), @@ -548,6 +570,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = true, + .support_dual_stations = true, + .pdev_suspend = false, }, { .name = "wcn6750 hw1.0", @@ -573,7 +597,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, .single_pdev_only = true, .rxdma1_enable = false, - .num_rxmda_per_pdev = 1, + .num_rxdma_per_pdev = 1, .rx_mac_buf_ring = true, .vdev_start_delay = true, .htt_peer_map_v2 = false, @@ -597,7 +621,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .coldboot_cal_ftm = true, .cbcal_restart_fw = false, .fw_mem_mode = 0, - .num_vdevs = 16 + 1, + .num_vdevs = 3, .num_peers = 512, .supports_suspend = false, .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), @@ -609,7 +633,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .supports_dynamic_smps_6ghz = false, .alloc_cacheable_memory = false, .supports_rssi_stats = true, - .fw_wmi_diag_event = false, + .fw_wmi_diag_event = true, .current_cc_support = true, .dbr_debug_support = false, .global_reset = false, @@ -629,6 +653,8 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750, .smp2p_wow_exit = true, .support_fw_mac_sequence = true, + .support_dual_stations = false, + .pdev_suspend = true, }, { .hw_rev = ATH11K_HW_IPQ5018_HW10, @@ -665,7 +691,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .ce_ie_addr = &ath11k_ce_ie_addr_ipq5018, .ce_remap = &ath11k_ce_remap_ipq5018, .rxdma1_enable = true, - .num_rxmda_per_pdev = RXDMA_PER_PDEV_5018, + .num_rxdma_per_pdev = RXDMA_PER_PDEV_5018, .rx_mac_buf_ring = false, .vdev_start_delay = false, .htt_peer_map_v2 = true, @@ -710,15 +736,275 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = false, + .support_dual_stations = false, + .pdev_suspend = false, }, -}; + { + .name = "qca2066 hw2.1", + .hw_rev = ATH11K_HW_QCA2066_HW21, + .fw = { + .dir = "QCA2066/hw2.1", + .board_size = 256 * 1024, + .cal_offset = 128 * 1024, + }, + .max_radios = 3, + .bdf_addr = 0x4B0C0000, + .hw_ops = &wcn6855_ops, + .ring_mask = &ath11k_hw_ring_mask_qca6390, + .internal_sleep_clock = true, + .regs = &wcn6855_regs, + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390, + .host_ce_config = ath11k_host_ce_config_qca6390, + .ce_count = 9, + .target_ce_config = ath11k_target_ce_config_wlan_qca6390, + .target_ce_count = 9, + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390, + .svc_to_ce_map_len = 14, + .ce_ie_addr = &ath11k_ce_ie_addr_ipq8074, + .single_pdev_only = true, + .rxdma1_enable = false, + .num_rxdma_per_pdev = 2, + .rx_mac_buf_ring = true, + .vdev_start_delay = true, + .htt_peer_map_v2 = false, -static inline struct ath11k_pdev *ath11k_core_get_single_pdev(struct ath11k_base *ab) -{ - WARN_ON(!ab->hw_params.single_pdev_only); + .spectral = { + .fft_sz = 0, + .fft_pad_sz = 0, + .summary_pad_sz = 0, + .fft_hdr_len = 0, + .max_fft_bins = 0, + .fragment_160mhz = false, + }, - return &ab->pdevs[0]; -} + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_DEVICE) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), + .supports_monitor = false, + .full_monitor_mode = false, + .supports_shadow_regs = true, + .idle_ps = true, + .supports_sta_ps = true, + .coldboot_cal_mm = false, + .coldboot_cal_ftm = false, + .cbcal_restart_fw = false, + .fw_mem_mode = 0, + .num_vdevs = 2 + 1, + .num_peers = 512, + .supports_suspend = true, + .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), + .supports_regdb = true, + .fix_l1ss = false, + .credit_flow = true, + .max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390, + .hal_params = &ath11k_hw_hal_params_qca6390, + .supports_dynamic_smps_6ghz = false, + .alloc_cacheable_memory = false, + .supports_rssi_stats = true, + .fw_wmi_diag_event = true, + .current_cc_support = true, + .dbr_debug_support = false, + .global_reset = true, + .bios_sar_capa = &ath11k_hw_sar_capa_wcn6855, + .m3_fw_support = true, + .fixed_bdf_addr = false, + .fixed_mem_region = false, + .static_window_map = false, + .hybrid_bus_type = false, + .fixed_fw_mem = false, + .support_off_channel_tx = true, + .supports_multi_bssid = true, + + .sram_dump = { + .start = 0x01400000, + .end = 0x0177ffff, + }, + + .tcl_ring_retry = true, + .tx_ring_size = DP_TCL_DATA_RING_SIZE, + .smp2p_wow_exit = false, + .support_fw_mac_sequence = true, + .support_dual_stations = true, + }, + { + .name = "qca6698aq hw2.1", + .hw_rev = ATH11K_HW_QCA6698AQ_HW21, + .fw = { + .dir = "QCA6698AQ/hw2.1", + .board_size = 256 * 1024, + .cal_offset = 128 * 1024, + }, + .max_radios = 3, + .bdf_addr = 0x4B0C0000, + .hw_ops = &wcn6855_ops, + .ring_mask = &ath11k_hw_ring_mask_qca6390, + .internal_sleep_clock = true, + .regs = &wcn6855_regs, + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390, + .host_ce_config = ath11k_host_ce_config_qca6390, + .ce_count = 9, + .target_ce_config = ath11k_target_ce_config_wlan_qca6390, + .target_ce_count = 9, + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390, + .svc_to_ce_map_len = 14, + .single_pdev_only = true, + .rxdma1_enable = false, + .num_rxdma_per_pdev = 2, + .rx_mac_buf_ring = true, + .vdev_start_delay = true, + .htt_peer_map_v2 = false, + + .spectral = { + .fft_sz = 0, + .fft_pad_sz = 0, + .summary_pad_sz = 0, + .fft_hdr_len = 0, + .max_fft_bins = 0, + .fragment_160mhz = false, + }, + + .interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_DEVICE) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), + .supports_monitor = false, + .supports_shadow_regs = true, + .idle_ps = true, + .supports_sta_ps = true, + .coldboot_cal_mm = false, + .coldboot_cal_ftm = false, + .cbcal_restart_fw = false, + .fw_mem_mode = 0, + .num_vdevs = 2 + 1, + .num_peers = 512, + .supports_suspend = true, + .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), + .supports_regdb = true, + .fix_l1ss = false, + .credit_flow = true, + .max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390, + .hal_params = &ath11k_hw_hal_params_qca6390, + .supports_dynamic_smps_6ghz = false, + .alloc_cacheable_memory = false, + .supports_rssi_stats = true, + .fw_wmi_diag_event = true, + .current_cc_support = true, + .dbr_debug_support = false, + .global_reset = true, + .bios_sar_capa = &ath11k_hw_sar_capa_wcn6855, + .m3_fw_support = true, + .fixed_bdf_addr = false, + .fixed_mem_region = false, + .static_window_map = false, + .hybrid_bus_type = false, + .fixed_fw_mem = false, + .support_off_channel_tx = true, + .supports_multi_bssid = true, + + .sram_dump = { *** 12223 LINES SKIPPED *** From nobody Mon Dec 15 18:09:52 2025 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 4dVSlB0ysBz6L6Yc for ; Mon, 15 Dec 2025 18:09:58 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSl95g45z4G5T for ; Mon, 15 Dec 2025 18:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822197; 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=ajvmmjhiMbSxvHr2nO/h2c02U7Kyp7MTFUY//xzhJho=; b=yJdOsUkl8RCWabUYGwhfhHh9UiJrXpb6jC1Uez1TYN2kgLk7tFAPSAv1qR9V1cu8fGgemT QEtbjSQzp8ZVAG30xfjG/dRGjtfy6pPr4M0xeWjMzrGzWCD6cEcXwEU6MDsz5bX1KNuc/y HWF5W1jAQug86eGDn0VUxaZ8l9X9vFLZ4lIGn9kkjp/Xw4U4UpfrIX3BfxJqm1drbvUZQ7 TDZtLCR5YpES6VBa4Qg0Y/qkq42nYuPQajfoyP/0FzT/n/esQv6aqijIM6aES+7IXqi4sp 8vQJICuKFW0XsVuvnWC7ECqfXM9SEpscIm0u1JNcPV7jnoccM9AI23M5mmujiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822197; 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=ajvmmjhiMbSxvHr2nO/h2c02U7Kyp7MTFUY//xzhJho=; b=wsb0vQU6w7COmybXj1k65Bd5iEdZca6iMaCbeG77P+qKHLbv9DgJ3kjutMzyrYmXBXUNPN R9hKjLDxxa++G9gDvJz1IW8WPx14uoj5bpHDbBmjvWKhL7lmAm8MNn2aA18JZ8+U8K7t9s tAIiyMe8/2QS810++HDucyPkwwJEUhWiXdmrY8vqO2FFESoILxTEk7nW8LDmU5pzr1UDyg RWPvYu6K6+Em05WG6FzdwAWUDqa3Q9n0CVAMKTR8ShPvp8djt5jHkcR925excZp/QaOuHk Kdxnwz1356IoZKDuf/XtkD/ozZRp2SL9B4uHsfPn6EaR9BBhhZHNu/ZNUJEuMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822197; a=rsa-sha256; cv=none; b=PSL6RYrpPf5p8dREZLtdCt+i14Dw/3wkj3hvNppsuJMMs8Xk/mWUZ2AIWztMarZqlexRi2 +vz6tCNQp428FGdni6yttpF/sLnPPk2v5uNenfIyp3BHqVN90oyKzk+zH2kzAOnmkbMFuh kovc6JmeAGzvD0HnIYatGimej/xu92UFK3K18K9JsiHSX72r1XVt7YrdJhmUG1IO4/vIjz 4F2iCBNWDJdsgQ8k9f44C17uS2oMGRiXQRezCA63NpTXWtUULa/vP14DL00glGl3DrQitx O2y/ybqmApJfSJ5A9pFxdNIA8O+hzDFQbmZIl8ObZSnFp4p6iJ4VkAjGDuvxyA== 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 4dVSl94gcTzVbk for ; Mon, 15 Dec 2025 18:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24708 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 1fa2a48dab66 - stable/15 - ath-common: update common Atheros/QCA code 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1fa2a48dab667057068d0b5568954d842adebf84 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:52 +0000 Message-Id: <69404ef0.24708.66323caf@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1fa2a48dab667057068d0b5568954d842adebf84 commit 1fa2a48dab667057068d0b5568954d842adebf84 Author: Bjoern A. Zeeb AuthorDate: 2025-12-06 09:47:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:20 +0000 ath-common: update common Atheros/QCA code This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ). Merge commit '99ad6f4f54c86845d6e3f03541913c07fcdeef59' (cherry picked from commit 28125d24c92a45883b3ab105625ec5b3ba37e320) --- sys/contrib/dev/athk/Kconfig | 68 +++++++++++++++++++++++++++++ sys/contrib/dev/athk/Makefile | 25 +++++++++++ sys/contrib/dev/athk/ath.h | 6 ++- sys/contrib/dev/athk/dfs_pattern_detector.c | 21 ++++----- sys/contrib/dev/athk/hw.c | 2 +- sys/contrib/dev/athk/key.c | 4 +- sys/contrib/dev/athk/main.c | 1 + sys/contrib/dev/athk/testmode_i.h | 66 ++++++++++++++++++++++++++++ sys/contrib/dev/athk/trace.h | 4 +- 9 files changed, 177 insertions(+), 20 deletions(-) diff --git a/sys/contrib/dev/athk/Kconfig b/sys/contrib/dev/athk/Kconfig new file mode 100644 index 000000000000..910c10028b14 --- /dev/null +++ b/sys/contrib/dev/athk/Kconfig @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: ISC +config ATH_COMMON + tristate + +config WLAN_VENDOR_ATH + bool "Atheros/Qualcomm devices" + default y + help + If you have a wireless card belonging to this class, say Y. + + Note that the answer to this question doesn't directly affect the + kernel: saying N will just cause the configurator to skip all the + questions about these cards. If you say Y, you will be asked for + your specific card in the following questions. + + For more information and documentation on this module you can visit: + + https://wireless.wiki.kernel.org/en/users/Drivers/ath + + For information on all Atheros wireless drivers visit: + + https://wireless.wiki.kernel.org/en/users/Drivers/Atheros + +if WLAN_VENDOR_ATH + +config ATH_DEBUG + bool "Atheros wireless debugging" + help + Say Y, if you want to debug atheros wireless drivers. + Right now only ath9k makes use of this. + +config ATH_TRACEPOINTS + bool "Atheros wireless tracing" + depends on ATH_DEBUG + depends on EVENT_TRACING + help + This option enables tracepoints for atheros wireless drivers. + Currently, ath9k makes use of this facility. + +config ATH_REG_DYNAMIC_USER_REG_HINTS + bool "Atheros dynamic user regulatory hints" + depends on CFG80211_CERTIFICATION_ONUS + default n + help + Say N. This should only be enabled in countries where + this feature is explicitly allowed and only on cards that + specifically have been tested for this. + +config ATH_REG_DYNAMIC_USER_CERT_TESTING + bool "Atheros dynamic user regulatory testing" + depends on ATH_REG_DYNAMIC_USER_REG_HINTS && CFG80211_CERTIFICATION_ONUS + default n + help + Say N. This should only be enabled on systems + undergoing certification testing. + +source "drivers/net/wireless/ath/ath5k/Kconfig" +source "drivers/net/wireless/ath/ath9k/Kconfig" +source "drivers/net/wireless/ath/carl9170/Kconfig" +source "drivers/net/wireless/ath/ath6kl/Kconfig" +source "drivers/net/wireless/ath/ar5523/Kconfig" +source "drivers/net/wireless/ath/wil6210/Kconfig" +source "drivers/net/wireless/ath/ath10k/Kconfig" +source "drivers/net/wireless/ath/wcn36xx/Kconfig" +source "drivers/net/wireless/ath/ath11k/Kconfig" +source "drivers/net/wireless/ath/ath12k/Kconfig" + +endif diff --git a/sys/contrib/dev/athk/Makefile b/sys/contrib/dev/athk/Makefile new file mode 100644 index 000000000000..8d6e6e218d24 --- /dev/null +++ b/sys/contrib/dev/athk/Makefile @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: ISC +obj-$(CONFIG_ATH5K) += ath5k/ +obj-$(CONFIG_ATH9K_HW) += ath9k/ +obj-$(CONFIG_CARL9170) += carl9170/ +obj-$(CONFIG_ATH6KL) += ath6kl/ +obj-$(CONFIG_AR5523) += ar5523/ +obj-$(CONFIG_WIL6210) += wil6210/ +obj-$(CONFIG_ATH10K) += ath10k/ +obj-$(CONFIG_WCN36XX) += wcn36xx/ +obj-$(CONFIG_ATH11K) += ath11k/ +obj-$(CONFIG_ATH12K) += ath12k/ + +obj-$(CONFIG_ATH_COMMON) += ath.o + +ath-objs := main.o \ + regd.o \ + hw.o \ + key.o \ + dfs_pattern_detector.o \ + dfs_pri_detector.o + +ath-$(CONFIG_ATH_DEBUG) += debug.o +ath-$(CONFIG_ATH_TRACEPOINTS) += trace.o + +CFLAGS_trace.o := -I$(src) diff --git a/sys/contrib/dev/athk/ath.h b/sys/contrib/dev/athk/ath.h index 90869e6d28da..243a03f13728 100644 --- a/sys/contrib/dev/athk/ath.h +++ b/sys/contrib/dev/athk/ath.h @@ -174,8 +174,10 @@ struct ath_common { unsigned int clockrate; spinlock_t cc_lock; - struct ath_cycle_counters cc_ani; - struct ath_cycle_counters cc_survey; + struct_group(cc, + struct ath_cycle_counters cc_ani; + struct ath_cycle_counters cc_survey; + ); struct ath_regulatory regulatory; struct ath_regulatory reg_world_copy; diff --git a/sys/contrib/dev/athk/dfs_pattern_detector.c b/sys/contrib/dev/athk/dfs_pattern_detector.c index 27f4d74a41c8..700da9f4531e 100644 --- a/sys/contrib/dev/athk/dfs_pattern_detector.c +++ b/sys/contrib/dev/athk/dfs_pattern_detector.c @@ -161,7 +161,7 @@ get_dfs_domain_radar_types(enum nl80211_dfs_regions region) struct channel_detector { struct list_head head; u16 freq; - struct pri_detector **detectors; + struct pri_detector *detectors[]; }; /* channel_detector_reset() - reset detector lines for a given channel */ @@ -183,14 +183,13 @@ static void channel_detector_exit(struct dfs_pattern_detector *dpd, if (cd == NULL) return; list_del(&cd->head); - if (cd->detectors) { - for (i = 0; i < dpd->num_radar_types; i++) { - struct pri_detector *de = cd->detectors[i]; - if (de != NULL) - de->exit(de); - } + + for (i = 0; i < dpd->num_radar_types; i++) { + struct pri_detector *de = cd->detectors[i]; + if (de != NULL) + de->exit(de); } - kfree(cd->detectors); + kfree(cd); } @@ -200,16 +199,12 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) u32 i; struct channel_detector *cd; - cd = kmalloc(sizeof(*cd), GFP_ATOMIC); + cd = kzalloc(struct_size(cd, detectors, dpd->num_radar_types), GFP_ATOMIC); if (cd == NULL) goto fail; INIT_LIST_HEAD(&cd->head); cd->freq = freq; - cd->detectors = kmalloc_array(dpd->num_radar_types, - sizeof(*cd->detectors), GFP_ATOMIC); - if (cd->detectors == NULL) - goto fail; for (i = 0; i < dpd->num_radar_types; i++) { const struct radar_detector_specs *rs = &dpd->radar_spec[i]; diff --git a/sys/contrib/dev/athk/hw.c b/sys/contrib/dev/athk/hw.c index 85955572a705..b301e6fbce6c 100644 --- a/sys/contrib/dev/athk/hw.c +++ b/sys/contrib/dev/athk/hw.c @@ -15,7 +15,7 @@ */ #include -#include +#include #include "ath.h" #include "reg.h" diff --git a/sys/contrib/dev/athk/key.c b/sys/contrib/dev/athk/key.c index b7b61d4f02ba..0ae436bd9b66 100644 --- a/sys/contrib/dev/athk/key.c +++ b/sys/contrib/dev/athk/key.c @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include "ath.h" @@ -104,7 +104,7 @@ bool ath_hw_keysetmac(struct ath_common *common, u16 entry, const u8 *mac) * Not setting this bit allows the hardware to use the key * for multicast frame decryption. */ - if (mac[0] & 0x01) + if (is_multicast_ether_addr(mac)) unicast_flag = 0; macLo = get_unaligned_le32(mac); diff --git a/sys/contrib/dev/athk/main.c b/sys/contrib/dev/athk/main.c index 69c054b3a99e..e505af3e73c7 100644 --- a/sys/contrib/dev/athk/main.c +++ b/sys/contrib/dev/athk/main.c @@ -16,6 +16,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include diff --git a/sys/contrib/dev/athk/testmode_i.h b/sys/contrib/dev/athk/testmode_i.h new file mode 100644 index 000000000000..980ef2f3f05f --- /dev/null +++ b/sys/contrib/dev/athk/testmode_i.h @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause-Clear */ +/* + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/* "API" level of the ath testmode interface. Bump it after every + * incompatible interface change. + */ +#define ATH_TESTMODE_VERSION_MAJOR 1 + +/* Bump this after every _compatible_ interface change, for example + * addition of a new command or an attribute. + */ +#define ATH_TESTMODE_VERSION_MINOR 1 + +#define ATH_TM_DATA_MAX_LEN 5000 +#define ATH_FTM_EVENT_MAX_BUF_LENGTH 2048 + +enum ath_tm_attr { + __ATH_TM_ATTR_INVALID = 0, + ATH_TM_ATTR_CMD = 1, + ATH_TM_ATTR_DATA = 2, + ATH_TM_ATTR_WMI_CMDID = 3, + ATH_TM_ATTR_VERSION_MAJOR = 4, + ATH_TM_ATTR_VERSION_MINOR = 5, + ATH_TM_ATTR_WMI_OP_VERSION = 6, + + /* keep last */ + __ATH_TM_ATTR_AFTER_LAST, + ATH_TM_ATTR_MAX = __ATH_TM_ATTR_AFTER_LAST - 1, +}; + +/* All ath testmode interface commands specified in + * ATH_TM_ATTR_CMD + */ +enum ath_tm_cmd { + /* Returns the supported ath testmode interface version in + * ATH_TM_ATTR_VERSION. Always guaranteed to work. User space + * uses this to verify it's using the correct version of the + * testmode interface + */ + ATH_TM_CMD_GET_VERSION = 0, + + /* The command used to transmit a WMI command to the firmware and + * the event to receive WMI events from the firmware. Without + * struct wmi_cmd_hdr header, only the WMI payload. Command id is + * provided with ATH_TM_ATTR_WMI_CMDID and payload in + * ATH_TM_ATTR_DATA. + */ + ATH_TM_CMD_WMI = 1, + + /* Boots the UTF firmware, the netdev interface must be down at the + * time. + */ + ATH_TM_CMD_TESTMODE_START = 2, + + /* The command used to transmit a FTM WMI command to the firmware + * and the event to receive WMI events from the firmware. The data + * received only contain the payload, need to add the tlv header + * and send the cmd to firmware with command id WMI_PDEV_UTF_CMDID. + * The data payload size could be large and the driver needs to + * send segmented data to firmware. + */ + ATH_TM_CMD_WMI_FTM = 3, +}; diff --git a/sys/contrib/dev/athk/trace.h b/sys/contrib/dev/athk/trace.h index 9935cf475b6d..82aac0a4baff 100644 --- a/sys/contrib/dev/athk/trace.h +++ b/sys/contrib/dev/athk/trace.h @@ -44,8 +44,8 @@ TRACE_EVENT(ath_log, ), TP_fast_assign( - __assign_str(device, wiphy_name(wiphy)); - __assign_str(driver, KBUILD_MODNAME); + __assign_str(device); + __assign_str(driver); __assign_vstr(msg, vaf->fmt, vaf->va); ), From nobody Mon Dec 15 18:09:57 2025 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 4dVSl95vwJz6L6H4 for ; Mon, 15 Dec 2025 18:09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSl92jSZz4Fst for ; Mon, 15 Dec 2025 18:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822197; 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=ESQxlqCLfnSyh2AAPwsK5kD0KAYztPl5Pklu7Wv6VAQ=; b=AxqKEU51jVosAJ+3sW72qLZ2ejkPMb3HdoUbw4OsWK3bA9phf429S2kp0i6ILu0t6goVnF nx7UxNcqnUdlUuaCiUSvrqmo17/Oqdcs0QXJPaIV683288L+mfKSskraSCEaOR0YR6E4Bv jccXasBGprf8KSW0EtvbVEx3WbPqxR+KwXuA5Aotwtt1mPJiE4z5bmvuO3v72Pv9mEtkfL GTWZstI4S32Zgy7IhST595MhGS+qirZuBRHyT295F9Cs7VwWcyZcMqiVZLm2ZOZcC0GVAJ BDtfOnTi7HscYw/UjkPmNo4bGUdX7nkfCvoggDVHTk9YptQitfjzw+A1myzpWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822197; 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=ESQxlqCLfnSyh2AAPwsK5kD0KAYztPl5Pklu7Wv6VAQ=; b=KfVAu0OUO0EH84Vy9u3Fzuy5jtVCLHTu+QT8682QvATYGhidM8KeVVkcuIGp5BUb3lBiPc PCYqTd9q/9g/K99u+IJ/L2oP3KBl3Qi7KXYMznqZY1raXCKiyLvVfoBKqCQXRQN86B8v91 vZ0czBMbl/BeJ9FexnndYSj31GPayZPaLy5euCwwf7K41Ks1HkPZYG94SwvTo54FyLtveQ UyRuE7+sStSx2WHCmPPLowl9+OCDqwAZKhwEr8ZmWi1MDpKACmOF9nCC3sVWsIsHysl4Ev QS+wUZoWwBDm87HYT7M1FbXpNoGxCaoSNCwqbljZwgIulh0N9G0iSUrqY98f3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822197; a=rsa-sha256; cv=none; b=rIeXBbYLN7r8ZRnv7lEzBRLJgekhHdxIdJGB/3k9b9mqbFphmMVumvXuCt3JcFLc0v5+Kb vPYf+HQc8B3cflnYVoPovMhBIbWLwuSb2yEeximWfVR2GJNUQrLmiuO3LvM5WJQDEJWNTf HRqDPMnyTyhzzaI6eOO77Qq4auo70Ll6/8c4swdsAfJl8pQjdqPWUU1333pA30ABc4rID4 H1b32RKz08Jnu0ZskLB5m9Nuk4DfBp/LStNGigWHgMfoGWoaxhzcNJ7wVmG4whMGJhIDFn q6w7RLuj+QytpgQHn3AqIbJT968zBQeSkrNZXNdWfMR8wfdGOU0dontg8fMgUA== 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 4dVSl91zKczW0W for ; Mon, 15 Dec 2025 18:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24593 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: ec43b17de53a - stable/15 - ath11k: start making compile some more 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ec43b17de53a057a07a051255a60ee3c82223c1c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:57 +0000 Message-Id: <69404ef5.24593.659a0f0f@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ec43b17de53a057a07a051255a60ee3c82223c1c commit ec43b17de53a057a07a051255a60ee3c82223c1c Author: Bjoern A. Zeeb AuthorDate: 2025-12-06 10:21:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:21 +0000 ath11k: start making compile some more There is more work to do to make this compile again but we will do that when we get to the driver. For now just take the most noise out of it. (cherry picked from commit 9c2f321630894b40c1ec51ece881c7c765d6d749) --- sys/contrib/dev/athk/ath11k/core.h | 2 ++ sys/contrib/dev/athk/ath11k/coredump.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sys/contrib/dev/athk/ath11k/core.h b/sys/contrib/dev/athk/ath11k/core.h index 03eaacf3cb5f..9825bce61b1e 100644 --- a/sys/contrib/dev/athk/ath11k/core.h +++ b/sys/contrib/dev/athk/ath11k/core.h @@ -1350,7 +1350,9 @@ static inline void ath11k_core_create_firmware_path(struct ath11k_base *ab, { const char *fw_name = NULL; +#if defined(CONFIG_OF) of_property_read_string(ab->dev->of_node, "firmware-name", &fw_name); +#endif if (fw_name && strncmp(filename, "board", 5)) snprintf(buf, buf_len, "%s/%s/%s/%s", ATH11K_FW_DIR, diff --git a/sys/contrib/dev/athk/ath11k/coredump.h b/sys/contrib/dev/athk/ath11k/coredump.h index 3960d9385261..871388dc42b0 100644 --- a/sys/contrib/dev/athk/ath11k/coredump.h +++ b/sys/contrib/dev/athk/ath11k/coredump.h @@ -6,6 +6,10 @@ #ifndef _ATH11K_COREDUMP_H_ #define _ATH11K_COREDUMP_H_ +#if defined(__FreeBSD__) +#include +#endif + #define ATH11K_FW_CRASH_DUMP_V2 2 enum ath11k_fw_crash_dump_type { From nobody Mon Dec 15 18:09:59 2025 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 4dVSlD6Z4wz6L6DV for ; Mon, 15 Dec 2025 18:10:00 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSlD0H2Zz4FyC for ; Mon, 15 Dec 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822200; 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=cvPoVFuUdNnUTgQHLGYxU+NsF+kaerQk7K34H7vxiuA=; b=eARVckXT1iGdkD2oEXhPse1vs30f+eVCiVtgYgsfSw4mrQGFwyfrPSDAiZtDrzqs5l9//y NSfmUdFal1brPwekEDeGZTboVFU6qXn6OnykA9NUpWp8/XXPo/tFK6SO6FxYb31qC1bY6f QdamUFkIpkYAe2nS0dFysbaWfxTQ+/ls1HetTxKh7UTxZzxRaBJVdaIThKiKhscHn4XVY1 LNY3DM6PStpKjZ84AQVfl9AmjruLlnqAu9WIbldAgIX0TgOiGgId3hOxN7XqYLqbpIEHib QnGGRV1/nKKRuYLPAz8+bSPnSB4qdLzRv4NRgRyOscfIlh/htIXuh5EDiBtLbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822200; 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=cvPoVFuUdNnUTgQHLGYxU+NsF+kaerQk7K34H7vxiuA=; b=dTOI9TU4jtID0+DG7Gj9ZeB0NJYI3/ilpLADLkDwXn7M2ilwb2O1t8MvymYdjbZ3okNnIL /YhpiwrsNupbzD2yMxUXu5qirgP3MzB8zo3hmPO4GgZI//6RTyrOkv/IV7X8FoRAll60dW S9OcHtfToibQEBboNykOFSnka5m4+eOkDzbdPy6MLg7ozqFVkZ5clwfITuNOfeW2vszkMi vVR0glKyZhFHorMvY/vHPfwJeW5j3HM7pPiTNKlkON+NMY2p60udmlx9AO5tX3nZ/yWYMI PMbgpYOjv6LMVNeFWKpWfkJRhrodvP0NTuLV5t1oE9ULn+SD5ha33guwzj7arA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822200; a=rsa-sha256; cv=none; b=gexUjYV0fsjwzodQ2rvFfpNb1Qo1B74cx3EH3FBH8G0nmxw3HOHG2JEJO4uU2AW8ZJSpix 5fJpsKw0Stn0+BBUmThaLVav1Hev4XyCRomrNCw8MzLodSuYmnbMbfM8jYacoxV3Q4JYzZ G5dRnTsZhspgW6ryanClJBX+JHxrnWqf5TY927pgzKOOYwfG7Qe4SfAQW3w94A3lIVjFzI KOiHNQ+zWbErAeKLO4JepoGx9asxiGjYQYfNOftm5mAIpa4jxoJE0pMeWvOpSqoG+zFQqx NtSmamV2A3vc7A0Muygfx8KoHBnygFMBc4GDvd9xgv0Uyet4mSGtJHv/tQ3DcQ== 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 4dVSlC3PGczVrn for ; Mon, 15 Dec 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2470c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: f545f8824641 - stable/15 - iwmfw(4): fix spelling of the iwm8000C firmware. 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f545f88246416514b09efde44879ba0eadfa1780 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:59 +0000 Message-Id: <69404ef7.2470c.3392c9d2@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f545f88246416514b09efde44879ba0eadfa1780 commit f545f88246416514b09efde44879ba0eadfa1780 Author: Bjoern A. Zeeb AuthorDate: 2025-12-08 03:03:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:21 +0000 iwmfw(4): fix spelling of the iwm8000C firmware. When migrating the firmware to be installed as plain firmware files to /boot/firmware the iwm8000C firmware lost its "fw" suffix that iwm(4) expects. The follow-up change to defaults/loader.conf is also consistently missing the "fw". Fix both places, and add the wrongly spelt version to ObsoleteFiles.inc (entirely untested). PR: 291403 Reported by: Augustin Hoffmann (avgwst tutanota.de) Fixes: af0a81b6470aba4af4a24ae9804053722846ded4 Fixes: a0f06dfb0d188966bee7265ec7d9f20093186bb6 (cherry picked from commit f0ea859229843affe07ac94db915489756f87096) --- ObsoleteFiles.inc | 3 +++ share/firmwares/iwm/Makefile | 2 +- stand/defaults/loader.conf | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8b08bc5ff496..1390c072afbc 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20251208: Rename iwm8000C to correct name. +OLD_FILES+=boot/firmware/iwm8000C + # 20251204: zpfind.9 alias to pfind.9 removed OLD_FILES+=usr/share/man/man9/zpfind.9 diff --git a/share/firmwares/iwm/Makefile b/share/firmwares/iwm/Makefile index c44f401c315e..0a242513fa3d 100644 --- a/share/firmwares/iwm/Makefile +++ b/share/firmwares/iwm/Makefile @@ -41,7 +41,7 @@ iwm7265DMODE= 644 iwm7265DPACKAGE= firmware-iwm iwm8000C= ${SRCTOP}/sys/contrib/dev/iwm/iwm-8000C-22.fw -iwm8000CNAME= iwm8000C +iwm8000CNAME= iwm8000Cfw iwm8000CDIR= /boot/firmware iwm8000CMODE= 644 iwm8000CPACKAGE= firmware-iwm diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 036479d22285..71fb052cd21b 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -195,5 +195,5 @@ iwm8265fw_type="firmware" iwm9260fw_type="firmware" iwm3168fw_type="firmware" iwm7265Dfw_type="firmware" -iwm8000C_type="firmware" +iwm8000Cfw_type="firmware" iwm9000fw_type="firmware" From nobody Mon Dec 15 18:09:58 2025 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 4dVSlB6F08z6L6f2 for ; Mon, 15 Dec 2025 18:09:58 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSlB3NnWz4FwF for ; Mon, 15 Dec 2025 18:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822198; 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=t1BqN+bfPBjEdtOOytEpRZpre3bwVH/1V1QNNxRkTKs=; b=WQOfSPvQ7ufjoHbvXN4wILLg4faiZBolNSaI26HNe1g85JJ1I/7ThNnMeuR3Dacerf2xqc wpnhO4aQ4TrpVh3ht6uTdCPoGlzU21GP60VGR+W8tqyEKSi+47p4H/ZW0FW7mKhqS6Sftf gyLs1hAMLrWBvWBJ8sUAx4GQxwucqeU0p4xd9LtBzlJqHLtrH78RMbWtAXDLcz5HyyBf4D xz78atqyygg3n4FbqnG+OP4PPoP+nwzLLIPd++Ls3zKb/mxs+plCa29591rXnuB1XNXy1k 3HqAbGeNN7Zk/o5E6FQuSI9H6tRpml15l5D929vJZjTMIes7XEWpA6mS0iGQUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822198; 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=t1BqN+bfPBjEdtOOytEpRZpre3bwVH/1V1QNNxRkTKs=; b=IEldZWUZnlGI1Ysnjre4hYQip1CYisK/wcStA6KyLGMf8yoJhHgAXwcl/7xevXAANb+9ll IAiESUwFL8fnpeK9oM21ZTpm5nf/HRkN/oo+lnEXpC/AF5c5IBCAMLm4ZsEvG82nuYkf4K l7cKEM6Z+Nm0O+TLlXmUtE2NBQJyBaedgnTF60Nh1Ilf2cctOEWMgY5dactK1a0iQwYkPA fuff5br4yuIb5GWBb6oYg3H7vSiSE25RWje7fSmHdhambLER9veuorqYzep6K6N8Udew7U D9Wl5A4V/Pr78uQYnkrw1OvcReeVT081zAhpuF0TLMyzRzGJmxp+IF9uv1mamw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822198; a=rsa-sha256; cv=none; b=NIjMfzAtQnIFCu7P3Fikli/zlIpL9u7Zd6lrN3B1bSDHsadugYH0AZVr1GiQhoRwSxkkOg RJnIqHYfGUd4zFdYOWfznrDodDQfblpNX8V96+zatU2dIrqC96W7lFtKvuTLsp0PRCoif1 t9KZ8P8mCzJ8/gNTqf5ojMt4EiDOhA38oklT6jjYtyFlUI8vA9pkQGKrOu5eoDQz0YF4iy E7f5/gOycdd3m2nmE02QyXgVLt3PtKzp8c3PcKjd66ivTkdcqoNsFios7JO/g8LFWaBesJ 8aJITnjAGN+nwhJW0KBL9fpn5es1PS/4s+2Nob5UNhG3EHwD85c63M8EcQB0NA== 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 4dVSlB2kc2zW0X for ; Mon, 15 Dec 2025 18:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 235a6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:09:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: caf7a30d6b7f - stable/15 - ath11k: add new files to module Makefile 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: caf7a30d6b7f1eed4be34316e1eea51b1cc6d17c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:09:58 +0000 Message-Id: <69404ef6.235a6.301481a0@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=caf7a30d6b7f1eed4be34316e1eea51b1cc6d17c commit caf7a30d6b7f1eed4be34316e1eea51b1cc6d17c Author: Bjoern A. Zeeb AuthorDate: 2025-12-06 10:24:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:21 +0000 ath11k: add new files to module Makefile Add the new files to the module Makefile as well, so they do not get lost. (cherry picked from commit c68126ec2594a80ac095e5ce9e6138709db75519) --- sys/modules/ath11k/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/ath11k/Makefile b/sys/modules/ath11k/Makefile index fb610117dfa5..42aa9b9936cd 100644 --- a/sys/modules/ath11k/Makefile +++ b/sys/modules/ath11k/Makefile @@ -11,6 +11,7 @@ SRCS+= core.c hal.c hal_tx.c hal_rx.c SRCS+= wmi.c mac.c reg.c htc.c qmi.c SRCS+= dp.c dp_tx.c dp_rx.c debug.c SRCS+= ce.c peer.c dbring.c hw.c +SRCS+= coredump.c fw.c p2p.c SRCS+= mhi.c pci.c pcic.c From nobody Mon Dec 15 18:10:00 2025 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 4dVSlF11zxz6L6bv for ; Mon, 15 Dec 2025 18:10:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSlD5SRpz4G81 for ; Mon, 15 Dec 2025 18:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822200; 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=/UdWmyGLm69/b+dzIIw69tBlSkA2VcHEho3vxw8BeV8=; b=iKBruOtfnlT3daq4vEODf8c0ovVHe02nx8AuGl96xA5oOe3DEbxBK10gMhfcZ0PMfHyhtq 1jFi594UJJMlzKTPWL++nZ3lixZdt5VM0G1KOPafW+Bwzz9CvLeDXFxpN3ut8iRYM9N9Rk 8MokwZhDy2HhswEoiJj4cwItaZl74rKvPiuZCoBMPL6AInd73zLmCEAtSQdU4cW/NeLl8X 8PcH+ZIhLVCWCq0lZUx7ltETQXpBEn+9HA0z0Wke4cxCdXX+zCTCfzPEazVqUmFKHmhaZ8 YrSraidhcwmKEzX/BkND3h6l6zA9q89PsHCTYWMUoQBfs0HeEqn7Ac5axktAZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822200; 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=/UdWmyGLm69/b+dzIIw69tBlSkA2VcHEho3vxw8BeV8=; b=d4lc3q7J3PHImQMY21myAYrYR5Y9IwNHjAD71YdZ9xVRBcmwb68YBtdExQs5xnubDugqjJ YWjUOWtG2xJpD+SrERtbYU3t5AU6OHceblOx5euKhgd77fLJwnujL0zCGYLMdKSGXPJqgx joENnIrk08mn2tZyoGHC7ClIZHNfoWa6hJPW0tIPZjwpAI6ADmMUd10DBOwOFntdWXihST 7ad3qzV3TMcfg29PkuwG8n4tgxxEkjOn8sWre3YmtV6i5cxDvidn06zkidVbiWT1fNamRP lQQOxVtiujp3L0HukBHLgaBTJ/kIHl4AJ8rywAlB6wKZh7goVntCNQIqiWjveg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822200; a=rsa-sha256; cv=none; b=mTdSi6fPrusA5eiGv0DrokmJ3ISNvh9psGT7j0Gq4pdRVdhI0t4VhMVoSeyWb2zGMC5gqg pnMGjfJZyvZPm2LaspOR1eseNSULQL5X9QD+9oqyiNhlxXlMpTm9gsr+ZXPJRZEZdMAK0z x5oaMjGcs3Sak9nZfb8LyZmbTnkzrwTfLdK7jQNjYaNujoWh6omPTphfLAqzP+7KKAT8oe EGu/OikBVssPjON3YfUrJmCcqTbpBFRVAECeeAsPIt37rWXWZTh+zEkH3YzM/iO4HCYKQh Rb+gBQ441KwdbifSXoHZ/+YTsPMDKbIygtS0wUQyAjvT6BrVS5J/TOUpLxPaHw== 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 4dVSlD3lSzzVlw for ; Mon, 15 Dec 2025 18:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25512 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:10:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 2e1156f75836 - stable/15 - LinuxKPI: 802.11: lock down the "txq_scheduled" tailq 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2e1156f75836a0e5a4026e13d72b54f272e705cb Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:10:00 +0000 Message-Id: <69404ef8.25512.23b9141@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2e1156f75836a0e5a4026e13d72b54f272e705cb commit 2e1156f75836a0e5a4026e13d72b54f272e705cb Author: Bjoern A. Zeeb AuthorDate: 2025-12-10 20:29:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:22 +0000 LinuxKPI: 802.11: lock down the "txq_scheduled" tailq For consistency rename the "scheduled_txqs" tailq to "txq_scheduled" and add a lock per txq ("txq_scheduled_lock[]"). We use the "_bh" locking as this called from the device driver. This fixes panics due to concurrent access to the tailq, especially in between "first" and "remove" on the out-direction and between "insert" and "elem_init" on the in-direction. This was easily reproducible just running iperf3 at basic rates for a few seconds to minutes with multiple chipsets, not only rtw89. Sponsored by: The FreeBSD Foundation PR: 290636 Reported by: arved, and others before (cherry picked from commit 567a097c8ab60d9fcd68a87c3c5ad605fe8715cc) --- sys/compat/linuxkpi/common/src/linux_80211.c | 51 ++++++++++++++++++++++------ sys/compat/linuxkpi/common/src/linux_80211.h | 3 +- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 8098d02da1a9..1d510577f00c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6472,8 +6472,9 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) TAILQ_INIT(&lhw->lvif_head); __hw_addr_init(&lhw->mc_list); for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { + spin_lock_init(&lhw->txq_scheduled_lock[ac]); lhw->txq_generation[ac] = 1; - TAILQ_INIT(&lhw->scheduled_txqs[ac]); + TAILQ_INIT(&lhw->txq_scheduled[ac]); } /* Chanctx_conf */ @@ -6507,6 +6508,7 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) { struct lkpi_hw *lhw; struct mbuf *m; + int ac; lhw = HW_TO_LHW(hw); free(lhw->ic, M_LKPI80211); @@ -6571,6 +6573,9 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) lkpi_cleanup_mcast_list_locked(lhw); LKPI_80211_LHW_MC_UNLOCK(lhw); + for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) + spin_lock_destroy(&lhw->txq_scheduled_lock[ac]); + /* Cleanup more of lhw here or in wiphy_free()? */ spin_lock_destroy(&lhw->txq_lock); LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw); @@ -8664,7 +8669,12 @@ linuxkpi_ieee80211_wake_queue(struct ieee80211_hw *hw, int qnum) spin_unlock_irqrestore(&lhw->txq_lock, flags); } +/* -------------------------------------------------------------------------- */ + /* This is just hardware queues. */ +/* + * Being called from the driver thus use _bh() locking. + */ void linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) { @@ -8672,10 +8682,16 @@ linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) lhw = HW_TO_LHW(hw); - IMPROVE_TXQ("Are there reasons why we wouldn't schedule?"); - IMPROVE_TXQ("LOCKING"); + if (ac >= IEEE80211_NUM_ACS) { + ic_printf(lhw->ic, "%s: ac %u out of bounds.\n", __func__, ac); + return; + } + + spin_lock_bh(&lhw->txq_scheduled_lock[ac]); + IMPROVE("check AIRTIME_FAIRNESS"); if (++lhw->txq_generation[ac] == 0) lhw->txq_generation[ac]++; + spin_unlock_bh(&lhw->txq_scheduled_lock[ac]); } struct ieee80211_txq * @@ -8688,24 +8704,33 @@ linuxkpi_ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) lhw = HW_TO_LHW(hw); txq = NULL; - IMPROVE_TXQ("LOCKING"); + if (ac >= IEEE80211_NUM_ACS) { + ic_printf(lhw->ic, "%s: ac %u out of bounds.\n", __func__, ac); + return (NULL); + } + + spin_lock_bh(&lhw->txq_scheduled_lock[ac]); /* Check that we are scheduled. */ if (lhw->txq_generation[ac] == 0) goto out; - ltxq = TAILQ_FIRST(&lhw->scheduled_txqs[ac]); + ltxq = TAILQ_FIRST(&lhw->txq_scheduled[ac]); if (ltxq == NULL) goto out; if (ltxq->txq_generation == lhw->txq_generation[ac]) goto out; + IMPROVE("check AIRTIME_FAIRNESS"); + + TAILQ_REMOVE(&lhw->txq_scheduled[ac], ltxq, txq_entry); ltxq->txq_generation = lhw->txq_generation[ac]; - TAILQ_REMOVE(&lhw->scheduled_txqs[ac], ltxq, txq_entry); txq = <xq->txq; TAILQ_ELEM_INIT(ltxq, txq_entry); out: + spin_unlock_bh(&lhw->txq_scheduled_lock[ac]); + return (txq); } @@ -8718,8 +8743,6 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, ltxq = TXQ_TO_LTXQ(txq); - IMPROVE_TXQ("LOCKING"); - /* Only schedule if work to do or asked to anyway. */ LKPI_80211_LTXQ_LOCK(ltxq); ltxq_empty = skb_queue_empty(<xq->skbq); @@ -8727,20 +8750,26 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, if (!withoutpkts && ltxq_empty) goto out; + lhw = HW_TO_LHW(hw); + spin_lock_bh(&lhw->txq_scheduled_lock[txq->ac]); /* * Make sure we do not double-schedule. We do this by checking tqe_prev, * the previous entry in our tailq. tqe_prev is always valid if this entry * is queued, tqe_next may be NULL if this is the only element in the list. */ if (ltxq->txq_entry.tqe_prev != NULL) - goto out; + goto unlock; + + TAILQ_INSERT_TAIL(&lhw->txq_scheduled[txq->ac], ltxq, txq_entry); +unlock: + spin_unlock_bh(&lhw->txq_scheduled_lock[txq->ac]); - lhw = HW_TO_LHW(hw); - TAILQ_INSERT_TAIL(&lhw->scheduled_txqs[txq->ac], ltxq, txq_entry); out: return; } +/* -------------------------------------------------------------------------- */ + void linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 0dfcd7646c34..fcbef46fc6de 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -252,7 +252,8 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; - TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; + spinlock_t txq_scheduled_lock[IEEE80211_NUM_ACS]; + TAILQ_HEAD(, lkpi_txq) txq_scheduled[IEEE80211_NUM_ACS]; spinlock_t txq_lock; /* Deferred RX path. */ From nobody Mon Dec 15 18:10:01 2025 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 4dVSlG0CkZz6L6f9 for ; Mon, 15 Dec 2025 18:10:02 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSlF5CZ4z4G1D for ; Mon, 15 Dec 2025 18:10:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822201; 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=aYW0vsxb/y/TOr8kCIo+dcjYpJ8/JK+v4zZeyAs06EU=; b=hq6iiFloY4J6Jpv/bzlKSEmWFat1mDLLFl4lpii2zVLOCPrVIas1dti7OupR/CIIgc1bkI B10/2WCf6jbn8X7Z3vU/KvxtIw5kqFdq4/f/kiGxNzdnv1PT/x5yGVvYWojpiz2iIcJuos Mk7cbVc+lKsfiYdJ5j0N4QYgfRNJsey0LZhlzdtAMP38AstlZN9Qwqm39Q7/9xU2av9mRt 6i9mb2s3ftRNIxpWVB/TA8sgEEfxIqA7M8JOZXZvavsBdZAY+gZnrKG+UjpzqNP4N1LyBv ysbBphAxIIL0yjw1SHfCeLkYgOGAv8BywGeAnGKH5y72gIJY9hvnVROGYRedOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822201; 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=aYW0vsxb/y/TOr8kCIo+dcjYpJ8/JK+v4zZeyAs06EU=; b=WXoZPCyyUQkGc1HTmiofgnQKHtIC0tpkdSXdTqdSataEs6whi90YgDXGzSSy+rQJpckpWC PCsXnKlzQCYYiaHYQ+nwRu5h9ijPqRsvEHl+vbINNrfOB85OJnnSRCnR3Vr5SA9w4MhskZ x4ITQVrjoDODADN2SfBnihShO/oxMl4RjG8+Tk/dPFlST1vv6SAJmnqzwImTarMCBgURhd QjICzttdIExM2EYUv1jbjvMRh89HMqxNTUSQF+447XppKeCnVScJvIzBpFTLcQR5RsaXOt St9ghu6+elIRLwdPbfsFBZXkZeO4S+9YABBgNGp3JKXxgiqB3+t+kXvcUJlOvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822201; a=rsa-sha256; cv=none; b=EcnL4QsLtX7+k6WHTNXO8Iop+poK9cd7IWp2WUmDdDS5pRZHTCVCK5aRmIbGO0k2RxKJLn x97AkbryTGPTK9RKYoUVHq7dUKAgIfXIezwjp1slIDq+dHpYcj0CMt3PhVTLhvgmKLswuY 5SqV9g5UpWsFWwVIMxPS9iNBjp38RN6f5qeVzIkcwHmp9lSAvRScvv7c2//0EQmbvE748Q I/yZj74iW8YkJbu+1TIGC8wVEeF+op82L3qgkAzFEat0mr7z0wzptu/+jOeUi3he5RDcR3 e0vJy1IeTewik7XWRbCYhBpuekg7QuIyK4DlemexbKn73aYLjqjaAuxzW2+6eQ== 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 4dVSlF46zmzVc5 for ; Mon, 15 Dec 2025 18:10:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24bf4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:10:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: f2ddd976ae52 - stable/15 - LinuxKPI: 802.11: rework MC/configure_filter 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f2ddd976ae5251c7a101229236a3598f4b3c4574 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:10:01 +0000 Message-Id: <69404ef9.24bf4.bcf849b@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f2ddd976ae5251c7a101229236a3598f4b3c4574 commit f2ddd976ae5251c7a101229236a3598f4b3c4574 Author: Bjoern A. Zeeb AuthorDate: 2025-12-14 20:07:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-15 18:09:22 +0000 LinuxKPI: 802.11: rework MC/configure_filter (*prepare_multicast)(), for the drivers we support, is iwlwifi(4)-specific. If it is not available do not let us stop from calling (*configure_filter)() at least as well. In addition to the interface setting mc_all_multi, if we have no way to prepare the multicast filter list this way, set FIF_ALLMULTI for now. This seems to help some with rtw89 but does not help me with other drivers yet to get IPv6 link-local (e.g., ff02::1%wlan0) going. This should also help in case we are scanning and are setting FIF_BCN_PRBRESP_PROMISC . We should go and review the full FIF_ list and start adding conditional support for the other options too. Sponsored by: The FreeBSD Foundation PR: 281982 (cherry picked from commit f943454bfbd98ce49516c6ede8626b5f2602edc1) --- sys/compat/linuxkpi/common/src/linux_80211.c | 10 ++-------- sys/compat/linuxkpi/common/src/linux_80211_macops.c | 3 --- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 1d510577f00c..02724433d89d 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1874,10 +1874,6 @@ lkpi_update_mcast_filter(struct ieee80211com *ic) lhw = ic->ic_softc; - if (lhw->ops->prepare_multicast == NULL || - lhw->ops->configure_filter == NULL) - return; - LKPI_80211_LHW_SCAN_LOCK(lhw); scanning = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; LKPI_80211_LHW_SCAN_UNLOCK(lhw); @@ -1887,7 +1883,8 @@ lkpi_update_mcast_filter(struct ieee80211com *ic) flags = 0; if (scanning) flags |= FIF_BCN_PRBRESP_PROMISC; - if (lhw->mc_all_multi) + /* The latter condition may not be as expected but seems wise. */ + if (lhw->mc_all_multi || lhw->ops->prepare_multicast == NULL) flags |= FIF_ALLMULTI; hw = LHW_TO_HW(lhw); @@ -4246,9 +4243,6 @@ lkpi_ic_update_mcast(struct ieee80211com *ic) struct lkpi_hw *lhw; lhw = ic->ic_softc; - if (lhw->ops->prepare_multicast == NULL || - lhw->ops->configure_filter == NULL) - return; LKPI_80211_LHW_MC_LOCK(lhw); /* Cleanup anything on the current list. */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index d9e82a6d64ee..a85e6d0d0dd7 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -310,9 +310,6 @@ lkpi_80211_mo_configure_filter(struct ieee80211_hw *hw, unsigned int changed_fla if (lhw->ops->configure_filter == NULL) return; - if (mc_ptr == 0) - return; - LKPI_80211_TRACE_MO("hw %p changed_flags %#x total_flags %p mc_ptr %ju", hw, changed_flags, total_flags, (uintmax_t)mc_ptr); lhw->ops->configure_filter(hw, changed_flags, total_flags, mc_ptr); } From nobody Mon Dec 15 18:18:21 2025 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 4dVSwt2crgz6L7JH for ; Mon, 15 Dec 2025 18:18:22 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSwt1Nbhz4KrS for ; Mon, 15 Dec 2025 18:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822702; 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=zEGwdUQsOebYn18s0OFyOnnQnrvnoNgQ3ysNLyj6nbA=; b=ADiSW/wt1JM8Qm1xiGyYajyIcbWb/X/4zXWGKw+PwkEvT4s5oWi8GeCsiGKkIHCUhgtVoz JUerUy4qf+e1gU22ZKwqLfJZUjp6TeTDAf+YmLeHx0OTNa8noPcah0IZP0/6BxcY5TgI44 KzIYL8j9E0pqPydiLiV7HIkE2wQJiA+tk8JmxpO+0O+dKHz+ADt4w9mg0UqY2I+vQ2NATa F7zShZGHD2ZROEw1M0viWXmVM7BsySLskEHR4gR7x3FaUWJkBndcfzHpHd6g727XuaTRSA VBcQ9H7CXyui4npG+jeWjTSxO4B5B7WuuBKggcCr5XK2mAXBDvflpnGnS5hNgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822702; 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=zEGwdUQsOebYn18s0OFyOnnQnrvnoNgQ3ysNLyj6nbA=; b=i3KsPOCoNyWOjOZVXxPzGw++yUK/OabDLufIdNWCOsieHa9UeIrHuU/IFyrvKaS3mlbzWH CiCas4tM9ZMhqYA0m7GWAKM+Sl8WjoUQs6HwYUO4DD6VxABU+lSaKcNi+q6uKDRym7X+QP 0zsdnJ2ee5sBj7Rav3qZPmZd98MmwDa3yzLMT4qjFq5CX9+CKAH7shF/MtgkInWETEXbTA IzW/NH08F2w9wcJxfQp7BK/wNOdeGeMkEI4t38QSFxYpMujROxiAp967EkKcbZfjuAxegx sxbjhE6X7e4GqG66ujdfZRHHKUyB1xR16SjK+AV3mLBJX9VAnEfa8N589m3N+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822702; a=rsa-sha256; cv=none; b=NwWwdQCWX2ZIAItWMKPTJoLqNZkw7nicRMfe71pxhGuHAFQw9TTxl9L5waGe8cHh62yQnJ G5yCAxzZnOHoscJwHKxZt6RauL45T/a8Z2wP90xJqVcZJylmh/Z5LWU1S8NI6bmSWnRQaP z2oERt4ZTwwynqk8MOCkDgGIKrzS5T5SCmhytkZ+XGx+DkKyhR7TK1kbBZVIX8c/+5srf7 TQPJ4w5Sgs2EJhRsUTnBbZEFhmj5fmJdUtHKFtQ+qczCexZnwYL6x9PB87FcEPk0/eH4LU fzrfZzcnE7lvdj8ZToHWlGrHl1+FvHmcol5R1fcrQYXcuAk4qIDIFoZGtiJosw== 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 4dVSws6ScYzWkZ for ; Mon, 15 Dec 2025 18:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 254ad by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: ede1087a4015 - stable/13 - bsd.subdir.mk: Drop broken optimisation for realinstall parallelisation 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ede1087a40152d764a5067a550dfecea0133a530 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:21 +0000 Message-Id: <694050ed.254ad.4091e514@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ede1087a40152d764a5067a550dfecea0133a530 commit ede1087a40152d764a5067a550dfecea0133a530 Author: Jessica Clarke AuthorDate: 2024-02-02 21:17:23 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:34 +0000 bsd.subdir.mk: Drop broken optimisation for realinstall parallelisation Not all of the tree is happy for realinstall to be done in parallel. In particular, Makefile.inc1 uses .WAIT to force etc to be installed after earlier subdirectories, since etc calls into share/man's makedb to run makewhatis on the tree and needs all manpages to have been installed. Also, libexec/Makefile doesn't set SUBDIR_PARALLEL, and the link from ld-elf32.1 to ld-elf.1 relies on rtld-elf having been installed before rtld-elf32, otherwise creating the link will fail. In general, core behavioural differences like this between NO_ROOT and "normal" builds are also dangerous and confusing. If this optimisation is deemed important, it should be reintroduced in a more limited and robust manner that doesn't break the above situations. Until then value correctness over slight efficiency gains on high core count machines, the same machines where you're more likely to encounter issues from this optimisation. This reverts commits cd19ecdbdc87 ("Similar to r296013 for NO_ROOT, force SUBDIR_PARALLEL for buildworld WORLDTMP staging.") and b9c6f3168112 ("Add more STANDALONE_SUBDIR_TARGETS."). Found by: CheriBSD Jenkins Reviewed by: bdrewery, brooks Fixes: cd19ecdbdc87 ("Similar to r296013 for NO_ROOT, force SUBDIR_PARALLEL for buildworld WORLDTMP staging.") Fixes: b9c6f3168112 ("Add more STANDALONE_SUBDIR_TARGETS.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43705 (cherry picked from commit fbae308319b7678cd9d879f60b1efd8d4c99b5eb) --- share/mk/bsd.subdir.mk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index e54a21521066..5c5fa9377e81 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -56,11 +56,6 @@ STANDALONE_SUBDIR_TARGETS+= \ installconfig installdirs installincludes installfiles print-dir \ maninstall manlint obj objlink -# It is safe to install in parallel when staging. -.if defined(NO_ROOT) || !empty(SYSROOT) -STANDALONE_SUBDIR_TARGETS+= realinstall -.endif - .include .if make(print-dir) From nobody Mon Dec 15 18:18:23 2025 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 4dVSwv1xFwz6L7FN for ; Mon, 15 Dec 2025 18:18:23 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSwv0Z9rz4Km8 for ; Mon, 15 Dec 2025 18:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822703; 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=XS4w1Tea38xtHiKa8qdrW43F9Zg5mtUTCFRHKgoXC7w=; b=vMPGrG7LG2MPqzeWkCN+lwOIJ33N9LW+sHzWSycWAgWc/lM3BaVrDFPCeCP9xa269+uThU RypV5TDsYby6VDLI417UM1eZcQg1srK/kPoRWomcXhPrOi9xPttCIBXeGkpWM/p2j/sLdA A0oTMtV5rm4ZRnnXu3SfWG71CWcmlZklRUiknDitLlccz9Gi2/AyUhly7E92yAnUQmtsbD RN3vHlUymUizZkcd/mHn/2HON2QFwDRcfnB2nbWcNKIZS9iBNRexauktPD37ifQAt7ReWl HXgcOkgO2M2bkmZt/f1GNibBkq8HtSYZIiYXHnnJEety8vzddgRRbtqTM5VIEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822703; 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=XS4w1Tea38xtHiKa8qdrW43F9Zg5mtUTCFRHKgoXC7w=; b=PW5ynJfcSYsyuPpfP/9Z9nRoUlMLpatQnFiiveO1bRXrYfBDPli04UR7iZaY1oQucWr45m Za0fJ04Gvg8GJJ4g+j4NKuOsXwWBGqMFvnokrUSjuLVR63SRRDSmPJ19WGXqvD477C1B0d +XPN2hcgk+BCtSgJp3b5qbekYAU2WvjvoNGg9PicsBn5nl2rRt5Vk6JYC1xnNvxElm7bfh 3/oLoT9s7YFtShTH+K/+UzJI7kO17uBfVG5pH7SxuoGtfgn81HzWOpZa2E4Kxa4/P6EwhZ AgqR9j/k/sUTGcRl8HyKxAMNQs/5M4WgavXxaOfM+9nD7jIN66J0/uvz1lzFcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822703; a=rsa-sha256; cv=none; b=mLDM5T5aNkbrI5rpO8GAa6PWdgPafFJqG+3L+2yaUzcHROBUBhdp/+uhvx7Ir3jIhHzALW M8iK7vFtIgzPPb+Hb2IaIcqthBWtps7gGhSIaPQk2kBiTXLEc8ffn4DDkT+ax9rYwrLnOh oe/pAoxwyQGv+VvbezMfDZ63wBLiqiy3K/p6eA+JH/KpcDprXecNGWtjSIoAjWHq+LVV5v pJLhHu2Bu7iy8QcC2WiXBFW1euKOMSunOE7XDCNGaqWpbr0dPLykrC2Id/oMa1NvAFpYds p4PwPoIrJmxCBhvo4o4TgwDchVdmi7V0rB1Cfy9y5jesW64OdIJPcEl2ETxi2w== 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 4dVSwv01SGzWkb for ; Mon, 15 Dec 2025 18:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 232fa by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 919db8472a3e - stable/13 - bsdinstall: Fix netconfig script when no interfaces are present 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 919db8472a3e88e7da79c522de1f0a16c4c28c7a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:23 +0000 Message-Id: <694050ef.232fa.3616a127@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=919db8472a3e88e7da79c522de1f0a16c4c28c7a commit 919db8472a3e88e7da79c522de1f0a16c4c28c7a Author: Jessica Clarke AuthorDate: 2024-02-03 01:52:37 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:34 +0000 bsdinstall: Fix netconfig script when no interfaces are present The script uses [ -z "$INTERFACES" ] to check if the list of interfaces is empty and will exit early if so, but INTERFACES always contains at least a space due to the way it appends the list of wireless devices. Fix this by only adding the space when there are devices to append, mirroring the behaviour for non-wireless devices above (both will result in a redundant leading space when the list is non-empty, but that one is harmless). Fixes: 159ca5c844cd ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.") MFC after: 1 week (cherry picked from commit b809c7d6a26924ac351e49a15011da718cc3feec) --- usr.sbin/bsdinstall/scripts/netconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index ca39b225841b..91852db3276c 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -46,7 +46,8 @@ for IF in `ifconfig -l`; do INTERFACES="$INTERFACES $IF" done -INTERFACES="$INTERFACES $(sysctl -in net.wlan.devices)" +WIRELESS_INTERFACES="$(sysctl -in net.wlan.devices)" +INTERFACES="$INTERFACES${WIRELESS_INTERFACES:+ }$WIRELESS_INTERFACES" is_wireless_if() { for IF in $(sysctl -in net.wlan.devices); do if [ $IF = $1 ]; then From nobody Mon Dec 15 18:18:24 2025 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 4dVSww64kxz6L7FV for ; Mon, 15 Dec 2025 18:18:24 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSww2KBwz4L0H for ; Mon, 15 Dec 2025 18:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822704; 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=jKcaw5rid+sYeJIjkvC08nwD3jIE6Zm6zbyKfIq3eQg=; b=bKuToisH2OlIgA0W9JOpTsH32R2pnkvtNrILxIiZcRwcf2gfzz9rqPUxSFPKLT1RYQX2My 3NTmlNze7xyCy2S7Uxg1nV8ORhTGgp/qcf2pxv7MTYVVdrzGkjssmE8bIRBipjGEEciCzV CaAzB7u+cu7RAcULGlVyVyEkNJyHu4d08HL8hJfSXSDcFznD6oDhfRwdZQUQoyAQsy2DH/ 03Qjql6lM3FezApEglecGjrbpDkz93+BLCacpnS7wQmm8ldJXsuYNmYjZyKXtaEo1M5WS4 K0IHvJVIbYtpLxGp4Nxz0gm1KioPwk9XgCbtl/PQ8rPHCwarYb5PphoyoPhuCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822704; 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=jKcaw5rid+sYeJIjkvC08nwD3jIE6Zm6zbyKfIq3eQg=; b=hVO1bEpsLpiJkwev7bnkaOcc3bJwyup5fj8lHBzjCLH0oWOgkMO+eCBtKRsOfztTLt7aiH x4WWpynxk1cqC6hm5d24nRHPGmH4dWUM1zDclBiGjF41T9LRa5//a/UPPgTFeMQbSCOmjD hj9f78k++cfrRaqu0fquxn1Br1CGqoa3FhTtyGqDiOlagunabDh66XiCkiMboCZIMVzp1s 5zRCAG7brIQm1UAHYnRbly+LUjnDdWMzmBwI2ukDTWZTPSWQg32zqdmTOGq983eiWF1Mo/ F+NuSPmRAAj4h7iLwqONsJz7UY9S4AFqRogzpSYBS3HpbhqOph8U0krmc3JhNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822704; a=rsa-sha256; cv=none; b=yHldGzScK22hMMVeb2Zwg28uLlgNgbmVyPgnZqO4uG0oOBcvl8zT96oxGWOYGMDtcUuoz6 L2+YyA3/AgBMUDvxiBaKOhEOCMm1MWJQ1IILz67cANh2wcVSY+qsjd1rQH2tblWO2bW6lZ KFyZK3Ui8BLjJ8EkUM7ckecvJe/1hRzQwvwRmoXqDDYrn0GRwncHjrwtXiu+rpN32N1SqZ uVRXwQjucyDczAGnTuyBG2lRxPEoPGQDiDklTkyGmamNC4Xz0ZHQF7Tn+wKSKM4esK8PDO V5Tdg3k2+CfZom+9F9L4gBMNowxAhGehBm6VWfM8VtIcG8vKAzXzAoWCRilSIA== 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 4dVSww0SW1zW0j for ; Mon, 15 Dec 2025 18:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23c54 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 8a29ebd6eac8 - stable/13 - bsdinstall: Drop Error from title in netconfig no interfaces dialog 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a29ebd6eac87c340d1abf4b0f37a2c5e3ec8b60 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:24 +0000 Message-Id: <694050f0.23c54.21114c5c@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8a29ebd6eac87c340d1abf4b0f37a2c5e3ec8b60 commit 8a29ebd6eac87c340d1abf4b0f37a2c5e3ec8b60 Author: Jessica Clarke AuthorDate: 2024-02-03 01:52:53 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:34 +0000 bsdinstall: Drop Error from title in netconfig no interfaces dialog This isn't inherently an error. It is if you're attempting to download dist tarballs or later install packages, but a FreeBSD system with no NIC is a reasonable setup to have, especially in a throwaway VM setting, so we shouldn't say it is one. Leaving the exit code as 1 is still fine, since auto will ignore it, and avoids breaking other uses. MFC after: 1 week (cherry picked from commit 7414d14bd51d8378057bbe952c2715b9f32d1d3e) --- usr.sbin/bsdinstall/scripts/netconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index 91852db3276c..ae7d1ff542ea 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -64,7 +64,7 @@ done if [ -z "$INTERFACES" ]; then dialog --backtitle 'FreeBSD Installer' \ - --title 'Network Configuration Error' \ + --title 'Network Configuration' \ --msgbox 'No network interfaces present to configure.' 0 0 exit 1 fi From nobody Mon Dec 15 18:18:25 2025 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 4dVSwx5Rd9z6L7Nc for ; Mon, 15 Dec 2025 18:18:25 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSwx2cD8z4Krl for ; Mon, 15 Dec 2025 18:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822705; 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=412a5LoosJBl1KRhy5jHhRugxR5rwSF1o5Xv2RqSHdU=; b=kLHnGggjJ1Oaq7uvYzpLiXIYrSBRQgmcyJEEpYSeffkW/abEa3ID183auzUkR6VGWzm8UO wueOIzm1QmcNcKRa1xry9wZBB/tVIQKuT389MOWi/Gww2L71gFZxFD8PywYWTBxn68haVd zINinYy0eMWVA+osL9GJF1TfgpbD4vndhudoerssHgq/UgiSYHNcfFvfuvD45BjNlLzUih UiEmCdEb8rLlS5/roFVbPZUvfjxQInU2MYQE4STMntDLquA9PAHwnnRHSG5dxaXoheqH72 XeWotZs8U5oneWNQdGH/9awhfZTxWB6m0Vp4YYEZJDOcTLIx4imqoQaz9uyuww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822705; 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=412a5LoosJBl1KRhy5jHhRugxR5rwSF1o5Xv2RqSHdU=; b=CL4PP/fqFK5e6D9ioy8y/UDlDo3dIQWHtqsUlzMBvTJP3MKi+vOm4CjWT+XI36h6CSHx7O /b4dBH+LVIaQIp6S4WpMYvhK227XtZ88tBxQtDeScGOJKoH8mxftwXk4EsGUZtDasUAcx9 qP4fwL8piwt3MeJT83NZ5C4pqJikAP9/t8blKKIl7jP6fKuqh360ICF3Fajw337Qm2nHei TaYaWBHMRcKHhOCvf6hiSs2KAI0oA4HY67r2NoSIwA4/xVZTfD/7yOGN4Z8HycsfApCSnu Ouw8XpC+OdJ90Yw8hSnaJ3uq92pW1Fq2+MNkxuwtFNCx8J8Y6EI91f7W+9TxUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822705; a=rsa-sha256; cv=none; b=ojr7xVzRKSM3ZwSGkSSGqm8WRqbemVbe+hlka2jA224lraaSZ1ex5Tr03Qg8gpCfTtGND2 jbqBVNfmta3ImBNKd5R2gP6AaJsTGASoZ3ES62riRXqLJVMP+O2woBT4RTpmIit8s0HsGB 92XgFuUAFYh37IoxkWvUmrnSCsblJKK4REY0gzxazZmpFTkiAR50kWG9bKT5SC/fms/txT +xikTLdX/YW5AxtgIRJfqQT92GeulRyaxerjMdeqqAIqTQUYEdb8VtfX2CIXHB1DydzpNO z7cpjvBXQKZZuoIVZxaOFBYl02tmPEhjNKCD9tpD2qXseLOClH5VdEppooA8zg== 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 4dVSwx1GB4zWn2 for ; Mon, 15 Dec 2025 18:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25a2a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: c4f666e81c6e - stable/13 - efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 case 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c4f666e81c6e7c4b726d7c5ff34a95e652848914 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:25 +0000 Message-Id: <694050f1.25a2a.2e97ba0a@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c4f666e81c6e7c4b726d7c5ff34a95e652848914 commit c4f666e81c6e7c4b726d7c5ff34a95e652848914 Author: Jessica Clarke AuthorDate: 2024-02-23 02:36:21 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:34 +0000 efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 case If cnt == 0 we access element 0 unconditionally, which is out of bounds, and then if that doesn't crash and happens to be 0 we will access element - 1, also out of bounds, and then if that doesn't crash will add 1 to whatever junk is there and use that for the variable. On CHERI, though, this does crash. This code is also overly complicated, with unnecessary special cases and tracking more state than needed. Rewrite it in a more general manner that doesn't need those special cases and naturally works for cnt == 0. Found by: CHERI Reviewed by: imp Fixes: 1285bcc833a3 ("Import Netflix's efibootmgr to help manage UEFI boot variables") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44029 (cherry picked from commit 09cb8031b43c8e98abb5ff9b43ff649031d1e808) --- usr.sbin/efibootmgr/efibootmgr.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index dfe8bfb1c145..74b59863d6c5 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -555,7 +555,7 @@ static char * make_next_boot_var_name(void) { struct entry *v; - uint16_t *vals, next_free = 0; + uint16_t *vals; char *name; int cnt = 0; int i; @@ -573,21 +573,14 @@ make_next_boot_var_name(void) vals[i++] = v->idx; } qsort(vals, cnt, sizeof(uint16_t), compare); - /* if the hole is at the beginning, just return zero */ - if (vals[0] > 0) { - next_free = 0; - } else { - /* now just run the list looking for the first hole */ - for (i = 0; i < cnt - 1 && next_free == 0; i++) - if (vals[i] + 1 != vals[i + 1]) - next_free = vals[i] + 1; - if (next_free == 0) - next_free = vals[cnt - 1] + 1; - /* In theory we could have used all 65k slots -- what to do? */ - } + /* Find the first hole (could be at start or end) */ + for (i = 0; i < cnt; ++i) + if (vals[i] != i) + break; free(vals); + /* In theory we could have used all 65k slots -- what to do? */ - asprintf(&name, "%s%04X", "Boot", next_free); + asprintf(&name, "%s%04X", "Boot", i); if (name == NULL) err(1, "asprintf"); return name; From nobody Mon Dec 15 18:18:20 2025 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 4dVSwy2QqGz6L7L3 for ; Mon, 15 Dec 2025 18:18:26 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSwx6LP6z4Kmc for ; Mon, 15 Dec 2025 18:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822705; 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=HY0xUVnA0170K0N/GF9Pak1KOX8sVfXkLws5aeMKrp0=; b=YINd9ddOlbyUMwb2E/DF7kqUFGOGkxtcyj3PjDl3dX1ajETNrALfV2yUJ951IhOA3dVz+s LQ8Cw0FrOkaaaYCOef0gx/Al7hUxrgIzdi3E6tzo5N13WkGfKVYoM9Vrjq93+X7ymc7jO9 WoGqFVkrqcliDegQxa82Y0Hk6RH4IQQaFfPOK03C5ZnGSYiyqcnDpPJufIzSxNdiVdgcFO UmFaY8vch7UPpRAD+vIHM6S1U3p74Nz2k0Hj7nUtqZlu3QZTBIeL74fHk+stNNPfxCjKxu 8VYVZP9QjRxFCaizHKbH3Cq7jgZ2bXkf1BwPK4EkkHVOjpRZIt1mUKzfXZtJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822705; 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=HY0xUVnA0170K0N/GF9Pak1KOX8sVfXkLws5aeMKrp0=; b=ep41t8PYZ0kUJmYudx0daks/0b/tZqmJwS9sNPY8D68IIAPxnq5VMK4NTNV9EmHlNW8wAX jnyI0UKbsVbvkTJZn5zyavCJ+FWJ5Fx15DI5JXviBzdHRmVmUkR/rXgNfzdbIifq45HzYF RZ6yvnxikS8XZPmRKWlfZgZB87vJU9bP1/gMtYtFTQSsrDXyx3+t9fs+7Idw24LcZe9pMc DMrB6MaRmkQPVht4iUDX+6Mlv9QVcDVcSCqFV5EVBZIzhujowpTvdRGcYXvsVMt2l7tbG/ Zfg99oEhKMd5n5ZA65LINyrhvuuOVs1JOZiAUPgL5MGmJ0SEbnDhttUVH5B/Sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822705; a=rsa-sha256; cv=none; b=FZM8zDptxjUpiDGtnwCZMUpqm5ipA98F55USAWb+q0HQA81xElTK7X0v73/gyL0skCzj4o nUVqHrZFoNgxDl2/+gL3eVCKIUsnOTccSh/cgUplbtwRjibvBlnE2+8VYQYiY0/aVq3CA4 b6tYIRTwjtrNMSRuIzBUbVH0faaAvXaxPYdtBiIj2N/sGCtI0dTjlfwrY0iw83rzinwXl1 eo+uOhX2rsRaH4GZcfYYU7aBnb6v5y1pBBSveSCxriNouYV0qPvQB/OBBz7lNL5KvrCHrY 1bh3bRIRZpHOnVhrQJbfNEW/OiU6UtTPlctY/okYa3+zp1pbeadrLR78o9nRWA== 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 4dVSwx5skwzWn3 for ; Mon, 15 Dec 2025 18:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 261a5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 8a95bcc10b23 - stable/13 - riscv: Remove the unused riscv64_cpu driver 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a95bcc10b23b13e8b14bacba4a0cfb310a2aa88 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:20 +0000 Message-Id: <694050ec.261a5.5e729705@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8a95bcc10b23b13e8b14bacba4a0cfb310a2aa88 commit 8a95bcc10b23b13e8b14bacba4a0cfb310a2aa88 Author: Jessica Clarke AuthorDate: 2024-01-30 20:33:30 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:34 +0000 riscv: Remove the unused riscv64_cpu driver This is a repeat of 63bf2d735ca3 ("Remove the unused arm64_cpu driver.") for RISC-V, which copied the defunct code from arm64 with no changes beyond substituting riscv64 for arm64, and made no use of it elsewhere. It has thus always been entirely superfluous. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43672 (cherry picked from commit 722b40377198e384a808f9561ae7262767068ab2) --- sys/riscv/riscv/mp_machdep.c | 77 -------------------------------------------- 1 file changed, 77 deletions(-) diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index 8de1673b436b..e19f2feb4775 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -80,10 +80,6 @@ static enum { #endif } cpu_enum_method; -static device_identify_t riscv64_cpu_identify; -static device_probe_t riscv64_cpu_probe; -static device_attach_t riscv64_cpu_attach; - static int ipi_handler(void *); struct pcb stoppcbs[MAXCPU]; @@ -94,7 +90,6 @@ extern cpuset_t all_harts; #ifdef INVARIANTS static uint32_t cpu_reg[MAXCPU][2]; #endif -static device_t cpu_list[MAXCPU]; void mpentry(u_long hartid); void init_secondary(uint64_t); @@ -114,78 +109,6 @@ static volatile int aps_ready; /* Temporary variables for init_secondary() */ void *dpcpu[MAXCPU - 1]; -static device_method_t riscv64_cpu_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, riscv64_cpu_identify), - DEVMETHOD(device_probe, riscv64_cpu_probe), - DEVMETHOD(device_attach, riscv64_cpu_attach), - - DEVMETHOD_END -}; - -static devclass_t riscv64_cpu_devclass; -static driver_t riscv64_cpu_driver = { - "riscv64_cpu", - riscv64_cpu_methods, - 0 -}; - -DRIVER_MODULE(riscv64_cpu, cpu, riscv64_cpu_driver, riscv64_cpu_devclass, 0, 0); - -static void -riscv64_cpu_identify(driver_t *driver, device_t parent) -{ - - if (device_find_child(parent, "riscv64_cpu", -1) != NULL) - return; - if (BUS_ADD_CHILD(parent, 0, "riscv64_cpu", -1) == NULL) - device_printf(parent, "add child failed\n"); -} - -static int -riscv64_cpu_probe(device_t dev) -{ - u_int cpuid; - - cpuid = device_get_unit(dev); - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - - device_quiet(dev); - return (0); -} - -static int -riscv64_cpu_attach(device_t dev) -{ - const uint32_t *reg; - size_t reg_size; - u_int cpuid; - int i; - - cpuid = device_get_unit(dev); - - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - KASSERT(cpu_list[cpuid] == NULL, ("Already have cpu %u", cpuid)); - - reg = cpu_get_cpuid(dev, ®_size); - if (reg == NULL) - return (EINVAL); - - if (bootverbose) { - device_printf(dev, "register <"); - for (i = 0; i < reg_size; i++) - printf("%s%x", (i == 0) ? "" : " ", reg[i]); - printf(">\n"); - } - - /* Set the device to start it later */ - cpu_list[cpuid] = dev; - - return (0); -} - static void release_aps(void *dummy __unused) { From nobody Mon Dec 15 18:18:27 2025 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 4dVSwz6VVzz6L7Fj for ; Mon, 15 Dec 2025 18:18:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSwz2rFHz4Kk3 for ; Mon, 15 Dec 2025 18:18:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8I84J8gVdd9em7V2iHXdPErKqJT74qnFXWobWmq+MkQ=; b=i6TZyHo08LZRpF6P4VhnH/EWAdBH45WTJIRnvbwBe9b+xhWXSFONAxhz6lWAZbN6NJcHtq hvofYCfqAJlrZLClLeTBT56HpWYUXL/A9k1lcxp4qs8HtsQhEaJYY3PPLHS/pyBTV/M4tn vP4JqJ1spIg5aqU54hUIn521bG0okBTTqx8yQN/Je1x/G9CQYdRvt7ZWH/oaShyU3dY+qc gMFvney6sbqQIU86znAO1oi5rJcjafHSeKOd3rCC8eI0SEafacK1B7wTtqBxbnhqRgyfDG N7cW/cxPnpqSyJgr6zamID12wslBKVybN1TAGnT411npzmVKGNAuIZi+iqL1nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8I84J8gVdd9em7V2iHXdPErKqJT74qnFXWobWmq+MkQ=; b=nfqafn2qfRs3nOAf4uOYFQA/T0NtQ/WQ1nYb482ZshVq4vXmoI18vYfjhGkXJ8sDBBDHBP kzXu8x5Fx2N4W7jOH0mkgOQM3viXvpu2UpXiA3GtARROrovLHE4vW/vBPwAKWWvkFIBgI4 YRlxcrGidalV1SlEMtxHOOEtfJ3HIl1to9rC0tjnTvoBKSKopbOqUBiEz2lqbvHsqI4o7V ejmdVzl48RIHlz9gjBkQmxAVJvpKI3TRylSHLtGbATdq4ikZSAJJ4Ip8EHgOOPkdyrcnYW 39UuZM6EAkk/+yJkZ5bQkiUMz0dNtIVSyA1eiWrH1ubu5Uz+yHIhOgU55sqnxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822707; a=rsa-sha256; cv=none; b=Xf4MVx33Ytuk8kL11Wo9M4JKKWISovQbd+suuAJJYViyhTxbepB/wJTGSaMmR0VY3A6NCG jXezkxmCC8COWmrp9TqPRyPPWFYom3ethMzrQkTzgFifYN4CLgMeCdmVv76dPbr5iN/Bwd ZuzLr5/IXXdbODOqeBE+6LLGGSWUIj14Zcg3W0d8YtIfvY5af5JujbTbez1t/0S1uoQxbB JD9bdX1ItBxEsAWRS4OpkeFCBf8bmLSXbMyW8k/0WLFJuUSSS/M2kk6wg9+7YOJCegas9e 1Ui/48nOOf2qqO1L91icxaiaFm91mj6+JRiZxUILuc2fZcX30sQ9d9PARRYpXg== 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 4dVSwz2R3HzWZJ for ; Mon, 15 Dec 2025 18:18:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25529 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Dapeng Gao From: Jessica Clarke Subject: git: e41762d412d7 - stable/13 - Fix off-by-one bug in btpand 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e41762d412d7d06a85db031de100cd0b2a5c0c02 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:27 +0000 Message-Id: <694050f3.25529.6e9489e1@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e41762d412d7d06a85db031de100cd0b2a5c0c02 commit e41762d412d7d06a85db031de100cd0b2a5c0c02 Author: Dapeng Gao AuthorDate: 2024-06-03 19:30:36 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 Fix off-by-one bug in btpand `ul` reaches `__arraycount(services)` before the bound-check happens, causing undefined behaviour. Reviewed by: imp, jrtc27 Fixes: 7718ced0ea98 ("Add btpand(8) daemon from NetBSD.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45463 (cherry picked from commit fbfdf57d65bedfab28f9debc8a4a8d6802f9338a) --- usr.sbin/bluetooth/btpand/btpand.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bluetooth/btpand/btpand.c b/usr.sbin/bluetooth/btpand/btpand.c index a0f380918bf1..721bafba8321 100644 --- a/usr.sbin/bluetooth/btpand/btpand.c +++ b/usr.sbin/bluetooth/btpand/btpand.c @@ -147,11 +147,14 @@ main(int argc, char *argv[]) case 's': /* service */ case 'S': /* service (no SDP) */ - for (ul = 0; strcasecmp(optarg, services[ul].name); ul++) { - if (ul == __arraycount(services)) - errx(EXIT_FAILURE, "%s: unknown service", optarg); + for (ul = 0; ul < __arraycount(services); ul++) { + if (strcasecmp(optarg, services[ul].name) == 0) + break; } + if (ul == __arraycount(services)) + errx(EXIT_FAILURE, "%s: unknown service", optarg); + if (ch == 's') service_name = services[ul].name; From nobody Mon Dec 15 18:18:26 2025 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 4dVSwy4kJDz6L7L7 for ; Mon, 15 Dec 2025 18:18:26 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSwy2G14z4Krw for ; Mon, 15 Dec 2025 18:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822706; 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=LImktDrvshb2v6QN9V4x545girzGWYlHSKZzUgFnlKU=; b=Bu1ZigbQHjLxTqDAtb5YFuNivh8IEHL6xM0i3vguo3obQ6q7ssYS6rBuSqLEVKi/u3YBSR IGkVpxOoqHcRbj2bXkr8EOD11fiWTXB2rY31wXijGq0gmVy0Kp2fzR+KCS85wk2GbTXpUJ S3X1KgHP5aZTezwxZkSvbPTkQhDh6YE4LS68Cns6RtKnMG14LUQ+3YeccTcFRwp4aKoFZO Qec68olxBJMDDm2pAR3GOjETnRJYFWDrodJAPC4pAlhlTouYF1jRCk0VxThkZQt5y5hyzZ zej/czKI92Qmje0IKQYQem9kzRGrVoZro1igGlvqRaiNQQuP2HqeONj27d+gUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822706; 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=LImktDrvshb2v6QN9V4x545girzGWYlHSKZzUgFnlKU=; b=W9BE6n89ysBh5u33HscuSI49t9GBX/fOWyOA9cLAbhJtPwRLodvV6lrROtDZiQ8xdYZB77 kt+/+avU2mSf4xMjEJuIFyXg/mKRljMAJ/vf4xavJG1RSHleBcUR42UawOue/kJaqkdyLf nubq1YSP61PrBvTPCwgIJ0r938z+o8nB42bhDtS1PmxvR49DnZJOSHSBMktpzlXiRMaicN CaM//kDUoiz/OBZA3B0UHf8iwW0wBIaGPimKQo6Hsv3Ju31ZP0fA2GmO+1lLL1bx+lxqgf f369k7IqZVactS6zza7hvZkiF+jSar0JFSlFKsthgZQnIDmY+xPfdE4Rih09Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822706; a=rsa-sha256; cv=none; b=mfd1rNi7eHue4B4ry0vKIeaGoc6jlafhkQNjOFD3iob5u5ylZWpOByH7kyHahIiZUNvg1T Yp94RIGRhcfs27s2b79cUZ4u3JNV7fAZU/I2j9/PlrVKyjvqZSo/DVxQZAmGm5OvawUeWY mRCFxWpGeEHXl75+txG2svTcZPnUb0Hy2PJnpDYswGdHS7qsPU4nkMX+DfutVqw3Qf0uT9 2zEJKO82UKDGRqI2k25iv6CkblGjiUSUHGc0kZOmJWRtq7xXbljKxmgQF+jy+D2hCm7Ipg jWLzaS6IbX9d0pk+smSk+1X3v5ryBAg48VuX3EuXFu35dxiRShjNPkjduS8eXA== 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 4dVSwy1hnWzW0k for ; Mon, 15 Dec 2025 18:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 257f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 8aaae40a354a - stable/13 - ee: Fix use of uninitialised pointer in ispell_op 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8aaae40a354a831b0c2ac13f34dbf0f99faa8b8b Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:26 +0000 Message-Id: <694050f2.257f5.25b0b3df@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8aaae40a354a831b0c2ac13f34dbf0f99faa8b8b commit 8aaae40a354a831b0c2ac13f34dbf0f99faa8b8b Author: Jessica Clarke AuthorDate: 2024-06-02 22:53:09 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:34 +0000 ee: Fix use of uninitialised pointer in ispell_op This used to be name = mktemp followed by fd = open downstream, replacing upstream's crude PID-based sprintf, but in 1.4.7 this was changed upstream to this buggy code, which we then picked up in the 1.5.0 import. Presumably nobody's actually used ee's ispell function in the past 15 years; that or it's just ended up using junk file names as temporary files if name's happened to be a valid address to something that can be interpreted as a string. Reported by: Dapeng Gao Fixes: 96b676e99984 ("Update ee(1) in the base system to version 1.5.0.") MFC after: 1 week (cherry picked from commit 25a33bfe9ce2b55812201f475e9d3e64009b40dc) --- contrib/ee/ee.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/ee/ee.c b/contrib/ee/ee.c index 5976152414cb..002852e9e59a 100644 --- a/contrib/ee/ee.c +++ b/contrib/ee/ee.c @@ -4436,6 +4436,7 @@ ispell_op() } (void)sprintf(template, "/tmp/ee.XXXXXXXX"); fd = mkstemp(template); + name = template; if (fd < 0) { wmove(com_win, 0, 0); wprintw(com_win, create_file_fail_msg, name); From nobody Mon Dec 15 18:18:28 2025 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 4dVSx068qKz6L7JS for ; Mon, 15 Dec 2025 18:18:28 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx03z9Kz4Kvm for ; Mon, 15 Dec 2025 18:18:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822708; 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=y6kZClPBKkgUGrPugv5sJyFBZjsV1LXriJzY2aC15Dk=; b=b+1waJJK3Y3jd3zqBDSDMk7Ru+FqLP1mEIZKZxLIPJU+AX1RTPPxYu+Dr8X5g4pnMi6Hrd UNd5a8tPPB1w8R6Oh7/rdgnawre7+m1KAM3+J9748XA/v8PIU38dGNBY1ZRVQe3nWr9Hk8 k2vH3YXcGCiSSixwnaBzqh84PpF7XWtkqhxfwV0Fvbhdawz82U6xE7aciQDtwcERV72qyn lg7x6TMthdgi6LEW+zqxlu97EqN2IxMavcHnqffKUrgWDGqs8a3BzfZZLzvn01Gx4DrNkj q0AJQiTnxVLActef1kgjjPFGHyORtmcZZPu8kAH5G4uT8eABrBcfHGdTNpnxbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822708; 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=y6kZClPBKkgUGrPugv5sJyFBZjsV1LXriJzY2aC15Dk=; b=e2L3L68gnYnXtJdKS/IAxykheLonreD7zQr9sh4xJUuXzOQVYF9ODYni7cdHBVoTosejob +gRvqVJtki8ckJsGtfie0VqTzPeGyrAKitqdB3BMcS4uzA+ZvskHtYmi1k7pQmEO1WzNis +PN4aBt1WN1wA4MQPCZ3SGaDPjkNoZtjR/6pgF6a446GsrFsfzVrAa3BmybPfztHTltLZu UXjbYX6iBAOy9df4DLHoNE+FxSgm8Us9y8B/abRw3miahcWhTZ346AcvyJH2HWv7/i1keC 1sjzolzK/LIkx9o+1say5D0c0L0So1VB0UkTeju3aEn5mbfA5Q8ObrzvX9DM9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822708; a=rsa-sha256; cv=none; b=m9rRQRbcoWphrsQLssJePPZpOJnRRy0s90lCYHEoVIkPdb/Ecrt45/D1YL3rm4aay/XYkH m0CiPgTRcInIw+zA38UAQzkY5TZ4osb55VURVGvs+eSIGhiywMsqRiFRdAOB82AO6nBbyJ CZIv6X1+E7Z4hpdm0UJ/rngec9yfVt/ajPNgY/yTOcT8OhGxFy3BMtmt/0TUX2SQlNOX4u zc8cRrnSLPg81wXJzOmwNffmBatCxDusFOjj5dcptbi+Mnwhqzpa7EeG/+8+u15x6uTEfO seUVGGZHuXXByxsNzjyJjvGZ0DIJEmD84QgxmdI63bsuUvK2xya5MSdnRPWwzA== 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 4dVSx02lTDzVhD for ; Mon, 15 Dec 2025 18:18:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2552e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d3fc73b79c6c - stable/13 - mx25l.4: Document the correct disk device path 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d3fc73b79c6c590d10678986c47aa44e94989da9 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:28 +0000 Message-Id: <694050f4.2552e.6b8c7910@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d3fc73b79c6c590d10678986c47aa44e94989da9 commit d3fc73b79c6c590d10678986c47aa44e94989da9 Author: Jessica Clarke AuthorDate: 2024-06-11 16:43:18 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 mx25l.4: Document the correct disk device path This was true at time of commit, but the path was changed 2 weeks later to just be the /dev/flash/spiN name, without updating the manpage. Reported by: David Gilbert Fixes: 68dd77957786 ("Give the mx25l device sole ownership of the name /dev/flash/spi* ...") MFC after: 1 week (cherry picked from commit 703768a23590d8faf65b0f16dd395248ff7273f6) --- share/man/man4/mx25l.4 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/share/man/man4/mx25l.4 b/share/man/man4/mx25l.4 index ff2e78a8c5aa..5dffdebcf43e 100644 --- a/share/man/man4/mx25l.4 +++ b/share/man/man4/mx25l.4 @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 26, 2019 +.Dd June 11, 2024 .Dt MX25L 4 .Os .Sh NAME @@ -60,7 +60,7 @@ such as block size, sector size, and device capacity. When a supported device is found, the .Nm driver creates a disk device and makes it accessible at -.Pa /dev/flash/mx25l? . +.Pa /dev/flash/spi? . The new disk device is then tasted by the available .Xr geom 4 modules as with any disk device. @@ -189,13 +189,9 @@ Set the high bit (1 << 31) to invert the logic level of the chip select line. The SPI mode (0-3) to use when communicating with this device. .El .Sh FILES -.Bl -tag -width /dev/flash/mx25l? -.It Pa /dev/flash/mx25l? -Provides read/write access to the storage device. +.Bl -tag -width /dev/flash/spi? .It Pa /dev/flash/spi? -An alias for the -.Pa /dev/mx25l? -device, for backwards compatibility with older versions of the driver. +Provides read/write access to the storage device. .El .Sh SEE ALSO .Xr fdt 4 , From nobody Mon Dec 15 18:18:29 2025 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 4dVSx20ylBz6L7Ny for ; Mon, 15 Dec 2025 18:18:30 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx14Tptz4Kq4 for ; Mon, 15 Dec 2025 18:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822709; 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=chTQDwDizPh8WtmHc/Wnc43sY/Kr7lyufrB7y5vVR9U=; b=fWaUsog5lEwXTeNjatk/TW0YUSEWoMCr+01HwnpRtxLMHZGllAOHWKy4qwlCWiz8qbY+M/ Zj7D0/PZVYaOGRCVDFk7KI/3E2DSSW1h0vQGV6QXa+0lPBy0CtrZWwrhy+t8iXcjmzAD8N Tw96kWlzhVEO3A+XogDTcclgN9zE19qy0pmhk3p7y/gUENo7Y5YbjyCBxlRT51i85/RBnd kAAuykYhmvFXG8nytorK83wnUS/QBowOZW6N56h21F7ybhQWLZeXofP0bzQczVeQO055gE J0goEqK3Ow4YdfIsisttXfqTSuxMdnwx5c5fPOviP2JlNjRMcHqULsVhvf4mew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822709; 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=chTQDwDizPh8WtmHc/Wnc43sY/Kr7lyufrB7y5vVR9U=; b=c8YKxoteJZiOhLg5j73JozTvgoaoBYK1PpPjleSnSt0nry1fZJyfDnIm0HAVRoDIGi8nQH t8cQj5vkw/TyyJuQDfdUN6vhEQidF2tmCqxaxqRTeD9lf8gqotvtAieiaDrhtnjDoNs6wS LA1yTZL2F5hgCaCJymhM8i6emauVxeMHErOh3iaxL9pJntEOzm4HJhnuTzNrmPj9Z8fOSE uyi2vRi0sz36V1KmsGEtCw3mzQB0EnGmaoCjWq5MiQqVwc/4eXDU6IgNb10zPi2u+b86HT t1xURJRnu+Kn7yaIOisf+wy7u5mme09bV8Cd5DDG5JGjhvcDowRX1nxCpBMB8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822709; a=rsa-sha256; cv=none; b=ccTEtSP/PIta0yRU8MTKvfhwlNOu+e/3sDWBEUN7KCD2/rFM6aqrIAQ3OPygFXUCHHHlV3 7hsYKcKYpvscggKuLHpJy3nhDmu6+tFtEWsyx5XJwuJ4N6Tn91RZ4h8Hpi0UKsxSZeCgu4 Wq1TUTcac05wqP5PLF1ICEZKMEOkoFW2lppGSPrVO4HAgz5URnXhxNR3gmAJjZrrh67snf kgh95X+FEy4esTSrBu3rEqvwHxPLwqy7ob7Ic7t8kQB3wPIIxt3CogYufpIS/uHrpzvBiY HW8Z3o8ZihOBkrqI52leUPi2t7Uxw924apZTML6gfSONY3OZmLYQ2Saz19KAYw== 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 4dVSx13ZbmzWdm for ; Mon, 15 Dec 2025 18:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25a2e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 91104d97ef24 - stable/13 - rtld-elf: Pass parsed aux_info to ifunc_init 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 91104d97ef248f9122dd5a7ae02daf540e695039 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:29 +0000 Message-Id: <694050f5.25a2e.432a0561@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=91104d97ef248f9122dd5a7ae02daf540e695039 commit 91104d97ef248f9122dd5a7ae02daf540e695039 Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 rtld-elf: Pass parsed aux_info to ifunc_init Currently we pass the raw pointer to the on-stack auxargs. This can legitimately have fewer than AT_COUNT entries, so the use of __min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also needlessly forces the callee to iterate over the elements to find the entry for a given type. Instead we can just pass aux_info like we use for everything else. Note that the argument has been left unused by every callee since its introduction in 4352999e0e6c ("Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86.") Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46276 (cherry picked from commit 33658afd4e4d11cd71d92e52ca9da5381cdd829b) --- libexec/rtld-elf/aarch64/reloc.c | 2 +- libexec/rtld-elf/amd64/reloc.c | 2 +- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/i386/reloc.c | 2 +- libexec/rtld-elf/mips/reloc.c | 2 +- libexec/rtld-elf/powerpc/reloc.c | 2 +- libexec/rtld-elf/powerpc64/reloc.c | 2 +- libexec/rtld-elf/riscv/reloc.c | 2 +- libexec/rtld-elf/rtld.c | 2 +- libexec/rtld-elf/rtld.h | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index 828686af8b98..c65b5dd431a0 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -352,7 +352,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 9c5887def356..2e24d6287ea3 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -499,7 +499,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index b62a62c5b116..3326ed2214d3 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -485,7 +485,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 04a8354343bc..c91239eb3989 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -464,7 +464,7 @@ rtld_cpuid_count(int idx, int cnt, u_int *p) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; int cpuid_supported; diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c index 55efd440ad81..4083d983b52e 100644 --- a/libexec/rtld-elf/mips/reloc.c +++ b/libexec/rtld-elf/mips/reloc.c @@ -752,7 +752,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 73a1c89991e2..859991cbe27f 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -802,7 +802,7 @@ powerpc_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 70928829aeda..71b7a361f0df 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -699,7 +699,7 @@ powerpc64_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index d806e1ec3d63..2b254803fabf 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -377,7 +377,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index cbf4baa1aee9..d3c696145d5c 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -930,7 +930,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) exit (0); } - ifunc_init(aux); + ifunc_init(aux_info); /* * Setup TLS for main thread. This must be done after the diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 2673e62ddd65..306c460f286d 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -423,7 +423,7 @@ int reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *); int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *); int reloc_iresolve_nonplt(Obj_Entry *, struct Struct_RtldLockState *); int reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *); -void ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]); +void ifunc_init(Elf_Auxinfo *[__min_size(AT_COUNT)]); void init_pltgot(Obj_Entry *); void allocate_initial_tls(Obj_Entry *); From nobody Mon Dec 15 18:18:31 2025 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 4dVSx42h5Wz6L6w4 for ; Mon, 15 Dec 2025 18:18:32 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx35kV5z4LDK for ; Mon, 15 Dec 2025 18:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822711; 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=uAFaDYbREG6/vmAvDHwnrWRGZEe/I1JsOEKODRXsoOs=; b=f3th0VtC+TfAIJPOY8lz7Yi4ayK9qNz7eC7tfysdu03NrjOsSuSmVY5TgXzbTne5SetBy2 0tIJaZsTyja+wVhNglvVAP/awqHY97SEUfnkDlxMqVxs3kL7nfwtj1u0XjiHmkXA0J3W31 bQGrHA7FP3eKStfQeC0FyCwTrVZJ6Z8Xp7ORMkjdGXVK7WgzkX07FaFVQe5a6oKHtQFZSi s3lX/9nvjbF3JHImAPX4b5rB9frNfC+iW7YS4S2KLcKGS3qypj/sJOa9XKnIYruzjUEmI0 W022vtWA0Y+UkM/nRdY13rY5dJPyrt9nyg8ZjsCzR7iWMO2KuEuWyE2l/usBKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822711; 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=uAFaDYbREG6/vmAvDHwnrWRGZEe/I1JsOEKODRXsoOs=; b=LVL1R8AgsALEUcizLe342L8mGPyS3ddqtejizdfLtVIfBpSbiFkSOTe2CKDWBQGJxjklPY XP4twioruEP+qfS1WjM9M7XUS5ukYEOIgidcN9ABJGSmNFGe/5U5vJ1dZZ3L8yNbGtA7kf ecpj1nq8FkKj3XMMVMpGfQlIBxs9d4ilQEDz/Ulcgd0U/I7yHw0SONGtWx8NEZriVUWRDX IAuUVrI3crEtJEea66AgNYG+5ZIKeEykqAluE2cUI2G0D5fBUkD4FTtYFbTZZGytLgt8zK Wy84UbxD0nL2GRg8MokN2/YkDI/U+6+0QhFLIq2KBRK60m5aOIAFrzMbDKpq3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822711; a=rsa-sha256; cv=none; b=g/v26Pq9sJKLsu9gD8pyGuNpEkiFZ920UVLHyw0I0hf7ecQrUKOZ7zUBOZLov+XKSr0ksl VOf+yJ/l1hLXWesblh/meP/lUOvNpJf/jFjFAMx1f4/xBIDDQZHHaxd2591pCPC7fiSQa1 VD2XrxC5uDIGEFbqnyyY3ZP0vIplail0hhB2pBy0zbuGivrO1GK5axqMXXghTzHL7LEZQe meZe2wB6tI4mJqAsA9Yp1yN0Kf4cTT2LYdKCTh/fcx0K7XCBPufl0xndxbMBJWfFOXlM+7 D3H1KZsJNSXTmGSFdj5oxpPt+HDaifaFicvjYg4xrbIPfuVsZPPAY8sx0pZTrQ== 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 4dVSx355sWzVhH for ; Mon, 15 Dec 2025 18:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 261a9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 8ccd9c23e64c - stable/13 - rtld-elf: Support IFUNCs on riscv 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ccd9c23e64ca07b22375610e89bf686dad6e46c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:31 +0000 Message-Id: <694050f7.261a9.4c4adb3@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8ccd9c23e64ca07b22375610e89bf686dad6e46c commit 8ccd9c23e64ca07b22375610e89bf686dad6e46c Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 rtld-elf: Support IFUNCs on riscv GNU/Linux has historically had the following two resolver prototypes: 1. Elf_Addr(uint64_t, void *) 2. Elf_Addr(uint64_t, void *, void *) For the former, AT_HWCAP is passed in the first argument, and NULL in the second. For the latter, AT_HWCAP is still passed, and the second argument is a pointer to their home-grown __riscv_hwprobe function. Should they want to use the third argument in future, they'll have to introduce yet another prototype to allow for later expansion, and then all users will have to check whether the second argument is NULL to know if the third argument really exists. This is all rather silly and will surely prove fun in the face of type-checking CFI. Instead, be like arm64 and just define all 8 possible general purpose register arguments up front. To naive source code that forgets non-Linux OSes exist this will be compatible with prototype 1 above, since the second argument will be 0 and it won't look further (though should we start using the second argument for something that wouldn't be true any more and it might think it's __riscv_hwprobe, but that incompatibility is one we can defer committing to, and can choose to never adopt). Until the standard interface for querying extension information[1] is settled and implemented in FreeBSD there's not much you can do in a resolver other than use HWCAP_ISA_B, but this gets the infrastructure in place for when that day comes. [1] https://github.com/riscv-non-isa/riscv-c-api-doc/pull/74 Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46278 (cherry picked from commit 729d2b16b74fa5207a12aa1de190bd930432810e) --- libexec/rtld-elf/riscv/reloc.c | 140 ++++++++++++++++++++++++++++------ libexec/rtld-elf/riscv/rtld_machdep.h | 5 +- 2 files changed, 122 insertions(+), 23 deletions(-) diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 2b254803fabf..8dd225e5a920 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -153,10 +153,20 @@ reloc_plt(Obj_Entry *obj, int flags __unused, RtldLockState *lockstate __unused) for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; - assert(ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT); - where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - *where += (Elf_Addr)obj->relocbase; + + switch (ELF_R_TYPE(rela->r_info)) { + case R_RISCV_JUMP_SLOT: + *where += (Elf_Addr)obj->relocbase; + break; + case R_RISCV_IRELATIVE: + obj->irelative = true; + break; + default: + _rtld_error("Unknown relocation type %u in PLT", + (unsigned int)ELF_R_TYPE(rela->r_info)); + return (-1); + } } return (0); @@ -188,6 +198,11 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) return (-1); } + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + obj->gnu_ifunc = true; + continue; + } + *where = (Elf_Addr)(defobj->relocbase + def->st_value); break; default: @@ -200,30 +215,89 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) return (0); } +static void +reloc_iresolve_one(Obj_Entry *obj, const Elf_Rela *rela, + RtldLockState *lockstate) +{ + Elf_Addr *where, target, *ptr; + + ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend); + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + lock_release(rtld_bind_lock, lockstate); + target = call_ifunc_resolver(ptr); + wlock_acquire(rtld_bind_lock, lockstate); + *where = target; +} + int -reloc_iresolve(Obj_Entry *obj __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; + + if (!obj->irelative) + return (0); - /* XXX not implemented */ + obj->irelative = false; + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_IRELATIVE) + reloc_iresolve_one(obj, rela, lockstate); + } return (0); } int -reloc_iresolve_nonplt(Obj_Entry *obj __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_iresolve_nonplt(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; - /* XXX not implemented */ + if (!obj->irelative_nonplt) + return (0); + + obj->irelative_nonplt = false; + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); + for (rela = obj->rela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_IRELATIVE) + reloc_iresolve_one(obj, rela, lockstate); + } return (0); } int -reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; + + if (!obj->gnu_ifunc) + return (0); - /* XXX not implemented */ + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT) { + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) + continue; + + lock_release(rtld_bind_lock, lockstate); + target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); + reloc_jmpslot(where, target, defobj, obj, + (const Elf_Rel *)rela); + } + } + obj->gnu_ifunc = false; return (0); } @@ -233,7 +307,8 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Elf_Rel *rel) { - assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT); + assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT || + ELF_R_TYPE(rel->r_info) == R_RISCV_IRELATIVE); if (*where != target && !ld_bind_not) *where = target; @@ -252,13 +327,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, const Elf_Rela *rela; const Elf_Sym *def; SymCache *cache; - Elf_Addr *where; + Elf_Addr *where, symval; unsigned long symnum; - if ((flags & SYMLOOK_IFUNC) != 0) - /* XXX not implemented */ - return (0); - /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). @@ -286,8 +357,27 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (def == NULL) return (-1); - *where = (Elf_Addr)(defobj->relocbase + def->st_value + - rela->r_addend); + /* + * If symbol is IFUNC, only perform relocation + * when caller allowed it by passing + * SYMLOOK_IFUNC flag. Skip the relocations + * otherwise. + */ + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + if ((flags & SYMLOOK_IFUNC) == 0) { + obj->non_plt_gnu_ifunc = true; + continue; + } + symval = (Elf_Addr)rtld_resolve_ifunc(defobj, + def); + } else { + if ((flags & SYMLOOK_IFUNC) != 0) + continue; + symval = (Elf_Addr)(defobj->relocbase + + def->st_value); + } + + *where = symval + rela->r_addend; break; case R_RISCV_TLS_DTPMOD64: def = find_symdef(symnum, obj, &defobj, flags, cache, @@ -366,6 +456,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, case R_RISCV_RELATIVE: *where = (Elf_Addr)(obj->relocbase + rela->r_addend); break; + case R_RISCV_IRELATIVE: + obj->irelative_nonplt = true; + break; default: rtld_printf("%s: Unhandled relocation %lu\n", obj->path, ELF_R_TYPE(rela->r_info)); @@ -376,10 +469,13 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, return (0); } +unsigned long elf_hwcap; + void -ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)]) { - + if (aux_info[AT_HWCAP] != NULL) + elf_hwcap = aux_info[AT_HWCAP]->a_un.a_val; } void diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index 6080f297be84..136e01deece0 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -77,8 +77,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, __asm __volatile("mv gp, %0" :: "r"(old1)); \ }) +extern unsigned long elf_hwcap; #define call_ifunc_resolver(ptr) \ - (((Elf_Addr (*)(void))ptr)()) + (((Elf_Addr (*)(unsigned long, unsigned long, unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long, \ + unsigned long))ptr)(elf_hwcap, 0, 0, 0, 0, 0, 0, 0)) /* * TLS From nobody Mon Dec 15 18:18:30 2025 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 4dVSx311H1z6L7LL for ; Mon, 15 Dec 2025 18:18:31 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx24nxQz4Ky3 for ; Mon, 15 Dec 2025 18:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822710; 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=u4Wt8mN5cUU72jEcf+aQnQSQJR+jzD3mcvQaQA9ZG4k=; b=wrByGArTCGQ9hhMWuPIcbPmRb0h9+XoWJWoAf9LAOHt1Au4zeyKp3Mq9Q1Ta7+jHjWd5y8 Hxdu1LcpCCER6hHwN7pRK05Uj2C4LRZGVoW3HfPkKVjJ1dhn1sV8CtuRjvRIjzlaCbhqcX 85+xmDIgOm0B/2BpG5nTGH3OfLbHBL4vaJ7HK0HIM/y1umVsA3tZwmFHnkaqDwQqBoF1ze YQ/zieQxOWKseTeeh9fTOTGfmAUaln7tkQOsNABZ1PC8Ig6Oe6h206w2WC5+E8F4j1gB3p +6SpYIhwDBNAbEpBXa1d14+Xecrv85Vfv6tAp6Gih91fNhKBAwH5BgMeZ4bgSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822710; 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=u4Wt8mN5cUU72jEcf+aQnQSQJR+jzD3mcvQaQA9ZG4k=; b=DUn0/qCTaZ/BMHqUG8Vq1XuzINwnvbhlM0fi+141LB5nibfarO5Pm/dnaYOBOo5n0eOgpH GYwrGbCYVnfNZ1h6ttMlsDjQ9t8CBjWL0QY9RnaUUUq1/0EO67tA0WDEcAXomiOJPf7qDk yT6Pvzzx+kpb2ylUoPSEbHQN+AhqrXMd58+jIITsje2e4bSxxUeSO7X/C+Zvw9tIzK8Y4S +dBUIqFlhGvIC65iYzTEczSAY2WgaMnmtNU8TENtv1kFl9tM98hzVaGmnyNs5svwQnBpdE tIhZ8bYXxQIXiQIlOCmNeYjC0j6TLUgCJLR/raTp4Hp7L1eeit+4awKxC6Qimw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822710; a=rsa-sha256; cv=none; b=jictugBFjLv+aUsHcoYthsDGZZbA1PBCNyNOT7dSqoR4da/X1BVet1t3FOoKo0ApGaFtIQ ssm3D7pzmXwhMVQMxQa+m8d02JwPVVcPeH06TcAGFUGHU+lT1UX+OYSz5CXtlkjHAf3cTX aUTModObWj0WRv44HHmCzQ4OZxw/jNOkv2wSCkXfAHjHL7KlRCgK8F9dE+kb1pbNedglkN jZ0stANwx998JJJon7SslA7Gw6hd1sIIWh0pwUrxeMOUj4DIceGco97uoq28AAxDuu6SSN GqJbOJ7folTqP19snwSTn1WapvLbxI9BrpMNYulovV01E9X9r/ncN9wUba7QQQ== 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 4dVSx24KxWzWbG for ; Mon, 15 Dec 2025 18:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25c78 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: aaf455cfdc5f - stable/13 - riscv: Recognise B extension for AT_HWCAP 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aaf455cfdc5f24f827fd381664a535846791f5db Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:30 +0000 Message-Id: <694050f6.25c78.6f8df534@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf455cfdc5f24f827fd381664a535846791f5db commit aaf455cfdc5f24f827fd381664a535846791f5db Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 riscv: Recognise B extension for AT_HWCAP This was ratified earlier this year as an alias for Zba_Zbb_Zbs. Whilst we don't currently export multi-letter extensions, we can still export this alias in AT_HWCAP. Reviewed by: mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46277 (cherry picked from commit 228a3e73e16983bc7f985b24ef20909500792d3c) --- sys/riscv/include/elf.h | 1 + sys/riscv/riscv/identcpu.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/riscv/include/elf.h b/sys/riscv/include/elf.h index ff0f36d2efe6..a14d6859902b 100644 --- a/sys/riscv/include/elf.h +++ b/sys/riscv/include/elf.h @@ -82,5 +82,6 @@ __ElfType(Auxinfo); #define HWCAP_ISA_C HWCAP_ISA_BIT('c') #define HWCAP_ISA_G \ (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) +#define HWCAP_ISA_B HWCAP_ISA_BIT('b') #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 88b0b08c9f2c..6f2949909e83 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -245,6 +245,7 @@ parse_riscv_isa(struct cpu_desc *desc, char *isa, int len) while (i < len) { switch(isa[i]) { case 'a': + case 'b': case 'c': #ifdef FPE case 'd': From nobody Mon Dec 15 18:18:32 2025 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 4dVSx51KHBz6L7P3 for ; Mon, 15 Dec 2025 18:18: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx46M6tz4KyW for ; Mon, 15 Dec 2025 18:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822712; 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=flwG4BZ+MplnnF6/urfz48w6Th4JEcnZZB3vc8BJ9rE=; b=IqYZEXb7BVx10++koIZ6nBRS/AigsXNvZVhvbnma4qHRcusKmKoJk97tIB/u3jlxtRYVZ4 Xg04a08lqW2bZwOly1wcUP0hYYOp58JKJvXjeL7yZKixVP7RpsJj9OZiXlF8iWRtXB+LGy ClCoD19UV0NIGUABIPsV7pV7ZeLAHH+LT2/N6fWIFmvCK8qAzHaPTrfVxHIOrFiOyZHYnc +PpwvcTiyV13fPhdvR16SR8206Cxu/BoUxR67YIP6yrJZeZGzzdRrEmGg1kInHpkpbUL13 4eyXKzIy3qk+cfeQBsKRayMAt2C6tNBdOMKXtkuo57wUXHjGp63VR48abPQDBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822712; 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=flwG4BZ+MplnnF6/urfz48w6Th4JEcnZZB3vc8BJ9rE=; b=FG963n3Dkbqzu5YK/RODRida5DyYXvBCmgFH/X06ZBxkJGpOVYvtBuWn+LgzRfRYiTq/f0 Kjv8kNgwzoQbrV179MR60EKLEfM4nyawNk3hVRFE0HtSnmvx/n328OMa3jVqgCLKJnir8t gWTRNZl3vJWRQqyEfIurPsdATe8/43OiKVyDFnf3o+JCJO3pUJT9TelaTSVt0ZWEEXwrwi yjhwpw3Rmn0cu9Xk+bhjdB/i6KS6jrXL0mue5bZzad6y6hptimjQKcorXKkOPrcMdEnEty 1SdIoI7PajeHPtnsuGQI9777l7oWpGIKYXz9psJ1PnptX14aRjpgMvbrV6+K3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822712; a=rsa-sha256; cv=none; b=a4Jr/gWbfzkZoFxDre1hu4RcIkLlbpF6cSrR9o1I6Gw+UKytewsP2kVpC9wHBNb78jLKUZ IY2KaLVr0zAoq1afWXFSRYLjf+m2pfKrVdOx1tKEdW80fBsr6ioRC53UAzPv3jjChnhFcz C2hIZvnHueTKbXnmGKjEHEs6eiR/no07mTOXwlY4SdbqcD8FQKCnSGweLmHmPVl0gdBZwz KQcOTAMMn/P713q74r9cfn6xoQR19sJDlQgUsTc9iNGb7/Fx5Pbl8qPHEsSSHUl5yHkHu5 pH07glX65wpcNQxBnXEBe4/D6BmJQKjAwpj62XnutDq+kmYK+0RAFjTxtIRFsQ== 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 4dVSx45vk8zWdn for ; Mon, 15 Dec 2025 18:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25532 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 09e84ec73eef - stable/13 - riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 09e84ec73eef29838aa5aa44c3a716a88490a621 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:32 +0000 Message-Id: <694050f8.25532.45e747bb@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=09e84ec73eef29838aa5aa44c3a716a88490a621 commit 09e84ec73eef29838aa5aa44c3a716a88490a621 Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:45 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46279 (cherry picked from commit 8afae0caf4c4816eb56b732fcd1a4b185e86098a) --- sys/riscv/include/ifunc.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/riscv/include/ifunc.h b/sys/riscv/include/ifunc.h new file mode 100644 index 000000000000..0f9747a2aa14 --- /dev/null +++ b/sys/riscv/include/ifunc.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015-2018 The FreeBSD Foundation + * Copyright (c) 2024 Jessica Clarke + * + * Part of this software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __RISCV_IFUNC_H +#define __RISCV_IFUNC_H + +#define DEFINE_IFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(void))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + static ret_type (*name##_resolver(void))args + +#define DEFINE_UIFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(unsigned long, unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long, \ + unsigned long, unsigned long))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + static ret_type (*name##_resolver(unsigned long elf_hwcap __unused, \ + unsigned long _arg2 __unused, unsigned long _arg3 __unused, \ + unsigned long _arg4 __unused, unsigned long _arg5 __unused, \ + unsigned long _arg6 __unused, unsigned long _arg7 __unused, \ + unsigned long _arg8 __unused))args + +#endif From nobody Mon Dec 15 18:18:33 2025 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 4dVSx648V6z6L6w7 for ; Mon, 15 Dec 2025 18:18:34 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx5702Lz4LBD for ; Mon, 15 Dec 2025 18:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822714; 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=1lQ4y+86BZxk8spjWML0Lbik2/cDpBEECK9DJZv5M4A=; b=pZPF9i/B4N/KKri6Ajvn9yFQWm3iHgWoA/xaXxuPOBuK7FALXO/fL+0Nj7xox4HjRsEYvM GR7hBVi9Dt3Ea1miHRNHH42klP8imBz8U2y9wdYcWQ0u4QPL3Qe/WsosyK20koWq6yRPXl GJjDAQlsBm+GlKEw1CfDkIwFzx+zDc7Hx5dTHzkxza2IPYJcZ5C5te3TSibnm4jrJdRKIy 2hvUXylEEwiTRntcIiYSNzhzQRdsFAImV4dl0TiSxWAI0S4FTRMFhdjCxV1+/w3bLIHmsw BOnKYvYE/4YYTV4fuzL6m/K+vuuPYw2tkInvUnUnFSpeoqWyCRq6orkPeykP+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822714; 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=1lQ4y+86BZxk8spjWML0Lbik2/cDpBEECK9DJZv5M4A=; b=k68DAux/hfhsZ2jqO+sBx/4nfPkkQo0a5AswIPA6yGDR5TAEmXhrWW9kBFMzDUUBJaYyVb iHG/59ZgipzKk407OtsSrJWwuH8e0UFWL7VFRDLOAritE/cwH1+Z/3hSIhP29WrazacQpm hdC4A7fHAwUJ8Nw5lpTtlg57Xzlabsxlz6iS9vwd/RFPz3Fjlw/CCZ7Pk/ztI3zSC15FQv yR7MCy1EZlNDJwsJqzTbX2eKA931Bb3/jDpjM9DU94KJjrbebtHWXD3w+8z8B0hQsokGQz 7QKLxih394zMsuogB5J/63DLFXy17lQjV3vH4CoaP4+TwcYPPDvFxYCsKW5Jfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822714; a=rsa-sha256; cv=none; b=WVxwy3WTwcxLrMTm5Q+95ELatQUnJTXDvDU3i/fKRYS6OCTmEmw5LKylP3U8RqK26DvmgI kKi+JEf3mkn9fNb6852rxxX+Ln7cGHX7TWAiMUoj5zQfDHz5NvyCN7IbJmewZrNvpMfOWV ttRTQaxRHHtLYX9GI+mBQgRppzMVc7nBSn/AT27Pd/N8Q81zWn1rMLA+T2IJfG3BKFTcfJ kQF0JRQuP1eLH4vlo7HHrYCfG2k2CORyeUDfKFVVr1ywteA8lxzjcDrgV9p7NZTSFo5BUA Hsr9/Lej4dSmTElqFH6bhSV9lYrRJTpjLdINz1BMugKSHHDiFfDA7onrzrrgWw== 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 4dVSx56X5YzWbH for ; Mon, 15 Dec 2025 18:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2385f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 19b23effacaf - stable/13 - gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19b23effacafe1313cce83a1f03151e905b6c9b8 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:33 +0000 Message-Id: <694050f9.2385f.4bf7c955@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=19b23effacafe1313cce83a1f03151e905b6c9b8 commit 19b23effacafe1313cce83a1f03151e905b6c9b8 Author: Jessica Clarke AuthorDate: 2024-09-02 22:21:18 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID This is a platform-independent UUID, and this is the name U-Boot uses. MFC after: 1 week (cherry picked from commit b162fc3f3094c50c8ed47ab50981c5448cf0052c) --- lib/geom/part/gpart.8 | 7 ++++++- sys/geom/part/g_part.c | 1 + sys/geom/part/g_part.h | 1 + sys/geom/part/g_part_gpt.c | 2 ++ sys/sys/disk/gpt.h | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8 index fa0b247c6174..121e6d6a5119 100644 --- a/lib/geom/part/gpart.8 +++ b/lib/geom/part/gpart.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 26, 2023 +.Dd September 2, 2024 .Dt GPART 8 .Os .Sh NAME @@ -1008,6 +1008,11 @@ A illumos/Solaris partition dedicated to reserved space. The scheme-specific type is .Qq Li "!6a945a3b-1dd2-11b2-99a6-080020736631" for GPT. +.It Cm u-boot-env +A raw partition dedicated to U-Boot for storing its environment. +The scheme-specific type is +.Qq Li "!3de21764-95bd-54bd-a5c3-4abe786f38a8" +for GPT. .It Cm vmware-vmfs A partition that contains a VMware File System (VMFS). The scheme-specific types are diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index c0baf5cc8992..5ff74685a1db 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -131,6 +131,7 @@ struct g_part_alias_list { { "solaris-home", G_PART_ALIAS_SOLARIS_HOME }, { "solaris-altsec", G_PART_ALIAS_SOLARIS_ALTSEC }, { "solaris-reserved", G_PART_ALIAS_SOLARIS_RESERVED }, + { "u-boot-env", G_PART_ALIAS_U_BOOT_ENV }, { "vmware-reserved", G_PART_ALIAS_VMRESERVED }, { "vmware-vmfs", G_PART_ALIAS_VMFS }, { "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG }, diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h index ffeeca9022fe..13bbb1e4126a 100644 --- a/sys/geom/part/g_part.h +++ b/sys/geom/part/g_part.h @@ -103,6 +103,7 @@ enum g_part_alias { G_PART_ALIAS_SOLARIS_HOME, /* A Solaris /home partition entry. */ G_PART_ALIAS_SOLARIS_ALTSEC, /* A Solaris alternate sector partition entry. */ G_PART_ALIAS_SOLARIS_RESERVED, /* A Solaris reserved partition entry. */ + G_PART_ALIAS_U_BOOT_ENV, /* A U-Boot environment partition entry. */ G_PART_ALIAS_VMFS, /* A VMware VMFS partition entry */ G_PART_ALIAS_VMKDIAG, /* A VMware vmkDiagnostic partition entry */ G_PART_ALIAS_VMRESERVED, /* A VMware reserved partition entry */ diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index 07bf36772466..e3471cce9f61 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -223,6 +223,7 @@ static struct uuid gpt_uuid_solaris_var = GPT_ENT_TYPE_SOLARIS_VAR; static struct uuid gpt_uuid_solaris_home = GPT_ENT_TYPE_SOLARIS_HOME; static struct uuid gpt_uuid_solaris_altsec = GPT_ENT_TYPE_SOLARIS_ALTSEC; static struct uuid gpt_uuid_solaris_reserved = GPT_ENT_TYPE_SOLARIS_RESERVED; +static struct uuid gpt_uuid_u_boot_env = GPT_ENT_TYPE_U_BOOT_ENV; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; static struct uuid gpt_uuid_vmfs = GPT_ENT_TYPE_VMFS; static struct uuid gpt_uuid_vmkdiag = GPT_ENT_TYPE_VMKDIAG; @@ -295,6 +296,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_solaris_home, G_PART_ALIAS_SOLARIS_HOME, 0 }, { &gpt_uuid_solaris_altsec, G_PART_ALIAS_SOLARIS_ALTSEC, 0 }, { &gpt_uuid_solaris_reserved, G_PART_ALIAS_SOLARIS_RESERVED, 0 }, + { &gpt_uuid_u_boot_env, G_PART_ALIAS_U_BOOT_ENV, 0 }, { &gpt_uuid_vmfs, G_PART_ALIAS_VMFS, 0 }, { &gpt_uuid_vmkdiag, G_PART_ALIAS_VMKDIAG, 0 }, { &gpt_uuid_vmreserved, G_PART_ALIAS_VMRESERVED, 0 }, diff --git a/sys/sys/disk/gpt.h b/sys/sys/disk/gpt.h index e48b13684814..f15596f766d9 100644 --- a/sys/sys/disk/gpt.h +++ b/sys/sys/disk/gpt.h @@ -252,6 +252,9 @@ CTASSERT(sizeof(struct gpt_ent) == 128); #define GPT_ENT_TYPE_HIFIVE_BBL \ {0x2e54b353,0x1271,0x4842,0x80,0x6f,{0xe4,0x36,0xd6,0xaf,0x69,0x85}} +#define GPT_ENT_TYPE_U_BOOT_ENV \ + {0x3de21764,0x95bd,0x54bd,0xa5,0xc3,{0x4a,0xbe,0x78,0x6f,0x38,0xa8}} + /* * Boot partition used by GRUB 2. */ From nobody Mon Dec 15 18:18:36 2025 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 4dVSx85Lplz6L7G2 for ; Mon, 15 Dec 2025 18:18:36 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx8197Vz4LKn for ; Mon, 15 Dec 2025 18:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822716; 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=t8QmxsdthtX0MOuJsNwSoPe3/oWjJqPdMfC5qr6yGHo=; b=xiHL17ZeVnbr5FpOUxCpGqMXDMivBaV8VyjueNXVTwj3NwTKV20pHWC9nf1EwH5535Td1/ 3kOFN6HSMrsIaeUacH7Z+vYjltIqJUpMFUE/fdaWBT7z1XmoBoI4GGXUIr3dAxlpZMaFS3 cHBv2CXR+mWHJti7tEDUHQ1yqKKVnGHM1aSPxbElByuCSZZ8hNq9QUyA5Cp6WnaWqb7zGs RzpPySwIdR6CEXR6d+0wFKI1RvVx7k3q0WlfHwUxnWpmoWpOmOCTqWJ6Ajh28XwaeEpFhb ZEMQTo7iUidc6KDkw60pCuSO8vjTrXfNWVozQDFIfnECBXKn5A72JzQJ6XAeWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822716; 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=t8QmxsdthtX0MOuJsNwSoPe3/oWjJqPdMfC5qr6yGHo=; b=R5CjV5BrQ6UOvQ8ErFzIxAIlHfTKTWDc69btn9MQHWSHKT6gQYB/FSVN7dmyTxjrM4NGNb 1lmr6mioZACoNkA/cwE+tp4cdWvFE3e76jWO4+jUqxBXASU/jAsvrEn9/TZ3sTn9aGOmYB zUvivFIVRBhQdKPUNlpEyNYvDmErVZ1k53pypYJz+SubtFNRDuHWyBqtjKVi1kBjPpX+QG Q4Ce+d+jHAiiGS3oQzYtR1I/IhhX2s+Qzxm8t6KpqkYzTYJW+Eu4alQ1oV+7OhhPzYEVhC oJuzCsK4FyrrkybsbOkDmX6zTcf8Ep+5Gic//5ja4R/1//wnd7v/uX0mft4RjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822716; a=rsa-sha256; cv=none; b=JcZ4GXv/9LFY8GiRrxlKnTKOUybpVznLGrjWZj+g6eBKOT0CmFG9HUMB597L7ofgI+c6J4 z7jeQBpI5UvviMNWJl1Gi2M6Pg6GpopHTn0eZnsM9yUDk7eS9iBI5r4wypoDMnTPWlArjs 2dcD6G5dT4Z6i6vuOe7/lN52CX4U+nfszjnGL7ww24SM3EMXo8gEheXy7OEh/KVDkPeBHh v84To444L7FzbcnqUSEthA9ZxtJHDcSbmOjUG4B3s2+KeHJjD9tjzvEhZ77bP7Yx5TzJX0 v3t9t966bp7zHcWz5fewFCqZTxHKrNqTjyEqfw/ey1MdI44Y729vz0cwQup1Pw== 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 4dVSx80crCzVhM for ; Mon, 15 Dec 2025 18:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25a32 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: db284e1732ef - stable/13 - Merge commit 88433e640ddb from upstream OpenZFS (by Jessica Clarke) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: db284e1732ef9a08438552ac8586c59e0ba42ac0 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:36 +0000 Message-Id: <694050fc.25a32.7015005e@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=db284e1732ef9a08438552ac8586c59e0ba42ac0 commit db284e1732ef9a08438552ac8586c59e0ba42ac0 Author: Jessica Clarke AuthorDate: 2024-09-11 17:01:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 Merge commit 88433e640ddb from upstream OpenZFS (by Jessica Clarke) sys/types32.h: Remove struct timeval32 from libspl's header (#16491) macOS Sequoia's sys/sockio.h, as included by various bootstrap tools whilst building FreeBSD, has started to include net/if.h, which then includes sys/_types/_timeval32.h and provide a conflicting definition for struct timeval32. Since this type is entirely unused within OpenZFS, simply delete the type rather than adding in some kind of OS detection. This fixes building FreeBSD on macOS Sequoia (Beta). Signed-off-by: Jessica Clarke Reviewed-by: Rob Norris Reviewed-by: Alexander Motin Reviewed-by: Tony Hutter MFC after: 1 week (cherry picked from commit 796c6031cde6dfdd92b4d178792fc0534bf788c5) --- sys/contrib/openzfs/lib/libspl/include/sys/types32.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/types32.h b/sys/contrib/openzfs/lib/libspl/include/sys/types32.h index bb41aa34bee0..0826170bdae5 100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/types32.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/types32.h @@ -65,11 +65,6 @@ typedef int32_t ssize32_t; typedef int32_t time32_t; typedef int32_t clock32_t; -struct timeval32 { - time32_t tv_sec; /* seconds */ - int32_t tv_usec; /* and microseconds */ -}; - typedef struct timespec32 { time32_t tv_sec; /* seconds */ int32_t tv_nsec; /* and nanoseconds */ From nobody Mon Dec 15 18:18:34 2025 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 4dVSx80wsRz6L7RS for ; Mon, 15 Dec 2025 18:18:36 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx70HvWz4L5w for ; Mon, 15 Dec 2025 18:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822715; 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=ftlCmol/aAk8bMx2xHIZ1zf6ELE/SDH6I1qLHYJsJQc=; b=orRzTi34C3M9bpF8pHOkIUDL67a3QcTxpLMl/CVKS2DIYZG7aqFVceQJv15hhWH3EJs/7k 1rvmZFdhyKXHwW7+cmhOTkoxIRFYOS6IClEtppQ4Fp+ACSIShsh3NJZQ+DIt+psrd9D2Mo mOMp0bkc1u7ziNNQaHiPLVFp77H2z3482nc+0y3mjGtD/GRR0RiK906TWxznbL88daOHKz domdFDpGngz30PUxIYAHnPeSoeo/OQeAblK+X27R++nyRsfqD/itALr3r2fdKMW+oGGFBW aLh0o/yHMj2b29rl1xGIxV/lt/jUhtlOe4YrxP6nOie0fGEZIN8ADNyaRxXLmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822715; 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=ftlCmol/aAk8bMx2xHIZ1zf6ELE/SDH6I1qLHYJsJQc=; b=VAcQrFZC9iXHpqdJUISyD/0Zv1gMrhcKVD0XU/hhwIMiP7fpGg57nKfPFB/Jxc16jeG25y 0vbAQDgEZSpHx8bbXL8TUfscRn58NZcC6rS8g2qFC55OkOyjMypnlp/vplHqNvuriS72rr V2Ja7IvAXVw4Z9aqcXdhnc25DpIu4n/61id6ZU9ZoZmXKx+uRohGDVIAejZkA2fV0cm815 ZDKKXSX26kdBFBvvyHjBE2VT+dOEJnRLsShh1ATK+Vn6GDwGwm8kDZyqmMeMsTLFdreKRx 39UprrlHQZ3k2mquKMUDzlQLV67TTEzAnpzNOVjnHBvyt9K6IPRUNy8YSQ5R/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822715; a=rsa-sha256; cv=none; b=RIv6yZ97D6wyPVNyIMppHsaSo6xZOtYvgK8Tt4NfO4qm6f04LohYByUQs8kQ49mDipWZaR oiHJjbl+V9yNlc1iBAWuqgLRMh9Ef/JFI+bi7yoi1o0M5VB83f4xaYEUxBNbZTkeVDSZM3 hArUzLx5GIP3hhC3f3+0ilg9cIsHf+joVAKwCrrJx9TEKoad/CWSppXwDLwwNcLSjWNI67 88jtc4qncUomdDpdjtwEU8D84nUUEHa5LG+4LC5ph/ClX/CRoIC+Z8jHpTrTnoymX2gT8U psiPnzNxVzF1DIEg+AahSyDQHw7aJJfBo6K3RaR4751H4CY7iHsiL0no6cBigQ== 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 4dVSx66yhyzWn6 for ; Mon, 15 Dec 2025 18:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25b6d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 9c9f4654e4db - stable/13 - kldxref: Don't warn and skip file if no relocations are found 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c9f4654e4dbfda9921055f32e2e225f1bf1743e Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:34 +0000 Message-Id: <694050fa.25b6d.35e721d@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9c9f4654e4dbfda9921055f32e2e225f1bf1743e commit 9c9f4654e4dbfda9921055f32e2e225f1bf1743e Author: Jessica Clarke AuthorDate: 2024-09-10 17:56:22 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 kldxref: Don't warn and skip file if no relocations are found This case is hit for the kernel itself on riscv64, and did not used to be checked. Since the code here can already handle missing Elf_Rel and/or Elf_Rela just delete the check. Reviewed by: jhb, imp Fixes: 0299afdff145 ("kldxref: Make use of libelf to be a portable cross tool") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46517 (cherry picked from commit 05996f453de2f2c7a03437a492d9d53831fccb2e) --- usr.sbin/kldxref/ef.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index 77ddada946f2..975626e46046 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -364,11 +364,6 @@ ef_parse_dynamic(elf_file_t ef, const GElf_Phdr *phdyn) error = EFTYPE; goto out; } - if (rel_off == 0 && rela_off == 0) { - warnx("%s: no ELF relocation table found\n", ef->ef_name); - error = EFTYPE; - goto out; - } nsym = 0; for (i = 0; i < nshdr; i++) { From nobody Mon Dec 15 18:18:38 2025 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 4dVSxC0GCZz6L7G5 for ; Mon, 15 Dec 2025 18:18:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxB35Nkz4LHq for ; Mon, 15 Dec 2025 18:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822718; 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=YftjrCNzQUAGMBxAtySp51lpSN1YLUCjXc5EDCkTVn4=; b=E2alVjZRQalBEfVKIa4kE/QiypyaFUReekB42C+LrGaXpKcuNDQeQ1C3RRMjd8/+X6tiAs b06QEsr0gG95Jad5BqlTuc24DtuH8ViXPvXEcpVCy7JxgRiQwTHxYQfeCIJ/Ers3j8D4au Iyi/IjcIhNXmxnCK5k6y7B6IvVlA+n72KChLC4OHVyp2lZCjGHIgffrqI0bUi3Cw7gNHib hGp/vX8YHF7FgJ7LET0omoX06ot9tjKBn3CUEtxe3nNSfOtOAU1ToyY2lv3vIhyAfKAoyb ZhaLdPoh2SB1pZ5wPq0dMzRHSzrPxxD6aVd0YXFckPgw423iIEGvBcNpBbWJDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822718; 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=YftjrCNzQUAGMBxAtySp51lpSN1YLUCjXc5EDCkTVn4=; b=ddPxdGE0VbBEPijnA9P8gt4gPEmEH/PTVLAows77eImvRl9AZQZS6wPCMzy3iOdXzm7HAi VCLLsgj71lcPHTx3mfGRYnrRFvq5AxbAm0X9gCtflQsgzOuOK8aqtW6LFkWqGtFobvikXg wjr9Aii9pH6sIfHJoVseIVAQvs1E5/pFTjxOxC/DtGeh2foiJg+oVaIl4zsAtaJjzTWqR5 wmdJPm5Fq4EYXfpT1l9BSA4YufkFzRVxeLbxj4mjE2ZowO4Fz6Un8Khy9PCB/Bmz8S45rS 0YNzpVXA8GS+/FcckVpmvLHNp6rgErYSSIgdiLoPAwrX1YxjNbPf0joLiviJOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822718; a=rsa-sha256; cv=none; b=SHPsCqYfqAHB34ya4yPT+DRFk36GZWzemSCUgb0KeTZnkopA5bG9gUiSoLhN3GJjajaVKW 2+bB/cwGcgQX32cjazCctKcLcookmCWkgkpz75fM0NVYnvP+ehAbz431p7dTXtIpeLzCQ1 LLI7MWIdao/PAJ7qAFAFYI2Uc0agDqH9VMLcfxsMI4ERYDNsF0IKH/Y3wdVLr2rihKis3R yIelr6WQNz10FXkTIbFtQK4P8w2RytmWysaPwfHCYfVJld+MkLx+1zS1ZQjf5XXe/M3987 hPYr7HmrC9f9gY7T+vvLsxlSIrbH4N9I0W5w2ROKtjqz9h3+PFCoivrD7qm0dg== 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 4dVSxB2BstzWn8 for ; Mon, 15 Dec 2025 18:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25c7c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 3abb712c2308 - stable/13 - libc/csu: Support IFUNCs on riscv 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3abb712c23087cec2b64fcd78d5e3c8ff4cdae63 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:38 +0000 Message-Id: <694050fe.25c7c.2af093e1@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3abb712c23087cec2b64fcd78d5e3c8ff4cdae63 commit 3abb712c23087cec2b64fcd78d5e3c8ff4cdae63 Author: Jessica Clarke AuthorDate: 2024-10-18 18:14:58 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 libc/csu: Support IFUNCs on riscv When adding support to rtld-elf I neglected the fact that static binaries can have IFUNCs. Add support for this too. Fixes: 729d2b16b74f ("rtld-elf: Support IFUNCs on riscv") MFC after: 1 week (cherry picked from commit 1363acbf25de4c36e183cfa0b0e801d4dd9bf2ad) --- lib/libc/csu/riscv/Makefile.inc | 4 +-- lib/libc/csu/riscv/reloc.c | 63 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/lib/libc/csu/riscv/Makefile.inc b/lib/libc/csu/riscv/Makefile.inc index 2534e6579f38..5d59d40eb393 100644 --- a/lib/libc/csu/riscv/Makefile.inc +++ b/lib/libc/csu/riscv/Makefile.inc @@ -1,4 +1,4 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_RELA \ + -DINIT_IRELOCS="init_cpu_features(env)" diff --git a/lib/libc/csu/riscv/reloc.c b/lib/libc/csu/riscv/reloc.c new file mode 100644 index 000000000000..036ea3de8701 --- /dev/null +++ b/lib/libc/csu/riscv/reloc.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2019 Leandro Lupori + * Copyright (c) 2024 Jessica Clarke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +static unsigned long elf_hwcap; + +static void +init_cpu_features(char **env) +{ + const Elf_Auxinfo *aux; + + /* Find the auxiliary vector on the stack. */ + while (*env++ != 0) /* Skip over environment, and NULL terminator */ + ; + aux = (const Elf_Auxinfo *)env; + + /* Digest the auxiliary vector. */ + for (; aux->a_type != AT_NULL; aux++) { + switch (aux->a_type) { + case AT_HWCAP: + elf_hwcap = (uint32_t)aux->a_un.a_val; + break; + } + } +} + +static void +crt1_handle_rela(const Elf_Rela *r) +{ + typedef Elf_Addr (*ifunc_resolver_t)( + unsigned long, unsigned long, unsigned long, unsigned long, + unsigned long, unsigned long, unsigned long, unsigned long); + Elf_Addr *ptr, *where, target; + + switch (ELF_R_TYPE(r->r_info)) { + case R_RISCV_IRELATIVE: + ptr = (Elf_Addr *)r->r_addend; + where = (Elf_Addr *)r->r_offset; + target = ((ifunc_resolver_t)ptr)(elf_hwcap, + 0, 0, 0, 0, 0, 0, 0); + *where = target; + break; + } +} From nobody Mon Dec 15 18:18:37 2025 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 4dVSx94YrMz6L7RX for ; Mon, 15 Dec 2025 18:18:37 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSx91pTFz4LKx for ; Mon, 15 Dec 2025 18:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822717; 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=5gwgEU9u6O04cBjqtFTawlB8LXB68Nv2i0R+OBqYeCs=; b=RrblmreqqjS6sKeA0lXLdHF9TOEZPo2iQm/4TpD9i8YNTW2pJcz4hz/MDVPWxenj1LgTzb k6nIFE4amCtsftg5jf53riJ1x7ammE2d+Lr269fGt2bGV+SV1PnOPiwbOt00YY0kuAF3kf sPc7MPUibSjG8yDMwZlp56nqk8m2XkL828zwkFeuZ82Qmw9vOJb72oVbxSgzP8kg6pw59c H9qCWjU+4ZE/WYMJ2VxuhXp3i8yKJnMTwEMVR/KxYOsJiovrRnf8Ugiv8En6xHqGJPdSE/ d5lJCnKVlLvRMAUVKtYcvG+rc25TMnUuMCA64D+6lV8LIuYAE0Pn7x14pJLaNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822717; 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=5gwgEU9u6O04cBjqtFTawlB8LXB68Nv2i0R+OBqYeCs=; b=NDI++ua9xeDHB5mZU4lVUGp2Zhv675lx6ksY0/SkKARIASOcb4DSzc46+SNVcP3+RQeRcE cmLK+bDS/Qg2aFq3m1qEJtL9VYxvyX56e5nLeA7CD2HhRCRJGcdstDDb3ewiZB/3AF1cEj zhPUwUOJI+yJn7QsXkIXHyPu7b47pWC0t1Er9fjt+osVY7YXPwAAop4w6+7g0/4wVz7bBz qgP03gOtc1fP2Isb4vQg4KBAkXG/zQbXh79msWq9YDIE4ZorbF/XcRby0XX4e1fsIzpHkc RLNsYuuWfIcxtHVNuSFMgM6uexr/i2TcwJDV4l/AJtsQ6Pcn9+R00N16veF2rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822717; a=rsa-sha256; cv=none; b=cc4FTJvhzF8AAML8e1lod8GFBheKq6daQ+p7M1GF8RWpbaiU+kVRDy1n+dd+RVq4M2J6lz gCNp3bxl4RnLKZ9vfEQ6QVmR0MJhu+ty1dnevTlyGhm80xtBOg9nEITIiDVl4sXlHx1jKy 8gO+pZQHESNGFZ48ovj+7qV6KmjNUwljv69QgKw8rXk2ZWVnpOaH4S4tmac/E5Mo6kDcFu wmxpAwJV0ZjndQ8VVwcSJ5WLS3thO2kHJ6WRzEGPOuS9Ei8iocyNKkE7wLuaVHyc6Ti5E2 MDQ5d4Zhg9ok0HwovZ3p9wCqMROJLBWmT1+E+BiMuDdk9tF1FK9ckLykn56a3w== 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 4dVSx91PxBzVhN for ; Mon, 15 Dec 2025 18:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 232fe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: fc195afbb4cb - stable/13 - lib/clang: Commit cleaned-up workaround for building on RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc195afbb4cbbd0f5624717ae66787c64ef1f9a4 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:37 +0000 Message-Id: <694050fd.232fe.7bab4385@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=fc195afbb4cbbd0f5624717ae66787c64ef1f9a4 commit fc195afbb4cbbd0f5624717ae66787c64ef1f9a4 Author: Jessica Clarke AuthorDate: 2024-10-18 12:59:48 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 lib/clang: Commit cleaned-up workaround for building on RISC-V There is a long-standing issue on RISC-V around --gc-sections when statically linking, which affects the bootstrap build of LLVM. Since fixing this properly has remained a TODO for years, commit the workaround with documentation so that building natively from source works out of the box. PR: 258358 MFC after: 1 week (cherry picked from commit 7aa6667623bef7306009d50a571e5e8c7766a174) --- lib/clang/llvm.build.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk index 45a779584e74..2d8d9a2b0fcb 100644 --- a/lib/clang/llvm.build.mk +++ b/lib/clang/llvm.build.mk @@ -111,6 +111,14 @@ CFLAGS+= -fdata-sections LDFLAGS+= -Wl,-dead_strip .else LDFLAGS+= -Wl,--gc-sections +# XXX: --gc-sections strips the ELF brand note and on RISC-V the OS/ABI ends up +# as NONE, so for statically-linked binaries, i.e. lacking an interpreter, +# get_brandinfo finds nothing and (f)execve fails with ENOEXEC. Work around +# this by manually setting the OS/ABI field via the emulation. +.if ${MACHINE_ARCH:Mriscv64*} != "" && ${NO_SHARED:Uno:tl} != "no" && \ + (${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)) +LDFLAGS+= -Wl,-m,elf64lriscv_fbsd +.endif .endif CXXSTD?= c++17 From nobody Mon Dec 15 18:18:39 2025 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 4dVSxC5RwSz6L7Rc for ; Mon, 15 Dec 2025 18:18:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxC3cTMz4LNd for ; Mon, 15 Dec 2025 18:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822719; 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=VaaYB2tToA5tAbFPWxNBLaRDnr7mocy/oxMxRExhmBg=; b=AROs5i/P4Uw0LzZf2SxXNo7JXR92zXr0fy9ejKJSiPO3qyx2I6l5Z27PmR5iSlDbZoI8bG wDop4yJlVO+UdLt6ZiSMIHzM5Uc9v7mKuWN5r0xD9AetV050O4oUEybKkyvSsSiEKBzuux mv/rP/oGj2xE8LubyueKQ8iGUMaoVQrGUAaeyR6NK5+pm3kEoRXcfnv3H4q7aaSavesLAU lJsD1F8z/UYrYhwhGG+uoP6lbRcfrOUVniR4bQDqXkPjcD8TUrT/9x6ELO/HpokHkGx8gu 8mGFDbcS9P2MheovSa/eFOsJ7/oFVbVNW6yVdmJ2TKJS9BKMPdYitiixqhUGoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822719; 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=VaaYB2tToA5tAbFPWxNBLaRDnr7mocy/oxMxRExhmBg=; b=P7A2K0Qm4XrYQht22f6msw4db4wcjHuSBbNdnbhGTyjfnbV6PRtDl7VoZZDhDV9OzyKMbP VT1fLLjX/H5iTvnPnnFvxMLu2Tr50IGWtip01gISY060nAZJXCVfYYM7lm/LGxYC4sfy+q LxgqGpKxmGHDdAlI2CwyqaK2DXoIsMwRtIdJ4q3szJDrlxisEdM7qBUTsrPUon5wisscqK 1m3ZwrIErQniI0a55qy79I308tEXQ4ldNvTFpq/5FrkFKGTiDE3AXG2Jfl/DD5sIkg9Pg2 UTHsIk32AUbqGZEeHh81FkpkMtpoDIpEbtPtOIgpiie8orJwf+TyuSRu288/bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822719; a=rsa-sha256; cv=none; b=R1rrudvb5dhFK1HqIoe+JXjQKDZL+7rd9O6+FhhrqkKYfoGd7IBXDrqAeNz0VvNOJC5VgK RWjKQh4fsuc8lvI0/ayMScwMKjaOnhI1yMz/JocWgCfipKooAJ/i0OKkvANf8AfELCRtaL QVS6tLLWWP+lKtQxh53Ki/mUW4ddGuK32n+nNFzU0p8iReRhwLHhDK/iIFZjh4NaZaujqO lMtuYHHuFeVdSFJKoDdOd/sG/BAY2obNHZbEnJ+faV6lq2k7ihBK5ViKdKA3xFMLclIgLS R2MyrTzFjQOA8aOZCNSQX98aUH/TkDO2nO/+C+4ncRswTaW934/yuFL3iMTG+Q== 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 4dVSxC2mvCzWZR for ; Mon, 15 Dec 2025 18:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23863 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 271d0a3119d5 - stable/13 - depend-cleanup.sh: Clean up after riscv static binary IFUNC addition 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 271d0a3119d5d219ecbc2fa9f7850e7597b5f744 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:39 +0000 Message-Id: <694050ff.23863.625ac1b4@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=271d0a3119d5d219ecbc2fa9f7850e7597b5f744 commit 271d0a3119d5d219ecbc2fa9f7850e7597b5f744 Author: Jessica Clarke AuthorDate: 2024-10-18 18:15:30 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 depend-cleanup.sh: Clean up after riscv static binary IFUNC addition reloc.c is conditionally included by libc_start1.c so existing builds don't feature it in the .depend file and won't know they need to rebuild libc_start1.c. MFC after: 1 week (cherry picked from commit d41a40f484826e90ed78dce5f006712b0eeaf501) --- tools/build/depend-cleanup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 24bbd07f03c4..9ccd799ec2e2 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -162,6 +162,22 @@ if [ -d "$OBJTOP"/usr.sbin/zic/zic ] ; then run rm -rf "$OBJTOP"/usr.sbin/zic/zic fi +# 20241018 1363acbf25de libc/csu: Support IFUNCs on riscv +if [ ${MACHINE} = riscv ]; then + for f in "$OBJTOP"/lib/libc/.depend.libc_start1.*o; do + if [ ! -f "$f" ]; then + continue + fi + if ! grep -q 'lib/libc/csu/riscv/reloc\.c' "$f"; then + echo "Removing stale dependencies and objects for libc_start1.c" + run rm -f \ + "$OBJTOP"/lib/libc/.depend.libc_start1.* \ + "$OBJTOP"/lib/libc/libc_start1.*o + break + fi + done +fi + # 20241018 5deeebd8c6ca Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 p="$OBJTOP"/lib/clang/libclang/clang/Basic f="$p"/arm_mve_builtin_sema.inc From nobody Mon Dec 15 18:18:40 2025 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 4dVSxD6mBvz6L7Jp for ; Mon, 15 Dec 2025 18:18:40 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxD47HYz4LFh for ; Mon, 15 Dec 2025 18:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822720; 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=IbaSgPflMc6mrqbj68l1WKBf3b0O8jwVRg2wbPZ9nNY=; b=SEI+Y0JaNGMct867GwIqOV7nipQzYmh4zinDKdsHCmmzgPcYAKdLf5kSoU+gwyoj7Kv+Jd Qcqc1NmrGUb8LiYWr2mCZU2Jvb2osDP2bqBNgASgAbJKp+9Qu+aUy04oOe8RWpA5NPMfYr h2jBn+KkZgX+scKpwDunwEq9bfdPvSovCA8JQ3hl1Be2DyTK+qJ7I4gYs1VWJGcBm2PPDf LQTmFqOyDhHRj2VoRoSkzIKIhOJ10LRUNLZgHZNar2rSi85u8FbWTbNBNGybJlH4kw5zV/ dxCts7KYhUWSr/+Dw3IuDkgRG5B2e/S9en3gEP0fP350W2oCq9/0YktwRrIt9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822720; 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=IbaSgPflMc6mrqbj68l1WKBf3b0O8jwVRg2wbPZ9nNY=; b=cJGMY2d53RO/LOGAYhF8FdCPNivxBTdj3V2Lu1W6aSezavH6P7lXNux9NPVPTY+adEUz5F LstNMALFez82u1gBBlIbXc8nJBeqT97tKz/z1jwkQ5IuYcYT/OfF4q0ptSXtS++fDW1vGm bMv65Y+ZyMyC2+X9bwnNeYLFopYXW75w/HU70NAgq1ikekXGz0aECUe5ez5l1+a0hkPaCN vqPd5aBRKV8M/y6raTlPWkGE6sfuLB45z7KUmfbkEJvgUL/je/969OQK+xjQKX+XUHlp2C HuKHHyFzeayve06x193wr+B2C7CU3EFdXa+S+KoXJxdoFqxezKNvgwhwH5IGQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822720; a=rsa-sha256; cv=none; b=sFtNRAwTWVlW3ps/bkBHdGfkZT9r8JwI+JtT6EviKF8avUXRiqt8xNc4+XiFDOBEMEFSzW fqOSijccSb7LyoPJnZeVsPOpodMhY0jQydNBXDQxQUHJAyp0UsM1HmH2RtT/aer9C7sLh4 tAM35ljYszRQkPWbIVpctwcqg3YQf8UWgs70iN4+ZQihnGVmPBvCSNFgcGsfqqN/woVaJj 1DiupYU6ZyXYnv5ErLDBoCbHbTVcb2VfyqnEhofTiWoGzJl1rE0z9UIpv0/XpTWzc9rJe3 e8hQn4suNWNefNFbEupufI2M5pgNFYSMckD6T1J+g3SJ6dxgb6tc/4kquc8u1A== 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 4dVSxD3gVyzW0r for ; Mon, 15 Dec 2025 18:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24676 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 1b03e7f80e16 - stable/13 - tools/build/cross-build: Don't include sys/uio.h from linux limits.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1b03e7f80e164a02ebe9a96a3b7fd59f77cda830 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:40 +0000 Message-Id: <69405100.24676.32ee657c@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=1b03e7f80e164a02ebe9a96a3b7fd59f77cda830 commit 1b03e7f80e164a02ebe9a96a3b7fd59f77cda830 Author: Jessica Clarke AuthorDate: 2024-10-18 20:39:37 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 tools/build/cross-build: Don't include sys/uio.h from linux limits.h This creates a circular dependency for OpenZFS's libspl in sys/uio.h, and it shouldn't be needed since the system limits.h already defines IOV_MAX, so delete it, and unconditionally assert that to be the case. Otherwise the re-include of libspl's sys/uio.h tries to use PAGESIZE before it has been defined by OpenZFS's own sys/param.h. Fixes: 7a7741af18d6 ("zfs: merge openzfs/zfs@b10992582") MFC after: 1 week (cherry picked from commit 0bdf2535d4f8a571cb6d230f2f19eb20a452a4f8) --- tools/build/cross-build/include/linux/limits.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/build/cross-build/include/linux/limits.h b/tools/build/cross-build/include/linux/limits.h index 5eca34b1120c..4631cabb1104 100644 --- a/tools/build/cross-build/include/linux/limits.h +++ b/tools/build/cross-build/include/linux/limits.h @@ -45,13 +45,11 @@ #if !defined(_GNU_SOURCE) #warning "Attempting to use limits.h with -std=c89/without _GNU_SOURCE, many macros will be missing" #endif +#endif /* C89 */ -#else /* Not C89 */ -/* Not C89 -> check that all macros that we expect are defined */ #ifndef IOV_MAX #error IOV_MAX should be defined #endif -#endif /* C89 */ #ifndef MAXBSIZE #define MAXBSIZE 65536 /* must be power of 2 */ @@ -83,7 +81,6 @@ #endif #include -#include /* For IOV_MAX */ /* Sanity checks for glibc */ #ifndef _GNU_SOURCE From nobody Mon Dec 15 18:18:41 2025 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 4dVSxG0GwVz6L7Rl for ; Mon, 15 Dec 2025 18:18:42 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxF5M3bz4L72 for ; Mon, 15 Dec 2025 18:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822721; 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=5N5C+0ITa87SFS/4nLMleez5CBpVyTV2yfvIZNwzTAM=; b=FjYxgtt9ZOAlQfYHZuRZ5mdUBnzz9cF1KLGB5sy5EGnzqE8IBi7NgoUR1gDrSpGEbb7pYG TVB5kUpT6k1gsvFIZEbjk4c5177URew/DHCX5F4i+XAQk4OJU3RpMuprJvtT4JIBWjovI1 WDZirJqmc+T/jQsj6lVEZz52KYFLkjs/V2mK7e9KPOUCefJPoyMaYh+PXhDYdIiqQEIm6W YVLzTfi/2C1wMp+08Ha1VzwKEIhjKCXGvH+X0lXGiNAw8TxIQ3HsF2ojKue0ttuIsTJm7y 7z+UPVCnTfdo/MefNoBiQnVByr9BVe8oLMSYre2qvTOjXW6c0ivPEui8jNsqLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822721; 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=5N5C+0ITa87SFS/4nLMleez5CBpVyTV2yfvIZNwzTAM=; b=Iw+L9mF+aspjR94O1y0z+eUcNWoG6fH8zpTqLYpvVDOgg7EJevvvIyfotfQmeZ38yQ/6ee RDgeDK8VHfJBEf0zyhDgraL4m/bAS/wa2CtYudbfSXvRZTxP1emI0pHDyMkvgHWtU3UHy9 LFWR7s/PUf1ALmjsbHeqeL/y6b0rdELYKf1MDPBEuEB6t84+36cYRBPrVlRcyhDAUltBXd o3Lz7eB8o/+bNGDGg+YN13gkRLYEY2sWsfqY/Ie2lKona2kwByHfp8Qn5YvSBY0mhc2hzG yCgVZqIaa9XpqWMy7w4lR9S0iZ4e7j1p9rFPRXvgtH43Uvvx5toRJyX9TgGeww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822721; a=rsa-sha256; cv=none; b=Y4R8RjxHqtjalp7SgmqiHe+1dNxB02wEOeQBnzsDo3Lnn0ghYEiXDGUiXcVsGM6xonD2up MehaKOR+UCGR/u9vCIJlhHRpU52wKVlUiVhBNiQ4+CHhEjnDqFN5RrO8ra5OwG0JbUIzmg PuVmFHY6uKVVgkPiCMsMRM7yOyAKpcB6rlYQCSvagTvUgnL0U0IWNrqJujjBb2kTzf+dLZ aXjl5jFezUmkRJN9XIOjvOzwRsxO2kg3JEgxsK4NfUP9RTuwYaERQH0ZANM652wWiyo/CU iuVxPNxlIfElbiyYmmRK4UrmXEtiD5KkKmWQT3qtkvv6SuSnqJoztYH6e0MewA== 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 4dVSxF4fhWzVhS for ; Mon, 15 Dec 2025 18:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25a36 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 3d292b9ee8cf - stable/13 - libc/csu: Unify INIT_RELOCS across architectures 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d292b9ee8cf4efc35c07f69bb9aae41a3f36ef8 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:41 +0000 Message-Id: <69405101.25a36.142e428e@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3d292b9ee8cf4efc35c07f69bb9aae41a3f36ef8 commit 3d292b9ee8cf4efc35c07f69bb9aae41a3f36ef8 Author: Jessica Clarke AuthorDate: 2024-10-18 23:48:52 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 libc/csu: Unify INIT_RELOCS across architectures Some architectures don't need any arguments, whilst others need auxargs, which they get by passing in env thanks to INIT_RELOCS referencing the local variable in __libc_start1(_gcrt) by name. This is unnecessarily confusing, fragile (one has to look at INIT_IRELOCS's definition to see that it uses env) and duplicates code between architectures. Instead, implement it more like rtld-elf. Each architecture provides an ifunc_init that takes the auxargs directly, and those that don't need it can just ignore it. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47188 (cherry picked from commit 9684658e35ab033c79e0519e3681d9a194976b71) --- lib/libc/csu/aarch64/Makefile.inc | 3 +-- lib/libc/csu/aarch64/reloc.c | 6 ++++++ lib/libc/csu/amd64/Makefile.inc | 3 +-- lib/libc/csu/amd64/reloc.c | 3 ++- lib/libc/csu/arm/Makefile.inc | 3 +-- lib/libc/csu/i386/Makefile.inc | 3 +-- lib/libc/csu/i386/reloc.c | 3 ++- lib/libc/csu/libc_start1.c | 28 ++++++++++++++++++++-------- lib/libc/csu/mips/Makefile.inc | 3 +-- lib/libc/csu/powerpc/Makefile.inc | 3 +-- lib/libc/csu/powerpc64/Makefile.inc | 3 +-- lib/libc/csu/powerpc64/reloc.c | 9 +-------- lib/libc/csu/powerpcspe/Makefile.inc | 3 +-- lib/libc/csu/riscv/Makefile.inc | 3 +-- lib/libc/csu/riscv/reloc.c | 9 +-------- 15 files changed, 41 insertions(+), 44 deletions(-) diff --git a/lib/libc/csu/aarch64/Makefile.inc b/lib/libc/csu/aarch64/Makefile.inc index b3420a638164..6c315c5e2624 100644 --- a/lib/libc/csu/aarch64/Makefile.inc +++ b/lib/libc/csu/aarch64/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/aarch64/reloc.c b/lib/libc/csu/aarch64/reloc.c index 7f5dff497fe2..4ba7920bcb07 100644 --- a/lib/libc/csu/aarch64/reloc.c +++ b/lib/libc/csu/aarch64/reloc.c @@ -25,6 +25,12 @@ */ #include + +static void +ifunc_init(const Elf_Auxinfo *aux __unused) +{ +} + static void crt1_handle_rela(const Elf_Rela *r) { diff --git a/lib/libc/csu/amd64/Makefile.inc b/lib/libc/csu/amd64/Makefile.inc index f14033217580..6c315c5e2624 100644 --- a/lib/libc/csu/amd64/Makefile.inc +++ b/lib/libc/csu/amd64/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="init_cpu_features()" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/amd64/reloc.c b/lib/libc/csu/amd64/reloc.c index 654958819271..f1f83db9a391 100644 --- a/lib/libc/csu/amd64/reloc.c +++ b/lib/libc/csu/amd64/reloc.c @@ -24,6 +24,7 @@ */ #include + #include #include @@ -31,7 +32,7 @@ static uint32_t cpu_feature, cpu_feature2; static uint32_t cpu_stdext_feature, cpu_stdext_feature2; static void -init_cpu_features(void) +ifunc_init(const Elf_Auxinfo *aux __unused) { u_int p[4]; diff --git a/lib/libc/csu/arm/Makefile.inc b/lib/libc/csu/arm/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/arm/Makefile.inc +++ b/lib/libc/csu/arm/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/i386/Makefile.inc b/lib/libc/csu/i386/Makefile.inc index f3f8c2b176ce..32018000e1f2 100644 --- a/lib/libc/csu/i386/Makefile.inc +++ b/lib/libc/csu/i386/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_REL \ - -DINIT_IRELOCS="init_cpu_features()" +CFLAGS+= -DCRT_IRELOC_REL diff --git a/lib/libc/csu/i386/reloc.c b/lib/libc/csu/i386/reloc.c index d617f35dc665..7097f58d8f26 100644 --- a/lib/libc/csu/i386/reloc.c +++ b/lib/libc/csu/i386/reloc.c @@ -24,6 +24,7 @@ */ #include + #include #include @@ -31,7 +32,7 @@ static uint32_t cpu_feature, cpu_feature2; static uint32_t cpu_stdext_feature, cpu_stdext_feature2; static void -init_cpu_features(void) +ifunc_init(const Elf_Auxinfo *aux __unused) { u_int cpuid_supported, p[4]; diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index d6a973bf0fe0..7296893efd57 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -135,6 +135,24 @@ handle_argv(int argc, char *argv[], char **env) } } +static void +handle_irelocs(char *env[]) +{ +#ifndef CRT_IRELOC_SUPPRESS + const Elf_Auxinfo *aux; + + /* Find the auxiliary vector on the stack. */ + while (*env++ != 0) /* Skip over environment, and NULL terminator */ + ; + aux = (const Elf_Auxinfo *)env; + + ifunc_init(aux); + process_irelocs(); +#else + (void)env; +#endif +} + void __libc_start1(int argc, char *argv[], char *env[], void (*cleanup)(void), int (*mainX)(int, char *[], char *[])) @@ -144,10 +162,7 @@ __libc_start1(int argc, char *argv[], char *env[], void (*cleanup)(void), if (&_DYNAMIC != NULL) { atexit(cleanup); } else { -#ifndef CRT_IRELOC_SUPPRESS - INIT_IRELOCS; - process_irelocs(); -#endif + handle_irelocs(env); _init_tls(); } @@ -169,10 +184,7 @@ __libc_start1_gcrt(int argc, char *argv[], char *env[], if (&_DYNAMIC != NULL) { atexit(cleanup); } else { -#ifndef CRT_IRELOC_SUPPRESS - INIT_IRELOCS; - process_irelocs(); -#endif + handle_irelocs(env); _init_tls(); } diff --git a/lib/libc/csu/mips/Makefile.inc b/lib/libc/csu/mips/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/mips/Makefile.inc +++ b/lib/libc/csu/mips/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/powerpc/Makefile.inc b/lib/libc/csu/powerpc/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/powerpc/Makefile.inc +++ b/lib/libc/csu/powerpc/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/powerpc64/Makefile.inc b/lib/libc/csu/powerpc64/Makefile.inc index 5d59d40eb393..6c315c5e2624 100644 --- a/lib/libc/csu/powerpc64/Makefile.inc +++ b/lib/libc/csu/powerpc64/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="init_cpu_features(env)" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/powerpc64/reloc.c b/lib/libc/csu/powerpc64/reloc.c index 6201ba0f1fb5..5caf5ff28e4b 100644 --- a/lib/libc/csu/powerpc64/reloc.c +++ b/lib/libc/csu/powerpc64/reloc.c @@ -25,15 +25,8 @@ static uint32_t cpu_features; static uint32_t cpu_features2; static void -init_cpu_features(char **env) +ifunc_init(const Elf_Auxinfo *aux) { - const Elf_Auxinfo *aux; - - /* Find the auxiliary vector on the stack. */ - while (*env++ != 0) /* Skip over environment, and NULL terminator */ - ; - aux = (const Elf_Auxinfo *)env; - /* Digest the auxiliary vector. */ for (; aux->a_type != AT_NULL; aux++) { switch (aux->a_type) { diff --git a/lib/libc/csu/powerpcspe/Makefile.inc b/lib/libc/csu/powerpcspe/Makefile.inc index 2534e6579f38..ddead75f874d 100644 --- a/lib/libc/csu/powerpcspe/Makefile.inc +++ b/lib/libc/csu/powerpcspe/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_SUPPRESS \ - -DINIT_IRELOCS="" +CFLAGS+= -DCRT_IRELOC_SUPPRESS diff --git a/lib/libc/csu/riscv/Makefile.inc b/lib/libc/csu/riscv/Makefile.inc index 5d59d40eb393..6c315c5e2624 100644 --- a/lib/libc/csu/riscv/Makefile.inc +++ b/lib/libc/csu/riscv/Makefile.inc @@ -1,4 +1,3 @@ # -CFLAGS+= -DCRT_IRELOC_RELA \ - -DINIT_IRELOCS="init_cpu_features(env)" +CFLAGS+= -DCRT_IRELOC_RELA diff --git a/lib/libc/csu/riscv/reloc.c b/lib/libc/csu/riscv/reloc.c index 036ea3de8701..6ae85085089b 100644 --- a/lib/libc/csu/riscv/reloc.c +++ b/lib/libc/csu/riscv/reloc.c @@ -24,15 +24,8 @@ static unsigned long elf_hwcap; static void -init_cpu_features(char **env) +ifunc_init(const Elf_Auxinfo *aux) { - const Elf_Auxinfo *aux; - - /* Find the auxiliary vector on the stack. */ - while (*env++ != 0) /* Skip over environment, and NULL terminator */ - ; - aux = (const Elf_Auxinfo *)env; - /* Digest the auxiliary vector. */ for (; aux->a_type != AT_NULL; aux++) { switch (aux->a_type) { From nobody Mon Dec 15 18:18:43 2025 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 4dVSxJ3846z6L7TV for ; Mon, 15 Dec 2025 18:18:44 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxH6bm2z4L9k for ; Mon, 15 Dec 2025 18:18:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o2KYcx6PDmrx8IHXVkg0JcQjDyk9HDnqXuDHTQ+XA8c=; b=X5WwlEmREwk9fq+Lei325/L3lr6YrMhRa9co/yfGI/amIyVB6SL/UcJjhYf9ufZGd+rrxn x4LZ8OB8E4AXrThS5bq++9bRAdbrUatCTw74DHWGtsEjJi6mYDNege4pE3uWTZVz/Zg8jc R74W9gAgZbJOqwUnD0eNR3C3pUvhYXu3cVz4eIqSwL+ZVIJwDnIFTcDroz5BACYITskk+1 fFFV3NOcx0PeQANLVAjCMvLbH5z93jfy81RXC23vKqreVpMLzYHNtilOM90K8B2bnxvKqd CLkJ+DYLhFtA9tJuV4FWlcINlRqaOM3JC0G39VOOdGt6WF/9JEpWUfR90mEmIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o2KYcx6PDmrx8IHXVkg0JcQjDyk9HDnqXuDHTQ+XA8c=; b=QUgNBokL9ts6+MPn83OvlA3Xkum93DQMlXpRuOND8T6QeeQ0PaDPQDN+IwtsD00fzZP1/m TeDA+8SoO2wVdYdMzHr5Tb1X24EeWIeVbRc7LP9IF4tx2yvThOc9jNujDAAFEAoa0sUEE+ uVEX2phE1p38SB+zJL2wE/zanh7nwhIV3AiTNKqzcU5yok0JNnuXv/9IzHMtwGGyb7SfHw kJDPK8FThMvaA/QOtgvHAFYz+RoquamaBsVswzgYxzc3CFdQ+bzehmc3zrOwQQBBLjK38q uUtxFtIT9ACW31XZt179GhJYnfsv94h8rEWWDu6CwoEXFUj6+ZykMTN9gR90/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822724; a=rsa-sha256; cv=none; b=to4pgFGrqYfS3BoI3ropy1X859RlI3QkH+cqZUNeuTkLiDLhypkmmyYVd8MlWi0DUiiXgJ SP2nW0TQtLHyd6JWmIoiU6RbQZYBtQTm1s3ATZxVaF7PybpM3162VmpIzrnmH+Eykk7WDE 1BaZiyL0A8gmk/fCAGrw65+14Hagvhnsvg9bGQ/cgnk7XYJ084vXsy6sz+D9NIZRamcro/ 2jaM7/4O0my7GN2GYcmYGlIiTTKCP6Xc8mEo+BWOezz/NbBggyEzpFvKlr6HoCrZPbmX73 BB7ii0tkhNbS7bzIQKFGoYxP6l42QcF+YtMoHPnT71x+SJKbbAG8GZZC8e5fEg== 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 4dVSxH69gFzWt4 for ; Mon, 15 Dec 2025 18:18:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25611 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: David Gilbert From: Jessica Clarke Subject: git: 7d8ea3c846f0 - stable/13 - hexdump.3: Add missing LIBRARY section 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7d8ea3c846f03150322720480381566b93134642 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:43 +0000 Message-Id: <69405103.25611.1a81bf0f@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7d8ea3c846f03150322720480381566b93134642 commit 7d8ea3c846f03150322720480381566b93134642 Author: David Gilbert AuthorDate: 2024-11-21 20:23:16 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 hexdump.3: Add missing LIBRARY section All the other libutil section 3 manpages document this, and although it's heavily implied by the libutil.h header in the synopsis, we should still be explicit and consistent. PR: 280078 Reviewed by: jrtc27 MFC after: 1 week (cherry picked from commit 169e23d41f8ff16244f4fb04924fdc9828325dce) --- lib/libutil/hexdump.3 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libutil/hexdump.3 b/lib/libutil/hexdump.3 index 677bf92680a6..e5a18e201bbd 100644 --- a/lib/libutil/hexdump.3 +++ b/lib/libutil/hexdump.3 @@ -32,6 +32,8 @@ .Sh NAME .Nm hexdump .Nd "dump a block of bytes to standard out in hexadecimal form" +.Sh LIBRARY +.Lb libutil .Sh SYNOPSIS .In libutil.h .Ft void From nobody Mon Dec 15 18:18:42 2025 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 4dVSxH3Bmxz6L7Jr for ; Mon, 15 Dec 2025 18:18:43 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxG5zm6z4LG4 for ; Mon, 15 Dec 2025 18:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822722; 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=Tir/OXzuYkjj5oZmSwkLjSquPATdIQr6yeBsMpaMIOY=; b=m0Kxt86b2MqYnqIkA6ue/R8kxOR22TBKjKdSlllorF6IvY7vzK0YLY9l3q2DDGVJfKSCE8 ULofnL8wKuHYcuRaQSNVwSvJtliJvnYEzBkC0Xvh3PtsigbMqQla6P+XszepWnY2kJYGIA bB/IsXJVKIPVhx1tQPevOS1cV4bQ58PUsDYqxrfc7UxeXS8Rvs0YEE98gp3bI/zfQmcCjK 0zTM2gc4zfX4ZbFJxJbLPsFY8yMgtrOPIbX5uaxDIII77yM00tbiwvojLFMHFUPRv20egF 2LBzSJBbrh4LX/ELUtDpMlcpecw+vk9p/i7Vsa1C763TrASGDsL9A2+tUuNryw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822722; 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=Tir/OXzuYkjj5oZmSwkLjSquPATdIQr6yeBsMpaMIOY=; b=dbKkadb/LQqIpJIfrSguchsbe4ubcoT9tRlCZJCz24sfwtvOzBHl/h0SUv3lM4uruwtzGH LtWxzjyplDB3/QeAbWwqnFuHb7ZZULSaaj+wj260MkeK5JJZg3aTkZxBprto6gaizs0ueT UACUtfmssYy4nG8dV6M4BIaUgHlula2AqmInBFVN7lqoT3ltzztcrYxkHye141Qer/Fg1Q Zc0cVs5sGAoEaKa+suioK2cGPUBRmMRE8KcCAH6aFWCRoFi4FOTJboA4ZflVcdshOd6QHL dKUKABjKhe45xF+JkBd2ijbFnc649e9i/3xX703nW3M/yL7rVDttvEb92wkoGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822722; a=rsa-sha256; cv=none; b=tSnOZ+aXpL1MD/T5toZcT50jfnfjTDO5/n++MR+yNNFHUAuyhYjZPYuaF547k3JKvrFVqe 9ZWnjqKtv9k0XavfauQmFjzKMcEFmVi9nEYCL0NT8xNe4pNFvXg6BTLT3BZlPXUSCezJrs GsSYcdSQH+/wtGPDoueHkPEOZYawHg+fI7bppSaGZ3EtLSQ/hhqtNtNFDS+rdQ3ySOgiLo NgUDoZiAwdMnJRlAhzdB0+K+VZEgBzy4uQgW+tTWsZv4y+9UR/3gAKlroa1OQOJ41i3TgI t8tnuKizz2tYRk6dxNqJ/eGjACu38K9qdGlPa25h1fAmvyb8CWFS8SqHP7oFbw== 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 4dVSxG5QQJzWbJ for ; Mon, 15 Dec 2025 18:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26202 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: ae54b3ca7831 - stable/13 - sys/cdefs.h: Add comments to make #if/#else/#endif triple more obvious 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae54b3ca7831ca0bbfe40b9824e1b80163be94e3 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:42 +0000 Message-Id: <69405102.26202.7f20e0ce@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ae54b3ca7831ca0bbfe40b9824e1b80163be94e3 commit ae54b3ca7831ca0bbfe40b9824e1b80163be94e3 Author: Jessica Clarke AuthorDate: 2024-11-20 20:09:28 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:35 +0000 sys/cdefs.h: Add comments to make #if/#else/#endif triple more obvious This block has a lot of nesting, not helped by two adjacent nested blocks involving _POSIX_C_SOURCE, with only the inner one commented, looking like it's the end of the outer one. Comment the outer one as well so it's not quite so hard to figure out. MFC after: 1 week (cherry picked from commit 7a3af393d8ac2dfe72d24fe401344b60c4f87866) --- sys/sys/cdefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index c549bfc3c2f3..fbd3c3144596 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -754,7 +754,7 @@ #undef __ISO_C_VISIBLE #define __ISO_C_VISIBLE 2011 #endif -#else +#else /* _POSIX_C_SOURCE */ /*- * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly @@ -792,7 +792,7 @@ #define __ISO_C_VISIBLE 2011 #define __EXT1_VISIBLE 1 #endif -#endif +#endif /* _POSIX_C_SOURCE */ /* User override __EXT1_VISIBLE */ #if defined(__STDC_WANT_LIB_EXT1__) From nobody Mon Dec 15 18:18:44 2025 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 4dVSxK26b3z6L7TW for ; Mon, 15 Dec 2025 18:18:45 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxK0HgDz4LMG for ; Mon, 15 Dec 2025 18:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822725; 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=5lTLoGMadqSKdBbKVf7VM1I0q2jkiHI6tPjIc1RxlRs=; b=lPw6VS0HTeL8xoBo+DbJVFzK3BVx9j57Jy8LNvn0eGZTXEzkErwDHrXFc2XCgrlRaoYoVH gThbkc9rJBpHUMYR3IiHdGY3UIIfMeYVNk6Rko1qOI/ouRZon3FCg7dP8mHGUlPX225hKj DDPm4l1SithUAwW1pJ8if2yDvEE+LxXj4m0YJrK6QetEhyJGvnC84kxVZiDdrOOxoyXLGb /eKVVRtUYHIz4CXbO62ys+iWp52Mw+4tOMleQzt+Fd20MNhi3VVEuJRGeSGqSUlNuAXJV5 OncW1KLF4IeJmHo2Qt7rAOd3czt3KNoWOuBUhLCAufPdUV74XGR3n/ySGQ3ExA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822725; 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=5lTLoGMadqSKdBbKVf7VM1I0q2jkiHI6tPjIc1RxlRs=; b=ub6j+3ShohTVZerg8kGULTpFnAXGNXglSxdAy7YQnS0/BIzRBBb2BaT+Al4Xw8PlXLYqcR XxbYYvRbUd9L0hdkklRcXHqy3xpPQHZ1YLkDP+492Tv5jETbwlR3xeAAQ7VcqX9H1Z4CxY fedhFiHClR5SJ2VxARcW0fvCtRDjCsn92t6yl1X1wRtgqDmVDrZBuANJ7Ig563WFIMRX/q wbbicTiCnNCFemWE33yg0ZqS5msi4bh0k4GFeW94wKW21l91xKp5si7lEjpPQ0uelymN2J mmELH6z8LJ5KeWl/WL2v99N6iBba4PxgjkQLOYBnzKPQgW9gfqPyySsj+C2jJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822725; a=rsa-sha256; cv=none; b=bIOJIncIom791pmqKZjkWGEN5UIiZfddKxo06v1EiJAd3x0k5VeW5fVV2mKw7LViij4LJx UoJ1O9cR8/MaP1K+/6rveGC1MDkZODbihrVOVoYZMbPln9SwbB7pN9uQLZU2xrU4nd9dm3 6Fb4cZ2P8IZoQF1GD4DiSJvJOh4xUswm7kuFuqj0P1PdZjNt5vd2G5Soe8dne+hMrg5t/V Nq5uvFv0jOkcUludf1XczFWbFOzCVCG7yUvxFqTXr+kUB3IMp+BTudCHtQtE3cHkIjryws oR6tiXgrNJOEDDBlr6r6AEbv7BIlyef2kMVIdvlySEdsxkF8FwqZd0LU3raC1A== 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 4dVSxJ6y4jzVhT for ; Mon, 15 Dec 2025 18:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 257f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d00f1d6858a0 - stable/13 - gic_v3: Correctly handle GICC GIGR Base Address case 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d00f1d6858a0caca5c52f819da8381a6be11e3a9 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:44 +0000 Message-Id: <69405104.257f9.7de14132@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d00f1d6858a0caca5c52f819da8381a6be11e3a9 commit d00f1d6858a0caca5c52f819da8381a6be11e3a9 Author: Jessica Clarke AuthorDate: 2024-12-09 21:55:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 gic_v3: Correctly handle GICC GIGR Base Address case When using the GICR Base Address field from each GICC structure instead of GICR structures, the field gives the address of a single redistributor page. However, that does not mean that they are not contiguous, and so GICR_TYPER.Last could be clear on them. Thus we must ignore GICR_TYPER.Last in this case and always treat each region as having a single page. Normally we'd do that as a result of checking against the rman's size (though that's a rather roundabout and iffy way of achieving it), but for whatever reason this is bigger on the Qualcomm Snapdragon X Elite (I assume the MADT reports GICv4 but TYPER doesn't report VLPIS and so there is a mismatch between the rman size and the stride used) and we end up walking off the region's mapping. Reviewed by: andrew, phk MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47560 (cherry picked from commit f8c90b704189c94275d22d7cc204d1d74e821d86) --- sys/arm64/arm64/gic_v3.c | 3 ++- sys/arm64/arm64/gic_v3_acpi.c | 1 + sys/arm64/arm64/gic_v3_var.h | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index c90edc3ba14c..5e77d2670217 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -1315,7 +1315,8 @@ gic_v3_redist_find(struct gic_v3_softc *sc) } rman_set_bushandle(&r_res, r_bsh); - } while ((typer & GICR_TYPER_LAST) == 0); + } while (!sc->gic_redists.single && + (typer & GICR_TYPER_LAST) == 0); } device_printf(sc->dev, "No Re-Distributor found for CPU%u\n", cpuid); diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index 45e5578ee647..287c8c2d99eb 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -290,6 +290,7 @@ gic_v3_acpi_count_regions(device_t dev) acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, madt_count_gicc_redistrib, sc); + sc->gic_redists.single = true; } acpi_unmap_table(madt); diff --git a/sys/arm64/arm64/gic_v3_var.h b/sys/arm64/arm64/gic_v3_var.h index 1a4112a4b0ea..c5ca77a46811 100644 --- a/sys/arm64/arm64/gic_v3_var.h +++ b/sys/arm64/arm64/gic_v3_var.h @@ -52,6 +52,12 @@ struct gic_redists { struct resource ** regions; /* Number of Re-Distributor regions */ u_int nregions; + /* + * Whether to treat each region as a single Re-Distributor page or a + * series of contiguous pages (i.e. from each ACPI MADT GICC's GICR + * Base Address field) + */ + bool single; /* Per-CPU Re-Distributor data */ struct redist_pcpu *pcpu[MAXCPU]; }; From nobody Mon Dec 15 18:18:46 2025 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 4dVSxL2XyNz6L7Wd for ; Mon, 15 Dec 2025 18:18:46 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxL13PVz4LWk for ; Mon, 15 Dec 2025 18:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822726; 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=3HgvUo5ddc5GectV6aQDNUxvV3NByEc94LrlHoJfTuY=; b=yJtWo7ya6KZRSAQtv+1Qi8wG7WYra2/XgUP/gtrCWgYboKne/gmaEUeyzqYBf4rWAg7G// 9AsIa8VkRHPgfgQ0S7SIy4SDkFgk+g7to/LGGui8W16xrvd8no9FWXVkEuYIcskHponyAc JYCM4e5j2R6QiwbRiKZoDzD2EcSNrRcDN0AHTfkAAqRq4BxpC/nSrV7IPCQU5syhBd8iUP 8vcOEN2qTcubrqgZqP+o8c1owPxuLxGvwMLH/D7k7WMoBinXCTQEBjvUE9F6pZa046Fpnh qBC4K/9q38nlElGMEsB9AgucU1TYXoFmTe1qZ4FtQuHLStXukHJ0mYej6VRWsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822726; 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=3HgvUo5ddc5GectV6aQDNUxvV3NByEc94LrlHoJfTuY=; b=hgPJwP68fTXJIXlck+7zhmnBVmEHSs3pbzZ/ujywvpzhkcRaC1LdtAOQI2BY49b+RdieoL nJS8XwVjxfaOmtvBPFntVr3pt98Hyhqq7YeaIxHg0OPEypqjDsJDzYFC0vv+dXYI4wthi0 OtQufDWdpo1az869LykI/u3o94E60S7ldJ5WkS/+QdYFdO0KHuJUfqWmLQHQ8A+7C5YNdD FswLVua3pApcjO9Kqe86EigHdwAR2dK2CPK2oY7E0EOqPjziUN1v6pLXXPSRW0q6HKopwk YN4kQ2sMT+rWMPpCb0AQ5cRRlvU2hFvKEAfIrlC5XqBVla3KwkOdllGnM/dITQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822726; a=rsa-sha256; cv=none; b=HMugAUI5lH0BC5jckgpefjM+sNuW0Ob6mwJkI4hLPcRbYlDxqVbm64LJu6GEjAFVcz7lnp Up0dgChQhNQAy3Ar3tjwALNaUCOilG4a3pKLT4cVe5Gl9LyfgoLraIpyJ3Zji5iTvPVJLe ngv3aQHgQbh9aFNXS+XrtzuYQJaB3TZRsa/qxyrIv7nTUvYrmJtlC8+biY6zYdc1TFP4SO 2Nd5mFnxH8GZv/XTe40+260t1c3WKudmb5VR3J3DIDfTEG7H6gxIlaw+nhxCqQeLc7+92n 1G+f7VlgdGK7JXUkzeHr+XoepX9rYQCSnPymnYuzHjfsyqwioTH5thX/zh0bBA== 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 4dVSxL0byQzWds for ; Mon, 15 Dec 2025 18:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 257fd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 017ebaa60a83 - stable/13 - ofw: Fix inverted bcmp in ofw_bus_node_status_okay 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 017ebaa60a8377ec10cb300cfcc6a4ab91b4e27a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:46 +0000 Message-Id: <69405106.257fd.731a0b67@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=017ebaa60a8377ec10cb300cfcc6a4ab91b4e27a commit 017ebaa60a8377ec10cb300cfcc6a4ab91b4e27a Author: Jessica Clarke AuthorDate: 2024-12-17 20:51:56 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 ofw: Fix inverted bcmp in ofw_bus_node_status_okay Otherwise this matches any two-character status except for ok. Fixes: e5e94d2de987 ("Expand OpenFirmware API with ofw_bus_node_status_okay method") MFC after: 1 week (cherry picked from commit e1060f6dfd80b34cab6d439bf7420ad686ddc8f1) --- sys/dev/ofw/ofw_bus_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index 844b7acaf957..3da754f66e76 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -197,7 +197,7 @@ ofw_bus_node_status_okay(phandle_t node) OF_getprop(node, "status", status, OFW_STATUS_LEN); if ((len == 5 && (bcmp(status, "okay", len) == 0)) || - (len == 3 && (bcmp(status, "ok", len)))) + (len == 3 && (bcmp(status, "ok", len) == 0))) return (1); return (0); From nobody Mon Dec 15 18:18:47 2025 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 4dVSxN2vgpz6L7KB for ; Mon, 15 Dec 2025 18:18:48 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxM2327z4LJx for ; Mon, 15 Dec 2025 18:18:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822727; 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=C4gl6NE/MRBJvxm5jQAu/PCcGvCJ/fGhrzUTzgS8pqE=; b=WKM/91UlDyKvgV6iGWsmPeiJtv4+RpmcjrBQlSrBLgOY2YwaCs2rJVGT6JYvuLo+0mLYL2 zcFW8Pa5K4AnJr+xTHHjiLiiO/xdmEKpkOm2URbkeaeWC3MdfVuecTZb3YKfAL0wxSoXlc MW3YASRXgOdabhkCyKRGC/af0FAUD5r+sG8TYRhCuO4WonUupkPOnoy77XaPqz+KG6kr1E ycncjZ6p7wP+8ZOB9bJkEy6c3DMOrnTyAOxMu+jql5RqDFB15dWWdWjknsnuGZpKGnb1sV NQombt4Yh8oPBN2w37O5WUP/mw2+xXIVpMD0SljlZmbm1/vcumyorN/UfjIwnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822727; 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=C4gl6NE/MRBJvxm5jQAu/PCcGvCJ/fGhrzUTzgS8pqE=; b=P3mX7KcRBySAAtaJ0vVCwVg1inkJ/wgRV3hIZ4U1U1Ivwtb35X/TZz9yVYPFlSf9crHlJv VxzBHFK52Pq2Ay4RbZpmMNhFWUzPtTRsYq4xYVu9ndCyIBSIHCAAxqY6dJPE5VFthrU/pW qF5LJ91SWvGw0NpwBoE5aGlO2KI7lMrdHTTsj6kxMGXQccYcYto4c+PvteMvLfEa+f8pwH NZtxDc+gJxbyWS9Axqz+ijFQV0taEXS7i8UgJHEUC/rSniryz5d1FXCRovj3kkb4HlleYZ xAVCk5k2MiYdjVi65/wB8ck4+jATkSpEl9VXZhuXBEwZjYXuQVN9hA2P5SRlpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822727; a=rsa-sha256; cv=none; b=PFdvpn1TGsu1Olda6EJKn617WZlV5DHb7YdoFlz1UhaIjcAzEvzeTUHDP6ZyUL+qXOKb5o g8IWmeyemfisTvtyFiamauGgCeeRiSuhTEu7f/lSnt9hH5q4sBklnssrgrivFtz+vG+4Jw cd+SbsmTkY9T6Dc8poFWdQzFdP/HAilhL3+3h7aMdQjOFn9Mqz+x7KMVqUZQbwM/3Nw5yX BUKp8DvjT2kokd8WAhanmyaJ7Yw1eqae8+yh9XV86rkmYSmJwK+Lnz6gBsMjXeR0IraNZa ZjrgKZzDMZZWHOGkuu9zEzt6aawERrOKYxLM+E1G1sOP0hYGi7ES8D3+74Ktug== 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 4dVSxM1bNTzWt5 for ; Mon, 15 Dec 2025 18:18:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25537 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 7adf09f6307b - stable/13 - riscv: Fix and generalise saving TP (PCPU pointer) whilst in userspace 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7adf09f6307b7f2b645b9be108e0ebddc20be558 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:47 +0000 Message-Id: <69405107.25537.140fcf51@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7adf09f6307b7f2b645b9be108e0ebddc20be558 commit 7adf09f6307b7f2b645b9be108e0ebddc20be558 Author: Jessica Clarke AuthorDate: 2025-02-04 17:28:42 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 riscv: Fix and generalise saving TP (PCPU pointer) whilst in userspace In cpu_fork, we allocate sizeof(struct pcb) + sizeof(struct trapframe) space on the stack, then round it for stack alignment. This not only fails to include the space needed for TP but also doesn't round up the trapframe allocation to be stack-aligned, yet TF_SIZE does, as is the expectation of fork_trampoline and cpu_exception_handler. Given that sizeof(struct pcb) + sizeof(struct trapframe) is a multiple of 16, this causes the saved TP to be stored in the PCB's pcb_sp (the intended trapframe padding aliasing pcb_ra), which is probably harmless in practice as the PCB isn't expected to be current, but definitely not intended. In cpu_thread_alloc, we do include the 8 bytes for TP and then stack align that. This again fails to include the padding for trapframe as present in TF_SIZE, but sizeof(struct pcb) + sizeof(struct trapframe) happens to be a multiple of 16, as above, so adding 8 then rounding to stack alignment (16) includes an extra 8 bytes of padding, giving the right result for the wrong reason (and could be broken by future struct growth). Extract the calculation into a shared function that rounds correctly regardless of the struct layouts. Also introduce a new struct kernframe to encapsulate and clearly document this shared state rather than using magic constants, and also enable it to be easily extended in future, as we intend to do downstream in CheriBSD. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48799 (cherry picked from commit 21c534b9f5d5de07137f9a42e016876dd6ae66c1) --- sys/riscv/include/frame.h | 14 ++++++++++++++ sys/riscv/riscv/exception.S | 4 ++-- sys/riscv/riscv/genassym.c | 4 +++- sys/riscv/riscv/swtch.S | 2 +- sys/riscv/riscv/vm_machdep.c | 35 ++++++++++++++++++++++++----------- 5 files changed, 44 insertions(+), 15 deletions(-) diff --git a/sys/riscv/include/frame.h b/sys/riscv/include/frame.h index f134842d1c45..c70a3a48ee0a 100644 --- a/sys/riscv/include/frame.h +++ b/sys/riscv/include/frame.h @@ -57,6 +57,10 @@ struct trapframe { uint64_t tf_scause; }; +#ifdef _KERNEL +#define TF_SIZE (roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1)) +#endif + /* * Signal frame. Pushed onto user stack before calling sigcode. */ @@ -65,6 +69,16 @@ struct sigframe { ucontext_t sf_uc; /* actual saved ucontext */ }; +#ifdef _KERNEL +/* + * Kernel frame. Reserved near the top of kernel stacks for saving kernel + * state while in userspace. + */ +struct kernframe { + register_t kf_tp; +}; +#endif + #endif /* !LOCORE */ /* Definitions for syscalls */ diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index 7a362485945b..b19e12525c68 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -53,7 +53,7 @@ /* Load our pcpu */ sd tp, (TF_TP)(sp) - ld tp, (TF_SIZE)(sp) + ld tp, (TF_SIZE + KF_TP)(sp) .endif sd t0, (TF_T + 0 * 8)(sp) @@ -139,7 +139,7 @@ csrw sscratch, t0 /* Store our pcpu */ - sd tp, (TF_SIZE)(sp) + sd tp, (TF_SIZE + KF_TP)(sp) ld tp, (TF_TP)(sp) /* And restore the user's global pointer */ diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c index 2057cb8d34bf..2d5691f5e99b 100644 --- a/sys/riscv/riscv/genassym.c +++ b/sys/riscv/riscv/genassym.c @@ -86,7 +86,7 @@ ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); -ASSYM(TF_SIZE, roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1)); +ASSYM(TF_SIZE, TF_SIZE); ASSYM(TF_RA, offsetof(struct trapframe, tf_ra)); ASSYM(TF_SP, offsetof(struct trapframe, tf_sp)); ASSYM(TF_GP, offsetof(struct trapframe, tf_gp)); @@ -99,6 +99,8 @@ ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); +ASSYM(KF_TP, offsetof(struct kernframe, kf_tp)); + ASSYM(RISCV_BOOTPARAMS_SIZE, sizeof(struct riscv_bootparams)); ASSYM(RISCV_BOOTPARAMS_KERN_L1PT, offsetof(struct riscv_bootparams, kern_l1pt)); ASSYM(RISCV_BOOTPARAMS_KERN_PHYS, offsetof(struct riscv_bootparams, kern_phys)); diff --git a/sys/riscv/riscv/swtch.S b/sys/riscv/riscv/swtch.S index 57e3904df531..7d2caad09a91 100644 --- a/sys/riscv/riscv/swtch.S +++ b/sys/riscv/riscv/swtch.S @@ -429,7 +429,7 @@ ENTRY(fork_trampoline) * Store our pcpup on stack, we will load it back * on kernel mode trap. */ - sd tp, (TF_SIZE)(sp) + sd tp, (TF_SIZE + KF_TP)(sp) ld tp, (TF_TP)(sp) /* Save kernel stack so we can use it doing a user trap */ diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c index 043093960edf..ada68ff63226 100644 --- a/sys/riscv/riscv/vm_machdep.c +++ b/sys/riscv/riscv/vm_machdep.c @@ -58,6 +58,26 @@ #define TP_OFFSET 16 /* sizeof(struct tcb) */ #endif +static void +cpu_set_pcb_frame(struct thread *td) +{ + td->td_pcb = (struct pcb *)((char *)td->td_kstack + + td->td_kstack_pages * PAGE_SIZE) - 1; + + /* + * td->td_frame + TF_SIZE will be the saved kernel stack pointer whilst + * in userspace, so keep it aligned so it's also aligned when we + * subtract TF_SIZE in the trap handler (and here for the initial stack + * pointer). This also keeps the struct kernframe just afterwards + * aligned no matter what's in it or struct pcb. + * + * NB: TF_SIZE not sizeof(struct trapframe) as we need the rounded + * value to match the trap handler. + */ + td->td_frame = (struct trapframe *)(STACKALIGN( + (char *)td->td_pcb - sizeof(struct kernframe)) - TF_SIZE); +} + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -74,13 +94,12 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) /* RISCVTODO: save the FPU state here */ - pcb2 = (struct pcb *)(td2->td_kstack + - td2->td_kstack_pages * PAGE_SIZE) - 1; + cpu_set_pcb_frame(td2); - td2->td_pcb = pcb2; + pcb2 = td2->td_pcb; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); - tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); + tf = td2->td_frame; bcopy(td1->td_frame, tf, sizeof(*tf)); /* Clear syscall error flag */ @@ -92,8 +111,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) tf->tf_sstatus |= (SSTATUS_SPIE); /* Enable interrupts. */ tf->tf_sstatus &= ~(SSTATUS_SPP); /* User mode. */ - td2->td_frame = tf; - /* Set the return value registers for fork() */ td2->td_pcb->pcb_s[0] = (uintptr_t)fork_return; td2->td_pcb->pcb_s[1] = (uintptr_t)td2; @@ -217,11 +234,7 @@ cpu_thread_exit(struct thread *td) void cpu_thread_alloc(struct thread *td) { - - td->td_pcb = (struct pcb *)(td->td_kstack + - td->td_kstack_pages * PAGE_SIZE) - 1; - td->td_frame = (struct trapframe *)STACKALIGN( - (caddr_t)td->td_pcb - 8 - sizeof(struct trapframe)); + cpu_set_pcb_frame(td); } void From nobody Mon Dec 15 18:18:48 2025 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 4dVSxP2KN7z6L7Wk for ; Mon, 15 Dec 2025 18:18:49 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxN2ntVz4LX5 for ; Mon, 15 Dec 2025 18:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822728; 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=Iber83cBzgO/pmnrPLv8M4mfi81w+mlL+F/EhUoKz24=; b=Iqw60RX8civV1p3h6vFlW9MFqeaey2uQbJMf4VLRTV2B++ECVV8vWIcsCgBoXDKWLOBBMi FVoxHC1O0I9nXlzmAc3y2epEyVRYU8qAyl5pKRReJSdX7Ep0yNmEoxvTk/96V7YlF/kVYj 1/SufEUUewlRAxx0tdSxoio8ju0PJUnvikoD4QmEZpbTM4ZNJfNZ+EH5IpTWxPfRv4dJhu 8kop+jW2zvnrzFSuwEcdCj2NhLz3kcFKd0YLv3pA8+T9ARUrqpkBfV5frjWSYQk59zb7lq JJPr0Fno/GQP+HQkk4e/pOlzoAoXbYwWbAx20nD0VfFZQ7d+Xo88qIwbjSVsXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822728; 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=Iber83cBzgO/pmnrPLv8M4mfi81w+mlL+F/EhUoKz24=; b=A5kNUIKymR1AieEbCvxbYZ08s87Dy1yXPmBayaO1sDuOsMaSV2WxMhrLnIAG4vVZCA5nsM j6TkE8yIEzcBPnv9ZBQCb9p4GNC5LPFpkv1i5/jrrSeWPrVdvqFPa/4WAgQk8WSUX82bWb tId3Xa7iYpbhn2t6nGg1X/xWa+WufCPBYB5Txf7jM+joLzc2EosxuR7V2T0kaUqxzVW4H7 CGVl6owLaBmGlu87G1+K33VjUsq/rL/8B8xQ5CCZB7gVz3gheXkUrsp4OZXjNRHK4Rd473 tq+Pr1jOIyTDZGEtj2DPbDJfjO6YNdtBbBUJJuhLw7cICrUrevnhKgu+MWhHPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822728; a=rsa-sha256; cv=none; b=DxmzK6I3VJR4M7xKbMKegWf8UgRAl3YQ0lV6jcRuCphSZdgsh5/f7ePVcn7RThwq5vVNfn 26eXNVcVZSIA9xSjX1Y3HELQMrMWe6JHV4qmbVYEKn/nQTK0sw4x/xSCDbmzYR5WzOJ/wB o4RlPeriugSykZdIW/MqqFMNO+LAolSQBpReXF1yi7DI3W6Bzlftuy25YDAcqm/V/3nYk6 Bcb1ZOlzol8HYY+ly8w6sK3yyE8rupIxyNmw0sBRGGV2bXtpxPQG0dnuNBwep2sU8Asjsh 1hfw3DxIbb3WdHuCET3ly2nhO0HrQbPjyADjAPauZTjZ5ivE7DEhQfMcXiIYKA== 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 4dVSxN2Pc7zVhZ for ; Mon, 15 Dec 2025 18:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 237e1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 915a65a92a9f - stable/13 - libc: Don't bias DTV entries by TLS_DTV_OFFSET 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 915a65a92a9f01f31d0af8b492eba0b781ba0999 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:48 +0000 Message-Id: <69405108.237e1.411a5f2c@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=915a65a92a9f01f31d0af8b492eba0b781ba0999 commit 915a65a92a9f01f31d0af8b492eba0b781ba0999 Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:50 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 libc: Don't bias DTV entries by TLS_DTV_OFFSET PowerPC and RISC-V have a non-zero TLS_DTV_OFFSET. The intent behind this in the design is that DTV entries are biased by this, as are (in the other direction) the DTPOFF/DTPREL entries in the GOT. However, this is pretty pointless in practice, and both FreeBSD and glibc's run-time linkers don't bother to bias DTV entries, instead just adding the bias back on at the end in __tls_get_addr. In libc we also have a minimal implementation of this for statically-linked binaries, which is only in practice used for code compiled with -fPIC (not -fPIE) that is also linked without TLS relaxation support. PowerPC supports linker relaxation for TLS sequences, so this likely never gets hit there, but RISC-V does not, and so easily does if you compile an executable with -fPIC. In this implementation we add TLS_DTV_OFFSET both to the DTV entries in __libc_allocate_tls and to the result of __tls_get_addr, meaning that any TLS accesses using the General Dynamic model in static binaries on RISC-V end up off by 0x800. Historically this also did not matter as __tls_get_addr was a stub that always returned NULL, so although 6e16d0bc4376 ("Rework alignment handling in __libc_allocate_tls() for Variant I of TLS layout.") added this DTV implementation, nothing actually read the entries. However, now it's a real implementation, and dl_iterate_phdr also now relies on it, it does matter. Fix this by not biasing the DTV entries, just like RTLD. We could instead stop adding TLS_DTV_OFFSET in __tls_get_addr, but being consistent between libc and RTLD seems better. (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: ca46b5698e8a ("libc: implement __tls_get_addr() for static binaries") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50181 (cherry picked from commit d04c93a2adccb4c3a17f7391126a9246326e3fea) --- lib/libc/gen/tls.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 0db0f42484e9..a6a1d6a2fed2 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -150,7 +150,9 @@ libc_free_aligned(void *ptr) * described in [3] where TP points (with bias) to TLS and TCB immediately * precedes TLS without any alignment gap[4]. Only TLS should be aligned. * The TCB[0] points to DTV vector and DTV values are biased by constant - * value (TLS_DTV_OFFSET) from real addresses[5]. + * value (TLS_DTV_OFFSET) from real addresses. However, like RTLD, we don't + * actually bias the DTV values, instead we compensate in __tls_get_addr for + * ti_offset's bias. * * [1] Ulrich Drepper: ELF Handling for Thread-Local Storage * www.akkadia.org/drepper/tls.pdf @@ -166,8 +168,6 @@ libc_free_aligned(void *ptr) * but we must follow this rule due to suboptimal _tcb_set() * (aka _SET_TP) implementation. This function doesn't expect TP but * TCB as argument. - * - * [5] I'm not able to validate "values are biased" assertions. */ /* @@ -271,7 +271,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) /* Adjust the DTV. */ dtv = tcb[0]; - dtv[2] = (Elf_Addr)(tls + TLS_DTV_OFFSET); + dtv[2] = (Elf_Addr)tls; } else { dtv = __je_bootstrap_malloc(3 * sizeof(Elf_Addr)); if (dtv == NULL) { @@ -282,7 +282,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) tcb[0] = dtv; dtv[0] = 1; /* Generation. */ dtv[1] = 1; /* Segments count. */ - dtv[2] = (Elf_Addr)(tls + TLS_DTV_OFFSET); + dtv[2] = (Elf_Addr)tls; if (libc_tls_init_size > 0) memcpy(tls, libc_tls_init, libc_tls_init_size); From nobody Mon Dec 15 18:18:49 2025 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 4dVSxQ06gbz6L7Pb for ; Mon, 15 Dec 2025 18:18:50 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxP4hs9z4LjX for ; Mon, 15 Dec 2025 18:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822729; 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=aA8ZSGtTVaumKxm3iCoazNvv7v4SM/KFK/QMX9lU9zo=; b=p4O3gpRxQdD4ktpggrGx7ZYMgwn/VkrBh+hvf4hew4WiiBDdgztJ0uHo5vCByUOq0Fwzdx roH6pI76cew2t763oBuZHxV8IaprlwZaKIBM3053LB5muIX2kuhutgMhNZ8OBkSaU3QPLt Xa6WKgpez0CzBxb/8TLB7QisRPW/CAU55kW2coC09xbwz9PbEw7aF91ZQCw2YGxZe4UWWT J6kCfF95/xuAM8jXlBolSJvno+osS5JQ9X3Y56VaMA/q8qVSOj7lkmvh5kP96Mo5Ud/iPh InAeQP6jgZdEx+uC78W41rtumwJh4L5zWCxdF4/VPw7jIpR4VKe3kzCJnHLy8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822729; 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=aA8ZSGtTVaumKxm3iCoazNvv7v4SM/KFK/QMX9lU9zo=; b=G/Iwy/eA57dNmeveYQCM02+VusErV7+/EUZREE3I36Jf8oGD+nbo+AJbwmpRgA9exdJZkv ZOWHU/kShSMLyHUMBz4DZtmbFqR2BOW7s/7H+V6bQkMXQaXXq4OAz8n02e2QtjaQ6kViFK kr7cAJ8XVRXyNc3Gaz4b7VTP5vMJBeVDz9LodeWBQ9/DYFW6dwy4F/A3koSmOxofbXJ9jA +jXHGAtNnUEsy30NP8Yc/QMVk2af5QOxbKwWOq+V7d9IbOzgj3fMb6HGOAybidQBqrE+S/ wbGh5Zd3TKVpTG6iGL0TBQuMiEal9WvJQZgNh1HtJCuh0OKWe0dQ44XNNmij7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822729; a=rsa-sha256; cv=none; b=gak3JwfHBRzaHHp9wcmv3/nvRSeNPsAX0wI07M+M0pfBFEQ+js9Ft9OlXef2HGx6ug6/DE WP97v9/5+wTiUEJTsWyWDWjyJJzRZZ8954eePLAPNnM2PFWvryYQ1VS6iUle8O47JCbObO 2svvaptyqptxQTSLpCngulkwCSb6aHbnkqRdCZiYyIf7WO/qTfIZ7RS5Vw9lXvc+O9g6NJ nFkRO5fjfu4gIgVzjjZkJ77poJg2YNAT+CU3+vTRe624m8DAdREGwKwqU77178Eldn+8BK MoiuCMbHiIxBh1tqNNl2zQDU9d+mR5FF7zn8599hMPlroAk3uYe94P9K5i24Rw== 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 4dVSxP48vyzWbL for ; Mon, 15 Dec 2025 18:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2553c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 03d5ae50dc7f - stable/13 - libc: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03d5ae50dc7f2c12427c937d374a679901eaf9dc Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:49 +0000 Message-Id: <69405109.2553c.2c5e2c77@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=03d5ae50dc7f2c12427c937d374a679901eaf9dc commit 03d5ae50dc7f2c12427c937d374a679901eaf9dc Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:50 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 libc: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V The implementation of dl_iterate_phdr for statically-linked binaries abuses __tls_get_addr to get to the start of the TLS block. For most architectures, tls_index's ti_offset (relocated by DTPOFF/DTPREL for GOT entries) is just the offset within that module's TLS block. However, for PowerPC and RISC-V, which have a non-zero TLS_DTV_OFFSET and thus are designed assuming DTV entries are biased by that value, ti_offset normally has TLS_DTV_OFFSET pre-subtracted. By using an offset of zero here we end up getting a pointer TLS_DTV_OFFSET past what __tls_get_addr would return for the first TLS variable. Fix this by using -TLS_DTV_OFFSET to mirror what the General Dynamic GOT entry for the first TLS variable would be. (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: dbd2053026a6 ("libc dl_iterate_phdr(): dlpi_tls_data is wrong") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50182 (cherry picked from commit 78b99f369f75f5df49b506ae750659b07ab34362) --- lib/libc/gen/dlfcn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index b6dab041bac3..c554deb0e5fc 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -226,7 +226,7 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) __unused, return (1); _once(&dl_phdr_info_once, dl_init_phdr_info); ti.ti_module = 1; - ti.ti_offset = 0; + ti.ti_offset = -TLS_DTV_OFFSET; mutex_lock(&dl_phdr_info_lock); phdr_info.dlpi_tls_data = __tls_get_addr(&ti); ret = callback(&phdr_info, sizeof(phdr_info), data); From nobody Mon Dec 15 18:18:51 2025 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 4dVSxS0CN7z6L7cT for ; Mon, 15 Dec 2025 18:18:52 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxR56tSz4LgH for ; Mon, 15 Dec 2025 18:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822731; 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=x5OTruHmdS4LkEsNa9il4lkdVQ/suHU3a/lVYMzyjwA=; b=Yy7j0xn6mpxEFFGaCpGGwBLPIRylAnwtlwZNOsf4Bijq+RYUPb1oRS8t+d4pQ35W2FljrP yVgIXicQgDaL6RbOQmdkP81Lc1j0nLLB5iVK00CvV+WT7zZ/Tk4vhH1F73zKoiryWtQBDx zssJ7eKdj2W4B0VK1QKuJDoclMX8nkbkZ6YrgcLWTCVnB4Yek5pbPYBldj9+whvhfyAQB+ YurbDb7BWg5mgBi7zFV5fJmhQDpGpJXu9Ha8RFmrYEoIKiYAsKANVZxOWhRk8TpRem4TSL RYmucoSgZ8+Eyu9854klkvrR/4NfWksXumHWiwiJlruD11a6NOsva12TOwcKBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822731; 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=x5OTruHmdS4LkEsNa9il4lkdVQ/suHU3a/lVYMzyjwA=; b=QtkBiEnMsUomzrEHFVs51jPpNFRV/csg8YTg5SUJk6Jyc8CS/WyPcq9lWsr29nFHAHu5KQ nueiIsGWTL6w41vIJxAbMYHVkDqDxWTzfoId68ANtxf1VMR1Lbgue51xudavOnRF77pNHW hKEO2b7PLGc/KY+Qq4z3OCmXkWWmglbCWnBG7gi+kt0Eab8LgCMlHAsMTHM8j73nzdNKb6 DLOafqjFzu3mZF/VSGtBy3dxIHwRPZBnddSfkgbuPNg6vbCP4nwYf9tUeQkGCW7m3T1DxD CwzeW5m8FbkrzMXG5vHFfbAzREgZIRNIApr+0jyO0bF617plubT7ijZce/WT3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822731; a=rsa-sha256; cv=none; b=Gn2QJAtAh6jD0KYknxX5MYBTZz6uRetRgz6c8nTnZBjAlEv0xcdhRYqBIuh1bZu0HulCJS PMy8qwjw03ZJ+CJNMVLrS7vsKxZUwJs0Y9E61BY+OH7UxlDsNYhtR/K80R35prdo/GEqXz PPgDejMHzzYeC5895l3fcd/2x5ezi72kDFeJOsOamuyEXOogRo7O7FcjWXJwpnzviJtoO8 lKRi502zNNUnQG/W/VNU66115/t8SkA/ezL6M9tCdUzPJQ+dlYNSvxIyaCpfQGpTMhzDqu PH5wUMlMxArE3mddOqjgYCtEnS4gjma8mlicGY6GNopgGlhQtnpHpzaToA68Zw== 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 4dVSxR4j5rzWbP for ; Mon, 15 Dec 2025 18:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25540 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: c9793e87025e - stable/13 - rtld-elf: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c9793e87025e0495bad680e0a1ad6fc174c508c6 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:51 +0000 Message-Id: <6940510b.25540.698474df@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c9793e87025e0495bad680e0a1ad6fc174c508c6 commit c9793e87025e0495bad680e0a1ad6fc174c508c6 Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 rtld-elf: Fix dl_iterate_phdr's dlpi_tls_data for PowerPC and RISC-V The implementation of dl_iterate_phdr abuses tls_get_addr_slow to get to the start of the TLS block, inlining the implementation of __tls_get_addr as if the tls_index's ti_offset were 0 (historically it called __tls_get_addr itself but changed due to locking issues). For most architectures, tls_index's ti_offset (relocated by DTPOFF/DTPREL for GOT entries) is just the offset within that module's TLS block. However, for PowerPC and RISC-V, which have a non-zero TLS_DTV_OFFSET and thus are designed assuming DTV entries are biased by that value, ti_offset normally has TLS_DTV_OFFSET pre-subtracted, but it's __tls_get_addr's responsibility to compensate for that. By using an offset of zero here, tls_get_addr_slow will return a pointer to the start of the TLS block itself, so by adding TLS_DTV_OFFSET we will point TLS_DTV_OFFSET past the module's TLS block. Fix this by removing the extra bias (the alternative would be to pass -TLS_DTV_OFFSET and keep the addition, which would more closely follow what __tls_get_addr does, but this is more direct). (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: d36d68161517 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50184 (cherry picked from commit c02aaba1b4549c1c3b1481f7c935f6cc80b98e8d) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a43c6e3c7cda..1cab00bb1c59 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4263,7 +4263,7 @@ rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info) phdr_info->dlpi_tls_modid = obj->tlsindex; dtvp = &_tcb_get()->tcb_dtv; phdr_info->dlpi_tls_data = (char *)tls_get_addr_slow(dtvp, - obj->tlsindex, 0, true) + TLS_DTV_OFFSET; + obj->tlsindex, 0, true); phdr_info->dlpi_adds = obj_loads; phdr_info->dlpi_subs = obj_loads - obj_count; } From nobody Mon Dec 15 18:18:50 2025 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 4dVSxR1Q6Mz6L7S1 for ; Mon, 15 Dec 2025 18:18:51 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxQ4ZZBz4LXH for ; Mon, 15 Dec 2025 18:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822730; 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=5qNQmddzhxM/eVRd6hap8gRzFk0vbo4F9i9CRW+PTSs=; b=Svi0NAFeb7mIjafaEHiEsrhgynFUFBZOdOE4X1O80sop+jli/MFX6D3Qy8FN2bpMuSxfzu 9Z1SxI0QROq/krJI//9KE2qtrPo7Y5D9CcD2+Q94BxqYgiWybg2PdAW89OQFKow41asibB yViyQdUm3/1pdSGaCXRQUjXVtB29maclB3vyWu3G9+9cfYZIOHgy9bSX/B/j2ClumvtCND 9Kimze428FhSuCcT4FhlGNRHQzKDt+GUI3Cz7EVHdJtPKUdxsEDorOCHcNfoim1r9P1sIh 7+nIZXsXgULuodDK89m4rtnJewkZf3FAhujPqAFodzE/OzRN0W3+2iH4ekTJUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822730; 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=5qNQmddzhxM/eVRd6hap8gRzFk0vbo4F9i9CRW+PTSs=; b=xNsQhZyFg/+FrIKpOLm2C6nwgIHghH/FIG5znxi2RBi00fb1TwQM1v8Cc9z+dESIXlY5Ce 6nhWBLnPHGE7Q1NDRIg0cf4Y1X7Jt86PjA6jevEReeBwbB0OisvuiVJpIlDSe1UcvUdeKX IuIVgxYQaTWAYqQbKPnobwDgXpBiwxs7eOuAcGpUOOs4OxDKfX+h5u0VqUDKpYxXEFKLYR 7efTl4lTcxTMfPK/+pTgcVuXhF1ZtL+auDY4A2IN5KQfb1B0Khb21VpNq8UOKob65f2yll DDhIf30sycbvr9S+SBTB4fzsJeMJVSwZeIRsuYZh0VpzA+7oMzNCTeVA+h/OYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822730; a=rsa-sha256; cv=none; b=ncthhNxGc4RDJeC/QyMlf6UczVnqiVcJZip2nGeoV+bVeno12iVXx5K6hF+QhqbNXV9BcH 46sACvEcSMK2+OOxUgVMHplNizhDrfE0/p5pZFaJ4zmnstt36xhm9A7/la6NhjnQUv1JZ8 7uVxWtXQO40t1WgiNmnEn3iqzEEFdMcamZISkDFhRIAFV1XSAVQ+/rF3zsplSUciXaaDm4 nEe8vOzsFWUEYpAoEQ+TuzOgFbGcPcEY1jn+GEDtplD4WmPInYYjsEo7WC63ZD9Y+/2pCk T8pzCtbHJbjEsg5u4o1aeC89n6ZLEkxkG0RZh7AJQUGN3EvuAT2Wrt8cjh2aMQ== 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 4dVSxQ3tNKzWbN for ; Mon, 15 Dec 2025 18:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 254b1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d5e9943bec69 - stable/13 - rtld-elf: Fix dlsym(3) for TLS symbols on PowerPC and RISC-V 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5e9943bec698945a68539911c27dc88ccf37a4b Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:50 +0000 Message-Id: <6940510a.254b1.67a25b47@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d5e9943bec698945a68539911c27dc88ccf37a4b commit d5e9943bec698945a68539911c27dc88ccf37a4b Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 rtld-elf: Fix dlsym(3) for TLS symbols on PowerPC and RISC-V The implementation here is meant to mirror what a GOT entry for the given symbol would use for ti_offset. However, on PowerPC and RISC-V, TLS_DTV_OFFSET is non-zero, and so the GOT entries are normally biased by this, but we fail to do so here. As a result we end up getting a pointer TLS_DTV_OFFSET past where the variable actually is. (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: 5ceeeba90c6c ("Import DragonFly BSD commit") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50183 (cherry picked from commit 8ad9cec3a2cc643020a286ee68f70eb01225fbdd) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d3c696145d5c..a43c6e3c7cda 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4082,7 +4082,7 @@ do_dlsym(void *handle, const char *name, void *retaddr, const Ver_Entry *ve, sym = rtld_resolve_ifunc(defobj, def); else if (ELF_ST_TYPE(def->st_info) == STT_TLS) { ti.ti_module = defobj->tlsindex; - ti.ti_offset = def->st_value; + ti.ti_offset = def->st_value - TLS_DTV_OFFSET; sym = __tls_get_addr(&ti); } else sym = defobj->relocbase + def->st_value; From nobody Mon Dec 15 18:18:53 2025 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 4dVSxV2tq9z6L7ZT for ; Mon, 15 Dec 2025 18:18:54 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxT6ZnSz4LpS for ; Mon, 15 Dec 2025 18:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822733; 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=I8qSfllHdf/cP2vfdhGv+E7wiUqbycUX4mUGKaOymdw=; b=FvHEoePRsWBvY0qfTm1iQztJZfj0Eo7Bsb8OHZdRBtAh4TY5RE+q7n+snAMgRoX0kyxWnU OWOPuz9NMMOK83z0Bq1R1CPg7OTGfijQ+hvkAJ0yOc1W17GnlgMtZnlj8xbRiE++QVsM7Y IZGGvSWwS44SLUgeQsTZx0h3LALOFIIBOzBZgStNBp27diKRQJavL3Z/Hc3OtcBwezuFwo OifwD0nCavUraJyFOaHPhvPMfTfIk1vKWCMq8iCC2g1bo6OWN775bxlQxZVY9iyU4tVuHA JH7g2UdUCuDbRTzG6Orgw5S9FpyAZnSYY0NH71xLskqjNJNjgoHvvmzs/da0hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822733; 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=I8qSfllHdf/cP2vfdhGv+E7wiUqbycUX4mUGKaOymdw=; b=Gov7pL/aj7IDVeasPVzB/PsDtDm6QWnjlQ5VGF3bRZ7uNh0x6tKTjRHIJqeEaHrJ3nIwgP Qf9X6Qo4InAvU2jEZo2hP71lBLRjDmBcDzYEyWsHVsjc50+KIcJFP2WIWfBp6t7SBHA1Nq 12pJCEU7v4in4fREZVydeEaOxW8agp3aGt6tUqZZy2lBTXOTajdqjFPJNB26ncdjGDnoZd RVWcGVULbTK73xZTW+10Cq/u06tNaHxrYXGzpAGOWtZxvDPY0TMuZBPCkJNsHTI+T0RbhP 46I9c+edBTOg1on1BDLD2xsu2RQ3i2eBHdvG5961q5N1NrnfDdkJHr11tYatfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822733; a=rsa-sha256; cv=none; b=sMrDYtWiR0aNhuJxeScUEwWvUm+N7bdW1+GhpUW8gjjaqMlVefq5xQr2ECBMTlT2Z2JCfZ UfV24rYMZ4W6ac6AryCIgqGqss40aalvI049ZPRMK3A+xRbGVr1vgCdBelgPDxoi3Aaz5P kD1gpH6pC6VnjI47vHZ6s2hN+7s0VH++Qjfg3C7TUWxma7TetEx09/W50x56crJhUq+I2v /tNOrnzyGay1Lh04LwdvAQTSMti5nGxL2r5uIsoNUKOpHx1FAeJL8kNE2VqKAtVGOgSqX2 WIDYwz180upj9S+8Ripv8CejeSIoYAMl27efjwrA7irYZTNrjmpjffzG/WGEEw== 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 4dVSxT65w1zWnD for ; Mon, 15 Dec 2025 18:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24ebc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 6216ed808d1b - stable/13 - rtld-elf: Fix executable's TLS module index for direct exec 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6216ed808d1b0ec1921f49b5bba454f38d152a0c Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:53 +0000 Message-Id: <6940510d.24ebc.5fa078df@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6216ed808d1b0ec1921f49b5bba454f38d152a0c commit 6216ed808d1b0ec1921f49b5bba454f38d152a0c Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 rtld-elf: Fix executable's TLS module index for direct exec For direct exec mode we reuse map_object, but tls_max_index is initialised to 1. As a result, the executable ends up being assigned module 2 (and the generation is pointlessly incremented, unlike in digest_phdr for the normal case). For most architectures this is harmless, since TLS linker relaxation will optimise General Dynamic accesses to Initial Exec or Local Exec for executables, but on RISC-V this relaxation does not exist, yet the linker will initialise the tls_index in the GOT with module 1, and at run time the call to __tls_get_addr will fail with: ld-elf.so.1: Can't find module with TLS index 1 Fix this by making map_object use 1 for obj->tlsindex when it's loading the main executable, and don't bother to increment tls_dtv_generation either, matching digest_phdr (though that one is harmless). (Note this also applies to MIPS on stable/13) Reviewed by: kib Fixes: 0fc65b0ab82c ("Make ld-elf.so.1 directly executable.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50186 (cherry picked from commit a08d92def20a41243d4afc97cf4a2124be5386b9) --- libexec/rtld-elf/map_object.c | 10 +++++++--- libexec/rtld-elf/rtld.c | 4 ++-- libexec/rtld-elf/rtld.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index eaf96fb80925..830974d22f9e 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -60,7 +60,7 @@ phdr_in_zero_page(const Elf_Ehdr *hdr) * for the shared object. Returns NULL on failure. */ Obj_Entry * -map_object(int fd, const char *path, const struct stat *sb) +map_object(int fd, const char *path, const struct stat *sb, bool ismain) { Obj_Entry *obj; Elf_Ehdr *hdr; @@ -314,8 +314,12 @@ map_object(int fd, const char *path, const struct stat *sb) if (phinterp != NULL) obj->interp = (const char *)(obj->relocbase + phinterp->p_vaddr); if (phtls != NULL) { - tls_dtv_generation++; - obj->tlsindex = ++tls_max_index; + if (ismain) + obj->tlsindex = 1; + else { + tls_dtv_generation++; + obj->tlsindex = ++tls_max_index; + } obj->tlssize = phtls->p_memsz; obj->tlsalign = phtls->p_align; obj->tlspoffset = phtls->p_offset; diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 980f5c89edb7..9725dcdd805f 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -777,7 +777,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) */ if (fd != -1) { /* Load the main program. */ dbg("loading main program"); - obj_main = map_object(fd, argv0, NULL); + obj_main = map_object(fd, argv0, NULL, true); close(fd); if (obj_main == NULL) rtld_die(); @@ -2891,7 +2891,7 @@ do_load_object(int fd, const char *name, char *path, struct stat *sbp, } dbg("loading \"%s\"", printable_path(path)); - obj = map_object(fd, printable_path(path), sbp); + obj = map_object(fd, printable_path(path), sbp, false); if (obj == NULL) return (NULL); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 306c460f286d..54015b5122f7 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -368,7 +368,7 @@ typedef struct Struct_SymLook { void _rtld_error(const char *, ...) __printflike(1, 2) __exported; void rtld_die(void) __dead2; const char *rtld_strerror(int); -Obj_Entry *map_object(int, const char *, const struct stat *); +Obj_Entry *map_object(int, const char *, const struct stat *, bool); void *xcalloc(size_t, size_t); void *xmalloc(size_t); char *xstrdup(const char *); From nobody Mon Dec 15 18:18:54 2025 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 4dVSxW4BHHz6L7SB for ; Mon, 15 Dec 2025 18:18:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxW0c14z4Lpd for ; Mon, 15 Dec 2025 18:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822735; 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=xvz57wV4zW7pKH/YDGTdnAzCunuDtV6iTZ80IwviyBQ=; b=nFrvYsoJMjfpiKpr58kxWO6bPIoam1TEuT0tGHab8YTd5sA4mEARC9qC4Frs83TCux/b0F NuWUPPrsdBobB/hF0iEOfQUeIADuJxCbv+QV+fteJqNTqrPuNvFw/sWvAJDCOqRVvKIYyX AvQPmGvMzXZ48O6K9iXAJIHJT8v35al6r0io6ADy/7f384UOSGK6nYGDxKnF3EDYCFCKYY 7px1Ogrg2YaAT2iB1j+mM0TFa4vDwUTuN5ZqTlI0w0Wxa/0qo2yZv+MOUnLZQ5j3k1TJ0f 6CYg9ye2Lg9fhWKPWWsoeVKtUTU/AyJDTehzAAa6BX8vcvkXAm86pJqHeatmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822735; 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=xvz57wV4zW7pKH/YDGTdnAzCunuDtV6iTZ80IwviyBQ=; b=CtRy3JvZvN+79ITEX/LQZcE7W+iPPx+BHAvSAWFy0S2YdbyLb9JiiD1dY1NZIPWE3AnIPF VpDOuMCH9BsG+Jmiy4SkKJAao0v8punBhh1X6+9iL/U98WpXUFScjD9BMoHwJdjoqjx8Ly yOdD1bemiULwrc1HfmlCp6+kRAIsUySawAcz86AaK/RaUzDjMJy8CzfppHK4CFAPnxmIcs v6DSCGdebJrypxzIAY/i4COAfcK8+j0CBXv7Gr+M+MWuU494ZwLt4GyqfTLqvmf1gzbdH3 HtQ1jKXovg1Mn60ztYNRwOwRoQ0aStoi60avacWpjCtRryBuWKcHKfbrJCk4rQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822735; a=rsa-sha256; cv=none; b=RIU9uN6lKWwFWAbL58ar2r4zV2d//ewqoxIkgdHJCchDJNwO4thXC79I5AINqXWfv3HtNf S017n2jK0IG402OzgQ7eyHc6kGv0g3y3RvXPc6VOuYOFS0L3+IXpppRLinsUrTCWhwzvHc YhOE+7JZXzVoV6uY8BfvgQbu5jVdpEXqHg390EXVN+B9K7NDZ+b7Vpbjp26OHV7duRP3OW 73RdGs5xdAhemUULxXSRun0M6+7FjdSiu/u+iFaoLegwRcaY2Q8keLW6Fo//PjVJxtVN1N 7Jqdgdp2UAJXQQqc95aEbP1JT9gyV8tJyCS67MXdeMfMfN7iTctQ2p90JeBygg== 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 4dVSxW003PzWZV for ; Mon, 15 Dec 2025 18:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 237e5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a85ba2eca4d6 - stable/13 - rtld-elf/riscv: Don't allocate static TLS for dynamic TLS relocations 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a85ba2eca4d6f7a958e3d4b139723e5116e0a623 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:54 +0000 Message-Id: <6940510e.237e5.4f8fdc14@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a85ba2eca4d6f7a958e3d4b139723e5116e0a623 commit a85ba2eca4d6f7a958e3d4b139723e5116e0a623 Author: Jessica Clarke AuthorDate: 2025-05-28 20:22:15 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 rtld-elf/riscv: Don't allocate static TLS for dynamic TLS relocations Provided you don't run out of extra static TLS space this should work, but it's wholly unnecessary and not how things are supposed to be done. Only static TLS relocations should allocate static TLS. Reviewed by: kib Fixes: 4b1859c0e943 ("Add support for RISC-V architecture.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50563 (cherry picked from commit 03801d449a3731cb643a51625c8c4d5d07b2e54c) --- libexec/rtld-elf/riscv/reloc.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 8dd225e5a920..03d3c2d0c9ba 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -405,23 +405,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, lockstate); if (def == NULL) return (-1); - /* - * We lazily allocate offsets for static TLS as we - * see the first relocation that references the - * TLS block. This allows us to support (small - * amounts of) static TLS in dynamically loaded - * modules. If we run out of space, we generate an - * error. - */ - if (!defobj->tls_static) { - if (!allocate_tls_offset( - __DECONST(Obj_Entry *, defobj))) { - _rtld_error( - "%s: No space available for static " - "Thread Local Storage", obj->path); - return (-1); - } - } *where += (Elf_Addr)(def->st_value + rela->r_addend - TLS_DTV_OFFSET); From nobody Mon Dec 15 18:18:52 2025 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 4dVSxT1ryFz6L7Gh for ; Mon, 15 Dec 2025 18:18:53 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxS6Rd8z4LgL for ; Mon, 15 Dec 2025 18:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822732; 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=QsrsueAuIh+DRvqYPNVG6PQsEMqQXtzQvyFmcG+oAYw=; b=Vw7vrmcArby9O1U6bQy/3xy7inxYMVifuV7qqNPh5W6aRRn5GUCEzw2j6HI65qUjIpvPK0 ImP3cEZWZ063rzMxdQKD12R0aL9nR27cK4IlxqVsed5nqfItuIXBJI9GpdDNxKTqzqeHr4 1pKboaXOyvLlXzmVnv3tmX/ctpdxJcMzdYsd3LIat3pG3dShfbl48j2GaDiOYUbWO8jsu5 A91pcpnooJZ0mKJQgVBlLKzY1ZVedWg5hCZICvt43429X3Or/PU7OUvLbiOeBS3L4nMDrR H5WRjUbw1wOcFyzuua1S+t8cvyNnaBuLaVhbniCMgK+VTtcigaJ4C9YRgGz36w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822732; 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=QsrsueAuIh+DRvqYPNVG6PQsEMqQXtzQvyFmcG+oAYw=; b=uxJ8GqhLaN5QZYCQ/kTgu4DPmK2mTx/OBrrBYh5W6VmAyq0cSnvztKZX9gIu7j9nn3R53p I4gOmKE/M/nQSPd9m9ct4tcAdlJcCFo4ToEwvYcLEDNM87zSrkpaj9BEejyKCtlHyCJDMV b7peV9YXEf44ma+PboTbzw/fHBLm1Z4njf66j11UekvO9nW/ec+6IAjwoSDEBUN8ymh8wE 3qtULuu1dybpWSTp4VZbiSxix+WezdvQan//+vQWrYQQxYuUrw0abXgJYutUam2zbJNCa+ 99mm8mBXteku76wvI8xJm3kiNr4Geo9F60M5dQVRYS9m9593iVnNGH30KHNKCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822732; a=rsa-sha256; cv=none; b=Y4o1/5P90v3QY7AfkHvTogOKgSPhv7vn2yNucx0vthdaFlztxdZ2eKN0EPZl0F+Ma6CAHD 3K16JEjwanThK92b5V4Kh8neNmMWCRNvJDcuvmXhxTFAjohKwjlK61C5lhUjavYkMwmdnu ExBzUKihgG5w7cl6TFL7Jg3b7Rkgxs1SE+NGP2zbfD4Xf1qqAiAjwlwA/MwJFFWTlADb8s vMKrVlv5EbQGcFPVITTS57zb17/i1SvpJlBghFZSUwdR5rvFssjCEcHQTEbxnI7326HF/f hZEfbtIyOiHm7m5icts3mXJAWY/Kyz435mWvqizckVzcaVtKPssRNDRPluPg1g== 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 4dVSxS5KBKzWt6 for ; Mon, 15 Dec 2025 18:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 231f6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: cb48c371f277 - stable/13 - rtld-elf: Fix UB for direct exec with no extra rtld arguments 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb48c371f2770a33c7934bb0dc098fee76e28711 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:52 +0000 Message-Id: <6940510c.231f6.2bc039a@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=cb48c371f2770a33c7934bb0dc098fee76e28711 commit cb48c371f2770a33c7934bb0dc098fee76e28711 Author: Jessica Clarke AuthorDate: 2025-05-06 22:14:51 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 rtld-elf: Fix UB for direct exec with no extra rtld arguments If no extra rtld arguments are provided, rtld_argc will be 1 (for argv[0] and so we are shifting the entire memory range down by a single pointer. However, unlike argv and envp, auxp's entries are two pointers in size, not one, and so in this case the source and destination overlap, meaning simple assignment is UB (C99 6.5.16.1p3). On many architectures this ends up being harmless as the compiler will emit double machine word loads and stores, or if it splits them it may still schedule them such that it works in this case, but our RISC-V baseline does not include such instructions and LLVM ends up picking a schedule that copies the second word before the first word, thereby replacing the first word with a copy of the second word. This results in direct exec mode segfaulting on RISC-V when given no arguments. Fix this by using a temporary in the source and let the compiler safely elide its use. Reviewed by: kib Fixes: 0fc65b0ab82c ("Make ld-elf.so.1 directly executable.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50185 (cherry picked from commit 2b04ba6e08b983d8756552286846059507bca7a3) --- libexec/rtld-elf/rtld.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1cab00bb1c59..980f5c89edb7 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -510,7 +510,7 @@ rtld_trunc_page(uintptr_t x) func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) { - Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT]; + Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT], auxtmp; Objlist_Entry *entry; Obj_Entry *last_interposer, *obj, *preload_tail; const Elf_Phdr *phdr; @@ -675,7 +675,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) dbg("move aux from %p to %p", auxpf, aux); /* XXXKIB insert place for AT_EXECPATH if not present */ for (;; auxp++, auxpf++) { - *auxp = *auxpf; + /* + * NB: Use a temporary since *auxpf and + * *auxp overlap if rtld_argc is 1 + */ + auxtmp = *auxpf; + *auxp = auxtmp; if (auxp->a_type == AT_NULL) break; } From nobody Mon Dec 15 18:18:56 2025 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 4dVSxX6WX3z6L7Ps for ; Mon, 15 Dec 2025 18:18:56 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxX1R3Zz4Lgt for ; Mon, 15 Dec 2025 18:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822736; 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=hkl1VA2OEVBIQirpSAYmovVeMOD4jDx1jHfhp22Cc/Y=; b=HQU/4GFRkFx84d2gOOcyL2RjV/G9V1tzcQ9rVnXv1o2mVAPfpR1NuYEP0fGCLJ93rmE+oj S+vczcqexDAzPbzcq9P58rkRNC2i53XPMEGzBvvI0ykP23dIIPDePP2nw2P6y30nmg8DEG xtUfrDFaoAVTCvaPKtXcEN0dud6qYgINypwM+LY7tGootsoE5xn5o87z92MrQUBY78twi6 TXssFZyk4oxMBYzlVMDH0sGnYIxr5i6yW5dE+UhDR2pHYKH6lBWBmNPidRwaQw6/sjT0Ii COuvvjVLYk1psfFsykXpd73yuaeHkSvdQ0IMD/lgfKVQKkHZRnCrWknDBPxaHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822736; 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=hkl1VA2OEVBIQirpSAYmovVeMOD4jDx1jHfhp22Cc/Y=; b=DOF8CO5NZXqXSK1ZvZLpYsfpzMl0EEkl6eg+2mbsPUPF/fcxRJo6ZWO0cqqK/3ddorOKvI IYT2thCwhgYg6cte98H0cjfYYxpel2px+CZ2EOKtNbZyA1u4uVW0SL2659ohFcDJCmTeta C1r8aXxboNEQP1LjQFoN85pSPV+Hz8y7lQyoFffJ4Aeivt1RDuXH+Cny+5hE8+XGSmUrwJ jKTCXBpmV7h1pOxanbfTVry7EddmqDYWbNSh6FhXzBgh9CEroYtBPzadAGI0b1lc+eswOU p/vuLmZbZhIoP9N/1ekzKAHuiLfS9YJNksMQDtAazqtEMzWhzUn0pRPuP3yARA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822736; a=rsa-sha256; cv=none; b=gMARRde3OZismXsyarNHP2xfjSKBIcfGBx+goDvmc0xTmrPT0wev6cBUqmhhIdJDDg2wae 3Pbpop7gVoOdBgT6s84Yxwxk51FXkycrzHPFu1enieAXbM4cYnVjKpyFblRPBEWX159jyI rnfcNTr8lpcZhtcqDVCRNTjH6QI81wdQ5tZNjyV1JHEMybpjUlWWU0fUMZT3x6haD+z8z/ XEWP0U6mc/ikqZZzr8l79SWNz2AAsSNB3kBjLg6VZxYZjsH6Mv7Jei/e2xNDFSnzX8xpFL LK5+xxvpoX9dprgX2aCplOWy04GGMiu9+whDPygQEgkSub+VI8aLdV2RP/d2/g== 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 4dVSxX0vVgzWnG for ; Mon, 15 Dec 2025 18:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 237e9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: c668cd775b29 - stable/13 - libc/riscv: Fix initial exec TLS mode for dynamically loaded shared objects 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c668cd775b2964ca17e14be032c40f1a4ed77c45 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:56 +0000 Message-Id: <69405110.237e9.1b956d0d@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c668cd775b2964ca17e14be032c40f1a4ed77c45 commit c668cd775b2964ca17e14be032c40f1a4ed77c45 Author: Jessica Clarke AuthorDate: 2025-05-28 20:23:10 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 libc/riscv: Fix initial exec TLS mode for dynamically loaded shared objects The offset here is relative to the TCB, not whatever the thread pointer points to, so as with powerpc and powerpc64 we need to account for that. However, rather than using hard-coded offsets as they did, due to predating machine/tls.h, we can just re-use _tcb_get(). Note that if libthr is used, and its initialiser has been called, it will take a different path that uses _get_static_tls_base, which works just fine on riscv (adding the offset to thr->tcb). This only affects programs that aren't linked against libthr (or that are but manage to dlopen before the initialiser is called, if that's even possible). In future this code should be made MI by just reusing _tcb_get() and checking the TLS variant (since the offset here is positive even for variant II, where it should be subtracted), but this is a targeted fix that makes it clear what's changing. Reviewed by: kib Fixes: 5d00c5a6571c ("Fix initial exec TLS mode for dynamically loaded shared objects.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50564 (cherry picked from commit 0e3dbc64d9f6c95cbb16dba60a32136ae116dada) --- lib/libc/riscv/static_tls.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libc/riscv/static_tls.h b/lib/libc/riscv/static_tls.h index ce9fa23338a6..40e9abd685e3 100644 --- a/lib/libc/riscv/static_tls.h +++ b/lib/libc/riscv/static_tls.h @@ -31,12 +31,14 @@ #ifndef _LIBC_RISCV_STATIC_TLS_H #define _LIBC_RISCV_STATIC_TLS_H +#include + static __inline uintptr_t _libc_get_static_tls_base(size_t offset) { uintptr_t tlsbase; - __asm __volatile("mv %0, tp" : "=r"(tlsbase)); + tlsbase = (uintptr_t)_tcb_get(); tlsbase += offset; return (tlsbase); } From nobody Mon Dec 15 18:18:57 2025 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 4dVSxY4hjwz6L7Wx for ; Mon, 15 Dec 2025 18:18: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxY2SY2z4LdZ for ; Mon, 15 Dec 2025 18:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822737; 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=/q3vMK0hHe2tUiHHUC/IqLZ4JmpOFFVdLDRPBtSSQMM=; b=EKo+lMN8qIGzxXAVKy5WBo8KU2yfrRAVS2vjUQszRju4C3yZY1BrC+gQ6kanmRmtDuJaV8 EV1tpKri3WNuzom4QSkxNMxb5RrJORLQRcAqw3zHgh7excmJ80zztI1sEGUXuo+57r6ec2 wu0iXt3hBWwMnhsT/5LgZsMyIFK2+x2ZLKlcbbqhgv18GLrA4O9fmUMaSWMITHzODsEjCM vjqLPW+AP7fKRYC+p95XN7HuJUfCaFKd15buTdPDXWxMgdWCv6hfFzI0yHxbYFXU7mnEAE QQsNUc5ZEG3Zidyy/59tmXMpdDBD6xwLaUDR+qMUpfT5WW7BHrQgZjdT5+JgUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822737; 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=/q3vMK0hHe2tUiHHUC/IqLZ4JmpOFFVdLDRPBtSSQMM=; b=u/84uRVKk77uDhwDkpqNU5Agk+2v1R7+SWQ6JT+Mby/JyXkgevd3E3RTw7HTd+e8T5F0pE d55g91glrsMpeWLJqNw673M5iSzZxhvE9ny/x7Wql45WIPrnzxsxA/1qnqe5W3TR3m+6tK x4bew2sudazWSKwOM9+utlM3kRnglO3J42G3Pjcd1KQgytuMmWea0bl4a8QnK7GpWWhwKu 9f9JDHB3Job7pnXdrvAO35oLf4oOEXMf+/ham0rX9BbVY80fUE6SVBulRzk1Tg0WkzlMm7 BqXMom70D/MvHx92ZysICLErlw4Ti1o7Nzil30uh8JXyF/xQ2wk9WBWEhsMv9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822737; a=rsa-sha256; cv=none; b=vNTt6BmUjsuVJyr4VzLtJZlM3vMxTsAn/2PP+v3IM8z5FgBzLlqzbSKj48/Bo8tQKO5hFB D94W3+fKOQL1kStrnhTcS2S4ayLjhIHKRTfubgv9bc66UE3cKt/APgJsIsEXu1FY4q6RMc 5NFPKD975H/PhNvQAU5OlBCN4m4ZfDVVw2HPZVUWlzRRX3skaruDtMYuUxHvHqZnSlSm4N +Nn8KuifGWjq+oxPJwKGXOboQ0SPnuveHu/zDThU1e+3y0AIGXB7js3GkgQxtNri+Hfq14 Iu9QSNBu6CIYL1mx3+kwjXM3PPWftUO7P2/we5jzvDG8VM8a6cshyLEku7DZeQ== 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 4dVSxY21mWzWdw for ; Mon, 15 Dec 2025 18:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24d7c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 749af7d9d89f - stable/13 - Revert "rtld: fix allocate_module_tls() variant I fallback to static allocation" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 749af7d9d89f45057357c8f10cf836007e13c3ba Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:57 +0000 Message-Id: <69405111.24d7c.73495192@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=749af7d9d89f45057357c8f10cf836007e13c3ba commit 749af7d9d89f45057357c8f10cf836007e13c3ba Author: Jessica Clarke AuthorDate: 2025-05-28 20:24:52 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 Revert "rtld: fix allocate_module_tls() variant I fallback to static allocation" This was applying a NetBSD fix to FreeBSD. However, the original code was correct for FreeBSD. NetBSD's obj->tlsoffset is relative to the end of the TCB, not the TCB itself, whilst ours is relative to the TCB[1] itself. For example, our allocate_tls uses (char *)tcb + obj->tlsoffset for the memcpy and memset calls. Without this reverted, for dynamically loaded shared objects, Initial Exec accesses to TLS variables on variant I architectures (non-x86) use the correct address, whilst General Dynamic and dlsym(3) use the incorrect address (TLS_TCB_SIZE past the start). Note that, on arm64, LLVM only supports TLSDESC (including LLD) and TLSDESC will use the static resolver if the variable ends up allocated to the static TLS block, even in the presence of dlopen(3), so only dlsym(3) shows the discrepancy there. Whilst here, add a comment to explain this difference to try and avoid the same mistake being made in future. [1] In the case of variant II, it's the amount to subtract, so still positive This reverts commit e9a38ed2fa61fd264a80f24ceb35f39b0ac6463d. Reviewed by: kib (prior version) Fixes: e9a38ed2fa61 ("rtld: fix allocate_module_tls() variant I fallback to static allocation") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50565 (cherry picked from commit ccfb1c50e45dbb7fcadf7e1932f63cf1702ef13a) --- libexec/rtld-elf/rtld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 9725dcdd805f..7ebef4ef2444 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5350,6 +5350,9 @@ get_tls_block_ptr(void *tcb, size_t tcbsize) * it is based on tls_last_offset, and TLS offsets here are really TCB * offsets, whereas libc's tls_static_space is just the executable's static * TLS segment. + * + * NB: This differs from NetBSD's ld.elf_so, where TLS offsets are relative to + * the end of the TCB. */ void * allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) @@ -5584,7 +5587,7 @@ allocate_module_tls(int index) if (obj->tls_static) { #ifdef TLS_VARIANT_I - p = (char *)_tcb_get() + obj->tlsoffset + TLS_TCB_SIZE; + p = (char *)_tcb_get() + obj->tlsoffset; #else p = (char *)_tcb_get() - obj->tlsoffset; #endif From nobody Mon Dec 15 18:18:58 2025 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 4dVSxb0cvVz6L7SM for ; Mon, 15 Dec 2025 18:18:59 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxZ3hbJz4LWC for ; Mon, 15 Dec 2025 18:18:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822738; 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=kErvCvlM3lDBKa6qMnOohnAeokL8v751xHvZsxxNwYU=; b=vG5tg/mL1lSmQzmjVIk+FSXA/dhbbU8pEDBgmJAsDP8gfGysrPU0cuQR2sETJ2JZ2q61Ke iRMfeF+Y4QM30ArNBPnNzKau50rTmZoZFie4TkzfLg6gmCcPk1+nuLRZOypmvxCLwknnN0 WM4p7p9q+rqOVUomGQN9omUlzTnhN6td4OEHR1LGK+D+R3KSttYmL+8zh/w6xZOH4j6Jh1 33g/qPJN2bD4yALFKvGxwHnjGbjwDNBL26pbwdWyFmHubKkDs/HZSxC9VMmxBAg6KQ9sr5 cYlkwmKoDU6HrUlWJMdkOgZnsyg191eBU8qjgdhFgUsk81mpEv2zRZ0QN+FDKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822738; 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=kErvCvlM3lDBKa6qMnOohnAeokL8v751xHvZsxxNwYU=; b=RRy+4xVpxRVB5Q3susOGFMjG7PKQbxb1Bo5tRtv/QRySR3irheAmbUJh1UKAaSMS8otd7U gj47rICykV0+8uOd3kAMICAXZBMH81sQ64vrl/R9k+Qsm0wB00v16QnmYJZiJOa4wqVesS aTJcrRtWJK4XdxuXuzbY0ASpwCK121PCV5BCCBv9WgYkeH84JWcVyJHUwVBZpVr2im2vXo TMUthw46TGEkN95YX41I0mLoYFTdQc+SxhITLuIkEYLiHjbKvCymPMh68hd2dm7ZUxPGsc YTWno385f/aT91U5Yd1F0zJEaOp4wJzqBpLX0zUIhTdWlvQ2OKeyIqvfHmKvGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822738; a=rsa-sha256; cv=none; b=uwdD4Thgiz4RYDomhCV+0rY9PnDcJG9ok4wOXwh6FkLc1t7PzRmnuhKd0wp8f35aN87I1t cBt7UZPFWANhe/9DpD8LJYS1i0pK0ZX3Tp9G2wQV9urXtULys3K1WETlDPMrWvWjqEMwEb 5IZyYaNjx+oJmrUkvGP9qnuv6grCCnfge35ZVRJUXxi2vrwWcyp5/i8f2FrM0Hgk0d9Q5+ LJsALDT1gojkYeapLU6JDjfpcr4+YAS8lohSXKmjBwB1AZBiwyMOqZTkG7O9dl1/C3O9IK JlveZe8NrGt4vxCUCOviWiecaBY30Iy+NYGgrHe1PGOvwCUQ1vuABm2xuGVJjw== 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 4dVSxZ31RtzWbS for ; Mon, 15 Dec 2025 18:18:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25759 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: ec80f8a3ada0 - stable/13 - share: Delete bitrotted make_*_driver.sh scripts 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ec80f8a3ada0d35f364ca0136cb8518f98750ce8 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:58 +0000 Message-Id: <69405112.25759.1fd2b3f6@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ec80f8a3ada0d35f364ca0136cb8518f98750ce8 commit ec80f8a3ada0d35f364ca0136cb8518f98750ce8 Author: Jessica Clarke AuthorDate: 2025-07-10 19:36:08 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 share: Delete bitrotted make_*_driver.sh scripts These scripts have not seen the necessary changes to keep them up to date with current KPIs and coding practices. They use I/O ports directly rather than any bus abstractions, use i386 (which is on the way out for kernel configs) as the architecture of choice for generated kernel configs, use ISA KPIs, use INTR_TYPE_FAST (renamed in 2000 to INTR_FAST and removed in 2011), and likely have other issues too that render them more harm than good for the uninitiated developer looking for a driver template. If anyone wants to invest time in modernising them they can do so and bring them back, but for now delete them. Reviewed by: cperciva, imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50468 (cherry picked from commit 8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf) --- ObsoleteFiles.inc | 6 + share/examples/Makefile | 7 - share/examples/drivers/README | 42 --- share/examples/drivers/make_pseudo_driver.sh | 435 --------------------------- tools/build/mk/OptionalObsoleteFiles.inc | 4 - 5 files changed, 6 insertions(+), 488 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index e7d6f4db8515..a897879d2bbf 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -60,6 +60,12 @@ OLD_FILES+=usr/share/man/man3/quota_statfs.3.gz # 20250805: Test case renamed OLD_FILES+=usr/tests/usr.bin/xargs/regress.n2147483647.out +# 20250710: share: Delete bitrotted make_*_driver.sh scripts +OLD_FILES+=usr/share/examples/drivers/README +OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh +OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh +OLD_DIRS+=usr/share/examples/drivers + # 20250524: don't install zoneinfo version OLD_FILES+=usr/share/zoneinfo/version diff --git a/share/examples/Makefile b/share/examples/Makefile index 8295c990f83e..2bd51be2a37d 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -12,7 +12,6 @@ LDIRS= BSD_daemon \ bootforth \ csh \ diskless \ - drivers \ etc \ find_interface \ flua \ @@ -81,12 +80,6 @@ SE_DISKLESS= \ README.TEMPLATING \ clone_root -SE_DIRS+= drivers -SE_DRIVERS= \ - README \ - make_device_driver.sh \ - make_pseudo_driver.sh - SE_DIRS+= etc SE_ETC= \ README.examples \ diff --git a/share/examples/drivers/README b/share/examples/drivers/README deleted file mode 100644 index 8628029a62f8..000000000000 --- a/share/examples/drivers/README +++ /dev/null @@ -1,42 +0,0 @@ - -Author: Julian Elischer - -The files in this directory are shell scripts. - -They will, when run, create an example skeleton driver -for you. You can use this driver as a starting point for -writing drivers for your own devices. They have all the hooks needed -for initialization, probing, attaching, as well as DEVFS -node creation. They also create sample ioctl commands and a sample -ioctl definition .h file in /sys/sys. In other words they are fully -functional in a 'skeleton' sort of a way. They support multiple devices -so that you may have several of your 'foobar' devices probed and attached -at once. - -I expect that these scripts will improve with time. - -At present these scripts also link the newly created driver into -the kernel sources in /sys. Possibly a better way would be -to make them interactive. (and ask what kernel tree to use as well as -a name for the driver.). - -There are presently two scripts. -One for making a real device driver for ISA devices, and -one for making a device driver for pseudo devices (e.g. /dev/null). -Hopefully they will be joined by similar scripts for creating -skeletons for PCI devices as well. - -Give them a single argument: the name of the driver. -They will use this given name in many places within the driver, -both in lower and upper case form. (conforming to normal usage). - -The skeleton driver should already link with the kernel -and in fact the shell script will compile a kernel with the new -drive linked in.. The new kernel should still be -runnable and the new driver should be -fully callable (once you get your device to probe). -You should simply edit the driver and continue to use -'make' (as done in the script) until your driver does what you want. - -The driver will end up in /sys/i386/isa for the device driver script, -and in /sys/dev for the pseudo driver script. diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh deleted file mode 100644 index 5d6d09aa9648..000000000000 --- a/share/examples/drivers/make_pseudo_driver.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/sh -# This writes a skeleton driver and puts it into the kernel tree for you -# -# arg1 is lowercase "foo" -# arg2 path to the kernel sources, "/sys" if omitted -# -# Trust me, RUN THIS SCRIPT :) -# -# -#-------cut here------------------ - -if [ "${1}X" = "X" ] -then - echo "Hey , how about some help here.. give me a device name!" - exit 1 -fi -if [ "X${2}" = "X" ]; then - TOP=`cd /sys; pwd -P` - echo "Using ${TOP} as the path to the kernel sources!" -else - TOP=${2} -fi - -for i in "" "conf" "i386" "i386/conf" "dev" "sys" "modules" -do - if [ -d ${TOP}/${i} ] - then - continue - fi - echo "${TOP}/${i}: no such directory." - echo "Please, correct the error and try again." - exit 1 -done - -UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"` - -if [ -d ${TOP}/modules/${1} ]; then - echo "There appears to already be a module called ${1}" - echo -n "Should it be overwritten? [Y]" - read VAL - if [ "-z" "$VAL" ]; then - VAL=YES - fi - case ${VAL} in - [yY]*) - echo "Cleaning up from prior runs" - rm -rf ${TOP}/dev/${1} - rm -rf ${TOP}/modules/${1} - rm ${TOP}/conf/files.${UPPER} - rm ${TOP}/i386/conf/${UPPER} - rm ${TOP}/sys/${1}io.h - ;; - *) - exit 1 - ;; - esac -fi - -echo "The following files will be created:" -echo ${TOP}/modules/${1} -echo ${TOP}/conf/files.${UPPER} -echo ${TOP}/i386/conf/${UPPER} -echo ${TOP}/dev/${1} -echo ${TOP}/dev/${1}/${1}.c -echo ${TOP}/sys/${1}io.h -echo ${TOP}/modules/${1} -echo ${TOP}/modules/${1}/Makefile - -mkdir ${TOP}/modules/${1} - -cat >${TOP}/conf/files.${UPPER} <${TOP}/i386/conf/${UPPER} <${TOP}/dev/${1}/${1}.c < -#include -#include /* SYSINIT stuff */ -#include /* SYSINIT stuff */ -#include /* cdevsw stuff */ -#include /* malloc region definitions */ -#include -#include /* ${1} IOCTL definitions */ - -#include /* DELAY() */ - -#define N${UPPER} 3 /* defines number of instances */ - -/* XXX These should be defined in terms of bus-space ops. */ -#define ${UPPER}_INB(port) inb(port) -#define ${UPPER}_OUTB(port, val) (port, (val)) - -/* Function prototypes (these should all be static) */ -static d_open_t ${1}open; -static d_close_t ${1}close; -static d_read_t ${1}read; -static d_write_t ${1}write; -static d_ioctl_t ${1}ioctl; -static d_mmap_t ${1}mmap; -static d_poll_t ${1}poll; - -#define CDEV_MAJOR 20 -static struct cdevsw ${1}_cdevsw = { - .d_version = D_VERSION, - .d_open = ${1}open, - .d_close = ${1}close, - .d_read = ${1}read, - .d_write = ${1}write, - .d_ioctl = ${1}ioctl, - .d_poll = ${1}poll, - .d_mmap = ${1}mmap, - .d_name = "${1}", -}; - -/* - * device specific Misc defines - */ -#define BUFFERSIZE 1024 -#define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */ - -/* - * One of these per allocated device - */ -struct ${1}_softc { - u_long iobase; - char buffer[BUFFERSIZE]; - struct cdev *dev; -}; - -typedef struct ${1}_softc *sc_p; - -static sc_p sca[N${UPPER}]; - -/* - * Macro to check that the unit number is valid - * Often this isn't needed as once the open() is performed, - * the unit number is pretty much safe.. The exception would be if we - * implemented devices that could "go away". in which case all these routines - * would be wise to check the number, DIAGNOSTIC or not. - */ -#define CHECKUNIT(RETVAL) \ -do { /* the do-while is a safe way to do this grouping */ \ - if (unit > N${UPPER}) { \ - printf("%s: bad unit %d\n", __func__, unit); \ - return (RETVAL); \ - } \ - if (scp == NULL) { \ - printf("%s: unit %d not attached\n", __func__, unit); \ - return (RETVAL); \ - } \ -} while (0) - -#ifdef DIAGNOSTIC -#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL) -#else /* DIAGNOSTIC */ -#define CHECKUNIT_DIAG(RETVAL) -#endif /* DIAGNOSTIC */ - -static int -${1}ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - switch (cmd) { - case DHIOCRESET: - /* whatever resets it */ - (void)scp; /* Delete this line after using scp. */ -#if 0 - ${UPPER}_OUTB(scp->iobase, 0xff); -#endif - break; - default: - return ENXIO; - } - return (0); -} - -/* - * You also need read, write, open, close routines. - * This should get you started - */ -static int -${1}open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}read(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int toread; - - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * read from buffer - */ - toread = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, toread, uio)); -} - -static int -${1}write(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int towrite; - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * write to buffer - */ - towrite = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, towrite, uio)); -} - -static int -${1}mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(-1); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ -#if 0 /* if we had a frame buffer or whatever.. do this */ - if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) { - return (-1); - } - return i386_btop((FRAMEBASE + offset)); -#else - return (-1); -#endif -} - -static int -${1}poll(struct cdev *dev, int which, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); /* this is the wrong value I'm sure */ -} - -/* - * Now for some driver initialisation. - * Occurs ONCE during boot (very early). - */ -static void -${1}_drvinit(void *unused) -{ - int unit; - sc_p scp; - - for (unit = 0; unit < N${UPPER}; unit++) { - /* - * Allocate storage for this instance . - */ - scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT | M_ZERO); - if( scp == NULL) { - printf("${1}%d failed to allocate strorage\n", unit); - return; - } - sca[unit] = scp; - scp->dev = make_dev(&${1}_cdevsw, unit, - UID_ROOT, GID_KMEM, 0640, "${1}%d", unit); - } -} - -SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR, - ${1}_drvinit, NULL); -DONE - -cat >${TOP}/sys/${1}io.h < -#endif -#include - -/* - * define an ioctl here - */ -#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */ -#endif -DONE - -if [ ! -d ${TOP}/modules/${1} ]; then - mkdir -p ${TOP}/modules/${1} -fi - -cat >${TOP}/modules/${1}/Makefile < -DONE - -echo -n "Do you want to build the '${1}' module? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - (cd ${TOP}/modules/${1}; make depend; make ) - ;; -*) -# exit - ;; -esac - -echo "" -echo -n "Do you want to build the '${UPPER}' kernel? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - ( - cd ${TOP}/i386/conf; \ - config ${UPPER}; \ - cd ${TOP}/i386/compile/${UPPER}; \ - make depend; \ - make; \ - ) - ;; -*) -# exit - ;; -esac - -#--------------end of script--------------- -# -#edit to your taste.. -# -# diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 256fbc4e56f1..b79dde1dd41f 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1846,9 +1846,6 @@ OLD_FILES+=usr/share/examples/diskless/README.BOOTP OLD_FILES+=usr/share/examples/diskless/README.TEMPLATING OLD_FILES+=usr/share/examples/diskless/clone_root OLD_FILES+=usr/share/examples/dma/mailer.conf -OLD_FILES+=usr/share/examples/drivers/README -OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh -OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh OLD_FILES+=usr/share/examples/dwatch/profile_template OLD_FILES+=usr/share/examples/etc/README.examples OLD_FILES+=usr/share/examples/etc/bsd-style-copyright @@ -2067,7 +2064,6 @@ OLD_DIRS+=usr/share/examples/bsdconfig OLD_DIRS+=usr/share/examples/csh OLD_DIRS+=usr/share/examples/diskless OLD_DIRS+=usr/share/examples/dma -OLD_DIRS+=usr/share/examples/drivers OLD_DIRS+=usr/share/examples/dwatch OLD_DIRS+=usr/share/examples/etc OLD_DIRS+=usr/share/examples/etc/defaults From nobody Mon Dec 15 18:19:00 2025 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 4dVSxd1zt2z6L7ST for ; Mon, 15 Dec 2025 18:19:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxc57V9z4LYm for ; Mon, 15 Dec 2025 18:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822740; 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=qSQjSJ3L6oqhLVdn3xPbl7myKLUnskzFwn2jAL25jLM=; b=PAJm/Vxe4P6csq7gU1ZOAQy7Gco5s+AakwL0wm2KjWdw+q+E5X1tERebI509VBniqFfx+Y QR7oel8sQ3io2aD2yQb0jVGSb+HX1J2bIqIHpP5QHuO2vc08cRQk+pvZdOeWCvRnP6AraG TJDr7VkkMAwTn0LwlAs2DFCQfyUZo6SBB5hH4AkKM6qUrgtOyuJmRh2PbvqWezXTogGJ77 kJhY7zThsY1Dq9kMaDr3g0jTv/pDFY6wV6eMG+Jw8ldLhlR1CvRzeVb/gy4mSy8NB7nUci qNKePGSrTQ35UK/6uBavofebDgGxOx5YCtzdDQwFuk5LiaYZobSPVgzOvj7UHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822740; 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=qSQjSJ3L6oqhLVdn3xPbl7myKLUnskzFwn2jAL25jLM=; b=XnabQE+yfgJiIo/s81rkMLqbs3ol5iII4fMPqnlJgfVxkjvsW76uwmbtyRBxaUMWB1vpDl jeM4mgJywYonu4ANxW6R95T6ikWg7Jes+Z3Q+F/r8wOKMfnnjGarH/dQP2jO3HdCsFuish zG+GvsOfRqtXX6198SbQCg6H/HkmxiBPdpuNHUsK9y3pOrwQnzexBbv4Tpu7SdgIV+upXM rfW17vuzm6QZkwvQMVXQuauFXMZ1piv0PHsbFeSk1T4jnoBcEg+pKlDwb/6oeskSdPJrAV aQVaWQ6kdOR+nVuhHT5XmVLfRnvFLMFQRi0Cb2npbh/VQFh8jEnvtScptzTKZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822740; a=rsa-sha256; cv=none; b=xh37PgrvL/4aqI3i8jM86A0pduZDVE9+vXM8Mm/asnni0IX7jdw2PL5LZwehbyR0OZSMqw NE8Qn4XQyAb5t6Vq20lCGR6kWxqkIZPAduBvYVf/cdKAXijKyGJ5nut2cZJqymBlw2Dlsd srGhlkEUTh9YZwFW4vPTq3qhrSbbzAyvA5fmX3sNBQ10zsT5WZZ0wRNjsrH110UDwOiVrr v4kZGwyoq/76rmDglbtVuvr0sEt4z0Sv3fo+RC7muPpl+FGIm0qvhPxieS0S49eqq4Gqtk vuz1tbyKmie5whwTh92jXBwLaSI2TXNHHge3tj599+JgO5iF/tcbMVi3hUKWmA== 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 4dVSxc4XkKzWZX for ; Mon, 15 Dec 2025 18:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 237f0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 275e5537486c - stable/13 - elf: Remove R_RISCV_[GT]PREL_[IS] relocation defines 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 275e5537486c60254f83217cc3b13cf23e41b0a6 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:00 +0000 Message-Id: <69405114.237f0.5b22772a@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=275e5537486c60254f83217cc3b13cf23e41b0a6 commit 275e5537486c60254f83217cc3b13cf23e41b0a6 Author: Jessica Clarke AuthorDate: 2021-07-20 05:13:43 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 elf: Remove R_RISCV_[GT]PREL_[IS] relocation defines These were internal binutils relocations that have no way to be generated in assembly nor will ever be seen in the output, and so should never have been defined in the psABI in the first place. They have therefore been removed from the spec as of [1], so do so here too. [1] https://github.com/riscv/riscv-elf-psabi-doc/commit/44f98e0fd8104def00f2a5a8d94b23dd647d18fb (cherry picked from commit f221000127767d33ea06d3a00e731c0164f9a70f) --- sys/sys/elf_common.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index c7207956d9dc..663f7f0aece2 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1364,10 +1364,6 @@ typedef struct { #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 #define R_RISCV_RVC_LUI 46 -#define R_RISCV_GPREL_I 47 -#define R_RISCV_GPREL_S 48 -#define R_RISCV_TPREL_I 49 -#define R_RISCV_TPREL_S 50 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 From nobody Mon Dec 15 18:19:01 2025 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 4dVSxf22VYz6L7V5 for ; Mon, 15 Dec 2025 18:19:02 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxd5YXHz4LlB for ; Mon, 15 Dec 2025 18:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822741; 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=qN1v88QavP5VJhnm4SllSeFH7ULcCaHi56C3dt73zaU=; b=BhDLuiwn4hakj7pcHRG/fw0/yaDQHAs5NbGHpD1FcGpG2IymjO0wIwlYiwdBcWjCC43cWB n3t8cEZ3u8sd2fThSugXxnirQhQ9rp4IwIW2CFwZXDT61mQt6Lw7HqoLspMrgSVOpm14OP yDy3lOzTeQNDBEqLyrSuDrUNFq7LQk2xfXBZAD0n8fxqgo6HyFlKOP33w9Jau9m1cyIU7k A2hlqpF9ohZZxIsMG8JLmjIA5EdQwWIvAUXQwKkWgUGKTLWgJuztjpzA2kW854Ib8lKHeh 6laiSGapm4MVfIL71sxZChPLjaUXM471xuLRAqZ2NrKb6w8LK/I1pX5yjF9SOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822741; 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=qN1v88QavP5VJhnm4SllSeFH7ULcCaHi56C3dt73zaU=; b=LHwj2pmSJdEPAjaWzp/MA5ZwZ0Pct+CPa9L7CsoREbNWP1O5Uyf6Em2wy+/4qErMju4WuH 677wpbldaMIF7D0XDPJAEFbq5hLA5xE94y8g3/Ubh7j/pxm98JnFukGY32rWTkdS3vEYvy OuBUAm55GmuAF4gFpx7A77WtYrmwyQANsKixsumkdbE9QnhdDO4AtHNp2Qk6kC+eTgh959 NzTk+VVPcIZF9xydoTKG+eZVBLR326I6C+b6vZENb+yT+Px25gmD0XoTrNSCUuQw/nN+6I TfHMpNW1tVZXzmkN7xkLp9uccW2G7Mcyxl4JVU/wMQUQo56tw5yRgMZHUpHRfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822741; a=rsa-sha256; cv=none; b=dZxVt3/k5UZxf1PWc7szwgcneNbkGcKxrZ2RSD7YwkI7Yk7EH8f6pIVPCN5RlmQjOoOJFK YgDuMMv25rTcvD327nm5FJLKoXvh6A6BuIG1jpvhl4QlY5NPcWa9vCpIvrWvvjII6SZuAt iAJUzw1degihiOfLXAxYWqeIHloHiQKDj5w/XSITjGVAItq1V6Jh4FHZGNMmPXRegJL1K/ v1u6yWY2zuW+FEXtfkt22sVqHLRachEbUvjggeWZqhOcR4sbbQvMTXBlNhCTgOEnMm699U lAZO5sVThupXaTrE0CTikk9cFbt4qTNluNP3TD6VvgAHenYnTE5MRu2jEMo5pA== 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 4dVSxd594zzWbT for ; Mon, 15 Dec 2025 18:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26380 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 7a41a7442ae4 - stable/13 - sys: Sync RISC-V relocations 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a41a7442ae4e7efb6aaf03f02ea4ee56a5695f6 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:01 +0000 Message-Id: <69405115.26380.2a2e94f@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7a41a7442ae4e7efb6aaf03f02ea4ee56a5695f6 commit 7a41a7442ae4e7efb6aaf03f02ea4ee56a5695f6 Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 sys: Sync RISC-V relocations MFC after: 1 week (cherry picked from commit 65bd6c7acd1fba38ce0b234d5d777a2ebad7e807) --- sys/sys/elf_common.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 663f7f0aece2..c9cf5e5c2ce6 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1335,6 +1335,7 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 +#define R_RISCV_TLSDESC 12 #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 @@ -1360,10 +1361,10 @@ typedef struct { #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 +#define R_RISCV_GOT32_PCREL 41 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 -#define R_RISCV_RVC_LUI 46 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 @@ -1372,6 +1373,14 @@ typedef struct { #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 #define R_RISCV_IRELATIVE 58 +#define R_RISCV_PLT32 59 +#define R_RISCV_SET_ULEB128 60 +#define R_RISCV_SUB_ULEB128 61 +#define R_RISCV_TLSDESC_HI20 62 +#define R_RISCV_TLSDESC_LOAD_LO12 63 +#define R_RISCV_TLSDESC_ADD_LO12 64 +#define R_RISCV_TLSDESC_CALL 65 +#define R_RISCV_VENDOR 191 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From nobody Mon Dec 15 18:18:59 2025 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 4dVSxc2GVyz6L7Py for ; Mon, 15 Dec 2025 18:19:00 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxb4BFyz4Ldt for ; Mon, 15 Dec 2025 18:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822739; 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=HDdUMiy8M/QSwwSIjfr5RWPtIKAwKEAqPMsU5fIkxpI=; b=O47QMawxeavK+S7hwVkR6GGH4Y3Do8fwi1d1Hc1zz/j8xuF1+latXTp/k20zrP19OXbQTN j2/oMYic6Uiz4gN5WZRIphqOHtP+PEZwW77Zuu9DBA7rztrRdNeellCESIoj6cqpa1FUuS hRzGo6o1KmXt1LRhhh4hQ7Vt7hGAvUod6IcQSdnSkVbSqX4Lvu458CugoVwCUR7lVAM8IG Otb5B5s7dFs4RwQOBbOLQpuHO5/qUi4brduPtgbbvpvWoqa95VBmBHACc5EeCcNvW8AqTH XuigMthjVNLtlVATqajg6j2JCTEBN0BTL2Fwl3tqhvcdU5Jp5ITuHrw/5+Sitg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822739; 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=HDdUMiy8M/QSwwSIjfr5RWPtIKAwKEAqPMsU5fIkxpI=; b=C/s3w+qD96O+YMo6q5t2f7qGIbWWdeo74wLVjxR/asn7uo481ru5Mtibv6Aeggm95nuy9K cfr5zDJ0/+TSXVmiZdyIZGStitLsKyfHfMFULagUGUjbmhEQ0zmupcK14Ogs5EyopeHzsz eINgh1CVWT0x/JJfx39NJQ6Mg6M20mye7C4tc3CDVl/aBf19VeQlJTtny2YPe/9npX2Zo4 ZhP7ouvrIt+IrzcJ2czk8l2+tsBDUmy8B1C44Vr1/YGHR9qN8TSxThrV+WOmjBa416A1b1 zfaU9/kJ6PQoLwrmB9rXQltLl0qVIPJk7wxZ2MG4tfwxenZk6SsO65lLduZ0Dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822739; a=rsa-sha256; cv=none; b=Q9nAng7Tp2e4klwtCLvKlrI/ZC4xstB5pLTBKMQ9Q9FbigegS4bUVtBVankiDPYmY35Dnu vo5ToFGsMSGV/i2j3msWMMy/voWqRgWg/emrCWGyvJn78OB3KxysfoUNQNy9XqbGPpqw3j 9T7s+2YHXLLW0BzePlSgPd14pJtpHWlG2UAXCQeQRQdwAeJzPKZ7bY1iUDhRtfLx/p1jtZ m9t1zEcoVJ/MaBpPs+SsawPu8Qu0ZcsrPxQXEQGSBJnRe2A6HcVQoOy1PrFn6fINiwf4mF 1PsVTIAPwZVqL2nTwvK1eiPfLunmEQ3guvqc/atc1kFDz+jRC025umOYZmWu+A== 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 4dVSxb3mDczWt7 for ; Mon, 15 Dec 2025 18:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25bb4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:18:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 205f65bcdd91 - stable/13 - sys: Delete stale comments in sys/elf_common.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 205f65bcdd91de9bd6d1cfdf0626430897633d8a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:18:59 +0000 Message-Id: <69405113.25bb4.6f121b30@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=205f65bcdd91de9bd6d1cfdf0626430897633d8a commit 205f65bcdd91de9bd6d1cfdf0626430897633d8a Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:36 +0000 sys: Delete stale comments in sys/elf_common.h Originally the relocations for RISC-V were partitioned into dynamic and static (with those that are both being classed as dynamic), but they were packed next to each other, and so as new relocations were added they were allocated sequentially, at the end of the static block, even if really dynamic, R_RISCV_IRELATIVE being the first such case (and only one we currently have a definition for). Delete the misleading comments. Fixes: 4b88ccbc79cc ("Sync relocation definitions") MFC after: 1 week (cherry picked from commit d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c) --- sys/sys/elf_common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index fa85396b02df..c7207956d9dc 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1323,7 +1323,6 @@ typedef struct { * RISC-V relocation types. */ -/* Relocation types used by the dynamic linker. */ #define R_RISCV_NONE 0 #define R_RISCV_32 1 #define R_RISCV_64 2 @@ -1336,8 +1335,6 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 - -/* Relocation types not used by the dynamic linker. */ #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 From nobody Mon Dec 15 18:19:02 2025 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 4dVSxg2Qt0z6L7gF for ; Mon, 15 Dec 2025 18:19:03 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxf68v4z4LnQ for ; Mon, 15 Dec 2025 18:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822742; 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=NE44yfHyDoiQpJNSqfPeOAGUzwRYzT6fhME0PmGNirM=; b=LkClGJ1zud5brgccAcykRIiGjPBMo4DjFov1dGiw8B0SDJb0RNgJjJ/QssgPq5nhA0KJDb iXv7xfxbkTdEeGV210tRutlfepFGBSiVgtWpIOzW52ZWg3wbamjXhlTqxII1jzwenw9r76 auaZ4c9hlRxLfyE+RPJjGECqSS8gIthGZBTU24YOCizw632EPwLhSYKtZibH6zwokXD7aT SSbMzWvwkL9E5vRAL73qxpb7NZt6hyGRA+/DoTC0ymEJ+0pcdjCepT7145PKvQe0lBmoyi d0STlLg7LEvbWYf3B1qnKMc1OZG/wEiSOQf1nsE/xyOH451tayucX8L0OMwcnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822742; 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=NE44yfHyDoiQpJNSqfPeOAGUzwRYzT6fhME0PmGNirM=; b=QJIV3nBvBq67Qc/E4otmsTgUYGsLt8S+dHBGwcVQ9GeFnVGZxUByjhI8WGDp3BaxTBo/HO /7zXG1amHbRKfAtZzov+bOzkLGtpz9OVrVNdlH3zthyyxao6Le1XY4IzRCH26dQT4dZzvx KfiqJHZLJ0aw3TQWxRlPD4GHzAAlPuSPLQl97g7VhMEw+I949xX71VC7IkAjDHQc7VMMtN bvYywVtsdjir8FGac5sCaawAeoE55lbwx7qqXoogxnxFv5U9Qua5e2kyc5d0zZtdZK9hhq Enop5Felufdg59YOkB4jH8KNd5pOwe6FrFKUhz77Am9WPJA4ZuV4RnTGc2LEOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822742; a=rsa-sha256; cv=none; b=SGS6Wi4j2tFIygVBrZyfbrcSvd0VSq1Yj/xwraPhNUPAZByAPpXIksWDY+BbGJpdEWKq9Y HxVIpXC2RD1aGzrY7yNc94Kvb70xzc5disd0GgeEOKQg4wsugJx7JoN5HiCajIilW4gReN cWie/pXZ/4Vatik0lgMn/QQCjsdTxbeufCXZiUa+I/EGEZ8B1PajLtgS3HExu3yOxuNiec nAlTyA4TiEF2UuMRi+L8baO2L4Ww/X27LHSTQFo+NoFzxjoFTM3GhD9VpqVN2FxH6V4pJE UgVM9cCkawk0OYuG0ypcmPTw2XXmlTw3snrP5o85d2LHqyU9Zn6qRKhMrGQDFA== 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 4dVSxf5fT0zWt9 for ; Mon, 15 Dec 2025 18:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 254b5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: cb891745397b - stable/13 - sys: Various whitespace style(9) fixes for sys/elf_common.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb891745397b08f91951d2017f093bb811ef708a Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:02 +0000 Message-Id: <69405116.254b5.2556f346@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=cb891745397b08f91951d2017f093bb811ef708a commit cb891745397b08f91951d2017f093bb811ef708a Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:07 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 sys: Various whitespace style(9) fixes for sys/elf_common.h MFC after: 1 week (cherry picked from commit 22ae840b9f0ff290cb08edacf975a99d264d3a0d) --- sys/sys/elf_common.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index c9cf5e5c2ce6..5618ebe76d36 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -449,12 +449,12 @@ typedef struct { #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_X86_64_UNWIND 0x70000001 /* unwind information */ -#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND +#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND #define SHT_ARM_EXIDX 0x70000001 /* Exception index table. */ -#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking +#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking pre-emption map. */ -#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility +#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility attributes. */ #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details. */ #define SHT_ARM_OVERLAYSECTION 0x70000005 /* See DBGOVL for details. */ @@ -769,7 +769,7 @@ typedef struct { #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ -#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ #define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ @@ -882,7 +882,7 @@ typedef struct { #define STV_ELIMINATE 0x6 /* Architecture specific data - st_other */ -#define STO_AARCH64_VARIANT_PCS 0x80 +#define STO_AARCH64_VARIANT_PCS 0x80 /* Special symbol table indexes. */ #define STN_UNDEF 0 /* Undefined symbol index. */ @@ -1055,11 +1055,11 @@ typedef struct { #define R_AARCH64_COPY 1024 /* Copy data from shared object */ #define R_AARCH64_GLOB_DAT 1025 /* Set GOT entry to data address */ #define R_AARCH64_JUMP_SLOT 1026 /* Set GOT entry to code address */ -#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ +#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ #define R_AARCH64_TLS_DTPREL64 1028 #define R_AARCH64_TLS_DTPMOD64 1029 -#define R_AARCH64_TLS_TPREL64 1030 -#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ +#define R_AARCH64_TLS_TPREL64 1030 +#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ #define R_AARCH64_IRELATIVE 1032 #define R_ARM_NONE 0 /* No relocation. */ @@ -1202,8 +1202,8 @@ typedef struct { #define R_MIPS_GOT_HI16 22 /* GOT HI 16 bit */ #define R_MIPS_GOT_LO16 23 /* GOT LO 16 bit */ #define R_MIPS_SUB 24 -#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ -#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ +#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ +#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ #define R_MIPS_JALR 37 #define R_MIPS_TLS_GD 42 #define R_MIPS_COPY 126 From nobody Mon Dec 15 18:19:04 2025 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 4dVSxj3pcTz6L7gH for ; Mon, 15 Dec 2025 18:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxj05XZz4Lnk for ; Mon, 15 Dec 2025 18:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822745; 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=aPXxyC1VWzh2iMLYab1gbWG06GHiKyMKTONHR+2vuKw=; b=CURSaDJBissF025x5cRLkVvhZdPcg3n83ty8Ko7DRAcxYwLY5Lc/I2bc8Xvo80fC2kJBCe 3/rqp9h+WoukZmWfi4zbFX8G5rOdl7pKlcBSDGUDQ+a5mdwATjBwaSFUTs8rOdaPYzsCZq WW7gDIXGnz3dG3+ZkF4toFZrC3xNlOVIULqoegvGQW6fVDlrgBO/ki/Yn49S5cNaRYVPHc NVxkXjg+TB2oFCTxUc/XuPAvVHsI3vgjZkOC9uQsU4UEB6QULNkwX4F44P9xAIB6P7Dda7 7E2U9+IbO3XEENTUXQU+5FMCKgVygyE8CwSm7RvfRDkW2eIoVFLsx4/sK6nC8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822745; 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=aPXxyC1VWzh2iMLYab1gbWG06GHiKyMKTONHR+2vuKw=; b=m1MJ2PxbaKsOxJ63n4CrBywQmb9572CTGMIuAZ43sXu0Tkp1eCfD9lRyl2XzA07+7yhzoy E9KrlISAae32p5FOtcQLom9V0EYra2oL5ckGC9UQcDsz0GN8BUlU7G6bp4q3C2fOrQK100 ylmKRZHj6Nqkowt+tLW3tX3devlEFiICFeJpP8JsHTxzQHHg8/ShlUIZ5rQppRMSoVfKRR 6mSJAl4ggIpQaB76elVmNXmxU15luIs286VZmRQL1snyL3RF0PVrjXI5TZYtvR7S5/9d0k gEJYU07dTDfgWXCCTzar+tm60cWVTwaMAYFg10qFA/RnhZOZJy7oscFuH1lbxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822745; a=rsa-sha256; cv=none; b=b4QYJC5hO0AE3jz+J43izkWbU3o5pRGYEp6Ti9/eIfPnmLhd5XtyNPa2Sni/dKEfiP1P3h FzIdH6SJtHMK7L7RZv3+E8UgOcmUrjjFUbMEzTaAAUxjR7yK2mkXegUO5Dho11wV324LG5 m/XlsfsG+vnAheiDlAcY5l4sML9I1QOGQE6QeGJcE23OgddF1Kq7dUZ0ycC29F25z4JW0V ROKm+nF0eSe3zBleSUsMyrAvrTdADSuc8+rDL0a1ZDQxYs4ppvB0JbkW8Pt6oXGh8ow5RC 2kT9FQ+V8NOYrH4y4Gdv+e2g3uB8iO8VMSEAyZycioonNwpWBn5HwqgbPv7I8g== 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 4dVSxh6pt9zWbW for ; Mon, 15 Dec 2025 18:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2575d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 29e74434e4d0 - stable/13 - bsd.compat.mk: Honour XSTRIPBIN for lib32 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 29e74434e4d0c9b11ef5cbf5c7bafa32bfcddfc5 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:04 +0000 Message-Id: <69405118.2575d.4c2bdacc@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=29e74434e4d0c9b11ef5cbf5c7bafa32bfcddfc5 commit 29e74434e4d0c9b11ef5cbf5c7bafa32bfcddfc5 Author: Jessica Clarke AuthorDate: 2025-08-22 20:46:16 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 bsd.compat.mk: Honour XSTRIPBIN for lib32 Currently we only honour XNM and XOBJCOPY, but XSTRIPBIN is important during install. Otherwise we end up using STRIPBIN for the host, not the target, which is normally the same, but may not be, especially on non-FreeBSD systems. In particular, cheribuild will build FreeBSD with STRIPBIN=/usr/bin/strip XSTRIPBIN=strip (with the latter referring to the bootstrap strip in PATH), which breaks for WITH_LIB32 when the host's /usr/bin/strip is unable to process the lib32 binaries (e.g. building arm64 FreeBSD's lib32 on an amd64 GNU/Linux system). MFC after: 1 week (cherry picked from commit ad13dc1ece2fe4a6192bceffea4a868ba6a2e0e2) --- share/mk/bsd.compat.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index ef485b843f99..de25b6e941c3 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -87,6 +87,7 @@ LIB32LDFLAGS= -Wl,-m${_EMULATION} LIB32WMAKEFLAGS+= NM="${XNM}" LIB32WMAKEFLAGS+= OBJCOPY="${XOBJCOPY}" +LIB32WMAKEFLAGS+= STRIPBIN="${XSTRIPBIN}" LIB32CFLAGS= -DCOMPAT_32BIT LIB32DTRACE= ${DTRACE} -32 From nobody Mon Dec 15 18:19:03 2025 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 4dVSxh5GXXz6L7MR for ; Mon, 15 Dec 2025 18:19:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxg72Rzz4Lhr for ; Mon, 15 Dec 2025 18:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822744; 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=n3Wr4gEBH8J0b03pkG7JV03WQvqMl3oGiUoSyVko5fI=; b=L3TA6nWEFidLN6tjMJcd8l5HZ373yBJc2ttSOkEXgRJs6X0jNRpEqRIs2dp9CvzsriPy2f TqSd13OZQoWBc9xOkxNd7c52WTDlSu0fIpfZP+9SSjr6YuHWarx9V6D2mG5zec2RN+2c6P au61FLWYXfd/5a454w0hh4tSePOEZYV4HFhLnZ4ox9oFv3KC63J7OT0Yz9fJqiPQ9IVZoA DDHtXzLsAXbOVi/Yrt09oXS/8hJfQisbajuZl0M/AtlsRT8I+JB0/QKgBTsKbdI1KujXFd jDYWny/5JAWeWvi/mQm3jlj0QiYo8aauMT5x3XfGTfd4LjtuEQXM5niASBqHEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822744; 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=n3Wr4gEBH8J0b03pkG7JV03WQvqMl3oGiUoSyVko5fI=; b=u9yLH7uYby4GpfIOKKNNGtblKRzXUM6Qanx/uehKvTTQlcdxgqRG2xLNKXtFjVWrTrn1Ln Ryj2Fthz1Nr5I3wi6ytuMKbchi8LEDMpjeQattpyEDDw/hp6qWRwc6d/vfQorFexU914dw aU8GvFKfz2ItPj/LXuwlOWpsrzlmdpZeZSqfniHEDlZohq7UEkmWzfHULSoUccF9THIXpr B5m1dzvFL8PeT6U/lx7iyfsQsIcHmXfkoXuKtGvU+YJCbv1A39GTJB2vZ+WGyf8pqV4IfN F/8NLFKGf3Rdjf9lJba1T30ewimu2H8sR4BDAsGM7i1vsNxU1ot5f+qfznweow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822744; a=rsa-sha256; cv=none; b=IJ+Ljv9nrRmO5bwVz643VuM99i4FmHB3bSqSP7gyrZP1Ph4RvsUraeVdkWc+mKxuM/tw2h O8Xu7IdPDnW51Jkqd/l4FsYBVXWCb7XOWLrEbHuzpnb4DiWTDUuvUobodqyz/uI/a+su44 uWuLTO/voQ+KAb16SM6QFRkKfiVJPwoBRIrl0FlV9CuEHPMQiHIm9NzsDzLzDcw86Jf3zA sw5Ph8jMP+HuiJCM8EUpycmYS0BhPUlCyoRWZzkOk0JhoiSr5+OJ6yvERmdogvO2t5Lx2O a7tdlKwChRvLDRMRRGNHZG+9T2fUKG3zRWqDuA7W8TNptbzz436K00CiU6HURQ== 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 4dVSxg6QnTzVhh for ; Mon, 15 Dec 2025 18:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25bb8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: dc6d1c831d74 - stable/13 - rtld-elf: Delete unused RELOC_ALIGNED_P copies 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc6d1c831d74af01b97fc7fe751bc6717500d172 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:03 +0000 Message-Id: <69405117.25bb8.1d168a09@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=dc6d1c831d74af01b97fc7fe751bc6717500d172 commit dc6d1c831d74af01b97fc7fe751bc6717500d172 Author: Jessica Clarke AuthorDate: 2025-07-11 01:07:04 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 rtld-elf: Delete unused RELOC_ALIGNED_P copies This was copied from arm to aarch64 to riscv, but only arm uses it. MFC after: 1 week (cherry picked from commit 02d06043ba88f931f9debd5aa519fc303ca70d11) --- libexec/rtld-elf/aarch64/reloc.c | 7 ------- libexec/rtld-elf/riscv/reloc.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index c65b5dd431a0..b5f550e8bb71 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -35,13 +35,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - /* * This is not the correct prototype, but we only need it for * a function pointer to a simple asm function. diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 03d3c2d0c9ba..5542295f8811 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -41,13 +41,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - uint64_t set_gp(Obj_Entry *obj) { From nobody Mon Dec 15 18:19:06 2025 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 4dVSxk3lKQz6L7QF for ; Mon, 15 Dec 2025 18:19:06 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxk0WTkz4M3y for ; Mon, 15 Dec 2025 18:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822746; 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=a6v7nRqlmKkPaeeeV1XpNq4+m0He8dYZhb2QPjXdRDg=; b=IufLJZcXffyg0tdMEiGT+FAhryMYtzBgMarEs/qMSClo0u4gT1wLNGblvujpM+z3BtSE10 f/e070v4xP5oJniob9oquOB8yd37T5kNDJakxsT6I3uEBfrso9wDWuHM4hoKMAQsttXJV4 xi/aF8pdkudOtY/sFlSiOKGwLLzVtVGptzH8RY1cYbgKOKPzpFmv5y3P1EZDPmy8IEI/4Q kGOSMLNzwA4FEn8Vxxd3TDmVjHqzBy8xQD9jmAla1aqlBa1mL+h7D3QxTHEhMbBeqnRa6o zU6LzH+IWuDL3PvW9QOYewKHhkjalqjjySnlT1VeW/Qz7NaIQndyKZiNV28z0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822746; 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=a6v7nRqlmKkPaeeeV1XpNq4+m0He8dYZhb2QPjXdRDg=; b=jLv5mIZQ3BBlE23h+yV0ZbzlWQGiBsvXuJwi4QMC564HY6QBR+QF8sKHnbn8crs0HdcJvA UDqz8RW9zMgRRStNlybVD+aoL16nn3WXxmGjdSNCmKNwKZ56GlHgZKJ57+Xvhi702u6n8P yDWrIbcp56yex/TQtOnWQQhG8bz3lrIRl+/qQ+v9mamqj28dH3z2DN++K9bFvcdWO4tLbz lWGjDt6jb+BV/N0vwKKLcOsMx8tErzuzVGf6GDkJ6Q9kceTxp+UXI/BX/XkDLu8JKtx+a/ 84/q5xoU/UpRlxIRC//A3fo+15ttCscWtUi5SbKJrxDS7qt6M95d2ObCbM5iIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822746; a=rsa-sha256; cv=none; b=aDmU5RmIZdnBWMAqo53J84F1m2O8k5hXMBbKOdGTOZKkIx7GHqZp/+YD3hgyQkD3r0ELGs eS+xssBT/b1eX2HjyL9Nzxa1MbETPw9hfN10zyHsUMLsYIgx0e4Ws2sopchFQgzbLAF4fG nJ1xCDzG8o4XCewwGe3Ofwn2xFBW5l867MsQ3SPAMaxJQbPvjdTWsrmxVjclJjDKP3VLEx sAtAGtjjKKCinlfqLYhfvF1WVT0w46Eda3WL1bgnb9untxJrULNZcOTC/gFH84wVm5guZu p6W0B8NeK3ieghVy3SX+RlJqEBTEnXslz2td3tfcd11OSnu1Wz5m9uhpG6duYg== 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 4dVSxk04LTzWZb for ; Mon, 15 Dec 2025 18:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 237f1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 577b231f3ae6 - stable/13 - freebsd-update: Mention upgrading packages, not just ports 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 577b231f3ae6b4b94711cd8be7e8c79158216f07 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:06 +0000 Message-Id: <6940511a.237f1.5588ede0@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=577b231f3ae6b4b94711cd8be7e8c79158216f07 commit 577b231f3ae6b4b94711cd8be7e8c79158216f07 Author: Jessica Clarke AuthorDate: 2025-12-06 00:33:20 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 freebsd-update: Mention upgrading packages, not just ports These days most end users are likely using pre-built packages, not locally-built ports. Thus be sure to mention this as an important case, and put it ahead of ports. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42968 (cherry picked from commit ced74610217ff0be071e4614c64a4ff66c40bc6b) --- usr.sbin/freebsd-update/freebsd-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index bb30cd54c01a..0ab7a3732ea8 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3128,8 +3128,8 @@ Kernel updates have been installed. Please reboot and run cat <<-EOF Completing this upgrade requires removing old shared object files. -Please rebuild all installed 3rd party software (e.g., programs -installed from the ports tree) and then run +Please upgrade or rebuild all installed 3rd party software (e.g., +programs installed with pkg or from the ports tree) and then run '`basename $0` [options] install' again to finish installing updates. EOF rm newfiles From nobody Mon Dec 15 18:19:07 2025 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 4dVSxm2yn7z6L7d5 for ; Mon, 15 Dec 2025 18:19:08 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxl1WtQz4Lw6 for ; Mon, 15 Dec 2025 18:19:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822747; 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=zhf8cvjV0ZAIS7aEPZGXB/SDecFXzXWSTI2sZ6dLmWY=; b=fC7gA43ow1de/YGZLzfPV8X6wVcnWSka6zq1CouTXE81EYiSbIbt8IQg7+6Fxkr32bdypA FKzQaAb4x1JPiRWrWaBpU65bPbLtFk4AJX1spr6zm6Eetz3eWRfgY5YA8Y1YH7XdQn0RTD puTMbiPLtKTknnmFZ9o9TDr8BeBY4Tr1Bw7wxl114aVyzdFeER20zq7sxHM0A+5KS07YJl hPvlpm6JBT+Mo+cC90PhgKWzkcpaOTztE8dZfzrWez86gsO5GwfmFE7nurlh/q3d9AQvoe OC3JgbaKSi01bOcUuNpR4POQnKK95KK5gYl7JnAXuHDUqu5xE4ERw0dsVzOU+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822747; 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=zhf8cvjV0ZAIS7aEPZGXB/SDecFXzXWSTI2sZ6dLmWY=; b=jqR8QHaYn4CAxIynXLEYIAGaUZEnzQDwFiXgYaEeeJKnqMO1XK2ZbnUW1KxRvTkTyvbHA0 nwxOGmS4u2EVESCgpbx+2Z8Al/NRg9lqahfFMS3b6Ng80l5yzIVbGZ/Pq0ecRS+24hSfpK bjKGjhY+N/aRznFIQy3RJhaB/CGBQbrRJCcX86NU97xvuXSTXh8WOpKl9JCNm8iNwkIGZI J1btheifoqBU7GKoz8RWzQhGJ9blUIj+aCAQ73D+XlTxayAdhcRgOZVZDkMQP/jgRWB/8z 9H9SasyHdR4dCtJJGwJ85uIHJ3apcZ6saRwl+q1OoW5/aJJTlzmJuKNFKemKrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822747; a=rsa-sha256; cv=none; b=jDuij8wICbLNX2UZ0auD2KjhKb296PVed/0hKkszotLPwFbEhnUs2Zgvhf7LitLpzoHsSU 5PdUroEkxostymlArgdiQZavmgFxy8Zbjtl+jLdTq4notJVCWuSnk5nJ3Y/expA2bL4anX t/hsFm7ePgEr4/hYe0Sgn/7OGsJQvKSOhfUOJQ2sS1//3Ju35ByMkKtu7T8QAVf/71wP4V BCrk00kOTeIe39fdvLjvEKliVkzDxwvNK1kY7RPqj7rezFJut6515GKrybhpMbhk5bRtmT m01rUbokMx/Tw6Wxdr0lUXJLrLL8USvg0ADAw241Nfhg6QuqDH0avzM3aVKSDg== 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 4dVSxl0qzYzWnL for ; Mon, 15 Dec 2025 18:19:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 261aa by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 3e264f4d3586 - stable/13 - imgact_elf: Fix off-by-one in note size check 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e264f4d35863f9888f3779c64bf027e52fc9bc0 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:07 +0000 Message-Id: <6940511b.261aa.183285ee@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3e264f4d35863f9888f3779c64bf027e52fc9bc0 commit 3e264f4d35863f9888f3779c64bf027e52fc9bc0 Author: Jessica Clarke AuthorDate: 2025-12-08 13:01:57 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 imgact_elf: Fix off-by-one in note size check Prior to c86af2cc4cd1 ("imgact_elf: Check note body sizes"), this was note_name + n_namesz >= note_end, which checks that there is at least one byte after the unpadded name (which could be either padding or data), and given our notes always have data with them this was fine. However, once we started checking the padded name (note that "FreeBSD\0" is already a multiple of 4 bytes, so has no padding) and data, this turned into checking that there is at least one byte after the unpadded data, and since our ELF notes already have a multiple of 4 bytes for their data and therefore have no padding, this means that we are now checking that there is at least one byte after the ELF note, which is not going to be the case for the last ELF note. Instead, switch this to a strict greater than, as should be used when comparing one-past-the-end pointers, which both sides of the inequality are. For executables, this was generally not a problem in reality, since the last of our ELF notes is NT_FREEBSD_NOINIT_TAG, which isn't read by the kernel. However, ld-elf.so.1 (and libcompat variants), like shared libraries, only has NT_FREEBSD_ABI_TAG, which meant the kernel did not see this ELF note when directly executing it (e.g. as done by ldd), and on RISC-V this is the only branding present, so doing so would fail with ENOEXEC. This does also mean on non-RISC-V direct exec ld-elf.so.1 runs with the wrong p_osrel, but given it sets kern.proc.osrel.PID to the executable's NT_FREEBSD_ABI_TAG that it loads, this probably doesn't matter in practice. PR: 291446 Reported by: bdragon Tested by: bdragon Fixes: c86af2cc4cd1 ("imgact_elf: Check note body sizes") MFC after: 3 days (cherry picked from commit 5d58198ccc2b562098ee5fc4898013622b32b065) --- sys/kern/imgact_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index cda86cf48001..eaaebfbb0e08 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2759,7 +2759,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, goto nextnote; note_name = (const char *)(note + 1); if (note_name + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + - note->n_descsz >= (const char *)note_end || + note->n_descsz > (const char *)note_end || strncmp(note_vendor, note_name, checknote->n_namesz) != 0) goto nextnote; From nobody Mon Dec 15 18:19:08 2025 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 4dVSxm5r3Yz6L7gN for ; Mon, 15 Dec 2025 18:19:08 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxm25bxz4LpB for ; Mon, 15 Dec 2025 18:19:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3nGwajSZdUrSAq87ygN2pZDfIuj4RuE/MBmtvlTR8E=; b=VXcX78c9PsuTh2DtlQoeBNoQhSriKXT37wNywm+22zos9UGN8LIUiGeAfJkiGyYPH1neWY OABA1NWM0uwpYfpXtljEXfau+M0YEPMYX1ZvlbO2+/LeHcEY2YWV29Ow5zZaDPXnMYDYIk xwOngzgOvAIg6+5FGkKioRMDnmE53CaCWZBahNJDFDCCiCTRlZaN4SLSnD4rMuQ75vZxw2 aAbCvVvRYvH+Dnp68RzLe+oc2j6ObxKDJ+F2t7Ep+sy+iAw+ltgciowzfsHmwqpMavC9Jb J9FlWruhSoT/KzWaJ0papyvhvVNR/IhKiaTSKpELVKObOT/ToeJBwIApYTdzlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3nGwajSZdUrSAq87ygN2pZDfIuj4RuE/MBmtvlTR8E=; b=cH7kgf2rbJpV4xIWNGfLfQc4/kBm0KQEnaljcfgDM2EDOriLozYsqaRax7ua+IyyVBMBuP Sz2KZk/zEvl4z/taqTTKQ6uhh1qzDwiPPGeMV3NB44b2kVOVm+WJBF8ca/PCvtM0L5DXYI hQjjrIsSZjGagLhiq7A6MQP5X8PH6f0Ro1KCzP41iv6M87AcPrNiZZRN4AUnq8tMG2h7y2 mqmTlafdBpJ45zpIXbQfsfucrhd8vnP5m19XMWtP3KIB19DGGM+rgbQeVR6xOnyHBX6FRQ c2S463toRxXF/ceVeROCQrKkSYQ0VHKmYnhXrQKbrUzFWZbMIqaR1hP0lYdrHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822748; a=rsa-sha256; cv=none; b=o+VbvWg41qhY+1obasYOtnS4fE1PgWigzq6SUVNLs+N11SlqELFQ1w1i42Lo+0WuOEK3pH Pw2/LMsIhSdzgUPV+xOebUcgfxILLk6pLDi5bAnQjlol1cZLpOEfDFRUIAyap6St21zt7J 3moW8UxWEXJJROLwo65ePDWhv6nb6lNxwAfpXd9fgZskea4DxQ5Nw6R+HePSGxX2f3MmJX Y8U9R1WL+25CTacmmp3zGSiGyNnGMsQDsndiBqwZgOnwyG+ujSP0K+uQIjvisSZm5xwkgZ Do69RRh9Tx2dilemCxBOL74wRk05ITc6+B0+NpFX7iuFhJotm0hHaDaRdoB18w== 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 4dVSxm1ddzzVcy for ; Mon, 15 Dec 2025 18:19:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 235cc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: John Baldwin From: Jessica Clarke Subject: git: 4aa306667080 - stable/13 - cross-build: Workaround system-provided strchrnul on macOS 15.4+ 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4aa306667080dc2dc77ecbb146eccb081f9e63b2 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:08 +0000 Message-Id: <6940511c.235cc.4d9dcae4@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4aa306667080dc2dc77ecbb146eccb081f9e63b2 commit 4aa306667080dc2dc77ecbb146eccb081f9e63b2 Author: John Baldwin AuthorDate: 2025-04-28 17:10:41 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 cross-build: Workaround system-provided strchrnul on macOS 15.4+ macOS added a native strchrnul in 15.4. There is not an easy way to detect it at compile time, so use a macro to rename our local inline version to avoid conflicts while also forcing its use during bootstrap. The local version can be removed once macOS versions older than 15.4 are no longer supported as build hosts. Co-authored by: jrtc27 Reported by: kib Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D49893 (cherry picked from commit 4e2616b74cb7eed921aa10fb776cdc2d5fd4e42f) --- tools/build/cross-build/include/mac/string.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/build/cross-build/include/mac/string.h b/tools/build/cross-build/include/mac/string.h index d7db0d3023a4..58464f1f9834 100644 --- a/tools/build/cross-build/include/mac/string.h +++ b/tools/build/cross-build/include/mac/string.h @@ -38,9 +38,12 @@ #include_next /* - * strchrnul is not provided by macOS and the strchrnul.c implementation - * can not be compiled on macOS so just provide it inline here + * strchrnul is provided by macOS 15.4 and later. However, there is + * no good way to detect the current host version at compile time, so + * provide an inline definition under an alternate name. */ +#define strchrnul(p, ch) __freebsd_strchrnul(p, ch) + static inline char * strchrnul(const char *p, int ch) { From nobody Mon Dec 15 18:19:09 2025 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 4dVSxn4ft2z6L7VW for ; Mon, 15 Dec 2025 18:19:09 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxn2v2Qz4Lyn for ; Mon, 15 Dec 2025 18:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivaypY0XN98UQOd10TBd2kGJluUMXTG5Hgfx58F5lsk=; b=xY1IZHT+hSQsbwYJP+9sVqKXzkvTNaPWeZwXAoWBMDGzm5yZlYlf+a45QjzBPYe1E6VWVS TFjKheD6Gkhl/djb8bHq3t3fmwRg9TOOZCxmITbBKWGksK7g2+oX5NnS/U40TBsqZrXixn I5DKbJWxkAYWj+83Lje1mi0koi6jD9YGPAhUIeBAZISkpGmInVozguUuUaKmaiUdRJYWD1 xijrdmV4WfwBhLg1imXAwuQm7FJM3eFApz+y2X/L7V8tsjjzp2f7pe8OHruYP+zizGChpa luP3ylddiTNXykC2JoY/5uXZZ6vZuop8fChAVz0FDiR5xtgveJtTyo18eomb0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivaypY0XN98UQOd10TBd2kGJluUMXTG5Hgfx58F5lsk=; b=ZDFUeLIFhCsAocK9Gg20lfnkxIWQr+AEy8J2QeXnnusutOo0xJ6su+Y/5ACrJbGbN5nJEv 7aDjlFlvmZc2ZI4P/XQcNyZnes+IAEmHn1EsAaWuB1xPtzQGjKN70h86Sh4pNAxWxqsADX bcCyRBYHuHeMP6X7r8f5g2iIm9RpyN44gCcE8rsUkZKvo9GTjTvPsAk8+Y2Cqm4NmgDCN1 yD8zYjOUSG2/IfR7YH58FKSiU3qNnpllE/J8prTV+uVa8VpfffqSoSI3hLLLcnXoUuenx8 RyJ2RowIM1MULHE5ylFjmPIaUusNWWoZ43or6O3ltIlnmr4I+97Ibb7NZxQyFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822749; a=rsa-sha256; cv=none; b=uPsAz+G1emuJXmJSfZ49vFVx8275YvbrZNY9ejo2cMeB9/Oucx09J/O4WfzZRn7muWKNy6 CJTpMAIMR9IClWkFcH0zzAl2qknJSZytZ16Kwz7CbPjDuR8XUBv5ZBQJD3fYGL5r6pzwUX NvxunIFc/d1Iw/R+Iz5U4LWUkqXv3dOPKtl7omD0FW+vszsKP72X44orOhlmMpZNGTqVF2 0cTo+DDM3U8PFst6+ATKf/SI/1j7Bxemywo2MyyxsE0OCfKYHBrzfS6mqhbz05K/ciR3f+ /NlCWNecpD/sZNLpPKr14mkniygpARFTazGD93V/nNH52/cS+EkjJQtey88Adg== 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 4dVSxn2QtPzWdy for ; Mon, 15 Dec 2025 18:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25bbc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konstantin Belousov From: Jessica Clarke Subject: git: 056563a1580f - stable/13 - cross-build: fix after the recent sqlite3 import 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 056563a1580f9614d7eba4c7e2855787f4d50664 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:09 +0000 Message-Id: <6940511d.25bbc.1aa73cd8@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=056563a1580f9614d7eba4c7e2855787f4d50664 commit 056563a1580f9614d7eba4c7e2855787f4d50664 Author: Konstantin Belousov AuthorDate: 2025-07-10 21:02:37 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 17:56:37 +0000 cross-build: fix after the recent sqlite3 import Stop adding contrib/sqlite3 into the include path for usr.bin/kyua, take headers from the install sysroot env. sqilte3 now has the VERSION file, which clashes with c++ include . Submitted by: jrtc27 (see https://reviews.freebsd.org/D51217) Tested by: kib Fixes: 17f0f75308f2 ("sqlite3: Vendor import of sqlite3 3.50.2") (cherry picked from commit 09d28419c646650a77721e168ef43bc1bac96b67) --- usr.bin/kyua/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/kyua/Makefile b/usr.bin/kyua/Makefile index 953bb46589b1..50b683e51586 100644 --- a/usr.bin/kyua/Makefile +++ b/usr.bin/kyua/Makefile @@ -33,7 +33,7 @@ MAN= kyua-about.1 \ CFLAGS+= -I${KYUA_SRCDIR} -I${.CURDIR} CFLAGS+= -I${SRCTOP}/contrib/lutok/include -CFLAGS+= -I${SRCTOP}/contrib/sqlite3 +CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/private/sqlite3 # kyua uses auto_ptr CFLAGS+= -Wno-deprecated-declarations CXXSTD= c++11 From nobody Mon Dec 15 18:19:10 2025 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 4dVSxq2djvz6L7QL for ; Mon, 15 Dec 2025 18:19:11 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxp4LQWz4LwT for ; Mon, 15 Dec 2025 18:19:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822750; 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=FltK8wmwIRpOVRtYXON4DkwHmYedBT5+AXRj+6jctrg=; b=iPDwxY2e+d0UmPDj4Hgq/Kqr7RsiFASVzRbVfuGknBWzpR8JccmITZyNymC0H19JK2YuH8 g5qAA+w42wWI4x6NlTU8mII2ezgXDLkTiEgMtYd/pCHu3qm8PdbUE+Vx3Hjy3VJtGYk9JK 7aKwwykhVHLUnjHiXpJamnwlQOEuQmm9vJAe0P0bHoJ246w3JoW6mBjF8+zUPXWk8gwzgV i+yjHwBUsQgR1AcHg8AHSz8SO/+azD5Y5J1MwNoMSJVWXIdUYw1VRZXyopsyTOm62f7LW5 QkKb7db1N/542ETBN6RaclwN4JoiduCYa4ifDD4Ppvb502vmRJf6JQeTSh/Q2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822750; 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=FltK8wmwIRpOVRtYXON4DkwHmYedBT5+AXRj+6jctrg=; b=ZRn3tWSIrftFJLjCI65QV7UtQhz3GgnD/hja7/nzFScvk1yzVwayEzKdSdF+azktI0v6U0 4LpijdOL17psPenIIq75ksV4i5QwLH6DPRXOBZXa6kKHPz49Tf/mt+wQSJ8ScKQNzHK/l5 U7ux8WXRTk69cFkRidOlYVxcwZBY2mt4eIKFPhfUBRTBL5SAl4lSTiTSrqAUvrFcEKsLQ3 7QZnGG/c8PDIj1UI2+jfcJ70hNZX74ov2nqmAT/99mr27JeT2rPOtU7gAs7wrRVW+Z6c19 Va5Nxv+943Govzc/gMPuj1b93AEdBaFt7GthH4HAQs0ofif0YTYtUJOe0aramg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822750; a=rsa-sha256; cv=none; b=Tz+pI9fsxWyfi3tHsiBvY0v9YTHSF548/PWuTeCqxIwOYT6kGY16jdJaR5EqIp5iL8zVfL EZS3HgwoqDfY+4xmc9HL16eZrqbu4PDhrxA6GmPM4g1Hv71M9/YfIcRp6uivPqzmTq8bAo 1U2rKaKhPjdLkEgsdCoozl6X+7Q+ob8xuR89QIkN6YLjI/oXZpS34go2qkf2Jp5HAEpuje ZECmlnewYgvbxvc7WDYFsG8Z/wmpFbZnLz9OcomV2/kLWCNeto5YTCwjJalvt1jOs9PN+O WEPPi98VtS0awHYPUX/wp1B2unIqlddptwGi+Hw75xpq4AMZtp37x0ly3nhArw== 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 4dVSxp3117zWnN for ; Mon, 15 Dec 2025 18:19:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24733 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: eb955433b1e7 - stable/13 - mips: Drop unused TRAMP_LDFLAGS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb955433b1e791cf0088018aa3f9df048ea2ecdb Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:10 +0000 Message-Id: <6940511e.24733.e91a2df@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=eb955433b1e791cf0088018aa3f9df048ea2ecdb commit eb955433b1e791cf0088018aa3f9df048ea2ecdb Author: Jessica Clarke AuthorDate: 2025-12-15 18:10:19 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 18:10:19 +0000 mips: Drop unused TRAMP_LDFLAGS This has always been empty since e8dce5b9b3a5 ("Complete the integration of tbemd branch into head."). This is a direct commit to stable/13 as mips no longer exists in main. --- sys/conf/Makefile.mips | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/Makefile.mips b/sys/conf/Makefile.mips index b0f13e5a5a68..3610d5e5d5d2 100644 --- a/sys/conf/Makefile.mips +++ b/sys/conf/Makefile.mips @@ -76,7 +76,7 @@ ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \ -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp sed -e s/${KERNLOADADDR}/${TRAMPLOADADDR}/ -e s/" + SIZEOF_HEADERS"// \ ${LDSCRIPT_NAME} > ${LDSCRIPT_NAME}.tramp.noheader - ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \ + ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} -Xlinker \ -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \ -DKERNNAME="\"${KERNEL_KO}.tmp\"" -DELFSIZE=${TRAMP_ELFSIZE} \ -fno-asynchronous-unwind-tables \ From nobody Mon Dec 15 18:19:11 2025 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 4dVSxs1JsCz6L7dH for ; Mon, 15 Dec 2025 18:19:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVSxq3w96z4M2k for ; Mon, 15 Dec 2025 18:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822751; 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=dlD0AFCGDs69ZpkgdQad3QyTT3X94oJphFM5MOuMhek=; b=BhXZcruoDkbKyhdV/IOaCGB2iV5Dx+cfmLz3silplCWcBFjoSQ6j0b9dD40sMOjBhFo6aG BNmLGKTouO1/BnQl/T/0KWXt6ZxKcZCsSKF1ru2zso2Xu8urAQvLEeIGpa3GyF8JfzpEOV UpD5TiI4XiKWaGvZLaM9BMCkQlPcndKwftspXG1YTLH5jgJjYVErS23GmrD6hIPvzYcWki oSUA2QR/ull/mnniYSp5/L7X0pGYAXl+/WS4EYnJLgREdLOy7N/KymQIWtX1UaBvS6vc/Q lCLCrgIYTEIgztHYA7TYg3Lr14WfEztsF9g0RxOeYY1+8Y5ip0pF2ajFykMDQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765822751; 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=dlD0AFCGDs69ZpkgdQad3QyTT3X94oJphFM5MOuMhek=; b=OsnX1AS1kzUN2ModQIz4yl1BLXTIdsGmiaKMMFgn6WyWVIQM/cvokObtCOdXUJAiUgymW6 tuzglquGcuA1GJQ0jfpEjNqiv2vAQX1DnlB7NpBY/REumkEYPM8LURVqttJQtYFeO/oO6s Xwos4EOOQgewWTJ5+G0mFIwR/426dKy+Kot5Z61qnmUdjljt2CUObVeI3zIG2v98Zlu+5e wQqaOrKvM4v0MfoKk6AhuVTKWXs9NrfJmRBtkUgpdVe8k1MO/2wRbzQ+GVFu4bOvLcVBfS B4V5+xhrIol6MitVDBgpIXwbQ3VaeC+v7HmRbJozno3cm+BHEpM35iF2fn5R3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765822751; a=rsa-sha256; cv=none; b=jZFt7VU3EAS+/plDNElbt6UehJlydEkTAaGpKh4yF9WbKOkEanQec3hU0bHQbnTerTjHx1 aoNnh+vjiD8+EV/G/VUxfgOCwm43fzmHbqzPq8eqUBjUw8ftF08KAUGciwTBicZxW9vcPE MQF9nwDwu5Gw0mtZ7Ic8T4gmUlRCR9V+IqDfE/USOo1gtTPevI9rWSPP6M342tt+d5BSpr rotsWlf22O0fwtNdJuC3zfg4l9srs92h96BVGYWbjXiixrTX4sFUUa9DlCsfZKApuf2XU1 TQpt2dpuxSua88GY0zUU82Evrg25JzobOQKaUwL+28GL1olQlVAhejqSdR2OLw== 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 4dVSxq3S9wzVhk for ; Mon, 15 Dec 2025 18:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23c58 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:19:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 79fc0a5b5036 - stable/13 - mips: Include CCLDFLAGS when linking kernel.tramp.bin 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 79fc0a5b50361042849766c7ef8fb0766c7f4e83 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:19:11 +0000 Message-Id: <6940511f.23c58.266a26c3@gitrepo.freebsd.org> The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=79fc0a5b50361042849766c7ef8fb0766c7f4e83 commit 79fc0a5b50361042849766c7ef8fb0766c7f4e83 Author: Jessica Clarke AuthorDate: 2025-12-15 18:16:54 +0000 Commit: Jessica Clarke CommitDate: 2025-12-15 18:16:54 +0000 mips: Include CCLDFLAGS when linking kernel.tramp.bin This ensures we pick up -fuse-ld/--ld-path for external toolchains rather than trying to use the default system linker, which may not exist (e.g. on macOS). This is a direct commit to stable/13 as mips no longer exists in main. --- sys/conf/Makefile.mips | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/Makefile.mips b/sys/conf/Makefile.mips index 3610d5e5d5d2..d3bb4b17685b 100644 --- a/sys/conf/Makefile.mips +++ b/sys/conf/Makefile.mips @@ -76,7 +76,7 @@ ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \ -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp sed -e s/${KERNLOADADDR}/${TRAMPLOADADDR}/ -e s/" + SIZEOF_HEADERS"// \ ${LDSCRIPT_NAME} > ${LDSCRIPT_NAME}.tramp.noheader - ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} -Xlinker \ + ${CC} ${CCLDFLAGS} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} -Xlinker \ -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \ -DKERNNAME="\"${KERNEL_KO}.tmp\"" -DELFSIZE=${TRAMP_ELFSIZE} \ -fno-asynchronous-unwind-tables \ From nobody Mon Dec 15 18:39:22 2025 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 4dVTPC1tvPz6L9Bv for ; Mon, 15 Dec 2025 18:39:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVTPC1KNWz3QDF for ; Mon, 15 Dec 2025 18:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765823967; 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=D5LQpjWy30qGKM2srBH9Vgn8iGYqZDn7Ce2p4dTSO4A=; b=t0ZCfhhxVXmN1B3FnceVFwq92bvTiMO93Y5ObREWeZlnVEoDCQjMNxIggfKDo7v8CaRLCS IfUYFjQUPjSfcHSLGuaqZzXVH8ZovfTGjWbYoQ48xm/Q4Zd8E9ooS1yl1KH2jbmLAk7mQi mRheZTTBt0xXqP8u94mYeSrgw3x5s225q/rQ5o406YaZ3DgbvhLU5Py9ukuZ8l0ziK4rwb RnLArv5wY4rkYRAJVAZOOpW03QLJUunRs/CASkvYZ5iFiJ/FmmL70j6jhc9jd15wquAwtV +XzE5MO3d0aRj0cj2nwNhfav61pLgjjmbpU/bs5cp3eJxhncY7PMN1Eoxr+V6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765823967; 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=D5LQpjWy30qGKM2srBH9Vgn8iGYqZDn7Ce2p4dTSO4A=; b=GuXYuGlPsAMI58zjfLE+67u6Zb+zhflN1zkGz2iwyvKOcXwJMdQYcVwGz8fkM5hhizKfV0 MqOWOBXC18cL4rtFwXbQ/DsAZvx9XHURHWCdkp6VqEOOC+k3/5t/P02cYRb2WwG8hDyALt SVK9WDKKanwbBgL9+3b1UW6m7SyY0eugLH0z7F35uINWPVJhzaZsfUce4/2dl9+Pw08kFB iJRV5jfFcpcg8jSp1G281rKo4S/LAdnW5MTYmpXpmhO/Tx+xrFwBywq5VKsabdJlO5hlmb lQI5eMbUZvl+YbHl753R+QPoAYMahVjEdGej4S/o5a1kAkHa2aKZY0arY8wbjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765823967; a=rsa-sha256; cv=none; b=Tx4zdNuCY3Lx4ZNmpMH0JsYG4y06hklAJt2dvWeg8ekWRx/RK2OHEv7HeTGQPPOB7Ta86V NtCQkdP7hew4r2hPglgeSMnm7L7z6jeVrUQx98eWfTTv09HmftNqu0hao0G6EbUGXwL63D UywC/CHz1toYKCth/m+HpTer97A8hQ324roZrNMzcQNBFsD9C23HbtjnmbRcRC0mKdk9lL wB4gBTqA1Kv54aPPER2f4nIm0yETzbpIixPhvzpTsdNtD9jbZvj1+OIMkb9CM2mIxK/vqW TFhHgt7YubGBd2gs8PhRRsybhwoI+y5F8caJWd1eAYdA/roQT87NPh7AG1FbmQ== 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 4dVTPC0nmbzXd5 for ; Mon, 15 Dec 2025 18:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26546 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 18:39:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: daedb9122a18 - stable/13 - agp: Export intel_gtt_read_pte, required by i915kms 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: daedb9122a1812d0e9c9baef01afbe115a4edfcc Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 18:39:22 +0000 Message-Id: <694055da.26546.25524284@gitrepo.freebsd.org> The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=daedb9122a1812d0e9c9baef01afbe115a4edfcc commit daedb9122a1812d0e9c9baef01afbe115a4edfcc Author: Ed Maste AuthorDate: 2025-11-25 18:40:35 +0000 Commit: Ed Maste CommitDate: 2025-12-15 18:39:11 +0000 agp: Export intel_gtt_read_pte, required by i915kms This isn't used by modern cards, but is needed for i915kms to load on a system that has agp as a module not compiled into the kernel. PR: 291214 Reviewed by: cy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53906 (cherry picked from commit a87c1e2dd8fc997d6ee603c252c543afe8a4d2a4) (cherry picked from commit 8befd2d2b6a0c5d54fa53246a89ae09009007799) (cherry picked from commit ae1f6fd47c4584d1abe5ecf26f291d282e6f6a67) --- sys/modules/agp/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/agp/Makefile b/sys/modules/agp/Makefile index c5ce53d2ef13..8841c5776920 100644 --- a/sys/modules/agp/Makefile +++ b/sys/modules/agp/Makefile @@ -37,6 +37,7 @@ EXPORT_SYMS+= intel_gtt_clear_range \ intel_gtt_install_pte \ intel_gtt_get \ intel_gtt_chipset_flush \ + intel_gtt_read_pte \ intel_gtt_unmap_memory \ intel_gtt_map_memory \ intel_gtt_insert_sg_entries \ From nobody Mon Dec 15 22:23:18 2025 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 4dVZMW0vRsz6LR8q for ; Mon, 15 Dec 2025 22:23:19 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVZMW084Bz3vmn for ; Mon, 15 Dec 2025 22:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765837399; 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=/kvwc1sCC/Tq9gqXcHN6h+0Y/beTEjrQRhtZpwkYFOk=; b=GfVtZe0b9+ygdBfUwq/LNV0WtGaJpmqoXFPKbqX8fcg4Iyfh1jnOZcFWTvjrSIYDUy0plu 3cyps9DyJcqjr//ssMD3skFRHuDbGJ+j2bdlcrucBxAM8dUHW6tkMic5DCqPXLblBT+gq6 r1xejbzpf4exLFs0YiExzmwnBOhi9okJ73KjXLnFL3+gCWm6oy0+Q5KpsqbxDQF1tLBrtA nka6PqXWK67ZH3bfQ8UWXdOAHARArEYFERPd35+JcwirUeG1Z1NP8lSOxfaM8pqOExZXHX aI4VbpMrl7W6/ZsmbPes2DIhz6VGFD/mATy+pxgj39J0Jvmkjbx2AgLd/6xtsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765837399; 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=/kvwc1sCC/Tq9gqXcHN6h+0Y/beTEjrQRhtZpwkYFOk=; b=AmdWEnWR9pF20bZnJA3V1GwTvG0MjHCTtskuq6pxFgrHMDeKPn7lIHhJj/L0+ZbcgSG4wZ M8TIGqBgrOGmNNm24XaJHoYeWvqEaMbZQt/5jcgCB0dCE8cOvcHgAiu4n3FGkHk0RLcOuR sBIADydGdEU8S85XBUO/K/unrDbOGhzNKTNpsmq7m8n//qCLYgct9xN2KLoeIuV3usYMod zcm9Timgum2dZYOUSffLeHoJfqmhfvjafr2UCUlgFhVgGAJX9zAr0coP5cXFGljry/UUrj VnYDA02yKfpe1gsRQH7DgpR+pZ7A0zUW43vI1kWe5VqZ1bT3thJnL3x6xIH7IQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765837399; a=rsa-sha256; cv=none; b=pTSzbWRa+xj9uuNuM1R/8cs54n1eCHAfqRPZDewugNVMKAXiNY8hW3JOMzOpyru8G8ioOl J1zUeYYwTrWE1Iz957xLJZKnmWZqzE/U8DdL8hRZ0NFwMefHjFhoMbg1ur4YRvymo22C40 3PAhXGKzw1d1zzAAzC8f95c+nUKf+lVOS5o/EDF5XH62zjL+Y9cyLsfdRcdMjrBjsTaQdm 92kouZkTWPNP/Ekb7X5+vzj6F2tBUnkRh2C60toJ2TJBtUmEjyqTryuEO1PqqW1MqKr2+W jd0ng3lsVhWwL2syuADvI5Bw80V+RZYm06n7tNI+8E+5OlHEBmDd9p6n4sAidQ== 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 4dVZMV6WkQzfvt for ; Mon, 15 Dec 2025 22:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45dee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 22:23:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Peek Subject: git: 7cba27286364 - stable/15 - ctfmerge: fix segfault when building on macOS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7cba27286364a77248234c305154afe53396f188 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 22:23:18 +0000 Message-Id: <69408a56.45dee.86c93a2@gitrepo.freebsd.org> The branch stable/15 has been updated by mp: URL: https://cgit.FreeBSD.org/src/commit/?id=7cba27286364a77248234c305154afe53396f188 commit 7cba27286364a77248234c305154afe53396f188 Author: Mark Peek AuthorDate: 2025-12-01 20:50:24 +0000 Commit: Mark Peek CommitDate: 2025-12-15 22:22:54 +0000 ctfmerge: fix segfault when building on macOS The barrier code was using semaphores which have been deprecated in macOS and not working at all, causing a race condition. Since macOS does not have pthread_barrier_*(), this change uses a condition variable instead. PR: 290958 Reported by: wosch Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D54018 (cherry picked from commit 732b4aa05d78ca6831d02e67a43f34ad104f4f01) --- cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c | 26 +++--------------------- cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h | 9 ++------ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c index c0719620dbde..e1f54e994ce3 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c @@ -38,9 +38,6 @@ */ #include -#ifdef illumos -#include -#endif #include #include "barrier.h" @@ -49,12 +46,7 @@ void barrier_init(barrier_t *bar, int nthreads) { pthread_mutex_init(&bar->bar_lock, NULL); -#ifdef illumos - sema_init(&bar->bar_sem, 0, USYNC_THREAD, NULL); -#else - sem_init(&bar->bar_sem, 0, 0); -#endif - + pthread_cond_init(&bar->bar_cv, NULL); bar->bar_numin = 0; bar->bar_nthr = nthreads; } @@ -65,26 +57,14 @@ barrier_wait(barrier_t *bar) pthread_mutex_lock(&bar->bar_lock); if (++bar->bar_numin < bar->bar_nthr) { + pthread_cond_wait(&bar->bar_cv, &bar->bar_lock); pthread_mutex_unlock(&bar->bar_lock); -#ifdef illumos - sema_wait(&bar->bar_sem); -#else - sem_wait(&bar->bar_sem); -#endif return (0); - } else { - int i; - /* reset for next use */ bar->bar_numin = 0; - for (i = 1; i < bar->bar_nthr; i++) -#ifdef illumos - sema_post(&bar->bar_sem); -#else - sem_post(&bar->bar_sem); -#endif + pthread_cond_broadcast(&bar->bar_cv); pthread_mutex_unlock(&bar->bar_lock); return (1); diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h index babf2e64e33f..138386f8ed46 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h @@ -33,12 +33,7 @@ * APIs for the barrier synchronization primitive. */ -#ifdef illumos -#include -#else -#include -typedef sem_t sema_t; -#endif +#include #ifdef __cplusplus extern "C" { @@ -48,7 +43,7 @@ typedef struct barrier { pthread_mutex_t bar_lock; /* protects bar_numin */ int bar_numin; /* current number of waiters */ - sema_t bar_sem; /* where everyone waits */ + pthread_cond_t bar_cv; /* where everyone waits */ int bar_nthr; /* # of waiters to trigger release */ } barrier_t; From nobody Mon Dec 15 22:49:38 2025 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 4dVZxt6PDmz6LSSm for ; Mon, 15 Dec 2025 22:49:38 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVZxt4Sl9z3y05 for ; Mon, 15 Dec 2025 22:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765838978; 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=VdO3htGy75+575/0hTAscu9TbS5pPWeTm4K6XJMU2d8=; b=ELhU1B0EEh7fIoFgOw/MtaiAcHbGiPcV6wmNBiwZVBLxntq1D8RmeI+rj6wK2ov1wzdIPG FCwaF48JU/ig47uMvI8Lzj3jGMSWVtcZhpadEgngQhYEtrVyoF3/hArxhPR7NeQ0tbokRN KMMjxvYRhQRTR9+cJ3k3LFMQrg5uuTBl6wP/6szyN6CVP8lY6HHSMyDPyN6OzvAfmGT7b4 9Yz1gm/JWpVcuLFrMZbIiEm0RzznITvgovv61pB7zGfbScomJ/b+yGVxPhn/ouzW3WUdZQ tQ7/Bex4kR0zBKaf6dw2uE2kXOY8Kj9ewjtbluV/kcmCR2f7z3QNhggutETayQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765838978; 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=VdO3htGy75+575/0hTAscu9TbS5pPWeTm4K6XJMU2d8=; b=CtEWFtHnyOo4Ur2sCB3h7JuphSrJlWPL7CiqtXF2DQNv6w7k/Pij635byJcKSLOC11HzWv hixJn3w1wRYdhAe7AEUCH/VbvlNpTrDft06m9Dm0paRNhLopfI6WWJaE00epO+Eke4s88V 7OT6GuJwP6atHnIHZTNFdEOI5eq9ke6ahZv3n6y/jyPIZHsu/U57PlcFj/fSfhp1Bm7FEu zk/10d3hg9Eg2SqiXSn9TTQ3MFlrXQONekz7cIAjC81kP4JQXgFClo6hnFUGotjmJc04h7 mJ5cQAnapXcmtor8Oy2XoBoSNVfv2MYr9AoP0XcIz46T83JumXr8BG0rC7lvzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765838978; a=rsa-sha256; cv=none; b=Lo+fvOV7N/uAtx+ugNxI35Nmb0vVLSNTuiKoj7DE1mb3THMalIDjJx/PbRgcjAkYFJGUGB Yt3qU+I568zpAVX2f+ok3pg3JPn5KIrF9LKxeqf+Pvt7dKwWz03o2GTFU05b1/R2z26yFI RMG8iKuoCBh9jYDpG0rtUiQQRl+uExvAD6NEgj8aJvFx/kV+xHMUG2zQKa0dZyHwAkBXru bdfJro8lsX9bbp6+RgHbEkxdSVwPoqTF/WpI7ThXWcCSzxaBQu9FDNwXUOgtUzsHJBWkl6 fbltgYz7BY0kvDq7w93t+UJCwTBfD+iwSNwuHgnLybDBKRRWi2yfbfPQZCM5Fg== 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 4dVZxt3bwczgQq for ; Mon, 15 Dec 2025 22:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47078 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 22:49:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Peek Subject: git: 2bf082df4931 - stable/14 - ctfmerge: fix segfault when building on macOS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2bf082df4931fa0a2c557c428e7e7a333fd95ae5 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 22:49:38 +0000 Message-Id: <69409082.47078.2b7e6386@gitrepo.freebsd.org> The branch stable/14 has been updated by mp: URL: https://cgit.FreeBSD.org/src/commit/?id=2bf082df4931fa0a2c557c428e7e7a333fd95ae5 commit 2bf082df4931fa0a2c557c428e7e7a333fd95ae5 Author: Mark Peek AuthorDate: 2025-12-01 20:50:24 +0000 Commit: Mark Peek CommitDate: 2025-12-15 22:49:04 +0000 ctfmerge: fix segfault when building on macOS The barrier code was using semaphores which have been deprecated in macOS and not working at all, causing a race condition. Since macOS does not have pthread_barrier_*(), this change uses a condition variable instead. PR: 290958 Reported by: wosch Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D54018 (cherry picked from commit 732b4aa05d78ca6831d02e67a43f34ad104f4f01) --- cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c | 26 +++--------------------- cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h | 9 ++------ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c index c0719620dbde..e1f54e994ce3 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c @@ -38,9 +38,6 @@ */ #include -#ifdef illumos -#include -#endif #include #include "barrier.h" @@ -49,12 +46,7 @@ void barrier_init(barrier_t *bar, int nthreads) { pthread_mutex_init(&bar->bar_lock, NULL); -#ifdef illumos - sema_init(&bar->bar_sem, 0, USYNC_THREAD, NULL); -#else - sem_init(&bar->bar_sem, 0, 0); -#endif - + pthread_cond_init(&bar->bar_cv, NULL); bar->bar_numin = 0; bar->bar_nthr = nthreads; } @@ -65,26 +57,14 @@ barrier_wait(barrier_t *bar) pthread_mutex_lock(&bar->bar_lock); if (++bar->bar_numin < bar->bar_nthr) { + pthread_cond_wait(&bar->bar_cv, &bar->bar_lock); pthread_mutex_unlock(&bar->bar_lock); -#ifdef illumos - sema_wait(&bar->bar_sem); -#else - sem_wait(&bar->bar_sem); -#endif return (0); - } else { - int i; - /* reset for next use */ bar->bar_numin = 0; - for (i = 1; i < bar->bar_nthr; i++) -#ifdef illumos - sema_post(&bar->bar_sem); -#else - sem_post(&bar->bar_sem); -#endif + pthread_cond_broadcast(&bar->bar_cv); pthread_mutex_unlock(&bar->bar_lock); return (1); diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h index babf2e64e33f..138386f8ed46 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h @@ -33,12 +33,7 @@ * APIs for the barrier synchronization primitive. */ -#ifdef illumos -#include -#else -#include -typedef sem_t sema_t; -#endif +#include #ifdef __cplusplus extern "C" { @@ -48,7 +43,7 @@ typedef struct barrier { pthread_mutex_t bar_lock; /* protects bar_numin */ int bar_numin; /* current number of waiters */ - sema_t bar_sem; /* where everyone waits */ + pthread_cond_t bar_cv; /* where everyone waits */ int bar_nthr; /* # of waiters to trigger release */ } barrier_t; From nobody Mon Dec 15 22:50:29 2025 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 4dVZys4GBwz6LSc7 for ; Mon, 15 Dec 2025 22:50:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVZys1v8Lz3yWh for ; Mon, 15 Dec 2025 22:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765839029; 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=mKcPtVHJbS9P2MV4X6cTt7cNEBCVwSPvkNyyYqZgUhI=; b=f2HkqVbtsqYAbPMgmyCmHHGqf0QgrBIxfmvBQcCOWx0KHaMQHlnoobOqYkovw7Zq5QxJ58 1S4pjzAvPoLdY75cKk3MhaSLr1YvMN3uot2Jd9dRFXhiuHe5ieuWsZ4ELTfKRKTLgt76oq mEm6kQoksXt8TlTC65F9S3XTjqy1Ixzf8P9mCw/4WigSyPC65c5NxFdOe+OvrmKYKzoCYW Oh7jCtJ8DP7MLoN9ku+aH1n/x6fwJMefz8pE7eiTOU8Kb0LgW/N6ibw+U3eMwcd417fati rPZVV7XCjRH46pozKmm8XpWM2RDSAEUF30QA2OXqBjiSe2q7bkEBDMY60LvZ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765839029; 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=mKcPtVHJbS9P2MV4X6cTt7cNEBCVwSPvkNyyYqZgUhI=; b=aKy4rrBCX30+1nFS/PpASPXXJioooBcu+CEqbqLUqqRA/HFG7mb+qgEx8QLG5JHs3pKPtD n2qYrOYhNAnXt0kgbXaBZjKJ5GJ7Zjehv2ejab8NUX/vdxGoy29+++JatUDPhuAwWnGlqg oOFIwBPNzArriBuL+N9InRm1qJeGmoka8FXr1pqA6oiXyPZn6OQI9w63RY71w9G5v1j85k xk5/xUcOH1VxtDZOkyAvn44s/5Uw4Woq0JQa5qt6iPt4CMj1dPkYfSUCrBLXlN/asCQpSP HBeY6eYZTQx8nyboIk9JjDvYpV6nbaI8Fcv1SvFp42loaE5G8NwpG14J8QSBNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765839029; a=rsa-sha256; cv=none; b=cjgiLBr7N3MmeeOCWK72AoiCFEnsJ88nAcuN3exJ2r3CFwnw4NMznfJHt5J5nn0DmvYmsc 0lToXod85DzPNvOE5oRy9ISOccg6Byfx0P1iGVW5vXpJyajjBZuyJxG9NcSHcUnEY+hKMv Nla+smArH0KBEwzyE7KQ57kp6JiLpWFGw+XKyGIOFoSX/eprWVqbaB/jV1aj/cgA4PDf+L dX9citpmFQ3pzMFOCaJA8b4O8cDQ3bjnAv0MyptPQpCFyvl8AF8MPxWnacWQt8VNBQmBL9 m3AnTDYaPcrd3X/8zYH0bDOlKCwdeetHuDUIW3pm6Rrz+xqpsFUIw8HU3VqksA== 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 4dVZys0l9CzfxS for ; Mon, 15 Dec 2025 22:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46876 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Dec 2025 22:50:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Peek Subject: git: f1b50f2cb0db - stable/13 - ctfmerge: fix segfault when building on macOS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f1b50f2cb0dbaf4c036fb8123b075ad8329559e4 Auto-Submitted: auto-generated Date: Mon, 15 Dec 2025 22:50:29 +0000 Message-Id: <694090b5.46876.4f4fd4ba@gitrepo.freebsd.org> The branch stable/13 has been updated by mp: URL: https://cgit.FreeBSD.org/src/commit/?id=f1b50f2cb0dbaf4c036fb8123b075ad8329559e4 commit f1b50f2cb0dbaf4c036fb8123b075ad8329559e4 Author: Mark Peek AuthorDate: 2025-12-01 20:50:24 +0000 Commit: Mark Peek CommitDate: 2025-12-15 22:50:10 +0000 ctfmerge: fix segfault when building on macOS The barrier code was using semaphores which have been deprecated in macOS and not working at all, causing a race condition. Since macOS does not have pthread_barrier_*(), this change uses a condition variable instead. PR: 290958 Reported by: wosch Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D54018 (cherry picked from commit 732b4aa05d78ca6831d02e67a43f34ad104f4f01) --- cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c | 26 +++--------------------- cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h | 9 ++------ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c index c0719620dbde..e1f54e994ce3 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c @@ -38,9 +38,6 @@ */ #include -#ifdef illumos -#include -#endif #include #include "barrier.h" @@ -49,12 +46,7 @@ void barrier_init(barrier_t *bar, int nthreads) { pthread_mutex_init(&bar->bar_lock, NULL); -#ifdef illumos - sema_init(&bar->bar_sem, 0, USYNC_THREAD, NULL); -#else - sem_init(&bar->bar_sem, 0, 0); -#endif - + pthread_cond_init(&bar->bar_cv, NULL); bar->bar_numin = 0; bar->bar_nthr = nthreads; } @@ -65,26 +57,14 @@ barrier_wait(barrier_t *bar) pthread_mutex_lock(&bar->bar_lock); if (++bar->bar_numin < bar->bar_nthr) { + pthread_cond_wait(&bar->bar_cv, &bar->bar_lock); pthread_mutex_unlock(&bar->bar_lock); -#ifdef illumos - sema_wait(&bar->bar_sem); -#else - sem_wait(&bar->bar_sem); -#endif return (0); - } else { - int i; - /* reset for next use */ bar->bar_numin = 0; - for (i = 1; i < bar->bar_nthr; i++) -#ifdef illumos - sema_post(&bar->bar_sem); -#else - sem_post(&bar->bar_sem); -#endif + pthread_cond_broadcast(&bar->bar_cv); pthread_mutex_unlock(&bar->bar_lock); return (1); diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h index babf2e64e33f..138386f8ed46 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h @@ -33,12 +33,7 @@ * APIs for the barrier synchronization primitive. */ -#ifdef illumos -#include -#else -#include -typedef sem_t sema_t; -#endif +#include #ifdef __cplusplus extern "C" { @@ -48,7 +43,7 @@ typedef struct barrier { pthread_mutex_t bar_lock; /* protects bar_numin */ int bar_numin; /* current number of waiters */ - sema_t bar_sem; /* where everyone waits */ + pthread_cond_t bar_cv; /* where everyone waits */ int bar_nthr; /* # of waiters to trigger release */ } barrier_t; From nobody Tue Dec 16 03:48:25 2025 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 4dVjZd2NTmz6JsxX for ; Tue, 16 Dec 2025 03:48:25 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVjZd1Mp4z3Zbp for ; Tue, 16 Dec 2025 03:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765856905; 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=tnE707a5ZSSvvWXJGns7XgcGTBLpcUh+acCc8oGbaq0=; b=OYUdY46s26kT+5vmaGOKT1tYHkqYxzHViPzpAlMJbKhxpLgccNzewgxpGNFP1KTbyj5lX9 mjvxNhrfG0WjDaiT2ZvGETAsxzPEtrcoaW+I1J33NafIEcX7uPoowIgK1RFeHf+sAm4pTp P4dMhnxZf9iP3ZpeO2CyXROAvV0Pwwq6YY6at7jLP52Yft2GAJkJklGTPCD7c+rPOSIA0p gUbUB7qZJU6JIsll1Kr/Egc9SLAO/0YQVyzgjMN2C/X15x0+a/qxSswMvpkLE0jd9nkdDE otcHwWsBX3FbUdGF6ONi60JdRFIQ9uPkVPHwnn5740K16+DCK3IUVVriVDu6PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765856905; 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=tnE707a5ZSSvvWXJGns7XgcGTBLpcUh+acCc8oGbaq0=; b=UtKCpCjVjgJSqtdJHjklB8vG02a0N4ROvrEYKAiex1qhkX0WwXuUP8KCCCcLAAyssIRFiP Ynkefe3DXBfls+zWJQKJrsp5qQmvwBFhL2xre3Y7BgvjGjrqC+7ID3dBHUz1c2A0dEtmTN 1O2r7pBSj8vSWnLu4tzLlT/f0mP3plFukvWFxWY4gfrQFk2dV4IB+fSqRnpfr6U0T+4MTV 9keQKo7fOTGj0MdA3O5c5uV9qBCj1H/lGaLo68vfgVVanix83/qGMQScWjKigTRuQy8EeB lcOS0MEBiLIsxAtMTEHVAZNQhJO4MV/3mL04SwD96ERc/Xel2eyOA4HDyjYHjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765856905; a=rsa-sha256; cv=none; b=bk8nU41ArfdCvCv+Ukf2Iv9g344GFDIav8MtJIXl04VP+XEZWma1HzVdtOZ3pXpMnvHGCj D7CljkEMN455SAMhh/4DuRjR1cQlnFVV3J4Iiq6ye1oVSXc5fDI7vPU+4cnBZC2fAGfi/B NnwjKp7Vfu3W67W9L4r1ez/cC5Gw7o3CzNosU3XUGMLKOdFRnVgNR+zmFJk2v8IH9eThEV otqjEFq+yS4fXmR0JHu24Mej2trp2OZz65p21dQSC9PTNvmWFaWMQFn4oW89f7nZXYz37W keESCSPvRbifO/zSqMoG1Vw/x8b5wl0YV1qp3UROos3VQZ/Q3C/TdDq1WDNYXw== 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 4dVjZd0zPZzq1f for ; Tue, 16 Dec 2025 03:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b45a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 03:48:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: c13157b87b00 - stable/15 - shutdown(8): Document additional formats supported by the code. 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c13157b87b00e9a98c02b829c3658e46078db90b Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 03:48:25 +0000 Message-Id: <6940d689.3b45a.36037b75@gitrepo.freebsd.org> The branch stable/15 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=c13157b87b00e9a98c02b829c3658e46078db90b commit c13157b87b00e9a98c02b829c3658e46078db90b Author: Xin LI AuthorDate: 2025-12-09 05:46:24 +0000 Commit: Xin LI CommitDate: 2025-12-16 03:46:52 +0000 shutdown(8): Document additional formats supported by the code. (cherry picked from commit f9500e75791cf793904c80ca4a52433afd585a23) --- sbin/shutdown/shutdown.8 | 62 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/sbin/shutdown/shutdown.8 b/sbin/shutdown/shutdown.8 index ed44ac36aef6..2f09f5d524a9 100644 --- a/sbin/shutdown/shutdown.8 +++ b/sbin/shutdown/shutdown.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 4, 2024 +.Dd December 8, 2025 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -99,10 +99,10 @@ system multi-user with logins disabled (for all but super-user). If one of the .Fl c , .Fl h , -.Fl p +.Fl p , or .Fl r -options are specified, +options is specified, .Nm will execute .Xr halt 8 @@ -135,23 +135,42 @@ may be the case-insensitive word .Ar now (indicating an immediate shutdown) or a future time in one of two formats: -.Ar +number , -or -.Ar yymmddhhmm , -where the year, month, and day may be defaulted -to the current system values. +.Ar +number +or an absolute time specification. The first form brings the system down in .Ar number -minutes and the second at the absolute time specified. +time units (defaulting to minutes), and the second at the absolute time specified. +.Pp +An absolute time may be specified in one of the following formats, +where unspecified parts default to the current date: +.Bl -tag -width "YYMMDDhhmm" +.It Ar hhmm +Hour and minute. +.It Ar DDhhmm +Day, hour, and minute. +.It Ar MMDDhhmm +Month, day, hour, and minute. +.It Ar YYMMDDhhmm +Year (within the century), month, day, hour, and minute. +.El +.Pp +The year +.Ar YY +is interpreted relative to the current century, with a one-year tolerance +for values slightly in the past (to accommodate entry at year boundaries). .Ar +number may be specified in units other than minutes by appending the corresponding suffix: .Dq Li s , .Dq Li sec , +.Dq Li secs , .Dq Li m , .Dq Li min , +.Dq Li mins , .Dq Li h , -.Dq Li hour . +.Dq Li hour , +.Dq Li hours . +The unit suffixes are case-insensitive. .Pp If an absolute time is specified, but not a date, and that time today has already passed, @@ -174,7 +193,7 @@ At intervals, becoming more frequent as apocalypse approaches and starting at ten hours before shutdown, warning messages are displayed on the terminals of all users logged in. Five minutes before -shutdown, or immediately if shutdown is in less than 5 minutes, +shutdown, or immediately if shutdown is in less than five minutes, logins are disabled by creating .Pa /var/run/nologin and copying the @@ -192,7 +211,7 @@ At shutdown time a message is written to the system log, containing the time of shutdown, the person who initiated the shutdown and the reason. The corresponding signal is then sent to .Xr init 8 -to respectively halt, reboot or bring the system down to single-user state +to respectively halt, reboot, or bring the system down to single-user state (depending on the above options). The time of the shutdown and the warning message are placed in @@ -220,7 +239,7 @@ exits without executing any action on the system. .Pp When run without options, the .Nm -utility will place the system into single user mode at the +utility will place the system into single-user mode at the .Ar time specified. .Pp @@ -235,7 +254,7 @@ shutdown -p now .It Pa /var/run/nologin tells .Xr login 1 -not to let anyone log in +not to let anyone log in. .It Pa /var/run/noshutdown prevents .Nm @@ -249,9 +268,22 @@ Reboot the system in 30 minutes and display a warning message on the terminals of all users currently logged in: .Pp .Dl # shutdown -r +30 \&"System will reboot\&" +.Pp +Halt the system at 23:30 (using either format): +.Pp +.Dl # shutdown -h 2330 +.Dl # shutdown -h 23:30 +.Pp +Power off the system on June 15th at 10:00: +.Pp +.Dl # shutdown -p 06151000 .Sh COMPATIBILITY -The hours and minutes in the second time format may be separated by +The hours and minutes in any absolute time format may be separated by a colon (``:'') for backward compatibility. +For example, +.Ar hh:mm +is accepted as equivalent to +.Ar hhmm . .Sh SEE ALSO .Xr kill 1 , .Xr login 1 , From nobody Tue Dec 16 04:57:26 2025 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 4dVl6H0G3vz6K0BW for ; Tue, 16 Dec 2025 04:57:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl6G6ltVz3hD3 for ; Tue, 16 Dec 2025 04:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861046; 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=NXnAsNQkTo92s7mLx/ERv2g6QQ1LuOyw4zefY5DjRZg=; b=kC9Sd8tkrQ3cMdbGiUL48ZCxX4+E8oSp7rWvO8BLbLRHsStdz/BEkUYPRzaiwsH8qfoyJc W0k1ahYawcqOZzl9chNtdmeviUW0U7klFtTr/2pweQUHSSQHQgv7mUz7ggR2NbCBQ7V1KM Dl3huxChRJmofeVBLXAsRttZPDfjVUjKFpx5LIKGgUIa5PNcCNwlKl7jOHP9GNg7CVrbu2 Y0D/b1XZknCfrk1u9/1H3dxvl0m+l0TTMg30VDZq6QsHfZWnplkaufU/SGmSayqLyaU+HQ L4NHxuGy4B8U9qDOvB/d5HiyJJYz0Sx2lV0io5Y4YPiRqEugTyx30zvw7wg79Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861046; 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=NXnAsNQkTo92s7mLx/ERv2g6QQ1LuOyw4zefY5DjRZg=; b=d5H1iRaUqDaJ96UH3WCPlhKp08xmXFtRm52YCPTrwH3mZlcfMwLdwntMLFIc3nY6/bfHgd B4Zt7CpoR7kcXER+98SepmWNhi/tnz5HBiMOlKkoPtJssp6FU3VnK1H4lu/Ur2t0PgqiV/ DjeSEKfgc9u3Gl72/9E/sOP6AlNLqOq3cKtX5oPJSiJ4yP2M4aU8lVz+RCTejhHHf9vo9r PZ3FRz6fPMJO35roAH0xb1Sz1l8sGKQpatL7DSpn4h9O/PiNtATXLD/IYJyJPXJUJGe/dD 70ApN5dvzv47ejgGcMSxobIG9k3X5XeY1d6BGFu128R+2x02XJdxb+B4mYjEbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861046; a=rsa-sha256; cv=none; b=oxSmPPoIgmrRq6hzHpPOfJ5Vh4YqZo7NqxwDNCg8I1fmku6bJrD9iOfmFiXJFc6UfpZbu4 THfhO4keXV1WzemEC7QO+fKMIrc2yo6uzIzmhr9EmDUAZ/5ZYOt2G4krh8FV8XjcEczjw/ sAyx6HqDWN2wfiKcb7G68kbQHp1nWqQ3svIpNsC2aQNBj0z87c3YKQVhcv6DmN43SgH2Ds 34hP6DVR3XZXvb2H5Qx6PCTXDxirXD350wsYlCPMwUThJl0CB1qE4hi1Pao+15VIetbYwM ZBVofbHZcUQaCc4psYqNrgMJkVZKNo+XzR5mKC8qdFKExSpsI5++axRlm0wqOQ== 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 4dVl6G6MPmzrc7 for ; Tue, 16 Dec 2025 04:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b347 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:57:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 477c4645bbcc - stable/15 - libc/string: put source files list one item per line 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 477c4645bbcc4dce0e88587ffa6b583c6ff6899f Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:57:26 +0000 Message-Id: <6940e6b6.b347.6bdb870@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=477c4645bbcc4dce0e88587ffa6b583c6ff6899f commit 477c4645bbcc4dce0e88587ffa6b583c6ff6899f Author: Konstantin Belousov AuthorDate: 2025-12-03 23:51:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:01 +0000 libc/string: put source files list one item per line (cherry picked from commit 98b7cca0186dddfc775582a32b39052d05840858) --- lib/libc/string/Makefile.inc | 144 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 121 insertions(+), 23 deletions(-) diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index 5d4a9a6e3eed..13cff22b9a32 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -7,26 +7,93 @@ CFLAGS+= -I${LIBC_SRCTOP}/locale # machine-independent string sources -MISRCS+=bcmp.c bcopy.c bzero.c explicit_bzero.c \ - ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \ - memccpy.c memchr.c memrchr.c memcmp.c \ - memcpy.c memmem.c memmove.c mempcpy.c memset.c memset_s.c \ +MISRCS+=bcmp.c \ + bcopy.c \ + bzero.c \ + explicit_bzero.c \ + ffs.c \ + ffsl.c \ + ffsll.c \ + fls.c \ + flsl.c \ + flsll.c \ + memccpy.c \ + memchr.c \ + memrchr.c \ + memcmp.c \ + memcpy.c \ + memmem.c \ + memmove.c \ + mempcpy.c \ + memset.c \ + memset_s.c \ memset_explicit.c \ - stpcpy.c stpncpy.c strcasecmp.c \ - strcat.c strcasestr.c strchr.c strchrnul.c strcmp.c strcoll.c strcpy.c\ - strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \ - strncat.c strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \ - strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \ - strverscmp.c strxfrm.c swab.c \ + stpcpy.c \ + stpncpy.c \ + strcasecmp.c \ + strcat.c \ + strcasestr.c \ + strchr.c \ + strchrnul.c \ + strcmp.c \ + strcoll.c \ + strcpy.c\ + strcspn.c \ + strdup.c \ + strerror.c \ + strlcat.c \ + strlcpy.c \ + strlen.c \ + strmode.c \ + strncat.c \ + strncmp.c \ + strncpy.c \ + strndup.c \ + strnlen.c \ + strnstr.c \ + strpbrk.c \ + strrchr.c \ + strsep.c \ + strsignal.c \ + strspn.c \ + strstr.c \ + strtok.c \ + strverscmp.c \ + strxfrm.c \ + swab.c \ timingsafe_bcmp.c \ timingsafe_memcmp.c \ - wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \ - wcschr.c wcscmp.c wcscoll.c wcscpy.c wcscspn.c wcsdup.c \ - wcslcat.c wcslcpy.c wcslen.c wcsncasecmp.c wcsncat.c wcsncmp.c \ - wcsncpy.c wcsnlen.c wcspbrk.c \ - wcsrchr.c wcsspn.c wcsstr.c wcstok.c wcswidth.c wcsxfrm.c wmemchr.c \ + wcpcpy.c \ + wcpncpy.c \ + wcscasecmp.c \ + wcscat.c \ + wcschr.c \ + wcscmp.c \ + wcscoll.c \ + wcscpy.c \ + wcscspn.c \ + wcsdup.c \ + wcslcat.c \ + wcslcpy.c \ + wcslen.c \ + wcsncasecmp.c \ + wcsncat.c \ + wcsncmp.c \ + wcsncpy.c \ + wcsnlen.c \ + wcspbrk.c \ + wcsrchr.c \ + wcsspn.c \ + wcsstr.c \ + wcstok.c \ + wcswidth.c \ + wcsxfrm.c \ + wmemchr.c \ wmemcmp.c \ - wmemcpy.c wmemmove.c wmempcpy.c wmemset.c + wmemcpy.c \ + wmemmove.c \ + wmempcpy.c \ + wmemset.c SYM_MAPS+= ${LIBC_SRCTOP}/string/Symbol.map @@ -45,14 +112,45 @@ CFLAGS.memchr.c+= -fno-sanitize=address .sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/string/Makefile.inc" .endif -MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ - memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ - strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \ - string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \ - strspn.3 strstr.3 strtok.3 strverscmp.3 strxfrm.3 swab.3 \ +MAN+= bcmp.3 \ + bcopy.3 \ + bstring.3 \ + bzero.3 \ + ffs.3 \ + index.3 \ + memccpy.3 \ + memchr.3 \ + memcmp.3 \ + memcpy.3 \ + memmem.3 \ + memmove.3 \ + memset.3 \ + strcasecmp.3 \ + strcat.3 \ + strchr.3 \ + strcmp.3 \ + strcoll.3 \ + strcpy.3 \ + strdup.3 \ + strerror.3 \ + string.3 \ + strlcpy.3 \ + strlen.3 \ + strmode.3 \ + strpbrk.3 \ + strsep.3 \ + strspn.3 \ + strstr.3 \ + strtok.3 \ + strverscmp.3 \ + strxfrm.3 \ + swab.3 \ timingsafe_bcmp.3 \ - wcscoll.3 wcstok.3 \ - wcswidth.3 wcsxfrm.3 wmemchr.3 + wcscoll.3 \ + wcstok.3 \ + wcswidth.3 \ + wcsxfrm.3 \ + wmemchr.3 MLINKS+=bzero.3 explicit_bzero.3 MLINKS+=ffs.3 ffsl.3 \ From nobody Tue Dec 16 04:57:27 2025 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 4dVl6J2vJDz6K01p for ; Tue, 16 Dec 2025 04:57:28 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl6J08DLz3h9B for ; Tue, 16 Dec 2025 04:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861048; 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=EZUGbfUiOLf6XCJT5FNGF+IFCHgxrGROvaxaDLhxj5U=; b=QTYLA6dx6L24DsKd8nkOBhZLOSXs9VBqEumTSthuCk/Aglu3ONNHXQAZcGBeiIzcW2yalW sPeKqRuk25gKc/PJhdy44S2zj5Ao6Fd2ak4rDglkqLImB6aODClis8GDehc+sKFaAnbKct fukcXjz5SVBzWlLA9MsZrJsjs2xrVSO3RduCyhAg+nyEpuW1p7iZSQwRB5kkrINBUsvYU9 vk0XVq3dQF2N0avhU4rCICJYx5liN45tL466HVPujCKVrI+KOWK78MGLrltLbEOJLx8QVZ vSUqjB8x+LTK6gJVl1iTd70LHNFw5knWK+aL7z8B8nxzj8YxXpgWM2Q9GGOxVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861048; 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=EZUGbfUiOLf6XCJT5FNGF+IFCHgxrGROvaxaDLhxj5U=; b=Km8JIbC/uEk0Zc1R7dKZvKivPKPaue2sXnOMBW+NvOgNU07+pLs1HXzah8mjnRpYCbaGOA BcnrM56pi41C7XWF/3qiTxlJPo6wHLAPVuwIZQSHmGQ/BX/CH5agyF9QAZZxizPtCkxhez ttVB3TgtarCIe3rlL9kFOxcBoR4wGXjJd+GBQX99QBsvg7VMDjB9QU1k0T3RYtWr6znaMx u1Z8TPDXnhuGRKd4nDoXt2/SRn+ZfQ6hr22+vtS5l0W43QUMzW58QWsRQu7cke7WNK3Ivk U1Yq9Jenm06ihKD46ZhGPZk1veQoTy25YiMao0petTR/mqFGNF9izr4A03LAtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861048; a=rsa-sha256; cv=none; b=f3R9gbLhdGiWwPtLx3QbxpVHKiknitDo8wRo20XWgNKCmFzh0l8ci3r6xLwB151jLnPZiW 4Tq4zc7x41i07fC7zxuX7Tc40AtsP5yFhMatn0UAnCa9XHR7g73dnn8oDDOJ8R0oc7IGqg L4d/IDPgKLZ7lNSMPQ92DK7foMvQHUogrervQ4Cr5H3w8uok4SHHy044ZtLqQy9SBDOD/n sE0EbNdFncOxjV0r69SmDWKsovHC9328dmdZSYaFTaSYt51Q0aZuCAXDJcpEPApL+prrBU 2WM3faJ86isLsQNbxapHkK7TNp2YraV0eAFwepvXxtVIQKKQutVQXQn4RGDv/w== 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 4dVl6H6phfzrc8 for ; Tue, 16 Dec 2025 04:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b0ea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:57:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b2e649a0b98d - stable/15 - libc/string: add strdupa(3) and strndupa(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b2e649a0b98d110aa70c2d2d6cab919b9dd8e9af Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:57:27 +0000 Message-Id: <6940e6b7.b0ea.159a16fe@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b2e649a0b98d110aa70c2d2d6cab919b9dd8e9af commit b2e649a0b98d110aa70c2d2d6cab919b9dd8e9af Author: Konstantin Belousov AuthorDate: 2025-12-03 23:56:26 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:01 +0000 libc/string: add strdupa(3) and strndupa(3) (cherry picked from commit a98e5d78500193dc7aa352e1f60ac2c6529e2c38) --- include/string.h | 28 ++++++++++++++++++++++++++++ lib/libc/string/Makefile.inc | 4 +++- lib/libc/string/strdup.3 | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/include/string.h b/include/string.h index a3fa96ebb449..e9aa1b55281a 100644 --- a/include/string.h +++ b/include/string.h @@ -154,6 +154,34 @@ void swab(const void * __restrict, void * __restrict, ssize_t); int timingsafe_bcmp(const void *, const void *, size_t); int timingsafe_memcmp(const void *, const void *, size_t); + +#if __has_builtin(__builtin_alloca) +#define strdupa(_Str) (__extension__({ \ + const char *_Str1; \ + size_t _Len; \ + char *_Copy; \ + \ + _Str1 = (_Str); \ + _Len = strlen(_Str1) + 1; \ + _Copy = (char *)__builtin_alloca(_Len); \ + memcpy(_Copy, _Str1, _Len); \ + _Copy; \ +})) + +#define strndupa(_Str, _Maxlen) (__extension__({ \ + const char *_Str1; \ + char *_Copy; \ + size_t _Len; \ + \ + _Str1 = (_Str); \ + _Len = strnlen((_Str1), (_Maxlen)); \ + _Copy = __builtin_alloca(_Len + 1); \ + (void)memcpy(_Copy, _Str1, _Len); \ + _Copy[_Len] = '\0'; \ + _Copy; \ +})) +#endif + #endif /* __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200112 || defined(_XLOCALE_H_) diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index 13cff22b9a32..dfe4b4b55bec 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -174,7 +174,9 @@ MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ strcpy.3 stpncpy.3 \ strcpy.3 strncpy.3 -MLINKS+=strdup.3 strndup.3 +MLINKS+=strdup.3 strndup.3 \ + strdup.3 strdupa.3 \ + strdup.3 strndupa.3 MLINKS+=strerror.3 perror.3 \ strerror.3 strerror_l.3 \ strerror.3 strerror_r.3 \ diff --git a/lib/libc/string/strdup.3 b/lib/libc/string/strdup.3 index 576fa122b8d6..5968289f5002 100644 --- a/lib/libc/string/strdup.3 +++ b/lib/libc/string/strdup.3 @@ -30,7 +30,9 @@ .Os .Sh NAME .Nm strdup , -.Nm strndup +.Nm strdupa , +.Nm strndup , +.Nm strndupa .Nd save a copy of a string .Sh LIBRARY .Lb libc @@ -39,7 +41,11 @@ .Ft char * .Fn strdup "const char *str" .Ft char * +.Fn strdupa "const char *str" +.Ft char * .Fn strndup "const char *str" "size_t len" +.Ft char * +.Fn strndupa "const char *str" "size_t len" .Sh DESCRIPTION The .Fn strdup @@ -63,6 +69,19 @@ characters from the string always .Dv NUL terminating the copied string. +.Pp +The +.Fn strdupa +function is identical to +.Fn strdup +but allocates the memory with +.Xr alloca 3 . +Similarly, the +.Fn strndupa +function is identical to +.Fn strndup , +but allocates the memory with +.Xr alloca 3 . .Sh RETURN VALUES If insufficient memory is available, NULL is returned and .Va errno @@ -72,6 +91,7 @@ Otherwise, the .Fn strdup family of functions return a pointer to the copied string. .Sh SEE ALSO +.Xr alloca 3 , .Xr free 3 , .Xr malloc 3 , .Xr wcsdup 3 @@ -84,6 +104,12 @@ The .Fn strndup function is specified by .St -p1003.1-2008 . +The +.Fn strdupa +and +.Fn strndupa +functions are extensions, +taken from glibc. .Sh HISTORY The .Fn strdup @@ -93,3 +119,9 @@ The .Fn strndup function was added in .Fx 7.2 . +The +.Fn strdupa +and +.Fn strndupa +functions were added in +.Fx 15.1 . From nobody Tue Dec 16 04:57:29 2025 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 4dVl6K3Cxwz6K0CP for ; Tue, 16 Dec 2025 04:57:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl6K0mZZz3gp0 for ; Tue, 16 Dec 2025 04:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861049; 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=GTOo3ee1eGIwimFme6lasrg2xEwe0O6cDeK3uLzyR/w=; b=Xq4wx/YcUF1UWf0E8f4uuOdmEGZDwfebUvWORyZOfnMhuhEt0stDMK3h4sQkXBfvGGgbWs G9KKz3hhhx/DpiRf42OtdIzVWLaefRBwQu5p7A355GnfhqVJDzdXd+UXBIInzc6Kmz964z MCsw3+zvtVAPHYjLQxGeMYSy27SDMmRrklex3eLBpKJSnQ/Z2a7sSdkPjwRN6ZC1nm5Xnv X5GmmVAK2CwahZlrqCe8vlDtSncajAaW+W0cMyMUAg0QzoaiPalgY2AsdSyS8WkXok6oSJ Z+gzVwOSHQgbQRw2tdRcCGlSXILcH8HRUE5AZYQpwGYh43kpB/7zvx3ufN2yNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861049; 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=GTOo3ee1eGIwimFme6lasrg2xEwe0O6cDeK3uLzyR/w=; b=fGObjqnobDR7PN1qKR+e75cmoymvZ12TWogiKt4jrj7KN85ccZh/AYNKhq0S/nwjXan7iQ LnklQ3QoHs8p0ocaa+y/cV7v0sLqcgHj90N0/CcRb4r5sJpbev8Z8NHUoruUNQ7+PeazgH PwjbKSuRdA50DjTnFny+VkDilrFIYJXxy3+klQtSkTr4xcVmIDcyj3Z5s56wcNUy/Du2HL Bl8KhWtp+H4tL80tn6f35xbe113Li03KtlT2+s3IA5/S0Q9YNShESD4MdhBqEQyJMrL8YF BKVBYFTT7QPqRsShtlZ2NpIHs0qMtqndsgLyHUsHmMuajV5zIBpzwQZNeBVGFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861049; a=rsa-sha256; cv=none; b=lLkQ/yTkxihIGXW+awmxrJ47EIlIv6tFUuCMUca4euS1M7HBPOWbL3qkbDoOj5l8R9G8zn pDZ3FBWtzWBoUW8s16Vh9zvHYuI1zEc2nxaCB6Q+Izq+I51AfaeV4dOZY4v3WKbY7MCIh4 K5D3ZMsUaJLEszCnqMWhAHCUoVGXpiwWcea0NRlDl5hi0VNkG29eQDzCP1U49DfeqtNAxh tbBQ/9f7PeUOo46wXFJ1lOjWl+ioJdMww6EiLQuk2E5S30E4rH3MWWFdgYTF290oJixGzM WLmRbghfiEK8Uzr/1QY0o83TnOFCBDTXHsOs7cB26IrmWzyWxA/OtO72QNy3cg== 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 4dVl6K0K9HzrLv for ; Tue, 16 Dec 2025 04:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c17c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:57:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dd1a76f1d969 - stable/15 - ofed/libibverbs: remove strdupa() hack from config.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: dd1a76f1d96912bb52d8d0cbffd591fd3ee70cdf Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:57:29 +0000 Message-Id: <6940e6b9.c17c.295eb106@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dd1a76f1d96912bb52d8d0cbffd591fd3ee70cdf commit dd1a76f1d96912bb52d8d0cbffd591fd3ee70cdf Author: Konstantin Belousov AuthorDate: 2025-12-08 22:38:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:01 +0000 ofed/libibverbs: remove strdupa() hack from config.h (cherry picked from commit 6a75e3951506c12b42428a47710d07cadcdd723e) --- contrib/ofed/libibverbs/config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/ofed/libibverbs/config.h b/contrib/ofed/libibverbs/config.h index 88722ee1cde1..ee0ff8fb020e 100644 --- a/contrib/ofed/libibverbs/config.h +++ b/contrib/ofed/libibverbs/config.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ - -#include "alloca.h" +#ifndef _OFED_IBVERBS_CONFIG_H_ +#define _OFED_IBVERBS_CONFIG_H_ #define memalign(align, size) ({ \ void *__ptr; \ @@ -39,3 +38,4 @@ #define MADV_DOFORK MADV_NORMAL #define SWITCH_FALLTHROUGH (void)0 +#endif /* _OFED_IBVERBS_CONFIG_H_ */ From nobody Tue Dec 16 04:57:30 2025 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 4dVl6L5Q9Dz6K04N for ; Tue, 16 Dec 2025 04:57:30 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl6L2t72z3hG0 for ; Tue, 16 Dec 2025 04:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861050; 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=4FRtVyhYTNt0jwf42r6p2rwnhixwhuabizMloGakAuY=; b=tqMytJ47u9v8LtHBnoDSDjj2/HfyayowZf1eEeh+385cGyarKwmigrBVltcZUljfcTw1js rkOjE/e3oD+ca5xwcbWZDZYLXz52g/qVQ4zjqsieiGQAHM62WGsE/UiT1sDnraI/M1NCiJ IQklacPanShTTn7zLdk0J0kAk21Qzfz7dMqWQUo71CSoFWh+MG7dyWxdKI/pXn3CreCLsx dbYmvSRCUy/PKZ7og/USQtrfzYUvvn7iV8AfcOJRVIDcsw/MUKzIkgvb9LPeyrQzNmrt0o lAFkkf2L0nBNDjaImcHId1HzQK+rdd+hnec6BWNdcz7D9uMhUyl2MiZvIRxkpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861050; 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=4FRtVyhYTNt0jwf42r6p2rwnhixwhuabizMloGakAuY=; b=JtBO91l2vUuGQXW8vAawh6vqIX2MDWCO2XXiFG9KyCZuOAkSALrP8w2XrCSeXFIjQ2rrGK pI0tyE8I2wDU2f/nze1XLK5rDhib8fLgz6xEVvU7G/OFpbkuH0A3MN7PxV7EKo1I5AJ9sG rNJ5qRfWV4DEdwU9+aq1ez+TU3vQg6V2JKY0vpxnELc/FA8KEmuc2Bo98PjcPmRmjkPUwP gvbxMQDAqF6V/DbqKApKK3y07E9auy3SoDTWw0VPehFtF7Yt8QsJrlZo0JdLw5p7ANpjzE c0ELJ1CSHL/OvZYbqdK3ZA/pMq/iSQ4z2PoBqhhFbGiN/ILTXsxgSeQSjoDm5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861050; a=rsa-sha256; cv=none; b=ETWdUjQT/PpidCL9tO0nCvPTTeiDdgei0oiaUC/QRIYRHKXXlMxJ7XgLj7435KxAT1tIpf Yu6Xm0HX1KnxdkzrWbMJwtRz+TszUujKKGZE/KofsfjUyzsFHBCEciDSGk44zeZSbT9XlA PzYiuV9eCnjMMhaI2e5KD1C3LNN3EhAykkElwS+Qhbpyu2wxiJqz49LkDoy1Y9dZJS06+s UdbTjPAE7P5N9mvyJi0tCIDl/9pGyWgvXawyNHAZmfLpdkiMxkjcLgZK/gq7/a3Hdg/5kf 6FEejXfIRxkrYhx8NsTc6FuY/nqO/t9JqiXn6uGixzMzdCvrFeYqCiQd8CVU5w== 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 4dVl6L0sfKzrx9 for ; Tue, 16 Dec 2025 04:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b34b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:57:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 90c370615158 - stable/15 - ofed/libibverbs: remove no longer needed local alloca.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 90c3706151583a1efa51f8bc16c3fa4a503d0146 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:57:30 +0000 Message-Id: <6940e6ba.b34b.5726ef56@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=90c3706151583a1efa51f8bc16c3fa4a503d0146 commit 90c3706151583a1efa51f8bc16c3fa4a503d0146 Author: Konstantin Belousov AuthorDate: 2025-12-08 23:10:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:02 +0000 ofed/libibverbs: remove no longer needed local alloca.h (cherry picked from commit 70edd3c126a591dec129958d3e103521de84746d) --- contrib/ofed/libibverbs/alloca.h | 18 ------------------ contrib/ofed/libibverbs/cmd.c | 1 - contrib/ofed/libibverbs/compat-1_0.c | 1 - contrib/ofed/libibverbs/device.c | 1 - 4 files changed, 21 deletions(-) diff --git a/contrib/ofed/libibverbs/alloca.h b/contrib/ofed/libibverbs/alloca.h deleted file mode 100644 index b0311c066275..000000000000 --- a/contrib/ofed/libibverbs/alloca.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _LIBIBVERBS_ALLOCA_H_ -#define _LIBIBVERBS_ALLOCA_H_ -#include -#include -#include - -#define strdupa(_s) \ -({ \ - char *_d; \ - int _len; \ - \ - _len = strlen(_s) + 1; \ - _d = alloca(_len); \ - if (_d) \ - memcpy(_d, _s, _len); \ - _d; \ -}) -#endif /* _LIBIBVERBS_ALLOCA_H_ */ diff --git a/contrib/ofed/libibverbs/cmd.c b/contrib/ofed/libibverbs/cmd.c index df6af3933e36..af2ff7f21f64 100644 --- a/contrib/ofed/libibverbs/cmd.c +++ b/contrib/ofed/libibverbs/cmd.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include "ibverbs.h" diff --git a/contrib/ofed/libibverbs/compat-1_0.c b/contrib/ofed/libibverbs/compat-1_0.c index d63bd55cc09d..73170756ef65 100644 --- a/contrib/ofed/libibverbs/compat-1_0.c +++ b/contrib/ofed/libibverbs/compat-1_0.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "ibverbs.h" diff --git a/contrib/ofed/libibverbs/device.c b/contrib/ofed/libibverbs/device.c index 6ea7fc241ed8..c840be7cb140 100644 --- a/contrib/ofed/libibverbs/device.c +++ b/contrib/ofed/libibverbs/device.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include "ibverbs.h" From nobody Tue Dec 16 04:58:17 2025 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 4dVl7F68xFz6K0Cw for ; Tue, 16 Dec 2025 04:58:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl7F3jzvz3jrT for ; Tue, 16 Dec 2025 04:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861097; 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=oIQmfkLvMkaYO2/UDlEeGjqrAfVfyVsVcW+ECnDrz6c=; b=uI8gP9rnQqwcOokEShvpfFYtH79aEG6urPGkgQTR2euOvxj5ZaIE9rRwonjshYQFsGo5GH yPXDGKf+RQI+mZnCD0uXRDV2uIRxMmxJ1tdl8urgLEcnm4GNd7NspKioLqWlTib0AVtjgr IQexeLFSZXOAP+0KjbVcnmVKJ0fcwrfk0z/70rCPnBMs+69iIVhMZf5WparOEuwgLTd/UO VvOegi0aysURQXb7eTIzWWH2ojrNmZpbpaxi2PgI66YEEFIYVqeXYk4NvRnhF4wlER0joK O5Qrc2XYqkjj1LjmDWbK5MTl2hV5zU0GimD/blhWzKHzmkFpBHUD3xAh8tmATQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861097; 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=oIQmfkLvMkaYO2/UDlEeGjqrAfVfyVsVcW+ECnDrz6c=; b=vy7hVUeg219S2nW8hqF9nlab5snj1wwSpwpjQVB6sJ6ZQLyJOgpxHwxFbot/WfW8sGATJY BmqIlQSoET+dk0mlqHmFfTL5Y1RedO006zTqpkMgpDihMX+Fjor9Fh4WSv8OwM14H0iaLf dqsFBNsrpgdJlmpBKuc8nAXZTO4FpgiYL3VVP5+QBJLk7EAbnOWs6WImPS8aNtXF9SG6BY u378mm8FIz2xE198CRow/upk4djuvXgtRW7iOl284Rnl+7czFfjHeq61V3gPKdi04uQxfI erU1l5CxR1EmRlE63WbA9IjCSqcnWiW2CS0xvyzjF5LNOfBdMuhAKg167xaC/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861097; a=rsa-sha256; cv=none; b=cmM9c8ME4wrlFG6G+xLPM6dfLFVIiHqXmrMwq+0Ms6fXDj5XwDWOMb1kg5e8uWEO2GRpVh QclylX7a62z7d4nXg8wpuqYpgC5XEw6aYlVFtLNoc4uDIYhSp4zXOS+DSxg52NqC2zass/ TvxANNgeJ1tYLdaNGuo8JXbaoP0bGO0aAmV3sYJlWhSzGvDSCG1sh5EwK0SLIcuv8aPx93 O8xPknmjHsRMCY0WPSTD0u1aerMKS3pSXJh3ijLPvBZQBzS7N6+B0STKTTYSj2YOcaDpsq agmkGbfoV5InL+NrxQX4Kt4hc9TBTyJ01lN3upLxKBVmEqz+xR1e4ZLCvnR1ag== 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 4dVl7F2fkQzrJQ for ; Tue, 16 Dec 2025 04:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c217 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:58:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 242f545e4e31 - stable/14 - libc/string: add strdupa(3) and strndupa(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 242f545e4e31b7fd49f4afac99531adebde55fce Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:58:17 +0000 Message-Id: <6940e6e9.c217.466ecde6@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=242f545e4e31b7fd49f4afac99531adebde55fce commit 242f545e4e31b7fd49f4afac99531adebde55fce Author: Konstantin Belousov AuthorDate: 2025-12-03 23:56:26 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:52 +0000 libc/string: add strdupa(3) and strndupa(3) (cherry picked from commit a98e5d78500193dc7aa352e1f60ac2c6529e2c38) --- include/string.h | 28 ++++++++++++++++++++++++++++ lib/libc/string/Makefile.inc | 4 +++- lib/libc/string/strdup.3 | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/include/string.h b/include/string.h index a362dc9e0f3f..e7fd3db0f0fd 100644 --- a/include/string.h +++ b/include/string.h @@ -149,6 +149,34 @@ void swab(const void * __restrict, void * __restrict, ssize_t); int timingsafe_bcmp(const void *, const void *, size_t); int timingsafe_memcmp(const void *, const void *, size_t); + +#if __has_builtin(__builtin_alloca) +#define strdupa(_Str) (__extension__({ \ + const char *_Str1; \ + size_t _Len; \ + char *_Copy; \ + \ + _Str1 = (_Str); \ + _Len = strlen(_Str1) + 1; \ + _Copy = (char *)__builtin_alloca(_Len); \ + memcpy(_Copy, _Str1, _Len); \ + _Copy; \ +})) + +#define strndupa(_Str, _Maxlen) (__extension__({ \ + const char *_Str1; \ + char *_Copy; \ + size_t _Len; \ + \ + _Str1 = (_Str); \ + _Len = strnlen((_Str1), (_Maxlen)); \ + _Copy = __builtin_alloca(_Len + 1); \ + (void)memcpy(_Copy, _Str1, _Len); \ + _Copy[_Len] = '\0'; \ + _Copy; \ +})) +#endif + #endif /* __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200112 || defined(_XLOCALE_H_) diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index a18eb62fddb8..689af376ec07 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -76,7 +76,9 @@ MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ strcpy.3 stpncpy.3 \ strcpy.3 strncpy.3 -MLINKS+=strdup.3 strndup.3 +MLINKS+=strdup.3 strndup.3 \ + strdup.3 strdupa.3 \ + strdup.3 strndupa.3 MLINKS+=strerror.3 perror.3 \ strerror.3 strerror_l.3 \ strerror.3 strerror_r.3 \ diff --git a/lib/libc/string/strdup.3 b/lib/libc/string/strdup.3 index a19a00f5430b..b48d88d4bac2 100644 --- a/lib/libc/string/strdup.3 +++ b/lib/libc/string/strdup.3 @@ -32,7 +32,9 @@ .Os .Sh NAME .Nm strdup , -.Nm strndup +.Nm strdupa , +.Nm strndup , +.Nm strndupa .Nd save a copy of a string .Sh LIBRARY .Lb libc @@ -41,7 +43,11 @@ .Ft char * .Fn strdup "const char *str" .Ft char * +.Fn strdupa "const char *str" +.Ft char * .Fn strndup "const char *str" "size_t len" +.Ft char * +.Fn strndupa "const char *str" "size_t len" .Sh DESCRIPTION The .Fn strdup @@ -65,6 +71,19 @@ characters from the string always .Dv NUL terminating the copied string. +.Pp +The +.Fn strdupa +function is identical to +.Fn strdup +but allocates the memory with +.Xr alloca 3 . +Similarly, the +.Fn strndupa +function is identical to +.Fn strndup , +but allocates the memory with +.Xr alloca 3 . .Sh RETURN VALUES If insufficient memory is available, NULL is returned and .Va errno @@ -74,6 +93,7 @@ Otherwise, the .Fn strdup family of functions return a pointer to the copied string. .Sh SEE ALSO +.Xr alloca 3 , .Xr free 3 , .Xr malloc 3 , .Xr wcsdup 3 @@ -86,6 +106,12 @@ The .Fn strndup function is specified by .St -p1003.1-2008 . +The +.Fn strdupa +and +.Fn strndupa +functions are extensions, +taken from glibc. .Sh HISTORY The .Fn strdup @@ -95,3 +121,9 @@ The .Fn strndup function was added in .Fx 7.2 . +The +.Fn strdupa +and +.Fn strndupa +functions were added in +.Fx 15.1 . From nobody Tue Dec 16 04:58:18 2025 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 4dVl7G50jFz6JylR for ; Tue, 16 Dec 2025 04:58:18 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl7G3wQhz3jq0 for ; Tue, 16 Dec 2025 04:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861098; 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=CpROGijdH8j6Vcq5h4UZ8jHwdvRF5PQUQLiZojrYBLg=; b=j5TX/CpUvSNY6+u9vzv9qHsja/sLrLBeUO2CNDzP7ZeKZ+4A2th/ohJDYTNeWOjVTkWXZl miy5G2RrUuom8X0bZSFYW5gV0Qux6YyOXlHKpMoqLl8g27DTiKkPH769BWX1pq2teOslhe rsHRzwRof8xHD2sCScBL3SmNaJztMgm4D+ZIDdt2SUJXnpYFRxt1e7ON7SXTvtmLKxmxJ9 WlxERm1GeIY3nH1v4KJSaQ6X9zJBV226905MsKPTqtSRPM1RtEjUL+6P3hQFKsTgQfJpMd PIpbYHQJ//F1awzwvu4vn2N/3fd5x4cBdtpaz6ezr7Ozmtj8+pTlL9TjbORgdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861098; 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=CpROGijdH8j6Vcq5h4UZ8jHwdvRF5PQUQLiZojrYBLg=; b=XoyUp//MD8WesJE8EgSA/1QqCYBJZUuALbd6khEPARvs6EnnnVsKsLxumlDOyAc5DRIGuW dCGcx2wWd1sg6wPvPMQT5xB6fkjVTh9c7NmYp7/jVS//f4H9e578tVPh3wB6Dnl7UXFXLi Wury6hx6DJ9aDZ5Zjr17A+Y17Kmtcu0bE7AOxGqTp56xiVyzdaUDCb77GkvH6PY58xNUKO ua9qkmbDurDCAOgwANX/zocoxSIDliqF2XTakHiV4fY2XGMLd9Mp+xUAaG4vRWg5kekrWE Ntihvuqeqrg//hFwr7e1LUXsORxOykt47263QcQ/8dX1s1UaT7uUU8ia8Md9vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861098; a=rsa-sha256; cv=none; b=Wz18FSeh2aNQ336LEmrLqZ/X3awMKTiduPs+zrFKleWADIeI+m93h/r9VLG/7W8TCBIvq9 iEoJkjfWo+C58trI0DOyK2ojV1nZoFyVsW+yzQLfyCq8vETOpUWkJiHpSC+YAtK73Kp/zo ZJ2INrdhNp+27wEUKf44VWUl/zQCEt/BYFks1WUStRyTuwI2YrofvsR+oaikgjYc4lDu+K d3rjrVXOnWZOybNRx6gq7gEdHiFzJIvPHF/ARMGtuShWGV63p+7dSY8GcMdI2TssKMmaxF HhHv3nA3xLDZlyeVTj0aahJTJ8vSbIiXFw154m6xaTwZasRyh5/4dsUZp0NDgQ== 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 4dVl7G3Sp0zrcB for ; Tue, 16 Dec 2025 04:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ae96 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:58:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0cfd862d4769 - stable/14 - ofed/libibverbs: remove strdupa() hack from config.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0cfd862d4769471ac98a08792f959ae9166a1f90 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:58:18 +0000 Message-Id: <6940e6ea.ae96.5fbc3f4a@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0cfd862d4769471ac98a08792f959ae9166a1f90 commit 0cfd862d4769471ac98a08792f959ae9166a1f90 Author: Konstantin Belousov AuthorDate: 2025-12-08 22:38:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:53 +0000 ofed/libibverbs: remove strdupa() hack from config.h (cherry picked from commit 6a75e3951506c12b42428a47710d07cadcdd723e) --- contrib/ofed/libibverbs/config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/ofed/libibverbs/config.h b/contrib/ofed/libibverbs/config.h index 88722ee1cde1..ee0ff8fb020e 100644 --- a/contrib/ofed/libibverbs/config.h +++ b/contrib/ofed/libibverbs/config.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ - -#include "alloca.h" +#ifndef _OFED_IBVERBS_CONFIG_H_ +#define _OFED_IBVERBS_CONFIG_H_ #define memalign(align, size) ({ \ void *__ptr; \ @@ -39,3 +38,4 @@ #define MADV_DOFORK MADV_NORMAL #define SWITCH_FALLTHROUGH (void)0 +#endif /* _OFED_IBVERBS_CONFIG_H_ */ From nobody Tue Dec 16 04:58:19 2025 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 4dVl7H6d0gz6K0D8 for ; Tue, 16 Dec 2025 04:58:19 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dVl7H4kvVz3jtZ for ; Tue, 16 Dec 2025 04:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861099; 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=SafVZP6th8L0hfJJWviqh+zeRbPWnmzvmC2HdLNIz1c=; b=lv9Ux8hP2D3F+cBb8FvSO9iwfaYAMwCQAp0uGZ2VuHlHfcUIR60EO4TODZYQXLCjZd/3Zh kEuL3wExhtw7tHynZ7bYBgWkDrPHEejkx+KTzC7htDmumzhzMtBCiNBzOiFcZ9yNM50FdE GRDafq5M4kk2QT+IzoSlqB/LWM3s0qFwWht43A1B8OpX+vtZ0hDmfxSKGD3JIlssOtp9W4 rHnuOBJHQEGodJonul9aNHWdGhD4oG8QXJmqg/dkPTIbB2Fyz4xOi43zM3kL/uS2az6hot RlRAJpkeQarfJhX4MlFHPC9gP21nBDV1mQtgCDDG5F3p4dEqsHvOtmg1aX8EDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765861099; 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=SafVZP6th8L0hfJJWviqh+zeRbPWnmzvmC2HdLNIz1c=; b=rraeuxh4dAG7JFkxUaOkgRu7Afxmovo+1nWZvju+p2+vlwL3rNr2l9+Byn9vZH0BaKtM/h EwhzSPAMNZal6gluu23nKVZckWF6I6nBjF8cFEHIv20Bk2wM/wQKuqTEN8EpGlyKHBL4QP umECulRlrvR17aKf51oeekZ4TL31sUdbbeOCfYmUhDRv0q0VKgWNp0q2mJFWuLNyA5VX00 UXWxyasxN74/qnNUjnwhtBRGwZjbk//phktQbMUaRSG/HJGajG1wZ9qJ8s2EGIpr+9xciI GjoQSwp8+YZtECOjEnA9JtHC3RSQfKAoOL61GiSce1dfi/MkpiobDyQ0FU1FqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765861099; a=rsa-sha256; cv=none; b=sRwa7wpcam9h2YomyU4usztCieQLyZizd6OuAJ8AClDhLFKa4uXdEgMWqxAE/1TU7pZDAG lbvaCsjkwkwwij23DM+c2IpG6K7VatInS3s+RnyRwry1K5/dAtetQoy0FtnmCbrKLRP/UF JT/Y2d/gkVJPpmDwplomwPqic3pN/x5LeHnXnBYhGXyyxHvY0N2njVyGuqE/J9BUI1Kk1X 3kwy4cchFOsbAaD/dOMsKB+dYPADQf5IDMdd+uvEKiY5Ir8bEISKFtiTe6CHXzBsjh9EQW anQ71bBMNno1VpgznUn/I1wb/4cykJpeRcY+e/lIjExueZfXJkH64H21ORa/1Q== 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 4dVl7H4H99zs28 for ; Tue, 16 Dec 2025 04:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id be81 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 04:58:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e5fbddef958d - stable/14 - ofed/libibverbs: remove no longer needed local alloca.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e5fbddef958d3ce81bf338def30a94c404762047 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 04:58:19 +0000 Message-Id: <6940e6eb.be81.19e4a158@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5fbddef958d3ce81bf338def30a94c404762047 commit e5fbddef958d3ce81bf338def30a94c404762047 Author: Konstantin Belousov AuthorDate: 2025-12-08 23:10:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-16 04:57:53 +0000 ofed/libibverbs: remove no longer needed local alloca.h (cherry picked from commit 70edd3c126a591dec129958d3e103521de84746d) --- contrib/ofed/libibverbs/alloca.h | 18 ------------------ contrib/ofed/libibverbs/cmd.c | 1 - contrib/ofed/libibverbs/compat-1_0.c | 1 - contrib/ofed/libibverbs/device.c | 1 - 4 files changed, 21 deletions(-) diff --git a/contrib/ofed/libibverbs/alloca.h b/contrib/ofed/libibverbs/alloca.h deleted file mode 100644 index b0311c066275..000000000000 --- a/contrib/ofed/libibverbs/alloca.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _LIBIBVERBS_ALLOCA_H_ -#define _LIBIBVERBS_ALLOCA_H_ -#include -#include -#include - -#define strdupa(_s) \ -({ \ - char *_d; \ - int _len; \ - \ - _len = strlen(_s) + 1; \ - _d = alloca(_len); \ - if (_d) \ - memcpy(_d, _s, _len); \ - _d; \ -}) -#endif /* _LIBIBVERBS_ALLOCA_H_ */ diff --git a/contrib/ofed/libibverbs/cmd.c b/contrib/ofed/libibverbs/cmd.c index 0a9cc3831d41..b157dd1a8ddc 100644 --- a/contrib/ofed/libibverbs/cmd.c +++ b/contrib/ofed/libibverbs/cmd.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include "ibverbs.h" diff --git a/contrib/ofed/libibverbs/compat-1_0.c b/contrib/ofed/libibverbs/compat-1_0.c index d63bd55cc09d..73170756ef65 100644 --- a/contrib/ofed/libibverbs/compat-1_0.c +++ b/contrib/ofed/libibverbs/compat-1_0.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "ibverbs.h" diff --git a/contrib/ofed/libibverbs/device.c b/contrib/ofed/libibverbs/device.c index d5cd2173cd8b..48f3f90d2330 100644 --- a/contrib/ofed/libibverbs/device.c +++ b/contrib/ofed/libibverbs/device.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include "ibverbs.h" From nobody Tue Dec 16 14:55:12 2025 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 4dW0N05z0Dz6L4HD for ; Tue, 16 Dec 2025 14:55:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dW0N03J3gz3q8P for ; Tue, 16 Dec 2025 14:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765896912; 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=KPQcvgNytT5xVpYOvQoEzzRijuOfWWOZWwlb6rKfF50=; b=nhdR8u6xHNCEq4+eumEp9TC5ev+Hk8tskQ+NjWjI83DgHZZrYn0b18om1xdkWEPXZd9uVz nY/lhf4HjlQaYn3FwinRYSsrz4Bl736gn/2C3BL7BfO0s3PNQcvBj2Cn5Cv3UO6q3FynQi OEsdSNZfq3WNzjxuF10L8hUlw9yKnZIgoCtdEdYEmf5Znm9tOej5NBBaky6TpdkS7qq7DQ YtLM07QKvrS1aYzvzuPRw6TsT69hTcRrqfnW1Mb+8Kw3DwyoPhlv26pjQAkqD88j5pG4pu 4Czh3cHfvCfj8SMMpr+2WEjv6ouPgCTDrrZ1yK3kEXAnrq9IF0QG5NEoO/lCGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765896912; 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=KPQcvgNytT5xVpYOvQoEzzRijuOfWWOZWwlb6rKfF50=; b=p7xN/KWRSMQ+nD/iyPPdD/xKXJYKToUjTEdPFr6Q40v7Iq9TwJEOKeNAq+wfFAFsRdqrxL ZfAXRLEOdxHgiorhsjciS9tdDY+OPcxFzzc96rZO3hvBZyjGebzvaHX8pnqB0PTZbNm8vT WamLT3byE1/ig2FpagVn8ROl0IEcIggti2W+b/5sqZBC8vpoO2Kvb7NkLEAqdhi7ILS7Y/ lLtK+MTusha8t9GVmblj1gOEGTVCM1qQhAoXeBD/0dcoK9hkhyanNDztqtiNmSG5Vr4DUn sGkmOuYg+z/FWBGWIrzKZkj4HT7OOwrQbAxskoi3l7qWSaVTISZcV6OwDmryQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765896912; a=rsa-sha256; cv=none; b=wohDeAH+ENuwAF8SF22yZsJcbjVi1aJ+56deFKkuVlmzvzy6P4hao2m7AgG0+Vl4finrBT 9JSNW6ndwNR8X7MTtN+4rKitBE+8oz9byv5NFESXR1DVvAXzBtk4SACtVsJnBDJDKP33zO C4PGq/aE51Og5bxKbN0YaJSrR3ZdmsBlx7pYlva+/TiKFL5Mi40iOINZM+KNkxkxcr9Itv mU/oxPm4DUGIaRNAX3wmBgqm/g/c1Glz87m8CEVGzbfQ0ec3g1bpefoiBrLlHqyUXCyo2X iyYaGvkuuzcgu7Y6kBQ8eEARdlFrWCGpsgUQdmmaUW9qUWqMDpIT7RTHKX8pxg== 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 4dW0N02cjKz19Df for ; Tue, 16 Dec 2025 14:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f472 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 14:55:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: f327af946e9c - stable/15 - trim.8: minor update for manual page 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f327af946e9c57551f6aaef2c747f970342f8940 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 14:55:12 +0000 Message-Id: <694172d0.3f472.5dd9a1ee@gitrepo.freebsd.org> The branch stable/15 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=f327af946e9c57551f6aaef2c747f970342f8940 commit f327af946e9c57551f6aaef2c747f970342f8940 Author: Eugene Grosbein AuthorDate: 2025-12-09 14:47:26 +0000 Commit: Eugene Grosbein CommitDate: 2025-12-16 14:55:03 +0000 trim.8: minor update for manual page Further explain that trim(8) is not for trimming free blocks in populated file systems/ZFS pools, as people still take it wrong sometimes. (cherry picked from commit dbc4a1c69191909a7210cad6da46b755557d0d34) (cherry picked from commit b2f8d46d898fb50222aefca47d687a852c647b2f) --- usr.sbin/trim/trim.8 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index eef369703715..caef15d98c13 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 1, 2025 +.Dd December 9, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -51,11 +51,21 @@ utility erases specified region of the device. It is mostly relevant for a storage that implements trim (like flash based, or thinly provisioned storage). .Sy All erased data is lost. -Alternatively, refer to the +.Pp +The +.Nm +utility should not be used upon mounted file system or active devices +being a part of imported ZFS pool or other software RAID, and the kernel +does not permit such usage generally. +If used upon not mounted file system +or inactive device, the +.Nm +utility erases blocks non-selectively, whether a block is occupied or not. +Refer to the .Xr fsck_ffs 8 command having a flag .Fl E -to trim populated UFS, and to the +to trim free blocks inside populated UFS, and to the .Xr zpool-trim 8 command to trim existing ZFS pool. .Pp From nobody Tue Dec 16 15:22:48 2025 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 4dW0zr5Rxjz6L6Kg for ; Tue, 16 Dec 2025 15:22:48 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dW0zr3NSmz3tPC for ; Tue, 16 Dec 2025 15:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765898568; 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=cKI61bcIdrRUeqEDk1606QOPukTgGz9tCh8KzNdMqsg=; b=DZyl0eL3cog9xBZ66Jei9AsUzaj1RROsOOQUvQf/WFDL9hIo4vq2F3B/G9cyqn1daDjWHz rrt/bNGctUpnCp0noCyLdXqaVfQS4SumRgQMHrW391A2MYbkZwMSELkRFtKhRkpG4duRfi NBs2ZYZidzZRInedB6QavEn1VjsH4+9YkKAdbLYX2Qw2q5iwFE/EqPYx9qrJX6dgup+0Hg mgJ2peWhfB4Ny9FL1B/aeyeVS908jJT2LCb10BJZSnIoK2i9ebxOqdsBiiYigz8hFEfUPD R1ZZvXH1kCHS6pcUA5rGutdrSUqDPrBl9SZZA/VjB3hhGVU/pPCWOESTMPLP7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765898568; 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=cKI61bcIdrRUeqEDk1606QOPukTgGz9tCh8KzNdMqsg=; b=CaFzlQYZ1BHg+aHwRrYvlJ/vDwoT7I1HcbynOBjXRUVEVRfKS8S/lE1j04VInNWmdH9+KJ LIkKAcfRXIz+iSTUlgYMjTaMRrT82+uZhtp5k3i/DT1fY4MqxP6jYGbFF2rt/rmTDkl3od ECEcUWdNaE/D00iAq0WNyS808vkVUyxe0vQjMGXzS/1dP7i+z003Wi4Ws2kbV7v7Z8g8t2 BpIdTyS8GV0bSH7nPe4752uyeUYMqjduDAGp0RCsXtxSohWokLzf1kZO7ALLxhFKpzbO1v WvhXiz7kcA8sHtFX0+BAjhS3HzJSQkj2vw3ZmMKErapk1vQvP8oI7PDSecfFkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765898568; a=rsa-sha256; cv=none; b=xYRUgdj9GaW5Pjr0bA+AcNAPilvpylA1CZSAJrqcnW5HvhMEWyeJ57h76giGGBYQp1D+9y wkrpl2vLc0V1gDeLyspDZJLS2k2BoXYBAulMsa3O/uHS3CmY4bPfQzqLD/nGMtwBRk9qU7 pwsFExbtKCAA8dwCN4yTaLpTBbGo75ypUMObpj8DMUWdLWhLl80+i/ejYNJlGdvrbRdxaX 5A+x3Cd0rKZr7H+y+poOIqX4mgEOzIJI6sbgMkw4/5LBayH3npA42B4Pc6/EmQx6SxlR1n JatFm5vF7fqsqqMHENHrp6btNrZH2g+pRSOunrF6XLcpyDF0dxLmd5TknN1X+Q== 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 4dW0zr2zSNz19qV for ; Tue, 16 Dec 2025 15:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41845 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 15:22:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 81b68da9d428 - stable/14 - trim.8: minor update for manual page 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 81b68da9d428c9e3fed8ed7e3115cb2c5fa6fa52 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 15:22:48 +0000 Message-Id: <69417948.41845.3297d264@gitrepo.freebsd.org> The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=81b68da9d428c9e3fed8ed7e3115cb2c5fa6fa52 commit 81b68da9d428c9e3fed8ed7e3115cb2c5fa6fa52 Author: Eugene Grosbein AuthorDate: 2025-12-09 14:47:26 +0000 Commit: Eugene Grosbein CommitDate: 2025-12-16 15:22:12 +0000 trim.8: minor update for manual page Further explain that trim(8) is not for trimming free blocks in populated file systems/ZFS pools, as people still take it wrong sometimes. (cherry picked from commit dbc4a1c69191909a7210cad6da46b755557d0d34) (cherry picked from commit b2f8d46d898fb50222aefca47d687a852c647b2f) --- usr.sbin/trim/trim.8 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index ebb8b927cd91..b4799399e110 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 1, 2025 +.Dd December 9, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -51,11 +51,21 @@ utility erases specified region of the device. It is mostly relevant for a storage that implements trim (like flash based, or thinly provisioned storage). .Sy All erased data is lost. -Alternatively, refer to the +.Pp +The +.Nm +utility should not be used upon mounted file system or active devices +being a part of imported ZFS pool or other software RAID, and the kernel +does not permit such usage generally. +If used upon not mounted file system +or inactive device, the +.Nm +utility erases blocks non-selectively, whether a block is occupied or not. +Refer to the .Xr fsck_ffs 8 command having a flag .Fl E -to trim populated UFS, and to the +to trim free blocks inside populated UFS, and to the .Xr zpool-trim 8 command to trim existing ZFS pool. .Pp From nobody Tue Dec 16 15:40:51 2025 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 4dW1Nm2TzKz6L7mS for ; Tue, 16 Dec 2025 15:40:56 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dW1Nm1lVwz3w4m for ; Tue, 16 Dec 2025 15:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765899656; 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=cFTz8abbeh2d/3cfx+dt3Qm2oHX+R9xyOS839pFCUng=; b=nuZgxqrOS5833ENQzc7VLqzDOg8KNQ1VAHDb+LLs+YXN+LMKP3VYxNyRP6Y0zIqzsXanWU Eqt4oXELEu+S2JG3vpM7ekRVgLc07wOQTN+hLqxBecWFqoQ+yrhCegFohCx57s60/CXltM 2cni4WXyY4XkH2lRDDTMCSh/sz6iZ4u232UmLjnGaHnMxoKbtbmr+eVs3CJ9TC48MiJfB5 BefYUYeqgzryF2YcG5EdkxMoBcndiEHFQjcGYnIR7qoYSvJvxmiSnxegnZU1Bl3aLo8/Rw XhvnRLwe+fRqdjgI7Anq72pSWmB6rwqePK/JMEu0Yng2nNZu4QHpqBNrfC5Y7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765899656; 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=cFTz8abbeh2d/3cfx+dt3Qm2oHX+R9xyOS839pFCUng=; b=EQm0+AHKPNFYr65IlvLgUUV0ZJ9wr0Ppj/IO5E9LKOkXPRTNCYhauJ3RQwCLR+OGHi2fB4 REtz8Zj3cPIRduLI6mGJSsWnlJHE2gFMBHLLSSXL+vJmLM4kSM8iZx2xBP5U5I4UZGpVco 4pDssOOQ3Icsx9H77s0oWfBSFNGvKeaKokmGUoIgphZW4casfctgEmhc5jh5tbbhOM3tBc Kb0/XPUwHP6O91zRDTCwNLg5TQ3CA2m2sSsJHnc/y8XS4N0zxjqITYvphL0RLvD/vOxsN3 oE3ywK/mKFjc6lJ3xqdr4bDsAsPGfXMS9u7C86NzAkZ71Q4opbchd6Nya19DMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765899656; a=rsa-sha256; cv=none; b=t7n8CTI/fhxX5I6p88nkE5HJWrgKJYFvieR2nqbkR5hM+MyGZNleX3jkQEjRdrAqPfKJwe PlNXkB9FsQFtm2saiX+iaZLSb4rgghnr2texfK4eJvBt5nXuHpNKQJ44VUu7BE7qIo6WYo /MaxMAO02Xh+YCKT6OdSFt/i6LZjSbdIH9jZdI5QIy9xwxBVi3+hCiS53Ags2d/l621jwt DdBe7Bm3hb2RhHZ4mmJPAh9fLI/0pMOa+HtSY/hlBaJfw516ZOtXzsu7y1Jnidm+hVttTZ Bmi3iAucGtr58jcT1QQ58IxVIwroLiSuyixc8MAR9XXIJtJolh1u9VJ97zsyBw== 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 4dW1Nm187sz1BYR for ; Tue, 16 Dec 2025 15:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44603 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 15:40:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8f84fdda4c78 - stable/15 - bsdinstall: Limit default swap to maximum supported by kernel 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8f84fdda4c788d63cf0bb0bb19962a0ebcf2e6a4 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 15:40:51 +0000 Message-Id: <69417d83.44603.48566f9c@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8f84fdda4c788d63cf0bb0bb19962a0ebcf2e6a4 commit 8f84fdda4c788d63cf0bb0bb19962a0ebcf2e6a4 Author: Ed Maste AuthorDate: 2023-03-06 20:24:05 +0000 Commit: Ed Maste CommitDate: 2025-12-16 15:40:40 +0000 bsdinstall: Limit default swap to maximum supported by kernel PR: 251993 Reviewed by: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53106 (cherry picked from commit 52f9722e6ffff6fee309e6040b7b5313499a03ef) --- usr.sbin/bsdinstall/partedit/part_wizard.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c index 90a8da1c3c9b..9146a2af782f 100644 --- a/usr.sbin/bsdinstall/partedit/part_wizard.c +++ b/usr.sbin/bsdinstall/partedit/part_wizard.c @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include @@ -41,10 +43,29 @@ #include "partedit.h" #define MIN_FREE_SPACE (1023*1024*1024) /* Just under 1 GB */ -#define SWAP_SIZE(available) MIN(available/20, 4*1024*1024*1024LL) static char *wizard_partition(struct gmesh *mesh, const char *disk); +/* + * Determine default swap (partition) size in bytes for a given amount of free + * disk space in bytes. The algorithm should likely be revisited in light of + * contemporary memory and disk sizes. + */ +static intmax_t +swap_size(intmax_t available) +{ + intmax_t swapsize; + unsigned long swap_maxpages; + size_t sz; + + swapsize = MIN(available/20, 4*1024*1024*1024LL); + sz = sizeof(swap_maxpages); + if (sysctlbyname("vm.swap_maxpages", &swap_maxpages, &sz, NULL, 0) == 0) + swapsize = MIN(swapsize, (intmax_t)swap_maxpages * getpagesize()); + + return (swapsize); +} + int part_wizard(const char *fsreq) { @@ -383,7 +404,7 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, return (!retval); /* Editor -> return 0 */ } - swapsize = SWAP_SIZE(available); + swapsize = swap_size(available); humanize_number(swapsizestr, 7, swapsize, "B", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); humanize_number(rootsizestr, 7, available - swapsize - 1024*1024, From nobody Tue Dec 16 15:49:57 2025 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 4dW1b96vDtz6L8Pj for ; Tue, 16 Dec 2025 15:49: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dW1b95rkGz3xFm for ; Tue, 16 Dec 2025 15:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765900197; 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=f+3sLeSor8YqDljytQJknutGeu8UUWDVm1tx8S/dM0A=; b=dmat8o+BzYV2uLKduOm26EYUDUp6TW9oYxBpFbEsHyXixUKdhrY+3kAGO+j0hPuqlGhv7q IC0b+vXRwOv7LmZaiHeIKGq387gAi+WWiwUtixDkRLF4uOx4CEpSm8elP4tPqpzz2Aninv PMgDHZCekKfYXcwW8/NoFn+zvzycIlJgXHkRXd6P5eNLDs18EP8/1YK12GlV/5SiPw4PV1 WF/1iI70Jpfahqqr8FDn38CcTQ4R2bnEubTqy7r4vjbMUzulnaXy/WhpEJjnosWU9EtDX+ 2EFVTi5BGBxnb2xpiVfUOtG2DcteEZvYFhgtSSwfqL23fBb0e/CficmbkeREnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765900197; 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=f+3sLeSor8YqDljytQJknutGeu8UUWDVm1tx8S/dM0A=; b=Iyp0YLJUHu8pp8QgWm/+zXVkQy9LK0erk+N+aa2pfEhOItAF+gp8lJyE2nd7l0JSSxaKC4 bov51QeWJPvJOELN6YNAOTAkD+OaW5QB1ycrTNK57UrIBe7z2aCvY8LGl/xq/gnWbGeQ8z Cr0NfrLrht+8/n+HSfHXUvmOJ0d+brynePli2Twu2wH9KglImqoB1uyjyWFYXLoqHf0XZk fLoD4qZE8UW1wxxgOONNuh5fU5CURL3OPOYfeMcyto5P5/P8N7YPS4Tmeas1H3v1g6VL5t dJcRVjYd8pc2PRHyZeC7/nDV6QzN+TuH/hkAQ5mB0b52JWO6RVk9p9zb9MdvHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765900197; a=rsa-sha256; cv=none; b=TQRKFJQ9L209jeMfM/tHKBVvX8Ykqx+AF6TsBmV133p15kq+IH+Eg1z9TCnGqWd8n4gQ2y 70htFfQGPssO850SlFwTPc93F7hHVjRiSi2a+JN75IuW3mX5lJvG8X1PnZ2hZMpzEsYpRB o2esIx+M5G+762WHS6xywolL/wIE4p/N4VjMpHmjMlGB3fwOsnRIhxJ+5wdEU5noSw8DyP R/UnKgl/nPJV0vHOeS4dcVGRWLeKbhlXUHz7MlQ4xH0WHb6xE4KMpDQrVDyjOW42gSjYQ4 Dt9O9EnNe31iseLHG5X7LehPOIh15G32+M0yolTZwo7HUuu/Oq9xVs8LhedpZg== 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 4dW1b94nFMz1BZ8 for ; Tue, 16 Dec 2025 15:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4401e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 15:49:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 07681cb31b24 - stable/14 - diff3: Remove bespoke getopt.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 07681cb31b2440e990ad56cc8ccc52bf3537fb3d Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 15:49:57 +0000 Message-Id: <69417fa5.4401e.42f99c76@gitrepo.freebsd.org> The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=07681cb31b2440e990ad56cc8ccc52bf3537fb3d commit 07681cb31b2440e990ad56cc8ccc52bf3537fb3d Author: Ed Maste AuthorDate: 2025-11-18 13:16:22 +0000 Commit: Ed Maste CommitDate: 2025-12-16 15:49:25 +0000 diff3: Remove bespoke getopt.h diff3's getopt.h included a function declaration without a prototype, which produces a compiler warning. Just remove the bespoke getopt.h and use the system header. Reported by: Mark Millard Reviewed by: fuz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53802 (cherry picked from commit 38829592dc77e9ead4259785e0bfb93bd4c2fe34) (cherry picked from commit 437c77476e726e0414e460c973fd88fe812ce2b4) --- contrib/diff/lib/getopt.h | 176 ---------------------------------------------- 1 file changed, 176 deletions(-) diff --git a/contrib/diff/lib/getopt.h b/contrib/diff/lib/getopt.h deleted file mode 100644 index c61768c691bf..000000000000 --- a/contrib/diff/lib/getopt.h +++ /dev/null @@ -1,176 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989-1994,1996-1999,2001,2003,2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -/* If __GNU_LIBRARY__ is not already defined, either we are being used - standalone, or this is the first header included in the source file. - If we are being used with glibc, we need to include , but - that does not exist if we are standalone. So: if __GNU_LIBRARY__ is - not defined, include , which will pull in for us - if it's from glibc. (Why ctype.h? It's guaranteed to exist and it - doesn't flood the namespace with stuff the way some other headers do.) */ -#if !defined __GNU_LIBRARY__ -# include -#endif - -#ifndef __THROW -# ifndef __GNUC_PREREQ -# define __GNUC_PREREQ(maj, min) (0) -# endif -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# else -# define __THROW -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ - const char *name; - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) - __THROW; -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ - -#ifndef __need_getopt -extern int getopt_long (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind) - __THROW; -extern int getopt_long_only (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind) - __THROW; - -#endif - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ From nobody Tue Dec 16 15:49:58 2025 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 4dW1bC05d3z6L8SL for ; Tue, 16 Dec 2025 15:49:59 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dW1bB5yKWz3xLZ for ; Tue, 16 Dec 2025 15:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765900198; 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=Jhi+6dUsXSUrEXlDXhheGPUYAqXOukOY3HAJO0WGsXA=; b=G21oX+Uo6XzfoXEM9yFdnU/pfHWiBUZ039Zx/4HD3tudDnFzUsGG/2BOt5I5FNqGfusNn9 9k/Vmd0IFaRRSc1AkSxc4oD7U+5iL4KcJWHI4fvXVoFeFiiHg8/6nT/ajSCNA77Xw8AGfy RkkDZK6iurncZp7GDvTnUAe9E8IXp7GzT5keVUvttcKcIbAUSLxC6lBa8Ado898LizRhB7 t8eAlE1u2VLchFYzLFHBoQuNPEDGqpQy8krQJCfPXw6ZL5Z/y0F/5bNo3wTiUk+AcWJieR qQdOlUb9NT7K5d2wuHU7Q+5a/3sE8Ge2AEONpnT/v2w9sHvJuY3cL4PKQJhUAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765900198; 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=Jhi+6dUsXSUrEXlDXhheGPUYAqXOukOY3HAJO0WGsXA=; b=NkAzeFL0BxebDV2lEuIyfm2g69bdgc6kQtN8grEcOyhGvTU6UlFCTRKlLhBZPegajwL7qj IMbhZVcP2wlEyuMYauszdwKsjua0X7+P9GxtziCf+X9EOO4fwAuDXp4cejPv1U4lcmrJvn vfD8JuYVhe58PN1XtfpmK0cZhxUeBWqcQy3E/9BAw++k5NLq1oG0nWnlR7xWKaQQyQ21yo 75wNGb/woB+0UaSE63P3NTFV1S6uGFu9j1FF+X2sAMhzBDnMt7jU8bGrSAcPTSkjzXmZmY v/kFbgu2/v1TljFYdkN3Nh/MRcHlz9rQV3UPeFtvxnvlx6hHlH8OQfrDC8c/6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765900198; a=rsa-sha256; cv=none; b=QsK+gKoALykcKBAU0adgMhaUxfj2vz0/n5RxdSzyfmTTh7jk1RhzGqup6ySdvym0G46tYD 3Fd2XoGg8F45oCzbt5rNI31GfBaDPKWqJ9VULZXYtbLueeylVihuqJ5jIDAU0EmLNbwWaO /eC/qrukwxUXlCkICSWOnKtd1s9zVps3lXFlorz7cunQOY8Ky5BWLK7iflS/1Cg0Py5SYp +63dQ4qnrJLWZC/L4i3/8nt7dDwKHf2ALZikHL3jMimPaPIlt+i+Oy0ntBs248lkGq9cyy nT7QIYegh84Ix1mscuIZs90TUli/ga+K6Pjx37QyHThV9oePXjzV0/B9uJ001g== 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 4dW1bB5Wsnz1BWP for ; Tue, 16 Dec 2025 15:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43890 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 15:49:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 98d08b86b4e5 - stable/14 - diff3: Use logical-not, not bitwise for booleans 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 98d08b86b4e5b77fa1401d4a44ec3ecc7b13f1b0 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 15:49:58 +0000 Message-Id: <69417fa6.43890.5c57f45@gitrepo.freebsd.org> The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=98d08b86b4e5b77fa1401d4a44ec3ecc7b13f1b0 commit 98d08b86b4e5b77fa1401d4a44ec3ecc7b13f1b0 Author: Ed Maste AuthorDate: 2025-11-18 13:20:40 +0000 Commit: Ed Maste CommitDate: 2025-12-16 15:49:25 +0000 diff3: Use logical-not, not bitwise for booleans And compare impcompat != 0 as it's actually an integer incremented on each use of one of the AeExX3 options. Reviewed by: fuz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53808 (cherry picked from commit abcb80f46c2607fc16564ca87cc25f0908f29f99) (cherry picked from commit 56bdfd2d967ac104dc599bced168e1a200aa168e) --- contrib/diff/src/diff3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/diff/src/diff3.c b/contrib/diff/src/diff3.c index c915d6b04c87..d0e8137756db 100644 --- a/contrib/diff/src/diff3.c +++ b/contrib/diff/src/diff3.c @@ -299,9 +299,9 @@ main (int argc, char **argv) } } - edscript = incompat & ~merge; /* -AeExX3 without -m implies ed script. */ - show_2nd |= ~incompat & merge; /* -m without -AeExX3 implies -A. */ - flagging |= ~incompat & merge; + edscript = (incompat != 0) & !merge; /* -AeExX3 without -m implies ed script. */ + show_2nd |= !incompat & merge; /* -m without -AeExX3 implies -A. */ + flagging |= !incompat & merge; if (incompat > 1 /* Ensure at most one of -AeExX3. */ || finalwrite & merge /* -i -m would rewrite input file. */ From nobody Tue Dec 16 16:09:54 2025 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 4dW22B2Jn6z6LB5X for ; Tue, 16 Dec 2025 16:09:54 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dW22B1P38z3F0l for ; Tue, 16 Dec 2025 16:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765901394; 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=FlRZayQGjMQ/Pq8MPuW8sa8tA0RtuLtB2DsQ13TIPgY=; b=G/WR16Mq19qVosMaS9sLjKRolvWLPLVgCONTEEu7nztfJlPV+HA2z4TNuEjZbWf3iQQBkZ SihLyjwlwhdNclVVgXX+sJ2wp/uykRXbLputlw9IpXPnwJ+ykINVjid8ycICouwycMWmfD 4/S1KMJKqlin7Bf8aSDf8FmPkan7kTLmkpkUUoBZ/wSc5TpJKMJPqFvQsEWcGKgi2I0ZVz lUI2c+rvf+SguyTvk8mnBQp5OXxrCyv+bYD21H4XI4qWRpE+aN4Th27z37OAbPv+QBaNCe X5XtiF6S0hDsjxUDcDVYHxAeLjly0Kfm8n4XYiulH0vJEu5SaHvmssEGLAvnDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765901394; 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=FlRZayQGjMQ/Pq8MPuW8sa8tA0RtuLtB2DsQ13TIPgY=; b=LQvLDCoV6JsDwb93aEtq+ijsyHLMBF5YGGdlzONKJPaDoWz9RjoSsOdQ4bEcSOrrcLms+f bLqW5HMki2U5/Vag7MJ0Mjwc/kRXpl7BqmPOkfdkauZYkSaq+iPQBVW4lNSDCm2fiNmM4f 72CNGH2eE7ioPIcK8KwFXr4uPQg0ZXTUCm3+iZ0udemrH6Y4/tMQp8CnqPN5FOyWt5T55l o/yKVG/x6q6Mzhd0HaFa7YcOhJrEih1K9XIuH9KUjhGQKSgrgcHgqLvX3eG7m9JQ45pAp2 PlqR4D6ylHhaUj3xpuTnXADNWrWY4BdPk9L+8EDs8HUvr5VAtrttxamnY0AWiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765901394; a=rsa-sha256; cv=none; b=NBTGIQfzqXSfZqNqpuH0EvadhKUu//TTU0hdrVhNrjyF/GR/jAltOBnx6qIW8hBk4b6L7o Zk3bNmN0Bk/rP1nG0HmxQS/gwF3/MgeFaHEZ/bi/KX4AQoQFdgdyFyCRmVvVHg76d0uKHH 35IS4JTxu2IQxBJtE4Qb7EV8YDxYOKb2cT3pIvfoi87eSeT3QRF3zXsspN8KqvlI896hyB NimbiJed4ilwRnAvUfOy+5zb6TT7+cFh2izOAMmMa1B7AYD4Iu6jiKRrSkTJfFFZ5UuTc/ srD95alol5bElANfU+SSvO5kEdPN/+/hW8qMmBYhBq4yUtVX6sMpr8teCurAWw== 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 4dW22B0zTxz1CR5 for ; Tue, 16 Dec 2025 16:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46340 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 16:09:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: c93d9e082b4e - stable/13 - trim.8: minor update for manual page 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c93d9e082b4e3d3fb367a1fd56cf447bccae2e93 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 16:09:54 +0000 Message-Id: <69418452.46340.2c6aa3ea@gitrepo.freebsd.org> The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=c93d9e082b4e3d3fb367a1fd56cf447bccae2e93 commit c93d9e082b4e3d3fb367a1fd56cf447bccae2e93 Author: Eugene Grosbein AuthorDate: 2025-12-09 14:47:26 +0000 Commit: Eugene Grosbein CommitDate: 2025-12-16 16:09:30 +0000 trim.8: minor update for manual page Further explain that trim(8) is not for trimming free blocks in populated file systems/ZFS pools, as people still take it wrong sometimes. (cherry picked from commit dbc4a1c69191909a7210cad6da46b755557d0d34) (cherry picked from commit b2f8d46d898fb50222aefca47d687a852c647b2f) --- usr.sbin/trim/trim.8 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index ebb8b927cd91..b4799399e110 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 1, 2025 +.Dd December 9, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -51,11 +51,21 @@ utility erases specified region of the device. It is mostly relevant for a storage that implements trim (like flash based, or thinly provisioned storage). .Sy All erased data is lost. -Alternatively, refer to the +.Pp +The +.Nm +utility should not be used upon mounted file system or active devices +being a part of imported ZFS pool or other software RAID, and the kernel +does not permit such usage generally. +If used upon not mounted file system +or inactive device, the +.Nm +utility erases blocks non-selectively, whether a block is occupied or not. +Refer to the .Xr fsck_ffs 8 command having a flag .Fl E -to trim populated UFS, and to the +to trim free blocks inside populated UFS, and to the .Xr zpool-trim 8 command to trim existing ZFS pool. .Pp From nobody Tue Dec 16 23:39:32 2025 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 4dWD104j29z6LPbV for ; Tue, 16 Dec 2025 23:39:32 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD103YBrz3FQg for ; Tue, 16 Dec 2025 23:39:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928372; 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=chCciT1TzNZn+Rx/VT9jGAylREkKXH/9lE6eTDog1HQ=; b=hDLTvX3Ci9KsBbpmtv7svSkdq9GrKT3RJbMT7qYjJNFE6xphTQCPlNY/KpYdsX7khWhLQH WpePHnOlfUlMiZ3+leQHAdGNWqXeGQP87xikwWSyGEiLHD1VntfvYJWdd2P9MWiH8zU+TZ sAxc8j4pU4yeUWl/0eA01U8AMp+GTk7vFEB16+HWJuUyuEtxpWrgBoWyjX0wcEbUEFvKiS Q+S49qs/PrpaaURZQ9ew94PjQWfZ3L97NT+7kK15aBV28a/sWlLFWn1xxWN2ndct/BEPrZ 5KCJH1DPXn9de0ZVaHluTx5OwpHDkpN8mzAtCxu4WGKL3wGWVzKzULP6tX+CWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928372; 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=chCciT1TzNZn+Rx/VT9jGAylREkKXH/9lE6eTDog1HQ=; b=Q5Rf/Gi+amg8WEYmpwZ+fmK/Yrd1YjLhEWUPoEBD3rPEDoItGnfJQiHB5sa3gmRGlEtnt9 FmGEPrvthhrfFe0oXcojTZJSQYxRnq36dI2lxUljeobTN1cdfRo09qVYrUoPogUe0dLgE2 kQ20lkhz051Iygq8RR6CjAgO9UWBHgGTOYDgHwbUvhljf3I9qodepXtuyEfRT29o1zVn7M caW/h5SJ51Kd/9V7QwCItKodWzev7ezSfDAb0upV0kIp25Eunr+tvfj3tzmHaKGhx3573S i38fGGrPpB8Hjd4MNHcOEZRbHpagbQYdWde01wB2ybc6wNSCXNxxwJyujN0EpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928372; a=rsa-sha256; cv=none; b=Wtcmp/sZ1I3inhKloamoOm00PxjFPaJa02fRXj97rXpLGhxHG894a95J2LSHBJUZZrk1UX A6/LdA0pYug+lWrOawrNlpK7MnM4EV6RM73VmbJEklsVMNimmONvF5WnRu3EmqjzZbSKx4 3PFEo3f8j/m1afcQkN6Z64y5JRYy8Cgf371gU2u8Vj61ik9Xws/6VVLoItPs7h7EQ04Aih I/xuCddIUEjVis33rzadug08tHjJjgNa9OBk+p0K63rmttACvHCu0VvZ21tOSqvn9Nbicb 8m/dgS3F/XjMu62HInT9pr+2s+zyxTeUzuZNvCCcaqqL6NT1mDq53lwWEmgGnw== 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 4dWD1035TczBr6 for ; Tue, 16 Dec 2025 23:39:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22ce1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:39:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6759fbb1a553 - stable/15 - rtsold: Validate entries in domain search lists 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6759fbb1a553a4af1a344e266970613ac49622ab Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:39:32 +0000 Message-Id: <6941edb4.22ce1.21527294@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6759fbb1a553a4af1a344e266970613ac49622ab commit 6759fbb1a553a4af1a344e266970613ac49622ab Author: Mark Johnston AuthorDate: 2025-12-15 20:50:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:39:27 +0000 rtsold: Validate entries in domain search lists Reported by: Kevin Day Approved by: so Security: FreeBSD-SA-25:12.rtsold Security: CVE-2025-14558 (cherry picked from commit bf804f69dd94b3c98962618b4ad3b48a35bff2ff) --- usr.sbin/rtsold/rtsol.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 79928932ca5c..a7d5a44a7d44 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -776,6 +776,41 @@ call_script(const char *const argv[], struct script_msg_head_t *sm_head) argv[0], status); } +#define PERIOD 0x2e +#define hyphenchar(c) ((c) == 0x2d) +#define periodchar(c) ((c) == PERIOD) +#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \ + ((c) >= 0x61 && (c) <= 0x7a)) +#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) + +#define borderchar(c) (alphachar(c) || digitchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c)) + +static int +res_hnok(const char *dn) +{ + int pch = PERIOD, ch = *dn++; + + while (ch != '\0') { + int nch = *dn++; + + if (periodchar(ch)) { + ; + } else if (periodchar(pch)) { + if (!borderchar(ch)) + return (0); + } else if (periodchar(nch) || nch == '\0') { + if (!borderchar(ch)) + return (0); + } else { + if (!middlechar(ch)) + return (0); + } + pch = ch, ch = nch; + } + return (1); +} + /* Decode domain name label encoding in RFC 1035 Section 3.1 */ static size_t dname_labeldec(char *dst, size_t dlen, const char *src) @@ -804,12 +839,11 @@ dname_labeldec(char *dst, size_t dlen, const char *src) } *dst = '\0'; - /* - * XXX validate that domain name only contains valid characters - * for two reasons: 1) correctness, 2) we do not want to pass - * possible malicious, unescaped characters like `` to a script - * or program that could be exploited that way. - */ + if (!res_hnok(dst_origin)) { + warnmsg(LOG_INFO, __func__, + "invalid domain name '%s' was ignored", dst_origin); + return (0); + } return (src - src_origin); } From nobody Tue Dec 16 23:42:59 2025 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 4dWD4z69TRz6LQ0W for ; Tue, 16 Dec 2025 23:42:59 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD4z4kpKz3G22 for ; Tue, 16 Dec 2025 23:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928579; 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=9vTN2Ein4IgWcO5d4SUyLGWF4bG2I1oJNcOL5QjoIrE=; b=L696cHq6/sFzTongg4g51y8HDsn+YPiE+kRe2lEaOtIHriFDOijQa0mjIW669mObAlNXV2 5vImBa7BespR8EnKiv3qUj42O5q4OPgzoyTeuiCqCT+amxF2GL7tUrsXzrtyd4YUDVbcdA VO5pQd48pSk0kFFrcrr0MSWmo/on5tScJ9FGV50RaNZBdkQJlgMmE+4qmMMZ5bBnz+qTWB 4X/j+Li6xuW8KLxP7tmUDWvYkV54EPZG2RoeG+E6yC0xCKRJ5IEi3/ZqvvgWXXmjO8y412 TEGOOC1e0FWVLp/S1VLHIJFEOsPm00TRA+jknOzhwfD5SGJSrpPW9mAW8Po+Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928579; 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=9vTN2Ein4IgWcO5d4SUyLGWF4bG2I1oJNcOL5QjoIrE=; b=vvXoKs+yWs0XFiKjuQ4ylm8u3e1nIRtRM+iMqwj7gtiu/TnW0a0YWuG8NmyaTamtUM8wvp ZFbdxBcSCY8Hmu9KLi/niWGfQiHcJ++84uT79ua+T+54PbILzVn8hRzx/fAicoj5scaPbx GwoDvL2S/m7P35sPxMlfrHsmFej2nFvkMAAmVLeVz8Z9De9NAnH+eLoZib5G2m3UA8s8dY teuPl8UiOgQGavjE16JIQEHT4iDsN9Oianrh95AD1DgpDtw/V5q6wFsINZDk4bpeNmWHeI Uf5gyqgTpYILJ1+BOLg+5PqljWSSeHQN5Tk0Gcf8Qrtfu1Id9wT3lq1AH72TXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928579; a=rsa-sha256; cv=none; b=N7dd+33Gi5ulg32/I4XZCpDhJB6U7H+RMNjpItzbVv8FbEFD/6gATimNlyAY1Nb95QkBIu W4LqNB4fEpvdqv+nzSNr4Kyi2Ws5NcfchtwGJTm19Tk85cuugQkMy1EWfRQWmrEEaXpK6q KjWSLW+9PGKYdU1iPGIfI+s7xlLQEJR4UW9aEwG9ukVlQKBgf33ya2SykY/EFLE8YTkCzv hPi2wliBrG/ed7hxbCldoYUxvL2ehTXIZTD61nq/uaEshv0Gt3RWEqTFUQZ/EEU2r4RNTP VLgwkAKGGLhgsXMDd483ZTPrSMmYRoIeLUHPe6qEeeJJR/EobJC6nLrhvb8BsA== 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 4dWD4z4KjGzCRt for ; Tue, 16 Dec 2025 23:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2397e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:42:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ff6b9c7c1c34 - releng/15.0 - zfs: Merge commit 86b064469dc9c2 from OpenZFS 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: ff6b9c7c1c3494f143879a98d645f5e682babf2c Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:42:59 +0000 Message-Id: <6941ee83.2397e.32ee3da2@gitrepo.freebsd.org> The branch releng/15.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6b9c7c1c3494f143879a98d645f5e682babf2c commit ff6b9c7c1c3494f143879a98d645f5e682babf2c Author: Mark Johnston AuthorDate: 2025-12-14 17:20:38 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 16:01:07 +0000 zfs: Merge commit 86b064469dc9c2 from OpenZFS FreeBSD: Fix a potential null dereference in zfs_freebsd_fsync() In general it's possible for a vnode to not have an associated VM object. This happens in particular with named pipes, which have some distinct VOPs, defined in zfs_fifoops. Thus, this chunk of zfs_freebsd_fsync() needs to check for the FIFO case, like other vm_object_mightbedirty() callers do. (Note that vn_flush_cached_data() calls are predicated on zn_has_cached_data() returning true, and it checks for a NULL v_object pointer already.) Fixes: ef4058fcdc01838117dd93a654228bac7487a37c Reported-by: Collin Funk Reviewed-by: Sean Eric Fagan Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Mark Johnston Closes #18015 MFC after: 3 days Approved by: so Security: FreeBSD-EN-25:19.zfs (cherry picked from commit fa259d156d43966db95fe0f5cc15a0e6af206ff7) (cherry picked from commit d988a0c1fc4cf75d5c4c9820fd2a5619d59ac608) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 8a9d23d0d554..05ac77741d4f 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -5275,7 +5275,7 @@ zfs_freebsd_fsync(struct vop_fsync_args *ap) * Push any dirty mmap()'d data out to the DMU and ZIL, ready for * zil_commit() to be called in zfs_fsync(). */ - if (vm_object_mightbedirty(vp->v_object)) { + if (vp->v_object != NULL && vm_object_mightbedirty(vp->v_object)) { zfs_vmobject_wlock(vp->v_object); if (!vm_object_page_clean(vp->v_object, 0, 0, 0)) err = SET_ERROR(EIO); From nobody Tue Dec 16 23:43:00 2025 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 4dWD511ppPz6LPrr for ; Tue, 16 Dec 2025 23:43:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD506KDcz3Fsy for ; Tue, 16 Dec 2025 23:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gMVhVxkNUxIbbexP8YrYMQvrgdEzgqO7TX1U+2G9fx4=; b=bkFfWL1qWtLihlFSIRQMpIbjqEALnNNbS2TROrKOJqazguByBywBpmq5XCIj82+/5tBLx+ CejeFc5wqBmvx09tvAJ5gDJrXdaSmX3LZLnI21yTab+JzYHR3tAVdfcDed+NdqNuM/D6gi vMgWEk8jXUknllFvMhZjp/GhRjSiTKQSEtZtRRoEV7U7cSXB3UmssI3/B6ryUmk4rW1Ep0 4CvmiU+s52PuGWt4MNCvwOmzFU6K1J5dZQcPIG2JCSfP8HnxFT0IRWBZhNLfI3XJSxXQ2m /0imAzGQ4g7i5MSQcKXUCNmjKZieA1YWv8eNpOK4ab1BA87GBK4F77HKAQo0DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gMVhVxkNUxIbbexP8YrYMQvrgdEzgqO7TX1U+2G9fx4=; b=kveHT/VgbgwBAQcX1tbQF4kJvECtEITchmpzfFjHD/EdDibyEMyTeKieAwI9FMj6a5p3YE qbPiTgAK4ZWYu0dv/ar3ZzHco+h0soQuAmJi6XEAdnxXG/9FMKjpQqcQvzz7O7aI3WVLze ch+z1gTm7QXf5HdMmAXK6kW+raGtKj1AHzP/JZgfVoR0r0ATo7vZpSiMyzqeXUgzZ9sqLK 8W8gURoSvoX5K2uLomQPGkVSnpsaoJNnBpBAWadC9lbZ8yTYD2AiWP7i7fWRQChQMCiT/n aeEc2wmN05r/4oramRm5Lyoc6DeGAPYGQIyQ2GlDELmY72SG9uHOvD0EYUXroA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928580; a=rsa-sha256; cv=none; b=hoPatPFECuGygv7GdiMcvIihKCMr53mHbzU4eB4nQo7LkGQ6vUH6KS97v8buUhCgfiUnJj t03IllzirHL1n+mh60D0qWlz5PIFEN6YM7ruMo040ck1sj3Ixkj0jFt/8vEoyraPf8lt8g aSOpJSePiGluTN9+e8Ykr6Gcu2TisGSYSR8wPxAHNiuAhqsUZbLqoMUXQbpsyRo3urpiBK 5tqKdSwSOJuCXpYw5O3i61iYbDwilJeN3K9q7Lm2GWVcolPppTZ8K/ECFArPJzJ9vrVGKY OlNsYEoAHhO/coc2j0aIBI3A35gMsMZtXXCEgr6xj+e2WhYuOrCBVvrz9tO5Vg== 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 4dWD505J03zCCc for ; Tue, 16 Dec 2025 23:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 237e6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Bojan Novk=?utf-8?Q?ovi=C4=87?= From: Mark Johnston Subject: git: 04e9f1aab83a - releng/15.0 - amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 04e9f1aab83a00e5b61aaed50fabf1cd69fb01cf Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:00 +0000 Message-Id: <6941ee84.237e6.382387b3@gitrepo.freebsd.org> The branch releng/15.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=04e9f1aab83a00e5b61aaed50fabf1cd69fb01cf commit 04e9f1aab83a00e5b61aaed50fabf1cd69fb01cf Author: Bojan Novković AuthorDate: 2025-12-13 14:53:45 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 16:01:22 +0000 amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map This change fixes two checks that conflated memory mapping and memory segment idenitifers. In both cases the code iterates over all memory mappings but passes the index to `vm_memseg_sysmem`, which is wrong. Fix this by passing the memory mapping's segment identifier instead. Differential Revision: https://reviews.freebsd.org/D54210 Reviewed by: markj Fixes: c76c2a19ae37 PR: 290920 Approved by: so Security: FreeBSD-EN-25:20.vmm (cherry picked from commit f1809eab82a796845f126b703c01d4a31ccf2193) (cherry picked from commit 4f7436bf297b93fd9e835ffca3d56288ce934dc5) --- sys/amd64/vmm/vmm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index c42da02d0bf6..cffbdf047d32 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -755,10 +755,10 @@ vm_iommu_map(struct vm *vm) sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED); for (i = 0; i < VM_MAX_MEMMAPS; i++) { - if (!vm_memseg_sysmem(vm, i)) + mm = &vm->mem.mem_maps[i]; + if (!vm_memseg_sysmem(vm, mm->segid)) continue; - mm = &vm->mem.mem_maps[i]; KASSERT((mm->flags & VM_MEMMAP_F_IOMMU) == 0, ("iommu map found invalid memmap %#lx/%#lx/%#x", mm->gpa, mm->len, mm->flags)); @@ -803,10 +803,10 @@ vm_iommu_unmap(struct vm *vm) sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED); for (i = 0; i < VM_MAX_MEMMAPS; i++) { - if (!vm_memseg_sysmem(vm, i)) + mm = &vm->mem.mem_maps[i]; + if (!vm_memseg_sysmem(vm, mm->segid)) continue; - mm = &vm->mem.mem_maps[i]; if ((mm->flags & VM_MEMMAP_F_IOMMU) == 0) continue; mm->flags &= ~VM_MEMMAP_F_IOMMU; From nobody Tue Dec 16 23:43:01 2025 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 4dWD522KCnz6LPxB for ; Tue, 16 Dec 2025 23:43:02 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD520F4Tz3Fb0 for ; Tue, 16 Dec 2025 23:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928582; 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=pVcaMwhSJAvWlYJRCD2iOGtgCo6db1IlMcH1CG1M570=; b=CjH1hZcamlDgu77GVy8Z9h633F4Kq1N5wKoNiK3kG1zmfdhuVuKe8Uq8Ti2TovMsD1k6zu SK4FBNLDZw3ET7pdFHG7N43b3sBMhqrr20HYNGS6j3mnnEgQVMEp4J/ZhczTV8//0z5mgM tXUegm5O+j357JKkxfR1+lgXkQ9IBVrCcbksOH03SnZ5osVr5b0EV9Q9ESgKtR0bzW0zS9 RqLm60Z7UbWbAObzh37f6Gd2p0qhMKIG9DeIfR2ySOboXUfezYzq7T9I6zl7vWDmXbzfA1 FsRZPj2VEPwnwnx9bO9RvgCLY0YwQxf6bSsHyVuD2uRd7UcSvE157b/gFKnmtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928582; 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=pVcaMwhSJAvWlYJRCD2iOGtgCo6db1IlMcH1CG1M570=; b=mCzrti+GboaSINarcV6oO5ycpP9FEoAA+whHqlU6NWoKgWsQScLXz6JL3NSdzRvleyPPUJ hVTaFYnoohH7CuKlsEb+v8lC4Nl8ybETrf2prAbPK2sTmOUYCWl3owSUre+4ZH5YFdnKgu Y9rLn6H5RVP4FD2C1snow5znbvRVwuhto4Rdf+6g8w2bEAMiOGek0Ww4Bn2mC60HBCVa2q Hz56Jb3satnYfhgKN5b4s8M7FIaAsmWsYTcnKw1qV+64EuRDJTEghnx86jQH4tqw46i+X7 LrZ1TE+5pMMIE/iy4ej55yXYuj/N/f38Lvmkwqo/bOZ4EKxEgbmRU3gMI94oeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928582; a=rsa-sha256; cv=none; b=ae+IsPf2BAYUX8bFrG/pGuUdOxqUK84yhsMY2x1o7QmZrCU/mqKVAlWWyKC1VdY3RpTw4Z YkvBYxwYrVJ+OfQVa76zVZDAfbcJcze8RNC5stCbaMFMs6BgB1VW+u5oWyI2bPUafg2CRP qO/O688s+iDunnnubc0A+UnlzkXOxrkYFo4L6yAK4YscMiwyE/toj65TBJi/9EiZF9/jTs RR7nIPaf6hk0dDmcHkSdwWzJdnmVz2DpVuy2oOBfNLAmPPjDPaYeBa05rQOvOYZ0x8F9/j qSZKzpRLXWZDdtYi6oQndMg2flPkbrF/GASYXxSZam66yUQrfQzLLZQMwU1YTA== 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 4dWD515xtDzC1w for ; Tue, 16 Dec 2025 23:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22933 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 408f5c61821f - releng/15.0 - rtsold: Validate entries in domain search lists 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 408f5c61821f5b29f59b5a72bafa07d406db9834 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:01 +0000 Message-Id: <6941ee85.22933.c5e601c@gitrepo.freebsd.org> The branch releng/15.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=408f5c61821f5b29f59b5a72bafa07d406db9834 commit 408f5c61821f5b29f59b5a72bafa07d406db9834 Author: Mark Johnston AuthorDate: 2025-12-15 20:50:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:42:34 +0000 rtsold: Validate entries in domain search lists Reported by: Kevin Day Approved by: so Security: FreeBSD-SA-25:12.rtsold Security: CVE-2025-14558 --- usr.sbin/rtsold/rtsol.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 79928932ca5c..a7d5a44a7d44 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -776,6 +776,41 @@ call_script(const char *const argv[], struct script_msg_head_t *sm_head) argv[0], status); } +#define PERIOD 0x2e +#define hyphenchar(c) ((c) == 0x2d) +#define periodchar(c) ((c) == PERIOD) +#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \ + ((c) >= 0x61 && (c) <= 0x7a)) +#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) + +#define borderchar(c) (alphachar(c) || digitchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c)) + +static int +res_hnok(const char *dn) +{ + int pch = PERIOD, ch = *dn++; + + while (ch != '\0') { + int nch = *dn++; + + if (periodchar(ch)) { + ; + } else if (periodchar(pch)) { + if (!borderchar(ch)) + return (0); + } else if (periodchar(nch) || nch == '\0') { + if (!borderchar(ch)) + return (0); + } else { + if (!middlechar(ch)) + return (0); + } + pch = ch, ch = nch; + } + return (1); +} + /* Decode domain name label encoding in RFC 1035 Section 3.1 */ static size_t dname_labeldec(char *dst, size_t dlen, const char *src) @@ -804,12 +839,11 @@ dname_labeldec(char *dst, size_t dlen, const char *src) } *dst = '\0'; - /* - * XXX validate that domain name only contains valid characters - * for two reasons: 1) correctness, 2) we do not want to pass - * possible malicious, unescaped characters like `` to a script - * or program that could be exploited that way. - */ + if (!res_hnok(dst_origin)) { + warnmsg(LOG_INFO, __func__, + "invalid domain name '%s' was ignored", dst_origin); + return (0); + } return (src - src_origin); } From nobody Tue Dec 16 23:43:02 2025 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 4dWD5345z2z6LPg7 for ; Tue, 16 Dec 2025 23:43:03 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5304NYz3Fl6 for ; Tue, 16 Dec 2025 23:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928583; 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=YwAPQJqs0S+e2DAcL6PI/ki0M7ynmn+EPI5otYBafPA=; b=XRVF+QztW1cw9hP8Weu67Y//VQvdZx1bQB0vujbvdtKTQc+qd5dQXFVlvT6ZlpKixZdgaf HQqroN+Cysn+iM/Vpxg+Z6w5SsKwD3s94xHs4S3oaZc2pioDACOLOUvrEW6xR4PNj9/7oH V8TDUB74I7f88uRiWlLM7XiKqWRhs8KaiT+qvvytDbkCQYy6jD4vZktV/iKugY8W+wsdfQ wi7MMK1ggpx4iAX4uR5jJwfowsiK34kRRgEbN0QO6Ny61+L7wOPgOWu//sZwQu8hrv4CoI DhNtePxIXMscDbVzr1wxpc+DK1F4G9/3puquLQbENm5WkcYWAmNF17d3EAl2pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928583; 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=YwAPQJqs0S+e2DAcL6PI/ki0M7ynmn+EPI5otYBafPA=; b=XbxVSej5uUAUo+6za/SdKHWvsbraZxurXixXKn+7JyoI4ENPAoAULfM0stczkMvXnXW6cD UR1J86bZrCwwB1HIP3+mXmJOdbJxY5aTwZLp4qJJEtiPck7ddN2Q8a1Wt9M8anctZl/qIT VNp5eMzw62589lwABMAbehktJBKvdx3e2adDRr8S5bm0U80y/O7J8vcz15OHfE5WN8Nzcx a0rajUeeFOy2M/ui0qlGy/K7RbrMaphDNpkPzg3pnP3gD9uG2XbvX0VCUK/NkuRBJlzpfq pLJhpBJXr2GASB8zIl/oVX8RtRyWDoGV43DaPtUFq0ILRg+67AA24vDnjh7Ixw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928583; a=rsa-sha256; cv=none; b=Ty9pYwTX/RyoJthzbOafcvS7r5/DW4nMGylqV2kawQdX2M/3zgyUAbXMvAPqnJxNB6/HNB WGtT8iuxFHsAReslefMvofqmhoFIQ1BcLmXpawiwfi817sDMeghoJzTAOSkGe24DVjCbjd gYnj650r+CNgGrIfQK5ZWdeXmzxYL4uzAchKJP2K4vwZsNacHKtLwp6H9GrI6ShLhTEacF 1iCVixtVtSVd4rCysugxN4/M+tgvKc1NAfmeWcc2iYFYoJ8onxjWuBVmfFy7j2wQ6TqNME yLBBHVJNciSkJ5U5arYuflUsFgH1zi0N6oykSGziiT8LLd8lBu4/lFQJcMN5gw== 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 4dWD526k3yzCPP for ; Tue, 16 Dec 2025 23:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23e11 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 63a5b645b23e - releng/15.0 - Add UPDATING entries and bump version. 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 63a5b645b23e1e1b6c5023a02703109282ef2a27 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:02 +0000 Message-Id: <6941ee86.23e11.3a73f168@gitrepo.freebsd.org> The branch releng/15.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=63a5b645b23e1e1b6c5023a02703109282ef2a27 commit 63a5b645b23e1e1b6c5023a02703109282ef2a27 Author: Mark Johnston AuthorDate: 2025-12-16 16:28:47 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:42:39 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index c23c9a66cbaa..b529467ca9cb 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,17 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20251216: + 15.0-RELEASE-p1 SA-25:12.rtsold + EN-25:19.zfs + EN-25:20.vmm + + Remote code execution via ND6 Router Advertisements. [SA-25:12.rtsold] + + Unprivileged kernel NULL pointer dereference. [EN-25:19.zfs] + + bhyve(8) PCI passthru regression. [EN-25:20.vmm] + 20251202: 15.0-RELEASE. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e48cfd747602..c86157eaf8e5 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -51,7 +51,7 @@ TYPE="FreeBSD" REVISION="15.0" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Dec 16 23:43:24 2025 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 4dWD5S4Kk8z6LPtx for ; Tue, 16 Dec 2025 23:43:24 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5S2CFtz3Gqb for ; Tue, 16 Dec 2025 23:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cbD9q15909q+wO5M26pymAlYzU8cWL+yK0pEi32H99g=; b=lD0OeYc4Zb4e9M1M9Mp1CPT8EmZDt+gwS/S3rPXmOADt+/7jA28Q8+Mrw0uyWyi9l8UVAE Em1IpcGxdWHAVQBEP4yEPL5v09vk5Rj6k12dxPeChYqrr6RjHArNUvbj1gFXSSs6lUdS+d Uop19/c3XYnBczDKnTNxrcH+XstePUBOYnWP5Uh6e9EbppNWqxQ4IchRY8IG48oG0KN/ux C+KFFFvESHveDtw92Ljf2vi/2EECjbMprnxpQF5+CNp3tInAgTSqaQYcDWqGw1y3kQ38fF zdslHZdcXfiFwr+vI1dsj5u04i2gOQfoN/N7/we+F9F8FHRl2a6+bUBlH31CQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cbD9q15909q+wO5M26pymAlYzU8cWL+yK0pEi32H99g=; b=VYnSUjo6TJ9W1+8HIPi/NVp50W673EBbhSmjAVjhik9Qd0b6h/QXyJ/DYrknkWyv2eKLZn JKKdMXHtmbAXqoDTqaGWhHfFubffANaQ2ovSs/3pk03VTeJYD9JTDA3H+TmwFd4mK8gDtg m+GlZ1smzufrFgQcI54Q1mwP3cW0AKEm3LmITcqgORHIN1jlt8+WYf3fQzkhsg03IF8Czc Myu/fBQNkd/8cReBGaVXQkVtotXh+pm3qwjTuDj91TnsGBM8VPUZxwDIM6GnovnDOZ9geb P1DN9KxjeGnSXZZdEn/kVdZdQSr1S4nDBqINpxHXKURbrCZYD+c9JxTcGb2aUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928604; a=rsa-sha256; cv=none; b=MUqa8rwJIh5z1mGdSAnnQK5K1kHkRTmktisXrb9xDSYSPrGDaocnJ7f0PfoSRCJP/slTYy nIoWManpGPshgkDXByBf+LdZ/j4llBWEDqORF3Ne87sv+1AqOWMrkYwSoFZrUp6G8po57u HSDwi1KlAppcfkZcKCpEBBg//woaDuTEQovPoFhJG1IZ1ra/R1oHRkHbPNWejvfIC+gdT5 0Z1hP8TXFd5dCjszhUWDcCm4m4HhnSLJuXKhq1IuZGQlKU/X58ajVyZRoBygnLDqh6Y2Pz x6JRUnf4L3Bc+/Ovz0b8w4DfwBIGINPG20dUgVKeThN1Z60JGHtAU2Mjz/2+VQ== 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 4dWD5S1WsLzCXp for ; Tue, 16 Dec 2025 23:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23f47 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Kyle Evans From: Mark Johnston Subject: git: c0cb68169beb - releng/14.3 - ipfw: pmod: avoid further rule processing after tcp-mod failures 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: c0cb68169bebc4210f9eccf643aeb73bf6d34654 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:24 +0000 Message-Id: <6941ee9c.23f47.5df1abdf@gitrepo.freebsd.org> The branch releng/14.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c0cb68169bebc4210f9eccf643aeb73bf6d34654 commit c0cb68169bebc4210f9eccf643aeb73bf6d34654 Author: Kyle Evans AuthorDate: 2025-11-01 17:34:11 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 13:57:34 +0000 ipfw: pmod: avoid further rule processing after tcp-mod failures m_pullup() here will have freed the mbuf chain, but we pass back an IP_FW_DENY without any signal that the outer loop should finish. Thus, rule processing continues without an mbuf and there's a chance that we conclude that the packet may pass (but there's no mbuf remaining) depending on the rules that follow it. PR: 284606 Reviewed by: ae Approved by: so Security: FreeBSD-SA-25:11.ipfw Security: CVE-2025-14769 (cherry picked from commit c0382512bfce872102d213b9bc2550de0bc30b67) (cherry picked from commit deb684f9d1d6a3681e451d3af31f768c567f7dbe) --- sys/netpfil/ipfw/pmod/tcpmod.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/netpfil/ipfw/pmod/tcpmod.c b/sys/netpfil/ipfw/pmod/tcpmod.c index d7400f4fd5ed..138fefe22a98 100644 --- a/sys/netpfil/ipfw/pmod/tcpmod.c +++ b/sys/netpfil/ipfw/pmod/tcpmod.c @@ -58,7 +58,8 @@ VNET_DEFINE_STATIC(uint16_t, tcpmod_setmss_eid) = 0; #define V_tcpmod_setmss_eid VNET(tcpmod_setmss_eid) static int -tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss) +tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss, + int *done) { struct mbuf *m; u_char *cp; @@ -73,8 +74,10 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss) * TCP header with options. */ *mp = m = m_pullup(m, m->m_pkthdr.len); - if (m == NULL) + if (m == NULL) { + *done = 1; return (ret); + } } /* Parse TCP options. */ for (tlen -= sizeof(struct tcphdr), cp = (u_char *)(tcp + 1); @@ -115,7 +118,7 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss) #ifdef INET6 static int -tcpmod_ipv6_setmss(struct mbuf **mp, uint16_t mss) +tcpmod_ipv6_setmss(struct mbuf **mp, uint16_t mss, int *done) { struct ip6_hdr *ip6; struct ip6_hbh *hbh; @@ -143,13 +146,13 @@ tcpmod_ipv6_setmss(struct mbuf **mp, uint16_t mss) /* We must have TCP options and enough data in a packet. */ if (hlen <= sizeof(struct tcphdr) || hlen > plen) return (IP_FW_DENY); - return (tcpmod_setmss(mp, tcp, hlen, mss)); + return (tcpmod_setmss(mp, tcp, hlen, mss, done)); } #endif /* INET6 */ #ifdef INET static int -tcpmod_ipv4_setmss(struct mbuf **mp, uint16_t mss) +tcpmod_ipv4_setmss(struct mbuf **mp, uint16_t mss, int *done) { struct tcphdr *tcp; struct ip *ip; @@ -163,7 +166,7 @@ tcpmod_ipv4_setmss(struct mbuf **mp, uint16_t mss) /* We must have TCP options and enough data in a packet. */ if (hlen <= sizeof(struct tcphdr) || hlen > plen) return (IP_FW_DENY); - return (tcpmod_setmss(mp, tcp, hlen, mss)); + return (tcpmod_setmss(mp, tcp, hlen, mss, done)); } #endif /* INET */ @@ -207,19 +210,23 @@ ipfw_tcpmod(struct ip_fw_chain *chain, struct ip_fw_args *args, switch (args->f_id.addr_type) { #ifdef INET case 4: - ret = tcpmod_ipv4_setmss(&args->m, htons(icmd->arg1)); + ret = tcpmod_ipv4_setmss(&args->m, htons(icmd->arg1), + done); break; #endif #ifdef INET6 case 6: - ret = tcpmod_ipv6_setmss(&args->m, htons(icmd->arg1)); + ret = tcpmod_ipv6_setmss(&args->m, htons(icmd->arg1), + done); break; #endif } /* * We return zero in both @ret and @done on success, and ipfw_chk() * will update rule counters. Otherwise a packet will not be matched - * by rule. + * by rule. We passed @done around above in case we hit a fatal error + * somewhere, we'll return non-zero but signal that rule processing + * cannot succeed. */ return (ret); } From nobody Tue Dec 16 23:43:25 2025 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 4dWD5T4QFtz6LPd6 for ; Tue, 16 Dec 2025 23:43:25 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5T2SFlz3Gqs for ; Tue, 16 Dec 2025 23:43:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928605; 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=77sERJYMqx5yJczTa636EDla2DbQzgo8D6ccUEWvJRo=; b=Cpab2wwRF5Q/ewr6+cT2WSm7+Y6K1YdUcRkR1oI0u+KJoMd+E5/xJ6Aw5FYmEWXX/mTwjf XCfBPmk6ZggmOluzOzZatVC+AcOXD6GyqUWQYc1bTyQ3z9zq+MBmP2Fn42ZbuukMS0KObQ 2jKkQNnk4k2N2afdAdlMg1Fv2JOa5MuOpbS+TSZRL0rEM0vSrx99+Ph80zSnDYJJjJbHYg ZkXP5pGjzlEVz9EVjOSmLuE0WAQjjT2qaGjGMgiJmhmuGVI9ZTioiIU6aLu6Qy9Qj0ahnz MzJDDhVQ7Ce9wpD8TCdIMjV/ZLSgSDZmwsKgur7BPIhVCOvSWsLrGkyI3Hqs/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928605; 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=77sERJYMqx5yJczTa636EDla2DbQzgo8D6ccUEWvJRo=; b=hYAhkLS7wXaupLerGBv0kqScUlkQLxaMLqT88UFe8+ykkfgJdqbR2svLSqZpjACsvpHUP3 YCv5FMT9T9269Xn7Rzsa6DYwqjpAThqBOWD2J6pOgZCtpnopSTpifCOK9VQGohKdtTutpN l2X9ZPJDPSRUvw7nHT1fT4JEj8b4kIjLKAVJtMPXQfdW5k7IiXNLa8H92BCK+HoqbFmHp2 kqznj3rh8ZlwHUD8SoH9dGBKBO50YJCA5c+8MVjlZInErfactxi/V2+lSYGegqXOx/Yd4Q OOaBwFimfwo8A9GmrZPAi0b7/vNjyGSqhzbwILwbmCQSWZLo96y3G7n4FDJu/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928605; a=rsa-sha256; cv=none; b=KREDxMkcmQ9xwWlkQQdkh6cBPUum/yyR5k61a2Hn1as53XjgpMaoSPEUkvxQ4641O1AjSI TNGqW279H+koKfRtZ8i+gdw/Ed2dyv57Ed8BJQP8y+feaoV43Wl1L2+4ErchTMGPc3e4Qt 8uZhLIHRtvRWJ578Va8ByDXJdoTGKcQPSvzHMcrm34n/OubFQ2vQ6JH9+UlwpVqGqXmK+r 8I9BvN8EMTirdwFfv0127Afwv3OZaz7urx8lxT7LQ6w2yoIoQE2I/S7fKNbcMBuaULEa6o MGerwhmF/f28i5yu5B5LMtkvpzSx+CMooVfCUAMdzyaN4M/WSyWq/2AFSXuUvw== 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 4dWD5T20CFzCS2 for ; Tue, 16 Dec 2025 23:43:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23dad by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3c54b204bf86 - releng/14.3 - rtsold: Validate entries in domain search lists 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 3c54b204bf86dc6c84b72c3fe8820d0ce25cb354 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:25 +0000 Message-Id: <6941ee9d.23dad.148278e4@gitrepo.freebsd.org> The branch releng/14.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3c54b204bf86dc6c84b72c3fe8820d0ce25cb354 commit 3c54b204bf86dc6c84b72c3fe8820d0ce25cb354 Author: Mark Johnston AuthorDate: 2025-12-15 20:50:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:41:02 +0000 rtsold: Validate entries in domain search lists Reported by: Kevin Day Approved by: so Security: FreeBSD-SA-25:12.rtsold Security: CVE-2025-14558 --- usr.sbin/rtsold/rtsol.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 79928932ca5c..a7d5a44a7d44 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -776,6 +776,41 @@ call_script(const char *const argv[], struct script_msg_head_t *sm_head) argv[0], status); } +#define PERIOD 0x2e +#define hyphenchar(c) ((c) == 0x2d) +#define periodchar(c) ((c) == PERIOD) +#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \ + ((c) >= 0x61 && (c) <= 0x7a)) +#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) + +#define borderchar(c) (alphachar(c) || digitchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c)) + +static int +res_hnok(const char *dn) +{ + int pch = PERIOD, ch = *dn++; + + while (ch != '\0') { + int nch = *dn++; + + if (periodchar(ch)) { + ; + } else if (periodchar(pch)) { + if (!borderchar(ch)) + return (0); + } else if (periodchar(nch) || nch == '\0') { + if (!borderchar(ch)) + return (0); + } else { + if (!middlechar(ch)) + return (0); + } + pch = ch, ch = nch; + } + return (1); +} + /* Decode domain name label encoding in RFC 1035 Section 3.1 */ static size_t dname_labeldec(char *dst, size_t dlen, const char *src) @@ -804,12 +839,11 @@ dname_labeldec(char *dst, size_t dlen, const char *src) } *dst = '\0'; - /* - * XXX validate that domain name only contains valid characters - * for two reasons: 1) correctness, 2) we do not want to pass - * possible malicious, unescaped characters like `` to a script - * or program that could be exploited that way. - */ + if (!res_hnok(dst_origin)) { + warnmsg(LOG_INFO, __func__, + "invalid domain name '%s' was ignored", dst_origin); + return (0); + } return (src - src_origin); } From nobody Tue Dec 16 23:43:26 2025 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 4dWD5V3wMvz6LPZB for ; Tue, 16 Dec 2025 23:43:26 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5V2sk0z3HHb for ; Tue, 16 Dec 2025 23:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928606; 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=k8rBe5Fu/LzsqI/DOgAEC/ee1SNevDMwEBiu+8adUYE=; b=I71vSIshY3z8AmoshWWeYf0Ek19W10baDVUkZMJ85ixkWL3AQ5F08gkdMaVlKm0WnVsF1S 0rXw5/DnP3fQq+BkNul7pkVxPOngsafJvAUqz3CZiYEA4HzaoVN4Yh0Mb4f532LKks1+7n VTekrX7JpgVN5SBftz98EgYahluBIESnev6VXg5Z3hZLDuBs2evj6N2DVWm2mg107caoj5 dVbIsa4ltni/wPyJSkSTBijVAImTerPxU3CJwUaVZJr9R4gDe4kUwL4wL/8kYU/VNoIYOp /8405stdNFpzBPtKubzZr9SPxL5ooZOJ4M8HE5gF2XNeWrDA6eCP5qkha2heRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928606; 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=k8rBe5Fu/LzsqI/DOgAEC/ee1SNevDMwEBiu+8adUYE=; b=ZAoBX7foFSpOI03D10WRexhUsVv1UFSaRWcl+piZXwMBPJDEEhXcpL6WEPk2zGmosQi5Y+ Xp377bIFyMD5gQD1EqubwM2nI+7wYob8V44hq+BjBwkvVJbzwrW7YrD7mBUC7RpTb7GRWl We3YV+ABXsgAUiTNOcgQO7Q/GcyKjwCEd6Pg2sTOItwY1OWmNvSjLp4V6lIpvvr5zPgWFZ AA0aVPzmtbmyAYDht9DJJALn3Pj7eyJWJC20Sf7eZVRDMmntrFPpbkQGxLSGU4knPWIEaM /VmOTwbsIblGo06xLkHPVGrvUzePe0Ictp2vnnar9t4pZ2yhi7lon2MxdziwpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928606; a=rsa-sha256; cv=none; b=k/6UL0ZqjYd+ODDvz3JlBRMTah4Bwl0h5v/zxmZyEB3cGBj9huM53RtfyGoAlAH5+AQx1u HEhNaH6wC05J3naej5OBm17mS2TTeZIFcnumn+occ6bW6RxEEMtpmlwzJ2+7Ai9Ch2qIDK LOQDilyUPJ7cMIDb7Ee7baMMP9VCCZ8NXT9J1+7QqgfRk344udxwvF9uiJDSdxvHyF2Osc UAlcJhwgbu+IubIZ0VCwMJQbnkVkvd0uNoxg2ieJOWvcvCGxYbKCQ4xXqxSosi7B84RVym dxskSZSRqIG2DiwQuSwqYrkCsdZXihUsrnWFiJb0So7y5Ml3s0cpb9sWgnzEcg== 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 4dWD5V2QBpzCPS for ; Tue, 16 Dec 2025 23:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 242ba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8b2a912a8abd - releng/14.3 - Add UPDATING entries and bump version. 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 8b2a912a8abd663785e0b5a0c358a9aa46dd6fc3 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:26 +0000 Message-Id: <6941ee9e.242ba.3471b51a@gitrepo.freebsd.org> The branch releng/14.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8b2a912a8abd663785e0b5a0c358a9aa46dd6fc3 commit 8b2a912a8abd663785e0b5a0c358a9aa46dd6fc3 Author: Mark Johnston AuthorDate: 2025-12-16 16:16:50 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:41:08 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 8 ++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 09b22327d84d..88bacfe686b4 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20251216: + 14.3-RELEASE-p7 SA-25:11.ipfw + SA-25:12.rtsold + + ipfw denial of service. [SA-25:11.ipfw] + + Remote code execution via ND6 Router Advertisements. [SA-25:12.rtsold] + 20251126: 14.3-RELEASE-p6 SA-25:10.unbound diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 49a6dc75c455..dd0c906a5aa5 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.3" -BRANCH="RELEASE-p6" +BRANCH="RELEASE-p7" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Dec 16 23:43:32 2025 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 4dWD5c2j41z6LPxY for ; Tue, 16 Dec 2025 23:43:32 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5c1hZmz3H50 for ; Tue, 16 Dec 2025 23:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZjZDojtYKk4tILlztY0w/a9/UFlBJA969/6+J4k6CuQ=; b=Fb2c1LWNd6t93LD/TOckIcY/oyeCEA+fEqCMdNb1O0OawZn1Wwq7q6WSCZQ9oWL7RjZcoE b18q2JvsAQFMFBflsy4GV4qwho5TvusUOlTOO1mHXxSg7Sw+0opJKMZ2apKVUG81oJcx/X v6ZY5XwvdK1kUri5rCRh2qoRCp60hnG0LcfbqSfoWt4inJrJ+slSZ4Bp5M25yuRDbo59zv h4djIO6GK035R0ng3vlDci4KR3eZFZxAMm9oTK/ZQPpD6Sj4Yzcg5cYwVpkZbOsxQs+kDb D4FS1h0PoCAHr3DZAazXY4gVw65vdA3KPOPQJkDvm28m+nLdfQvEZKhFI/+nKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZjZDojtYKk4tILlztY0w/a9/UFlBJA969/6+J4k6CuQ=; b=h+eFJ4XKJZ9R7K1eKB4AB3UIpXywzOlFahGE/5EvvLAbhi/fQsMla3sjRImfeERVT1cEwo ac+Th1/Yo/mZOmOtnZhyOhdBluQVuhvDotMGUOG/xoIZ/LKn5v0roVMtMGJjN9tI0OPylG zUALS0M0c1IEQaB9vRqFzPprOf+mIwsbeNFmJPEZipSLyZYabdV9G5BOv2cT2Exkt+LvrK 75Fzk6LgEYwBijhoicHmYtaAzxRMYPqZVhgDRmuUOrMtAnOqAb4UpipnWVmLSg12xJEMhm 1xh4EQciJey8f4uLsiMl77hiAuBT0uPs9lNL7Hc17dqtHaVXu/ESPqhaBtw1NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928612; a=rsa-sha256; cv=none; b=ZcfJ7KVdAzJP5+Pwep/gNSPaUgOGiLaigL+bB/3xSUDuogfFcEv49u+yDijDc62bDYcLzV akz7QOA8Pfsrte0mG0T5GTcA2+XgPjmE5JsQgmqPbE3cfwIHx2G9llRR164FuDCYym2tTF kC1OhvQbO1NTA5A7EiKh2hAyqOaELmDOFsEWFSBzPzEYkdvPK5MeV7Fk9Hkl8GEgCOhObf 7rk7lEIHxTBJSwqpvSqQAuDLiqngjMIJ2CQziYm4b+OAhvrdXS10aTmwhNMUOSoGfwy5nz bqN06k1ebgu45+S6zUOifZOdLL25Ioe2dfgxWe3j6j/iyu7OeDFcDudmXYZQZA== 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 4dWD5c0rllzBtS for ; Tue, 16 Dec 2025 23:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22fbd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Kyle Evans From: Mark Johnston Subject: git: 60026b06366f - releng/13.5 - ipfw: pmod: avoid further rule processing after tcp-mod failures 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 60026b06366f0178e2473441aaf9e601061c07a4 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:32 +0000 Message-Id: <6941eea4.22fbd.61ad6091@gitrepo.freebsd.org> The branch releng/13.5 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=60026b06366f0178e2473441aaf9e601061c07a4 commit 60026b06366f0178e2473441aaf9e601061c07a4 Author: Kyle Evans AuthorDate: 2025-11-01 17:34:11 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 01:55:38 +0000 ipfw: pmod: avoid further rule processing after tcp-mod failures m_pullup() here will have freed the mbuf chain, but we pass back an IP_FW_DENY without any signal that the outer loop should finish. Thus, rule processing continues without an mbuf and there's a chance that we conclude that the packet may pass (but there's no mbuf remaining) depending on the rules that follow it. PR: 284606 Reviewed by: ae Approved by: so Security: FreeBSD-SA-25:11.ipfw Security: CVE-2025-14769 (cherry picked from commit c0382512bfce872102d213b9bc2550de0bc30b67) (cherry picked from commit 94360584542abc49a1d947844cf4d8ca1369d4df) --- sys/netpfil/ipfw/pmod/tcpmod.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/netpfil/ipfw/pmod/tcpmod.c b/sys/netpfil/ipfw/pmod/tcpmod.c index d7400f4fd5ed..138fefe22a98 100644 --- a/sys/netpfil/ipfw/pmod/tcpmod.c +++ b/sys/netpfil/ipfw/pmod/tcpmod.c @@ -58,7 +58,8 @@ VNET_DEFINE_STATIC(uint16_t, tcpmod_setmss_eid) = 0; #define V_tcpmod_setmss_eid VNET(tcpmod_setmss_eid) static int -tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss) +tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss, + int *done) { struct mbuf *m; u_char *cp; @@ -73,8 +74,10 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss) * TCP header with options. */ *mp = m = m_pullup(m, m->m_pkthdr.len); - if (m == NULL) + if (m == NULL) { + *done = 1; return (ret); + } } /* Parse TCP options. */ for (tlen -= sizeof(struct tcphdr), cp = (u_char *)(tcp + 1); @@ -115,7 +118,7 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, int tlen, uint16_t mss) #ifdef INET6 static int -tcpmod_ipv6_setmss(struct mbuf **mp, uint16_t mss) +tcpmod_ipv6_setmss(struct mbuf **mp, uint16_t mss, int *done) { struct ip6_hdr *ip6; struct ip6_hbh *hbh; @@ -143,13 +146,13 @@ tcpmod_ipv6_setmss(struct mbuf **mp, uint16_t mss) /* We must have TCP options and enough data in a packet. */ if (hlen <= sizeof(struct tcphdr) || hlen > plen) return (IP_FW_DENY); - return (tcpmod_setmss(mp, tcp, hlen, mss)); + return (tcpmod_setmss(mp, tcp, hlen, mss, done)); } #endif /* INET6 */ #ifdef INET static int -tcpmod_ipv4_setmss(struct mbuf **mp, uint16_t mss) +tcpmod_ipv4_setmss(struct mbuf **mp, uint16_t mss, int *done) { struct tcphdr *tcp; struct ip *ip; @@ -163,7 +166,7 @@ tcpmod_ipv4_setmss(struct mbuf **mp, uint16_t mss) /* We must have TCP options and enough data in a packet. */ if (hlen <= sizeof(struct tcphdr) || hlen > plen) return (IP_FW_DENY); - return (tcpmod_setmss(mp, tcp, hlen, mss)); + return (tcpmod_setmss(mp, tcp, hlen, mss, done)); } #endif /* INET */ @@ -207,19 +210,23 @@ ipfw_tcpmod(struct ip_fw_chain *chain, struct ip_fw_args *args, switch (args->f_id.addr_type) { #ifdef INET case 4: - ret = tcpmod_ipv4_setmss(&args->m, htons(icmd->arg1)); + ret = tcpmod_ipv4_setmss(&args->m, htons(icmd->arg1), + done); break; #endif #ifdef INET6 case 6: - ret = tcpmod_ipv6_setmss(&args->m, htons(icmd->arg1)); + ret = tcpmod_ipv6_setmss(&args->m, htons(icmd->arg1), + done); break; #endif } /* * We return zero in both @ret and @done on success, and ipfw_chk() * will update rule counters. Otherwise a packet will not be matched - * by rule. + * by rule. We passed @done around above in case we hit a fatal error + * somewhere, we'll return non-zero but signal that rule processing + * cannot succeed. */ return (ret); } From nobody Tue Dec 16 23:43:33 2025 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 4dWD5d6RW5z6LPZM for ; Tue, 16 Dec 2025 23:43: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5d22DYz3H5J for ; Tue, 16 Dec 2025 23:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928613; 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=s2S2UlcXuHkLEwr3YjDhJxCMDW4VLZW1ox/mfZ/VS/8=; b=hjLVPAHkzNGivLnrb35jlSgtJTM5mpQ7FUwRwuCKalQY9G0bjX1Kc/xJGGSTf+pmrwJKFW W0cF8YD4rTeCzhcUGz906jDTLIqDgZWSH89QSSqnYThRtMtLPHgdSS4gl3BvgAu4tBUcKv 0OKv5NjSakQZdXIKqiz2TQbWNcMBNENeslek5fj57VrfT+1EXNpDji9hbQzMG2xZ1O1Fc7 uaiM/LbxwMEU7TL2lgSsbUxs9EGKjH8g6G11NjwkrW9QVUSxjDCRk8bEcZHYK92xqXkDxw IQ3dgnZHq+Kp+I0ZRNE5dUWlAlIf6RQzdcHAp5y+9eG9LzJHLR6yOzwbJVyV6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928613; 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=s2S2UlcXuHkLEwr3YjDhJxCMDW4VLZW1ox/mfZ/VS/8=; b=vhlXcKYX317V9Q2ZB4jfD+AA7oxzSFIrpVtaLnz4W8lkK/8xakJ9zDM1NZE5ZrFAxFpie7 8KIhDo6KdGos3x3R+4mMil3Lxn3GLJxRIKif2Lev3WFAHlWuz6ZtKAiZj0tPqynkO4ggZu lFGAk+MvldVsKwl9hYB0PcHVyJzajOTAU6/dPlCwkz73x1c7WDjUhKgIZSpDcVGlqeFXBm RZZnczjbJrCFVMhoVOfeae09pqgiokzvtc5owAp8Jl2ebl2/YyBF68pS6gZnyIZUrB0/ni nZtnpzn6w9yhTgKogbZxEyYK8+ljF9vSCOTJZI8nSkeXgV2KLe8ZLZHh3p6IeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928613; a=rsa-sha256; cv=none; b=okjLLK/ifQRY4U0EXn8UarE3kOozf4NJqmh+LmGnaMccIBAqyaIaSFDm/0f9WWmJhRgHQW r2oEm4iXcSU+84Qf7CbA/xqmJtN97omAgyModq18hcY6YsA/7L/mv3I7+YePpJrF6fxLcp FNMJzjQAtx3yaI6OgErDY8bTYvcygvl3E7ydeecDS3YbMGAGQ7nuHHdF4s1NXB6Z87lUlk xhVjrTwWYjlvgXzMbAajb1CsisLZBAA5j7heCVXKeX5jRHzAs6wUIAqfFq/nRJ5Dw51w5x bwDjB+BZV7K5BeOG3ScdWbq45K9fRjeSwocARs29Wxf5zDdPOhHkX1nUsv7Zgg== 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 4dWD5d1dbyzCS6 for ; Tue, 16 Dec 2025 23:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2411b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 35cee6a90119 - releng/13.5 - rtsold: Validate entries in domain search lists 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 35cee6a90119cc5d123f705544433164a7a9227a Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:33 +0000 Message-Id: <6941eea5.2411b.35034f07@gitrepo.freebsd.org> The branch releng/13.5 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=35cee6a90119cc5d123f705544433164a7a9227a commit 35cee6a90119cc5d123f705544433164a7a9227a Author: Mark Johnston AuthorDate: 2025-12-15 20:50:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:41:40 +0000 rtsold: Validate entries in domain search lists Reported by: Kevin Day Approved by: so Security: FreeBSD-SA-25:12.rtsold Security: CVE-2025-14558 --- usr.sbin/rtsold/rtsol.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 187aa44f6740..72573c2eb4b0 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -764,6 +764,41 @@ call_script(const char *const argv[], struct script_msg_head_t *sm_head) argv[0], status); } +#define PERIOD 0x2e +#define hyphenchar(c) ((c) == 0x2d) +#define periodchar(c) ((c) == PERIOD) +#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \ + ((c) >= 0x61 && (c) <= 0x7a)) +#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) + +#define borderchar(c) (alphachar(c) || digitchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c)) + +static int +res_hnok(const char *dn) +{ + int pch = PERIOD, ch = *dn++; + + while (ch != '\0') { + int nch = *dn++; + + if (periodchar(ch)) { + ; + } else if (periodchar(pch)) { + if (!borderchar(ch)) + return (0); + } else if (periodchar(nch) || nch == '\0') { + if (!borderchar(ch)) + return (0); + } else { + if (!middlechar(ch)) + return (0); + } + pch = ch, ch = nch; + } + return (1); +} + /* Decode domain name label encoding in RFC 1035 Section 3.1 */ static size_t dname_labeldec(char *dst, size_t dlen, const char *src) @@ -792,12 +827,11 @@ dname_labeldec(char *dst, size_t dlen, const char *src) } *dst = '\0'; - /* - * XXX validate that domain name only contains valid characters - * for two reasons: 1) correctness, 2) we do not want to pass - * possible malicious, unescaped characters like `` to a script - * or program that could be exploited that way. - */ + if (!res_hnok(dst_origin)) { + warnmsg(LOG_INFO, __func__, + "invalid domain name '%s' was ignored", dst_origin); + return (0); + } return (src - src_origin); } From nobody Tue Dec 16 23:43:34 2025 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 4dWD5f65whz6LPxZ for ; Tue, 16 Dec 2025 23:43:34 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD5f2vBXz3HKD for ; Tue, 16 Dec 2025 23:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928614; 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=e2B6jZRD7pk3Lfg2vyFBm5aUh9hObGAp6ac5KGSrXYM=; b=spm4jIemIm+vhHqjD6DaDdE0Uzs10QQrDtnpl395aOUzdcCl2sAyymH64sXdz3yjP+5d9Z XvmsNM6BNTqbI8I4FPgOOwwXZtgLi/dfrWEeQOciheExcTDaVpEgCfN0S09zVYteUy0BTc DIaTjBWon6YrKjgiEpUPgMXmBKxTP7/KtiSEozHKWgZIAcEdOPqf/Q1+R2OmbPrtNSk4CE tSalcIQ0x4Ierlgoiz5rcp4/CYdTX8eaIz381v1PC8gMCc6Xgztc9JP1glv75/KLvReIHO cNYdsnZ+J8/bUF2yMeC2FsREuTHxx08HRTynankVD7RdLtbNNwt8JOpjnxX5gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928614; 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=e2B6jZRD7pk3Lfg2vyFBm5aUh9hObGAp6ac5KGSrXYM=; b=iqPbZ1morWYWPiQapf/RvCtTBD87fdcyj0MKbsrtaMrzqiD8F1SP6MKCCdIjt9b/64BC6m J0JlJnv4euJFHaFYQSzULjhnPz5tUYiXsuE9lHy9jTSfnubbWDKpCDzNAtBCBQu28xZYW8 b2uKWdOKUzPRtazvTkIReZwEmJuemMgb1Wr3Apkmo++7S86r9tD6h3mjM29P7hvu+yOPuT dhIKN1LTrrLF+sHu6sD/Ms1okDkZLHVXn9goBD5aXj4CiYxDc8NmHvnJGQC1yB6UDPOs/Y C9AzGWa/hoOpHf7ygQVWf8e6HBdpGWtvMkCzS8Q62Qd1KTT7YXGDg6PbBoqIrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928614; a=rsa-sha256; cv=none; b=NmNrUsQgHQcynGYvXlvhRPnf7dp1RsYTuuz5jS8W4LgMtbqz9JgzffVSCtD39lde1LvgXH kiL1AmXcqN+Q3sqZQ3LsCEHoe2dZyrVOeQwx6+W6Y5/z3U4ErWOv79dJJFfhx3/IDA92XG MQtBRmafH932edPlr/Ng0v1+tFLXOt3g1cMGX6YyBnXTLTwfYhIUah7COLm3q7JPysRiCN 1JHD04wX25/I7NghA2ZdTY86vSbva8kVH/+QSJb06HloTpq3RwfNvbaX0TpoDTDpW8mUqE zbS6BCrISJcy8/UhvvTRpHjuU1kHm1ueaTUZi+8U7X81KSsxXBBOG0rJFKndZA== 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 4dWD5f2PY5zCPW for ; Tue, 16 Dec 2025 23:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 242be by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:43:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: eb5a6f5f9f74 - releng/13.5 - Add UPDATING entries and bump version 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: eb5a6f5f9f74d3aa3deed0ec4c30ebc2a30e92b7 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:43:34 +0000 Message-Id: <6941eea6.242be.3bc4abca@gitrepo.freebsd.org> The branch releng/13.5 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=eb5a6f5f9f74d3aa3deed0ec4c30ebc2a30e92b7 commit eb5a6f5f9f74d3aa3deed0ec4c30ebc2a30e92b7 Author: Mark Johnston AuthorDate: 2025-12-16 16:35:28 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:41:46 +0000 Add UPDATING entries and bump version Approved by: so --- UPDATING | 8 ++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 270e20be199b..4de06a13d679 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20251216: + 13.5-RELEASE-p8 SA-25:11.ipfw + SA-25:12.rtsold + + ipfw denial of service. [SA-25:11.ipfw] + + Remote code execution via ND6 Router Advertisements. [SA-25:12.rtsold] + 20251126: 13.5-RELEASE-p7 SA-25:10.unbound diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index a72f9f110df6..4506e76990cb 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Dec 16 23:44:10 2025 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 4dWD6M3mrkz6LQ36 for ; Tue, 16 Dec 2025 23:44:11 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD6L654dz3JvZ for ; Tue, 16 Dec 2025 23:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928650; 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=yVmfE29POuochemosRb+WEUgnqAOwouFLLklMJxnLQc=; b=g3w0luclrHt7J7iA1xvOwqVDH1ZdNatBzwWa2byg8rnlIXOLTaftMCG5hYDAV4dhZSEenr qeMgOUdCpB7ETO4N+w5Q05AeJLTyFqSSH/tjYPFC0mmx6bfjMHTW+N1+5dlAXQwpfNsqd/ iuTAatRkDkMKLZIuDwEPYIrYwZsLaynidaNGuMhH/UHSVT+b54qlbgGUgLz8GPO/aAASjG lH7bS607GwjwBjSpRrd3QA9z1i6xb67h9qNsvVxZuASfhX6uewEHHCDmt4OeSv1OO8FEuG LBHoOv5b3TWz4lB7U6AiHBBDOlE3KJphvNpqnfIY+DAIb/L6CEPiLF6B8y1WQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928650; 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=yVmfE29POuochemosRb+WEUgnqAOwouFLLklMJxnLQc=; b=I+IQzZfPutHpdC3mdHPWk+SSihJr7hFaxO5xOtcJX/YlaiCORQIIQX4M+eFFAU9/iIYQDH Zcsvov/MBngAdOfzgIbrLzZDZQjT/9XL7r8BmTZi1hAUKRltxi9b2qNCCcpN6HlWz1G26c M+L8yAHasbAppK6WZShlWtbgeBU7+unElgyMLMjfd0L1/zT51vOpyq9rePcL6+oNfEREHE 7/PLXzeoYP4dvfk0c+rbtPWd4UCsFUrjYDBmtaI0XcqEuNBvoE3SwhfPFIkBjr/XDhTgJD ljsY0ivOIO8uK2ELTnUxYG9PWV9jTdvpUsiTHSJm9dW8z34qYF2megTNIoGFww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928650; a=rsa-sha256; cv=none; b=gBiJj0ZU5eaGdKX7HlFMFCylHjYcJPWuDAklPxPyCMp6y8RESKUKHFBlPECI2pXSkwZzaN F15D5xRZL2mkI7lkYUP/1FhRu1IXKybUQH0ItIRPtLP6uiCakv9x0v3BvNSeUWo9RygV3B mNT8EjgS9ywWSAlCuyMVvty25AUwD9dE286Wm9VnaUnCmmyiD2zE9xCDFZSVxgKBsssXUR 8SkGTcVXrplQVzwnrXOheZvyPGJkAsWEblwLOT+m5EO6Efqe/onAMafX+Hw4Inchx4yfs0 BboPDc3zOxw0qHD5Ad9iBYC60Pvn+HvD06i7SJ7R/QhhwvhzNEcsG9lTBiFDAQ== 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 4dWD6L5Z5dzCPX for ; Tue, 16 Dec 2025 23:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23b06 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:44:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4fef5819cca9 - stable/13 - rtsold: Validate entries in domain search lists 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4fef5819cca9c54bb6d45520ac125c97979b845a Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:44:10 +0000 Message-Id: <6941eeca.23b06.19d06a35@gitrepo.freebsd.org> The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4fef5819cca9c54bb6d45520ac125c97979b845a commit 4fef5819cca9c54bb6d45520ac125c97979b845a Author: Mark Johnston AuthorDate: 2025-12-15 20:50:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:44:05 +0000 rtsold: Validate entries in domain search lists Reported by: Kevin Day Approved by: so Security: FreeBSD-SA-25:12.rtsold Security: CVE-2025-14558 (cherry picked from commit bf804f69dd94b3c98962618b4ad3b48a35bff2ff) --- usr.sbin/rtsold/rtsol.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 187aa44f6740..72573c2eb4b0 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -764,6 +764,41 @@ call_script(const char *const argv[], struct script_msg_head_t *sm_head) argv[0], status); } +#define PERIOD 0x2e +#define hyphenchar(c) ((c) == 0x2d) +#define periodchar(c) ((c) == PERIOD) +#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \ + ((c) >= 0x61 && (c) <= 0x7a)) +#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) + +#define borderchar(c) (alphachar(c) || digitchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c)) + +static int +res_hnok(const char *dn) +{ + int pch = PERIOD, ch = *dn++; + + while (ch != '\0') { + int nch = *dn++; + + if (periodchar(ch)) { + ; + } else if (periodchar(pch)) { + if (!borderchar(ch)) + return (0); + } else if (periodchar(nch) || nch == '\0') { + if (!borderchar(ch)) + return (0); + } else { + if (!middlechar(ch)) + return (0); + } + pch = ch, ch = nch; + } + return (1); +} + /* Decode domain name label encoding in RFC 1035 Section 3.1 */ static size_t dname_labeldec(char *dst, size_t dlen, const char *src) @@ -792,12 +827,11 @@ dname_labeldec(char *dst, size_t dlen, const char *src) } *dst = '\0'; - /* - * XXX validate that domain name only contains valid characters - * for two reasons: 1) correctness, 2) we do not want to pass - * possible malicious, unescaped characters like `` to a script - * or program that could be exploited that way. - */ + if (!res_hnok(dst_origin)) { + warnmsg(LOG_INFO, __func__, + "invalid domain name '%s' was ignored", dst_origin); + return (0); + } return (src - src_origin); } From nobody Tue Dec 16 23:45:05 2025 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 4dWD7V1wM4z6LPss for ; Tue, 16 Dec 2025 23:45:10 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWD7V1Dnqz3Kh7 for ; Tue, 16 Dec 2025 23:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928710; 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=yjzSrZEbNsuhcVzSKMWW2FiSV1PpLqWHFrO46/em2lc=; b=RfcWxuAU+ADAakUvaD9cN96GzKufkVJF+rX5L/hIOXMvHPiiVewz40TbO942/vc3ujCNQk Zl7mr38k7OpoMdKI8tC5KSq9CQQK2Zh7ErWbewDMdIvwowmUxGrXX24cxh1ExuMpCOjagD 18ap7N5svGaCg/qywERTIp3tD40FTxVE6FXL4+ylIT5XA5a6MZUY7LcBh6QL6NFReYB49n WY9r2hvlUC8PkPT+1wuNGYMG14C3qwy/a/onKOv0UGrP2zZVrEkBOkmpCoCAKvWTp981t7 SmlsK7Dj1feEl8bapAFNUYoeaQKRqeSJ2vN0vdBMqs/C6yDRgMk3XTjL9cgMDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765928710; 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=yjzSrZEbNsuhcVzSKMWW2FiSV1PpLqWHFrO46/em2lc=; b=VJyayEtAllnNizdV4MgJbtj74+k9RUmm5zB9+vhB/Ji0/EIEWWqd8YNGDJYSscH0/81BCa DcBkpoJtcG0Z5g5dnw6nQepAL4MztibjfB+53TTOOtdkIPv7oUfMve++cuCYHh6kXZ41fX XIV46nmSrUfvF6uVngoLcpuKxYdO9fX6uWCkxv4sYnoiIinUb1GIS1C4RrnuKvmTUvt+9a vMaWMEfwaGvuGvzpixfUMcoCHxZP6uoZuoWTRwaKZvYA9kxxk4SZlZHh9O2xKUo/A1G9Ms 7RZrCWnsyNXY4RA6QEuVnLIQD4gdKDXn/WZhh4l/7SJf2i8U9BMDw+9bwNNbCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765928710; a=rsa-sha256; cv=none; b=Rg8+yn28vold+EqJpiHahCQzSOLLzUESU1eVk78w94mHIXtsdqnUDe+tLnk16Ap4ScuM3v Xve5fvgU8qJ8FtzKsu9cIenKkOGSyDv/Tr1mlmJEHJ/ucgZV173Awew5WNUlwoghAx8hr8 rRjYqt20iUY5tw7eA8tHI/SJSD+wRQ3cyZZxphXuLZS/szhgRlqHPGzq5zuP1Lpb1n6Iu9 tN94X01jGpQlXPhRjLir+yu8aW+p7x2/b2+bRTLGAAavNF/Q+NauzYtyIMSMUwanGsYXzR e2e3YAAJSgq19OF98kBgKO1d2Y/BXJDd6zHw3iNCCEjf0kpEO0K+qow//B/kkA== 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 4dWD7V0p6bzCSF for ; Tue, 16 Dec 2025 23:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24121 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 23:45:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 26702912e857 - stable/14 - rtsold: Validate entries in domain search lists 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 26702912e85700ec3fb761382d445df815789f92 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 23:45:05 +0000 Message-Id: <6941ef01.24121.6d52d104@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=26702912e85700ec3fb761382d445df815789f92 commit 26702912e85700ec3fb761382d445df815789f92 Author: Mark Johnston AuthorDate: 2025-12-15 20:50:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:44:52 +0000 rtsold: Validate entries in domain search lists Reported by: Kevin Day Approved by: so Security: FreeBSD-SA-25:12.rtsold Security: CVE-2025-14558 (cherry picked from commit bf804f69dd94b3c98962618b4ad3b48a35bff2ff) --- usr.sbin/rtsold/rtsol.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 79928932ca5c..a7d5a44a7d44 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -776,6 +776,41 @@ call_script(const char *const argv[], struct script_msg_head_t *sm_head) argv[0], status); } +#define PERIOD 0x2e +#define hyphenchar(c) ((c) == 0x2d) +#define periodchar(c) ((c) == PERIOD) +#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \ + ((c) >= 0x61 && (c) <= 0x7a)) +#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) + +#define borderchar(c) (alphachar(c) || digitchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c)) + +static int +res_hnok(const char *dn) +{ + int pch = PERIOD, ch = *dn++; + + while (ch != '\0') { + int nch = *dn++; + + if (periodchar(ch)) { + ; + } else if (periodchar(pch)) { + if (!borderchar(ch)) + return (0); + } else if (periodchar(nch) || nch == '\0') { + if (!borderchar(ch)) + return (0); + } else { + if (!middlechar(ch)) + return (0); + } + pch = ch, ch = nch; + } + return (1); +} + /* Decode domain name label encoding in RFC 1035 Section 3.1 */ static size_t dname_labeldec(char *dst, size_t dlen, const char *src) @@ -804,12 +839,11 @@ dname_labeldec(char *dst, size_t dlen, const char *src) } *dst = '\0'; - /* - * XXX validate that domain name only contains valid characters - * for two reasons: 1) correctness, 2) we do not want to pass - * possible malicious, unescaped characters like `` to a script - * or program that could be exploited that way. - */ + if (!res_hnok(dst_origin)) { + warnmsg(LOG_INFO, __func__, + "invalid domain name '%s' was ignored", dst_origin); + return (0); + } return (src - src_origin); } From nobody Wed Dec 17 01:33:48 2025 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 4dWGXs0ZzFz6LZK6 for ; Wed, 17 Dec 2025 01:33:49 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWGXr6W15z3wqx for ; Wed, 17 Dec 2025 01:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765935229; 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=3IVgeFjudRVpEcfoQeDVHhqj+0yp++gtGKlbUUhtWgk=; b=BEmV2mLCxMyqBMqzxSOAHvH1L0CZO2t5AHMfMJKZUHsy2ceTTQ3jchAKi/TKbkFzUFfFT7 Ll5GYs9H28jJFaYab5wlC2+9VVEu/Ai9Ywx5X2c1ej2mbyBCOWEPpf86NfqcBYcz8hv4bs gzIaT6PKveoycr6y9mDg82/8MNyCGhSaA0RhFOQ+Ju5pMZqDrUSzAEasyvoZYJb41BLbIr R5MErUDknGUjcnd9piTXYwfIbXmlsJQQNc6oTz7K/3l3vEmX98pDc01ol7sjpHjIfU+bpr jheQU7bKkjqRlb6hAS2y4ju3NQrSsei2lzni3o/iXQpqaMxADj3ZVuL4Vnu8wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765935228; 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=3IVgeFjudRVpEcfoQeDVHhqj+0yp++gtGKlbUUhtWgk=; b=F0jLCwb1bvbtkRC4y2qWyJwlF2qd69lgTEJ3uu9HPzZD5vqeTq0FVkoh9UwvS09hJR+/Tc AXLJ5zdg3VrvotsLzCQpRBXhFd1yJTHvRsNqxrk/j6p3KZH5d+LadBnXYk3QcKBw8GpimO D1v0QIsZ3lH/gUkzIQ8TmqpWC6FOW65Pc6CwVsPLglgJ7HtChq2Cte3zXf6dY+voUGbNqa mcUIqXhZZgZYFmCiP22wXeYMgDfra0iqNbdyBJJ4mC04aL7zA20Is5E1YWYHuFb5FSC9Sv tmc2CSRhKi8cEAKi2IPpF9qXLhwuZ2EwIWecLpXkfBZQimih3I0ii7RqlE6chA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765935228; a=rsa-sha256; cv=none; b=TbLnLL8jKOyZt69Ogj9F6R8uqz+MQZ/M0sF8HcjBIHnklCDV52xiJHb2IQG++gqe6pSFxj dtIVFSwDYMhPA8fMFssRB32IkDYNjACDmEaFdzqNeqa3sBGq2rcJnskXJQhQ4YlBO5uaAr DsqRclbKnmXve4muZ3KkDvWBLcCpkuLF82wsbOPZkO1x8b3yuPOXYTo7b2v0dn/jXL0HtL A09A4QOdhZTsz7TzlWkm9mFvcz4tCyENhmfXRzCxeF8Jb06OBwcP8Bty5LEdKCtcfVkdSc h02xvzOce8pRliKh4oa9JkMJq9kaLqR0RNIxu1zZO80mjIfMDUfYt14rInCRiA== 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 4dWGXr5pkszXNm for ; Wed, 17 Dec 2025 01:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35731 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 01:33:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 90d55d16de2a - Create tag release/15.0.0-p1 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/15.0.0-p1 X-Git-Reftype: annotated tag X-Git-Commit: 90d55d16de2a5480a6c7f53849c67c45d27fc0d4 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 01:33:48 +0000 Message-Id: <6942087c.35731.ea27585@gitrepo.freebsd.org> The annotated tag release/15.0.0-p1 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/15.0.0-p1 tag release/15.0.0-p1 Tagger: Philip Paeps TaggerDate: 2025-12-17 01:31:28 +0000 Tag FreeBSD 15.0-RELEASE-p1 commit 63a5b645b23e1e1b6c5023a02703109282ef2a27 Author: Mark Johnston AuthorDate: 2025-12-16 16:28:47 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:42:39 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Wed Dec 17 01:34:44 2025 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 4dWGYw5vdTz6LYv5 for ; Wed, 17 Dec 2025 01:34:44 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWGYw3Y3Yz3xD5 for ; Wed, 17 Dec 2025 01:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765935284; 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=5O62xpC/R+s7YG17dWtWjwaSlnmV6Qy4FX6aWLJG8Bc=; b=QAeI3sYO+A/y1y0jUeMrAbc6H2C9Aq5BPssQfe6vyyxA0DZTAmhDuTJM+BbH5iGlgJT1yZ PEvPyFG+q1uUnwumuRQQ+AZxd1sW4aIpdADaKhDTw+KM6JzL/Y/pGlxwff60XfUwo6feK+ FBN0czp1Yk/6Y4j1zssZrt7TBHwH7R4bv2rZ3vz7D8c5Zk31gtjN29hrRtb+Dkfs/TATto 7vF37l45nRShPzcP/Wg/P+85zKOX2gyi+0SygUTDcvC9EwaYLvcQUOFq1jrO2xBTZnlHiE AnWFVuG5fSOtmbcC3wEsQc+dWO37/BrU1mYm5XtEvzl2Y0N6PjaV4BogSm0joQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765935284; 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=5O62xpC/R+s7YG17dWtWjwaSlnmV6Qy4FX6aWLJG8Bc=; b=j+7xjhuYpOem+xR/rb4hyBNeY3uHF+eJLoZhG0jd4x/lPbmkU/jF3iL7aR5mi8F/bZd0uR 6jwhTDzBaCl1iP2pxMX+ySW/iC++puBLv+If+alWu/fUuiu3Gavhbh7XiR9IQcAC4K0wKp jQkuHRq49aSUsqlWQs8rC07NCQS3ZSatWYvcGSelz8rTgGmGtxEIibSzyurrkufky5Bkf0 KT84U1kqcOWVI9zhiOL9hkIRXE0LMvk2SglQUWgtjmWT1XJ3p2slN1A2Z9r5+yLeHCU+Oo LjybQ85zArtwBpvy07IvcCw7rJikrwKPd2bw5V20uGx6hL0UiAnuvfkxIlQz+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765935284; a=rsa-sha256; cv=none; b=dUhjmRFbhzB3C1FuxdHbEZprzPz7zTFA8KHIBstha8Skv1KbSA8QVlEv8uHf4JHhO6rBI2 kusfdAehOM0/VYmdNafNOkN1CcLqYZbquwZexJTCKcQPe8O2pnsuY13Qb+Jhr/sg9Zg2H6 JqY1pAdS40vcQPf5pjenpKVyBNiN+vQWi5j81XvmZRXsOkknYbTo19MtCpzbnvhmJ/FR95 JmFKvf5mmUy3QtDHzoYFKVZCUyqJQFaUy4YhPwkXXyuWbO73CvsygvO7yUdGSHd0DBBXj0 9RHfpb0rpcZcZ/mWcNU5mZuYPCM3poaeNjxnIUOluMbZqxu7IExhfjkGWynM5A== 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 4dWGYw2R26zWrF for ; Wed, 17 Dec 2025 01:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36cc7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 01:34:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 5893a0be9d17 - Create tag release/14.3.0-p7 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.3.0-p7 X-Git-Reftype: annotated tag X-Git-Commit: 5893a0be9d171a112310bddf0d92fea41441a3fb Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 01:34:44 +0000 Message-Id: <694208b4.36cc7.68f465ad@gitrepo.freebsd.org> The annotated tag release/14.3.0-p7 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.3.0-p7 tag release/14.3.0-p7 Tagger: Philip Paeps TaggerDate: 2025-12-17 01:33:24 +0000 Tag FreeBSD 14.3-RELEASE-p7 commit 8b2a912a8abd663785e0b5a0c358a9aa46dd6fc3 Author: Mark Johnston AuthorDate: 2025-12-16 16:16:50 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:41:08 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Wed Dec 17 01:37:26 2025 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 4dWGd31Jb1z6LZKS for ; Wed, 17 Dec 2025 01:37:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWGd30ZYwz3xZT for ; Wed, 17 Dec 2025 01:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765935447; 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=ols4GVO9DLz1UHyXe3q0XNFmhkgQ+fgtfHiuR4doeA4=; b=ukUchhzgKe6xOHgd0g8cFF5ufhTY1oVWueMJ2Lvb0824/Pumn8/II/acahwA/5z87rNw4v JfPPpXjj2sFUrEP8D6qUxB+BUm9EMzhrJ7lh3iFTVA9DszVl3ZBR3b4I2Q4lG+CduAJf+2 eRIz/RfQYi7ci9l2oYEHSqGwJkO5P/g+zZlKzB4xnRQo5kD5LWexAC67MFxnk+crH07dKa CUaN8ZTyvCs1k0A+L7mS1IRbl6NFmTgFchoFd0I5g8q4ZNzA0KuG7Iu4QQb6xx9jmJuQoq jMnaLvWwu4GLh92OaSANs5sGz8EraycItAyFhnePSKLYv8j3s4pyvyNaJImmJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765935447; 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=ols4GVO9DLz1UHyXe3q0XNFmhkgQ+fgtfHiuR4doeA4=; b=L1Wjx4ObYi3xloBmgPrtKq3ei0JSjLIixpZ+snGlAgPbJHw3qB9w18D9lJ7UB0cZV6ezNP YHgHem9yD4ks+4LpicLm2shwDDYTtrP5slBOD7EykjWzVlzfooECSFJCTmxgmx5UcM/WwY +0OcF0pJ5AkJsEk7xdLvnSMRttmOlJ5lMgyYobjE8vVeCMrtJWX6HBWBARQeNrwUfZYVS6 sM4YJ9zz1R0TB4YBBlaehTspFI5dDrRNPxCyud/0rZ6o1wzfvJ+Gj4/VJQkRnPYTbVZbo3 kADNOiuyH80cY6ob1+k58mis2Z5Ja26OPoBpOVqP5A40gbSXVp4A5joPYIMTbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765935447; a=rsa-sha256; cv=none; b=aTYtc7dSCaWAHwXnYgHIcTpAvMLOPt+Ngjc2YwAwlsgFSKIztCmIyW70Bc4QQWHqWrJuSZ A9Nid1Ac14sU4hrZUImtuBTMbqV7c/HDj4yhuRyyyqg/vJUxkOgsKnbU1zJINJqCKeRQNX 9o7+FT9xyUvFEEcXBqaGQ+avExCBl3p8FR2xXIqQpw0aVRghpEiEiQTlt2z59jt4xVADEr n8ySlp/kOwkM0aaLCYLrC1EdOSPWJduKuzFFuo6TiNT4HXsddnmDB9DzhaCDKO81Vo68HD sx9BSebepQaNmUS4eT9i3R//U7qul5pnSkvRuSIVjXTB//NED68CGeN/hErDvA== 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 4dWGd26k9qzXP4 for ; Wed, 17 Dec 2025 01:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35735 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 01:37:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: c5db5a038525 - Create tag release/13.5.0-p8 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0-p8 X-Git-Reftype: annotated tag X-Git-Commit: c5db5a0385258955c30e63e1d095d00626f3bde0 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 01:37:26 +0000 Message-Id: <69420956.35735.5798eb78@gitrepo.freebsd.org> The annotated tag release/13.5.0-p8 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0-p8 tag release/13.5.0-p8 Tagger: Philip Paeps TaggerDate: 2025-12-17 01:34:59 +0000 Tag FreeBSD 13.5-RELEASE-p8 commit eb5a6f5f9f74d3aa3deed0ec4c30ebc2a30e92b7 Author: Mark Johnston AuthorDate: 2025-12-16 16:35:28 +0000 Commit: Mark Johnston CommitDate: 2025-12-16 23:41:46 +0000 Add UPDATING entries and bump version Approved by: so From nobody Wed Dec 17 02:46:28 2025 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 4dWJ8j0mBNz6LhbS for ; Wed, 17 Dec 2025 02:46:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWJ8j02dhz44fQ for ; Wed, 17 Dec 2025 02:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765939589; 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=NsfvboRJsqgvVgKAo3EzsoeBSOhxzZOL/McdpeTCFrg=; b=RUgyQyGQNQ0Qer0dT1KJwNhNVCvAmBLv7If0AGsH6XGgQVP9D8QtXBrMZ3djYLJERyqTQr pinMkb9x/+2ourwRqueVrpXkukHI19tUU7pbWHHuae680p95d0jLvH4un8ZEEsJyuBmlAd gvMXwj0/bbfnlVU9r6ewvTjT1SNukBcmB0/hWoLMknNgdpU61DfSUcFoXHPD97/eUeyj9g qZNLDHW0UbGFv+UelWGPKWoIAUdGaC/nGkTk1myndJJWUS7vV88/ubmPv7ZVsydRkRq4o1 Ilpd5YBbQQG7QGrB4wCyATivs7uxo/UzdhVyxl2txnvu5Wnh78FsA60cAMk96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765939589; 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=NsfvboRJsqgvVgKAo3EzsoeBSOhxzZOL/McdpeTCFrg=; b=pEV5VoSLPd76wlsKEdQUeX1vy7J2f1tB8bP6SsddjftvQKaz+cwR05pNCiCShEVjS30RjN /gzpEHxUYBH8Mdhb/xJcWoLxDIoDwpY9kqzzA+BlLnM2wiyAZ7PcnHM6TmM4d9bYxRmwl/ CDIb9bETyu4YIKvyRt30fQkx4efgTcvwkQ7nxpr8kI0vj3iUz/HxDeFgn/DdKO4NqHmHts vKmJspUWeGRSCawlCZaujIcSe+ZCuq1Y3EDPDI4NuMyae2eBzL6e//4fe2ZNxkJ3m6SV3l oopepFXZBg3JDmM6ruTBH+FUEfmMzkpT/b8osu1ucwKAZEOQqxpkKchrsx3wsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765939589; a=rsa-sha256; cv=none; b=ra4Ry+x16fyboZnhTATR/okur+KdUbLv2r/TDHF7Ajqv4j8Q8gNne7ydMSKOiCo0bRMc+M xaAhuChgg/mFvOj9YVC3LQVUvVUMw3zcFdlktMpoqoe4UTYbTiaCWhj1HL0RziS8kHR4RO +06LueEp6I6siKmhEP7in2H/xW6YF5zqQLwlOHow9mlNv2jjirD/7328LKiwsFfFW6p3Y6 rexj9IQ+bmQKudX/cRpbJ00UNTR2psyhAyp0zowYfyVVssop6Zseeu10xQlMduhmVcHb71 e7CuliW13tWP/ow8hhm/8YikT772DKF0bNpq2/XQM62JtXV5Jp928ZCC7gYZdw== 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 4dWJ8h5yhrzZ4t for ; Wed, 17 Dec 2025 02:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d8d5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 02:46:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Austin Shafer Subject: git: 30d5fc82cf8b - stable/15 - linuxkpi: clean up stray pctrie_iter_reset 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ashafer X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 30d5fc82cf8beedbc8996fd14392f21c7143cbaf Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 02:46:28 +0000 Message-Id: <69421984.3d8d5.75628d00@gitrepo.freebsd.org> The branch stable/15 has been updated by ashafer: URL: https://cgit.FreeBSD.org/src/commit/?id=30d5fc82cf8beedbc8996fd14392f21c7143cbaf commit 30d5fc82cf8beedbc8996fd14392f21c7143cbaf Author: Austin Shafer AuthorDate: 2025-12-09 15:33:17 +0000 Commit: Austin Shafer CommitDate: 2025-12-17 02:45:17 +0000 linuxkpi: clean up stray pctrie_iter_reset This removes an extraneous pctrie_iter_reset before returning. This is not needed as it simply clears a local variable that will get cleaned up anyway as we immediately return from the function. MFC after: 1 week Sponsored by: NVIDIA Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D54153 (cherry picked from commit 4ae02d9792272fa8c43f4982cf338123d9bcaed2) --- sys/compat/linuxkpi/common/src/linux_page.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 2b2827579cba..c0d9d71ba1ce 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -345,10 +345,8 @@ retry: page = vm_page_grab_iter(vm_obj, pindex, VM_ALLOC_NOCREAT, &pages); if (page == NULL) { page = PHYS_TO_VM_PAGE(IDX_TO_OFF(pfn)); - if (page == NULL) { - pctrie_iter_reset(&pages); + if (page == NULL) return (VM_FAULT_SIGBUS); - } if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) { pctrie_iter_reset(&pages); goto retry; From nobody Wed Dec 17 10:05:30 2025 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 4dWTvG36pnz6KlQy for ; Wed, 17 Dec 2025 10:05:30 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWTvG2Crfz3nhY for ; Wed, 17 Dec 2025 10:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765965930; 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=zqfthXCfMjzR8sRX5tJJZsuyNrAR+mE0g0GhEr9cSxE=; b=j3XmjoJk3gLnoTVOOdCpLNO4ZuQ1zrX/UlVkNBYxMRpAtZVaK3TnFU/mfNYweOCQMAlMW2 EsCBmtr/wCqZlSYbIi2yMwKSAMxlFw0GQGL7Ez3Cgf7WdS7eM3shxeqKldsMiZzU1qvbV+ r0pCCacirF7QuCuX6MxN9N/CuwbLfSrmoNLv4Xeh7bz2sXs4zALRQRurJicicDDHCQUTmE puZQG06OAsZRcsay7LEYz2EJgy10v9Y4i8TN8shduLDdzmIhxKMGOEPhae2dHdadapWHTb X3vK9whEjpTk/FSj4PUx7Dwg+7ZeEvrpVDxxYLgPUC+txqhj6RVz2xhzkMZv2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765965930; 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=zqfthXCfMjzR8sRX5tJJZsuyNrAR+mE0g0GhEr9cSxE=; b=WxcJEWr3PXVkYNJcjDqcrwBcOtmFj9Mxa65NrzllKTQ/RCbpDICe4kSdla03MJEBoE48CX SfXYj0v5rt+X2QuXILlniJRvQXbvOuwLLp8KLSakhugXxjErOLkyE0qLF2gMQaJVTXiuZ4 Ovx4pOdybchaE0/b2BzRDdKEG0p5deGFPgQTZwly6kL3h5O8RcOhIxKdfvrRGe8o9uIB/9 CO2kuJvGrqzGhnvywdOh++PzHAtqdlnIU5nYT1Ct4Q6eUbrhgwG4dp43cHLbV+GXfZ441t yH18vcBtDHyakkmXaTN46StP8wyHG1o21GdwH4irZ1JLuwpqE9TWNYcZs7djIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765965930; a=rsa-sha256; cv=none; b=Xubgj7/DnxwxR9mqUGyLkZfzcf1LI6hCFebGRn5ssnixcLpcEJLnE5c5RTGMFLKzxP5MBM MtPVZuHGCbPkRzMyxu+cQeM8C9ep4Q1VDUFUw2/lxXrDuT3DFIJ91f9dtwFxdKUjD1CbOV Eni2y6x9Czdh0uhbojpGrbvz6J7irNm1ggBB5HufF7oc5yLMt9lBFWkXFhamkq0annsiA9 0ko/6jUEnj8amd8ilYGqm2RqD7h90MvavSobbtHsRtzU9jJ8OxfodxUoTcBFfXLrH0r64O wbUCZ6CBPRV2Vw6xJNyK4kRDkREuW5I3Ck4ik37/obVWQytNMQdZyAnS3W059g== 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 4dWTvG1dm1znpq for ; Wed, 17 Dec 2025 10:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8884 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 10:05:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 394d701c41ec - stable/15 - if_ovpn: use epoch to free peers 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 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: 394d701c41ec567cbb5ddaeeb5f718ea39cb9024 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 10:05:30 +0000 Message-Id: <6942806a.8884.73d8e741@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=394d701c41ec567cbb5ddaeeb5f718ea39cb9024 commit 394d701c41ec567cbb5ddaeeb5f718ea39cb9024 Author: Kristof Provost AuthorDate: 2025-12-09 10:55:30 +0000 Commit: Kristof Provost CommitDate: 2025-12-17 09:23:03 +0000 if_ovpn: use epoch to free peers Avoid a possible use-after-free in the rx path. ovpn_decrypt_rx_cb() calls ovpn_finish_rx() which releases the lock, but continues to use the peer. Ensure that the peer cannot be freed until we're sure all potential users have stopped using it (i.e. have left net_epoch). Reported by: Kevin Day MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5e2bbfe387f7eac8f802c4b6ad2114f0e17bb5f2) --- sys/net/if_ovpn.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 8ce3491d072e..5be05667857b 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -161,6 +161,7 @@ struct ovpn_kpeer { struct callout ping_rcv; counter_u64_t counters[OVPN_PEER_COUNTER_SIZE]; + struct epoch_context epoch_ctx; }; struct ovpn_counters { @@ -568,6 +569,15 @@ ovpn_notify_float(struct ovpn_softc *sc, uint32_t peerid, return (0); } +static void +_ovpn_free_peer(struct epoch_context *ctx) { + struct ovpn_kpeer *peer = __containerof(ctx, struct ovpn_kpeer, + epoch_ctx); + + uma_zfree_pcpu(pcpu_zone_4, peer->last_active); + free(peer, M_OVPN); +} + static void ovpn_peer_release_ref(struct ovpn_kpeer *peer, bool locked) { @@ -606,8 +616,8 @@ ovpn_peer_release_ref(struct ovpn_kpeer *peer, bool locked) callout_stop(&peer->ping_send); callout_stop(&peer->ping_rcv); - uma_zfree_pcpu(pcpu_zone_4, peer->last_active); - free(peer, M_OVPN); + + NET_EPOCH_CALL(_ovpn_free_peer, &peer->epoch_ctx); if (! locked) OVPN_WUNLOCK(sc); From nobody Wed Dec 17 10:05:30 2025 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 4dWTvH0Rj0z6KksR for ; Wed, 17 Dec 2025 10:05:31 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWTvG6s6Hz3nmm for ; Wed, 17 Dec 2025 10:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765965931; 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=CFWwShFQ3RYD/BPoWUnXuTW9IQud5ZCOAiptPq7X90Y=; b=O6KZH+RnBuL8XPiG96+I/ch/z2q9dGILkNckJhWkuT7BNZeO8q6N93Tt7kXlFhiNg7Ek0l xpgYmGqQHIdi6KtgKox0ZblMqmFGdPi4ltas1TVTSEhkyHNpPTkYAeb6AYTdwsZVG845aQ +RfvhxLzZr/ILx4OP3BhudtvdXvu+t1Y4xrKG2eL1dIRytD+Fb8EAIuhT6XsVWcEpNkBP2 uVTuh1d+xbnJKFy4CslDJXnYA26fzZikugk9bkpKl8E9Xhq+OwVrfRA1rek9WskGQnVByx E+6YxXccZ1r+06Lrr++HnKVC7fQZsKJLkBh0ntbbim5Pql+3Fw5TXj/HCcwvmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765965931; 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=CFWwShFQ3RYD/BPoWUnXuTW9IQud5ZCOAiptPq7X90Y=; b=NJdr8qW+T3J6ZF8IfImxllc3E+OVD04ATAKzNQF9uCIo7tvAaX84KPpCfQb/DceKZO5XhR VMTWVPIkkJEy/Bx+NDhhdqjyyLy9snTPlRubSsXN44whckYzLSSzbBfAeCLDxkGrOPs+TJ tGQz0hXd8yLO/yjY/dcXT1yMJdEpr9xNexW2a+PfOafDsFCQ/U4W4izXQI6xU6ByK5qpSz cIXoz/DM5TrM0yxLhTJ6Jw4EXzLQq7OQO8qt7PRytN/ZgqEyKXc1jngyrMXs9NOXXfQplI 4D35fgSH856pnKTwyq8V5nUMRnWXZM3P0edQXA26cqYW+gh3Z8vm7a0feaYjxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765965931; a=rsa-sha256; cv=none; b=JrASCsfxAeqH7AGhI0o+Nf902aUrG2YHoV+GI0s5H/PO6gTZE9wUxGNCApeqCBOIEY/4rV ZZW9QbJjhdKNcjIRfYYoFzoB7iKJM5PRQAbpxT5hVyT7GbR3WH6Mr1j9VY9eDRmzp9l+pq QeRvZ5bAV0ftuUJS4f26WqGKTQiEYPLWcKaQh3uNMdxO06s9AJ7xtYTAaY6WPyDM81cAB2 s3I1Ghyr2geQLrt1Zzeop20DAdkuhHClVoRbtxHXa3GNL4FxER9ZYDOGqCcft+y2GAT07H uErme4mGKGqycvOzqthuNfT2yj9RakqwMpcrQxbJN0PI5sNYrEGSCL/sZiF7fA== 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 4dWTvG6R9wznsD for ; Wed, 17 Dec 2025 10:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e56e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 10:05:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: d19083e833d7 - stable/14 - if_ovpn: use epoch to free peers 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 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/14 X-Git-Reftype: branch X-Git-Commit: d19083e833d73319425650de938d087b8ca9f673 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 10:05:30 +0000 Message-Id: <6942806a.3e56e.3756ec27@gitrepo.freebsd.org> The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d19083e833d73319425650de938d087b8ca9f673 commit d19083e833d73319425650de938d087b8ca9f673 Author: Kristof Provost AuthorDate: 2025-12-09 10:55:30 +0000 Commit: Kristof Provost CommitDate: 2025-12-17 10:05:15 +0000 if_ovpn: use epoch to free peers Avoid a possible use-after-free in the rx path. ovpn_decrypt_rx_cb() calls ovpn_finish_rx() which releases the lock, but continues to use the peer. Ensure that the peer cannot be freed until we're sure all potential users have stopped using it (i.e. have left net_epoch). Reported by: Kevin Day MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5e2bbfe387f7eac8f802c4b6ad2114f0e17bb5f2) --- sys/net/if_ovpn.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 631b3f4dfa26..a0d34850943b 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -161,6 +161,7 @@ struct ovpn_kpeer { struct callout ping_rcv; counter_u64_t counters[OVPN_PEER_COUNTER_SIZE]; + struct epoch_context epoch_ctx; }; struct ovpn_counters { @@ -599,6 +600,15 @@ ovpn_notify_float(struct ovpn_softc *sc, uint32_t peerid, return (0); } +static void +_ovpn_free_peer(struct epoch_context *ctx) { + struct ovpn_kpeer *peer = __containerof(ctx, struct ovpn_kpeer, + epoch_ctx); + + uma_zfree_pcpu(pcpu_zone_4, peer->last_active); + free(peer, M_OVPN); +} + static void ovpn_peer_release_ref(struct ovpn_kpeer *peer, bool locked) { @@ -639,8 +649,8 @@ ovpn_peer_release_ref(struct ovpn_kpeer *peer, bool locked) callout_stop(&peer->ping_send); callout_stop(&peer->ping_rcv); - uma_zfree_pcpu(pcpu_zone_4, peer->last_active); - free(peer, M_OVPN); + + NET_EPOCH_CALL(_ovpn_free_peer, &peer->epoch_ctx); if (! locked) OVPN_WUNLOCK(sc); From nobody Wed Dec 17 21:07:52 2025 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 4dWmbX4vvxz6LQZV for ; Wed, 17 Dec 2025 21:07:52 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWmbX3vPXz4NTp for ; Wed, 17 Dec 2025 21:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766005672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zJYlN7d7+7F7LhXepn7n0oW/CEh6A8stRjnP2W42/Mk=; b=VpM5P8s1B3DCoX+T44ExfSD0RGHqyJik3JzAqDB5eiTd/FUCmKiQeyJdhd+S+lzfRINTaL FLWxP+pX/WcDBCVOEr2jwYOXIeVxjlUwGWgVWuBwtmhqAIUc2OP2UHyO69UAsssNEkESpw 7orIODETTmgxLj/IC2HVOBkLoYgsUghWjoqkxI6PP4IFjyxUIO1+GKn3BkEBy5G/+EJSS5 otd7cGkOCoD6NTuFkBISzcPFOdGR2Y5l0DszF4WtL6zlV1sE1+2HAghqhKRiVpVB+0Bcc8 YEHCgqSwHRDrrDrZUEflrVhBNJ7B5K4zTcvo1Uvvsq0roJCjvcocq/rGZWQFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766005672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zJYlN7d7+7F7LhXepn7n0oW/CEh6A8stRjnP2W42/Mk=; b=jTBApyFFIR0RxM3rBaFDxSqJTrMAs/rD28FP+shjnymv+LbVAX5q7bDbIgk+0w3Egq3rPM cNkdomSB1DJQDqBBAFbLDlehZGiWgFrCGl14bBvP8EJZFq/nqgDp9X5grbv1TmKAEzW3e1 sM3VIVuO7u/7JztACmJfDNpzJLyEIFcGcUVd/RTWx1GstrxJ7pf7f+jioXMx66m1jRIjPc rXnYVuPsZvIr6LLWy9hmmKNXK4KhNxBSBWBKRTY14OQcy4889FC2pqBbneLE/TqGE4PNgL iKNvZMT4E+bnpBGQm5HNNbNTP6e03gEGMTYDbXSF6O7TD4RqFctamhhhtM/7bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766005672; a=rsa-sha256; cv=none; b=PCovz/COtJNli4cYnUVIXqdeRIGP4sE0qtED/ts+TJjpxSC7+U1IultQn55N6Ib4isT/Zh 27KckKnz5+Wp+UNdKkKUplpXn82G0Q19UJTLP+Zwj2aih9dlEhu3yKfeE039HBmLeO6cjB WOe2PlYkCGWJNLoIZkPnLALeYdbEJ31u9ymcCp1KYNIQLh7dvUqPPQPqkCLzJUghjJIdfp jUMRXpiSd1h1xkcV9UbDoEl3rOrFHmC+SyZaln/25xCD4uN/sCJ1lIM/L1RdTWrz8G2Sl2 24Pk/Qp4opCwdcKEkXaDJTBWQ7tjMHSAvsSaR+KfBnhOXl1kno80nI6zWG2hyw== 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 4dWmbX3NJFz16wb for ; Wed, 17 Dec 2025 21:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40557 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 21:07:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konstantin Belousov From: Vladimir Kondratyev Subject: git: d3690a599586 - stable/15 - devfs: make destroy_dev() a release barrier for cdevpriv destructors runs 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d3690a5995867e35d4d1dc63127343d4b0a092d6 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 21:07:52 +0000 Message-Id: <69431ba8.40557.13f66fa4@gitrepo.freebsd.org> The branch stable/15 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d3690a5995867e35d4d1dc63127343d4b0a092d6 commit d3690a5995867e35d4d1dc63127343d4b0a092d6 Author: Konstantin Belousov AuthorDate: 2025-10-23 18:37:00 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-12-17 21:05:38 +0000 devfs: make destroy_dev() a release barrier for cdevpriv destructors runs Ensure that all destructors for cdevpriv finished running before destroy_dev() returns to the caller. Otherwise, since devfs_destroy_cdevpriv() removes the cdevpriv data from the list, drops the cdevpriv_mtx, and then starts the destructor, it is possible for destroy_dev() to return before destructor finished in other thread. This should allow drivers to safely remove cdev instance data that might be referenced by cdevpriv data. Diagnosed by: kevans Reviewed by: kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53303 (cherry picked from commit 4dbe6628179d8e6bf400bfdb4bfa869bdc102a56) --- sys/fs/devfs/devfs_int.h | 1 + sys/fs/devfs/devfs_vnops.c | 17 ++++++++++++++--- sys/kern/kern_conf.c | 3 +++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/fs/devfs/devfs_int.h b/sys/fs/devfs/devfs_int.h index 916297425b53..9fa75c0e90ad 100644 --- a/sys/fs/devfs/devfs_int.h +++ b/sys/fs/devfs/devfs_int.h @@ -67,6 +67,7 @@ struct cdev_priv { void *cdp_dtr_cb_arg; LIST_HEAD(, cdev_privdata) cdp_fdpriv; + u_int cdp_fdpriv_dtrc; struct mtx cdp_threadlock; }; diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 3a64c205186f..880756264b0f 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -200,14 +200,25 @@ devfs_foreach_cdevpriv(struct cdev *dev, int (*cb)(void *data, void *arg), void devfs_destroy_cdevpriv(struct cdev_privdata *p) { + struct file *fp; + struct cdev_priv *cdp; mtx_assert(&cdevpriv_mtx, MA_OWNED); - KASSERT(p->cdpd_fp->f_cdevpriv == p, - ("devfs_destoy_cdevpriv %p != %p", p->cdpd_fp->f_cdevpriv, p)); - p->cdpd_fp->f_cdevpriv = NULL; + fp = p->cdpd_fp; + KASSERT(fp->f_cdevpriv == p, + ("devfs_destoy_cdevpriv %p != %p", fp->f_cdevpriv, p)); + cdp = cdev2priv((struct cdev *)fp->f_data); + cdp->cdp_fdpriv_dtrc++; + fp->f_cdevpriv = NULL; LIST_REMOVE(p, cdpd_list); mtx_unlock(&cdevpriv_mtx); (p->cdpd_dtr)(p->cdpd_data); + mtx_lock(&cdevpriv_mtx); + MPASS(cdp->cdp_fdpriv_dtrc >= 1); + cdp->cdp_fdpriv_dtrc--; + if (cdp->cdp_fdpriv_dtrc == 0) + wakeup(&cdp->cdp_fdpriv_dtrc); + mtx_unlock(&cdevpriv_mtx); free(p, M_CDEVPDATA); } diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 57411b0dec08..2da51d84ff60 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -1163,6 +1163,9 @@ destroy_devl(struct cdev *dev) devfs_destroy_cdevpriv(p); mtx_lock(&cdevpriv_mtx); } + while (cdp->cdp_fdpriv_dtrc != 0) { + msleep(&cdp->cdp_fdpriv_dtrc, &cdevpriv_mtx, 0, "cdfdpc", 0); + } mtx_unlock(&cdevpriv_mtx); dev_lock(); From nobody Wed Dec 17 21:35:46 2025 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 4dWnCk4Txmz6LSmh for ; Wed, 17 Dec 2025 21:35:46 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWnCk1bW5z3G0x for ; Wed, 17 Dec 2025 21:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766007346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xe0+n3QJlLi6mY8y19QFXvUXQpW56Jcl7RSQS92nICc=; b=aEeE1wBzhpI7/FrXfeYrOTnYqZagjO94v7SFpVoPM7nNQbZU36yFISIp7ikX+tBCfI3Uj4 8aaPSpQdve3xJmdkgcLaVoWHs0tdYAWvYpKvSZB7fvQY4HYTUgFAAfLaSxfdDGmJ4sxpwF oaJ1MgDg3t9Ne+MBRulJSgusKYJ+eDU2MsyGS9wOin3aAsRZJnGXr7moD28Q4NeImCFGMS erp39SREw9a5D6Qq5CVU9Ht22mh1bA/watfTdSCn2bugbJMONRkHeokLIt5iyuqimGEa8O Cfm8NmUSh3sRTi1gip+6emEqpvyNqr9zecnXMhxwlRNvq8lFN27PtlZVu7sauA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766007346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xe0+n3QJlLi6mY8y19QFXvUXQpW56Jcl7RSQS92nICc=; b=ubUbw6nfjj6RLmIt3gsg6k5GFPEHkmVh7rnuo0SwL5vkyG34CzehAmhY4yLsUJD1xcK0IJ SsStpxU4K6HKKj8HbJXD9AgvtTtxqhD8YXOnyilzTOgwfZCWFIY2MUCJgSL3KCkurHH8dd DIetllxO/jr54rLyIz+V3iOYdBl99JLiwsbtlqUSN2L4bNzafSWdmXk/hmSB7kVIDhSzrm nog1/6vx/vSFdsfp6UVZNXVa9/eXKUNfeP5NdkL58i7p9DSaGbXpxoOM9TLBuwuXFaFoIO 3T/YiLQfJaAwGtxos8T6r+FKAvNY2DeXZqAp5gutSJ3ElxuEMDBbjFMtZ/9PNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766007346; a=rsa-sha256; cv=none; b=ZMMEqiiZG/ajr9C0JQh92XoWg1j5MtBfOiGqXcde+Gt2Ip3hXqDFuuiHYcyJi859hZfkPB hQUJ0q5JmC6KYvPGtbkDmnwaB6hvCcS1g6ZCAv/AYPXZHV2dY/jIPPu3dXnzXsn5xGvPFF pNp7qR7eFw9gJVzGK5p+xzAdTvblJ3O2o8DAWFjiPsh3OLMGWa//toZhXcc82Ncafvko4S Xd7QHMwsA7cCuYsS5bFuDnh15n3d2d5rlcZpMFtS3PR+L2imJvbrZMDNBrC+Gk27VMWWK1 1oIwxtIxCSwxjfM3q0gH6S1sn5BjCB4iDCUQOzlVp9QQ8xC/vDhv56G01r/Lcg== 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 4dWnCk1B0Vz18JH for ; Wed, 17 Dec 2025 21:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45100 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 21:35:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Yogesh Bhosale From: Kevin Bowling Subject: git: 645942dafaac - stable/14 - ixgbe: Remove unused function ixgbe_is_media_cage_present 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 645942dafaac8190459097b18eb16d9eff5148db Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 21:35:46 +0000 Message-Id: <69432232.45100.5df3c1e5@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=645942dafaac8190459097b18eb16d9eff5148db commit 645942dafaac8190459097b18eb16d9eff5148db Author: Yogesh Bhosale AuthorDate: 2025-09-10 07:26:09 +0000 Commit: Kevin Bowling CommitDate: 2025-12-17 21:35:24 +0000 ixgbe: Remove unused function ixgbe_is_media_cage_present Remove the unused function ixgbe_is_media_cage_present that generates a compiler warning. Signed-off-by: Yogesh Bhosale yogesh.bhosale@intel.com Reported by: markj Differential Revision: https://reviews.freebsd.org/D52467 (cherry picked from commit 275f7d72ff6a71bbe46b4282a88f0ea9a24be22a) --- sys/dev/ixgbe/ixgbe_e610.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_e610.c b/sys/dev/ixgbe/ixgbe_e610.c index 95c6dca416c6..18c4612446e0 100644 --- a/sys/dev/ixgbe/ixgbe_e610.c +++ b/sys/dev/ixgbe/ixgbe_e610.c @@ -1399,40 +1399,6 @@ s32 ixgbe_aci_set_link_restart_an(struct ixgbe_hw *hw, bool ena_link) return ixgbe_aci_send_cmd(hw, &desc, NULL, 0); } -/** - * ixgbe_is_media_cage_present - check if media cage is present - * @hw: pointer to the HW struct - * - * Identify presence of media cage using the ACI command (0x06E0). - * - * Return: true if media cage is present, else false. If no cage, then - * media type is backplane or BASE-T. - */ -static bool ixgbe_is_media_cage_present(struct ixgbe_hw *hw) -{ - struct ixgbe_aci_cmd_get_link_topo *cmd; - struct ixgbe_aci_desc desc; - - cmd = &desc.params.get_link_topo; - - ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_get_link_topo); - - cmd->addr.topo_params.node_type_ctx = - (IXGBE_ACI_LINK_TOPO_NODE_CTX_PORT << - IXGBE_ACI_LINK_TOPO_NODE_CTX_S); - - /* set node type */ - cmd->addr.topo_params.node_type_ctx |= - (IXGBE_ACI_LINK_TOPO_NODE_TYPE_M & - IXGBE_ACI_LINK_TOPO_NODE_TYPE_CAGE); - - /* Node type cage can be used to determine if cage is present. If AQC - * returns error (ENOENT), then no cage present. If no cage present then - * connection type is backplane or BASE-T. - */ - return ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL); -} - /** * ixgbe_get_media_type_from_phy_type - Gets media type based on phy type * @hw: pointer to the HW struct From nobody Thu Dec 18 03:24:26 2025 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 4dWwyJ01jsz6K5Ys; Thu, 18 Dec 2025 03:24:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4dWwyH3bR8z45d3; Thu, 18 Dec 2025 03:24:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 5BI3OQdB087466; Thu, 18 Dec 2025 05:24:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 5BI3OQdB087466 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 5BI3OQaU087465; Thu, 18 Dec 2025 05:24:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Dec 2025 05:24:26 +0200 From: Konstantin Belousov To: Vladimir Kondratyev Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org, kevans@freebsd.org Subject: Re: git: d3690a599586 - stable/15 - devfs: make destroy_dev() a release barrier for cdevpriv destructors runs Message-ID: References: <69431ba8.40557.13f66fa4@gitrepo.freebsd.org> 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 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69431ba8.40557.13f66fa4@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dWwyH3bR8z45d3 On Wed, Dec 17, 2025 at 09:07:52PM +0000, Vladimir Kondratyev wrote: > The branch stable/15 has been updated by wulf: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d3690a5995867e35d4d1dc63127343d4b0a092d6 > > commit d3690a5995867e35d4d1dc63127343d4b0a092d6 > Author: Konstantin Belousov > AuthorDate: 2025-10-23 18:37:00 +0000 > Commit: Vladimir Kondratyev > CommitDate: 2025-12-17 21:05:38 +0000 > > devfs: make destroy_dev() a release barrier for cdevpriv destructors runs > > Ensure that all destructors for cdevpriv finished running before > destroy_dev() returns to the caller. Otherwise, since > devfs_destroy_cdevpriv() removes the cdevpriv data from the list, drops > the cdevpriv_mtx, and then starts the destructor, it is possible for > destroy_dev() to return before destructor finished in other thread. > > This should allow drivers to safely remove cdev instance data that might > be referenced by cdevpriv data. > > Diagnosed by: kevans > Reviewed by: kevans, markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D53303 > > (cherry picked from commit 4dbe6628179d8e6bf400bfdb4bfa869bdc102a56) I did not merged this to 15 (or 14) because if_tun has a regressions requiring some fixes from kevans, which were not merged. From nobody Thu Dec 18 03:50:28 2025 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 4dWxXM1smBz6K7bk; Thu, 18 Dec 2025 03:50:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWxXM1NZtz46hn; Thu, 18 Dec 2025 03:50:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766029843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u/uME6NkYCQ+5smfCU5J4w03XGPf9/dK8d/nfIrwdmg=; b=v+NAAOL4gGkhF0aSEEy4bXN9FrFR/tfqM5B8wGC0z/PLj6RTKomrjCTSDa8K9tBBzsSFn8 eXs23OeOR3UMWcf7x9h7vxdeGB/XiIxyutLbNNnqd9cwjRXmkhwBJ27zavHNMTtuLSUF7a Z49+FcBMgYP3E7c0GFJLhapk0l2OYnkEm3VZ7x85VAPIQtq5N0glhE6Zx90XeXhgc75mZH 986ONg+MOxOVqFYj9KFpCJGTC3Z9lXed3G/tkwt+YxBK0aKFZtEiHCYFVQ2uqw3MaSHVbJ +/YmgSVOvlZg1IUVHVlOcJAJoU0OsmZipwzbwEtMiYM3J4E3Lj4ZwsbaYFIgmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766029843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u/uME6NkYCQ+5smfCU5J4w03XGPf9/dK8d/nfIrwdmg=; b=l2OGQGTZ0V+sXVM3YEWJ3NHgrSEuZvDPAkpm1lzaAFVdZTy9B8lmLG6yiZjWMhs07VofWv CxmhOktaW7HsZTIbQ05k6hkGGsoPWpedhebRS7mKIJE/9uc8MoQCwwgxqGgoMHFcJye5h1 azDDzlewh3q5NLCnI16Tw80KrdS82esr+HecVkD4JWQGIccENLY69STdnoQeOFYPB8gUW0 9xPp0mPSdUVKVplahMCiUfLINOUib+NR/kR7IXpKZecWBafpo/h2gmisZKZu7xg+R04Bg1 ZdEOxTNWLhApBDfQbBiBxgoSIUSJ8MofPGa/XWxRGf2VJxmn0o3Tuy9ojnkUaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766029843; a=rsa-sha256; cv=none; b=wiLoGm4dKo35xKhqihcOi0fOkLUozhcsARTDjcB74Pdu3r4SbnukNibTtTNq5mBd/lzai4 pB90hF0nfjPeuTNIRmIVI8KrwoG6z1qB0xjRRWcVFLSdn1gvyKP8Z9gpuSwPKcCHO5Z/x7 tdL+JTMpPMysaZbhmgLR0gh95CMyg+cq/09DCtUHz0c51lFhNele4kcjnfoLB0evxi/qMJ Y4YAG4WFWP+SMk/9ibbBtfpezzSNV5fdok2ZAKmtuN/u25CCk31xbPxipweAhoO+FRmkdG O49e/ZLjW0g44iOjIktvhtzDdHd1uddj3+2g5RA/I3X7uzrsDLS79zVerCvhhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dWxXL5WDjz111P; Thu, 18 Dec 2025 03:50:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Wed, 17 Dec 2025 21:50:28 -0600 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 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: d3690a599586 - stable/15 - devfs: make destroy_dev() a release barrier for cdevpriv destructors runs To: Konstantin Belousov , Vladimir Kondratyev Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org References: <69431ba8.40557.13f66fa4@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/17/25 21:24, Konstantin Belousov wrote: > On Wed, Dec 17, 2025 at 09:07:52PM +0000, Vladimir Kondratyev wrote: >> The branch stable/15 has been updated by wulf: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=d3690a5995867e35d4d1dc63127343d4b0a092d6 >> >> commit d3690a5995867e35d4d1dc63127343d4b0a092d6 >> Author: Konstantin Belousov >> AuthorDate: 2025-10-23 18:37:00 +0000 >> Commit: Vladimir Kondratyev >> CommitDate: 2025-12-17 21:05:38 +0000 >> >> devfs: make destroy_dev() a release barrier for cdevpriv destructors runs >> >> Ensure that all destructors for cdevpriv finished running before >> destroy_dev() returns to the caller. Otherwise, since >> devfs_destroy_cdevpriv() removes the cdevpriv data from the list, drops >> the cdevpriv_mtx, and then starts the destructor, it is possible for >> destroy_dev() to return before destructor finished in other thread. >> >> This should allow drivers to safely remove cdev instance data that might >> be referenced by cdevpriv data. >> >> Diagnosed by: kevans >> Reviewed by: kevans, markj >> Sponsored by: The FreeBSD Foundation >> MFC after: 1 week >> Differential revision: https://reviews.freebsd.org/D53303 >> >> (cherry picked from commit 4dbe6628179d8e6bf400bfdb4bfa869bdc102a56) > > I did not merged this to 15 (or 14) because if_tun has a regressions > requiring some fixes from kevans, which were not merged. > Ah, woof- sorry, it's been busy here. I'll go ahead and merge the fix to stable/15. The relevant feature won't be merged to stable/14, so it should be safe to take it back there as well. Thanks, Kyle Evans From nobody Thu Dec 18 03:52:50 2025 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 4dWxZp42Yzz6K7q3 for ; Thu, 18 Dec 2025 03:52:50 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWxZp1Knlz4948 for ; Thu, 18 Dec 2025 03:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766029970; 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=WobMAKSgRe0GNJDLE2OVA/+aLabqvS4Hz86MrdrnaVM=; b=H3x2BVnz2wtxweAh0IiCgvPEGfXZ0hDLueZ8NxFpUf312n1BxcKccqBEefi9V0ul/O2mj/ SFxW6hJc/j/cPeVNqJL9Rb49tK1o7OPkL1AoQLeVWHf8SgG2q1DLCO3SmyesMc3o4O0Z7M 89LSDzEbyYnqIRqLvhpr3yKdLBObFhGkFcNR04g37qlkknsc5/e3hUN98xBo2QUw2B9TMl m0zCcmRTUMtlR2YlyFRY3sjM6ukZW0w0v8kM7q3XghAlLmxSJtRA+zwQIp5xFUq3E2jNba LQplw36BYD9SKgMMpRvjOmYCHTU66HGzLpyKvDmNYfwJnjkvgmW/VDbDq1dImQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766029970; 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=WobMAKSgRe0GNJDLE2OVA/+aLabqvS4Hz86MrdrnaVM=; b=o3LW6Xyyi7/21hJshxMSVaiWDJm5PHFzQpNBJgl/pXEO7lFI4lLZ6RmH34O2Ro9mnWPtZk xDvq5RxHfwdzOaHuXZ45Jb31gAs/IN9EL6Havz/XY74jOg7RizQ6dnEooDRAX3ITD9LWVZ 24nJwSgz4+7Jvnlj+wM53naDiq3jcR2Oa/GvmoPjxqcoAje2EhU2zMPhRknKJhdRiRWkWQ xfGzqD7KkzCdIVlW4ZAFOjw36wh3deLMnEN7vsjX5rNy9vkKOqx1juKKdTSIz3VfuKAAMp gaezQtI1uAoaAs6PkvXkvep4gZObOkqK44dsrfKzNBTCJls63+orH9sa+UTcmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766029970; a=rsa-sha256; cv=none; b=H/1w2CFiDRkFr1XcOYnNPgMA+VhMvizSi4LGiSoHksvd0AFEqoKigTZyktXeS54551/Qwz vSazgVeuIyZ0iwVok0S5zkkQyUlqGSibEV4YkRZqJjAmCLRNhzWYBYTV1oM3503y+ccYyb 1nAexh2SRpQ0Vt/EHIfwPjIsqiEEA6V7kMSZVb/2m2zil75GHWGvzb4Upu7gBAhiEECJ8T BxmRqWLn0oFLjtGVMfAFJ1ZcY1RHdVR+3h9l4VEsEbR1G2ZSNZyp2FgG4sVLEPqVgkfS3k /77hd5JzkBaGFk3E6misatP2ipCq/MHI0GRTRsU5ZhnjFGihqzF9Kl5BAw1rwQ== 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 4dWxZp0KPbz6LP for ; Thu, 18 Dec 2025 03:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9dbe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 03:52:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 33a3ccfc1618 - stable/15 - if_tuntap: defer transient destroy_dev() to a taskqueue 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 33a3ccfc1618cd7eabd1b38109b81b613b60c19f Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 03:52:50 +0000 Message-Id: <69437a92.9dbe.202d4231@gitrepo.freebsd.org> The branch stable/15 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=33a3ccfc1618cd7eabd1b38109b81b613b60c19f commit 33a3ccfc1618cd7eabd1b38109b81b613b60c19f Author: Kyle Evans AuthorDate: 2025-11-05 00:28:02 +0000 Commit: Kyle Evans CommitDate: 2025-12-18 03:51:56 +0000 if_tuntap: defer transient destroy_dev() to a taskqueue We're in the dtor, so we can't destroy it now without deadlocking after recent changes to make destroy_dev() provide a barrier. However, we know there isn't any other dtor to run, so we can go ahead and clean up our state and just prevent a use-after-free if someone races to open the device while we're trying to destroy it. tunopen() now uses the net epoch to protect against softc release by a concurrent tun_destroy(). While we're here, allow a destroy operation to proceed if we caught a signal in cv_wait_sig() but tun_busy dropped to 0 while we were waiting to acquire the lock. This was more of an inherent design flaw, rather than a bug in the below-refed commit. Reviewed by: kib, markj (cherry picked from commit 96c1d8db39dfeea78ea3f27d67649252a39bbf2e) --- sys/net/if_tuntap.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 56bb90cce9bc..0dc3a58f6ae6 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -138,6 +138,7 @@ struct tuntap_softc { #define TUN_READY (TUN_OPEN | TUN_INITED) pid_t tun_pid; /* owning pid */ + struct epoch_context tun_epoch_ctx; struct ifnet *tun_ifp; /* the interface */ struct sigio *tun_sigio; /* async I/O info */ struct tuntap_driver *tun_drv; /* appropriate driver */ @@ -630,6 +631,18 @@ out: CURVNET_RESTORE(); } +static void +tunfree(struct epoch_context *ctx) +{ + struct tuntap_softc *tp; + + tp = __containerof(ctx, struct tuntap_softc, tun_epoch_ctx); + + /* Any remaining resources that would be needed by a concurrent open. */ + mtx_destroy(&tp->tun_mtx); + free(tp, M_TUN); +} + static int tun_destroy(struct tuntap_softc *tp, bool may_intr) { @@ -649,7 +662,7 @@ tun_destroy(struct tuntap_softc *tp, bool may_intr) error = cv_wait_sig(&tp->tun_cv, &tp->tun_mtx); else cv_wait(&tp->tun_cv, &tp->tun_mtx); - if (error != 0) { + if (error != 0 && tp->tun_busy != 0) { tp->tun_flags &= ~TUN_DYING; TUN_UNLOCK(tp); return (error); @@ -663,8 +676,18 @@ tun_destroy(struct tuntap_softc *tp, bool may_intr) TAILQ_REMOVE(&tunhead, tp, tun_list); mtx_unlock(&tunmtx); - /* destroy_dev will take care of any alias. */ - destroy_dev(tp->tun_dev); + /* + * destroy_dev will take care of any alias. For transient tunnels, + * we're being called from close(2) so we can't destroy it ourselves + * without deadlocking, but we already know that we can cleanup + * everything else and just continue to prevent it from being reopened. + */ + if ((tp->tun_flags & TUN_TRANSIENT) != 0) { + atomic_store_ptr(&tp->tun_dev->si_drv1, tp->tun_dev); + destroy_dev_sched(tp->tun_dev); + } else { + destroy_dev(tp->tun_dev); + } seldrain(&tp->tun_rsel); knlist_clear(&tp->tun_rsel.si_note, 0); knlist_destroy(&tp->tun_rsel.si_note); @@ -679,9 +702,8 @@ tun_destroy(struct tuntap_softc *tp, bool may_intr) sx_xunlock(&tun_ioctl_sx); free_unr(tp->tun_drv->unrhdr, TUN2IFP(tp)->if_dunit); if_free(TUN2IFP(tp)); - mtx_destroy(&tp->tun_mtx); cv_destroy(&tp->tun_cv); - free(tp, M_TUN); + NET_EPOCH_CALL(tunfree, &tp->tun_epoch_ctx); CURVNET_RESTORE(); return (0); @@ -742,9 +764,11 @@ tun_uninit(const void *unused __unused) mtx_unlock(&tunmtx); for (i = 0; i < nitems(tuntap_drivers); ++i) { drv = &tuntap_drivers[i]; + destroy_dev_drain(&drv->cdevsw); delete_unrhdr(drv->unrhdr); clone_cleanup(&drv->clones); } + NET_EPOCH_DRAIN_CALLBACKS(); mtx_destroy(&tunmtx); } SYSUNINIT(tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, tun_uninit, NULL); @@ -1104,19 +1128,43 @@ out: static int tunopen(struct cdev *dev, int flag, int mode, struct thread *td) { + struct epoch_tracker et; struct ifnet *ifp; struct tuntap_softc *tp; + void *p; int error __diagused, tunflags; + /* + * Transient tunnels do deferred destroy of the tun device but want + * to immediately cleanup state, so they clobber si_drv1 to avoid a + * use-after-free in case someone does happen to open it in the interim. + * We avoid using NULL to be able to distinguish from an uninitialized + * cdev. + * + * We use the net epoch here to let a concurrent tun_destroy() schedule + * freeing our tuntap_softc, in case we entered here and loaded si_drv1 + * before it was swapped out. If we managed to load this while it was + * still a softc, then the concurrent tun_destroy() hasn't yet scheduled + * it to be free- that will take place sometime after the epoch we just + * entered, so we can safely use it. + */ + NET_EPOCH_ENTER(et); + p = atomic_load_ptr(&dev->si_drv1); + if (p == dev) { + NET_EPOCH_EXIT(et); + return (ENXIO); + } + tunflags = 0; CURVNET_SET(TD_TO_VNET(td)); error = tuntap_name2info(dev->si_name, NULL, &tunflags); if (error != 0) { CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); return (error); /* Shouldn't happen */ } - tp = dev->si_drv1; + tp = p; KASSERT(tp != NULL, ("si_drv1 should have been initialized at creation")); @@ -1124,14 +1172,17 @@ tunopen(struct cdev *dev, int flag, int mode, struct thread *td) if ((tp->tun_flags & TUN_INITED) == 0) { TUN_UNLOCK(tp); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); return (ENXIO); } if ((tp->tun_flags & (TUN_OPEN | TUN_DYING)) != 0) { TUN_UNLOCK(tp); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); return (EBUSY); } + NET_EPOCH_EXIT(et); error = tun_busy_locked(tp); KASSERT(error == 0, ("Must be able to busy an unopen tunnel")); ifp = TUN2IFP(tp); From nobody Thu Dec 18 18:22:52 2025 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 4dXJth6t3rz6LTgS for ; Thu, 18 Dec 2025 18:22:52 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJth6Cymz46XS for ; Thu, 18 Dec 2025 18:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082172; 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=cdVd7RTYD4A/K+FaQRjEXLxSNoa4hczTlLlW3RYWp4Q=; b=Ot10qE2xrgpfTyY2ep3gACrY26DCg5uH7NhJBA8nqk1EApTDyYkmjFzHN7jjxaw6F2bCss 3zlaCmfqduaafzqUxhyCl8ryTeH7bXwYtEdkGMkA0phKL4rWsAsd82CaLEJtuphEXdglpo z+mWq4wNkvUbawHbljeUHTYXJ6ZV+/YqV1xBwwEjL1YIKWKsX8n2XEJkrL1l7gepHKV/Qm PscWgjTEOqLnikee97GWR4Zqjxcy6PqcEyHNfrFIrVDRH8aTNBObgPcEpWK9uMBirsSj3z Xh7aNb+5RxY1Yxk1aIyoTtbsCumF9VcWHcNcnDmMPX5qsmK/oI8EWRWKvNAADQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082172; 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=cdVd7RTYD4A/K+FaQRjEXLxSNoa4hczTlLlW3RYWp4Q=; b=H9c5fj7hD1qyp6GCOxXT9wx+8vy6WYMPVVdgnl6cGmzNuV/1mk+KCcPiBuLg7yKuMYAwMc zI5eO6AcHo5p7eDZJDyLumklw4JWYuNirXolzF0DzRike/vTiLmWMEl1bZfUzWEnQuDq7R 8fAnjzbk5/Ib1eQ2fRj1DjoGa4S8HL5i/KUQJjZPKkxmYlgN1b62KTkYqZJ7V/+47XCkxf SDQCpv2mzcnC2q37Gk/+lVF8aeByGDnAyNhpuuulrBGBb5poZo5CLtIUuYU6CU9RTgX823 TnlfPmvDYGU/QTtmmtFNWeqBkSr7a8Up6vgiLV8yHaASEYGe3crkiKZx1otiiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082172; a=rsa-sha256; cv=none; b=DuXKJIZrUNbmnabqdwaJ80+8Bb2mgedffBtsIrf4Tk+rYRfT6DQnBFJkh77hwOrqcWDNXU OMonVCBHU50QyIyC6EaugKiR8uSLAXsiDEPJ/c+Tfa8fxX/kVHs4UtHsJcPah7uqHCnwIc 80rfAz0Zeu1T+RTqheR42tH2rHcuKaiAXt84hEAffb0t4bLHGmOt/2pKeUb9UFZYTbCcx1 ua+3WbMo/WDs/0WmEcqeFqQ2Ha+wv/U8RqK7/CjHcqKkqOCclP9z7Vb0dRXAztC/hrfIsc 3qcRsp1mtltYjvMlxhD80Hb+N9o1IP10ZpWv7VEG0DXvE+oMpXJ2h9t6iwA2Rw== 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 4dXJth5XX3zph2 for ; Thu, 18 Dec 2025 18:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26fdb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:22:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 313616c4504a - stable/15 - fcntl(F_SETFL): Don't unconditionally invoke FIONBIO and FIOASYNC 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 313616c4504a1b97f1c0b773fa92ba8f54b7f97c Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:22:52 +0000 Message-Id: <6944467c.26fdb.761eebd7@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=313616c4504a1b97f1c0b773fa92ba8f54b7f97c commit 313616c4504a1b97f1c0b773fa92ba8f54b7f97c Author: John Baldwin AuthorDate: 2025-09-10 14:22:19 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:55 +0000 fcntl(F_SETFL): Don't unconditionally invoke FIONBIO and FIOASYNC Currently, F_SETFL always invokes FIONBIO and FIOASYNC ioctls on the file descriptor even if the state of the associated flag has not changed. This means that a character device driver that implements non-blocking I/O but not async I/O needs a handler for FIOASYNC that permits setting the value to 0. This also means that fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)) can fail for a character device driver that does not handle both FIONBIO and FIOASYNC. These requirements are not obvious nor well documented. Instead, only invoke FIONBIO and FIOASYNC if the relevant flag changes state. This only requires a device driver to implement support for FIONBIO or FIOASYNC if it supports the corresponding flag. While here, if a request aims to toggle both F_NOBLOCK and F_ASYNC and FIOASYNC fails, pass the previous state of F_NONBLOCK to FIONBIO instead of always disabling non-blocking I/O and then possibly reverting the flag back to on in f_flags. Reviewed by: mckusick, imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D52403 (cherry picked from commit 3c152a3de42a7d077e8d19159b679c3fb7572820) --- sys/kern/kern_descrip.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index ebc82b8dc427..2e43b5ca3b97 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -664,20 +664,26 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) } while (atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); got_set = tmp & ~flg; got_cleared = flg & ~tmp; - tmp = fp->f_flag & FNONBLOCK; - error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); - if (error != 0) - goto revert_f_setfl; - tmp = fp->f_flag & FASYNC; - error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td); - if (error == 0) { - fdrop(fp, td); - break; + if (((got_set | got_cleared) & FNONBLOCK) != 0) { + tmp = fp->f_flag & FNONBLOCK; + error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); + if (error != 0) + goto revert_flags; + } + if (((got_set | got_cleared) & FASYNC) != 0) { + tmp = fp->f_flag & FASYNC; + error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td); + if (error != 0) + goto revert_nonblock; + } + fdrop(fp, td); + break; +revert_nonblock: + if (((got_set | got_cleared) & FNONBLOCK) != 0) { + tmp = ~fp->f_flag & FNONBLOCK; + (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); } - atomic_clear_int(&fp->f_flag, FNONBLOCK); - tmp = 0; - (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); -revert_f_setfl: +revert_flags: do { tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; From nobody Thu Dec 18 18:22:53 2025 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 4dXJtk1x0Hz6LTgT for ; Thu, 18 Dec 2025 18:22:54 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJtj6nCCz46rk for ; Thu, 18 Dec 2025 18:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4j/VishZPnI2XgKHgLmXVxD7Jm9uHLIOVvm2tD5gh0U=; b=D6fTOiIDC+p8v7yRbOdDd71sccw1/xCjWfGrjSkdxfr2CSTC1dx6Z8Voj3R4ithxPmQARi VKSzF05DnumKVd6nrvO0gUo5MBKjb769aHPxzZFseINsYInh5Hrs/203PheCX8fcd34ZeE PGEappXhdTEcP+19Re3WIObh/Ll1GpJa1y+68XC4PLrZhqr4x+Ja3bQLTYWV52KJnrHWx0 Xas5qp+sTMZ6jlTiiJt3cI7IWZAEZboGGE5vGj0fJm9VBqRwJXScVLcbfeEV054pMK5yP0 HP0r5NizAs0LpwrIMpRLr5j2C8c6M4NwfRdo0M1VRlFh3M5A16FnOJHEL+6RUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4j/VishZPnI2XgKHgLmXVxD7Jm9uHLIOVvm2tD5gh0U=; b=rxmvrNqrA4IqGU64KrOOqYZseI5jRbWt/E9Ug94zakTgkxTHJOjVKUtNFEo5sNJQh5CTiw wP/T5T0d1Bs+Ji4Htm55kTCn62m6KMSZ+xaduSS2ajAIvSiF5BPwOshwoBh/oddi/26GWn SIkIqNMrB0vIH30AWXL8VIJxCX4x1Knh96EICxBrgjxNy8UApRSDfIJRW+Y5d2O7JTDDvZ jtnOr1kcpRQAKSMP6Wg/botVsH4z1WNLeW7FnVLIFQrnI8gBeoTYjCPmL67r43I9HyW7KR C19p4QsHRugjH44KXId8K6sPf1ve8dDILWOhU7p8Pnt1upHc3D6l0VlmSm7kZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082174; a=rsa-sha256; cv=none; b=Ah9oVgbhSODyhIsltYS0pQyHPc+8vziGFvuK12DotaeBBt/JdNGqBgWG4DpGwA7X/vnlZF rtRU7K8e1Tiy0+nYfqYRiyCmuTE2yQibhrpuiSt3cDJiTMdT3jHkY7+tmhNEWfKMxAZ7tf HqSJrCvW4eukSOCbi8iMNwv4CC8n7kA8E2W3ns02kmrlDk+1Z/usn9SdSr/EdbRlLszZ0X FckjbIrLR+O5puYOOCtOhgoNdpate6aXSNyVFcuiBsfD+QZAcDe+APHUwvnRg1xfMuuDrF hrntRfTfXLHfM+A77bLuuJMkr3pIJp2DjwTa3txXCd4qcJJBs7n+ReW+4C9pBA== 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 4dXJtj6LTTzpmj for ; Thu, 18 Dec 2025 18:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26cb8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:22:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konstantin Belousov From: John Baldwin Subject: git: 11870bb24801 - stable/15 - fcntl(F_SETFL): only allow one thread to perform F_SETFL 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 11870bb24801b053e04753b72d00297e2cf31fb9 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:22:53 +0000 Message-Id: <6944467d.26cb8.6216622c@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=11870bb24801b053e04753b72d00297e2cf31fb9 commit 11870bb24801b053e04753b72d00297e2cf31fb9 Author: Konstantin Belousov AuthorDate: 2025-09-11 10:05:04 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:55 +0000 fcntl(F_SETFL): only allow one thread to perform F_SETFL Use f_vflags file locking for this. Allowing more than one thread handling F_SETFL might cause de-sync between real driver state and flags. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D52487 (cherry picked from commit 4c3a868d13c053ef173268cdfe1365978a282178) --- sys/kern/kern_descrip.c | 3 +++ sys/kern/vfs_vnops.c | 36 ++++++++++++++++++++++++++++++++++++ sys/sys/file.h | 4 ++++ 3 files changed, 43 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 2e43b5ca3b97..2fa0621bdfca 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -657,6 +657,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = EBADF; break; } + fsetfl_lock(fp); do { tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; @@ -676,6 +677,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) if (error != 0) goto revert_nonblock; } + fsetfl_unlock(fp); fdrop(fp, td); break; revert_nonblock: @@ -690,6 +692,7 @@ revert_flags: tmp |= got_cleared; tmp &= ~got_set; } while (atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); + fsetfl_unlock(fp); fdrop(fp, td); break; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index e27692ccb1a3..68c0ea952e11 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -902,6 +902,18 @@ foffset_read(struct file *fp) return (atomic_load_long(&fp->f_offset)); } +void +fsetfl_lock(struct file *fp) +{ + file_v_lock(fp, FILE_V_SETFL_LOCKED, FILE_V_SETFL_LOCK_WAITING); +} + +void +fsetfl_unlock(struct file *fp) +{ + file_v_unlock(fp, FILE_V_SETFL_LOCKED, FILE_V_SETFL_LOCK_WAITING); +} + #else /* OFF_MAX <= LONG_MAX */ static void @@ -977,6 +989,30 @@ foffset_read(struct file *fp) return (foffset_lock(fp, FOF_NOLOCK)); } + +void +fsetfl_lock(struct file *fp) +{ + struct mtx *mtxp; + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + file_v_lock_mtxp(fp, mtxp, FILE_V_SETFL_LOCKED, + FILE_V_SETFL_LOCK_WAITING); + mtx_unlock(mtxp); +} + +void +fsetfl_unlock(struct file *fp) +{ + struct mtx *mtxp; + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + file_v_unlock_mtxp(fp, mtxp, FILE_V_SETFL_LOCKED, + FILE_V_SETFL_LOCK_WAITING); + mtx_unlock(mtxp); +} #endif void diff --git a/sys/sys/file.h b/sys/sys/file.h index b537daa27ff5..8105d658185e 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -93,6 +93,8 @@ void foffset_lock_pair(struct file *fp1, off_t *off1p, struct file *fp2, void foffset_lock_uio(struct file *fp, struct uio *uio, int flags); void foffset_unlock(struct file *fp, off_t val, int flags); void foffset_unlock_uio(struct file *fp, struct uio *uio, int flags); +void fsetfl_lock(struct file *fp); +void fsetfl_unlock(struct file *fp); static inline off_t foffset_get(struct file *fp) @@ -228,6 +230,8 @@ struct file { #define FILE_V_FOFFSET_LOCKED 0x0001 #define FILE_V_FOFFSET_LOCK_WAITING 0x0002 +#define FILE_V_SETFL_LOCKED 0x0004 +#define FILE_V_SETFL_LOCK_WAITING 0x0008 #endif /* __BSD_VISIBLE */ #endif /* _KERNEL || _WANT_FILE */ From nobody Thu Dec 18 18:22:54 2025 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 4dXJtl2gN8z6LV2k for ; Thu, 18 Dec 2025 18:22:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJtl1JzPz46Pp for ; Thu, 18 Dec 2025 18:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082175; 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=6De5lAsWFsRgfiDnbawLNQbzYVlWepHiI0fGDt92CXw=; b=o/OvT1GySdkHL08fU4l3Aja8Jw5dkgZmhDf27GCuxKGPhDajXG6IkqhrNDWBqzl+bd8Ebm 8krD/QHmOZGA34Ww4pCvJtDKJCJnfeUfgCLKU6lpEReZurbDV88OsWCw0pjD8+mrOPnFsU ctbGUjoD6yqzINScdKl+bxLY8h37G+2m87ZfvQjUVMXxkj2kOgmH0twE0dyBFJiNnJ0p3T 4bL3e8HTF8RL6rO1VTBOOotuU2f5FbtR4p6ieCWIEiBNtmQEGvvnzTZwyweTvU8PqZzGoq sfG9K2XU9dyjdTCsNosRvZZ7LmrfmBRFF6k2ExoN+SOln2OiU2wDA29Hs7KMqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082175; 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=6De5lAsWFsRgfiDnbawLNQbzYVlWepHiI0fGDt92CXw=; b=OWh1ZWTqK64q1OYb9uT/pJhwMhiwt5hZCE4JIMFAAqIn0QtwV05Ldgme2lqoJGGQeayc8t 7jHku07VDeyM/VRwizLhBAswW0wrKwIpdl9s4eNSX9PTihKSJ4XDRulX1OXfusQ8zF8+0w YWOgnwAcesSchzODlVsXKanegCHxqeicS+Xk7pOY1acllABdomyncPIJ7jNhV9XkrGacYa RDM0hfjolKAnfs36BdFd5vlcb9/PXvjLTRJrFlqO2IEbZeG66EnXb6GMTNQAyP8m6IqR0u SuLs3xX6VSs7biFs3zBb4hzHEZVzb0krRvWTsCEC5I0HAmjw/eG80HMutG0UtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082175; a=rsa-sha256; cv=none; b=sFiJ93RLEBj/4/BHSFmGrAhLCJA15EphqtvDwY6il6E6Kla4Sy79iNPGqxp96hrg8MIxv9 VsEDwAoiR/kTxPCnXZKm6SjMCe3y0ZHqQc5vk3Zvp0ciKk06UHX2UZ0UzdiZ8bGjxddlb2 XWenVH9dwhcbeNZEBXDnENbqHXLn9vqWx2RMhuraZcGJQfh2rvnvJkkAa6xh8D5CZzI3Dj UHGVCIrrvce9m/tv0N8Hpbjx962U2+J82j035vB8ZNeyDSF+p5HGvYJyKCO1Gi77Lt/K+V XPRy0FrETshPfbF3n6Feg/Ezeqks8Fig0kQyuZYnJz8nGqvjss5APKZWMyXkhQ== 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 4dXJtl043LzqKJ for ; Thu, 18 Dec 2025 18:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25c50 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:22:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f9c7de5c9c67 - stable/15 - fcntlflags_test: Port to atf-c(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f9c7de5c9c67d6dd036f6a10e2afb19b629d7b6a Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:22:54 +0000 Message-Id: <6944467e.25c50.49c726b6@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f9c7de5c9c67d6dd036f6a10e2afb19b629d7b6a commit f9c7de5c9c67d6dd036f6a10e2afb19b629d7b6a Author: John Baldwin AuthorDate: 2025-10-03 16:43:18 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:55 +0000 fcntlflags_test: Port to atf-c(3) Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D52720 (cherry picked from commit 5c331f449e9ca549d03ae1a3f50ac0e5306b488e) --- tests/sys/file/Makefile | 2 +- tests/sys/file/fcntlflags_test.c | 116 +++++++++++++++++++-------------------- 2 files changed, 58 insertions(+), 60 deletions(-) diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile index f80d1b271b85..beb4452359b7 100644 --- a/tests/sys/file/Makefile +++ b/tests/sys/file/Makefile @@ -5,7 +5,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= path_test TAP_TESTS_C+= closefrom_test TAP_TESTS_C+= dup_test -TAP_TESTS_C+= fcntlflags_test +ATF_TESTS_C+= fcntlflags_test TAP_TESTS_SH+= flock_test PLAIN_TESTS_C+= ftruncate_test PLAIN_TESTS_C+= newfileops_on_fork_test diff --git a/tests/sys/file/fcntlflags_test.c b/tests/sys/file/fcntlflags_test.c index c5026e38c48b..009bb87371a1 100644 --- a/tests/sys/file/fcntlflags_test.c +++ b/tests/sys/file/fcntlflags_test.c @@ -24,85 +24,83 @@ * SUCH DAMAGE. */ -#include - +#include #include #include #include +#include + /* * O_ACCMODE is currently defined incorrectly. This is what it should be. * Various code depends on the incorrect value. */ #define CORRECT_O_ACCMODE (O_ACCMODE | O_EXEC) -static int testnum; - static void -subtests(const char *path, int omode, const char *omodetext) +basic_tests(const char *path, int omode, const char *omodetext) { int fd, flags1, flags2, flags3; fd = open(path, omode); - if (fd == -1) - printf("not ok %d - open(\"%s\", %s) failed\n", - testnum++, path, omodetext); - else - printf("ok %d - open(\"%s\", %s) succeeded\n", - testnum++, path, omodetext); + ATF_REQUIRE_MSG(fd != -1, "open(\"%s\", %s) failed: %s", path, + omodetext, strerror(errno)); + flags1 = fcntl(fd, F_GETFL); - if (flags1 == -1) - printf("not ok %d - fcntl(F_GETFL) failed\n", testnum++); - else if ((flags1 & CORRECT_O_ACCMODE) == omode) - printf("ok %d - fcntl(F_GETFL) gave correct result\n", - testnum++); - else - printf("not ok %d - fcntl(F_GETFL) gave incorrect result " - "(%#x & %#x != %#x)\n", - testnum++, flags1, CORRECT_O_ACCMODE, omode); - if (fcntl(fd, F_SETFL, flags1) == -1) - printf("not ok %d - fcntl(F_SETFL) same flags failed\n", - testnum++); - else - printf("ok %d - fcntl(F_SETFL) same flags succeeded\n", - testnum++); + ATF_REQUIRE_MSG(flags1 != -1, "fcntl(F_GETFL) (1) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(omode, flags1 & CORRECT_O_ACCMODE); + ATF_REQUIRE((flags1 & O_NONBLOCK) == 0); + + ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, flags1) != -1, + "fcntl(F_SETFL) same flags failed: %s", strerror(errno)); + flags2 = fcntl(fd, F_GETFL); - if (flags2 == -1) - printf("not ok %d - fcntl(F_GETFL) failed\n", testnum++); - else if (flags2 == flags1) - printf("ok %d - fcntl(F_GETFL) gave same result\n", - testnum++); - else - printf("not ok %d - fcntl(F_SETFL) caused fcntl(F_GETFL) to " - "change from %#x to %#x\n", - testnum++, flags1, flags2); - if (fcntl(fd, F_SETFL, flags2 | O_NONBLOCK) == -1) - printf("not ok %d - fcntl(F_SETFL) O_NONBLOCK failed\n", - testnum++); - else - printf("ok %d - fcntl(F_SETFL) O_NONBLOCK succeeded\n", - testnum++); + ATF_REQUIRE_MSG(flags2 != -1, "fcntl(F_GETFL) (2) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(flags1, flags2); + + ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, flags2 | O_NONBLOCK) != -1, + "fcntl(F_SETFL) O_NONBLOCK failed: %s", strerror(errno)); + flags3 = fcntl(fd, F_GETFL); - if (flags3 == -1) - printf("not ok %d - fcntl(F_GETFL) failed\n", testnum++); - else if (flags3 == (flags2 | O_NONBLOCK)) - printf("ok %d - fcntl(F_GETFL) gave expected result\n", - testnum++); - else - printf("not ok %d - fcntl(F_SETFL) gave unexpected result " - "(%#x != %#x)\n", - testnum++, flags3, flags2 | O_NONBLOCK); + ATF_REQUIRE_MSG(flags3 != -1, "fcntl(F_GETFL) (3) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(flags2 | O_NONBLOCK, flags3); + (void)close(fd); } -int -main(int argc __unused, char **argv __unused) +ATF_TC_WITHOUT_HEAD(read_only_null); +ATF_TC_BODY(read_only_null, tc) +{ + basic_tests("/dev/null", O_RDONLY, "O_RDONLY"); +} + +ATF_TC_WITHOUT_HEAD(write_only_null); +ATF_TC_BODY(write_only_null, tc) +{ + basic_tests("/dev/null", O_WRONLY, "O_WRONLY"); +} + +ATF_TC_WITHOUT_HEAD(read_write_null); +ATF_TC_BODY(read_write_null, tc) { - printf("1..24\n"); - testnum = 1; - subtests("/dev/null", O_RDONLY, "O_RDONLY"); - subtests("/dev/null", O_WRONLY, "O_WRONLY"); - subtests("/dev/null", O_RDWR, "O_RDWR"); - subtests("/bin/sh", O_EXEC, "O_EXEC"); - return (0); + basic_tests("/dev/null", O_RDWR, "O_RDWR"); +} + +ATF_TC_WITHOUT_HEAD(exec_only_sh); +ATF_TC_BODY(exec_only_sh, tc) +{ + basic_tests("/bin/sh", O_EXEC, "O_EXEC"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, read_only_null); + ATF_TP_ADD_TC(tp, write_only_null); + ATF_TP_ADD_TC(tp, read_write_null); + ATF_TP_ADD_TC(tp, exec_only_sh); + + return (atf_no_error()); } From nobody Thu Dec 18 18:22:56 2025 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 4dXJtm5TH9z6LVDC for ; Thu, 18 Dec 2025 18:22:56 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJtm17y7z46v5 for ; Thu, 18 Dec 2025 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082176; 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=QMxhanse0UlnaNX7adQU8pm1agD/Z0e9w79YV83kB5c=; b=BYQa2J2AVA9jhINA+rh0UPCRnxkN/g6mN6rcBKNdYWtDhiFl3piveQ+fOEaJpEK1MqbgYa FT7g9iekbJoFHQ/bOPKc2rngsW7fVHeZXNxzd6AjADQu+s6/vETbI2/qNBLGS4LiXaVTfv dulMIYRUa7/s0T7mCVVUQOSvPMP/MJI2Gy0i8Zq4EYzkrqsLERjhRTJNRqP1QlixAtKn7P 4boV9vbyfMZV8IwzglQARPNtEBNU/jKV2aDEgpMUjmHUdNTmC4drXDcSCHjeCAT7YPMo0H trbkzdEaUeBD1OH56llU3uSxOG3gyPDJu0NiFtJE8UwUB/M8LGFizD0Y+TAcaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082176; 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=QMxhanse0UlnaNX7adQU8pm1agD/Z0e9w79YV83kB5c=; b=L3GOn99wNKnbacUjU0fyyuQ1K/20Q0IBkVRlT5Qj/HZ+hUMfS+beLb/ylxRaETy0zCtlcr thx2V7tGNxqqO7BE/+S3CwXvvBxErHCSZH6+esbZZqLN9t3gl67tW7j8Vb44XzXX+T3liO n3UFGJCwfy3VnUWM31xCvd3su1T8hpjl6JR+dnDCuEx0gAcT8bJtLKZGhgca5CcR+JEgf3 9AhXjwZ7W1TmbdjXh4v+S0JpcMeTXuE+SSIzX2x+eBPVhIEd7y45KS5M2wX2Jinct9LqfD +DGiJj4EHSYxwAXSD66mPVG732Xfb3LT+dyXqPJCTQU/Gm7nRVRIRtJ7EOMs7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082176; a=rsa-sha256; cv=none; b=Y5Q/a7LPpLf1zxDQWWX+8lJZlQBhzV/fY413GMHULtfCNQlzXjignXZ5Xdf43Fephh2xdz biMYKqCdYYQgyhW4Pzvh8VxGNSy1iLJnSiVguXBlzrbUjbvYfzhgH/LyR6D9Cm9erPrqMb /wVlDbvLYCZ9ICkAMspbvk+0eU8eQTo2VDpWrSKQQQXbQ5S6/A9PRjEkRcVKC1UdZmH3H7 1i9PYyxE98cE1EnMBM1mOuskF22OjAExjhpPv8E+YnoSMG29YDEHW5yrnzOe7+1SP6YN8Y V/fOtHHoEqs4d23qasUVzROLTtRNnsjCGdTsV2f/Y1tPbqW0Sya3IboZ2kGuOQ== 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 4dXJtm0ckczq4k for ; Thu, 18 Dec 2025 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25c54 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:22:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 45fa340b10cd - stable/15 - filedesc: Close race between fcntl(F_SETFL) and ioctl(FIONBIO/FIOASYNC) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 45fa340b10cd1f8cef9ecb7a72d9b3c4e4899078 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:22:56 +0000 Message-Id: <69444680.25c54.594cf167@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=45fa340b10cd1f8cef9ecb7a72d9b3c4e4899078 commit 45fa340b10cd1f8cef9ecb7a72d9b3c4e4899078 Author: John Baldwin AuthorDate: 2025-10-03 16:43:30 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:55 +0000 filedesc: Close race between fcntl(F_SETFL) and ioctl(FIONBIO/FIOASYNC) - Use the recently-added fsetfl_lock/unlock API to synchronize direct FIONBIO and FIOASYNC ioctls with fcntl(F_SETFL). - While here, skip calling the underlying ioctl if the flag's current state matches the requested state. - Also while here, only update the flag state if the underlying ioctl succeeds. This fixes a bug where the flags represented the new state even if the underlying ioctl failed. A test is added for this last case that a failing FIOASYNC on /dev/null doesn't result in setting O_ASYNC in the file flags. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D52721 (cherry picked from commit dfd7d1610aeb654aafcaa8cf77b75fc5c7d60250) --- sys/kern/sys_generic.c | 36 +++++++++++++++++++++--------------- tests/sys/file/fcntlflags_test.c | 27 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 5a7c6abec0cb..b84f675d1dcb 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -729,7 +729,7 @@ kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data) { struct file *fp; struct filedesc *fdp; - int error, tmp, locked; + int error, f_flag, tmp, locked; AUDIT_ARG_FD(fd); AUDIT_ARG_CMD(com); @@ -782,30 +782,36 @@ kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data) goto out; } + f_flag = 0; switch (com) { case FIONCLEX: fdp->fd_ofiles[fd].fde_flags &= ~UF_EXCLOSE; - goto out; + break; case FIOCLEX: fdp->fd_ofiles[fd].fde_flags |= UF_EXCLOSE; - goto out; - case FIONBIO: - if ((tmp = *(int *)data)) - atomic_set_int(&fp->f_flag, FNONBLOCK); - else - atomic_clear_int(&fp->f_flag, FNONBLOCK); - data = (void *)&tmp; break; + case FIONBIO: case FIOASYNC: - if ((tmp = *(int *)data)) - atomic_set_int(&fp->f_flag, FASYNC); - else - atomic_clear_int(&fp->f_flag, FASYNC); - data = (void *)&tmp; + f_flag = com == FIONBIO ? FNONBLOCK : FASYNC; + tmp = *(int *)data; + fsetfl_lock(fp); + if (((fp->f_flag & f_flag) != 0) != (tmp != 0)) { + error = fo_ioctl(fp, com, (void *)&tmp, td->td_ucred, + td); + if (error == 0) { + if (tmp != 0) + atomic_set_int(&fp->f_flag, f_flag); + else + atomic_clear_int(&fp->f_flag, f_flag); + } + } + fsetfl_unlock(fp); + break; + default: + error = fo_ioctl(fp, com, data, td->td_ucred, td); break; } - error = fo_ioctl(fp, com, data, td->td_ucred, td); out: switch (locked) { case LA_XLOCKED: diff --git a/tests/sys/file/fcntlflags_test.c b/tests/sys/file/fcntlflags_test.c index 009bb87371a1..15a18c113c4a 100644 --- a/tests/sys/file/fcntlflags_test.c +++ b/tests/sys/file/fcntlflags_test.c @@ -24,6 +24,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -95,12 +96,38 @@ ATF_TC_BODY(exec_only_sh, tc) basic_tests("/bin/sh", O_EXEC, "O_EXEC"); } +ATF_TC_WITHOUT_HEAD(fioasync_dev_null); +ATF_TC_BODY(fioasync_dev_null, tc) +{ + int fd, flags1, flags2, val; + + fd = open("/dev/null", O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open(\"/dev/null\") failed: %s", + strerror(errno)); + + flags1 = fcntl(fd, F_GETFL); + ATF_REQUIRE_MSG(flags1 != -1, "fcntl(F_GETFL) (1) failed: %s", + strerror(errno)); + ATF_REQUIRE((flags1 & O_ASYNC) == 0); + + val = 1; + ATF_REQUIRE_ERRNO(EINVAL, ioctl(fd, FIOASYNC, &val) == -1); + + flags2 = fcntl(fd, F_GETFL); + ATF_REQUIRE_MSG(flags2 != -1, "fcntl(F_GETFL) (2) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(flags1, flags2); + + (void)close(fd); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, read_only_null); ATF_TP_ADD_TC(tp, write_only_null); ATF_TP_ADD_TC(tp, read_write_null); ATF_TP_ADD_TC(tp, exec_only_sh); + ATF_TP_ADD_TC(tp, fioasync_dev_null); return (atf_no_error()); } From nobody Thu Dec 18 18:23:10 2025 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 4dXJv26q9qz6LTrW for ; Thu, 18 Dec 2025 18:23:10 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJv24rQ2z47FX for ; Thu, 18 Dec 2025 18:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082190; 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=BvA1ek2IBTyfNQGD672pvFy7DU/WdDqfPKvnmeCmcJw=; b=GIwmKq+hOKn0IT1huEvgwop6MNW8oESE8+inCRT5L7Xzhprbn8fslzcaexNQXMMThTdOEO Tr0OexcvvZeXz7WJGpBJr5gBtA3FP6AeZ9+0bxeDhRgnzmsoHayNKmxoVZ5IVuXP8jBTdE it6cuq4DtIgjJDPE5fFvg98KIHXy33YcMGCgAB035xYBe3vhGQhCW7PmcHgis1x7mcvLrC ma1WGyeUW1pu7SdAriENS4o3je35TL+tSxj8IU4sM4DfOtWojnuEqFdpu3VQquTjuPf1We BJhpILJDFT1WxxgV3ynJBtKlY/Kk0rFzQLpMa/4g048imzVq7YTdIa/xuh1RbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082190; 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=BvA1ek2IBTyfNQGD672pvFy7DU/WdDqfPKvnmeCmcJw=; b=HEwcYiL9d9xVveUpVonpFKAirKFqpny7rxHE+YbAZLR/jce/4SJqK0GFgIWVIP7RvgUzpH Y2KbAVQzB+c8BN72FICUUFQ4rhcI+RRTQu8bIAt97ne3X0ZOAX4lDSoTuF9s3hVLwIZxnz bkRtPfjD5noQFN7+BZKOIkFOzgspxyORlw98eyNu5+0eYXvKLkNSR2InYFVasSYqFMqwfK E0nxcMmbTLVzxv6hSorXIXBXJ0ryMccasyHD/lvLNGc1jJzMv23BFiv1xqQtCcGTCnQ4vA cqZrq+vBCkFTM0nK1bkcYhjFvKgN+clyooQoDMzdwCHQxE5kliZxutYz72770Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082190; a=rsa-sha256; cv=none; b=qY2CppmXgVN0OLkxdGRjmeBnHys1BCWO4HBz0S8bOLkgmAb91Zh+/a6I0y3mSqU31FxtdL 9v1JfQg6H/QjQdm5N81TdOjKwULxIR/f6DzjNa+ouedgmZSfcQM84bQczd/N3vTGzx8kYM pr3O6AqlTWFQXOSguTwOWJL5kkbQFzvB37SK3fcqakBhOOR+qa4L//Fui5VGRJ4DuKOVaG ZNlLEEcNbV2YG958OTJJnoJmlmGLJZwZsSqXarO98b/DeJBv2LM8ofVLDzUeaOBx7nFLCy Izi7hjWEyXzD7lGH7Uwv8hXGkGsTn+nFgvvi6uitMm6bBcvo8J1B+prHO2FV9w== 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 4dXJv23yswzpml for ; Thu, 18 Dec 2025 18:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2674f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:23:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b3aada5bfdb9 - stable/14 - fcntl(F_SETFL): Don't unconditionally invoke FIONBIO and FIOASYNC 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b3aada5bfdb9da22fdd33a67ca508074da6d1b5b Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:23:10 +0000 Message-Id: <6944468e.2674f.2f543ec6@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b3aada5bfdb9da22fdd33a67ca508074da6d1b5b commit b3aada5bfdb9da22fdd33a67ca508074da6d1b5b Author: John Baldwin AuthorDate: 2025-09-10 14:22:19 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:56 +0000 fcntl(F_SETFL): Don't unconditionally invoke FIONBIO and FIOASYNC Currently, F_SETFL always invokes FIONBIO and FIOASYNC ioctls on the file descriptor even if the state of the associated flag has not changed. This means that a character device driver that implements non-blocking I/O but not async I/O needs a handler for FIOASYNC that permits setting the value to 0. This also means that fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)) can fail for a character device driver that does not handle both FIONBIO and FIOASYNC. These requirements are not obvious nor well documented. Instead, only invoke FIONBIO and FIOASYNC if the relevant flag changes state. This only requires a device driver to implement support for FIONBIO or FIOASYNC if it supports the corresponding flag. While here, if a request aims to toggle both F_NOBLOCK and F_ASYNC and FIOASYNC fails, pass the previous state of F_NONBLOCK to FIONBIO instead of always disabling non-blocking I/O and then possibly reverting the flag back to on in f_flags. Reviewed by: mckusick, imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D52403 (cherry picked from commit 3c152a3de42a7d077e8d19159b679c3fb7572820) --- sys/kern/kern_descrip.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 0e6af0f5deff..e8bbc5d9ee1c 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -578,20 +578,26 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) } while (atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); got_set = tmp & ~flg; got_cleared = flg & ~tmp; - tmp = fp->f_flag & FNONBLOCK; - error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); - if (error != 0) - goto revert_f_setfl; - tmp = fp->f_flag & FASYNC; - error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td); - if (error == 0) { - fdrop(fp, td); - break; + if (((got_set | got_cleared) & FNONBLOCK) != 0) { + tmp = fp->f_flag & FNONBLOCK; + error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); + if (error != 0) + goto revert_flags; + } + if (((got_set | got_cleared) & FASYNC) != 0) { + tmp = fp->f_flag & FASYNC; + error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td); + if (error != 0) + goto revert_nonblock; + } + fdrop(fp, td); + break; +revert_nonblock: + if (((got_set | got_cleared) & FNONBLOCK) != 0) { + tmp = ~fp->f_flag & FNONBLOCK; + (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); } - atomic_clear_int(&fp->f_flag, FNONBLOCK); - tmp = 0; - (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); -revert_f_setfl: +revert_flags: do { tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; From nobody Thu Dec 18 18:23:11 2025 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 4dXJv415Cdz6LV7P for ; Thu, 18 Dec 2025 18:23:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJv35YgHz47VC for ; Thu, 18 Dec 2025 18:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWEDBTly3bW3aFVYod/OOGJgAksBczVpLr/lhF29du4=; b=yvUKsmNtbqIp5Q/ROwIQGBLpfVkfoXjC6AnNIWe2Bk3fdzftECSyCCMDAmiBudKo0ocN3x ygU/P4Soh+Tu3MW+JcrtzNr91DR6cCAlWRi0D/lXFr6F7ZEGNApx6MUqV+qWNx6U0xG26E BOeeIQEYd4MoLBp4PVrRY9lVgqD1iOVFP9RAb64CkFL5vBgOXpQ//B+TOkx+2ICMv3NZux WYGGI1v04DBA87opLtX6ohwOyNESN2993eW3tHBp8DvsssgjpaD74M7mmZ9wbO9zoLTOza DzpLKQY7vryXfxSzZUHAlu/6WtkjaUWkpaAy9ThZAfeBhBdvs+jtQwwHMDYVaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWEDBTly3bW3aFVYod/OOGJgAksBczVpLr/lhF29du4=; b=fuXmGR9Qa8l+vNfUTWjfDa4qObj5Iq+yElLW5zEzvpuP+QTYmWtlmrO+pZ24QacieVngkB 0FUUFM6yqXIyL5NTFxfiynQ9IAmsP73ltRCSRYI1LqDDHFr8jBV5JFcvfffrxpv71rp4ol IrVB4QOzVRI+6DwFrfhdUonMO79mMO/Cbj0LyURJMnyWFSKTRgiJZdVpj+xOVmWjwhVaNo T36gRD5WASrneVN3Jt4CUWbO5tLn3tHiMVeG3AEagoCODpgYOGrpd1pPNdkQk3o0S5MFsM KzEwc5CDehrRpoq0HkdEh51hSd1t9mNZaSMxWsN2WRdX+G5UlahtU4WMTXlEwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082191; a=rsa-sha256; cv=none; b=ADg9nhYI4P32PHDX74v34KVUnSLJumdX1CNQqXxzV1kWjEQ07SEWsHIPVuyB0yyv9H4TSA Ne1qjvex+HVs62u/go45alM/VPMsPe+QAZYX//XB45meMn8f1lKB/lMEmtZGShlItMgNB1 FtGIesHA+WhHhYXbTcHxuN94LTe0l4woEYt9wXVFLhOlsV9K0Btv/q8AUAkdM/ddMjayCs +rYEKcyH+nzW1tbA68E/ZuW+YQwx7tHF+9hDsArQiQr6og9gteDzWhOXzoxXOcSOChA1qR T7GMoOgwNcELbd3YIx/JxihV4bidkm3OwjLsayyR20eIW1RZ9E+jtEJG7ALKPg== 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 4dXJv34pWbzqS5 for ; Thu, 18 Dec 2025 18:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24461 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:23:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konstantin Belousov From: John Baldwin Subject: git: 7bf3b6d8e426 - stable/14 - fcntl(F_SETFL): only allow one thread to perform F_SETFL 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7bf3b6d8e4263d63f4276b27035f2c6254c28a86 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:23:11 +0000 Message-Id: <6944468f.24461.76f18959@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7bf3b6d8e4263d63f4276b27035f2c6254c28a86 commit 7bf3b6d8e4263d63f4276b27035f2c6254c28a86 Author: Konstantin Belousov AuthorDate: 2025-09-11 10:05:04 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:56 +0000 fcntl(F_SETFL): only allow one thread to perform F_SETFL Use f_vflags file locking for this. Allowing more than one thread handling F_SETFL might cause de-sync between real driver state and flags. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D52487 (cherry picked from commit 4c3a868d13c053ef173268cdfe1365978a282178) --- sys/kern/kern_descrip.c | 3 +++ sys/kern/vfs_vnops.c | 36 ++++++++++++++++++++++++++++++++++++ sys/sys/file.h | 4 ++++ 3 files changed, 43 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index e8bbc5d9ee1c..51752aa8ab33 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -571,6 +571,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = EBADF; break; } + fsetfl_lock(fp); do { tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; @@ -590,6 +591,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) if (error != 0) goto revert_nonblock; } + fsetfl_unlock(fp); fdrop(fp, td); break; revert_nonblock: @@ -604,6 +606,7 @@ revert_flags: tmp |= got_cleared; tmp &= ~got_set; } while (atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); + fsetfl_unlock(fp); fdrop(fp, td); break; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 4d1df41cf588..ee247de2374c 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -863,6 +863,18 @@ foffset_read(struct file *fp) return (atomic_load_long(&fp->f_offset)); } +void +fsetfl_lock(struct file *fp) +{ + file_v_lock(fp, FILE_V_SETFL_LOCKED, FILE_V_SETFL_LOCK_WAITING); +} + +void +fsetfl_unlock(struct file *fp) +{ + file_v_unlock(fp, FILE_V_SETFL_LOCKED, FILE_V_SETFL_LOCK_WAITING); +} + #else /* OFF_MAX <= LONG_MAX */ static void @@ -938,6 +950,30 @@ foffset_read(struct file *fp) return (foffset_lock(fp, FOF_NOLOCK)); } + +void +fsetfl_lock(struct file *fp) +{ + struct mtx *mtxp; + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + file_v_lock_mtxp(fp, mtxp, FILE_V_SETFL_LOCKED, + FILE_V_SETFL_LOCK_WAITING); + mtx_unlock(mtxp); +} + +void +fsetfl_unlock(struct file *fp) +{ + struct mtx *mtxp; + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + file_v_unlock_mtxp(fp, mtxp, FILE_V_SETFL_LOCKED, + FILE_V_SETFL_LOCK_WAITING); + mtx_unlock(mtxp); +} #endif void diff --git a/sys/sys/file.h b/sys/sys/file.h index 349605939d30..785230160b69 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -90,6 +90,8 @@ void foffset_lock_pair(struct file *fp1, off_t *off1p, struct file *fp2, void foffset_lock_uio(struct file *fp, struct uio *uio, int flags); void foffset_unlock(struct file *fp, off_t val, int flags); void foffset_unlock_uio(struct file *fp, struct uio *uio, int flags); +void fsetfl_lock(struct file *fp); +void fsetfl_unlock(struct file *fp); static inline off_t foffset_get(struct file *fp) @@ -219,6 +221,8 @@ struct file { #define FILE_V_FOFFSET_LOCKED 0x0001 #define FILE_V_FOFFSET_LOCK_WAITING 0x0002 +#define FILE_V_SETFL_LOCKED 0x0004 +#define FILE_V_SETFL_LOCK_WAITING 0x0008 #endif /* __BSD_VISIBLE */ #endif /* _KERNEL || _WANT_FILE */ From nobody Thu Dec 18 18:23:12 2025 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 4dXJv51Xd9z6LTpg for ; Thu, 18 Dec 2025 18:23:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJv4620Xz47Mw for ; Thu, 18 Dec 2025 18:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082192; 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=C8XzCMdl7juVCgyBYF/EiJ8e3e/FoKdddFziMw2YitQ=; b=pflBnb/iE/qnRuUIhifZAPvKpDvbUhcokwd9zqfFroi9jd9ckgsK9j+15cwmQCI5TLmHU5 pqVyLnYyN32/7+7YBkgVsAXmVvMvW7FAqBOnZGFkIchuX/4fRkg4Py+al064Sra23GueJ7 gLwEX4VoPpoAoPWcREsOnyFKxOn8iMK4IEYxvMDooYdikIBzBY17fe0CE1WGSm3BYeviCV 0OATbYF000ssNXykHPkw0juAzhfFQpBPHd5d3LPSXQGtRexhjqRUOGoXxjd4ANjHkRIoZM PHV3KF28az4qGllZu5mMj7o6Jm/pIwv/FxXwPEbGEEDaBQLlXQIScnGzPcDksQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082192; 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=C8XzCMdl7juVCgyBYF/EiJ8e3e/FoKdddFziMw2YitQ=; b=gVQuvV1hwWy0HWSQPtsQuvoNdZ1tMiomCUIF1yf/367mcKrWNaAfd1knPfhBPsr/6wha3v UzsO7Hc5YAYoGm6wcxRxkeypjm2Voviva5ACzrCp2wGStKhC3TGL36YfH4NaIUAL+j4dE/ 4S0Gp7EqnDFDsGRdirpx4PYsfof4SVZla69X3L4ZvWFoWETGeqR2/B/PHW+B/rOHUQpEZk zF8FpsYkgaI6JfApdiAZordTT5pFg8DVVcPduj/it9Ns6hefbGfMhalubu+RyvlJpi2Opv w07npkC/pSeMlxawXxq4EEfWN+Nn0CGnvPpUQLZd8frbt7RzPtRuIRcDh0kf5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082192; a=rsa-sha256; cv=none; b=dBYFAWZ2P3ZdAkzvqRZ26R5m2GZZ4V1HqQM4ogJEAo4yJgbI+FDHPuPyA4daR3riKhNIts jqEOi86x7MS1juG6i1k6CL8vR56gpNKzcANkoHr1R1Vq2wqB2ER/KN1KA+a7zrVDXVBJnR ghZERMuu/aCP+SXKLJ/2e5ynwD2zM0DnQs1rrdegPl9RaXf00V3+m0Ro1NZd5qGOev2kKu ickOhbCAr1guY7XwizfoZN9Iy5Z0kYxmVdF5s0T2ngQbTUDjl7Z5aqTWNRR0rOilEG3yJH a6f8KB8bdPrga0J0PZjhrHgVcY+7uwd1c+rZlo+dMSq1P111WK6cg9lEvAvCDA== 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 4dXJv45cfmzqS6 for ; Thu, 18 Dec 2025 18:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26fdf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:23:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 200e1ca48fdc - stable/14 - fcntlflags_test: Port to atf-c(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 200e1ca48fdc11914cce91957d75e549b91f07c1 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:23:12 +0000 Message-Id: <69444690.26fdf.3b57ed86@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=200e1ca48fdc11914cce91957d75e549b91f07c1 commit 200e1ca48fdc11914cce91957d75e549b91f07c1 Author: John Baldwin AuthorDate: 2025-10-03 16:43:18 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:56 +0000 fcntlflags_test: Port to atf-c(3) Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D52720 (cherry picked from commit 5c331f449e9ca549d03ae1a3f50ac0e5306b488e) --- tests/sys/file/Makefile | 2 +- tests/sys/file/fcntlflags_test.c | 116 +++++++++++++++++++-------------------- 2 files changed, 58 insertions(+), 60 deletions(-) diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile index 010606bfeba0..fd490cb0543e 100644 --- a/tests/sys/file/Makefile +++ b/tests/sys/file/Makefile @@ -6,7 +6,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= path_test TAP_TESTS_C+= closefrom_test TAP_TESTS_C+= dup_test -TAP_TESTS_C+= fcntlflags_test +ATF_TESTS_C+= fcntlflags_test TAP_TESTS_SH+= flock_test PLAIN_TESTS_C+= ftruncate_test PLAIN_TESTS_C+= newfileops_on_fork_test diff --git a/tests/sys/file/fcntlflags_test.c b/tests/sys/file/fcntlflags_test.c index c5026e38c48b..009bb87371a1 100644 --- a/tests/sys/file/fcntlflags_test.c +++ b/tests/sys/file/fcntlflags_test.c @@ -24,85 +24,83 @@ * SUCH DAMAGE. */ -#include - +#include #include #include #include +#include + /* * O_ACCMODE is currently defined incorrectly. This is what it should be. * Various code depends on the incorrect value. */ #define CORRECT_O_ACCMODE (O_ACCMODE | O_EXEC) -static int testnum; - static void -subtests(const char *path, int omode, const char *omodetext) +basic_tests(const char *path, int omode, const char *omodetext) { int fd, flags1, flags2, flags3; fd = open(path, omode); - if (fd == -1) - printf("not ok %d - open(\"%s\", %s) failed\n", - testnum++, path, omodetext); - else - printf("ok %d - open(\"%s\", %s) succeeded\n", - testnum++, path, omodetext); + ATF_REQUIRE_MSG(fd != -1, "open(\"%s\", %s) failed: %s", path, + omodetext, strerror(errno)); + flags1 = fcntl(fd, F_GETFL); - if (flags1 == -1) - printf("not ok %d - fcntl(F_GETFL) failed\n", testnum++); - else if ((flags1 & CORRECT_O_ACCMODE) == omode) - printf("ok %d - fcntl(F_GETFL) gave correct result\n", - testnum++); - else - printf("not ok %d - fcntl(F_GETFL) gave incorrect result " - "(%#x & %#x != %#x)\n", - testnum++, flags1, CORRECT_O_ACCMODE, omode); - if (fcntl(fd, F_SETFL, flags1) == -1) - printf("not ok %d - fcntl(F_SETFL) same flags failed\n", - testnum++); - else - printf("ok %d - fcntl(F_SETFL) same flags succeeded\n", - testnum++); + ATF_REQUIRE_MSG(flags1 != -1, "fcntl(F_GETFL) (1) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(omode, flags1 & CORRECT_O_ACCMODE); + ATF_REQUIRE((flags1 & O_NONBLOCK) == 0); + + ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, flags1) != -1, + "fcntl(F_SETFL) same flags failed: %s", strerror(errno)); + flags2 = fcntl(fd, F_GETFL); - if (flags2 == -1) - printf("not ok %d - fcntl(F_GETFL) failed\n", testnum++); - else if (flags2 == flags1) - printf("ok %d - fcntl(F_GETFL) gave same result\n", - testnum++); - else - printf("not ok %d - fcntl(F_SETFL) caused fcntl(F_GETFL) to " - "change from %#x to %#x\n", - testnum++, flags1, flags2); - if (fcntl(fd, F_SETFL, flags2 | O_NONBLOCK) == -1) - printf("not ok %d - fcntl(F_SETFL) O_NONBLOCK failed\n", - testnum++); - else - printf("ok %d - fcntl(F_SETFL) O_NONBLOCK succeeded\n", - testnum++); + ATF_REQUIRE_MSG(flags2 != -1, "fcntl(F_GETFL) (2) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(flags1, flags2); + + ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, flags2 | O_NONBLOCK) != -1, + "fcntl(F_SETFL) O_NONBLOCK failed: %s", strerror(errno)); + flags3 = fcntl(fd, F_GETFL); - if (flags3 == -1) - printf("not ok %d - fcntl(F_GETFL) failed\n", testnum++); - else if (flags3 == (flags2 | O_NONBLOCK)) - printf("ok %d - fcntl(F_GETFL) gave expected result\n", - testnum++); - else - printf("not ok %d - fcntl(F_SETFL) gave unexpected result " - "(%#x != %#x)\n", - testnum++, flags3, flags2 | O_NONBLOCK); + ATF_REQUIRE_MSG(flags3 != -1, "fcntl(F_GETFL) (3) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(flags2 | O_NONBLOCK, flags3); + (void)close(fd); } -int -main(int argc __unused, char **argv __unused) +ATF_TC_WITHOUT_HEAD(read_only_null); +ATF_TC_BODY(read_only_null, tc) +{ + basic_tests("/dev/null", O_RDONLY, "O_RDONLY"); +} + +ATF_TC_WITHOUT_HEAD(write_only_null); +ATF_TC_BODY(write_only_null, tc) +{ + basic_tests("/dev/null", O_WRONLY, "O_WRONLY"); +} + +ATF_TC_WITHOUT_HEAD(read_write_null); +ATF_TC_BODY(read_write_null, tc) { - printf("1..24\n"); - testnum = 1; - subtests("/dev/null", O_RDONLY, "O_RDONLY"); - subtests("/dev/null", O_WRONLY, "O_WRONLY"); - subtests("/dev/null", O_RDWR, "O_RDWR"); - subtests("/bin/sh", O_EXEC, "O_EXEC"); - return (0); + basic_tests("/dev/null", O_RDWR, "O_RDWR"); +} + +ATF_TC_WITHOUT_HEAD(exec_only_sh); +ATF_TC_BODY(exec_only_sh, tc) +{ + basic_tests("/bin/sh", O_EXEC, "O_EXEC"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, read_only_null); + ATF_TP_ADD_TC(tp, write_only_null); + ATF_TP_ADD_TC(tp, read_write_null); + ATF_TP_ADD_TC(tp, exec_only_sh); + + return (atf_no_error()); } From nobody Thu Dec 18 18:23:13 2025 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 4dXJv61gKYz6LTpk for ; Thu, 18 Dec 2025 18:23:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXJv604JDz47LP for ; Thu, 18 Dec 2025 18:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082194; 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=cZFQ87f8Fp2s/nKGNdSFWWwSRRBTLSA2Hv4TesMz2Q4=; b=CCZkHt9PaURFLVpeq3O7SYCNs0aRG7pxlTBqQeWru65mZRFY2S2CzVnXpK365VmQTBde55 4TrvrudA8HL0NdZUQxJ501UHkaabo32El+Lj382sdvCutK9UxGnmIPp6lDnGqF4BumBJJZ yNXH36xetj81ZZi3T+ULqyQ0NkguLCW6I2IO+BmBWceD/UwBqPTyGaFgWO5lQuK3WMK1yp Nn3ktzCmTg/RmmezDnDKZ7Jf11z2DurICSkO2+3R/Bdst3hhtj/OVtpkt+Zz6TpxmbTnYB zw/88AuWrliegISzZpLJL3yKV3a/doI9XObRiSm+b/NDkYBOf/gEUD1eQ1Avlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766082194; 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=cZFQ87f8Fp2s/nKGNdSFWWwSRRBTLSA2Hv4TesMz2Q4=; b=ya7o8I4wlw+6xoirKv7zSqwj7dLcVagksWZCJVj+JIz2/us+q0QfO8hPtWkIcR0XEVqBZ3 GQwXZmnUPKRTunqn0s/CClSsksgaC+I5SSoi7ryPQlM7hJXMUT+5ESO3GRe3jGLjjRMgda ywoVbi9n4po1DA6eztCYnkYfKcFmr/cXv8DwUzAn+IZ09kHBTx3w4HcA00n/zZJQOnPtg4 Ig51T1xhmezHh8LxoX8YR8RceLwVCGhodJoKjuo35SqGhCw6IIMJycDMIKgxBO7IOBTb+R U/wPavcywVO7dtT2arw9UHyeKPspWXb0HuKHwtkMHv8D+NX3NMdTzdBhtAZRiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766082194; a=rsa-sha256; cv=none; b=Y4C5WqDAeu/+LCYkgjiAfBIksY/F2qyIOPtWplXoSd1x6vatfxY4ErKRhX/vS84kmNSQkM JslvRNEiEUb2xSYSz6vcx2Vuz/R76QfwBfVlHgouArmkc/7Z0mfapJZnOxZGPJM01DloZE UWc3Z1vKq9cT0H7VNLoaTiyI3eCygEo2EweVV3bzeaNy2+qNY12tEHJfKwqWYrdUWNxwRX +YQ3nYe6+E9TsIbjUtmjfP/LaArWbJJWNC5INwKdoGm0tFM/xw4dv5O1HzafA5JgBiH5D3 kfivcI78IGc3m4JD3O3glsPDaNncLC5tSv+/MX0i9MlecealU5YBiTJFg+Ma7w== 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 4dXJv56SwWzq4p for ; Thu, 18 Dec 2025 18:23:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27566 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:23:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6acf7356d859 - stable/14 - filedesc: Close race between fcntl(F_SETFL) and ioctl(FIONBIO/FIOASYNC) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6acf7356d859a59f237f14bfb5a28ded63480a5f Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:23:13 +0000 Message-Id: <69444691.27566.7fc2b09b@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6acf7356d859a59f237f14bfb5a28ded63480a5f commit 6acf7356d859a59f237f14bfb5a28ded63480a5f Author: John Baldwin AuthorDate: 2025-10-03 16:43:30 +0000 Commit: John Baldwin CommitDate: 2025-12-18 17:01:56 +0000 filedesc: Close race between fcntl(F_SETFL) and ioctl(FIONBIO/FIOASYNC) - Use the recently-added fsetfl_lock/unlock API to synchronize direct FIONBIO and FIOASYNC ioctls with fcntl(F_SETFL). - While here, skip calling the underlying ioctl if the flag's current state matches the requested state. - Also while here, only update the flag state if the underlying ioctl succeeds. This fixes a bug where the flags represented the new state even if the underlying ioctl failed. A test is added for this last case that a failing FIOASYNC on /dev/null doesn't result in setting O_ASYNC in the file flags. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D52721 (cherry picked from commit dfd7d1610aeb654aafcaa8cf77b75fc5c7d60250) --- sys/kern/sys_generic.c | 36 +++++++++++++++++++++--------------- tests/sys/file/fcntlflags_test.c | 27 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 6a80ddbe86ed..6590b1ac9c59 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -728,7 +728,7 @@ kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data) { struct file *fp; struct filedesc *fdp; - int error, tmp, locked; + int error, f_flag, tmp, locked; AUDIT_ARG_FD(fd); AUDIT_ARG_CMD(com); @@ -781,30 +781,36 @@ kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data) goto out; } + f_flag = 0; switch (com) { case FIONCLEX: fdp->fd_ofiles[fd].fde_flags &= ~UF_EXCLOSE; - goto out; + break; case FIOCLEX: fdp->fd_ofiles[fd].fde_flags |= UF_EXCLOSE; - goto out; - case FIONBIO: - if ((tmp = *(int *)data)) - atomic_set_int(&fp->f_flag, FNONBLOCK); - else - atomic_clear_int(&fp->f_flag, FNONBLOCK); - data = (void *)&tmp; break; + case FIONBIO: case FIOASYNC: - if ((tmp = *(int *)data)) - atomic_set_int(&fp->f_flag, FASYNC); - else - atomic_clear_int(&fp->f_flag, FASYNC); - data = (void *)&tmp; + f_flag = com == FIONBIO ? FNONBLOCK : FASYNC; + tmp = *(int *)data; + fsetfl_lock(fp); + if (((fp->f_flag & f_flag) != 0) != (tmp != 0)) { + error = fo_ioctl(fp, com, (void *)&tmp, td->td_ucred, + td); + if (error == 0) { + if (tmp != 0) + atomic_set_int(&fp->f_flag, f_flag); + else + atomic_clear_int(&fp->f_flag, f_flag); + } + } + fsetfl_unlock(fp); + break; + default: + error = fo_ioctl(fp, com, data, td->td_ucred, td); break; } - error = fo_ioctl(fp, com, data, td->td_ucred, td); out: switch (locked) { case LA_XLOCKED: diff --git a/tests/sys/file/fcntlflags_test.c b/tests/sys/file/fcntlflags_test.c index 009bb87371a1..15a18c113c4a 100644 --- a/tests/sys/file/fcntlflags_test.c +++ b/tests/sys/file/fcntlflags_test.c @@ -24,6 +24,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -95,12 +96,38 @@ ATF_TC_BODY(exec_only_sh, tc) basic_tests("/bin/sh", O_EXEC, "O_EXEC"); } +ATF_TC_WITHOUT_HEAD(fioasync_dev_null); +ATF_TC_BODY(fioasync_dev_null, tc) +{ + int fd, flags1, flags2, val; + + fd = open("/dev/null", O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open(\"/dev/null\") failed: %s", + strerror(errno)); + + flags1 = fcntl(fd, F_GETFL); + ATF_REQUIRE_MSG(flags1 != -1, "fcntl(F_GETFL) (1) failed: %s", + strerror(errno)); + ATF_REQUIRE((flags1 & O_ASYNC) == 0); + + val = 1; + ATF_REQUIRE_ERRNO(EINVAL, ioctl(fd, FIOASYNC, &val) == -1); + + flags2 = fcntl(fd, F_GETFL); + ATF_REQUIRE_MSG(flags2 != -1, "fcntl(F_GETFL) (2) failed: %s", + strerror(errno)); + ATF_REQUIRE_INTEQ(flags1, flags2); + + (void)close(fd); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, read_only_null); ATF_TP_ADD_TC(tp, write_only_null); ATF_TP_ADD_TC(tp, read_write_null); ATF_TP_ADD_TC(tp, exec_only_sh); + ATF_TP_ADD_TC(tp, fioasync_dev_null); return (atf_no_error()); } From nobody Thu Dec 18 18:40:48 2025 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 4dXKHN4Z8Hz6LWZF for ; Thu, 18 Dec 2025 18:40:48 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXKHN3sB7z4D4m for ; Thu, 18 Dec 2025 18:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083248; 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=nLhtg46MXYyIPR9Zt09uCzLwvtp077YDxpXM6CmeXyk=; b=YyiwA/YxBxw/ZBxUD62JfSuUT/eyXjI+u7jPX2gtLejx4k1XhJOtjggh1gFRYxR+Lf/lbk 1iFu/I/i329ViKW/26/0YIV3LV/8chKDZZUJ8rFVC6+kOsdNw3PeT1sZ66jNI5o/bJ50J9 wKWNTkqMhGrZ8d2j4KDq6OzROmOG5KjyItagqohTnpCRShxGvM2EIXYfndspPaJd/w1sqs tDbnXPodbhctPqHTO9Hu10GuKs2zSgAv37wbhm00e+Hc18zTi9L9KJ5d9NgrqhrjKogNVu AsyLCYAHI7ddcr1KZuNDYBx10OFzRYnDks+fSOzsB6EHaZe71dEyWiqULfJTIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083248; 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=nLhtg46MXYyIPR9Zt09uCzLwvtp077YDxpXM6CmeXyk=; b=NCLi5SaIOU8J7+gIih/Ovs/fnfdLLv9sZOXeKPpHeyTbrFBhRakqE0fO57CWA0RBPvkgwJ iM4UhYzq7Ac9sHQHO0DekuCUo+ey0iR0PEQ1vIwFZIC1+7NLNNo8BPrsyQnSunFRElIIsW QQ3mFA/Sp+2GarjBPbZMa5XxTBEsf4lQM2LU28EHoT7denKPHmnD3D+KSQu5W0L2IDQaZ7 ZZK13bdzl/53dxPXrgWs0WqH6QSud7z0gP/iIXL5L/sNq+zvAWBPM9I0fn8Ywefj8kXVIz HkwCANBUf16iySCncTYSieb3TDZxdmQIhJEI9jL1dFcLifMUaQrKaoB8xdOyig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766083248; a=rsa-sha256; cv=none; b=Ne/nYJVjsvGcCxLtWQMkAmWIwVOWk37C4W1WqPNw04TEEL4OUtjoft5sLxElDP1JQADZSA Jc7yxe1tkVcm1dxv1X0kFolr+eAo9/GvoGWRWNBoRYSb44ycHZ5sGOJw1EnOWPPSkggJrJ 4qeIVyO0WPtvfNM0HPQWPINkQJALO5ro355u61gdJcLu42MHXV1JsIv2wMN57nxmaHLbun 9sAN8zNFxDMbCCibGD1hgpaIfloMIUn1dqkR5SEhlAOY/v1FZWjbffOLR4ruiGrBwWiRMj OwCIO60gR8svQkgYsnwEH5QJhwxK8dQwAV4L3llKQ7QylyhWjyTFPXf+HEmg1A== 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 4dXKHN39NzzqKl for ; Thu, 18 Dec 2025 18:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 319b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:40:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 186154414173 - stable/15 - aarch64: Clarify the initial adjustments to sp for kernel exception entry 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 186154414173eac06a2bbde4628cdecda520f22c Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:40:48 +0000 Message-Id: <69444ab0.319b6.674101ec@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=186154414173eac06a2bbde4628cdecda520f22c commit 186154414173eac06a2bbde4628cdecda520f22c Author: John Baldwin AuthorDate: 2025-09-16 11:21:39 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:24:15 +0000 aarch64: Clarify the initial adjustments to sp for kernel exception entry The first store-pair instruction in save_registers_head decrements the stack pointer to create room for most of the trapframe (and the redzone area for nested exceptions). However, the expression was a bit non-intuitive as it was using an expression without a leading negative sign to adjust the stack pointer. Rewrite the expression so that it is more clearly a negative adjustment to the stack pointer. Suggested by: andrew Reviewed by: andrew Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D52514 (cherry picked from commit 7314f78b240bdbf2bcec07e3d5a475e37941bb6b) --- sys/arm64/arm64/exception.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 13095def8b00..6e673fbe5a43 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -43,9 +43,9 @@ .macro save_registers_head el .if \el == 1 mov x18, sp - stp x0, x1, [sp, #(TF_X - TF_SIZE - 128)]! + stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]! .else - stp x0, x1, [sp, #(TF_X - TF_SIZE)]! + stp x0, x1, [sp, #-(TF_SIZE - TF_X)]! .endif stp x2, x3, [sp, #(2 * 8)] stp x4, x5, [sp, #(4 * 8)] From nobody Thu Dec 18 18:40:49 2025 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 4dXKHQ1dvbz6LWQy for ; Thu, 18 Dec 2025 18:40:50 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXKHP4TLSz4D4t for ; Thu, 18 Dec 2025 18:40:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ige3nabGnVn0afrftkKgOZ3VjnBJW5PZh4Lbq0/z9J4=; b=lNtlbiw3DOU7VC7N7ZWPbwSvfytfYL3XA1wpExLydK1tR+WeaOrB+nZuHI3BRDianIKhus O5j3IUV2Ev0S9tnBa13nFW3bzHME9O9jG7xZKr2tyNPk5S89kS5M8Bmu0pdygjv7oSxbLC pF/YwqxaXn9FEjMUFtv6mihLhpB3uvaHoh73XoVkNTUSzWLU0ihoXx7Vx7Nu3a6LlsidgL 7u2NNlZ1K6jUQ2ZANayzXjhXrBFnZUHy6x+dDoaCX8SLlG2bhATMNTVqS6jOviVZi2+uRd N0Kpk8l2IbeEBmW3f++RLu8jdoG6zqB3CQc5i5zYKf9QV+ZvX91nuaukd52UAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ige3nabGnVn0afrftkKgOZ3VjnBJW5PZh4Lbq0/z9J4=; b=dw51BirrL8GU55TQMopa0/zDiKLZc621n4XxqVBKe7w2BRDmpqX3AOYl13VpBl+4MTMWGG mr6GJdKC/AuzrPwFZNMy9fZeADkWhycbO1oPFObNUGm4Q+FkAUPpcbKCK+MlpFK3DCoDcg udE8JvHWUj45ygQSZACu+IqPCowKDDgheV8Q5VBZ6Y77d9bAKA1h9e8KKuvRDEH5KJwSOc klbPUEwbWsZ/ce8z7vMhG4oowq3PHcKyNtHtf/8hjcZOxmaFMmJPyaG+znXzHnqAZ8iFAU WnAmkkaMxR6SdsmVK6eNHNXZ/iYLBzHqUHdvIdkydVyQyVV5SKy6/+gHExndkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766083249; a=rsa-sha256; cv=none; b=WVyQlVWBVtGyFr4TrCAyNk88Bvr8+hysqPgXP3+n4nW9rmN9S8M18IBsEOdUb+U/jdqNCS BhGf1D2YzVIQVyYIZrragsnUGPhJru7kIY13eoWDRrkAJd9kbEPai9pg2CaxHxUXkZtbGI rF8Ti/v6oUfV6k9ebserSuckFgC4ButIXs/f3oyRB2J1Sz0Aoz/DY9iEWIfFCUh5mHVJ+H pZAtnL9NptynDbtSyF8cPaN2bORtMBLzG+hv5nB0WPBGAypI6LB7oySsMGUgZGY3Ss5arg Yg8Ptwl8nfzvPjUjU2J2ZNXq3pvl0mHv410XOUS1TzJAiqyK81x2LBHemdfQQA== 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 4dXKHP3mY2zqqV for ; Thu, 18 Dec 2025 18:40:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27c63 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:40:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konrad Witaszczyk From: John Baldwin Subject: git: 051540a092d1 - stable/15 - aarch64: Save correct value of x18 on trapframe for nested faults 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 051540a092d14c4d71410d137780b48db34dda93 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:40:49 +0000 Message-Id: <69444ab1.27c63.3d6c5324@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=051540a092d14c4d71410d137780b48db34dda93 commit 051540a092d14c4d71410d137780b48db34dda93 Author: Konrad Witaszczyk AuthorDate: 2025-09-16 11:21:57 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:24:44 +0000 aarch64: Save correct value of x18 on trapframe for nested faults x18 is overwritten with a temporary copy of the kernel stack pointer when it is saved in the trapframe. This does not matter in terms of function since nested exception return does not restore x18 from the trapframe, but it does mean that examining x18 in a debugger in stack frames above a nested fault outputs the wrong register value. To fix, compute the value of the original stack pointer to save in x18 later after the trapframe has been constructed. Reviewed by: jhb, andrew Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D52472 (cherry picked from commit 99213b3c352cdf568ea7cf5b4dddb1879f16a601) --- sys/arm64/arm64/exception.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 6e673fbe5a43..5a4181348a54 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -42,7 +42,6 @@ */ .macro save_registers_head el .if \el == 1 - mov x18, sp stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]! .else stp x0, x1, [sp, #-(TF_SIZE - TF_X)]! @@ -61,7 +60,9 @@ stp x24, x25, [sp, #(24 * 8)] stp x26, x27, [sp, #(26 * 8)] stp x28, x29, [sp, #(28 * 8)] -.if \el == 0 +.if \el == 1 + add x18, sp, #(TF_SIZE - TF_X + 128) +.else mrs x18, sp_el0 .endif mrs x10, elr_el1 From nobody Thu Dec 18 18:40:57 2025 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 4dXKHZ04jQz6LWZM for ; Thu, 18 Dec 2025 18:40:58 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXKHY6235z4D1t for ; Thu, 18 Dec 2025 18:40:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083257; 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=hNebrL/wJrFhf15lPkaTvvdpY49eLfYIJuVwLxLtz5s=; b=RtLjbuoCAwnBLdWfUHNItKucrvmXUiHMYPdcY19Up3ABeDgwNT5nQ32ir9vPytgNdLbIlI E7gGjs7RfTLVpC9k4jYYpge8lWIZYHssfq2u4mVQ3a/UZJISiydgeSEb2ph/IknUVn6HNd ncnpaUoixbFX5CbVj1cwvNJaraKOWMmX6z1gfcoXx9PIIQhcHM9cRGYBabs1mh9sspVhcp hjErXsMvo/7pSF/TxEktANRFQUKDydsvk+Jty0S3MyI6wBE1//93Uw4+cr6l7DVnBGZMVe cUKugGZTLNN2/uUoaixvjGA6YVInvGEsooaEGIK7kJXz2F6+AQ83EU5axwBf2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083257; 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=hNebrL/wJrFhf15lPkaTvvdpY49eLfYIJuVwLxLtz5s=; b=IeshEkO5DaaRtyJd5QhquqPGm9H0r9pLN6fU/Xh4DcnpX474kDr1FiWDrpZKs4zofGfBqh cMRXVmt/2AdEC+kVt6I7VbZSp6l3s8f2p4D3/E8Q7pZ0GqeJM0C2wP7rmprq8u7JhLrn/E xpGMCuiq+GPzlCAVymVkZun6eeFPREZY8bOPtbQyqpTnSWlgKZ+CssEfrZAPuk3m+jlOyO eGOGHrlF1uN4BiHehpshqefzxNy2TxcmnLYj/CXJcgSgexHKnEbdcDBvmcdUIkugODFfHF DEzWWPhniYZIBKRyQ4RjrMFW+Jn4GDmUwRrN0S3sVfTZrrqu3n+MOGPRRlaKjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766083257; a=rsa-sha256; cv=none; b=aMe4GTrldwyCT2ZcL+Lo4wFGX5JT+n8cW9yRKsCpL0mIVmgSm/f9IyGxUbWarKMxHKC/MH DpD9on0cEoZhRH0H/Vx0aXKKCeovm9xktMtJEWu5C+9WHEw2mtuVstO/5WGF5j85eciOSU 76jn3pySTJRHJxxWfgp/89+GzRpHp7OoL2aR5JPjZJp7UUuqVZe6/OG6KrL9ghltdc0QMe QJZG5FR7Ilf1nmiAfJldqrs624ps+U58JT2F/KFMklruygDdSSFASOthS156tCXjHIpSgO 7JdFXWdp78wk1UUBgxLY5cDCxcEiez+qw5CUEDicW3FBy0cKA0hgR2cyo3GWVQ== 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 4dXKHY5ZH5zqhX for ; Thu, 18 Dec 2025 18:40:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31a79 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:40:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c9be34e2e6af - stable/14 - aarch64: Clarify the initial adjustments to sp for kernel exception entry 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c9be34e2e6af8ba22124b4c4229adb5db3006eda Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:40:57 +0000 Message-Id: <69444ab9.31a79.bd3ab2@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c9be34e2e6af8ba22124b4c4229adb5db3006eda commit c9be34e2e6af8ba22124b4c4229adb5db3006eda Author: John Baldwin AuthorDate: 2025-09-16 11:21:39 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:24:20 +0000 aarch64: Clarify the initial adjustments to sp for kernel exception entry The first store-pair instruction in save_registers_head decrements the stack pointer to create room for most of the trapframe (and the redzone area for nested exceptions). However, the expression was a bit non-intuitive as it was using an expression without a leading negative sign to adjust the stack pointer. Rewrite the expression so that it is more clearly a negative adjustment to the stack pointer. Suggested by: andrew Reviewed by: andrew Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D52514 (cherry picked from commit 7314f78b240bdbf2bcec07e3d5a475e37941bb6b) --- sys/arm64/arm64/exception.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 0df440863632..0457efe77ba8 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -39,9 +39,9 @@ .macro save_registers_head el .if \el == 1 mov x18, sp - stp x0, x1, [sp, #(TF_X - TF_SIZE - 128)]! + stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]! .else - stp x0, x1, [sp, #(TF_X - TF_SIZE)]! + stp x0, x1, [sp, #-(TF_SIZE - TF_X)]! .endif stp x2, x3, [sp, #(2 * 8)] stp x4, x5, [sp, #(4 * 8)] From nobody Thu Dec 18 18:40:58 2025 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 4dXKHb1DzWz6LWdn for ; Thu, 18 Dec 2025 18:40:59 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXKHZ6TWJz4DC4 for ; Thu, 18 Dec 2025 18:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nXdmyZZsmKdDMf6466HxT2NRitdGizlARlQzYDS9d5U=; b=GH/W1wTNsQd3xbShaQsCfNduw+/NjzZdLRTt0lCY+7+NGm0Yzr7Utcg0GCf4ZoiDaQGkyR yx17Iz5lJBlgTr0u9kjxssi5w1GMnkCLZEF6nMl0SSM+yoaBg2YaI7muMUYcculz/GYM2+ HPwPc/TGndxeeovuPqW4Eg8GoOeY0QbMh7kWqWDw3NJak60VrSm+wTehjgrrM1CijKB8yE mqmnIzTPDSibAcQi8KIu+Qlq0KS6yt2K2mJ7OSpui+Dt58OGQv3LymkKxNSTTEMIdqwrmR vkYpXHmRoBrmWRnhqg64wRLUw5ZtvWv3IyD30tzZ/UpKKUJ/3lI5FuQnUEydjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766083258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nXdmyZZsmKdDMf6466HxT2NRitdGizlARlQzYDS9d5U=; b=GLnYUX/7Oj4lt6clzyNqhg2RGo4huOi/YYax106f1ywh3bmckfLOMUD3Ed9llcS8KXwNrY kWvN6XozcbNm3FjmTv+oQS6l5GnDs9xPT/3rK/g2vs283YlRBX+5fEZwcxDt71yWhSVLHH CFOBFZSCg+uLtb80coPTo3n+Hn0fELc+gmpmjcdV0CIA3CC+a929HObCart0HVBwG0lrLL i+qdU5RLqqDBQ0bOrv6m9gxxX9Z8lx4BIr4ZWi/362i8TxKr4mirbkcDY51t74aIF2GP+3 osZu9tof4lU8oL8Xiylle/tUm8sTLv8zQxuv3W4+l7bwfD/e1i4FdWYsp0j7NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766083258; a=rsa-sha256; cv=none; b=yei+eh8MTmDqrXYKUO430xwG6C5Aa2kJrUUI6SdbhMhn1qJTWs9x4ohvbDPJIM3jb/0kTS +bTeqc/UCV9hqMvBLE220l7MgKPUT++0Gkrg8MCr8OPP2UeyMKxJDV60N8jAZdme68y6G8 uZ8F4hKT5zVaQ91M8wD/HPSAqOtVMPxv211KkN6vMla4tvaNtqujPPaxg0GjVYeT+ztuRF a1cjehfBl3B2fkJeduDbLLYRD+38ISi/G4/TCps/f0mhAmc8FbNybPbR98VbC1dwfBdzJY VnHuntN4CNIx0YNzm2Xu7GjHGu8kV0iHmTR0D0DEfMF0frM4qHUDZxqqHuI1MA== 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 4dXKHZ61vSzqkg for ; Thu, 18 Dec 2025 18:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31bd2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 18:40:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konrad Witaszczyk From: John Baldwin Subject: git: d866f1d4f968 - stable/14 - aarch64: Save correct value of x18 on trapframe for nested faults 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d866f1d4f968f8ead4765944d82f4af640815678 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 18:40:58 +0000 Message-Id: <69444aba.31bd2.4e6e954d@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d866f1d4f968f8ead4765944d82f4af640815678 commit d866f1d4f968f8ead4765944d82f4af640815678 Author: Konrad Witaszczyk AuthorDate: 2025-09-16 11:21:57 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:25:14 +0000 aarch64: Save correct value of x18 on trapframe for nested faults x18 is overwritten with a temporary copy of the kernel stack pointer when it is saved in the trapframe. This does not matter in terms of function since nested exception return does not restore x18 from the trapframe, but it does mean that examining x18 in a debugger in stack frames above a nested fault outputs the wrong register value. To fix, compute the value of the original stack pointer to save in x18 later after the trapframe has been constructed. Reviewed by: jhb, andrew Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D52472 (cherry picked from commit 99213b3c352cdf568ea7cf5b4dddb1879f16a601) --- sys/arm64/arm64/exception.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 0457efe77ba8..07223fcb069d 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -38,7 +38,6 @@ */ .macro save_registers_head el .if \el == 1 - mov x18, sp stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]! .else stp x0, x1, [sp, #-(TF_SIZE - TF_X)]! @@ -57,7 +56,9 @@ stp x24, x25, [sp, #(24 * 8)] stp x26, x27, [sp, #(26 * 8)] stp x28, x29, [sp, #(28 * 8)] -.if \el == 0 +.if \el == 1 + add x18, sp, #(TF_SIZE - TF_X + 128) +.else mrs x18, sp_el0 .endif mrs x10, elr_el1 From nobody Thu Dec 18 19:13:39 2025 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 4dXL1H4dtYz6LZ82 for ; Thu, 18 Dec 2025 19:13:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1H3stzz4LSb for ; Thu, 18 Dec 2025 19:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmexfNMUxa20iIr4lyG/QsrzRBv7eAldbc1LbcwzTAo=; b=Jr0CIHvwz3aZ9eK7F0AoeqGBhc6DVOEuE0d8GCIKbleQvAI8ZbbgOJsrXz403vlhYM7n8I j/ddsNDz7MIm3fXRpZkARRLPewr1+GlcmYQtr2jhHBENeCP41gf1ENNuj+T9kO5fIi6WDz UL9XORIIfQY+ObvrN/TqzEBRsN5vpQ4VKSeUk0mUna9bKi0bImkuXFFRe4ygprgz2t80RP 6IoT3h/F6YQNZJ5NX8n47JdrpXKx3EH0KogwM6GCFePFpgLioAevxwFQJ8tSlEOpDxf+Lx PPeCAZoup4w54i7nrMSJGxyhhy1Rt43kMlKId0JmdeUcEeCFEdGJZS0+4AZ/Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmexfNMUxa20iIr4lyG/QsrzRBv7eAldbc1LbcwzTAo=; b=SwhDSgspvLOCOQzypWQsKOlzA981RFIlx5aF7M97ew6ZyTFPZbLeHYVkLsmvUyRk4JoxA3 KdTS7XD63TXx4HKlWI2UD/zQCtrizy6fTybSC0pdYDmCvIATYL+ZFUnjB3AlrCX7etIfsy 7f2gR+ECTFPiea3Tg18eOiWqTn1PCLS0GX9kG5A9eK+BmJUcUhG7I5PsLbq60WLGxMqpO7 pNHB+GHp9KcSJ1Cvw/jN9eBWrTBQaSO6j1awaYem6sM0juTTNv80jqJ0ypGhoJcAZHZU6V c/fcBGN7FanksdYIVgyCyAtkv7yBxOQ/AzwAe70Q9CmZpbDqp4CWn3zm9SIofA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085219; a=rsa-sha256; cv=none; b=s8V9qLxymZwyTn4LhOnpXkWnj/5yFUgV+ErF4T4tJ8hxvIGog7UnYOcLq2+L/HEYXkeb9I kFlT3GZUjvMY4+A5urQLrlobjlaFdQNQo299O5nTDG8L6KsW+zjB0CQEa5yScmhNL6oOAT RhcLt+qXDFVI2hcwNjnAde907EzNookG9rfwGyAPEvomgaj8TGkHSUxd+jkfVGDTq3RRkq RnOJt5+OGCnJR0Du2oD2HtSbISUvto8N7VVLwRdKo5TwD21IgwXuMPAEhuEzAcVeDxXH1h 6y1NP5jm/OL06pjfv2RD1f18Nm2lbdpVk5lyWRiR4aCN/DwR5Bne/4j9i4y/Jg== 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 4dXL1H3JnTzrXD for ; Thu, 18 Dec 2025 19:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 336bf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Jason W. Bacon From: John Baldwin Subject: git: 1a9ecead726a - stable/15 - getconf: Report value of _SC_PHYS_PAGES 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1a9ecead726a73817b3cd641cbdc03c9bb0abbd8 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:39 +0000 Message-Id: <69445263.336bf.6d3b022@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1a9ecead726a73817b3cd641cbdc03c9bb0abbd8 commit 1a9ecead726a73817b3cd641cbdc03c9bb0abbd8 Author: Jason W. Bacon AuthorDate: 2025-10-03 20:43:47 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:41:18 +0000 getconf: Report value of _SC_PHYS_PAGES PR: 289717 Reviewed by: jhb (cherry picked from commit aa9e4fe3c9021d623743e26aef879a0036f87c0f) --- usr.bin/getconf/sysconf.gperf | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/getconf/sysconf.gperf b/usr.bin/getconf/sysconf.gperf index baf341c8962b..2bd75dd47851 100644 --- a/usr.bin/getconf/sysconf.gperf +++ b/usr.bin/getconf/sysconf.gperf @@ -47,6 +47,7 @@ OPEN_MAX, _SC_OPEN_MAX PAGESIZE, _SC_PAGESIZE PAGE_SIZE, _SC_PAGESIZE PASS_MAX, _SC_PASS_MAX +PHYS_PAGES, _SC_PHYS_PAGES PTHREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_DESTRUCTOR_ITERATIONS PTHREAD_KEYS_MAX, _SC_THREAD_KEYS_MAX PTHREAD_STACK_MIN, _SC_THREAD_STACK_MIN From nobody Thu Dec 18 19:13:40 2025 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 4dXL1K0GFNz6LZQt for ; Thu, 18 Dec 2025 19:13:41 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1J4HyGz4LJt for ; Thu, 18 Dec 2025 19:13:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085220; 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=RKwvh8G/pW86BSnIrof0dN2m+4o8b4COXDx4M1rsqys=; b=yl5GYja1nCpOrHmUdRE0NjjsAwWuL/QHyoY9lCzgvBVHl+QDk/oxy01x6nX8JvxTYBb2xT tjySww+9WZUlobxfg0Oni3YEBHv04hJjrcqdhZDFJAgrABGRVfCHFvsN2lHVRrvsOmPpek SWGFx4e4qfCtR69UTrQubd0CijbN1fd1ewAfkmNPw8+60tnk8HmH5vocIJdn12HNziIuGA 37Q8fLGrLjAuPVj41PE0z2aSCTDLicXPUkk1DXZ9LjDkAw/ze3+KkpMBxVtefbc8hJT4oo MIgOAmwsGmj1hpW4fxtX0wUSljTUmEtxkdNm/wJFx1LEWk/7bNIV5zUQ6nE/cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085220; 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=RKwvh8G/pW86BSnIrof0dN2m+4o8b4COXDx4M1rsqys=; b=KuLQCv3YK90LheKLD9CaLI17U+es7O5gGq/oKt7ctw1DKS1bri30mLVfVvwWKfsyEDT7K1 sSIcULJDvplSq/T/WhTVzzVvRYECMICI51Gd9gwwljt1qu+m8CIqy+x3qr1WhX8WUAnlYE UZsvKdLJSuMizE5+KrehAHyH3T9OnxsxGyl5wdFYAWK4qIiY7T37DYcKB8HCZ7AXdYa5zt m5FtuTQUFA6Xa+PObZtZFU7ZoC68NP35gqv43x1zxgedYWkyms4+CRchQ3DmluKmbPiwmZ osYJ6GhU5It2S/8FUQeaNW69Dh7bvowwNpfTOSgIp7ZYgQSgoHvnm78+3gGcqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085220; a=rsa-sha256; cv=none; b=gdW49EXTMgK3sv1t+B30Uea6thfNC5AKIrAxGbNyY0d+oNF7TnBCGa5fNKiT8HtaC/i/Go TeSlXNMOqFHPc8qkfBN5VTzHkCZRaNrMP9CxcD/+WWLV1NXag/qeZij7xdAiFpQLEuSxUL BzmNOwp4tpOZBLMWufxoBPx/DUXla96mGDYGGSu25XMgSiggKt8BloMDarKLzciLybk+Pn zsTYR/5JB0xUjcjljbqQd2js1zXJtuUTOffodwS9FJ9jck3BWqGmUnF2lvC4+V8ga/WSPd 3t2a80aE7zv/KEpb8Q8ET0Fym9CAHVyTyJLDuAX5sWyuLfxbEnc0GDJtTVGUxw== 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 4dXL1J3hNlzrLw for ; Thu, 18 Dec 2025 19:13:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33453 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 198cd4912f30 - stable/15 - ctld: Defer initialization of NVMeoF associations 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 198cd4912f304a5074d018c34a919dd2d5068abc Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:40 +0000 Message-Id: <69445264.33453.39d60e32@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=198cd4912f304a5074d018c34a919dd2d5068abc commit 198cd4912f304a5074d018c34a919dd2d5068abc Author: John Baldwin AuthorDate: 2025-10-09 19:24:27 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:41:50 +0000 ctld: Defer initialization of NVMeoF associations Wait until all of the configuration has been parsed before creating associations for NVMe portals. This ensures that any options specified in a transport group are honored when creating associations. To enable this, add a new virtual method portal::prepare invoked when applying a configuration prior to opening a socket (or reusing an existing socket) for a portal. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D52844 (cherry picked from commit 1435a9b293e21f8fca1f654420c5075ea7434e8f) --- usr.sbin/ctld/ctld.cc | 5 ++++ usr.sbin/ctld/ctld.hh | 1 + usr.sbin/ctld/nvmf.cc | 77 +++++++++++++++++++++++---------------------------- usr.sbin/ctld/nvmf.hh | 16 ++++------- 4 files changed, 46 insertions(+), 53 deletions(-) diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc index 10c12f25068e..331c029e282e 100644 --- a/usr.sbin/ctld/ctld.cc +++ b/usr.sbin/ctld/ctld.cc @@ -814,6 +814,11 @@ portal_group::open_sockets(struct conf &oldconf) } for (portal_up &portal : pg_portals) { + if (!portal->prepare()) { + cumulated_error++; + continue; + } + /* * Try to find already open portal and reuse the * listening socket. We don't care about what portal diff --git a/usr.sbin/ctld/ctld.hh b/usr.sbin/ctld/ctld.hh index cc88e6eb590e..3bf18f6a32c0 100644 --- a/usr.sbin/ctld/ctld.hh +++ b/usr.sbin/ctld/ctld.hh @@ -151,6 +151,7 @@ struct portal { p_protocol(protocol) {} virtual ~portal() = default; + virtual bool prepare() { return true; } bool reuse_socket(portal &oldp); bool init_socket(); virtual bool init_socket_options(int s __unused) { return true; } diff --git a/usr.sbin/ctld/nvmf.cc b/usr.sbin/ctld/nvmf.cc index d1240bfa4f6c..eb116903f5c1 100644 --- a/usr.sbin/ctld/nvmf.cc +++ b/usr.sbin/ctld/nvmf.cc @@ -34,11 +34,8 @@ struct nvmf_io_portal final : public nvmf_portal { nvmf_io_portal(struct portal_group *pg, const char *listen, - portal_protocol protocol, freebsd::addrinfo_up ai, - const struct nvmf_association_params &aparams, - nvmf_association_up na) : - nvmf_portal(pg, listen, protocol, std::move(ai), aparams, - std::move(na)) {} + portal_protocol protocol, freebsd::addrinfo_up ai) : + nvmf_portal(pg, listen, protocol, std::move(ai)) {} void handle_connection(freebsd::fd_up fd, const char *host, const struct sockaddr *client_sa) override; @@ -63,8 +60,6 @@ struct nvmf_transport_group final : public portal_group { override; private: - struct nvmf_association_params init_aparams(portal_protocol protocol); - static uint16_t last_port_id; }; @@ -143,48 +138,55 @@ parse_number(const nvlist_t *nvl, const char *key, uint64_t def, uint64_t minv, return def; } -struct nvmf_association_params -nvmf_transport_group::init_aparams(portal_protocol protocol) +bool +nvmf_portal::prepare() { - struct nvmf_association_params params; - memset(¶ms, 0, sizeof(params)); + memset(&p_aparams, 0, sizeof(p_aparams)); /* Options shared between discovery and I/O associations. */ - const nvlist_t *nvl = pg_options.get(); - params.tcp.header_digests = parse_bool(nvl, "HDGST", false); - params.tcp.data_digests = parse_bool(nvl, "DDGST", false); - uint64_t value = parse_number(nvl, "MAXH2CDATA", DEFAULT_MAXH2CDATA, - 4096, UINT32_MAX); + freebsd::nvlist_up nvl = portal_group()->options(); + p_aparams.tcp.header_digests = parse_bool(nvl.get(), "HDGST", false); + p_aparams.tcp.data_digests = parse_bool(nvl.get(), "DDGST", false); + uint64_t value = parse_number(nvl.get(), "MAXH2CDATA", + DEFAULT_MAXH2CDATA, 4096, UINT32_MAX); if (value % 4 != 0) { log_warnx("Invalid value \"%ju\" for option MAXH2CDATA", (uintmax_t)value); value = DEFAULT_MAXH2CDATA; } - params.tcp.maxh2cdata = value; + p_aparams.tcp.maxh2cdata = value; - switch (protocol) { + switch (protocol()) { case portal_protocol::NVME_TCP: - params.sq_flow_control = parse_bool(nvl, "SQFC", false); - params.dynamic_controller_model = true; - params.max_admin_qsize = parse_number(nvl, "max_admin_qsize", - NVME_MAX_ADMIN_ENTRIES, NVME_MIN_ADMIN_ENTRIES, - NVME_MAX_ADMIN_ENTRIES); - params.max_io_qsize = parse_number(nvl, "max_io_qsize", + p_aparams.sq_flow_control = parse_bool(nvl.get(), "SQFC", + false); + p_aparams.dynamic_controller_model = true; + p_aparams.max_admin_qsize = parse_number(nvl.get(), + "max_admin_qsize", NVME_MAX_ADMIN_ENTRIES, + NVME_MIN_ADMIN_ENTRIES, NVME_MAX_ADMIN_ENTRIES); + p_aparams.max_io_qsize = parse_number(nvl.get(), "max_io_qsize", NVME_MAX_IO_ENTRIES, NVME_MIN_IO_ENTRIES, NVME_MAX_IO_ENTRIES); - params.tcp.pda = 0; + p_aparams.tcp.pda = 0; break; case portal_protocol::NVME_DISCOVERY_TCP: - params.sq_flow_control = false; - params.dynamic_controller_model = true; - params.max_admin_qsize = NVME_MAX_ADMIN_ENTRIES; - params.tcp.pda = 0; + p_aparams.sq_flow_control = false; + p_aparams.dynamic_controller_model = true; + p_aparams.max_admin_qsize = NVME_MAX_ADMIN_ENTRIES; + p_aparams.tcp.pda = 0; break; default: __assert_unreachable(); } - return params; + p_association.reset(nvmf_allocate_association(NVMF_TRTYPE_TCP, true, + &p_aparams)); + if (!p_association) { + log_warn("Failed to create NVMe controller association"); + return false; + } + + return true; } portal_group_up @@ -209,15 +211,12 @@ bool nvmf_transport_group::add_portal(const char *value, portal_protocol protocol) { freebsd::addrinfo_up ai; - enum nvmf_trtype trtype; switch (protocol) { case portal_protocol::NVME_TCP: - trtype = NVMF_TRTYPE_TCP; ai = parse_addr_port(value, "4420"); break; case portal_protocol::NVME_DISCOVERY_TCP: - trtype = NVMF_TRTYPE_TCP; ai = parse_addr_port(value, "8009"); break; default: @@ -230,14 +229,6 @@ nvmf_transport_group::add_portal(const char *value, portal_protocol protocol) return false; } - struct nvmf_association_params aparams = init_aparams(protocol); - nvmf_association_up association(nvmf_allocate_association(trtype, true, - &aparams)); - if (!association) { - log_warn("Failed to create NVMe controller association"); - return false; - } - /* * XXX: getaddrinfo(3) may return multiple addresses; we should turn * those into multiple portals. @@ -246,10 +237,10 @@ nvmf_transport_group::add_portal(const char *value, portal_protocol protocol) portal_up portal; if (protocol == portal_protocol::NVME_DISCOVERY_TCP) { portal = std::make_unique(this, value, - protocol, std::move(ai), aparams, std::move(association)); + protocol, std::move(ai)); } else { portal = std::make_unique(this, value, - protocol, std::move(ai), aparams, std::move(association)); + protocol, std::move(ai)); need_tcp_transport = true; } diff --git a/usr.sbin/ctld/nvmf.hh b/usr.sbin/ctld/nvmf.hh index 0b4f8d45adfd..6f34a2858ef9 100644 --- a/usr.sbin/ctld/nvmf.hh +++ b/usr.sbin/ctld/nvmf.hh @@ -38,13 +38,12 @@ using nvmf_qpair_up = std::unique_ptr; struct nvmf_portal : public portal { nvmf_portal(struct portal_group *pg, const char *listen, - portal_protocol protocol, freebsd::addrinfo_up ai, - const struct nvmf_association_params &aparams, - nvmf_association_up na) : - portal(pg, listen, protocol, std::move(ai)), - p_aparams(aparams), p_association(std::move(na)) {} + portal_protocol protocol, freebsd::addrinfo_up ai) : + portal(pg, listen, protocol, std::move(ai)) {} virtual ~nvmf_portal() override = default; + virtual bool prepare() override; + const struct nvmf_association_params *aparams() const { return &p_aparams; } @@ -58,11 +57,8 @@ private: struct nvmf_discovery_portal final : public nvmf_portal { nvmf_discovery_portal(struct portal_group *pg, const char *listen, - portal_protocol protocol, freebsd::addrinfo_up ai, - const struct nvmf_association_params &aparams, - nvmf_association_up na) : - nvmf_portal(pg, listen, protocol, std::move(ai), aparams, - std::move(na)) {} + portal_protocol protocol, freebsd::addrinfo_up ai) : + nvmf_portal(pg, listen, protocol, std::move(ai)) {} void handle_connection(freebsd::fd_up fd, const char *host, const struct sockaddr *client_sa) override; From nobody Thu Dec 18 19:13:41 2025 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 4dXL1K666pz6LZ3V for ; Thu, 18 Dec 2025 19:13:41 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1K4jfbz4LmL for ; Thu, 18 Dec 2025 19:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085221; 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=Oall6cUqPO8kwjI6BrZEo1ZB71Tw89ZDfWO2sQrJuc8=; b=icHQ7E4MsXaI1yhdJqgHUL9dZiuywarFZkzVJkZRVQTl4Y/svNmY2OVdWZ05DbQ59KQVaV a3/bFeEKpYMWk8jSNGPGHJZ8rEPgkFRfo6i3nOrZ/+c13Fw0olad5/AuEWb1MOUonKwTZB 9icHRhjwgZ1Uxpv2AFeW1zx4nc0oIAh5aomS5V8M3IlvfHHgN8OlXZaa8UiY7veoJZhwvo 1KS78gBHuEdXIEhyF1UWssInpVKGs8BRSnhcyG+MdVpv/tdxTfN5b5fo5SIDY5bhLz+TAF euyD+tkrbGFjUiunIVUQZEZyt3+8BqjJIlHQUSFHqcl9tvvMwwJ0qZppyEvXGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085221; 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=Oall6cUqPO8kwjI6BrZEo1ZB71Tw89ZDfWO2sQrJuc8=; b=RIMJMchsXSAqIu2axtRRcCbUYDJ7ISOYdkpvnmChyJjlyjQn6S4KMGL/ThOyeSzI+XJmRI /QOMubX3bFdKDc/cNhzj45Lp7HU+YbffxypyFgdusDubM33kfLePa4H75za39eeURMsZdk aKkpg+qxHxx+IXPwqa7CjcPlwfc03wIw+IvxhqqfAU7AxV7EYotaOw0K9KFV8LTjEvp9TY W4KMrinaFPlqEjRq/FNFLhTJK55o4raOKe2H+w14IYbQP/Z80kLmwXtLjqZOXgtFJ08Qd9 HGhNlhkGWKbdSiQmj5QJZ4od/Jhtndgv6ENr2n0mCgCxDYY0o17TeUNISwPfTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085221; a=rsa-sha256; cv=none; b=VIBxNcUpAHbPvGLM33cmeIsFL/DLsl7WEGUrvOs+yYcgDZzxEWiqpvT1SzDQqd0/t8ZlVQ P0dTDcwfQdOOCBOpyXhfqhofDHewDZXk7tqvsAjtxXr+IJ+zdwZSkaTIW9yUXTmvLYcPej 9g+ZdCL//pcaWtDcXGNiRvFMdACQlzdL3q47aJ1FEsPRFpr/4HvIFE6lCIFoKFfu/zbQck xGsbeALgK+0J2a8ysArVKdHmNTIhsuinDnHVMv2NQCmX0h4nNsuq20/2DTMub5nrx7XhTd 9CUxKz/Be0RaAUdxs+rfAV0gB3ktLx5skLd14FUjfF/Hc9DiMHvkUT+Al5DBIw== 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 4dXL1K4Fj1zr7F for ; Thu, 18 Dec 2025 19:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34323 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9207e31ba142 - stable/15 - closefrom_test: Fix the first test 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9207e31ba1426a4263322951c3e9a949aee4667a Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:41 +0000 Message-Id: <69445265.34323.7546e328@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9207e31ba1426a4263322951c3e9a949aee4667a commit 9207e31ba1426a4263322951c3e9a949aee4667a Author: John Baldwin AuthorDate: 2025-10-23 19:59:32 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:42:09 +0000 closefrom_test: Fix the first test The first test is supposed to close the new fd, but was instead not closing anything. Reviewed by: ngie, markj Fixes: 3cedbec3ee08 ("Integrate tools/regression/fifo into ...") Differential Revision: https://reviews.freebsd.org/D52799 (cherry picked from commit b307799b5141331effbb93d7f87dd00e9b991982) --- tests/sys/file/closefrom_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sys/file/closefrom_test.c b/tests/sys/file/closefrom_test.c index 7dccf858c772..212d048d7566 100644 --- a/tests/sys/file/closefrom_test.c +++ b/tests/sys/file/closefrom_test.c @@ -148,7 +148,7 @@ main(void) /* We'd better start up with fd's 0, 1, and 2 open. */ start = devnull(); - if (start == -1) + if (start < 3) fail("open", "bad descriptor %d", start); ok("open"); @@ -159,9 +159,9 @@ main(void) ok("highest_fd"); /* Try to use closefrom() for just closing fd 3. */ - closefrom(start + 1); + closefrom(start); fd = highest_fd(); - if (fd != start) + if (fd != start - 1) fail("closefrom", "highest fd %d", fd); ok("closefrom"); @@ -169,7 +169,7 @@ main(void) for (i = 0; i < 16; i++) (void)devnull(); fd = highest_fd(); - if (fd != start + 16) + if (fd != start + 15) fail("open 16", "highest fd %d", fd); ok("open 16"); From nobody Thu Dec 18 19:13:42 2025 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 4dXL1L6VSyz6LZ14 for ; Thu, 18 Dec 2025 19:13:42 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1L5k8yz4LpZ for ; Thu, 18 Dec 2025 19:13:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085222; 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=v9kqwtjt5KTF3dU9pCZWYxkOtyYCd9Ej3V9TlrsF0Y4=; b=YEy+032dRSPCYPJjnn7SMkpdAemImxBOzkA8sYhhO10H9a/kINlYX1wCUt6tTcg41lZ8bP CW0+1VhgptcLMEWAfd23XOTzBxc8XMW+DDAwAFoRG5fTN+CykXLdlBL2Pu95a1I/TZXzjx BP7cDjBvpRp0w4TbNoqzD/atEOYOG4pbMoOoU9BAMzncPdceW5lOF1FuCtVK67VdavXJNX 1f7TaHmaNauOKD3kwRC1R3Db+pLOhTFOf45DkNNO62RWvnVSE6i/DEgWHYHodp3VWBrJCY eTw2RoXHTkndKzoLR8nro/nqzTWUm6os88q8gQFzq8fwyK2NwEly57fTwluDHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085222; 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=v9kqwtjt5KTF3dU9pCZWYxkOtyYCd9Ej3V9TlrsF0Y4=; b=fI3MOXy/BKpAZBy9H+BZSwDhEGPn5bT6DoMeHPXXJLIG4Vcm63eCZxmyu1FaJSj3T/0xbX OEjy3zJ0ydPXNRTNuEgK0skRM1yRX8jI34WLmAg/M3M1FdGLyzVy8PALL4TYIzvFxiO3d8 V24DBD+GPtGMpxOKSFcXtu/CvFiP3twM0td/wAZi+uCLGRcxFmP8FVDF5EfHMn522MmzRD ph/qCfSlgqcwoviRxX/ZgHuLH3+cFcyAdN1vMHIQ/21l1xSiqnXY/pY5iBKqVg9z10qGx7 0qE3BmgbtS/aZiZxDJi+535YPkN5Gk+J9iWxOgnc3IPoknTQTWQQcQLrmeBlMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085222; a=rsa-sha256; cv=none; b=V5IuriXGEgy1anSRNcEWlWbF/p0P7ZIaAsUdMCphabHSbiM0rUrtTLgmtf5Y4SFxClRvN5 YtnFJHdfGc3FPVjWb7CbjYUTLAht+XDsh0MFOfpVrkzHKSj5Bou+NRsDqdU7z18NQ0YHPt qXVKtfYgnx836wOOLyEwQx1LFLAMeNubT6QSGPpANgzZJkaNnBKbS6R3HsVi3rAxjxtBRS l/LvUe5xD89bgZxSpopC6w+mSbrraKJTLosV0XVv7Sp4VC2lBERXhoK20Iwi6GQKw8Y8Rc 6CLA/Eygxik2rJPkLChZhUXwHirjQ5bKWnkuQGDHS29EIQs7nAy9t4y7mvDRmA== 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 4dXL1L52xlzrM0 for ; Thu, 18 Dec 2025 19:13:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 347e8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1e6728be9380 - stable/15 - closefrom_test: Convert to atf-c(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1e6728be93808e14678fd28b1f518ddefa67cdd8 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:42 +0000 Message-Id: <69445266.347e8.2803e2af@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e6728be93808e14678fd28b1f518ddefa67cdd8 commit 1e6728be93808e14678fd28b1f518ddefa67cdd8 Author: John Baldwin AuthorDate: 2025-10-27 17:36:06 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:42:23 +0000 closefrom_test: Convert to atf-c(3) Reviewed by: ngie, markj Differential Revision: https://reviews.freebsd.org/D52800 (cherry picked from commit 2fbb6e213ac2075594da5f68a72d41074fd85b69) --- tests/sys/file/Makefile | 2 +- tests/sys/file/closefrom_test.c | 490 +++++++++++++++++++--------------------- 2 files changed, 236 insertions(+), 256 deletions(-) diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile index beb4452359b7..c1fcef68d08e 100644 --- a/tests/sys/file/Makefile +++ b/tests/sys/file/Makefile @@ -3,7 +3,7 @@ TESTSDIR= ${TESTSBASE}/sys/file BINDIR= ${TESTSDIR} ATF_TESTS_C+= path_test -TAP_TESTS_C+= closefrom_test +ATF_TESTS_C+= closefrom_test TAP_TESTS_C+= dup_test ATF_TESTS_C+= fcntlflags_test TAP_TESTS_SH+= flock_test diff --git a/tests/sys/file/closefrom_test.c b/tests/sys/file/closefrom_test.c index 212d048d7566..a51e1630e24d 100644 --- a/tests/sys/file/closefrom_test.c +++ b/tests/sys/file/closefrom_test.c @@ -25,13 +25,13 @@ * SUCH DAMAGE. */ -#include /* * Regression tests for the closefrom(2) system call. */ #include #include +#include #include #include #include @@ -44,67 +44,57 @@ #include #include -struct shared_info { - int failed; - char tag[64]; - char message[0]; -}; +#include -static int test = 1; +static char *shared_page; -static void -ok(const char *descr) +/* + * A variant of ATF_REQUIRE that is suitable for use in child + * processes. Since these tests close stderr, errors are reported to + * a shared page of memory checked by the parent process. + */ +#define CHILD_REQUIRE(exp) do { \ + if (!(exp)) \ + child_fail_require(__FILE__, __LINE__, \ + #exp " not met"); \ +} while (0) + +static __dead2 __printflike(3, 4) void +child_fail_require(const char *file, int line, const char *fmt, ...) { + FILE *fp; + va_list ap; - printf("ok %d - %s\n", test, descr); - test++; -} + fp = fmemopen(shared_page, PAGE_SIZE - 1, "w"); + if (fp == NULL) + exit(1); -static void -fail(const char *descr, const char *fmt, ...) -{ - va_list ap; + fprintf(fp, "%s:%d: ", file, line); + va_start(ap, fmt); + vfprintf(fp, fmt, ap); + va_end(ap); + fclose(fp); - printf("not ok %d - %s", test, descr); - test++; - if (fmt) { - va_start(ap, fmt); - printf(" # "); - vprintf(fmt, ap); - va_end(ap); - } - printf("\n"); - exit(1); + exit(0); } -#define fail_err(descr) fail((descr), "%s", strerror(errno)) - -static void -cok(struct shared_info *info, const char *descr) +static pid_t +child_fork(void) { - - info->failed = 0; - strlcpy(info->tag, descr, sizeof(info->tag)); - exit(0); + shared_page = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANON | + MAP_SHARED, -1, 0); + ATF_REQUIRE_MSG(shared_page != MAP_FAILED, "mmap: %s", strerror(errno)); + return (atf_utils_fork()); } static void -cfail(struct shared_info *info, const char *descr, const char *fmt, ...) +child_wait(pid_t pid) { - va_list ap; - - info->failed = 1; - strlcpy(info->tag, descr, sizeof(info->tag)); - if (fmt) { - va_start(ap, fmt); - vsprintf(info->message, fmt, ap); - va_end(ap); - } - exit(0); + atf_utils_wait(pid, 0, "", ""); + if (shared_page[0] != '\0') + atf_tc_fail("%s", shared_page); } -#define cfail_err(info, descr) cfail((info), (descr), "%s", strerror(errno)) - /* * Use kinfo_getfile() to fetch the list of file descriptors and figure out * the highest open file descriptor. @@ -116,9 +106,8 @@ highest_fd(void) int cnt, i, highest; kif = kinfo_getfile(getpid(), &cnt); - if (kif == NULL) - fail_err("kinfo_getfile"); - highest = INT_MIN; + ATF_REQUIRE_MSG(kif != NULL, "kinfo_getfile: %s", strerror(errno)); + highest = -1; for (i = 0; i < cnt; i++) if (kif[i].kf_fd > highest) highest = kif[i].kf_fd; @@ -132,262 +121,253 @@ devnull(void) int fd; fd = open(_PATH_DEVNULL, O_RDONLY); - if (fd < 0) - fail_err("open(\" "_PATH_DEVNULL" \")"); + ATF_REQUIRE_MSG(fd != -1, "open(\" "_PATH_DEVNULL" \"): %s", + strerror(errno)); return (fd); } -int -main(void) +ATF_TC_WITHOUT_HEAD(closefrom_simple); +ATF_TC_BODY(closefrom_simple, tc) { - struct shared_info *info; - pid_t pid; - int fd, flags, i, start; - - printf("1..22\n"); + int fd, start; /* We'd better start up with fd's 0, 1, and 2 open. */ - start = devnull(); - if (start < 3) - fail("open", "bad descriptor %d", start); - ok("open"); + start = highest_fd(); + ATF_REQUIRE(start >= 2); + + fd = devnull(); + ATF_REQUIRE(fd > start); /* Make sure highest_fd() works. */ - fd = highest_fd(); - if (start != fd) - fail("highest_fd", "bad descriptor %d != %d", start, fd); - ok("highest_fd"); - - /* Try to use closefrom() for just closing fd 3. */ - closefrom(start); - fd = highest_fd(); - if (fd != start - 1) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); + ATF_REQUIRE_INTEQ(fd, highest_fd()); + + /* Try to use closefrom() to close just the new fd. */ + closefrom(fd); + ATF_REQUIRE_INTEQ(start, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closefrom_with_holes); +ATF_TC_BODY(closefrom_with_holes, tc) +{ + int i, start; + + start = highest_fd(); /* Eat up 16 descriptors. */ for (i = 0; i < 16; i++) (void)devnull(); - fd = highest_fd(); - if (fd != start + 15) - fail("open 16", "highest fd %d", fd); - ok("open 16"); + + ATF_REQUIRE_INTEQ(start + 16, highest_fd()); /* Close half of them. */ - closefrom(11); - fd = highest_fd(); - if (fd != 10) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); - - /* Explicitly close descriptors 6 and 8 to create holes. */ - if (close(6) < 0 || close(8) < 0) - fail_err("close2 "); - ok("close 2"); - - /* Verify that close on 6 and 8 fails with EBADF. */ - if (close(6) == 0) - fail("close(6)", "did not fail"); - if (errno != EBADF) - fail_err("close(6)"); - ok("close(6)"); - if (close(8) == 0) - fail("close(8)", "did not fail"); - if (errno != EBADF) - fail_err("close(8)"); - ok("close(8)"); - - /* Close from 4 on. */ - closefrom(4); - fd = highest_fd(); - if (fd != 3) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); - - /* Allocate a small SHM region for IPC with our child. */ - info = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANON | - MAP_SHARED, -1, 0); - if (info == MAP_FAILED) - fail_err("mmap"); - ok("mmap"); - - /* Fork a child process to test closefrom(0). */ - pid = fork(); - if (pid < 0) - fail_err("fork"); + closefrom(start + 9); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); + + /* Explicitly close two descriptors to create holes. */ + ATF_REQUIRE_MSG(close(start + 3) == 0, "close(start + 3): %s", + strerror(errno)); + ATF_REQUIRE_MSG(close(start + 5) == 0, "close(start + 5): %s", + strerror(errno)); + + /* Verify that close on the closed descriptors fails with EBADF. */ + ATF_REQUIRE_ERRNO(EBADF, close(start + 3) == -1); + ATF_REQUIRE_ERRNO(EBADF, close(start + 5) == -1); + + /* Close most remaining descriptors. */ + closefrom(start + 2); + ATF_REQUIRE_INTEQ(start + 1, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closefrom_zero); +ATF_TC_BODY(closefrom_zero, tc) +{ + pid_t pid; + int fd; + + /* Ensure standard descriptors are open. */ + ATF_REQUIRE(highest_fd() >= 2); + + pid = child_fork(); if (pid == 0) { /* Child. */ closefrom(0); fd = highest_fd(); - if (fd >= 0) - cfail(info, "closefrom(0)", "highest fd %d", fd); - cok(info, "closefrom(0)"); + CHILD_REQUIRE(fd == -1); + exit(0); } - if (wait(NULL) < 0) - fail_err("wait"); - if (info->failed) - fail(info->tag, "%s", info->message); - ok(info->tag); - - /* Fork a child process to test closefrom(-1). */ - pid = fork(); - if (pid < 0) - fail_err("fork"); + + child_wait(pid); +} + +ATF_TC_WITHOUT_HEAD(closefrom_negative_one); +ATF_TC_BODY(closefrom_negative_one, tc) +{ + pid_t pid; + int fd; + + /* Ensure standard descriptors are open. */ + ATF_REQUIRE(highest_fd() >= 2); + + pid = child_fork(); if (pid == 0) { /* Child. */ closefrom(-1); fd = highest_fd(); - if (fd >= 0) - cfail(info, "closefrom(-1)", "highest fd %d", fd); - cok(info, "closefrom(-1)"); + CHILD_REQUIRE(fd == -1); + exit(0); } - if (wait(NULL) < 0) - fail_err("wait"); - if (info->failed) - fail(info->tag, "%s", info->message); - ok(info->tag); - - /* Dup stdout to 6. */ - if (dup2(1, 6) < 0) - fail_err("dup2"); - fd = highest_fd(); - if (fd != 6) - fail("dup2", "highest fd %d", fd); - ok("dup2"); + + child_wait(pid); +} + +ATF_TC_WITHOUT_HEAD(closefrom_in_holes); +ATF_TC_BODY(closefrom_in_holes, tc) +{ + int start; + + start = highest_fd(); + ATF_REQUIRE(start >= 2); + + /* Dup stdout to a higher fd. */ + ATF_REQUIRE_INTEQ(start + 4, dup2(1, start + 4)); + ATF_REQUIRE_INTEQ(start + 4, highest_fd()); /* Do a closefrom() starting in a hole. */ - closefrom(4); - fd = highest_fd(); - if (fd != 3) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); + closefrom(start + 2); + ATF_REQUIRE_INTEQ(start, highest_fd()); /* Do a closefrom() beyond our highest open fd. */ - closefrom(32); - fd = highest_fd(); - if (fd != 3) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); + closefrom(start + 32); + ATF_REQUIRE_INTEQ(start, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closerange_basic); +ATF_TC_BODY(closerange_basic, tc) +{ + struct stat sb; + int i, start; - /* Chew up another 8 fd */ + start = highest_fd(); + + /* Open 8 file descriptors */ for (i = 0; i < 8; i++) (void)devnull(); - fd = highest_fd(); - start = fd - 7; + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); /* close_range() a hole in the middle */ - close_range(start + 3, start + 5, 0); - for (i = start + 3; i < start + 6; ++i) { - if (close(i) == 0 || errno != EBADF) { - --i; - break; - } - } - if (i != start + 6) - fail("close_range", "failed to close at %d in %d - %d", i + 1, - start + 3, start + 6); - ok("close_range"); + ATF_REQUIRE_INTEQ(0, close_range(start + 3, start + 5, 0)); + for (i = start + 3; i < start + 6; ++i) + ATF_REQUIRE_ERRNO(EBADF, fstat(i, &sb) == -1); /* close_range from the middle of the hole */ - close_range(start + 4, start + 6, 0); - if ((i = highest_fd()) != fd) - fail("close_range", "highest fd %d", i); - ok("close_range"); + ATF_REQUIRE_INTEQ(0, close_range(start + 4, start + 6, 0)); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); /* close_range to the end; effectively closefrom(2) */ - close_range(start + 3, ~0L, 0); - if ((i = highest_fd()) != start + 2) - fail("close_range", "highest fd %d", i); - ok("close_range"); + ATF_REQUIRE_INTEQ(0, close_range(start + 3, ~0L, 0)); + ATF_REQUIRE_INTEQ(start + 2, highest_fd()); /* Now close the rest */ - close_range(start, start + 4, 0); - fd = highest_fd(); - if (fd != 3) - fail("close_range", "highest fd %d", fd); - ok("close_range"); - - /* Fork a child process to test closefrom(0) twice. */ - pid = fork(); - if (pid < 0) - fail_err("fork"); + ATF_REQUIRE_INTEQ(0, close_range(start + 1, start + 4, 0)); + ATF_REQUIRE_INTEQ(start, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closefrom_zero_twice); +ATF_TC_BODY(closefrom_zero_twice, tc) +{ + pid_t pid; + int fd; + + /* Ensure standard descriptors are open. */ + ATF_REQUIRE(highest_fd() >= 2); + + pid = child_fork(); if (pid == 0) { /* Child. */ closefrom(0); + fd = highest_fd(); + CHILD_REQUIRE(fd == -1); closefrom(0); - cok(info, "closefrom(0)"); + fd = highest_fd(); + CHILD_REQUIRE(fd == -1); + exit(0); } - if (wait(NULL) < 0) - fail_err("wait"); - if (info->failed) - fail(info->tag, "%s", info->message); - ok(info->tag); - /* test CLOSE_RANGE_CLOEXEC */ + child_wait(pid); +} + +static void +require_fd_flag(int fd, const char *descr, const char *descr2, int flag, + bool set) +{ + int flags; + + flags = fcntl(fd, F_GETFD); + ATF_REQUIRE_MSG(flags >= 0, "fcntl(.., F_GETFD): %s", strerror(errno)); + + if (set) { + ATF_REQUIRE_MSG((flags & flag) == flag, + "%s did not set %s on fd %d", descr, descr2, fd); + } else { + ATF_REQUIRE_MSG((flags & flag) == 0, + "%s set %s when it should not have on fd %d", descr, descr2, + fd); + } +} + +ATF_TC_WITHOUT_HEAD(closerange_CLOEXEC); +ATF_TC_BODY(closerange_CLOEXEC, tc) +{ + int i, start; + + start = highest_fd(); + ATF_REQUIRE(start >= 2); + for (i = 0; i < 8; i++) (void)devnull(); - fd = highest_fd(); - start = fd - 8; - if (close_range(start + 1, start + 4, CLOSE_RANGE_CLOEXEC) < 0) - fail_err("close_range(..., CLOSE_RANGE_CLOEXEC)"); - flags = fcntl(start, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOEXEC) != 0) - fail("close_range", "CLOSE_RANGE_CLOEXEC set close-on-exec " - "when it should not have on fd %d", start); - for (i = start + 1; i <= start + 4; i++) { - flags = fcntl(i, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOEXEC) == 0) - fail("close_range", "CLOSE_RANGE_CLOEXEC did not set " - "close-on-exec on fd %d", i); - } - for (; i < start + 8; i++) { - flags = fcntl(i, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOEXEC) != 0) - fail("close_range", "CLOSE_RANGE_CLOEXEC set close-on-exec " - "when it should not have on fd %d", i); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); + + ATF_REQUIRE_INTEQ(0, close_range(start + 2, start + 5, + CLOSE_RANGE_CLOEXEC)); + for (i = 1; i < 9; i++) { + require_fd_flag(start + i, "CLOSE_RANGE_CLOEXEC", + "close-on-exec", FD_CLOEXEC, i >= 2 && i <= 5); } - if (close_range(start, start + 8, 0) < 0) - fail_err("close_range"); - ok("close_range(..., CLOSE_RANGE_CLOEXEC)"); + ATF_REQUIRE_INTEQ(0, close_range(start + 1, start + 8, 0)); +} + +ATF_TC_WITHOUT_HEAD(closerange_CLOFORK); +ATF_TC_BODY(closerange_CLOFORK, tc) +{ + int i, start; + + start = highest_fd(); + ATF_REQUIRE(start >= 2); - /* test CLOSE_RANGE_CLOFORK */ for (i = 0; i < 8; i++) (void)devnull(); - fd = highest_fd(); - start = fd - 8; - if (close_range(start + 1, start + 4, CLOSE_RANGE_CLOFORK) < 0) - fail_err("close_range(..., CLOSE_RANGE_CLOFORK)"); - flags = fcntl(start, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOFORK) != 0) - fail("close_range", "CLOSE_RANGE_CLOFORK set close-on-exec " - "when it should not have on fd %d", start); - for (i = start + 1; i <= start + 4; i++) { - flags = fcntl(i, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOFORK) == 0) - fail("close_range", "CLOSE_RANGE_CLOFORK did not set " - "close-on-exec on fd %d", i); - } - for (; i < start + 8; i++) { - flags = fcntl(i, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOFORK) != 0) - fail("close_range", "CLOSE_RANGE_CLOFORK set close-on-exec " - "when it should not have on fd %d", i); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); + + ATF_REQUIRE_INTEQ(0, close_range(start + 2, start + 5, + CLOSE_RANGE_CLOFORK)); + for (i = 1; i < 9; i++) { + require_fd_flag(start + i, "CLOSE_RANGE_CLOFORK", + "close-on-fork", FD_CLOFORK, i >= 2 && i <= 5); } - if (close_range(start, start + 8, 0) < 0) - fail_err("close_range"); - ok("close_range(..., CLOSE_RANGE_CLOFORK)"); + ATF_REQUIRE_INTEQ(0, close_range(start + 1, start + 8, 0)); +} - return (0); +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, closefrom_simple); + ATF_TP_ADD_TC(tp, closefrom_with_holes); + ATF_TP_ADD_TC(tp, closefrom_zero); + ATF_TP_ADD_TC(tp, closefrom_negative_one); + ATF_TP_ADD_TC(tp, closefrom_in_holes); + ATF_TP_ADD_TC(tp, closerange_basic); + ATF_TP_ADD_TC(tp, closefrom_zero_twice); + ATF_TP_ADD_TC(tp, closerange_CLOEXEC); + ATF_TP_ADD_TC(tp, closerange_CLOFORK); + + return (atf_no_error()); } From nobody Thu Dec 18 19:13:51 2025 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 4dXL1X14xsz6LZ1F for ; Thu, 18 Dec 2025 19:13:52 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1W5jhRz4Ltg for ; Thu, 18 Dec 2025 19:13:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VriwFvjexJl3p3FCc6j7nTJ6CXMV5t09vvF+iaADOx4=; b=M1sbX61FgH281Va1Jvz06O2h3nXfn0AWe0GBzD9HuWoLevSNVj5vmyVy7raC7KeeTWvz7j UPruN2NQcZDKjNYQk8OHpMCmpB2CmEmTlGyH84MQZXUnWu7upgPsmzuQFpjz6qbR2Gz6Ip nWD3XKqNNEk2PJF1fLGrKU9aOO6//QdZApN03i7OrfEBrpvAAFcsMmlRfa3EP7gzMBeyFn nT49DJBOxiD4+bggsLRWL1umqEpgw2jF+d78rrtIG9nPjLlr4yVIfH8mH77NXWjvydbsp1 3WZzEaa1eEG8OBMsqlDKj742Id1D7xQFgcVKXzoFI+0LMeF0PrvnmgzHhDLDlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VriwFvjexJl3p3FCc6j7nTJ6CXMV5t09vvF+iaADOx4=; b=fM5Sh2J+okbKwAf0wcTn9ZxbodYD7lxAdNd3XHAc4HVFn0rqbrCso91fUFvahbTRW8jjDH SIkZSNpF4iASRyaNismKj+kpysYodXd8Xr35+PGtnp4BsWOghDp+xhEnCE+iQQI/NxEnEy rOvR+73/DgYiEFDwkhvID4S1zcaLFRty21cSEeLOEMUF7lM7hABkvVQqiMCvkJ7/pFUWYT 9VuAc4obkP2dSf9b7tO+512JV4U+BCyt+4NOiSOQ2rHMqRYfkbzyu6bPAHyI/TqJ/8YYfw Bk7gQuYL7nQNWlvA90DGlbQx8uxGkqaK0G2YRVqPuG5N7NH0ZAI9u/i21puc3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085231; a=rsa-sha256; cv=none; b=UfpC0Bv0l5IKr2cnifTWgXLJd+vuO4UCYFNSRxnjBblEwRxsMXDe8h+1l0CqWIW4/uMcvG gsFTaSNG0pP4ZbTit6Ie5pboEXek6DCV893OzCI0PL2TyCg9CmmWaU5FK4a/+Osp5TFHES PyNUL0DKMMaievPbODZ9luv/Ur+SYspCg0GOC3PbcmBfj4wlKrQmli1Op6Wia61TBkc9Y2 YMTbAgXh7emhyXpTZufvK4vhg6G1iW+9g0DovYXukt8ec8M9bd+YfyVDpAnVag0MoskjRM nXf+95IdRvZ+ipcb0i9g3c+8o7iQGGO1D/hv6wMPTaj3QWYmtBhfmzCMyYjLwg== 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 4dXL1W5GYMzrXG for ; Thu, 18 Dec 2025 19:13:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33cdf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Yen-Cheng Chang From: John Baldwin Subject: git: 319f32a1748e - stable/14 - Fix grammar error in test/sys/file/closefrom_test.c 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 319f32a1748e4963c7680d4b124fa1e53ddc7c6a Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:51 +0000 Message-Id: <6944526f.33cdf.2d146dbb@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=319f32a1748e4963c7680d4b124fa1e53ddc7c6a commit 319f32a1748e4963c7680d4b124fa1e53ddc7c6a Author: Yen-Cheng Chang AuthorDate: 2024-01-01 06:38:02 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:43:43 +0000 Fix grammar error in test/sys/file/closefrom_test.c Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/973 (cherry picked from commit 664812f73488c4c0e16982c5c97d639deb9d2431) --- tests/sys/file/closefrom_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/file/closefrom_test.c b/tests/sys/file/closefrom_test.c index 7c6787bfd5f2..e30c5eb3d591 100644 --- a/tests/sys/file/closefrom_test.c +++ b/tests/sys/file/closefrom_test.c @@ -146,7 +146,7 @@ main(void) printf("1..21\n"); - /* We better start up with fd's 0, 1, and 2 open. */ + /* We'd better start up with fd's 0, 1, and 2 open. */ start = devnull(); if (start == -1) fail("open", "bad descriptor %d", start); From nobody Thu Dec 18 19:13:50 2025 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 4dXL1W18QKz6LZ87 for ; Thu, 18 Dec 2025 19:13:51 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1W0M4Gz4Lfl for ; Thu, 18 Dec 2025 19:13:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1pGnbr+ub5sXc21DLtXdAZcNSEwgwRTIxLEg3fE/IEQ=; b=PD7Exwh4E6hCx4bwJShsgxSAZjripQN6SmPPzxXUJsxRqyzVFchjNS8ntk0nZT0878t3/v TxcG9r02iwC7t67VGP1NCuHin9K64bXjkZX4KbiB3y5TQK3WlLA/Z5A6RZKrSD7pqQhfKU tx9k0BT4TVetMLpVvkrg8wv50+cNr2qfGcuhUuREWssczFli5GCmYT9QCvosnCXIzrYn6E UOgp14UbgR9uOrmhsTYl2uME2nIe8GLrAQin/f+A4lPm+I2rkgPvW2hgk7fuRZp7xEB8Lh E7xnh1jQm3lbPavvxbCil55JuyVwGfSvON7Xt3wZ6Wu2BJ0KWkJXclIEK2T2xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1pGnbr+ub5sXc21DLtXdAZcNSEwgwRTIxLEg3fE/IEQ=; b=IQ3WBa9tQh+CXVyCDOyzHqBUGrSitqApoVrlSRolsa7ZOr5rRd43Zrvm5YzliI8h3YaKlP GuMEXAvfxqGLAbrijuSm03GaUREvTZDRs5I8UfD8vB5CD7Hsw6HFBa9sc1e7/teDrjznIM vCPW1wAZ/JkBFo985mvtijdVAthvmQJ2Cyofjr0EsIc8dBPZxJCe9MZcOWUqAn1C/4UoPc O8OpJTu4RNPoXAnNe6V0tGeDHDAtOxnyk+2873p0IPTu1vEc7Oe0gKGcLIT5s7wdzPQI/x xO418Jmf6tNOGtUpBJpeayfY0797UhA8r191S0a4bHz4baEau6nVT2oWcAkqQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085231; a=rsa-sha256; cv=none; b=yjqtIN2hY9MiXnKtS6C76o7WCIEXAl2J7yLu8OVxJwX++9P3l7XffPTFVxPtodWjM03939 XgzEhWtq6jgQ+epi9w0d7hWv4izpxlGvpmLWTf72ovqPLgQEtlbpvdGLjASLQvWjgdBd88 CawjIMz4WOICXXkDkG2l6KwPyFjCMTOcrrs84jHVc1mYi4c7ep+ze9mdNaKU2CSti9w03l 3i7mBg53TRJjs+nY1ujZZulhPlpgbNpc5muKCVbPVnhqaxmIXd3aC3gKJcQQnKUSur+pjq 4JJ2cvobWY6UFuRqjAH0dPCSCoKPsVSu6XbAOfKtDom5/EMyeZMcGSR/giXAPw== 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 4dXL1V4xzczrM1 for ; Thu, 18 Dec 2025 19:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34327 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Jason W. Bacon From: John Baldwin Subject: git: 857d3887e664 - stable/14 - getconf: Report value of _SC_PHYS_PAGES 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 857d3887e66426865ca73fa143b04b3ca7930ef5 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:50 +0000 Message-Id: <6944526e.34327.4b9bc6e3@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=857d3887e66426865ca73fa143b04b3ca7930ef5 commit 857d3887e66426865ca73fa143b04b3ca7930ef5 Author: Jason W. Bacon AuthorDate: 2025-10-03 20:43:47 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:41:23 +0000 getconf: Report value of _SC_PHYS_PAGES PR: 289717 Reviewed by: jhb (cherry picked from commit aa9e4fe3c9021d623743e26aef879a0036f87c0f) --- usr.bin/getconf/sysconf.gperf | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/getconf/sysconf.gperf b/usr.bin/getconf/sysconf.gperf index baf341c8962b..2bd75dd47851 100644 --- a/usr.bin/getconf/sysconf.gperf +++ b/usr.bin/getconf/sysconf.gperf @@ -47,6 +47,7 @@ OPEN_MAX, _SC_OPEN_MAX PAGESIZE, _SC_PAGESIZE PAGE_SIZE, _SC_PAGESIZE PASS_MAX, _SC_PASS_MAX +PHYS_PAGES, _SC_PHYS_PAGES PTHREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_DESTRUCTOR_ITERATIONS PTHREAD_KEYS_MAX, _SC_THREAD_KEYS_MAX PTHREAD_STACK_MIN, _SC_THREAD_STACK_MIN From nobody Thu Dec 18 19:13:52 2025 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 4dXL1Y0923z6LZ1J for ; Thu, 18 Dec 2025 19:13:53 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1X6b9fz4M4N for ; Thu, 18 Dec 2025 19:13:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085232; 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=QskisQZb2yJRyqkInM1cofOpa/jS09Kd1oy0X4EhuZY=; b=roTjsD7pTSs2K1dCKqA1kmfrnDSwPAA+uboUS3cUpHT18zZ4WM6CZ4TOFMCD64SHzvA/8l 1qfSpSmK7x4seWlq1iFSkdjhtZjbh7OYHR3GudKmNMQHlysvq2l2dbQT1b1ZUZMlMKNljW 0ANIeEA5Y6dw5rSBjAgP/+4DshG2FSACFiP+MciRSoOK3vDldPY6VIFfEa0ISMkQb4GhSK 0o5rtxydotF9tS8NvCbZW6/q1ZVnr/IMVG1yOPHAH1m3aPJYtiLUQtPeCLnWd4B3ivDwwt d8HnyNyS1DuqIMdBHGy9StrNnCBwzzpxvzQNn8E7f/z4+5KGUT42MJYbT0oWNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085232; 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=QskisQZb2yJRyqkInM1cofOpa/jS09Kd1oy0X4EhuZY=; b=gNFyQqIcTL5s7Zs7WzKBPxhJVaGQ/POlyt/0R5N2yeSvesynDWFwEzythLpHuqPUrU5QtT fAVnc5/KarJZHHnh36VBhpUcDVwm00vd8RBL3JxYyYHVJ4ZkxgyOKsCjIYp64fwIvu2xeQ yENKf1+zZaLtLdh651PwjUm93ttAQ4pFQS5Uw6266A/uGxOYuRwURsWX+PGc1lUOqIvEyZ 1WohLnxin6OWviIxzUF1kz7ykdPYPQbKmjY8AQQQwrgbS7BFJxIko3+pdX1oJVyEsIHLFy f4+iTBvO1uzEt2k1U5P9FeH67p5aQTQlf/k7xQBggh2IbfJzAqSjuM9o6R+3Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085232; a=rsa-sha256; cv=none; b=b84sAGE0w3gXxrQ8U9rJxQIfIQ/dRZG+8dSt7QzVjDCLdKORopasi2e+8EmEYM2Go9Wpj2 QqSJqDve5CWQYtCjA7X/GlJnNDWC/7lmRNISr0VZhueCEUd0y0k8j51njKanbywUyCDgzb H6jiZ4DAcMCn/OrHm2fuHWVGkuIGafyBlgt6ozntKdexJAl6mSlL24ElQzlK2WNuMZUu38 LKtU+zaevZThcServKP2KXfiwtHTNVWMwggpd5BprK0PS/H/MNLULtDQVVNkcuSfJeP3es d0rrToJb5bILrlbCNEuLD1+19xPrO5PhKJmiSHoOrFmhA8jKrU9UFaQIkbCepA== 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 4dXL1X60zPzrmH for ; Thu, 18 Dec 2025 19:13:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 336c4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ee5ad300a0df - stable/14 - closefrom_test: Fix the first test 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ee5ad300a0df2e7dceeeda9bff1504c70ad84c69 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:52 +0000 Message-Id: <69445270.336c4.2b528dcd@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ee5ad300a0df2e7dceeeda9bff1504c70ad84c69 commit ee5ad300a0df2e7dceeeda9bff1504c70ad84c69 Author: John Baldwin AuthorDate: 2025-10-23 19:59:32 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:44:51 +0000 closefrom_test: Fix the first test The first test is supposed to close the new fd, but was instead not closing anything. Reviewed by: ngie, markj Fixes: 3cedbec3ee08 ("Integrate tools/regression/fifo into ...") Differential Revision: https://reviews.freebsd.org/D52799 (cherry picked from commit b307799b5141331effbb93d7f87dd00e9b991982) --- tests/sys/file/closefrom_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sys/file/closefrom_test.c b/tests/sys/file/closefrom_test.c index e30c5eb3d591..e4e4514f74d7 100644 --- a/tests/sys/file/closefrom_test.c +++ b/tests/sys/file/closefrom_test.c @@ -148,7 +148,7 @@ main(void) /* We'd better start up with fd's 0, 1, and 2 open. */ start = devnull(); - if (start == -1) + if (start < 3) fail("open", "bad descriptor %d", start); ok("open"); @@ -159,9 +159,9 @@ main(void) ok("highest_fd"); /* Try to use closefrom() for just closing fd 3. */ - closefrom(start + 1); + closefrom(start); fd = highest_fd(); - if (fd != start) + if (fd != start - 1) fail("closefrom", "highest fd %d", fd); ok("closefrom"); @@ -169,7 +169,7 @@ main(void) for (i = 0; i < 16; i++) (void)devnull(); fd = highest_fd(); - if (fd != start + 16) + if (fd != start + 15) fail("open 16", "highest fd %d", fd); ok("open 16"); From nobody Thu Dec 18 19:13:53 2025 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 4dXL1Z2Kxhz6LZ9v for ; Thu, 18 Dec 2025 19:13:54 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXL1Z0LYCz4M90 for ; Thu, 18 Dec 2025 19:13:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085234; 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=7yGGwETsdobuAcL74VUjtntsEw6MS4kYKWTN3PH5zs8=; b=TuajGMhE7YIUGNh+406dn0igQHrz+8vOi+iFpCGJYFU6UmOwFIfWDgJcF0m9DHLiur7W7i 7SvDe+NAuvJsGqU36cwemxyfE1leCI6IGNcWGD3DilWdGkl251xY/+TGVrJMMfNxRrRlUq Oz4DxVoVgxq4JtXhnEJgac6DM90kt/jHtudfpXZjcx1ODtxATe66qSKWTYDdFWtc62qWxX GdDYkHwtaX1QULin4h1asYkhlnlSaC4Z/EaMxmixmMLFiGU9FwDWVgGeeIYtJ62uV9BLt4 JVT3Q3p9pqtR9OLJjfjT+U0/AXwRmGO3VEQH5SuPETi+oetNe7SQ91+LXOfRBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766085234; 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=7yGGwETsdobuAcL74VUjtntsEw6MS4kYKWTN3PH5zs8=; b=hTonsUImV8lSnowlJAfbPO9d7nM8YbNB0SBKRsRjFHuqb7tei+wLpzzRJLj2iwc2Mb3rbl vhRNTShPTuCKyT9I1rS8cTNdA6flkXD+nqK67mfgFVSAX78yznMW/TDvCFRYQRTJtvPn8Q Cu1HEq4Wwde7SvmbOkSeRtsTOoxMoh3e8FvAfkuaZbGamsxAmhZzx3XXHThCYuYwY8HWDz TIeHYLFjfHG6ykkvLT4oZlJKvGBjlfE1Oqn6hx9sd0PwPcobi+PfW54k5wPEjIYlUxJCOx 35yxRBFtcuNrE5Zg9rsPalj3A0xSlIU8x88u/rTNVcBQ4xjITvMRZbgd+mCN0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766085234; a=rsa-sha256; cv=none; b=pZUNHGs5miFER/7wyggOA7NzwE9pZVXUzsR5ssbeMQvdVojvV3aVy4adZkxsN1KsWzsu5p 4EGOI0DbPBh3s5XlynKaE97rWZw8WXrT+hAiJ+octRn2H9cEhkRCdDeMgSowghHeU2cPwA hmubrkhrL9Afs6HdXSDFsp6blMhuR3jTFB09keHO3Nd5w6qB4+zk9tPHWJzATx6LxVQVSb uKqRmH6ELFMOvoHVWgfCmVpyFWyJv37f/WPR1XKQ0nfnQqu0JQ8ZmPCFz9cr6D4xFMs1Y6 q8IDV0F91AXUTKmnZqUcQx10rV+J1WwKWJ1BFagjPvOUk/crzY/ShP0EF0aa5A== 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 4dXL1Y6mcCzrXH for ; Thu, 18 Dec 2025 19:13:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35254 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 19:13:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7f33109a13f9 - stable/14 - closefrom_test: Convert to atf-c(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f33109a13f9fee4303cece3d60ddfb3be826081 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 19:13:53 +0000 Message-Id: <69445271.35254.4fbbcf5e@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7f33109a13f9fee4303cece3d60ddfb3be826081 commit 7f33109a13f9fee4303cece3d60ddfb3be826081 Author: John Baldwin AuthorDate: 2025-10-27 17:36:06 +0000 Commit: John Baldwin CommitDate: 2025-12-18 18:46:09 +0000 closefrom_test: Convert to atf-c(3) Reviewed by: ngie, markj Differential Revision: https://reviews.freebsd.org/D52800 (cherry picked from commit 2fbb6e213ac2075594da5f68a72d41074fd85b69) --- tests/sys/file/Makefile | 2 +- tests/sys/file/closefrom_test.c | 443 ++++++++++++++++++++-------------------- 2 files changed, 218 insertions(+), 227 deletions(-) diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile index fd490cb0543e..fd23420151a9 100644 --- a/tests/sys/file/Makefile +++ b/tests/sys/file/Makefile @@ -4,7 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/file BINDIR= ${TESTSDIR} ATF_TESTS_C+= path_test -TAP_TESTS_C+= closefrom_test +ATF_TESTS_C+= closefrom_test TAP_TESTS_C+= dup_test ATF_TESTS_C+= fcntlflags_test TAP_TESTS_SH+= flock_test diff --git a/tests/sys/file/closefrom_test.c b/tests/sys/file/closefrom_test.c index e4e4514f74d7..397b408303c3 100644 --- a/tests/sys/file/closefrom_test.c +++ b/tests/sys/file/closefrom_test.c @@ -25,13 +25,13 @@ * SUCH DAMAGE. */ -#include /* * Regression tests for the closefrom(2) system call. */ #include #include +#include #include #include #include @@ -44,67 +44,57 @@ #include #include -struct shared_info { - int failed; - char tag[64]; - char message[0]; -}; +#include -static int test = 1; +static char *shared_page; -static void -ok(const char *descr) +/* + * A variant of ATF_REQUIRE that is suitable for use in child + * processes. Since these tests close stderr, errors are reported to + * a shared page of memory checked by the parent process. + */ +#define CHILD_REQUIRE(exp) do { \ + if (!(exp)) \ + child_fail_require(__FILE__, __LINE__, \ + #exp " not met"); \ +} while (0) + +static __dead2 __printflike(3, 4) void +child_fail_require(const char *file, int line, const char *fmt, ...) { + FILE *fp; + va_list ap; - printf("ok %d - %s\n", test, descr); - test++; -} + fp = fmemopen(shared_page, PAGE_SIZE - 1, "w"); + if (fp == NULL) + exit(1); -static void -fail(const char *descr, const char *fmt, ...) -{ - va_list ap; + fprintf(fp, "%s:%d: ", file, line); + va_start(ap, fmt); + vfprintf(fp, fmt, ap); + va_end(ap); + fclose(fp); - printf("not ok %d - %s", test, descr); - test++; - if (fmt) { - va_start(ap, fmt); - printf(" # "); - vprintf(fmt, ap); - va_end(ap); - } - printf("\n"); - exit(1); + exit(0); } -#define fail_err(descr) fail((descr), "%s", strerror(errno)) - -static void -cok(struct shared_info *info, const char *descr) +static pid_t +child_fork(void) { - - info->failed = 0; - strlcpy(info->tag, descr, sizeof(info->tag)); - exit(0); + shared_page = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANON | + MAP_SHARED, -1, 0); + ATF_REQUIRE_MSG(shared_page != MAP_FAILED, "mmap: %s", strerror(errno)); + return (atf_utils_fork()); } static void -cfail(struct shared_info *info, const char *descr, const char *fmt, ...) +child_wait(pid_t pid) { - va_list ap; - - info->failed = 1; - strlcpy(info->tag, descr, sizeof(info->tag)); - if (fmt) { - va_start(ap, fmt); - vsprintf(info->message, fmt, ap); - va_end(ap); - } - exit(0); + atf_utils_wait(pid, 0, "", ""); + if (shared_page[0] != '\0') + atf_tc_fail("%s", shared_page); } -#define cfail_err(info, descr) cfail((info), (descr), "%s", strerror(errno)) - /* * Use kinfo_getfile() to fetch the list of file descriptors and figure out * the highest open file descriptor. @@ -116,9 +106,8 @@ highest_fd(void) int cnt, i, highest; kif = kinfo_getfile(getpid(), &cnt); - if (kif == NULL) - fail_err("kinfo_getfile"); - highest = INT_MIN; + ATF_REQUIRE_MSG(kif != NULL, "kinfo_getfile: %s", strerror(errno)); + highest = -1; for (i = 0; i < cnt; i++) if (kif[i].kf_fd > highest) highest = kif[i].kf_fd; @@ -132,229 +121,231 @@ devnull(void) int fd; fd = open(_PATH_DEVNULL, O_RDONLY); - if (fd < 0) - fail_err("open(\" "_PATH_DEVNULL" \")"); + ATF_REQUIRE_MSG(fd != -1, "open(\" "_PATH_DEVNULL" \"): %s", + strerror(errno)); return (fd); } -int -main(void) +ATF_TC_WITHOUT_HEAD(closefrom_simple); +ATF_TC_BODY(closefrom_simple, tc) { - struct shared_info *info; - pid_t pid; - int fd, flags, i, start; - - printf("1..21\n"); + int fd, start; /* We'd better start up with fd's 0, 1, and 2 open. */ - start = devnull(); - if (start < 3) - fail("open", "bad descriptor %d", start); - ok("open"); + start = highest_fd(); + ATF_REQUIRE(start >= 2); + + fd = devnull(); + ATF_REQUIRE(fd > start); /* Make sure highest_fd() works. */ - fd = highest_fd(); - if (start != fd) - fail("highest_fd", "bad descriptor %d != %d", start, fd); - ok("highest_fd"); - - /* Try to use closefrom() for just closing fd 3. */ - closefrom(start); - fd = highest_fd(); - if (fd != start - 1) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); + ATF_REQUIRE_INTEQ(fd, highest_fd()); + + /* Try to use closefrom() to close just the new fd. */ + closefrom(fd); + ATF_REQUIRE_INTEQ(start, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closefrom_with_holes); +ATF_TC_BODY(closefrom_with_holes, tc) +{ + int i, start; + + start = highest_fd(); /* Eat up 16 descriptors. */ for (i = 0; i < 16; i++) (void)devnull(); - fd = highest_fd(); - if (fd != start + 15) - fail("open 16", "highest fd %d", fd); - ok("open 16"); + + ATF_REQUIRE_INTEQ(start + 16, highest_fd()); /* Close half of them. */ - closefrom(11); - fd = highest_fd(); - if (fd != 10) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); - - /* Explicitly close descriptors 6 and 8 to create holes. */ - if (close(6) < 0 || close(8) < 0) - fail_err("close2 "); - ok("close 2"); - - /* Verify that close on 6 and 8 fails with EBADF. */ - if (close(6) == 0) - fail("close(6)", "did not fail"); - if (errno != EBADF) - fail_err("close(6)"); - ok("close(6)"); - if (close(8) == 0) - fail("close(8)", "did not fail"); - if (errno != EBADF) - fail_err("close(8)"); - ok("close(8)"); - - /* Close from 4 on. */ - closefrom(4); - fd = highest_fd(); - if (fd != 3) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); - - /* Allocate a small SHM region for IPC with our child. */ - info = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANON | - MAP_SHARED, -1, 0); - if (info == MAP_FAILED) - fail_err("mmap"); - ok("mmap"); - - /* Fork a child process to test closefrom(0). */ - pid = fork(); - if (pid < 0) - fail_err("fork"); + closefrom(start + 9); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); + + /* Explicitly close two descriptors to create holes. */ + ATF_REQUIRE_MSG(close(start + 3) == 0, "close(start + 3): %s", + strerror(errno)); + ATF_REQUIRE_MSG(close(start + 5) == 0, "close(start + 5): %s", + strerror(errno)); + + /* Verify that close on the closed descriptors fails with EBADF. */ + ATF_REQUIRE_ERRNO(EBADF, close(start + 3) == -1); + ATF_REQUIRE_ERRNO(EBADF, close(start + 5) == -1); + + /* Close most remaining descriptors. */ + closefrom(start + 2); + ATF_REQUIRE_INTEQ(start + 1, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closefrom_zero); +ATF_TC_BODY(closefrom_zero, tc) +{ + pid_t pid; + int fd; + + /* Ensure standard descriptors are open. */ + ATF_REQUIRE(highest_fd() >= 2); + + pid = child_fork(); if (pid == 0) { /* Child. */ closefrom(0); fd = highest_fd(); - if (fd >= 0) - cfail(info, "closefrom(0)", "highest fd %d", fd); - cok(info, "closefrom(0)"); + CHILD_REQUIRE(fd == -1); + exit(0); } - if (wait(NULL) < 0) - fail_err("wait"); - if (info->failed) - fail(info->tag, "%s", info->message); - ok(info->tag); - - /* Fork a child process to test closefrom(-1). */ - pid = fork(); - if (pid < 0) - fail_err("fork"); + + child_wait(pid); +} + +ATF_TC_WITHOUT_HEAD(closefrom_negative_one); +ATF_TC_BODY(closefrom_negative_one, tc) +{ + pid_t pid; + int fd; + + /* Ensure standard descriptors are open. */ + ATF_REQUIRE(highest_fd() >= 2); + + pid = child_fork(); if (pid == 0) { /* Child. */ closefrom(-1); fd = highest_fd(); - if (fd >= 0) - cfail(info, "closefrom(-1)", "highest fd %d", fd); - cok(info, "closefrom(-1)"); + CHILD_REQUIRE(fd == -1); + exit(0); } - if (wait(NULL) < 0) - fail_err("wait"); - if (info->failed) - fail(info->tag, "%s", info->message); - ok(info->tag); - - /* Dup stdout to 6. */ - if (dup2(1, 6) < 0) - fail_err("dup2"); - fd = highest_fd(); - if (fd != 6) - fail("dup2", "highest fd %d", fd); - ok("dup2"); + + child_wait(pid); +} + +ATF_TC_WITHOUT_HEAD(closefrom_in_holes); +ATF_TC_BODY(closefrom_in_holes, tc) +{ + int start; + + start = highest_fd(); + ATF_REQUIRE(start >= 2); + + /* Dup stdout to a higher fd. */ + ATF_REQUIRE_INTEQ(start + 4, dup2(1, start + 4)); + ATF_REQUIRE_INTEQ(start + 4, highest_fd()); /* Do a closefrom() starting in a hole. */ - closefrom(4); - fd = highest_fd(); - if (fd != 3) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); + closefrom(start + 2); + ATF_REQUIRE_INTEQ(start, highest_fd()); /* Do a closefrom() beyond our highest open fd. */ - closefrom(32); - fd = highest_fd(); - if (fd != 3) - fail("closefrom", "highest fd %d", fd); - ok("closefrom"); + closefrom(start + 32); + ATF_REQUIRE_INTEQ(start, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closerange_basic); +ATF_TC_BODY(closerange_basic, tc) +{ + struct stat sb; + int i, start; + + start = highest_fd(); - /* Chew up another 8 fd */ + /* Open 8 file descriptors */ for (i = 0; i < 8; i++) (void)devnull(); - fd = highest_fd(); - start = fd - 7; + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); /* close_range() a hole in the middle */ - close_range(start + 3, start + 5, 0); - for (i = start + 3; i < start + 6; ++i) { - if (close(i) == 0 || errno != EBADF) { - --i; - break; - } - } - if (i != start + 6) - fail("close_range", "failed to close at %d in %d - %d", i + 1, - start + 3, start + 6); - ok("close_range"); + ATF_REQUIRE_INTEQ(0, close_range(start + 3, start + 5, 0)); + for (i = start + 3; i < start + 6; ++i) + ATF_REQUIRE_ERRNO(EBADF, fstat(i, &sb) == -1); /* close_range from the middle of the hole */ - close_range(start + 4, start + 6, 0); - if ((i = highest_fd()) != fd) - fail("close_range", "highest fd %d", i); - ok("close_range"); + ATF_REQUIRE_INTEQ(0, close_range(start + 4, start + 6, 0)); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); /* close_range to the end; effectively closefrom(2) */ - close_range(start + 3, ~0L, 0); - if ((i = highest_fd()) != start + 2) - fail("close_range", "highest fd %d", i); - ok("close_range"); + ATF_REQUIRE_INTEQ(0, close_range(start + 3, ~0L, 0)); + ATF_REQUIRE_INTEQ(start + 2, highest_fd()); /* Now close the rest */ - close_range(start, start + 4, 0); - fd = highest_fd(); - if (fd != 3) - fail("close_range", "highest fd %d", fd); - ok("close_range"); - - /* Fork a child process to test closefrom(0) twice. */ - pid = fork(); - if (pid < 0) - fail_err("fork"); + ATF_REQUIRE_INTEQ(0, close_range(start + 1, start + 4, 0)); + ATF_REQUIRE_INTEQ(start, highest_fd()); +} + +ATF_TC_WITHOUT_HEAD(closefrom_zero_twice); +ATF_TC_BODY(closefrom_zero_twice, tc) +{ + pid_t pid; + int fd; + + /* Ensure standard descriptors are open. */ + ATF_REQUIRE(highest_fd() >= 2); + + pid = child_fork(); if (pid == 0) { /* Child. */ closefrom(0); + fd = highest_fd(); + CHILD_REQUIRE(fd == -1); closefrom(0); - cok(info, "closefrom(0)"); + fd = highest_fd(); + CHILD_REQUIRE(fd == -1); + exit(0); } - if (wait(NULL) < 0) - fail_err("wait"); - if (info->failed) - fail(info->tag, "%s", info->message); - ok(info->tag); - /* test CLOSE_RANGE_CLOEXEC */ + child_wait(pid); +} + +static void +require_fd_flag(int fd, const char *descr, const char *descr2, int flag, + bool set) +{ + int flags; + + flags = fcntl(fd, F_GETFD); + ATF_REQUIRE_MSG(flags >= 0, "fcntl(.., F_GETFD): %s", strerror(errno)); + + if (set) { + ATF_REQUIRE_MSG((flags & flag) == flag, + "%s did not set %s on fd %d", descr, descr2, fd); + } else { + ATF_REQUIRE_MSG((flags & flag) == 0, + "%s set %s when it should not have on fd %d", descr, descr2, + fd); + } +} + +ATF_TC_WITHOUT_HEAD(closerange_CLOEXEC); +ATF_TC_BODY(closerange_CLOEXEC, tc) +{ + int i, start; + + start = highest_fd(); + ATF_REQUIRE(start >= 2); + for (i = 0; i < 8; i++) (void)devnull(); - fd = highest_fd(); - start = fd - 8; - if (close_range(start + 1, start + 4, CLOSE_RANGE_CLOEXEC) < 0) - fail_err("close_range(..., CLOSE_RANGE_CLOEXEC)"); - flags = fcntl(start, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOEXEC) != 0) - fail("close_range", "CLOSE_RANGE_CLOEXEC set close-on-exec " - "when it should not have on fd %d", start); - for (i = start + 1; i <= start + 4; i++) { - flags = fcntl(i, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOEXEC) == 0) - fail("close_range", "CLOSE_RANGE_CLOEXEC did not set " - "close-on-exec on fd %d", i); - } - for (; i < start + 8; i++) { - flags = fcntl(i, F_GETFD); - if (flags < 0) - fail_err("fcntl(.., F_GETFD)"); - if ((flags & FD_CLOEXEC) != 0) - fail("close_range", "CLOSE_RANGE_CLOEXEC set close-on-exec " - "when it should not have on fd %d", i); + ATF_REQUIRE_INTEQ(start + 8, highest_fd()); + + ATF_REQUIRE_INTEQ(0, close_range(start + 2, start + 5, + CLOSE_RANGE_CLOEXEC)); + for (i = 1; i < 9; i++) { + require_fd_flag(start + i, "CLOSE_RANGE_CLOEXEC", + "close-on-exec", FD_CLOEXEC, i >= 2 && i <= 5); } - if (close_range(start, start + 8, 0) < 0) - fail_err("close_range"); - ok("close_range(..., CLOSE_RANGE_CLOEXEC)"); + ATF_REQUIRE_INTEQ(0, close_range(start + 1, start + 8, 0)); +} - return (0); +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, closefrom_simple); + ATF_TP_ADD_TC(tp, closefrom_with_holes); + ATF_TP_ADD_TC(tp, closefrom_zero); + ATF_TP_ADD_TC(tp, closefrom_negative_one); + ATF_TP_ADD_TC(tp, closefrom_in_holes); + ATF_TP_ADD_TC(tp, closerange_basic); + ATF_TP_ADD_TC(tp, closefrom_zero_twice); + ATF_TP_ADD_TC(tp, closerange_CLOEXEC); + + return (atf_no_error()); } From nobody Thu Dec 18 20:48:05 2025 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 4dXN6F2Dhmz6LlJs for ; Thu, 18 Dec 2025 20:48: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXN6F1DKsz3PV8 for ; Thu, 18 Dec 2025 20:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766090885; 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=1aG+Abcj8+YjuBd0wFqtj16dl1jT/speX5cl0ePUSeQ=; b=WAJSk4+8eJFyGAIPJj4R9V8aqcjQDa0ArjegptaXq0aktN3YJ77OylwW/tTde8d96kMR8g vmpS5ti2a9qZgjFOSdIoIRIq7rcm3c1V+rWyNM5+gN1jFSKzMD7Mh5mvTwbPFbAcP47qwv AqVntyXYsZPbrhtWUX1/CfdejP8NStMO1orDSIuWhPK4DtWcyNh0UqcoEMEExWEZX3Hp/s ZiE+nVbVmUlRb73FAnLrrEa5/MgkfhYAvbwI6P3rpJbp3FvkEJ6KVsQ2yB4KuX1g+2Cvaf oWXLFCX4Bgt9MduPONSLEgdsYTdmjvQiW65x79Xtbe+gKKJ6ZxNaBsUU4ZK0gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766090885; 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=1aG+Abcj8+YjuBd0wFqtj16dl1jT/speX5cl0ePUSeQ=; b=NmRHG8T4gX3AzdInArA4HiqULybMT/mZMoEjz95F9ywLweioD9vk78c6DP1Hd7MFWkaXu3 lZsbKkjrvA+dEI/HDdtY0IprSxRNqEaK9PkXyhovX9/ypQxFNR5BokoH3M8/jLjOT5FZhs 3AIpNodeok9CLv4+pt6PxgXBfdrxHLJVZf/Ar0ryYqOy4qYQgY9q+JWZ7A5ygAUhi0BhVz o5FGG1S94SD59AGaEtlm7BVnJVnEbqJMPYKOBYwrzuXxVrvp9Xuo3CxfUqrBLGa/igEEZa tfr0g7meXidIAIxI+i7C7MiFBCpaJhhPdK4iGY1zsQIewDMS9oH/E0pe1+Gk+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766090885; a=rsa-sha256; cv=none; b=IkDtz3lQZCM/DdGNbFRmrz3RI3ZjtpP+pFQkRT1ujLCUKVn/mhjS/PO6ESC2gOygTao9ps u7mJB4fF+XyPzj6qNo11gkFUcNPsfTI/6iydDP1uLA2lE8x/UPvbKKnolYq5Xk5hGn00Xl rAxaisC1EEw7hf3Ao6EU/7vYdpgAi8Xa3C17wHFaV/kKMwzkfeJESqBIX3BzRcI2C1qeQj ZVAyLe1uH7ZECmX71H3F2oQfKkX2Q5vx/K9u/BRf+qc72LwNnNnWW+ctTRzZ/GHvsTochI 88B0PCqlH7a7ht1MEmqMAGJSwqo3DLAH4NNZp8T1khgF20wpym3bd+rBbkjNnA== 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 4dXN6F0YNrzv7r for ; Thu, 18 Dec 2025 20:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b4f0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 20:48:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3fbce8315ee2 - stable/15 - bus_alloc_resource: First step in passing resource IDs by value 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3fbce8315ee22ef3a3e0fde3c57130e6ad16535f Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 20:48:05 +0000 Message-Id: <69446885.3b4f0.2bd35ddf@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3fbce8315ee22ef3a3e0fde3c57130e6ad16535f commit 3fbce8315ee22ef3a3e0fde3c57130e6ad16535f Author: John Baldwin AuthorDate: 2025-10-30 15:14:27 +0000 Commit: John Baldwin CommitDate: 2025-12-18 20:22:05 +0000 bus_alloc_resource: First step in passing resource IDs by value Add wrapper inline functions for bus_alloc_resource* that accept a resource ID by value (instead of a pointer). The rest of the bus resource API (outside of compat shims) does not accept resource IDs as arguments, but instead obtains the resource ID from the resource itself when needed. As such, there is no reason to return any potentially modified resource IDs to the caller. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53401 (cherry picked from commit 7eb213614b90cde31707a53c4b8ae6acacf2aa0f) --- share/man/man9/bus_alloc_resource.9 | 24 +++++++-------------- sys/kern/subr_bus.c | 2 +- sys/sys/bus.h | 42 +++++++++++++++++++++++++++++++++++++ sys/sys/param.h | 2 +- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9 index 27c64c608c70..210abb3074e1 100644 --- a/share/man/man9/bus_alloc_resource.9 +++ b/share/man/man9/bus_alloc_resource.9 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 20, 2016 +.Dd October 30, 2025 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -43,14 +43,14 @@ .In machine/resource.h .Ft struct resource * .Fo bus_alloc_resource -.Fa "device_t dev" "int type" "int *rid" "rman_res_t start" "rman_res_t end" +.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t end" .Fa "rman_res_t count" "u_int flags" .Fc .Ft struct resource * -.Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" +.Fn bus_alloc_resource_any "device_t dev" "int type" "int rid" "u_int flags" .Ft struct resource * .Fo bus_alloc_resource_anywhere -.Fa "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" +.Fa "device_t dev" "int type" "int rid" "rman_res_t count" "u_int flags" .Fc .Sh DESCRIPTION This is an easy interface to the resource-management functions. @@ -106,15 +106,13 @@ for I/O memory .El .It .Fa rid -points to a bus specific handle that identifies the resource being allocated. +is a bus specific handle that identifies the resource being allocated. For ISA this is an index into an array of resources that have been setup for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of resources described by the PC Card's CIS entry. For PCI, the offset into PCI config space which has the BAR to use to access the resource. -The bus methods are free to change the RIDs that they are given as a parameter. -You must not depend on the value you gave it earlier. .It .Fa start and @@ -170,20 +168,12 @@ A pointer to is returned on success, a null pointer otherwise. .Sh EXAMPLES This is some example code that allocates a 32 byte I/O port range and an IRQ. -The values of -.Va portid -and -.Va irqid -should be saved in the softc of the device after these calls. .Bd -literal struct resource *portres, *irqres; - int portid, irqid; - portid = 0; - irqid = 0; - portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &portid, + portres = bus_alloc_resource(dev, SYS_RES_IOPORT, 0, 0ul, ~0ul, 32, RF_ACTIVE); - irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid, + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE); .Ed .Sh SEE ALSO diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f75345415265..755d7d41899f 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4651,7 +4651,7 @@ bus_release_resources(device_t dev, const struct resource_spec *rs, * parent of @p dev. */ struct resource * -bus_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, +(bus_alloc_resource)(device_t dev, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct resource *res; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 77250bb1df4c..a0967178830f 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -600,6 +600,48 @@ bus_alloc_resource_anywhere(device_t dev, int type, int *rid, return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags)); } +/* Compat shims for bus_alloc_resource API. */ +static __inline struct resource * +bus_alloc_resource_const(device_t dev, int type, int rid, rman_res_t start, + rman_res_t end, rman_res_t count, u_int flags) +{ + return (bus_alloc_resource(dev, type, &rid, start, end, count, flags)); +} + +static __inline struct resource * +bus_alloc_resource_any_const(device_t dev, int type, int rid, u_int flags) +{ + return (bus_alloc_resource(dev, type, &rid, 0, ~0, 1, flags)); +} + +static __inline struct resource * +bus_alloc_resource_anywhere_const(device_t dev, int type, int rid, + rman_res_t count, u_int flags) +{ + return (bus_alloc_resource(dev, type, &rid, 0, ~0, count, flags)); +} + +#define bus_alloc_resource(dev, type, rid, start, end, count, flags) \ + _Generic((rid), \ + int *: bus_alloc_resource, \ + unsigned int *: bus_alloc_resource, \ + default: bus_alloc_resource_const) \ + ((dev), (type), (rid), (start), (end), (count), (flags)) + +#define bus_alloc_resource_any(dev, type, rid, flags) \ + _Generic((rid), \ + int *: bus_alloc_resource_any, \ + unsigned int *: bus_alloc_resource_any, \ + default: bus_alloc_resource_any_const) \ + ((dev), (type), (rid), (flags)) + +#define bus_alloc_resource_anywhere(dev, type, rid, count, flags) \ + _Generic((rid), \ + int *: bus_alloc_resource_anywhere, \ + unsigned int *: bus_alloc_resource_anywhere, \ + default: bus_alloc_resource_anywhere_const) \ + ((dev), (type), (rid), (count), (flags)) + /* Compat shims for simpler bus resource API. */ int bus_adjust_resource_old(device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end); diff --git a/sys/sys/param.h b/sys/sys/param.h index fe7ceeb90e9d..d4afa1be7bc5 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -74,7 +74,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500503 +#define __FreeBSD_version 1500504 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Dec 18 20:48:07 2025 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 4dXN6H4Fxsz6LlK0 for ; Thu, 18 Dec 2025 20:48:07 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXN6H35vnz3PPr for ; Thu, 18 Dec 2025 20:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766090887; 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=H0S7GZbhtSw6wTlxF1uTScva0AnRnXikFJWJ1TsoFE4=; b=dR4D5lESt3xNNvTNa7b2ObgyrEd5QcfrxAEPLPTvayYPkUuSZ51jOo0jYJTGVRvuRJ38Z1 3CjOJb7Fo/4CH823h5w/EShWVOM81W/qelFBuSPb8xMyqk0ptZg/kd/xh3EWTlLKFnWFRB 1IyRetXBDlWCJozfIua8JZw82MHeBQdkHN4kr7oEcjEsD/jwBscSdqOmqkMm0e//PvvkZC Ht2f2UlhWgJ+7GVpCUonT4Ce/2GqIaT9T2hRPcfeVLk7FGTKuBXCSWYzNWw9FGjybQFLRE TEVEr+qksV/tyexGCWvIMh8U/0tM79/N6LzSN6gLtVzASeJ2w6SLH1G34aU4Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766090887; 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=H0S7GZbhtSw6wTlxF1uTScva0AnRnXikFJWJ1TsoFE4=; b=Zwmi7oEV3fsy+jI4JXnUYuK1Bh8GSVITlkylDKo/5Wx0dWangOPS1q15Oq8ZlnmAgnUbX/ yb5xRkJh1Lnop4rCZsOEZ3BdGik9Ja/herpq8cKrQbKw3GYCRa4w5Nm4hkzJkWBRtWMUxB aHQ53Ro8K3gpPQUTxLjxU5Vo9S9AaRX4KenxnmnWiRwqTK9Y2BZFB1VAQBOMEeNLNkPhvO Wtxj5aNF8eSoAnGnceE3uvkDW+DAQzwjKlyPjSTjMKoV/fbw9RBs1MABtV7gDXnPbhpYvu 4TLvLMyNffp/XCdLY16ze14y9zQVcxDsRZAsVlGdz2Pa0r2wYQS9Bi6V/BU+nQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766090887; a=rsa-sha256; cv=none; b=gp5iRS9+15ZetU05bc5NE8+1exOLOcxGJ4I8TLYRm6g5v92h9VWurCGJ73KCmYk99ZMnJ0 gysoKGVupwhYGEKbOkdXB26YEkaHiQvUD8G+L6BWeCaocjutMqad/nrWVLhXZUR7RsJLcl N6KVc36M8itrfFR8HpYxMr61Ekpj6N3xF6mS8MOa5ZocGGaamv42wTs6zy42Xu1YVqcagv MljirmLnaCCpWNw+tSSMILcefYe5+tShWs3TLYw+9KPwEIdgSjlec7oKIJKGErlFwt7Kjj CGza3FcPbJr5UPxa8ieKGjDGXNPrAv4klbj7B2HoRZhpYb5/g1763KSPOBX8nw== 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 4dXN6H2CPXzv7s for ; Thu, 18 Dec 2025 20:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c0d5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 20:48:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 108b5d90bc1f - stable/14 - bus_alloc_resource: First step in passing resource IDs by value 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 108b5d90bc1fa8ed83cfd6f58e636193e03e8049 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 20:48:07 +0000 Message-Id: <69446887.3c0d5.7d4cc482@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=108b5d90bc1fa8ed83cfd6f58e636193e03e8049 commit 108b5d90bc1fa8ed83cfd6f58e636193e03e8049 Author: John Baldwin AuthorDate: 2025-10-30 15:14:27 +0000 Commit: John Baldwin CommitDate: 2025-12-18 20:22:46 +0000 bus_alloc_resource: First step in passing resource IDs by value Add wrapper inline functions for bus_alloc_resource* that accept a resource ID by value (instead of a pointer). The rest of the bus resource API (outside of compat shims) does not accept resource IDs as arguments, but instead obtains the resource ID from the resource itself when needed. As such, there is no reason to return any potentially modified resource IDs to the caller. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53401 (cherry picked from commit 7eb213614b90cde31707a53c4b8ae6acacf2aa0f) --- share/man/man9/bus_alloc_resource.9 | 24 +++++++-------------- sys/kern/subr_bus.c | 2 +- sys/sys/bus.h | 42 +++++++++++++++++++++++++++++++++++++ sys/sys/param.h | 2 +- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9 index 84a4c9c530c9..5d309229a34e 100644 --- a/share/man/man9/bus_alloc_resource.9 +++ b/share/man/man9/bus_alloc_resource.9 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 20, 2016 +.Dd October 30, 2025 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -43,14 +43,14 @@ .In machine/resource.h .Ft struct resource * .Fo bus_alloc_resource -.Fa "device_t dev" "int type" "int *rid" "rman_res_t start" "rman_res_t end" +.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t end" .Fa "rman_res_t count" "u_int flags" .Fc .Ft struct resource * -.Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" +.Fn bus_alloc_resource_any "device_t dev" "int type" "int rid" "u_int flags" .Ft struct resource * .Fo bus_alloc_resource_anywhere -.Fa "device_t dev" "int type" "int *rid" "rman_res_t count" "u_int flags" +.Fa "device_t dev" "int type" "int rid" "rman_res_t count" "u_int flags" .Fc .Sh DESCRIPTION This is an easy interface to the resource-management functions. @@ -106,15 +106,13 @@ for I/O memory .El .It .Fa rid -points to a bus specific handle that identifies the resource being allocated. +is a bus specific handle that identifies the resource being allocated. For ISA this is an index into an array of resources that have been setup for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of resources described by the PC Card's CIS entry. For PCI, the offset into PCI config space which has the BAR to use to access the resource. -The bus methods are free to change the RIDs that they are given as a parameter. -You must not depend on the value you gave it earlier. .It .Fa start and @@ -175,20 +173,12 @@ A pointer to is returned on success, a null pointer otherwise. .Sh EXAMPLES This is some example code that allocates a 32 byte I/O port range and an IRQ. -The values of -.Va portid -and -.Va irqid -should be saved in the softc of the device after these calls. .Bd -literal struct resource *portres, *irqres; - int portid, irqid; - portid = 0; - irqid = 0; - portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &portid, + portres = bus_alloc_resource(dev, SYS_RES_IOPORT, 0, 0ul, ~0ul, 32, RF_ACTIVE); - irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid, + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE); .Ed .Sh SEE ALSO diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index ce7209e5f852..078ea7002013 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4676,7 +4676,7 @@ bus_release_resources(device_t dev, const struct resource_spec *rs, * parent of @p dev. */ struct resource * -bus_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, +(bus_alloc_resource)(device_t dev, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct resource *res; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index a2189e068293..a9b22cd5d6cb 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -617,6 +617,48 @@ bus_alloc_resource_anywhere(device_t dev, int type, int *rid, return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags)); } +/* Compat shims for bus_alloc_resource API. */ +static __inline struct resource * +bus_alloc_resource_const(device_t dev, int type, int rid, rman_res_t start, + rman_res_t end, rman_res_t count, u_int flags) +{ + return (bus_alloc_resource(dev, type, &rid, start, end, count, flags)); +} + +static __inline struct resource * +bus_alloc_resource_any_const(device_t dev, int type, int rid, u_int flags) +{ + return (bus_alloc_resource(dev, type, &rid, 0, ~0, 1, flags)); +} + +static __inline struct resource * +bus_alloc_resource_anywhere_const(device_t dev, int type, int rid, + rman_res_t count, u_int flags) +{ + return (bus_alloc_resource(dev, type, &rid, 0, ~0, count, flags)); +} + +#define bus_alloc_resource(dev, type, rid, start, end, count, flags) \ + _Generic((rid), \ + int *: bus_alloc_resource, \ + unsigned int *: bus_alloc_resource, \ + default: bus_alloc_resource_const) \ + ((dev), (type), (rid), (start), (end), (count), (flags)) + +#define bus_alloc_resource_any(dev, type, rid, flags) \ + _Generic((rid), \ + int *: bus_alloc_resource_any, \ + unsigned int *: bus_alloc_resource_any, \ + default: bus_alloc_resource_any_const) \ + ((dev), (type), (rid), (flags)) + +#define bus_alloc_resource_anywhere(dev, type, rid, count, flags) \ + _Generic((rid), \ + int *: bus_alloc_resource_anywhere, \ + unsigned int *: bus_alloc_resource_anywhere, \ + default: bus_alloc_resource_anywhere_const) \ + ((dev), (type), (rid), (count), (flags)) + /* Compat shims for simpler bus resource API. */ int bus_adjust_resource_new(device_t child, struct resource *r, rman_res_t start, rman_res_t end); diff --git a/sys/sys/param.h b/sys/sys/param.h index 26f201a21715..73f122785266 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1403506 +#define __FreeBSD_version 1403507 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Dec 18 22:57:32 2025 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 4dXQzd2hhQz6LyjF for ; Thu, 18 Dec 2025 22:57: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXQzd11d4z3qRn for ; Thu, 18 Dec 2025 22:57:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098653; 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=1whR0sHoFf4dKNSGN/CyxUIbmUBXAa3Q2qAk177NeDw=; b=GAZuRr26AAyW83cfgR4h+6/8vbx6v5i3TbcbhMYUfXpfmVQyKBRt7HUamM0mxfmYCOLtBR DEWr4BuPA/chNEcyCf3vrgbInjaN2UbvH5BBQXpEPBuKg00PFfsmlI84N0p60FamL2696Y WZX0OJP0C/oxq/gRt1NfFuQMLdArICXy422cJi+QxdHol3jCtdEU5fJgav7pnDxTgNSEFQ Jaef4iLnhRB1q6CRAyEuOCzh9zmYTvYQ3XgKLag28o/OE4Yx8Wd2V0cas5QSc9PHcNANJY tJ6CGxz//zLq+7zJu4Zx3P9us2i9tGxw/1hhtVxtxus47JdQkATw6/g9yZrr7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098653; 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=1whR0sHoFf4dKNSGN/CyxUIbmUBXAa3Q2qAk177NeDw=; b=se/5GPWQJQX+DsmGCyFnfObbHRU8HP8SeWA6fU/kBtQkHIsdn95kpRfnnujQqU0AOlN/e/ 9JUTOom6ebPOB/sLh03FFiSl7+CRLcHMtHhbKZPqkX3WWOdsa19WSsR08ylYYaYEEilGFv tD6TBXqVQMPmMAgI9BN1qvp/tig/FChJyjY+DBWUn8unl5qt+ce/WsTru04dy76nlPCcf8 isNJKMbQqzix8xwtMaikcpWr/p98ZysV6M24281YoWvXM6w32TgPNCugj/AVFr7wt4H4ga OKzMul+/rPH/glvwyrAs8GaiZ5KZeeSiieRqu8uiZe8VzZyDLIrX35QuIfjloA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098653; a=rsa-sha256; cv=none; b=xA37EfQsm4DK1bX9T5xYxKNhq74n3f5eJEJnxGxRwrrpChbf95z0iGHXHokMw9UZ0MOmks lJlGaiNC5xfIYbQpVNKBfiKeLH/4cBwPBQHGYiFsUEJ/oX3SRK4fRdJ4vd5sl+j9fpQS5a MhGIHSCPdQeJo7ugj7G3i3aPL/EBRM36dO9Wd9GfP4OXUIFmL5dcGK5RG/jQp1BZKNPrKW SUu40NLUV3JoCPc8ICSu8wheAkg0OuIIuv1ZmobmHVmvqEcnaPNbZPlO27iGaZNz/oq/CZ sWfMV2sYG0LgwUIK7WfvOthHT2d3tYnBM+JltkbKsyCHojW1Hf8F5HlAdUmoVQ== 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 4dXQzc6kGCzy33 for ; Thu, 18 Dec 2025 22:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8942 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c6504647e06a - stable/15 - kmod.mk: Remove a trailing reference to pccarddevs.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c6504647e06aa62474559fa162d9b385650a60de Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:32 +0000 Message-Id: <694486dc.8942.714de4ea@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c6504647e06aa62474559fa162d9b385650a60de commit c6504647e06aa62474559fa162d9b385650a60de Author: John Baldwin AuthorDate: 2025-11-12 14:29:04 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:36:38 +0000 kmod.mk: Remove a trailing reference to pccarddevs.h Fixes: 31b35400cf77 ("pccard: Remove more of the PC Card infrastructure") (cherry picked from commit 6bf611ada21216aefcd830ba71fbf0b5d776ea47) --- sys/conf/kmod.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 0fd2d4050cf1..6e20dce0653f 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -472,7 +472,7 @@ CLEANFILES+= ${_i} .m.h: ${SYSDIR}/tools/makeobjops.awk ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h -.for _i in mii pccard +.for _i in mii .if !empty(SRCS:M${_i}devs.h) CLEANFILES+= ${_i}devs.h ${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs From nobody Thu Dec 18 22:57:34 2025 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 4dXQzf4T5cz6LywG for ; Thu, 18 Dec 2025 22:57:34 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXQzf1PCqz3qVR for ; Thu, 18 Dec 2025 22:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098654; 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=sHLQVwknsoMuXI2a+6AtRhx0MGNG+ar/motp+jwNm8s=; b=JuhjBr1FOuKofT8Nd15cVJP3lVpuCUUMmuEZ3WGd3M90Q6eNQUb0O3wvZ5L+ssv1v8Pv2w ywdFPG9grR/fjlw0xtlT3XOveIkGMcXuNMZzmT8pSd7X+qjV0aCXr/ajdiccbMB5Z91IaE OQjwjtR02g4iTGfVSLlRhTBkdW+hL/L19hoO+WrThJpVzFZqY7AN/5oIJ75TGAJQl8jVdr WEvQZsgNDTRkvngHMEN6YAZi3X5wAHCOrKV9A4tRkMSImxeCbAU1o3a7Vg8bM94k8DDdAR OSNlTxuIUzEzr7GtMk0IaJaCR3PwZYe4pb1atUGes/8MldVDXtfwDtuBRabKkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098654; 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=sHLQVwknsoMuXI2a+6AtRhx0MGNG+ar/motp+jwNm8s=; b=D1WFgTEXqbG667N4ROgiAvI2KyAoSYF4f6iShrK3YyXvoeIe0fkRVzn8vNXvzZ5XGEORoO itjMcGYHXIvI7KsJi32YEkX8JqZFgrYjBQizgEjHMi37wyJsEEWRM7s5P2swHc3on1F0tf dE6FjJUKcAPkfLDHGF0pIP4cpmscNUCjbr0BOX5AEILf6fC2EyKP58rOZ0nBuk7U4NxQM+ XJiJxdRi7HeTwrHXWP6FdTsGaTQn4CNiXwn79DVLDjmmZY5FUBkTSB6O7yFqFFvVO5psD6 iwthBsAy7BfJpzG4obZygaVnx0n3c+81GFq9HvRWhgcGnS129pEWTt1Ufj+Xtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098654; a=rsa-sha256; cv=none; b=EhCUtcZ7mW7HBYmJUReGaMXhQPCX+ZIkFiodhj4BzwLYJjGNMcrsKPoUzag65lNXoZZxVB ugYRNbxf4ZjgzgAFciac4lTNVNeHTLUdeBdI+caau0WbhCTatKL1JMa2zKQR7XhTA7k5OL qho6gsfVw2EV0bRxmlGS0O/AvviTE50ymUPld3OLZe0j1R66JwPc7WPdhd27+SZU+3bw32 xIni4qGhe84cW+8a8+vXN4skb7Q+TwzfnWRfwQXZ6+q0jKahAsRgtObkvTvs1w+s9goNR8 ULVtORKdrveHKM3Tgom4FizqROg1EyR4OJL8NSFIqND+tmcCSLHuIbaFqWMPgQ== 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 4dXQzf0NkjzyKp for ; Thu, 18 Dec 2025 22:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9f9c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: fe9134294b22 - stable/15 - apm(8): Drop MLINK to apmconf(8) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fe9134294b22c232b60e666af2ec5d671ea053b3 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:34 +0000 Message-Id: <694486de.9f9c.5d2d6387@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fe9134294b22c232b60e666af2ec5d671ea053b3 commit fe9134294b22c232b60e666af2ec5d671ea053b3 Author: John Baldwin AuthorDate: 2025-11-13 02:36:14 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:50:14 +0000 apm(8): Drop MLINK to apmconf(8) apmconf(8) was merged into apm(8) back in 2000 and this note and MLINK were added as a transition aid, but that aid is no longer needed. (cherry picked from commit daa1f9b415f3bca82cc7a6e555c9c56e1b1c44f5) --- ObsoleteFiles.inc | 3 +++ usr.sbin/apm/Makefile | 1 - usr.sbin/apm/apm.8 | 9 +-------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1390c072afbc..e7ddca0e47bc 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20251218: Remove old MLINK to apmconf(8) +OLD_FILES+=usr/share/man/man8/apmconf.8.gz + # 20251208: Rename iwm8000C to correct name. OLD_FILES+=boot/firmware/iwm8000C diff --git a/usr.sbin/apm/Makefile b/usr.sbin/apm/Makefile index f6c42194401f..f9b3e11d22fa 100644 --- a/usr.sbin/apm/Makefile +++ b/usr.sbin/apm/Makefile @@ -1,6 +1,5 @@ PROG= apm MAN= apm.8 -MLINKS= apm.8 apmconf.8 MANSUBDIR= /${MACHINE_CPUARCH} PACKAGE=apm diff --git a/usr.sbin/apm/apm.8 b/usr.sbin/apm/apm.8 index d6ede22066da..e295ec989a73 100644 --- a/usr.sbin/apm/apm.8 +++ b/usr.sbin/apm/apm.8 @@ -9,7 +9,7 @@ .\" the author assume any responsibility for damages incurred with its .\" use. .\" -.Dd December 22, 2009 +.Dd November 12, 2025 .Dt APM 8 i386 .Os .Sh NAME @@ -120,13 +120,6 @@ If no options are specified, displays information and current status of APM in verbose mode. If multiple display options are given, the values are displayed one per line in the order given here. -.Sh NOTES -.Xr apmconf 8 -has been merged in -.Nm -and thus -.Nm -replaces all of its functionality. .Sh SEE ALSO .Xr apm 4 , .Xr zzz 8 From nobody Thu Dec 18 22:57:35 2025 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 4dXQzg3Mrbz6Lyyj for ; Thu, 18 Dec 2025 22:57:35 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXQzg1ld1z3qVS for ; Thu, 18 Dec 2025 22:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qeGzqhY4qI2wegTqjKGCZ6cUUFUfqbV3/gejt1FEtG8=; b=WDkQ6i70IbZVumv+F9iqUfqGHseVx8mkcIGNt53EkPokr/tpbBy12Mh3/R5/OZf5go+vOC lvxwCYiokgls7Rs/PVrXC2e1CgvLeHdVZ5QYx3EFbTCjqo0m3gyJ4hW/EEuKY4XD2SbLAI IHd18oMa24D9uj+O3fmx1jIa1IbTtXkYSLoQKaG1W1bMIDcNSPt3sFtz/pSpnr2jRifjEZ eX5WoJM5MMgucEAPcOjXtRtdVYYGLrPtFnCIRQRnNmC7sNMCk36DBRDmnJkyWdHElFtByj npULNPCPghUYqBrCf5htRGvASUFe6rkktjmpuHlJJ+amHQg7raqG2Vkq/NwVhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qeGzqhY4qI2wegTqjKGCZ6cUUFUfqbV3/gejt1FEtG8=; b=JNwHnWy9XATZi0wDykaAFDc00kzW/QPaQz35tWLAAmf1/oK5JgVIFeSakb+aiUGYQPlFAe tylmjYKY4Ie5OYyxjNcLtOv86B+KwQz+JMm30PgPZI+QRva/pG0II9HejNfybNOI8/NSaD dPd5HS9MmXPJsoogzRC5IaxdfgFZiYEpOXpB0cCmYMii6G5FlgO5R2VFmqT2PforFH7QVL z7gZvQjagXNjRIw/q1x9XZTxI+HRfod+acBcUgxpgJSnR17o+1Djv0KaqnFRcXOuSLKGal IBa53bfzP/1+Fo9cawjdgX4djFTY2jyfLGEJJmmwVcyTl65OXR93af/SOVWNHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098655; a=rsa-sha256; cv=none; b=kHsOc2TWhk9H1H2UCRwZx9Vnc6qYREJpzHjzSEhX5fm0tkOlVBLZYr83T0d0iFDFkszOEW 6oU6n6w2xfro3ph2ag8fAiAxu50BxBS0ohrHrNU78i7DWDBV9XvyjBqgZhZ9Ai4eoETAwv Eu1kPJ0nq0JGBh+SMhK46ZuMCvgFpB/NrbRGC5qhRE8XnwD6Wavf3+pQSTuBnu6qbRJ3L0 0YKKG2rKA9Cb3FBbV26oeigZRCK/Kfi6igTCCN8kErVcGZ1xMHmke+9CHbbtTG4tZVY0D+ EOVi2AJbT1Zq8Ee23BR8s+HlGW4UO4+7MoChQKjwm6PRoQwAjgelzXB4MUaJkg== 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 4dXQzg19XHzxpH for ; Thu, 18 Dec 2025 22:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id a1a4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Hesham Almatary From: John Baldwin Subject: git: 37e9b420b23a - stable/15 - arm64: Fix calculating kernel size for preload metadata 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 37e9b420b23a4d39400a5f8d1fe0c15bc1e04230 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:35 +0000 Message-Id: <694486df.a1a4.1cfe0a45@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=37e9b420b23a4d39400a5f8d1fe0c15bc1e04230 commit 37e9b420b23a4d39400a5f8d1fe0c15bc1e04230 Author: Hesham Almatary AuthorDate: 2025-11-13 14:57:54 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:51:50 +0000 arm64: Fix calculating kernel size for preload metadata Cast &end to vm_offset_t before subtracting VM_MIN_KERNEL_ADDRESS to ensure the resulting size is correct for PRELOAD_PUSH_VALUE. Previously the correct size was effectively divided by sizeof(void *). Reviewed by: andrew Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D53699 (cherry picked from commit 587490dabc649b58f0c7966e749aa80a0f16796b) --- sys/arm64/arm64/machdep_boot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index 83bd74ea7317..1c5e8189e436 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -106,7 +106,8 @@ fake_preload_metadata(void *dtb_ptr, size_t dtb_size) PRELOAD_PUSH_VALUE(uint32_t, MODINFO_SIZE); PRELOAD_PUSH_VALUE(uint32_t, sizeof(size_t)); - PRELOAD_PUSH_VALUE(uint64_t, (size_t)(&end - VM_MIN_KERNEL_ADDRESS)); + PRELOAD_PUSH_VALUE(uint64_t, + (size_t)((vm_offset_t)&end - VM_MIN_KERNEL_ADDRESS)); if (dtb_ptr != NULL) { /* Copy DTB to KVA space and insert it into module chain. */ From nobody Thu Dec 18 22:57:36 2025 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 4dXQzh4NPNz6Lyr2 for ; Thu, 18 Dec 2025 22:57:36 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXQzh2PYfz3qRw for ; Thu, 18 Dec 2025 22:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098656; 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=qit+5TllcrKh5GfoHcYJmnz3ILhZFPTU1kZhGyFUPa8=; b=Jx4qAQjQuRDf1nOQqdSJ+gFjZ4EvZ4qtRPayhB0vviqibmitrje+SyZZEOV+P5YE4booNX QffKN+8kOfQXTlMMLeY+YSEeGv+RT6eBi1cVaeF2eHthqOgKWUvSKF0Gu5lRKU0ngZbnd+ XFzrg+1o2CsB/XCNeETnN3JQ6yDu5n0TTc4wFErVQzAPnbSIpvhagGx8ayLeKhk6oQrQ42 AoFhWlIN5gVEuFZSdjop2hMb5kht4PzFA3A2rmyjvMrN2FH0ZBMSoQmX0TGYAWtc37DWRv nLbvSHkyKhlY5Lvj/r8xIrVEV9u+9yTpMRIu9f6pFq6r8mOknMiRB5uvgMcVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098656; 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=qit+5TllcrKh5GfoHcYJmnz3ILhZFPTU1kZhGyFUPa8=; b=ilLYjo+P+ygl2DEuoqUIk5ff9bfhvPS534xb1UdhtoUHiEYD4DGYTNTsmTt6ZzDLp/Ylly xS+ajOKBpj4hR6GOdkUB2on2GhMYH/XFzrGW4srO36Eb6FSvsrUmB30sauTOYHHJhz9Ok9 W11gwPAsDfM4R4cI8Btxi1TMPOeOXoYtG7VuBDiuvFer8vT8NrqizjGTpnK4OpcSuihhe2 lP4im2MYyDa9LglMGxvnUbysb4rgyMUVzXTBPIvlZb+l5M0QYZBviDxlctkG7Bky4K+5fH tGDozEeVI0HcTzmPCTN82AJorgwzymaMrlkI5IavKmIEtTCE5/HEHUJ1/q+/vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098656; a=rsa-sha256; cv=none; b=RlmMWvhyqNjD5EDDZQs4klX+xgRt5fzbOpcWZ5+JWY9fuO0r8l2pIVsVxMALhJ4x8/YFS3 hqegYrWeZ8hLdeifkyZo/ldCSiCEzcNy56s3U/iZCjakWJpYRsN8kBvgBJ8JREYA9ehZSU AgTNdkEKYj494DvdaaWZtJiUOvVfgnW3kUEzLprvbZWVS1uf1dkaqwUmvSY9I0VdCaLdnD 5KrKSVjLNvW/9z8NLBg2Un17t8Ft9Bfe81o9OPR0BKWCoOZCmXzotFb2mgz3NhufdzPe4Z w8ybIs71jm33FQp8JNwZcteMQo43Amz7aYlycC6xvUWscK7n/xIvLxFo8s3QyQ== 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 4dXQzh1x7gzyHN for ; Thu, 18 Dec 2025 22:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47bcc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 400e08173e84 - stable/15 - loader.efi.8: Minor formatting nits 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 400e08173e84bdc4096844e5e16a7a7713993754 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:36 +0000 Message-Id: <694486e0.47bcc.62f0a4d0@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=400e08173e84bdc4096844e5e16a7a7713993754 commit 400e08173e84bdc4096844e5e16a7a7713993754 Author: John Baldwin AuthorDate: 2025-11-22 13:10:20 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:52:11 +0000 loader.efi.8: Minor formatting nits - Add several missing .Pp after lists and literal blocks. - Fix the column widths for the console table and use a shorter indent so that it doesn't wrap on an 80-col display. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53866 (cherry picked from commit 46d05a49a1d0d655af6cae2afd48a973698cbf71) --- stand/man/loader.efi.8 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index c488ac257804..d9a5c827ba71 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -158,6 +158,7 @@ The serial ports are assigned as follows on IBM PC compatible systems: .It COM3 Ta 0x3e8 Ta Pa /dev/uart2 .It COM4 Ta 0x2e8 Ta Pa /dev/uart3 .El +.Pp Though .Dv COM3 and @@ -191,8 +192,9 @@ of any behavior not covered in this document. .It Fl s Ta Dv boot_single Ta Va RB_SINGLE .It Fl v Ta Dv boot_verbose Ta Va RB_VERBOSE .El +.Pp And the following flags determine the primary console: -.Bl -column -offset indent ".Sy Flags" ".Sy Kernel Flags" ".Sy Kernel Consoles" ".Sy Primary Console" +.Bl -column -offset xxx "Flags" "RB_SERIAL | RB_MULTIPLE" "Kernel Consoles" "Primary Console" .It Sy Flags Ta Sy Kernel Flags Ta Sy Kernel Consoles Ta Sy Primary Console .It none Ta 0 Ta Video Ta Video .It Fl h Ta RB_SERIAL Ta Serial Ta Serial @@ -380,6 +382,7 @@ To check: # mount | grep nda0p1 /dev/nda0p1 on /boot/efi (msdosfs, local) .Ed +.Pp If it's not mounted, you will need to mount it: .Bd -literal -offset indent # mount -t msdosfs /dev/nda0p1 /boot/efi @@ -398,6 +401,7 @@ BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 0 nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI \&... .Ed +.Pp Often there are several options, depending on the BIOS. The entry that we booted with is marked with a .Sq + @@ -416,6 +420,7 @@ loader, which varies by architecture. .It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI .It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI .El +.Pp However, care must be taken: some multiple-boot environments rely on a special .Pa bootXXX.efi to function. @@ -436,10 +441,12 @@ above table): .Bd -literal -offset indent # cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOTX64.EFI .Ed +.Pp Copy the loader: .Bd -literal -offset indent # cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI .Ed +.Pp replacing the all caps part of the example with the proper path. .Pp If ESP path was From nobody Thu Dec 18 22:57:53 2025 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 4dXR030mhTz6Lylg for ; Thu, 18 Dec 2025 22:57:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXR022Wdnz3qk0 for ; Thu, 18 Dec 2025 22:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7cLmNWpdbGO42zL6czUzQD38UFMhU3igltw2qkG/jqo=; b=OaI7c0cYm8N7KqGHUV64C3cXHe8tBrw1lh7ACFNt2LPRCxnePVvLmFQmYRpDpx+78Hnf6z VQ3fodi5YCYp187Hz5Ay3cPMzyg8dyQ4h2SKMNOi1ITDUjoTCROSRV3ENgcUIshKua3ozb Lmyoau4FEl3GAvshG8EGZJLMqXFp5RSxyhzKU0p4mZGNhUdNn2egYEZWmm6YFqAg0k3IwC BUL5q27AaQbVHOtyJUpE2iQFc5PQm0h85YaRKZl6MbhRus6QVc5HlMIjGo6eaHPcWJHcdm uoAqkWSxpAkWEYpAXeKLzKrAsgw9Tm70qHJygw8gnr2qSKG2CKn0EaHpnaNoaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7cLmNWpdbGO42zL6czUzQD38UFMhU3igltw2qkG/jqo=; b=D7lNxGvU0M7YeqoSeLvi3KR8ltrkCeAksSXBRX9s4SXbWvTwjQJIs4SkDC/PKX69UMRULF ivyZ0jWSfEvm0Zlk+b9o5r2MmQ85xfl2KgvKicBHjbby0QPvIKnDir0qI2b/6S7Ut9N0Qn BB1Sh8eknMYGKtHFOjJOysNJjENMmSWYN6AI5/+qBqjxDgs9WDqeMdsuvSnAaAIIkfju1e 5hNvNEOm9s8YMT7YLNuK4L5TvBwdZjVDinleGQjTwgSuTzcnd9Fhei5tc0Nf+snxaUFmQM y5nDJIPogbtNl8ol6LEv4DyIhz0aJngoVP26F3OUMPvYkcU8bA+zL+bySfiJTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098674; a=rsa-sha256; cv=none; b=grMBNjl499XOfq82yuqRp2+ldClBDc2X34qMuUHjlVhpEb/3NVmxKYakZyISKuyJ2OYpSr 5j4LwPW1gcybUP9zNX6//97DahafaKSs/COckPhgPL0NOWnuIk1w9o6+00Fm7hnqkZHOHS 930703gXXmAjqQXqIfWSbmm3UEYvqMh2TqC+ZM3FPv4BnyQcc4JqFClB+mX6P2HG/5uydS 1tJ1bsqAiFKZhMiWS7urnBipSU0zATJjhHSE1aPR5gpe7NMSWtFX7+LR13wjJdLINKosm0 0L/qEAVqshauLCl8KtSqSqtQ+N8V/DjvwefR8MHOPZXGxQKzFJDehXDlrhpKRg== 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 4dXR020brszy1Q for ; Thu, 18 Dec 2025 22:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47bd0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Muhammad Moinur Rahman From: John Baldwin Subject: git: 0002b1d651c8 - stable/14 - Retire pccard(4) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0002b1d651c8e33b5ab5bed34fe503b85e585d59 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:53 +0000 Message-Id: <694486f1.47bd0.47585717@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0002b1d651c8e33b5ab5bed34fe503b85e585d59 commit 0002b1d651c8e33b5ab5bed34fe503b85e585d59 Author: Muhammad Moinur Rahman AuthorDate: 2025-11-12 17:01:18 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:49:14 +0000 Retire pccard(4) pccard has been declared obsolete for a long time and also the support has been removed but the man page still exists. It mentions being scheduled to be removed before 13.0 but it still exists in the tree. [Extracted from review D53434] (cherry picked from commit 5b9fba1cb0d84ee297908ec4d575c33cf1f68ad5) (cherry picked from commit 8a8c58f71e80e186da3679266eef54f4180e4d11) --- ObsoleteFiles.inc | 3 ++ share/man/man4/Makefile | 1 - share/man/man4/cardbus.4 | 1 - share/man/man4/pccard.4 | 78 ------------------------------------- share/man/man4/pccbb.4 | 3 +- share/man/man4/xl.4 | 1 - share/man/man9/DEVICE_DETACH.9 | 5 +-- share/man/man9/bus_alloc_resource.9 | 5 --- usr.sbin/dumpcis/dumpcis.8 | 3 +- 9 files changed, 6 insertions(+), 94 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ff44e9930315..24322d91923e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20251218: Remove pccard(4) +OLD_FILES+=usr/share/man/man4/pccard.4.gz + # 20251023: This file is now installed in /etc/dma OLD_FILES+=usr/share/examples/dma/auth.conf diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 87f493120cda..d0db3c39db8c 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -432,7 +432,6 @@ MAN= aac.4 \ p9fs.4 \ pass.4 \ pca954x.4 \ - pccard.4 \ pccbb.4 \ pcf.4 \ pcf8574.4 \ diff --git a/share/man/man4/cardbus.4 b/share/man/man4/cardbus.4 index 3b422b44c464..fa4bce65e095 100644 --- a/share/man/man4/cardbus.4 +++ b/share/man/man4/cardbus.4 @@ -52,5 +52,4 @@ Non-zero value causes the CIS parsing of the 32-bit CardBus card to be much more verbose and include a complete CIS dump. .El .Sh SEE ALSO -.Xr pccard 4 , .Xr pccbb 4 diff --git a/share/man/man4/pccard.4 b/share/man/man4/pccard.4 deleted file mode 100644 index cec07b2336cb..000000000000 --- a/share/man/man4/pccard.4 +++ /dev/null @@ -1,78 +0,0 @@ -.\" -.\" Copyright (c) 2002 M. Warner Losh -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd August 18, 2020 -.Dt PCCARD 4 -.Os -.Sh NAME -.Nm pccard -.Nd PC Card bus driver -.Sh SYNOPSIS -.Cd device pccard -.Sh DEPRECATION NOTICE -This driver is scheduled for removal prior to the release of -.Fx 13.0 . -.Sh DESCRIPTION -The -.Nm -driver implements the PC Card bus. -The -.Nm -driver supports all PC Card bridges in the system. -.Sh TUNABLES -The driver supports the following tunable parameters, which may be -added to -.Pa /boot/loader.conf -or set via the -.Xr sysctl 8 -command: -.Bl -tag -width ".Cm hw.pccard.cis_debug" -compact -.It Cm hw.pccard.debug -Non-zero values cause more verbose information to be printed when a -16-bit PC Card is inserted or removed. -.It Cm hw.pccard.cis_debug -Non-zero value causes the CIS parsing of the 16-bit PC Card to be much -more verbose and include a complete CIS dump. -.El -.Sh FILES -.Bl -tag -width ".Pa /dev/pccard0.cis" -compact -.It Pa /dev/pccard0.cis -This exclusive-use device will report all the CIS chains present in a -PC Card, if a 16-bit PC Card is inserted in the slot. -Only one user at a time may access the CIS. -The CIS is presented as the relevant byte stream from the PC Card. -For CIS tuples in Attribute Memory (the default), only the even -locations are presented (the ODD locations are undefined per the -standard). -For CIS tuples in Common Memory, every byte is presented to the user. -Decoding of the CIS tuples is done via a userland program. -All tuples are presented to the user. -.El -.Sh SEE ALSO -.Xr cardbus 4 , -.\" .Xr mecia 4 , -.Xr pccbb 4 -.\" .Xr tcic 4 -.Rs -.%T "PC Card Standard, Release 8" -.Re diff --git a/share/man/man4/pccbb.4 b/share/man/man4/pccbb.4 index 3200e8b2d2e2..1c6cb2045033 100644 --- a/share/man/man4/pccbb.4 +++ b/share/man/man4/pccbb.4 @@ -176,5 +176,4 @@ debugging problems with the bridge chipset. .El .Sh SEE ALSO .Xr cardbus 4 , -.Xr exca 4 , -.Xr pccard 4 +.Xr exca 4 diff --git a/share/man/man4/xl.4 b/share/man/man4/xl.4 index 309434154f4e..591703ac93cb 100644 --- a/share/man/man4/xl.4 +++ b/share/man/man4/xl.4 @@ -253,7 +253,6 @@ It is probably safe to ignore them. .Xr miibus 4 , .Xr netintro 4 , .Xr ng_ether 4 , -.Xr pccard 4 , .Xr polling 4 , .Xr ifconfig 8 .Sh HISTORY diff --git a/share/man/man9/DEVICE_DETACH.9 b/share/man/man9/DEVICE_DETACH.9 index 5f1bf7a3295f..856c6138ed4c 100644 --- a/share/man/man9/DEVICE_DETACH.9 +++ b/share/man/man9/DEVICE_DETACH.9 @@ -41,9 +41,7 @@ Detach a device. This can be called if the user is replacing the driver software or if a device is about to be physically removed from -the system (e.g.\& for -.Xr pccard 4 -devices). +the system. .Pp The method should deallocate any system resources allocated during the .Xr DEVICE_ATTACH 9 @@ -52,7 +50,6 @@ etc.) .Sh RETURN VALUES Zero is returned on success, otherwise an appropriate error is returned. .Sh SEE ALSO -.Xr pccard 4 , .Xr device 9 , .Xr DEVICE_ATTACH 9 , .Xr DEVICE_IDENTIFY 9 , diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9 index 5d309229a34e..210abb3074e1 100644 --- a/share/man/man9/bus_alloc_resource.9 +++ b/share/man/man9/bus_alloc_resource.9 @@ -157,11 +157,6 @@ resource permits contemporaneous sharing. It should always be set unless you know that the resource cannot be shared. It is the bus driver's task to filter out the flag if the bus does not support sharing. -For example, -.Xr pccard 4 -cannot share IRQs while -.Xr cardbus 4 -can. .It Dv RF_UNMAPPED do not establish implicit mapping when activated via .Xr bus_activate_resource 9 . diff --git a/usr.sbin/dumpcis/dumpcis.8 b/usr.sbin/dumpcis/dumpcis.8 index c40e5fe75d40..9da5ed9f3bdf 100644 --- a/usr.sbin/dumpcis/dumpcis.8 +++ b/usr.sbin/dumpcis/dumpcis.8 @@ -38,8 +38,7 @@ The utility translates a raw CIS stream into human readable form. .Sh SEE ALSO .Xr cardbus 4 , -.Xr cbb 4 , -.Xr pccard 4 +.Xr cbb 4 .Sh AUTHORS The original version was written by .An Warner Losh Aq Mt imp@FreeBSD.org . From nobody Thu Dec 18 22:57:52 2025 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 4dXR013vLNz6Lyld for ; Thu, 18 Dec 2025 22:57:53 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXR010cwMz3r0K for ; Thu, 18 Dec 2025 22:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098673; 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=EgvhHPiNklibep0BXoSgHB1BGaOfR7iBIYyfzkqVg/8=; b=UCdz2HinOakJm8NjmHrxD0xl4gV8jiCWR5EtjVSk9FUKManwUqJsk9CNISshXeboMNvxbJ txKrjUMYjnilV0wWYAJJjXLOI5gM3AGRkYi3mPaTnourBqhPtQagrLJYK7WPo6X8qpXLeq VpF/5+oBmv3HL6xjapt6fmVXddXfc9WHLuyO8mJ11ozsrZpeFXngy7JZL0YlLBUE/9G35y ecAsO7YYdPFmDaYieQxBSiiJp9i0WlugLOjA7Eruqb59UVBNTPoX/w8oFEkAwHza7EiAt7 oPSpeVvNUvbqn/yg+y83ZI+Cw92gm5oGpS7UEvSh2PmpcDADGqUINTY1JcoLaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098673; 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=EgvhHPiNklibep0BXoSgHB1BGaOfR7iBIYyfzkqVg/8=; b=IaI+rPFDZ0Sa1tiAMoNe2p1+GebCqy94o0cHb8Ky6PSPbz6SJT9zxqLTqfZbMesM+c8nhS DwJO8UKT/RhetSGw/7RoE+/iODj1ZMzGSlsoAO7KXeIZGJ+K/rM6ghoHKSkOKjANZPcMv9 D8ssKH48oY3aiOH5+TWHWxcEwN+e0RFrSxfIRcph5gktZaIQ2k+4EstkwkdDYT6OovMf03 K+wLVy4i0k9oQD4tVmDLhv2nmnQhXWs/3vS6chlGIbWuo/stkFR2K1GI/Wz1V+UqacxW5s vtgfPCjsEYJjjK/EbeUxtdDrXSJbHcD+9hZaf5Vjp9+ehIe4xMI1TyXLkdye8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098673; a=rsa-sha256; cv=none; b=MkrkDPW+VPONj0knfP9EtrFbzccozSyVOPMuQXL/L8v56Wru69XNBp+7QNs961pB/m7hnL Q63xaaa5l/xJL6ZzBvWSMDSvJ7horirJNiUcjWkkC/rdY6veZDfzLeP9nTqPLXCCWUzAJK mVfNQ8kk5Es9LveIWan6yzt24jdtHVA7L8+hAMu99SPAY7iz5aEch+x3Vc6vFtNJro0cTn y1CCUP2+n4n0WcuIFmVEGFYnfuxWRbAZj36zdwgPzr+Z2e5iLxrSxE+akRKtU7esBervGz eKYD/Wjdd+jKeOu3hGI3XjhmQwujUXxGQcGTohDBjYc9oawRRzMNdprRbO+rwA== 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 4dXR006gw3zy5f for ; Thu, 18 Dec 2025 22:57:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9fa0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3a25f21eed6e - stable/14 - kmod.mk: Remove a trailing reference to pccarddevs.h 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a25f21eed6e37e8d4bf70ac7cc4aaf69950806e Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:52 +0000 Message-Id: <694486f0.9fa0.4930e10f@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3a25f21eed6e37e8d4bf70ac7cc4aaf69950806e commit 3a25f21eed6e37e8d4bf70ac7cc4aaf69950806e Author: John Baldwin AuthorDate: 2025-11-12 14:29:04 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:37:10 +0000 kmod.mk: Remove a trailing reference to pccarddevs.h Fixes: 31b35400cf77 ("pccard: Remove more of the PC Card infrastructure") (cherry picked from commit 6bf611ada21216aefcd830ba71fbf0b5d776ea47) --- sys/conf/kmod.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 806007763de2..68b37e7efbff 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -470,7 +470,7 @@ CLEANFILES+= ${_i} .m.h: ${SYSDIR}/tools/makeobjops.awk ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h -.for _i in mii pccard +.for _i in mii .if !empty(SRCS:M${_i}devs.h) CLEANFILES+= ${_i}devs.h ${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs From nobody Thu Dec 18 22:57:56 2025 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 4dXR045gkKz6LywZ for ; Thu, 18 Dec 2025 22:57:56 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXR042T00z3r4x for ; Thu, 18 Dec 2025 22:57:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098676; 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=3J8nGQzyyZDNKT2EiTTukYFTnufY3i1D/52AlFVDuC4=; b=IeawvM7ltYD8Rk8yr9h5Ss/MBElnxss0ga63zIqmpHfbaJFHnoiRcf32GFZUgVPC0o5NHV iD/SxelJ3jXPw+NOFvmA0FkR+AJlVXVI2ZE6nuBB+c4wGwuwSQJGYIc3v3gseFxHlA8/x1 vIVD4XwXJsrNMtzUwQLRmV+xGyGammPdjfqGnjLSvAFmVAjKc+PYEvP5h5K7ZqW17uVlch JPXabzocae75Y18MW7/rLZ4ZDnSF/iIg/6/WAOkZxbgrEFvA2+ic8sYJgTGuuugzd/Qutt OteiPmqmN3l4lZjY5A6WZgX6YaElbDbynfgu625GTPpHew3eV9N4jclldbgAwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098676; 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=3J8nGQzyyZDNKT2EiTTukYFTnufY3i1D/52AlFVDuC4=; b=tl1r3MszZWRZm1KSkB9wxtGiB1f74qv4OMi5QzJNJaxUwqkMepUo3rGBJW8rmlNPa3pZd7 f6GExX4ee5f1sRmkPoug/Pzmf7N4ikBi3R5Efqe2R2JNan0eoudsYvcB0aANHI5RV5dYZq Ifaqq2a4AUMJWUmf3QmC2GdNiZQ30PfBzzIoEhswZnZ4T6kIv+Y+NGuNtLooMj380IKylR zLNsKzBLDbLGJZLULnh7GNDyFzTMKfXls0JlZMYah5YQwSTK2anq7mYJ3Jhf0AskMzhjc5 Y75J5s9RWKHy4MwCvXsXZzGcy95jrRwCpBA0zWcv1WXfQKJ11DYNhAz6ZzomCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098676; a=rsa-sha256; cv=none; b=oyWR7TevSI6r9LoQQ0vRH/WEnRHP1BhaUGjVpOv0K4jg+6gF/OBSUbkEiL6qqcvSXCMACK ALKaaSNjXtmAYRJ1qHQvdaK62iJLvsDuynRU8dDg/pDl09ZXcbga68OTjCH2cP0oe8GB2T vTz9fU6lDbgjNM7Qs5W0PnDfmPL9mtpC4AgGyTeDCtrIlxph9zY+ykDmlJwUydwXLTZ2mN 4KEqljn5oBvr4IOua8wxhAh4OY2Yq8it8SpHyK7XWsWRr/DDLfIidoI/P1Xd1EcBFIENEO LRVLJT+657r30I7/npPrhTlq4lWLsf36wYtrNOczFw84qKgVYzQ3tHz/9aSgIQ== 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 4dXR041bktzyHQ for ; Thu, 18 Dec 2025 22:57:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9059 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f2164d231f4f - stable/14 - apm(8): Drop MLINK to apmconf(8) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2164d231f4f33f93cea9cd13b80a444a69c8f6f Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:56 +0000 Message-Id: <694486f4.9059.3045c5ca@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f2164d231f4f33f93cea9cd13b80a444a69c8f6f commit f2164d231f4f33f93cea9cd13b80a444a69c8f6f Author: John Baldwin AuthorDate: 2025-11-13 02:36:14 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:51:14 +0000 apm(8): Drop MLINK to apmconf(8) apmconf(8) was merged into apm(8) back in 2000 and this note and MLINK were added as a transition aid, but that aid is no longer needed. (cherry picked from commit daa1f9b415f3bca82cc7a6e555c9c56e1b1c44f5) --- ObsoleteFiles.inc | 3 +++ usr.sbin/apm/Makefile | 1 - usr.sbin/apm/apm.8 | 9 +-------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index a14c12aaceba..d2bf38c1647d 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20251218: Remove old MLINK to apmconf(8) +OLD_FILES+=usr/share/man/man8/apmconf.8.gz + # 20251218: Remove pccard(4) and related OLD_FILES+=usr/share/man/man4/pccard.4.gz OLD_FILES+=usr/share/man/man4/pcic.4.gz diff --git a/usr.sbin/apm/Makefile b/usr.sbin/apm/Makefile index c18a841b9c16..155e688c23b3 100644 --- a/usr.sbin/apm/Makefile +++ b/usr.sbin/apm/Makefile @@ -1,7 +1,6 @@ PROG= apm MAN= apm.8 -MLINKS= apm.8 apmconf.8 MANSUBDIR= /${MACHINE_CPUARCH} PACKAGE=apm diff --git a/usr.sbin/apm/apm.8 b/usr.sbin/apm/apm.8 index d6ede22066da..e295ec989a73 100644 --- a/usr.sbin/apm/apm.8 +++ b/usr.sbin/apm/apm.8 @@ -9,7 +9,7 @@ .\" the author assume any responsibility for damages incurred with its .\" use. .\" -.Dd December 22, 2009 +.Dd November 12, 2025 .Dt APM 8 i386 .Os .Sh NAME @@ -120,13 +120,6 @@ If no options are specified, displays information and current status of APM in verbose mode. If multiple display options are given, the values are displayed one per line in the order given here. -.Sh NOTES -.Xr apmconf 8 -has been merged in -.Nm -and thus -.Nm -replaces all of its functionality. .Sh SEE ALSO .Xr apm 4 , .Xr zzz 8 From nobody Thu Dec 18 22:57:57 2025 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 4dXR054QJNz6Lywg for ; Thu, 18 Dec 2025 22:57: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXR052qwrz3qw9 for ; Thu, 18 Dec 2025 22:57:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ugQpiXXPwCtldbegZ+KIFUB1CSefwQoJNbaYZYqn3TM=; b=sYEJsnzs3eez+wq6gPj5rXK7uNGzsiVWEIO5CRZQ/2sd9qE7MRrhM9cJWL3PPU/w+yi8jw xH3zcQKxwuTL8cLGv8n2emw8Z2UhthmAbtSi+TWIQp4ewbynnfIBFuWMD1VmU0MhVIyoUB 5tRiQi1x4J7AQM8factQSayn4eQJVF9vjurdaN4bjecCfI7iNp5mlbUGZcu7rdqMF79Ju/ oEhAHlcdEm5XWheEh3oygjG6yDZTNOFzWKPsUuTHOWlz7eppt/IYyXzQ6nfBNpp3l4e/dy FFfxGKumKdB3nMcHlEwq7PPXYzapWctvRc+6/N5nStIi7gig3m28ySuybxmgAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ugQpiXXPwCtldbegZ+KIFUB1CSefwQoJNbaYZYqn3TM=; b=lgRNAhCJx86Hz8+GTTf5VDTV2ddjgX4iuCc7YVExIm2vZa91OBh4ELxbzQXmVgppzDpPhO lGzTzK1n5p4pNrfrI1GP3CnDgloYcEkOlano9wLUxulVUKzFE3szcXGR8PKxr3K9YxSgFa ECS1VYB5cYEoUx1baD2nRahTTmp+T9TyNKHee4HEWzPlstGANB9EjVzFnstWjLMJ8GWlrH WWQqbBqcyjPeLapnleRNgJc9iogmAOaKFhPThOU32WA1IyDMX5vwlPQHBnb9ZLzrVQ4efD k4zNv8wwHg43V0auXaXMvuo5jnw1NsuF+wgQM3Vp8nS0RKqR/N9ZulxMYY4Tkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098677; a=rsa-sha256; cv=none; b=ivTKd4dcmW75UzRTxYxUL/wK5rPX0KOxHBFJzWjGcAQ90eDz2wG6zdxZvv74P957zA/LFB +wzmPcHE06jVf2VafMG+uc736eRhkn7wvkmfcsIVCPm1Ed3+laBFpWlyweF+kyic8HphiB 9JZnQ1CtFsNxZwOEi+2ApFGVLaBOC27lEF/D1BZ4vSBW+3UGJFZo/KEs/KQSlI1PotThK1 cq9s5YZrEBzCLRRw7qE36ijApeBtzJuts3pBNnBdRydufCfMzybV+tKNLxMoDdfhuYnow9 ZO92ZgZw9sTXRPKuzX+7MYM02lfs4J25wlplFyElLz6kEjKVX8N6XksnQPABkQ== 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 4dXR052NKXzyN4 for ; Thu, 18 Dec 2025 22:57:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8948 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Hesham Almatary From: John Baldwin Subject: git: bed9eb6af70a - stable/14 - arm64: Fix calculating kernel size for preload metadata 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bed9eb6af70a8afb922089239ec892c6b73e72cd Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:57 +0000 Message-Id: <694486f5.8948.7f123995@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bed9eb6af70a8afb922089239ec892c6b73e72cd commit bed9eb6af70a8afb922089239ec892c6b73e72cd Author: Hesham Almatary AuthorDate: 2025-11-13 14:57:54 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:51:55 +0000 arm64: Fix calculating kernel size for preload metadata Cast &end to vm_offset_t before subtracting VM_MIN_KERNEL_ADDRESS to ensure the resulting size is correct for PRELOAD_PUSH_VALUE. Previously the correct size was effectively divided by sizeof(void *). Reviewed by: andrew Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D53699 (cherry picked from commit 587490dabc649b58f0c7966e749aa80a0f16796b) --- sys/arm64/arm64/machdep_boot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index 4ce38140a570..d9d3401eaeb7 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -102,7 +102,8 @@ fake_preload_metadata(void *dtb_ptr, size_t dtb_size) PRELOAD_PUSH_VALUE(uint32_t, MODINFO_SIZE); PRELOAD_PUSH_VALUE(uint32_t, sizeof(size_t)); - PRELOAD_PUSH_VALUE(uint64_t, (size_t)(&end - VM_MIN_KERNEL_ADDRESS)); + PRELOAD_PUSH_VALUE(uint64_t, + (size_t)((vm_offset_t)&end - VM_MIN_KERNEL_ADDRESS)); if (dtb_ptr != NULL) { /* Copy DTB to KVA space and insert it into module chain. */ From nobody Thu Dec 18 22:57:55 2025 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 4dXR0356mSz6LyrB for ; Thu, 18 Dec 2025 22:57:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXR032Xc6z3r32 for ; Thu, 18 Dec 2025 22:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WasrLMuEYqgqqTExGGidwamsVfz3hZh4mmxzzpfwHEU=; b=oNgu5Pgwk7zp0CM3DVl0Ku+Tqd+ht0iS4/TmOKY+zoZ/8KLqLV6BeMB3Nc5LwjluMdNCzM 40Y4grYkrJL/5M0GaY4GqJFKOXR/isCLujW1egMT1AvJ68OuAS5g2lfKGzZmcN0Jbo8syq L8ZvdhtoIovRfcvrEbim3j3opj6Na3w2Wsu3kKdapjQABMyhsjLncOJks354MOj0aC6HtM mWW6pppwh+/HDlNxcJ03q+L4QRRUUTJz1XOzU/NLIOa3qsghk51Fllm6vfM5f6ZNjw1mup 4zmiaG5Bw7xTg2mOUFMZuKAPynZfa2oSABo6dhg3y8fVLgdF3y4ULT7Q9lZgpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WasrLMuEYqgqqTExGGidwamsVfz3hZh4mmxzzpfwHEU=; b=kTgC+KHBe+3GdISHaIiBZk8ztbFfycjtGfwXlDpxFwGK6SADuFJopM7JcyTE8TZKssYmXz s5//zHKsB5qCPtyHhIqtlEPNUEx+ipB4M6CTdFWcgsfZua6fvDGFSFX4ckva/3b5BQbmzK U0njY3tPsyBYPQZEY571q5lR4gacwa/UOgaQo45PqTDJAl2vGPNckY2oHg5dsSz7oy0mb+ gY4eYm03tnrcdZ4B6rjrQGvOw91MaXWsJz+06ekT19Xu19pOatLxr8XzOoXHYpTOa7XIMw IrIBJjgyBT+DA3X2vZKoDYrXN/07LKSbAi8H6kif+nOOoOsHvPe+Mo/i4/ooiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098675; a=rsa-sha256; cv=none; b=C/YX2ISHBUgjgW8zyxmhFWYhrxA+Yg3bend3hBXIxNan+RUBIt17GLbq7Fi03FIYomyxTp ou75tPTqkD7FNgAmwZpd5tVbr2ePGwwbSMp9OuviZdu/2XkOd1ocA6ZwfV25wGr6iaMWUc PFcYrDL2zwK5lUsCYLQPImK3ZuCL2wuTcAH+l0+HHT1gcMBJko1mvp91oGukamkDfXgC1l OfCLlCDokFOAxXzeQ7o3BXJHSwkNVwaH7+UFawDW2IRty5tIH3B2cr1TOe1SIQx4CYfm/y sllKxMmO6qyum9rx0SFGHsjenxU2rvhh9MAtbOna8szN9fn9GuZBm81Nk3xqHw== 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 4dXR030pNkzyN2 for ; Thu, 18 Dec 2025 22:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id a0b4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Muhammad Moinur Rahman From: John Baldwin Subject: git: a9d8eb9e2e3c - stable/14 - pcic.4: Remove stale manual 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9d8eb9e2e3cb63bfb5cbfd9c7eb0128822a5ea9 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:55 +0000 Message-Id: <694486f3.a0b4.74e4ac6f@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a9d8eb9e2e3cb63bfb5cbfd9c7eb0128822a5ea9 commit a9d8eb9e2e3cb63bfb5cbfd9c7eb0128822a5ea9 Author: Muhammad Moinur Rahman AuthorDate: 2025-11-12 17:33:05 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:49:27 +0000 pcic.4: Remove stale manual Extracted from: https://reviews.freebsd.org/D53434 (cherry picked from commit 1d9f2db7c0b981bf5d45e3ef17dda13b953e1c97) (cherry picked from commit 6aaf184dc4e294779db7133629b7ae953b4da285) --- ObsoleteFiles.inc | 3 +- share/man/man4/Makefile | 1 - share/man/man4/ath.4 | 1 - share/man/man4/exca.4 | 3 +- share/man/man4/pcic.4 | 100 ------------------------------------------------ 5 files changed, 3 insertions(+), 105 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 24322d91923e..a14c12aaceba 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,8 +51,9 @@ # xargs -n1 | sort | uniq -d; # done -# 20251218: Remove pccard(4) +# 20251218: Remove pccard(4) and related OLD_FILES+=usr/share/man/man4/pccard.4.gz +OLD_FILES+=usr/share/man/man4/pcic.4.gz # 20251023: This file is now installed in /etc/dma OLD_FILES+=usr/share/examples/dma/auth.conf diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index d0db3c39db8c..969afafc6a63 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -439,7 +439,6 @@ MAN= aac.4 \ ${_pchtherm.4} \ pci.4 \ pcib.4 \ - pcic.4 \ pcm.4 \ ${_pf.4} \ ${_pflog.4} \ diff --git a/share/man/man4/ath.4 b/share/man/man4/ath.4 index e731277e4e75..b40ccbd16f09 100644 --- a/share/man/man4/ath.4 +++ b/share/man/man4/ath.4 @@ -258,7 +258,6 @@ This should not happen. .Xr ath_hal 4 , .Xr cardbus 4 , .Xr intro 4 , -.Xr pcic 4 , .Xr wlan 4 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , diff --git a/share/man/man4/exca.4 b/share/man/man4/exca.4 index 555e459b7db4..d43d359bfb25 100644 --- a/share/man/man4/exca.4 +++ b/share/man/man4/exca.4 @@ -33,5 +33,4 @@ The module is used to implement the Intel ExCA interface to PC Cards. .Sh SEE ALSO -.Xr pccbb 4 , -.Xr pcic 4 +.Xr pccbb 4 diff --git a/share/man/man4/pcic.4 b/share/man/man4/pcic.4 deleted file mode 100644 index 1c5b0fc35554..000000000000 --- a/share/man/man4/pcic.4 +++ /dev/null @@ -1,100 +0,0 @@ -.\" -.\" Copyright (c) 2001-2002 M. Warner Losh -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd July 9, 2002 -.Dt PCIC 4 -.Os -.Sh NAME -.Nm pcic -.Nd PC Card bridge driver -.Sh SYNOPSIS -.Cd device pcic -.Cd device pccard -.Sh DESCRIPTION -The -.Nm -driver provides support for older ISA and non-Yenta PCI PC Card bridges. -The -.Nm -driver supports most -.Tn ExCA -devices attached to the -.Tn ISA -bus or -.Tn PCI -devices that do not conform to the Yenta specification. -.Pp -The following -.Tn ISA -devices, or true clones, are supported in the current code. -.Pp -.Bl -tag -width "Intel i82365SL Step A" -compact -.It Intel i82365SL Step A -.It Intel i82365SL Step B -.It Intel i82365SL Step C -.Tn Intel Ns 's -original 16-bit PC Card controller. -.It Intel i82365SL-DF -.Tn Intel Ns 's -last version of this device. -3.3V support was added. -.It VLSI 82C146 -An older VLSI part with some issues on some machines. -.It Cirrus Logic PD-6710 -.It Cirrus Logic PD-6720 -.It Cirrus Logic PD-6722 -Cirrus Logic's pcic controller. -Compatible with the i82365SL Step C with the addition of a different -3.3V control. -.It Ricoh RF5C296 -.It Ricoh RF5C396 -Ricoh's PC Card bridge chips. -These are compatible with the i82365SL Step C, but with yet another -different 3.3V control. -.It Vadem 365 -.It Vadem 465 -Compatible with i82365SL Step C. -.It Vadem 468 -.It Vadem 469 -Like the earlier Vadem models, but with Vadem's own, incompatible, 3.3V -control system. -.It IBM PCIC -.Tn IBM -clone of the original i82365SL part, with its own ID register value. -Has no 3.3V ability. -.El -.Pp -Many other vendors made parts in this arena, but most of them were -compatible with one of the above chipsets. -.Pp -The following PCI pcmcia bridges are supported: -.Pp -.Bl -tag -width "Intel i82365SL Step A" -compact -.It Cirrus Logic PD6729 -.It Cirrus Logic PD6730 -.Pp -.It O2micro OZ6729 -.It O2micro OZ6730 -.El -.Sh BUGS -This does not work at all at the moment. From nobody Thu Dec 18 22:57:58 2025 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 4dXR066cLKz6Lycd for ; Thu, 18 Dec 2025 22:57:58 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXR063fCyz3r5H for ; Thu, 18 Dec 2025 22:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098678; 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=6mniSAXCPK1921fhwg+x+9M3+5sdq+xfALP6ssNOvzU=; b=mLYHTpWfXPdKXU0isHN5bmZoHXZh5Ed55yPSdJ2LvSlHVW7Iw4HX0y7pvwSlA9ts5hI8ou M9gVcSaQPFtZOrF9Xm7Yl/UuL6Y4uNlYH+q8/wFcbajadpkt24pnu4+3361IhDhT8Q286+ YBZuZgivlYpOgJLkekmlWPqrGw3s5Ll2xRLMTsSZrPVX8Uszlf1gaX/atiw1QnbXi0m/04 0wx1bO/1z2GIHkXljQfvBPvCfdX1gDpvWcUd/zU5remIXyp1qYYy+wOphICe/cUKzV4m7d TfwVnCJvOHgvyX82WLejVhXtN7EaFUAWYDRgJdoUvZOYwA//HNDF0Xo21DKCOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766098678; 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=6mniSAXCPK1921fhwg+x+9M3+5sdq+xfALP6ssNOvzU=; b=EemfTRoxobvENJOlp+T42pCnF7RuSXcPJkVXQxP6gQuU3/7s2g/duYmxl7icf2/1+xZMp6 wGV5ULh2wbSlZqHLbIwD4X7f4ti0PkeDLf/S7fVvfSUb4/NnPz2NFS1CTcLUEC2Bh4sEBS 4emYwXiR61bGj7XpMTBYUCh8Jl7S+oE9xk2Ka9nKAcDKGHs0bmkzN5GeUr+B3L3wfL1Q3W TpPk5J56vTb4HIb/PEPVjanAWJnaEXtOjQ8ELvFfmkVZix+goK7J7EwOrMnKhaTpDe+ywh 04mx3waYnjT5qyUHGmJ3w6PmzxhEYLshuD8kLnf3O6ek1duTO7M9Cqj7Y4mHkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766098678; a=rsa-sha256; cv=none; b=DSpkfkXNMYx4txicLAWmCeKvl6DD9qeNGjwr2LVaztbpAhL4FAc/FAiPpG62QxfGD+vs+w EHGVru6tJgWXBd/tiPUP965H5oSfdaa38Sd6p1zKb3+OdvmWDbEmETlBnQhznYP/eitDWT wDU401qL6xk5Dzcxer4x57XoMyRCi7gXudgRvJmQl7SmMI4q7P+lnb22OwIGjSEyr5LWjT /M3KMzGH55ED8ijKPJ4S9VM72LDXK1wwc/w6heBY/hIxRU+TBmvgzF02cs61mkaS9avaKd cnG5QMoyG3LwGKSpRcns2g97vI+0iUm8VB+Vd9Q7Ik/9xi9itCmNddUNDF9fTg== 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 4dXR0637xczyHR for ; Thu, 18 Dec 2025 22:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9c38 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:57:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c53d90c50c77 - stable/14 - loader.efi.8: Minor formatting nits 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c53d90c50c7732b34fe6ce65127e136ef2e62cee Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:57:58 +0000 Message-Id: <694486f6.9c38.512e316e@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c53d90c50c7732b34fe6ce65127e136ef2e62cee commit c53d90c50c7732b34fe6ce65127e136ef2e62cee Author: John Baldwin AuthorDate: 2025-11-22 13:10:20 +0000 Commit: John Baldwin CommitDate: 2025-12-18 22:52:22 +0000 loader.efi.8: Minor formatting nits - Add several missing .Pp after lists and literal blocks. - Fix the column widths for the console table and use a shorter indent so that it doesn't wrap on an 80-col display. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53866 (cherry picked from commit 46d05a49a1d0d655af6cae2afd48a973698cbf71) --- stand/man/loader.efi.8 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 7cb2f1e96595..a88c09fcff71 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -158,6 +158,7 @@ The serial ports are assigned as follows on IBM PC compatible systems: .It COM3 Ta 0x3e8 Ta Pa /dev/uart2 .It COM4 Ta 0x2e8 Ta Pa /dev/uart3 .El +.Pp Though .Dv COM3 and @@ -191,8 +192,9 @@ of any behavior not covered in this document. .It Fl s Ta Dv boot_single Ta Va RB_SINGLE .It Fl v Ta Dv boot_verbose Ta Va RB_VERBOSE .El +.Pp And the following flags determine the primary console: -.Bl -column -offset indent ".Sy Flags" ".Sy Kernel Flags" ".Sy Kernel Consoles" ".Sy Primary Console" +.Bl -column -offset xxx "Flags" "RB_SERIAL | RB_MULTIPLE" "Kernel Consoles" "Primary Console" .It Sy Flags Ta Sy Kernel Flags Ta Sy Kernel Consoles Ta Sy Primary Console .It none Ta 0 Ta Video Ta Video .It Fl h Ta RB_SERIAL Ta Serial Ta Serial @@ -380,6 +382,7 @@ To check: # mount | grep nda0p1 /dev/nda0p1 on /boot/efi (msdosfs, local) .Ed +.Pp If it's not mounted, you will need to mount it: .Bd -literal -offset indent # mount -t msdosfs /dev/nda0p1 /boot/efi @@ -398,6 +401,7 @@ BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 0 nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI \&... .Ed +.Pp Often there are several options, depending on the BIOS. The entry that we booted with is marked with a .Sq + @@ -416,6 +420,7 @@ loader, which varies by architecture. .It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI .It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI .El +.Pp However, care must be taken: some multiple-boot environments rely on a special .Pa bootXXX.efi to function. @@ -436,10 +441,12 @@ above table): .Bd -literal -offset indent # cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI .Ed +.Pp Copy the loader: .Bd -literal -offset indent # cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI .Ed +.Pp replacing the all caps part of the example with the proper path. .Pp If ESP path was From nobody Fri Dec 19 00:26:13 2025 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 4dXSxy1C3fz6K9Wp for ; Fri, 19 Dec 2025 00:26:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXSxx6PJnz47Qm for ; Fri, 19 Dec 2025 00:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766103973; 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=GFZqsJvHC5v+Xh54eYHfasotN1/EwntixG1L7H4qUok=; b=rmrjIXbK98o+KYaaTgwN9TmQ6y87TkmwCLKP8DbdKx1va1nPBqF+OYVeVA+3ctZ9+ehy/L 5CF4Jgxb/KP2AIV9GYbV+uHhDQpcFM1Ji0vQ6PtB7iZievmT0nnVtPWGbVzxUySGDXG7X9 js7QGIdjUo8FJXdjEZTI2oV8wCjycf8SrJWMVgTOuVLY8Rhy4QOlzBtG/He3MnJLI8CEP3 Cev9we5YwBxfnoyKR7+xTUZL9ZWIiSaufGISzNQA5Nk7YZPatzdLfUXlYpuQesVVbIt+tL zNLTj2FOwzne2Tu6SMEaCOsjo7jXrj+jkzlQSZOuU45yb6sVo/6sEgJIgINYFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766103973; 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=GFZqsJvHC5v+Xh54eYHfasotN1/EwntixG1L7H4qUok=; b=uimA5tNLSrE6M/BCbs0NLEc74SFrp2kbVfjO3FY6N/JCFx0i0WjO2AtM1wSHUx+gMmUby8 vaTWt2qE58R6xE5JYR18oAb/II00YjXu1J3Virz2XH3UHws6R0Pt2vh0BUKXvmN9gtTOXu NP+kMM3bqgZfET4q/f29pOZqa8xInYTW8gHTXKdWclVhK2YN4oMU5AfekauFkGrtGckW67 32HiXSEfg/zVpW9kfYe0W8VjG1pYq8w5vMaVbdr0UBHUxZ8JE1hCxohcSPkr97GiFsR/Ku Sn0bf4DLO2IN+hkIwEbAdGkdNK59+ywIDkovtIvg09+g7EgAfIfkOhNUEkI/8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766103973; a=rsa-sha256; cv=none; b=DTP6HYPSuM5yVaACMLj/6iyMQg5gRaYuzE1FJKMfzMJoUgqbQaY6DU0vwn8aHexbwixBjr 53nL2SeT6usq84mYkWS49WoMsZOe/Dj1fidVzRIvKTWNMkotKfvh8VtOWl7P2xcXozleJy XJTx/oHYCoizVK01L/YhnK/yOtMeduKc7WbXUCST/xl7WeikT/bu0GdcAAZR24w9PEgGXC XiiMGVNs/E96j+YXgrtxX2jP0QkLMCbM1bFJxJx3Ege6xAsbg1tr2D+WWyICW8k58DbzCi Conc/U5navJxwYjNQbsx4F/KOSdwan+OwOP4FwiIjnH+SgY4lmaIW/8pln1NVQ== 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 4dXSxx5zfHz11Dn for ; Fri, 19 Dec 2025 00:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2386e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 00:26:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 1b96cdea82c7 - stable/15 - ipfilter: Add missing kenv fetch 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1b96cdea82c77191fb4e777ab63428de95f56d3b Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 00:26:13 +0000 Message-Id: <69449ba5.2386e.1363dce8@gitrepo.freebsd.org> The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1b96cdea82c77191fb4e777ab63428de95f56d3b commit 1b96cdea82c77191fb4e777ab63428de95f56d3b Author: Cy Schubert AuthorDate: 2025-12-15 16:21:56 +0000 Commit: Cy Schubert CommitDate: 2025-12-19 00:26:07 +0000 ipfilter: Add missing kenv fetch When a module the environment must be explicitly fetched. Fixes: d9788eabffa4 PR: 291548 Noted by: markj Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54242 MFC after: 3 days (cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068) --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 6eb6cf2a7a47..8b30e13295d2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1424,4 +1424,6 @@ ipf_fbsd_kenv_get(ipf_main_softc_t *softc) { TUNABLE_INT_FETCH("net.inet.ipf.large_nat", &softc->ipf_large_nat); + TUNABLE_INT_FETCH("net.inet.ipf.jail_allowed", + &softc->ipf_jail_allowed); } From nobody Fri Dec 19 00:26:39 2025 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 4dXSyR6RWsz6K9TJ for ; Fri, 19 Dec 2025 00:26:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXSyR3xBKz47jS for ; Fri, 19 Dec 2025 00:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766103999; 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=I2mAMcNl0mh700KmP4K9t0XMdXK9iEVyLdB0vIjvTz4=; b=dWrT9NhMLPgy6J4y1TzJ1FXgDx5pGjnmfpkoI7p0NOlGQQy/7A4xiC3eU0Z22QeJr6RB6C TDW/v3SUPokW9MquBo1RDYqPAVtqjjRMUnaI6T8V4h1IuAwlEVrn9ta4CC6txVj/H9B0NT ewK5eZstiasoVUJkCB9Llvx669crtJqFcHBgmaAYJtBq39ekRthb1l6tNhiLAHtPCzh2dA Hox2pe+a/vRoLv18xHJmm80Ymh+CLuxDRKfcE1NDr9qvEwvBdwCJXt6I/2DKlBF6T3YXc3 g48NFCLy5F79ePlexEhnaikqurETe4xTnopcWpAIeuy3RmT8BIOFwXF/Izx2QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766103999; 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=I2mAMcNl0mh700KmP4K9t0XMdXK9iEVyLdB0vIjvTz4=; b=sdFewktvtZk1EgubnDYf2qq7LR/WCIKnFxvqxEmGfysQua7CLJec1/GsQ5NhzuSLVZGryL dMp0/W77Yrn4jLx+u4EIegMYtvraxtLvuk658hiFOcruwxTn27Z2hPWapmI15QUU4lDs57 BaN0L+7I/7vntXWJU1GKUyL1xbyzsk7pluZ1BwPx8dbQXWyPuqtElQ7E3ZAub7zuYhvNnJ 8XnLd17g41+kjwkJ1/vnNKF63PnhFsqEEuEcgbdoJLnpCn498RHDQaL3maIRzykwfRHwdM ofI1CakfHJssrANa/2wtZYouUM3N7UYf5e2+0b81KRY46cmVN67Bs89Vy7Ts+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766103999; a=rsa-sha256; cv=none; b=a08ZhlW6+5nWoKJBD5xy8K5NblzQ8ToM6ci5efpspwZPCZxIph4YREgRUcFH/2gC1wfu5U yI++lMxJHG+eiTfZHotYa/IvJJDxxnnNmJHfNPXO+0bcaBsOyrwOsbKJud4SmN8kAr/Uzx l94kYR/e0RP+NqdHpDJ3MJeQyRCaCF/hGHqzFzUmPzt9HzVp0BbYV+NuGpd7AdFHl1Hpau djHXTo7cuwFF8/duAWD3yFwHvxTqkjWh/W/GSNsBOyh9snGqVNkXQDjcxmZ/v9tvTJlE96 QG3i8C/FmbUsleIclwGLEs6FFIjL2h2i8YkPcJg1WqIL2nHOQ6x7I+JPa75/cQ== 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 4dXSyR3Tygz11h4 for ; Fri, 19 Dec 2025 00:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22a0c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 00:26:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5ece89c74efd - stable/14 - ipfilter: Add missing kenv fetch 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5ece89c74efd8ab836459af5bc6720af904ad1d4 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 00:26:39 +0000 Message-Id: <69449bbf.22a0c.7558d6a5@gitrepo.freebsd.org> The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5ece89c74efd8ab836459af5bc6720af904ad1d4 commit 5ece89c74efd8ab836459af5bc6720af904ad1d4 Author: Cy Schubert AuthorDate: 2025-12-15 16:21:56 +0000 Commit: Cy Schubert CommitDate: 2025-12-19 00:26:34 +0000 ipfilter: Add missing kenv fetch When a module the environment must be explicitly fetched. Fixes: d9788eabffa4 PR: 291548 Noted by: markj Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54242 (cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068) --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 2a6ff68649b9..57826a4d2e8b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1457,4 +1457,6 @@ ipf_fbsd_kenv_get(ipf_main_softc_t *softc) { TUNABLE_INT_FETCH("net.inet.ipf.large_nat", &softc->ipf_large_nat); + TUNABLE_INT_FETCH("net.inet.ipf.jail_allowed", + &softc->ipf_jail_allowed); } From nobody Fri Dec 19 00:27:01 2025 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 4dXSyt3w6mz6K9Lt for ; Fri, 19 Dec 2025 00:27:02 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXSys6lpLz484H for ; Fri, 19 Dec 2025 00:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766104022; 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=442MA8Xr3VwiFdYaoPUaWQIkuwW4ypUz/7UA8yauPJs=; b=Qw/3AS7l1bOKsJLgYZII7N+aFVXYHuR3SLTqkMKVU44O152dnusr0yS/PpW2C477cCrPhv yPMJHC+4GmhJ1i0sGH7eHjYNKDj9GXUxE9R90+Boy2U4bTwM3HhIwQ/tm0+2Z9/Bd+iHiY GxDLMQbD4yMRGI7Rq0XLeMZMaK+Hp4UXIZwf/FHtNXlTzjhYuA0bcEdI+9H71xX4GcQKXv scYX4/g/xMBq0bXaeVaAREE12ZqUOphQSG9UxrXVClUf2ocn/pLi22GMZxGC2h3w0sDg4C AVR/DK6jP1rGxtbZ3aPUcdXm6MdhXGi3ErJLmOi6AZD1IW1iurrg+42aoEEEow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766104022; 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=442MA8Xr3VwiFdYaoPUaWQIkuwW4ypUz/7UA8yauPJs=; b=I7mPNhilj8ooNN+1CnQp+V/s/y9+5O7MSDu1yptLcIF9OQEzcXxpTYp/qjposNOR+wqEXD fi8r4V1ZTGzcqJrw0cERLkIiZH9pIW74vHGiH7UyftqUX4CPzH14W1zWkPtBiUnDTq3Wja 5RT0r/38Aks+OtWLOs7XhPaxrUZaypd4HNjsBG3lvxSzzSFUu9oPKk+qlIG2S+c1FwYAoi 5VKaMkhukQ5PqAVOBlJ3EDXNd8YegtJAhtextQpuCAgW/iDwskOuJW3WGU9WzaiXWT5oa7 fL7AAP8jUZrAYg3fzow+g3wdr9z4kf+zbPakW7zfriPxFFrFQtWaPxXeNoHPeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766104022; a=rsa-sha256; cv=none; b=h4i5Be/wfN4i0Wz1CwJje0qnjx/fGZeNK++SG7frYG3QylDeqogRwek20emG8HyVPrpqZh 6xVF3ZxsQTv00tRNLJ/0+QhWNb7+m/a7b/UTl79pPO0lJboYlkNXSBcqj6YtjxIjCxS/0i LsUuX4uoUaAwZ7c/ON3aWVqo5Lm8+g8m9JqRbpk5htXVC9nhrn7Gfyrdk26F0KHngfhHj7 xAjzRXVLp31SBC8HjAiLlOr0KoNbF3xDIq6oc8aMfs9cBbpG3JZbAKFl58guvlVmjdE5jI 31rvU31E8UzSzmRHmuwY8q2M/B8Bz9ANnB/0SfMjMRwkQ8scb8J/S6IM/P2YkQ== 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 4dXSys6K09z11Xd for ; Fri, 19 Dec 2025 00:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22d85 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 00:27:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fb20aad3e846 - stable/13 - ipfilter: Add missing kenv fetch 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb20aad3e846bf42d98f9e84d5035e4d16115f95 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 00:27:01 +0000 Message-Id: <69449bd5.22d85.7905e35b@gitrepo.freebsd.org> The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fb20aad3e846bf42d98f9e84d5035e4d16115f95 commit fb20aad3e846bf42d98f9e84d5035e4d16115f95 Author: Cy Schubert AuthorDate: 2025-12-15 16:21:56 +0000 Commit: Cy Schubert CommitDate: 2025-12-19 00:26:56 +0000 ipfilter: Add missing kenv fetch When a module the environment must be explicitly fetched. Fixes: d9788eabffa4 PR: 291548 Noted by: markj Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54242 (cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068) --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 89e5be506be2..121bb2c08f4f 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1459,4 +1459,6 @@ ipf_fbsd_kenv_get(ipf_main_softc_t *softc) { TUNABLE_INT_FETCH("net.inet.ipf.large_nat", &softc->ipf_large_nat); + TUNABLE_INT_FETCH("net.inet.ipf.jail_allowed", + &softc->ipf_jail_allowed); } From nobody Fri Dec 19 01:42:27 2025 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 4dXVdx1ckZz6KJZH; Fri, 19 Dec 2025 01:42:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXVdx0fXBz3HTw; Fri, 19 Dec 2025 01:42:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766108549; 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=YLWKBMIhnXiVx8XUcdRPZ5ho7dd8xDrBWP7t9UoHPBw=; b=FmdDlmoNyzebyIPtiOD9l50QTp0NXnTzOICpcAmH5vB/Wt87N3eNNsNGxANE0Y22zKt9tY j7iyeibdziM9hcEEocAN/v5UsoeUZrLAZ3UY2hWV/9gV7QYJkFnScYenf7uy0thYZJsoQ/ yRMd69dYw6J2wgYnUSOR1tZDJBtCZKN+uTkl6zD7KeQy0LGKBpwr1wKfGKkNeaxMVaIlTe 1P5+X9x7tzY/Vezbygnp7Xbi2ZMZsDQoPjdZhXu3KEp0V6WKKPMFMEA0/R83bI42fV51xD b6+w0BOSfGU/syNXsKFZOR6LfuslmHG0ukQoJcDrq2X5MPKus46FebwKfhvPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766108549; 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=YLWKBMIhnXiVx8XUcdRPZ5ho7dd8xDrBWP7t9UoHPBw=; b=BVNunAFiRIi10WDOLigedYomghmYeaSVQ9QIpKqZAVoyY8sPb2GurCQa7Qy55zCJ+MI1ho bCwBxUJwkxfjS1xZHCIqgnJsDIg6B3EQqOapY4b6qhJtXd7rhU5cuYIpVi79sDuFMK1dWa XCEA+dgETa3cwgQOn0AFnEDDD8WUmhxcQCjiySI4qAyiQ1eWxvjx/DOoYlMuwUb/NAvXeu OPJdUR3f9u1zkd7oF/OPcP0iO3Noc8rK4B0POO244WV026KRrKQ/Xxx8m6OOSlIehGrD38 vH1M+RUfL6W5KCXgLST0YCz5INmaz2ac1iE6hqptVCYPCfCxPzlDS5CJ09Mrvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766108549; a=rsa-sha256; cv=none; b=yiFLaj/zSTIktAk3TINATFwyze16lZU8KtBVTg+m+aGRK2ZY/hG7+VUfwISaFqlDkVeebU KgRdkjYJzxbEIzjB+spzbovLzWN8W4y5c35cuNNueQVHy8LEVTqy2Rv/ghWq1AWJW4B79M c2Kl871bpZiZKyNaMcgzaLFYjm0o3f/ZV3Rs823CEQFGAaoFd3pJr2uLY39HoJ7BYSeHxB cg3wSmT3HcmxxUcTNJbLuHmITKBy3RrY+p7LD6nGv3acShwANj3lIezWhZr6PKhlFefHAs zyPjYOlDzNWemYrxkMRDIwwaYZvKCL4W6D+v7XPyWPstc1xf2Aub9DlhaK60Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4202:5670:3446:9f52:e591:8064] (unknown [IPv6:2601:5c0:4202:5670:3446:9f52:e591:8064]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dXVdw60zXzDdY; Fri, 19 Dec 2025 01:42:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <909a8fcd-158a-4b7c-a730-a45516662a83@FreeBSD.org> Date: Thu, 18 Dec 2025 20:42:27 -0500 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 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 1b96cdea82c7 - stable/15 - ipfilter: Add missing kenv fetch Content-Language: en-US To: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <69449ba5.2386e.1363dce8@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <69449ba5.2386e.1363dce8@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/18/25 19:26, Cy Schubert wrote: > The branch stable/15 has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1b96cdea82c77191fb4e777ab63428de95f56d3b > > commit 1b96cdea82c77191fb4e777ab63428de95f56d3b > Author: Cy Schubert > AuthorDate: 2025-12-15 16:21:56 +0000 > Commit: Cy Schubert > CommitDate: 2025-12-19 00:26:07 +0000 > > ipfilter: Add missing kenv fetch > > When a module the environment must be explicitly fetched. > > Fixes: d9788eabffa4 > PR: 291548 > Noted by: markj > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D54242 > MFC after: 3 days > (cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068) This doesn't build on either stable/15 or stable/14: /usr/src/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c:1461:11: error: no member named 'ipf_jail_allowed' in 'struct ipf_main_softc_s' 1461 | &softc->ipf_jail_allowed); | ~~~~~ ^ /usr/src/sys/sys/kernel.h:334:58: note: expanded from macro 'TUNABLE_INT_FETCH' 334 | #define TUNABLE_INT_FETCH(path, var) getenv_int((path), (var)) | ^~~ 1 error generated. *** [ip_fil_freebsd.o] Error code 1 -- John Baldwin From nobody Fri Dec 19 02:38:16 2025 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 4dXWtJ6PzDz6KgZB for ; Fri, 19 Dec 2025 02:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXWtJ40hVz3MDm for ; Fri, 19 Dec 2025 02:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766111896; 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=GwNntUTzEwUrRpwHOqbqBufslpW75gr02rGGEBWuukQ=; b=cU0pUKm6fK05axS63n5N3loxaSAUvKHZsjAX40sd+ocx2ThgU/uKtRhQu4sbjYTD9g533A Fa24GV7qXcrcQ/iSFT1TYvxVrceBL4egJwFasD9cielxAkOcA7NAwGrnEMsGbW/NmchvMP BSAtYwrHxwjrwRlRp0byceDKwY0SocjOq7U5nKebK/NEhY4TAi3ynOouZsu3ExqYDkKxs1 hSCcXp5Xm/uNRpfS1KKWkfn1Yi6SSR1yQr6Lds6nu2LVuI9ZD4Nebc/59q/ich/RiyAXS4 XoUfQ3WwDqcU3cpcyBNxfHw27mOFcsRPD/kXpnZ2n+Q5Gc9wLZCadGkjjmzYPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766111896; 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=GwNntUTzEwUrRpwHOqbqBufslpW75gr02rGGEBWuukQ=; b=ppziZGXyRV6OKVu6pbBSvrEU6PBWW+Xg+muamw7zMSlBkmoTOlh+jHqx4tbgq+2jUzjlAb 3gJeiaIBa4nJ3tzYmkc5g4rJ82AW4i2VzLi9TiubCpsQtVOrZ1tWRXEPAklC13WcYQJ/5E tjuO4n2L6XpljnrxSLn9xEmd3sqyDCNCMo/SN/QsTAqslMIAX46YlO6aCunbLSknRy4hNI tyc7mK+3ka2ePiPbkeqCwSKqvTRKFzhCknhNtsKXMcH9f9uxKfGZCW1WXhOmauSe5I9ZrD +AGIL+y5wmxRbYa1COMLVW9MWIStZT2/PS2v7YhZ9GcFoeJJCkKBsEz1wcjzDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766111896; a=rsa-sha256; cv=none; b=jIbg+3eMWq1UOwEsXrt3w5fKmDv05/DsxzZJaUON4HkFVDChYuo9jGf/UY8vACzWjWr8HY jpYevIwXwqo9K5w3Rpi25llq9AZLnIS6Gya8HscLZIk2x7YXbVdmpw8XMNTg6eafrQ+Pdh /5uZcOprFpWx08vIauBngqdCXV56vGc4dpVDtGOe/B2XViEaVCftfPOdTbx8KvEPBw3dP4 BaN94xR6VzVfUuUOrFR4+R0+dCJQfraHX6OVdMz9iyLVsuUMURJ6j0Fe3F/wub/A0Ju9Od RVADsprGnW+pXDnRzTq6lrhLCOei6GCwj8GRFXhCC1H5VHO6yPvj1BrNHTPjuQ== 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 4dXWtJ2gR3z142Y for ; Fri, 19 Dec 2025 02:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38580 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:38:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5ea68e7ea78e - stable/13 - Revert "ipfilter: Add missing kenv fetch" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ea68e7ea78ee12466f3667f4bf0de9eb82e9a86 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:38:16 +0000 Message-Id: <6944ba98.38580.674cc24@gitrepo.freebsd.org> The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea68e7ea78ee12466f3667f4bf0de9eb82e9a86 commit 5ea68e7ea78ee12466f3667f4bf0de9eb82e9a86 Author: Cy Schubert AuthorDate: 2025-12-19 02:37:43 +0000 Commit: Cy Schubert CommitDate: 2025-12-19 02:37:43 +0000 Revert "ipfilter: Add missing kenv fetch" The commit depends on d9788eabffa4b67fc534685fc3d9b8e3334af196 which has not been merged yet. This reverts commit fb20aad3e846bf42d98f9e84d5035e4d16115f95. --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 121bb2c08f4f..89e5be506be2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1459,6 +1459,4 @@ ipf_fbsd_kenv_get(ipf_main_softc_t *softc) { TUNABLE_INT_FETCH("net.inet.ipf.large_nat", &softc->ipf_large_nat); - TUNABLE_INT_FETCH("net.inet.ipf.jail_allowed", - &softc->ipf_jail_allowed); } From nobody Fri Dec 19 02:38:28 2025 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 4dXWtY0KZdz6KgcR for ; Fri, 19 Dec 2025 02:38:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXWtX5SpKz3MNq for ; Fri, 19 Dec 2025 02:38:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766111908; 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=eBISmz00zmqWSKctI2qxxW85aPMLrmIvWBI8bLyFTTE=; b=I1MogMaze9l2FkMRbHDbz9uzaJZ7ThKCO9ksfITsL28UQH2tbU/VqQ80PRCtwqEc3ctFOl nMViPNyf8zv4aqcNirvcktiYrIPnvlU1BvBtpFTeoG34JWgA5LMTh7jp9urHtjI8Rbzn+G vmrIxZ2p2gAsnAqU684m73gwYpGXO1xb7c64Voj7dLw8jG6+pqRLSDH0V3TmCc67clZ//m 7hhPJzH3724z12VLeoIdW1Vz7H9H8ChAfKogHM/9wxihNF1dWvyntE1fWiKeO9XKSWDC0Y VXvmwK5N7vI1lAkpX7G/5ZBN1nbZuiEE3NbO5qVb4nBlf5NJnAUKv+1pIyts+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766111908; 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=eBISmz00zmqWSKctI2qxxW85aPMLrmIvWBI8bLyFTTE=; b=DegmXWWyZ6zyMuLkIH02P2PZrI70h96wQTo+rV2dZtS/ba92Xvm+C09UCjcpWYHMqrbjhx VrP/okshVLr7ol4+dwXKCIHbA6uhBzQAngkzolFNC1UdrrTEDWZlL2kdCmGxUrsMxu8CC2 bLJLacGNZJNUaIBSNEFaJpHOzZYQ45fa/Cxs4bel609LorgYhqfKY/kybSWpZv+jNTqZmr 4wb0mNnElKkD6wkTzQ8McMH+AmwEHfmWmzsYdMcknkzZBTaIQZxCKriv2oE0tFVvvDHMTs BpqEIkvmBQ6SlQLfd1QZ7qydH8sWtu/XhMFz0zFHoazs5LyWstEACsIN37Y6KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766111908; a=rsa-sha256; cv=none; b=rX3SnssJe2gC8blZXPqGYzRJRxU7wY1GzPWxMervx5s7q+cFSontVvjJYX5pNu7oc5h8GC 4BVQDsB6eq8RDW2Q1E5dpHhNqEQsMxQKyuit7Hf3sWpgnd52stj0LCfkSsfcXfKr8NHSq8 KNon0RyuOKnQt8gwMsdKq/fr3AjksfHby5J6dtIk/l09IRlkfNYiH2ra9S6ZJ8hffUrhTM Yfyy6xeHAMH+DPStMm23NJwgcdtiRIoGJanK2uocUjz6g0yVobWTsegWYMK1eL2PP1jvSU a7U7oLI+CIGzTP7lUo3YQ0UXq3k7arfuxq1sMo9tAUaV4rDChbWvJsBisf2dEA== 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 4dXWtX50Xrz142Z for ; Fri, 19 Dec 2025 02:38:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38521 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:38:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: f60a41543430 - stable/14 - Revert "ipfilter: Add missing kenv fetch" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f60a41543430c764a276af5dc30b9bcf2b8c25d5 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:38:28 +0000 Message-Id: <6944baa4.38521.58f69c33@gitrepo.freebsd.org> The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f60a41543430c764a276af5dc30b9bcf2b8c25d5 commit f60a41543430c764a276af5dc30b9bcf2b8c25d5 Author: Cy Schubert AuthorDate: 2025-12-19 02:37:32 +0000 Commit: Cy Schubert CommitDate: 2025-12-19 02:37:32 +0000 Revert "ipfilter: Add missing kenv fetch" The commit depends on d9788eabffa4b67fc534685fc3d9b8e3334af196 which has not been merged yet. This reverts commit 5ece89c74efd8ab836459af5bc6720af904ad1d4. --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 57826a4d2e8b..2a6ff68649b9 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1457,6 +1457,4 @@ ipf_fbsd_kenv_get(ipf_main_softc_t *softc) { TUNABLE_INT_FETCH("net.inet.ipf.large_nat", &softc->ipf_large_nat); - TUNABLE_INT_FETCH("net.inet.ipf.jail_allowed", - &softc->ipf_jail_allowed); } From nobody Fri Dec 19 02:38:38 2025 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 4dXWtk3WCDz6Kgg7 for ; Fri, 19 Dec 2025 02:38:38 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXWtk1NZ7z3MWB for ; Fri, 19 Dec 2025 02:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766111918; 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=DBcUS4xsQBbrxYNBjl+l73PP+gfXmVheJ20foGDzrUY=; b=FyvRkwmSFwSIqn6JPf0vMjCy5gOrcfUJJX31CE8uSHR8bQ82KfUKfDk2MkuSNa91Ud0qUV R10SN0MAu5hjQG4sG2jGv8R4YPtfq635r7tSTPxnrwssBg52srOUWYM0BWD3IdVtZFfCQe dFp1qAOmVKgYV/Z1zCYrYx3sIVSf/JBC4qzk7GwLHNmDjznqaJdVpgKlbTb1+9Ypt4taYv XrSeZ770uPOlBglAcRKZC6HAF3THXAtMoxbjh1Ms7Ja9zsR21bEVvFmz5k7JPWtU0q9vSl bs3V5Lil+WGcpureJn9bDqyne03WV9F6t6hmzAjgAnk5x4r15dc50shsqaLjww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766111918; 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=DBcUS4xsQBbrxYNBjl+l73PP+gfXmVheJ20foGDzrUY=; b=yj3SSjSooOz+XxoNqn2yLIYHPizKJxSj3vIhNevW2NZ4Ch1Q72dwRfcppcdAosdzFaBBZY 4EyqYueCChEP0D3p9rc673Kpg4/+9wBfwKIT2Pe76S4TAuRNX6Pt2ngADufHCgSI2NfWnS prKYrRY1akau3Bq5Cfvsk6/MFbWINBVEqfDWQ7lWnm+3F0yI/0D8492UmtKOcoD/GLjHtt mk9HOFDGFZT6l4OThlTY/dvjQkSyFxhxJlee5GhDPAc6I+IBxAgIek5Bjf1PGjLN4U1trC vrLwPuYfinhZ/Ix2b4he7AW45xA8FuwMh1lWf+Ok/S6gNV1VHrOxIQ5TOkhV3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766111918; a=rsa-sha256; cv=none; b=xunpTg3g3Q3oUqoK5cy81VLCbFRW1UP5Mhfz12xYufEFiEEEO0I/Wmp8zQR9RoAuQPzJeI bbbVAHrmezBamvp5QIMhogvDLlYKLLTxMs7RssMFThIVf1HfUcfIi+3hSGPZUHUX78m3Q1 lwVt3+TEcx6K3aOgkIeZjHX9heYGY20kmw0b1udQSCqiY0UpVh1xXz10+57zfxHK+TFknA 3a+hy/n4suezpkJ/kft8WDxZohMetcl7DV73PaU5ZRCkoJBEPzS6gY4fZ2ED5fiDdkDvly eSfqnmT1u0qMtzv4NHdeqO1JigNammqTowZ+ib4FVNYXPNs14y2pqVeIMvkMXw== 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 4dXWtk0pC2z14wy for ; Fri, 19 Dec 2025 02:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3773f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:38:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 121076ea954c - stable/15 - Revert "ipfilter: Add missing kenv fetch" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 121076ea954c2ef9dcc61d3df035678d0bfbd806 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:38:38 +0000 Message-Id: <6944baae.3773f.6960c807@gitrepo.freebsd.org> The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=121076ea954c2ef9dcc61d3df035678d0bfbd806 commit 121076ea954c2ef9dcc61d3df035678d0bfbd806 Author: Cy Schubert AuthorDate: 2025-12-19 02:36:18 +0000 Commit: Cy Schubert CommitDate: 2025-12-19 02:36:58 +0000 Revert "ipfilter: Add missing kenv fetch" The commit depends on d9788eabffa4b67fc534685fc3d9b8e3334af196 which has not been merged yet. This reverts commit 1b96cdea82c77191fb4e777ab63428de95f56d3b. --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 8b30e13295d2..6eb6cf2a7a47 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1424,6 +1424,4 @@ ipf_fbsd_kenv_get(ipf_main_softc_t *softc) { TUNABLE_INT_FETCH("net.inet.ipf.large_nat", &softc->ipf_large_nat); - TUNABLE_INT_FETCH("net.inet.ipf.jail_allowed", - &softc->ipf_jail_allowed); } From nobody Fri Dec 19 02:40:20 2025 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 4dXWwm0WyNz6KgwQ; Fri, 19 Dec 2025 02:40:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXWwl39LGz3Nbw; Fri, 19 Dec 2025 02:40:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001b.ext.cloudfilter.net ([10.228.9.171]) by cmsmtp with ESMTPS id WI3UvySVRAPFJWQPmvI8t0; Fri, 19 Dec 2025 02:40:22 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id WQPlvVYJaVdZGWQPmvohbN; Fri, 19 Dec 2025 02:40:22 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Sp6dKfO0 c=1 sm=1 tr=0 ts=6944bb16 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=wP3pNCr1ah4A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=ObADz9b456GCB84EmDMA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy.cwsent.com [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id DDDA9357; Thu, 18 Dec 2025 18:40:20 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id D5F4221E; Thu, 18 Dec 2025 18:40:20 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: John Baldwin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 1b96cdea82c7 - stable/15 - ipfilter: Add missing kenv fetch In-reply-to: <909a8fcd-158a-4b7c-a730-a45516662a83@FreeBSD.org> References: <69449ba5.2386e.1363dce8@gitrepo.freebsd.org> <909a8fcd-158a-4b7c-a730-a45516662a83@FreeBSD.org> Comments: In-reply-to John Baldwin message dated "Thu, 18 Dec 2025 20:42:27 -0500." 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 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 18 Dec 2025 18:40:20 -0800 Message-Id: <20251219024020.D5F4221E@slippy.cwsent.com> X-CMAE-Envelope: MS4xfF9RQy3x/IBinFlMNKYqBeqYX+gBjLWXPUO7upwLoNT86qRGl2zW9JNOXyE9AQyZ7glYgF7UogKz6VaSu/0KWlFWgjXDl9AYyI6udRH80wlQzF+Lo5zU EAG31O6Al3WUTTA+q6cbqgrMRnl1Uet2FSIj/qYGjCB9S0n10dk8sUFZM1Me0jp7orylNP4wEN3mwBXGMs+0hwIuhknBxFvZayFnDH2jgis3S0GENCLPVm3C BQYZFmDPD8m91VQjX6jZBxBVD4tOljTe27dsz/vcNk6F1hY+zPJFBizVTH67bR4VUAwjXuif7WGfZdwdkbW38YurfagDVgF7hctyeMD1Z7ES5C9ffacOq1MU ujPecKxC X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dXWwl39LGz3Nbw In message <909a8fcd-158a-4b7c-a730-a45516662a83@FreeBSD.org>, John Baldwin wri tes: > On 12/18/25 19:26, Cy Schubert wrote: > > The branch stable/15 has been updated by cy: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1b96cdea82c77191fb4e777ab63428 > de95f56d3b > > > > commit 1b96cdea82c77191fb4e777ab63428de95f56d3b > > Author: Cy Schubert > > AuthorDate: 2025-12-15 16:21:56 +0000 > > Commit: Cy Schubert > > CommitDate: 2025-12-19 00:26:07 +0000 > > > > ipfilter: Add missing kenv fetch > > > > When a module the environment must be explicitly fetched. > > > > Fixes: d9788eabffa4 > > PR: 291548 > > Noted by: markj > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D54242 > > MFC after: 3 days > > (cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068) > > This doesn't build on either stable/15 or stable/14: > > /usr/src/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c:1461:11: error: no mem > ber named 'ipf_jail_allowed' in 'struct ipf_main_softc_s' > 1461 | &softc->ipf_jail_allowed); > | ~~~~~ ^ > /usr/src/sys/sys/kernel.h:334:58: note: expanded from macro 'TUNABLE_INT_FETC > H' > 334 | #define TUNABLE_INT_FETCH(path, var) getenv_int((path), (var)) > | ^~~ > 1 error generated. > *** [ip_fil_freebsd.o] Error code 1 > > -- > John Baldwin I should have merged d9788eabffa4b67fc534685fc3d9b8e3334af196 before this one. I've backed them out in order to apply the prerequisite first. Sorry for the breakage. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Fri Dec 19 02:48:22 2025 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 4dXX5z1QBRz6KhD6 for ; Fri, 19 Dec 2025 02:48:23 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXX5y5w38z3PVb for ; Fri, 19 Dec 2025 02:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0WuIvkk2DaSxYXkMMbzux1q3uIqLTwkKQqVwdHsWMY=; b=vP9N4nzi6XJrh7G7aoZeJxGDZsAbZ4IjVEUd0H7Z6Cm/Nee3Fw3+uCLzyCUESeqEPinLGB 4JrXFgzt/yNpCVeCoRDTxPWLuyLDvRCELCtwIzl/ckgGUF+UtOXsAKIdqCtLETaLOgHbeZ TkpA+ynZRjEX9ap3MgIg5YcM20yQWTP76ZkHMtWKkDMc7AiGUZV/Eo0BV5r5nYhrwJHLiu w5/WG479ooplNBxcIAt5D+8/EnueyUfSOsbmYSj07IAbe1qleflwDmESV/NJl4IQFv/LhF FXDL5aeO3XBdyXJYITqfmuEtfy9jLtDvdoGwp5WzNriYc19NCmIAWvbitgoSjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0WuIvkk2DaSxYXkMMbzux1q3uIqLTwkKQqVwdHsWMY=; b=m8iz+IVnvhJevW2WTBAX0EQsRt0bR2pT6GMu71OFIQVjOFN4/k7etaAsS+6qjNCPh1pn2b lijwqpYG/G5c7vr+axzlMETCAVWn5VFkdB9uC6wLguoqUxTSAuLaG3A0VLEv0FlkYxgB2G OOM/MK4l1D3sr2fLLCmwT4iqwwU5xYkoqa6wNsOwliMsLM+lR2d8ISvmzAcGfA2H0BqkfU VVNfzMVaCKCghyV2+ggu6B31fpDQ2xr/AhN57DA0Pm/+FLFbLEgGQij34T7YkgWa1q18df BNyMdkEqO8VQWoYfMI46fk6CGX5/e1U43YYUtq2WO01n3HWYBKn/z7/a13lbCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766112502; a=rsa-sha256; cv=none; b=irj9bDj6I0KbXsahAQzZ6o+mi3JP0bCfzzWwX3f5OXYOTZLUSelWXJE87V8Hp5x3GHjrwa fAJlmRrbwzSoee/H+YBO9IDz7w3OJCkgbZ1q8FIV+jXSK+QVylHKnYk0uhqIiEjz54mKlA fsTw2qdnjkDZ97DOFAse6s40AwPYlLteTpNbnxDufv6bSUgm664jqSle59GLg8UilTNq2Z msD1uriDr0IkgbftOveSlYMguoGKtPszJ8qG9O16FAOv07nPKfwUhEFB3Eb3Zz6JK2wEUN BhcA+VmbKttQNNKpjdhu0s4LaDSpsvQ/8kLtCKNH7il08OansZDTvoVyVA0o/g== 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 4dXX5y5V5fz14xb for ; Fri, 19 Dec 2025 02:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 376fe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:48:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Ricardo Branco From: Ed Maste Subject: git: ec8d0b5f5dfb - stable/15 - linux: Implement F_DUPFD_QUERY fcntl with kcmp(2) KCMP_FILE 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ec8d0b5f5dfb2711c2403b11d93ef26a81e764d2 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:48:22 +0000 Message-Id: <6944bcf6.376fe.582c4f5f@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ec8d0b5f5dfb2711c2403b11d93ef26a81e764d2 commit ec8d0b5f5dfb2711c2403b11d93ef26a81e764d2 Author: Ricardo Branco AuthorDate: 2025-12-08 22:30:31 +0000 Commit: Ed Maste CommitDate: 2025-12-19 02:47:50 +0000 linux: Implement F_DUPFD_QUERY fcntl with kcmp(2) KCMP_FILE Signed-off-by: Ricardo Branco Reviewed by: kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1920 (cherry picked from commit fe21dbf70aa8c6dfd2010f30dd2d09f7b743e77d) --- sys/compat/linux/linux_file.c | 8 ++++++++ sys/compat/linux/linux_file.h | 1 + 2 files changed, 9 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index a4be5313aa96..daddafa325ad 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1457,6 +1457,14 @@ fcntl_common(struct thread *td, struct linux_fcntl_args *args) fdrop(fp, td); return (0); + case LINUX_F_DUPFD_QUERY: + error = kern_kcmp(td, td->td_proc->p_pid, td->td_proc->p_pid, + KCMP_FILE, args->fd, args->arg); + if (error != 0) + return (error); + td->td_retval[0] = (td->td_retval[0] == 0) ? 1 : 0; + return (0); + default: linux_msg(td, "unsupported fcntl cmd %d", args->cmd); return (EINVAL); diff --git a/sys/compat/linux/linux_file.h b/sys/compat/linux/linux_file.h index 7448dc597230..0b6ca536be7d 100644 --- a/sys/compat/linux/linux_file.h +++ b/sys/compat/linux/linux_file.h @@ -127,6 +127,7 @@ #define LINUX_F_SETLEASE (LINUX_F_SPECIFIC_BASE + 0) #define LINUX_F_GETLEASE (LINUX_F_SPECIFIC_BASE + 1) +#define LINUX_F_DUPFD_QUERY (LINUX_F_SPECIFIC_BASE + 3) #define LINUX_F_CANCELLK (LINUX_F_SPECIFIC_BASE + 5) #define LINUX_F_DUPFD_CLOEXEC (LINUX_F_SPECIFIC_BASE + 6) #define LINUX_F_NOTIFY (LINUX_F_SPECIFIC_BASE + 2) From nobody Fri Dec 19 02:48:21 2025 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 4dXX5y2v8jz6KhD5 for ; Fri, 19 Dec 2025 02:48:22 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXX5x6d3Fz3PKG for ; Fri, 19 Dec 2025 02:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RYgjbp/SvPQsv7d09f4qhwbV9jiYwjQO92D+/UMee8c=; b=ElUEs6iWcGQceRtsO8uMWWOUEFByCUYkoNrfLJ6M/vKtIEq1jujwfis0ouxmpg0G25E4VI gnv7pIKPAtCqhM0o0ONHlxruxRb4YNASfkQJXYmaAeZRd2YxLZWnpdXiS77LAwvovM4v5+ iB+WGhqOlDjxYucikZLzz7TYOvJ2MNy2lw2rGeRmS2zfXXTu3ZNXbGRJyhlDtUB6Oou+ua 35omL+MC/bPajxqSVAhZHz9w87NBhoRYf6wEF/ZAEsY8uYGu0SedgcO4AUmEfVn1UoDRli zKnXyp94bRWZEIAal/iVTF6M0ZMGb70bnRhAzKuOlEasgaudO3abHvAu4zpa/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RYgjbp/SvPQsv7d09f4qhwbV9jiYwjQO92D+/UMee8c=; b=gb3azIiKOKT4CdfSP3yzKmD5Ym5Jq9OMLyuuIIb7yxrOd3IRJ7oUrGsZN+yagrODoSn4As FvZt0Jdw53pp/WcSqQvURxo6+WKs9xdIeXp4X+vI4ifQKW/yCn7v4hSWKMtfjo6axUy+Qi LRTf98T50uaXUPwvYmSqksQC57bel4vbk8v33S6J6IU8wI9Jol5Jc+htwzNXTT5/lEJmMG ZwazqpYwSfTl6ZDPRKjS3zGpdx6pOugz1tCsk+ahikxZlC5EwebT1ZWBAVlt3jesK0klK4 nxdMMjQvSBzcbrvqXMFBwYFkVQzGBA1mXrRifw+tYU18+SwLAeHM7rCBWQUNLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766112502; a=rsa-sha256; cv=none; b=IpFbfGOtjg5vnFmMKDoQfON8ie+r1A+mmChBe4N97bHz5YsWi/rI+IWqQWJY/opv3MVgrm /cc/W5UPlAWCywMDzhvetWZEvZ0tjbeE4tpZyioudkWzvwpDlGiLsAfkyYQNVoWVI6R1i0 OdFOzutdBU8F5YlSnwmd5PgwJHX7bOGPVXahZab8jY6GAg+Hx7rw8G3isKD52Iqhl5D0MO khLZJ8HTkVY2nwbJ1oySumxoo81o65GidYdmhh/TlIApMWU5zsnO8v0du51n7UIihqb6gf LLn+aLzeYTOc+3k9o/Hg1HYE4uYlpDIQxaun8ur6uHZ5xFBOdrXlSRAItwwSTQ== 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 4dXX5x59lRz150r for ; Fri, 19 Dec 2025 02:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3675e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:48:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Ricardo Branco From: Ed Maste Subject: git: 97b7a753ecb5 - stable/15 - linux: Add support for kcmp(2) system call 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 97b7a753ecb5c85bad237c02ca390d7d7d5a0fde Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:48:21 +0000 Message-Id: <6944bcf5.3675e.602ac442@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=97b7a753ecb5c85bad237c02ca390d7d7d5a0fde commit 97b7a753ecb5c85bad237c02ca390d7d7d5a0fde Author: Ricardo Branco AuthorDate: 2025-12-08 21:27:07 +0000 Commit: Ed Maste CommitDate: 2025-12-19 02:47:50 +0000 linux: Add support for kcmp(2) system call Signed-off-by: Ricardo Branco PR: 281690 Reviewed by: kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1920 (cherry picked from commit dbac191956f9b51069617b09fd0a24ca0e7bfc12) --- sys/compat/linux/linux_dummy.c | 2 -- sys/compat/linux/linux_misc.c | 27 +++++++++++++++++++++++++++ sys/compat/linux/linux_misc.h | 11 +++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 19cd55849f65..46f98f4da1eb 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -96,8 +96,6 @@ DUMMY(setns); /* Linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); /* Linux 3.8: */ DUMMY(finit_module); DUMMY(sched_setattr); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 0925ffb64480..69fb9935a9ae 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -3067,4 +3068,30 @@ linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) return (error); } +int +linux_kcmp(struct thread *td, struct linux_kcmp_args *args) +{ + int type; + + switch (args->type) { + case LINUX_KCMP_FILE: + type = KCMP_FILE; + break; + case LINUX_KCMP_FILES: + type = KCMP_FILES; + break; + case LINUX_KCMP_SIGHAND: + type = KCMP_SIGHAND; + break; + case LINUX_KCMP_VM: + type = KCMP_VM; + break; + default: + return (EINVAL); + } + + return (kern_kcmp(td, args->pid1, args->pid2, type, args->idx1, + args->idx)); +} + MODULE_DEPEND(linux, mqueuefs, 1, 1, 1); diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index 2d2b12ef0127..63ed914afc63 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -216,4 +216,15 @@ struct syscall_info { #define LINUX_IOPRIO_WHO_PGRP 2 #define LINUX_IOPRIO_WHO_USER 3 +/* Linux kcmp types from */ +#define LINUX_KCMP_FILE 0 +#define LINUX_KCMP_VM 1 +#define LINUX_KCMP_FILES 2 +#define LINUX_KCMP_FS 3 +#define LINUX_KCMP_SIGHAND 4 +#define LINUX_KCMP_IO 5 +#define LINUX_KCMP_SYSVSEM 6 +#define LINUX_KCMP_EPOLL_TFD 7 +#define LINUX_KCMP_TYPES 8 + #endif /* _LINUX_MISC_H_ */ From nobody Fri Dec 19 02:48:23 2025 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 4dXX601s2Bz6KhdH for ; Fri, 19 Dec 2025 02:48:24 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXX5z6k2kz3PVc for ; Fri, 19 Dec 2025 02:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112504; 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=XobeyWeAU7lC5Ie4WuOOxBqHGIu3meRRkOBKaApXKXE=; b=vNRZh/w/27XdQoqtBKzjEfJOI9AJ/hVkX/2GxrW7onddyIJ6/87MYqBPXRlTVItjjNv7Sm PBp73VRZsXC7daIs6SevEk5YyWWDh4bg0bsufpQ6d/D8l+C0S6mjztAEcFT3GgdFKYpj/b R3BhNTPXI0M9sLCe0H7gP3LD4RdQaTw9cme7AgZeMzMKJfilPJTW0P5CcEIDJFPKvJ5m9X r9khs32S8FHPC6Im9v/EBMuBH7mHIzDgFNviyK4Lk6DwE/Q2vWXj3btWzH2zRcKL7rMbpm UWs7jYFX1t7KCZhRYKxwkERuG+K75OImaLnrE1zaK57g7iuwC3tPoOjCShNomQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112504; 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=XobeyWeAU7lC5Ie4WuOOxBqHGIu3meRRkOBKaApXKXE=; b=qMlNgUYzCrCplvJX0oh1uJayRZrbhc0L3SgPufCBC9ZRydt3pVsespkRzJtY7e6iUvrSfu CNmJmS6Eq/SruITGSui8+FYWzEuryDiG+HaWl7l/klSfWFA6X4Bvz0wAHMxgPjDtoK2edr xpwqHbYjeQypSnXcPHxZ6Lv8CU0ezBR5jJolWlRbv/Wo2LDYqeReVKFdbGwpz2aNHYwqhe 1wZObENb2p7ejGawq4HyI5BsP3t7AshASuG+olKQ7zbr78tQT/AyU/LA5wQ7PghWCJONwS RXBp6OFwgDLn6Pab127Lz6pwyyfctbtcK0WcQHVRd5yOZ72gBB4foGtDO6Fjjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766112504; a=rsa-sha256; cv=none; b=GBYmVtQ8FRY9yL9CK4FXD9Shq9IoA3xfDB5+cIpHfwBXTA+YZ8hJrDXxBmpYicjJjmQcbR vL1Zkx+9AgZ5UKOl5Pau5fsJpuzvhUPhic8e/ohdG9jn3TRTgMg5jaR7RNpiI0FwqHV/aW BHBmK4ranH8LlKlmyIC4GG857BTojtQo8Rgru0drJop5IFcIk5m7gve7LtYIhIZgu8pqXO fRZDLt5OP9ydX46RWB9tt5FRgjlRY69QTAP2Dzy7JjOvW/HoKJIRi4Cfyp3R0TwvVFOug4 8VKWK7dQjdUUNTv5+XPwvzsV1k4c396S/wdXcoiVMti5hwnyQJmosYymRNHU0w== 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 4dXX5z6Hw4z150t for ; Fri, 19 Dec 2025 02:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 375cb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:48:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 51e30d5adfb9 - stable/15 - login.1: Remove mention of login copyright display 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 51e30d5adfb910b2130eec82d356b88404df250d Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:48:23 +0000 Message-Id: <6944bcf7.375cb.e69051f@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=51e30d5adfb910b2130eec82d356b88404df250d commit 51e30d5adfb910b2130eec82d356b88404df250d Author: Ed Maste AuthorDate: 2025-12-14 16:43:51 +0000 Commit: Ed Maste CommitDate: 2025-12-19 02:47:50 +0000 login.1: Remove mention of login copyright display PR: 291649 Fixes: 905571c03119 ("Remove copyright strings printed at login time via login(1) or sshd(8).") (cherry picked from commit 5917f9571dabddf28f95d15c17b65dc163628d44) --- usr.bin/login/login.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/login/login.1 b/usr.bin/login/login.1 index 8c24c4bda9f0..5dbe307e5dd3 100644 --- a/usr.bin/login/login.1 +++ b/usr.bin/login/login.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 29, 2022 +.Dd December 14, 2025 .Dt LOGIN 1 .Os .Sh NAME @@ -87,7 +87,7 @@ file. .Pp Immediately after logging a user in, .Nm -displays the system copyright notice, the date and time the user last +displays the date and time the user last logged in, the message of the day as well as other information. If the file .Pa .hushlogin From nobody Fri Dec 19 02:49:16 2025 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 4dXX7047hGz6KhdT for ; Fri, 19 Dec 2025 02:49: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXX703K5Tz3QGQ for ; Fri, 19 Dec 2025 02:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112556; 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=kJtfpO7H42J+gF915o0Pk+zpEulCytv1Em+5hyG3qzA=; b=GjfvcwEcTkOS+eiyN9shnariGCeGoPCYFWcWG9PVm+Tg4cJOXcgDX4PogjrgmeOSQzV80T p9BoKPWz00mn8XzV7icqsyj0wqmUZZqZ9VZe/zyPa6bbuLUEsnNYElpeLRhordFE3huczv /gHti7HyPhtlYZzrflKxitouqTNBsL6/x1FRZqoa0DN0OyK2hW4KHkQJuZGML8xMninxui FtfjuEEww9bYh/SVJ/I52nLzZ4hqCzCxCrTOywwkoKRMI6wD1e24pD1wKgMA4Sz0RKUfCT A6dk1hBQ4IJc9xR4dxYqL0wHUE/hbaFGEy1sgiGREJAH4aPaQQh29ErN/PO4iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112556; 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=kJtfpO7H42J+gF915o0Pk+zpEulCytv1Em+5hyG3qzA=; b=WNpqCV8e8VB7nfEmCid2JRXE0cl7iJMYAJp+azBatv3Tu7WmFtYinaE8WFj9VW1/58LY+O TJWAVFFHseOrH/A4XYDGIBsx1umFwxVc7tZZHi6SBQoTd4HFIigIiaVPNoH9ZSgImwBpdm vmOeQgkuhy+oJoAL/IyzPrI4SM7pWic/dtyxQCP/puM5ztgwTz9wmRpcmZVWs74Sbo2COk NoSEds0kliS71gfMPZ4grugv9F9fp1eCIq7Q/WIeMfpLfDjxSNPDdRd3u2cKN2W6ozzMeH GGt0CE/nV2x5ePPIlXmj7Y1KCy3C48t6JaTGfihObKXuWaiQ/FG8OgijulxBPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766112556; a=rsa-sha256; cv=none; b=vY03PPw4dzpTy4uDiB4dkNv2EC6ENYRsyi6SC1P9QytmuSBR5WZzXWCshRyJi/DmcObEds REvswId2ZmQH56e1jd6ou7ZJvSIGAEDEyriWymG3BsHEnaxMYRGee0oChveBMlzaICOSMt 6Eew35i2lhfILWp7vVmjidyabyoQAbupH7vSYz9ecKeaKQa547knbAJTfhbb5jUnZg7Y4f GEheJ1Sgnroz+mNiwTqS39kpTjyS/LT047L/2gKtLblH1Z+IdiH6EWV8VKDBtTCHMJIBLU vG9nz5cKpkBgMv3C2viWPDHwb/mxSMFatB0RtZIajzwQEHSjdJeWUPUs8fRrWg== 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 4dXX702ZTYz15HD for ; Fri, 19 Dec 2025 02:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38fa1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:49:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b3d8026db322 - stable/14 - boot.config.5: Clarify that this controls legacy boot blocks 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b3d8026db32244e1c4816a50f7172938c46cc1c3 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:49:16 +0000 Message-Id: <6944bd2c.38fa1.6794e322@gitrepo.freebsd.org> The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b3d8026db32244e1c4816a50f7172938c46cc1c3 commit b3d8026db32244e1c4816a50f7172938c46cc1c3 Author: Ed Maste AuthorDate: 2025-09-09 16:06:03 +0000 Commit: Ed Maste CommitDate: 2025-12-19 02:48:41 +0000 boot.config.5: Clarify that this controls legacy boot blocks Reviewed by; ziaee Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52460 (cherry picked from commit e96359d111aaffa6bf0ea72a6f183eb3b91e6c72) (cherry picked from commit de67d3cfc6537f6bfa8f2601da7af9c165d09075) --- share/man/man5/boot.config.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man5/boot.config.5 b/share/man/man5/boot.config.5 index 0b6d4c7b34e9..ddc232952f10 100644 --- a/share/man/man5/boot.config.5 +++ b/share/man/man5/boot.config.5 @@ -21,12 +21,12 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.Dd October 12, 2020 +.Dd November 14, 2025 .Dt BOOT.CONFIG 5 .Os .Sh NAME .Nm boot.config -.Nd "Configuration file for the boot blocks" +.Nd "Configuration file for the legacy boot blocks" .Sh DESCRIPTION The .Nm @@ -34,9 +34,9 @@ file contains options for the .Fx boot block code. .Pp -When the +When the first- and second-stage .Fx -boot loader runs, it searches the +boot loaders run, they search the .Dq Li a slice of the boot partition for a .Nm From nobody Fri Dec 19 02:49:17 2025 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 4dXX715x5hz6Khgs for ; Fri, 19 Dec 2025 02:49:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXX713l0dz3QK3 for ; Fri, 19 Dec 2025 02:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112557; 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=cry0QO4o8uV357CAyiMSrC8bPEG02FNvT+73uJ6A6m0=; b=P5BHpT8axI6NITL3kiSNHL8LcXOu1sHPzHuVQeAnLNo3GYA6cY01aTfZyNfAsuEHI4fb75 XNc+z2y/EHNAmt+5w4mNAcBy6+F8O8oPlDO5Ix4w9uS53EIHPma0is4yVdP9v21mVL+SMG 2iU93rVW0L1A/I29rNNUo4i91yC+xaDdLdVsE+byTOyOAjfp/rWgzlbd6vg55ndGLVEHpk GV5AchICzDtazHiS6Iceo+PbYV6j+XQcDzyX3VIiGhNQKMzidAZ7+0mv2DPiyXps6K1iWC Nk0FporrgC+xTeIySReP7+UMLfcRbqLm6MFmzA2gaavvmcjkD2DMI8HyGk916A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766112557; 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=cry0QO4o8uV357CAyiMSrC8bPEG02FNvT+73uJ6A6m0=; b=So8yakoC+UvEFyWy1guiWTW2oKJQ9yj6XClHZp3WKWTAGkq/QduxtHCylpYDeiYllKSjoh z/t7Frlnk8uGdDLCxWNsFEc2bwheBu627bmQ6dDgDUkjIF4hYCzmD/tjwVMgCzo7AqQyvW 40vVWZPzbeBi2hsox6/ygiGcPZAxdaVJ7xMPzaC7PHYAXtbjH5D9J4okoVwP1yGTrIhECM QswyvQvz36E/8OpQ2ZF8CdrGV5miIAydYIAK3v+d7NkpRIJjWOLGhyvD3LQJp1J76YBtSJ u1KcEfb8XhKJanqToGc3rR24Lz1bzLBJfUSUqhLO7QOVZMKYt45kN1rCsWrj1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766112557; a=rsa-sha256; cv=none; b=tOY8i22WviFpZKgdvawX/so50JivgOomo+r8xlpU/XXeXRBFQwtpmy4bZGfUnml7JhdEmT +TgBufH0uIJheovJGbbjjHf1+3WouCFplyfiH5CY6Ad91MnGBVqCSQPgYKEhyGsjyc+oQx vSoO0PWKQhz2zhPJatzqRCfiu1oG6sVGKLajuPJiI48x4CLLJS9Q/mAQWXKzXq+mCfUS+b Vkj+/vIE4A1rUTiawDNbemJOQTzpZCxSpgwI+1nhoUDj+iT59WQObmizHJsv55PITi4BLs 0+klppExDQbF46+zo/6fU9X2YQrRnGGGXlUY5Nw4du99r+NCXfzsAlumnEK/5Q== 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 4dXX713Hcnz1537 for ; Fri, 19 Dec 2025 02:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38bc9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 02:49:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c19688407a2c - stable/14 - sys: Bump 32-bit kernel removal to 16.0 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c19688407a2c797e74762aebd90c1f1cc70ab726 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 02:49:17 +0000 Message-Id: <6944bd2d.38bc9.2fb455e8@gitrepo.freebsd.org> The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c19688407a2c797e74762aebd90c1f1cc70ab726 commit c19688407a2c797e74762aebd90c1f1cc70ab726 Author: Ed Maste AuthorDate: 2025-10-24 18:28:56 +0000 Commit: Ed Maste CommitDate: 2025-12-19 02:48:41 +0000 sys: Bump 32-bit kernel removal to 16.0 We are shipping at least one 32-bit kernel in FreeBSD 15.0 (i.e., armv7). Sponsored by: The FreeBSD Foundation (cherry picked from commit 7b28d549427bd85ecfae24d09da6eacb26c15822) (cherry picked from commit 19b642b5dc2f000de4e3e55d9da94398ecb0aca3) --- sys/kern/init_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index cc9d300caa6e..aa541c527a19 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -386,7 +386,7 @@ C_SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, #if __SIZEOF_LONG__ == 4 static const char ilp32_warn[] = - "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n"; + "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 16.0.\n"; C_SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); C_SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, From nobody Fri Dec 19 09:19:00 2025 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 4dXhmj2R3gz6LBH0 for ; Fri, 19 Dec 2025 09:19:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmh5Fb5z44dt for ; Fri, 19 Dec 2025 09:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135940; 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=8ypnvNt+4ZJ3nquvUpsG9j49MyKTEHFDgS+cUKC3o8Q=; b=jFSI0A6wtrPA2NODheNJw6WkcAfdj+FQWGbNlgOIdodE78eeSTTeddlJVCEaZZAlZubtOV IvzehGhFty0f7IWFFIr7aI2MY1rnxA0epJdJBcHivAOlRYv6uByc093TG7/CPfMcgRqCp2 EWCKbqUqNVXp9etjMiuYoLvWb4Z0S5YiEqvjyBwNmYcZByXr2USP/r9B3qx4Dqz9ymsQvN DWeGXfOxikFCz5UVh3hwEKBXTDWL1he43nS8cE5m+/HpFFyHNVlfoKu+fKmVX62S0inTyU XTIFg97tFomi38W5VWV+w0tzqXJTfDPi/M8/cUH6zmasL+ipoveqzEVySFhK+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135940; 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=8ypnvNt+4ZJ3nquvUpsG9j49MyKTEHFDgS+cUKC3o8Q=; b=YcqOxkWxmeU+nNh/Pd+3Cc6AyY/zsWrjZdXepwZm0yMPZEW5sJBwOyeOBYYQG3/G7y3r+A tOs3MMQMUuko/rTTL5Ak2NCNGfRVlwBaKKqRPtnUxX62aJbr6u0krNakef/tU2FvCGj653 rZ48i1Gr1lHqafqc/Qt5IduU8mSquE9aVEW7aK5wiXUl2NuUeqc1V2TGOPfi0Q1I3E6uVr IrlWjbkwxi1v9Pwl2OcIfRCosbwXbkny9B1ViF+lUsZ9NYwAWDKHXBgCvIKECCpzdLsmlT 4BeWPeX9SE5ZmBOkyOsmXvs4+tyAqDpON8RcvCZ2cgAa7CxlhriBKF1iNW4SBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135940; a=rsa-sha256; cv=none; b=nhRXqf017B1wd+J4KVUbIujbEVlE1FdOxAVq3YQ22WJAqbl91Om9KSfNyuSz6h+r3XvESb Afg6Fdzad3Y1VeBKOi60Gr2braBLuppjl5Zdea5COBzd4RnKrSfOYXgQqLSCGIR0DVTcz3 5tLZ2nN36WfyDAYuTNW6FRI39uXMiWxQ153B7B+VdeksxXfawQkAocTyQrBZYB7eAhg6T6 A8N2KklL57dLFdNN5YDh2Q9aILApmNS27GEowXZ+d5qoNTw1Lf6hbdlPBMhp6kDWWLm/X8 8snk+8d261E2wSfUePnEfph66aMgGzvV5p/tp6qaRuF+QRmwUrU6feZc5TagPQ== 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 4dXhmh4kdQz1GYV for ; Fri, 19 Dec 2025 09:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cdd4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: fecb79a5a83e - stable/14 - libsa: smbios: Detect less-than-64-bit platforms via __SIZEOF_SIZE_T__ 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fecb79a5a83e1207c773df113b5d855634809107 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:00 +0000 Message-Id: <69451884.3cdd4.7294bfac@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fecb79a5a83e1207c773df113b5d855634809107 commit fecb79a5a83e1207c773df113b5d855634809107 Author: Olivier Certner AuthorDate: 2025-03-11 16:56:20 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:37 +0000 libsa: smbios: Detect less-than-64-bit platforms via __SIZEOF_SIZE_T__ What we really want here is to know if pointers can refer to 64-bit addresses, regardless of whether they also hold other information (such as capabilities in CHERI). __SIZEOF_SIZE_T__ is probably the closest indication to that piece of information, so let's use it. __ILP32__ wasn't wrong in practice though, as we don't support 32-bit CHERI hardware (and likely never will). Consistently with this change, test whether we can actually address the 64-bit SMBIOS's structure table by converting the end address to 'size_t' and checking whether its value is preserved. Suggested by: jhb (for the __ILP32__ => __SIZEOF_SIZE_T__ part) Reviewed by: jhb, imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49318 (cherry picked from commit d3bfcd66409befc2d545e5449963b41c25c369a9) --- stand/libsa/smbios.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stand/libsa/smbios.c b/stand/libsa/smbios.c index 32cd198a9537..73b49a111f89 100644 --- a/stand/libsa/smbios.c +++ b/stand/libsa/smbios.c @@ -186,14 +186,17 @@ smbios_sigsearch(const caddr_t addr, const uint32_t len) */ SMBIOS_GET8(cp, 0x0a) != 0 && smbios_checksum(cp, SMBIOS_GET8(cp, 0x06)) == 0) { -#ifdef __ILP32__ +#if __SIZEOF_SIZE_T__ < 8 uint64_t end_addr; end_addr = SMBIOS_GET64(cp, 0x10) + /* Start address. */ SMBIOS_GET32(cp, 0x0c); /* Maximum size. */ - /* Is the table (or part of it) located above 4G? */ - if (end_addr >= (uint64_t)1 << 32) - /* Can't access it with 32-bit addressing. */ + /* + * Is the table (or part of it) located above what we + * can address? + */ + if ((size_t)end_addr != end_addr) + /* Yes, give it up. */ continue; #endif smbios.is_64bit_ep = 1; From nobody Fri Dec 19 09:19:01 2025 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 4dXhmk3Tz1z6LBDn for ; Fri, 19 Dec 2025 09:19:02 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmk06SLz44W7 for ; Fri, 19 Dec 2025 09:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135942; 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=Z4t2LQ3iRCRp+49mSR97Kg3vYCioxG3wfSIadPiOyhA=; b=dhWh+BVLDsBZXkTfd4dTRHkE3/ssWQap1pNSui+CDy8HVaRCXDRsZPSTUP9fFzx1XmSa+U zzQVEUXTAbYWZZPaN6oK9rgDCnoJrDLDhuLcD72GzkjqPptfA6m90pLTis3yFgN93i1azu wfENSoF7am1e39+A3QD1c1Jf/MH9qGFG3JHLNK+jCSJ+uShErLhM+Vk0o4a17psIC0iJ8I j2Zmyhp3SM+iH8gjcAMGeEJl+JkGNHapOef+mc0Ld7IPAh/l3fj2wSxra8kyczTPtr+SLG Kre8v98Dsyjzk45iEb8njfae/QRnFCH8/OT5AkvLne3DxtezUZnp0nOv3ItTFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135942; 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=Z4t2LQ3iRCRp+49mSR97Kg3vYCioxG3wfSIadPiOyhA=; b=IMvt/pmv/F+1wiFVBkK3sY/qynBTnPTUFeRVyBLaVQhIF79ySRVEs87V0TRXg68SIxtxvb L0QKNgMMS6sBtzgAQytWgFYjy0nVuI8YZJV3L2DOy4F/BDhXUAC3mZZeEsNx8+H/4Zm8n+ rpwv5m/2rb2SZEapMgKlnCB64y7ktzEy0KphDIAcIh1pTkiknLLZu6p4PE6TzQhvViSkU4 t5pQ/deHJHKcYmucx2kSPLrUMTgNzq99O1oR3839kOB2qYDbB+K4w6uegLKi9wiV+QPl+F svb8k4DKZqCVht5kcI6bb116C622tO8LuyDKYbPhF+dwW0K/skAVAupb3ry3Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135942; a=rsa-sha256; cv=none; b=JqrD6fL8k0O9U8jZxUQnuYm7Fc+ZU+YJupTugfKgZSI/dij9RGVr1XuU8pfuDMiHsz4jFA JQ9gKXMoywA6p0b3Ox3EoB9dHRBOKL2Yyup34o3jf+l3AVC77NTx5aTs3RBexMxE3GpmVe l2BnziSr322gO++By87NmkBYwHxxSrAISnUxoVzZCmRobtcMa8r+psBj5styF8iExUTDcJ 71wRKvXfH7OM7QbDaTB6PLzkwRwi0vNS0k+sWjnvRnnMu/WEl/jynkkS3bn+ghlPnk8gV4 HPtEOmJWc8YbORR6iPIEkuTJJ4l8ZpqAnzzr14iLStLCIPTRng3RHJqXIjmk1w== 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 4dXhmj5xNlz1GKm for ; Fri, 19 Dec 2025 09:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3de78 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b987035c2af7 - stable/14 - uma_core: Rely on domainset iterator to wait on M_WAITOK 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b987035c2af7adb56f8a89253e09a0f4ead1beb7 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:01 +0000 Message-Id: <69451885.3de78.7a4e9eb3@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b987035c2af7adb56f8a89253e09a0f4ead1beb7 commit b987035c2af7adb56f8a89253e09a0f4ead1beb7 Author: Olivier Certner AuthorDate: 2025-09-08 17:37:35 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:43 +0000 uma_core: Rely on domainset iterator to wait on M_WAITOK Commit 8b987a77691d ("Use per-domain keg locks.") removed the need to lock the keg entirely, replacing it with per-domain keg locks. In particular, it removed the need to hold a lock over waiting for a domain to grow free memory. Simplify the code of keg_fetch_slab() and uma_prealloc() by removing the M_WAITOK -> M_NOWAIT downgrade and the local call to vm_wait_doms() (which used to necessitate temporary dropping the keg lock) which the iterator machinery already handles on M_WAITOK (and compatibly with vm_domainset_iter_ignore() at that, although that does not matter now). Reviewed by: bnovkov, markj Tested by: bnovkov MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52441 (cherry picked from commit 781802df7a2bfe224ef17596d56cf83c49517655) --- sys/vm/uma_core.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index dbac8cd3db27..4a6413fd1669 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3976,21 +3976,15 @@ restart: /* * Use the keg's policy if upper layers haven't already specified a * domain (as happens with first-touch zones). - * - * To avoid races we run the iterator with the keg lock held, but that - * means that we cannot allow the vm_domainset layer to sleep. Thus, - * clear M_WAITOK and handle low memory conditions locally. */ rr = rdomain == UMA_ANYDOMAIN; + aflags = flags; if (rr) { - aflags = (flags & ~M_WAITOK) | M_NOWAIT; if (vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &aflags) != 0) return (NULL); - } else { - aflags = flags; + } else domain = rdomain; - } for (;;) { slab = keg_fetch_free_slab(keg, domain, rr, flags); @@ -4020,13 +4014,8 @@ restart: if ((flags & M_WAITOK) == 0) break; vm_wait_domain(domain); - } else if (vm_domainset_iter_policy(&di, &domain) != 0) { - if ((flags & M_WAITOK) != 0) { - vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); - goto restart; - } + } else if (vm_domainset_iter_policy(&di, &domain) != 0) break; - } } /* @@ -5212,7 +5201,7 @@ uma_prealloc(uma_zone_t zone, int items) KEG_GET(zone, keg); slabs = howmany(items, keg->uk_ipers); while (slabs-- > 0) { - aflags = M_NOWAIT; + aflags = M_WAITOK; if (vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &aflags) != 0) panic("%s: Domainset is empty", __func__); @@ -5233,7 +5222,8 @@ uma_prealloc(uma_zone_t zone, int items) break; } if (vm_domainset_iter_policy(&di, &domain) != 0) - vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); + panic("%s: Cannot allocate from any domain", + __func__); } } } From nobody Fri Dec 19 09:19:02 2025 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 4dXhml2F1Dz6LBH4 for ; Fri, 19 Dec 2025 09:19:03 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhml00lrz44f0 for ; Fri, 19 Dec 2025 09:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bEL7zaic100CaM5CZmwwcaMf5vERMMf9G7P3IKKzm2I=; b=IHKBLUjI90VVOOsu7/hXSMqh8djJEzyG0rDubm8JtXMEbgp3tQnqVNGnlxkK1ycIy9pbTm XmZT8mH/B+OA+aw81g6Ys5quHyqIKquwqXhbMoU6HkvtDB1Yxna3PFJxgdhp0PkyA/jeJf v+w8YLsliW90830PT9VfYkCwplSMPwTqZB9Fuof8K3aiBVGR57nGr0PriuBHvjtCXFJaed hjWD4ykWeqMEYApsmhTvDUek4NVTYHoWGAlSH8jQavBpfRWSBoF/MEs79WDzqMyn7RfP0V WlJW5ENdxyZ8uDFdZNjGmn74GfhrKxkLV63hLShl3KlgH232Kd8ojg1mEHcTTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bEL7zaic100CaM5CZmwwcaMf5vERMMf9G7P3IKKzm2I=; b=jyDeikfL51GyN5g8/9QeOwXZRK8clzk+YZpukkVh5w/iF63VgEJ5Oyqf84yXT2gDxzEXbm 1dYXj1S/IJI3wvvTD8uAlTfGch+i8rNDYKsNm5FiXqpwxNaPYJwX/0J7ih66FMfvzRbcki vhg1197cBW5prpsVEso5owW4L0lVdSR7igF4robKIpSAJC3J0NK2R60ONfV3ySkIoD9blk ahAdPX93UmrTlPLWy2kTqQ/aWg60jBGxmXkMlvRta9GtvvrvkXnqaNYp93PsD5okdA4amp U2HpIEdB7hAXO5z9cjal7y8vksbgiHqif0EhT7gHydDdenLPSls7XjjqXySOMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135943; a=rsa-sha256; cv=none; b=fWkbTMM4tmIqsCAi7EDOArvvhwriYkMvPqANz8PKmuB44wrnDMVLDk/Fsb+DB+NO4oXd4f 9kZpuZ0NchgeRY2Z3oezRfKV6KoOFN1G19lcENAk/sSKMGAfzuuz14zQxsokdC0UdTdcxC 2c/mXZI7pcAyJuXrw/YHkBiMf6R8mKH26AMBcu9n1LU1VTRDhO5MleXb0puRhL6jbcO27P oqgJgSqB7N79VgU23Uf5n032rUyxCuuF79ZMr+apKuCKPDKOGzROQ2/s6ckuWtYJ030JZz f0eCviwu+JHt0CRmWtB5cJSwevXl5g+h9cTCLR3MhBm821tV9b07U8vMrCheYQ== 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 4dXhmk6NpXz1GKn for ; Fri, 19 Dec 2025 09:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3eec8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Kyle Evans From: Olivier Certner Subject: git: d913e3fe23b5 - stable/14 - tftpd: explicitly set egid after dropping supplemental groups 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d913e3fe23b538bf602a58d5cdf1438c16a8e41d Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:02 +0000 Message-Id: <69451886.3eec8.3b54eb72@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d913e3fe23b538bf602a58d5cdf1438c16a8e41d commit d913e3fe23b538bf602a58d5cdf1438c16a8e41d Author: Kyle Evans AuthorDate: 2025-07-24 14:59:07 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:43 +0000 tftpd: explicitly set egid after dropping supplemental groups tftpd seems to be the last program in base that implicitly relies on setgroups() to set the egid. This is a security landmine in portable software as most operating systems don't behave this way, so do an explicit setgid() in case the kernel doesn't set it already. While we're here, FreeBSD's setgroups() has supported nominally clearing all supplemental groups since 1997. It still leaves the egid in our cr_groups[0] because we don't have an out-of-band way to store the egid, and on other systems it'll clear the supplemental group entirely as one would want. Reviewed by: allanjude (previous version), des, olce Differential Revision: https://reviews.freebsd.org/D51149 (cherry picked from commit 5138a20765c76cdc8f245d3d7caeffe9a9011bb2) --- libexec/tftpd/tftpd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 81bc79fc2c12..d27054b757f8 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -363,10 +363,14 @@ main(int argc, char *argv[]) tftp_log(LOG_ERR, "chdir: %s", strerror(errno)); exit(1); } - if (setgroups(1, &nobody->pw_gid) != 0) { + if (setgroups(0, NULL) != 0) { tftp_log(LOG_ERR, "setgroups failed"); exit(1); } + if (setgid(nobody->pw_gid) != 0) { + tftp_log(LOG_ERR, "setgid failed"); + exit(1); + } if (setuid(nobody->pw_uid) != 0) { tftp_log(LOG_ERR, "setuid failed"); exit(1); From nobody Fri Dec 19 09:19:04 2025 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 4dXhmm4cd2z6LBBW for ; Fri, 19 Dec 2025 09:19:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmm0tQmz44hK for ; Fri, 19 Dec 2025 09:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1cqsM04DO3Niiy5A8i1fLEPTUisZsSmkus2o9+CqEtk=; b=yechWmsk8du6amf0Fh6CXLG7TreI2IKc/EKlU0nHgHBJ/RNPYsfJjQ2rmnoAbwaP2+VOld IDH0rBO9y6zswBRsGXIeOPx5hTVVIISlhow1d+ej66Dn5JkGim5+HcveGlxSQj1fTLtdpY X3eZjdq+YCwsYxwopC/SZeHqBIXB46eeyatyKHZ/+8MEza4R11OjrnKWUgsYwRRjqWYQit 3bO8mTGcI2gfZTmqzezg+dBBD5+X9DAqwdeUHlT6099Q1Ftk1++IcM4KqFiQ/R4En/T+sN 85ZzJfxlHK08U60GbGUswCiC6w9r7yOlSN6QNPS3PbklIUuHet73/LH5dR1ltw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1cqsM04DO3Niiy5A8i1fLEPTUisZsSmkus2o9+CqEtk=; b=vr3QtNmiN7AKWvBWvCMZSR9dkSkL915fXrHezkb/Kdui7qS8jI18VnSKT/axDUmmZcN+MG x6W2QZWOo+wpPz7Y55qITgH+3xpaa/eNQsrvueCaoLJeHlW9Tip/CNDMq2uaeeSTQ+k8hE e/9M5OtmLDPZZKW6ZPgXDmMvQNHUx8k0nOQLMc7DvXP0nTB9J2qSnUlQ7pRmMM6+n9yATT WSrMcDc6PgRSy492EqeyVZnOe4+Gi+dVWQPUrZf1RNRF2lGRFPxgtfCybN3rqE/RsBd9Sg ewT5cTKXstxT7XopI5XveBltlmU1HgtlUJhq22vUTrCJYG2dw5YyIwmF7s93BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135944; a=rsa-sha256; cv=none; b=IiTDZMWdsyp9g+/6GzvCJ4fFqDORZZAboIh5SuvzQrzMgXZzChx020Zo5sfRd2Kf/Yp9LS TwaaQNl3etJM8WAPEoAOATYUI2qrgrV0oje+nKGlctUE2S/6XsPLWSAO5DvAEjCEO+X5pA 7WxaTbv6E/0Xv0rsKXV30du2qJNI/3GBqw3O2NPazPgo5FmwmXE8kQSHPH8yJ333iBSgF4 JUsazOJvUAqAGd4EiFsbw9ZIRfvB/uv2I6nQ98kEIvakRtfprOV0ZmLTuGJN6IxYVPWEIy dqYUg9K2wZ8ginPJjFHVIeCSRiQDCI8z9VFhPekfZ13mIHOSVQE27ihwsk4oyg== 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 4dXhmm0BxRz1H01 for ; Fri, 19 Dec 2025 09:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ed0b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Kyle Evans From: Olivier Certner Subject: git: ed39e2b3cf42 - stable/14 - kern: adopt the cr_gid macro for cr_groups[0] more widely 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ed39e2b3cf429dc34cd27c1fa09a39db9451ea78 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:04 +0000 Message-Id: <69451888.3ed0b.61eaa913@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ed39e2b3cf429dc34cd27c1fa09a39db9451ea78 commit ed39e2b3cf429dc34cd27c1fa09a39db9451ea78 Author: Kyle Evans AuthorDate: 2025-07-24 14:59:08 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:43 +0000 kern: adopt the cr_gid macro for cr_groups[0] more widely A future change may split cr_gid out of cr_groups[0] so that there's a cleaner separation between the supplemental groups and the effective group. Do the mechanical conversion where we can, and drop some comments where we need further work because some assumptions about cr_gid == cr_groups[0] have been made. This should not be a functional change, but downstreams and other out-of-tree code are advised to investigate their usage of cr_groups sooner rather than later, as a future change will render assumptions about these two being equivalent harmful. Reviewed by: asomers, kib, olce Differential Revision: https://reviews.freebsd.org/D51153 (cherry picked from commit 46c07316f90628a82dd461376ccff64a81254325) This was MFCed to ease application of further commits. NOTE: Downstreams and out-of-tree code targeting stable/14 need not do the switch, as splitting 'cr_gid' out of cr_groups[], as we did in stable/15 (and is in 15.0), is not on the agenda for stable/14. Comments that were added temporarily for stable/15, alluding to the future split, have been removed. --- sys/fs/fuse/fuse_internal.h | 6 +++--- sys/fs/fuse/fuse_ipc.c | 2 +- sys/fs/fuse/fuse_vnops.c | 2 +- sys/fs/nfs/nfs_commonport.c | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/kern/kern_prot.c | 38 +++++++++++++++++++------------------- sys/kern/vfs_syscalls.c | 4 ++-- sys/netpfil/pf/pf.c | 4 ++-- sys/netsmb/smb_conn.c | 4 ++-- sys/rpc/authunix_prot.c | 6 +++--- sys/rpc/svc_auth_unix.c | 2 +- sys/security/audit/audit.c | 2 +- sys/security/audit/audit_arg.c | 2 +- sys/ufs/ufs/ufs_vnops.c | 4 ++-- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.h b/sys/fs/fuse/fuse_internal.h index cddf88095840..932012b5f52a 100644 --- a/sys/fs/fuse/fuse_internal.h +++ b/sys/fs/fuse/fuse_internal.h @@ -208,9 +208,9 @@ fuse_match_cred(struct ucred *basecred, struct ucred *usercred) if (basecred->cr_uid == usercred->cr_uid && basecred->cr_uid == usercred->cr_ruid && basecred->cr_uid == usercred->cr_svuid && - basecred->cr_groups[0] == usercred->cr_groups[0] && - basecred->cr_groups[0] == usercred->cr_rgid && - basecred->cr_groups[0] == usercred->cr_svgid) + basecred->cr_gid == usercred->cr_gid && + basecred->cr_gid == usercred->cr_rgid && + basecred->cr_gid == usercred->cr_svgid) return (0); return (EPERM); diff --git a/sys/fs/fuse/fuse_ipc.c b/sys/fs/fuse/fuse_ipc.c index 164b7abdaa53..7fd819705d21 100644 --- a/sys/fs/fuse/fuse_ipc.c +++ b/sys/fs/fuse/fuse_ipc.c @@ -869,7 +869,7 @@ fuse_setup_ihead(struct fuse_in_header *ihead, struct fuse_ticket *ftick, ihead->pid = pid; ihead->uid = cred->cr_uid; - ihead->gid = cred->cr_groups[0]; + ihead->gid = cred->cr_gid; } /* diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 28dca332dfd3..e400d02887fd 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -878,7 +878,7 @@ fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) if (incred->cr_uid != outcred->cr_uid) goto fallback; - if (incred->cr_groups[0] != outcred->cr_groups[0]) + if (incred->cr_gid != outcred->cr_gid) goto fallback; /* Caller busied mp, mnt_data can be safely accessed. */ diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 0c94f4e7dc52..9caa29aaa8f2 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -379,7 +379,7 @@ newnfs_setroot(struct ucred *cred) { cred->cr_uid = 0; - cred->cr_groups[0] = 0; + cred->cr_gid = 0; cred->cr_ngroups = 1; } diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index fe36119e08dc..755372d51a68 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -6827,7 +6827,7 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, if ((dp->nfsdi_flags & NFSDI_TIGHTCOUPLED) == 0) { tcred = NFSNEWCRED(cred); tcred->cr_uid = flp->nfsfl_ffm[mirror].user; - tcred->cr_groups[0] = flp->nfsfl_ffm[mirror].group; + tcred->cr_gid = flp->nfsfl_ffm[mirror].group; tcred->cr_ngroups = 1; } else tcred = cred; diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 8ce75c6297e3..c3908c8e99c9 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -287,7 +287,7 @@ sys_getgid(struct thread *td, struct getgid_args *uap) td->td_retval[0] = td->td_ucred->cr_rgid; #if defined(COMPAT_43) - td->td_retval[1] = td->td_ucred->cr_groups[0]; + td->td_retval[1] = td->td_ucred->cr_gid; #endif return (0); } @@ -307,7 +307,7 @@ int sys_getegid(struct thread *td, struct getegid_args *uap) { - td->td_retval[0] = td->td_ucred->cr_groups[0]; + td->td_retval[0] = td->td_ucred->cr_gid; return (0); } @@ -1080,7 +1080,7 @@ sys_setgid(struct thread *td, struct setgid_args *uap) gid != oldcred->cr_svgid && /* allow setgid(saved gid) */ #endif #ifdef POSIX_APPENDIX_B_4_2_2 /* Use BSD-compat clause from B.4.2.2 */ - gid != oldcred->cr_groups[0] && /* allow setgid(getegid()) */ + gid != oldcred->cr_gid && /* allow setgid(getegid()) */ #endif (error = priv_check_cred(oldcred, PRIV_CRED_SETGID)) != 0) goto fail; @@ -1092,7 +1092,7 @@ sys_setgid(struct thread *td, struct setgid_args *uap) */ if ( #ifdef POSIX_APPENDIX_B_4_2_2 /* use the clause from B.4.2.2 */ - gid == oldcred->cr_groups[0] || + gid == oldcred->cr_gid || #endif /* We are using privs. */ priv_check_cred(oldcred, PRIV_CRED_SETGID) == 0) @@ -1121,7 +1121,7 @@ sys_setgid(struct thread *td, struct setgid_args *uap) * In all cases permitted cases, we are changing the egid. * Copy credentials so other references do not see our changes. */ - if (oldcred->cr_groups[0] != gid) { + if (oldcred->cr_gid != gid) { change_egid(newcred, gid); setsugid(p); } @@ -1167,7 +1167,7 @@ sys_setegid(struct thread *td, struct setegid_args *uap) (error = priv_check_cred(oldcred, PRIV_CRED_SETEGID)) != 0) goto fail; - if (oldcred->cr_groups[0] != egid) { + if (oldcred->cr_gid != egid) { change_egid(newcred, egid); setsugid(p); } @@ -1393,12 +1393,12 @@ sys_setregid(struct thread *td, struct setregid_args *uap) if (((rgid != (gid_t)-1 && rgid != oldcred->cr_rgid && rgid != oldcred->cr_svgid) || - (egid != (gid_t)-1 && egid != oldcred->cr_groups[0] && + (egid != (gid_t)-1 && egid != oldcred->cr_gid && egid != oldcred->cr_rgid && egid != oldcred->cr_svgid)) && (error = priv_check_cred(oldcred, PRIV_CRED_SETREGID)) != 0) goto fail; - if (egid != (gid_t)-1 && oldcred->cr_groups[0] != egid) { + if (egid != (gid_t)-1 && oldcred->cr_gid != egid) { change_egid(newcred, egid); setsugid(p); } @@ -1406,9 +1406,9 @@ sys_setregid(struct thread *td, struct setregid_args *uap) change_rgid(newcred, rgid); setsugid(p); } - if ((rgid != (gid_t)-1 || newcred->cr_groups[0] != newcred->cr_rgid) && - newcred->cr_svgid != newcred->cr_groups[0]) { - change_svgid(newcred, newcred->cr_groups[0]); + if ((rgid != (gid_t)-1 || newcred->cr_gid != newcred->cr_rgid) && + newcred->cr_svgid != newcred->cr_gid) { + change_svgid(newcred, newcred->cr_gid); setsugid(p); } proc_set_cred(p, newcred); @@ -1547,17 +1547,17 @@ sys_setresgid(struct thread *td, struct setresgid_args *uap) if (((rgid != (gid_t)-1 && rgid != oldcred->cr_rgid && rgid != oldcred->cr_svgid && - rgid != oldcred->cr_groups[0]) || + rgid != oldcred->cr_gid) || (egid != (gid_t)-1 && egid != oldcred->cr_rgid && egid != oldcred->cr_svgid && - egid != oldcred->cr_groups[0]) || + egid != oldcred->cr_gid) || (sgid != (gid_t)-1 && sgid != oldcred->cr_rgid && sgid != oldcred->cr_svgid && - sgid != oldcred->cr_groups[0])) && + sgid != oldcred->cr_gid)) && (error = priv_check_cred(oldcred, PRIV_CRED_SETRESGID)) != 0) goto fail; - if (egid != (gid_t)-1 && oldcred->cr_groups[0] != egid) { + if (egid != (gid_t)-1 && oldcred->cr_gid != egid) { change_egid(newcred, egid); setsugid(p); } @@ -1626,8 +1626,8 @@ sys_getresgid(struct thread *td, struct getresgid_args *uap) error1 = copyout(&cred->cr_rgid, uap->rgid, sizeof(cred->cr_rgid)); if (uap->egid) - error2 = copyout(&cred->cr_groups[0], - uap->egid, sizeof(cred->cr_groups[0])); + error2 = copyout(&cred->cr_gid, + uap->egid, sizeof(cred->cr_gid)); if (uap->sgid) error3 = copyout(&cred->cr_svgid, uap->sgid, sizeof(cred->cr_svgid)); @@ -1737,7 +1737,7 @@ groupmember(gid_t gid, const struct ucred *cred) groups_check_positive_len(cred->cr_ngroups); - if (gid == cred->cr_groups[0]) + if (gid == cred->cr_gid) return (true); return (group_is_supplementary(gid, cred)); @@ -3004,7 +3004,7 @@ void change_egid(struct ucred *newcred, gid_t egid) { - newcred->cr_groups[0] = egid; + newcred->cr_gid = egid; } /*- diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 99f9e129f4cd..9298d0202c5a 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2174,10 +2174,10 @@ kern_accessat(struct thread *td, int fd, const char *path, cred = td->td_ucred; if ((flag & AT_EACCESS) == 0 && ((cred->cr_uid != cred->cr_ruid || - cred->cr_rgid != cred->cr_groups[0]))) { + cred->cr_rgid != cred->cr_gid))) { usecred = crdup(cred); usecred->cr_uid = cred->cr_ruid; - usecred->cr_groups[0] = cred->cr_rgid; + usecred->cr_gid = cred->cr_rgid; td->td_ucred = usecred; } else usecred = cred; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index dbd5ef04ef00..38e4cf3a6801 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4185,7 +4185,7 @@ pf_socket_lookup(struct pf_pdesc *pd, struct mbuf *m) } INP_RLOCK_ASSERT(inp); pd->lookup.uid = inp->inp_cred->cr_uid; - pd->lookup.gid = inp->inp_cred->cr_groups[0]; + pd->lookup.gid = inp->inp_cred->cr_gid; INP_RUNLOCK(inp); return (1); @@ -4698,7 +4698,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, if (inp != NULL) { INP_LOCK_ASSERT(inp); pd->lookup.uid = inp->inp_cred->cr_uid; - pd->lookup.gid = inp->inp_cred->cr_groups[0]; + pd->lookup.gid = inp->inp_cred->cr_gid; pd->lookup.done = 1; } diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c index e56e807a8c57..c147f078f8a0 100644 --- a/sys/netsmb/smb_conn.c +++ b/sys/netsmb/smb_conn.c @@ -423,7 +423,7 @@ smb_vc_create(struct smb_vcspec *vcspec, if (uid == SMBM_ANY_OWNER) uid = realuid; if (gid == SMBM_ANY_GROUP) - gid = cred->cr_groups[0]; + gid = cred->cr_gid; vcp->vc_uid = uid; vcp->vc_grp = gid; @@ -766,7 +766,7 @@ smb_share_create(struct smb_vc *vcp, struct smb_sharespec *shspec, if (uid == SMBM_ANY_OWNER) uid = realuid; if (gid == SMBM_ANY_GROUP) - gid = cred->cr_groups[0]; + gid = cred->cr_gid; ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, M_WAITOK); smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss ilock", "smbss"); ssp->obj.co_free = smb_share_free; diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index 3c9ede7b9869..8c10de166f2f 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -97,7 +97,7 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) if (!xdr_uint32_t(xdrs, &cred->cr_uid)) return (FALSE); - if (!xdr_uint32_t(xdrs, &cred->cr_groups[0])) + if (!xdr_uint32_t(xdrs, &cred->cr_gid)) return (FALSE); if (xdrs->x_op == XDR_ENCODE) { @@ -109,7 +109,7 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) if (!xdr_uint32_t(xdrs, &ngroups)) return (FALSE); for (i = 0; i < ngroups; i++) { - if (i + 1 < ngroups_max + 1) { + if (i < ngroups_max) { if (!xdr_uint32_t(xdrs, &cred->cr_groups[i + 1])) return (FALSE); } else { @@ -119,7 +119,7 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) } if (xdrs->x_op == XDR_DECODE) { - if (ngroups + 1 > ngroups_max + 1) + if (ngroups > ngroups_max) cred->cr_ngroups = ngroups_max + 1; else cred->cr_ngroups = ngroups + 1; diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index efdf6dbc9068..cc8354d93281 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -87,7 +87,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) str_len = RNDUP(str_len); buf += str_len / sizeof (int32_t); xcr->cr_uid = IXDR_GET_UINT32(buf); - xcr->cr_groups[0] = IXDR_GET_UINT32(buf); + xcr->cr_gid = IXDR_GET_UINT32(buf); gid_len = (size_t)IXDR_GET_UINT32(buf); if (gid_len > NGRPS) { stat = AUTH_BADCRED; diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c index 21d950ede416..3fb38b083960 100644 --- a/sys/security/audit/audit.c +++ b/sys/security/audit/audit.c @@ -280,7 +280,7 @@ audit_record_ctor(void *mem, int size, void *arg, int flags) cru2x(cred, &ar->k_ar.ar_subj_cred); ar->k_ar.ar_subj_ruid = cred->cr_ruid; ar->k_ar.ar_subj_rgid = cred->cr_rgid; - ar->k_ar.ar_subj_egid = cred->cr_groups[0]; + ar->k_ar.ar_subj_egid = cred->cr_gid; ar->k_ar.ar_subj_auid = cred->cr_audit.ai_auid; ar->k_ar.ar_subj_asid = cred->cr_audit.ai_asid; ar->k_ar.ar_subj_pid = td->td_proc->p_pid; diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index db621db1574f..3ba21b14deaf 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -409,7 +409,7 @@ audit_arg_process(struct proc *p) cred = p->p_ucred; ar->k_ar.ar_arg_auid = cred->cr_audit.ai_auid; ar->k_ar.ar_arg_euid = cred->cr_uid; - ar->k_ar.ar_arg_egid = cred->cr_groups[0]; + ar->k_ar.ar_arg_egid = cred->cr_gid; ar->k_ar.ar_arg_ruid = cred->cr_ruid; ar->k_ar.ar_arg_rgid = cred->cr_rgid; ar->k_ar.ar_arg_asid = cred->cr_audit.ai_asid; diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 4dfd327f1494..3ba17d98f015 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2082,7 +2082,7 @@ ufs_mkdir( ucred.cr_uid = ip->i_uid; ucred.cr_ngroups = 1; ucred.cr_groups = &ucred_group; - ucred.cr_groups[0] = dp->i_gid; + ucred.cr_gid = ucred_group = dp->i_gid; ucp = &ucred; } #endif @@ -2837,7 +2837,7 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, ucred.cr_uid = ip->i_uid; ucred.cr_ngroups = 1; ucred.cr_groups = &ucred_group; - ucred.cr_groups[0] = pdir->i_gid; + ucred.cr_gid = ucred_group = pdir->i_gid; ucp = &ucred; #endif } else { From nobody Fri Dec 19 09:19:05 2025 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 4dXhmn4Krqz6LBBb for ; Fri, 19 Dec 2025 09:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmn1SWZz44Sl for ; Fri, 19 Dec 2025 09:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135945; 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=gUD2CuJRGhkW/LiyjUrP9b053l0/75UNfjbkllSCi/0=; b=XmyqEmzjrvGULRBE2Oo6oxPhNKLhp7yc4R7vMF3SGTmX+VZlkJkt4rM1+tLBgl6kzWvIu6 alMXBWl6kM0ZtgSax22XDNKyo0y7EiCeyDrHHcVaXH64bpTKuVhqtGCOGJdKCWx+u5+n/u Zu06MgRiSJsoO4ZFAAEM/GM1F7qGm4+ODRZEetKIoDzYLRT6YebNbUAmzFGZ4vCu3oCobz 7yCVRlZZNM2zTsuLIaq2WTAxpap43uYQEm2oYblZU0+ReK+H9mJXBQMHRJj76xsncLk/Mw xZCDRY7ZI1fgviwQ44VVMx9TW2c4wrtXysDG6AQyjTg4Ki3vSfLUDbscZI5eCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135945; 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=gUD2CuJRGhkW/LiyjUrP9b053l0/75UNfjbkllSCi/0=; b=Aut1wb/CuwSTmnCRuzX2OScvrMR5tyAanDOXxyG07DkZ4FR3tAKhBRHjLPgdAqwGhUNNi2 LklNh4RqSpV54AS/2n2HQeAlMiNTo9UBwAK3KVh83AKKRCF2g6YgxQppQyhPPiddLpBNVE kTSAw/lk/FkaUd1KrPmzo122ySoBIAVgdSK7qtwi6T4uN/hzvg4V3gWLmYs1nMEcfQbLru vXC5VmcWtkv/zsMKyZU00JE5d6hheNWyfItId9qSYeP+mcJmAromA2/lIRfCkdI2cdXKnN yaZ17Fevg6fK25fvd4BzxA9hjnLOEHIEEQgCpgqn9Q5QMf3u6SKHUUj/+e6wyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135945; a=rsa-sha256; cv=none; b=JOiTfqvlbwwMLMyZ0rPioA8EFSVKnBHLeL6SbvBxGHAMioXnLmsRBlVC2Us9P2sxDXvaNS YlLZBngaHK7itGBKYdeI6PfgXbfurbpdnNZXTQX4Aytlt4TnnxIpH4/mYyzKNXk67i6oRs nIpmz96NYQMnEQ4PvQAPQasYtOQ1+Ro9SM8+4/NXvAq/lOSo6zb0kBPdf+SztAP1ZwZ6mz QV38XNkjGCeJi84ffO8ZEZlFLLvRaT8NL3j9fhcrNa5xVtTEDboGtdZyBYzAcVL0b8eSmx KIG9eUoHYBZ32aaOI1vwbhkqR+OkJ20F6xhxPApr0tDjhjaEJp4yiwqxIn2Rxw== 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 4dXhmn118yz1GWv for ; Fri, 19 Dec 2025 09:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3de7c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ede3009e4569 - stable/14 - sys/rpc: UNIX auth: Rename 'ngroups' => 'supp_ngroups' for clarity 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ede3009e4569b79055643b8fd65b4165092e8517 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:05 +0000 Message-Id: <69451889.3de7c.7fa701f1@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ede3009e4569b79055643b8fd65b4165092e8517 commit ede3009e4569b79055643b8fd65b4165092e8517 Author: Olivier Certner AuthorDate: 2025-10-07 10:03:07 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:43 +0000 sys/rpc: UNIX auth: Rename 'ngroups' => 'supp_ngroups' for clarity MFC after: 2 days Sponsored by: The FreeBSD Foundation (cherry picked from commit bda3b61512b2597d4c77d2b9c9074b844dec0405) Two minor conflicts, due to missing comments added in commit be1f7435ef21 ("kern: start tracking cr_gid outside of cr_groups[]") which will not be MFCed, were solved by adding these comments. --- sys/rpc/authunix_prot.c | 21 +++++++++++++-------- sys/rpc/svc_auth_unix.c | 21 +++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index 8c10de166f2f..42822a5d01c6 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -64,7 +64,7 @@ bool_t xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) { uint32_t namelen; - uint32_t ngroups, i; + uint32_t supp_ngroups, i; uint32_t junk; char hostbuf[MAXHOSTNAMELEN]; @@ -101,14 +101,19 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) return (FALSE); if (xdrs->x_op == XDR_ENCODE) { - ngroups = cred->cr_ngroups - 1; - if (ngroups > NGRPS) - ngroups = NGRPS; + /* + * Note that this is a `struct xucred`, which maintains its + * historical layout of preserving the egid in cr_ngroups and + * cr_groups[0] == egid. + */ + supp_ngroups = cred->cr_ngroups - 1; + if (supp_ngroups > NGRPS) + supp_ngroups = NGRPS; } - if (!xdr_uint32_t(xdrs, &ngroups)) + if (!xdr_uint32_t(xdrs, &supp_ngroups)) return (FALSE); - for (i = 0; i < ngroups; i++) { + for (i = 0; i < supp_ngroups; i++) { if (i < ngroups_max) { if (!xdr_uint32_t(xdrs, &cred->cr_groups[i + 1])) return (FALSE); @@ -119,10 +124,10 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) } if (xdrs->x_op == XDR_DECODE) { - if (ngroups > ngroups_max) + if (supp_ngroups > ngroups_max) cred->cr_ngroups = ngroups_max + 1; else - cred->cr_ngroups = ngroups + 1; + cred->cr_ngroups = supp_ngroups + 1; } return (TRUE); diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index cc8354d93281..c821b7901ea6 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -69,7 +69,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) uint32_t time; struct xucred *xcr; u_int auth_len; - size_t str_len, gid_len; + size_t str_len, supp_ngroups; u_int i; xcr = rqst->rq_clntcred; @@ -88,29 +88,34 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) buf += str_len / sizeof (int32_t); xcr->cr_uid = IXDR_GET_UINT32(buf); xcr->cr_gid = IXDR_GET_UINT32(buf); - gid_len = (size_t)IXDR_GET_UINT32(buf); - if (gid_len > NGRPS) { + supp_ngroups = (size_t)IXDR_GET_UINT32(buf); + if (supp_ngroups > NGRPS) { stat = AUTH_BADCRED; goto done; } - for (i = 0; i < gid_len; i++) { + for (i = 0; i < supp_ngroups; i++) { + /* + * Note that this is a `struct xucred`, which maintains + * its historical layout of preserving the egid in + * cr_ngroups and cr_groups[0] == egid. + */ if (i + 1 < XU_NGROUPS) xcr->cr_groups[i + 1] = IXDR_GET_INT32(buf); else buf++; } - if (gid_len + 1 > XU_NGROUPS) + if (supp_ngroups + 1 > XU_NGROUPS) xcr->cr_ngroups = XU_NGROUPS; else - xcr->cr_ngroups = gid_len + 1; + xcr->cr_ngroups = supp_ngroups + 1; /* * five is the smallest unix credentials structure - * timestamp, hostname len (0), uid, gid, and gids len (0). */ - if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) { + if ((5 + supp_ngroups) * BYTES_PER_XDR_UNIT + str_len > auth_len) { (void) printf("bad auth_len gid %ld str %ld auth %u\n", - (long)gid_len, (long)str_len, auth_len); + (long)supp_ngroups, (long)str_len, auth_len); stat = AUTH_BADCRED; goto done; } From nobody Fri Dec 19 09:19:06 2025 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 4dXhmq3thWz6L9tr for ; Fri, 19 Dec 2025 09:19:07 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmp4bQzz44WF for ; Fri, 19 Dec 2025 09:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135946; 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=ZzHiS1p9n7MKsLarHNOl+ulqDLVhJwjbqVuPFkz+JMA=; b=bRH29ljH8Eu5Ocwt8OIwk5A8GONXpEoW9Z+SSXLKDHpDa0MzGiArfKbAuw5dyO/AHy4onS 4PaLf2cjiQT139+wzx5tSiYQfKXzNN4w2fWmLSAH567Pn7iPDORY9E8ZhDWD/HELh0BuI9 ZVFSaq+KNf+d19bPtJCfjzVoK4+ARUEHEuSRE4fXXFjDfUvMZA+jS4/lRtR05B1GTXFjkt CxqmAJpF0Sx6GC4WgET2T80yiYxtpIsaYvIdy3HvpqRyNHbL9Sj8zM/DGxu46YgiBxTY8i vzUHfmx3OTSKSKT+/VYhIwD5SPjJ6fyiooR0xnmkG3VIf758LdTFaH+wci5wJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135946; 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=ZzHiS1p9n7MKsLarHNOl+ulqDLVhJwjbqVuPFkz+JMA=; b=Ezax/kEaV8AS2zRPTNThxM9wYyg8PRCuLiYbmIYiDbtWqLWJchTXpqRcr9ZrMGrsP4jX+m rG4xZR1FMy16echfIcXj82hJoNHaAu4Df6RFOa8tuaK4EnlLCKISMEoAHxa0sZsbTm5gaE o5BtRn59gNCmO/3ces6eAfsILltr7nUCtFxczbB5Mb5Dpclmx8rP5p4V5h6+9e8FiyrBav 7lsNss0WHzT6JFe3w+qNsSQhRBjgugJo7CNXbJAvtibYipWQtEBQHT87e7W6oofnHotqbe Y1TW4vBeHeZjT3Yg9nhXbKtSCuWKDgxF9k1AGvcODKXuFoRkT1bVD1FddXT0dg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135946; a=rsa-sha256; cv=none; b=bWk82AcUuiLoIbQrm/jBkL5E7bsGDiEtHVIKyIwkCHS5NgBaMIRc3AfgGvL5BCzCmaSikf o3xaLoSlvGrHMbZRpuDkYI7F37aoER24FpRUzqY5e7FMreZgyH0DPArhStps4RKIo5TPVy Nyuy8gmur70kozoN9P3y1rhNCyorTfl3z6/F78cwiFmxnvG+oR/wvlnLsj28dLAS+88R5u h/RF9b8I2HbjKG6zj3Ip7aE213IPXr87QLnANI62J8NuEcWTBSxlnTEaRNiCL3/QZlS8wi tUD9s/N7mA6iMqOwNWMYzMShi8sQyqOKTctkTGazjiB7mufbflJXWpgZtB4bXw== 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 4dXhmp1qXSz1GWw for ; Fri, 19 Dec 2025 09:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dd50 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0574fca39fb3 - stable/14 - sys/rpc: UNIX auth: Fix OOB accesses, notably writes on decode 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0574fca39fb3fa8fef062b74e82f359b99f1bee0 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:06 +0000 Message-Id: <6945188a.3dd50.6b3a964a@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0574fca39fb3fa8fef062b74e82f359b99f1bee0 commit 0574fca39fb3fa8fef062b74e82f359b99f1bee0 Author: Olivier Certner AuthorDate: 2025-10-07 10:02:23 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:44 +0000 sys/rpc: UNIX auth: Fix OOB accesses, notably writes on decode When the received authentication message had more than XU_NGROUPS, we would write group IDs beyond the end of cr_groups[] in the 'struct xucred' being filled (as 'ngroups_max' is always greater than XU_NGROUPS). For robustness, prevent various OOB accesses that would result from a change of value of XU_NGROUPS or a 'struct xucred' with an invalid 'cr_ngroups' field, even if these cases are unlikely. Reviewed by: rmacklem Fixes: dfdcada31e79 ("Add the new kernel-mode NFS Lock Manager.") MFC after: 2 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52960 (cherry picked from commit 47e9c81d4f1324674c624df02a51ad3a72aa7444) --- sys/rpc/authunix_prot.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index 42822a5d01c6..f2749e68e763 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -79,7 +79,6 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) } else { namelen = 0; } - junk = 0; if (!xdr_uint32_t(xdrs, time) || !xdr_uint32_t(xdrs, &namelen)) @@ -97,15 +96,25 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) if (!xdr_uint32_t(xdrs, &cred->cr_uid)) return (FALSE); + + /* + * Safety check: The protocol needs at least one group (access to + * 'cr_gid', decrementation of 'cr_ngroups' below). + */ + if (xdrs->x_op == XDR_ENCODE && cred->cr_ngroups == 0) + return (FALSE); if (!xdr_uint32_t(xdrs, &cred->cr_gid)) return (FALSE); if (xdrs->x_op == XDR_ENCODE) { /* - * Note that this is a `struct xucred`, which maintains its - * historical layout of preserving the egid in cr_ngroups and - * cr_groups[0] == egid. + * Note that this is a 'struct xucred', which still has the + * historical layout where the effective GID is in cr_groups[0] + * and is accounted in 'cr_ngroups'. We substract 1 to obtain + * the number of "supplementary" groups, passed in the AUTH_SYS + * credentials variable-length array called gids[] in RFC 5531. */ + MPASS(cred->cr_ngroups <= XU_NGROUPS); supp_ngroups = cred->cr_ngroups - 1; if (supp_ngroups > NGRPS) supp_ngroups = NGRPS; @@ -113,22 +122,15 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) if (!xdr_uint32_t(xdrs, &supp_ngroups)) return (FALSE); - for (i = 0; i < supp_ngroups; i++) { - if (i < ngroups_max) { - if (!xdr_uint32_t(xdrs, &cred->cr_groups[i + 1])) - return (FALSE); - } else { - if (!xdr_uint32_t(xdrs, &junk)) - return (FALSE); - } - } - if (xdrs->x_op == XDR_DECODE) { - if (supp_ngroups > ngroups_max) - cred->cr_ngroups = ngroups_max + 1; - else - cred->cr_ngroups = supp_ngroups + 1; - } + junk = 0; + for (i = 0; i < supp_ngroups; ++i) + if (!xdr_uint32_t(xdrs, i < XU_NGROUPS - 1 ? + &cred->cr_groups[i + 1] : &junk)) + return (FALSE); + + if (xdrs->x_op != XDR_ENCODE) + cred->cr_ngroups = MIN(supp_ngroups + 1, XU_NGROUPS); return (TRUE); } From nobody Fri Dec 19 09:19:07 2025 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 4dXhmr1SWqz6LBBm for ; Fri, 19 Dec 2025 09:19:08 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmq3n5yz44T4 for ; Fri, 19 Dec 2025 09:19:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135947; 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=to5XXe+hCky/SsiA1vmsLSndgQ6jx3PisG6IBJuFnJg=; b=kdETc2P7nuhhF+WhrlgneXDvMh7A3Gm3iYkZf0rzyhILoKFr4ZfoUHnGE7BjIojTPUnS1G WXr0b1yywBuKc+Rqi6kljF3Xhzj6yS6peZppwMqXbL7h+fhGstmiUwsNsj4Pfy2bxiCa2T 2uvY5GUjz3yWe+JlbVMeQ1sPb9JdFbGaDP24ovXbUYLXRekPCdsgvWCahvbGNuejol+oCp KJNEz33EIkfEQtSKjCtsPOhvR4hlbSIg6CjvmFcEWfqKK3Tz9sjqxzbYuRaZaZV3FPSfI6 xfiq5xFTamdehCtvHnaG7ydn5uaMsbIC9+/xFEdy3FEE4Nss0bvURuyNmyya/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135947; 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=to5XXe+hCky/SsiA1vmsLSndgQ6jx3PisG6IBJuFnJg=; b=ElTqARnGi0x7OgmY0nrIE3wDMJG/5Q6y7ovLFPLsHrBO6NtuIggfcZf52aBpVENv7yS8zV h7mfI/DkOUv8wM1XosXiBxUJx7Dfhg5gCFC0GqPP/A7qKSFGI3Lixb/mvITP5WNhfKm4+m +/9lgwCOuYYqqx66+i1cZNEZCu/lL0/hS64roL8tQ/85HIh9Pj4sv3d5u6Hl0y3Mzuq73V hPU9ABjEsEPli0WRMFfNg8QXDiTwqBZOyE/rnhOAR5Y1eP8+jlfZMHUApAnjinZmaH3PBI IrPNKY2C+HghvWE2W0/oVuNTfimWrxLQdyHMIWI3WBAbDUM+lCr7w5kXWvhB6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135947; a=rsa-sha256; cv=none; b=eDRRNjZD0ja1xtv1oM4x+8d01YN09a8AP9ITxlmcZuzcFXDC+dIcEvL+vVSj2ep3mIbvxv rl4KBZBiw8LfxfNV4c1aVCSaSMx9zwLHBLoS4HpX5E3CCPVssViGXH9itLpkf++FaW93qN NLi2p8aXqJQixIWsHgBf1RNlvlC/9Dzxw/5qC32hmlGnIo2V1GAC5toeHPUn4JpGZ5kNto GkiH0PpUFB92iBqH9+oyC4mYaDmtxwAW0MeDO4m3JFp31sg5b0MgxMZV5b07x7Ga4T/7wE ljCuiD1s+rG0Gi4wrFxEjT2z7quYn6OTeU1+Aup8wm0OnLh70JLVkaDFKNsPVg== 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 4dXhmq2bTDz1H2Q for ; Fri, 19 Dec 2025 09:19:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3eaa2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f15270ef49f9 - stable/14 - sys/rpc: Define AUTH_SYS_MAX_{GROUPS,HOSTNAME} 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f15270ef49f93cb949c2d8bcc65caf44f2d36295 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:07 +0000 Message-Id: <6945188b.3eaa2.5a8cc480@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f15270ef49f93cb949c2d8bcc65caf44f2d36295 commit f15270ef49f93cb949c2d8bcc65caf44f2d36295 Author: Olivier Certner AuthorDate: 2025-10-07 07:51:23 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:44 +0000 sys/rpc: Define AUTH_SYS_MAX_{GROUPS,HOSTNAME} As, respectively, the maximum number of "supplementary" groups and the maximum hostname size allowed in the credentials structure for AUTH_SYS (aka, AUTH_UNIX). Will be used in subsequent commits. Reviewed by: rmacklem MFC after: 2 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52961 (cherry picked from commit f7c4f800cc0b4fac1c99cda8e22d46b67592f9fa) --- sys/rpc/auth.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/rpc/auth.h b/sys/rpc/auth.h index e431be847628..6a2ae64e2b89 100644 --- a/sys/rpc/auth.h +++ b/sys/rpc/auth.h @@ -358,6 +358,10 @@ __END_DECLS #define RPCSEC_GSS 6 /* RPCSEC_GSS */ #define AUTH_TLS 7 /* Initiate RPC-over-TLS */ +/* RFC 5531's prescribed limits for variable-lenth arrays. */ +#define AUTH_SYS_MAX_HOSTNAME 255 +#define AUTH_SYS_MAX_GROUPS 16 /* Supplementary groups. */ + /* * Pseudo auth flavors for RPCSEC_GSS. */ From nobody Fri Dec 19 09:19:08 2025 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 4dXhmr6y3hz6LBFf for ; Fri, 19 Dec 2025 09:19:08 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmr3tfFz44TJ for ; Fri, 19 Dec 2025 09:19:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135948; 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=q+Y8Xlv/IR6PbUy898BdY/9NElgXTQMLVnPaT42yvrU=; b=bEE+J9Rxf5qGpq0QUqgEXzYimpjWG3qmqGKbzwCrfhvpNEfPpDfv+30ni5z8MSVCqwmzrD tXFZh6VMzDaq6hk98JBwDg3+irgWcJos2LmjGfETcQ+vNquQDyEqbiBzEnTXEkcUi3tDvR yGjwSaeo1jaZ2e1OoL0U1TIS3AJ+accJbIoXO8xAp6ZrDRSoZVR2ny2femctCdO4kjN/FM gMouLQDvtk4BW8CV0I5Zgje6mtWzxID1VLHvbfp+2SIIDk2NT7rYhKf2BRzLShpgrbXRCD IOlW1Ga8Qv6RVtp3Dd2Scpf/L5RFvQJVKHZYEyBXsoJfg3Lu/Aevg+rWNB5rrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135948; 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=q+Y8Xlv/IR6PbUy898BdY/9NElgXTQMLVnPaT42yvrU=; b=FcpHmRz7G4Pj5FjRbDhCIiYFyW3XD/b6k+Ea9iO0ild5+3iEONdLrOeQG4WKOlArDbUl86 kL16qE7ovciKOWYN4fbgY47ZAhwBo7QhDcp7VtspOCYfFPKWElsU0XElt6BzywGPlOJaHq 8AeoA9Qq4m4qw4siUvFcVEZnh3n8CFtDSFY8t+3NcG4YQPHBQEG2NeMzLmLpUyJJDdMqil ZBuecxa79EgqrTB5WojXwKS5eIEFXgxbKP2ItWfVNmIC6HRlAaJhFRvHp0IbmDn7PTiFrG 1ctdHNEZG9mGJ0NkqAdCvATLSbc002yuhMUUcyYxasjyhZQN53a0MJN/Yay0AQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135948; a=rsa-sha256; cv=none; b=TX6wvk1JqWflDL72yRguC6mlS7NVGD720l9cIJ895ztI5rOziXeRHxkzCLCA9rxF2HfWel 7TtYGCQ21NG4JOkOCOB5ygKscVPAsE9kiGb/tWjW5rtI13C8k/k28nZgJPmKBJ6Jnv8yB2 80f59cXLEh5zwUGrBzYpcbsXSxwOODGSwu12eB26SgOwSxssaRxPZ8wuutb1q3TiSRTz68 IbjwdrUfWkpk6JygdEpB2PNhq1Wrd8qERN9GcQfeTY8jSEh8rHmCo9H9rf5iwwBz6OkaPQ dRFdFmwkbI7K5Bnf4ciVPBb5t9RStR3FapbWScjd1queCCLRoSlbcJ2gCmrbew== 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 4dXhmr3Qd3z1GNN for ; Fri, 19 Dec 2025 09:19:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cdd8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: dab039c0e980 - stable/14 - sys/rpc: UNIX auth: Use AUTH_SYS_MAX_{GROUPS,HOSTNAME} as limits (1/2) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dab039c0e9803f1b0cd30cf0719e8d70822fb88d Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:08 +0000 Message-Id: <6945188c.3cdd8.4b1fc87e@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=dab039c0e9803f1b0cd30cf0719e8d70822fb88d commit dab039c0e9803f1b0cd30cf0719e8d70822fb88d Author: Olivier Certner AuthorDate: 2025-10-07 08:46:56 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:44 +0000 sys/rpc: UNIX auth: Use AUTH_SYS_MAX_{GROUPS,HOSTNAME} as limits (1/2) Consistently with the XDR_INLINE() variant of xdr_authunix_parms() (_svcauth_unix() in 'svc_auth_unix.c'), reject messages with credentials having a machine name length in excess of AUTH_SYS_MAX_HOSTNAME or more than AUTH_SYS_MAX_GROUPS supplementary groups, which do not conform to RFC 5531. This is done mainly because we cannot store excess groups anyway, even if at odds with the robustness principle ("be liberal in what you accept"). While here, make sure the current code is immune to AUTH_SYS_MAX_GROUPS changing value (in future RFCs?) even if that seems improbable. Reviewed by: rmacklem Fixes: dfdcada31e79 ("Add the new kernel-mode NFS Lock Manager.") MFC after: 2 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52962 (cherry picked from commit b119ef0f6a81eb32b0e1cd0075cec499543e7ddd) --- sys/rpc/authunix_prot.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index f2749e68e763..5189a279da8b 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -54,9 +54,6 @@ static char *sccsid = "@(#)authunix_prot.c 2.1 88/07/29 4.0 RPCSRC"; #include -/* gids compose part of a credential; there may not be more than 16 of them */ -#define NGRPS 16 - /* * XDR for unix authentication parameters. */ @@ -69,13 +66,10 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) char hostbuf[MAXHOSTNAMELEN]; if (xdrs->x_op == XDR_ENCODE) { - /* - * Restrict name length to 255 according to RFC 1057. - */ getcredhostname(NULL, hostbuf, sizeof(hostbuf)); namelen = strlen(hostbuf); - if (namelen > 255) - namelen = 255; + if (namelen > AUTH_SYS_MAX_HOSTNAME) + namelen = AUTH_SYS_MAX_HOSTNAME; } else { namelen = 0; } @@ -91,6 +85,8 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) if (!xdr_opaque(xdrs, hostbuf, namelen)) return (FALSE); } else { + if (namelen > AUTH_SYS_MAX_HOSTNAME) + return (FALSE); xdr_setpos(xdrs, xdr_getpos(xdrs) + RNDUP(namelen)); } @@ -116,13 +112,30 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) */ MPASS(cred->cr_ngroups <= XU_NGROUPS); supp_ngroups = cred->cr_ngroups - 1; - if (supp_ngroups > NGRPS) - supp_ngroups = NGRPS; + if (supp_ngroups > AUTH_SYS_MAX_GROUPS) + /* With current values, this should never execute. */ + supp_ngroups = AUTH_SYS_MAX_GROUPS; } if (!xdr_uint32_t(xdrs, &supp_ngroups)) return (FALSE); + /* + * Because we cannot store more than XU_NGROUPS in total (16 at time of + * this writing), for now we choose to be strict with respect to RFC + * 5531's maximum number of supplementary groups (AUTH_SYS_MAX_GROUPS). + * That would also be an accidental DoS prevention measure if the + * request handling code didn't try to reassemble it in full without any + * size limits. Although AUTH_SYS_MAX_GROUPS and XU_NGROUPS are equal, + * since the latter includes the "effective" GID, we cannot store the + * last group of a message with exactly AUTH_SYS_MAX_GROUPS + * supplementary groups. We accept such messages so as not to violate + * the protocol, silently dropping the last group on the floor. + */ + + if (xdrs->x_op != XDR_ENCODE && supp_ngroups > AUTH_SYS_MAX_GROUPS) + return (FALSE); + junk = 0; for (i = 0; i < supp_ngroups; ++i) if (!xdr_uint32_t(xdrs, i < XU_NGROUPS - 1 ? From nobody Fri Dec 19 09:19:09 2025 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 4dXhms6yCyz6LB6y for ; Fri, 19 Dec 2025 09:19:09 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhms4hZcz44j8 for ; Fri, 19 Dec 2025 09:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135949; 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=VQbsGm+O6byVLEpg9AA5Dp5t+Vfj97cejV80LGMbWig=; b=aOgR7UpuZI780JHGh/zkHLTh/8c8QgrLGhC8vuTFVk5J7NDWfyBLgHhl+diQpYPDZd5FkI rkJXefP8NLyjpqcUWK5MjQfyly7D8fi/QBfPBJpLM+LXcA1Qg8UrHz1oTj++XCrPOiERmu 6iXmFm6yqX0sEslPCVCrFUWK3yFmIMCWYYakroVv760f76OU8YxHPizwiNL1wHjlfGRkRo 7DftvchEisIiW4TdD0WKLYO7vBou1g6p6dmzJs6k0C+3l0f4sG0Py+bsZBFTrnjn48KbCQ 0rEZ2SybtEccfVJ13e2GIBN4oevfobi4EaeCGEmy6gmMYDKXKCbofsCKfJ07GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135949; 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=VQbsGm+O6byVLEpg9AA5Dp5t+Vfj97cejV80LGMbWig=; b=LM1TwYeVjBOpg9wNdVd2NxzzE6zeWsuIJKsuHOahsiq6FmqB1EhifVN3fFvBnnb1j007X5 W/EsRdJdHZd6godGf0a2KC3Zcw1rIvYOBKK+BZ7DXXkEFS8x5ewwRQmdFjgPFpGz1vzRCY +HoYQ3y3n7pfwtYw9+jz4gEXVwapS6VceAq288Krof3BKmMKjOaYVHHYPPQ8vb1X7ANnZy 33xHjFWILdePxBWiLO7Csi5nWRu+JvzuuFJqsJN//QqugWuyQDayxQR/jZMwsL6D7aIUIl WGxTkIi3Sibsf2izRgeuIymOwPlgGTdqMp03sQvFbImxUtyR5YV8x0ya4wmGUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135949; a=rsa-sha256; cv=none; b=J5pJrhIy1ubvL/RXEUEq+muWWxqpx1HSo/LzCJ40L6WalfFW6FQ6LavCAnTGf4KZ8LEPwC zN30Q/EomOg1mxrYg4/t3uTAlgS4c+SSOn9Mgl034OjczAfsY8MXx5+hGYPW/aZc48DeZx Nziql7twmvAXQEy8lY+LkhBUGjrfFtPS288BbFosQjlX8WjnKub6rMW8aTGkGmp3yjxu6g UxwR9BzNCfWzFd2EzVVYRM+3AMgvX8i4HlgTmwA3J2e9iS+THaBwwWippVmd49eNOCHRSg ufYtrgfqK1XB4f5tmU2aOyAppzLVJE8sN7BvovAPOlUkLfsrfjasJfQI0PDsPQ== 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 4dXhms4FHyz1GkZ for ; Fri, 19 Dec 2025 09:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c07c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2e3e62e4de9e - stable/14 - sys/rpc: UNIX auth: Use AUTH_SYS_MAX_{GROUPS,HOSTNAME} as limits (2/2) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e3e62e4de9efa6f2d55538aa6e7c36cfe849476 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:09 +0000 Message-Id: <6945188d.3c07c.2db131a5@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2e3e62e4de9efa6f2d55538aa6e7c36cfe849476 commit 2e3e62e4de9efa6f2d55538aa6e7c36cfe849476 Author: Olivier Certner AuthorDate: 2025-10-07 13:33:53 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:45 +0000 sys/rpc: UNIX auth: Use AUTH_SYS_MAX_{GROUPS,HOSTNAME} as limits (2/2) Remove local defines from 'svc_auth_unix.c' and use the new limit macros instead. Reviewed by: rmacklem MFC after: 2 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52963 (cherry picked from commit e665c0f6f7a611d25d9d7e7f64d98c84b3a92820) --- sys/rpc/svc_auth_unix.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index c821b7901ea6..97fd08de7f2b 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -54,9 +54,6 @@ static char *sccsid = "@(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC"; #include -#define MAX_MACHINE_NAME 255 -#define NGRPS 16 - /* * Unix longhand authenticator */ @@ -80,7 +77,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) if (buf != NULL) { time = IXDR_GET_UINT32(buf); str_len = (size_t)IXDR_GET_UINT32(buf); - if (str_len > MAX_MACHINE_NAME) { + if (str_len > AUTH_SYS_MAX_HOSTNAME) { stat = AUTH_BADCRED; goto done; } @@ -89,7 +86,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) xcr->cr_uid = IXDR_GET_UINT32(buf); xcr->cr_gid = IXDR_GET_UINT32(buf); supp_ngroups = (size_t)IXDR_GET_UINT32(buf); - if (supp_ngroups > NGRPS) { + if (supp_ngroups > AUTH_SYS_MAX_GROUPS) { stat = AUTH_BADCRED; goto done; } From nobody Fri Dec 19 09:19:10 2025 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 4dXhmv100Tz6L9v5 for ; Fri, 19 Dec 2025 09:19:11 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmt5P8Fz44Tp for ; Fri, 19 Dec 2025 09:19:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135950; 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=5ILIAAQRMeCZGWY0G013wa+jb6y3b8tuts2klLJZMgs=; b=pPNs8EBGOW5HCfUWInQy1Hi+eNp7c0/YsSktVUd9I48cjwF2F+Rf+tLJuLkx0OU0xpfK6p GkyZRl/ddTaZZ7sSeO34uile/XzcpdT9UpJgHj4xu/+SQf340hyTe5e9Y/cFEi3jZaFIQi wyD/TiyrccUHVDBxjnI9RDagQxmA/Qo67t2uuvFRnKnkph24apc5Uiu2f24MAycVCzJkMb 1R8VoyvuB9wvxlr4r/EakZMuES3YW1dYxJWgJvQDrdVDUGdGpNGTvaiSXrOFkZeNuZx4bD zZQcoiwNTFtXnOrvT6WhsCN92erVvI9Jn+FFiyXpc21DY0riXi+MX5sni97ygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135950; 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=5ILIAAQRMeCZGWY0G013wa+jb6y3b8tuts2klLJZMgs=; b=oNfBss6O5jTf97F5VlM7XyURQi6aNJRsSQSTj4jWA0zGvWfWWytoSnZx3+FFbgWnj21sdj b6K0gOPDtrHVfCTTYnVbXiJoRrsKn0wX6e12oTpsH3R39Ka8zwzceXYcbIxdmy/RIdUNj4 JvhtJgit6LecUAsq/gbwYSHsMkwycZEE1XSmv1WGsI1qHbEr+YFc1kQdeA9OKRLDqtuRoq G5s9kIkd8IXdrmzltm8X8B1ofTk04JXcOV7hJvQ+qjqalOOmKiMXunEGlJjcn2lqRB5Rh/ Os/1W9JzoHhJ0JwJNj+kmpiCxEhDNz4kD+MH06mNKyuPpk6k/HnFCi+YHEceMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135950; a=rsa-sha256; cv=none; b=xccIOxlWGrPQJYVlR/498d0RyAk4DWfQoyie1x1ong0tFgLkvSXJ/vuoozT74HcKyA3ihz O81LDzpwJyfek41ObbXCzT5RZ7NQ07UhAZhrssDtP250kXDzXZkMaG8+o6lW1bBXQTKN1K i1JxaqpZP0edVXcUtjCuegW12zuOEmpGJzDNPFB2N9PxW2LpgylI4tuPwuJfQU/r7ZhmGS 2ZnWfg2uDAN0PWGcgPc/FxPrmAXmKe3lgDQAChWuFT55vNgM3YKFYYo2hQ0C+WmfeGosFJ uQyNoQcVo6cW7N+KxV8hYA7zzDsFGEI8j3074JPK6yTg9S5wYrmIN1TYcEGJPQ== 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 4dXhmt4b8lz1GKs for ; Fri, 19 Dec 2025 09:19:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f0f8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 8807380a7400 - stable/14 - sys/rpc: UNIX auth: Fix OOB reads on too short message 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8807380a7400d0ea1ef788c81e70b3a363f632a9 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:10 +0000 Message-Id: <6945188e.3f0f8.fa9a98a@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8807380a7400d0ea1ef788c81e70b3a363f632a9 commit 8807380a7400d0ea1ef788c81e70b3a363f632a9 Author: Olivier Certner AuthorDate: 2025-10-07 15:51:16 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:45 +0000 sys/rpc: UNIX auth: Fix OOB reads on too short message In the inline version (_svcauth_unix()), fix multiple possible OOB reads when the credentials part of a request is too short to contain mandatory fields or with respect to the hostname length or number of groups it advertises. The previously existing check was arriving too late and relied on possibly wrong data coming from earlier OOB reads. While here, use 'uint32_t' as the length/size type, as it is more than enough and removes the need for conversions, explicit or implicit. While here, factor out setting 'stat' to AUTH_BADCRED and then jumping to 'done' on error, through the new 'badcred' label. While here, through comments, refer to what the non-inline version is doing (xdr_authunix_parms() in 'authunix_prot.c') and the reasons. Reviewed by: rmacklem Fixes: dfdcada31e79 ("Add the new kernel-mode NFS Lock Manager.") MFC after: 2 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52964 (cherry picked from commit d4cc791f3b2e1b6926420649a481eacaf3bf268e) --- sys/rpc/svc_auth_unix.c | 99 ++++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 39 deletions(-) diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index 97fd08de7f2b..7222fd6d95c0 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -63,11 +63,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) enum auth_stat stat; XDR xdrs; int32_t *buf; - uint32_t time; struct xucred *xcr; - u_int auth_len; - size_t str_len, supp_ngroups; - u_int i; + uint32_t auth_len, time; xcr = rqst->rq_clntcred; auth_len = (u_int)msg->rm_call.cb_cred.oa_length; @@ -75,51 +72,71 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) XDR_DECODE); buf = XDR_INLINE(&xdrs, auth_len); if (buf != NULL) { - time = IXDR_GET_UINT32(buf); - str_len = (size_t)IXDR_GET_UINT32(buf); - if (str_len > AUTH_SYS_MAX_HOSTNAME) { - stat = AUTH_BADCRED; - goto done; + /* 'time', 'str_len', UID, GID and 'supp_ngroups'. */ + const uint32_t min_len = 5 * BYTES_PER_XDR_UNIT; + uint32_t str_len, supp_ngroups; + + if (auth_len < min_len) { + (void)printf("AUTH_SYS: Too short credentials (%u)\n", + auth_len); + goto badcred; } + time = IXDR_GET_UINT32(buf); + str_len = IXDR_GET_UINT32(buf); + if (str_len > AUTH_SYS_MAX_HOSTNAME) + goto badcred; str_len = RNDUP(str_len); + /* + * Recheck message length now that we know the value of + * 'str_len' (and that it won't cause an overflow in additions + * below) to protect access to the credentials part. + */ + if (auth_len < min_len + str_len) { + (void)printf("AUTH_SYS: Inconsistent credentials and " + "host name lengths (%u, %u)\n", + auth_len, str_len); + goto badcred; + } buf += str_len / sizeof (int32_t); xcr->cr_uid = IXDR_GET_UINT32(buf); xcr->cr_gid = IXDR_GET_UINT32(buf); - supp_ngroups = (size_t)IXDR_GET_UINT32(buf); - if (supp_ngroups > AUTH_SYS_MAX_GROUPS) { - stat = AUTH_BADCRED; - goto done; - } - for (i = 0; i < supp_ngroups; i++) { - /* - * Note that this is a `struct xucred`, which maintains - * its historical layout of preserving the egid in - * cr_ngroups and cr_groups[0] == egid. - */ - if (i + 1 < XU_NGROUPS) - xcr->cr_groups[i + 1] = IXDR_GET_INT32(buf); - else - buf++; + supp_ngroups = IXDR_GET_UINT32(buf); + /* + * See the herald comment before a similar test at the end of + * xdr_authunix_parms() for why we strictly respect RFC 5531 and + * why we may have to drop the last supplementary group when + * there are AUTH_SYS_MAX_GROUPS of them. + */ + if (supp_ngroups > AUTH_SYS_MAX_GROUPS) + goto badcred; + /* + * Final message length check, as we now know how much we will + * read in total. + */ + if (auth_len < min_len + str_len + + supp_ngroups * BYTES_PER_XDR_UNIT) { + (void)printf("AUTH_SYS: Inconsistent lengths " + "(credentials %u, machine name %u, " + "supplementary groups %u)\n", + auth_len, str_len, + supp_ngroups * BYTES_PER_XDR_UNIT); + goto badcred; } - if (supp_ngroups + 1 > XU_NGROUPS) - xcr->cr_ngroups = XU_NGROUPS; - else - xcr->cr_ngroups = supp_ngroups + 1; /* - * five is the smallest unix credentials structure - - * timestamp, hostname len (0), uid, gid, and gids len (0). + * Note that 'xcr' is a 'struct xucred', which still has the + * historical layout where the effective GID is in cr_groups[0] + * and is accounted in 'cr_ngroups'. */ - if ((5 + supp_ngroups) * BYTES_PER_XDR_UNIT + str_len > auth_len) { - (void) printf("bad auth_len gid %ld str %ld auth %u\n", - (long)supp_ngroups, (long)str_len, auth_len); - stat = AUTH_BADCRED; - goto done; + for (uint32_t i = 0; i < supp_ngroups; ++i) { + if (i < XU_NGROUPS - 1) + xcr->cr_groups[i + 1] = IXDR_GET_INT32(buf); + else + buf++; } - } else if (! xdr_authunix_parms(&xdrs, &time, xcr)) { - stat = AUTH_BADCRED; - goto done; - } + xcr->cr_ngroups = MIN(supp_ngroups + 1, XU_NGROUPS); + } else if (! xdr_authunix_parms(&xdrs, &time, xcr)) + goto badcred; rqst->rq_verf = _null_auth; stat = AUTH_OK; @@ -127,6 +144,10 @@ done: XDR_DESTROY(&xdrs); return (stat); + +badcred: + stat = AUTH_BADCRED; + goto done; } From nobody Fri Dec 19 09:19:11 2025 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 4dXhmw3Hnjz6LBJ6 for ; Fri, 19 Dec 2025 09:19:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmv5VJXz44V0 for ; Fri, 19 Dec 2025 09:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135951; 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=g7JqQyQmZmXEDYDaDfLBQAMGu2X8Yl/3OVb/k/ibHYI=; b=UeFyNGE4JMqTlldh6C1LeCwf3Gw3jMHpavNcxSg7WqrIM8sm5NQEsKtSkd9obuup0UmGEm 4V2yz7Qm2TDYT1wiPPMXkZ7/mAwIEXiAsvK6kezVfhSCjG67dWmw7ApqQs6MIJIk6f1mIV wohrl32PhAiA6EtRKS2lLgUkq5XE8jFcVprEH3Ul0qfaE40DplytVD31fK6EOHu2sXIcCB HClYwmFOZ3+IA3Yp2qVGHSvPJIpq8uliQ3cFuzxNps9Xx8YFsctM9TXRJqY7+48aKSF8zh cXxBSp00Z09//nmtq8Nm2Y2i1fZtrVXyhBLe7cd/nd9pOYoUkiRQEJY5J+l7qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135951; 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=g7JqQyQmZmXEDYDaDfLBQAMGu2X8Yl/3OVb/k/ibHYI=; b=jC8l4f2e/GBcmoieIpIQ+RmI9ccL6ksP884WdK7dXATI6ykdqB8JEzBwadJ0lOkqUaUJxA MIxgCsEjXZ/QTExlI8K4CwN5R/CGOAnJ/wrg+0/Y2aOc4t4hzYO7hScS1QH0YsUzxRgK4p f3JJwN6V1j52gUeG4W1ZIT5mUGK8IX81++v1f3UwgPb5rR/YxIiDDl1J48dLwGjLClg6lf PD5BSuudw1ua3cqvb1aHVapmwIaO2xAI0I5CDMWohWbmGEdOWpXRhTTXU70JISDblu7Kz1 bRF9P5g5qRBFR7X+SL246nETWnpr1ZvDSvfMAvU6cPQMlEn3tccEv7Uh3pMPrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135951; a=rsa-sha256; cv=none; b=s6Ann0syc4BEMxpbWdiOuRPUXy1IYeeVfUMJA1aa9PMq73PrBOxudBYCF7+xpSY/GQAuVE /oZPV2JriBF5ToGyRd7qCqPBAv2PU+8VhK2MfJeFmzZ+UbWmmO9+waWIxZ+hxJ36vTFg81 xNMo9rKKcaDhy5HMOzIacgbmqZnNxguJKmIHW4HddRIt0mjLGZdiBXOp82r5+emwFkpinh 3I/9MQEyusLUOU1hNP4K7wRdst5r9frjUyHmmtAegIunyxNiwfbYnD7WggXd5EJfcMB/ND 8vSRGv16YBlojlaSXN8arCZmdDNE2EDSWzKRB/yXCdiTdmfLfzyaIkYWo49adQ== 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 4dXhmv52tYz1Gkc for ; Fri, 19 Dec 2025 09:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dc30 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1fa29df2cd37 - stable/14 - sys/rpc: UNIX auth: Support XDR_FREE 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1fa29df2cd37e74daa95c1150ec284b269db2e1f Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:11 +0000 Message-Id: <6945188f.3dc30.538c3051@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1fa29df2cd37e74daa95c1150ec284b269db2e1f commit 1fa29df2cd37e74daa95c1150ec284b269db2e1f Author: Olivier Certner AuthorDate: 2025-10-13 15:13:09 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:45 +0000 sys/rpc: UNIX auth: Support XDR_FREE xdr_authunix_parms() does not allocate any auxiliary memory, so we can simply support XDR_FREE by just returning TRUE. Although there are currently no callers passing XDR_FREE, this makes us immune to such a change in a way that doesn't cost more but is more constructive than a mere KASSERT(). Suggested by: rmacklem MFC after: 2 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 4ae70c3ea498e06676040ee99254d261e29ae82e) --- sys/rpc/authunix_prot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index 5189a279da8b..e72a28130882 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -65,6 +65,10 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) uint32_t junk; char hostbuf[MAXHOSTNAMELEN]; + if (xdrs->x_op == XDR_FREE) + /* This function does not allocate auxiliary memory. */ + return (TRUE); + if (xdrs->x_op == XDR_ENCODE) { getcredhostname(NULL, hostbuf, sizeof(hostbuf)); namelen = strlen(hostbuf); From nobody Fri Dec 19 09:19:13 2025 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 4dXhmy1rmDz6LBM2 for ; Fri, 19 Dec 2025 09:19:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmy00RHz44nJ for ; Fri, 19 Dec 2025 09:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135954; 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=ZsxvHucCUAvyl9g/ScYzudek8KrB35X7i9wYz3P5FQI=; b=Ya5ndjOLK10/aNppGh9UMhvuggcBSD+SUMUP4kbAYcaAfMjh6w6D7ewPsAzF7GsQURPupn OsU9expA5fzij7An1ZpGoU74PoVv/0lcVN36DRylzV6AQYlMTd4LDzaJsAsq03iBxTZWSv mVJqG/DWfb5DKqo4OoEKvF1U8/OfmAgQqqWXtguegTsQSPcWPLKsiUF6dIcOVlgZ23QPpf sm/H5y0BGOMdWp28qVGpdYSTm+MRTc207foK9+dDd/surlvuz1xdUkyyBqANoOUUTP/R6p 2CF0evRA30yqmLtEPV0NmkDMj/wxdGloIT88MODee84PI6jMTsRd3l4b41MGjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135954; 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=ZsxvHucCUAvyl9g/ScYzudek8KrB35X7i9wYz3P5FQI=; b=ep3uQnQDsU3rp57Vs50ofWS8AlEHcA67eD86/QAnzeOEjK1Lr4BuMjdsPZcnnFomeEgPAB PWc5o9YHqIHWjqpDBrA2ByZT5ZBiYhg1dDHIpU/zbmnBLcRQATz9rM4pG8m7K4Mvm5cvvk Wdjp2SVLyVxBlBNSgX+37Frx86obLyGz7JJV5tbDRX4YvPuuxWptcb2OyIfR+oNSsVL61P dA+7j2+4Uo+IEJ5/5cYYKZO+oDo34p6jW8vd2EmmqAdybICzVwCR75OyoRXu9aBJhd4ZdP amYwulPS1NuQ1g/gZLYibfbJQJlrNtRfIYFkmtcXlDIQjl9Rdjb73oqK0HJ30g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135954; a=rsa-sha256; cv=none; b=cRscWuKm+UTDpxrOoWCn72b6R152qWTb/HHwSUiVeRMQc+ftoTdgnhxufOeAr1o+jpnP2y BBNwRpeFdjDlee6OhcChYV+R3erMdxAIx7PthAI0fU6+SL6pXvYuS4DhT0k6R+9fwr/1Af gEgBjezwl8bHWa64r+a+d1rmrcu61Kmr3T5jySi54w95nb/+Mgi3dOuqOSuLI4V6gN2Yvo cklgDsmlI//wLE+yRwVrsCh+0tJoVcgWThhqzofNt20ssmrU5L0VIiZIbU3eC4oZpDcYO1 P2s1/eJ4pjv3gblR4Ty0Nl/IF+4cDE+o/bikTPh5dsSKvVbIDSZgI1I7xuDt6A== 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 4dXhmx6gK2z1GYd for ; Fri, 19 Dec 2025 09:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ed10 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 67a2afe25ab8 - stable/14 - sys/rpc: UNIX auth: Do not log on bogus AUTH_SYS messages 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 67a2afe25ab8c4f93f82624d0f0a00cfa22f83bb Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:13 +0000 Message-Id: <69451891.3ed10.68037e29@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=67a2afe25ab8c4f93f82624d0f0a00cfa22f83bb commit 67a2afe25ab8c4f93f82624d0f0a00cfa22f83bb Author: Olivier Certner AuthorDate: 2025-10-14 12:54:55 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:46 +0000 sys/rpc: UNIX auth: Do not log on bogus AUTH_SYS messages Remove the printf() stances added in commit d4cc791f3b2e ("sys/rpc: UNIX auth: Fix OOB reads on too short message"). Even if it can be helpful to know why an authentication message is rejected, printing explanatory messages on each request attempt is a remote log filler that could be triggered by accident, and the generic RPC code generally does not do that. These printf() calls should be restored only after some limiting or configuration mechanism is devised. MFC with: d4cc791f3b2e ("sys/rpc: UNIX auth: Fix OOB reads on too short message") Sponsored by: The FreeBSD Foundation (cherry picked from commit 2110ae0ef9d6ca8cf52b29fcaf926c4343f56826) --- sys/rpc/svc_auth_unix.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index 6d2cb2359ffd..46e339019f88 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -45,7 +45,6 @@ static char *sccsid = "@(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC"; */ #include -#include #include #include @@ -74,11 +73,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) const uint32_t min_len = 5 * BYTES_PER_XDR_UNIT; uint32_t str_len, supp_ngroups; - if (auth_len < min_len) { - (void)printf("AUTH_SYS: Too short credentials (%u)\n", - auth_len); + if (auth_len < min_len) goto badcred; - } time = IXDR_GET_UINT32(buf); str_len = IXDR_GET_UINT32(buf); if (str_len > AUTH_SYS_MAX_HOSTNAME) @@ -89,12 +85,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) * 'str_len' (and that it won't cause an overflow in additions * below) to protect access to the credentials part. */ - if (auth_len < min_len + str_len) { - (void)printf("AUTH_SYS: Inconsistent credentials and " - "host name lengths (%u, %u)\n", - auth_len, str_len); + if (auth_len < min_len + str_len) goto badcred; - } buf += str_len / sizeof (int32_t); xcr->cr_uid = IXDR_GET_UINT32(buf); xcr->cr_gid = IXDR_GET_UINT32(buf); @@ -112,14 +104,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) * read in total. */ if (auth_len < min_len + str_len + - supp_ngroups * BYTES_PER_XDR_UNIT) { - (void)printf("AUTH_SYS: Inconsistent lengths " - "(credentials %u, machine name %u, " - "supplementary groups %u)\n", - auth_len, str_len, - supp_ngroups * BYTES_PER_XDR_UNIT); + supp_ngroups * BYTES_PER_XDR_UNIT) goto badcred; - } /* * Note that 'xcr' is a 'struct xucred', which still has the From nobody Fri Dec 19 09:19:12 2025 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 4dXhmx2b1gz6LBCM for ; Fri, 19 Dec 2025 09:19:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmw6YdGz44dC for ; Fri, 19 Dec 2025 09:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135952; 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=7Neu2MJMXCtD5Cd473e8KlHJ1J53C+RDYIC2T6y5Kjo=; b=eG47q8qLjRcrjCXXK4zT4HSBKekqj7N1bP4TZKaNYkJwqP9eGjtw3mZXNMT95zk+8Dsecf f5L4AZNiUyA3aToS1HXeL6caFx7IV8z3j/Cv6+lfoiy3hvDEXqydynveRa5d7Jq7awSvGe yoYZcwAfFqbuXq0CFzmxEdpUJN+UXES/E5UIdJ2wOCfTRtlEWPuq5escb5f4yFf3dGSmqv iVa8Sj/9hhvHKGf6e2rQf/nvWEbbItjb0H//cH61QfKGUvXpLOimMzGxKddrLhDJeGUtLW VYhDaqKEiQ73CyYq8n7Yr+D/S4GV6WZeZehodoP5gGPKBckqsYtwpifbVu8g9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135952; 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=7Neu2MJMXCtD5Cd473e8KlHJ1J53C+RDYIC2T6y5Kjo=; b=oTSHgUz9zV2I3E0tcdpWPVA5FtkhQBoOl7aEq659TfIQGfE7B72Iz7miws1Ky7nMonmnhO gTTI3/rqE0ZmlwO/zBsW98Aumku/X6jnrH9HHH0IVpSqlVidlsnsufNsvfhDNydweURa+P jRHaOeITf1NjkvzgNCmq50HSnyB2ie8IwmDT/g/7cYEEeaw33wYqoOA/tBgVS9VavQqHwY iIm5FwSpRb3sJoiRomgLhrNtEe0KZvJyZzhcEKLVAwG2vonppyzv5Bs04UofGfLHZGX228 p6EKMBvcSR6ZG9vEYBnRIO+1HnmxFeE3FzO7biLj7vYVUcvo9JAwWDDQJx/mGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135952; a=rsa-sha256; cv=none; b=ltK6mBw9b8lof5cWqebSfnLTeaOa3bePHMoKT8DYyO+CjiKmwy86uqTBj9F10Ezvi7R+eN Z9UAmAQGUWCikiRr9x0Ov8pOMdSnCKYysc1Yyh9tW0U1fuUAcGyoWm/6xzqwYTcVaFj76K aanA3JIA9XaPB2mRYVLA6MNq5AzNoRJOC1je0lJGNqeaLQPrHzYP1I0LgifPcyBgq6ScsQ ybxQDDVm+LVdcU6l+ETtyj/1OT3w5XLY+pL/fDgk5whzBRDWi7iY4UjfXzxdU1YPNy+WX9 eIIC7Q/LhsjIAPiTtyXJv0/N8Mz9sBlwdjym5e7koeBaaoKCMMGjmEitraaXGw== 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 4dXhmw5sMpz1GNP for ; Fri, 19 Dec 2025 09:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d351 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: c3f9ca7ab109 - stable/14 - sys/rpc: UNIX auth: Style: Remove unnecessary headers, minor changes 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3f9ca7ab109be27a1f8d6a1745669ba6b4c9790 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:12 +0000 Message-Id: <69451890.3d351.834849d@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c3f9ca7ab109be27a1f8d6a1745669ba6b4c9790 commit c3f9ca7ab109be27a1f8d6a1745669ba6b4c9790 Author: Olivier Certner AuthorDate: 2025-10-07 17:10:12 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:45 +0000 sys/rpc: UNIX auth: Style: Remove unnecessary headers, minor changes MFC after: 2 days Sponsored by: The FreeBSD Foundation (cherry picked from commit a4105a5d4e179aa1ef661ee45d6008e83fefd2a7) --- sys/rpc/authunix_prot.c | 9 +++------ sys/rpc/svc_auth_unix.c | 4 +--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index e72a28130882..d863cdde9101 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -44,8 +44,7 @@ static char *sccsid = "@(#)authunix_prot.c 2.1 88/07/29 4.0 RPCSRC"; #include #include -#include -#include +#include #include #include @@ -74,12 +73,10 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) namelen = strlen(hostbuf); if (namelen > AUTH_SYS_MAX_HOSTNAME) namelen = AUTH_SYS_MAX_HOSTNAME; - } else { + } else namelen = 0; - } - if (!xdr_uint32_t(xdrs, time) - || !xdr_uint32_t(xdrs, &namelen)) + if (!xdr_uint32_t(xdrs, time) || !xdr_uint32_t(xdrs, &namelen)) return (FALSE); /* diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index 7222fd6d95c0..6d2cb2359ffd 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -45,8 +45,6 @@ static char *sccsid = "@(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC"; */ #include -#include -#include #include #include @@ -135,7 +133,7 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) buf++; } xcr->cr_ngroups = MIN(supp_ngroups + 1, XU_NGROUPS); - } else if (! xdr_authunix_parms(&xdrs, &time, xcr)) + } else if (!xdr_authunix_parms(&xdrs, &time, xcr)) goto badcred; rqst->rq_verf = _null_auth; From nobody Fri Dec 19 09:19:15 2025 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 4dXhn00xmcz6L9sF for ; Fri, 19 Dec 2025 09:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhmz0kG1z44mJ for ; Fri, 19 Dec 2025 09:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135955; 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=qnmsEmNWSIOU5feUbc6LIqqwspwbtqT7Mg7Trn93AVw=; b=agyKIfzBLmEGp7j+GpK12r2aymNMd0w3S2lqdgOURCNgrgqCQAjy6bA2L9zcMoR+6q79wH xBexBIhbbvi7g0lPtjExC3t6FVkAGHklfoHQwQVSLOnOkTv6HTqju0aYwdoFGswcvho2bI /1P8/956M6J2rzuT0qgJGjJpofZo/JitzyOt8M95VXEKGdqt6j0EHlb0ZxwWz8BNL5h8eR KSfP+Ns9Mw/7jXQsEurM/NvINDAxYlOzow/TTV7svKXmlA0VnVQcKwxc65HACbkF5zUwgi owied2Tf4KB1JYTuHCVYbH4LC3hdEi8IEz01Lr4/rGnmAbx2PjxvQikIEsB3Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135955; 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=qnmsEmNWSIOU5feUbc6LIqqwspwbtqT7Mg7Trn93AVw=; b=YL/iMgEt/GcD4OmRSPplHcE5HRBGTnzMTr8yzO1/MhO7mCUMApTcaeE3ZojxYxxy5t3R0i gZOlu1dLlRPnAJ92Cqfu73eB/Ai8HwE4HTgjz/U+MT6uxr6cGt78F4KhaeWz5dU/32mT07 dSp0Jh1fhOkf5tAw9Xn60NcqanMuEzM5mHbVWalFxh8+BtmJnRYFKl4Nu6ABk96TTwJxG6 IyCaGqRYpenM17Mb2XNiTcZBoYdbHpkw1JBoNG4erHa7azMTvqxuJsIFrQB883aqoUQ2Fq eDm/ecSwywT2ojMxrJVEXr8JiyTJFw+BbW2PVNd8ycJM7+KMtkMlw0p+VJbMdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135955; a=rsa-sha256; cv=none; b=bvvx3JKu1lQ/d8MdQq4+y7bJDD7FWTGIkLYAoT+j89I2/AgKssPXhp+Xf6tHOahwPkB3yt 34Ps113bV2pqC/KTFgyMqB3MxHsLBaoj/R+nE3dbGFqv7+v4eRUKzfNzTh+9tfd6MQBXX5 zrEFKiaG9zSBJKaGjOojJTU7jdU782hqTToPejcEAhnm7/dGY7jKFtPBVt6vqvoN6g7MRi wL/6eHUInNhMRWiK1XZ769xAj2s90OctJKFLdqITFWuNLHLQdgd/PqkIroXV9SlnyG/hTZ M8USHmQ92wqR+ZqLHEPPNXPKOZ2CevyznKjBEJSSo8mFHoEMuph8XrJcDC38Rw== 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 4dXhmz0L02z1GNQ for ; Fri, 19 Dec 2025 09:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dd54 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 12b613efb4c6 - stable/14 - vm_domainset: Ensure round-robin works properly 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 12b613efb4c670959ce540354db353bfb06e72a8 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:15 +0000 Message-Id: <69451893.3dd54.1be5d59d@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=12b613efb4c670959ce540354db353bfb06e72a8 commit 12b613efb4c670959ce540354db353bfb06e72a8 Author: Olivier Certner AuthorDate: 2025-09-25 14:40:30 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:46 +0000 vm_domainset: Ensure round-robin works properly All iterators that rely on an object's 'struct domainset_ref' (field 'domain' on 'struct vm_object'), which is the case for page allocations with objects, are used with the corresponding object locked for writing, so cannot lose concurrent iterator index's increases even if those are made without atomic operations. The only offender was thread stack allocation, which has just been fixed in commit 3b9b64457676 ("vm: Fix iterator usage in vm_thread_stack_create()"). However, the interleaved policy would still reset the iterator index when restarting, losing track of the next domain to allocate from when applying round-robin, which all allocation policies do if allocation from the first domain fails. Fix this last round-robin problem by not resetting the shared index at iterator's phase init on DOMAINSET_POLICY_INTERLEAVE. Add an assertion to check that, when passed, an object is write-locked in order to prevent the problem mentioned in the first paragraph from reappearing. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52733 (cherry picked from commit 7b0fe2d405ae09b1247bccc6fa45a6d2755cbe4c) In stable/14, all page allocations with object have the latter locked for writing. Contrary to what happened in main (and stable/15), the offender mentioned in the original commit message never appeared in stable/14 because it was introduced in main by commit 7a79d0669761 ("vm: improve kstack_object pindex calculation to avoid pindex holes") and later fixed by commit 3b9b64457676 ("vm: Fix iterator usage in vm_thread_stack_create()"), both of which were never MFCed. So, the following part of the original commit message: "The only offender was thread stack allocation, which has just been fixed in commit 3b9b64457676 ("vm: Fix iterator usage in vm_thread_stack_create()")." does not apply here. --- sys/vm/vm_domainset.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_domainset.c b/sys/vm/vm_domainset.c index e10cf2540919..6ec2d893fc7d 100644 --- a/sys/vm/vm_domainset.c +++ b/sys/vm/vm_domainset.c @@ -109,7 +109,6 @@ vm_domainset_iter_interleave(struct vm_domainset_iter *di, int *domain) int d; d = di->di_offset % di->di_domain->ds_cnt; - *di->di_iter = d; *domain = di->di_domain->ds_order[d]; } @@ -256,9 +255,14 @@ vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj, * are immutable and unsynchronized. Updates can race but pointer * loads are assumed to be atomic. */ - if (obj != NULL && obj->domain.dr_policy != NULL) + if (obj != NULL && obj->domain.dr_policy != NULL) { + /* + * This write lock protects non-atomic increments of the + * iterator index in vm_domainset_iter_rr(). + */ + VM_OBJECT_ASSERT_WLOCKED(obj); dr = &obj->domain; - else + } else dr = &curthread->td_domain; vm_domainset_iter_init(di, dr->dr_policy, &dr->dr_iter, obj, pindex); From nobody Fri Dec 19 09:19:17 2025 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 4dXhn14hN2z6L9vZ for ; Fri, 19 Dec 2025 09:19:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn12Prcz455B for ; Fri, 19 Dec 2025 09:19:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135957; 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=ie8ypwTJS8dyvmsmEbL2IX2Rf6JTULm2zxy59TZLWdY=; b=wx9gVtLgHylUvm98wo+7XFp65N+KffTYSyyUJTvcGwTu3BHVjSVMdfuZypYSbi1W27NuAK P8Ot7IfXFiWYbUfKKHWf58KDnpW3cjyZ+su0H+Fm8QAKsH/XOfB/fhKqV6ReiqW38RAQgx 0qc+D7nU6OsxKlcIsjIE7fdZa9Bs/UeZ6rX3f3twxCNzlvVtgAmrNpJ7TAxlznImNMoS46 1t5s6/yi5j+IjmDf+VTvTzuIBDucSpbRDVFZUveXG/fLhi+dVj5/+nMPxt3yK1fPvNSRs+ orjEvFwB6LneWyZ3Y1ENQwF0kGr8an5fF3jwGf9z6GW2xSJPBOnr4b0hdnWsrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135957; 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=ie8ypwTJS8dyvmsmEbL2IX2Rf6JTULm2zxy59TZLWdY=; b=HLtP11jOjYGsZDLLit1drOoZ8gRhhn1x/X2m3tXH77IE3foK7+1TqjT9ijC6MwJWcE50a5 L56+RTR7I4Q7zNZSPZGabBp8SwXoU+jz4nSFgSLNaEydbtV8mhAY1cJt0gJwBcvREtkb5n FDsrdeQLDvfOFS0T8XbqCpb+LvbdymZAH+XH+HkfNgpc2J1tDh6uLPDt7faEwrxLEj+91o +Ok4rdHVCGP8xABEV6KBJ9KMmSWZAzt0/nyi+QOo5RNpkrIDpwfDk1isUlg76MOPUCxggz aBbJVO0ta7Xs821PBlpTmxLU3CXytkTv8qS02sE8kKBfS/FKhsA0kHH3wSnQ8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135957; a=rsa-sha256; cv=none; b=E2jKug0now2NoQRXiTlunHhS//TrqiCr9+HXFgy78aoldAUD+IUXa6NgFquXRXjbGwEdPk 2Q3IPViWbyBsu2KlNqoReI3xb7vMSgRpsrUFWKx3G2mlovstqEQH1wlvxH4HCgsOQoqN5E yGEx1t/HDB89fbdSl4rP4489GzaELOhOQy73LIMBO0bkrea9uLd8rbkHzRTu6gxj2YAeqC V9Uy6T8pq3rhZTMBOKMbC2Ox5Gw5pl+Dxol/3p7kaBQgr1m3+6dw9ep1Q//aYDaC9Rz8eh LDGvOXc/8hW/QaRNPJJHG7CDBzZ7lj1/nipzjQ3SSS4nAOKDFtWzZH5xR+kJSw== 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 4dXhn11yXpz1GKy for ; Fri, 19 Dec 2025 09:19:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f0fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: bd26c99b688e - stable/14 - racct: Simplify skipping idle process in the throttling daemon 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd26c99b688e4f9dabfc477d6e89ead587f923f4 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:17 +0000 Message-Id: <69451895.3f0fc.100b66eb@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bd26c99b688e4f9dabfc477d6e89ead587f923f4 commit bd26c99b688e4f9dabfc477d6e89ead587f923f4 Author: Olivier Certner AuthorDate: 2025-10-29 15:47:25 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:47 +0000 racct: Simplify skipping idle process in the throttling daemon In racctd(), commit c72188d85a79 ("racct: Improve handling of the pcpu resource") added a superfluous test to skip the idle process when computing the resource usage and checking for limits, consisting of a comparison of the considered process' pointer with that of the process of the first CPU's idle thread. The P_IDLEPROC flag introduced in commit 33be1632047c ("racct: Fix accounting of CPU time for the system idle process") is sufficient and simpler for this purpose. In the second loop throttling processes based on their %CPU usage, the test excluding processes not in PRS_NORMAL was not consistent with that of the first loop (which tests for the idle process also). This had no practical consequences except a superfluous call to racct_pcpu_available() as the RACCT_PCTCPU counter stays at 0 on the idle process (because of the first loop). Factor out the test in the new racct_proc_to_skip() function. No functional change intended. Reviewed by: markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53455 (cherry picked from commit 9530c6f082ada9e6d0323f36697ce53997ab2326) --- sys/kern/kern_racct.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c index 13df4724f860..0e359dfe85cf 100644 --- a/sys/kern/kern_racct.c +++ b/sys/kern/kern_racct.c @@ -1226,6 +1226,13 @@ racct_decay(void) racct_decay_post, NULL, NULL); } +static bool +racct_proc_to_skip(const struct proc *p) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + return (p->p_state != PRS_NORMAL || (p->p_flag & P_IDLEPROC) != 0); +} + static void racctd(void) { @@ -1243,8 +1250,7 @@ racctd(void) FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); - if (p->p_state != PRS_NORMAL || - (p->p_flag & P_IDLEPROC) != 0) { + if (racct_proc_to_skip(p)) { if (p->p_state == PRS_ZOMBIE) racct_set(p, RACCT_PCTCPU, 0); PROC_UNLOCK(p); @@ -1297,7 +1303,7 @@ racctd(void) */ FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); - if (p->p_state != PRS_NORMAL) { + if (racct_proc_to_skip(p)) { PROC_UNLOCK(p); continue; } From nobody Fri Dec 19 09:19:16 2025 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 4dXhn04VkXz6LBMM for ; Fri, 19 Dec 2025 09:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn01cMsz44kS for ; Fri, 19 Dec 2025 09:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zY7eeHk6pL2cDod3hGUjQDUQaL6KEimoFzAIK/mhFeI=; b=jYL/lKjUHOFOUBTyKu8fTHwi69oSjITtj1K6e3hvYE8bJDOfmvsmKfkf+u3KIL0EaoEfKj EQ16EuxR3o2Qkqkd6qeBd3prdJTHN6WdDbdGi0PgJG8MmCzu6n5UOpdhCUfvAkJISEvS2r tlzMvZ8UMcxevswy+E0g7LhVi5F69u7BKhpXokibePG5b6zADgn7up7I5wVu+Ky6QJYtMR ef4xPGLrjuXrY216ff39Nr6gDlMqygVQWZer6GAuJFv4yE2v4ThFfIxa0oTA1ac4q3koCm FVluzOkNvvfz3571fJhhG5VPcxZTydSyYzz2Ee4TTD5UbMPUgYSvurNf+16rRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zY7eeHk6pL2cDod3hGUjQDUQaL6KEimoFzAIK/mhFeI=; b=ubnC4J/kGcMTSfzeL6SRLz6We7soNHfXAvtFeVU3Zw47uTDjItPzp3gzKQgsUOdG1FLdRW 9q+SQvd5kCcZ8bIhoAMxDil1SFDof/LyL2OD+uIJMs/d4aLM2oY9E/rLePD/xnfRw0v+ni vg6we2BZTopiHGxVvryNEOd/YJRY9XeXUGdTFNrZ/KTJLD3pFoDJ5gBQbAbJkfe+gIzmLe IXsmpHcgZrebHZS0ICx0bPu8MBpJNqx1vu6Qmr5XfAmrofG7SkOMZC4uw72V+0aIJWi1CS uXYw+oynfooayPOhLd23iBo8xB/IvjjRIoFR6lC3IXzZwRpRez7kS6kwo1/yAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135956; a=rsa-sha256; cv=none; b=ZhztGJXTT8WOIOgN1usSKNcjn3h8Pkfty0cQXNYhRDhGx9ESOJqBRDkANj3rptyPvuhD2c g+Hz3Da8/t0YOjHTt9vU54PadhY9rcnE0QdhExI4075Y7mSWgMGWx38A1h4Z5fat6KL59V MkVOvUjpiQF7eGiEVqrkU9SZ0euA5XnNiUcpkfzeHOPKidy35EE8/Sq7ajkBY7ag/ClJop azHWDs85urIp4CPKchxQP5F5xg5OBsNij+KcjpFQACYBnCd5umdG80s3hviKIAVbC+tKf9 x2WlRpJzrOQFdh2WLBEXZz/OhPdE0040Mu+Awbg6pRgLt8gOgLY3EvmtP3qtrg== 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 4dXhn019CVz1GKw for ; Fri, 19 Dec 2025 09:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f880 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Mark Johnston From: Olivier Certner Subject: git: fd404e957dd9 - stable/14 - racct: Fix accounting of CPU time for the system idle process 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fd404e957dd93d0e8525e4bc37df3f66610ca19d Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:16 +0000 Message-Id: <69451894.3f880.c951a04@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fd404e957dd93d0e8525e4bc37df3f66610ca19d commit fd404e957dd93d0e8525e4bc37df3f66610ca19d Author: Mark Johnston AuthorDate: 2025-05-01 13:59:55 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:46 +0000 racct: Fix accounting of CPU time for the system idle process - Add a flag which cleanly indicates that a given process is the system idle process. - Modify racctd() to skip over the idle proc when aggregating CPU time and other metrics which don't apply to the idle thread. - Remove handling for idle threads from racct_getpcpu(). PR: 269097 Reviewed by: olce, kib Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50073 (cherry picked from commit 33be1632047c05dbfcc139476e05f49c3a86d560) --- sys/kern/kern_idle.c | 3 +++ sys/kern/kern_racct.c | 22 ++++------------------ sys/sys/proc.h | 2 +- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index 0569659bdc73..0d0f496a1a03 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -83,4 +83,7 @@ idle_setup(void *dummy) #ifdef SMP } #endif + PROC_LOCK(p); + p->p_flag |= P_IDLEPROC; + PROC_UNLOCK(p); } diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c index b121e24b9354..13df4724f860 100644 --- a/sys/kern/kern_racct.c +++ b/sys/kern/kern_racct.c @@ -322,15 +322,13 @@ racct_getpcpu(struct proc *p, u_int pcpu) u_int swtime; #ifdef SCHED_4BSD fixpt_t pctcpu, pctcpu_next; -#endif -#ifdef SMP - struct pcpu *pc; - int found; #endif fixpt_t p_pctcpu; struct thread *td; ASSERT_RACCT_ENABLED(); + KASSERT((p->p_flag & P_IDLEPROC) == 0, + ("racct_getpcpu: idle process %p", p)); /* * If the process is swapped out, we count its %cpu usage as zero. @@ -350,19 +348,6 @@ racct_getpcpu(struct proc *p, u_int pcpu) p_pctcpu = 0; FOREACH_THREAD_IN_PROC(p, td) { - if (td == PCPU_GET(idlethread)) - continue; -#ifdef SMP - found = 0; - STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { - if (td == pc->pc_idlethread) { - found = 1; - break; - } - } - if (found) - continue; -#endif thread_lock(td); #ifdef SCHED_4BSD pctcpu = sched_pctcpu(td); @@ -1258,7 +1243,8 @@ racctd(void) FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); - if (p->p_state != PRS_NORMAL) { + if (p->p_state != PRS_NORMAL || + (p->p_flag & P_IDLEPROC) != 0) { if (p->p_state == PRS_ZOMBIE) racct_set(p, RACCT_PCTCPU, 0); PROC_UNLOCK(p); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index a094af09a21a..06506f7d03ed 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -807,7 +807,7 @@ struct proc { lock. */ #define P_CONTROLT 0x00000002 /* Has a controlling terminal. */ #define P_KPROC 0x00000004 /* Kernel process. */ -#define P_UNUSED3 0x00000008 /* --available-- */ +#define P_IDLEPROC 0x00000008 /* Container for system idle threads. */ #define P_PPWAIT 0x00000010 /* Parent is waiting for child to exec/exit. */ #define P_PROFIL 0x00000020 /* Has started profiling. */ From nobody Fri Dec 19 09:19:18 2025 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 4dXhn32Fbvz6LBNY for ; Fri, 19 Dec 2025 09:19:19 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn23J1Pz44rj for ; Fri, 19 Dec 2025 09:19:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135958; 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=kFRf+EmaCPS63/2PKUfabMvxCIH6PglcoRC8UvA+t4E=; b=NWUloIInGN+ohEbzX2eJOQlxUEOtFc5Bod2b8unvG50qNsvl7CuxB32iHtSr90SmBevy8g QuvZz+LHZjyDSDXoWNlmZ2zFL9mCUMLhWH/hoZKFHGMvhx1UMEy4up8sRrC9d2kWn/xzTK SIwLyOvw2d8sCoLWO3FOpH9efqPkGGKYezX01FnzgpP99G0dQdRRfp3dol9XEiS4DBPrhT oVEOFvkbbDK0ZwUwvym69JsbYU6UnMgSK55Ekpqqyck8ns2yuIumCSjtrezD6n5JdSQegl 9mxwBOnnW2ne1xFeCj9uI/PGdEAqQV1uKk4nzFzt4KW/Ui5W0kcxk3xxLDhJow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135958; 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=kFRf+EmaCPS63/2PKUfabMvxCIH6PglcoRC8UvA+t4E=; b=HvK+grsIYOIYsXPkr4AohBA7IhPrJ7dl98MW5beY2Q6a31NmN7DLXAJmEBpK27Sbr5N/VU D8Knzvo2PZBjQcFY3V84C2V5LtkS9dgTsNQWzfEgIguEmrJBzqEgLksVXSdXnA9cQoT+6h Opxeg38c7yeoSXpdMg4F0sRDVD/bBdBfuu20NBZ3E3kDN5QTXFLdyKk/XozAUIzSDct76c EmFJWdaqkdVXpLHlAOhIOZgcnd3wUs+EB+io7hKvIC6EnxarsL3ArNVIRtP4ZQvxiCg0Qz rutrcOQNfzerNpJRdL9KIe1ZvomdJo/1LNIh0QqHg5nx8fAZzVMisrKtEisuwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135958; a=rsa-sha256; cv=none; b=EhdUWUJWjkxR2NWMTBGUrWTS6GPUs4i8yQC8Ob7IW+biRB2U2ZUPpHnk9cA0FcfkquQ9lO UPv287gMSi5EU5YIEwcrPGy/suhy/GReqpiWE67LF3os2BHkDosQkcVJLKXfmaD0IA/ea0 PEpzUO7q3+loyFzizuYUzj95zXsaX5pSWdt2hJy51V3yt/KUthp4dojnNMifgt2y1jnzfJ udYdzQTTSm+e5yxtJTrVl25zMvcj+64SPynHkS+iiYqX3JhR8uNz2TMRWkfgLRepFQTENm 8Me1QACxUF3iONrmkMKUvElRn5HLNW4pbFQG2hxYFREgFCYipv9zLpEfsvB81Q== 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 4dXhn22myZz1Gwg for ; Fri, 19 Dec 2025 09:19:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f17b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: cc16a07a8e8f - stable/14 - kern: Fix credentials leaks on RACCT but no RCTL 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cc16a07a8e8fc4921e5072bff6263315918cf7bf Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:18 +0000 Message-Id: <69451896.3f17b.51b15830@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cc16a07a8e8fc4921e5072bff6263315918cf7bf commit cc16a07a8e8fc4921e5072bff6263315918cf7bf Author: Olivier Certner AuthorDate: 2025-10-29 16:46:39 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:47 +0000 kern: Fix credentials leaks on RACCT but no RCTL Affected system calls: setuid(), setreuid(), setresuid(), jail_attach(), setloginclass(). In these system calls, the crhold() calls that, on RACCT, make the just-installed process credentials survive a concurrent change of the same credentials just after PROC_UNLOCK() were not matched by a corresponding crfree() when RCTL is off. In fact, in that latter case, they are simply not necessary, so wrap them with '#ifdef RCTL' stances. 'kern_rctl.c' causes a compile error if RACCT is not defined but RCTL is, so ease reading by not nesting '#ifdef's. MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53456 (cherry picked from commit f4315ff8b3fee71eb0098864a84618f2f8ba85d5) --- sys/kern/kern_jail.c | 2 ++ sys/kern/kern_loginclass.c | 2 ++ sys/kern/kern_prot.c | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index c449aba9b56a..801424794eac 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2705,6 +2705,8 @@ do_jail_attach(struct thread *td, struct prison *pr, int drflags) setsugid(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); +#endif +#ifdef RCTL crhold(newcred); #endif PROC_UNLOCK(p); diff --git a/sys/kern/kern_loginclass.c b/sys/kern/kern_loginclass.c index ceba563413df..f6070cae24d5 100644 --- a/sys/kern/kern_loginclass.c +++ b/sys/kern/kern_loginclass.c @@ -226,6 +226,8 @@ sys_setloginclass(struct thread *td, struct setloginclass_args *uap) proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); +#endif +#ifdef RCTL crhold(newcred); #endif PROC_UNLOCK(p); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index c3908c8e99c9..db7377ed9c9c 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -964,6 +964,8 @@ sys_setuid(struct thread *td, struct setuid_args *uap) proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); +#endif +#ifdef RCTL crhold(newcred); #endif PROC_UNLOCK(p); @@ -1342,6 +1344,8 @@ sys_setreuid(struct thread *td, struct setreuid_args *uap) proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); +#endif +#ifdef RCTL crhold(newcred); #endif PROC_UNLOCK(p); @@ -1488,6 +1492,8 @@ sys_setresuid(struct thread *td, struct setresuid_args *uap) proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); +#endif +#ifdef RCTL crhold(newcred); #endif PROC_UNLOCK(p); From nobody Fri Dec 19 09:19:19 2025 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 4dXhn36T6Tz6LBQd for ; Fri, 19 Dec 2025 09:19:19 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn34Hscz457h for ; Fri, 19 Dec 2025 09:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135959; 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=iiYHnwJbFYFVDxregm9lfC8rIgzLqjuDoauaOSZBaw4=; b=routoAbRDJfPmptSHC8bVkWsszBUkodDL/h2vmJY4SS2VdOsDNRSxubmftM4HCJgRI6Au5 lHVoKsTGQ1dVYi9YnrU1nd8MzGAi4rMxlfkULEG02y97FMeU++o/paFm0DYdKyB/Mq87lj Y5+yzOtfbnLImxwnjcr726/tct5VTKo4UrNRXjlbJU1kK7KoNocGn2XJxW2SmwgkuVTz93 NyBE+6wSLr6XUtgvvRCTl2mHpznsltJ8o13QXz0cLQ9jwJNULVm4aALg8LIyuClpapKaBt bAdQeO+2CXdFlxQRKKJrKzhTO0pZj+rrIEMPSX9ErugE+5fTXuWwh0wnvZ4UTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135959; 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=iiYHnwJbFYFVDxregm9lfC8rIgzLqjuDoauaOSZBaw4=; b=sV+kpReMNCR8AbV0gEK9Wac14E6lCFH5wDjRzWKfM6SV/jg6Go4KUIKuHX3goTVB8R/fj+ xRw1qnS5tFCqobb36xx1hrV4tvSQXb6VMRl+QRN3ou79W+x5k/njkxzhBcywXS3QMyNtRy ZuJuJgiAfavAgyijSSBpZvRr0lnRECvhoBPxQkaDIvHPw9kxohiF3qKIb84ZWUlOgJMQ64 63PJcPmvFiNk4kStdwH5uZ9NxXho9C1/4EgUg/1yOh4cf0YROaQeXDXdb7Neg3UdIBvoKZ YhnqQSM1q5G1ViZBTfZ06DeE178ZOojq4lQw/34PPyUVE1bSsahRRhK9EjCCKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135959; a=rsa-sha256; cv=none; b=yV9upSTTm9BnP3GWlyyX31CEg9BgbSXK7gXcf4FbOnNYAhcktcrn1Kiu34LRzDFFj2tnaA fje5kY/Z1aYQPJ9Y1aaqlF9yTjxtvnU/nsOvIAobwU9EE9RQHxfghNkYaIKgIcmUkfe/5p v3aAy8AH4rvOYVBbYhGW2LZzEI6iHH1MqOATlDco1J4T8NRyIc8k7peKVH9NQ/C9VvdhCX 3zt9Mg5vEQFuqjQL+zNvQ68DBFDEmFpWg81huCn5XNR7S/x+yB0DDevs/MIQV1Bjk3UB90 RR3iZ9KRzaAjJ9RaImi23MFpnp0Jo17imQUGeQGZ5/r9SX6GRvUQiu/YgV80og== 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 4dXhn33cB6z1Gkg for ; Fri, 19 Dec 2025 09:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f885 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 8185ac38a099 - stable/14 - setcred(): Fix RACCT resource accounting on credentials change 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8185ac38a099f244ae6a71d381ac6c226d9264eb Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:19 +0000 Message-Id: <69451897.3f885.29e9e1d7@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8185ac38a099f244ae6a71d381ac6c226d9264eb commit 8185ac38a099f244ae6a71d381ac6c226d9264eb Author: Olivier Certner AuthorDate: 2025-10-29 17:07:59 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:47 +0000 setcred(): Fix RACCT resource accounting on credentials change When credentials are changed, we need to adjust the sum of resources associated to the initial and new process' user IDs (and old and new login classes and jails, but setcred() does not change them) for them to stay consistent. PR: 290352 MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53457 (cherry picked from commit 2be5127c4a31bacac9b4158395bfa844f6033626) --- sys/kern/kern_prot.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index db7377ed9c9c..044b8091310f 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -670,7 +670,7 @@ kern_setcred(struct thread *const td, const u_int flags, gid_t *groups = NULL; gid_t smallgroups[CRED_SMALLGROUPS_NB]; int error; - bool cred_set; + bool cred_set = false; /* Bail out on unrecognized flags. */ if (flags & ~SETCREDF_MASK) @@ -821,17 +821,32 @@ kern_setcred(struct thread *const td, const u_int flags, if (cred_set) { setsugid(p); to_free_cred = old_cred; +#ifdef RACCT + racct_proc_ucred_changed(p, old_cred, new_cred); +#endif +#ifdef RCTL + crhold(new_cred); +#endif MPASS(error == 0); } else error = EAGAIN; unlock_finish: PROC_UNLOCK(p); + /* * Part 3: After releasing the process lock, we perform cleanups and * finishing operations. */ +#ifdef RCTL + if (cred_set) { + rctl_proc_ucred_changed(p, new_cred); + /* Paired with the crhold() just above. */ + crfree(new_cred); + } +#endif + #ifdef MAC if (mac_set_proc_data != NULL) mac_set_proc_finish(td, proc_label_set, mac_set_proc_data); From nobody Fri Dec 19 09:19:20 2025 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 4dXhn50y0xz6LBNc for ; Fri, 19 Dec 2025 09:19:21 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn44sCXz44xt for ; Fri, 19 Dec 2025 09:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135960; 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=+8LdHDJ5akg5vBtDem7FB1WDjEnUP6jq/s+C/Boi6GE=; b=tWI2IO9HKMb0iMtKfxMkXQexS1oCoN6RCGL9dNEr3mLV1Wyx0ANsTQP0nR4unoPh2C17v7 IeyI/ISd33v5PAuCukFcL09+/+rV/uw+DdT17uwW+9B/svNPZhXN7m0xz/jlYnKgjf24nj I4g7E2AlHZJ3L76aUw1MPYqswjhTZBuOnyAdWixA809nfDxnDlsswvGc2rF7YGRVvOrdv7 aUVuT+5nSitpFEyxMzXoYu/17Bk8zHZ1WlLdJXXWZ73DDP2IAbRsAgrGutQesbxFc5ttJO kDVEo9lbd1iiyzwQmebRqMuo6SGJnj3Y2sy09aGl2/wFOXOW35NS5aWzciNgvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135960; 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=+8LdHDJ5akg5vBtDem7FB1WDjEnUP6jq/s+C/Boi6GE=; b=DIA3BHljaU1wgITAvnLeBppw8ova+g+/ujtJo0cwwgx0whkxWf9wCHp2e/WISpOchDEmLQ f56gzlYtlX40qaPxnmqgQ+P0iXPNIKRPIhDuTq82kveM7Xz6x2S2yOv65rw19Yzo5/Fqsx UY4JBM4HnSc1cz6sakO7EhtBmkpYg6JkQUyC/wcEsho3FtJ5em7jgckpUoSbzQRVxUxpZJ a2t/zkywRVqiR1XsuR8iT8GZq9nH2pSJPvylteAnS+Hp2xhNrfZzHNhPEJnCBj9cE4n7br uE9XWU/g7Zx2ht7aIeDJSn90qW+MXBIYpJeowM/aqc3DPS1YQzqKhgHkWjzX8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135960; a=rsa-sha256; cv=none; b=L5zTKeZKp8x+r3a7K6yODhPpXaiavW//ZDAq4Df2T5nbVO15gHNbtkaIznO0/8QXB+JyEh jY1GSdBIK/XmSv0b1Yy2gAMDqBvwH7H/hbeaIzTfy3anYZmMxooq5AGCSDgekN48Y65i/K SH254iW+jDt8kKRNw95B4hzShuiib9MFB19vsDl+CKhKJXrmmelUNoHW9D+IVS7idJZ7Ju yCU0bCndtYDCzSad5KFUZ8866ANm/egnNOsAzyzaZBFqNoM09o8LurNSWsWTMGT2aIysCA fH7yVmGtYJTkIUYOF6J92bky333O0ohfRc99UabEyIcMH6REVHTk9VgJNGz2lg== 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 4dXhn44PlQz1H2S for ; Fri, 19 Dec 2025 09:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d6dc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 269e6a4bc065 - stable/14 - proc_set_cred(): Allow 'newcred' to have multiple references 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 269e6a4bc0656994ea895c88135a2b0d162e8d13 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:20 +0000 Message-Id: <69451898.3d6dc.79fc1cbb@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=269e6a4bc0656994ea895c88135a2b0d162e8d13 commit 269e6a4bc0656994ea895c88135a2b0d162e8d13 Author: Olivier Certner AuthorDate: 2025-11-06 22:25:57 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:47 +0000 proc_set_cred(): Allow 'newcred' to have multiple references This is an extension needed by next commit, where some additional reference is kept on the credentials to be set on a process in order to keep these credentials alive even after the process lock is released (an intervening reset of process credentials could release the reference that the process holds). Only 'cr_users' is incremented, as the reference (counted in 'cr_ref') comes from the caller, who passes it to the process. Reviewed by: kib, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53636 (cherry picked from commit 5d46d11772c3280fd1c8ae09f20ce6c57f631c30) --- sys/kern/kern_prot.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 044b8091310f..c7c60d8bb747 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2678,10 +2678,6 @@ _proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) MPASS(oldcred != NULL); PROC_LOCK_ASSERT(p, MA_OWNED); - KASSERT(newcred->cr_users == 0, ("%s: users %d not 0 on cred %p", - __func__, newcred->cr_users, newcred)); - KASSERT(newcred->cr_ref == 1, ("%s: ref %ld not 1 on cred %p", - __func__, newcred->cr_ref, newcred)); if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) { /* @@ -2707,8 +2703,10 @@ _proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) __func__, oldcred->cr_users, oldcred)); oldcred->cr_users--; mtx_unlock(&oldcred->cr_mtx); + mtx_lock(&newcred->cr_mtx); + newcred->cr_users++; + mtx_unlock(&newcred->cr_mtx); p->p_ucred = newcred; - newcred->cr_users = 1; PROC_UPDATE_COW(p); if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) (void)chgproccnt(oldcred->cr_ruidinfo, -1, 0); From nobody Fri Dec 19 09:19:21 2025 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 4dXhn62W35z6LBGW for ; Fri, 19 Dec 2025 09:19:22 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn55d1cz453X for ; Fri, 19 Dec 2025 09:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135961; 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=ebpQ22cEBZ3e735dmQun5xh5fF81TVShSSPBijmdAkM=; b=XOYkoUgKWqDIRTxSKZq6gtnvtijH6hY9bIsK2a5Z86OUCUJeb/DIrvgSikbO109Su0Id0k 8LOcXsxAl4aLFs/HsCgVSUT8nJHIrwObPISilVcTckSldh+/TWkNLn3RvYqlVzn40OzmX+ xeIPp4U4hdR7czQls/YRbXJsGoq4C+/E87Q31Z0b8Wg0HCVUZHHRjGlek2JUCu6lEM7zxK eoyF6hjHjPQEJpxlJuN2pFfh672ZneprJbTRaXcKKnJo3PKV1lL/6YwmUuIIuPWedumXw1 jCm1ZSIvXNiNBMKCIhVTeLhgJ9SgdfnYSUImHZOBICZ9CIauaxyGgJG4AlnZHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135961; 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=ebpQ22cEBZ3e735dmQun5xh5fF81TVShSSPBijmdAkM=; b=kiekCkMCNln0YbiKNITpr9c478EViPmReLBcu/2gzpuA+lC/nDzTyJU4pDuzU4zjrSFhJl Bv9Wmsxl2hjIvXChJXHq9V6WNPzs3PSOmeVRH3je3JE7IXrMSXzUhKgVBVpyHEzl0/oSm+ I4c1Far0AVsyx3BnruTA9hb2xPsYXfkmJrvZ0H5IsqDNq4hj8qMX3bobj+007KtBOi3+b8 CRAai7izjRPxoiUATN7mYbfnSM4DlwHLPDbZs48TBl/VY6lHVaw5Xm5s66LiunvAnNq7q9 uwtqkQapB4JZ89IpEGkgRfNG6AsM+NNpljfBpcRZp4s2k2Qu25i+s11EmMYfjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135961; a=rsa-sha256; cv=none; b=PgUU0ZWmILDNLkUuczSKPG3B3Iz8jNd54R5x/DGnAzkzMHAoigYK4zEyBgbf3lfkj2s47o tjJurIMHhe4hoFNgw800BrvnMuTaMfYB3mXuzuU44IsZVyUtbi1ELcjceKvakXQhI4AoNy npsNatsAspgAKPG3OcdllOKzCOB1Gnu0bsCOCS6kMNVNXbF8709nM1tFBzGH454eHABEBy m4JnAPR2BYYqfurAYZNw+ATB4Dx6LhaBShuLh4qvKBKWIiNo89x4IiB6agpuUlY02akJHJ bJPVnYIZ3LzqwdFQGmuw9T86KIK3dHrOBdBsyOEiIqWkSmsObBdDKAdqyiV8tA== 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 4dXhn559wGz1GYg for ; Fri, 19 Dec 2025 09:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ccf3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ef2392225825 - stable/14 - setpgid(): Fix space before TAB in herald comment 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ef2392225825139ce9bff895dd732a78fea03d3e Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:21 +0000 Message-Id: <69451899.3ccf3.25628d3f@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ef2392225825139ce9bff895dd732a78fea03d3e commit ef2392225825139ce9bff895dd732a78fea03d3e Author: Olivier Certner AuthorDate: 2025-11-09 22:35:42 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:48 +0000 setpgid(): Fix space before TAB in herald comment No functional change. With this tiny change, all the file becomes whitespace-clean. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit d05ab93913f340c5590eafa4cc09cc84aa86282e) --- sys/kern/kern_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index c7c60d8bb747..5139cbb1e102 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -395,7 +395,7 @@ again: * pid must be in same session (EPERM) * pid can't have done an exec (EACCES) * if pgid != pid - * there must exist some pid in same session having pgid (EPERM) + * there must exist some pid in same session having pgid (EPERM) * pid must not be session leader (EPERM) */ #ifndef _SYS_SYSPROTO_H_ From nobody Fri Dec 19 09:19:22 2025 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 4dXhn72LrQz6LBGb for ; Fri, 19 Dec 2025 09:19:23 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn66fvKz458L for ; Fri, 19 Dec 2025 09:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135962; 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=aJkMJyC1zy3W7Vi6pEd7z4eYc6b7JdnfNyq1WdK6pp8=; b=NK4HKEIpKOl8xmTaT05pP675YkmIOJmOHyzJgIWEUwwq7qh2GvGOP4EcVWh66yv+5qP2db O7Vd9SJdmg6pktj8d+8gKqxHowoUElXB/fahcO5eDdU/xpGKK2Xz/W/Vy578oQqmnoonC1 nUWtsKr98Z8FyYnWgTmFtmiWEzyXxBo0C04C2exLF4vPj/7AGyy3dNmoRhtrZ/SJjWm8Mu 2sKSCI7Wx+dWZKIwfwrm3jgsuNcEs6HsNN3Ir3Twl4rsyfXQWgs27QcUaBb2mvzWpvDxC/ yheKNUc7uFooJ9wyd6XTPPsYlQ7lJCvuQ2lwh/JbyMGl6YUnvMsqWMwMXuEoUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135962; 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=aJkMJyC1zy3W7Vi6pEd7z4eYc6b7JdnfNyq1WdK6pp8=; b=bvADmq714LEcQZyAAXHo6UroCmMgf6Z+z8AiIyQWJ9BZv6ofcdX3zglq0tmv0HvNC5ajDg oI3HdHWu8+b0JMIu2dleJLZ5mC6wXKBPtIsK2+ABSlGWnLjJKXVNpL3POrskn5+mom956f chz6XwkgZhy1m+dMdzDWRiho/5kUn9hPenCmOK3HWK1BT3w6G6Io5t0UCXfgtM/UBUGd0u oCn1Ga/i7eaggTPC+xFHMd//iLAM4EsAmAn89guwXECNHZejBElM52B+OolSFHghCmfKoj yjoIbX26NfFZB6u/lMzursGMi7YR6tApDaUoEjygNXPLfUb7iS1vTNVj032irQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135962; a=rsa-sha256; cv=none; b=KToiqEf+tgZoKZJEMcYWeqd373/4GuuEWGUExRWSGJekvvnZwB4LOLLa959d4lqR+vtBP3 PV6kPG5s+O3Vwm3A2rCAMQ+VeeLC9mugNGVA9lGxUkYNyQ07JRHR1EKYFKKziXQHpkqITz ctXZVX9epBmU5HOB0Wi60QRe4Mr8AeaVfYekj9S/uFenfFwHFqbrtSj8JlpLin13FfFRw0 QHYnOD3RqIQOgXmN2qxoRxvw5/by78El+QS31TThS5B0rw1GKft1SCGmNVhCf8zmG16cdc Nk0jQkdQhxH0LpDdB+UPrEHHS5IQCHkPhziEG+GAtoVYDyO6rG+z0lqlkEBVTg== 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 4dXhn65xjBz1H2T for ; Fri, 19 Dec 2025 09:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f237 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f9f1c9d73259 - stable/14 - kern: RACCT: Keep process credentials alive via references 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f9f1c9d732596fecc088af3ddf20bbfc5cb18094 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:22 +0000 Message-Id: <6945189a.3f237.3e825fc6@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f9f1c9d732596fecc088af3ddf20bbfc5cb18094 commit f9f1c9d732596fecc088af3ddf20bbfc5cb18094 Author: Olivier Certner AuthorDate: 2025-11-03 18:21:08 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:48 +0000 kern: RACCT: Keep process credentials alive via references In system calls changing process credentials, on RACCT, calls to racct_proc_ucred_changed() must be issued on the new credentials. Currently, this is done after the new credentials have been installed on the process via proc_set_cred() or proc_set_cred_enforce_proc_lim(), which modifies 'p_ucred'. Only the process lock guarantees that the new credentials pointed to by 'p_ucred' cannot themselves be concurrently modified, which would cause their 'struct ucred' to potentially lose its last reference from the process before the call to racct_proc_ucred_changed(), which needs one. For better code understandability and to avoid errors in future modifications, stop relying on proc_set_cred*() storing the passed 'struct ucred' in the process 'p_ucred' and on the process lock to avoid the reference taken by proc_set_cred*() to vanish. Instead, ensure that a reference is held when racct_proc_ucred_changed() is called. As racct_proc_ucred_changed() is actually passed explicit pointers to the old and new credentials, there is in fact no need to call it after proc_set_cred(). Instead, call it before proc_set_cred() and its taking over the reference. Since setcred() uses proc_set_cred_enforce_proc_lim(), which can fail, instead of proc_set_cred(), we instead take an additional reference with crhold(). Indeed, racct_proc_ucred_changed() should update resource accounting only if proc_set_cred_enforce_proc_lim() succeeds (an alternative would be to call it in advance and then in case of failure of the latter to call it again in order to backpedal the updated accounting, but we don't see a compelling reason to do that instead of taking an additional reference). While here, add to the documentation of proc_set_cred_enforce_proc_lim() that it does not take over the credentials reference in case of failure. While here, in racct_proc_ucred_changed()'s herald comment, add the precise condition in which this function must be called. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53563 (cherry picked from commit c3d2b68c6933d0610bc3e09e9b94f963b4dc85aa) --- sys/kern/kern_jail.c | 9 ++++++-- sys/kern/kern_loginclass.c | 7 +++++- sys/kern/kern_prot.c | 54 +++++++++++++++++++++++++++++++++------------- sys/kern/kern_racct.c | 6 ++++-- 4 files changed, 56 insertions(+), 20 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 801424794eac..ddfe742178c0 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2701,14 +2701,19 @@ do_jail_attach(struct thread *td, struct prison *pr, int drflags) PROC_LOCK(p); oldcred = crcopysafe(p, newcred); newcred->cr_prison = pr; - proc_set_cred(p, newcred); - setsugid(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); #endif #ifdef RCTL crhold(newcred); #endif + /* + * Takes over 'newcred''s reference, so 'newcred' must not be used + * besides this point except on RCTL where we took an additional + * reference above. + */ + proc_set_cred(p, newcred); + setsugid(p); PROC_UNLOCK(p); #ifdef RCTL rctl_proc_ucred_changed(p, newcred); diff --git a/sys/kern/kern_loginclass.c b/sys/kern/kern_loginclass.c index f6070cae24d5..48abb5fd0731 100644 --- a/sys/kern/kern_loginclass.c +++ b/sys/kern/kern_loginclass.c @@ -223,13 +223,18 @@ sys_setloginclass(struct thread *td, struct setloginclass_args *uap) PROC_LOCK(p); oldcred = crcopysafe(p, newcred); newcred->cr_loginclass = newlc; - proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); #endif #ifdef RCTL crhold(newcred); #endif + /* + * Takes over 'newcred''s reference, so 'newcred' must not be used + * besides this point except on RCTL where we took an additional + * reference above. + */ + proc_set_cred(p, newcred); PROC_UNLOCK(p); #ifdef RCTL rctl_proc_ucred_changed(p, newcred); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 5139cbb1e102..c8fea2672565 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -814,22 +814,31 @@ kern_setcred(struct thread *const td, const u_int flags, if (error != 0) goto unlock_finish; +#ifdef RACCT /* - * Set the new credentials, noting that they have changed. + * Hold a reference to 'new_cred', as we need to call some functions on + * it after proc_set_cred_enforce_proc_lim(). */ + crhold(new_cred); +#endif + + /* Set the new credentials. */ cred_set = proc_set_cred_enforce_proc_lim(p, new_cred); if (cred_set) { setsugid(p); - to_free_cred = old_cred; #ifdef RACCT + /* Adjust RACCT counters. */ racct_proc_ucred_changed(p, old_cred, new_cred); #endif -#ifdef RCTL - crhold(new_cred); -#endif + to_free_cred = old_cred; MPASS(error == 0); - } else + } else { +#ifdef RACCT + /* Matches the crhold() just before the containing 'if'. */ + crfree(new_cred); +#endif error = EAGAIN; + } unlock_finish: PROC_UNLOCK(p); @@ -839,10 +848,12 @@ unlock_finish: * finishing operations. */ -#ifdef RCTL +#ifdef RACCT if (cred_set) { +#ifdef RCTL rctl_proc_ucred_changed(p, new_cred); - /* Paired with the crhold() just above. */ +#endif + /* Paired with the crhold() above. */ crfree(new_cred); } #endif @@ -973,16 +984,19 @@ sys_setuid(struct thread *td, struct setuid_args *uap) change_euid(newcred, uip); setsugid(p); } - /* - * This also transfers the proc count to the new user. - */ - proc_set_cred(p, newcred); + #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); #endif #ifdef RCTL crhold(newcred); #endif + /* + * Takes over 'newcred''s reference, so 'newcred' must not be used + * besides this point except on RCTL where we took an additional + * reference above. + */ + proc_set_cred(p, newcred); PROC_UNLOCK(p); #ifdef RCTL rctl_proc_ucred_changed(p, newcred); @@ -1356,13 +1370,18 @@ sys_setreuid(struct thread *td, struct setreuid_args *uap) change_svuid(newcred, newcred->cr_uid); setsugid(p); } - proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); #endif #ifdef RCTL crhold(newcred); #endif + /* + * Takes over 'newcred''s reference, so 'newcred' must not be used + * besides this point except on RCTL where we took an additional + * reference above. + */ + proc_set_cred(p, newcred); PROC_UNLOCK(p); #ifdef RCTL rctl_proc_ucred_changed(p, newcred); @@ -1504,13 +1523,18 @@ sys_setresuid(struct thread *td, struct setresuid_args *uap) change_svuid(newcred, suid); setsugid(p); } - proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); #endif #ifdef RCTL crhold(newcred); #endif + /* + * Takes over 'newcred''s reference, so 'newcred' must not be used + * besides this point except on RCTL where we took an additional + * reference above. + */ + proc_set_cred(p, newcred); PROC_UNLOCK(p); #ifdef RCTL rctl_proc_ucred_changed(p, newcred); @@ -2669,7 +2693,7 @@ cru2xt(struct thread *td, struct xucred *xcr) * 'enforce_proc_lim' being true and if no new process can be accounted to the * new real UID because of the current limit (see the inner comment for more * details) and the caller does not have privilege (PRIV_PROC_LIMIT) to override - * that. + * that. In this case, the reference to 'newcred' is not taken over. */ static bool _proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c index 0e359dfe85cf..acc365d7b921 100644 --- a/sys/kern/kern_racct.c +++ b/sys/kern/kern_racct.c @@ -1022,8 +1022,10 @@ racct_proc_exit(struct proc *p) } /* - * Called after credentials change, to move resource utilisation - * between raccts. + * Called to signal credentials change, to move resource utilisation + * between raccts. Must be called with the proc lock held, in the same span as + * the credentials change itself (i.e., without the proc lock being unlocked + * between the two), but the order does not matter. */ void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred, From nobody Fri Dec 19 09:19:23 2025 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 4dXhn83LLBz6LB9C for ; Fri, 19 Dec 2025 09:19:24 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn80s0Xz44yV for ; Fri, 19 Dec 2025 09:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135964; 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=SuvQ4wZkPZF9ygXBXd4/2e2s+USNqWzi5E0j7KZeHQM=; b=DrbV1EUcxZYqRYbCX2XNQx+6GI3sC27m9Us0N2yjvPmRAZviwZb2Em1qx6yFnWEemI3MYw otsYDrim1ielgTcn1HEHLpy0d7NmvD7z41fUlfN2LcWEEyIbLNzbpj4fWZCXdQI8CUUNK7 60P3TJlQ56vK4tnitCH/SKmTqkjSejG4C52z4AvyDSmBLhgywASqx4e4fBNTIbjH3c8fl9 8JdT1OZSFf4KzgQ07R/zqsTkxht3+aoAEoYE1tuV66hs2m+7p0mD7N7shhFHYHAYZek9Md vb0EpiO3pKBQ28YV9KOmpVQWJ/gx4u4nSIwtUYuDTR9RfUKyIYe/M04S/D2JMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135964; 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=SuvQ4wZkPZF9ygXBXd4/2e2s+USNqWzi5E0j7KZeHQM=; b=dQiVnANOlGWYUOjQ4yrzNQiuTibdEdLoFGcnWjKTiZ/os8Ia/CK90mA+fa2mgOhV0rm5AI So+LWJZFXSxx7IN4mj8ZEfAKTbto/zO0R3ilgKbhiUOU8KiKMIn3bYU7LePV4HO+d7bo0Q 0SCSF5fzz+vmtmZN6tlTGBCDRS47MjzLSfixKXFUrxUX9kOEjwF5JFUwXrpaLtakLQ8z0Q EuOgXzLcxeZOIcXmMren6iiPDZrmUiatw0GP7G/50XXWC47qOEmJdj9V71CT+Y3uT19KSu Kzoxg1YQQRG1qUkF8wUPgFzVgKtl1mOYrlc+C1GnvdHncEVuTQ3N0TZeN9qt1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135964; a=rsa-sha256; cv=none; b=PfZLvbQPWb6LuR00tdLlUK4mWxaKN2dK1i89coPltDi0UzxW5pk0zQrMJ/PevmzQ+MAohF xwudiirjKvvJtEFRIf8yhEeBQqc94xvvtqFiXMsEkSabYGP0kEsxo7nEUhLcRohG3jVSjy qAzZKB0ygmpGhfPIYJ1RokXKL00FQs6+C55Z5EPy1E0uYKqw1eK9NkV0XdMHfIdlyzzMb0 o0r5sQh5yYyz7nBIegRUN92RuEafKMWLsrv3RhufLWVTQKtS+0ijFMNnS7morn+Ng757qs 2TV1kJKQV2f2uhFYxJ8jIrV46+ai+ympNuQoXBxT+7nMiWv0FiSNqBPVd8oTRA== 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 4dXhn76mvlz1Gkl for ; Fri, 19 Dec 2025 09:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f889 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2815d86103ae - stable/14 - setcred(): Fix 32-bit compatibility copy-in 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2815d86103ae1b0e871c0dd68bb8b3c3090a2264 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:23 +0000 Message-Id: <6945189b.3f889.1a299a8a@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2815d86103ae1b0e871c0dd68bb8b3c3090a2264 commit 2815d86103ae1b0e871c0dd68bb8b3c3090a2264 Author: Olivier Certner AuthorDate: 2025-11-14 20:20:12 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:48 +0000 setcred(): Fix 32-bit compatibility copy-in For 32-bit processes on 64-bit architectures, a difference of 'int' pointers was wrongly used as a number of bytes to copy in a memcpy() used to internally construct a 64-bit 'struct setcred' from the 32-bit variant, leading to copying only part of the 32-bit structure, and thus to requesting credentials with garbage IDs except for the real and effective user IDs. This bug was spotted by jhb@, who produced a slightly more invasive fix in D53757 (a switch to using CP() on all fields). In the interest of minimizing the diff for possible inclusion in 15.0, the commit here just limits itself to fixing the number of bytes to copy. Tested successfully on a VM with 32-bit mdo(1) (and in passing also tested that the same executable on a kernel without this change exhibits the bug in practice, in the form of setcred() failing with EINVAL). Reported by: jhb Reviewed by: jhb Fixes: ddb3eb4efe55 ("New setcred() system call and associated MAC hooks") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53767 (cherry picked from commit 4872b48b175cc637ee38f645d68b8207d9335474) --- sys/kern/kern_prot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index c8fea2672565..9edc1fa3f02c 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -576,8 +576,8 @@ user_setcred(struct thread *td, const u_int flags, if (error != 0) return (error); /* These fields have exactly the same sizes and positions. */ - memcpy(&wcred, &wcred32, &wcred32.setcred32_copy_end - - &wcred32.setcred32_copy_start); + memcpy(&wcred, &wcred32, __rangeof(struct setcred32, + setcred32_copy_start, setcred32_copy_end)); /* Remaining fields are pointers and need PTRIN*(). */ PTRIN_CP(wcred32, wcred, sc_supp_groups); PTRIN_CP(wcred32, wcred, sc_label); From nobody Fri Dec 19 09:19:25 2025 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 4dXhn94FCWz6LB9D for ; Fri, 19 Dec 2025 09:19:25 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhn91CVZz44w1 for ; Fri, 19 Dec 2025 09:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135965; 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=c1PYUu3WBFgGpH69i6Cn/jfcF25lQGUuzBJpi8FYDJA=; b=KBKqJ5QhumICgn4pBlPn5ubeqjqvZBMOlcq/xHZOH8qjH0By11cP24BjIOKM/jA/YERGl/ aHw1nQnsMuXgMlItvqyItXMgnnEMiFnPYOpHgbvUw0mQ8LH6iMAqjUJ/nNyx1muyP7mwSG 67e5LTttGawI+eSwIB9Bd4o04jYgz4zcX4ih0rnwj1WyXQhokHeRPsWIfEVIckBHiKGk5v v+4q4WJYgyu/RDJBvgvbDHRPFwiDsoiNiky5FCI/7vJaiRgtvzbESEWomkeuqUwy7oNuvl QM12njsHyGCz7TGTFQCd56PvIwTacCulmVYIQSa2TxBh6Umk6WHMYcwao7R+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135965; 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=c1PYUu3WBFgGpH69i6Cn/jfcF25lQGUuzBJpi8FYDJA=; b=KM95yx2pGgS3y9fpwUba1IRDHRJ5Vo8b9dDppVrULzx+5bGM7Yvw+ST2TowcOLt7j2WHat 0s0bhqosPiEP3ryZ7Jdwy8J9D60Jk+O2Rn0K7FVIqhepHQAzyks7NpeoMLlFQPCbd0t/B2 o7XFUAwmrf4pWtm1NaGPerGE/K91GWkrdzZoIHbdCVHGja+IieXEGAsXhhfvAI1SIvjwTW naT9pFSo1qkK56bN/5QCnzW3CNVXqQcPOXzf8t3ewmK9mynb4jwguVlkoep1/Q0ban3Bac gA4R/+ug9ccBx4g4X5MaqETqpwb/CKJwkL7q88J8QxuPFxTdEkUQc/Ya3dBxcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135965; a=rsa-sha256; cv=none; b=kWvKvwjZkb/UT8DSan6PW2n8QOTqR8GBZgYHTq7pZyBsAZt9CWE2GT0vTckS3S1CdFFrSl PUrObgV7yvEEpbck/7MsfBdzhI3IKaxaaV/uF7LoeVCu6N6VdxkByVYHcmghHRQGdaumZ7 57iJGHXtFiHedIdj24J9YnW/0t6sfkZDYhXMWWvzp6zQAscUNyF902S87gMwgb2jWhA6Zx sQPBDThApLROhm7OqAz51osBB+Y6xtzbMPfcPFOyGDJuUCJlMuhC2ZtU8zRcZhEVPRf0of ObYBm5bLrmcSkKgjRhg9Q4+1EE0xX1IGe3g9A2gDUQb6q0pvX2pxi/GYzoxW5w== 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 4dXhn90by3z1GYh for ; Fri, 19 Dec 2025 09:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cddc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1dc4fa83bb8b - stable/14 - mdo(1): Avoid calling getgroups() in some unnecessary cases 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1dc4fa83bb8b78314cd24bbfda547edbfe2c7553 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:25 +0000 Message-Id: <6945189d.3cddc.622fa6b3@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1dc4fa83bb8b78314cd24bbfda547edbfe2c7553 commit 1dc4fa83bb8b78314cd24bbfda547edbfe2c7553 Author: Olivier Certner AuthorDate: 2025-11-14 11:59:09 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:48 +0000 mdo(1): Avoid calling getgroups() in some unnecessary cases If the basis for supplementary groups are the current ones, we do not need to fetch them when they are to be replaced entirely (which we already have been doing), as in the '!start_from_current_groups' case, but specifically also when they are not going to be touched at all. This change in passing makes the modified code block's comment saying that SETCREDF_SUPP_GROUPS need not be set here correct. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53771 (cherry picked from commit b92b1b47583036bd02e656564ff22c92b8949077) --- usr.bin/mdo/mdo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/mdo/mdo.c b/usr.bin/mdo/mdo.c index 3eb5d4e5c23f..879423bc0128 100644 --- a/usr.bin/mdo/mdo.c +++ b/usr.bin/mdo/mdo.c @@ -753,8 +753,14 @@ main(int argc, char **argv) */ setcred_flags |= SETCREDF_SUPP_GROUPS; } - } else if (supp_groups_str == NULL && (supp_mod_str == NULL || - supp_mod_str[0] != '@')) { + } else if (supp_groups_str == NULL && supp_mod_str != NULL && + supp_mod_str[0] != '@') { + /* + * We do not need to determine the current groups if, as for the + * '!start_from_current_groups' case, we are going to replace + * them entirely, but here also if we do not amend them at all + * (because they are by definition already in place). + */ const int ngroups = getgroups(0, NULL); if (ngroups > 0) { From nobody Fri Dec 19 09:19:27 2025 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 4dXhnC4s0kz6LBLW for ; Fri, 19 Dec 2025 09:19:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhnC2wzBz454T for ; Fri, 19 Dec 2025 09:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135967; 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=4pDozmzv0nSdmLRmmMEvQ47GOOqVQgN1oost07/IMCw=; b=cF7aHmrNgF8T640A24qjrP9Lw1MpgwDvbnFOKVBviBp5EAi5Miaktqzp9c+rOjuYydX7Uy kT3EuTI/oYfqPlRX40BGsHlQE/zzSeYV9ONohcUHpyz36pZJsZQxwAkGEa9Vj+cxCKNHTE 8SUmlE09u0py+sAFG28q7Udq5KW2CKoFFJ++IbEQPLIvwIiGPzaUILlT9IZ2Gz9PJY6gpA yEixZyVVea5ZgsnBjfPTHvu0RMlzXLobsASVDbmCRV81c9cV+ybBxynKcZasF99gxdcrX7 yp7p1rdetNMiO4QBii4PZae8hyNZMH6D2ZnhimljvbL4/cU9j/7OJWjdBWTpow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135967; 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=4pDozmzv0nSdmLRmmMEvQ47GOOqVQgN1oost07/IMCw=; b=HTMThpecfiqsWP1sPIpVWgXU3IV8opIQFASSNx0vAJHZGQ2oYBY/N/RwqyaZ3BXYlwSSt6 7EPaG4R3zdy/pWgZFqWCU+tJivjdrfmhPe78VulCVWuES+duLm3ASSvQysIwZrKi7a7NH0 cv3wSYFIAWPFEhbpKbo5vKaxeeEJgUniYYNyb4foD40a0T7zx3t6KUTRI9XKY0jW8fTuWu 3IW5cWYe1N0wM4cmYk9OoaZrxhPQoqzh0h4hXPq0dWWrcZ8tWXZ1kURDfWowb5IK1LFBhQ UWllbhkQ9da/hKksLjILkd7xJB0d7/ADx0myygl/kGNMNg70XyiglBb96u1hVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135967; a=rsa-sha256; cv=none; b=c8HUZ0kMYqLRhWwPHQ9L46fAZgJsyrx/bC2uUiwEwzh/TmgpkNkLaodaCqc8C8267seox9 NywZUVQqkc/Z8vTdr4x6le2wTy/hYcw9P/iphdBq70RxXhmB0aY0dvJNl3AVhrF9CyUhR4 DSzYGPfJzMQrSKzhiFbsRuXOxEWiyBrVgtDxtxjl+3v2P54LWsuHGYGKyYz1cfRhsnokwx KZyNtumdwQYgTpP0xH/xROL79rmptDdVtDGOVl4WW4w+4jwPDvYcf/llR6mvhHy/6pwZkR Swh7WAWmQWs6bJwacCeL8q8gftUiydN8XH5sCfzY+M72fdRExs/DO2mOnh+k9Q== 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 4dXhnC2Cc6z1Gwk for ; Fri, 19 Dec 2025 09:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d6e0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: c4b315440f6e - stable/14 - mdo.1: Document group-related and fine-grained control functionalities 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4b315440f6ea7031a4aabd2273419e042848f98 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:27 +0000 Message-Id: <6945189f.3d6e0.d4ab6cb@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c4b315440f6ea7031a4aabd2273419e042848f98 commit c4b315440f6ea7031a4aabd2273419e042848f98 Author: Olivier Certner AuthorDate: 2025-09-01 15:24:54 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:49 +0000 mdo.1: Document group-related and fine-grained control functionalities This is a manual page update describing the functionality that was added to mdo(1) in commit 3ca1e69028ac ("mdo(1): Add support and shortcuts for fully specifying users and groups"). Please either refer to that commit or the new manual page's content for more information. While here: - Add to the introduction a description of process credentials and some specific vocabulary that is used throughout the page, as well as the relationship between mdo(1) and mac_do(4). - Update the HISTORY section. - Add AUTHORS and SECURITY CONSIDERATIONS sections. Reviewed by: ziaee MFC after: 1 minute Sponsored by: The FreeBSD Foundation Sponsored by: Google LLC (GSoC 2025) Co-authored-by: Kushagra Srivastava Differential Revision: https://reviews.freebsd.org/D53905 (cherry picked from commit 73dd00f2fd7de2a5d8dda8fa25ebcd7c8964ff52) --- usr.bin/mdo/mdo.1 | 269 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 245 insertions(+), 24 deletions(-) diff --git a/usr.bin/mdo/mdo.1 b/usr.bin/mdo/mdo.1 index c4586f628661..1de694c69e40 100644 --- a/usr.bin/mdo/mdo.1 +++ b/usr.bin/mdo/mdo.1 @@ -1,49 +1,270 @@ .\"- -.\" Copyright(c) 2024 Baptiste Daroussin -.\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 26, 2025 +.\" Copyright (c) 2024 Baptiste Daroussin +.\" Copyright (c) 2025 Kushagra Srivastava +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Olivier Certner +.\" at Kumacom SARL under sponsorship from the FreeBSD +.\" Foundation. +.\" +.Dd November 26, 2025 .Dt MDO 1 .Os .Sh NAME .Nm mdo -.Nd execute commands as another user +.Nd execute commands with specific credentials .Sh SYNOPSIS .Nm -.Op Fl u Ar username +.Op Fl u Ar user | Fl k .Op Fl i -.Op command Op args +.Op Fl g Ar group +.Op Fl G Ar group1,group2,... +.Op Fl s Ar groups_mod1,groups_mod2,... +.Op Fl h +.Op Fl -ruid Ar user +.Op Fl -svuid Ar user +.Op Fl -euid Ar user +.Op Fl -rgid Ar group +.Op Fl -svgid Ar group +.Op Fl -egid Ar group +.Op -- +.Op Ar command Op Ar args ... .Sh DESCRIPTION The .Nm -utility executes the specified +utility executes the passed .Ar command -as user -.Ar username . -.Pp -If no -.Ar username -is provided it defaults to the -.Va root -user. -If no +with the requested process credentials or, if no .Ar command -is specified, it will execute the shell specified as -.Va SHELL -environnement variable, falling back on -.Pa /bin/sh . +was specified, the program whose path is the value of the +.Ev SHELL +environment variable or +.Pa /bin/sh +if that variable is unset. +The calling user must either be the superuser +.Pq effective user ID of 0 +or the credentials transition from the caller's to the requested ones must be +authorized by a MAC module such as +.Xr mac_do 4 . +The target process credentials are applied atomically using +.Xr setcred 2 . .Pp +Process credentials comprise the real, effective and saved user IDs, the real, +effective and saved group IDs, hereby called the +.Dq primary +groups, and the supplementary groups as a set of group IDs. +Below, the +.Dq user +phrase implies that the real, effective and saved user IDs all have or are going +to be set to the same value. The +.Dq primary group +phrase is used similarly with respect to primary groups. +.Pp +The target process credentials have to be fully specified, either explicitly by +listing all attributes and their requested values, or indirectly by establishing +a baseline that provides a default value for each attribute, which can then be +amended by additional options. +.Pp +Possible baselines are either the full set of credentials established at login +for a specific named user, the current credentials, or the current credentials' +primary and supplementary groups which implies some user is specified +explicitly. +They are respectively established by using either option +.Fl u +with a named user argument, option +.Fl k , +or option .Fl i -option can be used to only call -.Fn setuid -and keep the group from the calling user. +in conjunction with +.Fl u +or no other options. +If no other option than +.Fl i +appears, a default of +.Fl u Cm root +is implied. +.Pp +The primary group can be set or amended with option +.Fl g , +whereas the supplementary groups can be either fully replaced with an explicit +list using option +.Fl G +or amended through set-like operations with option +.Fl s . +.Pp +Any of the individual real, effective and saved user and group IDs can be +overridden separately if desired through the options +.Fl -ruid , +.Fl -euid , +and +.Fl -svuid +for users, and +.Fl -rgid , +.Fl -egid , +and +.Fl -svgid +for groups respectively. +.Pp +The options are: +.Bl -tag -width indent +.It Fl -euid Ar user +Override the effective user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -egid Ar group +Override the effective group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl G Ar group1,group2,... +Set or replace the full set of supplementary groups. +As for +.Fl g , +groups can be specified by name or numerical ID. +Groups must be separated by commas, and spaces around commas are not allowed. +.It Fl g Ar group +Set or amend the primary group. +.Ar group +may be the name of a group in the group database, else will be interpreted as +a numerical group ID. +.It Fl h +Display usage information and exit. +.It Fl i +Uses the current credentials' primary and supplementary groups as the baseline. +If no other option is present, the target user is assumed to be +.Dq root . +Otherwise, +.Fl u +or +.Fl k +must be specified. +.It Fl k +Use the current credentials as the baseline. +Incompatible with +.Fl u . +Implies +.Fl i . +.It Fl -ruid Ar user +Override the real user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -rgid Ar group +Override the real group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl s Ar groups_mod1,groups_mod2,... +Incrementally modify the supplementary groups set. +The argument is a comma-separated list of directives: +.Bl -tag -width indent -compact +.It Cm @ +Reset the set to the empty set. +When present, must be the first directive. +.It Cm + Ns Ar group +Include a group. +.It Cm - Ns Ar group +Exclude a group. +.El +If +.Fl G +is also specified, +.Fl s +applies on the list installed by it. +In this case, the +.Cm @ +directive cannot be used +.Pq this limitation may be lifted in the future . +.It Fl -svuid Ar user +Override the saved user. +As for +.Fl u , +.Ar user +may either be a name or a numerical ID. +.It Fl -svgid Ar group +Override the saved group. +As for +.Fl g , +.Ar group +may either be a name or a numerical ID. +.It Fl u Ar user +Specify a target user. +If +.Ar user +is the name of some user in the user database, +this option establishes his full login credentials, as specified by the user and +group databases, as the baseline. +Else, +.Ar user +is interpreted as a numerical user ID, and that ID is used to set the target +user only. +.El +.Sh EXAMPLES +Run a command as another user: +.Bd -literal -offset indent +mdo -u alice id +.Ed +.Pp +Run with explicit primary and supplementary groups: +.Bd -literal -offset indent +mdo -u 1001 -g wheel -G staff,operator /bin/sh +.Ed +.Pp +Modify only supplementary groups for the current user: +.Bd -literal -offset indent +mdo -k -s +wheel,+operator /usr/bin/id +.Ed +.Pp +Emulate the effect of a set-user-ID bit on the process image file, assuming its +user ID is +.Dq root : +.Bd -literal -offset indent +mdo -k --euid root --svuid root id +.Ed .Sh SEE ALSO .Xr su 1 , +.Xr setcred 2 , .Xr mac_do 4 .Sh HISTORY The .Nm -command appeared in +command first appeared in .Fx 14.2 . +.Pp +Support for specifying or amending groups, group-only transitions and +fine-grained control of real, effective and saved variants of user and primary +group first appeared in +.Fx 15.0 . +.Sh AUTHORS +The +.Nm +program was originally created by +.An -nosplit +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org . +It was modified to use the +.Xr setcred 2 +system call by +.An Olivier Certner Aq Mt olce@FreeBSD.org , +who designed the group-related and fine-grained-control-of-target-credentials +functionalities and supervised +.An Kushagra Srivastava Aq Mt kushagra1403@gmail.com +to add them during Google Summer of Code 2025. +.Sh SECURITY CONSIDERATIONS +The +.Nm +program is geared to role-based scenarios. +Consequently, it does not ask for any password or request other form of +authentication before trying to establish new credentials, instead relying +solely on the requester's credentials for this purpose. +.Pp +Specific unprivileged uses may be enabled by using the +.Xr mac_do 4 +security policy. From nobody Fri Dec 19 09:19:26 2025 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 4dXhnB4XSjz6LBWk for ; Fri, 19 Dec 2025 09:19:26 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhnB1dcYz44wK for ; Fri, 19 Dec 2025 09:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6PV7EkkjyP3vrviwGuB05CiYnbeGhem+0VCLdem3cNQ=; b=sumCXm2wuEpGAX0KNlrAvffPmVprrS8lHFfghY/lNc9BC37T3r8eNuSQtEhb/CuE4Q/oMn vEgj7OezpxB9GE4s4EJSfRur/BcFdzs0aN/3Elkw+aqbCvu8FdKdSNp/0hNFjEDaW2DqFK nHxx34JCRV3tRFZ0lss+IGXBRKhP+2rqRoU0Vo/ZX+XJcIfEPR2/7tawDI71R6/2CaragT suWak3yXcCbLt/Iui2YW6RNKz14bXES8n/ZTBQap2X5v97hRStLFtj25l9T7LF7Suc626J CWd8vEnX2qzygpAX9jCXLYHW5z0M6vyPGhUwZ2AWDnommLIZf5JoThQhV0X+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6PV7EkkjyP3vrviwGuB05CiYnbeGhem+0VCLdem3cNQ=; b=wZ5RRbojhYM9b/i3yS9EejaQlgcV0QkrMz/J3MXL2smTebGV57GFqqMf7UdcFC0vWw2Vvf MRlOxcpWeLpOCMu1icbwiA2UuHtDeHeUJuYShM8QoZcmiPsxABZ514mvBXl3arKHswIQRp urJYmnCGVQRPdQ7ajgleVZjFWXzUomBevHoUDb1U6DGIOpCJ5UqQ6yuaobsZlgW1vwouCL WOe9vwHOp2Z1juv7ITmLXergpng3baS9IcSG/6asXEtJZVkBlZllXQVNjk+SyazW9KaZvg jd5Y3ALXvjBPOKhUKNg9wfS+4p7Mk222tIGhPbvIcHWwUNaM26vZpfNNSKWXmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135966; a=rsa-sha256; cv=none; b=dGkXB4G6sMRuxeUhd8iXDYR+pb0nXgJygzbJaxha4o9Pp+8VOW2brTXk0G4g/P119G2Jpv WhjjHUkmIrZmpcIJXEsaRijzJewA7CTxeAlsh4BYcaXCC7m3+V+dox4ET1zOD9HFItI+VJ hyMpRwpTWxVujMu6htY2FIe67/BRqQUp07I1P92pW0QtW7A/bpC08TLiyItxe5de02c5rD hWWGusGIBkimxPTsR6r+T3xqWOQHgDE0e6A7gxTNfIHd0FQosyK74sDZN0864YLIKkXXtV z1DnibUIHlruRiSTA4wBTClkCD7ZoFtCSDPN1XId3/5n39ugm2Em7MVBYZJSEg== 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 4dXhnB19WDz1Gwj for ; Fri, 19 Dec 2025 09:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f192 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Tom Hukins From: Olivier Certner Subject: git: b7c5f19e0faf - stable/14 - mdo.1: Describe this command's history 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b7c5f19e0fafc8561fe9368ce0477bdcc536a9db Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:26 +0000 Message-Id: <6945189e.3f192.61256507@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b7c5f19e0fafc8561fe9368ce0477bdcc536a9db commit b7c5f19e0fafc8561fe9368ce0477bdcc536a9db Author: Tom Hukins AuthorDate: 2025-05-26 17:07:18 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:49 +0000 mdo.1: Describe this command's history Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1712 (cherry picked from commit a27c25625ddc7dc26185282dd6416a8f584bf55d) --- usr.bin/mdo/mdo.1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/mdo/mdo.1 b/usr.bin/mdo/mdo.1 index ae89481ddb2b..c4586f628661 100644 --- a/usr.bin/mdo/mdo.1 +++ b/usr.bin/mdo/mdo.1 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 22, 2024 +.Dd May 26, 2025 .Dt MDO 1 .Os .Sh NAME @@ -42,3 +42,8 @@ and keep the group from the calling user. .Sh SEE ALSO .Xr su 1 , .Xr mac_do 4 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 14.2 . From nobody Fri Dec 19 09:19:28 2025 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 4dXhnF1SJ4z6LBPF for ; Fri, 19 Dec 2025 09:19:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXhnD3Vlqz4527 for ; Fri, 19 Dec 2025 09:19:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135968; 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=WmosCRQOq7/wvCZ8P3llSl6wQ32Ub6YckgLuArzHGos=; b=q2ZzapFmoDeOXuIiNSfjN3y33S5W09IzvlDF+qAP7YOtZC8jjmDotLk4pdTZJ2UDSSsxHG qcPa5P1p0DK/NKeejgOAyeYIAMlg/ALeCJLZ0iMiNoMW0AeTfY/3AfVQD5rIu/hGx8MPdg 4S27lF6H5bbWMUIDPSQdbp/RzVWvxXKe7qNVv/tkXs599g5V9OMQ1gZI1IRCZyopgAFGYh ncNQfKt2PtoKHeju7sr3HaBD8ny722VTFk5zhTkXDdpSvLLbg0jvhaqobb1Zdpj5wyXwIY XETy4OUyrByv6k+BdF64+DO0MzwJtHZwbdoY4m7ZW27Rro1FnV/2WrU+mL4+Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766135968; 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=WmosCRQOq7/wvCZ8P3llSl6wQ32Ub6YckgLuArzHGos=; b=t9AA+m94oUdIxlMwNoaR6RzkqnTmdWdpsAQoyPX9cvV1douchDRFwCGFU/+RT3790woJKk nqwUkCBAjabCtiGcK/yw2btAV0imVt2VhQ47edSn5UUaHe0VyjubOF9E+dM36Blycj/Ua2 nzToY23IBTmgmuYLtJB1huZ+oETRMYtzsWnXXv4pSm3dycF3YiMFcVoBudjpDOfXzS+VjU aH8JmL314N4IEOXL31bRDUbAFQHlTECFkqBg8iJ11OyOjzAK2zoVrM1LfIF8JnoXE5y3Ca X8++r/wJDlRDqgWXPg6fbwXPGdgmxLBhZvPvXzyBh0hcKn7Esxfz5/WriRUvag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766135968; a=rsa-sha256; cv=none; b=VI/4WWMOsqgv7NOb76PiXwl9ig8om6su8XwI2DOB5CpitKgkebq4qXHNrnYS25Cje3A6YR R1IPeLiVb6NP/egybl7RqG4sPYG/WGCA26vPRH/Z6EXv+lIavdT2lrEsvZH/HAJaXzBySV BKwRUbdp1/Kej5B0WUdvmDM/nkMarijRNVx4wxYBD3DuCxLTYF+BEpQMkS8mVZt0QeDR+2 jPQL/hUPWZB+64fxqdoFfJ1IYTs+zyoeBfw1ttmJQLiGqXkpkqb3mcETsT8dRemNLMDNMz RpNKpKH3NTcn/7u7CeDVXuXV1jnXGO2dx4S38AMBOyJXZ3Y7nirCt6VFl/+p1Q== 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 4dXhnD3189z1Gwl for ; Fri, 19 Dec 2025 09:19:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dd58 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 09:19:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1a5539989e04 - stable/14 - exports.5: Typo: "auomatically" => "automatically" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a5539989e04a4ec03ad8787368858de4a2ae097 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 09:19:28 +0000 Message-Id: <694518a0.3dd58.32e8a666@gitrepo.freebsd.org> The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1a5539989e04a4ec03ad8787368858de4a2ae097 commit 1a5539989e04a4ec03ad8787368858de4a2ae097 Author: Olivier Certner AuthorDate: 2025-11-27 20:27:14 +0000 Commit: Olivier Certner CommitDate: 2025-12-19 09:16:49 +0000 exports.5: Typo: "auomatically" => "automatically" Fixes: 9d975e47d5a3 ("exports.5: Clarify that exported dirs should be local mount points") MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 7521dc5dce35159add70003340e1555456721a2d) --- usr.sbin/mountd/exports.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index 4c8e90635cb2..bf45b1292f60 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -85,7 +85,7 @@ As such, to avoid confusion with respect to what is exported, it may be prudent to limit exported directories to server local file system mount points. When exporting ZFS datasets with the .Sy sharenfs -property, this is auomatically the case. +property, this is automatically the case. If the .Fl alldirs flag is specified and From nobody Fri Dec 19 15:03:30 2025 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 4dXrQC6Fbdz6LqmR; Fri, 19 Dec 2025 15:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXrQC5Z3lz3TZ2; Fri, 19 Dec 2025 15:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766156611; 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=evL+vSCaAhhGR8g8CdreWiJb8RHe+NtKc+h5WPuCxy4=; b=MI+AQ9/u+RGzBMFDjrRTGOz8eBrNw0cvc48ESvwzrmACae2RQBHytAosJ+bxCQwQHNO30i +kL5oNbyFjQ7RDahLWLfR+LirwLu5Zk45Y22p+axqF90iTvt8SCxg73JWUclA9LkBVUXe1 /wMbjzIcSC4n3jocf2EOE+5pE1ab81dHzRfs7W8nwP+m6uRi/HjzPJZD4+NQLVR1RhEyNa WkMA5plY89fjCTDyUVdmlw7uXUMMlgVA1cGRyRYWgHhenLziD0BBxe46XD0JGqQi1ZyYDN ercTlGIwt+fZGW86q20wFbA8caFh0c9sTlX61uM2bc6Iw6oWK43TDszSunNalg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766156611; 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=evL+vSCaAhhGR8g8CdreWiJb8RHe+NtKc+h5WPuCxy4=; b=Y895ZR3qG/S/ef1zCkooE8ooaLK7uYuAm4d2s+8G1nKJ5Go6f1wWuHtwVIF0cqA6He3FGO ZgEG/dNDADk9OtrlYIb45Gak5rcwSmCWOyISRZrdQpQVDM69KX+ggybT3XBcnlQore2T+I OOHrF7di1q6QoCkpeA3aoCUUOXsIEVyM2FRHMICafm3QpESDjNhzC+rkQTXvxNTJprLBZQ RRGNCn2RDJUt7QHVlkUIJ2R617MHg3TpCVnnDqdrnYxxj/iDaJGXRRi4CpaqRl2fb+XXlG u6h1AMbcms7idXipPO1l5KDVj/SkVhg7Pef+bB3qUlci0lW5450ATBNsFYPUqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766156611; a=rsa-sha256; cv=none; b=cOUf5TxLj5WEDoP1H/TKqy3KTrVU3iYu4g2DIFsKePSyHeICGv1Qcqml+JjLW6476LOmt2 ND9EhgXSktIWcULNeDk4rvu5vQls4/YItZ+5feyly2vYxABDoIDnlTbPphSZuPX66xyfCS gSSSArZCsMW/vjYEQxVDYFs6JIZUsw/bAx/IwpApJfkYV8OQIiNoVc5d6Akc49kv0B8bVd 4f1nPEGPqN5Hq3nPQwbNhrFB973vv0IjkjDzgRf5Wf2vlwq/Opb3mEqdJtbesjvogrjHJB 11vrl59ixvVeOlutnyEpWEh64WdKIHnfkjsTKSAdoG4zyV9r91Jkv+Q5pOMkVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4202:5670:b8b0:391f:8f24:36b0] (unknown [IPv6:2601:5c0:4202:5670:b8b0:391f:8f24:36b0]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dXrQC3Sc3zmYW; Fri, 19 Dec 2025 15:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 19 Dec 2025 10:03:30 -0500 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 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: c19688407a2c - stable/14 - sys: Bump 32-bit kernel removal to 16.0 Content-Language: en-US To: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <6944bd2d.38bc9.2fb455e8@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <6944bd2d.38bc9.2fb455e8@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/18/25 21:49, Ed Maste wrote: > The branch stable/14 has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c19688407a2c797e74762aebd90c1f1cc70ab726 > > commit c19688407a2c797e74762aebd90c1f1cc70ab726 > Author: Ed Maste > AuthorDate: 2025-10-24 18:28:56 +0000 > Commit: Ed Maste > CommitDate: 2025-12-19 02:48:41 +0000 > > sys: Bump 32-bit kernel removal to 16.0 > > We are shipping at least one 32-bit kernel in FreeBSD 15.0 (i.e., > armv7). Hmm, I don't know that this is the best for stable/14. This means that 14.4 i386 and 32-bit powerpc kernels will now claim to be supported in 15.0 in the dmesg warning. -- John Baldwin From nobody Fri Dec 19 15:32:10 2025 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 4dXs3G5wkJz6LtM1 for ; Fri, 19 Dec 2025 15:32:10 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3G46xtz3YxS for ; Fri, 19 Dec 2025 15:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158330; 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=eiHCSwJsrrpOK4HKBej5Kr73y9m96ydhvVzZ4HZA86Q=; b=YImmNYcvsk4N0/8zK9O1nMVLS3Rz06TiGZGn6U4LPavEEMujExuQxY//DlATpK66puRBHZ HVmFQSz/EdnneqHySMAuByXA7dSUknfeO9kNvvAl16AwgVN7tXbypsyGMkc/QjXzggJoqs IpZzqFFCLuj6crGsZgn/9osAVDAfGKYRcZLV9JcmUAuZ4RhGF9Yn4mm+H6XgKl9c/3In2i oPwJOGmGJwPrIPOx+Q+gkqwea/wHU5kDHcbG017MhOlLFt2+c4mH1j5IlM5Urn7nZraP55 Rvz/QwJfTFsqQaucxVI4yrN0zUuP0SdmQRpDe+VrwINSxIRpfqAkwurfJL/eLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158330; 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=eiHCSwJsrrpOK4HKBej5Kr73y9m96ydhvVzZ4HZA86Q=; b=yz/9m4Vp9qzUnKIk2dH3JinSH1iYCgvi5pKT3fsCixe49kfEsyCPOEOvfiw4xuk8ft44vz i/U6rK7Ia1pg8vz2wCGQxZEg6WxwSBhthz4mslO8uUcLxYUALE/dKnta8xFyt4URgbubkl soIBQpRbLTBrnKE7doMJKyE+RN03AXr/vB5q5Ad2qZuW5w5SsNKszqdhTP+y/JYwxctN9g MZuCvjHXxoW/98CFU92g7QCNnWRr7D+K24BwQZrE2A89ws7i8tod2ofBh1/Ex/Ye1S5S0F NIaCMg2jJvjAl+ID73ENxcXlZiuS58U89EPmaz0ReVkduwAi1dKKpGYGgHTPgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158330; a=rsa-sha256; cv=none; b=b3UqpWEJhOWA/IFydCpeUlOVrfgGRyjVu15DJCUc3ZrK1AvwoariFtA4mOUwOYJwF9l4z1 8+o5hz+ObMxbzHNbddpBouktyoYhNbV8deQ16WRUehrye3mF7pIqQvu2cLIXFZp252PnWV +6y4whxb664p17L2b1IHnQ6vGDX3+xSxBr+swM/r5PCZbod24JoQZOKuAyhMgHypC1NCPp zLpNUQQWu5N8AUTKc32vm3InBRZE6Q0XoNxoqRuDgebzCCuaWAmPjj3BAOixtzZuL2zUNP GldCFjuT8OzdrCMxNTT+5kWg0dYLgqJAH9EJ0kUOmTVvw0gkCkXO6oq7HBei/g== 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 4dXs3G3kB3z36 for ; Fri, 19 Dec 2025 15:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44990 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c512446400fa - stable/15 - thread0: Stop calling thread0 "swapper" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c512446400fab8c650225704ef9f31b19270fadb Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:10 +0000 Message-Id: <69456ffa.44990.7432bf45@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c512446400fab8c650225704ef9f31b19270fadb commit c512446400fab8c650225704ef9f31b19270fadb Author: John Baldwin AuthorDate: 2025-12-04 19:52:59 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 thread0: Stop calling thread0 "swapper" Just leave it as "kernel". While here, replace "parked" with "-" (the typical wait channel for idle threads). Reviewed by: olce, kib, markj Differential Revision: https://reviews.freebsd.org/D54039 (cherry picked from commit 431b3b224db2a69d09c359ce1cfb37ba3da4705c) --- sys/kern/init_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 6612ac685936..a2898f75a795 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -336,7 +336,7 @@ mi_startup(void) * the need arises. */ for (;;) - tsleep(__builtin_frame_address(0), PNOLOCK, "parked", 0); + tsleep(__builtin_frame_address(0), PNOLOCK, "-", 0); } static void @@ -486,7 +486,7 @@ proc0_init(void *dummy __unused) schedinit(); /* scheduler gets its house in order */ /* - * Create process 0 (the swapper). + * Create process 0. */ LIST_INSERT_HEAD(&allproc, p, p_list); LIST_INSERT_HEAD(PIDHASH(0), p, p_hash); @@ -531,7 +531,7 @@ proc0_init(void *dummy __unused) LIST_INIT(&p->p_reaplist); strncpy(p->p_comm, "kernel", sizeof (p->p_comm)); - strncpy(td->td_name, "swapper", sizeof (td->td_name)); + strncpy(td->td_name, "kernel", sizeof (td->td_name)); callout_init_mtx(&p->p_itcallout, &p->p_mtx, 0); callout_init_mtx(&p->p_limco, &p->p_mtx, 0); From nobody Fri Dec 19 15:32:11 2025 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 4dXs3J1L7hz6LtK5 for ; Fri, 19 Dec 2025 15:32:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3H5Nrvz3YxV for ; Fri, 19 Dec 2025 15:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158331; 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=Mcy7k6C760WA4mUsXkW90qwuqg/rkfM8ptg05y3aod0=; b=XIqQPzRtcOQewQRDRTKAEtkPkyJmeY/24ySFHHwTw0VwFH5WdZojK9YYLb6VhxhqRaS51/ EJ4+Ef2zkCZ+awCHVrmPGzX9wxOTInDWjL1Z9nXaAt5ujGVx3eo+RxUtWNi7E0Ens6MqTq PgkAH2DX97OMOnToOoqw3OP/y0We2ORosvooYoQDJB9uYhPtrpdD73sSK4ve6dA8cSwGeh WAmDHeXCRyqRR97Kds9Xe6Nlj6S+K4NsyL0NNlcThBtfr2Swrih+lOG4JR+9xR/UitXZ4u 7bI6bMoqJ84AOUp09Fivosy91LDM/zZtjaYBFhnqBhCKgruX7WqXGuzLVKJ1fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158331; 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=Mcy7k6C760WA4mUsXkW90qwuqg/rkfM8ptg05y3aod0=; b=G/vywuD4bCAbMGOpDZ8I8mw48xoynwXfz6D1tkUOAl2zhbfjijYVSGT3e3Tn009Rm1PAQ0 O/JmggZDfQHgaz6wERkzzVp4SKmXyJvgIFlZlRmZH9f5Lf+s3hft6+eVFrxIYaDnxVfqNG cfdGhs7y9y+laNKUvniuRWNM/IdwXC0mBVwHJUrkKV+4rejM3dFAzMjJpwUnoooy8m/e4q ZL4VriTprUpF/5MI/Mb5hK1gM3H8qfvCtvYRkhdOk2H9hEtzueMYszZju2zn/+9blX3yKi sUvlEx7mvyAQOsV8MA9ddcbQM4dDAubNLlfgfdLnIxPhuuuJPOYhFZg+TuExww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158331; a=rsa-sha256; cv=none; b=FOrrwQnQl7EJ4flTnp02itgmnp9P7ZmJFFEHbtDopOIC0mud95X0br8IwsCG/1nknNey72 rKRU5q7NzDDdy/kbGpwmCiIpy6bd2HBnUcw6p7QhhpCtPLP7/Dzp5OnZn+qQhq3qsYE9gO kpfvtvQf6qZGi/0ORPcaC6BBu3u+geiDBDXp9TkyFSSwMCX5lmBVcEAf7xRE/6SN1tzvyZ 2eTuyusgbn4Vce+yUBoRZ8TIinMcdqdG4JmOAszbWDItZINkqOH1GHf+aqrLqtL1R2fW6O i6qxzpOr1vlKCQmcnGXPr9SJJuQPUYQvDMMWthlhqRiBg1wXBpP2RTMO+hDztg== 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 4dXs3H4hjjzDl for ; Fri, 19 Dec 2025 15:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44704 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6cafc75b3930 - stable/15 - sys: Remove/update references to the swapper process in various comments 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6cafc75b3930753c611c0ad86a00305bf3d202b2 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:11 +0000 Message-Id: <69456ffb.44704.515cf224@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6cafc75b3930753c611c0ad86a00305bf3d202b2 commit 6cafc75b3930753c611c0ad86a00305bf3d202b2 Author: John Baldwin AuthorDate: 2025-12-04 19:52:59 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 sys: Remove/update references to the swapper process in various comments Reviewed by: olce, markj Differential Revision: https://reviews.freebsd.org/D54051 (cherry picked from commit f6910b09a2302df9b3b1666deb89037c831a4e4c) --- sys/arm/arm/pmap-v6.c | 2 +- sys/i386/i386/pmap.c | 2 +- sys/sys/proc.h | 2 +- sys/sys/sleepqueue.h | 5 +---- sys/vm/vnode_pager.c | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 78883296c5b7..ff36ec974221 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2158,7 +2158,7 @@ SYSCTL_PROC(_vm, OID_AUTO, kvm_free, ***********************************************/ /* - * Initialize the pmap for the swapper process. + * Initialize the pmap for proc0. */ void pmap_pinit0(pmap_t pmap) diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index b44f5e08bbcf..b6c2fcb99393 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -2026,7 +2026,7 @@ pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t mpte) } /* - * Initialize the pmap for the swapper process. + * Initialize the pmap for proc0. */ static void __CONCAT(PMTYPE, pinit0)(pmap_t pmap) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 9140cee56885..81f0d41d6a6f 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1081,7 +1081,7 @@ extern int allproc_gen; extern struct sx proctree_lock; extern struct mtx ppeers_lock; extern struct mtx procid_lock; -extern struct proc proc0; /* Process slot for swapper. */ +extern struct proc proc0; /* Initial kernel process. */ extern struct thread0_storage thread0_st; /* Primary thread in proc0. */ #define thread0 (thread0_st.t0st_thread) extern struct vmspace vmspace0; /* VM space for proc0. */ diff --git a/sys/sys/sleepqueue.h b/sys/sys/sleepqueue.h index f28a7f75a50c..25b345f46a81 100644 --- a/sys/sys/sleepqueue.h +++ b/sys/sys/sleepqueue.h @@ -54,10 +54,7 @@ * be removed from a specified sleep queue using the sleepq_remove() * function. Note that the sleep queue chain must first be locked via * sleepq_lock() before calling sleepq_abort(), sleepq_broadcast(), or - * sleepq_signal(). These routines each return a boolean that will be true - * if at least one swapped-out thread was resumed. In that case, the caller - * is responsible for waking up the swapper by calling kick_proc0() after - * releasing the sleep queue chain lock. + * sleepq_signal(). * * Each thread allocates a sleep queue at thread creation via sleepq_alloc() * and releases it at thread destruction via sleepq_free(). Note that diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 244aa31ea703..9693cb15f80d 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1264,7 +1264,7 @@ vnode_pager_putpages(vm_object_t object, vm_page_t *m, int count, * Force synchronous operation if we are extremely low on memory * to prevent a low-memory deadlock. VOP operations often need to * allocate more memory to initiate the I/O ( i.e. do a BMAP - * operation ). The swapper handles the case by limiting the amount + * operation ). The swap pager handles the case by limiting the amount * of asynchronous I/O, but that sort of solution doesn't scale well * for the vnode pager without a lot of work. * From nobody Fri Dec 19 15:32:12 2025 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 4dXs3K1293z6LtFZ for ; Fri, 19 Dec 2025 15:32:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3J626sz3YxZ for ; Fri, 19 Dec 2025 15:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158332; 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=RNXgqb9So5xJjJ9gFcotrW1stasZVQbN3O16WtWfKQw=; b=nBxfWuAS9r5TWKiFHgG8hhunJR5yd51thWhPEOdA53+xj3L7DEUt7FY47v77C2cFzdkU/9 nnClHrb4+LFNdaC+TZGkM5wsipuv40IrDDMdJ6hqEfkb9ZRMid7GnAJ2eXsdfnXEidKBRc UVyyQBJZp6YIE/h2vMnU09vSEy8wQkOxBD6QIAtCgTgiI9w8gaL5keJE/jT19pbvflU/aI 89n3Kv0roFaVQ4EaOTKPIpweBSCn0OIiSLOpUQ4HWlK2K6x5mfvYIuk0s25FVcgGYM0df8 wYpkbDs9Ox6mfZhSabl65mJTzDNTLohHkEElGzPkB0053MJZ8o1rETxyrpx5NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158332; 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=RNXgqb9So5xJjJ9gFcotrW1stasZVQbN3O16WtWfKQw=; b=temINZf0G9+pzhM+s4gCG976PSVTmmdi03zKb6fmoqNET3gzXPLS2cVVQl1Utg+eXLFOD2 hopC92rkYlS8HWJBOn9sdr8mHUUvTIJupRFf/7jn4VitB0bFtaunV0VhvCQYE7ug2N8ia2 rQytUdA0Ly8n/ysy4PxrTfLdI7s6CdkxCWLYlbejdLN6dmG6bA+vdSGAZo4WruYFmpaKiN f7s6l9fXgV+mpz3/vU0QhRhpEmHxZ/skV+NFXaP83eC4iMYQjJTri2KZmBCc4hUkEwXX+F 9a0T3xKQCCy0VKe5FEMMk8wOsCkaWGUzolaXuMV2agJGotwq7g6r4kkOCifFWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158332; a=rsa-sha256; cv=none; b=yatjqBg0FHfNPHs/jApGBj2u7CE+nJFE4TGX6PnRxAfCY1z7mL4VTUOIB0aQMSqbpwDzQp hr7XKJH7GhqcOV0SE6m2u7pnVnpEd7VzzqGHHz0Gxyh/dfCroht+cu8MNEzAIsZrfspy/f SwY3d74BhYn18G/pWcf7lgBnHudyD0ccOm55Y1D7KNPFP3ZbaXGeipJcsu2e5jO8H1kD0l 8dgkxN7Sc78DP844utypQA1tBp3zCRaPkYsYzXyRVMbH6nQdH79U+PCd6BZQsQhkjD2EsR NPeCmwkN/oYv6oscD/xBpMGf/oTwh9IW+BzqFSsF7Ow2jBhIObdTSMiO+UdL5Q== 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 4dXs3J5WHgz1S6V for ; Fri, 19 Dec 2025 15:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44a83 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b35c6373910a - stable/15 - ruxreset: Add an inline function to reset all the stats in rusage_ext 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b35c6373910aef21bd01f7b52b4b58bd85ed306d Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:12 +0000 Message-Id: <69456ffc.44a83.67a449b3@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b35c6373910aef21bd01f7b52b4b58bd85ed306d commit b35c6373910aef21bd01f7b52b4b58bd85ed306d Author: John Baldwin AuthorDate: 2025-12-08 16:15:20 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 ruxreset: Add an inline function to reset all the stats in rusage_ext Use it in proc0_post to reset per-process CPU usage. Suggested by: olce Reviewed by: olce, kib Differential Revision: https://reviews.freebsd.org/D54049 (cherry picked from commit 3f8ed605dbd0ee211ce8fe59c0c072b916d6311c) --- sys/kern/init_main.c | 5 +---- sys/sys/proc.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index a2898f75a795..3f3ebd386150 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -660,10 +660,7 @@ proc0_post(void *dummy __unused) microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ - p->p_rux.rux_runtime = 0; - p->p_rux.rux_uticks = 0; - p->p_rux.rux_sticks = 0; - p->p_rux.rux_iticks = 0; + ruxreset(&p->p_rux); PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 81f0d41d6a6f..5142f67d0a42 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1326,6 +1326,18 @@ td_get_sched(struct thread *td) return ((struct td_sched *)&td[1]); } +static __inline void +ruxreset(struct rusage_ext *rux) +{ + rux->rux_runtime = 0; + rux->rux_uticks = 0; + rux->rux_sticks = 0; + rux->rux_iticks = 0; + rux->rux_uu = 0; + rux->rux_su = 0; + rux->rux_tu = 0; +} + #define PROC_ID_PID 0 #define PROC_ID_GROUP 1 #define PROC_ID_SESSION 2 From nobody Fri Dec 19 15:32:13 2025 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 4dXs3L2JRXz6LtcM for ; Fri, 19 Dec 2025 15:32:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3K6YLNz3YmB for ; Fri, 19 Dec 2025 15:32:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158333; 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=0tKZ/VZo9jCH8QZkotCAaNZ4pwzKL+Jl4xrMnG2VZ70=; b=iAqvcVZrVFq4znKGm82J6R0vMPQhxEmZ5ZcFz3NVHviX4OQHdBykHKKXlmVXDYfN5RwPya dIYsZlED1qE02NmSeZBWOAKOqaZWkrLjUa1CeGnTMeZWMPXUnHIUoxbZxCQRZpg6q/M9t+ 9ZUNfrSqbFJg0Of8sbLETKPDr0mzaTeiKaFqxGgzglJR1HQ273jIOwCQfIXGHpbhWtkaNI Jj8QDwuFhymfAtl0lQLm7Yavt8SevAx20rF33WfrKcCBGbAn7/WstWz8CQcSXXOSuBdmKD dd5eXRVC8YQmmcXxkBR4a5HXIZ5EM+zMC1N2bn3jQ6YSR//tMP5Cikq3d+HeaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158333; 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=0tKZ/VZo9jCH8QZkotCAaNZ4pwzKL+Jl4xrMnG2VZ70=; b=HZvVrMCgfUqYPkGhEjN/7nOQFvmR22Z68iBcbkyNHYYEjs2VgBGK7UMeVVgcADVXfZUfRh 97M/e33YBc6Ljp3Y4qgTbvQXZBLEr8vjjtyrCfj3xr1xm9bIFt4mU4UNzwmw03jsUHn781 ETda+/kgQlvkm8Ycesn95DcJaAKZsmHSK2pSMIS3MK8iXD3l308A0VsxThCkiP1haB6xrd JQSAxrWi4Ky1XJNDj4F8VzOEE2KcXHkmdBKsw7309GJ7ATlsrNYtZwOhrktCXb29W64wd6 bSKkPt2VqzeYmGjCSxLU49FtKujAM+H2DG9DCnEXNPdi7/WqYJGt3n5RwG1Sgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158333; a=rsa-sha256; cv=none; b=uSiRF82OdGAR3hL0c4pIOQtqiP6YxWT41QchTfdv1j/PBaxtrLsuz88pW9jORWySGG/5kz U0NCfVg4Q5WLcsoskwP1OuiVL+1x8lxVpzWJX2EEAQ6NmVR4Ldq83qg0kTqEDcOfJNU/S/ uISboMpGHE7jdefcChbtn5orlFURG1CNEdBG9zokoBAF4Lmuo1IB53yjCN1sKOG+Ij5sZM 3wIyFGwDBTSItonsPHRo+e43mEkuTaiqoDno73ItvppAst74m84yhIdiN++11FxgkQuyEb zdcfFSR2CZAzwbVZsaAT528l77hL8VRbdL9qg7KN0ZFJIUavSuZc1UFlZu7NFA== 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 4dXs3K5sKxz1SMm for ; Fri, 19 Dec 2025 15:32:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 434d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ebb0e512d97e - stable/15 - thread0: Clear td_rux stats in proc0_post 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ebb0e512d97e4355832fdc162a7a036842acf817 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:13 +0000 Message-Id: <69456ffd.434d2.40ea224b@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ebb0e512d97e4355832fdc162a7a036842acf817 commit ebb0e512d97e4355832fdc162a7a036842acf817 Author: John Baldwin AuthorDate: 2025-12-08 16:15:36 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 thread0: Clear td_rux stats in proc0_post proc0_post aims to reset the CPU usage accounting for all threads and processes in the system to zero once the time of day is verified. However, not all of the per-thread stats were not being cleared, resulting in over-reported time for thread0 post-boot. Reviewed by: olce, kib, markj Fixes: bed4c5241663 ("Implement RUSAGE_THREAD. Add td_rux...") Differential Revision: https://reviews.freebsd.org/D54040 (cherry picked from commit dafe50ebd874ca3ccd5908c441cee9f478c501f0) --- sys/kern/init_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 3f3ebd386150..2f28a0cc800d 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -648,7 +648,8 @@ proc0_post(void *dummy __unused) /* * Now we can look at the time, having had a chance to verify the - * time from the filesystem. Pretend that proc0 started now. + * time from the filesystem. Pretend that all current threads + * started now. */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { @@ -661,10 +662,13 @@ proc0_post(void *dummy __unused) PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ ruxreset(&p->p_rux); - PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; + thread_lock(td); + ruxreset(&td->td_rux); + thread_unlock(td); } + PROC_STATUNLOCK(p); PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); From nobody Fri Dec 19 15:32:14 2025 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 4dXs3M66YMz6LthD for ; Fri, 19 Dec 2025 15:32:15 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3L73Mmz3Z1F for ; Fri, 19 Dec 2025 15:32:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158335; 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=mdHwqm1tquQ2r//3h5q9OipP1YNC2LK230cqkzZ0Mf8=; b=IBb77eUKENFenrd8xRDGID81JQ+izhR1odFWCePf8Xq/Q1BewUJ2s2j5fQnGf6I1PeqCxU Q6/b0QXRJfcQcC8pXEpKQnuG1CCLxtM1i1Bl+htrF0wYXiVZJET0TR77dFib2HqTMW+g9p Su74n5hCUKTt+cuSaFox0zSU96K/e8C45bdNcXNIGGwMomBu/PJyF5QtSfIqBR7RoXS/UB OxAGgvMSocjv3VeYin2e4hMmLubwkOd5kiCyWt4PQ7QyfabR9rHVb6dSIBK+SNd3UbAbtR sX17BcXL2/0CLikhn7Kzdx/zyM5LojiZ+lR78QUVhlLAx35VpeTdRzZkAEFHSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158335; 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=mdHwqm1tquQ2r//3h5q9OipP1YNC2LK230cqkzZ0Mf8=; b=WUqGsKCFaYldZ4DByZY46dwMsAsm6cjC6k7MEqYdcigoeQpAVvAunhMAuOzZBRgzN4r9St wFJMoJwNk5eLPWR9CZlVVt7qo/FxY2G1V40NCTsPoetUXVSRAfJsW/eME3t06SJoBOTz2Y D4DSORUfzNr+5UtgRuutkQamX3xKStkAabb7wEnYuc1drkiq4RH0pa5VH8OO4Ol6J524Vu +NycSTtaFWKvwaI951mbEFLyO0j4mo0O03LigBnb0pA9V9YprdZFPU6R2beeN7Q4byfwra 3XpdUiDZ3S5vA7x7XjYmgwp3uduEq/QNp/61ZbTVEYHWQTv4PayGkv5x/Z1cbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158335; a=rsa-sha256; cv=none; b=ofNd3Sv68fGtAwQ6fgFzHtESb/jzSVuPAeSkc5OqVL/jl5h7KARGEulTO3UjKxJ+jXLaqr opRMChPdLGZuYLT/GChu45kf8W45zmUzpFvdxjshnOYHTRZgllKvGRp/sSVlYWUe45woHR 4UX8FGwebqwB3srDtFaHFaDz8omCAWCEXw+bOHEegpm5giv1HzSypdBJStrxYK67GFslX9 ZaFAJn0lKWwuEeeBT50ricmvOVY4xIh79tLJZjv1Ig/oJmXI22gp/nfCcwuKPSFGRbq794 etFnXroLjj4giV5hWVDGISI3K1+8m46622RJnaCNXAJV1yzaOAX1hwj2D20PpQ== 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 4dXs3L6cf4z8s for ; Fri, 19 Dec 2025 15:32:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 433d1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c358d6c0f350 - stable/15 - proc0_post: Clear relevant thread stats directly 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c358d6c0f350b64dd721581d115a231d365a119b Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:14 +0000 Message-Id: <69456ffe.433d1.e6fc967@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c358d6c0f350b64dd721581d115a231d365a119b commit c358d6c0f350b64dd721581d115a231d365a119b Author: John Baldwin AuthorDate: 2025-12-08 16:15:52 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 proc0_post: Clear relevant thread stats directly rufetch() has several other effects besides clearing these per-thread stats most of which are explicitly discarded by the subsequent calls to ruxreset(). Just clear the relevant stats directly instead. Reviewed by: olce, kib, markj Differential Revision: https://reviews.freebsd.org/D54050 (cherry picked from commit acd02443a952b1f5412d35d03f081ad48bae34d7) --- sys/kern/init_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 2f28a0cc800d..48cc9c1d95c4 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -643,7 +643,6 @@ static void proc0_post(void *dummy __unused) { struct proc *p; - struct rusage ru; struct thread *td; /* @@ -660,11 +659,15 @@ proc0_post(void *dummy __unused) } microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); - rufetch(p, &ru); /* Clears thread stats */ ruxreset(&p->p_rux); FOREACH_THREAD_IN_PROC(p, td) { - td->td_runtime = 0; thread_lock(td); + td->td_incruntime = 0; + td->td_runtime = 0; + td->td_pticks = 0; + td->td_sticks = 0; + td->td_iticks = 0; + td->td_uticks = 0; ruxreset(&td->td_rux); thread_unlock(td); } From nobody Fri Dec 19 15:32:15 2025 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 4dXs3N52D3z6LtM5 for ; Fri, 19 Dec 2025 15:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3N0VMHz3Z3b for ; Fri, 19 Dec 2025 15:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158336; 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=gEkXAhjLvQ28fDvTGuQjByWAy3hdFqnSMPQx+8ycFrA=; b=rT0V0Czj4UtEW2Zd6Fw99eepM4yjcv74FPGUrLELdMOi5oVm7FcuGXuZq46jQFEl4erfOE Jrkv4+txa+Fokwvwa8UmSVgfXMzfiohARinjEBC4Jy3T5eF48MnKnm69w3TKELwkBlr6aA r6Ux/b6U/aj75eiQmyH6QzaYADsxyXs/Ora44woDd3efPJO7/mf1kFr17XtvXmTl34tXJA wZPU4cu/JFBnGyEDA9IwylJlZApXZpO7sJQobCcGqc9Fi3WpFU/7i672dUjSCqITc43ate usU7sfR09Rg4IomxHZ4Nm/VN+IX3XHJF7+Gqujmyp9tylae14fxhuJXcn0/2bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158336; 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=gEkXAhjLvQ28fDvTGuQjByWAy3hdFqnSMPQx+8ycFrA=; b=HgRb9m9brNgdp9qcvMjAiPCLeQ9DqehqTId+7mucfGJovkDDKSiCIA1/BYWDiUMXVowL/s hkzQeNiYATE8KlJunXhxsfAH2BuXqLKabFdBmXTU5hcgtwO9CSkoI6xAXTksQhp+4XGMSq DfGwTZYC0f4f+Pe4MvfL24cXcIBTbuCM/FKZDV16zC0ZSGzrr60C4LESWu1qg5ZgXlVUkq BhAhIUcJAdIP28VvUjqzZaiTlVQBeAw5XrUQmm+E6j7l91hWpoAPKgFO3EAMEDh0khr1Ht 9CjWP1EEWcjPX2K0N6EfyFnRmHkswURalW+WZ32x+BmIZ1xnkLezAHj2wPBdaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158336; a=rsa-sha256; cv=none; b=dlWgTw8EdjaV1OxCo7452gSi3O6GfX5R+NF4ul9Qk670op6XQP5q9t/qLMKzcKZgQRU5L2 YXTZiFfdwpHRSQKJVfbJBXZWMGDWG0vVLtP7hGFk34LDtZanCqwUtLFczUMENwm76rl2zK yZoPnVqAHDohVXHZLE8c34JbNSwOEUHZ9UDPtKEQHXunQE+eiaGnQiI4Bm+32twosSZ8D7 JyYPo40wHsn/yHsd96ZEd/nx+qZxBlc8N6coDtHa7uDo88pWpw+m4dPyDWvGOXXuNlWRm9 huPy8B1tluOLURZgF9mjMLtyfNlcuG6enM4wqKTB1FCO70SB2/Pz9TH+bpSIeQ== 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 4dXs3N03RFz39 for ; Fri, 19 Dec 2025 15:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 434d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 444d2f9e2152 - stable/15 - bsdinstall: Mount /dev and /packages after using the shell to partition disks 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 444d2f9e21521f5ff29f518a357a22a81c9d03d5 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:15 +0000 Message-Id: <69456fff.434d6.77051938@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=444d2f9e21521f5ff29f518a357a22a81c9d03d5 commit 444d2f9e21521f5ff29f518a357a22a81c9d03d5 Author: John Baldwin AuthorDate: 2025-12-08 21:33:30 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 bsdinstall: Mount /dev and /packages after using the shell to partition disks Normally after partitions are created by the installer, the 'mount' script is used to mount the target disk partitions under /mnt. The tail end of this script also mounts a couple of additional filesystems under /mnt so that chrooted programs can work such as devfs and /packages. When the "Shell" option is used to permit the user to manually mount the destination filesystem, the "mount" script is not used as the user is instructed to mount the target filesystems and construct /mnt/etc/fstab, etc. However, this means that the user is responsible for mounting devfs (which is not included in /etc/fstab) and /packages as well. The help message for the "Shell" option doesn't mention these requirements, so users may not know to do so. This can lead to confusing errors as chrooted commands can fail to find needed /dev entries. For example, running fwget to fetch wireless firmware fails because /dev/pci doesn't exist. To make this less painful for users using this option, split out the bottom half of the 'mount' script that mounts these non-fstab-related filesystems into a separate 'mount_aux' script. Invoke 'mount_aux' after using "Shell" to create the filesystem to ensure that these filesystems are always present. PR: 290901 Reported by: Peter Tested by: Peter Differential Revision: https://reviews.freebsd.org/D53770 (cherry picked from commit f63a8c0a0915a3eceac179d4d18b2c03b1319fa2) --- tools/build/mk/OptionalObsoleteFiles.inc | 1 + usr.sbin/bsdinstall/scripts/Makefile | 1 + usr.sbin/bsdinstall/scripts/auto | 1 + usr.sbin/bsdinstall/scripts/mount | 10 +------- usr.sbin/bsdinstall/scripts/mount_aux | 39 ++++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 7cf742616e63..df51f6955d2d 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -434,6 +434,7 @@ OLD_FILES+=usr/libexec/bsdinstall/jail OLD_FILES+=usr/libexec/bsdinstall/keymap OLD_FILES+=usr/libexec/bsdinstall/mirrorselect OLD_FILES+=usr/libexec/bsdinstall/mount +OLD_FILES+=usr/libexec/bsdinstall/mount_aux OLD_FILES+=usr/libexec/bsdinstall/netconfig OLD_FILES+=usr/libexec/bsdinstall/netconfig_ipv4 OLD_FILES+=usr/libexec/bsdinstall/netconfig_ipv6 diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile index 4fd59e49d506..92a455d8e9e3 100644 --- a/usr.sbin/bsdinstall/scripts/Makefile +++ b/usr.sbin/bsdinstall/scripts/Makefile @@ -16,6 +16,7 @@ SCRIPTS=auto \ keymap \ mirrorselect \ mount \ + mount_aux \ netconfig \ netconfig_ipv4 \ netconfig_ipv6 \ diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 5fefc07e4c07..2204b33ae105 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -405,6 +405,7 @@ case "$PARTMODE" in clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 + bsdinstall mount_aux || error "Failed to mount auxiliary filesystems" ;; "$msg_manual") # Manual if f_isset debugFile; then diff --git a/usr.sbin/bsdinstall/scripts/mount b/usr.sbin/bsdinstall/scripts/mount index fd13e13c6a77..a432ccd5dfe5 100755 --- a/usr.sbin/bsdinstall/scripts/mount +++ b/usr.sbin/bsdinstall/scripts/mount @@ -52,12 +52,4 @@ for i in $FILESYSTEMS; do fi done -# User might want a shell and require devfs, so mount it -mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null -mount -t devfs devfs $BSDINSTALL_CHROOT/dev - -# If installing from the DVD, mount packages where they'll be accessible -if [ -d /packages ]; then - mkdir -p $BSDINSTALL_CHROOT/dist/packages - mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages -fi +bsdinstall mount_aux diff --git a/usr.sbin/bsdinstall/scripts/mount_aux b/usr.sbin/bsdinstall/scripts/mount_aux new file mode 100755 index 000000000000..21def9b6e8c0 --- /dev/null +++ b/usr.sbin/bsdinstall/scripts/mount_aux @@ -0,0 +1,39 @@ +#!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +# User might want a shell and require devfs, so mount it +mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null +mount -t devfs devfs $BSDINSTALL_CHROOT/dev + +# If installing from the DVD, mount packages where they'll be accessible +if [ -d /packages ]; then + mkdir -p $BSDINSTALL_CHROOT/dist/packages + mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages +fi From nobody Fri Dec 19 15:32:18 2025 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 4dXs3Q3nNcz6LtWG for ; Fri, 19 Dec 2025 15:32:18 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3Q26yhz3Z2F for ; Fri, 19 Dec 2025 15:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158338; 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=suHkzVlOLJHf38eUPp8d8k+MPXszpYEgmLBgTDb4TZo=; b=UxhBj4rjl/RWVcToJNxibvjYGhFm76lh/L+gqatPVFUATkL9nYntOrKw94EELMs+eOZAlr 7duYsnUNpDP+BWdNQ2++XAIrlprgT/XRa5mplUyWKZBEYRtugC13gPp5PYGZ0a8EZoh/47 AKaSx+3t3zl2HrkAdW6dnPsLVDBspKpDPcarO2VZ8OamR8EiLVhrgQBOuStz5YKAeirPnW /659daKazN9D3YOS7BVwuCciljV09GiK12tmuQwAwqevsdZqLFChmHn7nB0LqigpdwB0+r zTsXkW8DNX3ykfdvylxzazUKOBcmw1mjom+ugqHW3kQTm8jjDc6krMiJKHxU4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158338; 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=suHkzVlOLJHf38eUPp8d8k+MPXszpYEgmLBgTDb4TZo=; b=IB5gmmTFt6rfaML+yiKTwTGt/hriyexaOZTnB1L4hS8DS9plJY2ld+PqnT1gJzitxTUGzt ldNE4ANkeKgMjjIYGC7dO6IfxZiclclUdLYo9RuGBTdymiD8Hya4wk4JppVTbEeFOK4IcI TjlGBUCI2xKIUC5WLVpQSjLVqCHGlPrFBNV1pC7absYVP7DQGuPXuuaCN2MNXXAb1mtwMn p/ZzcY+hQ9O4dPVnOrJ6C8J/p5hZtg7zycZoRIFfx+GCamgIUUv7HgQoxiLTdhXtTxzAKi 2KybPm/wUfl6q02kfooBszoF/fjg4l4ezuRo+yki4i3TEgC8UnKMh8408oWzyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158338; a=rsa-sha256; cv=none; b=vPNmIS9cSSFXlrrq5nHvhHVuR0ix50DjQ747sjIDpJylfM8UmoSFSmGuQdi/NP3wtPdMly MHR/BesQMKRCInhOK6M0p3EOXicN00xyXJX6FnL7erVtAPc/kHID8X0or974Py1/nLt9Hx WX07q2b43ywO/F4pSl9NtW1XYXDd7K6G7DW+I3fswnsJ4IXtPgrO5rhlaooh0ze8DSNCAJ KZ+7Gj1oIqNTO9iFBKsLoSnwcXBxjDh6XQGNHUu8JpXNxVVsFTG//+e0hMEKUcIz1PyhQw 81TNrobR3dL1RAR+a3dv4TWuJKYYj3bZ6TC5GB4wYoOuoj5i2vG/Z4MezG2aBw== 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 4dXs3Q19sWzKl for ; Fri, 19 Dec 2025 15:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 453dc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6a99a27d4345 - stable/15 - rman: Simplify initialization of internal globals 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6a99a27d434559160e64eaac3c7f5898d9997f48 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:18 +0000 Message-Id: <69457002.453dc.5e70331f@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6a99a27d434559160e64eaac3c7f5898d9997f48 commit 6a99a27d434559160e64eaac3c7f5898d9997f48 Author: John Baldwin AuthorDate: 2025-12-09 15:59:19 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 rman: Simplify initialization of internal globals Use TAILQ_HEAD_INITIALIZER and MTX_SYSINIT to remove the 'once' code from rman_init. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D54142 (cherry picked from commit a35eae89cbddaac73d3b6c2b5c1b90e3a0c00997) --- sys/kern/subr_rman.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index dbb09850d049..b8528104ba28 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -102,8 +102,10 @@ SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RWTUN, static MALLOC_DEFINE(M_RMAN, "rman", "Resource manager"); -struct rman_head rman_head; +struct rman_head rman_head = TAILQ_HEAD_INITIALIZER(rman_head); static struct mtx rman_mtx; /* mutex to protect rman_head */ +MTX_SYSINIT(rman_mtx, &rman_mtx, "rman head", MTX_DEF); + static int int_rman_release_resource(struct rman *rm, struct resource_i *r); static __inline struct resource_i * @@ -121,14 +123,6 @@ int_alloc_resource(int malloc_flag) int rman_init(struct rman *rm) { - static int once = 0; - - if (once == 0) { - once = 1; - TAILQ_INIT(&rman_head); - mtx_init(&rman_mtx, "rman head", NULL, MTX_DEF); - } - if (rm->rm_start == 0 && rm->rm_end == 0) rm->rm_end = ~0; if (rm->rm_type == RMAN_UNINIT) From nobody Fri Dec 19 15:32:17 2025 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 4dXs3P49GCz6LtWF for ; Fri, 19 Dec 2025 15:32:17 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3P10FBz3Z3w for ; Fri, 19 Dec 2025 15:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158337; 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=/CY2PRED+0aGuyVRzZswJpuhdXVDja+4WZmRjqDGXqw=; b=HCrW/gR9b46qc5SmWxohyRAMjn3pt3wFT95DrKQU1L+BB8alwy/lrPE2mtf0bw2ICynLYl dD18lHoGkEDAdOR8no+jT8SzW8r8WtvpZGrTSnJGy3UZvI727tMyaU0U5h71YVZUEPN4tT hDh6ixBUA1RCAdmUMESAEUnQNAZpUGi6zLaufkbSqcEuMhYfgeEWL1IRWK8rEXN+yt8Mce IgrJp6uS807u7kJzoF+t71Rj9ChlUwOrrSADWqzD7C37okOy3VLH8i2revQvwWPlbwISau RF1w+4DKUmsSJuIByTu7kV4wAGZ6IiJus8BKYw4LXSf2PyPP2klWOkMaijrapg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158337; 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=/CY2PRED+0aGuyVRzZswJpuhdXVDja+4WZmRjqDGXqw=; b=yCN3Xctb33LyKyzUOowFhgAtXOMHrdfuVIalgGWWOcxk+LkwLlkSZ9wIR7EilTkl8tFoeS pdu89HnKuV90sIm/cOpc1LyvjX5ULGwf+iSP2LQeNzkpYn3HJJ/Z05evMwgnWAZuTEAnx4 RCeYdq48KYU+frlBupE8JFawfB8fpuRDl/mMsR77R5ZX4bNOZTXDbyU6QqCRGG3IUJYKcQ Q1FJSVj995YihtNYJqzQSE7cYf4yTu5TRi5of64dt2PZg8l2hgXMnuxBAD2+9Vns3k7g9J wLG/nUEcnjl9GKTlP58q/WWePR//OOlnkuKwhjvaIs5crVtUraQC6AUOqqyALw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158337; a=rsa-sha256; cv=none; b=N+rQJ3ymqwbVrZaDCZVrlNE5rsEunQzejdMN5P9BGNwm5EBOog0T8A4QcKVnd74MTPismN t0OsadTifqxSkPtTK9ZWlCPp7w0gbW1BoiZQU8nPRxiQ2ZJFlM7pzGvY/ivJEDK5Vo366V kMyqsNmsObZtvQ++inU2POEQgcqh5JSCqW+J/XPapKUXtlpf6AKh9Gquy2lCGCtQxT/I+e n+prsLhmQONAzq/hHnyLwV4jFPCrBVluiX/zxs1zgTYXcmsxeCGzWNvKZ70QN73vQ1K1+k KPYPGB6U7onN1dFVuC65CZ64E4iqX0VK44djUuYvej4flUrVCxEN763wpbPlgA== 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 4dXs3P0PVFzDr for ; Fri, 19 Dec 2025 15:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42e63 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 84140c99e54b - stable/15 - nvmf_tcp.4: Don't quote the document description given to .Nd 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 84140c99e54b1a5bb4caa7200b102f96ced14649 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:17 +0000 Message-Id: <69457001.42e63.418100eb@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=84140c99e54b1a5bb4caa7200b102f96ced14649 commit 84140c99e54b1a5bb4caa7200b102f96ced14649 Author: John Baldwin AuthorDate: 2025-12-09 15:57:16 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 nvmf_tcp.4: Don't quote the document description given to .Nd Reported by: ziaee (cherry picked from commit d8556d2bad4074258fb11c0c7ee997ad78dadf87) --- share/man/man4/nvmf_tcp.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/nvmf_tcp.4 b/share/man/man4/nvmf_tcp.4 index 0a650e342f0e..a781abaa7ad9 100644 --- a/share/man/man4/nvmf_tcp.4 +++ b/share/man/man4/nvmf_tcp.4 @@ -8,7 +8,7 @@ .Os .Sh NAME .Nm nvmf_tcp -.Nd "TCP transport for NVM Express over Fabrics" +.Nd TCP transport for NVM Express over Fabrics .Sh SYNOPSIS To compile the module into the kernel, place the following line in the From nobody Fri Dec 19 15:32:19 2025 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 4dXs3R5fVrz6LtcY for ; Fri, 19 Dec 2025 15:32:19 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3R2R38z3Yn8 for ; Fri, 19 Dec 2025 15:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158339; 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=0SMmZUPhAFEm5MKy9NRogdBCJNhOYq6j2v2eQvS7HEw=; b=bje8AAPm0UeibebDyQrwB4PehzzOg9MccGi5aT9jRne9YOnO4SJeCK2XRcxK7wbvhFjZfn H2akVysB0v5s+lVx4FsN41hzh+Jwxw2CUesICPp7uA8xjTASdoMQweEyl55TKmu9VXrCv2 +XDLuXxuSv1XvkMrn/paDjIgYk5W/GO9BZlYj8qPXa9i0zZ4IE6vbx0dy6rbkTTKYd0d6a o0DvwbNHH7eE9Rn5PYPa4Al54hcpqsdKs5r6iXIDNJOKW4MR+JEMYD7MzT1ZcvwbZkIh06 jtXg8j79Tos0t2aMAZdBE8G90S3TpZ+6oj5EF+4/RCnHq0gmPz9T4ispYihbLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158339; 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=0SMmZUPhAFEm5MKy9NRogdBCJNhOYq6j2v2eQvS7HEw=; b=R5lPf/hbJDqssrplk53FWDCO5ct4VjW9U0+tc4qsT8jdLHWuzt1N/IHByz5xdxHPQ1xeCV K0mlS6j7x54n8LoKY8H0qwTs9/EbpHDvKABGKQEip7I4XeboQSbnnrDP4QtwV8kQWBl8oC 777AwoWpXSROS/TNa/JwEJZ7ulS8WRlIz3FDaQbGOzFyC2br6E9E4oJtaDMWZ63iMbpqPX QYblCdVD0PEK+yw7KHktFCpfGiXf9VaIzBVuZdHvGtARO5R35zX/eBx5rFS4Gs165kpj1I YQzAa2Sum2eZ+vjxIWMkJRRuVvpb93aW5FAmTVFi/EXEEDwUHBQ+Yy78V1ztEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158339; a=rsa-sha256; cv=none; b=XMvwqFeDW89WEg9/GuxSx1Tau4olHMrI7ZR2lLNsNqjcU156/KfWlkRQGXtsnmovWcUK4k Z4Wg3LRZaLdv97MFyR/0nqbDLiA3Vmt1uphokKr4yTSiOxiKrZzR8G8wSBodtmCDCQBxX6 yKCfPvNOb8f29UD/LaWPifWAbwoGqKAzX8d7lWzlvn3aotkBDzBZMS+vUPvhX3KJmyAqOz pnj5eJw74JvvoAARxtKg8l0Pthd7IB9TK5bSGXC8Q3aWbvbL4NWnyjNkyR9i5W8biu6xxG eW/0auRBxL8a+WVr4gbsHCAO1ou7AoKgxhrQpeC1EuCijtjq7BE6fq/Zn8YrWA== 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 4dXs3R225vzHP for ; Fri, 19 Dec 2025 15:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4490e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 11b309c0a717 - stable/15 - netlink: Don't overwrite existing data in a linear buffer in snl_writer 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 11b309c0a717bce634ca6acc8e1c4260810aae9b Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:19 +0000 Message-Id: <69457003.4490e.5ea5929a@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=11b309c0a717bce634ca6acc8e1c4260810aae9b commit 11b309c0a717bce634ca6acc8e1c4260810aae9b Author: John Baldwin AuthorDate: 2025-12-10 15:30:31 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:44 +0000 netlink: Don't overwrite existing data in a linear buffer in snl_writer First, a bit of background on some of the data structures netlink uses to manage data associated with a netlink connection. - struct linear_buffer contains a single virtually-contiguous buffer of bytes. Regions of this buffer are suballocated via lb_allocz() which uses a simple "bump" where the buffer is split into an allocated region at the start and a free region at the end. Each allocation "bumps" the boundary (lb->offset) forward by the allocation size. Individual allocations are not freed. Instead, the entire buffer is freed once all of the allocations are no longer in use. Linear buffers also contain an embedded link to permit chaining buffers together. - snl_state contains various state for a netlink connection including a chain of linear buffers. This chain of linear buffers can contain allocations for netlink messages as well as other ancillary data buffers such as socket address structures. The chain of linear buffers are freed once the connection is torn down. - snl_writer is used to construct a message written on a netlink connection. It contains a single virtually-contiguous buffer (nw->base) allocated from the associated snl_state's linear buffer chain. The buffer distinguishes between the amount of space reserved from the underlying allocator (nw->size) and the current message length actually written (nw->offset). As new chunks of data (e.g. netlink attributes) are added to the write buffer, the buffer is grown by snl_realloc_msg_buffer by reallocating a larger buffer from the associated snl_state and copying over the current message data to the new buffer. Commit 0c511bafdd5b309505c13c8dc7c6816686d1e103 aimed to fix two bugs in snl_realloc_msg_buffer. The first bug is that snl_realloc_msg_buffer originally failed to update nw->size after growing the buffer which could result in spurious re-allocations when growing in the future. It also probably could eventually lead to overflowing the buffer since each reallocation request was just adding the new bytes needed for a chunk to the original 'nw->size' while 'nw->offset' kept growing. Eventually the new 'nw->offset' would be larger than 'nw->size + sz' causing routines like snl_reserve_msg_data_raw() to return an out-of-bounds pointer. The second change in this commit I think was trying to fix the buffer overflows due to 'nw->size' being wrong, but instead introduced a new set of bugs. The second change ignored the returned pointer from snl_allocz() and instead assumed it could use all of the currently-allocated data in the current linear buffer. This is only ok if the only data in the linear buffer chain for the associated snl_state is the snl_writer's message buffer. If there is any other data allocated from the snl_state, it could be earlier in the current linear buffer, so resetting new_base to nw->ss->lb->base can result in overwriting that other data. The second change was also over-allocating storage from the underlying chain of linear buffers (e.g. a writer allocation of 256 followed by 512 would end up using the first 512 bytes, but 768 bytes would be reserved in the underlying linear buffer). To fix, revert the second change keeping only the fix for 'nw->size' being wrong. Reviewed by: igoro, markj Fixes: 0c511bafdd5b ("netlink: fix snl_writer and linear_buffer re-allocation logic") Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D54148 (cherry picked from commit 255af72c8059b0117db646f82efa2e4848fa7570) --- sys/netlink/netlink_snl.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index ca1169d24b91..429dae767c47 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -1072,6 +1072,7 @@ static inline bool snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) { uint32_t new_size = nw->size * 2; + char *new_base; while (new_size < nw->size + sz) new_size *= 2; @@ -1079,23 +1080,20 @@ snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) if (nw->error) return (false); - if (snl_allocz(nw->ss, new_size) == NULL) { + new_base = snl_allocz(nw->ss, new_size); + if (new_base == NULL) { nw->error = true; return (false); } - nw->size = new_size; - void *new_base = nw->ss->lb->base; - if (new_base != nw->base) { - memcpy(new_base, nw->base, nw->offset); - if (nw->hdr != NULL) { - int hdr_off = (char *)(nw->hdr) - nw->base; + memcpy(new_base, nw->base, nw->offset); + if (nw->hdr != NULL) { + int hdr_off = (char *)(nw->hdr) - nw->base; - nw->hdr = (struct nlmsghdr *) - (void *)((char *)new_base + hdr_off); - } - nw->base = (char *)new_base; + nw->hdr = (struct nlmsghdr *)(void *)(new_base + hdr_off); } + nw->base = new_base; + nw->size = new_size; return (true); } From nobody Fri Dec 19 15:32:40 2025 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 4dXs3r542rz6Lthc for ; Fri, 19 Dec 2025 15:32:40 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3r2g8Mz3ZkP for ; Fri, 19 Dec 2025 15:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158360; 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=WlfSU3TmTVRhM/4nzr2BquqhCnCATr6j45v2Xgvswko=; b=TnYNSk02OcQIlp63aOU0egWPWG6E0mURw63Ua0tC5x3RUVWGFSwKa7l1YgL3PfFLw7PLml OrjiXZueI/Bn7g9RfZjDCimrL8bzCxSFLfXgH3m9oK7u73BWYbwMVqu10L7Qq79+PAK8ux YTO6TGYEKLynDZBHb51Xbnc4UU4iHnVA64u7uz3NPTdpN+6h2NelKbibDCacfHUG2C1e6h poTd0ntSEeNfdzANboDszRYK4RNOKxTtyLVDRXb1S6aWLPZ7ZDnHIosYF/y7gAVELuDIIK NgUPk87bhKRyhoNSX6qoVVRsYQ4OZav0hJIwT0Qo+TKlGKd9Nc4CrF/UA22/mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158360; 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=WlfSU3TmTVRhM/4nzr2BquqhCnCATr6j45v2Xgvswko=; b=nth7oC9G3bQbUhwut/ke8c4WwXCPGtX7gsekLqdPWTEunO8vtoJy9hvrZSA3oJlEpfQxsy 1ztL70HIwjyCQaVfoEM/+fzdeOyP0YGGqp2Hjprwv9XO5+00OawBknSCxFH7ijRe2/+b4a ebZ7/75f4XtuCBBmWZVsIMaTvCcHGbkpJh9r6bUVexJzzWiQi4YYomx9gZ9M7QG+IHSl45 OsHJyQkeH4Yu8iCzYuooV3fpbLPJgDJP7XnT+lcS8k6n9pvubHGnWIJR8mdOJfUWOjiPR1 bRqMxa8T3JPsFAJrTTLEDh3esB9Aj5PG/M6gYh3cb9OWfv1MY5raG5PqXPob+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158360; a=rsa-sha256; cv=none; b=q6JlHzi5RiC4WX6sZBWF6hXx8Qzsu32hB6OURroH7A00c8LRoYfB6hIETgjAlbI4xJ+/ip Am4+5UU1MNSnnlDLSbhMDF8m1jS1cZ0AXUpEe12VG5Vout4t1SoUnlDrGiJauz8bTTH8IH pp9Hew1oXWAHGgZX6uQqWWgk2mMteDfLRC1k0aSJm3kUGOwzIQ6L4DfxlwXiTyZvsdljdV J6hmu513a16dybrv3ozbuidfA8IT0f090l+1kjcZ8BtAjs5iqXDawijep4zcq7XmOhroJB rzQX3CJuWQn218E8HMfHRJ6CIifhOkpKqXeBgNOBE1P4isO0Qd6MToIN+tVsBA== 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 4dXs3r1x3yzN4 for ; Fri, 19 Dec 2025 15:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 436fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5685988838e4 - stable/14 - ruxreset: Add an inline function to reset all the stats in rusage_ext 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5685988838e403843422b5a727ff385a37b4909e Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:40 +0000 Message-Id: <69457018.436fc.171bd863@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5685988838e403843422b5a727ff385a37b4909e commit 5685988838e403843422b5a727ff385a37b4909e Author: John Baldwin AuthorDate: 2025-12-08 16:15:20 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 ruxreset: Add an inline function to reset all the stats in rusage_ext Use it in proc0_post to reset per-process CPU usage. Suggested by: olce Reviewed by: olce, kib Differential Revision: https://reviews.freebsd.org/D54049 (cherry picked from commit 3f8ed605dbd0ee211ce8fe59c0c072b916d6311c) --- sys/kern/init_main.c | 5 +---- sys/sys/proc.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index aa541c527a19..47707b4068ad 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -662,10 +662,7 @@ proc0_post(void *dummy __unused) microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ - p->p_rux.rux_runtime = 0; - p->p_rux.rux_uticks = 0; - p->p_rux.rux_sticks = 0; - p->p_rux.rux_iticks = 0; + ruxreset(&p->p_rux); PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 06506f7d03ed..53da0baa02e2 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1338,6 +1338,18 @@ td_get_sched(struct thread *td) return ((struct td_sched *)&td[1]); } +static __inline void +ruxreset(struct rusage_ext *rux) +{ + rux->rux_runtime = 0; + rux->rux_uticks = 0; + rux->rux_sticks = 0; + rux->rux_iticks = 0; + rux->rux_uu = 0; + rux->rux_su = 0; + rux->rux_tu = 0; +} + #define PROC_ID_PID 0 #define PROC_ID_GROUP 1 #define PROC_ID_SESSION 2 From nobody Fri Dec 19 15:32:41 2025 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 4dXs3s5cMdz6LtQS for ; Fri, 19 Dec 2025 15:32:41 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3s3BD7z3ZtS for ; Fri, 19 Dec 2025 15:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158361; 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=kDGLevQ7psJiou+g1mUcmRRhpuVmNmwFsk8uH+c3fS4=; b=T3JG/uMP7U+PEAoHjRFfxVIwK9pBlqVvKaQY7xPV/IcqCI2nOWCYtAU/ARk0u8azue6yzX hSoUKqmbBafQ3RGPjR2nzBgD+ejPdWcyvkdYcdUA4bMyP/MNj56bP/tvlRG+jJESTzkRiH nko0wsffVmZiO0TdzPlJ88qotNLUPuSmAaa0QNJlp3dmac6yiuXlSsytpynMU2rt5KCmOF 7NgmNKdM7btYFT7EpXwATwFxHkR7o0YOTt7+5baL+CmKhFUUf9K7OnxxTWeLgyMb9fMKNk jYOcWC3BgPmwgx3pO4cHHBEoTV6oQu8+f7Us4e6OZD5l1TC2dROAVkJlr+dGTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158361; 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=kDGLevQ7psJiou+g1mUcmRRhpuVmNmwFsk8uH+c3fS4=; b=fBEFdrYJlYlN+WNP5OZ4xcdv3Je725axncacKd63Al/XU7xooS4KgSzwIACbSXaY4wfYjo Qzoqw3+OjBjS9aqXlVhSoMz/X38Y+vU3fGyqIJbAl83b9gqyfXV6p+GFIBnrz6tVjLnrBW /FW1vxmKyoy35nUNVeNyi9EQu9B7L2Sg5z4hJbEuAqZxo+eUs8xd6yxPZVsHGMSo6tDgnr sO3BxYnb0wEkQnemBF0CPsJgDh32SKi3fXrKBfDs8QrvH8yOliweADvoA+1KCxUJTmJV6j oYjl36k9Rwovvs/ztZveEweifLyOp380sRg2iqo3k7piYfcCpZiJbTIXrqrLPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158361; a=rsa-sha256; cv=none; b=WfVdNknScp33Gg6TLoaFsypIZ76hMA4mPqEd0Qhg+Jv9cp4+pVPapJ3Mbl67sjOSFT1b8f zplQY+hlVZogchvEfexrxBdC6Vaq0koL5FWlo3ICROtMpjIwIVu0nhg2SMIXIvNX8YfN3L gxqoAbm3uZJ3ulPcHDLWktVemcWrh1VF9ekRrEG8tWdbf46t5ifX0mp0uHcgWDJuK3+7un GQ7iSxBHdq9HxGTyAL26QC36BmeheSQtYX4mNzWqyWlhADJVG1nXQhgE7pNsiO7p7y2qoN 1BBpsyz47JlyKwmK0+KLeGJOVJlljrIxiXVQRZ/PpIo3IlBZuTEo70ddVGBUAQ== 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 4dXs3s2hQwz3K for ; Fri, 19 Dec 2025 15:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45401 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cdad10ea780f - stable/14 - thread0: Clear td_rux stats in proc0_post 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cdad10ea780f9b2f4d49a073a07709b2ceb9d59a Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:41 +0000 Message-Id: <69457019.45401.2994adf1@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cdad10ea780f9b2f4d49a073a07709b2ceb9d59a commit cdad10ea780f9b2f4d49a073a07709b2ceb9d59a Author: John Baldwin AuthorDate: 2025-12-08 16:15:36 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 thread0: Clear td_rux stats in proc0_post proc0_post aims to reset the CPU usage accounting for all threads and processes in the system to zero once the time of day is verified. However, not all of the per-thread stats were not being cleared, resulting in over-reported time for thread0 post-boot. Reviewed by: olce, kib, markj Fixes: bed4c5241663 ("Implement RUSAGE_THREAD. Add td_rux...") Differential Revision: https://reviews.freebsd.org/D54040 (cherry picked from commit dafe50ebd874ca3ccd5908c441cee9f478c501f0) --- sys/kern/init_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 47707b4068ad..51a6e7e7d909 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -650,7 +650,8 @@ proc0_post(void *dummy __unused) /* * Now we can look at the time, having had a chance to verify the - * time from the filesystem. Pretend that proc0 started now. + * time from the filesystem. Pretend that all current threads + * started now. */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { @@ -663,10 +664,13 @@ proc0_post(void *dummy __unused) PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ ruxreset(&p->p_rux); - PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; + thread_lock(td); + ruxreset(&td->td_rux); + thread_unlock(td); } + PROC_STATUNLOCK(p); PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); From nobody Fri Dec 19 15:32:42 2025 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 4dXs3v0ySfz6LtMX for ; Fri, 19 Dec 2025 15:32:43 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3t3vDRz3Zml for ; Fri, 19 Dec 2025 15:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158362; 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=vEdoOq/XXJKD08PuVvYwMkqE1/bJJxKHBOlWjY2/tJc=; b=MHVW4mlP3M+IbeBiyD8fJnOu9t59rW+6bSg4lB/W5jVvpezoiqO/RSNJ7/bEOSIy/3qdeV I1O+KgMjr5iVZuQcKtu673rOA8SX0jZKTsSpwA5VgOXbRkduz+P25IOcDCTwk7jpadX0/B 6vP/KEH8DjW9geRSgv2lUepjlpcBrRpJJbWdwuMD+50ACw2dT/gisy5NwJUsllXYbmZMYJ /fEtKRPOak74170DqUG44sFBLzc36CWD6jnJlhLnwA/gw5RZ4wwV0b/8HirHufknOUGNd4 nGPWdhPke16pxOz/f1GCFlwd74ngNSnNlGpPmhZ5kEhAYlXxHwiiPnBG7bzQag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158362; 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=vEdoOq/XXJKD08PuVvYwMkqE1/bJJxKHBOlWjY2/tJc=; b=bTDFUJgMiiroudK8nUnPF9bcLGMKCv8CGvgUSx8AE+z+Jh0JL4dKQ1Mh6BN3C4rvnFOihN ahzwydyBcSqeZqXWaLMLE+onUOqS4WrFcxPGJFJXyD7NfYdxqidZFm6xEk8RK02Tm8tQ1m DDsDb2W9XCUDW8UdprHgOp1ztiaWxVkfawXgxoTfTcYCOeEblWpARJ2P+7fHYx2MDl3WKm 0P1dsQIM0VNEO7t1AMyxSgE+Xk7vDiUI/Nt1bI/JmaxWhwTVOk1GdkWZxpXOoBfgzUPlnj izL+tp+LhZX30WhJgNPog12t+R58HSltDtSi6zEVZYbqLGaEH9KXJQPpxft2vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158362; a=rsa-sha256; cv=none; b=nMkAqX+mGxaQZJ8895E7MVqACRp0eadKiazjvRG0WwIq7ol/rmojfrev/usjeVHcNlrWRb 0R1H796dXZoLmAQy0LAJarkU+5hqViNQNbvhTEWbGETQRyW84E/XkJMl6yIfwVYv9how0C 0wvbbWkVSFfFhVEEwQDnaZ3KTwyWIRhbU4AZONzm8NLFjPCeuQ4DqUxbTB4DCrkFfFN/EK z1ZfF9PQ1ya7BttDlFR08cvE6xm73CqeZPW0wFNBqkHpiDifpS1Q8DrLkJAVaolpiS/1r4 aqAxTzm/UaC21zlV1PvmKQuKRemwQvlaFD5of6xdM7YT6tUJ0js8UUeIspT4fA== 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 4dXs3t3SVMz1S6f for ; Fri, 19 Dec 2025 15:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 447be by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7087adfd960a - stable/14 - proc0_post: Clear relevant thread stats directly 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7087adfd960af71fba968371439a706badf830e9 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:42 +0000 Message-Id: <6945701a.447be.18fd3a44@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7087adfd960af71fba968371439a706badf830e9 commit 7087adfd960af71fba968371439a706badf830e9 Author: John Baldwin AuthorDate: 2025-12-08 16:15:52 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 proc0_post: Clear relevant thread stats directly rufetch() has several other effects besides clearing these per-thread stats most of which are explicitly discarded by the subsequent calls to ruxreset(). Just clear the relevant stats directly instead. Reviewed by: olce, kib, markj Differential Revision: https://reviews.freebsd.org/D54050 (cherry picked from commit acd02443a952b1f5412d35d03f081ad48bae34d7) --- sys/kern/init_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 51a6e7e7d909..65795eea183e 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -645,7 +645,6 @@ static void proc0_post(void *dummy __unused) { struct proc *p; - struct rusage ru; struct thread *td; /* @@ -662,11 +661,15 @@ proc0_post(void *dummy __unused) } microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); - rufetch(p, &ru); /* Clears thread stats */ ruxreset(&p->p_rux); FOREACH_THREAD_IN_PROC(p, td) { - td->td_runtime = 0; thread_lock(td); + td->td_incruntime = 0; + td->td_runtime = 0; + td->td_pticks = 0; + td->td_sticks = 0; + td->td_iticks = 0; + td->td_uticks = 0; ruxreset(&td->td_rux); thread_unlock(td); } From nobody Fri Dec 19 15:32:43 2025 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 4dXs3v6YVYz6LtGw for ; Fri, 19 Dec 2025 15:32:43 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3v4XdRz3Zb1 for ; Fri, 19 Dec 2025 15:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158363; 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=f+x6X03FkSkwvBGG8T0FtLWEANfNZZqQ1umoJ0450Vo=; b=rGYmpHoJWlqpbkx+FUldfyzh1y++FuPLDLMLgGKN0eS1JXaG6RFiT4qGNzlBUo6e2u/n5+ f4Ku/9IL8F4S9aSrdlovheJ/dHpuOExosOyRKlagDNrLklOW8Tz5XFy8kyrqrOffacVaml CFdBJ15jv7RChTn5ohhFvMZFBJW1Acny8tVSGD2meXKRcQxoRUyt/1bejh7Xyx8D8aDqR5 jz2pzQvOqFaitnGWTos28iInP01X3788mty5o7YFHhq0TrA3X27ARErI6jwCRVYo00okK/ vK/EXIrF1XfBdJfVgegxMDn76d+PUQPam1dA+kKjvZmMUCfgMuqymYAQhUveMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158363; 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=f+x6X03FkSkwvBGG8T0FtLWEANfNZZqQ1umoJ0450Vo=; b=ROI2Xr9xEtx+GUWcR3tmeVUOttCE3K60F3Ym15q33QAZG5aVNk119Gj0awkHktijMksoSz AEgxURA+VF6C+M2oPoWKQpNebSI/4av6sBvb11cY7DG4mw/9kVO2/J9gz1J8Dt4grJjnz8 T9z3XLMfTJ9ZuFlcBzQA2qphr8VZHTWOSGojg54s6Z2TecakzltN279Z6VI5EJpZw5DSvq gXVC/C+lXKWTH6ZfiBEREKM1/uzBq1YLb5ze7RQAgXXzlRy9drK3KPqGDw74aFcAKNY00I Wb6+4NRbqcuCKz+u02v2iEOHRMJHtiQwReA2NtciwpqWcK4s2SVEjJQBentt0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158363; a=rsa-sha256; cv=none; b=VHO0Rba9w00YULyb8ELEGE38C1lzAjPUoJSCJzIFkNSXwQRjcXgSl5O0rkKJ0rgjsF57W5 k8E08h/fWMICPlZjTZqTdOy+qqPf7mlyGlQakqN7DEjJ4GoxVLGuXeS4QJc7At+aaTnEyz wvwEIF3/4dlUv6bf4TleIBGd4QzkUSjFuE7hKQUwy9dBGPIj0sL3g7sM4IS9j9D+5xBCJh 8Qdsd3+FUY82cLsmbdooYvY7r9+tbhPEU5ms5Q4eJSmPIwrgbKFE5WgWgadfogET44D5Sa c1nb4Mt+/WiVc5PkwoutAdh9kqewYq1QUpy+Fusg/DNqgyfSlIagNDLYiqikyQ== 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 4dXs3v4593zF0 for ; Fri, 19 Dec 2025 15:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44e91 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: be89c92739ed - stable/14 - bsdinstall: Mount /dev and /packages after using the shell to partition disks 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: be89c92739ed6063df479bc21b6d9acce133e78c Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:43 +0000 Message-Id: <6945701b.44e91.243c19f8@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=be89c92739ed6063df479bc21b6d9acce133e78c commit be89c92739ed6063df479bc21b6d9acce133e78c Author: John Baldwin AuthorDate: 2025-12-08 21:33:30 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 bsdinstall: Mount /dev and /packages after using the shell to partition disks Normally after partitions are created by the installer, the 'mount' script is used to mount the target disk partitions under /mnt. The tail end of this script also mounts a couple of additional filesystems under /mnt so that chrooted programs can work such as devfs and /packages. When the "Shell" option is used to permit the user to manually mount the destination filesystem, the "mount" script is not used as the user is instructed to mount the target filesystems and construct /mnt/etc/fstab, etc. However, this means that the user is responsible for mounting devfs (which is not included in /etc/fstab) and /packages as well. The help message for the "Shell" option doesn't mention these requirements, so users may not know to do so. This can lead to confusing errors as chrooted commands can fail to find needed /dev entries. For example, running fwget to fetch wireless firmware fails because /dev/pci doesn't exist. To make this less painful for users using this option, split out the bottom half of the 'mount' script that mounts these non-fstab-related filesystems into a separate 'mount_aux' script. Invoke 'mount_aux' after using "Shell" to create the filesystem to ensure that these filesystems are always present. PR: 290901 Reported by: Peter Tested by: Peter Differential Revision: https://reviews.freebsd.org/D53770 (cherry picked from commit f63a8c0a0915a3eceac179d4d18b2c03b1319fa2) --- tools/build/mk/OptionalObsoleteFiles.inc | 1 + usr.sbin/bsdinstall/scripts/Makefile | 1 + usr.sbin/bsdinstall/scripts/auto | 1 + usr.sbin/bsdinstall/scripts/mount | 10 +------- usr.sbin/bsdinstall/scripts/mount_aux | 39 ++++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index e7e723916296..42514dc61b8c 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -420,6 +420,7 @@ OLD_FILES+=usr/libexec/bsdinstall/jail OLD_FILES+=usr/libexec/bsdinstall/keymap OLD_FILES+=usr/libexec/bsdinstall/mirrorselect OLD_FILES+=usr/libexec/bsdinstall/mount +OLD_FILES+=usr/libexec/bsdinstall/mount_aux OLD_FILES+=usr/libexec/bsdinstall/netconfig OLD_FILES+=usr/libexec/bsdinstall/netconfig_ipv4 OLD_FILES+=usr/libexec/bsdinstall/netconfig_ipv6 diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile index cbe190d85f12..b13a69184b9b 100644 --- a/usr.sbin/bsdinstall/scripts/Makefile +++ b/usr.sbin/bsdinstall/scripts/Makefile @@ -14,6 +14,7 @@ SCRIPTS=auto \ keymap \ mirrorselect \ mount \ + mount_aux \ netconfig \ netconfig_ipv4 \ netconfig_ipv6 \ diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 4d16dec6ac5a..71be4ae953a2 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -366,6 +366,7 @@ case "$PARTMODE" in clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 + bsdinstall mount_aux || error "Failed to mount auxiliary filesystems" ;; "$msg_manual") # Manual if f_isset debugFile; then diff --git a/usr.sbin/bsdinstall/scripts/mount b/usr.sbin/bsdinstall/scripts/mount index fd13e13c6a77..a432ccd5dfe5 100755 --- a/usr.sbin/bsdinstall/scripts/mount +++ b/usr.sbin/bsdinstall/scripts/mount @@ -52,12 +52,4 @@ for i in $FILESYSTEMS; do fi done -# User might want a shell and require devfs, so mount it -mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null -mount -t devfs devfs $BSDINSTALL_CHROOT/dev - -# If installing from the DVD, mount packages where they'll be accessible -if [ -d /packages ]; then - mkdir -p $BSDINSTALL_CHROOT/dist/packages - mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages -fi +bsdinstall mount_aux diff --git a/usr.sbin/bsdinstall/scripts/mount_aux b/usr.sbin/bsdinstall/scripts/mount_aux new file mode 100755 index 000000000000..21def9b6e8c0 --- /dev/null +++ b/usr.sbin/bsdinstall/scripts/mount_aux @@ -0,0 +1,39 @@ +#!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +# User might want a shell and require devfs, so mount it +mkdir $BSDINSTALL_CHROOT/dev 2>/dev/null +mount -t devfs devfs $BSDINSTALL_CHROOT/dev + +# If installing from the DVD, mount packages where they'll be accessible +if [ -d /packages ]; then + mkdir -p $BSDINSTALL_CHROOT/dist/packages + mount -t nullfs /packages $BSDINSTALL_CHROOT/dist/packages +fi From nobody Fri Dec 19 15:32:44 2025 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 4dXs3x3Bs4z6LtfL for ; Fri, 19 Dec 2025 15:32:45 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3w5KNXz3Zn4 for ; Fri, 19 Dec 2025 15:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158364; 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=1KmTkd+FJ/toHnUQUMvTuC8ohAbEd5n4ZyxGJaQ43d8=; b=bi16wOwf8awPj4GwH5xEE1IFTnodi6ujXkN6cJuhS16E46VzIL457RxuIPLXL/kSj3cbJ3 1fi6jlMcsBcXGT30eEr6B+WfhJNO8AuTg97QrrJmgPiEviqhZjgmGDPcLKY6aDi5sz07I6 +BnoVdNerAv6i2qStFrQfEgmi3izzk5vIJ4C9xdhXtFlTuppv1dMAMdn9opWn+45IT6mQm EnnpP83WrkKNE+u2z01s45/zTf2wtW5opNML7WlYkcZZSRenBSQaIgESvtROAdSKGeTck3 wE3JsciwDnfA7CCFp3AKkf+T2JUhwNtry6YdixW3C1NTFzBXV7xSbPLVoDUnFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158364; 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=1KmTkd+FJ/toHnUQUMvTuC8ohAbEd5n4ZyxGJaQ43d8=; b=INpy+gs6WSQHFJoJ3Fdfe7ZdukxLXsJH2mg8flcVQWLIEO1o1Lw23ViY7bg028uCUiKYGA pu3VAOnXBLqsJZxY9fj7pld5qeI5L6DwZEBk3ohy2cPHvZRZD+kIiYUqxet5X4siQ3lu+Q wK4V/ooyY1rOQIiZPXUCgRf+kULYRDmUbmUl6Nkzfi8cp/UkNF+A7VjywRzmy6FNhD+G9m mmoNL5egj2cqpJk8QQrUT6SLD3Jfy/M7kRqXE2i1k5Nwh4h/GopuKRwvrA4n9ozqTJyhN8 otMSz2CroGsMRzmJq5YDeU79WJZcc1ithTIIZwRhGw3Ri86aHagbnBQ0rkOT7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158364; a=rsa-sha256; cv=none; b=WnCxWXn69FIX6zKMfhocW0KjLFkZtohXYyPv8xvh8Rer15zgrrO+EkLkmKXDCWhsfjQITx 8zbsD6WGLihWo/ygzBc+eOqWzPvXJAVj6y+lOHmr+icciDn3b3MX4g4tD3Z4tlkjAsxnhK bPIFmawuseuQGdvAPI9E4gPWJJXgH6JXTh8ZLTg33yIJNPJ5BVzk8mZ2zjk+5ua+9+F+qR xpTYPfCwtLf4RmLs4fX1nZL4941N+dSUBIolsj3Z3CzawIXEWPPL/chP/TZff5b7EbFyUm UZkK53mfhnL9QTYVi2trwZmWQjYy6kx7i+10hw3CdP/Qkgry8vWxi2IIVWQGiA== 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 4dXs3w4sNGzF1 for ; Fri, 19 Dec 2025 15:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43c63 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b79115e13010 - stable/14 - rman: Simplify initialization of internal globals 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b79115e13010467d009fc3fed49c0a332f953833 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:44 +0000 Message-Id: <6945701c.43c63.16a91dec@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b79115e13010467d009fc3fed49c0a332f953833 commit b79115e13010467d009fc3fed49c0a332f953833 Author: John Baldwin AuthorDate: 2025-12-09 15:59:19 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 rman: Simplify initialization of internal globals Use TAILQ_HEAD_INITIALIZER and MTX_SYSINIT to remove the 'once' code from rman_init. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D54142 (cherry picked from commit a35eae89cbddaac73d3b6c2b5c1b90e3a0c00997) --- sys/kern/subr_rman.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index f5a782a00dce..08a3dbcd33d2 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -103,8 +103,10 @@ SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RWTUN, static MALLOC_DEFINE(M_RMAN, "rman", "Resource manager"); -struct rman_head rman_head; +struct rman_head rman_head = TAILQ_HEAD_INITIALIZER(rman_head); static struct mtx rman_mtx; /* mutex to protect rman_head */ +MTX_SYSINIT(rman_mtx, &rman_mtx, "rman head", MTX_DEF); + static int int_rman_release_resource(struct rman *rm, struct resource_i *r); static __inline struct resource_i * @@ -122,14 +124,6 @@ int_alloc_resource(int malloc_flag) int rman_init(struct rman *rm) { - static int once = 0; - - if (once == 0) { - once = 1; - TAILQ_INIT(&rman_head); - mtx_init(&rman_mtx, "rman head", NULL, MTX_DEF); - } - if (rm->rm_start == 0 && rm->rm_end == 0) rm->rm_end = ~0; if (rm->rm_type == RMAN_UNINIT) From nobody Fri Dec 19 15:32:45 2025 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 4dXs3y2bzRz6LtH6 for ; Fri, 19 Dec 2025 15:32:46 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXs3x6Q34z3b7x for ; Fri, 19 Dec 2025 15:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158365; 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=ENYOg8pcqxY6cFfxXHItY43Co0tN/r2reipM6I4wPpg=; b=Cq66dkDD3IgiHGYKX7nkF+XKFKxajJD4x9Y//mS/f/hDKK1NVF7SBhD3DidoTpuKYOv01a RhUucLKWRDPtj2KFuyseM5vbY7Ah1fStDWYGFtgBJAkf0O452yhz4MgnVelqWLXS4WwXf1 6DT/Hp1n2ZebS62WxyeiPDlgPy9a2dXyV1qDX3DiBr4wQ2LKTfl1FoDMq+xq9djwkEHERh ywsU/3ibuRcGMJtOC8jvE4gA7+vqmx89TW0uwE1HKv8TBmPkaqrNlYLIXSmBHWGxPfaUxv KSOh0kKIE8HNeSK4drwBBT9GHN4RB4xZcaCETKc7C1ia1TIqh6JSXgmMhQjO+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766158365; 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=ENYOg8pcqxY6cFfxXHItY43Co0tN/r2reipM6I4wPpg=; b=eRZ5MwZy4eAiYnt7Lsff+9XZcz50pGghpwWZ/QtvHzFBHCmePMlvHVxvySBAellm+ICsIa Uc3C5W5AJIkkR0+B1IEY1vVG3kRaD3GACkN3yeLy/DNe1HOStG1lFZpfkPAKMpxw2iY5t+ a9qjqaSbmzsY8EicCWJ3ByFq9atzEeg7FPUILEhV4IlNNPYvCNN6V0lJXtxosYW0Glg1oO OeQ3wHAtCfAO0MvIywK2/kVMXFCPTJDLcZY7Ga8DqaXWSM4IEqRUs1T7EPVo/haCaoohjH tzB6vDd1cLpOpYz1851FKCoQDxS7yAjzBrivRAdqtUKV6fA3yochwb+NSJ2ARQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766158365; a=rsa-sha256; cv=none; b=TtIF2Ehph0PHBsyAxrFkbxFK0PQkwkJNcQJX08iGqmFteHKYXTlHH+Liz1SZzIPexqNXQW XSB2ydE/IWPbqEPlXlI9JXVd1I80Q+0SNPuxI9r0MOVONvure5k7quV0rRJWl8mg+A9W4i hcnV7Mypl5JIUDtJTJi8BI35A4EDz9aNTEImZ1Dc7pdxlW5GXWvGJbuzbc6JD3Pg9PEeZH HPK5Qe1GtfJprif1sQSf/2C5i7XAOLzLXfPN5bUayf07tBvlXKL2JRqIJ0VKUgFkEWoifD js4JrSZXGt2pqseL+uc3KluOnEgm2V3fjl/mEwrqOAstbZS1FeYtzDRh+w+NFw== 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 4dXs3x5SFpzN6 for ; Fri, 19 Dec 2025 15:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43543 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 15:32:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c7cc4706504e - stable/14 - netlink: Don't overwrite existing data in a linear buffer in snl_writer 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7cc4706504e268fd3ca2f3382aa3f58004b71c6 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 15:32:45 +0000 Message-Id: <6945701d.43543.344bfddf@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c7cc4706504e268fd3ca2f3382aa3f58004b71c6 commit c7cc4706504e268fd3ca2f3382aa3f58004b71c6 Author: John Baldwin AuthorDate: 2025-12-10 15:30:31 +0000 Commit: John Baldwin CommitDate: 2025-12-19 15:19:41 +0000 netlink: Don't overwrite existing data in a linear buffer in snl_writer First, a bit of background on some of the data structures netlink uses to manage data associated with a netlink connection. - struct linear_buffer contains a single virtually-contiguous buffer of bytes. Regions of this buffer are suballocated via lb_allocz() which uses a simple "bump" where the buffer is split into an allocated region at the start and a free region at the end. Each allocation "bumps" the boundary (lb->offset) forward by the allocation size. Individual allocations are not freed. Instead, the entire buffer is freed once all of the allocations are no longer in use. Linear buffers also contain an embedded link to permit chaining buffers together. - snl_state contains various state for a netlink connection including a chain of linear buffers. This chain of linear buffers can contain allocations for netlink messages as well as other ancillary data buffers such as socket address structures. The chain of linear buffers are freed once the connection is torn down. - snl_writer is used to construct a message written on a netlink connection. It contains a single virtually-contiguous buffer (nw->base) allocated from the associated snl_state's linear buffer chain. The buffer distinguishes between the amount of space reserved from the underlying allocator (nw->size) and the current message length actually written (nw->offset). As new chunks of data (e.g. netlink attributes) are added to the write buffer, the buffer is grown by snl_realloc_msg_buffer by reallocating a larger buffer from the associated snl_state and copying over the current message data to the new buffer. Commit 0c511bafdd5b309505c13c8dc7c6816686d1e103 aimed to fix two bugs in snl_realloc_msg_buffer. The first bug is that snl_realloc_msg_buffer originally failed to update nw->size after growing the buffer which could result in spurious re-allocations when growing in the future. It also probably could eventually lead to overflowing the buffer since each reallocation request was just adding the new bytes needed for a chunk to the original 'nw->size' while 'nw->offset' kept growing. Eventually the new 'nw->offset' would be larger than 'nw->size + sz' causing routines like snl_reserve_msg_data_raw() to return an out-of-bounds pointer. The second change in this commit I think was trying to fix the buffer overflows due to 'nw->size' being wrong, but instead introduced a new set of bugs. The second change ignored the returned pointer from snl_allocz() and instead assumed it could use all of the currently-allocated data in the current linear buffer. This is only ok if the only data in the linear buffer chain for the associated snl_state is the snl_writer's message buffer. If there is any other data allocated from the snl_state, it could be earlier in the current linear buffer, so resetting new_base to nw->ss->lb->base can result in overwriting that other data. The second change was also over-allocating storage from the underlying chain of linear buffers (e.g. a writer allocation of 256 followed by 512 would end up using the first 512 bytes, but 768 bytes would be reserved in the underlying linear buffer). To fix, revert the second change keeping only the fix for 'nw->size' being wrong. Reviewed by: igoro, markj Fixes: 0c511bafdd5b ("netlink: fix snl_writer and linear_buffer re-allocation logic") Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D54148 (cherry picked from commit 255af72c8059b0117db646f82efa2e4848fa7570) --- sys/netlink/netlink_snl.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 1a33a814c611..e244c09e7d1f 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -1040,6 +1040,7 @@ static inline bool snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) { uint32_t new_size = nw->size * 2; + char *new_base; while (new_size < nw->size + sz) new_size *= 2; @@ -1047,23 +1048,20 @@ snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) if (nw->error) return (false); - if (snl_allocz(nw->ss, new_size) == NULL) { + new_base = snl_allocz(nw->ss, new_size); + if (new_base == NULL) { nw->error = true; return (false); } - nw->size = new_size; - void *new_base = nw->ss->lb->base; - if (new_base != nw->base) { - memcpy(new_base, nw->base, nw->offset); - if (nw->hdr != NULL) { - int hdr_off = (char *)(nw->hdr) - nw->base; + memcpy(new_base, nw->base, nw->offset); + if (nw->hdr != NULL) { + int hdr_off = (char *)(nw->hdr) - nw->base; - nw->hdr = (struct nlmsghdr *) - (void *)((char *)new_base + hdr_off); - } - nw->base = (char *)new_base; + nw->hdr = (struct nlmsghdr *)(void *)(new_base + hdr_off); } + nw->base = new_base; + nw->size = new_size; return (true); } From nobody Fri Dec 19 16:55:55 2025 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 4dXtvv5z7tz6M2nm for ; Fri, 19 Dec 2025 16:55:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXtvv4Hdjz3rck for ; Fri, 19 Dec 2025 16:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766163355; 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=TyFz3NLdWtdDyKS2cAJ/BBycbwHxrZ91DbVhTrVkjVg=; b=frADOmYlaTDZz2mxcIItY3WillzGlseErwmIft6VAbD4QqgQ6SvyNGaowbtn6A+XEt5PXV RSJyyPy8ZXjK6ab9GZxqDZRR2mQmTk+jAwCBqlRtZCnNh73RGkcNxefb+Ebm3kMu6K3oUt XFYoPSSq7D686WzQbPGE6LgEHDM5DSRjFJqQ+o2l1r3QuIiapGaWwgk/Kl5nCq5OJTSOA6 eYHnYa3/8LPJ/FFpoI+s7gwnmpDdAypto3R550Kovs7dx81cmTWXNgkhGv++00Sj9K4je1 uPzLfioY4anjToR4hiKPfMuC6hzl1N85CV+crrjWsspXAayo1/jyINRJ0cPl9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766163355; 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=TyFz3NLdWtdDyKS2cAJ/BBycbwHxrZ91DbVhTrVkjVg=; b=v9VxzNf1NI85uiroGBZKlKJYS/Xx2BNCyJPHfFB2C9C/9Pa4aekVxHih8nibYBusu7jPPM V2ly2P9DDgNTjC46276Kt2lv/OKnVbfgdFGxb/Rztd2lsuS9zZI2UFFH1QA1Xh8Bvn7x8s M3M3de5e0wxvVAbO2hFdKFulWnoCVDWsfgX38UhOEMaRicSpEoP7DK3Tq9hetSscGgB//+ RlDKR4oBo8u0DODdACNaTwFd2DCfKc/9aP0yXjjII/VkpkehwibGyB/fVBxATQcFIoMZcY nZfRYNj6piIEt1WhxgBXpsvfaP3oQ5lAC3ZdrEUUHjgX5hJhwyLMdUGchiCivw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766163355; a=rsa-sha256; cv=none; b=WSV7CkwQO4Gj9vb1gcpCeDeM4zjxk/aDYs5pPSfUHojsj8HUoiCIJ3MB7lY4Fi1e+OFV9q iVZ1lzPBxRrSAJv6ve93rPyRUSQ+NVTGoZkcSJnRyF6NqnTi5RUkKg/vUIfjwtW8cI4FM2 DPRShNaLIIVybAicNFBF5CmGPzW0Pk0iPmiXsfViY1vHqjW10KFOuCxdC6lWjeA1aZKEsJ PP0USMgA1DPeil9QYCCrqaEa00H+5G7h9HkTsVuxgwsy9G/wGuXmhECkevSR8aWHPylGuu yGvYGvey6hCEeTF3nQGpTbXaQrXCxygAyK7+PsLVWRPpkBi7GlRSdIMDhqH3pg== 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 4dXtvv3jvpz2Lh for ; Fri, 19 Dec 2025 16:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c545 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 16:55:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 33bc1fb48e32 - stable/13 - netlink: Don't overwrite existing data in a linear buffer in snl_writer 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 33bc1fb48e32bba89535d6814850a9e98e2658d5 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 16:55:55 +0000 Message-Id: <6945839b.c545.4a3996af@gitrepo.freebsd.org> The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=33bc1fb48e32bba89535d6814850a9e98e2658d5 commit 33bc1fb48e32bba89535d6814850a9e98e2658d5 Author: John Baldwin AuthorDate: 2025-12-10 15:30:31 +0000 Commit: John Baldwin CommitDate: 2025-12-19 16:55:36 +0000 netlink: Don't overwrite existing data in a linear buffer in snl_writer First, a bit of background on some of the data structures netlink uses to manage data associated with a netlink connection. - struct linear_buffer contains a single virtually-contiguous buffer of bytes. Regions of this buffer are suballocated via lb_allocz() which uses a simple "bump" where the buffer is split into an allocated region at the start and a free region at the end. Each allocation "bumps" the boundary (lb->offset) forward by the allocation size. Individual allocations are not freed. Instead, the entire buffer is freed once all of the allocations are no longer in use. Linear buffers also contain an embedded link to permit chaining buffers together. - snl_state contains various state for a netlink connection including a chain of linear buffers. This chain of linear buffers can contain allocations for netlink messages as well as other ancillary data buffers such as socket address structures. The chain of linear buffers are freed once the connection is torn down. - snl_writer is used to construct a message written on a netlink connection. It contains a single virtually-contiguous buffer (nw->base) allocated from the associated snl_state's linear buffer chain. The buffer distinguishes between the amount of space reserved from the underlying allocator (nw->size) and the current message length actually written (nw->offset). As new chunks of data (e.g. netlink attributes) are added to the write buffer, the buffer is grown by snl_realloc_msg_buffer by reallocating a larger buffer from the associated snl_state and copying over the current message data to the new buffer. Commit 0c511bafdd5b309505c13c8dc7c6816686d1e103 aimed to fix two bugs in snl_realloc_msg_buffer. The first bug is that snl_realloc_msg_buffer originally failed to update nw->size after growing the buffer which could result in spurious re-allocations when growing in the future. It also probably could eventually lead to overflowing the buffer since each reallocation request was just adding the new bytes needed for a chunk to the original 'nw->size' while 'nw->offset' kept growing. Eventually the new 'nw->offset' would be larger than 'nw->size + sz' causing routines like snl_reserve_msg_data_raw() to return an out-of-bounds pointer. The second change in this commit I think was trying to fix the buffer overflows due to 'nw->size' being wrong, but instead introduced a new set of bugs. The second change ignored the returned pointer from snl_allocz() and instead assumed it could use all of the currently-allocated data in the current linear buffer. This is only ok if the only data in the linear buffer chain for the associated snl_state is the snl_writer's message buffer. If there is any other data allocated from the snl_state, it could be earlier in the current linear buffer, so resetting new_base to nw->ss->lb->base can result in overwriting that other data. The second change was also over-allocating storage from the underlying chain of linear buffers (e.g. a writer allocation of 256 followed by 512 would end up using the first 512 bytes, but 768 bytes would be reserved in the underlying linear buffer). To fix, revert the second change keeping only the fix for 'nw->size' being wrong. Reviewed by: igoro, markj Fixes: 0c511bafdd5b ("netlink: fix snl_writer and linear_buffer re-allocation logic") Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D54148 (cherry picked from commit 255af72c8059b0117db646f82efa2e4848fa7570) --- sys/netlink/netlink_snl.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 8c31c5d31671..1ddaf0787369 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -707,6 +707,7 @@ static inline bool snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) { uint32_t new_size = nw->size * 2; + char *new_base; while (new_size < nw->size + sz) new_size *= 2; @@ -714,23 +715,20 @@ snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) if (nw->error) return (false); - if (snl_allocz(nw->ss, new_size) == NULL) { + new_base = snl_allocz(nw->ss, new_size); + if (new_base == NULL) { nw->error = true; return (false); } - nw->size = new_size; - void *new_base = nw->ss->lb->base; - if (new_base != nw->base) { - memcpy(new_base, nw->base, nw->offset); - if (nw->hdr != NULL) { - int hdr_off = (char *)(nw->hdr) - nw->base; + memcpy(new_base, nw->base, nw->offset); + if (nw->hdr != NULL) { + int hdr_off = (char *)(nw->hdr) - nw->base; - nw->hdr = (struct nlmsghdr *) - (void *)((char *)new_base + hdr_off); - } - nw->base = new_base; + nw->hdr = (struct nlmsghdr *)(void *)(new_base + hdr_off); } + nw->base = new_base; + nw->size = new_size; return (true); } From nobody Fri Dec 19 18:05:56 2025 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 4dXwSj0vjmz6M8wF for ; Fri, 19 Dec 2025 18:05: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwSj00fQz447v for ; Fri, 19 Dec 2025 18:05:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167557; 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=b+YKbAkcnCp1JJ3VAxmp25PWiqXlLXh4JnsH9yAQulM=; b=BkfBCirPPDAenjhF0lKHRyYe33LPfFojBS4piFKctweZAebSH4Mf+y1byHOcEWqswa4vEU IdDqJT0thLXzj2dY/lhtOqi2hoLwUkt+Hlq6os5D0qaQZhOEwYPeMD7upIknhme4YXQwnS br9dWnnmJLp+Qwqkm9gywKPcRROP70RM7cnADWsz3Mehr5+7idnFVANIWj3kGgwl/dO4XD EBpdeuymEav9g9rvDpQApw4f47pqrsRoo/dFKJhGPRP0BRt7+ep85vKXpEiZFXrHdRQK5u G9s/+gjQ1lZUc5PVf7O7EqoXQkV7FGFATPssxEUY+y8Oazhx5I2SwNH1M+YY8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167557; 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=b+YKbAkcnCp1JJ3VAxmp25PWiqXlLXh4JnsH9yAQulM=; b=W7Yj9DUP714sOBaKxUhSEDxwXmMuaX1h4AIMNFlH3i8shaQI1MyBFnxABayHikFXJCGRUl lEG1Pwvi6FaBOGaqOOxMF501LY62P6CfkFoxNGxmCF3GTz90UdE04TfnKN673zaC9QLfvT V564MMlg2aZzGS5D3cL7K2atSAIdvmboE+0+susFitH6mk4LCePmHDa8qWf7ieVaZ3l9mk S+FXYZike83XWx5zgFv8YZW2Xo8DDrYISgYVPQ+Uz8+AKAUYeKA4MkQSquV+4Xk+JQdX3U I3s4MDTrexUba2wYEbFF8gkXFmCsHjk4XVfZ5b4PtRM0FlP0x8Zxow/8H7LEkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167557; a=rsa-sha256; cv=none; b=ATlgB6mg1NSrknSStkP2i82e+j6An/l3jLbgSZeLVYicXNe+uVzawc8V5RnXe9MCJNv18T TswaYv0GOg20boEissLosP6grMpwGIBKybLbu2L5CInVBnGY8kgF9eNjZVSRJ8it/DgDD5 /jKHQCSx+I88QapsHiDAaA0o656gBzkze24HRbw51klo8m4ZHGRjLeur6gM/mw2X6qjZ1d bKlzmWRyuUPZvmixBG09+OmSl775Hh9+f5wnC2sB8kco407hzm+IliHZu3Na6OOQ7VOnWa NLWpU3vS1SzuOLWp/k1jOuUYx9u7gDrIytSnVOHMcWiIQb3hbu2DHCKedDHTZQ== 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 4dXwSh69G7z4Cx for ; Fri, 19 Dec 2025 18:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 235bc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:05:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 3ed0824b743a - stable/15 - vm: Fix kstack alignment assertion 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3ed0824b743af50a60402070c94f23591c75162f Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:05:56 +0000 Message-Id: <69459404.235bc.7cee7ea5@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3ed0824b743af50a60402070c94f23591c75162f commit 3ed0824b743af50a60402070c94f23591c75162f Author: Dag-Erling Smørgrav AuthorDate: 2025-12-11 09:01:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:05:43 +0000 vm: Fix kstack alignment assertion The expectation that the allocation will be aligned to the kstack size only applies when allocating from a kstack arena, not when allocating a non-standard size from the kernel arena. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Fixes: 7a79d0669761 ("vm: improve kstack_object pindex calculation to avoid pindex holes") Reviewed by: bnovkov, siderop1_netapp.com Differential Revision: https://reviews.freebsd.org/D54171 (cherry picked from commit a35545ee02680cee04c354b50182dd94d4489666) --- sys/vm/vm_glue.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 18d789c59281..925bb92cdd75 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -321,10 +321,12 @@ vm_thread_alloc_kstack_kva(vm_size_t size, int domain) rv = vmem_alloc(arena, size, M_BESTFIT | M_NOWAIT, &addr); if (rv == ENOMEM) return (0); - KASSERT(atop(addr - VM_MIN_KERNEL_ADDRESS) % - (kstack_pages + KSTACK_GUARD_PAGES) == 0, - ("%s: allocated kstack KVA not aligned to multiple of kstack size", - __func__)); + if (size == ptoa(kstack_pages + KSTACK_GUARD_PAGES)) { + /* This expectation only applies to kstack arenas */ + KASSERT((addr - VM_MIN_KERNEL_ADDRESS) % size == 0, + ("%s: allocated kstack KVA not aligned to multiple of kstack size", + __func__)); + } return (addr); #else From nobody Fri Dec 19 18:05:57 2025 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 4dXwSk2GJ6z6M8wG for ; Fri, 19 Dec 2025 18:05:58 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwSk07BZz44P9 for ; Fri, 19 Dec 2025 18:05:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167558; 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=YuASrwej5VacWpRy3WWVL1Oqp6LvRhEqKRr4NOvBJys=; b=tiaJ1WnP9VrbNgunCtijHiBqkW+V1wVG3U6f7Zq5UO/uyIL/L6pEAp+r8W+Y9/z2CUEbSS +KhAslkc8QaUXWiWOO9+X8K7qRdD67lHWzt5Is5+kMYe5b3j8rdcKXjrQgC8W5nkv9MTJ/ /Z27fC3cMrqeYwIOntTJBjSHAYsFVGUCpGHfc5/YayFSyoifqck6juGTNQmnP6kr63VEjV ZOZNmn1ui89hpO5nsB6pkmUr7d2rErIFpTiS960MHDQNlwivJT8/aqcgGnaZQbbrEqApy7 bMhFxsEyBPdNrx0rhYezNQiwOaL3tksNnY4RdVhr0DilkzqfbS8nDH/AptKIYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167558; 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=YuASrwej5VacWpRy3WWVL1Oqp6LvRhEqKRr4NOvBJys=; b=yFDIyRFEMdAThiSeNE+19a+dIIedNi2RZijBiwKb5t/yYUhQdGueK/tvQF3zfzNRjr6mgi lCmfV8CClGNc2ysutjKMOhIjAmXkkxZCARBalleBeLWsUSW2qFI5l/Y8yo6y91MZ/XdlEr H5ZNRTlWmMVKIeW17tx2QFilhgnmvSEmcThka0FM+8o2q3qqtofEhjP8JzuXQdT5g0J4WO Sy2827E4SaXafJquDXVHDTZdQhuJ4v5azGMK/iWjRy94yiWor7+/7e9/KdDS8HM7QZgFAx sbx3a9mJBBmFa5ogz7XaWCJjGXg37FfMSAQt3Oj/3Nys/nTnCgD/Cm5pqmEE5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167558; a=rsa-sha256; cv=none; b=rcaIw1RpjLDLIKcUs9mO8eCHEE9mubztMLCwVAVaKwt44TvpXvkrAr+V6cCNwP5e1BZOTd LDKdCbiDpMXiD+6u0Tn5m3GBnQabNHIg3tdtTFk+2E9b0QyEDUpJJR71OgTPa4vfbjUqCB MLU41owaq3rdNoD2G001xb5YL32YPJV+mQnqLRlcaNpfECnipTxNYygri7sAGqK61oWWwo XLNJK8dzO254Py+YMTAHzEnBiD/sfHkWFn5BUDpdZZ1mw2oFbM49nf36UEqTp8a5/1g8yM yjCt8Tcz+n6o7ZlKCHIFNNIO9ZqsUmg7MJSl3zzbbmTN3oa3oap9dgQ/sXAoSw== 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 4dXwSj6XLtz4D0 for ; Fri, 19 Dec 2025 18:05:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 229eb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:05:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: b43159901f11 - stable/15 - vfs: Let prison_enforce_statfs zero the fsid 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b43159901f11cb379176215cc573971c2148d18f Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:05:57 +0000 Message-Id: <69459405.229eb.50f4e87b@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b43159901f11cb379176215cc573971c2148d18f commit b43159901f11cb379176215cc573971c2148d18f Author: Dag-Erling Smørgrav AuthorDate: 2025-12-14 13:16:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:05:43 +0000 vfs: Let prison_enforce_statfs zero the fsid Currently, we unconditionally zero the fsid before returning a struct statfs to a jailed process. Move this into prison_enforce_statfs() so it only happens if enforce_statfs is greater than 1, or enforce_statfs is 1 but the mountpoint is outside the jail. PR: 291301 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54214 (cherry picked from commit d4f25d0c7957f0f1960028eec82625c2d6405537) --- sys/kern/kern_jail.c | 3 +++ sys/kern/vfs_syscalls.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 26a994ef0c32..43b485b161a4 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -4112,11 +4112,14 @@ prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp) if (pr->pr_enforce_statfs == 0) return; if (prison_canseemount(cred, mp) != 0) { + bzero(&sp->f_fsid, sizeof(sp->f_fsid)); bzero(sp->f_mntonname, sizeof(sp->f_mntonname)); strlcpy(sp->f_mntonname, "[restricted]", sizeof(sp->f_mntonname)); return; } + if (pr->pr_enforce_statfs > 1) + bzero(&sp->f_fsid, sizeof(sp->f_fsid)); if (pr->pr_root->v_mount == mp) { /* * Clear current buffer data, so we are sure nothing from diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 07c28a2b462a..5eaa9d0ef120 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -290,10 +290,8 @@ kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) error = VFS_STATFS(mp, buf); if (error != 0) goto out; - if (priv_check_cred_vfs_generation(td->td_ucred)) { - buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + if (priv_check_cred_vfs_generation(td->td_ucred)) prison_enforce_statfs(td->td_ucred, mp, buf); - } out: vfs_unbusy(mp); return (error); @@ -545,7 +543,6 @@ restart: sptmp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); *sptmp = *sp; - sptmp->f_fsid.val[0] = sptmp->f_fsid.val[1] = 0; prison_enforce_statfs(td->td_ucred, mp, sptmp); sp = sptmp; } else From nobody Fri Dec 19 18:05:59 2025 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 4dXwSl3BpGz6M8sl for ; Fri, 19 Dec 2025 18:05:59 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwSl0j5pz44Ct for ; Fri, 19 Dec 2025 18:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167559; 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=mewXLb/z+73QxAKHaZfqIImULBibkIgo3BHIaSvIdz4=; b=V4HmKbUcTUlwLhHeMypLyeJ2XGUPpyj2JrtCgJrnaEoDb8qPRAVKQ3drSVPPgFl+2UKZDz wYNHAMil0H0goEQ7guhcbxX+cmcNKHTikHncTKNHPdkdXfxTUWoosvbRT2qRMopTNaOypH nQqDc57uGO6uDHsS+Xp9XtTBjHgoETqG4PZE3te6/2ggVNMZQCLhiMMRXgMeM6ylpcciqj JFxL1RGQfmFlZevgDQuW583rDijIQCFRsffvMfioNlmqfnbU9HRJr0SsrfSc5qaMhW5c2P eeES0EMXoiaTJ9glr9sksJ8j58qViC13NJue48OJq4EFK5F20EQWIAFjMP0pwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167559; 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=mewXLb/z+73QxAKHaZfqIImULBibkIgo3BHIaSvIdz4=; b=DkgetjrthsbvTxEmXHtwn+MZdT6TYhF9hOjxNhVCXeRpsjOA85ZiOMMp1FI8DqpHK/7oR5 jiKv1ndjY77Q7aR91YXIdHNXB/lYw7UpXCkkkZDpiQxZMFkm9+Pm7Bk4uvNTKExRyj3Cb9 6CRh7vkyV/MYPCZCUvBqwxu6iC+kMGus8B1RveGaOuwLmb7mCOPfO+PqF9w8ocHDBP6XVb 4c9rc6baAELJN8/ceRdKcEttGKFI7g/aTVT9GRSe67VbRKPjMNR7J9rq3XsMi30EMlb4PP K+D7AHw4BONhtkC8dQeEt2wDU/iVUvG6uQ3e4TuFdLrznqYJ7cvJh86jOakviA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167559; a=rsa-sha256; cv=none; b=ManZRv7BHccYtz0NKxdLBxL+PkGq2/Q1hhlFcZ9B74nKHjzplzCeQarRdpwYXo9u8QiKUM MMSegQfELSArnkBv2oyJbYFeGf9UjThjDBqOz37aOwniZgk9eilUfnF/O5Uod9+QDzx2t4 5laHvA7/YIjbH2PqpbbKyw2+NT79lRxYf5vvS9vYrVizSQAS/0YulylvqyTw8XfuOK5qWf hcuDlIYb1rUw7kaX/F6p/hlrMNWZO5NhupSOh2+nsd+LdSzdNmrFQ64YUuKMXH7IIZOIgJ enQJZnIbVkTTk8NpXf7ihJ1GfEgyDk1DU5fmiOE6ov+sgc2x9dGCc8A6tb3Xyg== 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 4dXwSl0HzQz47g for ; Fri, 19 Dec 2025 18:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 231a2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:05:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: faac79511757 - stable/15 - proc: Fix proc_init / proc_dtor ordering issues 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: faac79511757177ee51e44af0a4e57cee742f390 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:05:59 +0000 Message-Id: <69459407.231a2.4b03790c@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=faac79511757177ee51e44af0a4e57cee742f390 commit faac79511757177ee51e44af0a4e57cee742f390 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-14 13:16:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:05:44 +0000 proc: Fix proc_init / proc_dtor ordering issues * Move the initialization of p_ktr into proc_init() and make the check in proc_dtor() unconditional. Prior to this, it was possible to fail and invoke proc_dtor() after the first thread had been created (which was the condition for checking p_ktr in proc_dtor()) but before p_ktr had been initialized. * Move the p_klist initialization in fork1() past the last possible failure point so we don't have to free it on failure. We didn't, which meant we were leaking a knlist every time we failed to fork due to hitting the resource limit. PR: 291470 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54215 (cherry picked from commit 026d962ef14dafe19fa73361bea6dcc95f141dfa) --- sys/kern/kern_fork.c | 4 ++-- sys/kern/kern_proc.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 599ea374ee8c..49dad70a8380 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1063,8 +1063,6 @@ fork1(struct thread *td, struct fork_req *fr) #ifdef MAC mac_proc_init(newproc); #endif - newproc->p_klist = knlist_alloc(&newproc->p_mtx); - STAILQ_INIT(&newproc->p_ktr); /* * Increment the count of procs running with this uid. Don't allow @@ -1077,6 +1075,8 @@ fork1(struct thread *td, struct fork_req *fr) chgproccnt(cred->cr_ruidinfo, 1, 0); } + newproc->p_klist = knlist_alloc(&newproc->p_mtx); + do_fork(td, fr, newproc, td2, vm2, fp_procdesc); error = 0; goto cleanup; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 6e56664d12ce..8f86ce349e30 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -241,11 +241,9 @@ proc_dtor(void *mem, int size, void *arg) p = (struct proc *)mem; td = FIRST_THREAD_IN_PROC(p); if (td != NULL) { -#ifdef INVARIANTS KASSERT((p->p_numthreads == 1), - ("bad number of threads in exiting process")); - KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); -#endif + ("too many threads in exiting process")); + /* Free all OSD associated to this thread. */ osd_thread_exit(td); ast_kclear(td); @@ -253,6 +251,7 @@ proc_dtor(void *mem, int size, void *arg) /* Make sure all thread destructors are executed */ EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); } + KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); #ifdef KDTRACE_HOOKS kdtrace_proc_dtor(p); @@ -281,6 +280,7 @@ proc_init(void *mem, int size, int flags) p->p_stats = pstats_alloc(); p->p_pgrp = NULL; TAILQ_INIT(&p->p_kqtim_stop); + STAILQ_INIT(&p->p_ktr); return (0); } From nobody Fri Dec 19 18:06:00 2025 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 4dXwSn2tDbz6M9Mx for ; Fri, 19 Dec 2025 18:06:01 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwSm5TnLz44PS for ; Fri, 19 Dec 2025 18:06:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167560; 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=NZ1L2CMjsTk7Z4NHDniTeibTP8c9lo78HBwPEGfN/bs=; b=HcS/u2bY5PK0bqwbKboBbwTaxU3sBYYbjz7UmJ31aJaI3zSnTTU3uoXmgszd3oxEat10ZX J01io6DjsCvayTAzStRWwES7WflalPqrmzsoqoiy7xWSRSdJP5/aDDtwU5h8VzSsLei1dg ZR4oc5SC8MYIqG3WoR+EFxHzqNXjPTNg0RtfZ7MN74DnJEXGV+DFLchQ/F9ZcIom217vsR /Jo1CnnWfElwW0URhW0pcAw2bLUt7mgowgwjn/jFkME7J51afdsfBfllLi+5ErRJVF3ncs wvT9mNPvI5rfBqMam6nPOMbzNtkqnYZyvHfoQghBbeDk/TUuCZAGBO5MAD75jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167560; 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=NZ1L2CMjsTk7Z4NHDniTeibTP8c9lo78HBwPEGfN/bs=; b=GMCNb5Vq2yRkqdk4eseCHsTtofwGvDBAJOZATIwY3D7tj73+JNJzxDtXqXWAELcr/cR239 7R7+T6XAS56x/FcyeRizk0TMq0/9QdNMcoWhfasgV8wdPmRO/uEhHXuItCXA5AAmG18gQp KOkEnYPZBa8oh3o9s6TT2R7Jd8SuLmf//Z3wbnQ6hxxgZx6ZOj4vQLc8TG6gHyDuaWPLeE 7Qx4T74a22I2doewy+w4pR8Clut/UOub6jvMPr562bTXQX4wLQgjXg+MSWzse6d96RI6ev 9dxvdPIza8/KhZ9+ASemU0AhX/4hGR5c1nfpgW2m7s9s0YVgEC2ZegE6en1hlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167560; a=rsa-sha256; cv=none; b=A4cbPnFLs1gywO1xvv3Ui1CjZoEBLWJ/afkNae29joq6c5I4wzbMOGcitcN78XFlaMOW5I HWqU8gksGxSGqKysCZJT2QDq+PVlCs44aDxgKC4wo8JGOI1yaH5vRuaqGZhtKMfs8Ve11D pzyRrKy1PKcLKnop2frdGjp8L1WJjgVONafq7DsXRp9nGcCi5IgQf7G9Ma7cZEGQ54Sl/P Zi5fj1KWELxagvJoe4h+cg5lcsQNRbkFApBE5iSJYDVLIPIJqPjBTtvnivUPHBwKFy2hvo xxroxYSj+MXNrIygnvxmV7hBSRjIBWTmS3KIrK2RyDB23goScvQc1YXrT8NCKQ== 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 4dXwSm0qr3z41j for ; Fri, 19 Dec 2025 18:06:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23b3a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:06:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 594ed1aab6f5 - stable/15 - ipfilter: Prevent stack buffer overflow 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 594ed1aab6f5666cd891151737489f448c039849 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:06:00 +0000 Message-Id: <69459408.23b3a.3073b68c@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=594ed1aab6f5666cd891151737489f448c039849 commit 594ed1aab6f5666cd891151737489f448c039849 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-16 16:11:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:05:44 +0000 ipfilter: Prevent stack buffer overflow When copying ipfs data from user space, don't just check that the payload length is nonzero, but also that it does not exceed the size of the stack buffer we're copying it into. While we're at it, use a union to create a buffer of the exact size we need instead of guessing that 2048 will be enough (and not too much). Finally, check the size of the payload once it gets to where it's used. MFC after: 3 days Reported by: Ilja Van Sprundel Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D54194 (cherry picked from commit a34c50fbd2a52bb63acde82e5aec4cb57880e39b) --- sbin/ipf/libipf/interror.c | 5 ++++ sys/netpfil/ipfilter/netinet/ip_sync.c | 51 ++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/sbin/ipf/libipf/interror.c b/sbin/ipf/libipf/interror.c index a8dc3be2d5d1..29923163212f 100644 --- a/sbin/ipf/libipf/interror.c +++ b/sbin/ipf/libipf/interror.c @@ -472,6 +472,11 @@ log" }, { 110019, "sync update could not find NAT entry" }, { 110020, "unrecognised sync NAT command" }, { 110021, "ioctls are not handled with sync" }, + /* missing entries 110022-110024 */ + { 110025, "invalid payload length (sync create state)" }, + { 110026, "invalid payload length (sync update state)" }, + { 110027, "invalid payload length (sync create NAT)" }, + { 110028, "invalid payload length (sync update NAT)" }, /* -------------------------------------------------------------------------- */ { 120001, "null data pointer for iterator" }, { 120002, "unit outside of acceptable range" }, diff --git a/sys/netpfil/ipfilter/netinet/ip_sync.c b/sys/netpfil/ipfilter/netinet/ip_sync.c index f6bc7e7fbe2a..b0be68148a18 100644 --- a/sys/netpfil/ipfilter/netinet/ip_sync.c +++ b/sys/netpfil/ipfilter/netinet/ip_sync.c @@ -409,13 +409,16 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synchdr_t sh; - - /* - * THIS MUST BE SUFFICIENT LARGE TO STORE - * ANY POSSIBLE DATA TYPE - */ - char data[2048]; - + union ipf_sync_data { + union ipf_sync_state_data { + ipstate_t create; + synctcp_update_t update; + } state; + union ipf_sync_nat_data { + nat_t create; + syncupdent_t update; + } nat; + } data; int err = 0; # if defined(__NetBSD__) || defined(__FreeBSD__) @@ -494,18 +497,18 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) * needed for the request */ - /* not supported */ - if (sh.sm_len == 0) { + /* too short or too long */ + if (sh.sm_len == 0 || sh.sm_len > sizeof(data)) { if (softs->ipf_sync_debug > 2) - printf("uiomove(data zero length %s\n", - "not supported"); + printf("uiomove(data) invalid length %d\n", + sh.sm_len); IPFERROR(110006); return (EINVAL); } if (uio->uio_resid >= sh.sm_len) { - err = UIOMOVE(data, sh.sm_len, UIO_WRITE, uio); + err = UIOMOVE(&data, sh.sm_len, UIO_WRITE, uio); if (err) { if (softs->ipf_sync_debug > 2) @@ -519,9 +522,9 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) sh.sm_len); if (sh.sm_table == SMC_STATE) - err = ipf_sync_state(softc, &sh, data); + err = ipf_sync_state(softc, &sh, &data); else if (sh.sm_table == SMC_NAT) - err = ipf_sync_nat(softc, &sh, data); + err = ipf_sync_nat(softc, &sh, &data); if (softs->ipf_sync_debug > 7) printf("[%d] Finished with error %d\n", sh.sm_num, err); @@ -651,6 +654,11 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) { case SMC_CREATE : + if (sp->sm_len != sizeof(sn)) { + IPFERROR(110025); + err = EINVAL; + break; + } bcopy(data, &sn, sizeof(sn)); KMALLOC(is, ipstate_t *); if (is == NULL) { @@ -717,6 +725,11 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; case SMC_UPDATE : + if (sp->sm_len != sizeof(su)) { + IPFERROR(110026); + err = EINVAL; + break; + } bcopy(data, &su, sizeof(su)); if (softs->ipf_sync_debug > 4) @@ -892,6 +905,11 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; } + if (sp->sm_len != sizeof(*nat)) { + IPFERROR(110027); + err = EINVAL; + break; + } nat = (nat_t *)data; bzero((char *)n, offsetof(nat_t, nat_age)); bcopy((char *)&nat->nat_age, (char *)&n->nat_age, @@ -915,6 +933,11 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; case SMC_UPDATE : + if (sp->sm_len != sizeof(su)) { + IPFERROR(110028); + err = EINVAL; + break; + } bcopy(data, &su, sizeof(su)); for (sl = softs->syncnattab[hv]; (sl != NULL); From nobody Fri Dec 19 18:06:10 2025 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 4dXwSz0grcz6M9Fk for ; Fri, 19 Dec 2025 18:06:11 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwSy3JjDz44Ty for ; Fri, 19 Dec 2025 18:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167570; 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=TDC91gViYEcZe9RwdM3tAVjC1n2XcWTnuGX7ZXx2w+A=; b=GaezTcKaH0B9aolBLgQU3+8erCyRKUeyqxAMubN/eH+YPsZKbQuhIifeghvKjukwiKvKxL u9MabZIyOKdS+HB9ZDQVaTNERMKWqiPYl1R0paDOE1KbD/wTzrfuEiasqkAyQhYdwfvZrE 5+7+YAQwGGOGNxQBO6iKnBr/KPT4NaH/zamkSzacU6rn1D12MMfgX2IWBAnPcwg3c8pFdb osLN42yIO1ahWrmQtmvxnAJda6d0BwYB0Vj0BZrQb4CRewP7fJ+HUj72XZ7+opfGyJbtHA x0fnbtQ/9EiWknUIOn9upfx1lzzQXVKxlteafkwO/pj4D3J22bUr5E+WKNMbCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167570; 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=TDC91gViYEcZe9RwdM3tAVjC1n2XcWTnuGX7ZXx2w+A=; b=ppJX6nF2d3TrytxayM6mHWPWY9rLD+oq0/eCAqQ9t6mNj+1hyX8PgOzzsn/QoEUDz19FRH JuuHNwb3ZhAX5wgS87TV2GgFY80YR27JOy2qnYOPKkWnedQvpMcqeCqcvn5s8yE5+ZbVpb uameDo5JF7Rjgvz0C9uGDSN9HSR0agRct18o86eobjdGfLbDKrSuiSQFUkk2upA/EqVn8Z Cm9YvIjTyqMpoHWmxoub1b5m+xhkabhfs8bjEr7uwEQui9iAQwYBfnW13MkmYHhBOq8Cxj 6Kq28tCg9nED1JqjB123j4E6AJK9chTMuz4lgmOeyIClv1wXHZTVD0wFkgenXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167570; a=rsa-sha256; cv=none; b=sarni4/lrScX0ItG5jTrm4VoL2wlktt/FZ72NJqMmF/oe8WkpHWutzKirLnwcPSPosiheP XEwUvPauBkO8T/8egVC4peL8VAY3dQEQA/LtBuU3LML6p2Y2Yrt0DYZhRYHp1MN8d4e2nl bFlOL1lVmmEO7EvDieUc/OgmdcwsNEdkwzVSiDaA6EXbGGeTYuWRpwKxNV5LVMOZWgXASX 5phShJNDkuq75mnrQuhgbY2hL+vXdR1Qg6VqiSA3gYrct9EYP/eMMwqaJAbD/loXSXkfHA 1xogDwdhSxe7jaeI5aKPLxGO1MFGRX+Rb09FdZpPeCdbAFxkPA7cHuT/RiMTsw== 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 4dXwSy2hgbz3wL for ; Fri, 19 Dec 2025 18:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 225b7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:06:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 00bdb832fd5d - stable/14 - proc: Fix proc_init / proc_dtor ordering issues 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00bdb832fd5def6dee43773d93a4f69c8db44643 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:06:10 +0000 Message-Id: <69459412.225b7.370f91ff@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=00bdb832fd5def6dee43773d93a4f69c8db44643 commit 00bdb832fd5def6dee43773d93a4f69c8db44643 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-14 13:16:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:06:00 +0000 proc: Fix proc_init / proc_dtor ordering issues * Move the initialization of p_ktr into proc_init() and make the check in proc_dtor() unconditional. Prior to this, it was possible to fail and invoke proc_dtor() after the first thread had been created (which was the condition for checking p_ktr in proc_dtor()) but before p_ktr had been initialized. * Move the p_klist initialization in fork1() past the last possible failure point so we don't have to free it on failure. We didn't, which meant we were leaking a knlist every time we failed to fork due to hitting the resource limit. PR: 291470 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54215 (cherry picked from commit 026d962ef14dafe19fa73361bea6dcc95f141dfa) --- sys/kern/kern_fork.c | 4 ++-- sys/kern/kern_proc.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 8abf6ebc20be..7731ae4d14f3 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1063,8 +1063,6 @@ fork1(struct thread *td, struct fork_req *fr) #ifdef MAC mac_proc_init(newproc); #endif - newproc->p_klist = knlist_alloc(&newproc->p_mtx); - STAILQ_INIT(&newproc->p_ktr); /* * Increment the count of procs running with this uid. Don't allow @@ -1077,6 +1075,8 @@ fork1(struct thread *td, struct fork_req *fr) chgproccnt(cred->cr_ruidinfo, 1, 0); } + newproc->p_klist = knlist_alloc(&newproc->p_mtx); + do_fork(td, fr, newproc, td2, vm2, fp_procdesc); error = 0; goto cleanup; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index b7fa7bfb60e9..c4d5356bb292 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -241,11 +241,9 @@ proc_dtor(void *mem, int size, void *arg) p = (struct proc *)mem; td = FIRST_THREAD_IN_PROC(p); if (td != NULL) { -#ifdef INVARIANTS KASSERT((p->p_numthreads == 1), - ("bad number of threads in exiting process")); - KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); -#endif + ("too many threads in exiting process")); + /* Free all OSD associated to this thread. */ osd_thread_exit(td); ast_kclear(td); @@ -253,6 +251,7 @@ proc_dtor(void *mem, int size, void *arg) /* Make sure all thread destructors are executed */ EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); } + KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); #ifdef KDTRACE_HOOKS kdtrace_proc_dtor(p); @@ -281,6 +280,7 @@ proc_init(void *mem, int size, int flags) p->p_stats = pstats_alloc(); p->p_pgrp = NULL; TAILQ_INIT(&p->p_kqtim_stop); + STAILQ_INIT(&p->p_ktr); return (0); } From nobody Fri Dec 19 18:06:11 2025 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 4dXwT005rjz6M9N3 for ; Fri, 19 Dec 2025 18:06:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwSz3xm8z44c6 for ; Fri, 19 Dec 2025 18:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167571; 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=F8Sz7pMkbj/uVkDTTJRG51U5J7ZUGuEUdG1iAuYcJm8=; b=gGyMMiZ/393yRnRq6+JvmZhL/PJjPFoUqC8h6YuEWk9LALJGhtzaHxkKvfsIDj10+E2ORf R/RoAEnTBafbZDTame9Lp4344LmeA+UMMHdTZvvqawNt08Y3Kx6YA+cCJ1+YypxkCxrY7D gq9Sh5VHSQMfkgG9aLG2OQtQPUTjBgSAs88nfYVSSY1RO9oN8BqWRtVdbmks5Ef9QyUyup aE0Pld0GHKU2jLnwhwxGM3OwyMcHScv45IbfcnHZry7UotrxLUpHkLLvinPllkHhL4x/dn S2ejENUBSaHiOttcfWrPiLJ/7wDMnChnVR6SE19rDttw8WG24IyraNOpMlzIjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167571; 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=F8Sz7pMkbj/uVkDTTJRG51U5J7ZUGuEUdG1iAuYcJm8=; b=wOIiBPLv7DoN6gjbWG73WbvIccKCNgN3gNeIDcXnHUZJm4rDH3Mh9IKXAajLVpuPhVFl7m 4htICOzld8c4+zjxMvdfCzpwjZ0G3t5JlH/2ntVN51cyhwRA9PRdn1nbGzVNl5lAHtw9SZ vJVJjwz1qCFUcKKoxqFCOhZOXrC2Cp19/blPjkHHQcb8HJEkKHz14HmEK0KgNQ7zh++Q2A 7bYUBGmmg0g/hjy8gKxyNsteVN64cjHWe2OU0QBM6XgNEj87TR0fpX6HskqA3yNDhy9TDJ qbXSPCbjheYopAMF6uA9I0e/LKb3GhXtZtjRYkhTxbzN6FsIvLegDan+GjjqMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167571; a=rsa-sha256; cv=none; b=U0TFyYr7ICZUWxvMKV2jMpij5t3c7lAsg/gFq2WmhT6ElnSZQBTre2cBevyZHz9TLId6hw MNYdbFYk+DPZDx82sDi9MXTMDUPPTur9QfWJr1epLO4rCS4v39U3g39oGi5KuVZ4WDTnHc 4eOsPt7nJtf4aJIcZXMbEPEaExJ7vvConKBbL0OIoVSP9lEXIrsVfEpDXNXgo5tD4kTYhU UI3oSleBZ++8xp4su+avgRDhScKd8jeEpS1WH62plxhoSFUiJK2m/OIt4CYZDwE4z6+Z3l hjSdUN3eFqiz0HQZR0Dcki7T78okYgti+O7tnSHfWLmarLX8WAgixZE+UIFcXw== 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 4dXwSz3GNBz3kb for ; Fri, 19 Dec 2025 18:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22ac8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:06:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 1a67e18678f6 - stable/14 - ipfilter: Prevent stack buffer overflow 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a67e18678f68e616896ace72f79cd4e399b0bd3 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:06:11 +0000 Message-Id: <69459413.22ac8.2ce0e534@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1a67e18678f68e616896ace72f79cd4e399b0bd3 commit 1a67e18678f68e616896ace72f79cd4e399b0bd3 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-16 16:11:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:06:01 +0000 ipfilter: Prevent stack buffer overflow When copying ipfs data from user space, don't just check that the payload length is nonzero, but also that it does not exceed the size of the stack buffer we're copying it into. While we're at it, use a union to create a buffer of the exact size we need instead of guessing that 2048 will be enough (and not too much). Finally, check the size of the payload once it gets to where it's used. MFC after: 3 days Reported by: Ilja Van Sprundel Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D54194 (cherry picked from commit a34c50fbd2a52bb63acde82e5aec4cb57880e39b) --- sbin/ipf/libipf/interror.c | 5 ++++ sys/netpfil/ipfilter/netinet/ip_sync.c | 51 ++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/sbin/ipf/libipf/interror.c b/sbin/ipf/libipf/interror.c index 5b3836f36d60..73521a67a1b8 100644 --- a/sbin/ipf/libipf/interror.c +++ b/sbin/ipf/libipf/interror.c @@ -472,6 +472,11 @@ log" }, { 110019, "sync update could not find NAT entry" }, { 110020, "unrecognised sync NAT command" }, { 110021, "ioctls are not handled with sync" }, + /* missing entries 110022-110024 */ + { 110025, "invalid payload length (sync create state)" }, + { 110026, "invalid payload length (sync update state)" }, + { 110027, "invalid payload length (sync create NAT)" }, + { 110028, "invalid payload length (sync update NAT)" }, /* -------------------------------------------------------------------------- */ { 120001, "null data pointer for iterator" }, { 120002, "unit outside of acceptable range" }, diff --git a/sys/netpfil/ipfilter/netinet/ip_sync.c b/sys/netpfil/ipfilter/netinet/ip_sync.c index b7afe45c8f7e..51b2e544ec52 100644 --- a/sys/netpfil/ipfilter/netinet/ip_sync.c +++ b/sys/netpfil/ipfilter/netinet/ip_sync.c @@ -412,13 +412,16 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synchdr_t sh; - - /* - * THIS MUST BE SUFFICIENT LARGE TO STORE - * ANY POSSIBLE DATA TYPE - */ - char data[2048]; - + union ipf_sync_data { + union ipf_sync_state_data { + ipstate_t create; + synctcp_update_t update; + } state; + union ipf_sync_nat_data { + nat_t create; + syncupdent_t update; + } nat; + } data; int err = 0; # if defined(__NetBSD__) || defined(__FreeBSD__) @@ -497,18 +500,18 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) * needed for the request */ - /* not supported */ - if (sh.sm_len == 0) { + /* too short or too long */ + if (sh.sm_len == 0 || sh.sm_len > sizeof(data)) { if (softs->ipf_sync_debug > 2) - printf("uiomove(data zero length %s\n", - "not supported"); + printf("uiomove(data) invalid length %d\n", + sh.sm_len); IPFERROR(110006); return (EINVAL); } if (uio->uio_resid >= sh.sm_len) { - err = UIOMOVE(data, sh.sm_len, UIO_WRITE, uio); + err = UIOMOVE(&data, sh.sm_len, UIO_WRITE, uio); if (err) { if (softs->ipf_sync_debug > 2) @@ -522,9 +525,9 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) sh.sm_len); if (sh.sm_table == SMC_STATE) - err = ipf_sync_state(softc, &sh, data); + err = ipf_sync_state(softc, &sh, &data); else if (sh.sm_table == SMC_NAT) - err = ipf_sync_nat(softc, &sh, data); + err = ipf_sync_nat(softc, &sh, &data); if (softs->ipf_sync_debug > 7) printf("[%d] Finished with error %d\n", sh.sm_num, err); @@ -654,6 +657,11 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) { case SMC_CREATE : + if (sp->sm_len != sizeof(sn)) { + IPFERROR(110025); + err = EINVAL; + break; + } bcopy(data, &sn, sizeof(sn)); KMALLOC(is, ipstate_t *); if (is == NULL) { @@ -720,6 +728,11 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; case SMC_UPDATE : + if (sp->sm_len != sizeof(su)) { + IPFERROR(110026); + err = EINVAL; + break; + } bcopy(data, &su, sizeof(su)); if (softs->ipf_sync_debug > 4) @@ -895,6 +908,11 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; } + if (sp->sm_len != sizeof(*nat)) { + IPFERROR(110027); + err = EINVAL; + break; + } nat = (nat_t *)data; bzero((char *)n, offsetof(nat_t, nat_age)); bcopy((char *)&nat->nat_age, (char *)&n->nat_age, @@ -918,6 +936,11 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; case SMC_UPDATE : + if (sp->sm_len != sizeof(su)) { + IPFERROR(110028); + err = EINVAL; + break; + } bcopy(data, &su, sizeof(su)); for (sl = softs->syncnattab[hv]; (sl != NULL); From nobody Fri Dec 19 18:06:09 2025 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 4dXwT24vvqz6M9Fl for ; Fri, 19 Dec 2025 18:06:14 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwT22X3yz44cj for ; Fri, 19 Dec 2025 18:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167574; 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=2+refv5Bqty6GphUVo0rvzc4jhdvxEvjRiamNkg1IgU=; b=H4IkouYcemvY4MESZAu8ua82JdUhhSOg/0bSb57Bhu/dMOW6X+fUmyqC8nbbJGzSXurb1A N5mEJ80XolOSnsYD/RhCx+t3+IpMh3yvz+YqY3f0DzDe+jOBVuP6HRhOSq5F5y4j+puxIN uwnXx3YLQX7PI3oB602i/MLLDCMHTe2mK4ixYbnCP4leiNMb6Wa2x//l+zxjB1MoFLQ8pC R7L/m9806oAQ+c8wW059LexfSOVoIJt4zsUbfJyrk/2iOQAid/jCw1x5Wm8QixeIqf+qBf 6CJOqewa/mPjWSewXZngIePbQ3n/kmSaT4MKRNCI3kUJgIcx51Bd1u1OOhHiWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167574; 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=2+refv5Bqty6GphUVo0rvzc4jhdvxEvjRiamNkg1IgU=; b=cq2yGdYmFXPbml03YQz5/XLcXBfCT8nGoVgeZWH6diZv8xBgVOp9nSKvCIUajlk/fkegJJ r+fDRch4+vNf8uaoKVq9oSsul1iXBUh/ZB+3KOfFu81Z49YVHLHs2V3Ko0CGRgtHovNf+P YHzabnrS87cvrRQHIbIGukF+tDjEza9Y4WnFZq0CFLeICwXpghEnozxECiUTPotazt7wof X04reilDnv4HHj8ki24qS7ubgrA8BFXoVAYRvI+Ci8LEMwaPDZIBiCH5K9q/isQqIStUmE Idpax2bIFVStvpAUfNaTwqPjJ+9sHuRKudIiSEt/U89FGN6HPZ8nsTDcYcpiGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167574; a=rsa-sha256; cv=none; b=SPwvaOjdnIoBK/wr/lwGWJry1p2sz/fPHbmax1LLivUsEARv0oPTTmJ9BwvHE1o8F5TV8E jg1eEutZVp0Kx9qDe3rDmokiei4nrDsfhQg4Pe1K9BzEEJvZbcN30zgpJUa1E5Kj+oZu1o Xe4H/ngi+TRZYpH/LaH/Ff1Ii/5lcFzDc0YFHjjhvp49Gkkz3IhFYq0fGkZFjGuO5Hw70K 0LhFosIsfJg5nz7a4UxTAM2RTFsvJNHGHuDe71cVbbh24WC4ZibjWJii9SSm6EuaWDCLnH jWaygVHGLsn3p0/cCehKqfUhZlOA0uWxSe4+n685nahaQD+pmMxcPaxUZ5wtUw== 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 4dXwT21mY8z4GL for ; Fri, 19 Dec 2025 18:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20874 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:06:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 90e09bfe799d - stable/14 - vfs: Let prison_enforce_statfs zero the fsid 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 90e09bfe799dc96e7e6e0071a053852cad152d96 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:06:09 +0000 Message-Id: <69459411.20874.59e1b121@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=90e09bfe799dc96e7e6e0071a053852cad152d96 commit 90e09bfe799dc96e7e6e0071a053852cad152d96 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-14 13:16:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:06:00 +0000 vfs: Let prison_enforce_statfs zero the fsid Currently, we unconditionally zero the fsid before returning a struct statfs to a jailed process. Move this into prison_enforce_statfs() so it only happens if enforce_statfs is greater than 1, or enforce_statfs is 1 but the mountpoint is outside the jail. PR: 291301 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54214 (cherry picked from commit d4f25d0c7957f0f1960028eec82625c2d6405537) --- sys/kern/kern_jail.c | 3 +++ sys/kern/vfs_syscalls.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index ddfe742178c0..54b06ba803c5 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3751,11 +3751,14 @@ prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp) if (pr->pr_enforce_statfs == 0) return; if (prison_canseemount(cred, mp) != 0) { + bzero(&sp->f_fsid, sizeof(sp->f_fsid)); bzero(sp->f_mntonname, sizeof(sp->f_mntonname)); strlcpy(sp->f_mntonname, "[restricted]", sizeof(sp->f_mntonname)); return; } + if (pr->pr_enforce_statfs > 1) + bzero(&sp->f_fsid, sizeof(sp->f_fsid)); if (pr->pr_root->v_mount == mp) { /* * Clear current buffer data, so we are sure nothing from diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 9298d0202c5a..5c59d4dda2fd 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -293,10 +293,8 @@ kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) error = VFS_STATFS(mp, buf); if (error != 0) goto out; - if (priv_check_cred_vfs_generation(td->td_ucred)) { - buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + if (priv_check_cred_vfs_generation(td->td_ucred)) prison_enforce_statfs(td->td_ucred, mp, buf); - } out: vfs_unbusy(mp); return (error); @@ -548,7 +546,6 @@ restart: sptmp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); *sptmp = *sp; - sptmp->f_fsid.val[0] = sptmp->f_fsid.val[1] = 0; prison_enforce_statfs(td->td_ucred, mp, sptmp); sp = sptmp; } else From nobody Fri Dec 19 18:07:10 2025 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 4dXwV65n22z6M9NY for ; Fri, 19 Dec 2025 18:07:10 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwV63HbQz461n for ; Fri, 19 Dec 2025 18:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167630; 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=jn4bK1rvjkzTGbn4DF6mpLMC42XUW6xlc5AOmSLftd0=; b=rS0qMa3ThOc8FgHZQzAze0z2G5kabb6qYTUkXbBMkbKaUkhv6cqTRdgrJU2ctugvkYdHWQ /rAxHGvVW/k0I47AyhX1DlFu6JxzpC+4XESeRYWv1PjRBfKRpK3IzHiNByDEEExBLT9bc1 kj7kY750Ct/z4jqmL86EJFuQL7OgqfuFq8xFzQX7Vz9lkHrZ1LO7zMmg7cKqKKwnGJZ8Gx KEk9mzkeyRpfbtchrM1mxgffvf2J98NOOvXFAqrxNNV+enxO/j+X+9RZ+GEE1ogm2NynPy PwOyrfm0FYceI3FOpZX7/XMOLzJ90NRKGDz1YD7l+KEYhQxT3iDRM2pXH49i3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167630; 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=jn4bK1rvjkzTGbn4DF6mpLMC42XUW6xlc5AOmSLftd0=; b=cs8jesDKgNYtzSFASz4R9bdiQ5/Yw+HNXhLgSBDx7zgXheaJv3vNacdZjXpwuFzyjvvwca bV82+mObLWNkWSX89R2rfc6UvaiUbPH6JwEu+6xqt9vt/aZNGVh7ofX1hu3npz7PBROwKD W5nsFjz5s5L3qCUVB/QtXsdSi/7oNLegUn1vzPTcv6WOMZJ4ZHL4uXT8RrQcWfMHOFyAoK VNFm1G998/VYOgHvE4Knv169u37g52Oebibw5/k06kEh/Zo8UY59KkA2wAEdOgnXJ9y6FX GGF74yGZuUQuOmzEP/ftdoqf7PBjnGFepv0rc1awKTb4umR46ZZH7N8dd8vtgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167630; a=rsa-sha256; cv=none; b=N5+ff2ZyLwlvZ4aKY0UAlqlq92lOmgDrJaSURWFfi8DB+OiIMuT9nJG+2ptWsaAExhFHV/ t7TnReuIfSt9NvNQ5ugELYeE3JFpso3YvYjAv81kMWi5zqOXwCfuObtp1XKoWnL8I9KiIO p0CFryVE8BtXksIDtygG7J0Sq6T2o0H+AsHho9iN0VIJXIgZCA1OY+242Zl8wTcWNEgpgp 4ZAYx3OlncWnHzo5He6y9KlQiyffO5hxnp1oF8mkyYYmkq6rv+87nF5/HGykZXI/0IrIO/ XCm5Kx1qrzyB9wKFG+MLhw7PcmvPRemiskf+AIIyRwDF0BO0PefsgP9XMRgBAA== 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 4dXwV62gLyz3ts for ; Fri, 19 Dec 2025 18:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 235c0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:07:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 307cbd494b59 - stable/13 - proc: Fix proc_init / proc_dtor ordering issues 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 307cbd494b593dd3fa6828d2cceb5dc2fc06a517 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:07:10 +0000 Message-Id: <6945944e.235c0.4aa80ed9@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=307cbd494b593dd3fa6828d2cceb5dc2fc06a517 commit 307cbd494b593dd3fa6828d2cceb5dc2fc06a517 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-14 13:16:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:07:05 +0000 proc: Fix proc_init / proc_dtor ordering issues * Move the initialization of p_ktr into proc_init() and make the check in proc_dtor() unconditional. Prior to this, it was possible to fail and invoke proc_dtor() after the first thread had been created (which was the condition for checking p_ktr in proc_dtor()) but before p_ktr had been initialized. * Move the p_klist initialization in fork1() past the last possible failure point so we don't have to free it on failure. We didn't, which meant we were leaking a knlist every time we failed to fork due to hitting the resource limit. PR: 291470 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54215 (cherry picked from commit 026d962ef14dafe19fa73361bea6dcc95f141dfa) --- sys/kern/kern_fork.c | 4 ++-- sys/kern/kern_proc.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 29b3e5d8d682..e3f3fe3ce307 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1063,8 +1063,6 @@ fork1(struct thread *td, struct fork_req *fr) #ifdef MAC mac_proc_init(newproc); #endif - newproc->p_klist = knlist_alloc(&newproc->p_mtx); - STAILQ_INIT(&newproc->p_ktr); /* * Increment the count of procs running with this uid. Don't allow @@ -1077,6 +1075,8 @@ fork1(struct thread *td, struct fork_req *fr) chgproccnt(cred->cr_ruidinfo, 1, 0); } + newproc->p_klist = knlist_alloc(&newproc->p_mtx); + do_fork(td, fr, newproc, td2, vm2, fp_procdesc); error = 0; goto cleanup; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 28c1dd90e685..fd7f786ac1b3 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -237,11 +237,9 @@ proc_dtor(void *mem, int size, void *arg) p = (struct proc *)mem; td = FIRST_THREAD_IN_PROC(p); if (td != NULL) { -#ifdef INVARIANTS KASSERT((p->p_numthreads == 1), - ("bad number of threads in exiting process")); - KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); -#endif + ("too many threads in exiting process")); + /* Free all OSD associated to this thread. */ osd_thread_exit(td); td_softdep_cleanup(td); @@ -250,6 +248,7 @@ proc_dtor(void *mem, int size, void *arg) /* Make sure all thread destructors are executed */ EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); } + KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); #ifdef KDTRACE_HOOKS kdtrace_proc_dtor(p); @@ -278,6 +277,7 @@ proc_init(void *mem, int size, int flags) p->p_stats = pstats_alloc(); p->p_pgrp = NULL; TAILQ_INIT(&p->p_kqtim_stop); + STAILQ_INIT(&p->p_ktr); return (0); } From nobody Fri Dec 19 18:07:09 2025 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 4dXwV56p2Wz6M9G4 for ; Fri, 19 Dec 2025 18:07:09 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwV531tMz46Q9 for ; Fri, 19 Dec 2025 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167629; 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=EHuQMSU86GycfsoRIPO0YKEJIWo6bb84R7SXog4gwA0=; b=f8lYTfjybkFwy1RF+IHV3Zs+atJDaA8Gd351skphn6Xo5FtJaCXCivAcIcojE1hOdsnSNr KXtSwiVk/AXSFFb6dCtsxHJEcFYTFnugrbIuSFISOea71yYZB6I2bZ7lySPxwwxVjD/HjJ xOxhj5qFI6DJM+q4ASwzp9kCuRF72rp3Xqx7K2tpUTkzDuXjPvDRqzRO/vJISlL4O6jXYn NnjYIDMy7dIv6N1YRI9/4eIWbF06oxAR969gskA0vhyUrXZfzBRGym/qFsPbTSf2IXDhZC p9OhChg1x79FSMI/kKmvxyLnBIqU4Spe0fpBy9YUHsEBwLrmqKmQTNBECmpVeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167629; 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=EHuQMSU86GycfsoRIPO0YKEJIWo6bb84R7SXog4gwA0=; b=UaMqYQjvee6deSKzpYg0eJBXhJafmIv7sgiDNeNdC9YSyoYPJNRGADfCXSRfjeeA5WiItc 0NxvDlJ21vKjYfd90ZFUPTK1BzZXIY9/pMT2GXFt6HkZPoO8dYqDR655MBAT9y5egn8Ld5 GZlEeVuC+i7zmJ7vbiK2xokHLRup5cdM/XWorN4nONvH/ootNTFf1T1TljbSMs7U6PwI1E j5f4q54pvTbbs1AHa/BtwLVF2Ha2iFEGewnp4o1vFH+dR9t4ozAK7gZ+RFs9G6qGe7LnLe llwKDpWHCZPBwjVwSQrLNvYt2fWXvn+Y3GHvwI8IjXZOeBB01r/Qm5pjq/z7rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167629; a=rsa-sha256; cv=none; b=Eq0o2zjdfnPp2Gr+8vvho1PtHaf/SujEPhoTRdruzttSoYzEo9IWi7NrKEw+5UPIuNPXpf FhpReio95TFiSSOGXDFydN1x1AMFnQCOBnS9staT57MnDy7wNQOHOdWVGvdZLtv9VTZY+q /FG4zDIw4NgpT/3pr/jiFVwjIELEwdCCKF8HG/MriPIpcF1wlTU5GL6bEKerUC66QBXF2B tN1cxcNpY1v5krp44wC0qj/O6WUVGqTjNHPOM+IO6eF+SgpicIx77vqzqIR2sNEgz/NSsd D1lXFH+pHonLrvWQKL5lfx2ZlS+1HqvSVeABx93ROxqO3jdRJ6t8va/VTPd7VA== 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 4dXwV51gqnz3W2 for ; Fri, 19 Dec 2025 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24352 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:07:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: b063e9c13a91 - stable/13 - vfs: Let prison_enforce_statfs zero the fsid 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b063e9c13a916cea96596de5c32cd0206aaf1c08 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:07:09 +0000 Message-Id: <6945944d.24352.76dacd29@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b063e9c13a916cea96596de5c32cd0206aaf1c08 commit b063e9c13a916cea96596de5c32cd0206aaf1c08 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-14 13:16:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:07:04 +0000 vfs: Let prison_enforce_statfs zero the fsid Currently, we unconditionally zero the fsid before returning a struct statfs to a jailed process. Move this into prison_enforce_statfs() so it only happens if enforce_statfs is greater than 1, or enforce_statfs is 1 but the mountpoint is outside the jail. PR: 291301 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54214 (cherry picked from commit d4f25d0c7957f0f1960028eec82625c2d6405537) --- sys/kern/kern_jail.c | 3 +++ sys/kern/vfs_syscalls.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 5c2da1048b7b..a1ee1bf1aab8 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3397,11 +3397,14 @@ prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp) if (pr->pr_enforce_statfs == 0) return; if (prison_canseemount(cred, mp) != 0) { + bzero(&sp->f_fsid, sizeof(sp->f_fsid)); bzero(sp->f_mntonname, sizeof(sp->f_mntonname)); strlcpy(sp->f_mntonname, "[restricted]", sizeof(sp->f_mntonname)); return; } + if (pr->pr_enforce_statfs > 1) + bzero(&sp->f_fsid, sizeof(sp->f_fsid)); if (pr->pr_root->v_mount == mp) { /* * Clear current buffer data, so we are sure nothing from diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 51f26b843c45..75568e858b78 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -291,10 +291,8 @@ kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) error = VFS_STATFS(mp, buf); if (error != 0) goto out; - if (priv_check_cred_vfs_generation(td->td_ucred)) { - buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + if (priv_check_cred_vfs_generation(td->td_ucred)) prison_enforce_statfs(td->td_ucred, mp, buf); - } out: vfs_unbusy(mp); return (error); @@ -546,7 +544,6 @@ restart: sptmp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); *sptmp = *sp; - sptmp->f_fsid.val[0] = sptmp->f_fsid.val[1] = 0; prison_enforce_statfs(td->td_ucred, mp, sptmp); sp = sptmp; } else From nobody Fri Dec 19 18:07:11 2025 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 4dXwV80Bnvz6M9Qs for ; Fri, 19 Dec 2025 18:07:12 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwV74sZHz46Md for ; Fri, 19 Dec 2025 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167631; 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=g1K8YnI4lf5sFQmCcXXS9M6Eoh49aCzD3BLwvYhNqTs=; b=tqOch9SvXhdPZsRuBGNo483WQC8fWm5v8E8HgLl10WxubY0GGekTzfLVOTLCqUdScalAOl pUfnbv/C5mY0BeYgySWgqM2+q1V65PHwZzPtANynTFemiBeTku0S+zcgGXEgphiE0fdIlU cDMuJcVmxz4ExhPIPOUCVzp1WnxBURbogrqeFVGldGL6oyeWc1sCpfZgWkcjzJzZJ2WiyF forX+mA1ORVC9J6jFAbarP2R2phYDvz3Fbfnz6ipzJT81bvQX/Jmw50TvFeciA6lYFKCeo 1nnXgoo1PN97rtNECtMg+qiylUF/8SHGd5atyl28yyvMVhYwOh+oo5PE0t0BWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766167631; 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=g1K8YnI4lf5sFQmCcXXS9M6Eoh49aCzD3BLwvYhNqTs=; b=aaoqXuE1yeEg0FA9iVweCvaBf5SYJSFFt3JwNW5RGHZkIU5Tlwd/uxZ2c+whzX1gemZU8T 0FPu7vEKlxLuEk/LY9k7xHLtCHKFOqL68T3mV/1tk1n/jiGV6EZjSPqVIYMvXJBr9HUjdE 2zSw0xg2dikwjX2pVZQTjSelwRbhsy1OTihEBeE4Bhopw/9gDMmBid9ufMljTNF9SpZhDu 4gLaxd9UL9yRFRsjYUiXLD8Zt4p0yC581j65T7R0iD330WZskVzOpMKAWtGgeDEg2s1c9o LK5j27zFdgKlA9aQjhIAEAFvmyL74I0P8TZkIQB+vYuLSOBzl1WXzMgeRskj5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766167631; a=rsa-sha256; cv=none; b=MAm32fiPJk04nNoSgL/ru8WpI2Y964qiZhfyarja38gb9AH6RHUdyE/1nQdTh3sAyfRu2u s3bHYbOfDnQuPSXrwAj4WvF0n52xWgjbolIwfDdZkpDuBMyAeS1NJJ6b99+IlipxME2NfM I+Tv6W+Tss6fF5lkoTdgY3V1KH5kYXZCHNdcQ4Zp6J8fIuFph0oK8QHxWKuoE2lUjx5Y/R gxURmWbLGdMZ0FKbAXhU0fBovyysTKJb2ZMVcEzW8TvjFFtBt5bQ0FbOgcOIbq+zu5fQJU 3s5aom9cTjNUcVJwR3Jeyo7qJRHZci8FpFR5DQ5iG3T+e3zXEKgrdwSDtUerDw== 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 4dXwV73N83z4D6 for ; Fri, 19 Dec 2025 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 235c4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:07:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 0c37e6e295fb - stable/13 - ipfilter: Prevent stack buffer overflow 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c37e6e295fb980b52b0fb865f4e01823759e8e8 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:07:11 +0000 Message-Id: <6945944f.235c4.5abb4403@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0c37e6e295fb980b52b0fb865f4e01823759e8e8 commit 0c37e6e295fb980b52b0fb865f4e01823759e8e8 Author: Dag-Erling Smørgrav AuthorDate: 2025-12-16 16:11:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-19 18:07:05 +0000 ipfilter: Prevent stack buffer overflow When copying ipfs data from user space, don't just check that the payload length is nonzero, but also that it does not exceed the size of the stack buffer we're copying it into. While we're at it, use a union to create a buffer of the exact size we need instead of guessing that 2048 will be enough (and not too much). Finally, check the size of the payload once it gets to where it's used. MFC after: 3 days Reported by: Ilja Van Sprundel Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D54194 (cherry picked from commit a34c50fbd2a52bb63acde82e5aec4cb57880e39b) --- sbin/ipf/libipf/interror.c | 5 ++++ sys/netpfil/ipfilter/netinet/ip_sync.c | 51 ++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/sbin/ipf/libipf/interror.c b/sbin/ipf/libipf/interror.c index 6d8c313ceb8b..ecb813aec853 100644 --- a/sbin/ipf/libipf/interror.c +++ b/sbin/ipf/libipf/interror.c @@ -472,6 +472,11 @@ log" }, { 110019, "sync update could not find NAT entry" }, { 110020, "unrecognised sync NAT command" }, { 110021, "ioctls are not handled with sync" }, + /* missing entries 110022-110024 */ + { 110025, "invalid payload length (sync create state)" }, + { 110026, "invalid payload length (sync update state)" }, + { 110027, "invalid payload length (sync create NAT)" }, + { 110028, "invalid payload length (sync update NAT)" }, /* -------------------------------------------------------------------------- */ { 120001, "null data pointer for iterator" }, { 120002, "unit outside of acceptable range" }, diff --git a/sys/netpfil/ipfilter/netinet/ip_sync.c b/sys/netpfil/ipfilter/netinet/ip_sync.c index b7afe45c8f7e..51b2e544ec52 100644 --- a/sys/netpfil/ipfilter/netinet/ip_sync.c +++ b/sys/netpfil/ipfilter/netinet/ip_sync.c @@ -412,13 +412,16 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) { ipf_sync_softc_t *softs = softc->ipf_sync_soft; synchdr_t sh; - - /* - * THIS MUST BE SUFFICIENT LARGE TO STORE - * ANY POSSIBLE DATA TYPE - */ - char data[2048]; - + union ipf_sync_data { + union ipf_sync_state_data { + ipstate_t create; + synctcp_update_t update; + } state; + union ipf_sync_nat_data { + nat_t create; + syncupdent_t update; + } nat; + } data; int err = 0; # if defined(__NetBSD__) || defined(__FreeBSD__) @@ -497,18 +500,18 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) * needed for the request */ - /* not supported */ - if (sh.sm_len == 0) { + /* too short or too long */ + if (sh.sm_len == 0 || sh.sm_len > sizeof(data)) { if (softs->ipf_sync_debug > 2) - printf("uiomove(data zero length %s\n", - "not supported"); + printf("uiomove(data) invalid length %d\n", + sh.sm_len); IPFERROR(110006); return (EINVAL); } if (uio->uio_resid >= sh.sm_len) { - err = UIOMOVE(data, sh.sm_len, UIO_WRITE, uio); + err = UIOMOVE(&data, sh.sm_len, UIO_WRITE, uio); if (err) { if (softs->ipf_sync_debug > 2) @@ -522,9 +525,9 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) sh.sm_len); if (sh.sm_table == SMC_STATE) - err = ipf_sync_state(softc, &sh, data); + err = ipf_sync_state(softc, &sh, &data); else if (sh.sm_table == SMC_NAT) - err = ipf_sync_nat(softc, &sh, data); + err = ipf_sync_nat(softc, &sh, &data); if (softs->ipf_sync_debug > 7) printf("[%d] Finished with error %d\n", sh.sm_num, err); @@ -654,6 +657,11 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) { case SMC_CREATE : + if (sp->sm_len != sizeof(sn)) { + IPFERROR(110025); + err = EINVAL; + break; + } bcopy(data, &sn, sizeof(sn)); KMALLOC(is, ipstate_t *); if (is == NULL) { @@ -720,6 +728,11 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; case SMC_UPDATE : + if (sp->sm_len != sizeof(su)) { + IPFERROR(110026); + err = EINVAL; + break; + } bcopy(data, &su, sizeof(su)); if (softs->ipf_sync_debug > 4) @@ -895,6 +908,11 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; } + if (sp->sm_len != sizeof(*nat)) { + IPFERROR(110027); + err = EINVAL; + break; + } nat = (nat_t *)data; bzero((char *)n, offsetof(nat_t, nat_age)); bcopy((char *)&nat->nat_age, (char *)&n->nat_age, @@ -918,6 +936,11 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) break; case SMC_UPDATE : + if (sp->sm_len != sizeof(su)) { + IPFERROR(110028); + err = EINVAL; + break; + } bcopy(data, &su, sizeof(su)); for (sl = softs->syncnattab[hv]; (sl != NULL); From nobody Fri Dec 19 18:16:12 2025 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 4dXwhY1cjpz6MB7q for ; Fri, 19 Dec 2025 18:16:13 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwhX5z7Qz48Wp for ; Fri, 19 Dec 2025 18:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766168172; 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=WjAL6Qnf/XNO7jERlFecXAZJzGIpuDYGu0zqEdD6qwE=; b=e6ZgXy5W15hqSfWDW4hKHh+r4KxDH7GY9m7FGZ/Rhiysw4jJIK8u/3R42IqNz9tvOKLlLg NAzBYdU8ffJgpG+QTK8MFpfBX+UpWdi1MDkwoWBsfzxJqD9oDgtjYD1ZDl/HXuxjI9O+zr a9UqUbFzv8wKKCgcFjujTg8DgpVHew3Vopvhl3vQWYoKiGQtyCHrbs+RoBpmjztcY6+UJL B57Ldx5wPwa7K1TqC2Z8/D40BYebCd/ZitfZ6qxSyv1glshTzytXfa9Alq3eQKaZEjcjft 7vWYul0uwEXF7388qf18Vs3La11T5wrVQ56n9oFhoxqQc+VWRdLs4i/Q2Hu2mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766168172; 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=WjAL6Qnf/XNO7jERlFecXAZJzGIpuDYGu0zqEdD6qwE=; b=ueBDtIltPaL6/RNIT1U46ce4piAp1rv+w5CshOcIwgXYU5SMFR6qMBkutebYEJagojgzLh PTxi7hwv/w2lqpLeEgtczkwYMZL3EsgoYrOGinhNqoKmV35N3sv4fUZ/91osu4y9LxXnsk qef7JB7tR0STuKC5i6syt6eiiqr9jlBVdX0SsPVx4TpmgB6yhB3B+bM9x38lP+0u2ZR0w4 ITpKndaDR5eL2iC0YoJjRUrOPFFW3g6fV7u99Rev0n7rt8V+aw3M/8NWsljwgUzE5nWUuw XoE99fMbkTgA9t3aetGhQyPWPwydE4EMoDAwoInkzATLTvaNMC2y0D7MRwjwZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766168172; a=rsa-sha256; cv=none; b=d5n0s3taa57A9FHe1V5RIS1chY81acc9le4GU4EtqfrQYlNncR6Ht9o94Y0KOAQBwuPR0E A9Narkef6TMsUxbvyISRZakdieAJzJtauX0UuiVP8xiFXiBNK5HmEF5cj6fyXfhZHLULq9 iYMG+Xx6h1n1RFfwEgByucOjGCZPBTSrd2gyIHE7q8PiJr1Atc7C0++bYV5yQAqPd6aQ4q b+q+ABlkpkWJ6YaQ9/2xmATrIR0/ypx9/qO61jukjhSb5MeBR7B9apsNA/jUOHV/nec2HD IC0/OGhM6im7XYNQ9M1YbeCu+7JxBc+DS+ggtMB4TWiglHvVbkduiODQ62BH+g== 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 4dXwhX4hwhz4KD for ; Fri, 19 Dec 2025 18:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2437e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:16:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ed6612dea24f - stable/15 - Revert "devinfo: Add support for libxo" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ed6612dea24f76b6224872bd4bbe314759a614dc Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:16:12 +0000 Message-Id: <6945966c.2437e.5909d755@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ed6612dea24f76b6224872bd4bbe314759a614dc commit ed6612dea24f76b6224872bd4bbe314759a614dc Author: John Baldwin AuthorDate: 2025-12-15 15:36:00 +0000 Commit: John Baldwin CommitDate: 2025-12-19 18:15:40 +0000 Revert "devinfo: Add support for libxo" This broke the human output formatting in several ways. This reverts commit 4cf5878d27ddc9d3ca3ed870f88112c3b4f6fb69. This reverts commit e8d6b58ef5a4afe0d155b6967c92d55f3bbd53fe. This reverts commit c759aca606cee8352c1d739bf7a762c8a2ed2012. PR: 291511 Reviewed by: imp, des Differential Revision: https://reviews.freebsd.org/D54196 (cherry picked from commit 43b07bdbc5d24febc7a904d16f05f921c478eaa7) --- usr.sbin/devinfo/Makefile | 2 +- usr.sbin/devinfo/devinfo.8 | 14 +-- usr.sbin/devinfo/devinfo.c | 216 ++++++++------------------------------------- 3 files changed, 39 insertions(+), 193 deletions(-) diff --git a/usr.sbin/devinfo/Makefile b/usr.sbin/devinfo/Makefile index 55b234f18363..f6506c176c9c 100644 --- a/usr.sbin/devinfo/Makefile +++ b/usr.sbin/devinfo/Makefile @@ -2,6 +2,6 @@ PACKAGE= devmatch PROG= devinfo MAN= devinfo.8 -LIBADD= xo devinfo +LIBADD= devinfo .include diff --git a/usr.sbin/devinfo/devinfo.8 b/usr.sbin/devinfo/devinfo.8 index c34713d367ff..15a6059c166f 100644 --- a/usr.sbin/devinfo/devinfo.8 +++ b/usr.sbin/devinfo/devinfo.8 @@ -34,13 +34,10 @@ .Nd print information about system device configuration .Sh SYNOPSIS .Nm -.Op Fl -libxo .Op Fl rv .Nm -.Op Fl -libxo .Fl p Ar dev Op Fl v .Nm -.Op Fl -libxo .Fl u Op Fl v .Sh DESCRIPTION The @@ -51,14 +48,7 @@ in the system, starting from the device. .Pp The following options are accepted: -.Bl -tag -width "--libxo" -.It Fl -libxo -Generate output via -.Xr libxo 3 -in a selection of different human and machine readable formats. -See -.Xr xo_options 7 -for details on command line arguments. +.Bl -tag -width indent .It Fl p Ar dev Display the path of .Ar dev @@ -83,8 +73,6 @@ This flag also displays verbose information about each device. .Sh SEE ALSO .Xr systat 1 , .Xr devinfo 3 , -.Xr libxo 3 , -.Xr xo_options 7 , .Xr devctl 8 , .Xr iostat 8 , .Xr pciconf 8 , diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c index 4163151ec840..43d88481d903 100644 --- a/usr.sbin/devinfo/devinfo.c +++ b/usr.sbin/devinfo/devinfo.c @@ -4,7 +4,6 @@ * Copyright (c) 2000, 2001 Michael Smith * Copyright (c) 2000 BSDi * All rights reserved. - * Copyright (c) 2024 KT Ullavik * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,18 +40,12 @@ #include #include #include - -#include #include "devinfo.h" static bool rflag; static bool vflag; -static int open_tag_count; -static char *last_res; static void print_indent(int); -static void print_kvlist(char *); -static char* xml_safe_string(char *); static void print_resource(struct devinfo_res *); static int print_device_matching_resource(struct devinfo_res *, void *); static int print_device_rman_resources(struct devinfo_rman *, void *); @@ -81,46 +74,7 @@ print_indent(int n) n = MIN((size_t)n, sizeof(buffer) - 1); memset(buffer, ' ', n); buffer[n] = '\0'; - xo_emit("{Pa:%s}", buffer); -} - -/* - * Takes a list of key-value pairs in the form - * "key1=val1 key2=val2 ..." and prints them according - * to xo formatting. - */ -static void -print_kvlist(char *s) -{ - char *kv; - char *copy; - - if ((copy = strdup(s)) == NULL) - xo_err(1, "No memory!"); - - while ((kv = strsep(©, " ")) != NULL) { - char* k = strsep(&kv, "="); - xo_emit("{ea:%s/%s} {d:key/%s}={d:value/%s}", k, kv, k, kv); - } - free(copy); -} - -static char -*xml_safe_string(char *desc) -{ - int i; - char *s; - - if ((s = strdup(desc)) == NULL) { - xo_err(1, "No memory!"); - } - - for (i=0; s[i] != '\0'; i++) { - if (s[i] == ' ' || s[i] == '/') { - s[i] = '-'; - } - } - return s; + printf("%s", buffer); } /* @@ -132,28 +86,20 @@ print_resource(struct devinfo_res *res) struct devinfo_rman *rman; bool hexmode; rman_res_t end; - char *safe_desc; rman = devinfo_handle_to_rman(res->dr_rman); hexmode = (rman->dm_size > 1000) || (rman->dm_size == 0); end = res->dr_start + res->dr_size - 1; - safe_desc = xml_safe_string(rman->dm_desc); - xo_open_instance(safe_desc); - if (hexmode) { - xo_emit("{:start/0x%jx}", res->dr_start); + printf("0x%jx", res->dr_start); if (res->dr_size > 1) - xo_emit("{D:-}{d:end/0x%jx}", end); - xo_emit("{e:end/0x%jx}", end); + printf("-0x%jx", end); } else { - xo_emit("{:start/%ju}", res->dr_start); + printf("%ju", res->dr_start); if (res->dr_size > 1) - xo_emit("{D:-}{d:end/%ju}", end); - xo_emit("{e:end/%ju}", end); + printf("-%ju", end); } - xo_close_instance(safe_desc); - free(safe_desc); } /* @@ -175,7 +121,7 @@ print_device_matching_resource(struct devinfo_res *res, void *arg) return(1); print_indent(ia->indent); print_resource(res); - xo_emit("\n"); + printf("\n"); } return(0); } @@ -188,7 +134,6 @@ print_device_rman_resources(struct devinfo_rman *rman, void *arg) { struct indent_arg *ia = (struct indent_arg *)arg; int indent; - char *safe_desc; indent = ia->indent; @@ -198,18 +143,13 @@ print_device_rman_resources(struct devinfo_rman *rman, void *arg) print_device_matching_resource, ia) != 0) { /* there are, print header */ - safe_desc = xml_safe_string(rman->dm_desc); print_indent(indent); - xo_emit("<{:description/%s}>\n", rman->dm_desc); - xo_open_list(safe_desc); + printf("%s:\n", rman->dm_desc); /* print resources */ ia->indent = indent + 4; devinfo_foreach_rman_resource(rman, print_device_matching_resource, ia); - - xo_close_list(safe_desc); - free(safe_desc); } ia->indent = indent; return(0); @@ -220,39 +160,20 @@ print_device_props(struct devinfo_dev *dev) { if (vflag) { if (*dev->dd_desc) { - xo_emit("<{:description/%s}>", dev->dd_desc); + printf(" <%s>", dev->dd_desc); } if (*dev->dd_pnpinfo) { - xo_open_container("pnpinfo"); - xo_emit("{D: pnpinfo}"); - - if ((strcmp(dev->dd_pnpinfo, "unknown") == 0)) - xo_emit("{D: unknown}"); - else - print_kvlist(dev->dd_pnpinfo); - - xo_close_container("pnpinfo"); + printf(" pnpinfo %s", dev->dd_pnpinfo); } if (*dev->dd_location) { - xo_open_container("location"); - xo_emit("{D: at}"); - print_kvlist(dev->dd_location); - xo_close_container("location"); + printf(" at %s", dev->dd_location); } - - // If verbose, then always print state for json/xml. - if (!(dev->dd_flags & DF_ENABLED)) - xo_emit("{e:state/disabled}"); - else if (dev->dd_flags & DF_SUSPENDED) - xo_emit("{e:state/suspended}"); - else - xo_emit("{e:state/enabled}"); } if (!(dev->dd_flags & DF_ENABLED)) - xo_emit("{D: (disabled)}"); + printf(" (disabled)"); else if (dev->dd_flags & DF_SUSPENDED) - xo_emit("{D: (suspended)}"); + printf(" (suspended)"); } /* @@ -262,20 +183,16 @@ static int print_device(struct devinfo_dev *dev, void *arg) { struct indent_arg ia; - int indent, ret; - const char* devname = dev->dd_name[0] ? dev->dd_name : "unknown"; + int indent; bool printit = vflag || (dev->dd_name[0] != 0 && dev->dd_state >= DS_ATTACHED); if (printit) { indent = (int)(intptr_t)arg; print_indent(indent); - - xo_open_container(devname); - xo_emit("{d:devicename/%s}", devname); - + printf("%s", dev->dd_name[0] ? dev->dd_name : "unknown"); print_device_props(dev); - xo_emit("\n"); + printf("\n"); if (rflag) { ia.indent = indent + 4; ia.arg = dev; @@ -284,13 +201,8 @@ print_device(struct devinfo_dev *dev, void *arg) } } - ret = (devinfo_foreach_device_child(dev, print_device, + return(devinfo_foreach_device_child(dev, print_device, (void *)((char *)arg + 2))); - - if (printit) { - xo_close_container(devname); - } - return(ret); } /* @@ -302,7 +214,6 @@ print_rman_resource(struct devinfo_res *res, void *arg __unused) struct devinfo_dev *dev; struct devinfo_rman *rman; rman_res_t end; - char *res_str, *entry = NULL; bool hexmode; dev = devinfo_handle_to_device(res->dr_device); @@ -310,38 +221,24 @@ print_rman_resource(struct devinfo_res *res, void *arg __unused) hexmode = (rman->dm_size > 1000) || (rman->dm_size == 0); end = res->dr_start + res->dr_size - 1; + printf(" "); + if (hexmode) { if (res->dr_size > 1) - asprintf(&res_str, "0x%jx-0x%jx", res->dr_start, end); + printf("0x%jx-0x%jx", res->dr_start, end); else - asprintf(&res_str, "0x%jx", res->dr_start); + printf("0x%jx", res->dr_start); } else { if (res->dr_size > 1) - asprintf(&res_str, "%ju-%ju", res->dr_start, end); + printf("%ju-%ju", res->dr_start, end); else - asprintf(&res_str, "%ju", res->dr_start); - } - - xo_emit("{P: }"); - - if (last_res == NULL) { - // First resource - xo_open_list(res_str); - } else if (strcmp(res_str, last_res) != 0) { - // We can't repeat json keys. So we keep an - // open list from the last iteration and only - // create a new list when see a new resource. - xo_close_list(last_res); - xo_open_list(res_str); + printf("%ju", res->dr_start); } dev = devinfo_handle_to_device(res->dr_device); if (dev != NULL) { if (dev->dd_name[0] != 0) { printf(" (%s)", dev->dd_name); - asprintf(&entry, "{el:%s}{D:%s} {D:(%s)}\n", - res_str, res_str, dev->dd_name); - xo_emit(entry, dev->dd_name); } else { printf(" (unknown)"); if (vflag && *dev->dd_pnpinfo) @@ -350,11 +247,9 @@ print_rman_resource(struct devinfo_res *res, void *arg __unused) printf(" at %s", dev->dd_location); } } else { - asprintf(&entry, "{el:%s}{D:%s} {D:----}\n", res_str, res_str); - xo_emit(entry, "----"); + printf(" ----"); } - free(entry); - last_res = res_str; + printf("\n"); return(0); } @@ -364,16 +259,8 @@ print_rman_resource(struct devinfo_res *res, void *arg __unused) int print_rman(struct devinfo_rman *rman, void *arg __unused) { - char* safe_desc = xml_safe_string(rman->dm_desc); - - xo_emit("<{:description/%s}\n>", rman->dm_desc); - xo_open_container(safe_desc); - + printf("%s:\n", rman->dm_desc); devinfo_foreach_rman_resource(rman, print_rman_resource, 0); - - xo_close_list(last_res); - xo_close_container(safe_desc); - free(safe_desc); return(0); } @@ -382,17 +269,12 @@ print_device_path_entry(struct devinfo_dev *dev) { const char *devname = dev->dd_name[0] ? dev->dd_name : "unknown"; - xo_open_container(devname); - open_tag_count++; - xo_emit("{:devicename/%s} ", devname); + printf("%s", devname); print_device_props(dev); if (vflag) - xo_emit("\n"); + printf("\n"); } -/* - * Recurse until we find the right dev. On the way up we print path. - */ static int print_device_path(struct devinfo_dev *dev, void *xname) { @@ -406,7 +288,7 @@ print_device_path(struct devinfo_dev *dev, void *xname) rv = devinfo_foreach_device_child(dev, print_device_path, xname); if (rv == 1) { - xo_emit("{P: }"); + printf(" "); print_device_path_entry(dev); } return (rv); @@ -415,26 +297,19 @@ print_device_path(struct devinfo_dev *dev, void *xname) static void print_path(struct devinfo_dev *root, char *path) { - open_tag_count = 0; - if (devinfo_foreach_device_child(root, print_device_path, - (void *)path) == 0) - xo_errx(1, "%s: Not found", path); + if (devinfo_foreach_device_child(root, print_device_path, (void *)path) == 0) + errx(1, "%s: Not found", path); if (!vflag) - xo_emit("\n"); - - while (open_tag_count > 0) { - xo_close_container_d(); - open_tag_count--; - } + printf("\n"); } static void __dead2 usage(void) { - xo_error( - "usage: devinfo [-rv]\n", - " devinfo -u [-v]\n", - " devinfo -p dev [-v]\n"); + fprintf(stderr, "%s\n%s\n%s\n", + "usage: devinfo [-rv]", + " devinfo -u [-v]", + " devinfo -p dev [-v]"); exit(1); } @@ -446,11 +321,6 @@ main(int argc, char *argv[]) bool uflag; char *path = NULL; - argc = xo_parse_args(argc, argv); - if (argc < 0) { - exit(1); - } - uflag = false; while ((c = getopt(argc, argv, "p:ruv")) != -1) { switch(c) { @@ -476,32 +346,20 @@ main(int argc, char *argv[]) if ((rv = devinfo_init()) != 0) { errno = rv; - xo_err(1, "devinfo_init"); + err(1, "devinfo_init"); } if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL) - xo_errx(1, "can't find root device"); + errx(1, "can't find root device"); if (path) { - xo_set_flags(NULL, XOF_DTRT); - xo_open_container("device-path"); print_path(root, path); - xo_close_container("device-path"); } else if (uflag) { /* print resource usage? */ - xo_set_flags(NULL, XOF_DTRT); - xo_open_container("device-resources"); devinfo_foreach_rman(print_rman, NULL); - xo_close_container("device-resources"); } else { /* print device hierarchy */ - xo_open_container("device-information"); devinfo_foreach_device_child(root, print_device, (void *)0); - xo_close_container("device-information"); - } - - if (xo_finish() < 0) { - exit(1); } return(0); } From nobody Fri Dec 19 18:16:44 2025 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 4dXwjG1kYLz6MBDn for ; Fri, 19 Dec 2025 18:16:50 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXwjG0PTHz49cZ for ; Fri, 19 Dec 2025 18:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766168210; 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=fdFPjJ41udCvhj9w3s79TiZO6Wy4QdvnUE1Jy9BSphs=; b=rtc4Bgcv2YIXpihWoQIVkl/n5Jt1TEHvJjvMmvylw8doeWt5Prbd6s4c3in4O+Dk/YJiLB giJyt5KZVGqYTvWVla1OCgtzh75aMh2ds5+Dag4dODsVCiG5TlJ7FjU4uMHII5qUmLFVkX /TQAL0CslOIgm5lHKyqGiHfoXlludhPJXmPvrbKkzupOhob0l/bXzy53qEhrSfG2DXhvG2 VzDB1E3bvj/GLoPwpvy5BOr1AHKy5r87fkOrX3JwaLfgry0dDQK5BvJLBvBDSQvNb++RkH XD20W0/dMkJ7D8TF4hOkBGUXsUv8gMIvDhCAjYbX8TH27IG5n0UHr1uujEtwUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766168210; 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=fdFPjJ41udCvhj9w3s79TiZO6Wy4QdvnUE1Jy9BSphs=; b=kGKfzGcTFmv4ienKDfc5Cvpcq4bYrk+JrpBMxFkh1mrfYgLbYWXdCDt5TmNG9OP++ak9+J bESAzqJ04Zmj/vvUF6l2FIs2j3WYWbaJDwNTP7qKr/V9G5GcrPYXp8MR3C9ypHx6RQpKY2 cyCk9lQPzk41yhdfLMi4gdUd9khvPvmbQYN6wYgDOmwse7COTp/phcJibr+P4SXLtNLmRJ rzHn0ihMymXQX65cqJ2HWOTt74D0iWkf2mLWCJW1RXBKw/uBIB1us35i3fMPEFSXtS5vSW bp3IzCeKeNK5DDZCaKVF9Z8PnXnYAiO60a8k1Ys04bv0CElc/rc078B1d36EGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766168210; a=rsa-sha256; cv=none; b=KJsmKyLXGk5u6U2SjjqP9RmOrwvwRDeMifugtfeUbiQDF+/v/DkrWdWya2WZkK08FibVBe BjN9GDwAnOYGc/wDLsMVoUHlwTwHNpcdUACyWbB33tKgItvArOAwFolx74A20kH48r4BcF cdrbBoH0YAIO65UTVd8Rri1l1GVfMUaJJdHp3BCtay+VAJjC8szeCrPo0j8wiZdHz00Ydr MspbBFCPG8s6IrecYCC7VsaqyEuCRp4EL/wdJfn4qDIKv+0u5CA1kFLIDpSY8DDXfdEs0m 2vbNS5iq0jdgBH8OPjdhA2nCrFDm3CXmadNvPLeix7UMra3T3R3UaI0/Y4niFw== 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 4dXwjF6zcdz4BX for ; Fri, 19 Dec 2025 18:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23b69 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 18:16:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 525766f1ae38 - stable/14 - Revert "sys: Bump 32-bit kernel removal to 16.0" 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 525766f1ae38ad3f0648348d9bea2d2546a0fbf7 Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 18:16:44 +0000 Message-Id: <6945968c.23b69.578e827@gitrepo.freebsd.org> The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=525766f1ae38ad3f0648348d9bea2d2546a0fbf7 commit 525766f1ae38ad3f0648348d9bea2d2546a0fbf7 Author: Ed Maste AuthorDate: 2025-12-19 18:11:53 +0000 Commit: Ed Maste CommitDate: 2025-12-19 18:15:49 +0000 Revert "sys: Bump 32-bit kernel removal to 16.0" 32-bit powerpc and i386 kernels still exist in 14.x, so we don't want to imply that those may persist until 16.0. The message only claims that the kernels "may be" removed in 15.0 anyhow. This reverts commit c19688407a2c797e74762aebd90c1f1cc70ab726. Reported by: jhb --- sys/kern/init_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 65795eea183e..561d976edc6e 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -386,7 +386,7 @@ C_SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, #if __SIZEOF_LONG__ == 4 static const char ilp32_warn[] = - "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 16.0.\n"; + "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n"; C_SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); C_SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, From nobody Sat Dec 20 01:10:40 2025 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 4dY5tm59cKz6L2cc for ; Sat, 20 Dec 2025 01:10:40 +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 4dY5tm2LY9z3tjQ for ; Sat, 20 Dec 2025 01:10:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193040; 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=7dGR7r8hACYiNBKRV/8kRq8nDeniX4ylbyqQQVgm3uk=; b=uPWuNhNrqbNCK4ENw0kOI3Vd5rF2aSD2xlrH8BotOgisC1GM1xbV/LELpJoK8oGQ+SxOTT rH4wiEduM/sCwowVuzdzEz6FfMtk8K47oafwjjKCYParWRuuHrdH+alA18WbFdrTfAIMfN 2g54mOJem2qNmD+apfvaE0L/zyqolZ7o+5c/wT1suPXtxRsI0I6zlkJfzMRx6PTnUOXY2+ TZWDmIdgPqugXf15NR8isC/rs/Yq2PQ4PxK3a1Q3LEhQPWrt2HkhJbIq8OgBOce3frzyEZ a3N1xvloCczciLv7VRKipqFzTuXO2ipiyEoJdrlduA95YUmwZUi6Ya5nomXpHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193040; 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=7dGR7r8hACYiNBKRV/8kRq8nDeniX4ylbyqQQVgm3uk=; b=H9WpxzYNHo5rCkrtNTTuMLJtJJNxoEHWPjXZ339Curhmcugam/MPC9xfeZqXyfdCeh0kRH nPxYWS0dbuN9L1cDtN2kMcbHQdlB7MAoIBvBNFPUuqndbJYatPgZYUKpZNYjpoF9ZtW3Bd pvJNIMOVNjNqB3wluPxtqBE16nfJGlst2sn7VbpjI3mzH6vmBwRBI1gRHh6jkJqD6ElKh9 qeDT1bAIeZMs9PJELJHvaP+DAeoF0+SUY5PPsAwoLXbe2nzbcryIDlOM5jEuou3AawqyNf giqVZNTUX4O5317eQ/hXFUatHXQn0w8UuingwKyO9c8LjSJGcdU3LE0IBtRccw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193040; a=rsa-sha256; cv=none; b=G0ru3B95mKIQcvackNLlirt55JLr2U7V07qhBhS6Oc7VgGI9epzoYiWvnvTTFZqW8yHRPo UuQRhIFwlPE6X85F3KBr2RgZzGBHEguunyrXjqebY8pf9HelMgj/Dd4EbRcWGmZjDOhMuO lePOhQurUbVeNImywob70ovOTPDumTYJ7gXpYNR7jjw7rmny7yFMiZv/yC4QQoUzdBG0qO GEHckjcjTlGoHKssZpoRfR/UpkII5tORZFWAzCito4w8xc7cPp1TihLnMvy4xAWOqOOo8/ kZiS7KGWYG4xlkhL1inlcHI6lA+9svQmx/60D4m1peaCn9vU9cVqDYRGf/9Zhg== 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 4dY5tm1lMlzXpZ for ; Sat, 20 Dec 2025 01:10:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33cde by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:10:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 97984de80f7f - stable/15 - mtree: Fix typos 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 97984de80f7f0e4a428b7fe82dc3acabc277719f Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:10:40 +0000 Message-Id: <6945f790.33cde.2520b8ab@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=97984de80f7f0e4a428b7fe82dc3acabc277719f commit 97984de80f7f0e4a428b7fe82dc3acabc277719f Author: Jose Luis Duran AuthorDate: 2025-12-09 13:18:23 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:06:36 +0000 mtree: Fix typos Manually apply a typo fix. This change has already been submitted upstream as bin/59824. MFC after: 1 week (cherry picked from commit dab5daf54cc26aaf2679a2eda5f378461f279ec5) --- contrib/mtree/compare.c | 2 +- contrib/mtree/spec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index c4e5bfcac1d7..3d8cf2335207 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -285,7 +285,7 @@ typeerr: LABEL; LABEL; printf(flavor == F_FREEBSD9 ? - "%spermissions expcted %#lo found %#lo" : + "%spermissions expected %#lo found %#lo" : "%spermissions (%#lo, %#lo", tab, (u_long)s->st_mode, (u_long)p->fts_statp->st_mode & MBITS); diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 25bface34bd0..24e15f33fa8a 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -803,7 +803,7 @@ addchild(NODE *pathparent, NODE *centry) * * Make centry point to the just-replaced node. Unlink * the just-replaced node from the list, and allow it to - * be insterted in the correct position later. + * be inserted in the correct position later. */ centry = samename; if (centry->prev) From nobody Sat Dec 20 01:10:41 2025 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 4dY5tn5wwnz6L2XG for ; Sat, 20 Dec 2025 01:10:41 +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 4dY5tn3HJkz3tgY for ; Sat, 20 Dec 2025 01:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193041; 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=DaNumC+4d4gcZLOUQN0ZRRQ94ku4rBDcsCwjy6YvUns=; b=JiTnWQiWQFM3C1J8ljrvaGzG+1WPpHencNIzC4Au5QSb5h3rgnbjG/JiYycXQe5lwRclYB xct6PuX4XBLaMP7MPG7pg0vweilz0ousfJUcZmd/RJaVCghfbBRwSjy3CE+AFjEunhCDxR a9TWvhJyHN0XabAealcTL4vdmga8Xvn6xrkTGDvdMaf3QOv1goUeZ7LPo5uR9CMZZDtj40 Zij7euBz/N4t2CLZuZR2WyCN0ymShmdjA/Im1cluUKuiwkw5fDLQiT3Bw0OZR/Lxu10Xeh RVSgTlkHXTpwUfTUJao2zraWS6n7+BryPV6UchkvIozeWLK4shB6jUGILx1XCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193041; 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=DaNumC+4d4gcZLOUQN0ZRRQ94ku4rBDcsCwjy6YvUns=; b=nDgDJWcGlRFl7ibvyV1n12RjJeQHTKmiJD2xyQCtT+se8Ut+IRfaL3objOUAQo1CwwKkHe NIqioMY5wE7ts2S0+oA9L9t+gOkvX+QO5PX4rGihdyiX/7rxLDt90YV+8qYD7aSQYY0L7v 57O+scIYpF8V7ZqFF4OnbyUjLokeVnD2pKK4CFqPxH/EznsL3TGZ8Ngfh4BZOYwdNPBnhg fsZgJ2fxws1GOG5qAfv1RRt46qMb6E9Tq31n6quCgg+B3fdhT5Pyu9D93AVYebQj76Phi1 ri+pK0Ebi0ZPlfH/YK0J37uLGrMIum3G0pvmS/5DSUx9vku9WUIv0SVlJHp4Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193041; a=rsa-sha256; cv=none; b=PhwL6zZ+QJL029gbt0W9jURi4lbJsdZ9+6VEIh/+mPx+Bjv4yeItNLgYK0ydocL7HJZJb/ CK3bNd9bOdFQSS5+ISDyZzw9hQJ/5al0aW/3Pa5rgxZQiHBjQ86MdnBBHHDEUeoSALVAPQ BVxfThnYudfoKbrQSo81LloIAktyCAFRxxMa0H2DUC4/A0x80y18qo5TtPqpuxUp5t35+J dtKno77fDGwA8Tc6oRmkvH/rtPccDkPhIxRSifJX3ZlJzX0Jd8Q4cFpxDAYOlI0TgxhBxZ eu0RdYPCDdMZDmlO+v3PkOqY4uOhRnWZ3yYwlHuywwgeuKPIdWpyYWJ55xV3hg== 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 4dY5tn2XXDzYnw for ; Sat, 20 Dec 2025 01:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34ded by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:10:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 9bbfffe39e87 - stable/15 - mtree: tests: Import NetBSD's mtree test suite 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9bbfffe39e87bc20818ea68efaf07399b83764bc Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:10:41 +0000 Message-Id: <6945f791.34ded.5a667a92@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=9bbfffe39e87bc20818ea68efaf07399b83764bc commit 9bbfffe39e87bc20818ea68efaf07399b83764bc Author: Jose Luis Duran AuthorDate: 2025-12-09 15:45:01 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:06:52 +0000 mtree: tests: Import NetBSD's mtree test suite Manually import latest mtree test suite from NetBSD. MFC after: 1 week (cherry picked from commit 2f29d0f3e6d25599c188c94bf1e395d9cbeb2a4d) --- contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh | 40 +++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh old mode 100755 new mode 100644 index 5daefd84e928..5e4177c792a5 --- a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh +++ b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh @@ -1,4 +1,4 @@ -# $NetBSD: t_mtree.sh,v 1.7 2017/01/14 20:45:16 christos Exp $ +# $NetBSD: t_mtree.sh,v 1.10 2023/12/02 16:18:17 christos Exp $ # # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -447,6 +447,42 @@ mtree_specspec_type_body() fi } +atf_test_case mtree_onlyfile +atf_test_case netbsd6_onlyfile +onlyfile_head() +{ + atf_set "descr" "Test -O with same hash value in directory and leaf" +} + +onlyfile_body() +{ + mkdir -p ab/no + echo ./ab/no >onlyfile + mtree -F ${FLAVOR} -c -n -O onlyfile >output + if [ ! -s output ]; then + atf_fail "mtree did not find path in onlyfile" + fi +} + +mtree_onlyfile_head() +{ + FLAVOR=mtree onlyfile_head +} +netbsd6_onlyfile_head() +{ + FLAVOR=netbsd6 onlyfile_head +} + +mtree_onlyfile_body() +{ + FLAVOR=mtree onlyfile_body +} +netbsd6_onlyfile_body() +{ + FLAVOR=netbsd6 onlyfile_body +} + + atf_init_test_cases() { atf_add_test_case mtree_create @@ -459,6 +495,7 @@ atf_init_test_cases() atf_add_test_case mtree_merge atf_add_test_case mtree_nonemptydir atf_add_test_case mtree_specspec_type + atf_add_test_case mtree_onlyfile atf_add_test_case netbsd6_create atf_add_test_case netbsd6_check @@ -469,4 +506,5 @@ atf_init_test_cases() atf_add_test_case netbsd6_ignore atf_add_test_case netbsd6_merge atf_add_test_case netbsd6_nonemptydir + atf_add_test_case netbsd6_onlyfile } From nobody Sat Dec 20 01:10:39 2025 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 4dY5tr3D5yz6L2hc for ; Sat, 20 Dec 2025 01:10:44 +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 4dY5tr1Vlqz3tqZ for ; Sat, 20 Dec 2025 01:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193044; 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=xZERsOwcGehnhQz/XEKYBR0wupIICFct0kfIn4gpy0w=; b=Qfwdri1bjbatzvPJ70LrE/kfdGDBaUOc0paCQQx389xyKsWsJ2QBLbM10MuiWh8YRcmK8w sMgmzjQPanai91w3mcfNXw8MWZpDixPh53+yNRjdTEL3TmK5R/S65uHLHMpUNyjOr6eeCN jtH3F3IoQ73Q9McgF/UFYpp1jPNX6yxAboT0Yl21EHl4Nq37DXgK3ofYPhA2wr9uPT4gHL zRcJEimc8LxosKU4bVJoRDm4GoSyWFVu4DNkIoRr+4mI63DIJwcJ0u6sGBpOt5pn9rc1+l 1/Fb5ZDQfzSmxVRGKt2VOcq221lbhR5Sjar92dEnr4K0XIdRD1yeGhpd3gNg/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193044; 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=xZERsOwcGehnhQz/XEKYBR0wupIICFct0kfIn4gpy0w=; b=CUKrbTpRMVGeFy9YtxiKqTTLy+M5jj8XwPJikA0G0QS1t6aEvVSc66BNYN/XbUAYYGhAwh dhylYnuH0uNflptbFMgyNgt1RPghaBfZFA3Y5zeUJYZuHP1YjpqK28l+x7d3C499B3hPHW zCs0GAANJMLmLjstUY++dW3kFu9si/jk7YWuteJ8tDkYHsQ3N3B9g6abKWhE+nDjH1V50Z 3x+aJ2wvv7YEEvYeZD/JWK/9tZkO3+Vz8BaJpRw0+Lom4H6sTBA0KZomhK3dU9D8QSOexv otprxGIGz6QBxKFKMUKgsbBwesEWNanDVMe1IQVG1HEy51IECtRwwdMus6s1Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193044; a=rsa-sha256; cv=none; b=m63MPXX6Q6SnmE69dhdQml3qYECYN1ro9hj/rU2io3yyMUWv6R8t0dCUOZqsQsIaZRtCzr GFB7NJyuxHghxywhFVrDudwfCCo/hKbao+8IOCAmMA++xTVaJ99dAHmWZLT9oOQa7gU/p0 lXlZ9BfKhfvCp8I91wA/mVVeLd2eci38Itb2SRaDfLu/gKNESp+d9t3EEpbadInJt/xrpu Ikl2VEwQKg2x02YrE/TnXyBWN7A9UGJKAglQVkoUxwde3pQd9p/hlISu9889G91G/xCZpQ xLTe8wzcWCjxT0dZSIVFuKcC1i2tYWPe8fdWwuQtWxKi/Nw4vCND6FiLTLi3rQ== 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 4dY5tr127czYjV for ; Sat, 20 Dec 2025 01:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33b7a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:10:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: f6fb1f8cdd51 - stable/15 - Import latest mtree from NetBSD 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f6fb1f8cdd519fde87a79fd7961a78258a434d3a Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:10:39 +0000 Message-Id: <6945f78f.33b7a.7d461795@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f6fb1f8cdd519fde87a79fd7961a78258a434d3a commit f6fb1f8cdd519fde87a79fd7961a78258a434d3a Author: Jose Luis Duran AuthorDate: 2025-12-13 14:28:16 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:06:14 +0000 Import latest mtree from NetBSD Merge commit 'f600477feb4ae61a75f61949eb600caff4aeea8c' MFC after: 1 week Discussed with: brooks (cherry picked from commit 49b6dda4d71175ad615718401573be5fd024822b) --- contrib/mtree/compare.c | 39 ++++++++----- contrib/mtree/crc.c | 20 +++---- contrib/mtree/create.c | 144 ++++++++++++++++++++--------------------------- contrib/mtree/extern.h | 13 ++++- contrib/mtree/misc.c | 10 ++-- contrib/mtree/mtree.8 | 139 +++++++++++++++++++++++++++++++++++---------- contrib/mtree/mtree.c | 8 +-- contrib/mtree/spec.c | 44 ++++++++++++--- contrib/mtree/specspec.c | 4 +- contrib/mtree/verify.c | 17 ++++-- 10 files changed, 271 insertions(+), 167 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index e3639ceea08f..c4e5bfcac1d7 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $ */ +/* $NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -135,8 +135,9 @@ do { \ int compare(NODE *s, FTSENT *p) { - u_int32_t len, val, flags; + uint32_t len, val, flags; int fd, label; + bool was_unlinked; const char *cp, *tab; #if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) char *digestbuf; @@ -144,6 +145,7 @@ compare(NODE *s, FTSENT *p) tab = NULL; label = 0; + was_unlinked = false; switch(s->type) { case F_BLOCK: if (!S_ISBLK(p->fts_statp->st_mode)) @@ -210,47 +212,53 @@ typeerr: LABEL; s->st_mode | nodetoino(s->type), s->st_rdev) == -1) || (lchown(p->fts_accpath, p->fts_statp->st_uid, - p->fts_statp->st_gid) == -1) ) + p->fts_statp->st_gid) == -1) ) { printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); - else + } else { printf(", modified%s\n", flavor == F_FREEBSD9 ? "" : ")"); + was_unlinked = true; + } } else printf(")\n"); tab = "\t"; } /* Set the uid/gid first, then set the mode. */ - if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) { + if (s->flags & (F_UID | F_UNAME) && + (was_unlinked || s->st_uid != p->fts_statp->st_uid)) { LABEL; printf(flavor == F_FREEBSD9 ? "%suser expected %lu found %lu" : "%suser (%lu, %lu", tab, (u_long)s->st_uid, (u_long)p->fts_statp->st_uid); if (uflag) { - if (lchown(p->fts_accpath, s->st_uid, -1)) + if (lchown(p->fts_accpath, s->st_uid, (gid_t)-1)) printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; } - if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) { + if (s->flags & (F_GID | F_GNAME) && + (was_unlinked || s->st_gid != p->fts_statp->st_gid)) { LABEL; printf(flavor == F_FREEBSD9 ? "%sgid expected %lu found %lu" : "%sgid (%lu, %lu", tab, (u_long)s->st_gid, (u_long)p->fts_statp->st_gid); if (uflag) { - if (lchown(p->fts_accpath, -1, s->st_gid)) + if (lchown(p->fts_accpath, (uid_t)-1, s->st_gid)) printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else @@ -258,8 +266,8 @@ typeerr: LABEL; tab = "\t"; } if (s->flags & F_MODE && - s->st_mode != (p->fts_statp->st_mode & MBITS)) { - if (lflag) { + (was_unlinked || s->st_mode != (p->fts_statp->st_mode & MBITS))) { + if (lflag && !was_unlinked) { mode_t tmode, mode; tmode = s->st_mode; @@ -287,7 +295,8 @@ typeerr: LABEL; strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else @@ -567,7 +576,7 @@ const char * rlink(const char *name) { static char lbuf[MAXPATHLEN]; - int len; + ssize_t len; if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1) mtree_err("%s: %s", name, strerror(errno)); diff --git a/contrib/mtree/crc.c b/contrib/mtree/crc.c index 4eac66e5b995..69b30b206439 100644 --- a/contrib/mtree/crc.c +++ b/contrib/mtree/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $ */ +/* $NetBSD: crc.c,v 1.11 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93"; #else -__RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $"); +__RCSID("$NetBSD: crc.c,v 1.11 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -53,7 +53,7 @@ __RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $"); #include "extern.h" -static const u_int32_t crctab[] = { +static const uint32_t crctab[] = { 0x0, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, @@ -114,15 +114,15 @@ static const u_int32_t crctab[] = { * locations to store the crc and the number of bytes read. It returns 0 on * success and 1 on failure. Errno is set on failure. */ -u_int32_t crc_total = ~0; /* The crc over a number of files. */ +uint32_t crc_total = ~0u; /* The crc over a number of files. */ int -crc(int fd, u_int32_t *cval, u_int32_t *clen) +crc(int fd, uint32_t *cval, uint32_t *clen) { u_char *p; - int nr; - u_int32_t thecrc, len; - u_int32_t crctot; + ssize_t nr; + uint32_t thecrc, len; + uint32_t crctot; u_char buf[16 * 1024]; #define COMPUTE(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)] @@ -132,12 +132,12 @@ crc(int fd, u_int32_t *cval, u_int32_t *clen) crctot = ~crc_total; while ((nr = read(fd, buf, sizeof(buf))) > 0) if (sflag) { - for (len += nr, p = buf; nr--; ++p) { + for (len += (uint32_t)nr, p = buf; nr--; ++p) { COMPUTE(thecrc, *p); COMPUTE(crctot, *p); } } else { - for (len += nr, p = buf; nr--; ++p) + for (len += (uint32_t)nr, p = buf; nr--; ++p) COMPUTE(thecrc, *p); } if (nr < 0) diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c index 7a09a1cc3951..e23004851f39 100644 --- a/contrib/mtree/create.c +++ b/contrib/mtree/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -84,13 +84,6 @@ static uid_t uid; static mode_t mode; static u_long flags; -#ifdef __FreeBSD__ -#define FTS_CONST const -#else -#define FTS_CONST -#endif - -static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); static void output(FILE *, int, int *, const char *, ...) __printflike(4, 5); static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, @@ -180,15 +173,59 @@ cwalk(FILE *fp) mtree_err("%s checksum: %u", fullpath, crc_total); } +static void +dosum(FILE *fp, int indent, FTSENT *p, int *offset, int flag, + char * (*func)(const char *, char *), const char *key) +{ + char *digestbuf; + + if ((keys & flag) == 0) + return; + + digestbuf = (*func)(p->fts_accpath, NULL); + if (digestbuf != NULL) { + output(fp, indent, offset, "%s=%s", key, digestbuf); + free(digestbuf); + return; + } + + if (qflag) { + warn("%s: %s failed", p->fts_path, key); + return; + } + + mtree_err("%s: %s failed: %s", p->fts_path, key, strerror(errno)); +} + +static char * +crcFile(const char *fname, char *dummy __unused) +{ + char *ptr; + uint32_t val, len; + int fd, e; + + if ((fd = open(fname, O_RDONLY)) == -1) + goto out; + + e = crc(fd, &val, &len); + close(fd); + if (e) + goto out; + + if (asprintf(&ptr, "%u", val) < 0) + goto out; + + return ptr; +out: + mtree_err("%s: %s", fname, strerror(errno)); + return NULL; +} + static void statf(FILE *fp, int indent, FTSENT *p) { - u_int32_t len, val; - int fd, offset; + int offset; const char *name = NULL; -#if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) - char *digestbuf; -#endif offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); @@ -241,65 +278,25 @@ statf(FILE *fp, int indent, FTSENT *p) output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif - if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { - if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || - crc(fd, &val, &len)) - mtree_err("%s: %s", p->fts_accpath, strerror(errno)); - close(fd); - output(fp, indent, &offset, "cksum=%lu", (long)val); - } + if (S_ISREG(p->fts_statp->st_mode)) { + dosum(fp, indent, p, &offset, F_CKSUM, crcFile, "cksum"); #ifndef NO_MD5 - if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: MD5File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_MD5, MD5File, MD5KEY); #endif /* ! NO_MD5 */ #ifndef NO_RMD160 - if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: RMD160File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_RMD160, RMD160File, RMD160KEY); #endif /* ! NO_RMD160 */ #ifndef NO_SHA1 - if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA1File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA1, SHA1File, SHA1KEY); #endif /* ! NO_SHA1 */ #ifndef NO_SHA2 - if (keys & F_SHA256 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA256, SHA256_File, SHA256KEY); #ifdef SHA384_BLOCK_LENGTH - if (keys & F_SHA384 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA384, SHA384_File, SHA384KEY); #endif - if (keys & F_SHA512 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA512, SHA512_File, SHA512KEY); #endif /* ! NO_SHA2 */ + } if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) output(fp, indent, &offset, "link=%s", @@ -440,27 +437,6 @@ statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, return (0); } -/* - * dcmp -- - * used as a comparison function passed to fts_open() to control - * the order in which fts_read() returns results. We make - * directories sort after non-directories, but otherwise sort in - * strcmp() order. - * - * Keep this in sync with nodecmp() in spec.c. - */ -static int -dcmp(const FTSENT *FTS_CONST *a, const FTSENT *FTS_CONST *b) -{ - - if (S_ISDIR((*a)->fts_statp->st_mode)) { - if (!S_ISDIR((*b)->fts_statp->st_mode)) - return (1); - } else if (S_ISDIR((*b)->fts_statp->st_mode)) - return (-1); - return (strcmp((*a)->fts_name, (*b)->fts_name)); -} - void output(FILE *fp, int indent, int *offset, const char *fmt, ...) { diff --git a/contrib/mtree/extern.h b/contrib/mtree/extern.h index 091cf8f84460..7b58dd4a4d20 100644 --- a/contrib/mtree/extern.h +++ b/contrib/mtree/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: extern.h,v 1.41 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -49,6 +49,12 @@ #include #endif +#if defined(__FreeBSD__) && !defined(HAVE_NBTOOL_CONFIG_H) +#define FTS_CONST const +#else +#define FTS_CONST +#endif + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif @@ -62,8 +68,9 @@ enum flavor { void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); -int crc(int, u_int32_t *, u_int32_t *); +int crc(int, uint32_t *, uint32_t *); void cwalk(FILE *); +int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); @@ -83,7 +90,7 @@ extern int bflag, dflag, eflag, iflag, jflag, lflag, mflag, extern int mtree_Mflag, mtree_Sflag, mtree_Wflag; extern size_t mtree_lineno; extern enum flavor flavor; -extern u_int32_t crc_total; +extern uint32_t crc_total; extern int ftsoptions, keys; extern char fullpath[]; extern slist_t includetags, excludetags; diff --git a/contrib/mtree/misc.c b/contrib/mtree/misc.c index b99f1ce1f708..b5bd9f4e06c6 100644 --- a/contrib/mtree/misc.c +++ b/contrib/mtree/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.34 2012/12/20 19:09:25 christos Exp $ */ +/* $NetBSD: misc.c,v 1.35 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: misc.c,v 1.34 2012/12/20 19:09:25 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.35 2024/12/05 17:17:43 christos Exp $"); #endif /* not lint */ #include @@ -111,7 +111,7 @@ slist_t excludetags, includetags; int keys = KEYDEFAULT; -int keycompare(const void *, const void *); +static int keycompare(const void *, const void *); u_int parsekey(const char *name, int *needvaluep) @@ -153,7 +153,7 @@ parsetype(const char *name) return (k->val); } -int +static int keycompare(const void *a, const void *b) { @@ -198,7 +198,7 @@ void parsetags(slist_t *list, char *args) { char *p, *e; - int len; + size_t len; if (args == NULL) { addtag(list, NULL); diff --git a/contrib/mtree/mtree.8 b/contrib/mtree/mtree.8 index 53bb21f711bf..99e3199de943 100644 --- a/contrib/mtree/mtree.8 +++ b/contrib/mtree/mtree.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mtree.8,v 1.69 2013/02/03 19:16:06 christos Exp $ +.\" $NetBSD: mtree.8,v 1.78 2023/12/02 13:26:09 christos Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,7 +56,7 @@ .\" .\" @(#)mtree.8 8.2 (Berkeley) 12/11/93 .\" -.Dd February 3, 2013 +.Dd December 2, 2023 .Dt MTREE 8 .Os .Sh NAME @@ -93,9 +93,11 @@ characteristics do not match the specification, or which are missing from either the file hierarchy or the specification. .Pp The options are as follows: -.Bl -tag -width Xxxexcludexfilexx +.Bl -tag -width Fl +. .It Fl b Suppress blank lines before entering and after exiting directories. +. .It Fl C Convert a specification into a format that's easier to parse with various tools. @@ -105,8 +107,7 @@ from the file given by In the output, each file or directory is represented using a single line (which might be very long). The full path name -(beginning with -.Dq \&./ ) +.Pq beginning with Ql \&./ is always printed as the first field; .Fl K , .Fl k , @@ -120,19 +121,25 @@ can be used to control which files are printed; and the .Fl S option can be used to sort the output. +. .It Fl c Print a specification for the file hierarchy originating at -the current working directory (or the directory provided by -.Fl p Ar path ) +the current working directory +.Po or the directory provided by +.Fl p Ar path +.Pc to the standard output. The output is in a style using relative path names. +. .It Fl D As per .Fl C , except that the path name is always printed as the last field instead of the first. +. .It Fl d Ignore everything except directory type files. +. .It Fl E Ar tags Add the comma separated tags to the .Dq exclusion @@ -141,9 +148,11 @@ Non-directories with tags which are in the exclusion list are not printed with .Fl C and .Fl D . +. .It Fl e Don't complain about files that are in the file hierarchy, but not in the specification. +. .It Fl F Ar flavor Set the compatibility flavor of the .Nm @@ -151,22 +160,23 @@ utility. The .Ar flavor can be one of -.Sy mtree , -.Sy freebsd9 , +.Cm mtree , +.Cm freebsd9 , or -.Sy netbsd6 . +.Cm netbsd6 . The default is -.Sy mtree . +.Cm mtree . The -.Sy freebsd9 +.Cm freebsd9 and -.Sy netbsd6 -flavors attempt to preserve output compatiblity and command line option +.Cm netbsd6 +flavors attempt to preserve output compatibility and command line option backward compatibility with .Fx 9.0 and .Nx 6.0 respectively. +. .It Fl f Ar spec Read the specification from .Ar file , @@ -178,10 +188,18 @@ The specifications will be sorted like output generated using .Fl c . The output format in this case is somewhat reminiscent of .Xr comm 1 , -having "in first spec only", "in second spec only", and "different" -columns, prefixed by zero, one and two TAB characters respectively. -Each entry in the "different" column occupies two lines, one from each -specification. +having +.Dq in first spec only , +.Dq in second spec only , +and +.Dq different +columns, prefixed by zero, one and two +.Tn TAB +characters respectively. +Each entry in the +.Dq different +column occupies two lines, one from each specification. +. .It Fl I Ar tags Add the comma separated tags to the .Dq inclusion @@ -191,14 +209,22 @@ Non-directories with tags which are in the inclusion list are printed with and .Fl D . If no inclusion list is provided, the default is to display all files. +. .It Fl i -If specified, set the schg and/or sappnd flags. +If specified, set the +.Ql schg +and/or +.Ql sappnd +flags. +. .It Fl j Indent the output 4 spaces each time a directory level is descended when creating a specification with the .Fl c option. -This does not affect either the /set statements or the comment before each +This does not affect either the +.Ql /set +statements or the comment before each directory. It does however affect the comment before the close of each directory. This is the equivalent of the @@ -207,26 +233,31 @@ option in the .Fx version of .Nm . +. .It Fl K Ar keywords Add the specified (whitespace or comma separated) keywords to the current set of keywords. If .Ql all is specified, add all of the other keywords. +. .It Fl k Ar keywords Use the .Sy type keyword plus the specified (whitespace or comma separated) -keywords instead of the current set of keywords. +.Ar keywords +instead of the current set of keywords. If .Ql all is specified, use all of the other keywords. If the .Sy type keyword is not desired, suppress it with -.Fl R Ar type . +.Fl R Cm type . +. .It Fl L Follow all symbolic links in the file hierarchy. +. .It Fl l Do .Dq loose @@ -235,7 +266,7 @@ will match less stringent ones. For example, a file marked mode 0444 will pass a check for mode 0644. .Dq Loose -checks apply only to read, write and execute permissions -- in +checks apply only to read, write and execute permissions \(em in particular, if other bits like the sticky bit or suid/sgid bits are set either in the specification or the file, exact checking will be performed. @@ -244,17 +275,25 @@ This option may not be set at the same time as the or .Fl u option. +. .It Fl M Permit merging of specification entries with different types, with the last entry taking precedence. +. .It Fl m -If the schg and/or sappnd flags are specified, reset these flags. -Note that this is only possible with securelevel less than 1 (i.e., -in single user mode or while the system is running in insecure -mode). +If the +.Ql schg +and/or +.Ql sappnd +flags are specified, reset these flags. +Note that this is only possible with securelevel less than 1 +.Po +i.e., in single user mode or while the system is running in insecure mode +.Pc . See .Xr init 8 for information on security levels. +. .It Fl n Do not emit pathname comments when creating a specification. Normally @@ -262,6 +301,7 @@ a comment is emitted before each directory and before the close of that directory when using the .Fl c option. +. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd @@ -274,31 +314,42 @@ rather than using the results from the system's and .Xr getgrnam 3 (and related) library calls. +. .It Fl O Ar onlypaths Only include files included in this list of pathnames. +. .It Fl P Don't follow symbolic links in the file hierarchy, instead consider the symbolic link itself in any comparisons. This is the default. +. .It Fl p Ar path Use the file hierarchy rooted in .Ar path , instead of the current directory. +. .It Fl q Quiet mode. Do not complain when a .Dq missing directory cannot be created because it already exists. This occurs when the directory is a symbolic link. +. .It Fl R Ar keywords Remove the specified (whitespace or comma separated) keywords from the current set of keywords. If .Ql all is specified, remove all of the other keywords. +. .It Fl r Remove any files in the file hierarchy that are not described in the specification. +Repeating the flag more than once will attempt to reset all the +file flags via +.Xr lchflags 2 +before attempting to remove the file in case the file was immutable. +. .It Fl S When reading a specification into an internal data structure, sort the entries. @@ -320,19 +371,23 @@ By default, if the .Fl S option is not used, entries within the same directory are collected together (separated from entries for other directories), but not sorted. +. .It Fl s Ar seed Display a single checksum to the standard error output that represents all of the files for which the keyword .Sy cksum was specified. The checksum is seeded with the specified value. +. .It Fl t Modify the modified time of existing files, the device type of devices, and symbolic link targets, to match the specification. +. .It Fl U Same as .Fl u except that a mismatch is not considered to be an error if it was corrected. +. .It Fl u Modify the owner, group, permissions, and flags of existing files, the device type of devices, and symbolic link targets, @@ -350,6 +405,7 @@ is given, these flags will be reset. Exit with a status of 0 on success, 2 if the file hierarchy did not match the specification, and 1 if any other error occurred. +. .It Fl W Don't attempt to set various file attributes such as the ownership, mode, flags, or time @@ -358,6 +414,7 @@ This option will be most useful when used in conjunction with .Fl U or .Fl u . +. .It Fl X Ar exclude-file The specified file contains .Xr fnmatch 3 @@ -370,11 +427,14 @@ the starting directory); otherwise, it will be matched against basenames only. Comments are permitted in the -.Ar exclude-list +.Ar exclude-file file. +. .It Fl x Don't descend below mount points in the file hierarchy. +. .El +. .Pp Specifications are mostly composed of .Dq keywords , @@ -384,7 +444,8 @@ No keywords have default values, and if a keyword has no value set, no checks based on it are performed. .Pp Currently supported keywords are as follows: -.Bl -tag -width sha384digestxx +. +.Bl -tag -width Sy .It Sy cksum The checksum of the file using the default algorithm specified by the @@ -420,6 +481,7 @@ format.) .It Ar number Opaque number (as stored on the file system). .El +. .Pp The following values for .Ar format @@ -614,9 +676,24 @@ they match. .Nm uses .Xr strsvis 3 -(in VIS_CSTYLE format) to encode path names containing +(in +.Dv VIS_OCTAL +format) to encode path names containing non-printable characters. Whitespace characters are encoded as +.Ql \e040 +(space), +.Ql \e011 +(tab), and +.Ql \e012 +(new line). +When flavor +.Sy netbsd6 +is selected, +.Xr strsvis 3 +(in +.Dv VIS_CSTYLE +format) is used and whitespace characters are encoded as .Ql \es (space), .Ql \et @@ -678,7 +755,7 @@ The utility exits with a status of 0 on success, 1 if any error occurred, and 2 if the file hierarchy did not match the specification. .Sh FILES -.Bl -tag -width /etc/mtree -compact +.Bl -tag -width Pa -compact .It Pa /etc/mtree system specification directory .El diff --git a/contrib/mtree/mtree.c b/contrib/mtree/mtree.c index 8b4cb9494d53..28f09fa32210 100644 --- a/contrib/mtree/mtree.c +++ b/contrib/mtree/mtree.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $"); #endif #endif /* not lint */ @@ -195,7 +195,7 @@ main(int argc, char **argv) qflag = 1; break; case 'r': - rflag = 1; + rflag++; break; case 'R': while ((p = strsep(&optarg, " \t,")) != NULL) @@ -204,7 +204,7 @@ main(int argc, char **argv) break; case 's': sflag = 1; - crc_total = ~strtol(optarg, &p, 0); + crc_total = (uint32_t)~strtol(optarg, &p, 0); if (*p) mtree_err("illegal seed value -- %s", optarg); break; diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 6fbe6f534560..25bface34bd0 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -224,10 +224,14 @@ noparent: mtree_err("no parent node"); */ if (strcmp(centry->name, ".") == 0 && centry->type == 0) centry->type = F_DIR; - if (strcmp(centry->name, ".") != 0 || - centry->type != F_DIR) + if (strcmp(centry->name, ".") != 0) mtree_err( - "root node must be the directory `.'"); + "root node must be the directory `.'," + " found `%s'", centry->name); + if (centry->type != F_DIR) + mtree_err( + "root node must type %#x != %#x", + F_DIR, centry->type); last = root = centry; root->parent = root; } else if (pathparent != NULL) { @@ -539,7 +543,8 @@ replacenode(NODE *cur, NODE *new) static void set(char *t, NODE *ip) { *** 120 LINES SKIPPED *** From nobody Sat Dec 20 01:11:01 2025 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 4dY5v93V1zz6L2hj for ; Sat, 20 Dec 2025 01:11:01 +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 4dY5v91M5yz3v18 for ; Sat, 20 Dec 2025 01:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193061; 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=D4/RtnZgExU1M7nEzcS/Ar5aPldS3fZxypWZpJkCEK4=; b=GgBWHiagbQ5uvvRQHMDE5N7SMeGFUZdlz+qRUsUVcwPkt9IolPoIQNiDD7D2H1iDXkuoMx +A+myEf8HypMJaUWqpdrUO0uZCD19c1ZLm4q2CYFI7wfhMWwVL2rQB5vA5x66pV/dYg8YA Ui4FnG7Uenh1XlllYan+hcdo5N94URWRZMPA2FHe4LeqviBM7DoSGHkyngL8mef8BrHuHz W1ct2Jur5ATJ7qUl4Hl2OVCDEXvj6Mzfhqzx2JnbSAVgTk+IdjSYgOyB7Pvv9DcI/fbfv1 d+9n5V6YUjhZY+ov/xwMsZqlXvt4ae1yarJpKwJMUoXs/O1KoUBrLb3fcksMSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193061; 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=D4/RtnZgExU1M7nEzcS/Ar5aPldS3fZxypWZpJkCEK4=; b=iAvZPS6N3DU6XUEDcD6gAlRV9QbUTEznShB5Fc57V4cgY2mUYa3xkd1q0rdowri0YHF1Cl EW3bqWFbdiIyoC8JZt2ONb1nwThv4f5Xk7EH7066DIn49UpCTfZbk52aA3F13vqBvotEtF mIFotcAlteC6T1fp7soB+NdyQK0/w6C7mya0GdAk87JFOzaKp4POeg9byWW60mO4mvOCkJ HZn9g5bymEDB6qjL+rpoRVBV06GrSjTFSW7MLZstEgNCKv2xDCmdy95eY8Z3VCWWefgzMg scXcg2y9B3GPxDgZtz5uRKsO6+hQYO3fyOER/sZ/9eY1Jz3D9YXi0EiH8LyQmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193061; a=rsa-sha256; cv=none; b=sT4Wtopqu4sTTrGojz/vLcqIRaKWvVYZexivTxYVIgIOxBKCEk9I88QRU8nUc2kUWcyc8g HxHFOkNV3TOk+2KMR2ca2e3ayflk+96NYHbSpkSDmy+UJpu0PhwGfAffhNaNMX0cmLDgsR KYq6MXRDEhUOUs2I75W6WZXKvsAJ5titQEgbwhkVn2UNmXlFh9EOHcCbvUAc0LJURQTA0c yuclI84h9XWRuXBfIvbAfBek7VKNMPfuNP7WeT3UDUNuceP3/c6GZqAJn4FkEJXp4+3jDk +Txp4ECwKjkI8yd72L/tavUxlbT6lpkAsd80a1HmVUsD/BXTaJeIA0iRU1OMIA== 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 4dY5v90TcfzYjZ for ; Sat, 20 Dec 2025 01:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34a3a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:11:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: ecc2e2e2c5b9 - stable/14 - Import latest mtree from NetBSD 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ecc2e2e2c5b9f1e88282533348229bbb8d36d5f0 Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:11:01 +0000 Message-Id: <6945f7a5.34a3a.2d959677@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=ecc2e2e2c5b9f1e88282533348229bbb8d36d5f0 commit ecc2e2e2c5b9f1e88282533348229bbb8d36d5f0 Author: Jose Luis Duran AuthorDate: 2025-12-13 14:28:16 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:07:25 +0000 Import latest mtree from NetBSD Merge commit 'f600477feb4ae61a75f61949eb600caff4aeea8c' MFC after: 1 week Discussed with: brooks (cherry picked from commit 49b6dda4d71175ad615718401573be5fd024822b) --- contrib/mtree/compare.c | 39 ++++++++----- contrib/mtree/crc.c | 20 +++---- contrib/mtree/create.c | 144 ++++++++++++++++++++--------------------------- contrib/mtree/extern.h | 13 ++++- contrib/mtree/misc.c | 10 ++-- contrib/mtree/mtree.8 | 139 +++++++++++++++++++++++++++++++++++---------- contrib/mtree/mtree.c | 8 +-- contrib/mtree/spec.c | 44 ++++++++++++--- contrib/mtree/specspec.c | 4 +- contrib/mtree/verify.c | 17 ++++-- 10 files changed, 271 insertions(+), 167 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index e3639ceea08f..c4e5bfcac1d7 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $ */ +/* $NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -135,8 +135,9 @@ do { \ int compare(NODE *s, FTSENT *p) { - u_int32_t len, val, flags; + uint32_t len, val, flags; int fd, label; + bool was_unlinked; const char *cp, *tab; #if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) char *digestbuf; @@ -144,6 +145,7 @@ compare(NODE *s, FTSENT *p) tab = NULL; label = 0; + was_unlinked = false; switch(s->type) { case F_BLOCK: if (!S_ISBLK(p->fts_statp->st_mode)) @@ -210,47 +212,53 @@ typeerr: LABEL; s->st_mode | nodetoino(s->type), s->st_rdev) == -1) || (lchown(p->fts_accpath, p->fts_statp->st_uid, - p->fts_statp->st_gid) == -1) ) + p->fts_statp->st_gid) == -1) ) { printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); - else + } else { printf(", modified%s\n", flavor == F_FREEBSD9 ? "" : ")"); + was_unlinked = true; + } } else printf(")\n"); tab = "\t"; } /* Set the uid/gid first, then set the mode. */ - if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) { + if (s->flags & (F_UID | F_UNAME) && + (was_unlinked || s->st_uid != p->fts_statp->st_uid)) { LABEL; printf(flavor == F_FREEBSD9 ? "%suser expected %lu found %lu" : "%suser (%lu, %lu", tab, (u_long)s->st_uid, (u_long)p->fts_statp->st_uid); if (uflag) { - if (lchown(p->fts_accpath, s->st_uid, -1)) + if (lchown(p->fts_accpath, s->st_uid, (gid_t)-1)) printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; } - if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) { + if (s->flags & (F_GID | F_GNAME) && + (was_unlinked || s->st_gid != p->fts_statp->st_gid)) { LABEL; printf(flavor == F_FREEBSD9 ? "%sgid expected %lu found %lu" : "%sgid (%lu, %lu", tab, (u_long)s->st_gid, (u_long)p->fts_statp->st_gid); if (uflag) { - if (lchown(p->fts_accpath, -1, s->st_gid)) + if (lchown(p->fts_accpath, (uid_t)-1, s->st_gid)) printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else @@ -258,8 +266,8 @@ typeerr: LABEL; tab = "\t"; } if (s->flags & F_MODE && - s->st_mode != (p->fts_statp->st_mode & MBITS)) { - if (lflag) { + (was_unlinked || s->st_mode != (p->fts_statp->st_mode & MBITS))) { + if (lflag && !was_unlinked) { mode_t tmode, mode; tmode = s->st_mode; @@ -287,7 +295,8 @@ typeerr: LABEL; strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else @@ -567,7 +576,7 @@ const char * rlink(const char *name) { static char lbuf[MAXPATHLEN]; - int len; + ssize_t len; if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1) mtree_err("%s: %s", name, strerror(errno)); diff --git a/contrib/mtree/crc.c b/contrib/mtree/crc.c index 4eac66e5b995..69b30b206439 100644 --- a/contrib/mtree/crc.c +++ b/contrib/mtree/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $ */ +/* $NetBSD: crc.c,v 1.11 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93"; #else -__RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $"); +__RCSID("$NetBSD: crc.c,v 1.11 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -53,7 +53,7 @@ __RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $"); #include "extern.h" -static const u_int32_t crctab[] = { +static const uint32_t crctab[] = { 0x0, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, @@ -114,15 +114,15 @@ static const u_int32_t crctab[] = { * locations to store the crc and the number of bytes read. It returns 0 on * success and 1 on failure. Errno is set on failure. */ -u_int32_t crc_total = ~0; /* The crc over a number of files. */ +uint32_t crc_total = ~0u; /* The crc over a number of files. */ int -crc(int fd, u_int32_t *cval, u_int32_t *clen) +crc(int fd, uint32_t *cval, uint32_t *clen) { u_char *p; - int nr; - u_int32_t thecrc, len; - u_int32_t crctot; + ssize_t nr; + uint32_t thecrc, len; + uint32_t crctot; u_char buf[16 * 1024]; #define COMPUTE(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)] @@ -132,12 +132,12 @@ crc(int fd, u_int32_t *cval, u_int32_t *clen) crctot = ~crc_total; while ((nr = read(fd, buf, sizeof(buf))) > 0) if (sflag) { - for (len += nr, p = buf; nr--; ++p) { + for (len += (uint32_t)nr, p = buf; nr--; ++p) { COMPUTE(thecrc, *p); COMPUTE(crctot, *p); } } else { - for (len += nr, p = buf; nr--; ++p) + for (len += (uint32_t)nr, p = buf; nr--; ++p) COMPUTE(thecrc, *p); } if (nr < 0) diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c index 7a09a1cc3951..e23004851f39 100644 --- a/contrib/mtree/create.c +++ b/contrib/mtree/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -84,13 +84,6 @@ static uid_t uid; static mode_t mode; static u_long flags; -#ifdef __FreeBSD__ -#define FTS_CONST const -#else -#define FTS_CONST -#endif - -static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); static void output(FILE *, int, int *, const char *, ...) __printflike(4, 5); static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, @@ -180,15 +173,59 @@ cwalk(FILE *fp) mtree_err("%s checksum: %u", fullpath, crc_total); } +static void +dosum(FILE *fp, int indent, FTSENT *p, int *offset, int flag, + char * (*func)(const char *, char *), const char *key) +{ + char *digestbuf; + + if ((keys & flag) == 0) + return; + + digestbuf = (*func)(p->fts_accpath, NULL); + if (digestbuf != NULL) { + output(fp, indent, offset, "%s=%s", key, digestbuf); + free(digestbuf); + return; + } + + if (qflag) { + warn("%s: %s failed", p->fts_path, key); + return; + } + + mtree_err("%s: %s failed: %s", p->fts_path, key, strerror(errno)); +} + +static char * +crcFile(const char *fname, char *dummy __unused) +{ + char *ptr; + uint32_t val, len; + int fd, e; + + if ((fd = open(fname, O_RDONLY)) == -1) + goto out; + + e = crc(fd, &val, &len); + close(fd); + if (e) + goto out; + + if (asprintf(&ptr, "%u", val) < 0) + goto out; + + return ptr; +out: + mtree_err("%s: %s", fname, strerror(errno)); + return NULL; +} + static void statf(FILE *fp, int indent, FTSENT *p) { - u_int32_t len, val; - int fd, offset; + int offset; const char *name = NULL; -#if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) - char *digestbuf; -#endif offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); @@ -241,65 +278,25 @@ statf(FILE *fp, int indent, FTSENT *p) output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif - if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { - if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || - crc(fd, &val, &len)) - mtree_err("%s: %s", p->fts_accpath, strerror(errno)); - close(fd); - output(fp, indent, &offset, "cksum=%lu", (long)val); - } + if (S_ISREG(p->fts_statp->st_mode)) { + dosum(fp, indent, p, &offset, F_CKSUM, crcFile, "cksum"); #ifndef NO_MD5 - if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: MD5File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_MD5, MD5File, MD5KEY); #endif /* ! NO_MD5 */ #ifndef NO_RMD160 - if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: RMD160File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_RMD160, RMD160File, RMD160KEY); #endif /* ! NO_RMD160 */ #ifndef NO_SHA1 - if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA1File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA1, SHA1File, SHA1KEY); #endif /* ! NO_SHA1 */ #ifndef NO_SHA2 - if (keys & F_SHA256 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA256, SHA256_File, SHA256KEY); #ifdef SHA384_BLOCK_LENGTH - if (keys & F_SHA384 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA384, SHA384_File, SHA384KEY); #endif - if (keys & F_SHA512 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA512, SHA512_File, SHA512KEY); #endif /* ! NO_SHA2 */ + } if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) output(fp, indent, &offset, "link=%s", @@ -440,27 +437,6 @@ statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, return (0); } -/* - * dcmp -- - * used as a comparison function passed to fts_open() to control - * the order in which fts_read() returns results. We make - * directories sort after non-directories, but otherwise sort in - * strcmp() order. - * - * Keep this in sync with nodecmp() in spec.c. - */ -static int -dcmp(const FTSENT *FTS_CONST *a, const FTSENT *FTS_CONST *b) -{ - - if (S_ISDIR((*a)->fts_statp->st_mode)) { - if (!S_ISDIR((*b)->fts_statp->st_mode)) - return (1); - } else if (S_ISDIR((*b)->fts_statp->st_mode)) - return (-1); - return (strcmp((*a)->fts_name, (*b)->fts_name)); -} - void output(FILE *fp, int indent, int *offset, const char *fmt, ...) { diff --git a/contrib/mtree/extern.h b/contrib/mtree/extern.h index 091cf8f84460..7b58dd4a4d20 100644 --- a/contrib/mtree/extern.h +++ b/contrib/mtree/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: extern.h,v 1.41 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -49,6 +49,12 @@ #include #endif +#if defined(__FreeBSD__) && !defined(HAVE_NBTOOL_CONFIG_H) +#define FTS_CONST const +#else +#define FTS_CONST +#endif + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif @@ -62,8 +68,9 @@ enum flavor { void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); -int crc(int, u_int32_t *, u_int32_t *); +int crc(int, uint32_t *, uint32_t *); void cwalk(FILE *); +int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); @@ -83,7 +90,7 @@ extern int bflag, dflag, eflag, iflag, jflag, lflag, mflag, extern int mtree_Mflag, mtree_Sflag, mtree_Wflag; extern size_t mtree_lineno; extern enum flavor flavor; -extern u_int32_t crc_total; +extern uint32_t crc_total; extern int ftsoptions, keys; extern char fullpath[]; extern slist_t includetags, excludetags; diff --git a/contrib/mtree/misc.c b/contrib/mtree/misc.c index b99f1ce1f708..b5bd9f4e06c6 100644 --- a/contrib/mtree/misc.c +++ b/contrib/mtree/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.34 2012/12/20 19:09:25 christos Exp $ */ +/* $NetBSD: misc.c,v 1.35 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: misc.c,v 1.34 2012/12/20 19:09:25 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.35 2024/12/05 17:17:43 christos Exp $"); #endif /* not lint */ #include @@ -111,7 +111,7 @@ slist_t excludetags, includetags; int keys = KEYDEFAULT; -int keycompare(const void *, const void *); +static int keycompare(const void *, const void *); u_int parsekey(const char *name, int *needvaluep) @@ -153,7 +153,7 @@ parsetype(const char *name) return (k->val); } -int +static int keycompare(const void *a, const void *b) { @@ -198,7 +198,7 @@ void parsetags(slist_t *list, char *args) { char *p, *e; - int len; + size_t len; if (args == NULL) { addtag(list, NULL); diff --git a/contrib/mtree/mtree.8 b/contrib/mtree/mtree.8 index 53bb21f711bf..99e3199de943 100644 --- a/contrib/mtree/mtree.8 +++ b/contrib/mtree/mtree.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mtree.8,v 1.69 2013/02/03 19:16:06 christos Exp $ +.\" $NetBSD: mtree.8,v 1.78 2023/12/02 13:26:09 christos Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,7 +56,7 @@ .\" .\" @(#)mtree.8 8.2 (Berkeley) 12/11/93 .\" -.Dd February 3, 2013 +.Dd December 2, 2023 .Dt MTREE 8 .Os .Sh NAME @@ -93,9 +93,11 @@ characteristics do not match the specification, or which are missing from either the file hierarchy or the specification. .Pp The options are as follows: -.Bl -tag -width Xxxexcludexfilexx +.Bl -tag -width Fl +. .It Fl b Suppress blank lines before entering and after exiting directories. +. .It Fl C Convert a specification into a format that's easier to parse with various tools. @@ -105,8 +107,7 @@ from the file given by In the output, each file or directory is represented using a single line (which might be very long). The full path name -(beginning with -.Dq \&./ ) +.Pq beginning with Ql \&./ is always printed as the first field; .Fl K , .Fl k , @@ -120,19 +121,25 @@ can be used to control which files are printed; and the .Fl S option can be used to sort the output. +. .It Fl c Print a specification for the file hierarchy originating at -the current working directory (or the directory provided by -.Fl p Ar path ) +the current working directory +.Po or the directory provided by +.Fl p Ar path +.Pc to the standard output. The output is in a style using relative path names. +. .It Fl D As per .Fl C , except that the path name is always printed as the last field instead of the first. +. .It Fl d Ignore everything except directory type files. +. .It Fl E Ar tags Add the comma separated tags to the .Dq exclusion @@ -141,9 +148,11 @@ Non-directories with tags which are in the exclusion list are not printed with .Fl C and .Fl D . +. .It Fl e Don't complain about files that are in the file hierarchy, but not in the specification. +. .It Fl F Ar flavor Set the compatibility flavor of the .Nm @@ -151,22 +160,23 @@ utility. The .Ar flavor can be one of -.Sy mtree , -.Sy freebsd9 , +.Cm mtree , +.Cm freebsd9 , or -.Sy netbsd6 . +.Cm netbsd6 . The default is -.Sy mtree . +.Cm mtree . The -.Sy freebsd9 +.Cm freebsd9 and -.Sy netbsd6 -flavors attempt to preserve output compatiblity and command line option +.Cm netbsd6 +flavors attempt to preserve output compatibility and command line option backward compatibility with .Fx 9.0 and .Nx 6.0 respectively. +. .It Fl f Ar spec Read the specification from .Ar file , @@ -178,10 +188,18 @@ The specifications will be sorted like output generated using .Fl c . The output format in this case is somewhat reminiscent of .Xr comm 1 , -having "in first spec only", "in second spec only", and "different" -columns, prefixed by zero, one and two TAB characters respectively. -Each entry in the "different" column occupies two lines, one from each -specification. +having +.Dq in first spec only , +.Dq in second spec only , +and +.Dq different +columns, prefixed by zero, one and two +.Tn TAB +characters respectively. +Each entry in the +.Dq different +column occupies two lines, one from each specification. +. .It Fl I Ar tags Add the comma separated tags to the .Dq inclusion @@ -191,14 +209,22 @@ Non-directories with tags which are in the inclusion list are printed with and .Fl D . If no inclusion list is provided, the default is to display all files. +. .It Fl i -If specified, set the schg and/or sappnd flags. +If specified, set the +.Ql schg +and/or +.Ql sappnd +flags. +. .It Fl j Indent the output 4 spaces each time a directory level is descended when creating a specification with the .Fl c option. -This does not affect either the /set statements or the comment before each +This does not affect either the +.Ql /set +statements or the comment before each directory. It does however affect the comment before the close of each directory. This is the equivalent of the @@ -207,26 +233,31 @@ option in the .Fx version of .Nm . +. .It Fl K Ar keywords Add the specified (whitespace or comma separated) keywords to the current set of keywords. If .Ql all is specified, add all of the other keywords. +. .It Fl k Ar keywords Use the .Sy type keyword plus the specified (whitespace or comma separated) -keywords instead of the current set of keywords. +.Ar keywords +instead of the current set of keywords. If .Ql all is specified, use all of the other keywords. If the .Sy type keyword is not desired, suppress it with -.Fl R Ar type . +.Fl R Cm type . +. .It Fl L Follow all symbolic links in the file hierarchy. +. .It Fl l Do .Dq loose @@ -235,7 +266,7 @@ will match less stringent ones. For example, a file marked mode 0444 will pass a check for mode 0644. .Dq Loose -checks apply only to read, write and execute permissions -- in +checks apply only to read, write and execute permissions \(em in particular, if other bits like the sticky bit or suid/sgid bits are set either in the specification or the file, exact checking will be performed. @@ -244,17 +275,25 @@ This option may not be set at the same time as the or .Fl u option. +. .It Fl M Permit merging of specification entries with different types, with the last entry taking precedence. +. .It Fl m -If the schg and/or sappnd flags are specified, reset these flags. -Note that this is only possible with securelevel less than 1 (i.e., -in single user mode or while the system is running in insecure -mode). +If the +.Ql schg +and/or +.Ql sappnd +flags are specified, reset these flags. +Note that this is only possible with securelevel less than 1 +.Po +i.e., in single user mode or while the system is running in insecure mode +.Pc . See .Xr init 8 for information on security levels. +. .It Fl n Do not emit pathname comments when creating a specification. Normally @@ -262,6 +301,7 @@ a comment is emitted before each directory and before the close of that directory when using the .Fl c option. +. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd @@ -274,31 +314,42 @@ rather than using the results from the system's and .Xr getgrnam 3 (and related) library calls. +. .It Fl O Ar onlypaths Only include files included in this list of pathnames. +. .It Fl P Don't follow symbolic links in the file hierarchy, instead consider the symbolic link itself in any comparisons. This is the default. +. .It Fl p Ar path Use the file hierarchy rooted in .Ar path , instead of the current directory. +. .It Fl q Quiet mode. Do not complain when a .Dq missing directory cannot be created because it already exists. This occurs when the directory is a symbolic link. +. .It Fl R Ar keywords Remove the specified (whitespace or comma separated) keywords from the current set of keywords. If .Ql all is specified, remove all of the other keywords. +. .It Fl r Remove any files in the file hierarchy that are not described in the specification. +Repeating the flag more than once will attempt to reset all the +file flags via +.Xr lchflags 2 +before attempting to remove the file in case the file was immutable. +. .It Fl S When reading a specification into an internal data structure, sort the entries. @@ -320,19 +371,23 @@ By default, if the .Fl S option is not used, entries within the same directory are collected together (separated from entries for other directories), but not sorted. +. .It Fl s Ar seed Display a single checksum to the standard error output that represents all of the files for which the keyword .Sy cksum was specified. The checksum is seeded with the specified value. +. .It Fl t Modify the modified time of existing files, the device type of devices, and symbolic link targets, to match the specification. +. .It Fl U Same as .Fl u except that a mismatch is not considered to be an error if it was corrected. +. .It Fl u Modify the owner, group, permissions, and flags of existing files, the device type of devices, and symbolic link targets, @@ -350,6 +405,7 @@ is given, these flags will be reset. Exit with a status of 0 on success, 2 if the file hierarchy did not match the specification, and 1 if any other error occurred. +. .It Fl W Don't attempt to set various file attributes such as the ownership, mode, flags, or time @@ -358,6 +414,7 @@ This option will be most useful when used in conjunction with .Fl U or .Fl u . +. .It Fl X Ar exclude-file The specified file contains .Xr fnmatch 3 @@ -370,11 +427,14 @@ the starting directory); otherwise, it will be matched against basenames only. Comments are permitted in the -.Ar exclude-list +.Ar exclude-file file. +. .It Fl x Don't descend below mount points in the file hierarchy. +. .El +. .Pp Specifications are mostly composed of .Dq keywords , @@ -384,7 +444,8 @@ No keywords have default values, and if a keyword has no value set, no checks based on it are performed. .Pp Currently supported keywords are as follows: -.Bl -tag -width sha384digestxx +. +.Bl -tag -width Sy .It Sy cksum The checksum of the file using the default algorithm specified by the @@ -420,6 +481,7 @@ format.) .It Ar number Opaque number (as stored on the file system). .El +. .Pp The following values for .Ar format @@ -614,9 +676,24 @@ they match. .Nm uses .Xr strsvis 3 -(in VIS_CSTYLE format) to encode path names containing +(in +.Dv VIS_OCTAL +format) to encode path names containing non-printable characters. Whitespace characters are encoded as +.Ql \e040 +(space), +.Ql \e011 +(tab), and +.Ql \e012 +(new line). +When flavor +.Sy netbsd6 +is selected, +.Xr strsvis 3 +(in +.Dv VIS_CSTYLE +format) is used and whitespace characters are encoded as .Ql \es (space), .Ql \et @@ -678,7 +755,7 @@ The utility exits with a status of 0 on success, 1 if any error occurred, and 2 if the file hierarchy did not match the specification. .Sh FILES -.Bl -tag -width /etc/mtree -compact +.Bl -tag -width Pa -compact .It Pa /etc/mtree system specification directory .El diff --git a/contrib/mtree/mtree.c b/contrib/mtree/mtree.c index 8b4cb9494d53..28f09fa32210 100644 --- a/contrib/mtree/mtree.c +++ b/contrib/mtree/mtree.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $"); #endif #endif /* not lint */ @@ -195,7 +195,7 @@ main(int argc, char **argv) qflag = 1; break; case 'r': - rflag = 1; + rflag++; break; case 'R': while ((p = strsep(&optarg, " \t,")) != NULL) @@ -204,7 +204,7 @@ main(int argc, char **argv) break; case 's': sflag = 1; - crc_total = ~strtol(optarg, &p, 0); + crc_total = (uint32_t)~strtol(optarg, &p, 0); if (*p) mtree_err("illegal seed value -- %s", optarg); break; diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 6fbe6f534560..25bface34bd0 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -224,10 +224,14 @@ noparent: mtree_err("no parent node"); */ if (strcmp(centry->name, ".") == 0 && centry->type == 0) centry->type = F_DIR; - if (strcmp(centry->name, ".") != 0 || - centry->type != F_DIR) + if (strcmp(centry->name, ".") != 0) mtree_err( - "root node must be the directory `.'"); + "root node must be the directory `.'," + " found `%s'", centry->name); + if (centry->type != F_DIR) + mtree_err( + "root node must type %#x != %#x", + F_DIR, centry->type); last = root = centry; root->parent = root; } else if (pathparent != NULL) { @@ -539,7 +543,8 @@ replacenode(NODE *cur, NODE *new) static void set(char *t, NODE *ip) { *** 120 LINES SKIPPED *** From nobody Sat Dec 20 01:11:02 2025 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 4dY5vC6tGdz6L2nn for ; Sat, 20 Dec 2025 01:11:03 +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 4dY5vB1v2Nz3v1j for ; Sat, 20 Dec 2025 01:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193062; 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=ivB5VQWiT0VvDEY0i4E+XooMFzmRXz6nbizpJbfkheo=; b=SOJfDsws//9mYKhx+kSdDUWOQpveWEOZV2/aKDe0M0oJ33BOHqq6RfVNJ8PXByaL8EfHk4 QLbHIR4eX4W1E7j3TEW1AavOCupZphLWFA91xMKgMpRovdGX6yRi7G2KXLqDh/SQo+22nA doJdkqbDokkfLICC5bqFVjie8Ggx9DImICBLiGXvZp8WPepoFKuc5rUNdqn3asjRahD3fp DRlFZtR9EKUCUi0dDl16nsbfFLJvU5V1avSmTbDLV+dMlLy86W95KiuAvkXLQD3ZxXtmye ZEA0/bQa2ebJG0/BQBh9+dTEuowLWCx8qTp6m6NIJoJE/YIeMPGnzqsSx6krXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193062; 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=ivB5VQWiT0VvDEY0i4E+XooMFzmRXz6nbizpJbfkheo=; b=VP+cn+VJ/TuLCRUPxYDkbcEM6zSZLs2S++59c64oG0GqHMXuISEOBHrcXeiq8N/VrfFejA N3b1ZdQiwNCTEoRqq1TLbVrZfuKaIWLVPEKmCXUEsj2CG4pT8pEqKlSuQihs6v7N1ztXvC dT4PVyaT4i87Wl0pZevsO0rXVgv13+CfE8pNpqRjThr8TR+KmZja2ztlzOYmVA3ZdPnASW 0YTyYmmVej8TeIui+FeSAwndhiB0oNf/15QL2i/peCWCJ01IqgxuYHZabZIdODEEPbKIso dYPBCtAFiOrGn7A1P3bxGzT4pXRH3Bf9Du6VPLYh4aLwhLZhj0VbdH/ml3kFaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193062; a=rsa-sha256; cv=none; b=udGB2dnAhyau8DrXFScc9W7oYX6EeUuO2U3TgzUs1aWTX7hSVe2LeIgyDdqSAOfopLK1C7 EfUEdJWAAfMPNIJJ0vjF87Fp6G3Eev/E38YwQ0jFQd8DJnsKd4dbhniwyfjQyH6ZCc2qP5 nQuKRtaO2/1s0D7cvha3oATHZDv7+6PZtVEJzRltjy7glwH3M+1+/xHcb5672i/GrSUT9+ ABvBhLvaRuSQnYpUzPcxAizsTHyJUE/W1uRq5VVzWFgyuWvD5FKEB2/Q9OJX/tvAdJvg9l kHFmlTqmOT61IJOxX7su3l0L925OItmlk+X3GXU8iwXehS1Jr1evvPcIgeVNKQ== 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 4dY5vB1CkJzYpD for ; Sat, 20 Dec 2025 01:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3679e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:11:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 12aa5ff90bd5 - stable/14 - mtree: Fix typos 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 12aa5ff90bd57da67f0ef4c25ea4cde28567315b Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:11:02 +0000 Message-Id: <6945f7a6.3679e.27c8037b@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=12aa5ff90bd57da67f0ef4c25ea4cde28567315b commit 12aa5ff90bd57da67f0ef4c25ea4cde28567315b Author: Jose Luis Duran AuthorDate: 2025-12-09 13:18:23 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:07:41 +0000 mtree: Fix typos Manually apply a typo fix. This change has already been submitted upstream as bin/59824. MFC after: 1 week (cherry picked from commit dab5daf54cc26aaf2679a2eda5f378461f279ec5) --- contrib/mtree/compare.c | 2 +- contrib/mtree/spec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index c4e5bfcac1d7..3d8cf2335207 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -285,7 +285,7 @@ typeerr: LABEL; LABEL; printf(flavor == F_FREEBSD9 ? - "%spermissions expcted %#lo found %#lo" : + "%spermissions expected %#lo found %#lo" : "%spermissions (%#lo, %#lo", tab, (u_long)s->st_mode, (u_long)p->fts_statp->st_mode & MBITS); diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 25bface34bd0..24e15f33fa8a 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -803,7 +803,7 @@ addchild(NODE *pathparent, NODE *centry) * * Make centry point to the just-replaced node. Unlink * the just-replaced node from the list, and allow it to - * be insterted in the correct position later. + * be inserted in the correct position later. */ centry = samename; if (centry->prev) From nobody Sat Dec 20 01:11:03 2025 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 4dY5vD2ml6z6L2hm for ; Sat, 20 Dec 2025 01:11:04 +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 4dY5vC2Rpfz3vPM for ; Sat, 20 Dec 2025 01:11:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193063; 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=jJPImiwT/ecua3w6CMJv2RwZPPo3QWpXbhPXjGKK6rI=; b=v2240zC0B2cTDFpJZZfExj+tuudm1sqrOBt7AWkD5dkxkRU4tstbMR/m9it2LAenetn9qT wV3sFt9uX/rZVHuEwH37AkbjDeGI6Gl8FJMPbGaIefGGBqwUABm5slcp6ZCPLZ7maL88Gq Cl17Ob3KpZSGn05dmbartJMn/7Us49zEfZeNyvZPFnzKIkZiLdmAxnMXJWxJ4JiBG/1lvX RGhsmNQj2zTXO/FJx00FPGK0ZSrk9D9vNaAh0hXNvWv7mKTkF19QYmW/3HGqF7Tzh9IixQ Zo5l3pV8b9+I8syFGhaZponObVKorQGLv+/5lHEzVQX4XZNmsQMUALJqJKxXSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193063; 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=jJPImiwT/ecua3w6CMJv2RwZPPo3QWpXbhPXjGKK6rI=; b=jY8i/VmFvbgByEt2g8nRQpS7bTOUgeyHsO/ozMdUBbLCeEN1haHj1LE233PtZ6FE8o6bBH KLqHPXm3g1/fM8lVzB6LKR9Z0BKTboFDoEP6/dMyofU5QmqdKEDWY6jBBcupSKrd7EvE6y PnDk7UREyubKuxPt9Obu56CsHdfkKHrd5Yz/aj9ylSDR3T6X8tr+G5/Vxp/+xQiXqeqg// 5FFUdVnRtZubX/KRUhfCGwVAp9hdAgRnUJq/86LeFNFGK6gHE6Lgoe3eJTVoXx2V03ZuH3 Kb/rUm7UwNdxVX4aCl4YDHEFhztSs5WCZqDuLCKww6K+sEj94sklrJzZn36X8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193063; a=rsa-sha256; cv=none; b=NnNsiSJwb+99rYZlDdDYwYQe5otq3EXRU6ESZo6RchAGuPO9E9J8T6hNugywfH0TbPx7Tw oTHKSSmUV8WFLEXkGh21ZTkbFOqEF4eLjxeG64F1y6YbXSSH97F8tiDMwOGUYgUgUoNYhK WpONaiuZLXFGddAn7f643LPVhd0qnythI2UABJZ8rR1aUMflMHA9D1Yp0bAWTdWqwbY3SH AWW8mEjKn2UKr9zBBKKCSlk/drLR4Lj1u9t3vakfqL6tm0afN9TYR7i5JXiIQ2x7JO7oii WDM+M16ElEivyx1iARnPb4j8S+JjSY3TUZG3B75gWmNZGTBhNXxjrCRonyVYNQ== 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 4dY5vC22PJzYNW for ; Sat, 20 Dec 2025 01:11:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34a3e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:11:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 7cc02662711c - stable/14 - mtree: tests: Import NetBSD's mtree test suite 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7cc02662711ca0eb036114686f4f293a5e4be8bc Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:11:03 +0000 Message-Id: <6945f7a7.34a3e.5f3f2829@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=7cc02662711ca0eb036114686f4f293a5e4be8bc commit 7cc02662711ca0eb036114686f4f293a5e4be8bc Author: Jose Luis Duran AuthorDate: 2025-12-09 15:45:01 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:07:52 +0000 mtree: tests: Import NetBSD's mtree test suite Manually import latest mtree test suite from NetBSD. MFC after: 1 week (cherry picked from commit 2f29d0f3e6d25599c188c94bf1e395d9cbeb2a4d) --- contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh | 40 +++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh old mode 100755 new mode 100644 index 5daefd84e928..5e4177c792a5 --- a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh +++ b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh @@ -1,4 +1,4 @@ -# $NetBSD: t_mtree.sh,v 1.7 2017/01/14 20:45:16 christos Exp $ +# $NetBSD: t_mtree.sh,v 1.10 2023/12/02 16:18:17 christos Exp $ # # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -447,6 +447,42 @@ mtree_specspec_type_body() fi } +atf_test_case mtree_onlyfile +atf_test_case netbsd6_onlyfile +onlyfile_head() +{ + atf_set "descr" "Test -O with same hash value in directory and leaf" +} + +onlyfile_body() +{ + mkdir -p ab/no + echo ./ab/no >onlyfile + mtree -F ${FLAVOR} -c -n -O onlyfile >output + if [ ! -s output ]; then + atf_fail "mtree did not find path in onlyfile" + fi +} + +mtree_onlyfile_head() +{ + FLAVOR=mtree onlyfile_head +} +netbsd6_onlyfile_head() +{ + FLAVOR=netbsd6 onlyfile_head +} + +mtree_onlyfile_body() +{ + FLAVOR=mtree onlyfile_body +} +netbsd6_onlyfile_body() +{ + FLAVOR=netbsd6 onlyfile_body +} + + atf_init_test_cases() { atf_add_test_case mtree_create @@ -459,6 +495,7 @@ atf_init_test_cases() atf_add_test_case mtree_merge atf_add_test_case mtree_nonemptydir atf_add_test_case mtree_specspec_type + atf_add_test_case mtree_onlyfile atf_add_test_case netbsd6_create atf_add_test_case netbsd6_check @@ -469,4 +506,5 @@ atf_init_test_cases() atf_add_test_case netbsd6_ignore atf_add_test_case netbsd6_merge atf_add_test_case netbsd6_nonemptydir + atf_add_test_case netbsd6_onlyfile } From nobody Sat Dec 20 01:11:20 2025 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 4dY5vX56TSz6L2j4 for ; Sat, 20 Dec 2025 01:11:20 +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 4dY5vX1J7Yz3vbK for ; Sat, 20 Dec 2025 01:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193080; 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=r2j8ln4pHNEU7ZScq+v9oCVWqfl5SDxVjQfVpJunakg=; b=cLnJic8vZxeZvzQw8gTp/CT9d1fuFDp++zhLIBKGTojBqmDC8Yfudkp5tGGp0UY77jH8yT iEKkHVhZ9SBVAa+Fnbn1AoP7tAh53e91yoCxyuLG1CuePjMZqNrsWq3UehideL9zOPYAza XS/1hC6ImE6ckHpWESbp85Cp3UY18WbmFY3AicGo4IGnE/46gZNyiaC37IWQK0ItLUlwAC gr2kHEi7DoHCnWBKW/BulAn5VjbI2ZovEKcaVVYvJQ13svboELWNi/OYcPS9qOrpOjQF7q LBvb6nd5yZCIrLG6va9xZBhlozDbCF0Gz8S8Z4ScpVmoMsWXr0MaWC9+xb/4Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193080; 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=r2j8ln4pHNEU7ZScq+v9oCVWqfl5SDxVjQfVpJunakg=; b=GmyEuhSWOW8CQcqOuvrRaj54jmdvLMpuG77FFzt7l0sZRmENd+YSMTpTy4cJPGaCSSJdFd dmBPiUXuykjgXuP0ehTBKP6x9nn4jBjK3EXld1iEzqkU4IJqQHqUgEfE+Uwo9Ooj58uqpR FWcFIPZg9UT1Bm7ghvemW3ym0Sws6PkixfJ9F+N2acN4bnOD0WDcMwnYN5YI07cV3tSe/8 LA9ftpnMCF7JtTcEQhIyKZb4RHDQA/8cLyed2VGeDUkCplTb5niF0S9Cl2FnowG+79bCdv T0Fi2hYyAvTSqam4UTrrTzP9tzL0Mx9mnezVQb2kYzhwM6WSl/p57jcm3iwsZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193080; a=rsa-sha256; cv=none; b=qjgwOqxEhZqv7IvRvAvd2qumzm72kU4ZFWco8EdzYQj06/kiT39USqNlquwcA+0et6EPh/ 3/TL5xMs+z4ip712AQP/bjB0qaUHsJz37blsb2iV9IziUNQZTRPM9u+X682TjQjnnbn4TP xtdH+MEqPa9lJL9zQpQzktp8eHIU19YncXK7QujUdyNLq1hJOGc8GxpAE4K9Nc/FzraldS 8IAz45eKWxbH+xLOJB46rDRAx+E8bcWrAV5kbqudVpPJEwqOlYt5b9OAFc9sPahZTs0TwG H9uCtRasH0xznO26NOh18S5VgED/iXB+RuFtlSv1ySlgNGqCxZnmk6wAn8ZKGA== 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 4dY5vX0mbyzYv8 for ; Sat, 20 Dec 2025 01:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35f26 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:11:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 23d971abe8f0 - stable/13 - mtree: Fix typos 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 23d971abe8f02b251bb1222bb0da97f1b0dc8180 Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:11:20 +0000 Message-Id: <6945f7b8.35f26.69003c8e@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=23d971abe8f02b251bb1222bb0da97f1b0dc8180 commit 23d971abe8f02b251bb1222bb0da97f1b0dc8180 Author: Jose Luis Duran AuthorDate: 2025-12-09 13:18:23 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:08:37 +0000 mtree: Fix typos Manually apply a typo fix. This change has already been submitted upstream as bin/59824. MFC after: 1 week (cherry picked from commit dab5daf54cc26aaf2679a2eda5f378461f279ec5) --- contrib/mtree/compare.c | 2 +- contrib/mtree/spec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index c4e5bfcac1d7..3d8cf2335207 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -285,7 +285,7 @@ typeerr: LABEL; LABEL; printf(flavor == F_FREEBSD9 ? - "%spermissions expcted %#lo found %#lo" : + "%spermissions expected %#lo found %#lo" : "%spermissions (%#lo, %#lo", tab, (u_long)s->st_mode, (u_long)p->fts_statp->st_mode & MBITS); diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 25bface34bd0..24e15f33fa8a 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -803,7 +803,7 @@ addchild(NODE *pathparent, NODE *centry) * * Make centry point to the just-replaced node. Unlink * the just-replaced node from the list, and allow it to - * be insterted in the correct position later. + * be inserted in the correct position later. */ centry = samename; if (centry->prev) From nobody Sat Dec 20 01:11:19 2025 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 4dY5vX0BrZz6L2Xj for ; Sat, 20 Dec 2025 01:11:20 +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 4dY5vW3kDZz3vq6 for ; Sat, 20 Dec 2025 01:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193079; 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=S6J4AA3V02Be+kPHxNa2mEq4WVk0lzaGS5jVgkwjviM=; b=uSOILBzKmjTe0YuLohj4B+8s4zguIskCpNTa1laOTTqYr95hANdv9NUmumc/n7ZK9jSWDT 0JiLRPZFzWFo21nnv+zfPskfbJzA4KxXCTlQekSduUe617wT0p+t9PTWcmk3o+ZBlzGFCj Nr8vINH42nQ5ZVP9K0qesRsLN9bJF2+GX29JYr/qozOSDqEtAA0Z/aGdxWX7Tu1wqNdPEQ kPNR2T9n9x5TuY2oDRp81jRXgq7B3hluqyK4PX+2N8czTexdmy4svvAk5jOj0JzHjrH1OU s0QZln4cVOFPiBzXTDzTi7LGG5i6LDMYmhFyYhFthq1EU5XqJ+J1fKgiQCZI0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193079; 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=S6J4AA3V02Be+kPHxNa2mEq4WVk0lzaGS5jVgkwjviM=; b=cXIy0SRxFdn3vbJ/rO/GcRPZUI/hyzgF2t5eDzfr1Kl3tRuI1abwqC4bUNLc29tfTGrpRz c5OuLBXJ7UIJoTSAMJ0dCTYgu0YXWwvL6mL64e7ijK9XplSt3WCB7MC/WXyM5Rn7yQYs2I Xl/xemI9fsyG+cVsDjVKxok/v45oENHp7nQxOOtEbf/QZ7SXMPV+qZYUCCf8U4TNM9frHO 9G/r1nNVpB5EubKW3YYOb2kRnF6AgruR+UQrSH5xZwiMYeh4aBuUB0oZRwKgW1lPQEO2XL pCmoWYTknYF3mnhfh/Nx/+puWCNZhqAbNa9LVvG6sMmnXdt3z5I9SoUD38iTGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193079; a=rsa-sha256; cv=none; b=OZ02qGYxuaxfH6YC7Fi3xaVICaVR1UEWXIuv4ytgpFYY+5QhVyVshczmS/xzrAhJyWFlgj HA9PSxFNK9J+sG6l72HwwAeEOVh7+2OlD3diWSmd/Pwh1yb3aQZUvJSIhBBgvbGEtomeOR ux4wyCQPXcqdepj1GeIY98I7VndWhHJp+/v8xAGWUgIRU6mwegbsRRTGuuvd9nmUZAM4Fs xLdyPtB6llq1bpswMCTrz31sDqKOP4arq/qVm25P5wgPx3qoUdLcNXqRw3c4kvDz347XVn CoIckxLtx7rdmsKgpYy3BCzVIXijNo8eVTyeN1EMzHtMoVmYsw3HGNVlM5ctcw== 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 4dY5vW0SsmzYxZ for ; Sat, 20 Dec 2025 01:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35924 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:11:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a3b349e43987 - stable/13 - Import latest mtree from NetBSD 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3b349e439870eeb4f58c74b990f721d86a75e1d Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:11:19 +0000 Message-Id: <6945f7b7.35924.1cf63169@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a3b349e439870eeb4f58c74b990f721d86a75e1d commit a3b349e439870eeb4f58c74b990f721d86a75e1d Author: Jose Luis Duran AuthorDate: 2025-12-13 14:28:16 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:08:28 +0000 Import latest mtree from NetBSD Merge commit 'f600477feb4ae61a75f61949eb600caff4aeea8c' MFC after: 1 week Discussed with: brooks (cherry picked from commit 49b6dda4d71175ad615718401573be5fd024822b) --- contrib/mtree/compare.c | 39 ++++++++----- contrib/mtree/crc.c | 20 +++---- contrib/mtree/create.c | 144 ++++++++++++++++++++--------------------------- contrib/mtree/extern.h | 13 ++++- contrib/mtree/misc.c | 10 ++-- contrib/mtree/mtree.8 | 139 +++++++++++++++++++++++++++++++++++---------- contrib/mtree/mtree.c | 8 +-- contrib/mtree/spec.c | 44 ++++++++++++--- contrib/mtree/specspec.c | 4 +- contrib/mtree/verify.c | 17 ++++-- 10 files changed, 271 insertions(+), 167 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index e3639ceea08f..c4e5bfcac1d7 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $ */ +/* $NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -135,8 +135,9 @@ do { \ int compare(NODE *s, FTSENT *p) { - u_int32_t len, val, flags; + uint32_t len, val, flags; int fd, label; + bool was_unlinked; const char *cp, *tab; #if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) char *digestbuf; @@ -144,6 +145,7 @@ compare(NODE *s, FTSENT *p) tab = NULL; label = 0; + was_unlinked = false; switch(s->type) { case F_BLOCK: if (!S_ISBLK(p->fts_statp->st_mode)) @@ -210,47 +212,53 @@ typeerr: LABEL; s->st_mode | nodetoino(s->type), s->st_rdev) == -1) || (lchown(p->fts_accpath, p->fts_statp->st_uid, - p->fts_statp->st_gid) == -1) ) + p->fts_statp->st_gid) == -1) ) { printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); - else + } else { printf(", modified%s\n", flavor == F_FREEBSD9 ? "" : ")"); + was_unlinked = true; + } } else printf(")\n"); tab = "\t"; } /* Set the uid/gid first, then set the mode. */ - if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) { + if (s->flags & (F_UID | F_UNAME) && + (was_unlinked || s->st_uid != p->fts_statp->st_uid)) { LABEL; printf(flavor == F_FREEBSD9 ? "%suser expected %lu found %lu" : "%suser (%lu, %lu", tab, (u_long)s->st_uid, (u_long)p->fts_statp->st_uid); if (uflag) { - if (lchown(p->fts_accpath, s->st_uid, -1)) + if (lchown(p->fts_accpath, s->st_uid, (gid_t)-1)) printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; } - if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) { + if (s->flags & (F_GID | F_GNAME) && + (was_unlinked || s->st_gid != p->fts_statp->st_gid)) { LABEL; printf(flavor == F_FREEBSD9 ? "%sgid expected %lu found %lu" : "%sgid (%lu, %lu", tab, (u_long)s->st_gid, (u_long)p->fts_statp->st_gid); if (uflag) { - if (lchown(p->fts_accpath, -1, s->st_gid)) + if (lchown(p->fts_accpath, (uid_t)-1, s->st_gid)) printf(", not modified: %s%s\n", strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else @@ -258,8 +266,8 @@ typeerr: LABEL; tab = "\t"; } if (s->flags & F_MODE && - s->st_mode != (p->fts_statp->st_mode & MBITS)) { - if (lflag) { + (was_unlinked || s->st_mode != (p->fts_statp->st_mode & MBITS))) { + if (lflag && !was_unlinked) { mode_t tmode, mode; tmode = s->st_mode; @@ -287,7 +295,8 @@ typeerr: LABEL; strerror(errno), flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified%s\n", + printf(", modified%s%s\n", + was_unlinked ? " by unlink" : "", flavor == F_FREEBSD9 ? "" : ")"); } else @@ -567,7 +576,7 @@ const char * rlink(const char *name) { static char lbuf[MAXPATHLEN]; - int len; + ssize_t len; if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1) mtree_err("%s: %s", name, strerror(errno)); diff --git a/contrib/mtree/crc.c b/contrib/mtree/crc.c index 4eac66e5b995..69b30b206439 100644 --- a/contrib/mtree/crc.c +++ b/contrib/mtree/crc.c @@ -1,4 +1,4 @@ -/* $NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $ */ +/* $NetBSD: crc.c,v 1.11 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93"; #else -__RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $"); +__RCSID("$NetBSD: crc.c,v 1.11 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -53,7 +53,7 @@ __RCSID("$NetBSD: crc.c,v 1.9 2012/10/05 00:40:51 christos Exp $"); #include "extern.h" -static const u_int32_t crctab[] = { +static const uint32_t crctab[] = { 0x0, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, @@ -114,15 +114,15 @@ static const u_int32_t crctab[] = { * locations to store the crc and the number of bytes read. It returns 0 on * success and 1 on failure. Errno is set on failure. */ -u_int32_t crc_total = ~0; /* The crc over a number of files. */ +uint32_t crc_total = ~0u; /* The crc over a number of files. */ int -crc(int fd, u_int32_t *cval, u_int32_t *clen) +crc(int fd, uint32_t *cval, uint32_t *clen) { u_char *p; - int nr; - u_int32_t thecrc, len; - u_int32_t crctot; + ssize_t nr; + uint32_t thecrc, len; + uint32_t crctot; u_char buf[16 * 1024]; #define COMPUTE(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)] @@ -132,12 +132,12 @@ crc(int fd, u_int32_t *cval, u_int32_t *clen) crctot = ~crc_total; while ((nr = read(fd, buf, sizeof(buf))) > 0) if (sflag) { - for (len += nr, p = buf; nr--; ++p) { + for (len += (uint32_t)nr, p = buf; nr--; ++p) { COMPUTE(thecrc, *p); COMPUTE(crctot, *p); } } else { - for (len += nr, p = buf; nr--; ++p) + for (len += (uint32_t)nr, p = buf; nr--; ++p) COMPUTE(thecrc, *p); } if (nr < 0) diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c index 7a09a1cc3951..e23004851f39 100644 --- a/contrib/mtree/create.c +++ b/contrib/mtree/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -84,13 +84,6 @@ static uid_t uid; static mode_t mode; static u_long flags; -#ifdef __FreeBSD__ -#define FTS_CONST const -#else -#define FTS_CONST -#endif - -static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); static void output(FILE *, int, int *, const char *, ...) __printflike(4, 5); static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, @@ -180,15 +173,59 @@ cwalk(FILE *fp) mtree_err("%s checksum: %u", fullpath, crc_total); } +static void +dosum(FILE *fp, int indent, FTSENT *p, int *offset, int flag, + char * (*func)(const char *, char *), const char *key) +{ + char *digestbuf; + + if ((keys & flag) == 0) + return; + + digestbuf = (*func)(p->fts_accpath, NULL); + if (digestbuf != NULL) { + output(fp, indent, offset, "%s=%s", key, digestbuf); + free(digestbuf); + return; + } + + if (qflag) { + warn("%s: %s failed", p->fts_path, key); + return; + } + + mtree_err("%s: %s failed: %s", p->fts_path, key, strerror(errno)); +} + +static char * +crcFile(const char *fname, char *dummy __unused) +{ + char *ptr; + uint32_t val, len; + int fd, e; + + if ((fd = open(fname, O_RDONLY)) == -1) + goto out; + + e = crc(fd, &val, &len); + close(fd); + if (e) + goto out; + + if (asprintf(&ptr, "%u", val) < 0) + goto out; + + return ptr; +out: + mtree_err("%s: %s", fname, strerror(errno)); + return NULL; +} + static void statf(FILE *fp, int indent, FTSENT *p) { - u_int32_t len, val; - int fd, offset; + int offset; const char *name = NULL; -#if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) - char *digestbuf; -#endif offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); @@ -241,65 +278,25 @@ statf(FILE *fp, int indent, FTSENT *p) output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif - if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { - if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || - crc(fd, &val, &len)) - mtree_err("%s: %s", p->fts_accpath, strerror(errno)); - close(fd); - output(fp, indent, &offset, "cksum=%lu", (long)val); - } + if (S_ISREG(p->fts_statp->st_mode)) { + dosum(fp, indent, p, &offset, F_CKSUM, crcFile, "cksum"); #ifndef NO_MD5 - if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: MD5File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_MD5, MD5File, MD5KEY); #endif /* ! NO_MD5 */ #ifndef NO_RMD160 - if (keys & F_RMD160 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: RMD160File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_RMD160, RMD160File, RMD160KEY); #endif /* ! NO_RMD160 */ #ifndef NO_SHA1 - if (keys & F_SHA1 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA1File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA1, SHA1File, SHA1KEY); #endif /* ! NO_SHA1 */ #ifndef NO_SHA2 - if (keys & F_SHA256 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA256, SHA256_File, SHA256KEY); #ifdef SHA384_BLOCK_LENGTH - if (keys & F_SHA384 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA384, SHA384_File, SHA384KEY); #endif - if (keys & F_SHA512 && S_ISREG(p->fts_statp->st_mode)) { - if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) - mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, - strerror(errno)); - output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); - free(digestbuf); - } + dosum(fp, indent, p, &offset, F_SHA512, SHA512_File, SHA512KEY); #endif /* ! NO_SHA2 */ + } if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) output(fp, indent, &offset, "link=%s", @@ -440,27 +437,6 @@ statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, return (0); } -/* - * dcmp -- - * used as a comparison function passed to fts_open() to control - * the order in which fts_read() returns results. We make - * directories sort after non-directories, but otherwise sort in - * strcmp() order. - * - * Keep this in sync with nodecmp() in spec.c. - */ -static int -dcmp(const FTSENT *FTS_CONST *a, const FTSENT *FTS_CONST *b) -{ - - if (S_ISDIR((*a)->fts_statp->st_mode)) { - if (!S_ISDIR((*b)->fts_statp->st_mode)) - return (1); - } else if (S_ISDIR((*b)->fts_statp->st_mode)) - return (-1); - return (strcmp((*a)->fts_name, (*b)->fts_name)); -} - void output(FILE *fp, int indent, int *offset, const char *fmt, ...) { diff --git a/contrib/mtree/extern.h b/contrib/mtree/extern.h index 091cf8f84460..7b58dd4a4d20 100644 --- a/contrib/mtree/extern.h +++ b/contrib/mtree/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: extern.h,v 1.41 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -49,6 +49,12 @@ #include #endif +#if defined(__FreeBSD__) && !defined(HAVE_NBTOOL_CONFIG_H) +#define FTS_CONST const +#else +#define FTS_CONST +#endif + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif @@ -62,8 +68,9 @@ enum flavor { void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); -int crc(int, u_int32_t *, u_int32_t *); +int crc(int, uint32_t *, uint32_t *); void cwalk(FILE *); +int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); @@ -83,7 +90,7 @@ extern int bflag, dflag, eflag, iflag, jflag, lflag, mflag, extern int mtree_Mflag, mtree_Sflag, mtree_Wflag; extern size_t mtree_lineno; extern enum flavor flavor; -extern u_int32_t crc_total; +extern uint32_t crc_total; extern int ftsoptions, keys; extern char fullpath[]; extern slist_t includetags, excludetags; diff --git a/contrib/mtree/misc.c b/contrib/mtree/misc.c index b99f1ce1f708..b5bd9f4e06c6 100644 --- a/contrib/mtree/misc.c +++ b/contrib/mtree/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.34 2012/12/20 19:09:25 christos Exp $ */ +/* $NetBSD: misc.c,v 1.35 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: misc.c,v 1.34 2012/12/20 19:09:25 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.35 2024/12/05 17:17:43 christos Exp $"); #endif /* not lint */ #include @@ -111,7 +111,7 @@ slist_t excludetags, includetags; int keys = KEYDEFAULT; -int keycompare(const void *, const void *); +static int keycompare(const void *, const void *); u_int parsekey(const char *name, int *needvaluep) @@ -153,7 +153,7 @@ parsetype(const char *name) return (k->val); } -int +static int keycompare(const void *a, const void *b) { @@ -198,7 +198,7 @@ void parsetags(slist_t *list, char *args) { char *p, *e; - int len; + size_t len; if (args == NULL) { addtag(list, NULL); diff --git a/contrib/mtree/mtree.8 b/contrib/mtree/mtree.8 index 53bb21f711bf..99e3199de943 100644 --- a/contrib/mtree/mtree.8 +++ b/contrib/mtree/mtree.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mtree.8,v 1.69 2013/02/03 19:16:06 christos Exp $ +.\" $NetBSD: mtree.8,v 1.78 2023/12/02 13:26:09 christos Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,7 +56,7 @@ .\" .\" @(#)mtree.8 8.2 (Berkeley) 12/11/93 .\" -.Dd February 3, 2013 +.Dd December 2, 2023 .Dt MTREE 8 .Os .Sh NAME @@ -93,9 +93,11 @@ characteristics do not match the specification, or which are missing from either the file hierarchy or the specification. .Pp The options are as follows: -.Bl -tag -width Xxxexcludexfilexx +.Bl -tag -width Fl +. .It Fl b Suppress blank lines before entering and after exiting directories. +. .It Fl C Convert a specification into a format that's easier to parse with various tools. @@ -105,8 +107,7 @@ from the file given by In the output, each file or directory is represented using a single line (which might be very long). The full path name -(beginning with -.Dq \&./ ) +.Pq beginning with Ql \&./ is always printed as the first field; .Fl K , .Fl k , @@ -120,19 +121,25 @@ can be used to control which files are printed; and the .Fl S option can be used to sort the output. +. .It Fl c Print a specification for the file hierarchy originating at -the current working directory (or the directory provided by -.Fl p Ar path ) +the current working directory +.Po or the directory provided by +.Fl p Ar path +.Pc to the standard output. The output is in a style using relative path names. +. .It Fl D As per .Fl C , except that the path name is always printed as the last field instead of the first. +. .It Fl d Ignore everything except directory type files. +. .It Fl E Ar tags Add the comma separated tags to the .Dq exclusion @@ -141,9 +148,11 @@ Non-directories with tags which are in the exclusion list are not printed with .Fl C and .Fl D . +. .It Fl e Don't complain about files that are in the file hierarchy, but not in the specification. +. .It Fl F Ar flavor Set the compatibility flavor of the .Nm @@ -151,22 +160,23 @@ utility. The .Ar flavor can be one of -.Sy mtree , -.Sy freebsd9 , +.Cm mtree , +.Cm freebsd9 , or -.Sy netbsd6 . +.Cm netbsd6 . The default is -.Sy mtree . +.Cm mtree . The -.Sy freebsd9 +.Cm freebsd9 and -.Sy netbsd6 -flavors attempt to preserve output compatiblity and command line option +.Cm netbsd6 +flavors attempt to preserve output compatibility and command line option backward compatibility with .Fx 9.0 and .Nx 6.0 respectively. +. .It Fl f Ar spec Read the specification from .Ar file , @@ -178,10 +188,18 @@ The specifications will be sorted like output generated using .Fl c . The output format in this case is somewhat reminiscent of .Xr comm 1 , -having "in first spec only", "in second spec only", and "different" -columns, prefixed by zero, one and two TAB characters respectively. -Each entry in the "different" column occupies two lines, one from each -specification. +having +.Dq in first spec only , +.Dq in second spec only , +and +.Dq different +columns, prefixed by zero, one and two +.Tn TAB +characters respectively. +Each entry in the +.Dq different +column occupies two lines, one from each specification. +. .It Fl I Ar tags Add the comma separated tags to the .Dq inclusion @@ -191,14 +209,22 @@ Non-directories with tags which are in the inclusion list are printed with and .Fl D . If no inclusion list is provided, the default is to display all files. +. .It Fl i -If specified, set the schg and/or sappnd flags. +If specified, set the +.Ql schg +and/or +.Ql sappnd +flags. +. .It Fl j Indent the output 4 spaces each time a directory level is descended when creating a specification with the .Fl c option. -This does not affect either the /set statements or the comment before each +This does not affect either the +.Ql /set +statements or the comment before each directory. It does however affect the comment before the close of each directory. This is the equivalent of the @@ -207,26 +233,31 @@ option in the .Fx version of .Nm . +. .It Fl K Ar keywords Add the specified (whitespace or comma separated) keywords to the current set of keywords. If .Ql all is specified, add all of the other keywords. +. .It Fl k Ar keywords Use the .Sy type keyword plus the specified (whitespace or comma separated) -keywords instead of the current set of keywords. +.Ar keywords +instead of the current set of keywords. If .Ql all is specified, use all of the other keywords. If the .Sy type keyword is not desired, suppress it with -.Fl R Ar type . +.Fl R Cm type . +. .It Fl L Follow all symbolic links in the file hierarchy. +. .It Fl l Do .Dq loose @@ -235,7 +266,7 @@ will match less stringent ones. For example, a file marked mode 0444 will pass a check for mode 0644. .Dq Loose -checks apply only to read, write and execute permissions -- in +checks apply only to read, write and execute permissions \(em in particular, if other bits like the sticky bit or suid/sgid bits are set either in the specification or the file, exact checking will be performed. @@ -244,17 +275,25 @@ This option may not be set at the same time as the or .Fl u option. +. .It Fl M Permit merging of specification entries with different types, with the last entry taking precedence. +. .It Fl m -If the schg and/or sappnd flags are specified, reset these flags. -Note that this is only possible with securelevel less than 1 (i.e., -in single user mode or while the system is running in insecure -mode). +If the +.Ql schg +and/or +.Ql sappnd +flags are specified, reset these flags. +Note that this is only possible with securelevel less than 1 +.Po +i.e., in single user mode or while the system is running in insecure mode +.Pc . See .Xr init 8 for information on security levels. +. .It Fl n Do not emit pathname comments when creating a specification. Normally @@ -262,6 +301,7 @@ a comment is emitted before each directory and before the close of that directory when using the .Fl c option. +. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd @@ -274,31 +314,42 @@ rather than using the results from the system's and .Xr getgrnam 3 (and related) library calls. +. .It Fl O Ar onlypaths Only include files included in this list of pathnames. +. .It Fl P Don't follow symbolic links in the file hierarchy, instead consider the symbolic link itself in any comparisons. This is the default. +. .It Fl p Ar path Use the file hierarchy rooted in .Ar path , instead of the current directory. +. .It Fl q Quiet mode. Do not complain when a .Dq missing directory cannot be created because it already exists. This occurs when the directory is a symbolic link. +. .It Fl R Ar keywords Remove the specified (whitespace or comma separated) keywords from the current set of keywords. If .Ql all is specified, remove all of the other keywords. +. .It Fl r Remove any files in the file hierarchy that are not described in the specification. +Repeating the flag more than once will attempt to reset all the +file flags via +.Xr lchflags 2 +before attempting to remove the file in case the file was immutable. +. .It Fl S When reading a specification into an internal data structure, sort the entries. @@ -320,19 +371,23 @@ By default, if the .Fl S option is not used, entries within the same directory are collected together (separated from entries for other directories), but not sorted. +. .It Fl s Ar seed Display a single checksum to the standard error output that represents all of the files for which the keyword .Sy cksum was specified. The checksum is seeded with the specified value. +. .It Fl t Modify the modified time of existing files, the device type of devices, and symbolic link targets, to match the specification. +. .It Fl U Same as .Fl u except that a mismatch is not considered to be an error if it was corrected. +. .It Fl u Modify the owner, group, permissions, and flags of existing files, the device type of devices, and symbolic link targets, @@ -350,6 +405,7 @@ is given, these flags will be reset. Exit with a status of 0 on success, 2 if the file hierarchy did not match the specification, and 1 if any other error occurred. +. .It Fl W Don't attempt to set various file attributes such as the ownership, mode, flags, or time @@ -358,6 +414,7 @@ This option will be most useful when used in conjunction with .Fl U or .Fl u . +. .It Fl X Ar exclude-file The specified file contains .Xr fnmatch 3 @@ -370,11 +427,14 @@ the starting directory); otherwise, it will be matched against basenames only. Comments are permitted in the -.Ar exclude-list +.Ar exclude-file file. +. .It Fl x Don't descend below mount points in the file hierarchy. +. .El +. .Pp Specifications are mostly composed of .Dq keywords , @@ -384,7 +444,8 @@ No keywords have default values, and if a keyword has no value set, no checks based on it are performed. .Pp Currently supported keywords are as follows: -.Bl -tag -width sha384digestxx +. +.Bl -tag -width Sy .It Sy cksum The checksum of the file using the default algorithm specified by the @@ -420,6 +481,7 @@ format.) .It Ar number Opaque number (as stored on the file system). .El +. .Pp The following values for .Ar format @@ -614,9 +676,24 @@ they match. .Nm uses .Xr strsvis 3 -(in VIS_CSTYLE format) to encode path names containing +(in +.Dv VIS_OCTAL +format) to encode path names containing non-printable characters. Whitespace characters are encoded as +.Ql \e040 +(space), +.Ql \e011 +(tab), and +.Ql \e012 +(new line). +When flavor +.Sy netbsd6 +is selected, +.Xr strsvis 3 +(in +.Dv VIS_CSTYLE +format) is used and whitespace characters are encoded as .Ql \es (space), .Ql \et @@ -678,7 +755,7 @@ The utility exits with a status of 0 on success, 1 if any error occurred, and 2 if the file hierarchy did not match the specification. .Sh FILES -.Bl -tag -width /etc/mtree -compact +.Bl -tag -width Pa -compact .It Pa /etc/mtree system specification directory .El diff --git a/contrib/mtree/mtree.c b/contrib/mtree/mtree.c index 8b4cb9494d53..28f09fa32210 100644 --- a/contrib/mtree/mtree.c +++ b/contrib/mtree/mtree.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $"); #endif #endif /* not lint */ @@ -195,7 +195,7 @@ main(int argc, char **argv) qflag = 1; break; case 'r': - rflag = 1; + rflag++; break; case 'R': while ((p = strsep(&optarg, " \t,")) != NULL) @@ -204,7 +204,7 @@ main(int argc, char **argv) break; case 's': sflag = 1; - crc_total = ~strtol(optarg, &p, 0); + crc_total = (uint32_t)~strtol(optarg, &p, 0); if (*p) mtree_err("illegal seed value -- %s", optarg); break; diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 6fbe6f534560..25bface34bd0 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ +/* $NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $"); #endif #endif /* not lint */ @@ -224,10 +224,14 @@ noparent: mtree_err("no parent node"); */ if (strcmp(centry->name, ".") == 0 && centry->type == 0) centry->type = F_DIR; - if (strcmp(centry->name, ".") != 0 || - centry->type != F_DIR) + if (strcmp(centry->name, ".") != 0) mtree_err( - "root node must be the directory `.'"); + "root node must be the directory `.'," + " found `%s'", centry->name); + if (centry->type != F_DIR) + mtree_err( + "root node must type %#x != %#x", + F_DIR, centry->type); last = root = centry; root->parent = root; } else if (pathparent != NULL) { @@ -539,7 +543,8 @@ replacenode(NODE *cur, NODE *new) static void set(char *t, NODE *ip) { *** 120 LINES SKIPPED *** From nobody Sat Dec 20 01:11:21 2025 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 4dY5vY5dQLz6L2Xr for ; Sat, 20 Dec 2025 01:11:21 +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 4dY5vY2Lnyz3vbZ for ; Sat, 20 Dec 2025 01:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193081; 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=8xG09srwRGr16Px0FONY4rpwtbjO9JF6CYyVAN1hLCY=; b=UIzivbcuOPIJqA3ZsYAMmesKw5Hp7n7AFF++OoR7egmAynTn3Hn3Dugrk5+2gML2bbWAlg 2lT2Ae86Zls6NGy9zRresMMumtAV87LbOimQUK5UXR/sgt2wujey/DGiYiVRmn2JBrqzRe WZ901kgjdb7k3I8QePCpssJmhFros18/mA1Vekjro0imF7LyUHntL6zkWMbrrk6xwrbEnS 3XJRdXNb+YPDXHSdPmC1O+YhHK88XeZDEP/SgR2FflXsOVKohyoWsJ+94ObUmps5q6yRyq RlWPDGL6EIL76/h89fk4mRBEyif/eJ+ZWeR/Aa/Jd2kg8I8LmwDvP0GwDQIBnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766193081; 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=8xG09srwRGr16Px0FONY4rpwtbjO9JF6CYyVAN1hLCY=; b=SZX9Py1V3Dxy/F67ZU5zUYqhITbGoXg90jJQCts0iXqxkGYJe/fIZTo6z/8Yo5cQRao5Hv BjjLihemYZ9p41bvNykGfzC85N7x0WeJVTlWhx/gAHqZiijk1NhhKfNUgf5VHbTWKYvMue 3IQihX3tI2dnuyabJiipcYszWYi/+gENu5GqH1GK/vClUGRHsCDVBLQa6dnSGED9f2bsU0 RFvT95LsUcMXxTeVynGI7HSJsUmt4qGcRhQqbplKysvmcU26M5mJPMdu33rwVovTzgQ5QH hf0V5act6COgxhW+sOw7rUou/4oUKtSEHf0WmwCmYVWV6lCtDlprULJW8+Ceag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766193081; a=rsa-sha256; cv=none; b=yh8u7rn0ue8y/uII6qryPiV74bswkEkbyuW0lOpRrtFgbVEshzTXhFZtbcQFIXN+UrH9t0 qVFj1UphRy0pRR15Hn1F8Yil/KtEFGHcLZAmgdjgl3uB6Qm+d4zr5VjSd/n/nM8KljEbmT dQ1FZzcCrdyaKiIEfTWLOJxQ2+JeRkeXyuh4jVAbaNZjZHUpVty5Pk/U2HXe0NGtUTos6D NIyb1L4xQ8U4stIlxF6DuhIliZEVmAmMmiz3mbMuZ0nfozyKiLzTHqih5Yv868TvK8jfzn uxOKYZLj7bziCIpzw7oJJZc8BVOJxIaqZErs3wGQMtkiJ/NgY6IxSMa3ErzAzQ== 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 4dY5vY1bd0zYNh for ; Sat, 20 Dec 2025 01:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3414b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 01:11:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 2011380115d0 - stable/13 - mtree: tests: Import NetBSD's mtree test suite 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2011380115d0d1a862dc3b09bd2043e218333731 Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 01:11:21 +0000 Message-Id: <6945f7b9.3414b.393e9d1c@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=2011380115d0d1a862dc3b09bd2043e218333731 commit 2011380115d0d1a862dc3b09bd2043e218333731 Author: Jose Luis Duran AuthorDate: 2025-12-09 15:45:01 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-20 01:08:49 +0000 mtree: tests: Import NetBSD's mtree test suite Manually import latest mtree test suite from NetBSD. MFC after: 1 week (cherry picked from commit 2f29d0f3e6d25599c188c94bf1e395d9cbeb2a4d) --- contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh | 40 +++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh old mode 100755 new mode 100644 index 5daefd84e928..5e4177c792a5 --- a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh +++ b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh @@ -1,4 +1,4 @@ -# $NetBSD: t_mtree.sh,v 1.7 2017/01/14 20:45:16 christos Exp $ +# $NetBSD: t_mtree.sh,v 1.10 2023/12/02 16:18:17 christos Exp $ # # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -447,6 +447,42 @@ mtree_specspec_type_body() fi } +atf_test_case mtree_onlyfile +atf_test_case netbsd6_onlyfile +onlyfile_head() +{ + atf_set "descr" "Test -O with same hash value in directory and leaf" +} + +onlyfile_body() +{ + mkdir -p ab/no + echo ./ab/no >onlyfile + mtree -F ${FLAVOR} -c -n -O onlyfile >output + if [ ! -s output ]; then + atf_fail "mtree did not find path in onlyfile" + fi +} + +mtree_onlyfile_head() +{ + FLAVOR=mtree onlyfile_head +} +netbsd6_onlyfile_head() +{ + FLAVOR=netbsd6 onlyfile_head +} + +mtree_onlyfile_body() +{ + FLAVOR=mtree onlyfile_body +} +netbsd6_onlyfile_body() +{ + FLAVOR=netbsd6 onlyfile_body +} + + atf_init_test_cases() { atf_add_test_case mtree_create @@ -459,6 +495,7 @@ atf_init_test_cases() atf_add_test_case mtree_merge atf_add_test_case mtree_nonemptydir atf_add_test_case mtree_specspec_type + atf_add_test_case mtree_onlyfile atf_add_test_case netbsd6_create atf_add_test_case netbsd6_check @@ -469,4 +506,5 @@ atf_init_test_cases() atf_add_test_case netbsd6_ignore atf_add_test_case netbsd6_merge atf_add_test_case netbsd6_nonemptydir + atf_add_test_case netbsd6_onlyfile } From nobody Sat Dec 20 16:16:04 2025 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 4dYTzS3VMxz6KBY2 for ; Sat, 20 Dec 2025 16:16:04 +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 4dYTzS28Zcz3mKB for ; Sat, 20 Dec 2025 16:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766247364; 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=Zbg6CwOrS2/aCVK7J6QTL+RgqNkTGCI2dpQNNNgzJhA=; b=ZmXzBocRAD9zjCwxz8FvhFsN84AjROIcGpcpDo0MfjQ3KNRnmVgmgBe+a9G6CFbRRPeTS8 uXqq+u8zc6SexaOOpHVEuJpSwDvmWwCO53U7eBbaeT13Xnyo2cxgwXKgX45RwEDMj/kPKN PLpJd1B1jUYLBB+AGhRqc4aUxn5s/Zy6MrHfYim9a3K3y+nQyOpDW9VS6IgJhS4tzy6S7i siQL9iLrIIuyebjdkK/L9RFrafMLkJPrRmqwmxPNocVN+Antu+mpBhsTO7KijKMkPmZa2v jvQN0lQhXcBfH7ThWhcqvwsaSsAFBnDSf1LS2Fhn7ycWGC7Yxbv3UftugkuRug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766247364; 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=Zbg6CwOrS2/aCVK7J6QTL+RgqNkTGCI2dpQNNNgzJhA=; b=K69IrFR+kUWLfhIwx8b2r3Q7uLoaNAf1a1KrQeFCSNV2QeZPdZ+FW8L5Ro+V9EQ6lWa9VM 6I7CdS7nF4VN1cD2reqVgjBDE435yU8sfnxqs/wzhlSNPRi3zz6XajAS7mmwQLxBtuOYVt AO2NquOeqCg1GE/7GbyO1As+zhUMfnWrO26EZ0xoDCvvUh16yyEX/fQsM2LfBp8HdnNlfB e/o4nWGYaR01oh2Vm2DjZz98NkXPxmcuUgcS418nkUYlRGl07uHzwvU+N9PhQ2BRSl7oTw kWudhY9fUsETIl7vXWxUc+3m3wlierY8HtJ0gHESyZS93ur0dHN9/q6d6HvJeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766247364; a=rsa-sha256; cv=none; b=v3Xg5QilUpGZ3Bfs5OTxYITfuHGA4webel4JYdetj/A8jKnldFzwgjOdQu78TMFFXaoaJl 1aDbZj5GfZClHFTFHgBgnJUWEGofUor3byHLD3rLPwZ9he3NcvooQzBRE389ctH+SydR3h jAaNTvdoiquyG2PD596bpTXzgq5q7sEzKGDq91UcHEaKx8kl+18VY1njVzoNynU9JP6BTg 4tRGvtdqfOP96e+WyTXfkmdnPru+VG3kALf5r1EF38UbuhxmZXUHfJgy3iPZLsj+QtuWE7 k07on+I98lh7ZQ/Lneat5uy/LJ9b5MQRz1PQOxrpmkXYKP/Ny4KddViarsciSA== 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 4dYTzS1ltPz11rB for ; Sat, 20 Dec 2025 16:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id de9f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Dec 2025 16:16:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: f954e595b21f - stable/15 - tests/ci: Collect environment information 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f954e595b21fae59395540b0a8296972c979a6ae Auto-Submitted: auto-generated Date: Sat, 20 Dec 2025 16:16:04 +0000 Message-Id: <6946cbc4.de9f.3a93053c@gitrepo.freebsd.org> The branch stable/15 has been updated by bofh: URL: https://cgit.FreeBSD.org/src/commit/?id=f954e595b21fae59395540b0a8296972c979a6ae commit f954e595b21fae59395540b0a8296972c979a6ae Author: Muhammad Moinur Rahman AuthorDate: 2025-12-16 09:24:55 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2025-12-20 16:15:51 +0000 tests/ci: Collect environment information For reproducing errors or test results it is important to gather environment information. These environments are divided into two parts. One part is in which environment the artifacts were built into and the second part is in which environment the tests were run. This patch collects thesee information and saves into a .env file in the metadir. After this patch lands we will also need to change our jenkins job where we are uploading the artifact to a central location. This environment file should also be stored along with the artifact. For easier location the image basename and the environment basename are kept same. Approved by: lwhsu MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54247 (cherry picked from commit 14d5c13a89269862b51ef2a7f190b0d28cfbf8a2) --- tests/ci/Makefile | 43 +++++++++++++++++++++++++++++++++++- tests/ci/tools/freebsdci | 57 +++++++++++++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 23 deletions(-) diff --git a/tests/ci/Makefile b/tests/ci/Makefile index 30ca34a810be..a750b1265169 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -82,6 +82,7 @@ KYUA_TEST_FILTERS?= META_TAR!=mktemp /tmp/meta.XXXXXX META_DIR!=mktemp -d /tmp/meta.XXXXXX META_DIROUT!=mktemp -d /tmp/meta.XXXXXX +ENV_FILE= ${META_DIR}/ci-${OSRELEASE}-${GITREV}-${KERNCONF}.env DISC_CAM!=truncate -s 128m /tmp/disk-cam EXTRA_DISK_NUM?=5 DISK_NUMBERS!=jot - 1 ${EXTRA_DISK_NUM} @@ -201,7 +202,47 @@ CITYPE=smoke ci-set-full-var: .PHONY CITYPE=full -ci-create-meta: .PHONY +ci-get-env: .PHONY + @echo "TARGET=${TARGET}" > ${ENV_FILE} + @echo "TARGET_ARCH=${TARGET_ARCH}" >> ${ENV_FILE} + @echo "KERNCONF=${KERNCONF}" >> ${ENV_FILE} + @echo "OSRELEASE=${OSRELEASE}" >> ${ENV_FILE} + @echo "CIIMAGE=${CIIMAGE}" >> ${ENV_FILE} + @echo "CIDISK=${CIDISK}" >> ${ENV_FILE} + @echo "VMSIZE=${VMSIZE}" >> ${ENV_FILE} + @echo "VM_MEM_SIZE=${VM_MEM_SIZE}" >> ${ENV_FILE} + @echo "TIMEOUT=${TIMEOUT}s" >> ${ENV_FILE} + @echo "CITYPE=${CITYPE}" >> ${ENV_FILE} + @echo "KYUA_TEST_FILTERS='${KYUA_TEST_FILTERS}'" >> ${ENV_FILE} + @echo "META_MODE='${METAMODE}'" >> ${ENV_FILE} + @echo "USE_QEMU='${USE_QEMU}'" >> ${ENV_FILE} + @echo "GITREV='${GITREV}'" >> ${ENV_FILE} + @echo "GITBRANCH='${GITBRANCH}'" >> ${ENV_FILE} + @echo "GITCOUNT='${GITCOUNT}'" >> ${ENV_FILE} + @echo "BUILDDATE='${BUILDDATE}'" >> ${ENV_FILE} + @echo "CC='${CC}'" >> ${ENV_FILE} + @echo "CFLAGS='${CFLAGS}'" >> ${ENV_FILE} + @echo "CPP='${CPP}'" >> ${ENV_FILE} + @echo "CXX='${CXX}'" >> ${ENV_FILE} + @echo "CXXFLAGS='${CXXFLAGS}'" >> ${ENV_FILE} + @echo "COMPILER_FEATURES='${COMPILER_FEATURES}'" >> ${ENV_FILE} + @echo "COMPILER_FREEBSD_VERSION='${COMPILER_FREEBSD_VERSION}'" >> ${ENV_FILE} + @echo "COMPILER_TYPE='${COMPILER_TYPE}'" >> ${ENV_FILE} + @echo "COMPILER_VERSION='${COMPILER_VERSION}'" >> ${ENV_FILE} + @echo "HOST_CC='${HOST_CC}'" >> ${ENV_FILE} + @echo "HOST_MACHINE='${HOST_MACHINE}'" >> ${ENV_FILE} + @echo "HOST_OS='${HOST_OS}'" >> ${ENV_FILE} + @echo "HOST_OSMAJOR='${HOST_OSMAJOR}'" >> ${ENV_FILE} + @echo "HOST_OSTYPE='${HOST_OSTYPE}'" >> ${ENV_FILE} + @echo "LD='${LD}'" >> ${ENV_FILE} + @echo "LDFLAGS='${LDFLAGS}'" >> ${ENV_FILE} + @echo "MACHINE='${MACHINE}'" >> ${ENV_FILE} + @echo "MACHINE_ABI='${MACHINE_ABI}'" >> ${ENV_FILE} + @echo "MACHINE_ARCH='${MACHINE_ARCH}'" >> ${ENV_FILE} + @echo "MACHINE_CPU='${MACHINE_CPU}'" >> ${ENV_FILE} + @echo "MACHINE_CPUARCH='${MACHINE_CPUARCH}'" >> ${ENV_FILE} + +ci-create-meta: ci-get-env .PHONY truncate -s 512M ${META_TAR} tar rvf ${META_TAR} -C ${META_DIR} . diff --git a/tests/ci/tools/freebsdci b/tests/ci/tools/freebsdci index 42c565a45055..f71ccc1cad4f 100755 --- a/tests/ci/tools/freebsdci +++ b/tests/ci/tools/freebsdci @@ -57,6 +57,27 @@ auto_shutdown() esac } +set_environment() +{ + if [ "${istar}" -eq 1 ]; then + rm -fr ${metadir} + mkdir -p ${metadir} + tar xvf ${tardev} -C ${metadir} + ci_env_file=$(set -- "${metadir}"/ci-*.env; \ + [ "$#" -eq 1 ] && printf '%s\n' "$1") + if [ -z "${ci_env_file}" ]; then + echo "ci: No CI environment file found in ${metadir}" + else + env >> "${ci_env_file}" + fi + else + echo "ERROR: no device with POSIX tar archive format found." + # Don't shutdown because this is not run in unattended mode + exit 1 + fi + +} + smoke_tests() { echo @@ -72,29 +93,19 @@ full_tests() echo "--------------------------------------------------------------" echo "BOOT sequence COMPLETED" echo "TEST sequence STARTED" - if [ "${istar}" -eq 1 ]; then - rm -fr ${metadir} - mkdir -p ${metadir} - tar xvf ${tardev} -C ${metadir} - cd /usr/tests - set +e - kyua \ - -v parallelism=${parallelism} \ - test ${freebsdci_test_filters} - rc=$? - set -e - if [ ${rc} -ne 0 ] && [ ${rc} -ne 1 ]; then - exit ${rc} - fi - kyua report --verbose --results-filter passed,skipped,xfail,broken,failed --output test-report.txt - kyua report-junit --output=test-report.xml - mv test-report.* /${metadir} - tar cvf ${tardev} -C ${metadir} . - else - echo "ERROR: no device with POSIX tar archive format found." - # Don't shutdown because this is not run in unattended mode - exit 1 + cd /usr/tests + set +e + kyua \ + -v parallelism=${parallelism} \ + test ${freebsdci_test_filters} + rc=$? + set -e + if [ ${rc} -ne 0 ] && [ ${rc} -ne 1 ]; then + exit ${rc} fi + kyua report --verbose --results-filter passed,skipped,xfail,broken,failed --output test-report.txt + kyua report-junit --output=test-report.xml + mv test-report.* /${metadir} echo "TEST sequence COMPLETED" echo "INITIATING system SHUTDOWN" echo "--------------------------------------------------------------" @@ -102,11 +113,13 @@ full_tests() firstboot_ci_run() { + set_environment if [ "$freebsdci_type" = "smoke" ]; then smoke_tests elif [ "$freebsdci_type" = "full" ]; then full_tests fi + tar cvf ${tardev} -C ${metadir} . auto_shutdown } From nobody Sun Dec 21 03:56:20 2025 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 4dYnWS5JyGz6LW5p for ; Sun, 21 Dec 2025 03:56:20 +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 4dYnWS4mVJz3tp1 for ; Sun, 21 Dec 2025 03:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766289380; 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=3HPc3UC0wPtu4DVpuUjAR25kSEm5ncjdHpSDUpSvJZE=; b=G7CAeF0FJ6bKrVHakwI3NmFJJbo4YdkCvBrni9K2yTo4aywg2mfkFfF4uHk/2nuZq1WzMK hYs5l8yYVN1RMZIilnIrY/W5ZkqZUnbHJib5OQmae6g3JImCiKRNIh63hoHQgs2SgoNT/i mp4in87ruY8zoR9WuCNRz4VPy95KkvlON46H2Zju5tACglzfrasvRpbIKWMr3p2g21YUo5 YilCFAAjgerfrJn3nZUrNs09oi3Ov6iyirHHlXN2t1A8QOOp1c1yub0JZptGdY1pVDKvSQ BNQg46Ow+Psd17jb+1QRmUABOJMX0LSBPsccfob+tdyiUBTj4GfequzHtI5dow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766289380; 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=3HPc3UC0wPtu4DVpuUjAR25kSEm5ncjdHpSDUpSvJZE=; b=ZJXhXfox2QfXl+gHS9RR71+vp015SYDw7D1p3nMwfFY7GQbqKQY1JNVn8QunXN8xbOL970 Exqis1MY51fULRF3xNy+RMOhDzcoaWdQFeahRS2XF0M2HsGYta9QmWs0tQZglf1ErsddM3 pvG56U26biteFBfuiC2PpBngXVVj5eli5vvezhNKLRENsQu4Qkbm9GeqSdhrdVYx8TyiSm sNMOKvz88/nLmHZkDEb/Cw9RLGrxM8RS4B8U+TfSy0I8Y10y3/j1m7rdogpuv/BHp7SySc LtQ5ctvdxJRbFivtD8y3HMuYyUkhwMp/NhkTAeDgsULfutOiZ4NqsKjuDw6wHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766289380; a=rsa-sha256; cv=none; b=rH6xdX8IEr7s357ZWb2/ZJxUqIYdskVlSrf0e5pLwI5CR4xjg/Iuv/5doJ04Ilb48c3SjC X9qRbQhKMii6SVl1nWV++ackG1TDdGnXXmLWJWX8ogvWbVZL3NyRX26iX6kx7KqRCRrVEn 5WIgbvcjAJo5XHp35X79cLZh8ewYwTcHd/uvbUYNKxLGzlXfnBWr9X0ypMEu7nA5REsVYP hUyYJVKnWzJhDyVSsyzOZ4jNEujItaZr3+cdsaUTLB4plPhwXxHjNTIocRxPY5RmiG8Vp2 CSwRlam7kwadcB2qHn3muIRTxCJ2puKCa+VGTqF3DO4flgMLMinVMJoRdepVvw== 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 4dYnWS4MxMz8JY for ; Sun, 21 Dec 2025 03:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id a151 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Dec 2025 03:56:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 84a265d9ace3 - stable/15 - vmem.9: provide a reference to libuvmem(3) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 84a265d9ace3e923bfcb2592cbfd60e720321844 Auto-Submitted: auto-generated Date: Sun, 21 Dec 2025 03:56:20 +0000 Message-Id: <69476fe4.a151.648ecaac@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=84a265d9ace3e923bfcb2592cbfd60e720321844 commit 84a265d9ace3e923bfcb2592cbfd60e720321844 Author: Konstantin Belousov AuthorDate: 2025-12-18 20:13:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-21 03:55:36 +0000 vmem.9: provide a reference to libuvmem(3) (cherry picked from commit 5c1d9df10b78f8d2e13e16f5db2e4542f582aebd) --- share/man/man9/vmem.9 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/man/man9/vmem.9 b/share/man/man9/vmem.9 index 053aec856a78..119815e818b9 100644 --- a/share/man/man9/vmem.9 +++ b/share/man/man9/vmem.9 @@ -281,6 +281,9 @@ subsystem is implemented within the file .\" ------------------------------------------------------------ .Sh SEE ALSO .Xr malloc 9 +.Pp +.Xr libuvmem 3 +for the userspace port of the allocator. .Rs .%A Jeff Bonwick .%A Jonathan Adams