From nobody Mon Jan 20 00:01: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 4Ybr8t6N6Zz5ltt6; Mon, 20 Jan 2025 00:01: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybr8t5crSz3bRp; Mon, 20 Jan 2025 00:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331278; h=from:from:reply-to:subject:subject: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/wUkgvEu197+KUMXQfIY4/c6wyQVxbgBk8gywqV/H4=; b=yW6kBq+Yp07mDsNC2WoEDCm4bFx5chOzUc3GvSrABK+qf2Z2nGm5K9Z1aNCJEcT/A2j4vb Xf2/s/5VqVz5mBwZ85fyf7UMa8zg9MNNPY28ivYZCnO7K5IOuEN3K131GZ4CP+bwvv5KpI FOMh0VsuvOkxEjf8iNdeYIx5TM8v6iI1rZRKbeWf0rVXL523plHtkFIyXgWWu6zJ3m/EVX 2+v0Ge46fJ9uCRy/Do17+z7wU7hOQokatWgNFGHZ64R7SIqBSFy3YCSmmYxrXj72kGLz6S QXUvI17T2VC9+lm3cCSBoKEnubVL1soFSdl7hHOzCrgHaJ2XQ6NKVYHuMXZBtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331278; h=from:from:reply-to:subject:subject: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/wUkgvEu197+KUMXQfIY4/c6wyQVxbgBk8gywqV/H4=; b=H5psnzO5Ooka9waa4TcT3UDELZYAIXQVu30J9vD64IGO2OPfnmweypKl9PlJeROMdqp4tt CvLV3FDNECCVD1rNStgAvq0RBlcTmxVOCi53xbdpyn/2YAXwLEX5ZQFDm5de3Nn0Pwqa9L oBFtQ1Zz7l79U+/yk9stxvqLQTOSzNG//g6IyzamXHLydeXzvuT3lWv78pMovQ3vW4k/rp YIfv02RbZUXKDrOA9dKRzQi2uNhqxCTEptxzUQJPwHQ2wtbv8E/eZLPCfHcpbMG5qklJrA o+E3uOzalw8SA1ua66tDECNOES6NXm7U5uo9mKuhQ9sX+74A9J8aSQzllz+sVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737331278; a=rsa-sha256; cv=none; b=e9YD69AezeLfFvQSYpMFkdLzUsocpFJxeWIzDDRYtdlUHy4JmULAkEBD8Nkg6R2S22MiMO kkVewqxM2YwMbXtQlL41i2Zwz8uaSaPTiuFOUmottKrHXoNYG7p27RSK78YWpOAGdsk1FU QkzC9O/+Sl3YGrKZYuEDwxi6vEYETveXI17AwVijT4y/w/p8l0ASMVqfJbFf/UHio2fSuN mflLNDvYBO6IvRxNAOgh1QthA4RzPI0IouoFV7WMulF0nbWPUCz/vnX9ttEGnYmHqz2zXA A6dkGYaQzAHtNfXB/64CRjJEJGaBQ5giizRqLxAyr7hJ0VXzdubZDImUl90ekQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybr8t57tCz19nN; Mon, 20 Jan 2025 00:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K01IJw075772; Mon, 20 Jan 2025 00:01:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K01IZn075769; Mon, 20 Jan 2025 00:01:18 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:01:18 GMT Message-Id: <202501200001.50K01IZn075769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 2cd9a4f0c229 - stable/14 - exports.5: Document the current behavior of -alldirs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2cd9a4f0c229626f7422187b30723772336e8896 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2cd9a4f0c229626f7422187b30723772336e8896 commit 2cd9a4f0c229626f7422187b30723772336e8896 Author: Rick Macklem AuthorDate: 2024-12-28 21:51:08 +0000 Commit: Rick Macklem CommitDate: 2025-01-20 00:00:35 +0000 exports.5: Document the current behavior of -alldirs Commit 07cd69e272da adds a new "-a" mountd option, which changes the behavior of mountd when file systems are exported via -alldirs. This patch updates the man page to reflect the actual behavior when -alldirs is used when mountd is started with/without -a. Prior to the above commit, exports(5) documented that, when -alldirs was specified, the exports line would fail unless the directory was a server file system mount point. This behavior was only documented in the Examples section and has not been implemented since a change between FreeBSD 1 and FreeBSD 2 was done. This is a contents change. PR: 282995 (cherry picked from commit 295934eaa92cd917ae42a446899c0d527ad9c0c9) --- usr.sbin/mountd/exports.5 | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index 6c18e910c116..b8f0e93aec8a 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -27,7 +27,7 @@ .\" .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" -.Dd October 08, 2024 +.Dd December 16, 2024 .Dt EXPORTS 5 .Os .Sh NAME @@ -86,6 +86,15 @@ 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. +If the +.Fl alldirs +flag is specified and +the +.Fl a +command line option is specified for +.Xr mountd 8 , +the export will fail if the directory path is not a local file system +mount point. .Pp There are three forms of the directory path specification. The first is to list all mount points as absolute @@ -552,12 +561,18 @@ will be exported read-only to the entire network 192.168.33.0/24, including all its subdirectories. Since .Pa /cdrom -is the conventional mountpoint for a CD-ROM device, this export will -fail if no CD-ROM medium is currently mounted there since that line +is the conventional mountpoint for a CD-ROM device, +for the case where the +.Fl a +option has been specified for +.Xr mountd 8 , +this export will +fail if no CD-ROM medium is currently mounted there +since that line would then attempt to export a subdirectory of the root file system with the .Fl alldirs -option which is not allowed. +option. The .Fl quiet option will then suppress the error message for this condition that From nobody Mon Jan 20 00:11: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 4YbrP96JMrz5lvRR; Mon, 20 Jan 2025 00:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbrP95SPHz3cLp; Mon, 20 Jan 2025 00:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lH9wpVDyW5/xUzlFZf3SoenLYLfGq/eldATm74mjroc=; b=su8jfQwHeYZhToL/H34S4yNqPA1hiADS7GRbeWbLbdS9LD6Px77irb6n2An+t+dCUVAGjJ MO0i9MLU44mR0MBabeQ2bhrkaCE0CXk05aDUHnFD98JO2Lndo1X8l2xU3xPbsV5PSQ480d zU6RN3UtWfVDPfhaY8AZUQtm8574wyBV7LF3uIx4H2Pux1U/iiauEVxnHkWkfio+WVkBU/ 5wm1a2TdKuXZjbAukHzI2S9d9g7qsF7n4qatsRwkLy8v4GrV29dCjrilUwvLVkMiTGd1pS Q038UjKuTFA3wt2TB7snpZVhpm/nJ35mapFbl3LTvJAuAATYHRx0YDSACmNNLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lH9wpVDyW5/xUzlFZf3SoenLYLfGq/eldATm74mjroc=; b=yndRd5hgS+J1vd5iC0QJbmAyqGJ1fMIF/e+czcgVHlAAnCl15B/WBbol/rgwLTa4TMy4/z jdFnLLshy/59b6ZabGb/Q45mjYlPKwcxAhpl47TavJvp/MX5z49IObt5/Dl2pfahNqZuxV CYPvdSuY6EXkcw56O/vzZmCjfRre+mzgmXg07OS7p4lBqBJ7o2Ooz8AB9tMCj5ZQnO0KBN y8GRLp2iwODxtgbhd2CHbO8ymcBX5v2d8nopzYUDNQPRIYeWDW0xnkfwnQ2HvYORChLpAd tXxnn/Gz+8YfmdFZV7sfIsE6UuwFtCvgY6uo60fRxC4Z+Mz6mIa3xhsOBp7BdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737331917; a=rsa-sha256; cv=none; b=n3fPHWtUWGBUDM0HEAMUriVlF7kTMSKPnFa1j+SGpY98o9FEIf+ztsxpmspqnJvSKkbFWU DLSRbidv41I3KvHnB1xeaHxl0f6J5htnOeIYDnBav6YIRKqrCVdwVJ3gwMslUOQTakQFew tcrE8ifxCXY+fenVFYNuZTSSztWLkrfzXf4PcOhnSUMreHoLiyr9zYddxSvdRHnILwgt13 zyAgj/05Jja1uKtpcXvGQkQo/AkSMZYXIWeuD4z6lQtBvGgNo6ZEsfbORM1E7QmaxKJ9Ae XI6CAFAFGcUycSG8b0Hqbs2aUZ/Xz1hHT7YTgEB/jobg/jCxdQqqdC1f9/dngQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbrP954CSz1Bx0; Mon, 20 Jan 2025 00:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0Bv6i093078; Mon, 20 Jan 2025 00:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0BvFW093075; Mon, 20 Jan 2025 00:11:57 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:11:57 GMT Message-Id: <202501200011.50K0BvFW093075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 22d2336252c9 - stable/14 - RELNOTES: Add entry for commit ead3cd3ef628 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 22d2336252c9af8e58b19444e2308a98946f3246 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=22d2336252c9af8e58b19444e2308a98946f3246 commit 22d2336252c9af8e58b19444e2308a98946f3246 Author: Rick Macklem AuthorDate: 2025-01-20 00:10:06 +0000 Commit: Rick Macklem CommitDate: 2025-01-20 00:10:06 +0000 RELNOTES: Add entry for commit ead3cd3ef628 --- RELNOTES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELNOTES b/RELNOTES index 515ba162b440..812dc613957b 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +ead3cd3ef628: + Add a new -a command line option to mountd(8). + If this command line option is specified, when + a line in exports(5) has the -alldirs export option, + the directory must be a server file system mount point. + 54974e731f27, 155987e20190, 4634282f8908, 7a3a0402aeb6, 6b1a5d3535d9: The layout of NFS file handles for the tarfs, cd9660, and ext2fs file systems has changed. An NFS server that exports any of these file From nobody Mon Jan 20 00:25: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 4Ybrhw0LFBz5lwC0; Mon, 20 Jan 2025 00:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrhv6ZVCz3dLJ; Mon, 20 Jan 2025 00:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cLQsh2C31AuJCgFRHwjsQ/XDlBgQo5bez2IdUL4Jz2U=; b=dDUJCbcSrhS7VDtvRYQ/WJSdlCJXzte11+3XtQfWTWhKYr3RWW+H6esfRhpgRTOjCf7O5C MBKWY157A/Rtv1duRtax4pQ4tcXBBXJg6eMNhIdyQJoCEMjtt9RKYCLAGrmSMm4rs/92/D 2AFgvoQf4I3VwQBe2o/aNKodo/GVVwbhbDCjpJ9cVkg87YNg9p74kFeso/xHkWltkFyXKT KKl/o/jWfx2JpgyPCJUw9mav4I4F3wbSKUaKOuhFyvP1thgcLBpwCQAzvml399XDyUqR3N ++hCp7MWW8030vpdBa0pe+ng+uLppn8j4ufua8tySk0B58jkJz8E0sPE/CIV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cLQsh2C31AuJCgFRHwjsQ/XDlBgQo5bez2IdUL4Jz2U=; b=Y3aXP7008P9YhJv3zRSrurqkx5DWlQq7NVSBAladz4TQB03XK4P14vkyV6UU+fu1BBe7VW cXU6f6npamSjj610bdZ0pdduRvE1HkH4poRurKdLccx27JMxJOOu3Qz61YtLooGkZfV7tr 1ovchgcn2yfp4fqG/q9KZNvMVdKgNmOA4nwbNElGgfUTECXfjb8eHKG9hAhyPy2b9P0DMH GlbksI1qksnyzkipj96TqMEzL7O/bk9AIaa40JUKM1D3G+srgyH1P7Uufw2aY+H1PkCtRN qzezE8HSKEFUDgA/F27cJvbJBhtmyKI7JXQ8BSS+hDZgMFBDmBCng7gID5CZKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332735; a=rsa-sha256; cv=none; b=hpIFIIh0tddvaxpV8oItlMMwP/pA65lzHf2ZBvfKAl66631/2frd9SU2UFq0taUBhnrQyV TU3KdrbVY+jVuXWSrlZnTDsQgBUBfM6Ti63fgw1uWMX0i1mmn42Sy5ZvbEiKiU+b0CGpgx 36iFpAzOTvlP8DY+s0XXOVomae+nGBxvpCT+XBWTLUoyU3UwMigYyAysa2p9lInIfy+OBr 0ZTohwhoRrObdlJKt5BqaEr3N3VJU7HpS0EkuswWOICBo+ABTAreWcBMKjjtW+dkoediMb Qnl0sGXZkMI3NRsN5YydE72bM5GO/iX3jMY55a1najEgkaxBolsZNk14Ab7jBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrhv5zd7z1Bpx; Mon, 20 Jan 2025 00:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0PZ2I018076; Mon, 20 Jan 2025 00:25:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0PZYg018073; Mon, 20 Jan 2025 00:25:35 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:25:35 GMT Message-Id: <202501200025.50K0PZYg018073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: a158d26e89f2 - stable/14 - contrib/tzdata: import tzdata 2025a List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a158d26e89f2e3274ba1064e3fd6b341c6fcb07c Auto-Submitted: auto-generated The branch stable/14 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=a158d26e89f2e3274ba1064e3fd6b341c6fcb07c commit a158d26e89f2e3274ba1064e3fd6b341c6fcb07c Author: Philip Paeps AuthorDate: 2025-01-17 01:33:46 +0000 Commit: Philip Paeps CommitDate: 2025-01-20 00:23:58 +0000 contrib/tzdata: import tzdata 2025a Changes: https://github.com/eggert/tz/blob/2025a/NEWS (cherry picked from commit 46226b0162ba03986b1de2c790804b37dd8e64d6) --- contrib/tzdata/Makefile | 32 +++++------ contrib/tzdata/NEWS | 84 +++++++++++++++++++++++++++-- contrib/tzdata/antarctica | 2 + contrib/tzdata/asia | 113 ++++++++++++++++++++++++++++----------- contrib/tzdata/australasia | 113 +++++++++++++++++++++------------------ contrib/tzdata/checknow.awk | 2 +- contrib/tzdata/checktab.awk | 39 +++++++++++++- contrib/tzdata/etcetera | 4 ++ contrib/tzdata/europe | 2 +- contrib/tzdata/factory | 10 ++++ contrib/tzdata/leap-seconds.list | 8 +-- contrib/tzdata/leapseconds | 8 +-- contrib/tzdata/northamerica | 9 ++-- contrib/tzdata/southamerica | 27 ++++++++-- contrib/tzdata/theory.html | 40 +++++++++----- contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 2 +- contrib/tzdata/zone1970.tab | 6 +-- contrib/tzdata/zonenow.tab | 9 ++-- 19 files changed, 369 insertions(+), 143 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 0087b4596515..2130582c2deb 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -137,7 +137,7 @@ TIME_T_ALTERNATIVES_TAIL = int_least32_t.ck uint_least32_t.ck \ uint_least64_t.ck # What kind of TZif data files to generate. (TZif is the binary time -# zone data format that zic generates; see Internet RFC 8536.) +# zone data format that zic generates; see Internet RFC 9636.) # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -255,6 +255,7 @@ LDLIBS= # -DHAVE_UNISTD_H=0 if does not work* # -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DMKTIME_MIGHT_OVERFLOW if mktime might fail due to time_t overflow # -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ # Typically it is better to use a later standard. For example, # with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. @@ -262,7 +263,7 @@ LDLIBS= # feature (integers at least 64 bits wide) and maybe more. # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. -# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -Dssize_t=int on hosts like MS-Windows that lack ssize_t # -DSUPPORT_C89=0 if the tzcode library should not support C89 callers # Although -DSUPPORT_C89=0 might work around latent bugs in callers, # it does not conform to POSIX. @@ -285,7 +286,7 @@ LDLIBS= # This mishandles some past timestamps, as US DST rules have changed. # It also mishandles settings like TZ='EET-2EEST' for eastern Europe, # as Europe and US DST rules differ. -# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) +# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 254) # -DUNINIT_TRAP if reading uninitialized storage can cause problems # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library @@ -319,7 +320,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ $(GCC_INSTRUMENT) \ -Wall -Wextra \ -Walloc-size-larger-than=100000 -Warray-bounds=2 \ - -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ + -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wcast-qual \ + -Wdate-time \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ @@ -336,7 +338,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-format-nonliteral -Wno-sign-compare + -Wno-format-nonliteral -Wno-sign-compare -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -614,8 +616,8 @@ TZS_YEAR= 2050 TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs TZS_NEW= to$(TZS_YEAR)new.tzs -TZS_DEPS= $(YDATA) asctime.c localtime.c \ - private.h tzfile.h zdump.c zic.c +TZS_DEPS= $(YDATA) localtime.c private.h \ + strftime.c tzfile.h zdump.c zic.c TZDATA_DIST = $(COMMON) $(DATA) $(MISC) # EIGHT_YARDS is just a yard short of the whole ENCHILADA. EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi @@ -855,10 +857,10 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_mild back.ck +check: check_mild back.ck now.ck check_mild: check_web check_zishrink \ character-set.ck white-space.ck links.ck mainguard.ck \ - name-lengths.ck now.ck slashed-abbrs.ck sorted.ck \ + name-lengths.ck slashed-abbrs.ck sorted.ck \ tables.ck ziguard.ck tzs.ck # True if UTF8_LOCALE does not work; @@ -1103,7 +1105,7 @@ set-timestamps.out: $(EIGHT_YARDS) touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ - if git diff --quiet $$file; then \ + if git diff --quiet HEAD $$file; then \ time=$$(TZ=UTC0 git log -1 \ --format='tformat:%cd' \ --date='format:%Y-%m-%dT%H:%M:%SZ' \ @@ -1354,13 +1356,13 @@ long-long.ck unsigned.ck: $(VERSION_DEPS) zonenames: tzdata.zi @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi -asctime.o: private.h tzfile.h +asctime.o: private.h date.o: private.h difftime.o: private.h -localtime.o: private.h tzfile.h tzdir.h -strftime.o: private.h tzfile.h -zdump.o: version.h -zic.o: private.h tzfile.h tzdir.h version.h +localtime.o: private.h tzdir.h tzfile.h +strftime.o: localtime.c private.h tzdir.h tzfile.h +zdump.o: private.h version.h +zic.o: private.h tzdir.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_mild check_time_t_alternatives diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 83b8b8c8d39c..a5d7ea89204e 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,83 @@ News for the tz database +Release 2025a - 2025-01-15 10:47:24 -0800 + + Briefly: + Paraguay adopts permanent -03 starting spring 2024. + Improve pre-1991 data for the Philippines. + Etc/Unknown is now reserved. + + Changes to future timestamps + + Paraguay will stop changing its clocks after the spring-forward + transition on 2024-10-06, so it is now permanently at -03. + (Thanks to Heitor David Pinto and Even Scharning.) + This affects timestamps starting 2025-03-22, as well as the + obsolescent tm_isdst flags starting 2024-10-15. + + Changes to past timestamps + + Correct timestamps for the Philippines before 1900, and from 1937 + through 1990. (Thanks to P Chan for the heads-up and citations.) + This includes adjusting local mean time before 1899; fixing + transitions in September 1899, January 1937, and June 1954; adding + transitions in December 1941, November 1945, March and September + 1977, and May and July 1990; and removing incorrect transitions in + March and September 1978. + + Changes to data + + Add zone1970.tab lines for the Concordia and Eyre Bird Observatory + research stations. (Thanks to Derick Rethans and Jule Dabars.) + + Changes to code + + strftime %s now generates the correct numeric string even when the + represented number does not fit into time_t. This is better than + generating the numeric equivalent of (time_t) -1, as strftime did + in TZDB releases 96a (when %s was introduced) through 2020a and in + releases 2022b through 2024b. It is also better than failing and + returning 0, as strftime did in releases 2020b through 2022a. + + strftime now outputs an invalid conversion specifier as-is, + instead of eliding the leading '%', which confused debugging. + + An invalid TZ now generates the time zone abbreviation "-00", not + "UTC", to help the user see that an error has occurred. (Thanks + to Arthur David Olson for suggesting a "wrong result".) + + mktime and timeoff no longer incorrectly fail merely because a + struct tm component near INT_MIN or INT_MAX overflows when a + lower-order component carries into it. + + TZNAME_MAXIMUM, the maximum number of bytes in a proleptic TZ + string's time zone abbreviation, now defaults to 254 not 255. + This helps reduce the size of internal state from 25480 to 21384 + on common platforms. This change should not be a problem, as + nobody uses such long "abbreviations" and the longstanding tzcode + maximum was 16 until release 2023a. For those who prefer no + arbitrary limits, you can now specify TZNAME_MAXIMUM values up to + PTRDIFF_MAX, a limit forced by C anyway; formerly tzcode silently + misbehaved unless TZNAME_MAXIMUM was less than INT_MAX. + + tzset and related functions no longer leak a file descriptor if + another thread forks or execs at about the same time and if the + platform has O_CLOFORK and O_CLOEXEC respectively. Also, the + functions no longer let a TZif file become a controlling terminal. + + 'zdump -' now reads TZif data from /dev/stdin. + (From a question by Arthur David Olson.) + + Changes to documentation + + The name Etc/Unknown is now reserved: it will not be used by TZDB. + This is for compatibility with CLDR, which uses the string + "Etc/Unknown" for an unknown or invalid timezone. (Thanks to + Justin Grant, Mark Davis, and Guy Harris.) + + Cite Internet RFC 9636, which obsoletes RFC 8536 for TZif format. + + Release 2024b - 2024-09-04 12:27:47 -0700 Briefly: @@ -116,7 +194,7 @@ Release 2024b - 2024-09-04 12:27:47 -0700 Changes to commentary Commentary about historical transitions in Portugal and her former - colonies has been expanded with links to many relevant legislation. + colonies has been expanded with links to relevant legislation. (Thanks to Tim Parenti.) @@ -204,10 +282,10 @@ Release 2023d - 2023-12-21 20:02:24 -0800 changing its time zone from -01/+00 to -02/-01 at the same moment as the spring-forward transition. Its clocks will therefore not spring forward as previously scheduled. The time zone change - reverts to its common practice before 1981. + reverts to its common practice before 1981. (Thanks to Jule Dabars.) Fix predictions for DST transitions in Palestine in 2072-2075, - correcting a typo introduced in 2023a. + correcting a typo introduced in 2023a. (Thanks to Jule Dabars.) Changes to past and future timestamps diff --git a/contrib/tzdata/antarctica b/contrib/tzdata/antarctica index 8d5d6cd1cdd0..2e90a5e09d17 100644 --- a/contrib/tzdata/antarctica +++ b/contrib/tzdata/antarctica @@ -174,6 +174,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13 # France & Italy - year-round base # Concordia, -750600+1232000, since 2005 +# https://en.wikipedia.org/wiki/Concordia_Station +# Can use Asia/Singapore, which it has agreed with since inception. # Germany - year-round base # Neumayer III, -704080-0081602, since 2009 diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index a2480b021225..d4eb058053ed 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3665,21 +3665,70 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line # https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm -# The rest of the data entries are from Shanks & Pottenger. - -# From Jesper Nørgaard Welen (2006-04-26): -# ... claims that Philippines had DST last time in 1990: -# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/ -# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires, -# but no details] - -# From Paul Eggert (2014-08-14): -# The following source says DST may be instituted November-January and again -# March-June, but this is not definite. It also says DST was last proclaimed -# during the Ramos administration (1992-1998); but again, no details. -# Carcamo D. PNoy urged to declare use of daylight saving time. -# Philippine Star 2014-08-05 -# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time + +# From P Chan (2021-05-10): +# Here's a fairly comprehensive article in Japanese: +# https://wiki.suikawiki.org/n/Philippine%20Time +# (2021-05-16): +# According to the references listed in the article, +# the periods that the Philippines (Manila) observed DST or used +9 are: +# +# 1936-10-31 24:00 to 1937-01-15 24:00 +# (Proclamation No. 104, Proclamation No. 126) +# 1941-12-15 24:00 to 1945-11-30 24:00 +# (Proclamation No. 789, Proclamation No. 20) +# 1954-04-11 24:00 to 1954-06-04 24:00 +# (Proclamation No. 13, Proclamation No. 33) +# 1977-03-27 24:00 to 1977-09-21 24:00 +# (Proclamation No. 1629, Proclamation No. 1641) +# 1990-05-21 00:00 to 1990-07-28 24:00 +# (National Emergency Memorandum Order No. 17, Executive Order No. 415) +# +# Proclamation No. 104 ... October 30, 1936 +# https://www.officialgazette.gov.ph/1936/10/30/proclamation-no-104-s-1936/ +# Proclamation No. 126 ... January 15, 1937 +# https://www.officialgazette.gov.ph/1937/01/15/proclamation-no-126-s-1937/ +# Proclamation No. 789 ... December 13, 1941 +# https://www.officialgazette.gov.ph/1941/12/13/proclamation-no-789-s-1941/ +# Proclamation No. 20 ... November 11, 1945 +# https://www.officialgazette.gov.ph/1945/11/11/proclamation-no-20-s-1945/ +# Proclamation No. 13 ... April 6, 1954 +# https://www.officialgazette.gov.ph/1954/04/06/proclamation-no-13-s-1954/ +# Proclamation No. 33 ... June 3, 1954 +# https://www.officialgazette.gov.ph/1954/06/03/proclamation-no-33-s-1954/ +# Proclamation No. 1629 ... March 25, 1977 +# https://www.officialgazette.gov.ph/1977/03/25/proclamation-no-1629-s-1977/ +# Proclamation No. 1641 ...May 26, 1977 +# https://www.officialgazette.gov.ph/1977/05/26/proclamation-no-1641-s-1977/ +# National Emergency Memorandum Order No. 17 ... May 2, 1990 +# https://www.officialgazette.gov.ph/1990/05/02/national-emergency-memorandum-order-no-17-s-1990/ +# Executive Order No. 415 ... July 20, 1990 +# https://www.officialgazette.gov.ph/1990/07/20/executive-order-no-415-s-1990/ +# +# During WWII, Proclamation No. 789 fixed two periods of DST. The first period +# was set to continue only until January 31, 1942. But Manila was occupied by +# the Japanese earlier in the month.... +# +# For the date of the adoption of standard time, Shank[s] gives 1899-05-11. +# The article is not able to state the basis of that. I guess it was based on +# a US War Department Circular issued on that date. +# https://books.google.com/books?id=JZ1PAAAAYAAJ&pg=RA3-PA8 +# +# However, according to other sources, standard time was adopted on +# 1899-09-06. Also, the LMT was GMT+8:03:52 +# https://books.google.com/books?id=MOYIAQAAIAAJ&pg=PA521 +# https://books.google.com/books?id=lSnqqatpYikC&pg=PA21 +# +# From Paul Eggert (2024-09-05): +# The penultimate URL in P Chan's email refers to page 521 of +# Selga M, The Time Service in the Philippines. +# Proc Pan-Pacific Science Congress. Vol. 1 (1923), 519-532. +# It says, "The change from the meridian 120° 58' 04" to the 120th implied a +# change of 3 min. 52s.26 in time; consequently on 6th September, 1899, +# Manila Observatory gave the noon signal 3 min. 52s.26 later than before". +# +# Wikipedia says the US declared Manila liberated on March 4, 1945; +# this doesn't affect clocks, just our time zone abbreviation and DST flag. # From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15): # In the Philippines, there is a national law, Republic Act No. 10535 @@ -3697,24 +3746,26 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # influence of the sources. There is no current abbreviation for DST, # so use "PDT", the usual American style. -# From P Chan (2021-05-10): -# Here's a fairly comprehensive article in Japanese: -# https://wiki.suikawiki.org/n/Philippine%20Time -# From Paul Eggert (2021-05-10): -# The info in the Japanese table has not been absorbed (yet) below. - # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 D -Rule Phil 1937 only - Feb 1 0:00 0 S -Rule Phil 1954 only - Apr 12 0:00 1:00 D -Rule Phil 1954 only - Jul 1 0:00 0 S -Rule Phil 1978 only - Mar 22 0:00 1:00 D -Rule Phil 1978 only - Sep 21 0:00 0 S +Rule Phil 1936 only - Oct 31 24:00 1:00 D +Rule Phil 1937 only - Jan 15 24:00 0 S +Rule Phil 1941 only - Dec 15 24:00 1:00 D +# The following three rules were canceled by Japan: +#Rule Phil 1942 only - Jan 31 24:00 0 S +#Rule Phil 1942 only - Mar 1 0:00 1:00 D +#Rule Phil 1942 only - Jun 30 24:00 0 S +Rule Phil 1945 only - Nov 30 24:00 0 S +Rule Phil 1954 only - Apr 11 24:00 1:00 D +Rule Phil 1954 only - Jun 4 24:00 0 S +Rule Phil 1977 only - Mar 27 24:00 1:00 D +Rule Phil 1977 only - Sep 21 24:00 0 S +Rule Phil 1990 only - May 21 0:00 1:00 D +Rule Phil 1990 only - Jul 28 24:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 - 8:04:00 - LMT 1899 May 11 - 8:00 Phil P%sT 1942 May - 9:00 - JST 1944 Nov +Zone Asia/Manila -15:56:08 - LMT 1844 Dec 31 + 8:03:52 - LMT 1899 Sep 6 4:00u + 8:00 Phil P%sT 1942 Feb 11 24:00 + 9:00 - JST 1945 Mar 4 8:00 Phil P%sT # Bahrain diff --git a/contrib/tzdata/australasia b/contrib/tzdata/australasia index 359f9c1f1e10..405944536cd3 100644 --- a/contrib/tzdata/australasia +++ b/contrib/tzdata/australasia @@ -1239,10 +1239,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # The 1992 ending date used in the rules is a best guess; # it matches what was used in the past. -# The Australian Bureau of Meteorology FAQ -# http://www.bom.gov.au/faq/faqgen.htm -# (1999-09-27) writes that Giles Meteorological Station uses -# South Australian time even though it's located in Western Australia. +# From Christopher Hunt (2006-11-21), after an advance warning +# from Jesper Nørgaard Welen (2006-11-01): +# WA are trialing DST for three years. +# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf # From Paul Eggert (2018-04-01): # The Guardian Express of Perth, Australia reported today that the @@ -1254,54 +1254,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/ # [The article ends with "Today's date is April 1."] -# Queensland - -# From Paul Eggert (2018-02-26): -# I lack access to the following source for Queensland DST: -# Pearce C. History of daylight saving time in Queensland. -# Queensland Hist J. 2017 Aug;23(6):389-403 -# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS - -# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): -# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] -# # [ Dec 1990 ] -# ... -# Zone Australia/Queensland 10:00 AQ %sST -# ... -# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D -# Rule AQ 1972 only - Feb lastSun 3:00 0 E -# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D -# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E - -# From Bradley White (1989-12-24): -# "Australia/Queensland" now observes daylight time (i.e. from -# October 1989). - -# From Bradley White (1991-03-04): -# A recent excerpt from an Australian newspaper... -# ...Queensland...[has] agreed to end daylight saving -# at 3am tomorrow (March 3)... - -# From John Mackin (1991-03-06): -# I can certainly confirm for my part that Daylight Saving in NSW did in fact -# end on Sunday, 3 March. I don't know at what hour, though. (It surprised -# me.) - -# From Bradley White (1992-03-08): -# ...there was recently a referendum in Queensland which resulted -# in the experimental daylight saving system being abandoned. So, ... -# ... -# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D -# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S -# ... - -# From Arthur David Olson (1992-03-08): -# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. - -# From Christopher Hunt (2006-11-21), after an advance warning -# from Jesper Nørgaard Welen (2006-11-01): -# WA are trialing DST for three years. -# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf +# The Australian Bureau of Meteorology FAQ +# http://www.bom.gov.au/faq/faqgen.htm +# (1999-09-27) writes that Giles Meteorological Station uses +# South Australian time even though it's located in Western Australia. # From Rives McDow (2002-04-09): # The most interesting region I have found consists of three towns on the @@ -1359,6 +1315,59 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # For lack of better info, assume the tradition dates back to the # introduction of standard time in 1895. +# From Stuart Bishop (2024-11-12): +# An article discussing the in-use but technically unofficial timezones +# in the Western Australian portion of the Nullarbor Plain. +# https://www.abc.net.au/news/2024-11-22/outback-wa-properties-strange-time-zones/104542494 +# From Paul Eggert (2024-11-12): +# As the article says, the Eyre Bird Observatory and nearby sheep stations +# can use Tokyo time. Other possibilities include Asia/Chita, Asia/Seoul, +# and Asia/Jayapura. + +# Queensland + +# From Paul Eggert (2018-02-26): +# I lack access to the following source for Queensland DST: +# Pearce C. History of daylight saving time in Queensland. +# Queensland Hist J. 2017 Aug;23(6):389-403 +# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS + +# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): +# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] +# # [ Dec 1990 ] +# ... +# Zone Australia/Queensland 10:00 AQ %sST +# ... +# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D +# Rule AQ 1972 only - Feb lastSun 3:00 0 E +# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D +# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E + +# From Bradley White (1989-12-24): +# "Australia/Queensland" now observes daylight time (i.e. from +# October 1989). + +# From Bradley White (1991-03-04): +# A recent excerpt from an Australian newspaper... +# ...Queensland...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From John Mackin (1991-03-06): +# I can certainly confirm for my part that Daylight Saving in NSW did in fact +# end on Sunday, 3 March. I don't know at what hour, though. (It surprised +# me.) + +# From Bradley White (1992-03-08): +# ...there was recently a referendum in Queensland which resulted +# in the experimental daylight saving system being abandoned. So, ... +# ... +# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D +# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S +# ... + +# From Arthur David Olson (1992-03-08): +# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. + # southeast Australia # diff --git a/contrib/tzdata/checknow.awk b/contrib/tzdata/checknow.awk index 8b7881d2e27f..450490ee3768 100644 --- a/contrib/tzdata/checknow.awk +++ b/contrib/tzdata/checknow.awk @@ -44,7 +44,7 @@ BEGIN { END { for (zone in zone_data) { data = zone_data[zone] - if (!zonenow[data]) { + if (data && !zonenow[data]) { printf "Zone table should have one of:%s\n", zones[data] zonenow[data] = zone # This suppresses duplicate diagnostics. status = 1 diff --git a/contrib/tzdata/checktab.awk b/contrib/tzdata/checktab.awk index 9a26e4655ddb..5fa60556be13 100644 --- a/contrib/tzdata/checktab.awk +++ b/contrib/tzdata/checktab.awk @@ -9,6 +9,19 @@ BEGIN { if (!zone_table) zone_table = "zone1970.tab" if (!want_warnings) want_warnings = -1 + monthabbr["Jan"] = 1 + monthabbr["Feb"] = 1 + monthabbr["Mar"] = 1 + monthabbr["Apr"] = 1 + monthabbr["May"] = 1 + monthabbr["Jun"] = 1 + monthabbr["Jul"] = 1 + monthabbr["Aug"] = 1 + monthabbr["Sep"] = 1 + monthabbr["Oct"] = 1 + monthabbr["Nov"] = 1 + monthabbr["Dec"] = 1 + while (getline >"/dev/stderr" + status = 1 + } } else { + stdoff = $1 ruleUsed[$2] = 1 if ($3 ~ /%/) rulePercentUsed[$2] = 1 } + + if (stdoff && stdoff !~ /^\-?1?[0-9](:[0-5][0-9](:[0-5][0-9])?)?$/) { + printf "%s:%d: unlikely STDOFF: %s\n", FILENAME, FNR, stdoff \ + >>"/dev/stderr" + status = 1 + } + if (tz && tz ~ /\// && tz !~ /^Etc\//) { if (!tztab[tz] && FILENAME != "backward" \ && zone_table != "zonenow.tab") { diff --git a/contrib/tzdata/etcetera b/contrib/tzdata/etcetera index a5ecd6de1f6e..948531c8d862 100644 --- a/contrib/tzdata/etcetera +++ b/contrib/tzdata/etcetera @@ -51,6 +51,10 @@ Link Etc/GMT GMT # so we moved the names into the Etc subdirectory. # Also, the time zone abbreviations are now compatible with %z. +# There is no "Etc/Unknown" entry, as CLDR says that "Etc/Unknown" +# corresponds to an unknown or invalid time zone, and things would get +# confusing if Etc/Unknown were made valid here. + Zone Etc/GMT-14 14 - %z Zone Etc/GMT-13 13 - %z Zone Etc/GMT-12 12 - %z diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index f9063949eb83..df334fc27c1d 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1147,7 +1147,7 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # However, Greenland will change to Daylight Saving Time again in 2024 # and onwards. -# From a contributor who wishes to remain anonymous for now (2023-10-29): +# From Jule Dabars (2023-10-29): # https://www.dr.dk/nyheder/seneste/i-nat-skal-uret-stilles-en-time-tilbage-men-foerste-gang-sker-det-ikke-i-groenland # with a link to that page: # https://naalakkersuisut.gl/Nyheder/2023/10/2710_sommertid diff --git a/contrib/tzdata/factory b/contrib/tzdata/factory index d116a115990e..14faf52a792e 100644 --- a/contrib/tzdata/factory +++ b/contrib/tzdata/factory @@ -8,5 +8,15 @@ # time zone abbreviation "-00", indicating that the actual time zone # is unknown. +# TZ="Factory" was added to TZDB in 1989, and in 2016 its abbreviation +# was changed to "-00" from a longish English-language error message. +# Around 2010, CLDR added "Etc/Unknown" for use with TZDB, to stand +# for an unknown or invalid time zone. These two notions differ: +# TZ="Factory" is a valid timezone, so tzalloc("Factory") succeeds, whereas +# TZ="Etc/Unknown" is invalid and tzalloc("Etc/Unknown") fails. +# Also, a downstream distributor could modify Factory to be a +# default timezone suitable for the devices it manufactures, +# whereas that cannot happen for Etc/Unknown. + # Zone NAME STDOFF RULES FORMAT Zone Factory 0 - "Local time zone must be set--use tzsetup" diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index da0efc8c8566..6f861c888d75 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -60,15 +60,15 @@ # # The following line shows the last update of this file in NTP timestamp: # -#$ 3929093563 +#$ 3945196800 # # 2) Expiration date of the file given on a semi-annual basis: last June or last December # -# File expires on 28 June 2025 +# File expires on 28 December 2025 # # Expire date in NTP timestamp: # -#@ 3960057600 +#@ 3975868800 # # # LIST OF LEAP SECONDS @@ -117,4 +117,4 @@ # please see the readme file in the 'source' directory : # https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README # -#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 +#h 848434d5 570f7ea8 d79ba227 a00fc821 f608e2d4 diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index 6c715cb20b01..76f771427f25 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -69,11 +69,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2025 Jun 28 00:00:00 +#Expires 2025 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1720104763 (2024-07-04 14:52:43 UTC) -#expires 1751068800 (2025-06-28 00:00:00 UTC) +#updated 1736208000 (2025-01-07 00:00:00 UTC) +#expires 1766880000 (2025-12-28 00:00:00 UTC) # Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# File expires on 28 June 2025 +# File expires on 28 December 2025 diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index 01f392e0e6a4..8d356aa0069d 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -27,9 +27,12 @@ # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# From Paul Eggert (2018-03-20): +# From Paul Eggert (2024-11-18): # Dowd's proposal left many details unresolved, such as where to draw -# lines between time zones. The key individual who made time zones +# lines between time zones. Sandford Fleming of the Canadian Pacific Railway +# argued for Dowd's proposal in 1876, and Cleveland Abbe of the American +# Meteorology Society published a report in 1879 recommending four US time +# zones based on GMT. However, the key individual who made time zones # work in the US was William Frederick Allen - railway engineer, # managing editor of the Travelers' Guide, and secretary of the # General Time Convention, a railway standardization group. Allen @@ -2631,7 +2634,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Mexico 1931 only - April 30 0:00 1:00 D +Rule Mexico 1931 only - Apr 30 0:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index c8d9097aeb14..1fcf65146785 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1687,7 +1687,7 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 - # and that on the first Sunday of the month of October, it is to be set # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... -Rule Para 2010 max - Oct Sun>=1 0:00 1:00 - +Rule Para 2010 2024 - Oct Sun>=1 0:00 1:00 - Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): @@ -1706,14 +1706,35 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # https://www.abc.com.py/politica/2023/07/12/promulgacion-el-cambio-de-hora-sera-por-ley/ # From Carlos Raúl Perasso (2023-07-27): # http://silpy.congreso.gov.py/descarga/ley-144138 -Rule Para 2013 max - Mar Sun>=22 0:00 0 - +Rule Para 2013 2024 - Mar Sun>=22 0:00 0 - +# +# From Heitor David Pinto (2024-09-24): +# Today the Congress of Paraguay passed a bill to observe UTC-3 permanently.... +# The text of the bill says that it would enter into force on the first +# Sunday in October 2024, the same date currently scheduled to start DST.... +# https://silpy.congreso.gov.py/web/expediente/132531 +# (2024-10-14): +# The president approved the law on 11 October 2024, +# and it was officially published on 14 October 2024. +# https://www.gacetaoficial.gov.py/index/detalle_publicacion/89723 +# The text of the law says that it enters into force on the first +# Sunday in October 2024 (6 October 2024). But the constitution +# prohibits retroactive effect, and the civil code says that laws +# enter into force on the day after their publication or on the day +# that they specify, and it also says that they don't have retroactive +# effect. So I think that the time change on 6 October 2024 should +# still be considered as DST according to the previous law, and +# permanently UTC-3 from 15 October 2024 according to the new law.... +# https://www.constituteproject.org/constitution/Paraguay_2011 +# https://www.oas.org/dil/esp/codigo_civil_paraguay.pdf # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time -4:00 - %z 1972 Oct -3:00 - %z 1974 Apr - -4:00 Para %z + -4:00 Para %z 2024 Oct 15 + -3:00 - %z # Peru # diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index d3573ede0dfb..352a3d87078f 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -123,8 +123,9 @@ If geolocation information is available, a selection interface can locate the user on a timezone map or prioritize names that are geographically close. For an example selection interface, see the tzselect program in the tz code. -The Unicode Common Locale Data -Repository contains data that may be useful for other selection +Unicode's Common Locale Data +Repository (CLDR) +contains data that may be useful for other selection interfaces; it maps timezone names like Europe/Prague to locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格".

@@ -200,6 +201,8 @@ in decreasing order of importance:
  • A name must not be empty, or contain '//', or start or end with '/'. + Also, a name must not be 'Etc/Unknown', as + CLDR uses that string for an unknown or invalid timezone.
  • Do not use names that differ only in case. @@ -220,10 +223,18 @@ in decreasing order of importance: do not need locations, since local time is not defined there.
  • - If all the clocks in a timezone have agreed since 1970, - do not bother to include more than one timezone - even if some of the clocks disagreed before 1970. + If all clocks in a region have agreed since 1970, + give them just one name even if some of the clocks disagreed before 1970, + or reside in different countries or in notable or faraway locations. Otherwise these tables would become annoyingly large. + For example, do not create a name Indian/Crozet + as a near-duplicate or alias of Asia/Dubai + merely because they are different countries or territories, + or their clocks disagreed before 1970, or the + Crozet Islands + are notable in their own right, + or the Crozet Islands are not adjacent to other locations + that use Asia/Dubai.
  • If boundaries between regions are fluid, such as during a war or @@ -579,10 +590,10 @@ in decreasing order of importance: locations while uninhabited. The leading '-' is a flag that the UT offset is in some sense undefined; this notation is derived - from Internet + from Internet RFC 3339. (The abbreviation 'Z' that - Internet + Internet RFC 9557 uses for this concept would violate the POSIX requirement of at least three characters in an abbreviation.) @@ -1115,8 +1126,8 @@ However POSIX.1-2024, like earlier POSIX editions, has some limitations: the name of a file from which time-related information is read. The file's format is TZif, a timezone information format that contains binary data; see - Internet - RFC 8536. + Internet + RFC 9636. The daylight saving time rules to be used for a particular timezone are encoded in the TZif file; the format of the file allows US, @@ -1201,12 +1212,15 @@ The vestigial APIs are: The tm_isdst member is almost never needed and most of its uses should be discouraged in favor of the abovementioned APIs. + It was intended as an index into the tzname variable, + but as mentioned previously that usage is obsolete. Although it can still be used in arguments to mktime to disambiguate timestamps near a DST transition when the clock jumps back on platforms lacking tm_gmtoff, this - disambiguation does not work when standard time itself jumps back, - which can occur when a location changes to a time zone with a + disambiguation works only for proleptic TZ strings; + it does not work in general for geographical timezones, + such as when a location changes to a time zone with a lesser UT offset.
  • @@ -1223,8 +1237,8 @@ The vestigial APIs are: Programs that in the past used the timezone function may now examine localtime(&clock)->tm_zone (if TM_ZONE is defined) or - tzname[localtime(&clock)->tm_isdst] - (if HAVE_TZNAME is nonzero) to learn the correct time + use strftime with a %Z conversion specification + to learn the correct time zone abbreviation to use.
  • diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 699e50d4d38e..0846b7f265fa 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2024b +2025a diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index bfc0b5933044..d2be66359f3b 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -310,7 +310,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG -0930+14710 Pacific/Port_Moresby most of Papua New Guinea PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index 764215888efa..3a5a71c508d4 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -184,7 +184,7 @@ IR +3540+05126 Asia/Tehran IT,SM,VA +4154+01229 Europe/Rome JM +175805-0764736 America/Jamaica JO +3157+03556 Asia/Amman -JP +353916+1394441 Asia/Tokyo +JP,AU +353916+1394441 Asia/Tokyo Eyre Bird Observatory KE,DJ,ER,ET,KM,MG,SO,TZ,UG,YT -0117+03649 Africa/Nairobi KG +4254+07436 Asia/Bishkek KI,MH,TV,UM,WF +0125+17300 Pacific/Tarawa Gilberts, Marshalls, Wake @@ -247,7 +247,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG,AQ,FM -0930+14710 Pacific/Port_Moresby Papua New Guinea (most areas), Chuuk, Yap, Dumont d'Urville PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon @@ -294,7 +294,7 @@ RU +6445+17729 Asia/Anadyr MSK+09 - Bering Sea SA,AQ,KW,YE +2438+04643 Asia/Riyadh Syowa SB,FM -0932+16012 Pacific/Guadalcanal Pohnpei SD +1536+03232 Africa/Khartoum -SG,MY +0117+10351 Asia/Singapore peninsular Malaysia +SG,AQ,MY +0117+10351 Asia/Singapore peninsular Malaysia, Concordia SR +0550-05510 America/Paramaribo SS +0451+03137 Africa/Juba ST +0020+00644 Africa/Sao_Tome diff --git a/contrib/tzdata/zonenow.tab b/contrib/tzdata/zonenow.tab index 01f536b3ba38..d2c1e48584f8 100644 --- a/contrib/tzdata/zonenow.tab +++ b/contrib/tzdata/zonenow.tab @@ -97,9 +97,6 @@ XX +1828-06954 America/Santo_Domingo Atlantic Standard ("AST") - eastern Caribbe # -04/-03 (Chile DST) XX -3327-07040 America/Santiago most of Chile # -# -04/-03 (Paraguay DST) -XX -2516-05740 America/Asuncion Paraguay -# # -04/-03 - AST/ADT (North America DST) XX +4439-06336 America/Halifax Atlantic ("AST/ADT") - Canada; Bermuda # @@ -224,7 +221,7 @@ XX +1345+10031 Asia/Bangkok Russia; Indochina; Christmas Island XX -0610+10648 Asia/Jakarta Indonesia ("WIB") # # +08 -XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore +XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore; Concordia # # +08 - AWST XX -3157+11551 Australia/Perth Western Australia ("AWST") *** 18 LINES SKIPPED *** From nobody Mon Jan 20 00:26: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 4YbrkD3mdtz5lvyX; Mon, 20 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbrkD2rJSz3dNB; Mon, 20 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o6tqkhbKoSAj7/uJCtDyMudSuAVvg/8mDUHT+q0jbfE=; b=RS4YMwvymyholJkWYAV9ZEJQiDd/kiUXSb7Nm9PMQIs2dDQPcZevmD5b5JymigYivUvEwe nV/79zVSLEaw2zJEpNs+viW8yKMNuRmdk7Yy5nNPztWPjN37OrXiEXepbjAhm1sy88PuZh 0JdU7DokLtqZZGpolqze88fwIlOUJ0tzikfRxNieqL2OtZlK0NYICzNVfZOskx4uIAqkPL uLd7ijpZ/jTVa0Nza5mNBM3DrKyJ2P+lwtG6l4eMYvLk8tBo/UBtdIbtLEWLLT5+vtoaq4 V9kGcP6Y3CzOiiO8ra7OOGbTLGG5hf1P+BQIHF785mB3ZPXkV4ifqbQnS34Pxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o6tqkhbKoSAj7/uJCtDyMudSuAVvg/8mDUHT+q0jbfE=; b=IbewTKrqsWeRrllB+NG+Zv3kPIO66ASptwhcXBTJtrdFIOnzj2Orr9M+0lIpUDns9ohwir vlmBsXqiWRIZb+qXnP181gqDGdDFtNxLelmPsxOceyd+6RBXkUBr3H3Lf/JArY50/3RaNb dnuKoAq1bOQunbFiE28PTPjg7X2mwPr664bj/xmzMt6O3InbkywPcWfifBWa6FI4XNcEzt jxQWM/MqyQS9XHfjI79suNUuiPgyjNW/wwylnVGUAhP2Ncl36k2ngvyDSQUThpAJSEg68M Dthe0UJq8/8lyddLh6FIbIzyig2ppffQc2a8gEz3MeGmu1MJFEGk8kaklDPDBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332804; a=rsa-sha256; cv=none; b=rG3YLek953EhAQzTtxo069rKEGh5mwVj545L1wm9M+Pi5f2Y/l7bpptyYSbY3/zJP3ts2N Ad59/ZPs6un8hMzwc3czwH8/SjsPeaNFmsMKQDt6uTZV80aQxE4AprDDG9rl4ckgvGM8Nm GW2+gykNPIfq75iUyPFbTObOOjogfURAmTkDBnS1+Yt9Ef8S0y/oemeGSGSPj6tMh6Rcam GYXYMBY2pALwmLg7EfxH459GNbXHoDubRK4N6Oc6GToSx2e437nWLeoz4Y68i5z+CtEse4 1taAxT6eH3ExzxlMlwMPRj9TbTmiVXy+pp33LF2EmpxJ/Gj0luvjEZV3IVIdEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbrkD2NMfz1Bcw; Mon, 20 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0QiUN018524; Mon, 20 Jan 2025 00:26:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0Qi4a018520; Mon, 20 Jan 2025 00:26:44 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:26:44 GMT Message-Id: <202501200026.50K0Qi4a018520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 2d6dcb4f97f8 - stable/13 - contrib/tzdata: import tzdata 2025a List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d6dcb4f97f89376189f39b700459c72fe7a2678 Auto-Submitted: auto-generated The branch stable/13 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=2d6dcb4f97f89376189f39b700459c72fe7a2678 commit 2d6dcb4f97f89376189f39b700459c72fe7a2678 Author: Philip Paeps AuthorDate: 2025-01-17 01:33:46 +0000 Commit: Philip Paeps CommitDate: 2025-01-20 00:26:07 +0000 contrib/tzdata: import tzdata 2025a Changes: https://github.com/eggert/tz/blob/2025a/NEWS (cherry picked from commit 46226b0162ba03986b1de2c790804b37dd8e64d6) --- contrib/tzdata/Makefile | 32 +++++------ contrib/tzdata/NEWS | 84 +++++++++++++++++++++++++++-- contrib/tzdata/antarctica | 2 + contrib/tzdata/asia | 113 ++++++++++++++++++++++++++++----------- contrib/tzdata/australasia | 113 +++++++++++++++++++++------------------ contrib/tzdata/checknow.awk | 2 +- contrib/tzdata/checktab.awk | 39 +++++++++++++- contrib/tzdata/etcetera | 4 ++ contrib/tzdata/europe | 2 +- contrib/tzdata/factory | 10 ++++ contrib/tzdata/leap-seconds.list | 8 +-- contrib/tzdata/leapseconds | 8 +-- contrib/tzdata/northamerica | 9 ++-- contrib/tzdata/southamerica | 27 ++++++++-- contrib/tzdata/theory.html | 40 +++++++++----- contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 2 +- contrib/tzdata/zone1970.tab | 6 +-- contrib/tzdata/zonenow.tab | 9 ++-- 19 files changed, 369 insertions(+), 143 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 0087b4596515..2130582c2deb 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -137,7 +137,7 @@ TIME_T_ALTERNATIVES_TAIL = int_least32_t.ck uint_least32_t.ck \ uint_least64_t.ck # What kind of TZif data files to generate. (TZif is the binary time -# zone data format that zic generates; see Internet RFC 8536.) +# zone data format that zic generates; see Internet RFC 9636.) # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -255,6 +255,7 @@ LDLIBS= # -DHAVE_UNISTD_H=0 if does not work* # -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DMKTIME_MIGHT_OVERFLOW if mktime might fail due to time_t overflow # -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ # Typically it is better to use a later standard. For example, # with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. @@ -262,7 +263,7 @@ LDLIBS= # feature (integers at least 64 bits wide) and maybe more. # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. -# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -Dssize_t=int on hosts like MS-Windows that lack ssize_t # -DSUPPORT_C89=0 if the tzcode library should not support C89 callers # Although -DSUPPORT_C89=0 might work around latent bugs in callers, # it does not conform to POSIX. @@ -285,7 +286,7 @@ LDLIBS= # This mishandles some past timestamps, as US DST rules have changed. # It also mishandles settings like TZ='EET-2EEST' for eastern Europe, # as Europe and US DST rules differ. -# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) +# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 254) # -DUNINIT_TRAP if reading uninitialized storage can cause problems # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library @@ -319,7 +320,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ $(GCC_INSTRUMENT) \ -Wall -Wextra \ -Walloc-size-larger-than=100000 -Warray-bounds=2 \ - -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ + -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wcast-qual \ + -Wdate-time \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ @@ -336,7 +338,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-format-nonliteral -Wno-sign-compare + -Wno-format-nonliteral -Wno-sign-compare -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -614,8 +616,8 @@ TZS_YEAR= 2050 TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs TZS_NEW= to$(TZS_YEAR)new.tzs -TZS_DEPS= $(YDATA) asctime.c localtime.c \ - private.h tzfile.h zdump.c zic.c +TZS_DEPS= $(YDATA) localtime.c private.h \ + strftime.c tzfile.h zdump.c zic.c TZDATA_DIST = $(COMMON) $(DATA) $(MISC) # EIGHT_YARDS is just a yard short of the whole ENCHILADA. EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi @@ -855,10 +857,10 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_mild back.ck +check: check_mild back.ck now.ck check_mild: check_web check_zishrink \ character-set.ck white-space.ck links.ck mainguard.ck \ - name-lengths.ck now.ck slashed-abbrs.ck sorted.ck \ + name-lengths.ck slashed-abbrs.ck sorted.ck \ tables.ck ziguard.ck tzs.ck # True if UTF8_LOCALE does not work; @@ -1103,7 +1105,7 @@ set-timestamps.out: $(EIGHT_YARDS) touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ - if git diff --quiet $$file; then \ + if git diff --quiet HEAD $$file; then \ time=$$(TZ=UTC0 git log -1 \ --format='tformat:%cd' \ --date='format:%Y-%m-%dT%H:%M:%SZ' \ @@ -1354,13 +1356,13 @@ long-long.ck unsigned.ck: $(VERSION_DEPS) zonenames: tzdata.zi @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi -asctime.o: private.h tzfile.h +asctime.o: private.h date.o: private.h difftime.o: private.h -localtime.o: private.h tzfile.h tzdir.h -strftime.o: private.h tzfile.h -zdump.o: version.h -zic.o: private.h tzfile.h tzdir.h version.h +localtime.o: private.h tzdir.h tzfile.h +strftime.o: localtime.c private.h tzdir.h tzfile.h +zdump.o: private.h version.h +zic.o: private.h tzdir.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_mild check_time_t_alternatives diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 83b8b8c8d39c..a5d7ea89204e 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,83 @@ News for the tz database +Release 2025a - 2025-01-15 10:47:24 -0800 + + Briefly: + Paraguay adopts permanent -03 starting spring 2024. + Improve pre-1991 data for the Philippines. + Etc/Unknown is now reserved. + + Changes to future timestamps + + Paraguay will stop changing its clocks after the spring-forward + transition on 2024-10-06, so it is now permanently at -03. + (Thanks to Heitor David Pinto and Even Scharning.) + This affects timestamps starting 2025-03-22, as well as the + obsolescent tm_isdst flags starting 2024-10-15. + + Changes to past timestamps + + Correct timestamps for the Philippines before 1900, and from 1937 + through 1990. (Thanks to P Chan for the heads-up and citations.) + This includes adjusting local mean time before 1899; fixing + transitions in September 1899, January 1937, and June 1954; adding + transitions in December 1941, November 1945, March and September + 1977, and May and July 1990; and removing incorrect transitions in + March and September 1978. + + Changes to data + + Add zone1970.tab lines for the Concordia and Eyre Bird Observatory + research stations. (Thanks to Derick Rethans and Jule Dabars.) + + Changes to code + + strftime %s now generates the correct numeric string even when the + represented number does not fit into time_t. This is better than + generating the numeric equivalent of (time_t) -1, as strftime did + in TZDB releases 96a (when %s was introduced) through 2020a and in + releases 2022b through 2024b. It is also better than failing and + returning 0, as strftime did in releases 2020b through 2022a. + + strftime now outputs an invalid conversion specifier as-is, + instead of eliding the leading '%', which confused debugging. + + An invalid TZ now generates the time zone abbreviation "-00", not + "UTC", to help the user see that an error has occurred. (Thanks + to Arthur David Olson for suggesting a "wrong result".) + + mktime and timeoff no longer incorrectly fail merely because a + struct tm component near INT_MIN or INT_MAX overflows when a + lower-order component carries into it. + + TZNAME_MAXIMUM, the maximum number of bytes in a proleptic TZ + string's time zone abbreviation, now defaults to 254 not 255. + This helps reduce the size of internal state from 25480 to 21384 + on common platforms. This change should not be a problem, as + nobody uses such long "abbreviations" and the longstanding tzcode + maximum was 16 until release 2023a. For those who prefer no + arbitrary limits, you can now specify TZNAME_MAXIMUM values up to + PTRDIFF_MAX, a limit forced by C anyway; formerly tzcode silently + misbehaved unless TZNAME_MAXIMUM was less than INT_MAX. + + tzset and related functions no longer leak a file descriptor if + another thread forks or execs at about the same time and if the + platform has O_CLOFORK and O_CLOEXEC respectively. Also, the + functions no longer let a TZif file become a controlling terminal. + + 'zdump -' now reads TZif data from /dev/stdin. + (From a question by Arthur David Olson.) + + Changes to documentation + + The name Etc/Unknown is now reserved: it will not be used by TZDB. + This is for compatibility with CLDR, which uses the string + "Etc/Unknown" for an unknown or invalid timezone. (Thanks to + Justin Grant, Mark Davis, and Guy Harris.) + + Cite Internet RFC 9636, which obsoletes RFC 8536 for TZif format. + + Release 2024b - 2024-09-04 12:27:47 -0700 Briefly: @@ -116,7 +194,7 @@ Release 2024b - 2024-09-04 12:27:47 -0700 Changes to commentary Commentary about historical transitions in Portugal and her former - colonies has been expanded with links to many relevant legislation. + colonies has been expanded with links to relevant legislation. (Thanks to Tim Parenti.) @@ -204,10 +282,10 @@ Release 2023d - 2023-12-21 20:02:24 -0800 changing its time zone from -01/+00 to -02/-01 at the same moment as the spring-forward transition. Its clocks will therefore not spring forward as previously scheduled. The time zone change - reverts to its common practice before 1981. + reverts to its common practice before 1981. (Thanks to Jule Dabars.) Fix predictions for DST transitions in Palestine in 2072-2075, - correcting a typo introduced in 2023a. + correcting a typo introduced in 2023a. (Thanks to Jule Dabars.) Changes to past and future timestamps diff --git a/contrib/tzdata/antarctica b/contrib/tzdata/antarctica index 8d5d6cd1cdd0..2e90a5e09d17 100644 --- a/contrib/tzdata/antarctica +++ b/contrib/tzdata/antarctica @@ -174,6 +174,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13 # France & Italy - year-round base # Concordia, -750600+1232000, since 2005 +# https://en.wikipedia.org/wiki/Concordia_Station +# Can use Asia/Singapore, which it has agreed with since inception. # Germany - year-round base # Neumayer III, -704080-0081602, since 2009 diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index a2480b021225..d4eb058053ed 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3665,21 +3665,70 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line # https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm -# The rest of the data entries are from Shanks & Pottenger. - -# From Jesper Nørgaard Welen (2006-04-26): -# ... claims that Philippines had DST last time in 1990: -# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/ -# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires, -# but no details] - -# From Paul Eggert (2014-08-14): -# The following source says DST may be instituted November-January and again -# March-June, but this is not definite. It also says DST was last proclaimed -# during the Ramos administration (1992-1998); but again, no details. -# Carcamo D. PNoy urged to declare use of daylight saving time. -# Philippine Star 2014-08-05 -# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time + +# From P Chan (2021-05-10): +# Here's a fairly comprehensive article in Japanese: +# https://wiki.suikawiki.org/n/Philippine%20Time +# (2021-05-16): +# According to the references listed in the article, +# the periods that the Philippines (Manila) observed DST or used +9 are: +# +# 1936-10-31 24:00 to 1937-01-15 24:00 +# (Proclamation No. 104, Proclamation No. 126) +# 1941-12-15 24:00 to 1945-11-30 24:00 +# (Proclamation No. 789, Proclamation No. 20) +# 1954-04-11 24:00 to 1954-06-04 24:00 +# (Proclamation No. 13, Proclamation No. 33) +# 1977-03-27 24:00 to 1977-09-21 24:00 +# (Proclamation No. 1629, Proclamation No. 1641) +# 1990-05-21 00:00 to 1990-07-28 24:00 +# (National Emergency Memorandum Order No. 17, Executive Order No. 415) +# +# Proclamation No. 104 ... October 30, 1936 +# https://www.officialgazette.gov.ph/1936/10/30/proclamation-no-104-s-1936/ +# Proclamation No. 126 ... January 15, 1937 +# https://www.officialgazette.gov.ph/1937/01/15/proclamation-no-126-s-1937/ +# Proclamation No. 789 ... December 13, 1941 +# https://www.officialgazette.gov.ph/1941/12/13/proclamation-no-789-s-1941/ +# Proclamation No. 20 ... November 11, 1945 +# https://www.officialgazette.gov.ph/1945/11/11/proclamation-no-20-s-1945/ +# Proclamation No. 13 ... April 6, 1954 +# https://www.officialgazette.gov.ph/1954/04/06/proclamation-no-13-s-1954/ +# Proclamation No. 33 ... June 3, 1954 +# https://www.officialgazette.gov.ph/1954/06/03/proclamation-no-33-s-1954/ +# Proclamation No. 1629 ... March 25, 1977 +# https://www.officialgazette.gov.ph/1977/03/25/proclamation-no-1629-s-1977/ +# Proclamation No. 1641 ...May 26, 1977 +# https://www.officialgazette.gov.ph/1977/05/26/proclamation-no-1641-s-1977/ +# National Emergency Memorandum Order No. 17 ... May 2, 1990 +# https://www.officialgazette.gov.ph/1990/05/02/national-emergency-memorandum-order-no-17-s-1990/ +# Executive Order No. 415 ... July 20, 1990 +# https://www.officialgazette.gov.ph/1990/07/20/executive-order-no-415-s-1990/ +# +# During WWII, Proclamation No. 789 fixed two periods of DST. The first period +# was set to continue only until January 31, 1942. But Manila was occupied by +# the Japanese earlier in the month.... +# +# For the date of the adoption of standard time, Shank[s] gives 1899-05-11. +# The article is not able to state the basis of that. I guess it was based on +# a US War Department Circular issued on that date. +# https://books.google.com/books?id=JZ1PAAAAYAAJ&pg=RA3-PA8 +# +# However, according to other sources, standard time was adopted on +# 1899-09-06. Also, the LMT was GMT+8:03:52 +# https://books.google.com/books?id=MOYIAQAAIAAJ&pg=PA521 +# https://books.google.com/books?id=lSnqqatpYikC&pg=PA21 +# +# From Paul Eggert (2024-09-05): +# The penultimate URL in P Chan's email refers to page 521 of +# Selga M, The Time Service in the Philippines. +# Proc Pan-Pacific Science Congress. Vol. 1 (1923), 519-532. +# It says, "The change from the meridian 120° 58' 04" to the 120th implied a +# change of 3 min. 52s.26 in time; consequently on 6th September, 1899, +# Manila Observatory gave the noon signal 3 min. 52s.26 later than before". +# +# Wikipedia says the US declared Manila liberated on March 4, 1945; +# this doesn't affect clocks, just our time zone abbreviation and DST flag. # From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15): # In the Philippines, there is a national law, Republic Act No. 10535 @@ -3697,24 +3746,26 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # influence of the sources. There is no current abbreviation for DST, # so use "PDT", the usual American style. -# From P Chan (2021-05-10): -# Here's a fairly comprehensive article in Japanese: -# https://wiki.suikawiki.org/n/Philippine%20Time -# From Paul Eggert (2021-05-10): -# The info in the Japanese table has not been absorbed (yet) below. - # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 D -Rule Phil 1937 only - Feb 1 0:00 0 S -Rule Phil 1954 only - Apr 12 0:00 1:00 D -Rule Phil 1954 only - Jul 1 0:00 0 S -Rule Phil 1978 only - Mar 22 0:00 1:00 D -Rule Phil 1978 only - Sep 21 0:00 0 S +Rule Phil 1936 only - Oct 31 24:00 1:00 D +Rule Phil 1937 only - Jan 15 24:00 0 S +Rule Phil 1941 only - Dec 15 24:00 1:00 D +# The following three rules were canceled by Japan: +#Rule Phil 1942 only - Jan 31 24:00 0 S +#Rule Phil 1942 only - Mar 1 0:00 1:00 D +#Rule Phil 1942 only - Jun 30 24:00 0 S +Rule Phil 1945 only - Nov 30 24:00 0 S +Rule Phil 1954 only - Apr 11 24:00 1:00 D +Rule Phil 1954 only - Jun 4 24:00 0 S +Rule Phil 1977 only - Mar 27 24:00 1:00 D +Rule Phil 1977 only - Sep 21 24:00 0 S +Rule Phil 1990 only - May 21 0:00 1:00 D +Rule Phil 1990 only - Jul 28 24:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 - 8:04:00 - LMT 1899 May 11 - 8:00 Phil P%sT 1942 May - 9:00 - JST 1944 Nov +Zone Asia/Manila -15:56:08 - LMT 1844 Dec 31 + 8:03:52 - LMT 1899 Sep 6 4:00u + 8:00 Phil P%sT 1942 Feb 11 24:00 + 9:00 - JST 1945 Mar 4 8:00 Phil P%sT # Bahrain diff --git a/contrib/tzdata/australasia b/contrib/tzdata/australasia index 359f9c1f1e10..405944536cd3 100644 --- a/contrib/tzdata/australasia +++ b/contrib/tzdata/australasia @@ -1239,10 +1239,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # The 1992 ending date used in the rules is a best guess; # it matches what was used in the past. -# The Australian Bureau of Meteorology FAQ -# http://www.bom.gov.au/faq/faqgen.htm -# (1999-09-27) writes that Giles Meteorological Station uses -# South Australian time even though it's located in Western Australia. +# From Christopher Hunt (2006-11-21), after an advance warning +# from Jesper Nørgaard Welen (2006-11-01): +# WA are trialing DST for three years. +# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf # From Paul Eggert (2018-04-01): # The Guardian Express of Perth, Australia reported today that the @@ -1254,54 +1254,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/ # [The article ends with "Today's date is April 1."] -# Queensland - -# From Paul Eggert (2018-02-26): -# I lack access to the following source for Queensland DST: -# Pearce C. History of daylight saving time in Queensland. -# Queensland Hist J. 2017 Aug;23(6):389-403 -# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS - -# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): -# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] -# # [ Dec 1990 ] -# ... -# Zone Australia/Queensland 10:00 AQ %sST -# ... -# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D -# Rule AQ 1972 only - Feb lastSun 3:00 0 E -# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D -# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E - -# From Bradley White (1989-12-24): -# "Australia/Queensland" now observes daylight time (i.e. from -# October 1989). - -# From Bradley White (1991-03-04): -# A recent excerpt from an Australian newspaper... -# ...Queensland...[has] agreed to end daylight saving -# at 3am tomorrow (March 3)... - -# From John Mackin (1991-03-06): -# I can certainly confirm for my part that Daylight Saving in NSW did in fact -# end on Sunday, 3 March. I don't know at what hour, though. (It surprised -# me.) - -# From Bradley White (1992-03-08): -# ...there was recently a referendum in Queensland which resulted -# in the experimental daylight saving system being abandoned. So, ... -# ... -# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D -# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S -# ... - -# From Arthur David Olson (1992-03-08): -# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. - -# From Christopher Hunt (2006-11-21), after an advance warning -# from Jesper Nørgaard Welen (2006-11-01): -# WA are trialing DST for three years. -# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf +# The Australian Bureau of Meteorology FAQ +# http://www.bom.gov.au/faq/faqgen.htm +# (1999-09-27) writes that Giles Meteorological Station uses +# South Australian time even though it's located in Western Australia. # From Rives McDow (2002-04-09): # The most interesting region I have found consists of three towns on the @@ -1359,6 +1315,59 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # For lack of better info, assume the tradition dates back to the # introduction of standard time in 1895. +# From Stuart Bishop (2024-11-12): +# An article discussing the in-use but technically unofficial timezones +# in the Western Australian portion of the Nullarbor Plain. +# https://www.abc.net.au/news/2024-11-22/outback-wa-properties-strange-time-zones/104542494 +# From Paul Eggert (2024-11-12): +# As the article says, the Eyre Bird Observatory and nearby sheep stations +# can use Tokyo time. Other possibilities include Asia/Chita, Asia/Seoul, +# and Asia/Jayapura. + +# Queensland + +# From Paul Eggert (2018-02-26): +# I lack access to the following source for Queensland DST: +# Pearce C. History of daylight saving time in Queensland. +# Queensland Hist J. 2017 Aug;23(6):389-403 +# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS + +# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): +# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] +# # [ Dec 1990 ] +# ... +# Zone Australia/Queensland 10:00 AQ %sST +# ... +# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D +# Rule AQ 1972 only - Feb lastSun 3:00 0 E +# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D +# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E + +# From Bradley White (1989-12-24): +# "Australia/Queensland" now observes daylight time (i.e. from +# October 1989). + +# From Bradley White (1991-03-04): +# A recent excerpt from an Australian newspaper... +# ...Queensland...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From John Mackin (1991-03-06): +# I can certainly confirm for my part that Daylight Saving in NSW did in fact +# end on Sunday, 3 March. I don't know at what hour, though. (It surprised +# me.) + +# From Bradley White (1992-03-08): +# ...there was recently a referendum in Queensland which resulted +# in the experimental daylight saving system being abandoned. So, ... +# ... +# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D +# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S +# ... + +# From Arthur David Olson (1992-03-08): +# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. + # southeast Australia # diff --git a/contrib/tzdata/checknow.awk b/contrib/tzdata/checknow.awk index 8b7881d2e27f..450490ee3768 100644 --- a/contrib/tzdata/checknow.awk +++ b/contrib/tzdata/checknow.awk @@ -44,7 +44,7 @@ BEGIN { END { for (zone in zone_data) { data = zone_data[zone] - if (!zonenow[data]) { + if (data && !zonenow[data]) { printf "Zone table should have one of:%s\n", zones[data] zonenow[data] = zone # This suppresses duplicate diagnostics. status = 1 diff --git a/contrib/tzdata/checktab.awk b/contrib/tzdata/checktab.awk index 9a26e4655ddb..5fa60556be13 100644 --- a/contrib/tzdata/checktab.awk +++ b/contrib/tzdata/checktab.awk @@ -9,6 +9,19 @@ BEGIN { if (!zone_table) zone_table = "zone1970.tab" if (!want_warnings) want_warnings = -1 + monthabbr["Jan"] = 1 + monthabbr["Feb"] = 1 + monthabbr["Mar"] = 1 + monthabbr["Apr"] = 1 + monthabbr["May"] = 1 + monthabbr["Jun"] = 1 + monthabbr["Jul"] = 1 + monthabbr["Aug"] = 1 + monthabbr["Sep"] = 1 + monthabbr["Oct"] = 1 + monthabbr["Nov"] = 1 + monthabbr["Dec"] = 1 + while (getline >"/dev/stderr" + status = 1 + } } else { + stdoff = $1 ruleUsed[$2] = 1 if ($3 ~ /%/) rulePercentUsed[$2] = 1 } + + if (stdoff && stdoff !~ /^\-?1?[0-9](:[0-5][0-9](:[0-5][0-9])?)?$/) { + printf "%s:%d: unlikely STDOFF: %s\n", FILENAME, FNR, stdoff \ + >>"/dev/stderr" + status = 1 + } + if (tz && tz ~ /\// && tz !~ /^Etc\//) { if (!tztab[tz] && FILENAME != "backward" \ && zone_table != "zonenow.tab") { diff --git a/contrib/tzdata/etcetera b/contrib/tzdata/etcetera index a5ecd6de1f6e..948531c8d862 100644 --- a/contrib/tzdata/etcetera +++ b/contrib/tzdata/etcetera @@ -51,6 +51,10 @@ Link Etc/GMT GMT # so we moved the names into the Etc subdirectory. # Also, the time zone abbreviations are now compatible with %z. +# There is no "Etc/Unknown" entry, as CLDR says that "Etc/Unknown" +# corresponds to an unknown or invalid time zone, and things would get +# confusing if Etc/Unknown were made valid here. + Zone Etc/GMT-14 14 - %z Zone Etc/GMT-13 13 - %z Zone Etc/GMT-12 12 - %z diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index f9063949eb83..df334fc27c1d 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1147,7 +1147,7 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # However, Greenland will change to Daylight Saving Time again in 2024 # and onwards. -# From a contributor who wishes to remain anonymous for now (2023-10-29): +# From Jule Dabars (2023-10-29): # https://www.dr.dk/nyheder/seneste/i-nat-skal-uret-stilles-en-time-tilbage-men-foerste-gang-sker-det-ikke-i-groenland # with a link to that page: # https://naalakkersuisut.gl/Nyheder/2023/10/2710_sommertid diff --git a/contrib/tzdata/factory b/contrib/tzdata/factory index d116a115990e..14faf52a792e 100644 --- a/contrib/tzdata/factory +++ b/contrib/tzdata/factory @@ -8,5 +8,15 @@ # time zone abbreviation "-00", indicating that the actual time zone # is unknown. +# TZ="Factory" was added to TZDB in 1989, and in 2016 its abbreviation +# was changed to "-00" from a longish English-language error message. +# Around 2010, CLDR added "Etc/Unknown" for use with TZDB, to stand +# for an unknown or invalid time zone. These two notions differ: +# TZ="Factory" is a valid timezone, so tzalloc("Factory") succeeds, whereas +# TZ="Etc/Unknown" is invalid and tzalloc("Etc/Unknown") fails. +# Also, a downstream distributor could modify Factory to be a +# default timezone suitable for the devices it manufactures, +# whereas that cannot happen for Etc/Unknown. + # Zone NAME STDOFF RULES FORMAT Zone Factory 0 - "Local time zone must be set--use tzsetup" diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index da0efc8c8566..6f861c888d75 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -60,15 +60,15 @@ # # The following line shows the last update of this file in NTP timestamp: # -#$ 3929093563 +#$ 3945196800 # # 2) Expiration date of the file given on a semi-annual basis: last June or last December # -# File expires on 28 June 2025 +# File expires on 28 December 2025 # # Expire date in NTP timestamp: # -#@ 3960057600 +#@ 3975868800 # # # LIST OF LEAP SECONDS @@ -117,4 +117,4 @@ # please see the readme file in the 'source' directory : # https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README # -#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 +#h 848434d5 570f7ea8 d79ba227 a00fc821 f608e2d4 diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index 6c715cb20b01..76f771427f25 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -69,11 +69,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2025 Jun 28 00:00:00 +#Expires 2025 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1720104763 (2024-07-04 14:52:43 UTC) -#expires 1751068800 (2025-06-28 00:00:00 UTC) +#updated 1736208000 (2025-01-07 00:00:00 UTC) +#expires 1766880000 (2025-12-28 00:00:00 UTC) # Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# File expires on 28 June 2025 +# File expires on 28 December 2025 diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index 01f392e0e6a4..8d356aa0069d 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -27,9 +27,12 @@ # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# From Paul Eggert (2018-03-20): +# From Paul Eggert (2024-11-18): # Dowd's proposal left many details unresolved, such as where to draw -# lines between time zones. The key individual who made time zones +# lines between time zones. Sandford Fleming of the Canadian Pacific Railway +# argued for Dowd's proposal in 1876, and Cleveland Abbe of the American +# Meteorology Society published a report in 1879 recommending four US time +# zones based on GMT. However, the key individual who made time zones # work in the US was William Frederick Allen - railway engineer, # managing editor of the Travelers' Guide, and secretary of the # General Time Convention, a railway standardization group. Allen @@ -2631,7 +2634,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Mexico 1931 only - April 30 0:00 1:00 D +Rule Mexico 1931 only - Apr 30 0:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index c8d9097aeb14..1fcf65146785 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1687,7 +1687,7 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 - # and that on the first Sunday of the month of October, it is to be set # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... -Rule Para 2010 max - Oct Sun>=1 0:00 1:00 - +Rule Para 2010 2024 - Oct Sun>=1 0:00 1:00 - Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): @@ -1706,14 +1706,35 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # https://www.abc.com.py/politica/2023/07/12/promulgacion-el-cambio-de-hora-sera-por-ley/ # From Carlos Raúl Perasso (2023-07-27): # http://silpy.congreso.gov.py/descarga/ley-144138 -Rule Para 2013 max - Mar Sun>=22 0:00 0 - +Rule Para 2013 2024 - Mar Sun>=22 0:00 0 - +# +# From Heitor David Pinto (2024-09-24): +# Today the Congress of Paraguay passed a bill to observe UTC-3 permanently.... +# The text of the bill says that it would enter into force on the first +# Sunday in October 2024, the same date currently scheduled to start DST.... +# https://silpy.congreso.gov.py/web/expediente/132531 +# (2024-10-14): +# The president approved the law on 11 October 2024, +# and it was officially published on 14 October 2024. +# https://www.gacetaoficial.gov.py/index/detalle_publicacion/89723 +# The text of the law says that it enters into force on the first +# Sunday in October 2024 (6 October 2024). But the constitution +# prohibits retroactive effect, and the civil code says that laws +# enter into force on the day after their publication or on the day +# that they specify, and it also says that they don't have retroactive +# effect. So I think that the time change on 6 October 2024 should +# still be considered as DST according to the previous law, and +# permanently UTC-3 from 15 October 2024 according to the new law.... +# https://www.constituteproject.org/constitution/Paraguay_2011 +# https://www.oas.org/dil/esp/codigo_civil_paraguay.pdf # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time -4:00 - %z 1972 Oct -3:00 - %z 1974 Apr - -4:00 Para %z + -4:00 Para %z 2024 Oct 15 + -3:00 - %z # Peru # diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index d3573ede0dfb..352a3d87078f 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -123,8 +123,9 @@ If geolocation information is available, a selection interface can locate the user on a timezone map or prioritize names that are geographically close. For an example selection interface, see the tzselect program in the tz code. -The Unicode Common Locale Data -Repository contains data that may be useful for other selection +Unicode's Common Locale Data +Repository (CLDR) +contains data that may be useful for other selection interfaces; it maps timezone names like Europe/Prague to locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格".

    @@ -200,6 +201,8 @@ in decreasing order of importance:
  • A name must not be empty, or contain '//', or start or end with '/'. + Also, a name must not be 'Etc/Unknown', as + CLDR uses that string for an unknown or invalid timezone.
  • Do not use names that differ only in case. @@ -220,10 +223,18 @@ in decreasing order of importance: do not need locations, since local time is not defined there.
  • - If all the clocks in a timezone have agreed since 1970, - do not bother to include more than one timezone - even if some of the clocks disagreed before 1970. + If all clocks in a region have agreed since 1970, + give them just one name even if some of the clocks disagreed before 1970, + or reside in different countries or in notable or faraway locations. Otherwise these tables would become annoyingly large. + For example, do not create a name Indian/Crozet + as a near-duplicate or alias of Asia/Dubai + merely because they are different countries or territories, + or their clocks disagreed before 1970, or the + Crozet Islands + are notable in their own right, + or the Crozet Islands are not adjacent to other locations + that use Asia/Dubai.
  • If boundaries between regions are fluid, such as during a war or @@ -579,10 +590,10 @@ in decreasing order of importance: locations while uninhabited. The leading '-' is a flag that the UT offset is in some sense undefined; this notation is derived - from Internet + from Internet RFC 3339. (The abbreviation 'Z' that - Internet + Internet RFC 9557 uses for this concept would violate the POSIX requirement of at least three characters in an abbreviation.) @@ -1115,8 +1126,8 @@ However POSIX.1-2024, like earlier POSIX editions, has some limitations: the name of a file from which time-related information is read. The file's format is TZif, a timezone information format that contains binary data; see - Internet - RFC 8536. + Internet + RFC 9636. The daylight saving time rules to be used for a particular timezone are encoded in the TZif file; the format of the file allows US, @@ -1201,12 +1212,15 @@ The vestigial APIs are: The tm_isdst member is almost never needed and most of its uses should be discouraged in favor of the abovementioned APIs. + It was intended as an index into the tzname variable, + but as mentioned previously that usage is obsolete. Although it can still be used in arguments to mktime to disambiguate timestamps near a DST transition when the clock jumps back on platforms lacking tm_gmtoff, this - disambiguation does not work when standard time itself jumps back, - which can occur when a location changes to a time zone with a + disambiguation works only for proleptic TZ strings; + it does not work in general for geographical timezones, + such as when a location changes to a time zone with a lesser UT offset.
  • @@ -1223,8 +1237,8 @@ The vestigial APIs are: Programs that in the past used the timezone function may now examine localtime(&clock)->tm_zone (if TM_ZONE is defined) or - tzname[localtime(&clock)->tm_isdst] - (if HAVE_TZNAME is nonzero) to learn the correct time + use strftime with a %Z conversion specification + to learn the correct time zone abbreviation to use.
  • diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 699e50d4d38e..0846b7f265fa 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2024b +2025a diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index bfc0b5933044..d2be66359f3b 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -310,7 +310,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG -0930+14710 Pacific/Port_Moresby most of Papua New Guinea PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index 764215888efa..3a5a71c508d4 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -184,7 +184,7 @@ IR +3540+05126 Asia/Tehran IT,SM,VA +4154+01229 Europe/Rome JM +175805-0764736 America/Jamaica JO +3157+03556 Asia/Amman -JP +353916+1394441 Asia/Tokyo +JP,AU +353916+1394441 Asia/Tokyo Eyre Bird Observatory KE,DJ,ER,ET,KM,MG,SO,TZ,UG,YT -0117+03649 Africa/Nairobi KG +4254+07436 Asia/Bishkek KI,MH,TV,UM,WF +0125+17300 Pacific/Tarawa Gilberts, Marshalls, Wake @@ -247,7 +247,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG,AQ,FM -0930+14710 Pacific/Port_Moresby Papua New Guinea (most areas), Chuuk, Yap, Dumont d'Urville PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon @@ -294,7 +294,7 @@ RU +6445+17729 Asia/Anadyr MSK+09 - Bering Sea SA,AQ,KW,YE +2438+04643 Asia/Riyadh Syowa SB,FM -0932+16012 Pacific/Guadalcanal Pohnpei SD +1536+03232 Africa/Khartoum -SG,MY +0117+10351 Asia/Singapore peninsular Malaysia +SG,AQ,MY +0117+10351 Asia/Singapore peninsular Malaysia, Concordia SR +0550-05510 America/Paramaribo SS +0451+03137 Africa/Juba ST +0020+00644 Africa/Sao_Tome diff --git a/contrib/tzdata/zonenow.tab b/contrib/tzdata/zonenow.tab index 01f536b3ba38..d2c1e48584f8 100644 --- a/contrib/tzdata/zonenow.tab +++ b/contrib/tzdata/zonenow.tab @@ -97,9 +97,6 @@ XX +1828-06954 America/Santo_Domingo Atlantic Standard ("AST") - eastern Caribbe # -04/-03 (Chile DST) XX -3327-07040 America/Santiago most of Chile # -# -04/-03 (Paraguay DST) -XX -2516-05740 America/Asuncion Paraguay -# # -04/-03 - AST/ADT (North America DST) XX +4439-06336 America/Halifax Atlantic ("AST/ADT") - Canada; Bermuda # @@ -224,7 +221,7 @@ XX +1345+10031 Asia/Bangkok Russia; Indochina; Christmas Island XX -0610+10648 Asia/Jakarta Indonesia ("WIB") # # +08 -XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore +XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore; Concordia # # +08 - AWST XX -3157+11551 Australia/Perth Western Australia ("AWST") *** 18 LINES SKIPPED *** From nobody Mon Jan 20 00:27: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 4Ybrlf3wYwz5lw9V; Mon, 20 Jan 2025 00:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrlf3GRzz3djM; Mon, 20 Jan 2025 00:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoyQEvpCyRxopGiTiXBfaho2IpAhqFWiWZEcCKgD2YY=; b=YdvW+tEAxvpnBpYT/Y2Ou2xpldCchun34R9pfSk3xLTPBPNWnD+L1iTEd/xzC761QZTtn/ CTNkYa86fWIkJ4TNX9nU7HV1mED4IngC+3QhCsG340fKwUYCMJ8JEOs82TESEoDaw4NKvN zZFr+cxZikV5QSJPvWcS1wkAjUWX1MTAIaqLTqqxEKlufYfmEHjkqXWT8SWuKiTj2IHL6n 66ziEQAV/urnBJwfOhhbFpJIXJcxAK52fEorGkGAX0YMUX6CE6BKc4UNKOu7QJgXuSvnaO 8wu4GR59Dd+WT/3A6DdC0+6jyQfOYHnhETZpCO7Ii04Na3a2u4H3SJ2EWsak3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoyQEvpCyRxopGiTiXBfaho2IpAhqFWiWZEcCKgD2YY=; b=JnbhOAiW8NjwTM+D5McXqLk7jgOMAT+IoBG5CiAwqWShgdryVVSdwVhzEWvGjBVUzMhXJB lmFuQCpaOxS5sdn3wrp5lT2/CRqm6wHPwoWytk5mvAVbYxRBd9MYPG4q/Sb00+HI7f5Vb9 9KXwzI2jPW6VNvg62C+UByYXNC81MJAAdQl2d2xpRCBxMn8KJx4oz81TaYu5lqOpHHxh1F UJxObjTdFuPbqNtQtY+uY9wOGr7CRkpzkXigJOe1wD2g3dttx51+f3LC4TH9arf1aJ2OTO 66NAtpBf/RbDOifboOdur/cw26J5pPXosAA7fTV9FbaW2jyODHDM2V6nQzKzIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332878; a=rsa-sha256; cv=none; b=MrW/FgoHmjmnIydq7QYS/0rLHpv+4LvKns33cIElCtXF+zf8BEa1dCyRhp4L7Rv4aRUniA RCHrHFshagHAJHuQjJviD4UWbW0T3BHXRFMySa/bxr9gmomndpW/N/PGGCZSWBvqL5CTO1 LyVXsOsn3zCG+2QNitfDcUY9wihZ20m7sRdek4JKBO7nPBTlCV0wdbov+DcV4jRcojD/5G 61RfbWfirYTKiqaJ9SolCldgZCphErpjFN44RcXfJwRgRdH5e81F0tASNFvtI9sHM4K4Tx ypD9QMN6QIokckerx6hWapYPpbfdRbjarzY+jYEfPl6ubpiF6Ln3Dbn3UZa5uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrlf2qMTz1Bpy; Mon, 20 Jan 2025 00:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0Rwot019006; Mon, 20 Jan 2025 00:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0RwdY019003; Mon, 20 Jan 2025 00:27:58 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:27:58 GMT Message-Id: <202501200027.50K0RwdY019003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8373644ee2c8 - stable/14 - unix: Be consistent about error handling for unconnected sockets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 8373644ee2c848bab47d87d24b31d673e6515bce Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8373644ee2c848bab47d87d24b31d673e6515bce commit 8373644ee2c848bab47d87d24b31d673e6515bce Author: Mark Johnston AuthorDate: 2025-01-06 22:55:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 00:26:27 +0000 unix: Be consistent about error handling for unconnected sockets SOCK_STREAM and SOCK_SEQPACKET sockets should get the same treatment here. PR: 176420 MFC after: 2 weeks (cherry picked from commit 1c933f464fdbb630f9663751f04c29cdcda38902) --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 78469adcd84d..80ac5cc0b775 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1779,7 +1779,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt) if (unp->unp_flags & UNP_HAVEPC) xu = unp->unp_peercred; else { - if (so->so_type == SOCK_STREAM) + if (so->so_proto->pr_flags & PR_CONNREQUIRED) error = ENOTCONN; else error = EINVAL; From nobody Mon Jan 20 00:27: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 4Ybrlg6mXJz5jxYW; Mon, 20 Jan 2025 00:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrlg4NNMz3dlQ; Mon, 20 Jan 2025 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+S/BGzCn3b2P9TPqXu3bx9KGJ7xFKZRAOV2DXZJIv4s=; b=W9V7AC3M7485aQc9w6j22c/MljLGupXUOXjNo3CuqxuI0qmuour9X2y614X+ohToUtONxm 7h7oAq8dEa8+QiNK2a++McQO9DguCAg55L4rwLsG/NIy9ZZX4YIC8d4ksfv1Ah1z24VClV dpukCsZW3MWzBYsbiT22A/mkyurs7jujW1H76N3UcFUQlVx8NU3r/oR13j3lDNvrEAT623 cKUhvDh6tjGzLlqFcWCkrhB6dMvbGgSUOZWOdvg44PH/d7VFXAO7H2jiujQUmGqdfz/rZ3 j9ZlbI79LkD0wvQ1nLlKlwc1we+WGpj+hBNWmyUGeg/hly6FFSYqfekX+ir7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+S/BGzCn3b2P9TPqXu3bx9KGJ7xFKZRAOV2DXZJIv4s=; b=O/ziKlV3VfE3dsSh3S0zj9hlcrR6Ib6pUKjlJFPypQFxTYrPiqFdTuDzQaU6BV3DfuKCyq vgJ5wuL6GRd3LLkpNRSAMe9X1HL3uBg7BvA4bQWZ/XicchXLvIL91AR0NkdDU8UZ0IqtXw 9DZywxn/3+2xrrNyJy8q4g/NkiYKAzTqNY28F38UGU6rQl80k3zc/iPyKjo95GSZY451js fdqgSQB78arpHrsIAhQVvO58GRSitSF+X3uLNFvaBDHe1d64a225KxqkicBaEIf/tv6zTs tmchbm7Ay/8LDHe1t0W4QCx1b0GgyXpzAIqpir5V8TwJ0gfoWeKFQaOeWfqcGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332879; a=rsa-sha256; cv=none; b=PGAARJEHJVcUgntmByt/30tqqma8OERiYNQ27m+IBzn+oxsizfYEYAyzfuCJIIUpQjY3oR BJY1c+5jjbKIiyMm17fy7dx2qhZhdxAn6OYHi1FxwlUfD1BNfyIRFCKYtLhhZpjzTFUVU7 dw+KIplvElntQ77y6o6VToVx6cH/5FcHEMs11HRVRs0UjKgyT0iH854ujduPEph76xWKdi DjtKHyEZYVQP//HKQVq5/U2uPgQTTACNYwxnEGGrpm4VP/ifQzVjnakAE5T1f+aaoE5Vz3 mcG3BifOZjcJGrxlLj0mguKJBm89dSNOsEkaz9oH63aH2Hd/KSeNYxDaTnBzUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrlg3kcYz1Bq0; Mon, 20 Jan 2025 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0RxdJ019043; Mon, 20 Jan 2025 00:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0Rxjb019040; Mon, 20 Jan 2025 00:27:59 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:27:59 GMT Message-Id: <202501200027.50K0Rxjb019040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 65da23709d20 - stable/14 - netipsec: Pass the right mbuf up List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 65da23709d2047c996fb9434e68c2ce90ecdc1bb Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=65da23709d2047c996fb9434e68c2ce90ecdc1bb commit 65da23709d2047c996fb9434e68c2ce90ecdc1bb Author: Mark Johnston AuthorDate: 2025-01-06 23:20:08 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 00:26:35 +0000 netipsec: Pass the right mbuf up Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE message handler is not set. PR: 243057 MFC after: 2 weeks (cherry picked from commit 378a2b155aaf853933df5b53e174b3880826488c) --- sys/netipsec/key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 772602eeea90..5458d189c7bf 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -2519,7 +2519,7 @@ key_spdacquire(struct secpolicy *sp) mtod(result, struct sadb_msg *)->sadb_msg_len = PFKEY_UNIT64(result->m_pkthdr.len); - return key_sendup_mbuf(NULL, m, KEY_SENDUP_REGISTERED); + return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED); } /* From nobody Mon Jan 20 00:28: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 4Ybrlj1tQRz5jxZt; Mon, 20 Jan 2025 00:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrlh55Ftz3dpC; Mon, 20 Jan 2025 00:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YQBNE3EkhmuUpH/M6Qv/7lbiAfQ9jn5zPkTMDF3jD5o=; b=OxiShi0M83nnlxclcIc7Jxo+UMbq3+970pa0ndRSOQ8UkN00/sSoZG+BVVOsLu9fbr68F1 ahODvLiFo/b0WFTj3YWISGYtrnGoNc9h6QTqnjV0D1b3yP5jbw99wndFZVgw9JWyyAuXr3 JjihczWNlXOAqCS6TfzPqLaR+zQUwpS0VV1JkJl7YDdg+nPMu5fq61cfTaRx4ECaUftvcy 9Wr6R+lFRZGxK2T4KwCntWnwquojxQ4if7YB943R+XOsKl0DY3lbWSODhQ5JgRrG6IsNTM 2C9DM10dLJYRLJ7cLsmkMSkHgcFUQqDtIuNoO1oV/R60vQ0baY/RHN3f0W+Dmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YQBNE3EkhmuUpH/M6Qv/7lbiAfQ9jn5zPkTMDF3jD5o=; b=iOygzJcE4zk9Ksx4+wpN38p2FVQFWyNqKg2koeooh4gzGgj9vrS2H/9BjIUWfXj58tdxHI gQ61lDuLNL/ebUyjtlxGjjdBQlvM4vgMNffNhJOicBThObXcHs0BMM7a9Y+Zno2INrq3xZ B4ywGd+ferqWOACSf2mUI+PGqFHr5lfHKVgFzWwZd3m9R7nGbav5O/x8e2Q3ks3CkyURml wHV06BRosSqrRUa7jnORTy9aZkfAYAUakROZhaDxiYy/oR2ChHxs9PeVP9dtA4V61RKmc6 ri/H0GpGUcSsyvsG32O9CbCHaFff7aL8NYNtC4YHhN6L/6M9BTmNbPD+HPVJ/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332880; a=rsa-sha256; cv=none; b=A7/QETDrXi7MQMjA0GHYtcGH7E5tvPw1K/F8PgLwoVsEninTh7TVMZxb2d5PQ/hDJ8Yli7 JOtCclee3H1KPSJDdE+wwpsw8uiwOrn1JqCER3Qp5QwVc2j+6rATMpJ1Zsa2tk/crXffg6 +PzGoZfG9kGfwI1wSfp+nr69XJmJ813qtpRn4zKG40Xk3mHsvomZ5VXyS888ugS6lUYfFf NJFll4oDFDsE67Ln+8BWytnz3mjiED4ks41faquAx4yyXY9uLR3cGOoWuYPvjoFGX87NXf 60ZQAQfnkEoZHck1FTc1CXVAFXRB5EzRubgHu/HrkfDm9l7434nKBfsKO0/Z+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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrlh4gT8z1Bjm; Mon, 20 Jan 2025 00:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0S0LU019083; Mon, 20 Jan 2025 00:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0S0YU019080; Mon, 20 Jan 2025 00:28:00 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:28:00 GMT Message-Id: <202501200028.50K0S0YU019080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bd40a5abb1f8 - stable/14 - jail: Avoid a potential use-after-free when destroying jails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: bd40a5abb1f8810310a8841c34e469019002993f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd40a5abb1f8810310a8841c34e469019002993f commit bd40a5abb1f8810310a8841c34e469019002993f Author: Mark Johnston AuthorDate: 2025-01-06 22:53:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 00:26:43 +0000 jail: Avoid a potential use-after-free when destroying jails prison_deref() and prison_deref_kill() have to handle the case where destruction of a jail will release the final reference on the jail's parent, resulting in destruction of the parent jail. They thus maintain a list of jails whose references have gone away; the loop at the end of prison_deref() then goes through the list and deallocates resources associated with each jail. In particular, if a jail's VNET is not the same as that of its parent, this loop destroys the VNET. Suppose prison_deref() removes the last reference on a jail, releasing a reference to its parent and causing the jail to be placed in the "freeprison" list. Suppose then that the parent jail is destroyed before the "freeprison" list is processed. When destroying the now-orphaned child jail, prison_deref() derefences its parent to see whether the child jail's VNET needs to be freed, but if this race occurs, this is a use-after-free. Fix the problem by using PR_VNET to decide whether the jail's VNET is to be destroyed, rather than dereferencing the parent jail pointer. Set it earlier so that a subsequent failure in kern_jail_set() cleans up the nascent VNET. Reviewed by: zlei (previous version), jamie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47992 (cherry picked from commit 8c75c15d43e4123bc51f24f5bf99319289c45a6c) --- sys/kern/kern_jail.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 6f2b4f7fc336..103b44cc00b9 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1701,9 +1701,18 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) sizeof(pr->pr_osrelease)); #ifdef VIMAGE - /* Allocate a new vnet if specified. */ - pr->pr_vnet = (pr_flags & PR_VNET) - ? vnet_alloc() : ppr->pr_vnet; + /* + * Allocate a new vnet if specified. + * + * Set PR_VNET now if so, so that the vnet is disposed of + * properly when the jail is destroyed. + */ + if (pr_flags & PR_VNET) { + pr->pr_flags |= PR_VNET; + pr->pr_vnet = vnet_alloc(); + } else { + pr->pr_vnet = ppr->pr_vnet; + } #endif /* * Allocate a dedicated cpuset for each jail. @@ -3173,9 +3182,12 @@ prison_deref(struct prison *pr, int flags) * Removing a prison frees references * from its parent. */ + ppr = pr->pr_parent; + pr->pr_parent = NULL; mtx_unlock(&pr->pr_mtx); + + pr = ppr; flags &= ~PD_LOCKED; - pr = pr->pr_parent; flags |= PD_DEREF | PD_DEUREF; continue; } @@ -3202,7 +3214,7 @@ prison_deref(struct prison *pr, int flags) */ TAILQ_FOREACH_SAFE(rpr, &freeprison, pr_list, tpr) { #ifdef VIMAGE - if (rpr->pr_vnet != rpr->pr_parent->pr_vnet) + if (rpr->pr_flags & PR_VNET) vnet_destroy(rpr->pr_vnet); #endif if (rpr->pr_root != NULL) From nobody Mon Jan 20 01:59: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 4Ybtn933JLz5k46x; Mon, 20 Jan 2025 01:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybtn90V0pz3l8H; Mon, 20 Jan 2025 01:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737338365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3H5C+wIKHbpqpJkkOGRgetIXkz+Ks7bS94vEMbGTs6c=; b=vPQoufBM1PjcZ/6Kf2+Q2uNBvstNCsHHeZUH9fZNlGkx0E/b4wELAAzkdmZZII8EVZD/dj aT5nvDSunqN/9l2EQFIUrMNt747BndUuBde3VKUsB5taZZywRmNWaR+6IXexh7+BFkhShz rPLUdunHYbgc+oWjJcAyeegAFFqA/7+ci1C2Bt0ME5iub/Tn7/R8g+ytpvi8/l69qLWpSB mg3/nU6DBtgzbpN/tZLgffMiBh89Lb/XGta8vEsElbkUgOdtteeQRkqXQBqpPmtOv9rCcn ZL/RgLJt8f1g3RH41v9Fjmn2Iyo9Doy5ual5V4AhLPYyHJs3A+UEF/ArOm4JtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737338365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3H5C+wIKHbpqpJkkOGRgetIXkz+Ks7bS94vEMbGTs6c=; b=d6vnMxMIArI1BlBqNkJyzahKcRdhLhR8xTqDpysJvubABzPGv31UQf5GrXJHUp7hGSS7C/ ulP6wUJe6maz5nKB2mGywCSfVbcPXJVnnkDZsqBZAJmN33ZmRoB776qNAV5x6cpxBE7Onb C0IE5X85VoV/vyv8oC5BmN/+UrYES/w2rLUBDp5pfwEvfoBHf+zB6BpW4jcPZxR6oVxy+e gLkrjyQIDhUqWKZiXxyHuDj2hfm5phodVH1DCt2iZxWzZQeJnOz9VSrAFQhhVScgBRwkrG vq37a/vRKJSf5x/jNX1l9eQzIqGdfX+CRtJhouJ7Vv3bgSfALhS2ZYybiZI3iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737338365; a=rsa-sha256; cv=none; b=qcm0hY1G9RS6vUoD0AwX9GP6U2LgGv/2WsmdO31yEaBUNcAQDYScdgSUqLfS9ZHGrYwLbF eooOV3nupYd0b7BeZVSnSsWGcjedxuI2OAPcxItOtwDAvw8JBY45mkFPrdh/0LidBsjE8t v5HRyEJ5+LbSc3xBZtHKVfNsfBHDnFqQaxuTyaJHP/0aCYPSzm+cGWluGnOQWksOOS8QXt SuPjijaeLylUSxYdYR8BzendoBCPO+hOwmW9QqCqmJ7pEnbCHIs1wm/qBq4/1W8U/SJrE2 ZRumqI5VUP6kCgmLuMxpTt+bQJgbqk2nvUsXMf+ag9lmadHLdAWX1Isv8MpnMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybtn904zhz1FPf; Mon, 20 Jan 2025 01:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K1xOtc085864; Mon, 20 Jan 2025 01:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K1xOHO085861; Mon, 20 Jan 2025 01:59:24 GMT (envelope-from git) Date: Mon, 20 Jan 2025 01:59:24 GMT Message-Id: <202501200159.50K1xOHO085861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6404a5a7fe13 - stable/14 - genl.1: Improve grammar List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 6404a5a7fe1341c641c29299bdf7bf43e9d7094e Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6404a5a7fe1341c641c29299bdf7bf43e9d7094e commit 6404a5a7fe1341c641c29299bdf7bf43e9d7094e Author: Cy Schubert AuthorDate: 2025-01-17 04:18:24 +0000 Commit: Cy Schubert CommitDate: 2025-01-20 01:59:16 +0000 genl.1: Improve grammar Make the first sentence read more smoothly. (cherry picked from commit 13d81ef632ec6ca5e6936ab77e8ac67a8c430033) --- usr.bin/genl/genl.1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/genl/genl.1 b/usr.bin/genl/genl.1 index af0c6360ad83..5a32d69dd482 100644 --- a/usr.bin/genl/genl.1 +++ b/usr.bin/genl/genl.1 @@ -40,8 +40,7 @@ .Sh DESCRIPTION The .Nm -utility is design to provide access to the user to generic netlink -protocols. +utility provides user access to generic netlink protocols. .Pp The following commands are available: .Bl -tag -width indent From nobody Mon Jan 20 02:40: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 4Ybvhh2DVXz5k6Y8; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhh1XNNz3pMG; Mon, 20 Jan 2025 02:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=671cz/R2LJnV1lPdzrfNGoP2GQe1KQDsu6S8KCuukN4=; b=A3tViV00eiuVWk5eMtHB+zoKUrfDnQ6ktd1dtxRyFHYbBNQj63If3zYAuxOkPHZ89MLnt3 zEeRGtd1UC1alt2GktKb/O4Co48NbX9WNWbGIrcgl75kd0CwEmPJLTW5xN+OVD3iX35fFf SPiU7oRREwpVSV4gsAxFHaMlzpYdMBUQHZ5sONTwNmx0nlzosageV6NfqYdjiQULxkPREA kMfsu9uGy/vh+53v9ECFOMQ3FaRNFS7lhTacwOzfbPSR97F4PMU3UBf5QPsNLVleOrG43W HusLLtUU/nyJqa3QV+j0kaju0NjJgRNDSw+j0r4khQ4+ggx9S/J7pvKAgbi+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=671cz/R2LJnV1lPdzrfNGoP2GQe1KQDsu6S8KCuukN4=; b=xzJQZ3F/0Zh6omP0TlwEB1nkc9y+YOssExSsNa0/bWNPWuBjc956VjIF0knTk7iecgqMWo QQlxzny7nzUhncxz8CsVhOo+Gphz8viQFlGcb0gysBTfDQBnmPW5jMQloCIRFPA1bYMAqr MEWuFctl68ODbc48rtma2teFTkAmS+UCHT0PaCR2S5MlHxaXLp1ycUwVMSA2sJ0zY6ayws p6oQvpygR95zNrtVNxayeQYIKMjbtAXPSfuZsSe5F7Q8wOYWjrZnwvGo4N2sJH4ce2gBZV YV0990JKU0+9CkGUaTc4KB/x0jSj4F49/qWJDVZW0Igy2pdCHcgoY+Ti77A8mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340836; a=rsa-sha256; cv=none; b=Y8OYvbZpiHVBStXoRfDwaCT9m/1YePkZz8+J7Uqn1x6YX2lbrMjK4hihawv4bZvI3CX3CF NRu/KuWPb/ETPWrPxbRKJyNhAPaatV/VyGarhIUAv8gtfsXzp0YQviMQ6EUMrA1WfjuqvZ prL9eZn3Hlf8AyIh6p8jWUbkTWVj8i9KkcrnLSTC57Y99bqUMN2BoceGNEY8D6z9bWkmwz XwWPsHYTVpaMyk9peWRgxuICNqkWBc4QmRvXJP8OpaPkJFBsLO3imaatf7gdcpuHa6Nn8F 9bHy0yCcH9yERGG6NEwq5fpGSt35mVYomAxTYai5XhbuIY8kGRJ1FcQvDHRfeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhh0sW8z1GJC; Mon, 20 Jan 2025 02:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2eaDq069485; Mon, 20 Jan 2025 02:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2eanF069482; Mon, 20 Jan 2025 02:40:36 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:36 GMT Message-Id: <202501200240.50K2eanF069482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 97eaa1218f77 - stable/14 - ffs_blkpref_ufsX(): do not iterate over startcg twice List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 97eaa1218f7752556801105899620954a8f98bc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=97eaa1218f7752556801105899620954a8f98bc3 commit 97eaa1218f7752556801105899620954a8f98bc3 Author: Konstantin Belousov AuthorDate: 2025-01-05 23:00:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 ffs_blkpref_ufsX(): do not iterate over startcg twice (cherry picked from commit a57a2c01aacc5e2a29fa33d50aecc516e37cecd0) --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 690df0c12793..d08a51264fdb 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1498,7 +1498,7 @@ ffs_blkpref_ufs1(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); @@ -1610,7 +1610,7 @@ ffs_blkpref_ufs2(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); From nobody Mon Jan 20 02:40: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 4Ybvhj3JVbz5k6pb; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhj28qNz3p13; Mon, 20 Jan 2025 02:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xLLwKh+1QMyrDSwPpftDcmXMUVKloqqAjK6KQvDh31A=; b=aPHrlF4fGS17XsgoXTeh8q/GuHIsek5Z+kZ1RjQ/Ke0oLiEwTz9LgnFEh03MeKeK+VBsV0 39H0NmYYFxa/b9eCdXIUcapm9L5yI+TMYhcsmBnFBuUI+rOleTeM2kNnyLM8UsnBcwUmZn nTVlmoTsKO0hfkl+vQ3GW98vSN3GeB8TYND8tj26MGlpx8WeY6N6Amt2HmOxgO89ZR92F3 ueagsJEjbidbkgZZjbsdX20v6u4fKVMyY23WJg1ifBFUyQ7CWhXQjF4rWiA6Hlma6WY4qK Bm+bYc/aEV13TvlmXCff3yNMBa/hTS0eLfyG/YsmHmocM5s03U4JV1Jrl/pQ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xLLwKh+1QMyrDSwPpftDcmXMUVKloqqAjK6KQvDh31A=; b=UsVE45LVMV464hGXE1J0eqNw9fxUnkbDpBBKYcGnBf2If0ypyprF/Qo26+0fUMkp1RL8G0 QVWgqnyUZMm3NOGoql0nRFsezYNGCJaBD6jwyXa4vEafB/60+QuJBKGP2zOkX2O6d5YTgk RTitUH5QROI7vx0/H5jSdWlZzm9KA33ymlXBxmDt9ZcWyHEyswxhPCRnpfxWsYDlJ7agVO 4TqKDwwrAXByKdRG6jpKhI8iWZDR4Ip69suy+J0hIdQlx++E3nvdI3iev6LvS61DVNayaX dH9Il/vnPESYTdTDNw7XgR/Go0ttH5UcvZuAKv+oTftLXxHieiwJcmyqsXy+MA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340837; a=rsa-sha256; cv=none; b=WDCPvndWq3BxuR53LaGh5VcIkjGswo/BHIKbtcsOeGND5BjP8Fn5h7DNB6+lWEBIKkDE2A aomdZse5AImtDczDnx0hkJR+kngZHoobfm4NurSUpxTnfJGW96BCgRCi3TsAubXeMybkDD W0yvBpLahlFC21tjWx1bv6PAokrieEJDCCR2PUK6GOFnyGjeLiFscGm06POnAkepi5pIoM 3DZK02kQRoJzD3eBI+oowC+Qw2C98WOs7CKpOrPkCArsjIS1AE9i52C/ef20Fklnkn7hSz U+hoSZD8EzsIKoDA0qr0ea9zlYBeRJGJdWuL8fljBYbAl+12NBMO5AI5DRIVXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhj1Prmz1Fxj; Mon, 20 Jan 2025 02:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2ebFv069541; Mon, 20 Jan 2025 02:40:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2eb44069534; Mon, 20 Jan 2025 02:40:37 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:37 GMT Message-Id: <202501200240.50K2eb44069534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6149261d549b - stable/14 - ffs_reallocblks(): ensure that pref cg is valid List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 6149261d549b3b5072fe69b498f26e8172de1623 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6149261d549b3b5072fe69b498f26e8172de1623 commit 6149261d549b3b5072fe69b498f26e8172de1623 Author: Konstantin Belousov AuthorDate: 2025-01-05 22:51:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 ffs_reallocblks(): ensure that pref cg is valid (cherry picked from commit dc37121d3210d08c96a883ebfed780660e7e2b39) --- sys/ufs/ffs/ffs_alloc.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index d08a51264fdb..b586ab8e126a 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -683,6 +683,7 @@ ffs_reallocblks_ufs1( * groups that we will search. */ cg = dtog(fs, pref); + MPASS(cg < fs->fs_ncg); for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) break; @@ -949,6 +950,7 @@ ffs_reallocblks_ufs2( * groups that we will search. */ cg = dtog(fs, pref); + MPASS(cg < fs->fs_ncg); for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) break; @@ -1440,8 +1442,11 @@ ffs_blkpref_ufs1(struct inode *ip, * place it immediately following the last direct block. */ if (indx == -1 && lbn < UFS_NDADDR + NINDIR(fs) && - ip->i_din1->di_db[UFS_NDADDR - 1] != 0) + ip->i_din1->di_db[UFS_NDADDR - 1] != 0) { pref = ip->i_din1->di_db[UFS_NDADDR - 1] + fs->fs_frag; + if (dtog(fs, pref) >= fs->fs_ncg) + pref = 0; + } return (pref); } /* @@ -1452,8 +1457,11 @@ ffs_blkpref_ufs1(struct inode *ip, if (lbn == UFS_NDADDR) { pref = ip->i_din1->di_ib[0]; if (pref != 0 && pref >= cgdata(fs, inocg) && - pref < cgbase(fs, inocg + 1)) + pref < cgbase(fs, inocg + 1)) { + if (dtog(fs, pref + fs->fs_frag) >= fs->fs_ncg) + return (0); return (pref + fs->fs_frag); + } } /* * If we are at the beginning of a file, or we have already allocated @@ -1508,6 +1516,8 @@ ffs_blkpref_ufs1(struct inode *ip, /* * Otherwise, we just always try to lay things out contiguously. */ + if (dtog(fs, prevbn + fs->fs_frag) >= fs->fs_ncg) + return (0); return (prevbn + fs->fs_frag); } @@ -1552,8 +1562,11 @@ ffs_blkpref_ufs2(struct inode *ip, * place it immediately following the last direct block. */ if (indx == -1 && lbn < UFS_NDADDR + NINDIR(fs) && - ip->i_din2->di_db[UFS_NDADDR - 1] != 0) + ip->i_din2->di_db[UFS_NDADDR - 1] != 0) { pref = ip->i_din2->di_db[UFS_NDADDR - 1] + fs->fs_frag; + if (dtog(fs, pref) >= fs->fs_ncg) + pref = 0; + } return (pref); } /* @@ -1564,8 +1577,11 @@ ffs_blkpref_ufs2(struct inode *ip, if (lbn == UFS_NDADDR) { pref = ip->i_din2->di_ib[0]; if (pref != 0 && pref >= cgdata(fs, inocg) && - pref < cgbase(fs, inocg + 1)) + pref < cgbase(fs, inocg + 1)) { + if (dtog(fs, pref + fs->fs_frag) >= fs->fs_ncg) + return (0); return (pref + fs->fs_frag); + } } /* * If we are at the beginning of a file, or we have already allocated @@ -1620,6 +1636,8 @@ ffs_blkpref_ufs2(struct inode *ip, /* * Otherwise, we just always try to lay things out contiguously. */ + if (dtog(fs, prevbn + fs->fs_frag) >= fs->fs_ncg) + return (0); return (prevbn + fs->fs_frag); } @@ -1970,6 +1988,7 @@ ffs_clusteralloc(struct inode *ip, ump = ITOUMP(ip); fs = ump->um_fs; + MPASS(cg < fs->fs_ncg); if (fs->fs_maxcluster[cg] < len) return (0); UFS_UNLOCK(ump); From nobody Mon Jan 20 02:40: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 4Ybvhm0c5sz5k6dB; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhk5Fx4z3pPr; Mon, 20 Jan 2025 02:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbDCCV8ICSUrdrvLxgX7T2pZLZlIYxVPyygrlSc8O7c=; b=wTRXMN7U4PIpLkvmkc51wv3l6jP/ELxKdg6ylw9HcU1Ro5zKqksRNpBE4kjxH2ocdMUaBB W0+OUQaE0ipIlUMLMEmJZDN6uBEmiZE7mqXcoFi8fMZzpzLp0Rfsny3GzNDan5yBFw53lZ QYSNwcAiap8hFshobfT7zP17sSjG918tznPK9eKJxbXt22e2zXTtatgbm4dUFLSOGOL3Ky EE1c4uVWYgpNAb1JIFafx79roFO3Gy9AGnJ2j3sJ6XN4+JVa8CqmDD/a2ycT5FJzW6pMNA JjcfTaH22QjYNoWV4AuPyJfQmxptgwFXkskduFNhuUxpMH2mDW4PM2IHi9/3fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbDCCV8ICSUrdrvLxgX7T2pZLZlIYxVPyygrlSc8O7c=; b=a7GYXsIzwIrgx/TsmSEpF5lKpH9TTRcjunS+bkrDi1uNDnMmJ91m2cbQ6hBXIIFvIXlOE8 s/vWLmU/HUBcb19nl9ZSXwMye0uRtQCo6wmEUj++md/OWWYr+BByTN6aGmE4on8ioMNgQe Gzq/4yus/CXmPQ7q6Tka9+DDQb57Ff8yRIgDv5UT6+7aUrDiwP+s0iepv4RdCf0LV+ZyCG LQcQ561R5okInhaELOL8A4A2UzJT1kcoFvTM+K4x7Z87Pl6G+r+ES4FIhrG2JIMTtRFQw0 azWZQ8elfHFuHCtgj2hzuDPmeUt0wKoZLk0O5dSoa+/XkINIMudnmU/m7Usbzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340838; a=rsa-sha256; cv=none; b=XC1c3ieUH4CA7PKML8E8Db9ZQFPgWMWNnfvyvGZb2/S12XJyiEmnAo1dV8IlbFjemka6Cs E/NTxNke3n4FKSeUierJL0CXKy2UA3jYkqE+Ry0LY6fFsm7kBj+flXwxoiJWirhzjrb2LY 7aU78O9Fk8ZSnU8KD3u120A9J3Cbt0OtI4LB6ZsPDtZ7Y8+hN3xib3gyV1qJm8VyqO0J4y tgoxF9aH51Bvlq5v16dqXPrIxaPtQx4NEn3RdjkNvch/kpMh1+07u+Ne0T8Mm8mu9norWR r4RRq2OushDPevWlUA63OlUHZfXBXpEKrHmV2llO0g+1r5F2sdqWZMWkbUylUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhk1mlBz1Fxk; Mon, 20 Jan 2025 02:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2ecAV071038; Mon, 20 Jan 2025 02:40:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2ecB3071024; Mon, 20 Jan 2025 02:40:38 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:38 GMT Message-Id: <202501200240.50K2ecB3071024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6e9b6e5dbb84 - stable/14 - mb_unmapped_to_ext(): return error code on error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 6e9b6e5dbb84c0c44930448b7da169a6a351d670 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6e9b6e5dbb84c0c44930448b7da169a6a351d670 commit 6e9b6e5dbb84c0c44930448b7da169a6a351d670 Author: Konstantin Belousov AuthorDate: 2024-12-28 08:30:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 mb_unmapped_to_ext(): return error code on error (cherry picked from commit cf322978d73a3ed4958cb64cc4f1b47ceb53a03e) --- sys/kern/kern_mbuf.c | 41 +++++++++++++++++++++++++++-------------- sys/sys/mbuf.h | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 002e508e91cc..0a9cb72222c2 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -936,8 +936,8 @@ mb_unmapped_free_mext(struct mbuf *m) mb_free_extpg(old_m); } -static struct mbuf * -_mb_unmapped_to_ext(struct mbuf *m) +static int +_mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres) { struct mbuf *m_new, *top, *prev, *mref; struct sf_buf *sf; @@ -947,9 +947,15 @@ _mb_unmapped_to_ext(struct mbuf *m) u_int ref_inc = 0; M_ASSERTEXTPG(m); + + if (m->m_epg_tls != NULL) { + /* can't convert TLS mbuf */ + m_freem(m); + *mres = NULL; + return (EINVAL); + } + len = m->m_len; - KASSERT(m->m_epg_tls == NULL, ("%s: can't convert TLS mbuf %p", - __func__, m)); /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -1047,7 +1053,8 @@ _mb_unmapped_to_ext(struct mbuf *m) atomic_add_int(refcnt, ref_inc); } m_free(m); - return (top); + *mres = top; + return (0); fail: if (ref_inc != 0) { @@ -1064,13 +1071,15 @@ fail: } m_free(m); m_freem(top); - return (NULL); + *mres = NULL; + return (ENOMEM); } -struct mbuf * -mb_unmapped_to_ext(struct mbuf *top) +int +mb_unmapped_to_ext(struct mbuf *top, struct mbuf **mres) { - struct mbuf *m, *next, *prev = NULL; + struct mbuf *m, *m1, *next, *prev = NULL; + int error; prev = NULL; for (m = top; m != NULL; m = next) { @@ -1086,12 +1095,15 @@ mb_unmapped_to_ext(struct mbuf *top) */ prev->m_next = NULL; } - m = _mb_unmapped_to_ext(m); - if (m == NULL) { - m_freem(top); + error = _mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (top != m) + m_free(top); m_freem(next); - return (NULL); + *mres = NULL; + return (error); } + m = m1; if (prev == NULL) { top = m; } else { @@ -1110,7 +1122,8 @@ mb_unmapped_to_ext(struct mbuf *top) prev = m; } } - return (top); + *mres = top; + return (0); } /* diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index f7925da795cd..941c907e903b 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -814,7 +814,7 @@ struct mbuf *mb_alloc_ext_plus_pages(int, int); struct mbuf *mb_mapped_to_unmapped(struct mbuf *, int, int, int, struct mbuf **); int mb_unmapped_compress(struct mbuf *m); -struct mbuf *mb_unmapped_to_ext(struct mbuf *m); +int mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres); void mb_free_notready(struct mbuf *m, int count); void m_adj(struct mbuf *, int); void m_adj_decap(struct mbuf *, int); From nobody Mon Jan 20 02:40: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 4Ybvhm0q6jz5k6gp; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhl2xq4z3nxl; Mon, 20 Jan 2025 02:40:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYy2IYqzEJmmUcaxePEGUMZGo2aAvnfIyUfXE15uLvg=; b=PywFhIpwf7Wjv0ogQ92wHULMRLoqRlT4vrCqODPTkmy+E/8sopPahBFnAQHk2hJziMwst4 yWdM3kuijsMh1NPo53wKIMmMQLQ+WoGHljZsYCPD/M+iMbk5vDvnqAFsNtW789xWQUW1b/ 5N6A8fyCdvq320eVHDFa/EKhC+KgzWmgRy5tFq6JJvxuNIu18JusgKgLxea3/72nDOYz/Z kWwtjmd9gMKjFuzhJEUKCVpI8X8qtgkvsqLsXmcrXVv1UhWkzvz6tOTI5Bh1+mpDoOQogD qbebsX7+NPakrUtWYDP8PZ6yKq0HgjjKHgZxP9toKN2IfbpUDGdLlthhHFIdOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYy2IYqzEJmmUcaxePEGUMZGo2aAvnfIyUfXE15uLvg=; b=jh0VgToyy70rkvOpFCWl9/w4hyt8k6qz+vaQ2SRpftszYPDQdGlQAsPJAmTZBsPO6lazGX f3TApZFunSnK9S7Fx9/1SUYs42ItnwH4248wcEnc6FyeZIlR/yppo2uO3dKCOqZKMGOsas +WtDSwNcixqDbSv5tUxEwXbyM0AgGCviA4NnP9ec8OSSXPSJY7LotWPF1nIzlhNu0Fq3HT eoFI5RFiLo+tPUq8vQlABtgJ5nXsLha+5F2LiyD+AbE3UA7jKi2Z33WeNPhWW541cBJnxu I6XnJKnw7jat8TpyHiuBUn1dmDKo7+Z7dAs4VAO9cWLPb3D/WBnyhK/pFtzJTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340839; a=rsa-sha256; cv=none; b=UuDecUMZal3ZJw6CjyNRVAE2/iCQmMLTzIhbXdSmaoABbgS+flL3HpYd1VUY/TfRf13Scz zq+Qddfr5gPIhfzQ0EOTM88y/rCPglM0ICk5mx6Sg9apxE8gov1Ss3b1TMUI7zwU1akLvb NOFHBybEiOcinnGWz/3iROlempAML3kAvcZjniQQ2+wBNGZlqYb2xjg1G+kysyhKM4DJZt 4nv4DZJBc/j3nqpxaDkZgNArKE6Lhuwf5EmzeMUgl+VvaFmKO+vRMaA+qMi0EVDywjMKiT j0AAVF76CPZEQIecA8WQ+0c2dwCfmXGamWWeQ06pWBohXoLZSmbgxWcCmXElsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhl2XYPz1Fxm; Mon, 20 Jan 2025 02:40:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2ediF072343; Mon, 20 Jan 2025 02:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2ed1v072328; Mon, 20 Jan 2025 02:40:39 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:39 GMT Message-Id: <202501200240.50K2ed1v072328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c968d55123fa - stable/14 - ipsec + ktls: cannot coexists List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: c968d55123faf55a26d769847b603330eb51f67c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c968d55123faf55a26d769847b603330eb51f67c commit c968d55123faf55a26d769847b603330eb51f67c Author: Konstantin Belousov AuthorDate: 2024-12-28 08:30:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 ipsec + ktls: cannot coexists (cherry picked from commit b0e020764aae970545357b0f146dcba7b4b55864) --- sys/netinet/ip_output.c | 33 +++++++++++++++++++++++++-------- sys/netinet6/ip6_output.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index bcd4ed4c94c9..892a54eb628d 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -669,17 +669,25 @@ again: sendit: #if defined(IPSEC) || defined(IPSEC_SUPPORT) if (IPSEC_ENABLED(ipv4)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSTAT_INC(ips_odropped); - error = ENOBUFS; - goto bad; + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == ENOMEM) { + IPSTAT_INC(ips_odropped); + error = ENOBUFS; + goto bad; + } + /* XXXKIB */ + goto no_ipsec; } + m = m1; if ((error = IPSEC_OUTPUT(ipv4, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } +no_ipsec:; } /* * Check if there was a route for this packet; return error if not. @@ -733,11 +741,20 @@ sendit: /* Ensure the packet data is mapped if the interface requires it. */ if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if_printf(ifp, "TLS packet\n"); + /* XXXKIB */ + } else if (error == ENOMEM) { + error = ENOBUFS; + } IPSTAT_INC(ips_odropped); - error = ENOBUFS; goto bad; + } else { + m = m1; } } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 3c0e7f37b74f..d98d7c5aa928 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -459,17 +459,25 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, * XXX: need scope argument. */ if (IPSEC_ENABLED(ipv6)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IP6STAT_INC(ip6s_odropped); - error = ENOBUFS; - goto bad; + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == ENOMEM) { + IP6STAT_INC(ip6s_odropped); + error = ENOBUFS; + goto bad; + } + /* XXXKIB */ + goto no_ipsec; } + m = m1; if ((error = IPSEC_OUTPUT(ipv6, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } +no_ipsec:; } #endif /* IPSEC */ @@ -1102,10 +1110,20 @@ passout: /* Ensure the packet data is mapped if the interface requires it. */ if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if_printf(ifp, "TLS packet\n"); + /* XXXKIB */ + } else if (error == ENOMEM) { + error = ENOBUFS; + } IP6STAT_INC(ip6s_odropped); - return (ENOBUFS); + return (error); + } else { + m = m1; } } From nobody Mon Jan 20 10:15: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 4Yc5ng3C0Nz5l7n8; Mon, 20 Jan 2025 10:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc5ng2Nynz3kMk; Mon, 20 Jan 2025 10:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737368135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vyP3Rw8szAR7AfRy1I0y0ISgbZ1uGo5X9Smbjbocj84=; b=m8Ikmy5otqWd+a8bC5dxJ6azvuUEx3NNa8YKuLT1wQGWxhWFTJIa9ybu5uDwaKeu+h/fgy zuvWhOimc+H4S+ghSdVo1Ko4cewPtg4iABtPzoOBnMJ3W++BnVRUJA006Jswjdutf6jic9 2jl4vFShOYN7aEoFsrY4PHvqdvNHY1ylqBjY/FSyTdiGCAEfQlppkQnF4tifczaQBulpZm Sm+b7tpm9mUhqCneizHT2+4Jug35WzSlPJnRTvkbb0r+Mk2TRD4FY3qP8WZyVtt6OLLhGf LsH78eyItMLu2dcluIrT9rwA2Z3EvzTMcLFXu1r2oujRYHzJ7wxHc5czwDdEyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737368135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vyP3Rw8szAR7AfRy1I0y0ISgbZ1uGo5X9Smbjbocj84=; b=r9uWDZsiOCTTQceV/0Ic4pVc19+CuMnildLmB60RidiGmBqomycgHsoDWd4ot8uigLCH0J Kh2WKjb37Othsy06qH5mMLq/N5/mh2uKZoRKMXvtqVoVAnSGNlu+EmJpDf/bEXyWyvjQHo 8J/n98TsCd3jSeo0+Dl1laYvfW6CN6aKrfmCHC7gasnrmhCg5hx8ANRthQ7T2lhakO2e+s 6Hq4bm2gaP28FL8N/cMDfwqZvZOyvdfvpxK/bhQ3tOR5EEKuVwSDIqur7xyo2b1Pq9fo54 Czs5r2XnUoOUM8B4VkREpdY6ZUgkZ3bLZkVNaFAaMBmCcjG77dkRqZdFvztr+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737368135; a=rsa-sha256; cv=none; b=BJnTwS3WqFVbMn2HpEzcFCIozAB7wiJ8iYbEoQZBIgQtNveLzhqZcw+JLfpopZuveehUN7 c6Jgpi0DT+/zR40IFtI+7eSaSiKkUh3XyLPRFuybUmsfq3B0QoibprxnuKgSQ2r3S4iE8a 3x5m6oPmLT9bfglLH/wVEgsx/MT/mZ6jL2vWAECw0a6beN0DdpJ7R34Tn8D7pefRrspxQE mUIVX/QkwIDL94vZo7nluYoGCV+BDyTTj0gGFtem/Up6U5qXfso2VhNIPLCDFR2Aa4kJEp O8bWsMK3FNUqSCWKoFK1I097wYRxGx9+7+RodUBzsV7yyHA0jqPzSlKuTzjShQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc5ng1z6Dz1TB; Mon, 20 Jan 2025 10:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KAFZRB019356; Mon, 20 Jan 2025 10:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KAFZot019353; Mon, 20 Jan 2025 10:15:35 GMT (envelope-from git) Date: Mon, 20 Jan 2025 10:15:35 GMT Message-Id: <202501201015.50KAFZot019353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 5094faf5dfa8 - stable/14 - pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5094faf5dfa860f238f636457563bc0d89013c7a Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5094faf5dfa860f238f636457563bc0d89013c7a commit 5094faf5dfa860f238f636457563bc0d89013c7a Author: Zhenlei Huang AuthorDate: 2025-01-15 04:32:31 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 10:14:43 +0000 pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit This driver prefers connection speed over sas port speed. On stable/13 branch the stack-allocated CCB is not cleared thus the cam layer may report weird speed on boot. ``` da0: Fixed Direct Access SPC-4 SCSI device da0: 4294967.295MB/s transfers ``` -current and stable/14 have the change [1] which clears stack-allocated CCB thus are not affected, but I want -current and stable/14 to have this fix in to reduce drift between branches. 1. ec5325dbca62 cam: make sure to clear even more CCBs allocated on the stack Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48438 (cherry picked from commit 7befd68335a0b34405b6293f30cc47cabc46ab06) --- sys/dev/vmware/pvscsi/pvscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/vmware/pvscsi/pvscsi.c b/sys/dev/vmware/pvscsi/pvscsi.c index 74c515c9fca0..c8b79485efc7 100644 --- a/sys/dev/vmware/pvscsi/pvscsi.c +++ b/sys/dev/vmware/pvscsi/pvscsi.c @@ -1445,6 +1445,10 @@ finish_ccb: cts->proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB; cts->proto_specific.scsi.valid = CTS_SCSI_VALID_TQ; + /* Prefer connection speed over sas port speed */ + cts->xport_specific.sas.valid &= ~CTS_SAS_VALID_SPEED; + cts->xport_specific.sas.bitrate = 0; + ccb_h->status = CAM_REQ_CMP; xpt_done(ccb); } break; From nobody Mon Jan 20 12:42: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 4Yc92r2FsYz5lJ9q; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92r11VPz3v7G; Mon, 20 Jan 2025 12:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWCf11Jw/Pdnu4fDwho2PclPPZlM2qSfZkagDMLUMHE=; b=sq3tRJH/vkyw2XonOh6CZeirAuZkd3rj590VjPygVe5nzhs8e9mRZu62C/+b3Tmvtk4TM1 QLMxP2y6sEZGjYgNm4cPBZphaYGplqjBiK1RsRYBd/ZE2AGPu+AizhUj28ypdZwA4zpzRA kPPJIZjxlGxDzufWm9DF44I3xjZh9qhaGKrnOuQPoyByZVT1oPHMgIGXRAf88iXCfV3wLY 7KUWypD4zkMXJh5CWWgobLPjbFfUycfOthG1sR/RmfOVgM6CMk1Ce0cdSwJZw1Sn9+iint wcePejAKAWAM0OghSArOloYEYMPm1mTKkhMiVK2jcvQkNQ1dxk/DOydOGToSEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWCf11Jw/Pdnu4fDwho2PclPPZlM2qSfZkagDMLUMHE=; b=bWAFrUb2TtaQpX94xd+RTVBWq3K1ImhFY177n9FidK3Wiuf2E8Uy3lLuLbkWA4JZU7/8Ij BRkAfDY0sbCB2zpr2ZLTnNIQKPNLxmP1M/9wkuckMn450uYIKZaHQvP0wDKXfpd0Qsi8v0 uH+TfWw1oVdStjYZMLLmEMAecI0MivOCgDqO0alTPTGPxQaI17LQWrSrRBx02jGUtBD9Hr 3hHFrNXPp2KIoYaPw2H/RiXQvztLFKznTuFGTGuv8w7Db7NWlaJbLJL4Giref5GSy79Hol fsWVjSzITJY6OhktAmqtRyp6hFGC88ZVeyOYzfv7e2jOU3tQQVBys4S2DwShOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376932; a=rsa-sha256; cv=none; b=mVuwP6daaq28/zCA4PABnW+ALETd1zSZzGBOoFruI0e4H4e00tWSVtYLuvIfPtfXC1ICYX 1z5B9KVCpIHBLEGPk+HjRd1/T0mVJlq3NGpl94Y7r17fK7HDlL0ErEKrlxGxn1e1fGn5Vr FD8sg116dy5doh7FViUJnvvLG5fdrCzuzvX1gF4DlYZ0ncK6YHUZQkBPB2CySSTvdrLLA6 LS7XmLto/0gmd1cNyoCZ8fseFA21Q/bPkIKcQDx5BfbcVvsyFzkBfC/t1XV8cYNBHlrhht EoUhNjB+BHycgjb+hkKuGbkUFk5exQ1PK7PVHzN7YWJUh5DSyDQVjJu9WcIcjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92r0Z7rz5kr; Mon, 20 Jan 2025 12:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgC1j098381; Mon, 20 Jan 2025 12:42:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgCtq098378; Mon, 20 Jan 2025 12:42:12 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:12 GMT Message-Id: <202501201242.50KCgCtq098378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 25695358d03b - stable/13 - pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25695358d03b4c60344df5b7dead04085350448d Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=25695358d03b4c60344df5b7dead04085350448d commit 25695358d03b4c60344df5b7dead04085350448d Author: Zhenlei Huang AuthorDate: 2025-01-15 04:32:31 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:26 +0000 pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit This driver prefers connection speed over sas port speed. On stable/13 branch the stack-allocated CCB is not cleared thus the cam layer may report weird speed on boot. ``` da0: Fixed Direct Access SPC-4 SCSI device da0: 4294967.295MB/s transfers ``` -current and stable/14 have the change [1] which clears stack-allocated CCB thus are not affected, but I want -current and stable/14 to have this fix in to reduce drift between branches. 1. ec5325dbca62 cam: make sure to clear even more CCBs allocated on the stack Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48438 (cherry picked from commit 7befd68335a0b34405b6293f30cc47cabc46ab06) (cherry picked from commit 5094faf5dfa860f238f636457563bc0d89013c7a) --- sys/dev/vmware/pvscsi/pvscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/vmware/pvscsi/pvscsi.c b/sys/dev/vmware/pvscsi/pvscsi.c index b3be2280eb5e..e850f6d8dae3 100644 --- a/sys/dev/vmware/pvscsi/pvscsi.c +++ b/sys/dev/vmware/pvscsi/pvscsi.c @@ -1445,6 +1445,10 @@ finish_ccb: cts->proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB; cts->proto_specific.scsi.valid = CTS_SCSI_VALID_TQ; + /* Prefer connection speed over sas port speed */ + cts->xport_specific.sas.valid &= ~CTS_SAS_VALID_SPEED; + cts->xport_specific.sas.bitrate = 0; + ccb_h->status = CAM_REQ_CMP; xpt_done(ccb); } break; From nobody Mon Jan 20 12:42: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 4Yc92s2dfGz5lHyV; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92s1kb5z3v9G; Mon, 20 Jan 2025 12:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7iNAy7GZpDHyRKUQcnXHNTljW3UCbAasIVxnTIgcaP4=; b=B4w3sQ71s97uhxKrdTfhZw9Cus2a/axGMKEwfkYtt5ES23UtHIYEqSWFn3UiTYTeb6Zkd+ 4seFGnhVJ2fcncFEG926Z/jS2MDgj8miP0it+VvkHsLLihfPGPT30NzpX5+Jhb1OYOmyVA lz+R5lANNdfsyW7mr4FVPcAlXEuY6AqAsEA4itRjvP6ZNIwsYsHzRMJhgW04kRp0tqAEuP H7oTbn1rZi5fnhoPLy+UnL+WA8V/BtjS/Zs0ESqI8/5jJ3ngUNJIFmrDa17ZqE3AjoftyR fFiYCvuZrDaabKJWLNpVWFsJ/KLqTzCXAjpTaHFOVuK/xmClxym7D/35rSkkzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7iNAy7GZpDHyRKUQcnXHNTljW3UCbAasIVxnTIgcaP4=; b=fcx/21EnrF5JMomv2btI6WzQ6YR2LluC+hUePgFs7Y+8ivZDwIFZxVuXkAUryv9K1c3fba CLofx34r9xN2uFhtndRXhb/E4TcmrMd2lGi1YEkEHj/m9rO0hPdyJULZhSGvlHbFYiTnO2 Rp6VJbGDN7Bihxv8kbhH4P5EOdFuADqbkRx/VhRQmIBCVRE4+vtk6vdjrtdwL71145PSRF irUKTobNzWk5L28oDahYrwInOjsXg3DmVygQN8mWNSMgvQ7FfHcf96OcTCllq4n795UqS6 uwSemXl8kU5Be6Be6tlqAi0jS36jD7Fhh1xKsdyYoz2usrCeErGXRPalHMghCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376933; a=rsa-sha256; cv=none; b=Ph0k1/LwJPGqWsLEZntF+fjgZ4VCQgGbVbwSgRjwkz5bRjO34VVaN96VBFH3R9GwXKTpHj RQWSJH/vyMLoL/FOwM+/nbAUH4PGSldiuSAkmq539WVhp+RWQES9KGnRpAVlmxIgnkSq+W worqSwdXaEaocWYGI45eueovDxTO60eLzjU2ugDhywRckILQ15Rm3YuxHRxLe64koVsiP1 2Hfc3KNhknEEGZOn7bY+Le/yUFziKoUBMu8pHDuuiFDwOFcTgf6TQ1tBxgS0qLOrlWkeAJ Im0uAkO75C0qd+v9rV9m3w4NYo5QkRr9fAy3QL9uJ1fiLDQefIJyP4AolmYv/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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92s1GW8z5dl; Mon, 20 Jan 2025 12:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgDre098413; Mon, 20 Jan 2025 12:42:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgDFm098410; Mon, 20 Jan 2025 12:42:13 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:13 GMT Message-Id: <202501201242.50KCgDFm098410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 23b90ad00a2a - stable/13 - cam: make sure to clear CCBs allocated on the stack List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 23b90ad00a2a00e4c4fa25b996de79266ae152a6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=23b90ad00a2a00e4c4fa25b996de79266ae152a6 commit 23b90ad00a2a00e4c4fa25b996de79266ae152a6 Author: Edward Tomasz Napierala AuthorDate: 2021-03-30 18:15:11 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:26 +0000 cam: make sure to clear CCBs allocated on the stack This is required for small CCBs support, where we need to track whether the CCB was allocated from an UMA zone or not. There are no (intended) functional changes with the current source. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D29484 (cherry picked from commit 076686fe0703b906a05c9869609dd550bd4ed7ac) --- sys/cam/cam_periph.c | 6 ++++++ sys/cam/cam_xpt.c | 5 +++++ sys/cam/scsi/scsi_da.c | 3 +++ sys/cam/scsi/scsi_xpt.c | 7 +++++++ 4 files changed, 21 insertions(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 21abebc416ae..f609e198921a 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -760,6 +760,7 @@ camperiphfree(struct cam_periph *periph) union ccb ccb; void *arg; + memset(&ccb, 0, sizeof(ccb)); switch (periph->deferred_ac) { case AC_FOUND_DEVICE: ccb.ccb_h.func_code = XPT_GDEV_TYPE; @@ -1333,6 +1334,7 @@ cam_freeze_devq(struct cam_path *path) struct ccb_hdr ccb_h; CAM_DEBUG(path, CAM_DEBUG_TRACE, ("cam_freeze_devq\n")); + memset(&ccb_h, 0, sizeof(ccb_h)); xpt_setup_ccb(&ccb_h, path, /*priority*/1); ccb_h.func_code = XPT_NOOP; ccb_h.flags = CAM_DEV_QFREEZE; @@ -1348,6 +1350,7 @@ cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("cam_release_devq(%u, %u, %u, %d)\n", relsim_flags, openings, arg, getcount_only)); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.ccb_h.flags = getcount_only ? CAM_DEV_QFREEZE : 0; @@ -1472,6 +1475,7 @@ cam_periph_bus_settle(struct cam_periph *periph, u_int bus_settle) { struct ccb_getdevstats cgds; + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgds.ccb_h.func_code = XPT_GDEV_STATS; xpt_action((union ccb *)&cgds); @@ -1543,6 +1547,7 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, * First off, find out what the current * transaction counts are. */ + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL); @@ -1661,6 +1666,7 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **orig, /* * Grab the inquiry data for this device. */ + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 391a5b8ae2a2..25679c705741 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -495,6 +495,7 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread * * This is an immediate CCB, so it's okay to * allocate it on the stack. */ + memset(&ccb, 0, sizeof(ccb)); /* * Create a path using the bus, target, and lun the @@ -2546,6 +2547,7 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) return (1); + memset(&cgd, 0, sizeof(cgd)); xpt_compile_path(&path, NULL, device->target->bus->path_id, @@ -5024,6 +5026,7 @@ xpt_start_tags(struct cam_path *path) sim->max_tagged_dev_openings); xpt_dev_ccbq_resize(path, newopenings); xpt_async(AC_GETDEV_CHANGED, path, NULL); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; @@ -5049,6 +5052,7 @@ xpt_stop_tags(struct cam_path *path) device->inq_flags &= ~SID_CmdQue; xpt_dev_ccbq_resize(path, sim->max_dev_openings); xpt_async(AC_GETDEV_CHANGED, path, NULL); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; @@ -5206,6 +5210,7 @@ xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg, xptpath = 1; } + memset(&csa, 0, sizeof(csa)); xpt_setup_ccb(&csa.ccb_h, path, CAM_PRIORITY_NORMAL); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = event; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 5782d414bd42..2161e3340ff6 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4888,6 +4888,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) /*timeout*/0, /*getcount_only*/0); + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; @@ -6133,6 +6134,7 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, * up with something that will make this a bootable * device. */ + memset(&ccg, 0, sizeof(ccg)); xpt_setup_ccb(&ccg.ccb_h, periph->path, CAM_PRIORITY_NORMAL); ccg.ccb_h.func_code = XPT_CALC_GEOMETRY; ccg.block_size = dp->secsize; @@ -6170,6 +6172,7 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, min(sizeof(softc->rcaplong), rcap_len)) != 0)) { struct ccb_dev_advinfo cdai; + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_RCAPLONG; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 512d4ad6823a..37d8333e21a8 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1046,6 +1046,7 @@ proberequestdefaultnegotiation(struct cam_periph *periph) { struct ccb_trans_settings cts; + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; @@ -2299,6 +2300,7 @@ scsi_scan_lun(struct cam_periph *periph, struct cam_path *path, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("scsi_scan_lun\n")); + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -2425,6 +2427,7 @@ scsi_devise_transport(struct cam_path *path) struct scsi_inquiry_data *inq_buf; /* Get transport information from the SIM */ + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -2485,6 +2488,7 @@ scsi_devise_transport(struct cam_path *path) */ /* Tell the controller what we think */ + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -2747,6 +2751,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path * Perform sanity checking against what the * controller and device can do. */ + memset(&cur_cts, 0, sizeof(cur_cts)); xpt_setup_ccb(&cur_cts.ccb_h, path, CAM_PRIORITY_NONE); cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cur_cts.type = cts->type; @@ -2930,6 +2935,7 @@ scsi_toggle_tags(struct cam_path *path) && (dev->inq_flags & (SID_Sync|SID_WBus16|SID_WBus32)) != 0)) { struct ccb_trans_settings cts; + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.protocol = PROTO_SCSI; cts.protocol_version = PROTO_VERSION_UNSPECIFIED; @@ -3037,6 +3043,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int *speed, u_int *freq, stru return; /* Ask the SIM for its base transfer speed */ + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); From nobody Mon Jan 20 12:42: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 4Yc92v1mZqz5lHyY; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92t3Zyxz3vZB; Mon, 20 Jan 2025 12:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8BwJys7RU9qyHqxlWN3v/xISBFRKRzj1MhCf/AIXf8=; b=LVaSBN5YvxQNKXCy+gfpF35p4uFOq4FPGObAfGtHRp1k4HgcNZ93HDksT0pWkQ0Bv+xWnX YZamHTwa3S6xChKzBcG3ZJ0oiZ4FDImHc6gXJ39NWmRh28f8ZXhWvdGuQYSPVSB4trzx4A hDSvekBCIkHPP0uGiCItY8py2pgv7zRo7emlciFWTVbBvKqL6QdNvKmP2DmlLx5+xLh4f8 7r8romgik1xwCpT57M1Kw+MmO889pc47Uav6YfNyeGrwwSb514QoebkY29kOy4SI384n6v Ku4NZAKXLZUxNFUtIHu8KkPBh77wN9MHgO/xuLtNvwR2xHpJ6I0JLIOVYhrY6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8BwJys7RU9qyHqxlWN3v/xISBFRKRzj1MhCf/AIXf8=; b=bVhVUpTPPzC37jgZ/Kim4bg/SQrg5WmrPkLbt+VF4QvedZnZYSyLY53MvkzvglWkDYLe+w cyy92JHXbaJx/9Rqk5BHffiPynyFdGQwrlUEjuFTCH7Q7uren8sjFE1qOtOSurMvDqOmc8 QaeCfFDt6osn4YsZYNbohXmwq0fMCL60v97Xc2r9mYqCrpCHgiy5ViPArNksiHJHfkaYqh CicB6LEyccFAg2R1gg2dGoKUZYkIkBHho9UW3i8Y/GNDFYgFRLRK4b8KoQYUlOuag7iCRv k6nwnsk/vTcI4a3nQcPwgRF5H0S5s19rSIRWtKIttyhHc0I9Y6PU6o+XJNzInw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376934; a=rsa-sha256; cv=none; b=gs/wsll+Ef2og++Nzwe3pJMGVp7YCK6myOGy9j2XQ3gcP/hlilSGELjVk+h1jO/yovobDK sZb1uowQBw3W8mu89eW5hbva7+XOE2OHeSfULaVp94/Oljvn1n6FKqAqVuK4U3dYMvnULh nwXXVPQDbT6NJMUWA6zJ6BO4MLy4pTF+KEVfNfVBZ/cmIoAbC578ITRO2eJzIUrWcMx9dM pcBJc6HneUSMj1aoWfbrGf8Cdmak2MVtpuMhhAkbqCL+HCIoFGf5VFuKXMLivnGU23SLSJ wUn05bbvcnQ5vuIWVRkP8Csj5BgzPcCvYy4E8h9KPf1xCaq18XAX/3mBHzD66w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92t2JPGz4yK; Mon, 20 Jan 2025 12:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgE5k098445; Mon, 20 Jan 2025 12:42:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgEvt098442; Mon, 20 Jan 2025 12:42:14 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:14 GMT Message-Id: <202501201242.50KCgEvt098442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ee2a1bc81a17 - stable/13 - cam: make sure to clear even more CCBs allocated on the stack List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee2a1bc81a1782f197053c53cf84b4933e545e47 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ee2a1bc81a1782f197053c53cf84b4933e545e47 commit ee2a1bc81a1782f197053c53cf84b4933e545e47 Author: Edward Tomasz Napierala AuthorDate: 2021-04-10 10:25:22 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:26 +0000 cam: make sure to clear even more CCBs allocated on the stack This is my second pass, this time over all of CAM except for the SCSI target bits. There should be no functional changes. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D29549 (cherry picked from commit ec5325dbca629d65179f14f68bbcdb9c014f1523) --- sys/cam/ata/ata_da.c | 2 ++ sys/cam/ata/ata_xpt.c | 3 +++ sys/cam/mmc/mmc_da.c | 1 + sys/cam/mmc/mmc_xpt.c | 1 + sys/cam/nvme/nvme_xpt.c | 2 ++ sys/cam/scsi/scsi_cd.c | 1 + sys/cam/scsi/scsi_enc_ses.c | 3 +++ sys/cam/scsi/scsi_sa.c | 2 ++ sys/cam/scsi/scsi_xpt.c | 2 ++ 9 files changed, 17 insertions(+) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 4ad82e8e1fc0..38d8b45243bc 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1346,6 +1346,7 @@ adaasync(void *callback_arg, u_int32_t code, case AC_GETDEV_CHANGED: { softc = (struct ada_softc *)periph->softc; + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); @@ -1381,6 +1382,7 @@ adaasync(void *callback_arg, u_int32_t code, cam_periph_async(periph, code, path, arg); if (softc->state != ADA_STATE_NORMAL) break; + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 5c8f07dd5e9e..81e6269dfa0d 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -724,6 +724,7 @@ aproberequestdefaultnegotiation(struct cam_periph *periph) { struct ccb_trans_settings cts; + bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; @@ -1691,6 +1692,7 @@ ata_device_transport(struct cam_path *path) ata_version(ident_buf->version_major) : cpi.transport_version; /* Tell the controller what we think */ + bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -2126,6 +2128,7 @@ ata_announce_periph(struct cam_periph *periph) struct ccb_trans_settings cts; u_int speed, mb; + bzero(&cts, sizeof(cts)); _ata_announce_periph(periph, &cts, &speed); if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 18d686735082..81cbccb62693 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -693,6 +693,7 @@ sddaasync(void *callback_arg, u_int32_t code, case AC_GETDEV_CHANGED: { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("=> AC_GETDEV_CHANGED\n")); + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 127c24e31bf4..c957a1ef5e41 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -386,6 +386,7 @@ mmc_announce_periph(struct cam_periph *periph) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmc_announce_periph")); + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index ec4ffd4b33e7..e55bc09cf35d 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -631,6 +631,7 @@ nvme_device_transport(struct cam_path *path) path->device->protocol_version = cpi.protocol_version; /* Tell the controller what we think */ + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -792,6 +793,7 @@ nvme_announce_periph(struct cam_periph *periph) cam_periph_assert(periph, MA_OWNED); /* Ask the SIM for connection details */ + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index d5406dc76f6f..b964c59906d3 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -1257,6 +1257,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) status = done_ccb->ccb_h.status; + bzero(&cgd, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, CAM_PRIORITY_NORMAL); diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index df06a8a4c22e..ef71cfb1f0b4 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -980,6 +980,7 @@ ses_paths_iter(enc_softc_t *enc, enc_element_t *elm, != CAM_REQ_CMP) return; + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); @@ -1041,6 +1042,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element_t *elm, args = (ses_setphyspath_callback_args_t *)arg; old_physpath = malloc(MAXPATHLEN, M_SCSIENC, M_WAITOK|M_ZERO); xpt_path_lock(path); + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_PHYS_PATH; @@ -1101,6 +1103,7 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, * Assemble the components of the physical path starting with * the device ID of the enclosure itself. */ + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.flags = CDAI_FLAG_NONE; diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 2ac4edb48de2..9c596f5523d0 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -2552,6 +2552,7 @@ saregister(struct cam_periph *periph, void *arg) bzero(&ext_inq, sizeof(ext_inq)); + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; @@ -4728,6 +4729,7 @@ saextget(struct cdev *dev, struct cam_periph *periph, struct sbuf *sb, SASBADDVARSTR(sb, indent, periph->periph_name, %s, periph_name, strlen(periph->periph_name) + 1); SASBADDUINT(sb, indent, periph->unit_number, %u, unit_number); + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 37d8333e21a8..28d6445afac5 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2730,6 +2730,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path inq_data = &device->inq_data; scsi = &cts->proto_specific.scsi; + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -3086,6 +3087,7 @@ scsi_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) struct ccb_trans_settings cts; u_int speed, freq, mb; + memset(&cts, 0, sizeof(cts)); _scsi_announce_periph(periph, &speed, &freq, &cts); if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) return; From nobody Mon Jan 20 12:42: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 4Yc92v6cvJz5lHyZ; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92v45h8z3vg2; Mon, 20 Jan 2025 12:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0UdfaMQQAZSLqSIXrPKfcIEa/p07ZY+pkXhVPoENJc=; b=OvTTPrEb2KbWaNBHBOIGFzHXFKLK6sawNBaDIiwZBkvBk+0OH56WFKwetB4FDZbU1RBbms LRDX4mXfztNcZcZhSo9RMv8vvtQJYcpv0iQcP5CLtWEtpr7tRnwIxofztfI+0CVMWwG5Vq VGwmdMvIpGu5GkA83pNsomx3MtVITr1MuBguUJ2x13D0ldDCZuAfDDd9uBnAcNj4Dt5+AI Iy3QGwq5Az3IiD5OElXVYz8JBPaUQ4jioIgieWZYk05PABa70t/uK3KV1CbCDBZT3eoT/d Xowx5EDrPwJQPRLS50AOBVgjnx/aXOLgZTtE69qXk3znAIu4kAC0X9+t3NcInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0UdfaMQQAZSLqSIXrPKfcIEa/p07ZY+pkXhVPoENJc=; b=fRO5y+OaYABRrRIzwL+T2Sp9ioLjCfnHznkKIDdu/wUJpQbWTRyCsH8L6h7JVHGcaPfxpV 1Ko+aHzNmQDyUOcZhn+VaieB64ItNbwDHX9ZbNtNTTnnl5BQrAy1m57sm2zz2/LVUfL2hq e6SMTqZw37bnbg4efBAYuVy+BECszHWs2N0dAyxaTU5CbPRBBsmYMOmcXjBTDllf3g1mWf 8kzZvLi9eOzVQtPsdyvQan/yk3ncyCIeoyeutHa4ylHYBsJoXoFUvuOTu1z6/cbYiuOpk5 jIIxighzDfnWV2j6zkUZ92apR5CC+Aycspu8Ip+sfeUBeGThxsTOTumQFam1Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376935; a=rsa-sha256; cv=none; b=FWhpP5kuoh0pI8hFF0d+zo4by5jZe4eYSeSwjteEHMASgtmIaTZwMfE1phaQ6SnkYbEjjm IdDk7lvrJJ1H8VVLHZ8r5ngCvEI4sSqThqCKvexcK2E/JH09kL+giQ1s8SJ5tyQf7STCXC aQZdtEjSBswa51NOwMeu7au93DicBe7DCBgqC7153Fs5lVmMVAeAZxKscMEhtQy0E4pHTK 5jSnHq+h95FpkM1reP9v/IdUBqWfLaUOu0IcIXAVbWW343BbPQez5BJF8SbZ+uvk5jWqp1 l/4SUQH0knVtMRt6SlJyaCOLwGIxxNQ0hnEaqik2qIvyvGMM0WAY5rlRovaIyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92v3cv1z5dm; Mon, 20 Jan 2025 12:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgFC7098477; Mon, 20 Jan 2025 12:42:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgFBW098474; Mon, 20 Jan 2025 12:42:15 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:15 GMT Message-Id: <202501201242.50KCgFBW098474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: cdd9dd5ac768 - stable/13 - cam: add missing zeroing of a stack-allocated CCB. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdd9dd5ac768675c1e67b6aa33f8f1c0ae56534a Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd9dd5ac768675c1e67b6aa33f8f1c0ae56534a commit cdd9dd5ac768675c1e67b6aa33f8f1c0ae56534a Author: Edward Tomasz Napierala AuthorDate: 2021-05-16 09:28:04 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:27 +0000 cam: add missing zeroing of a stack-allocated CCB. This could cause a panic at boot. Reported By: Shawn Webb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 0f206cc91279e630ad9e733eb6e330b7dbe6c70e) --- sys/cam/ata/ata_xpt.c | 1 + sys/cam/scsi/scsi_xpt.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 81e6269dfa0d..c20c8626e395 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -2181,6 +2181,7 @@ ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) struct ccb_trans_settings cts; u_int speed, mb; + bzero(&cts, sizeof(cts)); _ata_announce_periph(periph, &cts, &speed); if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 28d6445afac5..3b3aaabf2968 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -3144,6 +3144,7 @@ scsi_announce_periph(struct cam_periph *periph) struct ccb_trans_settings cts; u_int speed, freq, mb; + memset(&cts, 0, sizeof(cts)); _scsi_announce_periph(periph, &speed, &freq, &cts); if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) return; From nobody Mon Jan 20 12:42: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 4Yc92w6FR8z5lJ9v; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92w4ZZdz3vd7; Mon, 20 Jan 2025 12:42:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PnhsoaDeTzCjpwTU0M1eSlclO57vS3Hz5B0BGDLG3LY=; b=pxDjdrua1nsfRJOJHvO1QkvUdIS5JtjVCVTxkG7TvWJ+C7M1tna/hMom7OTShFkfgXKQyo oX3TvcNdxzjEJjwLk3nbpaWlWfIHRMld5nTRgidNAo06456AZmNVU0M6I6T28rrw8lAChj Gj25Zzw71GVL7meQ3F8R0jv6qRVjq/r7SH6Ufz4JZGOYlju6mPWZmDH2cb3rwC3S98uWnK Shx903cv2Nt7a92CuZXtVs5Wo+s/E/rGXMbuqF7Rmy5W/sicQntpo1AxNVA6p+u//6+/Vc hyZVFthobzBBHDUtLTCNKnrWVSf/iikPV/MgSR8gg+T3I1lkhJwn8JRvpjd7PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PnhsoaDeTzCjpwTU0M1eSlclO57vS3Hz5B0BGDLG3LY=; b=yVaIVM27fNT7bn05gFws/Lu5fPsPZ0RIiIF6G/W6UOopteTF27QWBtPcFnYjoAIelS/8D8 vl1xjE0+0PTR0uGJYut4oTQkIY/LN183QUaG7OX9BiKaGWGFqgjJ0OXsmBsZwPbHZ6hf2Y 3dsTZCIQ9KFjb4KsNgrD9LRUGLK1DQQQTixy+fkHm05iQ4METN4BpyBt1OwcYfdnsSopf7 4GK1VIhDPyqPs2w24tgM819KRmhrRyw3GyOIG7iTemWgDQv9erxNPIWSb66yFGT60rU4YZ LQLn4zKz0Aq73Hq7yANayLplMbaqUdPuZrlldGZZ15sU1wAaiGn2e1IQhgJdXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376936; a=rsa-sha256; cv=none; b=BUAOxaf05oaBDuLsE7J22vzm6BjTtbHAYcKH+fQIyBIuh9jAJoGc7mEyDID9f7N4toOLnO qo9cUXqUqPHtjXlpC+GJDwksKY785h9m4uGmMfG9cmGFq3n0ES++1quw7L5ADubXvwE+7q 7WsaN+YDhf4jz6vV2OQGhrlQSeGlb0truqf8DEKqyCR2hoa26RXZV5XHQ+fykIE9EgR+sb Hsu3cDO+WkWzdvXL25HH70QzTqYtvdbVWhIRd7xPwcCy1O2eC10uJlnhn6hB3S5ZQLFXDw eDLgUKTPQ0oDd6wEE3DL798EEsqpXVREkpTCMCZ1MN6VP7ild0/RXl9fJCuDog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92w4BBdz5hH; Mon, 20 Jan 2025 12:42:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgG5Z098810; Mon, 20 Jan 2025 12:42:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgGT2098794; Mon, 20 Jan 2025 12:42:16 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:16 GMT Message-Id: <202501201242.50KCgGT2098794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: eeecaa064c8d - stable/13 - cam: clear stack-allocated CCB in the target layer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eeecaa064c8d4ba0f4a17739527ef285ee56fd36 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=eeecaa064c8d4ba0f4a17739527ef285ee56fd36 commit eeecaa064c8d4ba0f4a17739527ef285ee56fd36 Author: Edward Tomasz Napierala AuthorDate: 2021-07-21 09:18:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:27 +0000 cam: clear stack-allocated CCB in the target layer Note that, as pointed out by scottl@, this code should really look a bit different, in that the stack allocations should be replaced with dynamic allocation, and the periph creation should be moved to a context where one can use M_WAITOK. See the review for more details. For now let's go with a minimal fix until we're done with UMA CCBs. Reviewed By: mav, imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30298 (cherry picked from commit 616a676a0535eca78ce6b02a6226d0bcb69d7d4e) --- sys/cam/ctl/scsi_ctl.c | 3 +++ sys/cam/scsi/scsi_targ_bh.c | 7 +++++-- sys/cam/scsi/scsi_target.c | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c index 4bc7091337ca..d3a3e299a213 100644 --- a/sys/cam/ctl/scsi_ctl.c +++ b/sys/cam/ctl/scsi_ctl.c @@ -477,6 +477,7 @@ ctlferegister(struct cam_periph *periph, void *arg) /*getcount_only*/1); } + memset(&ccb, 0, sizeof(ccb)); xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); ccb.ccb_h.func_code = XPT_EN_LUN; ccb.cel.grp6_len = 0; @@ -611,6 +612,7 @@ ctlfeoninvalidate(struct cam_periph *periph) cam_status status; /* Abort all ATIOs and INOTs queued to SIM. */ + memset(&ccb, 0, sizeof(ccb)); xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); ccb.ccb_h.func_code = XPT_ABORT; LIST_FOREACH(hdr, &softc->atio_list, periph_links.le) { @@ -1850,6 +1852,7 @@ ctlfe_dump_queue(struct ctlfe_lun_softc *softc) struct ccb_getdevstats cgds; int num_items; + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgds.ccb_h.func_code = XPT_GDEV_STATS; xpt_action((union ccb *)&cgds); diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c index ae105ea03356..7b543763c521 100644 --- a/sys/cam/scsi/scsi_targ_bh.c +++ b/sys/cam/scsi/scsi_targ_bh.c @@ -239,6 +239,7 @@ targbhenlun(struct cam_periph *periph) if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) != 0) return (CAM_REQ_CMP); + memset(&immed_ccb, 0, sizeof(immed_ccb)); xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); immed_ccb.ccb_h.func_code = XPT_EN_LUN; @@ -265,7 +266,7 @@ targbhenlun(struct cam_periph *periph) struct ccb_accept_tio *atio; atio = (struct ccb_accept_tio*)malloc(sizeof(*atio), M_SCSIBH, - M_NOWAIT); + M_ZERO | M_NOWAIT); if (atio == NULL) { status = CAM_RESRC_UNAVAIL; break; @@ -307,7 +308,7 @@ targbhenlun(struct cam_periph *periph) struct ccb_immediate_notify *inot; inot = (struct ccb_immediate_notify*)malloc(sizeof(*inot), - M_SCSIBH, M_NOWAIT); + M_SCSIBH, M_ZERO | M_NOWAIT); if (inot == NULL) { status = CAM_RESRC_UNAVAIL; @@ -348,6 +349,8 @@ targbhdislun(struct cam_periph *periph) if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) == 0) return CAM_REQ_CMP; + memset(&ccb, 0, sizeof(ccb)); + /* XXX Block for Continue I/O completion */ /* Kill off all ACCECPT and IMMEDIATE CCBs */ diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index 4cb8024545e1..dcec777d1604 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -360,6 +360,7 @@ targendislun(struct cam_path *path, int enable, int grp6_len, int grp7_len) cam_status status; /* Tell the lun to begin answering selects */ + memset(&en_ccb, 0, sizeof(en_ccb)); xpt_setup_ccb(&en_ccb.ccb_h, path, CAM_PRIORITY_NORMAL); en_ccb.ccb_h.func_code = XPT_EN_LUN; /* Don't need support for any vendor specific commands */ @@ -933,7 +934,7 @@ targgetccb(struct targ_softc *softc, xpt_opcode type, int priority) int ccb_len; ccb_len = targccblen(type); - ccb = malloc(ccb_len, M_TARG, M_NOWAIT); + ccb = malloc(ccb_len, M_TARG, M_NOWAIT | M_ZERO); CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb)); if (ccb == NULL) { return (ccb); @@ -1030,6 +1031,7 @@ abort_all_pending(struct targ_softc *softc) * Then abort all pending CCBs. * targdone() will return the aborted CCB via user_ccb_queue */ + memset(&cab, 0, sizeof(cab)); xpt_setup_ccb(&cab.ccb_h, softc->path, CAM_PRIORITY_NORMAL); cab.ccb_h.func_code = XPT_ABORT; cab.ccb_h.status = CAM_REQ_CMP_ERR; From nobody Mon Jan 20 14:26: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 4YcCM53ztDz5lPKp; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCM53FpWz4869; Mon, 20 Jan 2025 14:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKW1DVsD3v5fnfy+XI1uscpY5akLQb/ME/jlLYRleC0=; b=lZensxFlzWSEXz+WaxTvG9911XKOiRMjkoUwk5f5L8/KIqLqFZAann3wsaP08EA8P13B6B cY8yQpIHgULsPl4TAlEtXHRhEroJvGJtEZtF0GtUpDbBRdUZ7bc/9AG9sJ0jT1jLXvDJaK HXD1mqeKn+UqtmuFO7nwxBKq2w+WPjK/fYz3YmQsfz5IWFym8O0jy/vGlBhaY1dtUG4X2r RqY/COU4y0pi91I9FLVNRwrO0VeKrjdIXN5Vr1Feye0kz8qPZ3qxtPZuq2oIRePd33KI4y VoGT0GlZUpMD0iSZAbyAZc2d9+6LAW/bBjvCRDVzmNrtItHKoxTgHYfdQ0Eo5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKW1DVsD3v5fnfy+XI1uscpY5akLQb/ME/jlLYRleC0=; b=U76BU/0joCJsxxLVMg2HnnPBEy9B9UohK12H4hCAbka7K2jxh8337e0cNAwAhUE43QP/w6 JSKJ7h1x6AnO9PXrpdBEw/4yKyst+NBlFKUynF/zve4f7fmrB8dXWZzSmLs3/pBiVsvcp6 2rWqSDvVn+OFGUaomee65SY1AlJNfHKo22z3w6DU48CLXX7oclUJAInQDrreJhHQMwbePT 3EvZ287S43kjvfj8090on1hNDiFAVrUKGLKro6YtJBk/1ONzq2hg3d0GhQKy6SbXxregNV KH1qjBk0nKIImM2TbQxJUKnG+2/hv4ro+dpFcPJdzimPeRR6vPpknabiqEoU2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383185; a=rsa-sha256; cv=none; b=Secavvy7aCv82ZJE2Wfx63BJU6nCNWABfvjEH9lDVn1+vYi69nty7mC13K80+tdNrmHPRC pgKr0GirdhHVrgesp2jxi84/XVOZMSANvmcpH+YEDYKiWclyLeb6aAx95j/qSJnWhXnFHm Qta/deOOrAEllmj8UTRnBPpW7peyS3Wb3TLuLp80eN9lcfe3NqWShrxbNK7P22a1QqCvVi TfCy0laXXo7KZsatCyt5jfcxtzVC3ZkmIbD1+VpytmZqPIP+sCYHnEuSBjzod3hHsqEDfd Orx0nQ4L5YbWjmZU4YZx+D29ue4VChNQC4NTCreuNngSSYgM95HOB5KfpTUW/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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCM52VH5z7Jw; Mon, 20 Jan 2025 14:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQPAi086989; Mon, 20 Jan 2025 14:26:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQPHj086986; Mon, 20 Jan 2025 14:26:25 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:25 GMT Message-Id: <202501201426.50KEQPHj086986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c4cae8cbc337 - stable/14 - libbsnmp: avoid division by zero with empty password List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: c4cae8cbc337eaf824774fcba88018e42fa31efa Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c4cae8cbc337eaf824774fcba88018e42fa31efa commit c4cae8cbc337eaf824774fcba88018e42fa31efa Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 (cherry picked from commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146) --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index ab3ac2d18e64..b312a37ed3ed 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1792,7 +1792,7 @@ snmp_discover_engine(char *passwd) if (snmp_client.user.auth_proto == SNMP_AUTH_NOAUTH) return (0); - if (passwd == NULL || + if (passwd == NULL || strlen(passwd) == 0 || snmp_passwd_to_keys(&snmp_client.user, passwd) != SNMP_CODE_OK || snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK) From nobody Mon Jan 20 14:26: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 4YcCM642Gjz5lPKq; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCM63CXYz48jP; Mon, 20 Jan 2025 14:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qnb+3m0uB0w968B1ENQBB5saPPYqASIAeYlnQvWXZ98=; b=bLQV0lo9CS4zlnIqK+7xYyNS27Ztbtw2ahtREt6s9YaiUQ7jGH0AfRFpHA0Siqe5fdk0Kd c17COTk4x7XA02ftXrI97LNBRJL3FtLJtKgvXzfxouA6KBq4Oe0NriPIVGjowU14WD9KND sSZtru+Eb6Xxy1JVgUaxTQlySPRrdo/ATaiXxZbKObTKMsyj7/Bnc25dvpxOHevr5UFUEj yJMSASuenVTfearSZO3y1Re8SsQkugW/heRgNGkludJcAsLGW1zxkCiy8szKWH1bUZ0CfH GcEjxnz7nFQ6KGXS+Fw/3x/MZB3Og/90FDr8tLPhT14848hoAlrozBzgTNDoow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qnb+3m0uB0w968B1ENQBB5saPPYqASIAeYlnQvWXZ98=; b=BK+XW0ARaGn4o45R9OqOpsVrn7R0bZYMMeLKdrpsXVpzqu2RyUmMYDnsb94zdjsMZQ47B5 Ma4KRdrxEl5x4P8C7EzJqdXAuzKGbLKZ1CvKbsYDpdFasGSK069QBBLOoxg2e2QW7OCFaD U6Nm2ocPKkAwQAd0yU3yag8ew1ZYf7v8Z3g/P1Y2yufNjgZhxNBa2Oi5PqQQbGfUi+/m3O 0q7RHGJcOo0imM3czJOAA+rLy2VapvXNFa/T2xjH4jRB4KDy7mSjH/3CxGkPTp+MopFX/P UgJt1PDw8i7bKRk1knUZLm6NIpvjjjxHurNDELnhLB6Oyiey4bTouPbM6Psjag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383186; a=rsa-sha256; cv=none; b=AV3W/7v+IQuC1jzG+BraAwwSeesy3Cwq5QfKHkdbyc1IxY7IM2hzQWvFrhnaLSN/mAWz+6 PojzVop1SOAOTznty/u6RTtnkZaGXLL1gZTDYlT469xQT3sX9/MxN5bQONZlPcGaOjLnBl sNNFLJ0yrefEM8EMKW9pVuXuylE5Hgyi7A02bqcjTRsLMiB4oWwZ86JY83eIodyXjgGw0p jIs5yr0iKB7yFVtyXlKJwKFBPxJlssswwEsWoFPP3hYbeQmGjYlzrwkNQmhhQs3wykIpkp vk7RHhv5nGLhU/r0BUkRvLRXeJX1mDKKT0G/Vu2znqXqu0k5HdWh5XmMeK5j1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCM62dlTz7sv; Mon, 20 Jan 2025 14:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQQfV087032; Mon, 20 Jan 2025 14:26:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQQbb087029; Mon, 20 Jan 2025 14:26:26 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:26 GMT Message-Id: <202501201426.50KEQQbb087029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0bfbd30663b6 - stable/14 - libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 0bfbd30663b68a851ebf24667d121c6891c86827 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0bfbd30663b68a851ebf24667d121c6891c86827 commit 0bfbd30663b68a851ebf24667d121c6891c86827 Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password The removed check left snmptoolctx->passwd pointer to uninitialized memory. Always calling strlcpy(3) would guarantee that with empty password it will point to empty string. Submitted by: markj PR: 283909 (cherry picked from commit 3999a860d6e899de98b1025317d2d0ef1f83255f) --- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index a9d44cee4364..fb09e1ac785e 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -178,8 +178,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) warn("malloc() failed"); return (-1); } - if (slen > 0) - strlcpy(snmptoolctx->passwd, str, slen + 1); + strlcpy(snmptoolctx->passwd, str, slen + 1); } return (0); From nobody Mon Jan 20 14:26: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 4YcCMd5vJvz5lPTM; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCMd5PlTz49g3; Mon, 20 Jan 2025 14:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsFhbBtDxAy97mjIw2FhdHhVgp02lrEurO9NqlwnXY0=; b=o/evr0ZueMWdOrkaZHy4QCTGvfRJL5rjGwAkS0D7h+mAWzvXqcSnRCZamYBemi1KBL5NQC yNo0gqp/1scuGyYGFspJBWK8WTnDDtvKmU9lRFuDppSyei27xD2Lr2VXH8q9iw79RwcnUZ yUXhTj+BOZAHyVW8bLQI6lgUlvEgdS3VtB4ggbqPwmwQKmRfCnJuvCjFVjiFLID7ra3HRD PZA4QBVquOO1blsTsDw91gdGjkKGLsNfMlUdhDZbX+YTV2ZsoSDvB6gjtzQxZhVkZqvR4N 18EdGwSVm/4wjmG5tZ6/Zly2gtbR6CRYjcrEOWhDcMOmZinosYLaIoyyNENp0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsFhbBtDxAy97mjIw2FhdHhVgp02lrEurO9NqlwnXY0=; b=bzMassnbruv2V6eOmzU6wXuIQszpWO9DU9wLkLwtMnIm7G9KuQd9d6lvKvVStaulJZL1jX EBP3cG4jiRXP5dNPDwX7sUt6HmKBunmsscPAsoufJhThl3nL/r0jtdu8naTNmdmNu6vwv5 cLZcvwETK1c7LIiGSnxdNe5dXfwL6/0chBgVObVnPz/CPF5Fwkq+mKRFmygNf+5bBKRjbo eceea5oavZFLEDuAtAtRotLQH7q57pBW/5TNS0eDJIgVeXu1+PH8beXSkMOHYdPP2mazus WyUbaqq9fds1HzQyiDurKkCWiThAXaMOTFuPI4Z1nsLbLnv7t+SXA2zfWU+xlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383213; a=rsa-sha256; cv=none; b=w39ApYWHKK4sL9CfForw8jkm3beUYK5feTfYbtkTWCpzf9b66kaFPkDYE8klYwgsZpD/gC VRNA2j3nJsbJvNm2N9KtCUn8SKZLiCzDMPmp7UW3Ag5+mxel1BdN6EI6iWGxyNYhk+CUPN j5rXGfc9cmOyqxiUIyQYtaVrh9d4Eyf4Dlk/IEcoBxvbWreZ8JuZ4kDHeMPisQJL/IyIrs jrqZlk8qC5R3ZD9jUOiWQ/OmTqxZrl18tRjUu9Nvvdib0qzZ0AMyApoVaqo6ja07NfIKh1 E+AAi1onUGmGbSu093ehCwWxzHBB2NjscurZffSS3GiOF17PDvwdfxJVWPaUdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCMd4jCnz8Hr; Mon, 20 Jan 2025 14:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQrdU087299; Mon, 20 Jan 2025 14:26:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQrab087296; Mon, 20 Jan 2025 14:26:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:53 GMT Message-Id: <202501201426.50KEQrab087296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 61c50909354a - stable/14 - munmap.2: Unaligned addresses do not return error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 61c50909354ace6f07d0b2113f10965f4546e0ed Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=61c50909354ace6f07d0b2113f10965f4546e0ed commit 61c50909354ace6f07d0b2113f10965f4546e0ed Author: Ed Maste AuthorDate: 2025-01-15 16:52:58 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 munmap.2: Unaligned addresses do not return error We previously claimed that non-page-aligned addresses would return EINVAL, but the address is in fact rounded down to the page boundary. Reported by: Harald Eilertsen Reviewed by: brooks Sponsored by: The FreeBSD Foundation Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()") Differential Revision: https://reviews.freebsd.org/D48465 (cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3) --- lib/libc/sys/munmap.2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index 8f5cb0c02e2b..cf8d9ec22b1c 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -25,9 +25,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)munmap.2 8.3 (Berkeley) 5/27/94 +.Dd January 15, 2025 .\" -.Dd June 22, 2017 .Dt MUNMAP 2 .Os .Sh NAME @@ -56,8 +55,6 @@ will fail if: .Bl -tag -width Er .It Bq Er EINVAL The -.Fa addr -argument was not page aligned, the .Fa len argument was zero or negative, or some part of the region being unmapped is outside the From nobody Mon Jan 20 14:26: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 4YcCMf74ZCz5lPZY; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCMf64f6z49jG; Mon, 20 Jan 2025 14:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tW7TgAty811m8Zgrk0CwPcNwbNp8647qmbC+CpNgO7s=; b=id96PcKFkUPs+H4RIY38lM2e9/ewASzFsRIPJQ9ImO0Q2MxM0pdO67uQY49wV8H1R76wzV DMomoUeMAkQknq8cJTlcawI6mQO+mzerR1gmRaNU3rt4Jz1NS+PNC7aDxPCtontH2/hOdW SSvu97PfGO52RBQi47kq7C6dv1aYAont4BGKdOwpxySX+DklM9NrNH2XVpLjuYBpVJev+x R6WBebaTxVrSPh8TToNnSvOksynX16n5YUCm8H73xaTRfDdmrRIaknHq/e5x0XHAmTwmx+ 0YzcA7iuRfPyq57okdV2mp33n3dfpNd7ODifvT7k+bVooKceVDeOYmMBNWMnIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tW7TgAty811m8Zgrk0CwPcNwbNp8647qmbC+CpNgO7s=; b=J6hFTw//No3lKPkMUKogaJVJwOPIpUkzZhZ6j2+BoTpfIxYO6xzjWvI3TKVPvUY8z06pc9 TIKW7sBdcEEMO3+EMQ5//2x5ZuiHbk+JuptzxbY97EIGhUPbWO4ufWEnV0WpYZAXEYMaRi /MfgnVhSObRUVA0IksKZtuyxdTnNq3VH5ZNx8wzvv2isQ7KCGeboqhqx0RysPiiU4ElWQp /3gUCB4zxthUwcNa4egParT/c3exkX29o8IU6beOJ3rCMoRSwPPwNntOuTxdm0SHCiJOY8 YPASDoMDXW+uCi+zadGGRQuBjevQ7rDmpNcOQ/D5Cf+GPeQpwa8ORU/ImKyMyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383214; a=rsa-sha256; cv=none; b=YFg6LDACTbVcNAe4hyNFHhhpTb9ME23y5/a9HTdFRFsJm6zk3TQr7JhPB/I648aiH2PWNd xZvOl6y3MIERp08vJSZ3yVs7cC2U6oCM2XLx2P0vbwCJCRnCqUuED7Ne9+xktvI4HcmR/k lmE70B2peUKZF4KBu0p88uOATptdQe7O5GSoYsR3UFaCow8CfM09vrGF7bpkUfVY717IBz M3Zchr4jvCEtJ01ZYDu15k7ntwtwtaZYgbIdhfDHtiSg2rKmFW0+lla0pRVgbB8h+wN+Xv UuICgRUmVLdQZhynNvZyAMQHQkpNeJeuVQwqmg+VBwwOlo9RUY8AIo1yKFNSHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCMf5dJtz8Hs; Mon, 20 Jan 2025 14:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQsH0087344; Mon, 20 Jan 2025 14:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQs1q087340; Mon, 20 Jan 2025 14:26:54 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:54 GMT Message-Id: <202501201426.50KEQs1q087340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e2cbfa1f5045 - stable/14 - munmap.2: Remove EINVAL for negative len List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: e2cbfa1f5045019d34eb0091db7755c151ea06d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e2cbfa1f5045019d34eb0091db7755c151ea06d5 commit e2cbfa1f5045019d34eb0091db7755c151ea06d5 Author: Ed Maste AuthorDate: 2025-01-15 21:44:31 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 munmap.2: Remove EINVAL for negative len len is unsigned (it is size_t), so cannot be negative. Sponsored by: The FreeBSD Foundation (cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1) --- lib/libc/sys/munmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index cf8d9ec22b1c..2411ccb3b0db 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -56,7 +56,7 @@ will fail if: .It Bq Er EINVAL The .Fa len -argument was zero or negative, or +argument was zero, or some part of the region being unmapped is outside the valid address range for a process. .El From nobody Mon Jan 20 14:29: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 4YcCQF2C7zz5lQ0s; Mon, 20 Jan 2025 14:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCQF1k9Fz4B7k; Mon, 20 Jan 2025 14:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOaT/dUWZo1h66DLcHsjMQqmlmv3cVUXLjiw6U4XBZs=; b=ONE1BkJKKZnCzyr692ZEWcDiXC5TAX/8ATmuBh1Xe9i5LzMt6r19wafH0rN1zQiqIL+37e r2mVf1j/6gwJY8E5Y46sO9ETqnF+t6s3rdYxPTFMx4QIk3uxR20PwyQAhDRa5a8J/liTSo /sWCKqRvL+zDsjI6dWao/seSVyI4QzSWXCWg48X7r67zX6b7ZYVX7GJKUCUv/5XGMSZ+f2 96DDRdIkDf9laQHePKgjjB4JxqFs7OzwfwEzk+/F/hd4iT31VgP5X5ragN9aoVueNJSEAD QYiD2Nw/F/w5iXUOt55t1EnRVTG/XG44zoRgkfOs+LwsLq0LKWaYQ7jOwb63+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOaT/dUWZo1h66DLcHsjMQqmlmv3cVUXLjiw6U4XBZs=; b=JcnzdmfKaeUJkrOSVQtZnX83cXor4ByUC/AE/MqEyNkulg1sr2AWZ/3k4kYWHLputjZvbP MZ1zIpPw4qHTbNerbesImyLVkgwN9bfKj+ejrhOH1iXO5l5p6flAnNjAyGTLh7ZrnTH8oq FkxFB0CT6qJFmxSbFF0dA6EI77MPc78Wqkh/Nob3fE2osN1g2vUT6KNAoShZiOr4Feh8cj +Y4oJkUzhHzm21o65E9jUhMholGxgYyf2OeVe4mcWyySAiYDEKVa5w8LxDjHmzI0LfA1qM 9KIpJfqa2XYHDvx6MG2VpK/alnHklYhzE/u1QD4KBAZ28TtiI27NQ9p5j6vO7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383349; a=rsa-sha256; cv=none; b=ToypiurD0Q4EqQFOSCdLGf/f2tInGdzkt4XoBykiA4gk4E7dshauIyeI/QQ14cF2l96Qmo T6oA1DSOoLNQSeUtrgywfJXD9mTnBroNHu6WWHcZSffl+j7IJimyf/aibKc4JEntFss81c hR35hwEs3xX53X15OXeFcXjzH4/6rB26DLgbUbvYEsLOpdmehsy3mrYkhcfsHlK4ef3/Q3 4pZkM8jXrZE3ZYCadI2SDPipK6B7QRmAs5QLqghFe4FqyaepNBvuPsSFEtGCr6BtybXJuS 5ISC6egH4NjfDn5l2T0vMFFghoBK6c2DU12krFLMkrMDg2woVWEcWHEGtkvScg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCQF1Bfgz7sy; Mon, 20 Jan 2025 14:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KET9tW088113; Mon, 20 Jan 2025 14:29:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KET92p088110; Mon, 20 Jan 2025 14:29:09 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:29:09 GMT Message-Id: <202501201429.50KET92p088110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d6fbd34acbbc - stable/13 - libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: d6fbd34acbbc90ae106fc1fa08d83d5f25d59039 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d6fbd34acbbc90ae106fc1fa08d83d5f25d59039 commit d6fbd34acbbc90ae106fc1fa08d83d5f25d59039 Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:28:54 +0000 libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password The removed check left snmptoolctx->passwd pointer to uninitialized memory. Always calling strlcpy(3) would guarantee that with empty password it will point to empty string. Submitted by: markj PR: 283909 (cherry picked from commit 3999a860d6e899de98b1025317d2d0ef1f83255f) (cherry picked from commit 0bfbd30663b68a851ebf24667d121c6891c86827) --- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index 373e91de06d3..e1339877e945 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -178,8 +178,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) warn("malloc() failed"); return (-1); } - if (slen > 0) - strlcpy(snmptoolctx->passwd, str, slen + 1); + strlcpy(snmptoolctx->passwd, str, slen + 1); } return (0); From nobody Mon Jan 20 14:29: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 4YcCQG3bMVz5lPLh; Mon, 20 Jan 2025 14:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCQG2S5Wz3Bmm; Mon, 20 Jan 2025 14:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZaxG+AOy3FgFYojRR2Icu2dvVGUA6g1+Hsb2YgnKm4=; b=Ml1Su8JZd49IgzL7sQtdTska+Fwhi2rlrh1Gv+yO3HUurm3ABM20Jmu7ieJPne2RhCX6rA 5Enq+k93yR750S6UKSwI2Fu5BPH4vyiw0nLCIUth8j49QhEq5BLr/yMrCpQotk2PLOHxFA Ck3FrM15Y6APy4mWzvgAVvzbwIeutVxMwtNjKHN2uvEREGl2OSE+sh1t18b3tEvqEYqLHd lUbFNHs1DqsaKIAOeZ998BeW676FYdTh+wUOYanfD94cM6ky/ecoHh95BcKuRN8jtpBSVx XgtrGVXypOhksEBwOcYKOJNYnIsSl7EZUY2eV/cUX7KlUziG5L7H7AX9LgM7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZaxG+AOy3FgFYojRR2Icu2dvVGUA6g1+Hsb2YgnKm4=; b=tIQUWdVLowF4/3j2sm20ZPbLVo84YV/BvHhlg6S8D13xSZQ3Uu2SZXw51NZhYFrYNIuKIo hFxxklrNnr3g9uSZlamoF4of4bMJVWj65Mr4zlywukFWoowiDxW0QFJX/tPH4IXtS/dKLa 23Hv4jDGnt/PUfr1JVzQqyh7mzeA/6jWnQ8QIn1FYqw2Lkq4uBZvXnSGFOR58nRyZWr4hI Q+t1JizV1DSasThP8zu8xDBkfSAxBpNyxSLs60IhT3nHZd5goqe3qfb44Bq4G3xYDjA7lk 1zZBHCU3XXiIL7txtODc7QdwVIfRPFpBEEf9SD4EDfRCMpKXgl5E1rOkouVxWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383350; a=rsa-sha256; cv=none; b=lmAZi7FGIyrduDHN0xPfYxeg2ralCTqaTd07Z525o1SOzi/dl/NrXMXxUOOvWl/I+gsXUC QdanFjf7TcAP+Iudq7Kgx2N6G4YbNlFFhr5V/ang1Et2LGYjU8qVQhDx5m0oYgQ7VVztVI Di7mYVlxVv6t50oJtajkHsoMQoejGKMBL5TZULRRWBwNpULtxCiIp9IgPXZ5YfXe2h9RQ/ cVm5um7+siNwVYvxKD2oAchthgarfH/I2zZvOAx51iCedSy0nthide2ivrIwt8VEslOczs sAXRNFsuf9KCy0iIDiz/wyqI3A7SAU4w+koYXp+HqnMYxF/YyBN7orCebYE7HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCQG1zNFz8Ls; Mon, 20 Jan 2025 14:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KETAHu088145; Mon, 20 Jan 2025 14:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KETAD3088142; Mon, 20 Jan 2025 14:29:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:29:10 GMT Message-Id: <202501201429.50KETAD3088142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8ed2e663712c - stable/13 - libbsnmp: avoid division by zero with empty password List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 8ed2e663712c3749b10af7968a646b9e81b6bcea Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed2e663712c3749b10af7968a646b9e81b6bcea commit 8ed2e663712c3749b10af7968a646b9e81b6bcea Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:28:54 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 (cherry picked from commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146) (cherry picked from commit c4cae8cbc337eaf824774fcba88018e42fa31efa) --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index 05711e341fd7..a7556527ad51 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1792,7 +1792,7 @@ snmp_discover_engine(char *passwd) if (snmp_client.user.auth_proto == SNMP_AUTH_NOAUTH) return (0); - if (passwd == NULL || + if (passwd == NULL || strlen(passwd) == 0 || snmp_passwd_to_keys(&snmp_client.user, passwd) != SNMP_CODE_OK || snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK) From nobody Mon Jan 20 14:30: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 4YcCSJ1qrgz5lPsD; Mon, 20 Jan 2025 14:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCSJ19Fkz3CNM; Mon, 20 Jan 2025 14:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YUpPC8TUDOBbQ9TrAr3Tty3EilHY1wzpTtCTs84L5v0=; b=TlRLm2Iw8f3SZ4ad+8YiRJarVW/13gBs34zGTpBrYG+cdoRNRJdspJQwwJRH6Vbp7zlO+v He0id7ev/nlTLtTJVNSQs1UzNUWQG3w+jtaqJFjSaYOGhJ2IyRZYXxMH1EzFmS1ZxHnPbi 7k6olKZEa0yifGVjXzxAdrQgy8ZWHnoB9WfuumnVYVFIXDNAXIwkyXfnneD441gbyLZwY3 WIBMjt95CvQlxLyVX0ooH9C6Sr28pizwH13Kcb2HF8eARhVqTgCltVLl2YXV7XfswCrfAh eMFnb84K/xZ0GwRH4XdEMVLk2zKc9s6/vMJ3AEbmjqpbv7a5cKLDMIeED9NoJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YUpPC8TUDOBbQ9TrAr3Tty3EilHY1wzpTtCTs84L5v0=; b=vFz5+Bh9PPlD0aWkNfpIZR+wxGNjxvqC0VvwbtMmQLSrqNWrx5Rsu8SKxfg15NpSE2SFJf MZFzQ76H46FkoCXL9yBPrTKV8x+KMDLVJbIyHoSqV/q4T2uIK3xAHwtcdahzI2gsipZbyJ /A0DBRmqU3g1bsAZhvUF5r4mXmkTLb9gvPVIC4RRCTR33m0Cfvk7mS22S+U473w7xK4j+m gL8jwKEA/GD9kWL2mVJLmoSO62dEFZYO5M3M6Ni3mlUP+iZS+drZUqIuYz9ZrguERpMLIF nZCidl+zWbKpRGe8MLJjvuqa5WhyWrGQiGaT4suhpCOFRZBlddwE4xFqGnl4Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383456; a=rsa-sha256; cv=none; b=b6KfGkWfGISSbtUtbkrDiXo9qB04gGUpg4937aW808ztnSajA+ofERNTaPuexYgmlwfUCO IBIwHQiaTPubOjJ71zHgUAZt6TgUIEeogbWVMNansxcVszCtqtQBKxp4mLBOoVA25Ceh4S 18E+xlvku9g9QF/RbOxe+/eDuQmyc+Qggvphgv8W8+UJzWwzlgEYGvwpP8jlV9ul5W+tXJ G0ol9DNRekb52ABYjxB6iBhl/mxcJ8AkuDURwnW6aEC/+OvM0xCHB8ojTdfZh7O72OfPUy CmFukJ0w3TGIqPUk96fQNCWzQJpnjiNJoTV/3zBFiQK7fTgzXZKIWXaz84gTZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCSJ0lP1z8Rl; Mon, 20 Jan 2025 14:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEUuXG002476; Mon, 20 Jan 2025 14:30:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEUuUP002473; Mon, 20 Jan 2025 14:30:56 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:30:56 GMT Message-Id: <202501201430.50KEUuUP002473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a52b922c05a4 - stable/13 - munmap.2: Unaligned addresses do not return error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: a52b922c05a46f594fa604e1af3f17f046aba955 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a52b922c05a46f594fa604e1af3f17f046aba955 commit a52b922c05a46f594fa604e1af3f17f046aba955 Author: Ed Maste AuthorDate: 2025-01-15 16:52:58 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:30:43 +0000 munmap.2: Unaligned addresses do not return error We previously claimed that non-page-aligned addresses would return EINVAL, but the address is in fact rounded down to the page boundary. Reported by: Harald Eilertsen Reviewed by: brooks Sponsored by: The FreeBSD Foundation Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()") Differential Revision: https://reviews.freebsd.org/D48465 (cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3) (cherry picked from commit 61c50909354ace6f07d0b2113f10965f4546e0ed) --- lib/libc/sys/munmap.2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index 8f5cb0c02e2b..cf8d9ec22b1c 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -25,9 +25,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)munmap.2 8.3 (Berkeley) 5/27/94 +.Dd January 15, 2025 .\" -.Dd June 22, 2017 .Dt MUNMAP 2 .Os .Sh NAME @@ -56,8 +55,6 @@ will fail if: .Bl -tag -width Er .It Bq Er EINVAL The -.Fa addr -argument was not page aligned, the .Fa len argument was zero or negative, or some part of the region being unmapped is outside the From nobody Mon Jan 20 14:30: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 4YcCSK2p5Jz5lPsF; Mon, 20 Jan 2025 14:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCSK23wbz3CSs; Mon, 20 Jan 2025 14:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qi2OaVI3TtfTlCIgqgo1PJ/h4cfWhyu6cc/mpp7CMc=; b=aWoqDeSGTLBCHptv0HnYnGHF+rFVHh+SK0cmTxqKUOMtLlchTgCEyWUyD6VbgBCqns05Rz HBbWyPy35nioY2YcIwU0DltbkXUzANwC0ZQDgvmck2ouPKN83ACAVvDP5RifDsY8Qs6OPF ija8PHR66UdONPz/C6uOj96FUQrxVcYI2y8yloTqOE3+ndmRWJu2GIjnXYujVR+cYu63PF MarrEbeXIUMaxVcMDt9tC6gP+Pn7YFePz+o/kRwqG1KmRXRC+9UaMarTBgi7Q/a5krPzik xNdvPwsx686uVl0cgDxsN0+VVdMzuTpGZMX5lnuCwYzWHUIG/pb377yQNFDBgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qi2OaVI3TtfTlCIgqgo1PJ/h4cfWhyu6cc/mpp7CMc=; b=FWUGDuJLWVUl4hy2Nw8+ckXgE7jAqeOLqcJzzH54H5hobu7AKcP/UneOwtPlFBt74QKliR 3CfKzHBD1rOVpo3x5cYUECtMdvo0QoXAgSahAMF2vGOEcOjGQ9TXPQ04cwVmx9z2sh+JkO H+nrnbhw/Xj8l50r4gvAwRBJmm5IkxXLg7q37eCoJ6tiM8jXpj/tgRwYJyoeYKcOf72SVW orgIfKORjrfLXFf7lffVgJRrWG25qbwyIIVucYasKBj4pCq47//DS8UkS6fHwrvKkadrMe da0jLxjJJfx9yeGEuD4OLQmmJL0wI3KHItiKylvA8c3fsJbuUwqufXwcFwl9Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383457; a=rsa-sha256; cv=none; b=FNr//JgkVR6Zi1bC2AzOA/JeLZQvAt+daE9g05T/9GVnUyB4qPrfFGPIB3ZzWxCJ+qIQhj maw0M7wLY8LK/W3sipvzSSeQaFL1eFo0T8N9UQ9kPCL/NxOHjfLCjWSuSAKFYYRkUml1OO hDcDcdrd5EetrpmEXkLfoHTBTqrnWAs8F3XR98eh10x+tY/rVG79VZKlLEB4sClNhMs9iN u0gwMGSoSZFHpoKJ3Y+i6w3QxQMTIbuvPvLvV/bKPotqWasUj6+KKMmYGyUGSr/qo/ERSN zR6C/XcxpDfvVYRaVri5Ep3+Pmqch9xj9zYgvCZIVUloplsAhavr0IpRao0oJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCSK1gy6z8PM; Mon, 20 Jan 2025 14:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEUvkr002513; Mon, 20 Jan 2025 14:30:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEUvh7002510; Mon, 20 Jan 2025 14:30:57 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:30:57 GMT Message-Id: <202501201430.50KEUvh7002510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8883e8de0559 - stable/13 - munmap.2: Remove EINVAL for negative len List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 8883e8de05598e475d2ac129dfefd734e06908ab Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8883e8de05598e475d2ac129dfefd734e06908ab commit 8883e8de05598e475d2ac129dfefd734e06908ab Author: Ed Maste AuthorDate: 2025-01-15 21:44:31 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:30:43 +0000 munmap.2: Remove EINVAL for negative len len is unsigned (it is size_t), so cannot be negative. Sponsored by: The FreeBSD Foundation (cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1) (cherry picked from commit e2cbfa1f5045019d34eb0091db7755c151ea06d5) --- lib/libc/sys/munmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index cf8d9ec22b1c..2411ccb3b0db 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -56,7 +56,7 @@ will fail if: .It Bq Er EINVAL The .Fa len -argument was zero or negative, or +argument was zero, or some part of the region being unmapped is outside the valid address range for a process. .El From nobody Mon Jan 20 16:20: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 4YcFtx0zGbz5kK4c; Mon, 20 Jan 2025 16:20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFtx0DF1z3RRv; Mon, 20 Jan 2025 16:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AhUoAeVj0tuBXalptBZU9X2jFfcQmwEo/J4FJ6mG0so=; b=J7x9hXCoN8TYspCfwu5obrQU7m6eh5K/6NfEJOLdxjU6tkCVvDDqkQUOrIguYxUJN2+nr9 hpKA9XmZ5rRHSijF4LCV+UAZzfqbpoGEh6sjiADm28MBORW+bQjpnFh6xHzZjCtyOdrUnW /ZYb9CJ+cggjuj222SvBb7IVffQbnNDnpGMBjJfa/VxpAYR5IsGI450CU9AQ78VGiU5rtd uFGj4OR/U7g9gIAl4Ih6wZVvP9OnvnNUTavRJfO3PPgWwjOYJcBvOrcCm2slBSmYpEuEvA BsCCcCOktCOwBP/0FYW2e/Pmr3QTpf+ksSqB/XL90kdj96pbt0X/+aHG5Ts4cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AhUoAeVj0tuBXalptBZU9X2jFfcQmwEo/J4FJ6mG0so=; b=iglXSmGHGgWC+rTODnsQ+JMM8fXl5EDKjRIR2BmbSXtaoe2KogZmxbYOqhWkLhrB+2EEhE RhmSuyEm2DCLVDcfN3m7v21zx0kwLKl1vtYWjeAfeFRc1gOlyGkL7E3S6EqfnX5rEYYwP5 ED0lBhyIakSyMc0OJquVPd++QDZPivroq3HxvP7s+jKwtindyYHFbTEWrvx6W/gSR5vko9 NwNuRWGZYWQGIS7fOfiwA/UI1YVRME8RYR+Q3gbksO5RMjRDW9ShO0ehIqPJISE4IBPsI6 S0EUU4SuiYmX52IdPKkWrX/IBFB9F2ELfUTi8phqX2C4D25XwgUde1pe8VmoDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390041; a=rsa-sha256; cv=none; b=aUkATB2j8koUIPWY0SFX3B7X6XcpVmg7jBr+qqTed3kYpTOglnoyBhKGguXnY1YQA/jOr3 O7Ke6GyHU32xlpDJU7Bn1fkTUXS/WJJSNRo013TT+g6zO+BsQREGPQFyZupogHDfCJsNNP 8Lu9dPDFMEytOL4y7jmAW+JXlaxk38hAc5MzjGMLgdwv4aJrkvOY1HL19nofoC7Fd80MPz lCl9rKetBL5NiY6kJTT8moUziatRVN2hNPPD7WXMXQ4SaMGx6lAyxf2zMMrD0SS1ejjfT1 zr5vZsglurz22reGJ8LwGFj4tMxwrdu2CJdy8DMTnNYNadAlDQ6tdfbVBRpGKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFtw6xcXzC4M; Mon, 20 Jan 2025 16:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGKeNE003691; Mon, 20 Jan 2025 16:20:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGKeiC003686; Mon, 20 Jan 2025 16:20:40 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:20:40 GMT Message-Id: <202501201620.50KGKeiC003686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 4ea15740a873 - stable/14 - tmpfs: remove duplicate flags check in tmpfs_rmdir List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ea15740a87314302dcb79d48b9280be199b0173 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea15740a87314302dcb79d48b9280be199b0173 commit 4ea15740a87314302dcb79d48b9280be199b0173 Author: Claudiu AuthorDate: 2024-10-13 20:00:42 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:20:20 +0000 tmpfs: remove duplicate flags check in tmpfs_rmdir Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D47100 (cherry picked from commit ec22e705c266ff629cc5ec47b84f67ba02b7b924) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 729feb0329a4..a42ada6a5469 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1327,6 +1327,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) goto out; } + /* Check flags to see if we are allowed to remove the directory. */ if ((dnode->tn_flags & APPEND) || (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND))) { error = EPERM; @@ -1344,13 +1345,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_nameptr, v->a_cnp->cn_namelen)); - /* Check flags to see if we are allowed to remove the directory. */ - if ((dnode->tn_flags & APPEND) != 0 || - (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { - error = EPERM; - goto out; - } - /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); if (v->a_cnp->cn_flags & DOWHITEOUT) From nobody Mon Jan 20 16:22: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 4YcFxR2NGKz5kKX2; Mon, 20 Jan 2025 16:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFxR1cFJz3RnZ; Mon, 20 Jan 2025 16:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QNViSTRw19HDifaYvLn0Fcb7UnjG7RTGfdCCCwVUPU=; b=PEJgIN++gE7N7Zj/cJ3kqo48qMRftPa4DCgopUheZgO5d2Tzr4vKBweRnpqmF5g2Usfmv/ bSxtcZ1DWvPA5LPypVzokJ55UTBanWpXCYlRV03xv8mhzZH8++oTFd9QLh1xRlWDBvR7TG 4AX9oaVuhXsfug8MOsvur1jA2X/2oIaH1jQsq6HzoQpq0AZ7R3BUJHoWmei3QugSkw7rjj iHC5ofKPEn1CU5ENOe+u24rPCFNqEYdWIRR+zWW2r6MR3Uw0DxlnpQBNosV7AvdFFGeo9m BC0hWO5rV+34g2tZbm5SHdozjgeTQqUFiQDsF8Rfy8uyFQukDDoUCivNR7ndgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QNViSTRw19HDifaYvLn0Fcb7UnjG7RTGfdCCCwVUPU=; b=kG1MT75pgjrZfAn2gIbckjO/BAGZHcfH2xA/T2+RioVDHIZwQtwHB5G75wSyYQrcL/CZ9r 7yYJrFAtjL39Fuh6nPWzr7oHc90aPwV7tfzrmJbVgKDOYAwCIHi3Tw8MGZ2lZRkFKl6rI6 obOz+CQ/rpSc1QcHXfeqNq3gvZgy3sh7Y8z1gPDD78+I1gsKo/JosO818alxRYMKBNJ7VV omdMx8PFpt466527/1fdGsyM0AaB+LXp36kjBFgC3EAnwGk/DssmUy8umkynx4O+nwjqjq 27W73zaz6AcqnJCx/pdkJuMuoyvKfri70z+UicvIaxwoC2WvjgQtjlCg6uMqiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390171; a=rsa-sha256; cv=none; b=AV7uKsg7Iotagrskql/hROHI1qkqG1Kw9VuGVkwnQrAMjOKb6mRzbQCG+iQNdgpGULK2Jg vGurQdADzpgYzf7ikdUn6vQcwOvPQLzmrQOjzW8rcTLNZoVpizC1WxC8L1Kfes0vumD/ob +pnmWZrq5FZ7Qzms/1bx4RHPcJdnKg6R5pz4pZ91XlVAdBYKiaCAPNPuLamieGNG3Jt72B MXnDF1/nr3oe9rs2ArmcAXzE2tSEWVabfx+yJCE2uh/mdT95Qx4icCXJrpJSQpuQaPOdpR 2KwsOfU9BujqtOUjiYCtJnTfCc+WGY5sZHNbF5RGC7CPESLY/k1IQMCNxQA57Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFxR15XjzCG9; Mon, 20 Jan 2025 16:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGMpiq010887; Mon, 20 Jan 2025 16:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGMpG8010884; Mon, 20 Jan 2025 16:22:51 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:22:51 GMT Message-Id: <202501201622.50KGMpG8010884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 6203d08e7a3a - stable/14 - ktls.4: note that security/gnutls now supports ktls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6203d08e7a3aaaa1e8e4c1e78b26065ec2902d8d Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=6203d08e7a3aaaa1e8e4c1e78b26065ec2902d8d commit 6203d08e7a3aaaa1e8e4c1e78b26065ec2902d8d Author: Alan Somers AuthorDate: 2024-10-28 15:14:06 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:22:21 +0000 ktls.4: note that security/gnutls now supports ktls [skip ci] PR: 278083 Sponsored by: ConnectWise Reviewed by: diizzy Differential Revision: https://reviews.freebsd.org/D47310 (cherry picked from commit 7200d90644ba61d63e6fec33855bba5d3b7eb7bd) ktls.4: note that there are multiple openssl ports with KTLS knobs [skip ci] Reported by: "Herbert J. Skuhra" Sponsored by: ConnectWise (cherry picked from commit 1e4da42a36d5cf44bacf0e261626b69a4761f0cc) --- share/man/man4/ktls.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 46a37d5dd636..56b03d45faf7 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd December 14, 2021 +.Dd October 31, 2024 .Dt KTLS 4 .Os .Sh NAME @@ -220,8 +220,10 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa security/openssl-devel -port may also be built with support for +.Fa security/openssl* +and +.Fa security/gnutls +ports may also be built with support for .Nm by enabling the .Dv KTLS From nobody Mon Jan 20 16:24: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 4YcFyv6f3lz5kKgp; Mon, 20 Jan 2025 16:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFyv5rPxz3S82; Mon, 20 Jan 2025 16:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1NqUjmH0fZ9RkN+R7jmcAYegzES9vbVRy7I5a775C3U=; b=lCWHk7eRBHcF1Kb4bCh8ZRaONf2HjnZCXPHdz55CNJoNwmqHWSyQx6eFBCF939gA++Rb7D tOQJ10re1Wov8f/vTWJSxsTz+S3HkyQKJ6wRScsR5lVZdla/HW9e1sOQO9S/RG/j8r9kWz xRk5REMVFpflsiH4BT5vttidE9bqqKf5DBsXvD/6EVwRmykZ1xDeVEJtnXlGsMT0VTNp6a ZJO3kmpyqDi3bAym3Mg0VHrdrNUrx1mCxTqbPMb3IslzViwQCZFpQps30d+cQQzQdd6DBc Ncpz6LqcwjraXp0EASp2uTeNE61zAzlV0R2U8Rq5AaXOKhnlDb0C7Z74dnBNFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1NqUjmH0fZ9RkN+R7jmcAYegzES9vbVRy7I5a775C3U=; b=JyIO4OULJAp+bNwCL+zFySwoZT3rF3TUSou8Z3YBHdJmtiCyzlqj0I3h03yInmUbmbjSFM kxcAsG0Ry90HuqOGdRdbLGpP7E80GNO32EFHFNH2idE6VT5yws58uZQxOHgQGggFKR1dmp VXSKlF6CQFVXTnqiOxQolZc62AfPAF49gyeyxPP/hRD8E7SfuHnlrhFD7tlXJz1305kvwY h4TVNuK0L27q9FnSFwL+tyuc5ORQJEPy+fKRpTFxjYNgluwvhPOBiFX5nw/6fPKf5UV0YY uaPEghxVFRg9V4YSzrgnbS421bHu0zenbh6GGAreI/1l3tP+mAkNOKwZR8z0EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390247; a=rsa-sha256; cv=none; b=Ms4tnLffzbXe8e+gKD2zPlLEJx9wCSmdPdMPWRue2txrFu6tIABX+46M1EA8aZHV0KBfgK dRQMeiJHt1A8ToPrlyILAeN9BZFVg7ZERzapBM6XQecqjraf1MNgx18Q9PPMO/i6p8ZVnw 3y3cH4iYp3yVXUkzwUpgUdQlV7Ne58ewfMNhWKxT+cDPjlH8agP+uQH5BW4h4BSmv+LaJW hRuaasc6ieoNSJyWkdh78WIzfQGhJ1148zdZHyXqTpvJW39YgRzzjqyViJYXqyhFYlCY+L KjMzeqd/EePxKlAKXSaiQXQn4z3xEvoFRE8+O/d+NFDEC7EZcfJP1ZA6Zbx1mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFyv5RXXzCD1; Mon, 20 Jan 2025 16:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGO7tn011388; Mon, 20 Jan 2025 16:24:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGO7ha011385; Mon, 20 Jan 2025 16:24:07 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:24:07 GMT Message-Id: <202501201624.50KGO7ha011385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 23b270405951 - stable/14 - Make the CTL tests more resilient List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23b2704059512b985bb14b220d92102bc4569b3e Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=23b2704059512b985bb14b220d92102bc4569b3e commit 23b2704059512b985bb14b220d92102bc4569b3e Author: Alan Somers AuthorDate: 2024-11-05 00:26:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:23:08 +0000 Make the CTL tests more resilient Fix the find_device function to work regardless of whether "camcontrol devlist" lists the da device first and the pass device second or vice versa. On FreeBSD 14 and 15 it apparently always lists da first. But on 13 it can do it in either order. Sponsored by: ConnectWise Reviewed by: emaste, markj, #cam Differential Revision: https://reviews.freebsd.org/D47446 (cherry picked from commit b032be711c740d2f25b27c92069537edcfac221c) --- tests/sys/cam/ctl/ctl.subr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr index 18991e0fa144..868b1c809571 100644 --- a/tests/sys/cam/ctl/ctl.subr +++ b/tests/sys/cam/ctl/ctl.subr @@ -47,7 +47,14 @@ find_device() { ctladm port -o on -p 0 >/dev/null HEXLUN=`printf %x $LUN` while true; do - dev=`camcontrol devlist | awk -v lun=$HEXLUN '/FREEBSD CTL/ && $9==lun {split($10, fields, /[,]/); print fields[1];}' | sed 's:[()]::'` + dev=`camcontrol devlist | awk -v lun=$HEXLUN ' + /FREEBSD CTL.*,pass/ && $9==lun { + split($10, fields, /[,]/); print fields[1]; + } + /FREEBSD CTL.*\(pass/ && $9==lun { + split($10, fields, /[,]/); print fields[2]; + } + ' | sed 's:[()]::'` if [ -z "$dev" -o ! -c /dev/$dev ]; then retries=$(( $retries - 1 )) if [ $retries -eq 0 ]; then From nobody Mon Jan 20 16:27: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 4YcG3D2L86z5kKmq; Mon, 20 Jan 2025 16:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcG3D1p1tz3StN; Mon, 20 Jan 2025 16:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Puheg5tWKDriOHlHV8I++IR49mvsmAdcBmrzHKAt66s=; b=EJk9BLNy4StThiRh1IGnyLR+KjEzotz5xrtggb1c3eTYEJSzonha7PzVAcecllfhDnagbd 1Hjl5Izyb46BSmA98hV9ISVr64zYF69BbSuFT0aNm+Hm1qbIHQ7r3ERur3oUM3LAUVoAoK uk9wqjcZSWmYbcvt43Z2izec4FDNEIgN/XroIT3tkj1DpWLcd5DvM0F9++db1Y3of1hCuD FfdM+orzqnd1LRa+eSH/EB4+s1Oc16J8GZALwTRTSoRyv/X7T8v5gXQ0v58v9tHIG36u4k B3vtPVaE0Ss2bHdf3MX0mMPQmVxzykPB61nXes2Lnm2OXT4U7veSUnHsuLEfPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Puheg5tWKDriOHlHV8I++IR49mvsmAdcBmrzHKAt66s=; b=XeOCfHP/ZjrUrxYCclr9xUHbZW/3P3jE6/qaZH7JYKHKwtSxE2KyMlJ+rqeXnxPwCv8b53 yYLs1zyrhGr0TDYbk5c8EBHRsCXSzm1uDE71I5UJrI/WyhwmziKCDhmzr3TGjAa0LduYgo UwW+8rambzVOgrDN7hrJ21dd2X3Q8xh2B3Wms91TisWZgSlogAUkNLQfbKomlegRddeqH6 S/jKM+Tmb5zjcpwL2G6ypnpCwEz88ZfuTSdWAHZ4nUFG/lglbBRWHO3dCE6CnDiR7qqlvN xHJzWG3vCSBtRj0GkA1TUBAsdScJZChbKsjhHewrhq4L5xH9b/MgQu0sSYdKOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390472; a=rsa-sha256; cv=none; b=npPbxuD4pKjNQewM1bhXCpr5yxgK/VJ0fWeNjWX9M6cS7xQ3kMK34hdd/sHSmTOpSBB34c qc7R55deYGPZxW7+0TPMDZ+J5uJt0Q51wqWDE/AHvWhgJnFSkcEzLelW0c/Cb7B7pB8M+6 sae3/l9wxk/Tb0C6gqEoZHF5cTgl0fuSJHchAyhsSvH+YDPjInroCThGEioeYfe/sNn5X1 1kt7wX1Jnk7oROEg35B9IoWQzdHyorqBmP9dk7klpKeEMxBgpjRLg8yhrqj1ZZN3X7v4LP nrb3xQvnSP/r17dRdMRhXe8bU2iCUdDUXOXl88gSf5zD3mHfONb0iXvpMLSINg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcG3D0xCwzCD3; Mon, 20 Jan 2025 16:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGRqVj012577; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGRqYc012574; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:27:52 GMT Message-Id: <202501201627.50KGRqYc012574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 980eedb0cad6 - stable/14 - pf: avoid use-after-free on reassembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 980eedb0cad684c1e4a64d063df2ee7d28fa693d Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=980eedb0cad684c1e4a64d063df2ee7d28fa693d commit 980eedb0cad684c1e4a64d063df2ee7d28fa693d Author: Kristof Provost AuthorDate: 2025-01-06 20:08:04 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 16:26:49 +0000 pf: avoid use-after-free on reassembly Ensure we update the mbuf pointer returned by pf_normalize_ip() or pf_normalize_ip6() even if they fail. Otherwise we'd risk using a freed mbuf. PR: 283705 Reported by: Yichen Chai , Zhuo Ying Jiang Li Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5d28f4cab8d5919aba1365e885a91a96c0655b59) --- sys/netpfil/pf/pf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 18b907c45d38..31c3dd8009de 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8424,6 +8424,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, if (mtag != NULL) m_tag_delete(m, mtag); } else if (pf_normalize_ip(m0, kif, &reason, &pd) != PF_PASS) { + m = *m0; /* We do IP header normalization and packet reassembly here */ action = PF_DROP; goto done; @@ -8629,6 +8630,10 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, done: PF_RULES_RUNLOCK(); + + if (m == NULL) + goto out; + if (action == PF_PASS && h->ip_hl > 5 && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; @@ -8968,6 +8973,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, kif, &reason, &pd) != PF_PASS) { + m = *m0; action = PF_DROP; goto done; } @@ -9237,6 +9243,9 @@ done: n = NULL; } + if (m == NULL) + goto out; + /* handle dangerous IPv6 extension headers. */ if (action == PF_PASS && rh_cnt && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { From nobody Mon Jan 20 16:27: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 4YcG3F1Xj6z5kJyY; Mon, 20 Jan 2025 16:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcG3F0mQYz3SwY; Mon, 20 Jan 2025 16:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w4FnXSwKJghk8Q6ekNWLhBUmMLPG5Xw2P3Yy+QC/JuI=; b=FMfs610vHf0OQ/xXaXKm1l9xCSiG9mASmYlRSMyMv+VE0eOR300SODIjLCUdCvsXFRfP0h dTXV53Gcj0orW3EF8MjIhd3aNGdNCjPjTs1B8NXkWSVbyk83xKXBRtFLsEwYfutqn7SrLq i5MkNqNd/ZLVgMVY4qVDbhUnjcBLCXb1z4ufOtkSF1DUx2EHRB9BPDBVOR8CE4YPRS0y2s 1gq83ZwPC4JQPTTBT90EjoNlNHTL4SMDvTf3yQOGRe0LvpOxw6R80jdon6BrJhQQDn98Ox kzOzs8ErUwb9RM8uUf8Nd3RnD8nHJ9yBIsv3s3ShiVhiAn/1Kpc+wh2ADVQmGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w4FnXSwKJghk8Q6ekNWLhBUmMLPG5Xw2P3Yy+QC/JuI=; b=qtnCtaJm9VGrbvVR2v4UVvv+VrVt/uiWl07hlgIqjTfVU2aiPsylXN+NhjT8gvQOyA7Uio WdsDElPBoiqZGfFP523IwZhkSJwHQwyxgWg0n1qNbSTyjdfFO9OIn2HuQB1pq+hNV2yE/R 7nu3yqvGXgivIPuVAd6zb5v1SWIby28p7uLTEMYyyTEqBiprPY7FAbpH4/jTh/EzFo7i3U pyqHRcVBfsnlkCalDuw4zWNtW5l+jYXHt/M9pIlC2l70CA4XCmtP34+eDsIPte45g4Oc1C XbhdT9ZgQyZLZHrA8+kaFKm2qvssGyEk8PbJoh9wjKdCnos95bqUKPe2eah+MA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390473; a=rsa-sha256; cv=none; b=T+jy9tKMh/BkG1NQldlMmBF1YqMJhBt/HiNwD4lVsUGDlBDNhnvSend+y4YB1CBixHzhfw UaAgUZ9c4H0xO70GsyEEdk6AmljfQ2LDO8T+iliyqLrDcpMnLuSybFMeaZZirnZtAqb1R3 GdYUoTYwdeSAe9TLv17w8CKWngcr2zHFJqLMrEP+LNSfLCaWqZhTiZCeXI24/plR+0PrBm AU3/WawTnAAlNpaSf6M6vN1b8zZ/rBODR8fui1KxuXPDSC6iUT848QkIvGFoyDADXCjFhP iLbgfzpU1Mbbj3nTMU9329Bw8OnXadpQOVANRPbqvXfj3DEoPjnRa4JxgPX07Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcG3F0DdVzC73; Mon, 20 Jan 2025 16:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGRqnM012670; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGRqSL012667; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:27:52 GMT Message-Id: <202501201627.50KGRqSL012667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: faec43a79bf9 - stable/13 - pf: avoid use-after-free on reassembly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: faec43a79bf9a43ac3e2bc3e1de244dd31868dd3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=faec43a79bf9a43ac3e2bc3e1de244dd31868dd3 commit faec43a79bf9a43ac3e2bc3e1de244dd31868dd3 Author: Kristof Provost AuthorDate: 2025-01-20 07:11:14 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 16:17:10 +0000 pf: avoid use-after-free on reassembly Ensure we update the mbuf pointer returned by pf_normalize_ip() or pf_normalize_ip6() even if they fail. Otherwise we'd risk using a freed mbuf. PR: 283705 Reported by: Yichen Chai , Zhuo Ying Jiang Li Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5d28f4cab8d5919aba1365e885a91a96c0655b59) --- sys/netpfil/pf/pf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e5cd0b83ac0c..b5f872d40b02 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7468,6 +7468,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * pd.pf_mtag->flags &= ~PF_FASTFWD_OURS_PRESENT; } } else if (pf_normalize_ip(m0, dir, kif, &reason, &pd) != PF_PASS) { + m = *m0; /* We do IP header normalization and packet reassembly here */ action = PF_DROP; goto done; @@ -7679,6 +7680,10 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * done: PF_RULES_RUNLOCK(); + + if (m == NULL) + goto out; + if (action == PF_PASS && h->ip_hl > 5 && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; @@ -7936,6 +7941,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, dir, kif, &reason, &pd) != PF_PASS) { + m = *m0; action = PF_DROP; goto done; } @@ -8210,6 +8216,9 @@ done: n = NULL; } + if (m == NULL) + goto out; + /* handle dangerous IPv6 extension headers. */ if (action == PF_PASS && rh_cnt && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { From nobody Mon Jan 20 16:36: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 4YcGDl0mmcz5kLKc; Mon, 20 Jan 2025 16:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGDl015yz3Tmt; Mon, 20 Jan 2025 16:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8zJ7hJSkfS8Xdf8UgwvjlNdwd6KmmmqgRuBZ1JPF600=; b=BwWgNCtBeP/1sw9d5YgIUJbOEMEyVaW3f7mWWyd9VPKC9lTJ/CdhU9Ijq/+ss+HkgWeoIe ZWF8X6EwWRVGbQTHPOzV36uew7J4EXqeQKkXbleZfCVv2Rcev0D8K1YNd/bUDqxptRqsJA 1FPpFMYSiVh359hmBg9oAvizXLgBwn7obvXzJW6QzBgIKoBDNJ9fLX2DMpUoN7DRWU1R6N H9EvhLZ3CAj90NWWb8Vj/8Oe+kHWm32WeEoJBW3VhBMl453BcFnFBGPiA7pBdX71kXRrPu hvGmh0odyySQv0eZ469ZQrbqzFjBRLuk9TMz72prMaQTSc20xlj2XqP9LOlWpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8zJ7hJSkfS8Xdf8UgwvjlNdwd6KmmmqgRuBZ1JPF600=; b=bNSbrWEXvZCGeBNg5Uali/bOcmPwar9hxwDpMrsMKHYeEdZS3RNgRDRq2lt6rpR7M+oUP/ LC7Q6dcW9wRWJgIRXbr/fucunThFlSqNQBBHUrPiQYS6xFpyirESH57e5p+hiq2egRKOEp xZIu9JD91sol1Uz3UPbVAumMUqsF3gSHBbqygIWDLu48ZIno9zARr8x5Vy/37B671NFGUj ERZ2k+5BVcwDf2bmT6uYtJFtg/sMmrTIAITz5vQ9J0gRAyoO/n3n7DPjsT/ynZpITV9ghP IedZ5XCK4ajFBj7gcTRARFt0ByMIX9juRxW9tH1JeWsloSBdIfDIKqdPIy4DKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390967; a=rsa-sha256; cv=none; b=GV0gToCk0UpBBmndePlgrbJFxUPNeSVJL213esPEmdZnkWshsOWnAgRiSPnYr52CrBqg88 it0nLCm/wlqfVCKevu3VWLGXY3+R5juI44bYbT6G2jyxbXQL4maiSqd/NSw0J/ne5d2iOY KLZOOMn99qgja5YuztqWmNfGXiUvRzpVx3GSBlM5Vf5nLw1KU4Jv+8r07iv5PfuzM0qy91 Oy2i9YnG2wx1gdaZqC+78acseaCVNsVmDdmdwtKPyovnUe33+5NhvYoKBz11X2FFEh6OX9 lph3MaQnN/ZtLOHvgRKkYsc7aiHfhA54gNP8sGvisul2qXHrubM3ctOyS0h9YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGDk6X4dzCgb; Mon, 20 Jan 2025 16:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGa6lZ031002; Mon, 20 Jan 2025 16:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGa6IN030999; Mon, 20 Jan 2025 16:36:06 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:36:06 GMT Message-Id: <202501201636.50KGa6IN030999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: b797d07560a7 - stable/14 - fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b797d07560a76d790c0256a70d65b2b684ab6ee7 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b797d07560a76d790c0256a70d65b2b684ab6ee7 commit b797d07560a76d790c0256a70d65b2b684ab6ee7 Author: Alan Somers AuthorDate: 2024-12-13 14:00:20 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:36:02 +0000 fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint Unusually, the FUSE_NOTIFY_INVAL_INODE and FUSE_NOTIFY_INVAL_ENTRY messages are fully asynchronous. The server sends them to the kernel unsolicited. That means that unlike every other fuse message coming from the server, these two arrive to a potentially unbusied mountpoint. So they must explicitly busy it. Otherwise a page fault could result if the mountpoint were being unmounted. Reported by: JSML4ThWwBID69YC@protonmail.com (cherry picked from commit 989998529387b4d98dfaa6c499ad88b006f78de8) --- sys/fs/fuse/fuse_device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c index 5df9be59ce36..2fd43bc742dc 100644 --- a/sys/fs/fuse/fuse_device.c +++ b/sys/fs/fuse/fuse_device.c @@ -440,7 +440,6 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); - mp = data->mp; if (uio->uio_resid < sizeof(struct fuse_out_header)) { SDT_PROBE2(fusefs, , device, trace, 1, @@ -543,6 +542,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) } else if (ohead.unique == 0){ /* unique == 0 means asynchronous notification */ SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); + mp = data->mp; + vfs_ref(mp); + err = vfs_busy(mp, 0); + vfs_rel(mp); + if (err) + return (err); + switch (ohead.error) { case FUSE_NOTIFY_INVAL_ENTRY: err = fuse_internal_invalidate_entry(mp, uio); @@ -567,6 +573,7 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) /* Not implemented */ err = ENOSYS; } + vfs_unbusy(mp); } else { /* no callback at all! */ SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket, From nobody Mon Jan 20 16:36: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 4YcGFd4zn3z5kLHP; Mon, 20 Jan 2025 16:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGFd4JZnz3V3C; Mon, 20 Jan 2025 16:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z03LKoRcmGqXNgkSB3yPUwRnLk4aYnaGh0hunpew5A4=; b=FIPUJKyzEGg3FZg9frC6Ab1iHqQKTtfXyapv5ZzboQQdvc2pz8ESNuBBcix0qTh6Tj248s X//qcaxwkWsti6chrp0GDAsfAuGausEYCIiyZH5vtrZULFQiH+4erHhLEp0SYS+FtEerSv HvtoB9+H6AlUYR+2IrQlQBFe46LFeafHL1OHlvAsJKTl7MhHG8IMmm9s7Bp2PdEIUVDrIs MreG6ePvk53kr7hyeiMUkpb1Copg7AUjvwmSod2Pi57jNyMDx/K2cdXMRDKajUP3OUJbKv FHfDnfitehVoPwooEOhaz0+2ZyLeoMSd9AFF+BtKGnlQ9Ena2RP3P3xPSN0SYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z03LKoRcmGqXNgkSB3yPUwRnLk4aYnaGh0hunpew5A4=; b=CE2oFAlbvJ6VTikqnLgORM8pkbTJXQRYGEhEfj11z7Gy0CsgtoYmhsYyVHCSQUVrGIIcw2 bFV3VvcFEJR4aKl6tDLwnMYGbD0jJ/wGM0zxOCQha45ATmBXJaGXOyq90jUHkTBFGAngfL dOdV/POBqqKS/3GNMIuNK3FvjbPmGwbNYMkh+L7zBqycBkotLofDE2nW0/dPfsk2B8Qw8d CLODbiYS8OCs//VEzo1kgO1otF6FRqsr4wGETYeALzw1DT6rCSLXvzTUsmDRD2RJoN+59g aHCK245it4NLdmUsrakbDGU/H7+qBpghHWTMhiyd3lGZ4rU8KpEix/iIyluOZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391013; a=rsa-sha256; cv=none; b=ZoezsYHdEKwG9evQGvVPtbSgwf3mQ65Q6EZAGqJ/jNwFFm9RF7FGJPHG2NRcJMu7n504jQ BWcYMv7vI+Kcf9mhYuhNb8pzycq1TBzadKzzmMTVRbVMIvOIef67NFeLlh86jHcQpTTjPX 4KDo4glR5UU4uXP3M7eDjY4vnzMf//i6jsjqhxE2uy5bC60v6arv9TH9z4JESG518hSAyR YZPnYDo1cjxpkNV1Ba+SbdFqcbiy1DAggcHcMxS6Ufthai77ZIJbn+Jlr+piXqxpKSu67j W0MgdWhPPM95H9X8pQFib9RGma3u32NpLrKgeCsmssDIHaG9bwlJg3/mcsMHzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGFd3s4qzC65; Mon, 20 Jan 2025 16:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGarHw031328; Mon, 20 Jan 2025 16:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGarMh031325; Mon, 20 Jan 2025 16:36:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:36:53 GMT Message-Id: <202501201636.50KGarMh031325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 887494153482 - stable/14 - namei: add more detail about LOCKSHARED's behavior List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 887494153482e4332f90a64a499ee1ed196ff25d Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=887494153482e4332f90a64a499ee1ed196ff25d commit 887494153482e4332f90a64a499ee1ed196ff25d Author: Alan Somers AuthorDate: 2024-12-17 20:10:57 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:36:24 +0000 namei: add more detail about LOCKSHARED's behavior [skip ci] Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48125 (cherry picked from commit 22bb70a6b3bb7799276ab480e40665b7d6e4ce25) --- share/man/man9/namei.9 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9 index 0be73f68cdda..63a6d3b11f6f 100644 --- a/share/man/man9/namei.9 +++ b/share/man/man9/namei.9 @@ -31,7 +31,7 @@ .\" If you integrate this manpage in another OS, I'd appreciate a note .\" - eivind@FreeBSD.org .\" -.Dd July 8, 2023 +.Dd December 17, 2024 .Dt NAMEI 9 .Os .Sh NAME @@ -124,7 +124,6 @@ Lock vnode on return with unless .Dv LOCKSHARED is also set. -The .Xr VOP_UNLOCK 9 should be used to release the lock (or @@ -153,8 +152,20 @@ and .Xr vrele 9 . .It Dv LOCKSHARED Lock vnode on return with -.Dv LK_SHARED . -The +.Dv LK_SHARED , +if permitted by the file system that owns the vnode. +The file system must explicitly permit this by setting +.Dv MNTK_LOOKUP_SHARED +in +.Dv mp->mnt_kern_flag +during mount and by calling +.Fn VN_LOCK_ASHARE +when allocating the vnode. +If +.Dv LOCKLEAF +is specified but shared locking is not permitted, then the vnode will be +returned with +.Dv LK_EXCLUSIVE . .Xr VOP_UNLOCK 9 should be used to release the lock (or From nobody Mon Jan 20 16:52: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 4YcGbP72snz5kMDR; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbP6Wcfz3Wwd; Mon, 20 Jan 2025 16:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BnIE1+0seA3GBNylb6o/77poARRCiN4NwjGaZbdQ7oU=; b=AGaDbJhYJQZQoBZ3QA4zTqpzuaQdRKhQDdONUhTkpxtPhk/sAx9uQjqCYSrESiJxH/+LoX mjXZgX5MXcJsvcGBsyshxIcvJ8tE4kO7JxVjQiCOMvhbSjmL1qBCSEW1PXydKvU90Dga2f g00SkAqLqAyA9MJG1cjWiTZgs1NaQ/Em1RlCSw+ma1zMahvuWN0uPJYbetqAveoT54zvb8 jaSn28pgyaubzIIAyybRB+Zv8pcZzWGmU5VkEAg61vHNkCdARQrA1bXHgCnWn1c4kgFIGt 8d1UuK38LhlC2s4J6xHYLQl51rWaIQDZbyd/rnzgHUCMeQQRvVVJwuL48Bp1Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BnIE1+0seA3GBNylb6o/77poARRCiN4NwjGaZbdQ7oU=; b=ttKf+4EKCRfdCK5Lq3YBiv6JK11roRuN8dZ2da0lUmFBzlWIRULF9jQu65nBFis0yI8BDF 3HnJXmdmeVTItn0zRj5gCLSbMWb/Em8IHmx+M0/a8DBK9DRQ5kHWYQQv0taJtVOLgTjHC4 JVD8l+Vf1co5c7FLV5NsYeMvEta52Q5kWAXoxlpYUObSPPxz2S92QmiWvALdztRXLzhwN0 i9s0Qsgm99RuzqlpMDg2zQgIV+rgPCiZDfLKOY4KLE6zrXSdNdgNUC3sU2Xtkw2QZqWJQn /oITwKlHuZvfm/OVaR/ZxaVG0D5HX2uS8lCMmN/0WtYmI62WiopqH/7q/mgvSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391937; a=rsa-sha256; cv=none; b=QI4Hkxk2YApUt2/XaGKLGnhJEp41NcQwtffdPngco+na01GFMmpRXlxm4oG50EA1EJ/GqX kQK2DHd2tW+yAhqQxHU94LPjSXEDzZhDY+ijSTJ6qkZ5A/l7dLX4/69nKldV4N0sl6itlJ gUFtCQJW3cF7otdWt9s9lHBwikDTQ7nzU9VgoQGmyPSat4abcL+SvIQGeJkeKowvh80j3+ 3hKrVsr8D9kT5eyLgy4yrMV/gbaEIh59VWaxYGJefrUGIDsRTs43MRzxnoxjHFJUReYmja gkMS+FwOMII4ip6FE+ffAZhfjBMrUxgmaajT3kaTEuMTLDgfP+3OY9Tt4XeWhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbP64BRzCmC; Mon, 20 Jan 2025 16:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqHc5065176; Mon, 20 Jan 2025 16:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqHOj065158; Mon, 20 Jan 2025 16:52:17 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:17 GMT Message-Id: <202501201652.50KGqHOj065158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: b0348117953a - stable/14 - fusefs: More accurately test the unique tokens in the 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b0348117953a117244056032e468dd6a742dc678 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b0348117953a117244056032e468dd6a742dc678 commit b0348117953a117244056032e468dd6a742dc678 Author: Alan Somers AuthorDate: 2024-12-18 01:38:05 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:31 +0000 fusefs: More accurately test the unique tokens in the test suite Every fuse ticket has a "unique" token. As the name implies, they're supposed to be unique. Previously the fusefs test suite verified their uniqueness by relying on the fact that they are also sequential. But they aren't guaranteed to be sequential. Enhance the tests by removing that convenient assumption. Sponsored by: Axcient (cherry picked from commit b1879975794772ee51f0b4865753364c7d7626c3) --- tests/sys/fs/fusefs/mockfs.cc | 15 ++++++--------- tests/sys/fs/fusefs/mockfs.hh | 6 ++++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index bd7bd1b663f9..023cecd0276f 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -421,6 +421,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, uint32_t kernel_minor_version, uint32_t max_write, bool async, bool noclusterr, unsigned time_gran, bool nointr, bool noatime, const char *fsname, const char *subtype) + : m_uniques(new std::unordered_set) { struct sigaction sa; struct iovec *iov = NULL; @@ -436,7 +437,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, m_pm = pm; m_time_gran = time_gran; m_quit = false; - m_last_unique = 0; + if (m_pm == KQ) m_kq = kqueue(); else @@ -738,14 +739,10 @@ void MockFS::audit_request(const mockfs_buf_in &in, ssize_t buflen) { default: FAIL() << "Unknown opcode " << in.header.opcode; } - /* - * Check that the ticket's unique value is sequential. Technically it - * doesn't need to be sequential, merely unique. But the current - * fusefs driver _does_ make it sequential, and that's easy to check - * for. - */ - if (in.header.unique != ++m_last_unique) - FAIL() << "Non-sequential unique value"; + /* Verify that the ticket's unique value is actually unique. */ + if (m_uniques->find(in.header.unique) != m_uniques->end()) + FAIL() << "Non-unique \"unique\" value"; + m_uniques->insert(in.header.unique); } void MockFS::init(uint32_t flags) { diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 958964f769d4..38efcd049a61 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -36,6 +36,8 @@ extern "C" { #include "fuse_kernel.h" } +#include + #include #define TIME_T_MAX (std::numeric_limits::max()) @@ -298,8 +300,8 @@ class MockFS { /* pid of the test process */ pid_t m_pid; - /* The unique value of the header of the last received operation */ - uint64_t m_last_unique; + /* Every "unique" value of a fuse ticket seen so far */ + std::unique_ptr> m_uniques; /* Method the daemon should use for I/O to and from /dev/fuse */ enum poll_method m_pm; From nobody Mon Jan 20 16:52: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 4YcGbR14szz5kMGn; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbQ6zkfz3Wr9; Mon, 20 Jan 2025 16:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jhqsr8wYKZWt/ub9OkWv81xD1Fyyl67/pmL+10BmdIc=; b=fTON4E3MJ/ecw3RSyiuCdVP8qMEDnrtaGk8Vq+aBqVla5NVWEEcqZm1WgcGebfpkDVLs1E EbS+Brb7lqdfceyGpykbsQ+q04Kc+Ayk6zoYpjwVjIKq3NPIG2YBACbU7o8fUa/5W6QRO6 P9Vl2xyhtknaWrqT1De2OJ5T74OKKdrlQ+vxpAmQykHpM9nWHZE506p8QlsDahzGX/P5Aa KAXnGMGG3lce7XbjKKr+0LaUu9U1ru6R+1mHoz/Z4JkF4cXSKvebyED6gIu0E4VcXV6qpZ OSJ8MrYzpXyAgDjFD5N/kiIaLlkcvkE49KEbcrXy+DdkDwGwHzhN+7wfuMzplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jhqsr8wYKZWt/ub9OkWv81xD1Fyyl67/pmL+10BmdIc=; b=SuhEDeGMNSweWEGsobHIIpHT5DoWvI3cdCY1m0ffS4mMOvukyajk82o66+trF7sFa2PX24 zKvWlRHLB+m4J1refCex21tE3iJYhJss3ffgSsmrbEDUf+TknCJz0+Rif0IcaL8Zt9qeZA y/0IT+Sr0W1JdJ+5DrN61ROAFjBqcqrbFRwz17fJ0Y4XYIqwdM5xuaWNAcS5YaS4hN0LBM sYB/WfxOJiVrUKNRDaSh4Gsn12gdawGhDwmwt/zjP9ZmUQlkz6fvf1eqdgOCkHfyC1ZaLm u0nT93qNl9IRtc9L2KAxbKBT4l4XMc4VuZtsNB1mIBN+QTmoNQFYUO6QcW1HSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391939; a=rsa-sha256; cv=none; b=mH+fsgsNBDepjNPiHb8fXDjEkGsY0TfGoz4yK48yy+zNSQLxIZ0fu+p/T5TCZi+k8ZbSFn 49FPTlZR/QVZMdWY0HBke1uj5fbL28N8MtHYDJStOQAWmxktfMi0yj9PlQlStpq7Ndrbys B5kEZ5KOaFxm08n+0Mo9JwSNDrIZBT0129alLeZWDDKigvPosTLS4er4O8KIBGu2rV0CqN GQoSo5n2pDYlYX6J3/0Ui0hPf/xUs/bckzqGh8OjxlfkkR4RjQ5nW46/JJla/PoJ/jWUeh Afpajn5/NVZ46gVHLYxBz89kgOzW6C4nTRWNj6QPZedCwgoZfNhRzFYX+LIc9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbQ6XpKzCxp; Mon, 20 Jan 2025 16:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqIvX066524; Mon, 20 Jan 2025 16:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqIM0066512; Mon, 20 Jan 2025 16:52:18 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:18 GMT Message-Id: <202501201652.50KGqIM0066512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: fb4e0325c758 - stable/14 - fusefs: delete a comment in the tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fb4e0325c758f393b61dab4219f195f1674fcd70 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=fb4e0325c758f393b61dab4219f195f1674fcd70 commit fb4e0325c758f393b61dab4219f195f1674fcd70 Author: Alan Somers AuthorDate: 2024-12-18 18:24:03 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:35 +0000 fusefs: delete a comment in the tests Even on a riscv embedded system, the fusefs tests run fast enough that 10 seconds is a reasonable timeout. [skip ci] Sponsored by: ConnectWise (cherry picked from commit 53f73aaffddaedff019555679d686ec401330d39) --- tests/sys/fs/fusefs/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index f45f2f93e1c0..00e2e208989e 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -66,7 +66,6 @@ TEST_METADATA.default_permissions_privileged+= required_user="root" TEST_METADATA.mknod+= required_user="root" TEST_METADATA.nfs+= required_user="root" -# TODO: drastically increase timeout after test development is mostly complete TEST_METADATA+= timeout=10 FUSEFS= ${SRCTOP}/sys/fs/fuse From nobody Mon Jan 20 16:52: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 4YcGbS6Z6hz5kM7l; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbS3Bwkz3X2Z; Mon, 20 Jan 2025 16:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lsmuG0GEIlRrlIjNzn6bECnp8iaL+69VEGmrW0tOZdU=; b=yaDu+Wu+VQRd7rNxq/Hp13PJP2sDcwNSN3Yh/+lsflU3bA3nndW0SDHX+J+hh8xTUp5KY/ AUFyFV6ba32MU5k2OOBF2Ii4qy4bkkVFjHgUwgStlUiNJVgMR+IuAtjvffYAye3T1KFAX5 us5/tmc/lDIe081dybiEvYpRFWlpprX8zjGrgsiUY8n1wXlSHINPmGRId+dKG9Zqet5AN3 6BePJeY1deL4MSTImUP0TYRkl1qTFWsOFpWgStzjIZVcP9nl3gi+w171qEi2wofVmCRTjk S8d1/eCXC3aWacs2SNzNVv3N/tbP4ainprSq2nnrHJE0EX2Cl24bxHPBttwTyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lsmuG0GEIlRrlIjNzn6bECnp8iaL+69VEGmrW0tOZdU=; b=irWwh2IgWr6ZNunCz09VzKd8109YdpsqMcd6Puo7sla5XhqWBH08BZy0a6K5mGru/RX5l6 b9jp4U9qy5o/rGFas6zAh1og6dCVqw3qELbDNTlYLm0I7ex7we4s1UGVTK6zLnwBFlruWl lOA5sE6QzBh0d6YVRBku8oX7fJ0DA5i6BAwvajNV8bo0wIsg3KY6TaEy+5dmz1Vi5JGxVv DpJ8RYjK1IV/zwnt8nSfi8viJT+C3cfn+mehds0yutbNi1okRGJ0wjmUynDVBhoO/nL9eW nrTq9WLv0jQCW0KknXiKug7oagKNnLIE7O+b4vJL/YwBliNjpL3FwgFperIqMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391940; a=rsa-sha256; cv=none; b=l/SW+1XlIm7MAFcmyWRLEt4e8quBuU527aIQgUmZRD7P+q1XfZ3VfOwIg+iiTmp3EDCTxs 6pUEqxMmZknaoRxa0D37EwnKoSmkQRbs1qeK04kTmHdmH+/KjTnjqBxgFl1wlXwyfueNdD H63rcX3UJ26me/SS29RghSVG8nI7A2k0g1XDpevSJvE2mqniHYLMnkt+UGlMg5Qy+zfKxU 4cPrwgV2Vdh0cw7MTkOUfkQXhTkYWhHvQ4gjRjgp6VEoYjIS4L2eLCl72BHFNJj/uehakO OCehUOxE4313Clsvkz+4TcAb9qRr7F6afgcHnTYIJHm/2Dk5bDPC8eRJJAvhcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbS0Q2GzC8D; Mon, 20 Jan 2025 16:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqJFw067287; Mon, 20 Jan 2025 16:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqJkl067284; Mon, 20 Jan 2025 16:52:19 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:19 GMT Message-Id: <202501201652.50KGqJkl067284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: d2c25c4c5e5b - stable/14 - fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2c25c4c5e5b13a0933fb71781e1f04ac179c3a8 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c25c4c5e5b13a0933fb71781e1f04ac179c3a8 commit d2c25c4c5e5b13a0933fb71781e1f04ac179c3a8 Author: CismonX AuthorDate: 2024-11-02 20:19:15 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:40 +0000 fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags The FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT flags are only meant to indicate kernel features, and should be ignored if they appear in the FUSE_INIT reply flags. Also fix the corresponding test cases. Reviewed by: Alan Somers Signed-off-by: CismonX Pull Request: https://github.com/freebsd/freebsd-src/pull/1509 (cherry picked from commit f0f596bd955e5b48c55db502e79fc652ac8970d3) --- sys/fs/fuse/fuse_file.c | 9 +++------ sys/fs/fuse/fuse_internal.c | 4 ---- sys/fs/fuse/fuse_ipc.h | 2 -- sys/fs/fuse/fuse_vnops.c | 17 ++++++++--------- tests/sys/fs/fusefs/open.cc | 38 ++------------------------------------ tests/sys/fs/fusefs/opendir.cc | 27 ++------------------------- 6 files changed, 15 insertions(+), 82 deletions(-) diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c index ecaa641a9261..22fc283e263c 100644 --- a/sys/fs/fuse/fuse_file.c +++ b/sys/fs/fuse/fuse_file.c @@ -123,7 +123,6 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct mount *mp = vnode_mount(vp); - struct fuse_data *data = fuse_get_mpdata(mp); struct fuse_dispatcher fdi; const struct fuse_open_out default_foo = { .fh = 0, @@ -133,12 +132,10 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_open_in *foi = NULL; const struct fuse_open_out *foo; fufh_type_t fufh_type; - int dataflags = data->dataflags; int err = 0; int oflags = 0; int op = FUSE_OPEN; int relop = FUSE_RELEASE; - int fsess_no_op_support = FSESS_NO_OPEN_SUPPORT; fufh_type = fflags_2_fufh_type(a_mode); oflags = fufh_type_2_fflags(fufh_type); @@ -146,12 +143,11 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, if (vnode_isdir(vp)) { op = FUSE_OPENDIR; relop = FUSE_RELEASEDIR; - fsess_no_op_support = FSESS_NO_OPENDIR_SUPPORT; /* vn_open_vnode already rejects FWRITE on directories */ MPASS(fufh_type == FUFH_RDONLY || fufh_type == FUFH_EXEC); } fdisp_init(&fdi, sizeof(*foi)); - if (fsess_not_impl(mp, op) && dataflags & fsess_no_op_support) { + if (fsess_not_impl(mp, op)) { /* The operation implicitly succeeds */ foo = &default_foo; } else { @@ -161,7 +157,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, foi->flags = oflags; err = fdisp_wait_answ(&fdi); - if (err == ENOSYS && dataflags & fsess_no_op_support) { + if (err == ENOSYS) { /* The operation implicitly succeeds */ foo = &default_foo; fsess_set_notimpl(mp, op); @@ -175,6 +171,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, goto out; } else { foo = fdi.answ; + fsess_set_impl(mp, op); } } diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index f67bfe0e91c3..f3206a3ddf9c 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -1011,10 +1011,6 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) data->dataflags |= FSESS_POSIX_LOCKS; if (fiio->flags & FUSE_EXPORT_SUPPORT) data->dataflags |= FSESS_EXPORT_SUPPORT; - if (fiio->flags & FUSE_NO_OPEN_SUPPORT) - data->dataflags |= FSESS_NO_OPEN_SUPPORT; - if (fiio->flags & FUSE_NO_OPENDIR_SUPPORT) - data->dataflags |= FSESS_NO_OPENDIR_SUPPORT; /* * Don't bother to check FUSE_BIG_WRITES, because it's * redundant with max_write diff --git a/sys/fs/fuse/fuse_ipc.h b/sys/fs/fuse/fuse_ipc.h index 0ec556138be0..5648624f4c63 100644 --- a/sys/fs/fuse/fuse_ipc.h +++ b/sys/fs/fuse/fuse_ipc.h @@ -227,8 +227,6 @@ struct fuse_data { /* (and being observed by the daemon) */ #define FSESS_PUSH_SYMLINKS_IN 0x0020 /* prefix absolute symlinks with mp */ #define FSESS_DEFAULT_PERMISSIONS 0x0040 /* kernel does permission checking */ -#define FSESS_NO_OPEN_SUPPORT 0x0080 /* can elide FUSE_OPEN ops */ -#define FSESS_NO_OPENDIR_SUPPORT 0x0100 /* can elide FUSE_OPENDIR ops */ #define FSESS_ASYNC_READ 0x1000 /* allow multiple reads of some file */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ #define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 22564c65c44d..87e44051d9a9 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1946,10 +1946,9 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) tresid = uio->uio_resid; err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); if (err == EBADF && mp->mnt_flag & MNT_EXPORTED) { - KASSERT(fuse_get_mpdata(mp)->dataflags - & FSESS_NO_OPENDIR_SUPPORT, - ("FUSE file systems that don't set " - "FUSE_NO_OPENDIR_SUPPORT should not be exported")); + KASSERT(!fsess_is_impl(mp, FUSE_OPENDIR), + ("FUSE file systems that implement " + "FUSE_OPENDIR should not be exported")); /* * nfsd will do VOP_READDIR without first doing VOP_OPEN. We * must implicitly open the directory here. @@ -3209,21 +3208,21 @@ fuse_vnop_vptofh(struct vop_vptofh_args *ap) return EOPNOTSUPP; } if ((mp->mnt_flag & MNT_EXPORTED) && - !(data->dataflags & FSESS_NO_OPENDIR_SUPPORT)) + fsess_is_impl(mp, FUSE_OPENDIR)) { /* * NFS is stateless, so nfsd must reopen a directory on every * call to VOP_READDIR, passing in the d_off field from the - * final dirent of the previous invocation. But without - * FUSE_NO_OPENDIR_SUPPORT, the FUSE protocol does not + * final dirent of the previous invocation. But if the server + * implements FUSE_OPENDIR, the FUSE protocol does not * guarantee that d_off will be valid after a directory is * closed and reopened. So prohibit exporting FUSE file - * systems that don't set that flag. + * systems that implement FUSE_OPENDIR. * * But userspace NFS servers don't have this problem. */ SDT_PROBE2(fusefs, , vnops, trace, 1, - "VOP_VPTOFH without FUSE_NO_OPENDIR_SUPPORT"); + "VOP_VPTOFH with FUSE_OPENDIR"); return EOPNOTSUPP; } diff --git a/tests/sys/fs/fusefs/open.cc b/tests/sys/fs/fusefs/open.cc index 7ab3aeb6ba2a..e80d1aa2a393 100644 --- a/tests/sys/fs/fusefs/open.cc +++ b/tests/sys/fs/fusefs/open.cc @@ -70,14 +70,6 @@ void test_ok(int os_flags, int fuse_flags) { } }; - -class OpenNoOpenSupport: public FuseTest { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPEN_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * fusefs(5) does not support I/O on device nodes (neither does UFS). But it * shouldn't crash @@ -281,37 +273,11 @@ TEST_F(Open, o_rdwr) } /* - * Without FUSE_NO_OPEN_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Open, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - int fd; - - FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_OPEN && - in.body.open.flags == (uint32_t)O_RDONLY && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).Times(1) - .WillOnce(Invoke(ReturnErrno(ENOSYS))); - - fd = open(FULLPATH, O_RDONLY); - ASSERT_EQ(-1, fd) << strerror(errno); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPEN_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPEN, then it and subsequent FUSE_OPEN and FUSE_RELEASE operations will * also succeed automatically without being sent to the server. */ -TEST_F(OpenNoOpenSupport, enosys) +TEST_F(Open, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; diff --git a/tests/sys/fs/fusefs/opendir.cc b/tests/sys/fs/fusefs/opendir.cc index dd837a8d43c1..e1fed59635fc 100644 --- a/tests/sys/fs/fusefs/opendir.cc +++ b/tests/sys/fs/fusefs/opendir.cc @@ -71,13 +71,6 @@ void expect_opendir(uint64_t ino, uint32_t flags, ProcessMockerT r) }; -class OpendirNoOpendirSupport: public Opendir { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPENDIR_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * The fuse daemon fails the request with enoent. This usually indicates a @@ -179,27 +172,11 @@ TEST_F(Opendir, opendir) } /* - * Without FUSE_NO_OPENDIR_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Opendir, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - - expect_lookup(RELPATH, ino); - expect_opendir(ino, O_RDONLY, ReturnErrno(ENOSYS)); - - EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPENDIR_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPENDIR, then it and subsequent FUSE_OPENDIR and FUSE_RELEASEDIR * operations will also succeed automatically without being sent to the server. */ -TEST_F(OpendirNoOpendirSupport, enosys) +TEST_F(Opendir, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; From nobody Mon Jan 20 16:52: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 4YcGbT59vKz5kMBD; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbT2SS2z3Wtl; Mon, 20 Jan 2025 16:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JBn/Kka3zcYaiilBQd/RLQXdCQoAW/w3JU/5TGwvGeM=; b=Mv1ILLlG0o5HTHcikuydJPt6/TLTMuiZdooPCnMkfBguysBMo7egVwB3cAPi2BfyDgXPBX trMpkOHKAyYnED6QiBTzM+0WAjxHlC9qoleLUxu7jUaRArxfO4VNB9GpbosK4l+hzqEro0 I0u6BcTDMv99blfz66xSrydiMWyjdHPm9ZwSqlMC8omjCC4OiYQGWSaXYBWxc3eKggpVBE hInX/qtKtgtVmritOXVqHG/QOaX0TqSC4GCiX/CFwHBJgg4m3zquG30+AhNF0os81+gNfb CZFNArZLFC+VkiikQpYcvzPcmRFX4g+ZuYyDVgcy3v+Xb1T39eYeXGtRgr112Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JBn/Kka3zcYaiilBQd/RLQXdCQoAW/w3JU/5TGwvGeM=; b=Qd+VZNHQMwOI2r46Iur1bmnrPPXDZdb33uxNuGNnEWDNHmIVTixSYAyx5u0XW7ps3w6jO6 wdk6jFbvXL8F+kjtOmNHZCPhBwtr3ZTI6JHRuVNw7b4+J0lErMr4Px0QAyGAAi4SU5MV07 VG85DVPnJd2Q0WchbkFuEO18o5K8mXO87ODLneb9So7QxMRPm5m2HxBEUOPua/yEfJWKgc IogQGz9prnPuIYdN2y9QA3Cyt6c11HePYLoqmk+/5YWVcYZKB6Nittbslye2ZFbNHPrwql OXghJkcxAi6Znt+lFp+fKTJymobqqEk2mCL+A2Zh1+jgk0HpWbPD/rQMM+iJjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391941; a=rsa-sha256; cv=none; b=N9F1MWOZwEFQs1aVdVFO3Yz14lsLoKu0m13CgrCDu2XIweL5ZFVPT0swUXKVDsNQS/VLXV NnkUCJg0k+oKPFlMAMCLEXaHhkez18usCGhADZXj4F+O/oUh3cEYgwI2rTDCL4AJu5eZGH FfhUUX22NpCXqQOJOcx49hIR02u/mpESbnlDm7+VZWiw8Bdf/FXlKFGXfv/6esljiL3g8c 3nXZbzZB063Altgasc4H479zxhoXYktZDyGyU875YpA01k6ti8kflfzBHRmC+0LVBYPcu+ iAyoFWzIJ5H75u/eUoiORvo40qfUzNslXgTrfxaoFgu8E4S0PIejGS4YmMnIZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbT1L0qzD88; Mon, 20 Jan 2025 16:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqLx3067321; Mon, 20 Jan 2025 16:52:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqL6R067318; Mon, 20 Jan 2025 16:52:21 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:21 GMT Message-Id: <202501201652.50KGqL6R067318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 60311a50779d - stable/14 - fusefs: fix a memory leak List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 60311a50779d27467f4f1cc38d62cb098ed80607 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=60311a50779d27467f4f1cc38d62cb098ed80607 commit 60311a50779d27467f4f1cc38d62cb098ed80607 Author: Alan Somers AuthorDate: 2024-12-23 20:26:11 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:44 +0000 fusefs: fix a memory leak Fix a leak of a fuse_ticket structure. The leak mostly affected NFS-exported fuse file systems, and was triggered by a failure during FUSE_LOOKUP. Sponsored by: ConnectWise (cherry picked from commit 969d1aa4dbfcbccd8de965f7761203208bf04e46) --- sys/fs/fuse/fuse_vfsops.c | 2 +- tests/sys/fs/fusefs/nfs.cc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 4a4f9dac3fae..ce9c1d7fd946 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -566,7 +566,7 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) error = fdisp_wait_answ(&fdi); if (error) - return error; + goto out; feo = (struct fuse_entry_out *)fdi.answ; if (feo->nodeid == 0) { diff --git a/tests/sys/fs/fusefs/nfs.cc b/tests/sys/fs/fusefs/nfs.cc index 79fead8e77cb..27ffc8f5cbc1 100644 --- a/tests/sys/fs/fusefs/nfs.cc +++ b/tests/sys/fs/fusefs/nfs.cc @@ -144,6 +144,36 @@ TEST_F(Fhstat, lookup_dot) EXPECT_EQ(mode, sb.st_mode); } +/* Gracefully handle failures to lookup ".". */ +TEST_F(Fhstat, lookup_dot_error) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = mode; + out.body.entry.nodeid = ino; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .WillOnce(Invoke(ReturnErrno(EDOOFUS))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(-1, fhstat(&fhp, &sb)); + EXPECT_EQ(EDOOFUS, errno); +} + /* Use a file handle whose entry is still cached */ TEST_F(Fhstat, cached) { From nobody Mon Jan 20 16:52: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 4YcGbV5HrHz5kM52; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbV2gZXz3Wrk; Mon, 20 Jan 2025 16:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih8Pye3wcoa7OO+fQ+BSCRb7vZDGabatpLferJIFYLo=; b=fjbdzgqSDOo3F7urIu4w61UsX+hK87isRThOVC1hb0n38gn0ng7WX51i5RkknopLvHmTmA 5A1K+dfwVIcKKSJ4Uo6SsJe8tsCWfOcUXH7LQiva1Ne0Y9dzuN8rzyzguvHLPgiHvcmln4 sxojB5eSW+e/5EpXMPb9HcjlucKan6QOMZgJKQSxl1dGFdZCgtlydQSS8Ut1g/5Kq+dlbi h+AsJa1kZKzVjyvdkzzqLQzIqaCxC7nURXtyWV82ehw2ad87ha54VHJUqY3W+wlNXe6y13 cmZt/wsLj7hmi39Rd1ZN3DQyfa+G9epcutzUzFCDRkkyeR6ri0dx3PVUXWexLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih8Pye3wcoa7OO+fQ+BSCRb7vZDGabatpLferJIFYLo=; b=XSK58DiW52rrWcpcIlNyQKSXTlB2Aj8z/qiF/sI9CJ2GEqI6+zmmotdMx1xjlhObuW1Tsm ylTRlQ2IP/lrOu81mQ2S6PUewqo28kAKks3tu4YKCqphzGjfoALv3FL850TVVxrbEGeSoK JWhR1fuVi0W/46PJAWLfo7OyIVrc53esDS8zoAZPdf8HJSbaC2xZY7VHP9GNhD1XdZax1q EbPoxng9yizetQ/nfr/QhL23xAlSc7Ea1JDjN9eWHARHrjUJczo/dL8QulbymaYWGOc7Va JbE00JJ5JAyl61s9w39HiZFkK7epEb0iemGnu8hfKYgXYr6LkLSmFhgB3AL59A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391942; a=rsa-sha256; cv=none; b=Xb9nxb3Ubsr/R9ukX4Zv4AC6SCrMeub9M6ASCgq8T/PqlPZRIVWu97CpZYbIJ1Z+H0nebe M+oJRnzfHW4iVRit1a+QowbZQbV4uSNU/7B2sMq5gLoFN+KTgLVQIwBX3/vVRbcFdF7AaX 6KUysOCMxeAYJQaHFF4y87ufpIcia7Yg3B/T0kkLEkmoRQ5cXNZu2E42ltU56Mv8Vqwu9Z yQpZIIa4UObDoucqRQXuyeF/YK7oWikI5EOehOaKB9aoFa5MImqKpaHho6kZ5rGbyLkBPJ +vR1HVlf0axMzZqOfG5JqDRyPIzknklPZGwFwKDaxIzdLtDpCabOlzlBMnNvIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbV1zf5zD7G; Mon, 20 Jan 2025 16:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqMj5067354; Mon, 20 Jan 2025 16:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqMiU067351; Mon, 20 Jan 2025 16:52:22 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:22 GMT Message-Id: <202501201652.50KGqMiU067351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 8b2b77c32f2e - stable/14 - fusefs: minor cleanup in the tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b2b77c32f2e46c89aa7b60610003b1733f7a0e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8b2b77c32f2e46c89aa7b60610003b1733f7a0e0 commit 8b2b77c32f2e46c89aa7b60610003b1733f7a0e0 Author: Alan Somers AuthorDate: 2024-12-27 21:24:17 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:48 +0000 fusefs: minor cleanup in the tests Delete some unused includes and member variables. Sponsored by: ConnectWise (cherry picked from commit c2153a533ffb9691848a072c7628dcf56e0e6442) --- tests/sys/fs/fusefs/allow_other.cc | 3 --- tests/sys/fs/fusefs/forget.cc | 1 - tests/sys/fs/fusefs/io.cc | 1 - tests/sys/fs/fusefs/notify.cc | 1 - 4 files changed, 6 deletions(-) diff --git a/tests/sys/fs/fusefs/allow_other.cc b/tests/sys/fs/fusefs/allow_other.cc index dae6290ea8e5..24a161166a90 100644 --- a/tests/sys/fs/fusefs/allow_other.cc +++ b/tests/sys/fs/fusefs/allow_other.cc @@ -52,9 +52,6 @@ const static char RELPATH[] = "some_file.txt"; class NoAllowOther: public FuseTest { public: -/* Unprivileged user id */ -int m_uid; - virtual void SetUp() { if (geteuid() != 0) { GTEST_SKIP() << "This test must be run as root"; diff --git a/tests/sys/fs/fusefs/forget.cc b/tests/sys/fs/fusefs/forget.cc index 846198e75925..1e7764ac4782 100644 --- a/tests/sys/fs/fusefs/forget.cc +++ b/tests/sys/fs/fusefs/forget.cc @@ -31,7 +31,6 @@ extern "C" { #include #include -#include #include #include diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 99b5eae34e09..766148044b32 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -31,7 +31,6 @@ extern "C" { #include #include -#include #include #include diff --git a/tests/sys/fs/fusefs/notify.cc b/tests/sys/fs/fusefs/notify.cc index e3f539f57599..1e22bde13db7 100644 --- a/tests/sys/fs/fusefs/notify.cc +++ b/tests/sys/fs/fusefs/notify.cc @@ -30,7 +30,6 @@ extern "C" { #include -#include #include #include From nobody Mon Jan 20 16:52: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 4YcGbX0m69z5kM2M; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbW3ycMz3Wxp; Mon, 20 Jan 2025 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6B/8Y2XY1bbGTWc0c3t/lqmWrFN7XW3qH+whYFxMGPk=; b=Ys8ftwwBLz0XSHot1CTlVK7/hwCKMgeBDxlExTPUiwnhH8yQRozsowl/Kc6ZLsF61yBboW WRPciu7hRsgxd37fYWvsCBc2fbzAmqA9ZNpJKt/1V/2tGyYtx/bG0vCgQIQBO4ULl9kdIW L9YpJxIRVN7qijVWZGJ+TNSgdYQRkCBA5BOz6Ii+p4wQIPc8XiP38eBNfyIVv49PdFicwN nisLMYgHOLB+WxG4L8KwOMXLTUfdCMiyZ+vc38lxChv6lHBCSGAdfQXlm2+8c89ySkOX3C hfOvLzTEFD2GdgoyuiQuDQYcfTTd9OLqF1nHoK8PccMVtyGr7Z23n7yO6XQd0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6B/8Y2XY1bbGTWc0c3t/lqmWrFN7XW3qH+whYFxMGPk=; b=oTjvDHmqKxKxWsHXaT8UDdJKS+jKoHhITDx4QB96CAlq6Il+/ylWCBoBEyD3bdmvI07/e/ 4PnHQDDcJMzdwfMEePHLKz3Ybs/5l/3H+9aKk2zS8F401JAnJKcwLn/noNOTgX037Uqwak pKOpcJpfR2LLRF3TV6LPRgF1FkqRCO5Jr/mt+L3lkxCTEzvRrP/7YszpaSB+zZjzVAH4lJ C77UF2l5Nub0g+cFP7kvb7kl3ebEhfpoErQP2R0ij1KhDuez9uWKWTArsj67rGUxGcsk0x LxcnS0a7AhH3UUaNyRAef32NqHDmgxn2LocqZ3In4gIsvYwLM2HgxbeH6sAJkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391943; a=rsa-sha256; cv=none; b=dd0Ow8VP4c0y69eErQuDIe+LBTBUg8lYkVgmrSM19ng3TgvRLretzauqRUcSoGfKKBPf+D eay1zJT055X1+NAKzlWFN9tJl/ZoI2+0Bj9yYtv/VDpsT2fQh9Stz9693AuaNXg/LcjD5V dN51uj3CTt/2Fo8onbXHJ2Li80OkHxG3XFIjaCxi2uZWN0zWQ5WNnHh/JOhdUNbhCSXCI2 Do510dkF+Xkn70QWbR1Yd9cLiSMM/dWatllPBCXAJIsukp+RlcELhZAZsPrsEt9hwqo7Me nQQcHdzt01Zc9u0G40czgxYGQ1PqJxxQXsDtvRVdR20wju8CzKlGuMM81y+mWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbW2z9fzCxr; Mon, 20 Jan 2025 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqNJN067387; Mon, 20 Jan 2025 16:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqNvN067384; Mon, 20 Jan 2025 16:52:23 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:23 GMT Message-Id: <202501201652.50KGqNvN067384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 09df42f1d592 - stable/14 - fusefs: Coverity cleanup in the lseek tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 09df42f1d5925a81c76da163f0f6d647129729c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=09df42f1d5925a81c76da163f0f6d647129729c6 commit 09df42f1d5925a81c76da163f0f6d647129729c6 Author: Alan Somers AuthorDate: 2025-01-06 19:21:29 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:52 +0000 fusefs: Coverity cleanup in the lseek tests Always check the return value of open(). Reported by: Coverity Scan CID: 1471118 1471133 1471215 1471896 1471901 1472116 1473799 CID: 1473879 1473996 1555269 1558044 Sponsored by: ConnectWise (cherry picked from commit f415b2ef30f7bf0db753f09fbba7b0910475b0d2) --- tests/sys/fs/fusefs/lseek.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/sys/fs/fusefs/lseek.cc b/tests/sys/fs/fusefs/lseek.cc index 2a1cb198bcce..12d41f7af1b2 100644 --- a/tests/sys/fs/fusefs/lseek.cc +++ b/tests/sys/fs/fusefs/lseek.cc @@ -71,6 +71,7 @@ TEST_F(LseekPathconf, already_enosys) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_in, lseek(fd, offset_in, SEEK_DATA)); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -105,6 +106,7 @@ TEST_F(LseekPathconf, already_seeked) out.body.lseek.offset = i.body.lseek.offset; }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset, lseek(fd, offset, SEEK_DATA)); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -171,6 +173,7 @@ TEST_F(LseekPathconf, eio) .WillRepeatedly(Invoke(ReturnErrno(EIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EIO, errno); @@ -203,6 +206,7 @@ TEST_F(LseekPathconf, enosys_now) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EINVAL, errno); @@ -266,6 +270,7 @@ TEST_F(LseekPathconf, seek_now) }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_initial, lseek(fd, offset_initial, SEEK_SET)); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); /* And check that the file pointer hasn't changed */ @@ -299,6 +304,7 @@ TEST_F(LseekPathconf, zerolength) ).WillOnce(Invoke(ReturnErrno(ENXIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); /* Check again, to ensure that the kernel recorded the response */ EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -327,6 +333,7 @@ TEST_F(LseekPathconf_7_23, already_enosys) ).Times(0); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EINVAL, errno); @@ -391,6 +398,7 @@ TEST_F(LseekSeekData, enosys) _) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); /* * Default behavior: ENXIO if offset is < 0 or >= fsize, offset @@ -431,6 +439,7 @@ TEST_F(LseekSeekHole, ok) out.body.lseek.offset = offset_out; }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_out, lseek(fd, offset_in, SEEK_HOLE)); EXPECT_EQ(offset_out, lseek(fd, 0, SEEK_CUR)); @@ -463,6 +472,7 @@ TEST_F(LseekSeekHole, enosys) _) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); /* * Default behavior: ENXIO if offset is < 0 or >= fsize, fsize @@ -500,6 +510,7 @@ TEST_F(LseekSeekHole, enxio) _) ).WillOnce(Invoke(ReturnErrno(ENXIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, lseek(fd, offset_in, SEEK_HOLE)); EXPECT_EQ(ENXIO, errno); From nobody Mon Jan 20 16:58: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 4YcGk33KRTz5kMqv; Mon, 20 Jan 2025 16:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGk32c1qz3YCg; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737392283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5RjYd/zbFLzTPMFPiwEMWtqhU88hXVL8TrGQh17GFo=; b=PsxI5Po4BPi/wdjbpWd8lrBTXl/YL2/C/G0TcD2G9oQXuzuetLVg1BzNVX+PBcDPzFDE0N t90LuBwnqGQEWqdMpuOD5p2opfaWNwefUKkgcaHbDOWgBMaUZnd9ZPk+h+POEMHKgNhGH5 J0fPqx6C46Htsz8FMmz0OoWQXxpfVxcF7JL4GwOdTb9rPaauytuVpuA2f/VPUI1Offx7MW oNuqBFozRbQhp0pvN5g46ydz6E4sxNQNQyIBuDhRSmcPZ+dVZzg3g9nDN660FqnF/BCKIY GIaB/3W0krC65lvqz+ejPEc0E/7s89xCcsfz8S98PCteingKES0qZg9HcQ4trA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737392283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5RjYd/zbFLzTPMFPiwEMWtqhU88hXVL8TrGQh17GFo=; b=rBdA9rN8JfJrJTjPEjLnHA5PlKb1T+1yVliGPVeqq2Wqa0pZtfMCakrHZPYo58cQvH5ykI 7LdoYqxRPRSy/eFHvbIv1LvOayTrhSUPmKKzZ2FSvGrFbMmlm3H4CHuuxEJch7HGxmOXeS vJe60X7eOSmr27n8z5UIlSa4z30UW61e2/JeqK7hlvEcRZCDLazvTBsdnzB9t3Va2D49b3 DVdOA/udH/5MhdLvQwafKO7cPR4/S+ej+uITGO5/i2vgsW7gshZ0IIlx1VuE9hYUrozW69 0He3KHSjBI+VHSLeH9B0L3zpE5rnEgy3MmHtRibgBTjBmfJ5ywLn2g7ys1uTUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737392283; a=rsa-sha256; cv=none; b=QWo1HhNopA4ir616ol1nV2GLed7tWyCwxlvf3Ql7nj3SnPNl8p8Sc6UTKvUd1lZWBK5plV tcPGND4Rmol1OkAMqbHLrEvbZv3udf8OQRfROwSGNH71q85Ojj4wa4LyS7hZelUawvAEVd yqfHsVOgHXPtMUB0C6Cq5R+9FxWCxdR++EW4Yo9g+0Zo3E2iNfd2epnc96FGbOwvO/D7yD FrcmGRVwLPl0dWrgDM463FESLPsL4BiVFyqXK1dJH5Q1QzogiPG6AFoRaUeWr6cdT/zc19 F8pMelWbwBy2o310WBQawpwmn+1p/ShXrvvfyD+ZigheUHPI86LBNKH5BFv5VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGk31klPzCmH; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGw3H4069188; Mon, 20 Jan 2025 16:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGw3Z6069185; Mon, 20 Jan 2025 16:58:03 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:58:03 GMT Message-Id: <202501201658.50KGw3Z6069185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 3dc01440a064 - stable/14 - Fix lib/libc/nss/getgr_test with large numbers of 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc01440a064c95bc5f125acf7c0ef6acbb5c257 commit 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 Author: Alan Somers AuthorDate: 2024-12-31 20:41:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:54:45 +0000 Fix lib/libc/nss/getgr_test with large numbers of groups These tests create a linked list with one entry for every group on the running system. On a system with about 30,000 groups, the test took 69 seconds to run, and crashed Kyua with the below error: kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db). Fix the test by limiting it to operating on the first 1024 groups. Apply the same change to getpw_test and getserv_test too, which are vulnerable to the same problem. Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48275 (cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd) --- lib/libc/tests/nss/getgr_test.c | 4 ++++ lib/libc/tests/nss/getpw_test.c | 4 ++++ lib/libc/tests/nss/getserv_test.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c index 7c0e265fa6f6..974632d4b7c7 100644 --- a/lib/libc/tests/nss/getgr_test.c +++ b/lib/libc/tests/nss/getgr_test.c @@ -293,6 +293,8 @@ group_fill_test_data(struct group_test_data *td, int (*cb)(struct group *, void *)) { struct group *grp; + const int limit = 1024; + int count = 0; setgroupent(1); while ((grp = getgrent()) != NULL) { @@ -303,6 +305,8 @@ group_fill_test_data(struct group_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endgrent(); diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 3a44497cf848..434d86a31591 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -240,6 +240,8 @@ passwd_fill_test_data(struct passwd_test_data *td, int (*cb)(struct passwd *, void *)) { struct passwd *pwd; + const int limit = 1024; + int count = 0; setpassent(1); while ((pwd = getpwent()) != NULL) { @@ -250,6 +252,8 @@ passwd_fill_test_data(struct passwd_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endpwent(); diff --git a/lib/libc/tests/nss/getserv_test.c b/lib/libc/tests/nss/getserv_test.c index 486a8c20836f..cc66fdb2fa52 100644 --- a/lib/libc/tests/nss/getserv_test.c +++ b/lib/libc/tests/nss/getserv_test.c @@ -283,6 +283,8 @@ static int servent_fill_test_data(struct servent_test_data *td) { struct servent *serv; + const int limit = 1024; + int count = 0; setservent(1); while ((serv = getservent()) != NULL) { @@ -290,6 +292,8 @@ servent_fill_test_data(struct servent_test_data *td) TEST_DATA_APPEND(servent, td, serv); else return (-1); + if (++count >= limit) + break; } endservent(); From nobody Mon Jan 20 22: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 4YcPdt0XdPz5l2W2; Mon, 20 Jan 2025 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcPds6vyfz4LTX; Mon, 20 Jan 2025 22: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=1737410994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/QVT99ZWnhfRXpxzZeAt4fYdM8P0QU6JBan/8f0Ybo=; b=UA2zXHCv6DwG17mfaDRCfg7j2velq+TWAwHhEWOt16iwGm8qQrj4MdolaSYhQePybz++OJ SKO0Ub3aplXrcGkOB5+KNVg/7+Rfz3ulFyF3GaJP1R+TBnwHs9VsM5kQYzK5z/GWu+IZc6 EGWk7Yxf3Q5iKr6c3UMWKLWfqZNqH5m/5sCHAVDo773WKqBSDBRH7YY19kMsMWBX6nu/aQ JNP6LoYcgtzKKbMvAtDr/Nerzw+XBBxvgaiBG/BY21x/UajFXhuYMSiFHrnAqYVL46sQwm rKF+i609j3NnBfk1Q37QOW+PiG1nQBJ7QPN1cTNNthnJAllmbOrOHto32G43Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737410994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/QVT99ZWnhfRXpxzZeAt4fYdM8P0QU6JBan/8f0Ybo=; b=F1RbjIZs+wIEgpKa7Vz3TvipXn+Y+BkoxUUNN62XY3ujQY4CHs/57MJ55QHhekwZrrxe8B TQe+IKNwFC7Hf9OBFlZ/x1kH/Lo0QOytFcpq3aEriLQVjODzjKwAdZRH4hidsRLkOMdRVI WhWLsJVsiAHNvtDyBk1LE6gnWGdiG4mDEXopgKmINvPvj1BToWdpPTNW0fhBMlblIdpSiO oDsS7GhqbJ/oFgNskVwLp44oShFtacz2iUNa0df2o45ime3I619uTYoRkoPrnoMpUj9IA/ odCm8wUtHqveokb5yXC/tLuy7plxCOEUFKXdLwtN4JnA3Ms5ram7loZb7xDB+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737410994; a=rsa-sha256; cv=none; b=E1IkG9Lzt8HcYHElgdBAjwgLXa2DFsX7D4+2tBfTZabIHxRax+sv1HQis7uAd1UCI+aEML U9ptXRhBe8O4tkRZj7htYLDCK12rSAZDEnILyEJtLFdHlQBanbQsvFUD3pEPAe1lkWmF7+ 3/3x9zLu1mynPU9/T3XhhS4D0UqlfPLFz9o5WiCrJdDgGP1LmAAP8OAeYaxUTVxXemK1nn R4SJP98HQsx7AquJvOlQdk5YXFuCuYj3ALNu5AIgRGrIaQvTK9bTi1fLwXG6dzRCDznU2N 265Pp2eXj31u4P/KWe3qG/+AqY0lm8yWy/kCyB459taB4qcP7PPXH4WI4IRlVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcPds6KBWzffH; Mon, 20 Jan 2025 22:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KM9rLs052406; Mon, 20 Jan 2025 22:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KM9rSw052403; Mon, 20 Jan 2025 22:09:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:09:53 GMT Message-Id: <202501202209.50KM9rSw052403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 99d5ee8738a3 - stable/14 - ktrace: Fix uninitialized memory disclosure List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 99d5ee8738a354e0d8f12453a82ed87e47bd62f1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=99d5ee8738a354e0d8f12453a82ed87e47bd62f1 commit 99d5ee8738a354e0d8f12453a82ed87e47bd62f1 Author: Mark Johnston AuthorDate: 2025-01-20 13:50:04 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 22:08:45 +0000 ktrace: Fix uninitialized memory disclosure The sockaddr passed to ktrcapfail() may be smaller than sizeof(struct sockaddr), and the trailing bytes in the sockaddr structure will be uninitialized, whereupon they get copied out to userspace. PR: 283673 Reviewed by: jfree, emaste Reported by: Yichen Chai Reported by: Zhuo Ying Jiang Li Fixes: 9bec84131215 ("ktrace: Record detailed ECAPMODE violations") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48499 (cherry picked from commit 5b86888bae651e54ccc0adde0ed897ec1c1e0d45) --- sys/kern/kern_ktrace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 1c6a2ae01f3d..2b311f2d36dc 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -958,9 +958,16 @@ ktrcapfail(enum ktr_cap_violation type, const void *data) case CAPFAIL_PROTO: kcd->cap_int = *(const int *)data; break; - case CAPFAIL_SOCKADDR: - kcd->cap_sockaddr = *(const struct sockaddr *)data; + case CAPFAIL_SOCKADDR: { + size_t len; + + len = MIN(((const struct sockaddr *)data)->sa_len, + sizeof(kcd->cap_sockaddr)); + memset(&kcd->cap_sockaddr, 0, + sizeof(kcd->cap_sockaddr)); + memcpy(&kcd->cap_sockaddr, data, len); break; + } case CAPFAIL_NAMEI: strlcpy(kcd->cap_path, data, MAXPATHLEN); break; From nobody Mon Jan 20 22:26: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 4YcQ163bnWz5l3W2; Mon, 20 Jan 2025 22:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ16325hz4MQk; Mon, 20 Jan 2025 22:26:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737411994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bf44mUCweZEZUUc4+vIUNgOya69SnVBlIp18c/9oE54=; b=gYrE/zBx+CB11aZ45lmBoswoC9F2z1OAhNVR0G4JenhVcBKgN4+90d3z8ZEFyAA9gzthet e4FbfJizegagtTDNpbfaStu3WSYf8hlcCNlduKj9ZwM1FK3/PGn2dcTfQfqLXuVGHxgPYV 01tVUybKZXfjhby7zp2AD0nWbF8a69FSW/wFd0V8gKrDOX7at3gXq9hfbsFLGgOwlEW++4 IqaEqWP5Gxkic7XNZ5K4wqHymQFVXltoDBLZi3pMnUv3B5WcH4zkVqMCO4SDyR7SjZnDNO vS2Lsv9zXocYEnlMnuU+PEZoRlle6ryzVSRGi6gcGjNXPcvQKssrIFO388Vu9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737411994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bf44mUCweZEZUUc4+vIUNgOya69SnVBlIp18c/9oE54=; b=TWNBbpWROc5gvq9MCxPrXz76dVrEae8wt/ihBVxOr7U+iyhnRO+Sph9JmLcGQvohUL3z4q Ri5iP2Xtnqp1Mc85jJGPKUEUNurTW4Xre8+zRZw2F/8ybG6NtCc96De7d5KHrFx5OkkzpK wTHLwTSd5AxP7/V9kGiVwshbG5KnuFL0piNvCehCYhO31Bv2l8ZXYnXUhyXEfhERpOJNk6 2lyq2fEOYMSvjCIq6DFCkh7YV9if4Md7RtYYxRBEs1815nWOAvAP4ZEfQ8Be1ochPCASXU g/sLp08OBPrn8QCH/8HrSY9gee7G0nl7jaYiIhqqNzQoxTXL4KU8sUgtSKfzCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737411994; a=rsa-sha256; cv=none; b=OYXR57gnXsFmmxIxK9Nb+3zYCJOUaRK4ADlCINHjSW2mqU6ecQ0uxnTdLTjfLJPhuRANt9 t0xfpPvXMbyuMtIaMMv8GnlwJwzcZR7DXvFJEG9fpZc2RKxH9V+Wut2Huy7U1DakseH9+K /AQ5Xj2OfO9bXEYSk4gVVmb9+LWL0n/FyENEUF3o0Z4f9IH+Hh7L8HHbqSlZwfmLt+zMbI p1I9M5px3DuO4y1Rpfl6r6MjOufkltjPAsRZMOWUvkUv9pq9WjZVr6QqYgx+3XFauaOz2H fDI1tocEAH0/Y05XRGWnmyuKxKEeSBnJcUpPC2aodoUr5R8rlDwi3CF1aT8fFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ1627lQzg7R; Mon, 20 Jan 2025 22:26:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMQYqV088267; Mon, 20 Jan 2025 22:26:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMQYdY088264; Mon, 20 Jan 2025 22:26:34 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:26:34 GMT Message-Id: <202501202226.50KMQYdY088264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e758e5512005 - stable/13 - nfscl: fix uninitialized memory in nfsv4_loadattr List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e758e5512005abdc30285e95e39f98c01ae12d85 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e758e5512005abdc30285e95e39f98c01ae12d85 commit e758e5512005abdc30285e95e39f98c01ae12d85 Author: Alan Somers AuthorDate: 2024-09-08 20:42:38 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:16:11 +0000 nfscl: fix uninitialized memory in nfsv4_loadattr When processing an RPC response that did not include any Owner attribute, nfsv4_loadattr would return na_uid and na_gid uninitialized. The uninitialized values could then make their way into the NFS attribute cache via nfscl_loadattrcache. PR: 281279 Reported by: KMSAN Reviewed by: rmacklem Sponsored by: Axcient (cherry picked from commit 44328abfb7aca8150b07b83ff502c9185677e3fb) --- sys/fs/nfs/nfs_commonsubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index ebed4a4b5905..e35fd8d1185f 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -1280,6 +1280,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, * Just set default values to some of the important ones. */ if (nap != NULL) { + VATTR_NULL(&nap->na_vattr); nap->na_type = VREG; nap->na_mode = 0; nap->na_rdev = (NFSDEV_T)0; From nobody Mon Jan 20 22:29: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 4YcQ3y0fHhz5l3Sh; Mon, 20 Jan 2025 22:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ3x4xNbz4MxD; Mon, 20 Jan 2025 22:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9gn9D0j9BSG/lWEHx1DLHqV0Y7nUpgPUaMYp1ODZ9c=; b=tTRuGou5veBA+mVwz1oenmtEqUdUPBfJMaXRFK6wlcB1GvDRqv4ATi0O1X/HVm0WUZchGX nvjMA78zG9HD8u+MOgGfjMH6FrM9fkf+bV0IiONLlcvy9l0T5ArlcfupufBPdQk2OhXxp5 piQhvfzFG4Iuf5hxm7Nqd6V+OabiI8AXYiPAslGeCBYcu5Myu24VH8FIaEhOcuQxNBumrZ 8ZMaP3/r12n4Lwo2sexSbuBFsTk7u84lbdhUyFSj1l1UbxmvLohXSAb8UN1kLfVm/0BZ2Y Ur/wUcAMvxNOeKFOLIYZ/iyOBzwdaOmIE8FkRFA1K+YHm1pHFB4qB8k1kADJRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9gn9D0j9BSG/lWEHx1DLHqV0Y7nUpgPUaMYp1ODZ9c=; b=kWP7DoBFPOHOayhjye1ykastEQQQor0BZs/LZ14kFRaskPeS3V88akMRAZGvoWpw7+1qgk WJOZM90e1NaKnY1oGNBwzJ94BLg/j8DkuDY8eJLKPn7pr4OkV/SirNWLZWo1s2dJoYz66Q pD85uNxmyeZdmWIHV84HLHHFitMbHgFwTvfS/nEhggwHBdfRINXtMvaiW0dhtnu71c9nyv 78bZEZ8642QCWwUreNtHO2/rAzVSVFwnlldGzj9I0M43jLfGcKJCKUeqYFPFmuVifCkRf8 M4odVepPSFmXxaAQhWEY3CG+DgZFRo6ebW5TVkZzSiuhrlFIxkRj3vEESKZwYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412141; a=rsa-sha256; cv=none; b=cz5vXIRrzV8R07SGOJE2QcUIFxLwBiVmQYw2jr0iOR2+hNFOc/EQ46/WOPzbB0T/9Nt4gM JSipghK0Ib/oBxUZoZ5NDrpa36Fjq9pyF4ilFMynkwc2NJyrOPuo9PFA0UYUnZPeY87DQ+ u8wz7g7t5RtPYYIynTcpI1ZHpSXo2JChbtRB7fA+6fgQWTFiZOHWmK5Aw/1pyRP2QY58Tq aY3luw/hI9eilwesDWfV3wV4Od1Bqq9K6U/DEp9UX758/nJ4GOdKMJpQ02+vTTzskhMZKy H+GhmOQBZpS4r9VuNXxHmp6jUaA26w9fNVtWo5pXerLhohfMB8QsYtY0wR//6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ3x4VbnzgDP; Mon, 20 Jan 2025 22:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMT1l4089134; Mon, 20 Jan 2025 22:29:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMT1vr089131; Mon, 20 Jan 2025 22:29:01 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:29:01 GMT Message-Id: <202501202229.50KMT1vr089131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 06b782abaafe - stable/13 - tmpfs: remove duplicate flags check in tmpfs_rmdir List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 06b782abaafe56674fc2be847dea4ab28c1cddf0 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=06b782abaafe56674fc2be847dea4ab28c1cddf0 commit 06b782abaafe56674fc2be847dea4ab28c1cddf0 Author: Claudiu AuthorDate: 2024-10-13 20:00:42 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:27:26 +0000 tmpfs: remove duplicate flags check in tmpfs_rmdir Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D47100 (cherry picked from commit ec22e705c266ff629cc5ec47b84f67ba02b7b924) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 3c61938f8cae..f1add1ed6ab9 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1307,6 +1307,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) goto out; } + /* Check flags to see if we are allowed to remove the directory. */ if ((dnode->tn_flags & APPEND) || (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND))) { error = EPERM; @@ -1324,13 +1325,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_nameptr, v->a_cnp->cn_namelen)); - /* Check flags to see if we are allowed to remove the directory. */ - if ((dnode->tn_flags & APPEND) != 0 || - (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { - error = EPERM; - goto out; - } - /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); if (v->a_cnp->cn_flags & DOWHITEOUT) From nobody Mon Jan 20 22:31: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 4YcQ6Q6sJCz5l3X1; Mon, 20 Jan 2025 22:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ6Q5G8rz4N6L; Mon, 20 Jan 2025 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClAYY6SyotThsffXwxqDKRbq9ng3J19+e8fOA4YoTMQ=; b=nM9UfAqAqjbfX038sda8o1+98KMW/gJSKHtVmdbEfIelQVMXPW4QkPOrNItpqG/IUMpVes 6OHfIoNcigKsCwmRj3P0ua+HbfXGZliyGz2cIEZkBlM5/H+XOrJw1bK1us4B4cU9zqU2m1 TVss5rtQQg+iQ5tdGo4la02QQDnNimw0i1/QK46VHHpXG1MsJ8THaeRlTmkzO1pIUJ9u0X dLYbfPCDkFq5rTaFICS9sGaD8RMU0AojFpPQ9sLVaKwmFvUt1QhezKeDZ+k/Y7/tAWGykq LKhmA3VPQzQWQXHSDhGd9fVHyrgKvZ9nCeQgXIavoxis1bm96CVdhUFWg0O1+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClAYY6SyotThsffXwxqDKRbq9ng3J19+e8fOA4YoTMQ=; b=B9eloIu1qU3+A6HM4VH9EOhSxelLuXBKrBYihEAWH49wX+tsLg0sX119GkScgc/jPEZHs9 Jkn5kSq71iDORboNlhxdlnGsm4BfrP7IAl2XXQD7h4IuZd/0k1ar8Dp265RBqF7YtH1jWA XBE0KSRkCHoyeWSX/7jBTzNH+VGFnS/uJ1UsvSpT5Mq/KghYWEam1Smm1xBrc88/+tEYNv WgAJqK9AuOPs62yedvFdCE4jxaQ+STBysDTTsIOjavL9tqq0NAwN1v8jY8M4quTK3g+UGB 4wG14vIDWQhAGTxhZJjiK+4uv5g4pbkzyD5Z1fSMi/Zslujb6rlfIHhi3UBuTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412270; a=rsa-sha256; cv=none; b=oy030Hhnen11mf5z5zIFTsZZJKPThjV/WY6NI/cWmEXvaexQ5wTymG2c/FMw73cTEPGLCY 38QzzP7QjL/F3UmmIJJAAvGrTKMpjVaFZ2PRZz5rORgsYqY0MoONT8/SuIX3YSENpZ5GVt sInwwCH6ruNp4SdT3R1geFkcwhLNOdHf456FLOIYElytrP6fTd6uYg6Rn77OjDVgOenMNJ Y6zufHEXMA294/kJHKmU5dSIteLVGnHSvGK3Zu92RTQiUChbmx4bh6w4SVxGj/A2KeGBlI u0wcAPoWIOT4zdgYuTEm/luAksmKcExCFzeah9byHyO04Kgb2Q0qjUAFQz7XwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ6Q4sYJzfpm; Mon, 20 Jan 2025 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMVADU000331; Mon, 20 Jan 2025 22:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMVA8l000311; Mon, 20 Jan 2025 22:31:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:31:10 GMT Message-Id: <202501202231.50KMVA8l000311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1bcf8494d934 - stable/13 - ktls.4: note that security/gnutls now supports ktls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1bcf8494d934bda897ca52e8dbbebec55e940e68 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1bcf8494d934bda897ca52e8dbbebec55e940e68 commit 1bcf8494d934bda897ca52e8dbbebec55e940e68 Author: Alan Somers AuthorDate: 2024-10-28 15:14:06 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:30:57 +0000 ktls.4: note that security/gnutls now supports ktls [skip ci] PR: 278083 Sponsored by: ConnectWise Reviewed by: diizzy Differential Revision: https://reviews.freebsd.org/D47310 (cherry picked from commit 7200d90644ba61d63e6fec33855bba5d3b7eb7bd) ktls.4: note that there are multiple openssl ports with KTLS knobs [skip ci] Reported by: "Herbert J. Skuhra" Sponsored by: ConnectWise (cherry picked from commit 1e4da42a36d5cf44bacf0e261626b69a4761f0cc) --- share/man/man4/ktls.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index a2942544a5eb..b6e89f054bf7 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd May 26, 2021 +.Dd October 31, 2024 .Dt KTLS 4 .Os .Sh NAME @@ -229,8 +229,10 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa security/openssl-devel -port may also be built with support for +.Fa security/openssl* +and +.Fa security/gnutls +ports may also be built with support for .Nm by enabling the .Dv KTLS From nobody Mon Jan 20 22:33: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 4YcQ8k3VWgz5l3ng; Mon, 20 Jan 2025 22:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ8k2kZTz4NY7; Mon, 20 Jan 2025 22:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GGkjC5Pj2ZaRZfpglaNsoUK5gj0PTLOxhX+p9isKfws=; b=kMIE77DoMkli0egqzTb2XBA+eYxzzL2745QfjvYdvKye866ZDc6ruCGWmj/jqykY403m4g XBfMl/iIeGce8Zdu2O7JWn/cfCdd6gofrf2u9Y7W3CsbPrxyPhrUzynOXdmriXMAD/waw/ VLsCJA7KbPV+2dHSAZ5PDSxCxAmRA4NqIiEaNrKhwDFKKxOkXXLOB/j/4VIpYz/OBmwRKq VZmlX4+i0ARpr5KSR3IpsclQGReEeaNnyMpnqHbBXSPxBevgWLiIodbCkb/S8v2ezD3Z6L CgL1aBlEv56IYGWn3uW3UOhvXeZBS9m9RvVNKQiJTLLi2Z+9hXVtPThUUjh0Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GGkjC5Pj2ZaRZfpglaNsoUK5gj0PTLOxhX+p9isKfws=; b=VH4gX/blK56UIhtsAp3fAbgv091PT6qtMtbGCwyT+SVTJCtSbg0fWd/iR9tu45jpwpJgbY /TWKws59NFVg3694KsYQEtE0eThKZjUKzPgUr0ZBuSy8JEwP1bULtr1+HUTzjhIAVTwEGZ +inii79RnfGD5pXQGkPHHrX0GthCAG/y68uRLdFUEmvS21PBBkzt8tyaxoVZF4U3iBjQl4 JUnCcWkrB7xBe+TNYQtIJoF85JJKsQNlRR9MF21Uv9yfRhxDfdOZ//PI/EjVO22mVCZnTw 39FDdRN1d/5yA99dW4WxctG0gbkWgv5yP/1NV/EFt4K8OaWOd2XuUNV5yOvt9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412390; a=rsa-sha256; cv=none; b=vW3L1jhGBsAn3dLZBanNm1HFp4WdP/4x0ou+qGeyLF/FHPCsxKietV1yw0/griHfdD3VXN 8W+UABmgDGq08PaEs5r4z/6sVvx8u2j7/6GkuHsm0KY/WNY9M7GugExPaUR5pEimL7XToJ RFleMCKDAy2mueY/eSZd6/dxaxvdLIIdiMSsaFXbsaGWpwU8cQtUP1uep4d4Ul+ErEeCWl QvrShdtFubv7BTNZ/kIJembJwcFK2HjGqliHNwVBMIxNJqIzM8+xwjb3t356pCzfJiQQMl RSHkRMamnCmNX7r9sKIgUVqovg2MyXcE5P22V8Srr45hA2HdmBw7wr8EFdqkhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ8k276pzgRW; Mon, 20 Jan 2025 22:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMXAqx006278; Mon, 20 Jan 2025 22:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMXAbL006275; Mon, 20 Jan 2025 22:33:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:33:10 GMT Message-Id: <202501202233.50KMXAbL006275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 2b4a45992a04 - stable/13 - fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b4a45992a043459ab0d63410059822a2efb6045 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=2b4a45992a043459ab0d63410059822a2efb6045 commit 2b4a45992a043459ab0d63410059822a2efb6045 Author: Alan Somers AuthorDate: 2024-12-13 14:00:20 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:31:29 +0000 fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint Unusually, the FUSE_NOTIFY_INVAL_INODE and FUSE_NOTIFY_INVAL_ENTRY messages are fully asynchronous. The server sends them to the kernel unsolicited. That means that unlike every other fuse message coming from the server, these two arrive to a potentially unbusied mountpoint. So they must explicitly busy it. Otherwise a page fault could result if the mountpoint were being unmounted. Reported by: JSML4ThWwBID69YC@protonmail.com (cherry picked from commit 989998529387b4d98dfaa6c499ad88b006f78de8) --- sys/fs/fuse/fuse_device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c index 88ebe702ec0a..7b163bc04bc2 100644 --- a/sys/fs/fuse/fuse_device.c +++ b/sys/fs/fuse/fuse_device.c @@ -440,7 +440,6 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); - mp = data->mp; if (uio->uio_resid < sizeof(struct fuse_out_header)) { SDT_PROBE2(fusefs, , device, trace, 1, @@ -543,6 +542,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) } else if (ohead.unique == 0){ /* unique == 0 means asynchronous notification */ SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); + mp = data->mp; + vfs_ref(mp); + err = vfs_busy(mp, 0); + vfs_rel(mp); + if (err) + return (err); + switch (ohead.error) { case FUSE_NOTIFY_INVAL_ENTRY: err = fuse_internal_invalidate_entry(mp, uio); @@ -567,6 +573,7 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) /* Not implemented */ err = ENOSYS; } + vfs_unbusy(mp); } else { /* no callback at all! */ SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket, From nobody Mon Jan 20 22:34: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 4YcQ9h4f5Cz5l3XC; Mon, 20 Jan 2025 22:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ9h44nGz4NrV; Mon, 20 Jan 2025 22:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EcxDoGDWQnoGaG8omec9RCot2a5QA73F58v44rQOsMg=; b=IaT6wNZzuONk08HOuaXAOjZqdl0a5SyyZKR+eeTeZSBrK8mXkqNAq13ZrxL4wvaGV/j/b8 uS+a+z+LAdsciUFh8a5snMiaRe4GREI666SCEjweWuszwWvwQA2Js2NgTOHB0nZP5ZbfDf NAjIqWip/oLvtBYm1t4mbdn5UqXnOODYOP9vMnQaAM7Ra/oWiIGJOy96ww1S1tvUQTJxnQ TKhAbqPMY+lUKE59GT78ALmjoEG6nUdPlOKnEXnpWfEJq14DnoCyhEoGaybWlxws0gh6kv yXQLvZqb5e0nYpt0qTl8jcEYIRAlob2M+KdB3jFPrn6A1NFWK60CKqAwWYi7kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EcxDoGDWQnoGaG8omec9RCot2a5QA73F58v44rQOsMg=; b=EjgJ4exgcyMUC+B6Rs8KxGEk5sHy3U7MureXE0aSLZ9zJ5lmMPmGF9yhuuTBPbNi4nsixb cIsqzR4k+PnNb+RdTAGMsqoxI6xFpHVfnSijdr3V2UtFoJDw/nETdasnvfaoq9Gjygx3+e 27Cm0+PebsB5pOc1KrlReTTfJxvy3OnY2OgATHAlqxDRj4WQ21Hsu+X+0s/iCPkX3s6Q19 jBJNEn3SnkPJ0yDCh4VqyZFDGnYgvyXtZggssAS/gQEcqdUYrxNWXxKHrcmvQjriEsNxqf tz4YZ8SAfhFZHTz2wocsMJryGBgWHhqrcKHCxPAwv2NuKhlwrZhGLRv33X3N/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412440; a=rsa-sha256; cv=none; b=G0+XByU3bOIv3WpSwFC7qf1R5JlnEDAKVuRd8QAPcVtG91bSZEU4XWN9ZPdv+XJoWCYaEJ c6IucZfm3/+kqOi9Sx2LE+q95E+dXvytUGbioYw3d8adYqYXB45M4jTFrTfq9EgX8ZeDpJ W59VpAX5w/yK1HhdQ8cSMxU2Oyqv6uHh7dYyswORcxV9IX8qFG7wR9shSnhGGZ+ng5uG2U RLjC0hOEmvK6oV7gkWaU0toP+lee5dNhGjlPVnz42sP2+xs45m1fQHh4vNu6Pc5Z4O3dV8 NnUzlSxjQW0HJ5FM9l4Fcg5T8/XiI/PJSSLh0v9TL+ZmEV8EeUba6RS6a518rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ9h3hJYzflT; Mon, 20 Jan 2025 22:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMY0jk006666; Mon, 20 Jan 2025 22:34:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMY0K8006663; Mon, 20 Jan 2025 22:34:00 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:34:00 GMT Message-Id: <202501202234.50KMY0K8006663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 4ded81daacec - stable/13 - namei: add more detail about LOCKSHARED's behavior List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 commit 4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 Author: Alan Somers AuthorDate: 2024-12-17 20:10:57 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:33:53 +0000 namei: add more detail about LOCKSHARED's behavior [skip ci] Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48125 (cherry picked from commit 22bb70a6b3bb7799276ab480e40665b7d6e4ce25) --- share/man/man9/namei.9 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9 index 8890abedcc59..9e60985a4965 100644 --- a/share/man/man9/namei.9 +++ b/share/man/man9/namei.9 @@ -31,7 +31,7 @@ .\" If you integrate this manpage in another OS, I'd appreciate a note .\" - eivind@FreeBSD.org .\" -.Dd May 23, 2015 +.Dd December 17, 2024 .Dt NAMEI 9 .Os .Sh NAME @@ -124,7 +124,6 @@ Lock vnode on return with unless .Dv LOCKSHARED is also set. -The .Xr VOP_UNLOCK 9 should be used to release the lock (or @@ -153,8 +152,20 @@ and .Xr vrele 9 . .It Dv LOCKSHARED Lock vnode on return with -.Dv LK_SHARED . -The +.Dv LK_SHARED , +if permitted by the file system that owns the vnode. +The file system must explicitly permit this by setting +.Dv MNTK_LOOKUP_SHARED +in +.Dv mp->mnt_kern_flag +during mount and by calling +.Fn VN_LOCK_ASHARE +when allocating the vnode. +If +.Dv LOCKLEAF +is specified but shared locking is not permitted, then the vnode will be +returned with +.Dv LK_EXCLUSIVE . .Xr VOP_UNLOCK 9 should be used to release the lock (or From nobody Mon Jan 20 22:36: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 4YcQDD1xXkz5l40p; Mon, 20 Jan 2025 22:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQDD1Gs9z4PNb; Mon, 20 Jan 2025 22:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8cOFrXr9SzMMm2vTufQEs4PLbdIMo3IL2MuEB9+RRg=; b=TAQ/Ak2HhWJVJAMMpFOMMAvttGeqYHXNw1SJhSekeF4/VDg6HuOi8X9cT+m89lX/e9NhA8 fUQrFrJlVZ/Kt9gpd4P1xaz6wAEFMjTQghJQhi1LQFeTiqKfEKF97wzJke8We+csCAA1jF 0zBf0gUcWpeYBAVGbgM5DpwaU/hvP/Dfr2Km813KjPlQfFxpNAWYJSLrLtPGn9p+ZF0fWv 37b8ahAO/ru8j95FQszk5oqZkpEqxdfkepCwBrB/y9e5d3xDMmAnVm+otN+Gar6nJCNM/6 0/+TnGln0OiTrxKIZUKU3PNXVgjOjJIYKklWoJ5MV1tUIZ2a0yZD3AxgjqZ7dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8cOFrXr9SzMMm2vTufQEs4PLbdIMo3IL2MuEB9+RRg=; b=yjprEesQzbVKGn7/VBhuInuj6dzjK+dYZ8sJxNHQclSkfkcv/D7oXhGNkbFliM7ip9ZyAD CBZQ2TwASwBmo990yquuuJaXDHz1ZGZghI99P38CyXUYTkS0ZCvd2PmAklydV+he+rjnNJ 8SyAQRoNjM7nJx62UXf9EYtEBjUZWsJLIkviJ32jGWwTdyGGXaAI+epR2tAaiMF6F87eBf LMBW3Wxr+iuiVCpg+EPFgnHKak6JdAZewKm+Q8/8AstbzVXXlNyhv0eg9DlJGZnNS+P9AX vxc5Vtzkhh77eD3voZhlClCVs07EcHD5AaklDMCon1uY2iRl4l41zz6D6xgQlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412572; a=rsa-sha256; cv=none; b=Mjwln21aGXQ/ApHcf5+hv8kGOYBUNjRKO1mpV9+DPqR/m96yqISkFL0OMiyIhYgX6PDeZW /tvu4Czdhid9LVG+2i1KK4/Odn0v0ueLIqG/TWfFD8yNy3lHpXK5M4cCRQFbK4OZkdvnwO ul0lRoZiivudrupbJs6a7DimGGNCz0Di51efNhe2wVOG8SurlmQ2jicm65aCq9bxE2qWDU c/l7rogIfZKG+xOKZj5/Rvd3N4C/oP34vzjKdcACRHIPuUBGhFcsaYBEmRfZg+0jrBYmsY R/h7ATKiLzbfFwYuyNN55WW+wFvdOOB7cWuMt/kpomFm75U5HpPI4ksnQwgr9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQDD0s5tzgDl; Mon, 20 Jan 2025 22:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMaCCW007404; Mon, 20 Jan 2025 22:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMaCdQ007401; Mon, 20 Jan 2025 22:36:12 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:36:12 GMT Message-Id: <202501202236.50KMaCdQ007401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 039609b04d63 - stable/13 - fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 039609b04d63f2e597d70fec66915a766834e81c Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=039609b04d63f2e597d70fec66915a766834e81c commit 039609b04d63f2e597d70fec66915a766834e81c Author: CismonX AuthorDate: 2024-11-02 20:19:15 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:34:18 +0000 fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags The FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT flags are only meant to indicate kernel features, and should be ignored if they appear in the FUSE_INIT reply flags. Also fix the corresponding test cases. Reviewed by: Alan Somers Signed-off-by: CismonX Pull Request: https://github.com/freebsd/freebsd-src/pull/1509 (cherry picked from commit f0f596bd955e5b48c55db502e79fc652ac8970d3) --- sys/fs/fuse/fuse_file.c | 9 +++------ sys/fs/fuse/fuse_internal.c | 4 ---- sys/fs/fuse/fuse_ipc.h | 2 -- sys/fs/fuse/fuse_vnops.c | 17 ++++++++--------- tests/sys/fs/fusefs/open.cc | 38 ++------------------------------------ tests/sys/fs/fusefs/opendir.cc | 27 ++------------------------- 6 files changed, 15 insertions(+), 82 deletions(-) diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c index ecaa641a9261..22fc283e263c 100644 --- a/sys/fs/fuse/fuse_file.c +++ b/sys/fs/fuse/fuse_file.c @@ -123,7 +123,6 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct mount *mp = vnode_mount(vp); - struct fuse_data *data = fuse_get_mpdata(mp); struct fuse_dispatcher fdi; const struct fuse_open_out default_foo = { .fh = 0, @@ -133,12 +132,10 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_open_in *foi = NULL; const struct fuse_open_out *foo; fufh_type_t fufh_type; - int dataflags = data->dataflags; int err = 0; int oflags = 0; int op = FUSE_OPEN; int relop = FUSE_RELEASE; - int fsess_no_op_support = FSESS_NO_OPEN_SUPPORT; fufh_type = fflags_2_fufh_type(a_mode); oflags = fufh_type_2_fflags(fufh_type); @@ -146,12 +143,11 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, if (vnode_isdir(vp)) { op = FUSE_OPENDIR; relop = FUSE_RELEASEDIR; - fsess_no_op_support = FSESS_NO_OPENDIR_SUPPORT; /* vn_open_vnode already rejects FWRITE on directories */ MPASS(fufh_type == FUFH_RDONLY || fufh_type == FUFH_EXEC); } fdisp_init(&fdi, sizeof(*foi)); - if (fsess_not_impl(mp, op) && dataflags & fsess_no_op_support) { + if (fsess_not_impl(mp, op)) { /* The operation implicitly succeeds */ foo = &default_foo; } else { @@ -161,7 +157,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, foi->flags = oflags; err = fdisp_wait_answ(&fdi); - if (err == ENOSYS && dataflags & fsess_no_op_support) { + if (err == ENOSYS) { /* The operation implicitly succeeds */ foo = &default_foo; fsess_set_notimpl(mp, op); @@ -175,6 +171,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, goto out; } else { foo = fdi.answ; + fsess_set_impl(mp, op); } } diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index adf84d30e801..9f47d960d050 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -1012,10 +1012,6 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) data->dataflags |= FSESS_POSIX_LOCKS; if (fiio->flags & FUSE_EXPORT_SUPPORT) data->dataflags |= FSESS_EXPORT_SUPPORT; - if (fiio->flags & FUSE_NO_OPEN_SUPPORT) - data->dataflags |= FSESS_NO_OPEN_SUPPORT; - if (fiio->flags & FUSE_NO_OPENDIR_SUPPORT) - data->dataflags |= FSESS_NO_OPENDIR_SUPPORT; /* * Don't bother to check FUSE_BIG_WRITES, because it's * redundant with max_write diff --git a/sys/fs/fuse/fuse_ipc.h b/sys/fs/fuse/fuse_ipc.h index 0ec556138be0..5648624f4c63 100644 --- a/sys/fs/fuse/fuse_ipc.h +++ b/sys/fs/fuse/fuse_ipc.h @@ -227,8 +227,6 @@ struct fuse_data { /* (and being observed by the daemon) */ #define FSESS_PUSH_SYMLINKS_IN 0x0020 /* prefix absolute symlinks with mp */ #define FSESS_DEFAULT_PERMISSIONS 0x0040 /* kernel does permission checking */ -#define FSESS_NO_OPEN_SUPPORT 0x0080 /* can elide FUSE_OPEN ops */ -#define FSESS_NO_OPENDIR_SUPPORT 0x0100 /* can elide FUSE_OPENDIR ops */ #define FSESS_ASYNC_READ 0x1000 /* allow multiple reads of some file */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ #define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index aa44366ccb95..79317e4e4cd2 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1961,10 +1961,9 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) tresid = uio->uio_resid; err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); if (err == EBADF && mp->mnt_flag & MNT_EXPORTED) { - KASSERT(fuse_get_mpdata(mp)->dataflags - & FSESS_NO_OPENDIR_SUPPORT, - ("FUSE file systems that don't set " - "FUSE_NO_OPENDIR_SUPPORT should not be exported")); + KASSERT(!fsess_is_impl(mp, FUSE_OPENDIR), + ("FUSE file systems that implement " + "FUSE_OPENDIR should not be exported")); /* * nfsd will do VOP_READDIR without first doing VOP_OPEN. We * must implicitly open the directory here. @@ -3118,21 +3117,21 @@ fuse_vnop_vptofh(struct vop_vptofh_args *ap) return EOPNOTSUPP; } if ((mp->mnt_flag & MNT_EXPORTED) && - !(data->dataflags & FSESS_NO_OPENDIR_SUPPORT)) + fsess_is_impl(mp, FUSE_OPENDIR)) { /* * NFS is stateless, so nfsd must reopen a directory on every * call to VOP_READDIR, passing in the d_off field from the - * final dirent of the previous invocation. But without - * FUSE_NO_OPENDIR_SUPPORT, the FUSE protocol does not + * final dirent of the previous invocation. But if the server + * implements FUSE_OPENDIR, the FUSE protocol does not * guarantee that d_off will be valid after a directory is * closed and reopened. So prohibit exporting FUSE file - * systems that don't set that flag. + * systems that implement FUSE_OPENDIR. * * But userspace NFS servers don't have this problem. */ SDT_PROBE2(fusefs, , vnops, trace, 1, - "VOP_VPTOFH without FUSE_NO_OPENDIR_SUPPORT"); + "VOP_VPTOFH with FUSE_OPENDIR"); return EOPNOTSUPP; } diff --git a/tests/sys/fs/fusefs/open.cc b/tests/sys/fs/fusefs/open.cc index 7ab3aeb6ba2a..e80d1aa2a393 100644 --- a/tests/sys/fs/fusefs/open.cc +++ b/tests/sys/fs/fusefs/open.cc @@ -70,14 +70,6 @@ void test_ok(int os_flags, int fuse_flags) { } }; - -class OpenNoOpenSupport: public FuseTest { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPEN_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * fusefs(5) does not support I/O on device nodes (neither does UFS). But it * shouldn't crash @@ -281,37 +273,11 @@ TEST_F(Open, o_rdwr) } /* - * Without FUSE_NO_OPEN_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Open, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - int fd; - - FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_OPEN && - in.body.open.flags == (uint32_t)O_RDONLY && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).Times(1) - .WillOnce(Invoke(ReturnErrno(ENOSYS))); - - fd = open(FULLPATH, O_RDONLY); - ASSERT_EQ(-1, fd) << strerror(errno); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPEN_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPEN, then it and subsequent FUSE_OPEN and FUSE_RELEASE operations will * also succeed automatically without being sent to the server. */ -TEST_F(OpenNoOpenSupport, enosys) +TEST_F(Open, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; diff --git a/tests/sys/fs/fusefs/opendir.cc b/tests/sys/fs/fusefs/opendir.cc index dd837a8d43c1..e1fed59635fc 100644 --- a/tests/sys/fs/fusefs/opendir.cc +++ b/tests/sys/fs/fusefs/opendir.cc @@ -71,13 +71,6 @@ void expect_opendir(uint64_t ino, uint32_t flags, ProcessMockerT r) }; -class OpendirNoOpendirSupport: public Opendir { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPENDIR_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * The fuse daemon fails the request with enoent. This usually indicates a @@ -179,27 +172,11 @@ TEST_F(Opendir, opendir) } /* - * Without FUSE_NO_OPENDIR_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Opendir, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - - expect_lookup(RELPATH, ino); - expect_opendir(ino, O_RDONLY, ReturnErrno(ENOSYS)); - - EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPENDIR_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPENDIR, then it and subsequent FUSE_OPENDIR and FUSE_RELEASEDIR * operations will also succeed automatically without being sent to the server. */ -TEST_F(OpendirNoOpendirSupport, enosys) +TEST_F(Opendir, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; From nobody Mon Jan 20 22:41: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 4YcQLS14Kbz5l3w2; Mon, 20 Jan 2025 22:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQLS0c51z4PqL; Mon, 20 Jan 2025 22:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmIMeodK1dhZEBu7RSPwC+mzxNYJRGA2Hk/abyZsSGA=; b=S2KU0/W4OaHMUIa5QM62THenaaKN3atx2ZmClFktK0FQxFyfmo2zarzo48fDZjISXNG0nr coYQ7k7wXFG6TKFgN9MIHXX0QzT04VpBMzo9lP2RDvd8jdY9IJ0iqsG+/ul7MdupF27P8S w8jXndKppNhVLzQwX/PL5DIcIOfnVpHI1B/UysVZAjVpVBJmOJuU05agCMyhn6qBLbnDft UJQFgyFSXtMN0AZlxAkWQ39qIduwL67TpQKX5d+WcWYY479mf0oeYfUWLLgxDK/gg6AI5Y IRbJ1acBgBjPTgZ6rudwkO43dOqf/lD6DO93YjGIASmrsIdjokftBjDQBOVuAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmIMeodK1dhZEBu7RSPwC+mzxNYJRGA2Hk/abyZsSGA=; b=JLs9qnmyTbXhTj4NSmTt3+rg56/M//E550MpXr7vX/U5/gTFpGwMZDhbWwJX1MTSYseUYX KssSr/NqtJR8y9OEhaRcAzVGpQMF8S/q8eXrXA84XKavNBYsr7x73yR18jWipSwk/B1lP8 ubMTOcI3S5oAOiOmy38Il5O0g2AwAkwRMzYHpiSFyXgJfKZx2624EVU+vaV+AE7YR29F8u Pey1MDQWjO7R04Elnclr9aCZzCw6rThR7mfLodhgazPR1JIX9N2CHAc4mqRaRk3tokNjJ2 PqDWePkXYCyaFanNtkNybalr0cM2VcNwB2J+9L+jmTHZv0/XqR33sQ9XVchk9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412896; a=rsa-sha256; cv=none; b=DdLOH/eGvDivRg8E4q+epncXspeVlGiENTwf7JZNx8sUviGf+onaN0gn51TNxvj1TtA0G2 WoOS0cjiT6ihnkUgipzX1K72yBlVGJLVxFQdLD2HWR3CB4ORBWovvGzkCh68q/udanZASf Ulo1jMts95CYe1srFDUIlVa6zOtcjobJUyfrzYS2/XTl0JD6XJL25wsZ3vXG0pgE2Ug5RG L2l/S80ao1rFFBHVWwAH4ChiljFgMIbdc4PgQyb2omkuuJZigT5sdyKGHxN5STDUZc1JGX moFmgU1mtCfhOKtP27weCXR6EB4MyMKpTGuqItOHXDS0+obe0w7vxQzoRD6hbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQLR70v5zgX6; Mon, 20 Jan 2025 22:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMfZS8020836; Mon, 20 Jan 2025 22:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMfZf7020833; Mon, 20 Jan 2025 22:41:35 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:41:35 GMT Message-Id: <202501202241.50KMfZf7020833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e8a272048a0f - stable/13 - fusefs: fix a memory leak List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e8a272048a0fc9f558c7788dd06b0159b56c4585 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a272048a0fc9f558c7788dd06b0159b56c4585 commit e8a272048a0fc9f558c7788dd06b0159b56c4585 Author: Alan Somers AuthorDate: 2024-12-23 20:26:11 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:36:27 +0000 fusefs: fix a memory leak Fix a leak of a fuse_ticket structure. The leak mostly affected NFS-exported fuse file systems, and was triggered by a failure during FUSE_LOOKUP. Sponsored by: ConnectWise (cherry picked from commit 969d1aa4dbfcbccd8de965f7761203208bf04e46) --- sys/fs/fuse/fuse_vfsops.c | 2 +- tests/sys/fs/fusefs/nfs.cc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 858fd768cb1d..156e7b288c85 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -566,7 +566,7 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) error = fdisp_wait_answ(&fdi); if (error) - return error; + goto out; feo = (struct fuse_entry_out *)fdi.answ; if (feo->nodeid == 0) { diff --git a/tests/sys/fs/fusefs/nfs.cc b/tests/sys/fs/fusefs/nfs.cc index 79fead8e77cb..27ffc8f5cbc1 100644 --- a/tests/sys/fs/fusefs/nfs.cc +++ b/tests/sys/fs/fusefs/nfs.cc @@ -144,6 +144,36 @@ TEST_F(Fhstat, lookup_dot) EXPECT_EQ(mode, sb.st_mode); } +/* Gracefully handle failures to lookup ".". */ +TEST_F(Fhstat, lookup_dot_error) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = mode; + out.body.entry.nodeid = ino; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .WillOnce(Invoke(ReturnErrno(EDOOFUS))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(-1, fhstat(&fhp, &sb)); + EXPECT_EQ(EDOOFUS, errno); +} + /* Use a file handle whose entry is still cached */ TEST_F(Fhstat, cached) { From nobody Mon Jan 20 22:42: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 4YcQM500Nnz5l3w5; Mon, 20 Jan 2025 22:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQM46V99z4QD3; Mon, 20 Jan 2025 22:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p4EVGgSfJrXYEJjWMBdevhoKKYo9z9tCdNwBn2Qxboo=; b=xFioA5yFXI7dbWDUsRCJjUms/3VbZi8NDkYamKodjP0PpfPrAsO2tnINuIPA9ksVc9E5y0 K4CaWfuWFy6en4rAXcT6/2UL0ZIgDeNlRhGdyZVUUNtPXeJ4KjpnQWsjyRvHXFX/5U8Xx/ usj6IgH4Qqh/tGF/U6rXGAfP7wlvGKkHzojRTlH/yuczmWvjc3vlSkc2C/iXl/ptOiWGJH ctBy48L1GpjzZt7/2XMQ0b01UIZ2J1UwKG7qAICQ4dLEi33K/orscmIAeRzstvQHF4TXG6 HI7k+oVGuO7kJccMnwNGJQoBn5EU43eK7syHIP8VSuhgn5moFppcFdkUUUEbkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p4EVGgSfJrXYEJjWMBdevhoKKYo9z9tCdNwBn2Qxboo=; b=MbZy3DvbHD7A5U48jwvvuXYxlJI1YmHC0El8o5baHAHSPwLtFmPJI7h3MX3mqOGj3lfCKK onnJkB0NdIvfbmNvPoIN93wMwWDAJFDxTvs67HGzvvMYoR5ZVbJA2gTS26hvFKMntk9Pdm C7xnwe3mN2e29RNNazXzNwSFwUCgQjTmUlOnmMcbYpxxZg6S8jskUYsfv03RQsx/mlaF+s FKbwD5F8lx4KsoVwWtEQT2A5iJsKQ9raHxjFL9jBhsPmzUVZwLa2iC4f1K0UnOpTUtwjv0 FZ4qJ6XzHZ0kqE6zJ6hpc/ewnY/DXW4F0MVcmq4014cjmWTf+bHX4j18rF6Pnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412928; a=rsa-sha256; cv=none; b=n/D0Oc1pU96/a5obweksQsGJldLX2TlS0ixST1jarWVYtZLRVmgtVXHOIgfWCt6NwoqB9f dAZnZkDMmOvniwVY1ZQP85oY/M9hU/9i5wz3yDNZ9Slvmpk8iKkjTIjF/8IL9cnV0m1fGb qGfZvFylZuCfIu/IO2MKsRUfD7PMrQga7rqD0OKc7/hQ1Qdu3bWRwOHET3M98vV/elVzfP TX6P6Ba/sfDn98zvSNP6Fu8vvYuXPcWbnEQdDqiUOY5c3YvYg5ZWOhVW3NGGiYmajvr26z km4AZrAK217Zg4GIjtoFDbDsmEI17S/thA/OpSA0RKcTkm4NRmc5UwdmOuqkPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQM463bhzgXV; Mon, 20 Jan 2025 22:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMg8TZ022069; Mon, 20 Jan 2025 22:42:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMg8lX022066; Mon, 20 Jan 2025 22:42:08 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:42:08 GMT Message-Id: <202501202242.50KMg8lX022066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1486bb0bfcac - stable/13 - Fix lib/libc/nss/getgr_test with large numbers of 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2 commit 1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2 Author: Alan Somers AuthorDate: 2024-12-31 20:41:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:41:52 +0000 Fix lib/libc/nss/getgr_test with large numbers of groups These tests create a linked list with one entry for every group on the running system. On a system with about 30,000 groups, the test took 69 seconds to run, and crashed Kyua with the below error: kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db). Fix the test by limiting it to operating on the first 1024 groups. Apply the same change to getpw_test and getserv_test too, which are vulnerable to the same problem. Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48275 (cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd) --- lib/libc/tests/nss/getgr_test.c | 4 ++++ lib/libc/tests/nss/getpw_test.c | 4 ++++ lib/libc/tests/nss/getserv_test.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c index 28c5e2e98028..f3aef0e1abd1 100644 --- a/lib/libc/tests/nss/getgr_test.c +++ b/lib/libc/tests/nss/getgr_test.c @@ -294,6 +294,8 @@ group_fill_test_data(struct group_test_data *td, int (*cb)(struct group *, void *)) { struct group *grp; + const int limit = 1024; + int count = 0; setgroupent(1); while ((grp = getgrent()) != NULL) { @@ -304,6 +306,8 @@ group_fill_test_data(struct group_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endgrent(); diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 7525cd28b962..94b8b9373272 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -241,6 +241,8 @@ passwd_fill_test_data(struct passwd_test_data *td, int (*cb)(struct passwd *, void *)) { struct passwd *pwd; + const int limit = 1024; + int count = 0; setpassent(1); while ((pwd = getpwent()) != NULL) { @@ -251,6 +253,8 @@ passwd_fill_test_data(struct passwd_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endpwent(); diff --git a/lib/libc/tests/nss/getserv_test.c b/lib/libc/tests/nss/getserv_test.c index d74feb113a69..d7fce475d70d 100644 --- a/lib/libc/tests/nss/getserv_test.c +++ b/lib/libc/tests/nss/getserv_test.c @@ -284,6 +284,8 @@ static int servent_fill_test_data(struct servent_test_data *td) { struct servent *serv; + const int limit = 1024; + int count = 0; setservent(1); while ((serv = getservent()) != NULL) { @@ -291,6 +293,8 @@ servent_fill_test_data(struct servent_test_data *td) TEST_DATA_APPEND(servent, td, serv); else return (-1); + if (++count >= limit) + break; } endservent(); From nobody Tue Jan 21 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 4YcSgh2gGNz5lC2v; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgg4wW8z3Md3; Tue, 21 Jan 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=1737419199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxV12yVPxgTZVPdvjb3DqUOuWSNQKE5uWjEY1DpLy/4=; b=R4RWA1pixO6HDu38b7XMla4x3Vj1csx6WE63G8ruwyLEZmyEbrSGrL3NF1PMgzY+UZMfhM 7rIUa0qQAJlofAYgpRcQuKG0/11pV2I/3ZP3QSWaaJfk7gO+v8nKHtj3lJ2z9fByyiT+tF AVgZBSQr3u7/hppKJpN6OU7498tb7yyO0ncoGLwaTzOzIkLXugFMExJK3hlFHDa9eW8Dcb DNzD69saMrKNUKH64yTejP3qMBwX/DU6vA8PCvzYt7PdTRNjLG7b9rXfPfiED9HNYWqtz3 +QjEyMKjexVo4h1cYXkKUZvxDY976fPlp38DeFDjtSX2Hd22Dw0TrJSTOJGAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxV12yVPxgTZVPdvjb3DqUOuWSNQKE5uWjEY1DpLy/4=; b=CDef6xkpbUzpWgZv9hUn50KtAZJqUIc29Ygi8f0dmwljP9XiZEtDH2XaSpEQPcJjFywUhZ qxFXjO8G13gYJ2/m58VomYZgnsQj37BHK6hqdzIHxZ113HSQE3QVxwBL1DW0nDW3htwXgX 6yU7WjarcxVC+e/8LyLKi41++0oKmhn7NWGCZQweCdqAdcs4GAk5apsHSp6H4VxSoTr2ZA nScMbdLZikJulUTY/zEEk91blVZ+Z9wJOihi7wV2VlrJdLAEbztSf4wwY2/oG0OPvlhYCH +6AILYbJI1lgpYIv5MlP1g0eRrwlyYlJlysxOeGRmkMnCIUauWcRaVyv2mJOoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419199; a=rsa-sha256; cv=none; b=tmy2yN/kZspCfvLmPQCod9RBlIKiDkBQqBG2uPFlQIhND5j87rLcJsmm9x2V4mWTmGiLNW qp1WKIP9cDNTDx1GVdj17O1NW3jmjVdexSAsQ7XHurTOqV6XMeDLEALb02i+47+DD/AMyp Bfnc+KVAbE0U9WVDYYwhQ8LnyqqfHoq3XqRyD2JjNcp+e1/LHg0C+XRNl+Y1jnBg/6JNX4 P3LHgae9Nuhge+uqf7nA3XmYBi+TuKCwS8UIQ39fNj3ZTaTCH92u12KJov5sKCfyyUnQSh 6Qr9ycl29guFpZ6iL830o6nmP0g1EfdzSasm5UCAEncpojJax2ivM3JU7JD5Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgg43YwzkSt; Tue, 21 Jan 2025 00:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0QduV013177; Tue, 21 Jan 2025 00:26:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0Qdta013174; Tue, 21 Jan 2025 00:26:39 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:39 GMT Message-Id: <202501210026.50L0Qdta013174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0961e16b3668 - stable/14 - libthr: use atomic_add_int() instead of atomic_fetchadd_int() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 0961e16b36684d4755ad16d789c9f4cb509c8f39 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0961e16b36684d4755ad16d789c9f4cb509c8f39 commit 0961e16b36684d4755ad16d789c9f4cb509c8f39 Author: Konstantin Belousov AuthorDate: 2025-01-13 19:18:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 libthr: use atomic_add_int() instead of atomic_fetchadd_int() (cherry picked from commit 4804cb433dbec2555695dc2bf391f286f2172621) --- lib/libthr/thread/thr_list.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index 72018d94f496..d13cead7e588 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -150,16 +150,16 @@ _thr_alloc(struct pthread *curthread) if (thread == NULL) { if (total_threads > MAX_THREADS) return (NULL); - atomic_fetchadd_int(&total_threads, 1); + atomic_add_int(&total_threads, 1); thread = calloc(1, sizeof(struct pthread)); if (thread == NULL) { - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); return (NULL); } if ((thread->sleepqueue = _sleepq_alloc()) == NULL || (thread->wake_addr = _thr_alloc_wake_addr()) == NULL) { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); return (NULL); } } else { @@ -177,7 +177,7 @@ _thr_alloc(struct pthread *curthread) thread->tcb = tcb; } else { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); thread = NULL; } return (thread); @@ -203,7 +203,7 @@ _thr_free(struct pthread *curthread, struct pthread *thread) thread->tcb = NULL; if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); } else { /* * Add the thread to the free thread list, this also avoids From nobody Tue Jan 21 00:26: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 4YcSgj2WDYz5lBxC; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgh5Ppwz3Mg2; Tue, 21 Jan 2025 00:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Aem3n4a8fcWC739lIDyBYOW0GtEfFjcEpP4kpT62Obc=; b=TaCuJtxRkldiMgXl2Lrsqt0CGhYYX3z2C+kKGrMJ0UKwjfPa9sZP85+4GVIdDI44c3I3+7 WGuZMmm7NKSxn9Acrzixmok5a1R6oVeerPZyps6EEXEb0MDmHtG8uIthhA75FMlbcpr/m/ L7ywzgBR6x5md0n9xq2mEl8th+p+Nb/dS0JXIgSVdN3wetqvarekxB4wt+AOZZ/695b7W0 Cyw/xq4caEJPtDDCHs768BOSp31M8eTmePVVoTx6oiXqPdF/1s+D/mq1+xiDhknpnVTZU+ bhHYneZmIhzm26gxgv8gvTgw4Cjy3gENFUSOwC7KYwye3iHC39zC7dQK/mdFsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Aem3n4a8fcWC739lIDyBYOW0GtEfFjcEpP4kpT62Obc=; b=BMKoVocTYqTY8dLl+xKYn9XAdbsBEiKfHCDGP5woMhfyeAa5pYCnZ/D63+DvEdFhoBMar7 pGG4ijuyXD0x3EftQA2z9I05XF6TYClGPVl7OCBR8aQSnVv4N7EVXGyiT0WOuXaFOhOOeC Rkyx1TLp7DgPRc6FruClPPuTnmrITYlLG3mc1SPzRqOj3itT6T8gKvVrJx7QgsVdndlH0n hz9LJ6X0JR11W/X08tv822jeWJ3NNUaIVzsfrbvAnsdHPAGprJCXZHW9iHCQo2ljoWBBEn +atOJYPETmVtDtEgWy4Ns7yUvFl/Ojhr59mEHrOLjGVBzDxIsiivw+BkcOSDvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419200; a=rsa-sha256; cv=none; b=xCL2mi0fFEETSYCbKuJ0NhY1bhxcSxU/K9Kv5G6XONVYQC2NAdhT0IlB5vASvRp+KqAuqW 7aGVjPG2OzicrNswJIrnSUwXjJkZAQf69HCz70LcKUZidYVl8bEG8lhesXfcuMmSk/IWcF rHeX3dnkocqaN3kYmsYD0cBPXFh6AWvp5mqacMUKGe/f4mvZqOZaWIWmSidRuO8IQf9vd7 i4izOK7hwWaGbTmaU4YPCEP3x4dY/tm08Q07AN5syOjgcT9eeQryI+Wm7VZ6v+EzWQg2h4 eGETdBB7uaBy5TAQMPzaDwO6aR19MoKs5A/avGQ7wJDLPrQHKcLHB3w+YnDRfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgh4zBvzkSv; Tue, 21 Jan 2025 00:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qemh013213; Tue, 21 Jan 2025 00:26:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QeDW013210; Tue, 21 Jan 2025 00:26:40 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:40 GMT Message-Id: <202501210026.50L0QeDW013210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d6a896c3c83b - stable/14 - pthread_mutex_trylock(): init libthr if needed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: d6a896c3c83b1a0f473563dad5fc3f0427ee6f64 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6a896c3c83b1a0f473563dad5fc3f0427ee6f64 commit d6a896c3c83b1a0f473563dad5fc3f0427ee6f64 Author: Konstantin Belousov AuthorDate: 2025-01-12 11:28:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 pthread_mutex_trylock(): init libthr if needed (cherry picked from commit 9718f18471f700b271eb898c764e02b7fcd3766f) --- lib/libthr/thread/thr_mutex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index ca8971cc720a..32bdc4afe65f 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -619,6 +619,7 @@ __Tthr_mutex_trylock(pthread_mutex_t *mutex) uint32_t id; int ret, robust; + _thr_check_init(); ret = check_and_init_mutex(mutex, &m); if (ret != 0) return (ret); From nobody Tue Jan 21 00:26: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 4YcSgl3H5Qz5lBxJ; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgk6Mq5z3Mb8; Tue, 21 Jan 2025 00:26:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9HERNyk/V5CTV1WLwo2KqOvY1gVInPW0i1Y8U8lJc8=; b=CW9vZKFsfCRbrBMY9E2dd1S1tAg5qOeb32kDhyEOqB0Qs+I3p1NZN7ULOsOw4UI5yraxMl 62PR0h9wMFxwNdrhE1QsWBcz6O33o5hdSYP3UisJRcNkzurw1WysjTfyHYLLDNQ0x+HlZu r+yfIUyAKzSVJQhwrT6Dg2AzPCt6WvvxzYsI5Vjclt5C8nfacNyL6tcw4JAqn0tUJpvW+e 5Mei4dH8swDe41qHflDPwKQCoh3CkZ8yD9sWnZ4OZomM1wVybhkKizx0vHoGFyeer70vUX BQ2ZWlsQunJv45Rfa/Vn4kjzyRyIPX2KFjxizp3IhLKV7LTOaIM62db/XLFf2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9HERNyk/V5CTV1WLwo2KqOvY1gVInPW0i1Y8U8lJc8=; b=VjHroQz9FltQQbbUdA3Eo5vBVjYdX6Hocj6qbms+qa/a55GzY8MXNqMV1xPRaR+1LHjmPh wNXDhjYvqX+10MHcCT/CuXwGPlppS25gMLN2mzoU8+vN0N+rKdB49wFRNQiPqgRdgc8/eK rlDlqJF2ySD5dCfCAb2e4iXJeQxwez/Iz1/up7qAx9IxkR6HSlACr1a3dwkX66sxkq5xJe SwdnMIKf0ApNPpr+RLKjumzYnt9FBF0QNOfs/byYP0/ReKCPdH9WHMcfYr4b70EmFS/8yL nfbHR6/klL5Vl86ffm7bIFMazOJB4KKbaFkVVsJnRj1oELPg8uImv6DLsY3JrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419202; a=rsa-sha256; cv=none; b=yUosP3H3fxmzlRE/d75Ruxq3zdYcknZ4HPKoQQH8vk+1TTEUTZSXFXiyuOSwn0g2hjtNNd GYYdrJuwJ1tk/euGlJbNUaD6MwzKcHD+IFkdniMzy291MnalMODc79vSxFPyvn+8E/rQ+d jduDfNkXSrq0DvnLRHd13GNWj+mQmr6UdDN67K8aVPpqWOPjJTOJEpKdZoF0dvh4C7XKaM bmXOPUeT+8/bZllkgXwTE7tfd3qVqGx1Yl0HLu3JOQfKc96uu6pn2OeebYhns50x61sdXj kWUF0GgGe+aexzSlQpD/CYgbozFWM80nbH6ZoIHKFyrcjGY/uMaoQXb983csxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgk5s66zk3Y; Tue, 21 Jan 2025 00:26:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0QgA1013289; Tue, 21 Jan 2025 00:26:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QgEY013286; Tue, 21 Jan 2025 00:26:42 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:42 GMT Message-Id: <202501210026.50L0QgEY013286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e2268518dff0 - stable/14 - libpthread_init(): ensure curthread == NULL until set explicitly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: e2268518dff082d32b8399ccdac37ce3c597f178 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2268518dff082d32b8399ccdac37ce3c597f178 commit e2268518dff082d32b8399ccdac37ce3c597f178 Author: Konstantin Belousov AuthorDate: 2025-01-14 22:11:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 libpthread_init(): ensure curthread == NULL until set explicitly (cherry picked from commit 676be27133fa3296f3d9083732d8837a3eaa5ea4) --- lib/libthr/thread/thr_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index ff59288d919e..80f7c05ee5ce 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -332,6 +332,8 @@ _libpthread_init(struct pthread *curthread) /* Set the initial thread. */ if (curthread == NULL) { first = 1; + /* Force _get_curthread() return NULL until set. */ + _tcb_get()->tcb_thread = NULL; /* Create and initialize the initial thread. */ curthread = _thr_alloc(NULL); if (curthread == NULL) From nobody Tue Jan 21 00:26: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 4YcSgk72mqz5lC2x; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgj6Fryz3Mg7; Tue, 21 Jan 2025 00:26:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gx9nfkAfVd1yG8CfQTjD+9N/uO4jBFqKcun3t+PgMk=; b=KP7HgWwT9WB7Cb56T1owRr6cSKOwRv9Nf9NOxct0UoEnpKas8UJZMAeA7Ait5dxAyV/Edq lO/tY8rQxw1j4ynKSED2h+afbgGMaoXDuNsgvOKgvJqL17zk14plWQkEUxqN8mhlwaLwBT 3oPT0kpXkljO8NVY1SeucLnHYoxbCyekiZL6GGuouNKDQTq16j82IpLOxwwQQ06+fU9Sv7 c3ZYIYUamVk/4WQsVqyQdIP5bcij+1rmfTT/+NtdD+QFtgoKuVyCHHuSpi0Fd0HIf4hFt1 tDMSK0WdwfDu24d/tT8FFhhosR7o2Y/yLsiANLGkfTZ5nYTm8zQPggUrwS1q8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gx9nfkAfVd1yG8CfQTjD+9N/uO4jBFqKcun3t+PgMk=; b=Bct4P2Awcahh+8CZhxLZwfPnTDzKZUU7PM7tgXPJWgNAdN+ubeEYw6BPjtVLE2wP4Xkrt5 aWZvuoUUqd43AOs1k9BpuFYK5L9CBl4YncBg+2xNZupAD+u65vI3eNdxibMkH8CZGO2VwV Ly+gETMcU0ym3t66C2wMI5I0Vh3Zi9CoKUgO50OQhx5XMPi2ZwyecZsYxUHV8QXHI4aB1L YmSza8JlAoOa1OmdlF99qbyAVD35t6rGhuoVceGqgV/T3A/3ZP2ds+NsReJ2ohezY88iLo Xxf1ZAwz6cGRXbK33PLuYqrfCcL0eumhEtPk248JkQyOpYRKlK2KkyGYRkhaKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419201; a=rsa-sha256; cv=none; b=Jp7HhfgsgGcKbaP2Sr/eD8MY/rakf36zPw3dFCbMveTS7e7dwZlM/DXQrNGe9WDTWJWKvs 3SPNQDay4D0pDpGwYjhb+v1uEx7yxw1EWurbZGEqgXvxFHlst3VaCeGsg8iPSnkkCumhCN Tb5OwlCx2M00y58aKwsmai18B5G89+Qenyo3Qt59wmHdaCba53WYfqgdDc+AoCJu6IbgiY waDOG8JKC+E0XJEbN2W3ZkyJEQtsBIEgxyfRPcBQlsCJwqVwS5CxBbTYbQ+CERE0J1hyth TAz0mfjjLyfh5gGR7JKU2/2/Eyv3UL9rIkTx0tW+5R5ZG/REy4s/IrMRqr24HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgj5f9wzkSw; Tue, 21 Jan 2025 00:26:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qfbk013247; Tue, 21 Jan 2025 00:26:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0Qf7N013244; Tue, 21 Jan 2025 00:26:41 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:41 GMT Message-Id: <202501210026.50L0Qf7N013244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 205043060940 - stable/14 - libthr: switch thread and sleepq memory allocator to crt from libc malloc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 2050430609400237e4120e099c1aabd4e77e1c1e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2050430609400237e4120e099c1aabd4e77e1c1e commit 2050430609400237e4120e099c1aabd4e77e1c1e Author: Konstantin Belousov AuthorDate: 2025-01-14 09:06:58 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 libthr: switch thread and sleepq memory allocator to crt from libc malloc (cherry picked from commit 9a2ae72421cd75c741984f63b8c9ee89346a188d) --- lib/libthr/thread/thr_list.c | 4 ++-- lib/libthr/thread/thr_sleepq.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index d13cead7e588..6b41951aaf59 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -151,7 +151,7 @@ _thr_alloc(struct pthread *curthread) if (total_threads > MAX_THREADS) return (NULL); atomic_add_int(&total_threads, 1); - thread = calloc(1, sizeof(struct pthread)); + thread = __thr_calloc(1, sizeof(struct pthread)); if (thread == NULL) { atomic_add_int(&total_threads, -1); return (NULL); @@ -223,7 +223,7 @@ thr_destroy(struct pthread *curthread __unused, struct pthread *thread) _sleepq_free(thread->sleepqueue); if (thread->wake_addr != NULL) _thr_release_wake_addr(thread->wake_addr); - free(thread); + __thr_free(thread); } /* diff --git a/lib/libthr/thread/thr_sleepq.c b/lib/libthr/thread/thr_sleepq.c index d7de9ab4e25a..9c680acd0ac0 100644 --- a/lib/libthr/thread/thr_sleepq.c +++ b/lib/libthr/thread/thr_sleepq.c @@ -62,7 +62,7 @@ _sleepq_alloc(void) { struct sleepqueue *sq; - sq = calloc(1, sizeof(struct sleepqueue)); + sq = __thr_calloc(1, sizeof(struct sleepqueue)); TAILQ_INIT(&sq->sq_blocked); SLIST_INIT(&sq->sq_freeq); return (sq); @@ -71,7 +71,7 @@ _sleepq_alloc(void) void _sleepq_free(struct sleepqueue *sq) { - free(sq); + __thr_free(sq); } void From nobody Tue Jan 21 00:26: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 4YcSgm50CKz5lCD4; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgm0chyz3MSB; Tue, 21 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+qrGsoaVxUnaTwrUZU/Z33NUkG7PMlD8yf1ioRf3Ts=; b=lfImpb3FwzSnkxBxL/dksvAMIwwQMi1x3f+BwzOhHAnhoGLbVlXp1/eDcTc5o7eCBCexm2 +XuSrTgCw+IwLkzoeDu6Mz8usZKHeHMi9OfpQaO4fXNdk8uk2MsedGgkLIZOsz8hFDs9DP FCChwm4Tiol4+frp7LMW0aeuOophlvCLkj2BeDzcm2cDvy1HZBkGWiBo+5IKReycRJ61IL eZ5LGR9XaEFtFGEIpRfYWQzbxVIE8wUs8BmbH39JFtSIuhihHOaZVPjdjI3rBAVrbb77PI E9OYIC8zwST48ex7/zKAw9Ll5ODBwcfRTGcbbUUxRK+EpL9lxWCpWUw3B1JbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+qrGsoaVxUnaTwrUZU/Z33NUkG7PMlD8yf1ioRf3Ts=; b=O83KDaxzpkJxeM+jxDJrAXprKU5akTJBaneCoXrptGvmOKkRLG7mwuJiWXqq8RrY2A0xxJ 8lL4sEYIOd/4d6R1w3MDbNHm7CXD0kwjbmIQxxRm2hwM08GfEor32C1SpbPKUCrSh2eOAZ RRjZ9NnpOhjsdzAa/u0Hzuu9emILGqPIY3eM+zj95OY1yimq0wa+Fc2XtPNvAjfAGkbHQv wtMahKVqomcuzyx1pTyGvCza6TPlTVDkzxfakPJrReoVQKO7jWCg1Gbrh1u8iBi+6Lrwdb U5d3mti+OyNxPWLZtlcIGvj15bgSPsMN5JyniutVOrHDhq4O72CyBl9Pqq6jcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419204; a=rsa-sha256; cv=none; b=XpO9DMq2xQsM4EircAcu13rLWdE/6apF286HwTtRY73GPq2uJKR+eZ3tftLSyvu3p5JBVz YMUW09LT3tPbWYB16FZ49UihbNpGAfPebt96xoVkXNwD9eS8L4B65Ogwk/xEYB+Jq+Pnuc MCScAIhjfxxJbEBJPzzsPyh+lxvDW2pSNl7yDh7TSERII2l/pxS7i4BuV5WAlXPlXrQTT/ mOrot1RAlYR0LYBD/aQ3/2h0M1cwGlVLYKTsuq65awmpeY42IvIOpLGNvfrE3lnvPOSfHN O6UvWL2IYRWXxMMIdD043Qq23UKkXCz9PucV9Sofy8jLANTprpIDyX7VjV5tzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgm04CmzkWK; Tue, 21 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qh8r013327; Tue, 21 Jan 2025 00:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0Qh0f013324; Tue, 21 Jan 2025 00:26:43 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:43 GMT Message-Id: <202501210026.50L0Qh0f013324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1a085ee97343 - stable/14 - pthread_create(): style List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1a085ee97343c3938a12a7813421cec05768945b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1a085ee97343c3938a12a7813421cec05768945b commit 1a085ee97343c3938a12a7813421cec05768945b Author: Konstantin Belousov AuthorDate: 2025-01-14 23:32:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 pthread_create(): style (cherry picked from commit 02703de8bcae3b45e6d96e8467d5fa512d62cc3d) --- lib/libthr/thread/thr_create.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 4de9bd84ca5b..2ae7cf0cd7b2 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -146,7 +146,7 @@ _pthread_create(pthread_t * __restrict thread, _thr_stack_fix_protection(new_thread); /* Return thread pointer eariler so that new thread can use it. */ - (*thread) = new_thread; + *thread = new_thread; if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { THR_THREAD_LOCK(curthread, new_thread); locked = 1; @@ -226,8 +226,8 @@ _pthread_create(pthread_t * __restrict thread, THR_THREAD_UNLOCK(curthread, new_thread); } out: - if (ret) - (*thread) = 0; + if (ret != 0) + *thread = NULL; return (ret); } From nobody Tue Jan 21 00:26: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 4YcSgn5N1Xz5lBvS; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgn1H4Hz3MgZ; Tue, 21 Jan 2025 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hAUO9iBWVyt2Z1R9Ly4HNIttnybPPOG1k5SHUhUqQDQ=; b=pkMeEUDqI9/nUKCB4LT2c6zEKjGd1pOLe3ePeL1f9Agf/03jBInq7mb4ItNp4Ibev76XjI DjA+WsuoT2Zh4tFeC8UVWNgOOQ8WAHI6J9r4PS+I1JCJ6PCJoyzDmDfeEKWOew/Kuk2pbd R6lLxrs1SFVl3XYtJqOagpLzaQop4RraRqX0zTk7eQibCoUPKvZPLmHSdBo0n+tEumstZR x6jhc0OnBo2CuvXLHKJOp28VxdMg5qxJUBY6T7DRYzyzdQfEZfCWzBwNm5DQgWS1h1xBkU 3Ux5+ihJBD7oFH63PUNeqdYfk7qM5bR1E7Ce1nGuen8I3a2B72FoNjLdwdfCsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hAUO9iBWVyt2Z1R9Ly4HNIttnybPPOG1k5SHUhUqQDQ=; b=Pk/dw22r1UeFyIoxRrz7G+wqGa2FwkLrik+XSZY5ppSoc7y/l4Sa39e9kv7m8bJuBjWP/4 gCehx+9cdmXkqlIU7dSxxhQJmCaa2b3MZ/qQGCTac7tEIw+iubpecVMRQ6i8KOacf+9fae ruK2JyJH5Hqi2l0chBE309p9tRnCb5cLKGw+X468hMuyv8oQL317ISdbmT3tqrDROTVEJf u1vjjIwlHp6nKaWqB7JLT7h/4YlDQZdhwO21PBJa61L428dt9P4rkamJJMIKxxwkxXMcma q6HlC0vho1VGBx9anGoi1PG4AeVFGV1PSewpJ0ijUFmqXJ7stcDQv5GFfO+e/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419205; a=rsa-sha256; cv=none; b=L+4e8WSSC1dM/lFDTNQEAasydRjbC5lnSVq3Hff0PsRDyNoODyac3a2bNgekZMDF2jfsLt 91BoHRbu//2n0E7QZpHdzwJV9LB8rND1AXZr/pC81fb6HR9odxCeNatYZoEVPNWJFkjs2q DmxwaDj3MxL7FquIDoiPGY7eqdmlbHDWqawfFGXLij1O7n0x1CFI60iIhwYUcG7vbET9pv UNyoOWQmoO12SowkXuytdabFOogjuB7dF/KvbRdQElVLDkcBW45yHY6npcWviNBv7vdwGx uYNypW8ptq/zk9SBTmT/Gt2pmwTocwTSe4RcZASe/kPgv2nEvAdHuCb2h+Z+LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgn0tnMzkSx; Tue, 21 Jan 2025 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0QjcC013362; Tue, 21 Jan 2025 00:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QjeE013359; Tue, 21 Jan 2025 00:26:45 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:45 GMT Message-Id: <202501210026.50L0QjeE013359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2c0e00dc0147 - stable/14 - kill.1: mention special PID 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c0e00dc0147bdf3a6a84d0a16174aa521cbd262 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2c0e00dc0147bdf3a6a84d0a16174aa521cbd262 commit 2c0e00dc0147bdf3a6a84d0a16174aa521cbd262 Author: artembunichev AuthorDate: 2025-01-19 12:49:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:25:59 +0000 kill.1: mention special PID 0 PR: 284158 (cherry picked from commit f5cf173de0dc62dbf47a8bbdcae28aac947d90a6) --- bin/kill/kill.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/kill/kill.1 b/bin/kill/kill.1 index f3f0d27bb89b..0d3754626ee6 100644 --- a/bin/kill/kill.1 +++ b/bin/kill/kill.1 @@ -81,6 +81,9 @@ of the default .Pp The following PIDs have special meanings: .Bl -tag -width indent +.It 0 +The signal is sent to all processes whose group ID is equal to the process +group ID of the sender, and for which the process has permission. .It -1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user. From nobody Tue Jan 21 00:26: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 4YcSgp6Jpvz5lC7G; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgp2J76z3Mgh; Tue, 21 Jan 2025 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X8TVtqG3KCUPup3dQiPkvebrqBuynvK3oHjf8Nv/gu4=; b=D+tSvHsacoaLurflyrwJzb6pKz1SGsr4L1IiDuN8A4BgwdrR4Du1UGICVxG4kaZU3lLX3s sWIAJXLVA1yeH/N0gNSK4B1PLbbpEmC6b9AErQLDhL0CUrZQHbuallLH+LykyRYkfdCOAT XM7q+n3wSolyPME6qd9Hnu412LujrNEHO0ySDayn9RLB7DOkvKXySLhY6Pg2Yhp7IudxAi YVx/r244EbIqPws23WfqYHRNbYCD0RLGkdTsWNGFKXB7c668Pnn83zpVEYefmMVB6rSN5p LKI4U+AX3y0PxpsNF/pYARng+fVZc7RpJ/Tvh6XqQv6QzuK80gaSV74j1+5mDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X8TVtqG3KCUPup3dQiPkvebrqBuynvK3oHjf8Nv/gu4=; b=CIwzPUsPJumsxD5KjInKBpQCQHfLsQdpPMOr9wBtFlzYnPcjtCCtfAph1eL1nCRVazjkfW MCLjEoaxjEbVaAPZn/q8uydYRUYJDqpxFOla6z3DzzytLMKuwXj0HicXKDSInqK5ChM2X+ z52LFeKkywn5tWPJP093j9XcrGRp8VAEU8AEGM29FUzwtP9VpkXNSd8YNHxzLr+Y586KQP E1K/eNZDlvMKW0Ji3SZdvwS6eRoVhAdbzHA/AZt3AyALlLlfuyAyz7haB3ML5/BPtQkiF/ rqs2C/RgvlDu8kvL0CRockVNbq1bimdAgl5j0hJzTtNKO6g3gg5NIDMKBoPi/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419206; a=rsa-sha256; cv=none; b=VXgS2oVSsNtwdkwUJGJESOVMzzTWKoMvDAm8FRRRISSBGH+RNQvujSrT39zG5PL9HzrAQz hnl2xHxDb55aAgPCUsb1O6cP1vaKnd2u+wceGubtM+8THnfVjrIj15YWwl6pTjABFxNxaQ JVB8tuOJxmHL5yh/1UiA7c7LWoBTJ0+H5xMIrdx/lqORAcHqz0WB4iSEvNz5v3QFM/cfrs F8n4rPRq9gT+LKMu/T3bm8TvlmrGeE/gUDCOtoQHu2hSs0l/4mw636hhw7Tl0Fw/CU60pm Sk8hjqJsMdBMziQGX3tNdJudRCWwrXFudycQJSBNsItIFz+pIiAsMqlBFcRc5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgp1RK2zkG3; Tue, 21 Jan 2025 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qkmq013398; Tue, 21 Jan 2025 00:26:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QkBX013395; Tue, 21 Jan 2025 00:26:46 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:46 GMT Message-Id: <202501210026.50L0QkBX013395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fe74df3f9db8 - stable/14 - kill.1: mention special meaning of PGID as a PID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: fe74df3f9db830194ba7b91d4d703dddee2a60c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fe74df3f9db830194ba7b91d4d703dddee2a60c7 commit fe74df3f9db830194ba7b91d4d703dddee2a60c7 Author: artembunichev AuthorDate: 2025-01-19 12:58:55 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:25:59 +0000 kill.1: mention special meaning of PGID as a PID PR: 284158 (cherry picked from commit d6c2d4fe975c70975bdc6bec76d044408f6dcb8c) --- bin/kill/kill.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/kill/kill.1 b/bin/kill/kill.1 index 0d3754626ee6..b977e7899ab9 100644 --- a/bin/kill/kill.1 +++ b/bin/kill/kill.1 @@ -87,6 +87,9 @@ group ID of the sender, and for which the process has permission. .It -1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user. +.It - Ns Ar PGID +The signal is sent to all processes that belong to the specified +process group ID (PGID). .El .Pp Some of the more commonly used signals: From nobody Tue Jan 21 11:37: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 4YclYC4TNBz5kyDr; Tue, 21 Jan 2025 11:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YclYC3WLbz3cpj; Tue, 21 Jan 2025 11:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8kWY2Tte4611QMfjlzn70XtQgqLgw0rwJWSDouqRy8=; b=SvRbHFmINTg1w9QfZnkA63PrhMrrDOQTdW57IDrle/PZ6vJxbwPIfIFXwVjcEI7PWq6gZt B/KyFLac+MBvP5CwOwkg1trpZ1iJs6D86ifAjeNm4vdcc3IWxrgDcBSzYjVV9BKNxfIF24 8Nz2sGfVrQDRl/LmKdHETTyZy1InhZk034WMLBmZ4O3fnvQedVKRaPKqhr5xvZc4I2uXgI yOH4oLmRYNZFAYo9AnEHFBSXC4uQyBEFpkwEiBcAjbyLCxFJ0HUHmokMkvAcPPDeNi9stM LX1rNTPzIUivRCC9EoVvRYkAQ7nCdn3l87UH94adECPP1OlRkpPOsu6dRoPObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8kWY2Tte4611QMfjlzn70XtQgqLgw0rwJWSDouqRy8=; b=V7Hb/NBGKGRPoyXL6894fv8zHErKJtlA513VqY0wZdHHqyoff6tYuPpOHd6fYuYKxtCdGL wOlIRtIm/r1j6NPWG83FfrsO0tkpM+IE1aQhHVpg8RmIpju+qhtycZ/EfRLKyYZbc79bQ8 FYKO/qlq8oCcuBUIQVX/ktxbr+BEDTxg6rr/zUqG+WLDRbrrEQTVdCGI0uF7GGXO0jq3XZ oYwoyu25gsjyHf3zFynfuWFLGxkCbI4qjrtAnhBGhu3JfMa7R+inr+hHU76Zdg/SXgojNR O0Aetfa3ImiS7zFQg8VMRhJY1sjd1iqvVrDrk/iytBD/27sFTegUmZww4eNWqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737459423; a=rsa-sha256; cv=none; b=nZUR0kW24sq4TzgPm10wxrV5vPp1YwW6lbw0r/kV/fBWX9XjhoQvYx5G6BbqGydF8103ns /PIQWVq2mFypqI8KvqajgTXbQIcH8mmoGFOqHe811UMqBtPV5wRkFA6zzVj+jkJZgNFHej 2155uMBMQsUt7kQkUtMVWEKqm4ePLrl4k5oWxOKEPw0iBLtAHSyq50FyHXD4YmNp9YCWZX Dj+ZWaqQB835PoiTbniblL29s387CzvXB4zfAFuex1RDJWxXb3ouIGpHEPaf9Vg/lpIRpL c5QzK28C4YtnrwV2l+pW2CiQSPcA4gSexUlZOzsqyvR2SR3LwEtHvJcPCgPUwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YclYC30Tsz14sN; Tue, 21 Jan 2025 11:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBb3Uw067012; Tue, 21 Jan 2025 11:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBb3Z5067009; Tue, 21 Jan 2025 11:37:03 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:37:03 GMT Message-Id: <202501211137.50LBb3Z5067009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 7dc48056c87b - stable/14 - ipfw: use only needed TCP flags for state tracking List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7dc48056c87b2100f2841d48dbb45a46ffdae934 Auto-Submitted: auto-generated The branch stable/14 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=7dc48056c87b2100f2841d48dbb45a46ffdae934 commit 7dc48056c87b2100f2841d48dbb45a46ffdae934 Author: Andrey V. Elsukov AuthorDate: 2024-12-12 12:57:45 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:35:40 +0000 ipfw: use only needed TCP flags for state tracking This fixes stateful firewall failures after adding TH_AE flag into TH_FLAGS. Reported by: ronald Fixes: 347dd05 (cherry picked from commit 9ea8d692f4cb552902b9e8394260d7f3cf4aefb0) --- sys/netpfil/ipfw/ip_fw_dynamic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 283032048845..d26e05e5d159 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -920,7 +920,8 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, int dyn_type, #define _SEQ_GE(a,b) ((int)((a)-(b)) >= 0) #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) -#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define BOTH_RST (TH_RST | (TH_RST << 8)) +#define TCP_FLAGS (BOTH_SYN | BOTH_FIN | BOTH_RST) #define ACK_FWD 0x00010000 /* fwd ack seen */ #define ACK_REV 0x00020000 /* rev ack seen */ #define ACK_BOTH (ACK_FWD | ACK_REV) From nobody Tue Jan 21 11:38: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 4Yclb7270Kz5kyFH; Tue, 21 Jan 2025 11:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yclb71Qlcz3d9x; Tue, 21 Jan 2025 11:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nO9N3m0r7p4iGFCgGT2bXDN7yhWUleX0OflabtuUV28=; b=KjSIH+SIYnhGDvayKS4XKDvcABr7KUqaKEl9UNMb6S3uOAKXap3dGxHjD3bXlYor3pBJav XYbuEdxCenCdXM0O7QB76I/bDWG+0W3lzbZDR6VqpyEAsXelGMA+w9kNos+UR8eHVSSyWR Kbi9zrliIKYL/UDw2gfgKVbu5/bePE6SarjSFlItFqcoWSRfxCumDzJePbYxcGKTv0fOeK Mq7ZMjB4397/F7ELAbbRqnpKCrDvGI4VXXE39hUcT85YtDsLlKTFY/vxdau3dX97iM0Thh EWJ2ljUloZaixIUE2oW8c82/tVILS43c+JV/qdQAiIGRT/aaESQBpDn0CpTVww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nO9N3m0r7p4iGFCgGT2bXDN7yhWUleX0OflabtuUV28=; b=Dm9HF1vsAZL3al6hyhf3Abhqu8Xpte1jQMOHtlZjUbsqaSRPDimU4CWuXfF0eRlYe5RIyF PApmROwpCn8Na5mSW1Af9VfdYaXFu095QmXoh8oXl/qw3hHqSCHl3gR8g9lZ2QVaYxk+oI YfBHn0u+71sgtTn2dZUmAxK+B6U3WPTnZembAppJMEXnn+F43b+BmHnpFh1n63rx5OlEiH JVMTNxMFqivXinbEMnJaUD7fuw3moB6IrHwefxzt0EL2qWWfPpND9NHw00t4+tJIUWoij0 9S5GIT9U/XmhVseVWl6C21y/jsJTe/wr6rmQ2MmHlM6jiCTr4nTpzlGoYwJ97w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737459523; a=rsa-sha256; cv=none; b=fNfQrlyWuww1HwPT/YfOGeegq36Pim9KBX9nwzQw3P7o6Nd+UNlCkfMrIDon74sRwgVJsF P/1sSAu6DXhdeDVomiZqgQpuUMY6nW9YkGD46DGbkLnlF0z5t+QkFvz27mh8FrjQ3I1s9g BtCLNIk7TQ032tYWJlJvDPRYe/7XwMv2zIqTlhCxhYSjOeImFcaGFQErdunt31X3D6HLdy prYwFUDHUAUJ5emHWqSymBqU/v/snudb+Y2RvKaoUm6R9MYqS3TVyU5SZbu0mPTP3QRm4M FIr1kyixzrLkiUCot/ORwMPyCJK2wpXjeXt+pU4sR2UxgREBvWYdAhPhOw+0UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yclb71144z14sP; Tue, 21 Jan 2025 11:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBchcY067603; Tue, 21 Jan 2025 11:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBchlZ067600; Tue, 21 Jan 2025 11:38:43 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:38:43 GMT Message-Id: <202501211138.50LBchlZ067600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: e29ffd402d38 - stable/14 - netlink: restore the ability to delete PINNED routes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e29ffd402d38b32f9c37eea69f87361ad32b7534 Auto-Submitted: auto-generated The branch stable/14 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=e29ffd402d38b32f9c37eea69f87361ad32b7534 commit e29ffd402d38b32f9c37eea69f87361ad32b7534 Author: Andrey V. Elsukov AuthorDate: 2025-01-11 08:25:50 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:37:26 +0000 netlink: restore the ability to delete PINNED routes route(8) had such ability before migration to netlink. To be able to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px() when userland uses RTF_PINNED flag with RTM_DELETE command. This is hackish way for route(8) tool, that third-party software usually doesn't use. PR: 279988 Tested by: franco at opnsense org Discussed with: glebius Differential Revision: https://reviews.freebsd.org/D46301 (cherry picked from commit 3ce003c8b6151f7764b7934de11c789d6b84ee5c) --- sys/netlink/route/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 7379d49b96a9..679260e54322 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -1013,7 +1013,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, - attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); + attrs.rtm_dst_len, path_match_func, &attrs, + (attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc); if (error == 0) report_operation(attrs.rta_table, &rc, nlp, hdr); return (error); From nobody Tue Jan 21 11:46: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 4YclmH5x2sz5kypH; Tue, 21 Jan 2025 11:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YclmH57Y7z3dl3; Tue, 21 Jan 2025 11:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7HeA7KqQUQ/Wg6v7WuGhSaN26OC5iRraNaFRehi6pXI=; b=j6s072FAFotWoeZe0muR01b/M4qhxWcuG8TZw9+5MUjDRtbF9eeyWdgczPoL0mx2mfrqKb wmPM5M0mxCiTu6JGahurK8jrT++mpcdhvK11e6Z5ADtkiQ/bkViO6WAOLG02uKb0Zzlc1E rItAoMUptc+pLlkowXnyZyGLUns5TmUwzEL0ftpio3m21wQnb0ONf8tdR/m34Q1dmmvpZk 3qQZys7MqAMlq8us/XuiLoo/hRoO4OfUZNGW7X8R88nT9ZCiXg28hWxfiinJrmWZskA2tN ZcuhOz+XtPVBgtyzScYIchMuLAf6wzpt83KfPv32rFeimUnpO/OGyyyjrzWOyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7HeA7KqQUQ/Wg6v7WuGhSaN26OC5iRraNaFRehi6pXI=; b=fIx4ZZXDkN6Poz7H38hAJtzjFTO+O95E0jHipU5kizKl2OnTRtYYsJqIiJ1g+7xZS5rgFg 5iM2X27/ljPaOgXJYko/ZZoJQyXLtuvOvXABI9UGXBZX62ua4269gRrBevoKrjRABB8r3U VamFtmIyF4BLVbrbEkGNGwNWzc0dhpfr4wJRbAgM7A5j7CV+BhV0DMTtCJvgW2aXy7YKI7 0AC2UfScXy8t/jXhunm0k9QFLUsIhSfEyaXs4oIAjK1Uz5xc4bEW13VIj3qe3hdbERvylq OWCYc1VihM58IKvvQ6nIgTxeOdUHDWeorUVZnElyLyz7cly0H6rqQe+i//wjMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737459999; a=rsa-sha256; cv=none; b=psCMtEvwXqZLHLWfDiQeB9OpN0X2O9FcmgIW1yNe2oFLLg1/mKn4C2SorFC08v8YncOY0c z29mXOhCF7aUgx+u6WG0OqNqhjd7XRjU+8K9/9ZWpC75CZq5o2hXcz2dNM3HKsD/8acBHn t4HHMiVmDGAt3BW/jkdF1//tbw8gWY8PQVCP63bB6XIf2eI6Br3hHF3D34DOBJnfOiA2Cf VYtQgpjTji1SRsxlJTBXmdln2SgLOfMbcl7MkhZ+oT2cr0lQxGD84zwx9wRH6fCqqdgQXt thmq4cbXhKqMuzBwimzbhGdiOsbp+i9NVDavTSjpiKs1pC2IqU2VpPUN7R0+xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YclmH46zMz14st; Tue, 21 Jan 2025 11:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBkdZ3085708; Tue, 21 Jan 2025 11:46:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBkdsa085705; Tue, 21 Jan 2025 11:46:39 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:46:39 GMT Message-Id: <202501211146.50LBkdsa085705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: e98f79cc71a3 - stable/13 - ipfw: use only needed TCP flags for state tracking List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e98f79cc71a35c25a83788f8ac9ba3375baaf149 Auto-Submitted: auto-generated The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=e98f79cc71a35c25a83788f8ac9ba3375baaf149 commit e98f79cc71a35c25a83788f8ac9ba3375baaf149 Author: Andrey V. Elsukov AuthorDate: 2024-12-12 12:57:45 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:45:09 +0000 ipfw: use only needed TCP flags for state tracking This fixes stateful firewall failures after adding TH_AE flag into TH_FLAGS. Reported by: ronald Fixes: 347dd05 (cherry picked from commit 9ea8d692f4cb552902b9e8394260d7f3cf4aefb0) --- sys/netpfil/ipfw/ip_fw_dynamic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 29ffe4f320ab..a100101f87d4 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -920,7 +920,8 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, int dyn_type, #define _SEQ_GE(a,b) ((int)((a)-(b)) >= 0) #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) -#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define BOTH_RST (TH_RST | (TH_RST << 8)) +#define TCP_FLAGS (BOTH_SYN | BOTH_FIN | BOTH_RST) #define ACK_FWD 0x00010000 /* fwd ack seen */ #define ACK_REV 0x00020000 /* rev ack seen */ #define ACK_BOTH (ACK_FWD | ACK_REV) From nobody Tue Jan 21 11:46: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 4YclmK27fFz5kykT; Tue, 21 Jan 2025 11:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YclmJ5Fdjz3dvT; Tue, 21 Jan 2025 11:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737460000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b13xbWH93mky+uPSBtG9VCRX2pGewJPnZtggi0zc4j0=; b=OwEiS7HPITmdoP/2benBMwYUlsiXVhp9IR00HPWmakCnPwIWMkPTjFAxY7yzubBqNW8w/8 W4PYNKNmT5Fq3rFA/dlkiTC+0Doprht6ndxT+kRQQXIZ8b4CbHF4CgMOgas368ugUEd81x kFMiL/VgjVYSXWtaK118mZHjhJgWLH6z6KQjPoO/fcWwLBvj9s9qWspkd+/lNmY+jKAtc6 q5uCsYlbkuQ4wp+xEjzBy7mFDAVQHEe2dzehHlXf8R967LV55m10B/BYeGAOP0eocewjFu fEBq4vg0V5BMOwV/iJvqHHrRSpOoDSTTQjyDORcmMNEI15kDp/6/gX1ncRL+3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737460000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b13xbWH93mky+uPSBtG9VCRX2pGewJPnZtggi0zc4j0=; b=OHhrR2fN4BuTepR1D8V2IQPriIUGJlhU/ukR1HirQUMy7Be03Aw1jewCyBMg0ONai52Ns7 /gTU9JLZpEVsQlbNh8zGJi/2br5QqLha4KrppNzxqE4YC5WVI4mlh53vDBXzF9W1pDXal+ BPDSXHdKH77/n8oE6DQSTHEOzmdUUMcwZYYrDAqore848wZ80NHC0vXHBHgUnKE1VfzxcG yNsXLVJs67yEsFMpPphDfLvV/Eo6o1PdgPYY4OA8dDY5oZiDV7apAOAPohsC7/AZWcu5ou FedS60cbbRq5RK+djK2WQB9YWJ+FPC/oIa7vo8f0u6tv4UEycJuaCniTpqnkOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737460000; a=rsa-sha256; cv=none; b=dpwM4VDBPnMymj1IF3lVSyA354M5onYGEusSQJYRYRUrh+EVqCtYlx5KpHr4pXrLMHnfil Qg1PvfM89QOfyzK36IpOV+gwVpKkfLXnmZuXWDaOAmcNKUvBEawPJoLjiBgWclkDb+INN4 bH1FJ0PDgNxmhjjdUoAgYdj4C8eYvU4E6WCw5cUiny/TaqSLF8UFfho/duYvreWqfV0KoJ 8uqKD3z8EZEgnbZOIofmQRNs2NR4i6idZbyRfEnBgwCOwG2YKhgHd6vF9fBKjO0rU1vShG HaOhLC6T6yQD168VHm1R5TM/6A3ZLaSNOB+YQLjSb1QsJUrF1UfZHnjuQ99Ahw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YclmJ4bpJz14Sq; Tue, 21 Jan 2025 11:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBke8s085745; Tue, 21 Jan 2025 11:46:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBkeY5085742; Tue, 21 Jan 2025 11:46:40 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:46:40 GMT Message-Id: <202501211146.50LBkeY5085742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: edc19f8d0fd0 - stable/13 - netlink: restore the ability to delete PINNED routes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: edc19f8d0fd03c21cd24cbd0e2e004713bb112f6 Auto-Submitted: auto-generated The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=edc19f8d0fd03c21cd24cbd0e2e004713bb112f6 commit edc19f8d0fd03c21cd24cbd0e2e004713bb112f6 Author: Andrey V. Elsukov AuthorDate: 2025-01-11 08:25:50 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:45:57 +0000 netlink: restore the ability to delete PINNED routes route(8) had such ability before migration to netlink. To be able to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px() when userland uses RTF_PINNED flag with RTM_DELETE command. This is hackish way for route(8) tool, that third-party software usually doesn't use. PR: 279988 Tested by: franco at opnsense org Discussed with: glebius Differential Revision: https://reviews.freebsd.org/D46301 (cherry picked from commit 3ce003c8b6151f7764b7934de11c789d6b84ee5c) --- sys/netlink/route/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 24d8c4c9d714..3eed4c4361cf 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -940,7 +940,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, - attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); + attrs.rtm_dst_len, path_match_func, &attrs, + (attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc); if (error == 0) report_operation(attrs.rta_table, &rc, nlp, hdr); return (error); From nobody Tue Jan 21 12:29: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 4Ycmjm6Kzxz5l20D; Tue, 21 Jan 2025 12:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycmjm5kMJz3krd; Tue, 21 Jan 2025 12:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vLQwazNbUlBhM7xOGWreTN4vF2mGd0fdd+zia/VmbB8=; b=Kd6K1WT23CvhCBtTBg2qrucVq7VTGKpCC0CoOr3IPCUh5b2BcFkw3fwoWGyAmz25uHqSUw d5IBoBytxgdzWvjZ29zEDhTFBy75Z1+2lQ6kiciJLNRwkn2Gx/vSW4C9OK2xfw40GYY814 6Dur2HfqwL48fseo+ru7p3fFpk9WJBPDl8wUFxwSZtsBZsvymKi4nbjfxCRawRAdSL/wTi Da8f3n2qB8JNQvQX+JKfotmKU04BUyT8YhwrjSJv8HJcfhvrLHpssA5PGtGWVid1viQGpb tKi1l/1Fnr8ApgyggkMzO6qBlZkgq2B9mwW04X6Jj/dM/EqynqhkAKajvLGTBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vLQwazNbUlBhM7xOGWreTN4vF2mGd0fdd+zia/VmbB8=; b=tMWjlneWYlKUPWfG0aCrnXLPgyJxl0WHUEX3RCrBPzcUNc2icgCWMlG2XaY4L19xbu3hvB rQ673tNZQ1hrgv2I9yhwdgHKNWk6WEqI0ZdbAMtw7MuFHde7QfKof1qoyhCmTJtOOIerS0 bPe86+kZfhPPEncrrudqwCC3kJjCpvyzcpyDzpb6ovVJO1QXe1r07kMb3Zvy2r9AzSSQvh KHyHwEHGTtGpivkltUHpuILg+5gs9eEOSX4bJq8HVZ7NeaN0Dkmtr+a3KpFhAK0dOfqpX0 0UwUF7jxcaRr6XYY4+XVG10QAxSTVD3hbvs1qQx/DRWQwl/PMDAt7BKeeZ+T8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737462572; a=rsa-sha256; cv=none; b=ZhzlyhEHoqnmppremQ01mmHsO+8wOoxenLmjaocexw3YE5OaHJ4fzqWkUF78f3ufBjbXWR JkHMoB8qmWyM0xP2Doo0wfw1YBoUOgIJ6dPPH/MhkF45XtdKnIkb63JELjWAAMsyL5Nxof xvV+BjNir/dIs4wHcCS/Esb8NYjVTLqw+D78zSNbP1/Rk1hc+LhqbX4GloXqyEFAUL1VYf fZSXM+3t5ClNd/KCcH7cq57fDD++ZfJblN9vOgriDScBxp+BKaxiCIxcovthXMUTBST0gc BzVK2ksEc3KPaVpdvHe8D42YktR0JNyVYfmngCI22MXFk9aE0+UmfqapRXIPmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycmjm56X4z15Pf; Tue, 21 Jan 2025 12:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LCTWLR061651; Tue, 21 Jan 2025 12:29:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LCTWFR061648; Tue, 21 Jan 2025 12:29:32 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:29:32 GMT Message-Id: <202501211229.50LCTWFR061648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1dda3a6ed9c5 - stable/14 - hid: Correctly handle signed/unsigned quantities in kernel HID parser. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1dda3a6ed9c51adc908fee4db5917b1232fa932c Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1dda3a6ed9c51adc908fee4db5917b1232fa932c commit 1dda3a6ed9c51adc908fee4db5917b1232fa932c Author: Vladimir Kondratyev AuthorDate: 2024-12-22 03:16:11 +0000 Commit: Ed Maste CommitDate: 2025-01-21 12:29:17 +0000 hid: Correctly handle signed/unsigned quantities in kernel HID parser. Wrong signedness of usage value results in inverted range check in hmt(4) driver that allows out of bound array access leading to panic. Reported by: many Sponsored by: Future Crew, LLC Obtained from: NetBSD NetBSD PR: kern/53605 PR: 274014, 282592 (cherry picked from commit 38b67578fb4bbf568f7012ca3921a4d15cfe7c5d) --- sys/dev/hid/hid.c | 91 +++++++++++++++++++++++++++++-------------------------- sys/dev/hid/hid.h | 32 +++++++++---------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 4b5d4a81b51e..453c37d806fc 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -69,7 +69,7 @@ hid_test_quirk_t *hid_test_quirk_p = &hid_test_quirk_w; #define MAXLOCCNT 2048 struct hid_pos_data { - int32_t rid; + uint32_t rid; uint32_t pos; }; @@ -79,9 +79,9 @@ struct hid_data { const uint8_t *p; struct hid_item cur[MAXPUSH]; struct hid_pos_data last_pos[MAXID]; - int32_t usages_min[MAXUSAGE]; - int32_t usages_max[MAXUSAGE]; - int32_t usage_last; /* last seen usage */ + uint32_t usages_min[MAXUSAGE]; + uint32_t usages_max[MAXUSAGE]; + uint32_t usage_last; /* last seen usage */ uint32_t loc_size; /* last seen size */ uint32_t loc_count; /* last seen count */ uint32_t ncount; /* end usage item count */ @@ -117,7 +117,7 @@ hid_clear_local(struct hid_item *c) } static void -hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID) +hid_switch_rid(struct hid_data *s, struct hid_item *c, uint32_t next_rID) { uint8_t i; @@ -242,6 +242,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) uint32_t oldpos; int32_t mask; int32_t dval; + uint32_t uval; if (s == NULL) return (0); @@ -253,10 +254,10 @@ hid_get_item(struct hid_data *s, struct hid_item *h) if (s->icount < s->ncount) { /* get current usage */ if (s->iusage < s->nusage) { - dval = s->usages_min[s->iusage] + s->ousage; - c->usage = dval; - s->usage_last = dval; - if (dval == s->usages_max[s->iusage]) { + uval = s->usages_min[s->iusage] + s->ousage; + c->usage = uval; + s->usage_last = uval; + if (uval == s->usages_max[s->iusage]) { s->iusage ++; s->ousage = 0; } else { @@ -264,7 +265,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } } else { DPRINTFN(1, "Using last usage\n"); - dval = s->usage_last; + uval = s->usage_last; } c->nusages = 1; /* array type HID item may have multiple usages */ @@ -318,28 +319,32 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } switch (bSize) { case 0: - dval = 0; + uval = 0; + dval = uval; mask = 0; break; case 1: - dval = (int8_t)hid_get_byte(s, 1); + uval = hid_get_byte(s, 1); + dval = (int8_t)uval; mask = 0xFF; break; case 2: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval = (int16_t)dval; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + dval = (int16_t)uval; mask = 0xFFFF; break; case 4: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval |= hid_get_byte(s, 1) << 16; - dval |= hid_get_byte(s, 1) << 24; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + uval |= hid_get_byte(s, 1) << 16; + uval |= hid_get_byte(s, 1) << 24; + dval = uval; mask = 0xFFFFFFFF; break; default: - dval = hid_get_byte(s, bSize); + uval = hid_get_byte(s, bSize); + dval = uval; DPRINTFN(0, "bad length %u (data=0x%02x)\n", bSize, dval); continue; @@ -351,7 +356,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 8: /* Input */ c->kind = hid_input; ret: - c->flags = dval; + c->flags = uval; c->loc.count = s->loc_count; c->loc.size = s->loc_size; @@ -381,7 +386,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) goto ret; case 10: /* Collection */ c->kind = hid_collection; - c->collection = dval; + c->collection = uval; c->collevel++; c->usage = s->usage_last; c->nusages = 1; @@ -407,7 +412,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 1: /* Global */ switch (bTag) { case 0: - c->_usage_page = dval << 16; + c->_usage_page = uval << 16; break; case 1: c->logical_minimum = dval; @@ -422,21 +427,21 @@ hid_get_item(struct hid_data *s, struct hid_item *h) c->physical_maximum = dval; break; case 5: - c->unit_exponent = dval; + c->unit_exponent = uval; break; case 6: - c->unit = dval; + c->unit = uval; break; case 7: /* mask because value is unsigned */ - s->loc_size = dval & mask; + s->loc_size = uval & mask; break; case 8: - hid_switch_rid(s, c, dval & mask); + hid_switch_rid(s, c, uval & mask); break; case 9: /* mask because value is unsigned */ - s->loc_count = dval & mask; + s->loc_count = uval & mask; break; case 10: /* Push */ /* stop parsing, if invalid push level */ @@ -479,14 +484,14 @@ hid_get_item(struct hid_data *s, struct hid_item *h) switch (bTag) { case 0: if (bSize != 4) - dval = (dval & mask) | c->_usage_page; + uval = (uval & mask) | c->_usage_page; /* set last usage, in case of a collection */ - s->usage_last = dval; + s->usage_last = uval; if (s->nusage < MAXUSAGE) { - s->usages_min[s->nusage] = dval; - s->usages_max[s->nusage] = dval; + s->usages_min[s->nusage] = uval; + s->usages_max[s->nusage] = uval; s->nusage ++; } else { DPRINTFN(0, "max usage reached\n"); @@ -499,16 +504,16 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage |= 1; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_minimum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_minimum = uval; goto check_set; case 2: s->susage |= 2; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_maximum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_maximum = uval; check_set: if (s->susage != 3) @@ -529,25 +534,25 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage = 0; break; case 3: - c->designator_index = dval; + c->designator_index = uval; break; case 4: - c->designator_minimum = dval; + c->designator_minimum = uval; break; case 5: - c->designator_maximum = dval; + c->designator_maximum = uval; break; case 7: - c->string_index = dval; + c->string_index = uval; break; case 8: - c->string_minimum = dval; + c->string_minimum = uval; break; case 9: - c->string_maximum = dval; + c->string_maximum = uval; break; case 10: - c->set_delimiter = dval; + c->set_delimiter = uval; break; default: DPRINTFN(0, "Local bTag=%d\n", bTag); diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index 09fad96c9559..aeb0da98b181 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -233,31 +233,31 @@ struct hid_location { struct hid_item { /* Global */ - int32_t _usage_page; + uint32_t _usage_page; int32_t logical_minimum; int32_t logical_maximum; int32_t physical_minimum; int32_t physical_maximum; - int32_t unit_exponent; - int32_t unit; - int32_t report_ID; + uint32_t unit_exponent; + uint32_t unit; + uint32_t report_ID; /* Local */ int nusages; union { - int32_t usage; - int32_t usages[HID_ITEM_MAXUSAGE]; + uint32_t usage; + uint32_t usages[HID_ITEM_MAXUSAGE]; }; - int32_t usage_minimum; - int32_t usage_maximum; - int32_t designator_index; - int32_t designator_minimum; - int32_t designator_maximum; - int32_t string_index; - int32_t string_minimum; - int32_t string_maximum; - int32_t set_delimiter; + uint32_t usage_minimum; + uint32_t usage_maximum; + uint32_t designator_index; + uint32_t designator_minimum; + uint32_t designator_maximum; + uint32_t string_index; + uint32_t string_minimum; + uint32_t string_maximum; + uint32_t set_delimiter; /* Misc */ - int32_t collection; + uint32_t collection; int collevel; enum hid_kind kind; uint32_t flags; From nobody Tue Jan 21 12:34: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 4Ycmq66K9vz5l2rD; Tue, 21 Jan 2025 12:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycmq65Pwkz3lvt; Tue, 21 Jan 2025 12:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jZkUlyhPMDdcHCl9Y8oEsye1NjqhlJSPsaOdk28il0c=; b=YTMdZskViD9ZNxOVF/2WhelU//pkKolYlfFpyb1z2bPzPX2oBY/lj/IZKirBn92UM+6gzv kGVBN2WGXSXWi/NWslohbZs9K87IJwHx/ZtllVd5sxzwIpkAe6pslCQ+tL1nmg86BBc3nN LtItkvmUJGR6SM8PhOZsZQGqCWhQX2ZV86VgGNk34B8xdsCd31tJKRt56xs97WAfnUvkW0 7ozApbR28J1R6AmPX1fWjczuWwFMqcdAYC4tFXh7FJDbGDlxb3Y2WjubnX2oMGAZtx0+8e ASFTEK+1Mjef9IId2j1Oy3g9nsmhYFXriDLBTD+3HAwQrqp6lSNr3n7MS+GnRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jZkUlyhPMDdcHCl9Y8oEsye1NjqhlJSPsaOdk28il0c=; b=DJadxV9xgW4aCWAJ1RuQuYpvf+wyxiIgeJLvLCZWQ1XMkUM5ewi0zaxm1P0FY7dUPmToz6 29rqdsKMQgzpCFHjsFhQ4HMdz9sI49zoE8AhErQc8sLGm5N5cN/DZrHtzIqbPQDbhWIFQI jNbyXEVm5nbrx8+ZIed6sc8KeePLa546z0RCqlbcpdrQ9geMwzFNvBjultpz0QV76VEEIh DRffwrl1ms+ZACKf+X9HW43Hjz1AhTw+3ZW0+tTBwP2pxeE0wD2p1qAC4u1tsFSto4IZ3f bIknWsadrzZGLfjD46xa5Z9eLEjIKe4lVEo3MNeXOjmo8rUqxY2lUEt4mrxVNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737462850; a=rsa-sha256; cv=none; b=oU56vA7I+K304ABhxnzCm2HCXRTE4vghB2bVywB0mFEVRia4CZiPxrVfA/Y/Xm5igwTz4V ZRSqgGRhns9VoIczdaZmJ2QAKjedxo4Q1x8NSpIe7S3gmH7ZiIlCJn03S2J1Op7bkHd4dg y5WPiWCuIZVpP8uMjbNaJ9EptR/+VuY9OZgVJLcJ0wj4dlP2JRo+Wk3iVzpN4KjfZyOUDL TFy5WcNBuLveOCJizjkznj2UnOCcfmPVij1web3Xdogm3GK4lALqe+IAkEZqzPUGcWZJqY PGNSEKwfpD6ZzQbwKvjeUWAWIUzAwgfOjIK8FA8oKRAQEn4Yt1a29ilBv6Fd5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycmq64vYkz15jg; Tue, 21 Jan 2025 12:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LCYAaA079288; Tue, 21 Jan 2025 12:34:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LCYADb079285; Tue, 21 Jan 2025 12:34:10 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:34:10 GMT Message-Id: <202501211234.50LCYADb079285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ecf605de97b7 - stable/13 - hid: Correctly handle signed/unsigned quantities in kernel HID parser. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: ecf605de97b702ef09c64ee51c5a70f427ae0bfa Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ecf605de97b702ef09c64ee51c5a70f427ae0bfa commit ecf605de97b702ef09c64ee51c5a70f427ae0bfa Author: Vladimir Kondratyev AuthorDate: 2024-12-22 03:16:11 +0000 Commit: Ed Maste CommitDate: 2025-01-21 12:33:47 +0000 hid: Correctly handle signed/unsigned quantities in kernel HID parser. Wrong signedness of usage value results in inverted range check in hmt(4) driver that allows out of bound array access leading to panic. Reported by: many Sponsored by: Future Crew, LLC Obtained from: NetBSD NetBSD PR: kern/53605 PR: 274014, 282592 (cherry picked from commit 38b67578fb4bbf568f7012ca3921a4d15cfe7c5d) (cherry picked from commit 1dda3a6ed9c51adc908fee4db5917b1232fa932c) --- sys/dev/hid/hid.c | 91 +++++++++++++++++++++++++++++-------------------------- sys/dev/hid/hid.h | 32 +++++++++---------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 5e6ad5bb7aef..b48fa01b31ec 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -73,7 +73,7 @@ hid_test_quirk_t *hid_test_quirk_p = &hid_test_quirk_w; #define MAXLOCCNT 2048 struct hid_pos_data { - int32_t rid; + uint32_t rid; uint32_t pos; }; @@ -83,9 +83,9 @@ struct hid_data { const uint8_t *p; struct hid_item cur[MAXPUSH]; struct hid_pos_data last_pos[MAXID]; - int32_t usages_min[MAXUSAGE]; - int32_t usages_max[MAXUSAGE]; - int32_t usage_last; /* last seen usage */ + uint32_t usages_min[MAXUSAGE]; + uint32_t usages_max[MAXUSAGE]; + uint32_t usage_last; /* last seen usage */ uint32_t loc_size; /* last seen size */ uint32_t loc_count; /* last seen count */ uint32_t ncount; /* end usage item count */ @@ -121,7 +121,7 @@ hid_clear_local(struct hid_item *c) } static void -hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID) +hid_switch_rid(struct hid_data *s, struct hid_item *c, uint32_t next_rID) { uint8_t i; @@ -246,6 +246,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) uint32_t oldpos; int32_t mask; int32_t dval; + uint32_t uval; if (s == NULL) return (0); @@ -257,10 +258,10 @@ hid_get_item(struct hid_data *s, struct hid_item *h) if (s->icount < s->ncount) { /* get current usage */ if (s->iusage < s->nusage) { - dval = s->usages_min[s->iusage] + s->ousage; - c->usage = dval; - s->usage_last = dval; - if (dval == s->usages_max[s->iusage]) { + uval = s->usages_min[s->iusage] + s->ousage; + c->usage = uval; + s->usage_last = uval; + if (uval == s->usages_max[s->iusage]) { s->iusage ++; s->ousage = 0; } else { @@ -268,7 +269,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } } else { DPRINTFN(1, "Using last usage\n"); - dval = s->usage_last; + uval = s->usage_last; } c->nusages = 1; /* array type HID item may have multiple usages */ @@ -322,28 +323,32 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } switch (bSize) { case 0: - dval = 0; + uval = 0; + dval = uval; mask = 0; break; case 1: - dval = (int8_t)hid_get_byte(s, 1); + uval = hid_get_byte(s, 1); + dval = (int8_t)uval; mask = 0xFF; break; case 2: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval = (int16_t)dval; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + dval = (int16_t)uval; mask = 0xFFFF; break; case 4: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval |= hid_get_byte(s, 1) << 16; - dval |= hid_get_byte(s, 1) << 24; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + uval |= hid_get_byte(s, 1) << 16; + uval |= hid_get_byte(s, 1) << 24; + dval = uval; mask = 0xFFFFFFFF; break; default: - dval = hid_get_byte(s, bSize); + uval = hid_get_byte(s, bSize); + dval = uval; DPRINTFN(0, "bad length %u (data=0x%02x)\n", bSize, dval); continue; @@ -355,7 +360,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 8: /* Input */ c->kind = hid_input; ret: - c->flags = dval; + c->flags = uval; c->loc.count = s->loc_count; c->loc.size = s->loc_size; @@ -385,7 +390,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) goto ret; case 10: /* Collection */ c->kind = hid_collection; - c->collection = dval; + c->collection = uval; c->collevel++; c->usage = s->usage_last; c->nusages = 1; @@ -411,7 +416,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 1: /* Global */ switch (bTag) { case 0: - c->_usage_page = dval << 16; + c->_usage_page = uval << 16; break; case 1: c->logical_minimum = dval; @@ -426,21 +431,21 @@ hid_get_item(struct hid_data *s, struct hid_item *h) c->physical_maximum = dval; break; case 5: - c->unit_exponent = dval; + c->unit_exponent = uval; break; case 6: - c->unit = dval; + c->unit = uval; break; case 7: /* mask because value is unsigned */ - s->loc_size = dval & mask; + s->loc_size = uval & mask; break; case 8: - hid_switch_rid(s, c, dval & mask); + hid_switch_rid(s, c, uval & mask); break; case 9: /* mask because value is unsigned */ - s->loc_count = dval & mask; + s->loc_count = uval & mask; break; case 10: /* Push */ /* stop parsing, if invalid push level */ @@ -483,14 +488,14 @@ hid_get_item(struct hid_data *s, struct hid_item *h) switch (bTag) { case 0: if (bSize != 4) - dval = (dval & mask) | c->_usage_page; + uval = (uval & mask) | c->_usage_page; /* set last usage, in case of a collection */ - s->usage_last = dval; + s->usage_last = uval; if (s->nusage < MAXUSAGE) { - s->usages_min[s->nusage] = dval; - s->usages_max[s->nusage] = dval; + s->usages_min[s->nusage] = uval; + s->usages_max[s->nusage] = uval; s->nusage ++; } else { DPRINTFN(0, "max usage reached\n"); @@ -503,16 +508,16 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage |= 1; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_minimum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_minimum = uval; goto check_set; case 2: s->susage |= 2; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_maximum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_maximum = uval; check_set: if (s->susage != 3) @@ -533,25 +538,25 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage = 0; break; case 3: - c->designator_index = dval; + c->designator_index = uval; break; case 4: - c->designator_minimum = dval; + c->designator_minimum = uval; break; case 5: - c->designator_maximum = dval; + c->designator_maximum = uval; break; case 7: - c->string_index = dval; + c->string_index = uval; break; case 8: - c->string_minimum = dval; + c->string_minimum = uval; break; case 9: - c->string_maximum = dval; + c->string_maximum = uval; break; case 10: - c->set_delimiter = dval; + c->set_delimiter = uval; break; default: DPRINTFN(0, "Local bTag=%d\n", bTag); diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index 5840c189352c..b8e733cde13d 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -236,31 +236,31 @@ struct hid_location { struct hid_item { /* Global */ - int32_t _usage_page; + uint32_t _usage_page; int32_t logical_minimum; int32_t logical_maximum; int32_t physical_minimum; int32_t physical_maximum; - int32_t unit_exponent; - int32_t unit; - int32_t report_ID; + uint32_t unit_exponent; + uint32_t unit; + uint32_t report_ID; /* Local */ int nusages; union { - int32_t usage; - int32_t usages[HID_ITEM_MAXUSAGE]; + uint32_t usage; + uint32_t usages[HID_ITEM_MAXUSAGE]; }; - int32_t usage_minimum; - int32_t usage_maximum; - int32_t designator_index; - int32_t designator_minimum; - int32_t designator_maximum; - int32_t string_index; - int32_t string_minimum; - int32_t string_maximum; - int32_t set_delimiter; + uint32_t usage_minimum; + uint32_t usage_maximum; + uint32_t designator_index; + uint32_t designator_minimum; + uint32_t designator_maximum; + uint32_t string_index; + uint32_t string_minimum; + uint32_t string_maximum; + uint32_t set_delimiter; /* Misc */ - int32_t collection; + uint32_t collection; int collevel; enum hid_kind kind; uint32_t flags; From nobody Tue Jan 21 14:08: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 4YcpwT1FJnz5l8Jx; Tue, 21 Jan 2025 14:08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcpwT0TdRz41P7; Tue, 21 Jan 2025 14:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737468537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SbV9kctG/guJPvh4gsi8bgxI+CqTCH47RPyMUTwJ88I=; b=Vdd6xPNptKVJUzMvWFYrPbcrnKVZb8+F7ZH5M9Z0wP3NWU3U5/66gfhGOQuGzScFYIgVwJ sMOTK99FfqwSKroEJr5LntGd2v4ZWnUW2JW70pC+aHSvFCIS59orrHM0rWP2EzvW4OtX7t MqIQ94OeqQEaHCO42veZB/jvrJc3nT7gd/0S/4EOH3TwhapZhD2ScXL9KByKY2hnK/oPyM AJVJO933ig20fG3IAC7hj5UDB5+xYn6/SKHA+wg/DVfdGj/i5XyQdPAomdMNCJZW0GC5Kf mr0WZjr2kb9bQnKXuhRViG38Av6y4a3d3mbsvUFYLrCGm77MpGjh7ydvyANepA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737468537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SbV9kctG/guJPvh4gsi8bgxI+CqTCH47RPyMUTwJ88I=; b=T/d6jAnbvz1aik6WSpUZontgQqAFyK6gjjGXGBmGD7duiM3zbkeu7sECpwYZ6seinNLHFy JaRQpU2Hd46g9mfAL7Oc9hil1zNJSnAiyi+TlnE36LZrA2odyhnS2ss/eGg4HpP9W3Zlda oquBYru7riNqNGuS7w5ZGIVl6aIXWZy4fSC+YwwJG8wBoh5s6cf0xzwEC5WZLNs0gIZz6t 6L4O/D1Jp1pBuChUisqNAu8RE8wCM7/uTLLeUWmK2iW1wLYT3EMqwDenPkvN8LiBD77oOp Qr5a7RvS4bY2eCGkTQuFnklhN7v5O3N8+Cmvil9VRwMXKDhCqEKQFvseLB3o3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737468537; a=rsa-sha256; cv=none; b=Ey0QtX/79bw+Mc9NzR8mPyqD1KZFDXkgyYslZQ9ieYnD7R8hMaQX5fwIrLP/jLH0RQpXZ3 vWYBiXpxpPbihEHPpKsw3jkTwpCUemGF5Q3DCciMZ6ZrumDJbbb2dodqbaw6a4LvhBplhT 2T5QH1gCYmrBKA8/8ntXqziebg/10zoCmaO6E9w6Ea/0xRyAjaNxLXxtMt+T9LRYuPO6JN HhFmPXyj9YS+ov/vz+Vk26SLy7OQ69CnUKWzYHZuIgw+OI87vH/BlohcVW87EbHGjhS4y7 6w2wXHeHyTuCaiKycnNhiRDcO8A18TGNgL5N0KK2RmvAvFMGOPcv1wC74Fry+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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcpwS6rhdz18kV; Tue, 21 Jan 2025 14:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LE8uj3049066; Tue, 21 Jan 2025 14:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LE8uSw049063; Tue, 21 Jan 2025 14:08:56 GMT (envelope-from git) Date: Tue, 21 Jan 2025 14:08:56 GMT Message-Id: <202501211408.50LE8uSw049063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0ec93987e530 - stable/14 - makefs: Handle special file types when creating a zpool List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 0ec93987e5302495f9512f8534a2375d7da4ee2a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0ec93987e5302495f9512f8534a2375d7da4ee2a commit 0ec93987e5302495f9512f8534a2375d7da4ee2a Author: Mark Johnston AuthorDate: 2025-01-07 14:31:02 +0000 Commit: Mark Johnston CommitDate: 2025-01-21 14:08:40 +0000 makefs: Handle special file types when creating a zpool Previously, anything other than a regular file, directory or symlink would cause makefs to exit with an assertion failure. Make it a bit more resilient to user error: print a warning and skip the file. Add a regression test wherein we create an image from a devfs mount. PR: 283583 MFC after: 2 weeks (cherry picked from commit ce878284318e71217d8d8f43f7d590b6c338d3aa) --- usr.sbin/makefs/tests/makefs_zfs_tests.sh | 22 +++++++++++++++++ usr.sbin/makefs/zfs/fs.c | 39 +++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/usr.sbin/makefs/tests/makefs_zfs_tests.sh b/usr.sbin/makefs/tests/makefs_zfs_tests.sh index aeda889d9a5c..3d5819439a73 100644 --- a/usr.sbin/makefs/tests/makefs_zfs_tests.sh +++ b/usr.sbin/makefs/tests/makefs_zfs_tests.sh @@ -148,6 +148,27 @@ dataset_removal_cleanup() common_cleanup } +# +# Make sure that we can handle some special file types. Anything other than +# regular files, symlinks and directories are ignored. +# +atf_test_case devfs cleanup +devfs_body() +{ + atf_check mkdir dev + atf_check mount -t devfs none ./dev + + atf_check -e match:"skipping unhandled" $MAKEFS -s 1g -o rootpath=/ \ + -o poolname=$ZFS_POOL_NAME $TEST_IMAGE ./dev + + import_image +} +devfs_cleanup() +{ + common_cleanup + umount -f ./dev +} + # # Make sure that we can create and remove an empty directory. # @@ -842,6 +863,7 @@ atf_init_test_cases() atf_add_test_case autoexpand atf_add_test_case basic atf_add_test_case dataset_removal + atf_add_test_case devfs atf_add_test_case empty_dir atf_add_test_case empty_fs atf_add_test_case file_extend diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c index 9413241da0c7..073dce3ce697 100644 --- a/usr.sbin/makefs/zfs/fs.c +++ b/usr.sbin/makefs/zfs/fs.c @@ -177,6 +177,13 @@ fsnode_isroot(const fsnode *cur) return (strcmp(cur->name, ".") == 0); } +static bool +fsnode_valid(const fsnode *cur) +{ + return (cur->type == S_IFREG || cur->type == S_IFDIR || + cur->type == S_IFLNK); +} + /* * Visit each node in a directory hierarchy, in pre-order depth-first order. */ @@ -186,9 +193,11 @@ fsnode_foreach(fsnode *root, int (*cb)(fsnode *, void *), void *arg) assert(root->type == S_IFDIR); for (fsnode *cur = root; cur != NULL; cur = cur->next) { - assert(cur->type == S_IFREG || cur->type == S_IFDIR || - cur->type == S_IFLNK); - + if (!fsnode_valid(cur)) { + warnx("skipping unhandled %s %s/%s", + inode_type(cur->type), cur->path, cur->name); + continue; + } if (cb(cur, arg) == 0) continue; if (cur->type == S_IFDIR && cur->child != NULL) @@ -381,9 +390,15 @@ fs_populate_sattrs(struct fs_populate_arg *arg, const fsnode *cur, */ for (fsnode *c = fsnode_isroot(cur) ? cur->next : cur->child; c != NULL; c = c->next) { - if (c->type == S_IFDIR) + switch (c->type) { + case S_IFDIR: links++; - objsize++; + /* FALLTHROUGH */ + case S_IFREG: + case S_IFLNK: + objsize++; + break; + } } /* The root directory is its own parent. */ @@ -652,6 +667,16 @@ fs_populate_symlink(fsnode *cur, struct fs_populate_arg *arg) fs_populate_sattrs(arg, cur, dnode); } +static fsnode * +fsnode_next(fsnode *cur) +{ + for (cur = cur->next; cur != NULL; cur = cur->next) { + if (fsnode_valid(cur)) + return (cur); + } + return (NULL); +} + static int fs_foreach_populate(fsnode *cur, void *_arg) { @@ -678,7 +703,7 @@ fs_foreach_populate(fsnode *cur, void *_arg) ret = (cur->inode->flags & FI_ROOT) != 0 ? 0 : 1; - if (cur->next == NULL && + if (fsnode_next(cur) == NULL && (cur->child == NULL || (cur->inode->flags & FI_ROOT) != 0)) { /* * We reached a terminal node in a subtree. Walk back up and @@ -694,7 +719,7 @@ fs_foreach_populate(fsnode *cur, void *_arg) eclose(dir->dirfd); free(dir); cur = cur->parent; - } while (cur != NULL && cur->next == NULL && + } while (cur != NULL && fsnode_next(cur) == NULL && (cur->inode->flags & FI_ROOT) == 0); } From nobody Wed Jan 22 21:28: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 4Ydcdf71lTz5l5KY; Wed, 22 Jan 2025 21:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydcdf5tXNz3P1v; Wed, 22 Jan 2025 21:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4CsSMvOZiDAWSNdQg7n0JfZzYxWX76tU3YBpP9lfbxI=; b=TR3q24mTskoHrmG4C6igDoBfDU0g3JjgUZBeii4t65kN8SK2nhpyVPfOf3F03LCP2ys7Hf n4lOfzgk/Ft17y6pLBZUtO0JuZqLWhHqiVXwj5MXmIsJ7ExFMnhUE+7ZHvvYIUZPGbY0Qg JH+16Ry+zdPKtkcH+D2wZGg+IQsl4W3+1/o/evjVnGWxQpnPclN/OZPtc6dKWIrRoEl4RC Q6Cskm7J2Dw+/32G2U/87jg3Zce3PVqj2KNwDFHwe57MCWgHPHRkqJ37rI+dRKJxhxDLXD z05QH8aF+nQJSEIVly5D8BQBE2I7jxNW2/V3cnoNCM76S4IeaLpTFlbe19VDfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4CsSMvOZiDAWSNdQg7n0JfZzYxWX76tU3YBpP9lfbxI=; b=saGbq36aE/gHSDlM3oo772SjfxW9uAZfS4IATaIx3xTU1DlJrlDxTRQdo/L2qNOS+AVkvW j0vLx/xBqIBBh8f4bkW4hr9Qe1Lqn80/NPmrVLbPnP6KNIGP4iXR2yKou+qc334wpER/cQ k7NHd+KixNH+X+glEhwVGj5XZCVSx35EvbB2TNK1oJaFLwndriseK/O13XrA+oHT+syN08 8AEIHJFOihRVcvjvg6u5wgdaUOT+HlhnGTvRSEbt2z27/oQi8l7wxYcdsUv4ap7hVPfLR/ 9M9PsgVT3QI62ag7U9x8kLv9dXOBa6EwpzrZkH6ZTI/o1vtRZy+o6Ads2U6mMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737581334; a=rsa-sha256; cv=none; b=pmgE6OE/t6UswWHhgHrpPRF/vseypC9E/TMsDTCAOaJc5+g/Cx8O214MxBqrzTbmLBD1sX m+MREa9wPYyTWCq4kQH5ss4ZLRIL2gOCB1aPJp0p5dRxExwehf1UfBabLpvVPIH27BfKwV Ljau+AwM20ZR8ExK9W2a2Uhg7z57dpra4O/u+D5rqAh4KZZpoHH8hLHzChlZCOJKcrSZAR Ee6WcL154Na3mkXx43C8kLg8PqEDYtBqaC0u5JBQvlMX2OOBlxJzI0Q7o4FX9M+wbPXN+k N25zYoqfp3eR099vUNYdNOvIGOZlL4Jp9ubz3lgczajpQ68gDy1sDm8yCCw2rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydcdf5CG6z18Pg; Wed, 22 Jan 2025 21:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLSswC071688; Wed, 22 Jan 2025 21:28:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLSsEO071685; Wed, 22 Jan 2025 21:28:54 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:28:54 GMT Message-Id: <202501222128.50MLSsEO071685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: e6061e54d6d4 - stable/14 - fwget: Silence log() when -q is used List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6061e54d6d4c0549b259c7d94630a6511561007 Auto-Submitted: auto-generated The branch stable/14 has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=e6061e54d6d4c0549b259c7d94630a6511561007 commit e6061e54d6d4c0549b259c7d94630a6511561007 Author: Renato Botelho AuthorDate: 2025-01-09 12:16:10 +0000 Commit: Renato Botelho CommitDate: 2025-01-22 21:28:44 +0000 fwget: Silence log() when -q is used Summary: Silence log function when -q parameter is used to prevent undesired output PR: 283939 Reviewed By: manu Differential Revision: https://reviews.freebsd.org/D48391 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 19a6bc9f51e5c5705a2b396b0da61e6536acb4cb) --- usr.sbin/fwget/fwget.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index 3e2181e53b73..d87cd03aa139 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -47,7 +47,9 @@ EOF log() { - echo "$@" + if [ "${QUIET}" != "y" ]; then + echo "$@" + fi } log_verbose() From nobody Wed Jan 22 21:28: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 4Ydcdh0rXdz5l5SH; Wed, 22 Jan 2025 21:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydcdg6RWkz3Nyk; Wed, 22 Jan 2025 21:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAA2ZFnbwi0PDHgulbtZBIetRBhX3+YWfo81yK9TUKQ=; b=wOMsDu+dFxpsCuW8yMeQk04GvNsaDinTFkqtdY7rzjHy93Obs4lcg+uVOSb7ZgfsVi0jRD Ngs7yo4tJJYULiT9pQaTd2yVY8mjDJw12tRzGbVIPIN1G7jo4JGOpTyxMluH7LrGi7tX73 SL3hxY9feJ73zytR9RfWd2pUQCxwxoXbXzGrz7VmE6V3FVsI/HsiTaAQK7vZDj4A5Y8Wk+ QkWZF6xtEWcOtLHFLjrxjuHOl2zHtCbthwcwUY5XbvhMkwaea4bUsqofkBGAxMnZmn/gRq Ht50vmE6WkD1oxsqVdtMgA3Ib7TVTqv4ZrVdOae1KYeGeh+fyldrpDhjJY6NTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAA2ZFnbwi0PDHgulbtZBIetRBhX3+YWfo81yK9TUKQ=; b=igF9b0G57dBmvCiBDhQZU4AKyTmvPLyizLEFROkZVCgdw9iPaXsVG8LyKEJNDY03cxtYjd 1jWB6S1l7naPB7jzg5kvT9VAdUrdKuxRlHbNQ4ga4SgnEpc+0snm5O1IOl7/6jUET08DE9 SRyt+iEBf+lo4rtc/N83WyRpLrt8GGEjP8lT9JTtLE2iVUxBYgLIV5IE1aXeU1YvB+8qrc Q2vQdS3HguzWOPg8vhrQ8blmuUPC2oKHaEjUF/aR9gLmZrdCFUI4GV69B84+VOZn6a9J6o Y4ofQTtzxw8yKKXcGM3Kkc6c874vnwjtgJp+cng74xIsQzDS8ORhtrcmmxaGVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737581335; a=rsa-sha256; cv=none; b=msynHhjHeeTNI1GBgVyg0FMTDucW+70woLfgTYuytCBnT00+lSowgvBPeB0tI8QFgi4LzP jWJR0hmIO6fbRX1os5+L3vpE6WefzlrmfVEsss2nbcvM7UiUy6e6A1/oPQQ9OVqtB/OEd+ rkEqwlS0TZ9VwK+2zN4SILLiKiJY6UXvBgMA/ZaLIoKGgEsjnD/mDkttHUYSF/N460FIFa tMZgPaagKIW9unjK4Dzed34jrWJROUaKNpJPhe45nEoyP0DKpYJnizSNahKU7UsNuOaJJM Yq0QNKPqJevVMS46pcGtV4kWDA5IACav4Bu+lj8uY/R09jVJOTJqI3pDs0iK8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydcdg5qr5z18D8; Wed, 22 Jan 2025 21:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLStuZ071722; Wed, 22 Jan 2025 21:28:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLStYV071719; Wed, 22 Jan 2025 21:28:55 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:28:55 GMT Message-Id: <202501222128.50MLStYV071719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: 4cdfa4e8db56 - stable/14 - fwget: Simplify logic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4cdfa4e8db56460bf5b51974019bd26fdab5a9b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=4cdfa4e8db56460bf5b51974019bd26fdab5a9b4 commit 4cdfa4e8db56460bf5b51974019bd26fdab5a9b4 Author: Renato Botelho AuthorDate: 2025-01-09 14:24:18 +0000 Commit: Renato Botelho CommitDate: 2025-01-22 21:28:45 +0000 fwget: Simplify logic Summary: Use log() to print messages that should be supressed when -q is in use. No functional changes intended. Differential Revision: https://reviews.freebsd.org/D48393 Reviewed By: manu Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fb98fc4755def2cb8ca145751b0e54485d5e2f4a) --- usr.sbin/fwget/fwget.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index d87cd03aa139..138a2a26bfb1 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -120,16 +120,12 @@ done case "${packages}" in ""|^[[:space:]]*$) - if [ "${QUIET}" != "y" ]; then - echo "No firmware packages to install." - fi + log "No firmware packages to install." exit 0 ;; esac -if [ "${QUIET}" != "y" ]; then - echo "Needed firmware packages: '${packages}'" -fi +log "Needed firmware packages: '${packages}'" if [ "${DRY_RUN}" = "y" ]; then if [ "${QUIET}" = "y" ]; then for pkg in ${packages}; do From nobody Thu Jan 23 06:36: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 4YdrnK4Msvz5ljQ7; Thu, 23 Jan 2025 06:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdrnK2tRlz3RQM; Thu, 23 Jan 2025 06:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KagLGCtijYCYEkTMNd/KX6fNE9wP2tfFPxxj8L31qXM=; b=fxqnWFjlA1NPH79IvH1CnitUphT9zRt8XCHrXuhr4wm9WSYF1ZsrviStoMBQRleGpSkSN2 P7vnQlPa+fugmOPgM1HVjXU0pwQstXUgZ4BuTmU8G9kFZX761+RT987yXe40OwnfKHCxos OT+9RnzBvrwgNmjZazWqnJQTwyLCQ+1g3Qz3+ZwK8KgkDfR+FtSsgPF7mYnL2G1ZM/7MIq PeEFpXQ+Qx264JiGbIu4iQ1dy3wGYwXjMsFivzSdUZYsy3qJVkZzi722XNaK/L6FUzC6cI W1PKDa/yLTecniKfgrA6eEZZBXR3V8F1+Z8ER6jbj2hlnf9TG0u54gJu1aFUPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KagLGCtijYCYEkTMNd/KX6fNE9wP2tfFPxxj8L31qXM=; b=C/lBsakDdun90SZfnlBglAXWYBiOlAuUgnIWMNUVfuaZ52Yltt3asjKJPDnpiDEYdQg5yE 1lB74xmqXvi3z9T9N1xku3RRlc/9uyV4jZaDwGFIvkmGtEttBUdVFLeudfpCe0GbBMLgPG jPKpdwplLpDpwShiv+oNx4q7AAB2XmZezEQXgOFQ8H3s1/nsbPt8kQuSn5qbQ5nIS33tFy QtM3WSyzl1NuVv+6X8uUXMLHGDVs30GhPpZHvc3KOMyfOvVzlY2QgnwK5bt5K9LINv14LH 8FcsYVVBXIsi/DcUAbn4Engv4/indIwsZE1+bvwiL/7HF3V7ZXnOaJefH6DZ4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614181; a=rsa-sha256; cv=none; b=R/+zZ2hQ3W7iaFNjaf7B9SEW+BM3xl/zKseEcshP1tMQw3Q2dSktaJ7qIOBJHEQfELu4At 9UCzUCt+GgcOjSiYmhNtdEw2v5cuJtKaJa3bFr2fvPkQka+OWTHGFmYzqiABIZdzRaAjiy BYXLQ4UCuLl4G1EwbanRiNG5DouhfskNMsK4EvVkr4rh68Kqec58qvrd8H7kuatgxbHsMh 98dA5it054aPbrm8nRRkWKzrPAsf7l51j31vlz9EKvCR5UwnuvRCKkM5tdTsgsBAwPUpcC pFlo29iKJIOfUv4ewZULL9qhGoDhZWue5OPOIigxbiHemILSaQIc6Djw0CN2tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdrnK2D8PzBt8; Thu, 23 Jan 2025 06:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6aLmI001252; Thu, 23 Jan 2025 06:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6aLGC001249; Thu, 23 Jan 2025 06:36:21 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:36:21 GMT Message-Id: <202501230636.50N6aLGC001249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 996fe40e05c9 - stable/14 - Eliminate unneeded variables and computations. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 996fe40e05c9b863ef029e27b6a44907a1d7fa4b Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=996fe40e05c9b863ef029e27b6a44907a1d7fa4b commit 996fe40e05c9b863ef029e27b6a44907a1d7fa4b Author: Kirk McKusick AuthorDate: 2025-01-12 21:51:24 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:36:04 +0000 Eliminate unneeded variables and computations. No functional change. (cherry picked from commit df48361e7792f9a9e6371f95c1228d4af2808d2a) --- sys/ufs/ffs/ffs_suspend.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index 3afbab82cba5..c35831c4bb96 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -245,16 +245,12 @@ ffs_susp_unsuspend(struct mount *mp) static void ffs_susp_dtor(void *data) { - struct fs *fs; - struct ufsmount *ump; struct mount *mp; int error; sx_xlock(&ffs_susp_lock); mp = (struct mount *)data; - ump = VFSTOUFS(mp); - fs = ump->um_fs; if (ffs_susp_suspended(mp) == 0) { sx_xunlock(&ffs_susp_lock); @@ -266,7 +262,8 @@ ffs_susp_dtor(void *data) error = ffs_reload(mp, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) - panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + panic("failed to unsuspend writes on %s", + VFSTOUFS(mp)->um_fs->fs_fsmnt); ffs_susp_unsuspend(mp); sx_xunlock(&ffs_susp_lock); From nobody Thu Jan 23 06:38: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 4Ydrr72j4pz5ljQJ; Thu, 23 Jan 2025 06:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydrr71zNKz3RRx; Thu, 23 Jan 2025 06:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tSY1AuscYOptyQh+KwYXHzBK8IuOvjrN8Lcq4MprOSI=; b=eeXkjtMu8t0/wMI81pDAwN56r22BagEv1kV4t0HoKl2BsxyTM8zWKoOGKmcPMlS10xoCXU wdlnGuqjfOvrFp/49Tfi/WmwRCt9TRgo4QjzowiFy29KP+dHPg9ddxhqYEzdePPHWkxi4y VtmV5DFdhldPwPu5QwefSlXEvNQHWqDb1qQQBf5bMxcVFfsmfM14MUhrp1iDz8dshClvo5 dYzRz2a1ALXIbNIGgHBVMU18t77rrS9t0W+a9wIEFIsvRcFayCmtZXaNCeN92IcyT8bNkV OL3mQIVoOLi8xKf5/5l6voruN1TnykMqgs0xnmUKiVncemTrTUrOwU7YUHn+Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tSY1AuscYOptyQh+KwYXHzBK8IuOvjrN8Lcq4MprOSI=; b=TXRZq0QDlilTAsW5VCMil788D7v+y+eiLXo07YVcxwAtYx0Xv1bLoUoWNUiYhwHxByRguR /n6KjXBZPNPvLHgYLLqS5ukE59hsaEcu19PujJif7lb/5oS5cNwY6AJtxepC+KUPaXcTjB 2qoqNhMzapOBRqkrQt+S3LS4mVWkQBeuxAVJK9ED35vJwiHl6dod6fwgZj1xhUXwGpVY8R u7SBWpwZcKRb5fGX4TwfwW958bLU3mJWJ+QPMy5rS12V1+lveUFE8fqo0moq84JvwXo1HN U94CZ4pr9ZOKRYnS8lzMEuL0BC99P2zoz0Va/O8LTr8/7viAGa++K5z0hJlisQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614327; a=rsa-sha256; cv=none; b=x4AmOdq9JMkYWuQVxPGiETs+pSH6Qc1Ziy7UhxJ6t1EtuisuMVf165OIV3dB+XaM/lX85H ezaDoslrOqwEJxbtLtEa2ajKM5qITdB8NFeccgmG17vYfqAbScpmVzvesrc5AtPVXxeh51 dv/5zZRjVQZ4BEvzPfdPizuze4RYcMQVAqB1R+sOxO333PGR9nno3Jo4gPKsCLhKqGqiYW tXLBeuUqw8/Is7+t7qVK3s3x9kvoHnWDnwckvnEAeMqxD/R6YEEyjiwjsbR2Oa2DL8yCxd Nghi671C3RFnhNfk2UnWsKREkyhKuD9ELqZVsZquQ+mWKwADgvyPjFcOZ+YFkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydrr714K3zC5t; Thu, 23 Jan 2025 06:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6ckZH002178; Thu, 23 Jan 2025 06:38:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6ckKV002175; Thu, 23 Jan 2025 06:38:46 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:38:46 GMT Message-Id: <202501230638.50N6ckKV002175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: f31c37f8acb2 - stable/14 - Use ffs_sbget() to replace open-coded superblock reload. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f31c37f8acb2c1edf356562994bb524bc2e67ed0 Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=f31c37f8acb2c1edf356562994bb524bc2e67ed0 commit f31c37f8acb2c1edf356562994bb524bc2e67ed0 Author: Kirk McKusick AuthorDate: 2025-01-15 21:08:42 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:37:43 +0000 Use ffs_sbget() to replace open-coded superblock reload. No functional change intended. Tested-by: Peter Holm (cherry picked from commit c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2) --- sys/ufs/ffs/ffs_vfsops.c | 87 ++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 65 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index c56603752a50..2b7353d157e2 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -580,8 +580,12 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, 0)) != 0) + (error = ffs_reload(mp, 0)) != 0) { return (error); + } else { + /* ffs_reload replaces the superblock structure */ + fs = ump->um_fs; + } if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { /* @@ -742,26 +746,20 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) * Things to do to update the mount: * 1) invalidate all cached meta-data. * 2) re-read superblock from disk. - * 3) re-read summary information from disk. - * 4) invalidate all inactive vnodes. - * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary - * writers, if requested. - * 6) invalidate all cached file data. - * 7) re-read inode data for all active vnodes. + * 3) If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. + * 4) invalidate all cached file data. + * 5) re-read inode data for all active vnodes. */ int ffs_reload(struct mount *mp, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; - void *space; struct buf *bp; struct fs *fs, *newfs; struct ufsmount *ump; - ufs2_daddr_t sblockloc; - int i, blks, error; - uint64_t size; - int32_t *lp; + int error; ump = VFSTOUFS(mp); @@ -784,31 +782,22 @@ ffs_reload(struct mount *mp, int flags) /* * Step 2: re-read superblock from disk. */ - fs = VFSTOUFS(mp)->um_fs; - if ((error = bread(devvp, btodb(fs->fs_sblockloc), fs->fs_sbsize, - NOCRED, &bp)) != 0) + if ((error = ffs_sbget(devvp, &newfs, UFS_STDSB, 0, M_UFSMNT, + ffs_use_bread)) != 0) return (error); - newfs = (struct fs *)bp->b_data; - if ((newfs->fs_magic != FS_UFS1_MAGIC && - newfs->fs_magic != FS_UFS2_MAGIC) || - newfs->fs_bsize > MAXBSIZE || - newfs->fs_bsize < sizeof(struct fs)) { - brelse(bp); - return (EINTEGRITY); - } /* - * Preserve the summary information, read-only status, and - * superblock location by copying these fields into our new - * superblock before using it to update the existing superblock. + * Replace our superblock with the new superblock. Preserve + * our read-only status. */ - newfs->fs_si = fs->fs_si; + fs = VFSTOUFS(mp)->um_fs; newfs->fs_ronly = fs->fs_ronly; - sblockloc = fs->fs_sblockloc; - bcopy(newfs, fs, (uint64_t)fs->fs_sbsize); - brelse(bp); + free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); + free(fs, M_UFSMNT); + fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_bsize = fs->fs_bsize; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); + ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -818,42 +807,10 @@ ffs_reload(struct mount *mp, int flags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - - /* - * Step 3: re-read summary information from disk. - */ - size = fs->fs_cssize; - blks = howmany(size, fs->fs_fsize); - if (fs->fs_contigsumsize > 0) - size += fs->fs_ncg * sizeof(int32_t); - size += fs->fs_ncg * sizeof(uint8_t); - free(fs->fs_csp, M_UFSMNT); - space = malloc(size, M_UFSMNT, M_WAITOK); - fs->fs_csp = space; - for (i = 0; i < blks; i += fs->fs_frag) { - size = fs->fs_bsize; - if (i + fs->fs_frag > blks) - size = (blks - i) * fs->fs_fsize; - error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - NOCRED, &bp); - if (error) - return (error); - bcopy(bp->b_data, space, (uint64_t)size); - space = (char *)space + size; - brelse(bp); - } /* - * We no longer know anything about clusters per cylinder group. + * Step 3: If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. */ - if (fs->fs_contigsumsize > 0) { - fs->fs_maxcluster = lp = space; - for (i = 0; i < fs->fs_ncg; i++) - *lp++ = fs->fs_contigsumsize; - space = lp; - } - size = fs->fs_ncg * sizeof(uint8_t); - fs->fs_contigdirs = (uint8_t *)space; - bzero(fs->fs_contigdirs, size); if ((flags & FFSR_UNSUSPEND) != 0) { MNT_ILOCK(mp); mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); From nobody Thu Jan 23 06:41: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 4Ydrtl25QSz5ljxM; Thu, 23 Jan 2025 06:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydrtl1Yf5z3Rqn; Thu, 23 Jan 2025 06:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j2Rts2BooKqxqkHHzRuecqgJpHG+iyPJXWe6IlH48yI=; b=LMKsmcW0XU3yh5ir/M5sk0TGXQM7r9qO6cU7+9L59aJyl4b1+PPeZh2DpANpeEPA4f4F2L 0uufgyoV9p6qrSJJdXhb/VPoCsijH+F3myfLUAHcn+7qgXqrfsZ8/BP8/ZLtyTHLAYN3FS XxHE0CbJtPV/mx8Rcy3I4WA3XCI3vTYJDytCJV8R6KOJaF7cW9FZX15R3UtEpXop15u96F czRXNR6uomNvKzwyqrr56qsCyEi1BA9mJwLFYxPPhdc1hSaez9MFC3zadZbnn/0viCiTeY u4aJt10Eeu7JEW0c6kBezG2Y4PPoCBjmCjzKlYN80HNi9qAPTyLAeruk6oQHvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j2Rts2BooKqxqkHHzRuecqgJpHG+iyPJXWe6IlH48yI=; b=Ix1jrzxR80VPHVlGSuKzKIEBWvE4DgG2DuYx6XPnwRdu5xcyBQHJvSIcH/GJbipScLS1tl +Yq51J+koX4EGMjLLoqo+GJnRH0aFYWaTgqXlTJXPHsFdbhgpTkwPO597UR2gN+0+EfutR WMfOXZs4yjeztYc2BmC8wUzOC9xMSV4uoO7MJB5TdnytFmL2zMEBUQwiPEp6hZxCvV2Ypt B8hfSeXkjskzzSA72PhhchJ2P4NUs59mne1erngCunlCU4Lahi2VleB8MpbhxXZsKuMrjW Nz065x1L6n6ghlaCOA8ENwlbqg5lQXTOxLhj6AzTNarL586l+bJl+IfPKgRldQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614463; a=rsa-sha256; cv=none; b=HpU12WVkNiVlrVUBXAL9mFy4uzV6L7fOqoTf7j7fSn+wCf/iZ3TbVjCtAXrrbVe0nMzHkW 2NRt5NdcuEAWygvwXT0pZgsIsrRu76YeXG5IT1j0Tt/YMc5I1eIARf+UK0XVdIgK2fQ6Ma q3p4Wck/ywGP1+sS/ZrkalYWJM17cQ+KaUukxAPSAMmUVFCXo+iysu8g2/TBOSExLa/07Q LnmnRwC48HAu21ayB4bOrOJj6ObZhC5Il7EEMIcbPUWj8Jm3Y5cgBfVj+Dm65GL3OCMlaw MXd98rZ6xOt9sHIOOhYujeuGUe5dy4Zv+WH1B02AgYhz3Bjy/jQpTP8NhhPRQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydrtl18DvzBtW; Thu, 23 Jan 2025 06:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6f3ds014324; Thu, 23 Jan 2025 06:41:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6f3Ae014321; Thu, 23 Jan 2025 06:41:03 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:41:03 GMT Message-Id: <202501230641.50N6f3Ae014321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 26c483aec039 - stable/14 - Fix backward compatibility with UFS1 filesystems created before June 2002 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 26c483aec039b01182bfef468fd7979895bcb645 Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=26c483aec039b01182bfef468fd7979895bcb645 commit 26c483aec039b01182bfef468fd7979895bcb645 Author: Kirk McKusick AuthorDate: 2025-01-16 18:43:48 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:39:45 +0000 Fix backward compatibility with UFS1 filesystems created before June 2002 Reviewed-by: kib Tested-by: Peter Holm Differential-Revision: https://reviews.freebsd.org/D48472 (cherry picked from commit 661ca921e8cd56b17fc6615bc7e596e56e0e7c31) --- sbin/growfs/debug.c | 2 - sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_snapshot.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 +- sys/ufs/ffs/ffs_subr.c | 81 +++++++++++++++++++++++++++++++++++++- sys/ufs/ffs/ffs_vfsops.c | 96 +--------------------------------------------- sys/ufs/ffs/fs.h | 5 ++- 7 files changed, 88 insertions(+), 104 deletions(-) diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index 456e67dbc5c2..ab4539d06a69 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -305,8 +305,6 @@ dbg_dump_fs(struct fs *sb, const char *comment) sb->fs_avgfilesize); fprintf(dbg_log, "avgfpdir int32_t 0x%08x\n", sb->fs_avgfpdir); - fprintf(dbg_log, "save_cgsize int32_t 0x%08x\n", - sb->fs_save_cgsize); fprintf(dbg_log, "flags int32_t 0x%08x\n", sb->fs_flags); fprintf(dbg_log, "contigsumsize int32_t 0x%08x\n", diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index f0c6eaaa1088..56e2fdd6ce51 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -84,7 +84,7 @@ int ffs_inotovp(struct mount *, ino_t, uint64_t, int, struct vnode **, int); int ffs_isblock(struct fs *, uint8_t *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, uint8_t *, ufs1_daddr_t); -void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +void ffs_oldfscompat_write(struct fs *); int ffs_own_mount(const struct mount *mp); int ffs_sbsearch(void *, struct fs **, int, struct malloc_type *, int (*)(void *, off_t, void **, int)); diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index ae3b444a19e9..77480f36e827 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -840,7 +840,7 @@ resumefs: copy_fs->fs_fmod = 0; bpfs = (struct fs *)&nbp->b_data[loc]; bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (uint64_t)fs->fs_sbsize); - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index fa2b0bf24366..316c978e1bdf 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9941,7 +9941,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) if (pino == 0) { bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, @@ -9973,7 +9973,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) (int)fs->fs_sbsize, 0, 0, 0); bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index fc43b4c06e7f..1792e1628a48 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -126,6 +126,7 @@ ffs_update_dinode_ckhash(struct fs *fs, struct ufs2_dinode *dip) static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int (*)(void *, off_t, void **, int)); +static void ffs_oldfscompat_read(struct fs *, ufs2_daddr_t); static int validate_sblock(struct fs *, int); /* @@ -271,6 +272,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags, if (fs->fs_magic == FS_UFS1_MAGIC && (flags & UFS_ALTSBLK) == 0 && fs->fs_bsize == SBLOCK_UFS2 && sblockloc == SBLOCK_UFS2) return (ENOENT); + ffs_oldfscompat_read(fs, sblockloc); if ((error = validate_sblock(fs, flags)) > 0) return (error); /* @@ -319,6 +321,83 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags, return (0); } +/* + * Sanity checks for loading old filesystem superblocks. + * See ffs_oldfscompat_write below for unwound actions. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +static void +ffs_oldfscompat_read(struct fs *fs, ufs2_daddr_t sblockloc) +{ + uint64_t maxfilesize; + + /* + * If not yet done, update fs_flags location and value of fs_sblockloc. + */ + if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { + fs->fs_flags = fs->fs_old_flags; + fs->fs_old_flags |= FS_FLAGS_UPDATED; + fs->fs_sblockloc = sblockloc; + } + /* + * If not yet done, update UFS1 superblock with new wider fields. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { + fs->fs_maxbsize = fs->fs_bsize; + fs->fs_time = fs->fs_old_time; + fs->fs_size = fs->fs_old_size; + fs->fs_dsize = fs->fs_old_dsize; + fs->fs_csaddr = fs->fs_old_csaddr; + fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; + fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; + fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; + fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; + } + if (fs->fs_magic == FS_UFS1_MAGIC && + fs->fs_old_inodefmt < FS_44INODEFMT) { + fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; + fs->fs_qbmask = ~fs->fs_bmask; + fs->fs_qfmask = ~fs->fs_fmask; + } + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_save_maxfilesize = fs->fs_maxfilesize; + maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; + if (fs->fs_maxfilesize > maxfilesize) + fs->fs_maxfilesize = maxfilesize; + } + /* Compatibility for old filesystems */ + if (fs->fs_avgfilesize <= 0) + fs->fs_avgfilesize = AVFILESIZ; + if (fs->fs_avgfpdir <= 0) + fs->fs_avgfpdir = AFPDIR; +} + +/* + * Unwinding superblock updates for old filesystems. + * See ffs_oldfscompat_read above for details. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +void +ffs_oldfscompat_write(struct fs *fs) +{ + + /* + * Copy back UFS2 updated fields that UFS1 inspects. + */ + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_old_time = fs->fs_time; + fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; + fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; + fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; + fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; + fs->fs_maxfilesize = fs->fs_save_maxfilesize; + } +} + /* * Verify the filesystem values. */ @@ -564,7 +643,7 @@ validate_sblock(struct fs *fs, int flags) sizepb *= NINDIR(fs); maxfilesize += sizepb; } - WCHK(fs->fs_maxfilesize, !=, maxfilesize, %jd); + WCHK(fs->fs_maxfilesize, >, maxfilesize, %jd); /* * These values have a tight interaction with each other that * makes it hard to tightly bound them. So we can only check diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 2b7353d157e2..16a955bc7f6d 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -85,8 +85,6 @@ static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; VFS_SMR_DECLARE; static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); -static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, - ufs2_daddr_t); static void ffs_ifree(struct ufsmount *ump, struct inode *ip); static int ffs_sync_lazy(struct mount *mp); static int ffs_use_bread(void *devfd, off_t loc, void **bufp, int size); @@ -797,7 +795,6 @@ ffs_reload(struct mount *mp, int flags) fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_bsize = fs->fs_bsize; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -1012,7 +1009,6 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); sx_init(&ump->um_checkpath_lock, "uchpth"); - ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; fs->fs_active = NULL; mp->mnt_data = ump; @@ -1221,96 +1217,6 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int size) return (0); } -static int bigcgs = 0; -SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, ""); - -/* - * Sanity checks for loading old filesystem superblocks. - * See ffs_oldfscompat_write below for unwound actions. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -static void -ffs_oldfscompat_read(struct fs *fs, - struct ufsmount *ump, - ufs2_daddr_t sblockloc) -{ - off_t maxfilesize; - - /* - * If not yet done, update fs_flags location and value of fs_sblockloc. - */ - if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { - fs->fs_flags = fs->fs_old_flags; - fs->fs_old_flags |= FS_FLAGS_UPDATED; - fs->fs_sblockloc = sblockloc; - } - /* - * If not yet done, update UFS1 superblock with new wider fields. - */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { - fs->fs_maxbsize = fs->fs_bsize; - fs->fs_time = fs->fs_old_time; - fs->fs_size = fs->fs_old_size; - fs->fs_dsize = fs->fs_old_dsize; - fs->fs_csaddr = fs->fs_old_csaddr; - fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; - fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; - fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; - fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; - } - if (fs->fs_magic == FS_UFS1_MAGIC && - fs->fs_old_inodefmt < FS_44INODEFMT) { - fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; - fs->fs_qbmask = ~fs->fs_bmask; - fs->fs_qfmask = ~fs->fs_fmask; - } - if (fs->fs_magic == FS_UFS1_MAGIC) { - ump->um_savedmaxfilesize = fs->fs_maxfilesize; - maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; - if (fs->fs_maxfilesize > maxfilesize) - fs->fs_maxfilesize = maxfilesize; - } - /* Compatibility for old filesystems */ - if (fs->fs_avgfilesize <= 0) - fs->fs_avgfilesize = AVFILESIZ; - if (fs->fs_avgfpdir <= 0) - fs->fs_avgfpdir = AFPDIR; - if (bigcgs) { - fs->fs_save_cgsize = fs->fs_cgsize; - fs->fs_cgsize = fs->fs_bsize; - } -} - -/* - * Unwinding superblock updates for old filesystems. - * See ffs_oldfscompat_read above for details. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -void -ffs_oldfscompat_write(struct fs *fs, struct ufsmount *ump) -{ - - /* - * Copy back UFS2 updated fields that UFS1 inspects. - */ - if (fs->fs_magic == FS_UFS1_MAGIC) { - fs->fs_old_time = fs->fs_time; - fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; - fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; - fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; - fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; - fs->fs_maxfilesize = ump->um_savedmaxfilesize; - } - if (bigcgs) { - fs->fs_cgsize = fs->fs_save_cgsize; - fs->fs_save_cgsize = 0; - } -} - /* * unmount system call */ @@ -2194,7 +2100,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size) UFS_UNLOCK(ump); fs = (struct fs *)bp->b_data; fs->fs_fmod = 0; - ffs_oldfscompat_write(fs, ump); + ffs_oldfscompat_write(fs); fs->fs_si = NULL; /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index 5769cd7776b4..c634c73e9a39 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -413,7 +413,8 @@ struct fs { int64_t fs_unrefs; /* number of unreferenced inodes */ int64_t fs_providersize; /* size of underlying GEOM provider */ int64_t fs_metaspace; /* size of area reserved for metadata */ - int64_t fs_sparecon64[13]; /* old rotation block list head */ + uint64_t fs_save_maxfilesize; /* save old UFS1 maxfilesize */ + int64_t fs_sparecon64[12]; /* old rotation block list head */ int64_t fs_sblockactualloc; /* byte offset of this superblock */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ @@ -426,7 +427,7 @@ struct fs { uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ uint32_t fs_avgfilesize; /* expected average file size */ uint32_t fs_avgfpdir; /* expected # of files per directory */ - int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ + uint32_t fs_available_spare; /* old scratch space */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ int32_t fs_sparecon32[21]; /* reserved for future constants */ From nobody Thu Jan 23 06:44: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 4Ydryp4CFYz5lk0h; Thu, 23 Jan 2025 06:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydryp3KT3z3SKY; Thu, 23 Jan 2025 06:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/us0cXdrYN/ooC8rlj8qgnwqUphXiQOSuG6qd03V+zs=; b=WcOG2F0Mv4ZeIvnKl4HxT60J5C5oRi4lbrEMBhtpA1nVwRxO2frFb/dSSV8RNLlLea4GrL VzAjDslCjSexM/MpoxDiiqKsDpBZiRfyX+X1bXDnUah8utWSGtphBM0Fe8Cl49bWOT5t9G NDTbmDa7JLt9M681h7Y0i3QDSSJNSIA53N8i6r1rxLoerx8lrt6Cc4gC26Er536eWJIZWH Vt4nCJIplpA9x4Ae1Mb/MKEB40REhM0tB2PPtFmb+wKvtMm/JhwKujyY33pHIYn+rg5SMI 2sKmfHzGLfeAoFWsoCX347CzdAA2Lc5Ovfpu3Iu9+KXic0cm3NvXTlGf4x2EdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/us0cXdrYN/ooC8rlj8qgnwqUphXiQOSuG6qd03V+zs=; b=wCbRg9aY4+5TrrSI9WGHWnintqGBjEgbChFRNy/72AGdKStVWdX5AbtSRFdlA4Dac56l09 4PzAy3J2sjP/Hqzj1yCVOK7qBBCjsPVzmLY74rfXVGzJDwlCxr5/5HlHCAPhsZgxGRWrHL 7yr4w8MdFuR+jM7AFAS6MUvFhl3+YcU51kmSKbx1LHHD0VeTWfShixVQS0IbsgaTB3u0e3 Z36jvFCSXQOmmD6RPQNFYuLC1r35P8WmjIRzPtcV8tZ5B7mSaTepIVRxGvxJrtuGffCnf9 UgIpSF87SEfVWHQPLgp3/g05PWpTUwBCrJgaYAaQGQJt4uKnfItATn79RTjU6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614674; a=rsa-sha256; cv=none; b=gdmljM+h7514Yz1uf1CpIEd3ipM0tRnydEfMwZ8hMDyKkrb4x/aRl6e/qy9R9V9FSzNRZz Wy7RvJwtfAwpyH5s2kq9gxZTTKcU3qJKpA6XCghhv7E0x2PDcAYCnlLFCy21urDf+zb2Vs UNqJpbtOmBbJ3+kf4ElDEJd2lrVNpWpUHt2yTaOR7lrvdmyFMDcEmriJlO1Udzfrojg4hI NX1fGIxoPanZyIX1ZD1BD6pbxA/b68wf+RshcD2EtkPNQ0FmUJEvlPu98Tg3m+eXV5LZ5e hREWrmVhY+lzNKJxxDEUJHkrmDgqSapEJTI++nHwKa9PbZQh4swghhlXjz/X/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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydryp2VrBzCQ2; Thu, 23 Jan 2025 06:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6iY1L019490; Thu, 23 Jan 2025 06:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6iY6d019487; Thu, 23 Jan 2025 06:44:34 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:44:34 GMT Message-Id: <202501230644.50N6iY6d019487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: bb14579988c5 - stable/13 - Eliminate unneeded variables and computations. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb14579988c5d82a272578e77ea719603b237fb3 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=bb14579988c5d82a272578e77ea719603b237fb3 commit bb14579988c5d82a272578e77ea719603b237fb3 Author: Kirk McKusick AuthorDate: 2025-01-12 21:51:24 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:44:17 +0000 Eliminate unneeded variables and computations. No functional change. (cherry picked from commit df48361e7792f9a9e6371f95c1228d4af2808d2a) --- sys/ufs/ffs/ffs_suspend.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index e23e12cc8be4..9e65cddc0d8f 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -242,16 +242,12 @@ ffs_susp_unsuspend(struct mount *mp) static void ffs_susp_dtor(void *data) { - struct fs *fs; - struct ufsmount *ump; struct mount *mp; int error; sx_xlock(&ffs_susp_lock); mp = (struct mount *)data; - ump = VFSTOUFS(mp); - fs = ump->um_fs; if (ffs_susp_suspended(mp) == 0) { sx_xunlock(&ffs_susp_lock); @@ -263,7 +259,8 @@ ffs_susp_dtor(void *data) error = ffs_reload(mp, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) - panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + panic("failed to unsuspend writes on %s", + VFSTOUFS(mp)->um_fs->fs_fsmnt); ffs_susp_unsuspend(mp); sx_xunlock(&ffs_susp_lock); From nobody Thu Jan 23 09:52: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 4Ydx760DWfz5lvrH; Thu, 23 Jan 2025 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydx755FJnz3s5Y; Thu, 23 Jan 2025 09:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JgQlKMWHRLQVdFpPDb1X2fefAckuC7N4Wvwmy2vey5s=; b=FKObdqxrliVT9AOZFnvpEdx/oAzlrtEzkxDYcuYqDmI4RCJpbeXo9vfj49PBsLyfA+X849 DAGtBNg0ZP72sjXfJEQiQJ0MdFlmbbxF01NkeW9e8pr49Mflbf5lbq6n2MW0OsTPCKkeaj +ywLhQB7TH3XuYEJUH2yRhaiWYGrLDpXFBBXaMVYp33zm3giCzWV58xxKiy48VL0bIkz0B pxND2i7euO6LPI4B9FznPhUxexal5JoE26X+eTmIACFTu63ZEIInSgVasy7plv3/pKkDva Jxr2MXdtm8T6YjnXjLpVMhC1eHFuDd/jHGXOE7JPEGw9ECx6E6FxulHjUSRe3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JgQlKMWHRLQVdFpPDb1X2fefAckuC7N4Wvwmy2vey5s=; b=YvP0XKQZpIpMkpOyCnX+vYOcRtbUv7T34Y2FSLOvPA6K2Fb5y+65CO3mZX+J/DaI0FJW3w lvmLy6SNd935yvjNr445nNQ4BoMrTuN0aZ0AbMST0wH3z5r1vbAQ1uBJTfZq0y2qtLq/fg ABsEyZUikoMOpArmlLMqzQQeD3Acnih/Xm+2iO0meUXf+Iz2KXq6+BwcBJ2U9/iDoqC98Q 5WN/z6G8IlkhLu0V6wZ7IOF6WTqVMkVtEP8+1g1YhjU8XU0ZmaNK0myv9ed0RnOxmb8wHF MJvmlu984Eg+nXomeiGdzCdo9MkRTqaU9fylosuPtH0JnhMtQPSDx/vXkY6NpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737625921; a=rsa-sha256; cv=none; b=iuJIpnSld+dJSGCnsgtNuTYw2m1iX5I8hZ2r9hPGF6x4wCkyB/fBK1/B7CzeA6P4hwhyWx s/j5Ndg3HDdAhoZsSwb+RQPdIysH7vcPxU8ZxeZzAq9pxDfMSxS+bbfNjJllXmMB060ceR sL6hMnLANz1LfdKWpsQ2LhR8qX4d5Lo4Wv1mekD04yMIY71IpyeBWNnqn13AOHjZKo0WaT fOhXfri/LC4hpJqzEt3bQgFg3llfvh84SVE/ovWj9AqTkSoWOg6zynLnSqN17w2XkCPHqF TmAlD0XgO0/2o1FPB62M1ItVHXHIM2UmIrQjCCicecDvaYWrlZZ4mRqMT5bjug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydx754rwkzZlY; Thu, 23 Jan 2025 09:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N9q1vw073436; Thu, 23 Jan 2025 09:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N9q1Da073433; Thu, 23 Jan 2025 09:52:01 GMT (envelope-from git) Date: Thu, 23 Jan 2025 09:52:01 GMT Message-Id: <202501230952.50N9q1Da073433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 57820508a012 - stable/14 - rtld-elf/rtld.c: fix typo in 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57820508a0128bb768bd8f54c6465bb2b88edada Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=57820508a0128bb768bd8f54c6465bb2b88edada commit 57820508a0128bb768bd8f54c6465bb2b88edada Author: Konstantin Belousov AuthorDate: 2025-01-18 06:33:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-23 09:46:57 +0000 rtld-elf/rtld.c: fix typo in comment (cherry picked from commit dd1d72961b8d343b29480b74afcfe4292fd166af) --- 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 c0d0be1d6cda..47680c363187 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5319,7 +5319,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) maxalign = MAX(tcbalign, tls_static_max_align); tls_init_align = MAX(obj_main->tlsalign, 1); - /* Compute fragmets sizes. */ + /* Compute fragments sizes. */ extra_size = tcbsize - TLS_TCB_SIZE; post_size = calculate_tls_post_size(tls_init_align); tls_block_size = tcbsize + post_size; From nobody Thu Jan 23 09:52: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 4Ydx770wzwz5lvl4; Thu, 23 Jan 2025 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydx766M9cz3rxY; Thu, 23 Jan 2025 09:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y5i07r8Vn0Gbp4JfkPwF15rprcRuwytp24F9fQuJWg=; b=q93IYBn8AjJkZUOe+glZ6vnfjcv2JCulbzl/+bwfA+7e24sfUZsquCVHlSPKC6S4s4gmdt jIURB2DBdu9tySFZ6V1UDbDJvxtaZnilsPnATg4d0gXQMJinvZyEdBTxxwGR3znM958pW3 7Pu3cvW74Irg5IWosJbeAX09aKXD3hnSOuzAzKwve+zcutA0nJQ5v4qOKp2l61cN0qMZms hohcc6fF5bzkZ+MWPhBFSbskk9rPRaJ25rhHJOSLuzqFUksybL3x+34lLigBgrELOD8U3m bGuhZCc9NOCkn5NDdHpVK0e3CcYeLVTH1Yuv8x5nEL+SFg3vx2ALoHIOYyLJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y5i07r8Vn0Gbp4JfkPwF15rprcRuwytp24F9fQuJWg=; b=PxSBTeu05Qs1PXQsz0ryRXtCP6ksrL62B8fO05OLotHudg7Q/hwHcMXXRnGt8xB1lGRYNu 64kSJipBltrtF/Sy3nS2T4zAc5LH4htiSruxqFM0T0p2T7UED/wDyfDoz/2TQ+SVcdEQpH DKCEN3ouNIEEiwvNN9ltW/Tcxjgl62m8SV42CGr9RpD4m5yq3BYoH7ZhUKPfJLG2EoYypD sZyCkL/r2M91gEC2SW7zSCa1MMK5Aep7qjOfxYSiLOqcc2fhz0843fjWfDCF2Fv2eWfsCV t7yYhujt7H9tnShKGAw257NznGHcxw7Q3no0d52yIA7eX4+wbbGM52g/COKYEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737625922; a=rsa-sha256; cv=none; b=tmG45GWpgtHLV+27e5VCjWO6dOITI9S9S133ugWjtkLFsAfqQZ2WInmhCELBTmS7sTDxHS +6wGoZL4v4Y4hGiMuVpUBJxukW+nxRGmI9xqYYZ0xIv+PQkJraxvfpl76mGfoXwtKRg4qS 2usn9LBXi62oAfgnCrfUOHOJPaaO0cxG4Ul2C5u92s2lwjaBE1gWxUBmXNt7kntP7boNa9 PbdynUFl5dLfBU13MhhDn4D5XQrkpo71m8FjbjCtixwvgHo3Yyj72Hp1dUnmwIqDe35NId 0ZBXKqcOpiTYLoYGWFv9LYEl20o+H5D6HHBWj/9Zexiyv/WWcxX9ZBG+39NdKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydx765tQYzZg1; Thu, 23 Jan 2025 09:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N9q2KZ073470; Thu, 23 Jan 2025 09:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N9q2Xc073467; Thu, 23 Jan 2025 09:52:02 GMT (envelope-from git) Date: Thu, 23 Jan 2025 09:52:02 GMT Message-Id: <202501230952.50N9q2Xc073467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f10a06556f56 - stable/14 - rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f10a06556f56ddbcf348a7b1e67a8e89b71c739d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f10a06556f56ddbcf348a7b1e67a8e89b71c739d commit f10a06556f56ddbcf348a7b1e67a8e89b71c739d Author: Konstantin Belousov AuthorDate: 2025-01-18 03:07:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-23 09:46:58 +0000 rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg (cherry picked from commit e3035c52f25356299abc8e08be9221032967554d) --- libexec/rtld-elf/amd64/reloc.c | 2 -- libexec/rtld-elf/i386/reloc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 9c5887def356..7e7f01a5d186 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -405,9 +405,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { -#ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); -#endif if (!ld_bind_not) *where = target; return (target); diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 04a8354343bc..361bb777315a 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -358,9 +358,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *obj __unused, const Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { -#ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); -#endif if (!ld_bind_not) *where = target; return (target); From nobody Thu Jan 23 10:17: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 4Ydxhx39WGz5kjc3; Thu, 23 Jan 2025 10:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydxhx2WJxz3xYD; Thu, 23 Jan 2025 10:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737627473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NqndeKLtt6Hmx1PtbH2fVic8AQaBr4aB1+yH6BMiPQ=; b=Jir9FDyg579kkX0GdMjS9gsy+ErgClBGBOS8gVzMxDbFMbdUhhgjIIeRHPJ/tk46CdBP3y aV/GnzMGXIJSJojuvgk+HlKtEN86OV8LTCiciKnhErC4+ruSvBI2muEV0wDkVutV6U8MCa sgJ10hWMBM5zTKgfnpCdwDf21mCD6IAJ48IOsRKnlEEnf0L4k1ND8EZJ2s9bbkNmn6tTJo qRliVAlrC/rJ3oB66BwOkSDpSkl33geaZChopQHbCYywLO/epyyTaoNB6LgANIvyVuoqm7 Tg0hL/59a6WAfZ67p7+WirI+X6FsRQEmgH53vzSYfq9i6xPM6wKeP4vHSJHuUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737627473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NqndeKLtt6Hmx1PtbH2fVic8AQaBr4aB1+yH6BMiPQ=; b=QlSbDeHgSXYejzriVzsnH+re0bh0sDko1jE/rMd3krqW9qGmeRkdXHkDssLmdcGfFNUqqd Tg36kNL9DMSUhufZHfvom/Y0/WVp51QylI/z36u16m4/zYimcTEIB2twm9Xfw3ShAxnPHE 4h3J7rskDzEONUOjw0wOj7aFBRo2O/1MHkGQXtLFghsHv0pg0GfITYmrFRW1GQaWyoQ2iZ FPgDgOPaCqXMwL9CXjiN03TplhE+H+Yh4at0B0LtUD1Ea6KO7Yn4zFFMqE5VSVOs35Ndjl +RrMPwK7QDerKxRSNnXEUnGVMdhDnYtEYXN89onEWdi1zykt2tQeNkyglgR6eA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737627473; a=rsa-sha256; cv=none; b=cbIhEA8siW/BEfHWMv5lekRCPNJfjA476c30P4vIn5CcsGsvRIhqFRTxzPeYMg49AoXqm3 XyAl5ZEk/TkwAa5joE6MpngivuPyIr9gOuUqjuOroSDtEXPIzDFcLtrKh7MKeMhUYM5MY4 GlKbGbbmEcg5+2inmlixjW3/Dwx97X84pMPIdQOXPpTlxqMHW4fBmF67zYTVHzqfz23ozs i7bB1cAKSZtc+3OUFUulOD6QPwk4wvakIS/RqPOXqV488MD1e7e4hjl5QC9uZDk504vOzm WeH7N97upNwqcgCAt5iBXX1j8IQTPmPsvv40X+W/6Vw0n88d3Lp+e1fx6W1oXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydxhx227Bzbgr; Thu, 23 Jan 2025 10:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NAHrVM015188; Thu, 23 Jan 2025 10:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NAHro9015184; Thu, 23 Jan 2025 10:17:53 GMT (envelope-from git) Date: Thu, 23 Jan 2025 10:17:53 GMT Message-Id: <202501231017.50NAHro9015184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 09cbd68e4e47 - stable/13 - sysctl: Add flags to filter jail prison and vnet variables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 09cbd68e4e4728dbac768937b35ad09995c20fea Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=09cbd68e4e4728dbac768937b35ad09995c20fea commit 09cbd68e4e4728dbac768937b35ad09995c20fea Author: Zhenlei Huang AuthorDate: 2024-10-29 11:26:11 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 09:47:10 +0000 sysctl: Add flags to filter jail prison and vnet variables So users do not have to contact the source code to tell whether a variable is a jail prison / vnet one or not. Reviewed by: cy (previous version), markj, jamie (for #jails) MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D47107 (cherry picked from commit 5ec83c660acaf30c1d6b9417dbd8c80dfa9d56ac) --- sbin/sysctl/sysctl.8 | 9 +++++++-- sbin/sysctl/sysctl.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index ee3f8579882f..ff0a8cea266d 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd August 18, 2023 +.Dd October 29, 2024 .Dt SYSCTL 8 .Os .Sh NAME @@ -107,6 +107,8 @@ The purpose is to make use of .Nm for collecting data from a variety of machines (not all of which are necessarily running exactly the same software) easier. +.It Fl J +Display only jail prision sysctl variables (CTLFLAG_PRISON). .It Fl N Show only variable names, not their values. This is particularly useful with shells that offer programmable @@ -144,6 +146,8 @@ to standard error. Display only variables that are settable via loader (CTLFLAG_TUN). .It Fl t Print the type of the variable. +.It Fl V +Display only VNET sysctl variables (CTLFLAG_VNET). .It Fl W Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. @@ -316,7 +320,8 @@ option has been deprecated and is silently ignored. .Xr loader.conf 5 , .Xr sysctl.conf 5 , .Xr security 7 , -.Xr loader 8 +.Xr loader 8 , +.Xr jail 8 .Sh HISTORY A .Nm diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 6f5c886bbf05..0fe6c92dc386 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -64,6 +64,7 @@ static const char *conffile; static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; static int Nflag, nflag, oflag, qflag, tflag, Tflag, Wflag, xflag; +static bool Jflag, Vflag; static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); @@ -136,7 +137,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AabB:def:hiJNnoqtTVwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -166,6 +167,9 @@ main(int argc, char **argv) case 'i': iflag = 1; break; + case 'J': + Jflag = true; + break; case 'N': Nflag = 1; break; @@ -184,6 +188,9 @@ main(int argc, char **argv) case 'T': Tflag = 1; break; + case 'V': + Vflag = true; + break; case 'w': /* compatibility */ /* ignored */ @@ -992,10 +999,18 @@ show_var(int *oid, int nlen, bool honor_skip) if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) return (1); + /* if Jflag then only list sysctls that are prison variables. */ + if (Jflag && (kind & CTLFLAG_PRISON) == 0) + return (1); + /* if Tflag then only list sysctls that are tuneables. */ if (Tflag && (kind & CTLFLAG_TUN) == 0) return (1); + /* if Vflag then only list sysctls that are vnet variables. */ + if (Vflag && (kind & CTLFLAG_VNET) == 0) + return (1); + if (Nflag) { printf("%s", name); return (0); From nobody Thu Jan 23 10:57: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 4YdyZN2j6lz5klwk; Thu, 23 Jan 2025 10:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdyZN1vfNz42rw; Thu, 23 Jan 2025 10:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737629836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D51q9atbZqGvKIWYZNNs2epEYYTSkfUF3/K/Do8UtO0=; b=Kt1Uo5oZ3hA+iDvpW9v0iY5Jvdb2CEaBKKRyC2hWK5lUqk2NQ47KdBrvoFeEE4JC3N8EQX e1Vk5Fz26j0isiGpUePHvEq8IZ19Ah2WOjcY9XXlGZXrES35FqSmXrJK0PbId6zhZAfLqw pGUUVI+wtWciKD+EKYL7UQCQxPBcSb2vi6iuobyX4rR4ZtsU0njqshh/G0P1EnszVsV8W6 1T99ZhUi6ATxxwGY38dYVYEdeXvogdGamVDGlRA08RAXYi0GkSoHdeGOz6F3Awsqf/HfI1 PECLIH2szOrs2ypKtMe6XjZnw8CZVpf1LIbaKUN6++96dvu9ZGUU2AawZc5UNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737629836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D51q9atbZqGvKIWYZNNs2epEYYTSkfUF3/K/Do8UtO0=; b=urxrcyCSA/2naDsD0CuHzTFkHGQWglE8uOnObmyuSfsl8wxv/v3E51VpVCVE2jYud2JdsC TpNZNL3rbHP9zOrwPdGZ8Ezr4SH22x2VjYeJYJ0MUnvJZhhGE1WSUuHo6jLkwNNEiub3pO eohSsl+3npsGU8wgame/Jk95a+PkBAMiFVT7jbBADBu65DycG5S+Mtq4TkwJESr87XlX8d Qq8ZJzHh/rg6ss/eJmmxpsix656Ai2GzYZo+dlQwWYcNmIZF5n+NXYQtaH9LYcEOX190lp lnpOwFIkaKNm/lDyeyNPa8zbdZAcCTBsk1b2CBBcz6m2Ei3W6M/j5Z6jPipqZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737629836; a=rsa-sha256; cv=none; b=Ck74/hKXxFO+m80UafrdBwhGSkYHHap0/uKzxSIwcjol++1Pdhl7QZJBWu+O/+maNn4HN4 uKzR7MuN2JbBbFVPnuWGqB5aJqfhL/qDaPZZP5K0LV0ZSYsCkXM3zFEV9TH2de+V/qqXEP v21hOhaOyxFWWVexbFbMlFPUHBL/aDu06ennSmal5xjAkGI6LRkiB0NJkZweGD+T4fNz3u ukjqkMiGZr/8RE0M4bRovnpr169qf3unVllsvVW+4kmbW1BTnNorn0m6uXlejSRxCrAgrH 3PKZp8QmR+RnCo4lvFT8Cfobx1M30U/HDHXN7srjca2no84MJQ+KnHHa8Z6Etg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdyZN1PM0zbcV; Thu, 23 Jan 2025 10:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NAvGp4089287; Thu, 23 Jan 2025 10:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NAvGwU089284; Thu, 23 Jan 2025 10:57:16 GMT (envelope-from git) Date: Thu, 23 Jan 2025 10:57:16 GMT Message-Id: <202501231057.50NAvGwU089284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1a1a1728e0be - stable/14 - kern_sysctl: Make name2oid() non-destructive to the name List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a1a1728e0bec6e5b978e6c5c7433ca91596b389 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1a1a1728e0bec6e5b978e6c5c7433ca91596b389 commit 1a1a1728e0bec6e5b978e6c5c7433ca91596b389 Author: Alexander Motin AuthorDate: 2023-09-23 16:13:46 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 10:56:26 +0000 kern_sysctl: Make name2oid() non-destructive to the name It is not the first time I see it panicking while trying to modify const memory. Lets make it safer and easier to use. While there, mark few functions using it also const. MFC after: 10 days (cherry picked from commit f80babf906b7be51b2a031ef26525893c7bf4e31) --- sys/kern/kern_sysctl.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 2e983e2ff803..7f0bd48747f3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -127,6 +127,7 @@ static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); static int sysctl_new_kernel(struct sysctl_req *, void *, size_t); +static int name2oid(const char *, int *, int *, struct sysctl_oid **); static struct sysctl_oid * sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) @@ -142,6 +143,21 @@ sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) return (NULL); } +static struct sysctl_oid * +sysctl_find_oidnamelen(const char *name, size_t len, + struct sysctl_oid_list *list) +{ + struct sysctl_oid *oidp; + + SYSCTL_ASSERT_LOCKED(); + SYSCTL_FOREACH(oidp, list) { + if (strncmp(oidp->oid_name, name, len) == 0 && + oidp->oid_name[len] == '\0') + return (oidp); + } + return (NULL); +} + /* * Initialization of the MIB tree. * @@ -1317,21 +1333,26 @@ static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXTNOSKIP, nextnoskip, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); static int -name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) +name2oid(const char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; + const char *n; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - oidp = sysctl_find_oidname(strsep(&name, "."), lsp); + n = strchrnul(name, '.'); + oidp = sysctl_find_oidnamelen(name, n - name, lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number; (*len)++; - if (name == NULL || *name == '\0') { + name = n; + if (*name == '.') + name++; + if (*name == '\0') { if (oidpp) *oidpp = oidp; return (0); @@ -2899,7 +2920,7 @@ db_show_sysctl_all(int *oid, size_t len, int flags) * Show a sysctl by its user facing string */ static int -db_sysctlbyname(char *name, int flags) +db_sysctlbyname(const char *name, int flags) { struct sysctl_oid *oidp; int oid[CTL_MAXNAME]; From nobody Thu Jan 23 11:21: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 4Ydz6P4bHBz5knHW; Thu, 23 Jan 2025 11:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydz6P40t2z481j; Thu, 23 Jan 2025 11:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BTmv3ZalWqRNFIM0q6qxaCQni8+yGDt4G2B95jbIkNA=; b=PZUaH3P24Pa7d6pwyhtbFbiIklZ9F7KkxHaPxsHEZOeaz4cIyFvu4JTJb6ImieCNfTJGdz 5F2UcB+i4XOmRIKyWVyw21/m+CUqul6Z9linzLvX8yIUitajRTZ9XQsyBABBhTa1GlRf5O qHvQQkUUta6RR/wMB+SxzQAquWBbNcP5MnztFr+AToi68Nn458E0cv4VGLW4SSep1W2WYc EKFBtu0+/f0uwUGUQyQdrSqFLTUOtdMNGIGXoAbE+PAdmO6FT9DYnrYaH+Q4MDEkDgss63 cq4ktJzpGHFNOWtVYM+Be/unJVWvWdnlr1CR2tehkfwukOgFzfA1NZmwbz6NkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BTmv3ZalWqRNFIM0q6qxaCQni8+yGDt4G2B95jbIkNA=; b=JLUAnpKsTGiXgfp4vS9l+dx3+kWOrrZpeK8tR/QhpQqSA14VA+LMV+vJL/uSm7tbL2g61v g42KslE8foWvViGMZ5SoJbzTszyETeskWQKynu3lED/fm9d1ie2twq2v7KT3s+Imqo62vT twTRXn4Fr04r3hcspBE4vnk6ZabtM00d9jkT7XaZt6qxePpxoObCclvGdYrVCzOPtnVNtP 6nTVQ9SO5ysqUWIkAe9NsN8jT2owksf3/IrTKnkd66ab5wdZCJota23pi0dJEsoyLXU6Lw Fg8QD99Pw4vq/bgaVyAG5rt6ibuZacEy3khEdxPSSzqpV2yFmpFOZrCeVHYYGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737631293; a=rsa-sha256; cv=none; b=RMOY+Py3zlZV7gFqjdkZLN5cTgnhL+i+Twb8TmWKdKVaNDcGwjl/wdqSovNcH083D2IZIw i+siMaEs+cKJI5N7QA2Rca6asafF7ni7RVSzNOweoJWrI3WX/WB9M0FDJ5LTs+a6Tg62YX ORQ2Sg2qKRJzzSqeUMg7AwJBlRyrINEb0EqFYFLQjMcxbRPXBC2f2gN/9SaVxlQ56Beg9b MCeLSk3QL4SRXs/RJ1MXpGNn5VAmqUWTxswzQnhSayu+FBuvdE/xtWfgBKxalbgVVkYsXP 6U5vopIitpI83RXn9QF/mhCcAkk8Sk3ChQt76d2i/j2ejrxAM0MhzHBmxqUEkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydz6P3bDBzd5q; Thu, 23 Jan 2025 11:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NBLXtb038098; Thu, 23 Jan 2025 11:21:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NBLXEI038095; Thu, 23 Jan 2025 11:21:33 GMT (envelope-from git) Date: Thu, 23 Jan 2025 11:21:33 GMT Message-Id: <202501231121.50NBLXEI038095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: c44335b1a313 - stable/13 - name2oid: use find_oidname List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c44335b1a3137628f1b5c657c11aff1a95329085 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c44335b1a3137628f1b5c657c11aff1a95329085 commit c44335b1a3137628f1b5c657c11aff1a95329085 Author: Doug Moore AuthorDate: 2022-09-27 21:17:55 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 11:09:18 +0000 name2oid: use find_oidname In name2oid, use sysctl _find_oidname instead of re-implementing it. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36765 (cherry picked from commit 9f6f9007b98fc407a1b064c4492697e27954191a) --- sys/kern/kern_sysctl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 2543c4bde785..aa9d271f3bd2 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1323,17 +1323,11 @@ name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; - char *p; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - p = strsep(&name, "."); - - SYSCTL_FOREACH(oidp, lsp) { - if (strcmp(p, oidp->oid_name) == 0) - break; - } + oidp = sysctl_find_oidname(strsep(&name, "."), lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number; From nobody Thu Jan 23 11:21: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 4Ydz6Q6vPhz5knDk; Thu, 23 Jan 2025 11:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydz6Q5RxHz48Bm; Thu, 23 Jan 2025 11:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8JVI37aWZZHza9eLbQFO8lIyq8nZBtx/0qfWUN43iY=; b=Jzmq8eS1b+FW+DFBqBBvAupxTxBz+M20QCddMDTlcQpsPxBM3QO0SN2uTSS4CPg+i2qQf4 E+AVyjFMYq98obl8nkHcAkhSbLgnLDRJWe7OPbloglaZHd6Ds/eNZpgbEat56Sisi2SDHp YM7Kms2TC1BK6A3a5gZQsDTEkWaTsEujZZ0st9Hp9RQ42Za1JdWs1yKqIUADkzjlfe9voW ZggvsPlx4CvEGL/KHx5RHHbK7OVjqnqHTcGEdxtJQOgE9+XayoBojBIQ1oyX9U1JvgxTDT K/hRsXWD6QYNvErsQn3UIxXDYe0mdRGnep3owYkzrNNp7dQ65MbOZb+qbG8Tvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8JVI37aWZZHza9eLbQFO8lIyq8nZBtx/0qfWUN43iY=; b=QA8LIeve4mnmE8vEe6iVinrGTvDXB++YQ5kZ1rSCcEk0PK3vcqwyob206udJRp+vt++XNo mFvu/84RPqjTx/KWFGhwD4bSUZy2fIIRAlNf4CL5FmHnjDgay9mRvSYqxRZfxSr8npo7Pl Yb9t43qig76y3ReAL42TMSEbSVDt3VErhTpgzga+scMY+sVBnPLSohZEgzMR1jQ6EmDtRO UjOHQJwQFbKrj65ZH9x/KgIZZidlJ4yH32qHAQc/N+xNRlI2oRSutPtZCJX0y717SXVJaG KA5rOfscmRUcX/2qmdhHS1m4haI2NY3jKpyfraDAvMrYHH3xGc/fVMXt/KUVqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737631294; a=rsa-sha256; cv=none; b=TskLaN15c38GFT51gNcI4LCuUW2F6xdY8bb3qRG+gJppDTK7nI+Nus9nZp2m23Llhcf+U/ 4s6zxbKnJ7lPso2sr/3PMrC/BSnEg7eYBYJ+vPBRHelK0N70HUXqBoDCMo2LY7TQNi9FnY 0VbRzg6WaRFgE562Fa/1rya8HFcU631nQrMswE3brFKn5Q6anYNSeDMVyzZjQdjOSW1vew RyXls+ujM8jxJAQNKW6soKUJSz0NaGV6K/5KX8WG3tZBCwfS6EIdDGpnq3MlpifpVU0fzh bbWQhfY7kA4rD9Flww9j4rI+ta0D2cox7DyWevDZeFdKMjnbf9Mp+/exzvVo5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydz6Q4Lslzd5r; Thu, 23 Jan 2025 11:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NBLYUF039194; Thu, 23 Jan 2025 11:21:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NBLYoq039191; Thu, 23 Jan 2025 11:21:34 GMT (envelope-from git) Date: Thu, 23 Jan 2025 11:21:34 GMT Message-Id: <202501231121.50NBLYoq039191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 69e2004d8434 - stable/13 - kern_sysctl: Make name2oid() non-destructive to the name List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 69e2004d843452bffdebdf164ab5346b1b81a9e6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=69e2004d843452bffdebdf164ab5346b1b81a9e6 commit 69e2004d843452bffdebdf164ab5346b1b81a9e6 Author: Alexander Motin AuthorDate: 2023-09-23 16:13:46 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 11:09:34 +0000 kern_sysctl: Make name2oid() non-destructive to the name It is not the first time I see it panicking while trying to modify const memory. Lets make it safer and easier to use. While there, mark few functions using it also const. MFC after: 10 days (cherry picked from commit f80babf906b7be51b2a031ef26525893c7bf4e31) (cherry picked from commit 1a1a1728e0bec6e5b978e6c5c7433ca91596b389) --- sys/kern/kern_sysctl.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index aa9d271f3bd2..a19f3a5ab27b 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -125,6 +125,7 @@ static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); static int sysctl_new_kernel(struct sysctl_req *, void *, size_t); +static int name2oid(const char *, int *, int *, struct sysctl_oid **); static struct sysctl_oid * sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) @@ -140,6 +141,21 @@ sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) return (NULL); } +static struct sysctl_oid * +sysctl_find_oidnamelen(const char *name, size_t len, + struct sysctl_oid_list *list) +{ + struct sysctl_oid *oidp; + + SYSCTL_ASSERT_LOCKED(); + SYSCTL_FOREACH(oidp, list) { + if (strncmp(oidp->oid_name, name, len) == 0 && + oidp->oid_name[len] == '\0') + return (oidp); + } + return (NULL); +} + /* * Initialization of the MIB tree. * @@ -1319,21 +1335,26 @@ static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXTNOSKIP, nextnoskip, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); static int -name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) +name2oid(const char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; + const char *n; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - oidp = sysctl_find_oidname(strsep(&name, "."), lsp); + n = strchrnul(name, '.'); + oidp = sysctl_find_oidnamelen(name, n - name, lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number; (*len)++; - if (name == NULL || *name == '\0') { + name = n; + if (*name == '.') + name++; + if (*name == '\0') { if (oidpp) *oidpp = oidp; return (0); @@ -2909,7 +2930,7 @@ db_show_sysctl_all(int *oid, size_t len, int flags) * Show a sysctl by its user facing string */ static int -db_sysctlbyname(char *name, int flags) +db_sysctlbyname(const char *name, int flags) { struct sysctl_oid *oidp; int oid[CTL_MAXNAME]; From nobody Thu Jan 23 13:58: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 4Yf2bw58hbz5l041; Thu, 23 Jan 2025 13:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2bw4TXYz3bqs; Thu, 23 Jan 2025 13:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOgB/7cyjpL2wubQyJZHxXEXU6q2GzrVW6xXVQ3saAM=; b=Lqbo8DLQzVgSmi7DeECJ2e6JXESicm6RST7DqA+xPxTSKPuaoiCPeZh/5Mpu4QQhJCUVqR mLmq+6S3ujE/AZ2fx5tAlmPQD8W9UEK1imSSl9rDA3BwYA+kwa4Ebwnhodxqg74rBdBh2V GeTsOI2Vzz/7zADwjABGW6BLXSAuiKWq1vX7Cpue0tocKqxdzMvECOKNKTbrM0q00wwtqV k+osiONNuJt8//kgZNsM2v5fwZVbln3EKvn2IiopgdYjWiN5FwX82B8yf2rCxR0HKXqzbq AtYYcFcQyxyhghAIWVnw68pQfFFJP0/tsgbi7sigBqVCK5OTCdKSbkR//8DDaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOgB/7cyjpL2wubQyJZHxXEXU6q2GzrVW6xXVQ3saAM=; b=ukmu2otBVUUrlp0QsnS4cxN3ybW3P+Tojri99p0MussZqSSDRZZ2hhVx2bUvePmvZstt6q q+nXrv6EP8pY4H+KlD2cj60jNIhhotSADo1qxeSpUUOBlpTHQdHtf7Carvi/2Q67wfZyna h8h/kzVA0ggbs3mFEQaK/5zlMfLtcn2T0BKjo2Wi1cZe8sduJmOrVzWYP34ZdHjX1onS7l ToDkfmug9llzR+wVbIVQPUEpDCzCiAC9pxcEWKo7o9+gpmX4iyOBr4pUx3BIy5H3eX3jx3 Xulr5dC8dBt+vt9ssSst7HRYLHbl9CBaE8u4n9cRt7F8XuD/UlB7AHGuevud+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640732; a=rsa-sha256; cv=none; b=gZqfAGguLJLEqx3sAz8ydNIR9gcw+v3I/zgMR/QbOK4vaRRl6vES4TQPGVJFaWtrnYPitR IjhRbkaxfD+tiSghliPPLJG2yEhgLk1im7PJvB39t6Up4iGlNvxfbPDIm0evfRMZe83iG5 ZBzj22OhczhOlmnMujUcu4TqZNsV7dXSpVr8Sa0rA+lpan22eWHN5hhv1GMbovcJCXy1WB +c+vBq7DgWY5s8kwmGMfZF34tmPpebh5n54zGrNBG8T2ZXpln+t7Gc7On1rFveDlLQjtnx CgvWfCEzo/jxmnifJnUGt+EIl02xaCiPF+jUhIz02oC5iD0VBqKIoVqOtb92CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2bw3xGFzj8t; Thu, 23 Jan 2025 13:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDwqs8026233; Thu, 23 Jan 2025 13:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDwqSh026230; Thu, 23 Jan 2025 13:58:52 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:58:52 GMT Message-Id: <202501231358.50NDwqSh026230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 49f741240242 - stable/14 - inpcb: Further restrict binding to a port owned by a different UID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 49f7412402428e827f4f8b3583703a6784baa764 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49f7412402428e827f4f8b3583703a6784baa764 commit 49f7412402428e827f4f8b3583703a6784baa764 Author: Mark Johnston AuthorDate: 2024-12-23 15:31:11 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:07 +0000 inpcb: Further restrict binding to a port owned by a different UID See commit 4f02a7d739b3 for more background. I cannot see a good reason to continue ignoring mismatching UIDs when binding to INADDR_ANY. Looking at the sdr.V2.4a7n sources (mentioned in bugzilla PR 7713), there is a CANT_MCAST_BIND hack wherein the application binds to INADDR_ANY instead of a multicast address, but CANT_MCAST_BIND isn't defined for FreeBSD builds. It seems unlikely that we still have a use-case for allowing sockets from different UIDs to bind to the same port when binding to the unspecified address. And, as noted in D47832, applications like sdr would have been broken by the inverted SO_REUSEPORT check removed in that revision, apparently without any bug reports. Let's break compatibility and simply disallow this case outright. Also, add some comments, remove a hack in a regression test which tests this funtionality, and add a new regression test to exercise the remaining checks that were added in commit 4658dc8325e03. MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47870 (cherry picked from commit c9756953bded0d8428027fa3e812c9bdac069252) --- sys/netinet/in_pcb.c | 11 ++++- sys/netinet6/in6_pcb.c | 11 ++++- tests/sys/netinet/socket_afinet.c | 86 ++++++++++++++++++++++++++++++++++----- 3 files changed, 94 insertions(+), 14 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 15729bcd1ce3..937fa6f826c0 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -921,13 +921,20 @@ in_pcbbind_avail(struct inpcb *inp, const struct in_addr laddr, if (!IN_MULTICAST(ntohl(laddr.s_addr)) && priv_check_cred(inp->inp_cred, PRIV_NETINET_REUSEPORT) != 0) { + /* + * If a socket owned by a different user is already + * bound to this port, fail. In particular, SO_REUSE* + * can only be used to share a port among sockets owned + * by the same user. + * + * However, we can share a port with a connected socket + * which has a unique 4-tuple. + */ t = in_pcblookup_local(inp->inp_pcbinfo, laddr, lport, INPLOOKUP_WILDCARD, cred); if (t != NULL && (inp->inp_socket->so_type != SOCK_STREAM || in_nullhost(t->inp_faddr)) && - (!in_nullhost(laddr) || - !in_nullhost(t->inp_laddr)) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index b3b2f03451aa..a88e47abef64 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -241,13 +241,20 @@ in6_pcbbind_avail(struct inpcb *inp, const struct sockaddr_in6 *sin6, if (!IN6_IS_ADDR_MULTICAST(laddr) && priv_check_cred(inp->inp_cred, PRIV_NETINET_REUSEPORT) != 0) { + /* + * If a socket owned by a different user is already + * bound to this port, fail. In particular, SO_REUSE* + * can only be used to share a port among sockets owned + * by the same user. + * + * However, we can share a port with a connected socket + * which has a unique 4-tuple. + */ t = in6_pcblookup_local(inp->inp_pcbinfo, laddr, lport, INPLOOKUP_WILDCARD, cred); if (t != NULL && (inp->inp_socket->so_type != SOCK_STREAM || IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && - (!IN6_IS_ADDR_UNSPECIFIED(laddr) || - !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr)) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); diff --git a/tests/sys/netinet/socket_afinet.c b/tests/sys/netinet/socket_afinet.c index ba8c03af46a6..6fc98d982602 100644 --- a/tests/sys/netinet/socket_afinet.c +++ b/tests/sys/netinet/socket_afinet.c @@ -337,7 +337,8 @@ ATF_TC_BODY(socket_afinet_bindany, tc) * Returns true if the bind succeeded, and false if it failed with EADDRINUSE. */ static bool -child_bind(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt, bool unpriv) +child_bind(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt, + bool unpriv) { const char *user; pid_t child; @@ -483,16 +484,8 @@ multibind_test(const atf_tc_t *tc, int domain, int type) /* * Multi-binding is only allowed when both * sockets have the same owner. - * - * XXX-MJ we for some reason permit this when - * binding to the unspecified address, but I - * don't think that's right */ - if (flags[flagi] && opts[opti] != 0 && - opts[opti] != SO_REUSEADDR && opti == optj) - ATF_REQUIRE(res); - else - ATF_REQUIRE(!res); + ATF_REQUIRE(!res); } ATF_REQUIRE(close(s) == 0); } @@ -517,6 +510,78 @@ ATF_TC_BODY(socket_afinet_multibind, tc) multibind_test(tc, AF_INET6, SOCK_DGRAM); } +static void +bind_connected_port_test(const atf_tc_t *tc, int domain) +{ + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + struct sockaddr *sinp; + int error, sd[3], tmp; + bool res; + + /* + * Create a connected socket pair. + */ + sd[0] = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd[0] >= 0, "socket failed: %s", strerror(errno)); + sd[1] = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd[1] >= 0, "socket failed: %s", strerror(errno)); + if (domain == PF_INET) { + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons(0); + sinp = (struct sockaddr *)&sin; + } else { + ATF_REQUIRE(domain == PF_INET6); + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_addr = in6addr_any; + sin6.sin6_port = htons(0); + sinp = (struct sockaddr *)&sin6; + } + + error = bind(sd[0], sinp, sinp->sa_len); + ATF_REQUIRE_MSG(error == 0, "bind failed: %s", strerror(errno)); + error = listen(sd[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen failed: %s", strerror(errno)); + + error = getsockname(sd[0], sinp, &(socklen_t){ sinp->sa_len }); + ATF_REQUIRE_MSG(error == 0, "getsockname failed: %s", strerror(errno)); + + error = connect(sd[1], sinp, sinp->sa_len); + ATF_REQUIRE_MSG(error == 0, "connect failed: %s", strerror(errno)); + tmp = accept(sd[0], NULL, NULL); + ATF_REQUIRE_MSG(tmp >= 0, "accept failed: %s", strerror(errno)); + ATF_REQUIRE(close(sd[0]) == 0); + sd[0] = tmp; + + /* bind() should succeed even from an unprivileged user. */ + res = child_bind(tc, SOCK_STREAM, sinp, 0, false); + ATF_REQUIRE(!res); + res = child_bind(tc, SOCK_STREAM, sinp, 0, true); + ATF_REQUIRE(!res); +} + +/* + * Normally bind() prevents port stealing by a different user, even when + * SO_REUSE* are specified. However, if the port is bound by a connected + * socket, then it's fair game. + */ +ATF_TC(socket_afinet_bind_connected_port); +ATF_TC_HEAD(socket_afinet_bind_connected_port, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "require.config", "unprivileged_user"); +} +ATF_TC_BODY(socket_afinet_bind_connected_port, tc) +{ + bind_connected_port_test(tc, AF_INET); + bind_connected_port_test(tc, AF_INET6); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_afinet); @@ -527,6 +592,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, socket_afinet_stream_reconnect); ATF_TP_ADD_TC(tp, socket_afinet_bindany); ATF_TP_ADD_TC(tp, socket_afinet_multibind); + ATF_TP_ADD_TC(tp, socket_afinet_bind_connected_port); return atf_no_error(); } From nobody Thu Jan 23 13:58: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 4Yf2by0kQsz5l042; Thu, 23 Jan 2025 13:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2bx54Rhz3byc; Thu, 23 Jan 2025 13:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBRzkyQHKUcDaon1Zk6IwjLy4ZMjiKkWYySWWY7XmSw=; b=sVza74/3yoSAakqirQXl10UPpJuYKIb6QCSR96Lwzk9SgZRYKoY0YbdRuiw1zfjtxTqTrr 7ycymXx8w/ZpFmlFOO65SiTMGQZrRjKrs0oZS63I0NsHWouinj9tCCiK9pmpTmr7uPHjA/ jM3dktRW9vJ5tcoYH/wffPIl4cKxyc89WVSRTlLKz+L6DtmL9q6N+OER4eyhJfslmNOI50 zqWjPUlaN5yJ10b+pJ/hyH362TVdpQ0t4vnop/VIVKZvvdQfliva1cVOPa1UaSX/PSLeCA Pxx2GMRVLjPwvcuj6GBpwyaKJ5zzwOJcDz6zedVxaVedxJ9K+V0UhAanP+vWuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBRzkyQHKUcDaon1Zk6IwjLy4ZMjiKkWYySWWY7XmSw=; b=QYHFXHpFdcfgKTxAHWj8HtVdCBfCZogCUaTRhPJgcM4GrGkVV2bShDLFEiUSL2HFSX/a8L Ea/W/KkAh7QAvJxokkJ/kVejfuVfJrNh26SLil75kDPnpW8Wl/6xR+q9SsOJ+qlA3t5SVM cETqzXcw0gUgN8m+vLIx5XafEE6XZy5/QRpnBcmr0ires/+dL/JvoW17oVEFZahEyd5pZT z0N2qz51rWpoOfU4BLIx77WJoK3Qq1Ih+z7NOumyzZBJ22Xw1CJ+ov4EftLYesBVJ1YP76 GV+uEtBh8nLX2fKpO4swctxnKONhjgbP5SWKyL37hMqqpxTKoX1jDB5EBCul2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640733; a=rsa-sha256; cv=none; b=U48Il/OJeS2Id1D5R9Rq51KrrvIcbNihecC6S24zvi9PKo+vPNGB4w7XZ+qn7bVUBAac8M HF3VoP2xyueMx1Ar3sxuQyXbYTmk/Kt2RMU0l59aKzfx6Ytasfdmu5ovbuUy9gSdY88kpp nyZH9xusIA1hq7ObDT3PJFOhh2FINojmKWIujouTZ9C+FlwXJj4uekIE8aXTTHxTSR2mjH Go0IHcHVJ4ltRVUODQ7NXce+/YW+58PdD3B01988fvY5QbzR/DcEJBqqhVueogjaiyh7lf V9b473RHu9mO6yR7O4RH6nI1FX0KC9wZvbiqcIojF8DtQSLTQ6tk24C0JeJz+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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2bx4TTjzjBt; Thu, 23 Jan 2025 13:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDwr50026268; Thu, 23 Jan 2025 13:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDwrVr026265; Thu, 23 Jan 2025 13:58:53 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:58:53 GMT Message-Id: <202501231358.50NDwrVr026265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 67e54a07e948 - stable/14 - vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 67e54a07e948d99f97322a9933a438f5c64caf3d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=67e54a07e948d99f97322a9933a438f5c64caf3d commit 67e54a07e948d99f97322a9933a438f5c64caf3d Author: Mark Johnston AuthorDate: 2025-01-09 14:54:10 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:07 +0000 vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning Right now we have the vm.pageout_cpus_per_thread tunable which controls the number of threads to start up per CPU per NUMA domain, but after booting, it's not possible to disable multi-threaded scanning. There is at least one workload where this mechanism doesn't work well; let's make it possible to disable it without a reboot, to simplify troubleshooting. Reviewed by: dougm, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48377 (cherry picked from commit 55b343f4f9bc586eba5e26a2524a35f04dd60c65) --- sys/vm/vm_page.c | 1 + sys/vm/vm_pageout.c | 9 +++++++-- sys/vm/vm_pagequeue.h | 5 +++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 2facdca9bf27..7eebf30e19a7 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -460,6 +460,7 @@ vm_page_domain_init(int domain) vmd->vmd_free_count = 0; vmd->vmd_segs = 0; vmd->vmd_oom = false; + vmd->vmd_helper_threads_enabled = true; for (i = 0; i < PQ_COUNT; i++) { pq = &vmd->vmd_pagequeues[i]; TAILQ_INIT(&pq->pq_pl); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 3b07af2c76d4..bc946e2bb844 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1657,8 +1657,9 @@ vm_pageout_inactive_dispatch(struct vm_domain *vmd, int shortage) * If we have more work than we can do in a quarter of our interval, we * fire off multiple threads to process it. */ - threads = vmd->vmd_inactive_threads; - if (threads > 1 && vmd->vmd_inactive_pps != 0 && + if ((threads = vmd->vmd_inactive_threads) > 1 && + vmd->vmd_helper_threads_enabled && + vmd->vmd_inactive_pps != 0 && shortage > vmd->vmd_inactive_pps / VM_INACT_SCAN_RATE / 4) { vmd->vmd_inactive_shortage /= threads; slop = shortage % threads; @@ -2295,6 +2296,10 @@ vm_pageout_init_domain(int domain) pidctrl_init_sysctl(&vmd->vmd_pid, SYSCTL_CHILDREN(oid)); vmd->vmd_inactive_threads = get_pageout_threads_per_domain(vmd); + SYSCTL_ADD_BOOL(NULL, SYSCTL_CHILDREN(vmd->vmd_oid), OID_AUTO, + "pageout_helper_threads_enabled", CTLFLAG_RWTUN, + &vmd->vmd_helper_threads_enabled, 0, + "Enable multi-threaded inactive queue scanning"); } static void diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 1f1f818d3ec3..70122fef9fff 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -254,8 +254,9 @@ struct vm_domain { /* Paging control variables, used within single threaded page daemon. */ struct pidctrl vmd_pid; /* Pageout controller. */ - bool vmd_oom; - u_int vmd_inactive_threads; + bool vmd_oom; /* An OOM kill was requested. */ + bool vmd_helper_threads_enabled;/* Use multiple threads to scan. */ + u_int vmd_inactive_threads; /* Number of extra helper threads. */ u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ blockcount_t vmd_inactive_starting; /* Number of threads started. */ From nobody Thu Jan 23 13:58: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 4Yf2bz4Ldbz5kyhL; Thu, 23 Jan 2025 13:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2by653Cz3bp0; Thu, 23 Jan 2025 13:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+We/OAfx9sL1F8I+KQIZRpc/7sO2kUXa/9HUtrFqyDM=; b=T7h4SiPXj9uBu7oMg1Nnlpra2hSfmnEVpuDWhY4owJYk++1a92KtxWtP7unzLp1eNulqS7 eCQD94BjAcoQkavcOY3wsypU0ObviaeGWef+k1FjgnroO+Fnofz08Phyd1llRqZcBMMts8 DomyAvQgNg/KK0XgLX083FW3Hx7Na705daTPrdm3ElZePoR/NRTQoe+Fr4WddkSSXkl4s2 ldaGBAuNxwFfJIYoenAV4vDpr0F4a7SCjviZr9LH31m8f0Xk7f4AIEKfJdooxBtPMCGRlP fRXaqSEmuDM0s3E6w3n/XFqS52gjg0ZmU+SGCZRgy4ZOIzKzxo+mvNyayj5zuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+We/OAfx9sL1F8I+KQIZRpc/7sO2kUXa/9HUtrFqyDM=; b=wetAJLohyZn4CbGsCyKv170PEEE0iwGQ5WQ8SpfdAvs3wyA170agdYe/yRdBaqpCKn5ocE TLbCT/qMANiZxBEHn3TJL0MEUespL8lR3ps/bSsIYdry3M6Ecn7ZWGePpUrSqofDlVKZQX Xx7Yez0m6wN6X7zDrjVfLxL3ovb2PGo3RSMLsWge99eJffi9/Kq6Ema2aYgHGmku9KWgUx 5SVTZFFkw1VvAsRLZ+hsWPIKvn0htdrSbqkgxnlLf37ODaCv8fqHUr4x805YYevaaxzqyR j001aiGGNOl4MNc6FnzBgsYZDRpFycrxjM4AfMhoiUal5s2leaR4kR+uUKIHgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640734; a=rsa-sha256; cv=none; b=W7eDvzx19o5IBmD6UKamFobSbCrkKEBkEtlGW+j4CyIl/CyFFyQrh7D3nKe5dhuJrn393m M/3eOGKgZIlBi0IbmngwFvZ7WXFCl2dfqgkZ/N+4+jFKZWhKCrJMthuMioHtZEnrHGIb/u 2G/CChHse4Pb77ek4v/9P86+2ToSzgKQWN+7swGnA2EroT3S20yiK7I3IRexLrY9jFDL4T 53XXolRuAQMm29MmJNHAv6lHWChRu8EVdkPr83Z2jDLVntK2OaTsLoPhXHRy9MoN6MAT9D avr2jXEfF17UqXUxcLsaKmzRxO42Ka1F/cCgZzkTBMroXgx/v+UCaQ3awGxhAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2by5R4lzjBv; Thu, 23 Jan 2025 13:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDwsJf026309; Thu, 23 Jan 2025 13:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDwsIs026306; Thu, 23 Jan 2025 13:58:54 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:58:54 GMT Message-Id: <202501231358.50NDwsIs026306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e8e2e213ab53 - stable/14 - pkgbase: Fix OSVERSION specification when creating a repo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: e8e2e213ab53845fe38a8220fb7fbd473255ad8e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e8e2e213ab53845fe38a8220fb7fbd473255ad8e commit e8e2e213ab53845fe38a8220fb7fbd473255ad8e Author: Mark Johnston AuthorDate: 2025-01-19 23:25:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:07 +0000 pkgbase: Fix OSVERSION specification when creating a repo -o OSVERSION= needs to appear before the "repo" verb, otherwise it has no effect. In this case, recent pkg-devel fails to create the repo, saying that ABI cannot be specified without OSVERSION. Reviewed by: kevans, manu MFC after: 2 weeks Fixes: 188fe88ec50e ("pkgbase: force OSVERSION") Differential Revision: https://reviews.freebsd.org/D48518 (cherry picked from commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517) --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index d4ec63091e5a..94f74392f4fb 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2283,7 +2283,7 @@ real-sign-packages: _pkgbootstrap .PHONY .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ + @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" repo \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ From nobody Thu Jan 23 13:59: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 4Yf2c46cN7z5l0Bd; Thu, 23 Jan 2025 13:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2c45Cknz3bpl; Thu, 23 Jan 2025 13:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ogGd4XLCsydAEGo3nnchpdMcaLP9vzELWslOYsf7yI=; b=M26YZ3Mth3WJI8RsqUWJ/r4WChrwcL0b5YhPrHzxekW4YeK8w1IeINR8e2FrWifFTMlJOe 92Le+umZsHsxdmP/OPjNP4lIe+2JZYhEsDIrhWFd8NxH70X4L/xxBjtqNNvvp8iDdO4FDU GUsXtVIQ1y9rNxTIhXiQ2bSxwcFPdK4jSfZTwWOurqoI+j0yUmjnxlusgeL1Rbjm9OGrN7 MRSvFq967V+9DauLfNMTakAqi/s4qxfZhnYc+jUEsNbV7uvGyywDmWWrS34qZTILeUfWTx NgGF2OuPiyjGCGmT3xPM+hBI+7qc0VG2fk6O+vbZ8Bfl2K5iSKJ+YXli+PIegw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ogGd4XLCsydAEGo3nnchpdMcaLP9vzELWslOYsf7yI=; b=P5FFaUIhIchyZjQC1bKCvp1VJkF9404b5Wk8bZBExN1/xUENTqPDOTkAZdWluEIh1F18Iu GWwRkBWxE2CdhTTfR4LMlx+UJsbIKgh56UQomDh5Zj0WTh7/8Yt+S9bTPIOMKN00AnutQh 1DMYhzaUk/hnucqHNB4WQgeJvJTespvDjhou0cgntm4VOqqeogXMme0qXgPJo8dJOu8gJt 0/el2BBYSEL1kx9+omrOBM2m1/jmWFiykCnZC5865mpRLnVHJg6M2Q9Lh739rHKoqctM2g B+pcUtuFCG7f1cC751i8J0Dv/aU93nu95fTMD0QB4EYvPeq58LSzQg9sIsJ4Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640740; a=rsa-sha256; cv=none; b=McNxCoGA9DYEh7tJNWen3mi30GtyFCfkw8VEMuImZwQpOwlQAa9LovgYGH1Gz3ui2O+dZf Uj78Ru1YHLCn8v8x9CjI3cW6xWXtcZywPVp7IuKwPCma6MyGjArCPhcRNaimI1K7qCxsJX xk4M0SCCUIFSfzzztOxhQ9chvBOv/V1hOiYMYcWGSTrHDhR9gOzF9D4K80LufKGBmrIBYO d7DWr4akGc4wUD0HVqnChibrGymzGjrxLRImiFF4zYLdxmttkyfPgbgThdNIR7zZPtqnVe ZeCkXPuhaKwCZ4IeXoAjrtLNLCFahrP9RsnaBmgA0g75kyXd6xe7LATibmRyEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2c43jGXzj6G; Thu, 23 Jan 2025 13:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDx0BY026480; Thu, 23 Jan 2025 13:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDx0Zl026476; Thu, 23 Jan 2025 13:59:00 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:59:00 GMT Message-Id: <202501231359.50NDx0Zl026476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7b95d2a40219 - stable/13 - pkgbase: Fix OSVERSION specification when creating a repo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 7b95d2a40219ddaf187dbc087e1f9a0615b70b60 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7b95d2a40219ddaf187dbc087e1f9a0615b70b60 commit 7b95d2a40219ddaf187dbc087e1f9a0615b70b60 Author: Mark Johnston AuthorDate: 2025-01-19 23:25:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:36 +0000 pkgbase: Fix OSVERSION specification when creating a repo -o OSVERSION= needs to appear before the "repo" verb, otherwise it has no effect. In this case, recent pkg-devel fails to create the repo, saying that ABI cannot be specified without OSVERSION. Reviewed by: kevans, manu MFC after: 2 weeks Fixes: 188fe88ec50e ("pkgbase: force OSVERSION") Differential Revision: https://reviews.freebsd.org/D48518 (cherry picked from commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517) --- Makefile.inc1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c8b5fc856dd5..65a5aa203aa3 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2150,8 +2150,7 @@ sign-packages: _pkgbootstrap .PHONY .endif @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ - -o OSVERSION="${SRCRELDATE}" \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o OSVERSION="${SRCRELDATE}" repo \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ From nobody Thu Jan 23 18:14: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 4Yf8HD6sTsz5lHpH; Thu, 23 Jan 2025 18:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf8HD63Lfz4Hqr; Thu, 23 Jan 2025 18:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qyhWJCbQzc6vPLs/UENKjVCDSy970XZTIVyaaKksxfQ=; b=cZa2PDvhOm4PiFK1hNiDb5pJK6XrMu4LnTNUhbb4q/Q9Tj7eE+6aDtuqo6jOlB0aKG2a+5 hTubR7vZSWFBzkkJID0Jk074x75eQtMWwnUrOg3lg3DuHYdCPmSExshx1YczcLlTapJLJ8 1vvzTPma1tGkRQ4Tsq1ZNIPsCyHAmf9g5KLSOhwaaZm8sMrSyvOJHYyRWeHLCzeaxdGhsg v6yx/cXMR3Jpnto5iwBjxKsyw2ztryfNG8zUqv3VggHBm2Lv8Thv9L+QmqnBEKHMqkOg2X L7/cNvA5B8GTjKWzftts+JAtyIHIV477ElyYt8n036bQ3HLf7w/CHnWOBDps+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qyhWJCbQzc6vPLs/UENKjVCDSy970XZTIVyaaKksxfQ=; b=t/M31t24tiSsIvqtdQvAbNXYhEwdtkUDBR94bfNxu8u7ptKwtzPOxgiugXgxU2P9aaTFCk 9DRasD+adfDgot9bN7Ndurd7qsxxXVPtsDhfk85jHpBt9Mid6r/7oW6H1meVUlFMd2wcgZ 06z6+ucwb5NY0hW4FRah2FKKvXUxeDoNVfnipYn33pebcG3Vyw06+KlKg5XRwYsZ5jgrGB Uh9HDzeFHyvwv03x3JcDdHrJj+UpempXdjkHOq5piYLei0CN/ub11+MgwEwH9lNmfPU1fI psiaFTHWZhFb3FQqhsxDjvr0QuSWt5wF+PBqsjJHVmHMfR7jH0WfmTjVEh5HIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737656088; a=rsa-sha256; cv=none; b=JbhaK0VOd842dCREYgUtk9fqLmgQdIutC/6C6/p0ytAd/mUTb6Xws974xdR++7TxFBSpnm egpAZKruQn7xAIev748Hjm1YqOSmlSLH6hjUxmtlQAfspCTZ9eoA/ALdhUpBt/eSjCbKsP kViFl1UNUxZe8Cc7XXJZIenlCFWxHjsDNp8pbK7tmY41PAH1RlCpXL04Vq0tsxcQi6ogDR dpOq92g796NO6qD1IHB4u+WBpsMU8Hwyre8AmUYqs7KkQpvrRlUsMDRas6gIawP59Gv/vh z1IPl2kLPn17zbbjK5Ypv+7nWafv1f8Y23Z0NQqHvqUS4Jhfb20c8A65Mlh1Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf8HD5XP5zr1X; Thu, 23 Jan 2025 18:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NIEm6L015768; Thu, 23 Jan 2025 18:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NIEmM7015765; Thu, 23 Jan 2025 18:14:48 GMT (envelope-from git) Date: Thu, 23 Jan 2025 18:14:48 GMT Message-Id: <202501231814.50NIEmM7015765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9dc8d7326d7f - stable/14 - gvinum(8): Fix a typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 9dc8d7326d7fc0f3e15c7b4b11d350e04c0acdb1 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc8d7326d7fc0f3e15c7b4b11d350e04c0acdb1 commit 9dc8d7326d7fc0f3e15c7b4b11d350e04c0acdb1 Author: Che-Yu Chang AuthorDate: 2023-12-26 16:05:26 +0000 Commit: Ed Maste CommitDate: 2025-01-23 18:14:17 +0000 gvinum(8): Fix a typo On line 354, "go up from" is mistyped as "go up form". Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/951 (cherry picked from commit 2aa186b3b08bcf6e49b743329b2fa00897a1235f) --- sbin/gvinum/gvinum.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 index 4176e6274a37..28e4cd7d76db 100644 --- a/sbin/gvinum/gvinum.8 +++ b/sbin/gvinum/gvinum.8 @@ -351,7 +351,7 @@ Then, initiate the rebuild: .Pp .Dl "gvinum start myraid5vol.p0" .Pp -The plex will go up form degraded mode after the rebuild is finished. +The plex will go up from degraded mode after the rebuild is finished. The plex can still be used while the rebuild is in progress, although requests might be delayed. .Pp From nobody Thu Jan 23 20:55: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 4YfCrj2r8nz5lSpx; Thu, 23 Jan 2025 20:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCrj26l6z3QZF; Thu, 23 Jan 2025 20:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737665733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Pw+kzlO19VXBP93VBZ9KyDZyYhMPXZBV7wSQgM87ik=; b=uIb0l/97ZuNJ1zMpbb1RDBXk2jmfJ0dXqEyhV5WVEhfQktUWRg33zJ01yN9369U1iTpIEP kZdq97L0tId1RDuYQoyBPbZ58oQIBeGKiqg2q8oIfaFE5etlncCCEsNAWTmLWeHutDtx/S RKAF9UfFksI/pfd1DcDsG8qsTwag+5/KTQI2FhWm3d6zmWaKCqGL1VTxJX1aClv32IWU7a lFGAv7rRn32RaWGT1YHOiKcMEU8IkIeyTTmnel+z0M87HhUeEowhP0ZZmL4uLKQyVTehmf SOkh9g/kCny1ULkK64w78ms0VBS8sEPCYUSeZRJ0NjKEJhoa5/+inEo0HTWz6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737665733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Pw+kzlO19VXBP93VBZ9KyDZyYhMPXZBV7wSQgM87ik=; b=B0lGg8mXoA2XW6lYdLDuBNevuZwpEXI49BXN4vM1zhDf752lKTeq5ySWvZyVkowNJquHo1 OgZTkBxsbkj6HvKYrEsubZMDdvU6OGvYcLCsAVwHbnrxE7HsyC1yiaa90ym8g4tCxNbNxA 938nr2GIDqOJExUlbQtsA6iNy24sRVJWmheYYs7GqacDdoQ3Xd8vwaPn28CRrU8s2rl9oy ts8436FBY6IsOqr3vAjGAgkg196skRikuAcut32N5h93URwrKP/6ZhU+p3f9wAO5PIv26m vRRd30p9XCsgxkGjZ3scEVHWm81lpj/n1OaCodo8kd9o1ZHnGmWEDNokCCx+ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737665733; a=rsa-sha256; cv=none; b=ZMPJW+wkF8k0zqYEySMXSi3a3bAMRKlhboRM2O+ktt+pNgxQ842KfxnvAeX4zPhGtIoyWd soi2fruYYh+4wPDyYUcCISm6Veuu2tFfhfLHCdox4huXPnOi06zkwUdupqv97n+gUuDqxH WzAWGz1ofy91Km/VWK9svl6SxnIRM7A6pAgoXtTyR40Jx5hpVMPREvFY0b9Z50TjLTrU/o ry6DU03M+LNEzIiVdui4T1VOxNePKH0l5EFRAbMB7OLcR+uS5ebCZo54VxooLwK/l5McWT VSM4jMnDq+sRPX7zr59p3HTCZsja7qaPOTjI/sh83MqeVmjdXQUntFPnxWZkvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCrj1TdfzvSs; Thu, 23 Jan 2025 20:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKtX7d016059; Thu, 23 Jan 2025 20:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKtX3p016056; Thu, 23 Jan 2025 20:55:33 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:55:33 GMT Message-Id: <202501232055.50NKtX3p016056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Joseph Mingrone Subject: git: 75bca5af38f6 - stable/14 - ObsoleteFiles.inc: Remove bogus entries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75bca5af38f66871e2fe2c3631f8177f68bc0d93 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=75bca5af38f66871e2fe2c3631f8177f68bc0d93 commit 75bca5af38f66871e2fe2c3631f8177f68bc0d93 Author: Joseph Mingrone AuthorDate: 2025-01-23 20:19:43 +0000 Commit: Joseph Mingrone CommitDate: 2025-01-23 20:54:34 +0000 ObsoleteFiles.inc: Remove bogus entries Reviewed by: emaste (cherry picked from commit 6651a75af260a1c57b787a8146266de4cecd70cf) --- ObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 093fe4e91001..81f6f1110d3e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -525,11 +525,6 @@ OLD_FILES+=usr/include/c++/v1/__type_traits/is_trivially_move_constructible.h OLD_FILES+=usr/include/c++/v1/__type_traits/operation_traits.h OLD_FILES+=usr/include/c++/v1/experimental/__memory -# 20240914 libpcap upgrade from 1.10.4 to 1.10.5 -OLD_FILES+=contrib/libpcap/pcap-haiku.cpp -OLD_FILES+=contrib/libpcap/pcap-rpcap-int.h -OLD_FILES+=contrib/libpcap/pcap-usb-linux-common.c - # 20240827: retire fips.so OLD_LIBS+=usr/lib/ossl-modules/fips.so From nobody Fri Jan 24 01:22: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 4YfKmn3F2kz5ll4g; Fri, 24 Jan 2025 01:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfKmn2T5Yz3wlP; Fri, 24 Jan 2025 01:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737681753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S/iGF7WqHBSdMi8p05OkOGZe169LF8L9tm1l1v01WLw=; b=fUSwTSiE3cqDX9+5aE+nMwgS9oFE6jgCejXgrwCVolwGEd2Uktkcgo5a1MvqMjoC3J5uK/ a/oP4gR2DY22dqdxRTrUU2Fxrb3vWT78yUjMO2D728PVfKd7Uzd7bQHblx6JOPLvGHeoZH CTqcrVS3aI4sf0f2exU/yZqr+/kJWu413AHHCO1pcmWrK2ubeIiM23jKxmY/hF9pmbTMDa L9W08L0uRhFsXRsPbgF0/g4kxorJKfdXZwcdyBouLhoix0qb2CygVkaR3BCZNYeEOu+ZZY 1J6QKplRDOL1uvOXl8d7fEfwezMmtE2pkQbSngdJnQKPO1PLWJ9nEfr2ego2XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737681753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S/iGF7WqHBSdMi8p05OkOGZe169LF8L9tm1l1v01WLw=; b=ckiBGBFPWIiJint5gyjvwRmJ2URco5A3OC9BksavKEdxccsLdffwXvj4g08xy7XYLOjBCL gTXNoCmscARZdwsIrxw9XHJhXSAkxo9h/tQvmqtWZ73b/gej7kZ1uQkrT4MOsPMu69HviG 2jAAAivE2M0040RUA/FbFaNwNsvZIFTEP9DtE4DuzgNdwKbfFJWo6BnHUKQq86JIlrMLbj iyWhf2cBLE7nQWLA/TE+dwFezDq+BREY+XkH19gx8UezCeoLwDQdaZT+sTZxSX4aFc6i1a +xsDGZCs585aqR0z8br0GGkoGywqhzbvTBvWkBrdgZv7o+VxHVgfqSaLUbTPrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737681753; a=rsa-sha256; cv=none; b=p89q6bEDJFWdbLl6Ybfn2/3yntVWwFr8HqqcP/X599OT4HnikDShDIOZWcmvATWxecLmMc IziU8usxVx6pYvmR5GSOCJtl1y9TWmDi49xWdhCf4hplyvOW56zB3Eu88nLQ0S2MHZQllO kCRR+746a5FVSPN3A82tzomVh5HRw3NhPQmQVcKBcs80of7c4hfYez496XimFNWpRhbEGT 3kg6e0o0KSL1wLeseb2DJHRVqucDyvm8Qy3Tzqqjrwrpvl20IB42ctqCronV90L7d4s+xP 6Ax1Kdv2OUqArlTlLRvMcCF4AMOnEtqzD48ggm+gPcyaZQEntd2albhkc+jpBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfKmn20TPz133f; Fri, 24 Jan 2025 01:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O1MXmC023223; Fri, 24 Jan 2025 01:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O1MXX5023220; Fri, 24 Jan 2025 01:22:33 GMT (envelope-from git) Date: Fri, 24 Jan 2025 01:22:33 GMT Message-Id: <202501240122.50O1MXX5023220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 544ad91ef9f6 - stable/13 - Use ffs_sbget() to replace open-coded superblock reload. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 544ad91ef9f67430b955ce43456b6ffc97ab4c80 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=544ad91ef9f67430b955ce43456b6ffc97ab4c80 commit 544ad91ef9f67430b955ce43456b6ffc97ab4c80 Author: Kirk McKusick AuthorDate: 2025-01-15 21:08:42 +0000 Commit: Kirk McKusick CommitDate: 2025-01-24 01:20:50 +0000 Use ffs_sbget() to replace open-coded superblock reload. No functional change intended. Tested-by: Peter Holm (cherry picked from commit c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2) --- sys/ufs/ffs/ffs_vfsops.c | 87 ++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 65 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 433df476f563..d97f5413c647 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -607,8 +607,12 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, 0)) != 0) + (error = ffs_reload(mp, 0)) != 0) { return (error); + } else { + /* ffs_reload replaces the superblock structure */ + fs = ump->um_fs; + } if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { /* @@ -769,26 +773,20 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) * Things to do to update the mount: * 1) invalidate all cached meta-data. * 2) re-read superblock from disk. - * 3) re-read summary information from disk. - * 4) invalidate all inactive vnodes. - * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary - * writers, if requested. - * 6) invalidate all cached file data. - * 7) re-read inode data for all active vnodes. + * 3) If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. + * 4) invalidate all cached file data. + * 5) re-read inode data for all active vnodes. */ int ffs_reload(struct mount *mp, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; - void *space; struct buf *bp; struct fs *fs, *newfs; struct ufsmount *ump; - ufs2_daddr_t sblockloc; - int i, blks, error; - uint64_t size; - int32_t *lp; + int error; ump = VFSTOUFS(mp); @@ -811,30 +809,21 @@ ffs_reload(struct mount *mp, int flags) /* * Step 2: re-read superblock from disk. */ - fs = VFSTOUFS(mp)->um_fs; - if ((error = bread(devvp, btodb(fs->fs_sblockloc), fs->fs_sbsize, - NOCRED, &bp)) != 0) + if ((error = ffs_sbget(devvp, &newfs, STDSB, M_UFSMNT, + ffs_use_bread)) != 0) return (error); - newfs = (struct fs *)bp->b_data; - if ((newfs->fs_magic != FS_UFS1_MAGIC && - newfs->fs_magic != FS_UFS2_MAGIC) || - newfs->fs_bsize > MAXBSIZE || - newfs->fs_bsize < sizeof(struct fs)) { - brelse(bp); - return (EINTEGRITY); - } /* - * Preserve the summary information, read-only status, and - * superblock location by copying these fields into our new - * superblock before using it to update the existing superblock. + * Replace our superblock with the new superblock. Preserve + * our read-only status. */ - newfs->fs_si = fs->fs_si; + fs = VFSTOUFS(mp)->um_fs; newfs->fs_ronly = fs->fs_ronly; - sblockloc = fs->fs_sblockloc; - bcopy(newfs, fs, (uint64_t)fs->fs_sbsize); - brelse(bp); + free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); + free(fs, M_UFSMNT); + fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); + ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -844,42 +833,10 @@ ffs_reload(struct mount *mp, int flags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - - /* - * Step 3: re-read summary information from disk. - */ - size = fs->fs_cssize; - blks = howmany(size, fs->fs_fsize); - if (fs->fs_contigsumsize > 0) - size += fs->fs_ncg * sizeof(int32_t); - size += fs->fs_ncg * sizeof(uint8_t); - free(fs->fs_csp, M_UFSMNT); - space = malloc(size, M_UFSMNT, M_WAITOK); - fs->fs_csp = space; - for (i = 0; i < blks; i += fs->fs_frag) { - size = fs->fs_bsize; - if (i + fs->fs_frag > blks) - size = (blks - i) * fs->fs_fsize; - error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - NOCRED, &bp); - if (error) - return (error); - bcopy(bp->b_data, space, (uint64_t)size); - space = (char *)space + size; - brelse(bp); - } /* - * We no longer know anything about clusters per cylinder group. + * Step 3: If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. */ - if (fs->fs_contigsumsize > 0) { - fs->fs_maxcluster = lp = space; - for (i = 0; i < fs->fs_ncg; i++) - *lp++ = fs->fs_contigsumsize; - space = lp; - } - size = fs->fs_ncg * sizeof(uint8_t); - fs->fs_contigdirs = (uint8_t *)space; - bzero(fs->fs_contigdirs, size); if ((flags & FFSR_UNSUSPEND) != 0) { MNT_ILOCK(mp); mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); From nobody Fri Jan 24 02:26: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 4YfMBS4hZ0z5lpKL; Fri, 24 Jan 2025 02:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfMBS3nDBz42N5; Fri, 24 Jan 2025 02:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aPXzsgq5VeWSzxrGS1Q2aKgzwxUxU20/pL6NIp/BfDc=; b=WgAnTQF/IHgTXAFKVdqjzHyfJXKUdk7/4vrZOqIq9GZuFWTDUuxyv7Z7lNFLMoBzsVpgzb L8xqtqwlXv+gULpLMS1X2t+14c0oDnADCBsItguBeO88fQ91uXI85Vg85NL4FGt4Mrwdu8 D8Yb4OO++zRRXp8FwpDb18dCstFRlml+orkbdxY9Q2iF1JOAI1Qp7IY1PEi64/rQXuqOOu H5cnrvnUhkajScKNkjaGXJlLAarBhzTmwK1xVKfGItw91WXfSvLiKq/UWnQQG3xX+grLyw Txm1uqxFgjIK7Z6EWahwARE0W5XEZFfOHfItgnH9nK//heFOGjVfpp1ncrXbNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aPXzsgq5VeWSzxrGS1Q2aKgzwxUxU20/pL6NIp/BfDc=; b=B9N4EUyAQLDwsdBEIAyNvqBuBzTozLLpmQovuXnKF4PFhsqKxD0hldCRwG12yHhyM9oNZJ OMuCRYE7P0u+GUTR52rmj2HFsdx6JK4vFzw13Qp0bRy3ensy+mEd3UZ1cpr1A1jObT5Dtr xCMEc5+kN4dwAibeEF2lRaDbCMubiKwinc2rZbJqYzfbeip8NGZd1AB+/T8tGJQdTU3D/D BfGm5dzvZQinXQW2HBhRwtyEEDmgIrPhwpkwfbx5J1LtJGOscmxxPeYJacVW9MJ2gTsO4U +23txDfG2rt5ltWOF38h8jsBxnQjK80kXa1eO0AO7eTTyx6Zd0nlCpApnKBHGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737685584; a=rsa-sha256; cv=none; b=o0sf8cK7DUCvqTPyGQkE+enAnftE86VyQ23EkP8l+bP5L9HfVPPmaDac4v5/VYyLiNIe0L SxYGDYypOGOGWJc6hPwRm7S+SF/zxTXVu+KRYRXDyUEnAulLCD3BUCRztTqtLylQ2oNuMS cP/3bvR0kicF7yVU4uERppN7SldXZBrM/KIHLUCeyCtzOfHmjoRraaVxxTKEgYMpp6PWrv fIpyE/9K4jyKd4Dhon9LWjRdLF+OTk6RXQNsvNZgpqg4ny0YqjWSa+MnuNLEeZdsFKNiG+ 8UzbC2UKRGGyGMME4iwLsfpalCpwAVZical7XyAgGIr/GccrrgxOerM1RZ62Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfMBS2gt4z154X; Fri, 24 Jan 2025 02:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O2QOqs036903; Fri, 24 Jan 2025 02:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O2QOcN036900; Fri, 24 Jan 2025 02:26:24 GMT (envelope-from git) Date: Fri, 24 Jan 2025 02:26:24 GMT Message-Id: <202501240226.50O2QOcN036900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d7b69bb536f7 - stable/14 - nfscl: Fix a crash when a readdir entry has nul in it List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d7b69bb536f7dd4857f1aec86536737a2e94c68a Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d7b69bb536f7dd4857f1aec86536737a2e94c68a commit d7b69bb536f7dd4857f1aec86536737a2e94c68a Author: Rick Macklem AuthorDate: 2025-01-10 03:54:41 +0000 Commit: Rick Macklem CommitDate: 2025-01-24 02:25:10 +0000 nfscl: Fix a crash when a readdir entry has nul in it Commit 026cdaa3b3a9 added a check for a nul or "/" in a file name in a readdir reply. Unfortunately, the minimal testing done on it did not detect a bug that can cause the client to crash. This patch fixes the code so that it does not crash. Note that a NFS server will not normally return a file name in a readdir reply that has a nul or "/" in it, so the crash is unlikely. PR: 283965 (cherry picked from commit f9f0a1d61c7b97c705246c747baec385e0592966) --- sys/fs/nfsclient/nfs_clrpcops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 7540893ce63c..76aa3b102962 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3397,6 +3397,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, nfsattrbit_t attrbits, dattrbits; u_int32_t rderr, *tl2 = NULL; size_t tresid; + bool validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3622,6 +3623,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); ncookie.lval[0] = *tl++; @@ -3701,6 +3703,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3738,7 +3741,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ncookie.lval[0] = 0; ncookie.lval[1] = *tl++; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; @@ -3875,7 +3878,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, size_t tresid; u_int32_t *tl2 = NULL, rderr; struct timespec dctime, ts; - bool attr_ok; + bool attr_ok, validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -4086,6 +4089,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); if (nd->nd_flag & ND_NFSV4) { ncookie.lval[0] = *tl++; @@ -4161,6 +4165,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -4217,7 +4222,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, goto nfsmout; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; From nobody Fri Jan 24 02:31: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 4YfMJ92NvSz5lpPY; Fri, 24 Jan 2025 02:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfMJ91lDhz43SV; Fri, 24 Jan 2025 02:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BoN4HZtV+67st4m3IZknGuXtmuolJPEg3ZP2gCFkvqY=; b=Z/bD9RyQMdxJKqnk65nCWWnO9nFvQoGmjv+84F1JPwWEnEspAjjkyl9VVCutuMWZbF8/j8 QDuMxXc7eJsrNmoV7ihUkIXN0yOJVt/C7yGsxo0Avb1fiEjpK3QYP/OrQxwmoIFalXxJ2B Ma/QeGu0vHZESAN/YnItyqlZyWSFvtDyvJ5ID05QRb+SeYszAdwdF8Bn1hQFsk7jzKsfwc 2dGKvCOONop73Zdxsnkr3kDJtp1rhxAFwLnVX8yh9S5ljI+NKa+mfrVLNM3GdwPv9VSx5n 8CUH7sL1hmoJO2pesHrtIIoMf4Jtd2e2299E7A96vWBPL4DIN2xWP/wR0eccug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BoN4HZtV+67st4m3IZknGuXtmuolJPEg3ZP2gCFkvqY=; b=p1pMg0GTvtba2xZAH7j5HK8NWG6Yi1OGGeRe7VrDZbW0HdpDsUXq0g48qWDUyS8JoQwBbo VU+JUtqAuGMJxZlzCLR2itqdXNV4m70LBs/9jFZIiHmelEOS0aRrmBNMR0FEw616QX3nME WWSwj3MV49VKYd5fMKoSeQhLPpwQoGSP3JRHHP3k+cZvNmfzIoDR3ZVicXL9Yr5Zerd3n7 OU4DpTe4zWvg1oLQB0IgPeBPwvK4T05nUVQaAJRxNT30Pw49MeUKAbRR85/CNLxXMf8s9/ Jn//cu7rgOmyInHGB5XmhzSZAbLg3JdV/7SjkcmakrraF2N26DQV/IvfKfa6vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737685881; a=rsa-sha256; cv=none; b=LseGrYLslpisWxJ3sq3YEWCj9qqtn2XWSxB2ujJch5XLtJns5GD2e6SC/O3xAqSOJe4M35 aXy+IiuKDxXnG10j8ICfci0nC1i/Rn6n1+SbKEj8p4/QkIWMAZIaaan4+1Y50+YMft6RBY WVCzTAS7XyUNDZrVf9c55QLIL3sfcXjNNqhhnDko2302Qrf6aPjec8l21K8iTt/pKRjOnx /jBEnFWiNTztCFrDL/L5Fq/vTR7qFlh84fRlim5HgV/lyh3P0aFDgaRlf7D2Xyn3oa1ROf lyGf0USmiE4qFZoalw2tckmDng3Clot6p9WiVDu7W8l0GK86Ub/9Lt2o0Ndapg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfMJ91Hpxz15P7; Fri, 24 Jan 2025 02:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O2VLZD052426; Fri, 24 Jan 2025 02:31:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O2VLWq052423; Fri, 24 Jan 2025 02:31:21 GMT (envelope-from git) Date: Fri, 24 Jan 2025 02:31:21 GMT Message-Id: <202501240231.50O2VLWq052423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 968abc191ea1 - stable/13 - nfscl: Fix a crash when a readdir entry has nul in it List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 968abc191ea145040f4c2105755d11b63ecb2427 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=968abc191ea145040f4c2105755d11b63ecb2427 commit 968abc191ea145040f4c2105755d11b63ecb2427 Author: Rick Macklem AuthorDate: 2025-01-10 03:54:41 +0000 Commit: Rick Macklem CommitDate: 2025-01-24 02:30:22 +0000 nfscl: Fix a crash when a readdir entry has nul in it Commit 026cdaa3b3a9 added a check for a nul or "/" in a file name in a readdir reply. Unfortunately, the minimal testing done on it did not detect a bug that can cause the client to crash. This patch fixes the code so that it does not crash. Note that a NFS server will not normally return a file name in a readdir reply that has a nul or "/" in it, so the crash is unlikely. PR: 283965 (cherry picked from commit f9f0a1d61c7b97c705246c747baec385e0592966) --- sys/fs/nfsclient/nfs_clrpcops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index b3062b5a5d88..f3ab2bda8f85 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3079,6 +3079,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, nfsattrbit_t attrbits, dattrbits; u_int32_t rderr, *tl2 = NULL; size_t tresid; + bool validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3305,6 +3306,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); ncookie.lval[0] = *tl++; @@ -3384,6 +3386,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3421,7 +3424,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ncookie.lval[0] = 0; ncookie.lval[1] = *tl++; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; @@ -3560,7 +3563,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, size_t tresid; u_int32_t *tl2 = NULL, rderr; struct timespec dctime, ts; - bool attr_ok; + bool attr_ok, validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3771,6 +3774,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); if (nd->nd_flag & ND_NFSV4) { ncookie.lval[0] = *tl++; @@ -3846,6 +3850,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3902,7 +3907,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, goto nfsmout; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; From nobody Fri Jan 24 03:38: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 4YfNnr01xgz5lt9s; Fri, 24 Jan 2025 03:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfNnq5XrWz3C8L; Fri, 24 Jan 2025 03:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737689919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cDbBAFzKMAKIxi+k36AIzCNunBUZgZnYgsnCUe3B034=; b=mr3xn9Czz7hqY9bPOMCYU1cGZ6afRYpnlcUcKbJTwSNHd4sow9bVzHoX8sTkYmzgkWot4z y369c/oOcKocy4pdHGZg7fl5Slb8XsA0Rd3cjdm1Z2sgUWdiife9wvDMy0kjvPF/A+vagR h4vqdABosiqqVI73xhz/csEhUMGV0x3vZG7SeLjpa24LGKtO/jyqgRVtGXCF5VzO7rqHKb G+N1nM7FnYjS4aSKVsQyaINLedPMRRAKUCfQSu8WadV3YZRidSC8TqlM/CJGCiMwtTX25s VGHgP3UgrivfEg1jii0t0jfgUY3a3EozK+mdFZFPqeCS3CljVQ5+wpO/C7Q8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737689919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cDbBAFzKMAKIxi+k36AIzCNunBUZgZnYgsnCUe3B034=; b=bcjvpN4sZX8H/09jnhxtjAE245b04ehuW+kWfFlYHI+NqcJfQkog6LfNbCXnuzygqq6d3i 4BMEQQFlkZKhQFe9WJlJNEMiDDm6zFWTkaMMjIU5I8C1zdjdnAAGpZcLd1eWFa6dgMfpQy YVQDxN2Vp9Xr3lwQQ7MuPacXzCs3ghl7nusAM3HevHqwkvAATiRt5nkadLgWnkElfHZw1K TygeL5SF1I2PDROPKgieLj8UgZCDW7CPlgiM+btjl6jLcr/5P8Yu0mlbiXZmALQDI6pcT+ 9W17l1ySLmObDbJ/i++cl9YtcWe6uLK3MVIA8fBYzuHDgLq2uywvDgLsS+JpEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737689919; a=rsa-sha256; cv=none; b=P4lvw0nkOob8dd4nIoGKU1bkh/7Oy8ANR64mz32M1aRPMeG8VWafsOGxQeDwMAJd9RwNXf C2BFbt8PxTfBpCLk+RxkYM+aNK2jC8CN4UoukIPfjyCvt8la1Oy8uGBC8975gNDBgr8iWC 9D6yZPqicgOTLi4mpmOML4fRemwW9NX2eZLqPkVLSp4Dgw/MsbcrBE0USt3WExVLK+r1uv LhGeoCpdf+CtKh0r8/NVUBF0Z4L88PMXncU1GI7Q3ZWw7V8AqnYELSPjotwA6K4H0cSzSl QWG0/fyYSNAu94bs9kavvlZZ62kNU/OH4suktfA7BcdFjOw3RV9Pt/BIVKfr0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfNnq53q2z16yj; Fri, 24 Jan 2025 03:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O3cd9I070170; Fri, 24 Jan 2025 03:38:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O3cdtl070167; Fri, 24 Jan 2025 03:38:39 GMT (envelope-from git) Date: Fri, 24 Jan 2025 03:38:39 GMT Message-Id: <202501240338.50O3cdtl070167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 02816415a34a - stable/14 - kldstat.8: Polish options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 02816415a34aee8092c155ce53bec21126e2eb7f Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=02816415a34aee8092c155ce53bec21126e2eb7f commit 02816415a34aee8092c155ce53bec21126e2eb7f Author: Alexander Ziaee AuthorDate: 2025-01-21 19:55:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-24 03:36:03 +0000 kldstat.8: Polish options + Align and alphabetize options + -q: s/Only/Quietly/ for search + Tag SPDX MFC after: 3 days Reviewed by: gbe, carlavilla, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48325 (cherry picked from commit 8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa) --- sbin/kldstat/kldstat.8 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8 index f7e7552625e3..09094da3741d 100644 --- a/sbin/kldstat/kldstat.8 +++ b/sbin/kldstat/kldstat.8 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Doug Rabson .\" All rights reserved. .\" @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 19, 2016 +.Dd January 4, 2025 .Dt KLDSTAT 8 .Os .Sh NAME @@ -48,22 +50,22 @@ utility displays the status of any files dynamically linked into the kernel. .Pp The following options are available: -.Bl -tag -width indentXX +.Bl -tag -width "-n filename" +.It Fl d +Show the module specific data (as int, unsigned int and unsigned long) .It Fl h Display the size field in a human-readable form, using unit suffixes instead of hex values. -.It Fl v -Be more verbose. -.It Fl d -Show the module specific data (as int, unsigned int and unsigned long) .It Fl i Ar id Display the status of only the file with this ID. +.It Fl m Ar modname +Display the status of only the module with this modname. .It Fl n Ar filename Display the status of only the file with this filename. .It Fl q -Only check if file is loaded or compiled into the kernel. -.It Fl m Ar modname -Display the status of only the module with this modname. +Quietly check if file is loaded or compiled into the kernel. +.It Fl v +Be more verbose. .El .Sh EXIT STATUS .Ex -std From nobody Fri Jan 24 03:43: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 4YfNvY12BTz5ltNT; Fri, 24 Jan 2025 03:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfNvX5M1Jz3CZG; Fri, 24 Jan 2025 03:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737690216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zv8UUqvFC7vBGl7gnAq+I3pt9dHhKWQIXeufW+sFqXU=; b=eEzkiCqS93qw5kDFOCVMCS1YpLcr03WN+t7pzvJ8F1ILRe8YsRKNcndGQeLFC9MqZRgDAK xsRA7c0Gm8ViT4GIaNFBu1lVgCYed0dVPXiXeVFPrskBuNpMEdHlo9MwM/19Ychk1lbMqg k6qDnd/GXfgMPlqrp9MvNFiP1N8F5fu42iyWdHNtsIx4JBH50elMedBtwPJwSESzHvyZgV ASzijvGUefsM6IZRKjhGQBsQK5zJkhFqD/D/P7yxXPh+29JOoux2QF7YWtra2Md6e2m2wF Kwdhf/faw0euXNKZ7QTWL3TVKvX2OVX/kcKJEuCHlOSOs12JcRwaplOuY9qrcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737690216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zv8UUqvFC7vBGl7gnAq+I3pt9dHhKWQIXeufW+sFqXU=; b=EBJazlBkd7PAMc7ur5G0/bjWQTMqCAmYtChlvbTFmQ4t1zeIVESkCTVVeA84Y25TB9ojco IooWDcO12y2Qd52QrVQPO0adloEh+kJy45tYUPJCQwcsAb/EIwO3UTwqaVWTj85u4Opx/O OS7DZWvzcYf+W8YyITEspeai9aHtHF9RXOSnC2+fr0tRA679BNMBqwx5i31GGQQIYdaSqP /AO+LjSBkLPDrQBEJ1q6Gq+i8vdd4dx6y9dI0hlqg9IKfomlYxziZUefx7zgXllzg13Wca j/Y3WzLTqQv3KbxGwZTnyKFo8MfJ2iMM3riH6h2JOqbmxkPrUmcU/lxU3mJdvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737690216; a=rsa-sha256; cv=none; b=hVjAnmBf6D6tPKq4io084+fYzX+LRYXTEfJ9B0RZRnMHYmlrTQukhDOLWrdiIbg2PBo4Tk Pvlql3jE7N8CoXFxM8Ddf7UrhezfCLgjAoWRLdrtAP6rmmJXd+FVqdATNfSdtyaLtfDDc3 ZNFiPdV3vXchmg3a00uQJrGb2GWYHTDTO3PQZv0VhKF6zgs3v6DjIm4Q/5KgPdTZjbTASV rzulebgAVxBLMQxaWSwj/WbSExQ9/gEuyE4lK+zlgWYkSzlPo+fQqdMWecbzsxSfGNHFKB ta5W0pAna7A2oflg+OUDkQ/iFIZFG5VTXaXsFO1N6BPDjw1lghU06rBQ8wHyMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfNvX4yHlz17kL; Fri, 24 Jan 2025 03:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O3ha3F087585; Fri, 24 Jan 2025 03:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O3haTV087582; Fri, 24 Jan 2025 03:43:36 GMT (envelope-from git) Date: Fri, 24 Jan 2025 03:43:36 GMT Message-Id: <202501240343.50O3haTV087582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: f68403f807a5 - stable/13 - kldstat.8: Polish options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f68403f807a53687478291fe4cc6352a5ef14e2b Auto-Submitted: auto-generated The branch stable/13 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f68403f807a53687478291fe4cc6352a5ef14e2b commit f68403f807a53687478291fe4cc6352a5ef14e2b Author: Alexander Ziaee AuthorDate: 2025-01-21 19:55:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-24 03:43:12 +0000 kldstat.8: Polish options + Align and alphabetize options + -q: s/Only/Quietly/ for search + Tag SPDX MFC after: 3 days Reviewed by: gbe, carlavilla, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48325 (cherry picked from commit 8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa) --- sbin/kldstat/kldstat.8 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8 index f7e7552625e3..09094da3741d 100644 --- a/sbin/kldstat/kldstat.8 +++ b/sbin/kldstat/kldstat.8 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Doug Rabson .\" All rights reserved. .\" @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 19, 2016 +.Dd January 4, 2025 .Dt KLDSTAT 8 .Os .Sh NAME @@ -48,22 +50,22 @@ utility displays the status of any files dynamically linked into the kernel. .Pp The following options are available: -.Bl -tag -width indentXX +.Bl -tag -width "-n filename" +.It Fl d +Show the module specific data (as int, unsigned int and unsigned long) .It Fl h Display the size field in a human-readable form, using unit suffixes instead of hex values. -.It Fl v -Be more verbose. -.It Fl d -Show the module specific data (as int, unsigned int and unsigned long) .It Fl i Ar id Display the status of only the file with this ID. +.It Fl m Ar modname +Display the status of only the module with this modname. .It Fl n Ar filename Display the status of only the file with this filename. .It Fl q -Only check if file is loaded or compiled into the kernel. -.It Fl m Ar modname -Display the status of only the module with this modname. +Quietly check if file is loaded or compiled into the kernel. +.It Fl v +Be more verbose. .El .Sh EXIT STATUS .Ex -std From nobody Fri Jan 24 05:22: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 4YfR594BX4z5kmxm; Fri, 24 Jan 2025 05:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfR590Hbbz3L4Y; Fri, 24 Jan 2025 05:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YqAqlODNE4okaRYKubKb3dzqosvSC4yA/lyGCKKujU=; b=qLUL7rMQ2cNO7c8vYEkSqb2qUnLAPAaaHmgfxrfDuAscxwaHr2TqdpCQvg5N1O7Ax1pDuv Yn1wgx12vcERQuNAF2F6D2gS5H6TsqSQPxlignLi3pPsDTjIKH71VuXSEVzoEKTCrd6sqh LsMlf62prNDcD1hE5eckya6SdsjJdpM9fktv0I20koOaRnPSwnGYsA53yhUxq2NdG2kbHd OIVDnn9dw41kiXscErSPgYKsTjZx9WRNGeEkd8FyaVbIVY4ytnPM3amNxtQ7jpgmV9lYE4 2OI8+eIHjao2oA5MtBKUtTaN0yHS5JLNLTc5uDmoerPQI6hrm4ReM3nRJsrtgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YqAqlODNE4okaRYKubKb3dzqosvSC4yA/lyGCKKujU=; b=KQNxohix6GhgN9rOlNf9YrZta8Ra5XE/UDRp6JYtSnoyBoSkpnU1elr50SkeMQRPeX4vRp KZl7edmzGMcBwg9MqZRLhNsWBQNMNOL8bHS3WSgCyxmGUgpQF+gwh49RXghtER0JwJMRIl yAGdkWZ9njj1kDeQxLt21thEvYc7xvnWTXqVAYHoAjX5L3tmO1lvA+LXXnxzcFBkBSoZF9 ZhWcHwpfaBzgVhnkdJ8lVUULPAWX2iEC7quUmf/rDf0rEq5x3EWuedNbOxTMFCuN5oQ8tG 1MG3dzZoGeVrbqDNhfmxgAR94KX7EDQxAvCY2/9vvY3pVEpJG6AQcQXxtxH8PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737696125; a=rsa-sha256; cv=none; b=L9q8FBJGWWmpvTgbT/5jyZe/eQpBzgdth43VV0K9H4hVa5n6pLC5WnvuOzpI3xsc/tBUqo ynZw9gniUpFdAcUeELtn5q4rqDNaBOKgCxpiyhB7cp61Bi2LpuuTgit19UcY3ZTk+VIpEL SYZ2u1eTnhAfD96dDMEA0oCVPG9XjGUfskr/gshz1rgD3O1lYOF7DuZja6MDuJO5Rgqrfv 2MjetGI+qhaZiKHyhCNI5c5cbFMp78THe8Jzda6tT+Dr3nTIMFMsR2vb4clltufR5SfMAZ bwrnPDWC4c/Lv6J7jDXwDLhmP+FwQ2nfe8JooYimVessdAAcVGnC+PJ6rKjhEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfR5870tsz19yQ; Fri, 24 Jan 2025 05:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O5M4w1073007; Fri, 24 Jan 2025 05:22:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O5M4vt073004; Fri, 24 Jan 2025 05:22:04 GMT (envelope-from git) Date: Fri, 24 Jan 2025 05:22:04 GMT Message-Id: <202501240522.50O5M4vt073004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 13639d5f710b - stable/13 - 13.5: Update stable/13 to -PRERELEASE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13639d5f710b9a578543ac86efd03cbba546666c Auto-Submitted: auto-generated The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=13639d5f710b9a578543ac86efd03cbba546666c commit 13639d5f710b9a578543ac86efd03cbba546666c Author: Colin Percival AuthorDate: 2025-01-24 05:21:00 +0000 Commit: Colin Percival CommitDate: 2025-01-24 05:21:00 +0000 13.5: Update stable/13 to -PRERELEASE This marks the start of the FreeBSD 13.5 release cycle; the stable/13 tree is now in "code slush". Developers are encouraged to prioritize fixing bugs (and/or merging bug fixes from HEAD) over new features at this time. Commit approval from re@ is not required but if new features introduce problems they may be removed from the release. Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 4 ++-- usr.bin/yacc/config.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b9f8da60411e..bc2cc8de1cf9 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -52,8 +52,8 @@ # TYPE="FreeBSD" -REVISION="13.4" -BRANCH="STABLE" +REVISION="13.5" +BRANCH="PRERELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/usr.bin/yacc/config.h b/usr.bin/yacc/config.h index d3b415df4366..f7df2f9a9ed2 100644 --- a/usr.bin/yacc/config.h +++ b/usr.bin/yacc/config.h @@ -86,7 +86,7 @@ #define STDC_HEADERS 1 /* Define to the system name. */ -#define SYSTEM_NAME "freebsd13.4" +#define SYSTEM_NAME "freebsd13.5" /* "Define to 1 if you want to use dbmalloc for testing." */ /* #undef USE_DBMALLOC */ From nobody Fri Jan 24 15:39: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 4YfhnP4Ttxz5lZ9F; Fri, 24 Jan 2025 15:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfhnP3zWwz44m2; Fri, 24 Jan 2025 15:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ff4LSk+A3o+uU/W5E8eTpz0x3oJolKiIeKiiVJxHkGc=; b=pPo6kwLUHCxRH8GzAmqG98kNP4jRBA1N3GuBWQxbyGk4ZY/g/Lap6E2kj+tw/5FKB0HC/0 3ynYLZhKYCT8qomAKy/5VDffE1cklc2GOuU5zAn0ImsHencMDXCX8W31ADbNbZ2WXbbdA5 qbE4k6wQZ0Zm7g9NF3hqCo7OyVbQhDrCw4m1zkieeM+T0vpuobfW6PmNh98tuYgH/8QTj5 Zqcxd1Y7gC4Q8FPToO+kxYRMX0+y/9eXONywUEaoZ88D3J/PdgHUVrppxqeQ7W+eYDh5Sw ysHkn/mFtCHji9BbuZWATZkDDwqrZAgP8Ehnv4dlMIEhWM9Q0G02Rh1voHHbuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ff4LSk+A3o+uU/W5E8eTpz0x3oJolKiIeKiiVJxHkGc=; b=HSphsqdM6tN0a5PFLxexjAMTgW9Xekwq5ghlgIxmdhho9MwSSGM1N3AHBiMARVPrepigXu u++0bOllfgeMbSEiCQ/Npa8BBbqBmEOMpEx513DEi6GODxMbHGN4xVRDl2l41DIIiQ63Oh AiImFdQ6xlXFv/S3GSUiirZw4he6BkRnp1cwqcKekD1uEuxIjUMKdHlOz1zoQ6Mt+d+JxC UV+9Smj6kMOBAry2JJt1op7MZ+hmxXDJWN6nnoumEmMT1CqrOWo/Ys019ZNGzWdtYy4j6+ BVsawr+hHAXSx0+4qJd8XUmkYWPM2pAmL726UzWVtXA8shtnNXhMM9ZQjv4zOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733161; a=rsa-sha256; cv=none; b=CkUe9kPQZK4X2WOGw+XZM6R3of5QZFqzjfkECkPTrTVgCPnj41sJJSpWQNcwgXgDHS1rMt 876w2YCTBsdjWgPLf9L5EH8asDeYOZNvnSO6zQgP2Bq6rJliMy4g3GigbMo+LwacY8zejk Di7WzvdkqCPn2/+x+pc50Vwd8eE5RBVhk6vRecvAAjdd4GdgbvlU16fOwhoTylyccc+Kfi 110CCtEDxNCZxUL0KCp8lx/jONZmLBXDqYQkzMOjCn7i/VhPE5mHIxB2fXS7DNUdVd+bCa 0A6uAGyPAENEpeQqfldDFfxBegHLCAZxUgbWv6j4nN6hrnqHu09d8mTwjv6vaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfhnP3MWHzXTW; Fri, 24 Jan 2025 15:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFdLgw020748; Fri, 24 Jan 2025 15:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFdLek020745; Fri, 24 Jan 2025 15:39:21 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:39:21 GMT Message-Id: <202501241539.50OFdLek020745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 894efae09de4 - stable/14 - sysctl(9): Enable vnet sysctl variables to be loader tunable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 894efae09de43a38b0ff667c4b7195dc377640e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=894efae09de43a38b0ff667c4b7195dc377640e4 commit 894efae09de43a38b0ff667c4b7195dc377640e4 Author: Zhenlei Huang AuthorDate: 2023-09-09 08:06:23 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:35:49 +0000 sysctl(9): Enable vnet sysctl variables to be loader tunable Complete phase two of 3da1cf1e88f8. In 3da1cf1e88f8, the meaning of the flag CTLFLAG_TUN is extended to automatically check if there is a kernel environment variable which shall initialize the SYSCTL during early boot. It works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTLs which belong to VNETs. This change extends the meaning further, to allow it also works for the SYSCTLs which belong to VNETs. A typical usage is ``` VNET_DEFINE_STATIC(int, foo) = 0; SYSCTL_INT(_net, OID_AUTO, foo, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(foo), 0, "Description of the foo loader tunable"); ``` Note that the implementation has a limitation. It behaves the same way as that of non-vnet loader tunables. That is, after the kernel or modules being initialized, any changes (e.g. via kenv) to kernel environment variable will not affect the corresponding vnet variable of subsequently created VNETs. To overcome it, we can use TUNABLE_XXX_FETCH to fetch the kernel environment variable into those vnet variables during vnet constructing. This change will fix the following SYSCTLs those belong to VNETs and have CTLFLAG_TUN flag: ``` net.add_addr_allfibs net.bpf.optimize_writers net.inet.tcp.fastopen.ccache_buckets net.link.bridge.inherit_mac net.link.bridge.ipfw_arp net.link.bridge.log_stp net.link.bridge.pfil_bridge net.link.bridge.pfil_local_phys net.link.bridge.pfil_member net.link.bridge.pfil_onlyip net.link.lagg.default_use_flowid net.link.lagg.default_use_numa net.link.lagg.default_flowid_shift net.link.lagg.lacp.debug net.link.lagg.lacp.default_strict_mode ``` Although the following vnet SYSCTLs have CTLFLAG_TUN flag, theirs values are re-fetched via TUNABLE_XXX_FETCH, thus are not affected by this change. ``` net.inet.ip.reass_hashsize net.inet.tcp.hostcache.cachelimit net.inet.tcp.hostcache.hashsize net.inet.tcp.hostcache.bucketlimit net.inet.tcp.syncache.bucketlimit net.inet.tcp.syncache.cachelimit net.inet.tcp.syncache.hashsize net.key.spdcache.maxentries net.key.spdcache.threshold ``` In memoriam: hselasky Discussed with: hselasky, glebius Fixes: 3da1cf1e88f8 Extend the meaning of the CTLFLAG_TUN flag ... MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D39638 (cherry picked from commit 110113bc086f5df1a9b6547edb1ab0cec698c55c) --- sys/kern/kern_linker.c | 3 +++ sys/kern/kern_sysctl.c | 3 --- sys/kern/link_elf.c | 20 ++++++++++++++++++++ sys/kern/link_elf_obj.c | 30 +++++++++++++++++++++++++++++- sys/kern/linker_if.m | 9 +++++++++ 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index a04dd4cec563..2a024816f23c 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -474,6 +474,9 @@ linker_load_file(const char *filename, linker_file_t *result) } modules = !TAILQ_EMPTY(&lf->modules); linker_file_register_sysctls(lf, false); +#ifdef VIMAGE + LINKER_PROPAGATE_VNETS(lf); +#endif linker_file_sysinit(lf); lf->flags |= LINKER_FILE_LINKED; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 7f0bd48747f3..9f340404f9b3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -526,9 +526,6 @@ sysctl_register_oid(struct sysctl_oid *oidp) RB_INSERT(sysctl_oid_list, parent, oidp); if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE && -#ifdef VIMAGE - (oidp->oid_kind & CTLFLAG_VNET) == 0 && -#endif (oidp->oid_kind & CTLFLAG_TUN) != 0 && (oidp->oid_kind & CTLFLAG_NOFETCH) == 0) { /* only fetch value once */ diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index c7871e8e2e0d..bcce79a8b262 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -160,6 +160,9 @@ static int link_elf_each_function_nameval(linker_file_t, static void link_elf_reloc_local(linker_file_t); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); +#ifdef VIMAGE +static void link_elf_propagate_vnets(linker_file_t); +#endif static int elf_lookup(linker_file_t, Elf_Size, int, Elf_Addr *); static kobj_method_t link_elf_methods[] = { @@ -178,6 +181,9 @@ static kobj_method_t link_elf_methods[] = { KOBJMETHOD(linker_ctf_get, link_elf_ctf_get), KOBJMETHOD(linker_symtab_get, link_elf_symtab_get), KOBJMETHOD(linker_strtab_get, link_elf_strtab_get), +#ifdef VIMAGE + KOBJMETHOD(linker_propagate_vnets, link_elf_propagate_vnets), +#endif KOBJMETHOD_END }; @@ -1934,6 +1940,20 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) return (ef->ddbstrcnt); } +#ifdef VIMAGE +static void +link_elf_propagate_vnets(linker_file_t lf) +{ + elf_file_t ef = (elf_file_t)lf; + int size; + + if (ef->vnet_base != 0) { + size = (uintptr_t)ef->vnet_stop - (uintptr_t)ef->vnet_start; + vnet_data_copy((void *)ef->vnet_base, size); + } +} +#endif + #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) || defined(__powerpc__) /* * Use this lookup routine when performing relocations early during boot. diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 2718a92d7864..a7fbfaa3ca64 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -150,6 +150,9 @@ static int link_elf_each_function_nameval(linker_file_t, static int link_elf_reloc_local(linker_file_t, bool); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); +#ifdef VIMAGE +static void link_elf_propagate_vnets(linker_file_t); +#endif static int elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps, Elf_Addr *); @@ -170,6 +173,9 @@ static kobj_method_t link_elf_methods[] = { KOBJMETHOD(linker_ctf_get, link_elf_ctf_get), KOBJMETHOD(linker_symtab_get, link_elf_symtab_get), KOBJMETHOD(linker_strtab_get, link_elf_strtab_get), +#ifdef VIMAGE + KOBJMETHOD(linker_propagate_vnets, link_elf_propagate_vnets), +#endif KOBJMETHOD_END }; @@ -1872,7 +1878,7 @@ link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab) return (0); return (ef->ddbsymcnt); } - + static long link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) { @@ -1883,3 +1889,25 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) return (0); return (ef->ddbstrcnt); } + +#ifdef VIMAGE +static void +link_elf_propagate_vnets(linker_file_t lf) +{ + elf_file_t ef = (elf_file_t) lf; + + if (ef->progtab) { + for (int i = 0; i < ef->nprogtab; i++) { + if (ef->progtab[i].size == 0) + continue; + if (ef->progtab[i].name == NULL) + continue; + if (strcmp(ef->progtab[i].name, VNET_SETNAME) == 0) { + vnet_data_copy(ef->progtab[i].addr, + ef->progtab[i].size); + break; + } + } + } +} +#endif diff --git a/sys/kern/linker_if.m b/sys/kern/linker_if.m index 0722390d4e20..a50ed1ea84a3 100644 --- a/sys/kern/linker_if.m +++ b/sys/kern/linker_if.m @@ -154,3 +154,12 @@ STATICMETHOD int link_preload { METHOD int link_preload_finish { linker_file_t file; }; + +#ifdef VIMAGE +# +# Propagate system tunable values to all vnets. +# +METHOD void propagate_vnets { + linker_file_t file; +}; +#endif From nobody Fri Jan 24 15:42: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 4YfhsF2Xdsz5lZ7n; Fri, 24 Jan 2025 15:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfhsF0Tv6z459g; Fri, 24 Jan 2025 15:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cpNFKzhWTRN+jAWocdp+n1RzmZcS+GOXXBd976XIFw=; b=v/g3SXW+yxxqT/sTotybEDVXxUHH0UobIHdJoffqchcQpE4wdA0KroQ70hTaGJkOFawbu3 gru1SI8d62xQTtLMENV8GSZRlX7+GGF54bC+yEt/RkVUSxwBpdgD0gtmKyz7kvDWJnhWAe KjiZcAAFVNE/dmS9deh1efkaLvS26jqSZFJiKUhRUCw5xjvQnrKJwsrnPzDc9Pmj92pWqG 4w4dMfebcgUyzCtdNEc/4jqeXO1d7dnIofPMFfpFEPJkCdi5s2tM1hmkgoS3E+gtDGJ6Qs llEi5Gi7xpHZ/XpYXbTaqDCH/6nVbcwodgYGBLGjjdzi+saRQkbNjAuCv7xwxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cpNFKzhWTRN+jAWocdp+n1RzmZcS+GOXXBd976XIFw=; b=e4l0TAdHc6N2V4kT81ap6DJLJDXWXmxgk13JDcGT8CYAGGYoFiitIKEPIir7E68H2+k8+t wMsdKgG9Y+oeg1aBjVCnVFtXvp7+5PH/Ezyxe5xl9r2FPKqKa4admVyZrXRzK6FWGCBDab Yy3dB51KvRo1Gj+P2vRwN34my71Gz06Nh/qMI8DFyTK1Mhv9SNPZava1qH4r7U8K8iZDzo yTFokKWjoZcPjyi2tPwaWtklHbrNZUMf++2Dp3wG6vDPFjU6mFAuNU9DPuVA5o12rDPxh0 98J2tZ69SE5WFkJ/Cqx2zAjkw6g4D6F0cZSD7jUKQBtf2bFpZ8fUfWMSFG4dRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733361; a=rsa-sha256; cv=none; b=S+Rh10B3GSdMgFHrZOSlbmraRuS2wUIo+/I45xGivp49VRTz/k2g0p4EDHEK8jrxG/UIxa lOcnm1fGD32bAeu2wxUxK7dhq7pX7j8Kx+BDE4uG3b5xTsLPGSWjS/O7vnwO/z9WZuC1AZ VBLF0NWE9Uy6PmDzO9FFsO08jxORC5HjGJ+XK6vZ4zOh3tD9yhi4IkQaVblwId7nfP9ipd pWrUfh4M31HfYZmWG9kxmVqbt22VfQTGFiUetbMC1qAP8kCzI/DDGiscgA9QgLYtIBQG3k xbWXxGdMFMTyihottIlQpKkt5cjhYXMtukIM+3R6ILcVqUC0OrK9xm+X+5iSgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfhsD6r99zXSP; Fri, 24 Jan 2025 15:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFgeAQ037260; Fri, 24 Jan 2025 15:42:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFgeSd037257; Fri, 24 Jan 2025 15:42:40 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:42:40 GMT Message-Id: <202501241542.50OFgeSd037257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d67b1748ea34 - stable/14 - carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d67b1748ea34ad6f66072694fd8b623ab0ea72b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d67b1748ea34ad6f66072694fd8b623ab0ea72b1 commit d67b1748ea34ad6f66072694fd8b623ab0ea72b1 Author: Zhenlei Huang AuthorDate: 2023-09-09 08:10:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:41:09 +0000 carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH With recent change 110113bc086f, a vnet tunable can be initialized when there is a corresponding kernel environment variable unless it is marked with the flag CTLFLAG_NOFETCH. The initialization may happen during early boot(linker preload), at that time vnet0 has not been created. The hander carp_allow_sysctl() for the tunable net.inet.carp.allow requires vnet, thus invoking it during early boot will cause kernel panic. The tunnable is initialized by vnet sysinit routine ipcarp_sysinit() so let's just mark it with flag CTLFLAG_NOFETCH. No functional change intended. Fixes: 110113bc086f sysctl(9): Enable vnet sysctl variables to be loader tunable MFC after: 2 week Differential Revision: https://reviews.freebsd.org/D41525 (cherry picked from commit 242fa308f3c3def32b2e61e0b78c11b3697e4492) --- sys/netinet/ip_carp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 335cb42613bf..ddbc13e7c878 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -237,7 +237,7 @@ static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "CARP"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, allow, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &VNET_NAME(carp_allow), 0, carp_allow_sysctl, "I", "Accept incoming CARP packets"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, dscp, From nobody Fri Jan 24 15:48: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 4Yfhzd6Pdgz5lZS4; Fri, 24 Jan 2025 15:48: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfhzd5jFnz4688; Fri, 24 Jan 2025 15:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yt7WnfR01VyREjI5XnE+ehbJJfBCRFYbQK6lxP0ZRUU=; b=sBCILoR4A4OZP5UwTGh3rwO94BpQVQ1sdjo/2TZzCU3HcQw/eZ9ela0fakhurcmd7j9VLy Z+iYlszQlgDQRYRUTPLp9lsJwe5XIZXD3T7FwzZCSPWZhalPimVlxqA/NtTrgSLhZlP6Bm meZwJ9vmJGTIsrkTenQTFcDGPADjITNXNi8wm1oA5KNQa5EC1jseQ/GSrC+A04CJD5ilYJ SKi+a9HOEEQQI4xwsD0ul7AQC7S5EpqklPmu58DJH6OquZ2oEMFA6pBopL2ZpVDO3Hktva IxTpTtPTEcE0uhOcfEam7YVW65hr4cGrk24el/FFxPJg7F8yycLWkPZKsvrIHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yt7WnfR01VyREjI5XnE+ehbJJfBCRFYbQK6lxP0ZRUU=; b=L6iD5hUk0lxWJqmwnNcIqZYyebDTmFCS8r1K+1YqmzcTBTgObEnqKxeeqVYb4q7rWPePib oaz38MOytc8L3iMMj2zKg+8jy2vLfQE9XiXFGk6nyR29G1RGJf1pqnygFM1Fq5A2/tod2N EuBRX6EAw8pXrGAsgYz0ZwhbBBJ4GSVKx7snvtsRVSlZyDwKw0LN/qsunz/j8VqUts5hcb hoLKFrBVRZ8lUysKQkcftIkpRCZj1rEJa4z4zdkbBWgYU0h6UWzEYqvyb32FKmv8gevAwk a1H9MjZ2K/ZZid7CNEW/dL60slhltTXZxjR0w0SFdDSGev1GFuMCGe2bAU+nDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733693; a=rsa-sha256; cv=none; b=uleEbuMzFCvYbn72RzWjK8dpL8AQSXEovuWXcR8E8XgU0tEEJyxhDdNtMavWnfzW+BVZgJ uhsTT7iL4Rtl/epLS6btklozg4fV+VFcx0zNMUalPm2GA3gFoZads9Ne2SBDtJYUiQQKPq i+n72JmWRlC2bIwComd9SbL5HDFehmIes+H0dj0yoSldQondtfIL9sGk03xzsVoieM5qGR FVleQvfd8AS+d3vejuUplrBOm8E3+lHh8WtaRYqe6E5IubKCcWWT19QhNBu8q3dxPFa1tO NddXQmajVNSK2eOpKy3fZHpS6PBIS/EWa1x9OPOcPP0UcCz5hz+0Z1NIlcIFjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfhzd4p0bzXRv; Fri, 24 Jan 2025 15:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFmD4e038987; Fri, 24 Jan 2025 15:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFmDYF038984; Fri, 24 Jan 2025 15:48:13 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:48:13 GMT Message-Id: <202501241548.50OFmDYF038984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3965be101c43 - stable/14 - pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3965be101c434437ce8819250e9e6b3e5c3d702e Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3965be101c434437ce8819250e9e6b3e5c3d702e commit 3965be101c434437ce8819250e9e6b3e5c3d702e Author: Zhenlei Huang AuthorDate: 2023-09-22 10:05:02 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:46:20 +0000 pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop' 7f7ef494f11d introduced a compile time option PF_DEFAULT_TO_DROP to make the pf(4) default rule to drop. While this change exposes a vnet loader tunable 'net.pf.default_to_drop' so that users can change the default rule without re-compiling the pf(4) module. This change is similiar to that for IPFW [1]. 1. 5f17ebf94db5 Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable 'net.inet.ip.fw.default_to_accept' Reviewed by: #network, kp MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D39866 (cherry picked from commit c531c1d1462c45f7ce5de4f9913226801f3073bd) --- share/man/man4/pf.4 | 4 ++++ sys/netpfil/pf/pf_ioctl.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 4938e719b17e..cd87b98ea45d 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -87,6 +87,10 @@ Default value is 131072. Size of hash table that store source nodes. Should be power of 2. Default value is 32768. +.It Va net.pf.default_to_drop +This value overrides +.Cd "options PF_DEFAULT_TO_DROP" +from kernel configuration file. .It Va net.pf.rdr_srcport_rewrite_tries The maximum number of times to try and find a free source port when handling redirects. diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 6cb7bc95df2b..e67a0ddadfb7 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -199,6 +199,16 @@ SYSCTL_BOOL(_net_pf, OID_AUTO, filter_local, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(pf_filter_local), false, "Enable filtering for packets delivered to local network stack"); +#ifdef PF_DEFAULT_TO_DROP +VNET_DEFINE_STATIC(bool, default_to_drop) = true; +#else +VNET_DEFINE_STATIC(bool, default_to_drop); +#endif +#define V_default_to_drop VNET(default_to_drop) +SYSCTL_BOOL(_net_pf, OID_AUTO, default_to_drop, CTLFLAG_RDTUN | CTLFLAG_VNET, + &VNET_NAME(default_to_drop), false, + "Make the default rule drop all packets."); + static void pf_init_tagset(struct pf_tagset *, unsigned int *, unsigned int); static void pf_cleanup_tagset(struct pf_tagset *); @@ -335,11 +345,7 @@ pfattach_vnet(void) /* default rule should never be garbage collected */ V_pf_default_rule.entries.tqe_prev = &V_pf_default_rule.entries.tqe_next; -#ifdef PF_DEFAULT_TO_DROP - V_pf_default_rule.action = PF_DROP; -#else - V_pf_default_rule.action = PF_PASS; -#endif + V_pf_default_rule.action = V_default_to_drop ? PF_DROP : PF_PASS; V_pf_default_rule.nr = -1; V_pf_default_rule.rtableid = -1; From nobody Fri Jan 24 15:50: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 4Yfj2M39Wrz5lZV5; Fri, 24 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfj2M2bgKz46ZJ; Fri, 24 Jan 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Hli9L2VaFN1VQu3ZGsd9nYK8CcoRm3/CAl2+1uEcIc=; b=gtMujfxHukwxxmampH9Iej5dhh2cTYE5k4PCeiG64whGItAcGjmAthoNV9r142CLGJTOve WLNL8k38tECTu+4x7m2yzaDZmi71Gn8B1jWSvVaWGqpZ8gYYLSr4TXUca+XxRMnjQsBbeU BiIw3WbcuC6+mxnbW9fF7O8kPnpjA5uF8Me6oM/dDvZPni1FF6XfbDZbzVdC9N2YlQFxkR 0ZLiJ8U7g/A8+7C+FWokt5NVzcEQ1u/Pc8uNVVORunaBNZGdyR0yC8g/tqCIih3Ybg8Lhs mJ/H++ygYE7kyhv9YTSMKyEbt3VrEd06Gq83b+6p8mAq2AbmhztgBG3PeiPakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Hli9L2VaFN1VQu3ZGsd9nYK8CcoRm3/CAl2+1uEcIc=; b=oaUjR4KdaKqZhU7lzUxK7MskTBn8FWT7P8vcHvJpl7LXoUJoEFa8EQTFms1LCUZ/6q0FHU YqsBq1l6x8blxe5S+8tZxJwXfEaZKr7LzmEbEQmIlp0OLAbho27y6iofreZJ7xiWk0TJak +4gcPLNJKJwyj/t8la3azFg2lb0ikqbY6a2BbNe9mZCyuwbwez+LqDGDo3Ve3/vE/zicYS +u0Zv041AdJGjfc/mQvQOpFIDE19SdC1oIfgNa4ZaSRV4GHNV0X4BM8PmcbV52a1qKkd4w A8gib04BP7DH/WFdUfFbAPJQqXu3gYOyDGiTPyvG745fLG5LYpS0kjA9RpKmaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733835; a=rsa-sha256; cv=none; b=iBF1Id4yaH/o3lPWF9cjXLVFVC+u+i/iffTY19kv8xu1KS7rPHt04IxWQiGYX+7RsnIc12 UC3HMvTDOnp1/Pi5hHkydA7aOdI/wAPmHJs2FUSy6LI4gB9VUlwO2OXzXbYh8o7K7ImQ6q S5+uD7GK5DMWiH24Fso1UJ6lkSva+jVp7bkYEJMqNpaRKIXyfJSiteFo/0N8GsLIG1ebL2 OLxvcBVQ3FK2CymBEcYJNQQFe0ne1HqWC976Q5bTGVxOVNmLna4cT7EGFJUQCCiCDcZm1P zA9Ft8iYHVpCwayXAXkBY2SG9lcKN7GfCnF27Rbc9RR08ZVbHYcCp2t45vF4eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfj2M24lwzXVB; Fri, 24 Jan 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFoZYK048332; Fri, 24 Jan 2025 15:50:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFoZIr048330; Fri, 24 Jan 2025 15:50:35 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:50:35 GMT Message-Id: <202501241550.50OFoZIr048330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1d890d546b06 - stable/14 - sysctl: Fix usage() and SYNOPSIS section of man 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d890d546b064f2c7753b949f5dbf00d79cde292 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d890d546b064f2c7753b949f5dbf00d79cde292 commit 1d890d546b064f2c7753b949f5dbf00d79cde292 Author: Zhenlei Huang AuthorDate: 2025-01-23 07:24:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:49:33 +0000 sysctl: Fix usage() and SYNOPSIS section of man page I forgot to update the usage() and SYNOPSIS section of man page when adding the two options -J and -V. While here, fix the options sort order in SYNOPSIS section. Fixes: 5ec83c660aca sysctl: Add flags to filter jail prison and vnet variables MFC after: 1 day (cherry picked from commit 0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3) --- sbin/sysctl/sysctl.8 | 6 +++--- sbin/sysctl/sysctl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index fadc162b80c6..da4dec6be005 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -30,7 +30,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd October 29, 2024 +.Dd January 23, 2025 .Dt SYSCTL 8 .Os .Sh NAME @@ -38,13 +38,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdeFhilNnoTtqWx +.Op Fl bdeFhiJlNnoqTtVWx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value Ns Op , Ns Ar value .Ar ... .Nm -.Op Fl bdeFhlNnoTtqWx +.Op Fl bdeFhJlNnoqTtVWx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 8ec9089bd2cf..df9b453d52a0 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -122,8 +122,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdeFhilNnoqTtWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdeFhlNnoqTtWx] [ -B ] -a"); + "usage: sysctl [-bdeFhiJlNnoqTtVWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdeFhJlNnoqTtVWx] [ -B ] -a"); exit(1); } From nobody Fri Jan 24 15:50: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 4Yfj2N4k89z5lZfk; Fri, 24 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfj2N39xBz46LV; Fri, 24 Jan 2025 15:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLBdtNFMngvnP4JRNUzekVyD/Ryaj+1gI5HHLbJNguQ=; b=YwQdJBZR3o7UvWjcniC5ZTQm8+uc5VtyhLdLnFPZNQQ8ED3wRLjnAut00kShciZMTcR+ys rWKq/SoshDAHGEImrxueH6rL6Fw0Ya34Q4UVnSTiuj0V4Z66fTZpI3+JztI53PXYaNSKQC AZUnFXuNZFvBaC+3E/LTO4b0Hge3U0GcBu47qv14WwGUj3RZYjtn2tVBAqMv4CGp7Gh59g 1kB+Y1dS8lW0jaMySrKuGjtvbCc8nFUfdYQ0VB5Hc+21nkoxuKLveD7HM42gEdnaQh13Nu AJigbEB8plSuuJFFR7BlNoy5vXAVYPxRSjTwk27ILVd461WqmHg/CXq+O9jpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLBdtNFMngvnP4JRNUzekVyD/Ryaj+1gI5HHLbJNguQ=; b=dER5+NNRCFifgDmcC1LiQckeeui4ynf5s2eF+DC3aWyqHZqafRIJuqW9i4XwtRPHgOZC8F o0k9uRS9Sc9sZfc+IPYomObvA8c3ZNxWZtc/m5vmMfZX+drI5g8RGxPDz0OcXfwUNZN+B+ ORT/04TqpzfUiC2sKCwQnpAfrQVifC5odyzd5PJnm2lOyB5Je7bA0cnxn99GRz9tp8LZhW P98MoyR0sIr8Ol/uF/nxuimN65McXBVlNobMpW8WD4q86ssQHW2RuQwUgstJkSAEvd11x0 vlXnhgIoYYm2wjN3YcxQxDCSXyKWw2OfvFuhIn3B/u2pUvh/+U1xIj6JaV+dSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733836; a=rsa-sha256; cv=none; b=iqjRPaxD+TEKUAmKsS5jc3k8KNMw2q6f2xoaYCQ5vdvcf0/71UDvtsljrmmMB9IbHhVRE4 y6ke48EATpK8LAJ+PGoGjYy3Jkmibyjy4Tor0PtSKRzsBfiEdr+1KrfTL76ll8trRU3ER9 O0dmmbfNon0sTTV+StCThUHAop9kw4KAjK91+UOYG+JIZ9I4JJOzsfxcmPjBD5+IZU9VBr u7qO0/8RzqosiyYO1JRVAtkSTiZ+YqdXWQKBPdfSqTSnsvCvHhnJW3yN+0MIl60CXrSFuS lm3gl7u9klk39vusm9PwbJ8RJ2HZv5JfVw1S7OQP6B6nqaGRAVqgXo9StooA3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfj2N2l1qzXmd; Fri, 24 Jan 2025 15:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFoap2048376; Fri, 24 Jan 2025 15:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFoaaE048373; Fri, 24 Jan 2025 15:50:36 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:50:36 GMT Message-Id: <202501241550.50OFoaaE048373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 0e4f9db00dc3 - stable/14 - sysctl: Sort options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e4f9db00dc3907f90152afdeee7965555563927 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0e4f9db00dc3907f90152afdeee7965555563927 commit 0e4f9db00dc3907f90152afdeee7965555563927 Author: Zhenlei Huang AuthorDate: 2025-01-23 08:01:04 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:49:49 +0000 sysctl: Sort options No functional change intended. MFC after: 1 day (cherry picked from commit c294ecb25b5f3553b5c84b630869bb05724c9629) --- sbin/sysctl/sysctl.8 | 16 ++++++++-------- sbin/sysctl/sysctl.c | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index da4dec6be005..aee66173fdea 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -70,10 +70,6 @@ opaque or excluded from listing via the flag. This option is ignored if one or more variable names are specified on the command line. -.It Fl b -Force the value of the variable(s) to be output in raw, binary format. -No names are printed and no terminating newlines are output. -This is mostly useful with a single variable. .It Fl B Ar bufsize Set the buffer size to read from the .Nm @@ -83,6 +79,10 @@ This is necessary for a .Nm that has variable length, and the probe value of 0 is a valid length, such as .Va kern.arandom . +.It Fl b +Force the value of the variable(s) to be output in raw, binary format. +No names are printed and no terminating newlines are output. +This is mostly useful with a single variable. .It Fl d Print the description of the variable instead of its value. .It Fl e @@ -96,15 +96,15 @@ This option is ignored if either or .Fl n is specified, or a variable is being set. +.It Fl F +Print the format of the variable. +This is additional information to describe the type of the variable and +most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl f Ar filename Specify a file which contains a pair of name and value in each line. .Nm reads and processes the specified file first and then processes the name and value pairs in the command line argument. -.It Fl F -Print the format of the variable. -This is additional information to describe the type of the variable and -most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl h Format output for human, rather than machine, readability. .It Fl i diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index df9b453d52a0..13161e9a3be4 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -137,7 +137,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:FhiJlNnoqtTVwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AaB:bdeFf:hiJlNnoqTtVWwXx")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -146,24 +146,24 @@ main(int argc, char **argv) case 'a': aflag = 1; break; - case 'b': - bflag = 1; - break; case 'B': Bflag = strtol(optarg, NULL, 0); break; + case 'b': + bflag = 1; + break; case 'd': dflag = 1; break; case 'e': eflag = 1; break; - case 'f': - conffile = optarg; - break; case 'F': Fflag = true; break; + case 'f': + conffile = optarg; + break; case 'h': hflag = 1; break; @@ -188,22 +188,22 @@ main(int argc, char **argv) case 'q': qflag = 1; break; - case 't': - tflag = 1; - break; case 'T': Tflag = 1; break; + case 't': + tflag = 1; + break; case 'V': Vflag = true; break; + case 'W': + Wflag = 1; + break; case 'w': /* compatibility */ /* ignored */ break; - case 'W': - Wflag = 1; - break; case 'X': /* compatibility */ aflag = xflag = 1; From nobody Fri Jan 24 19:49: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 4YfpKh51Hsz5lqPv; Fri, 24 Jan 2025 19:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfpKh4TKTz3VLv; Fri, 24 Jan 2025 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLuW71iGqOh7O5uZJyEoftCBRg3YlEdXhKfSpQ0bwiI=; b=ow11nMovEXKdz/45HUMQijZpvNIChZFoNcI7T0lKG3oHNaFc8PFP6EdVjjbVd+A9pZAqDD EL8M2Ujz2xQFeQMu8WaWnJpVGABeY9q5bNe9FQgV3F71Lhq6kS66O82trZzJyYLlNmsGB/ 61VgBL1LYwf/ZRh3YDKDyt11k0v3zvXYkAW1w3P2mKW+Gqe+Aa9Nram7hRMlOWwM4m0RXy 8+twYspZdKh4k2YBDN2ynSbIIR/5dyfT39YZWDtT+SnJ28dtWvmyRhi95m0p4Zcoob8g7g qUzTNSIZQbE0WkeENwZqrmW6/fTnWJ7tD4Eg0y8KpKMOmyV/Cu5ZYrc4pxKtLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLuW71iGqOh7O5uZJyEoftCBRg3YlEdXhKfSpQ0bwiI=; b=oQwWQHPflPj+V4YuHo0qhkujwoU5OFCE/JNh0Xd8YLnFnx7pE2JGNZ7EfC5PhzNl2kmdPk pnELuzToJzTRU2Pvfsr6XAlR8SR10kDIxeuO8OEIXheZfW2Q8hjQRRj/OAdioxX2sf+0/b is2cwdU8XW/khQaPyh0PVW8UFklpd2c+yei9+aoQPOqxNO12szljAaTQRQWpRe5A6ODt6l UwUIp8xK7++mne+EBbKp/N0D8q0gI9a6OdbDn7+XGQbfECkuFjNfjHYfPM7hEBjDfMlxLx l/j7iNnFZzFhxGrSGBfHyrze9BxD2SAMERfaUxW9AquY4vN7VyCMVlcnCkqcJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737748152; a=rsa-sha256; cv=none; b=wzhsuI/2JxSp0RroQiPeytfWzBCoSNJkJNe0SxjrsNWCPxxcqqK3p9Bp1DbELFxwAW1kZ8 gwuLVsEC0iIUpuaC4GOlJphPc6h8BQc2pVl9I0PyiPx8OwQl47pCZXtv9mfcR7AQOmRHWa AoLQC/94SarD+/vtYWShvsAwNRZ/Q/NbKwv3965LbUgdcIkJGldUP5xpUoD4qXf+RAJSso j+sor01jY+DT/kGDDy3rKc1c3VfA++8EqCWV+jKAOhWCbCr5faE/vLrrJMYayzSYYugZ3P 6Ni5SU+SDA65OS0yMiRCjoQEQ9g3QF/wXUSjaZ3jHT0PUNJKoUJNLZcXfvogrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfpKh43Sfzg6k; Fri, 24 Jan 2025 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJnCsd087743; Fri, 24 Jan 2025 19:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJnCDV087740; Fri, 24 Jan 2025 19:49:12 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:49:12 GMT Message-Id: <202501241949.50OJnCDV087740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2dd706b9c41e - stable/14 - libelftc: Fix a typo - FreeBSD's riscv port is little-endian. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 2dd706b9c41ec78d5c1f99aba52856dbaa2265c8 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2dd706b9c41ec78d5c1f99aba52856dbaa2265c8 commit 2dd706b9c41ec78d5c1f99aba52856dbaa2265c8 Author: Joseph Koshy AuthorDate: 2024-12-31 17:53:16 +0000 Commit: Ed Maste CommitDate: 2025-01-24 19:48:56 +0000 libelftc: Fix a typo - FreeBSD's riscv port is little-endian. This change brings the descriptor for target "elf64-riscv-freebsd" in line with its documentation. I missed this somehow when reviewing https://reviews.freebsd.org/D20768. Reported by: Haowu Ge (on elftoolchain-developers) Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D48271 (cherry picked from commit aac74b708b3dc49466b0fb5365bc2923b7727a1c) --- contrib/elftoolchain/libelftc/libelftc_bfdtarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c b/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c index 5bbf89ba78fa..3f2c23708549 100644 --- a/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c +++ b/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c @@ -334,7 +334,7 @@ struct _Elftc_Bfd_Target _libelftc_targets[] = { { .bt_name = "elf64-riscv-freebsd", .bt_type = ETF_ELF, - .bt_byteorder = ELFDATA2MSB, + .bt_byteorder = ELFDATA2LSB, .bt_elfclass = ELFCLASS64, .bt_machine = EM_RISCV, .bt_osabi = ELFOSABI_FREEBSD, From nobody Fri Jan 24 19:50: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 4YfpMc5qynz5lqcR; Fri, 24 Jan 2025 19:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfpMc5MQKz3W59; Fri, 24 Jan 2025 19:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oRsBjXFHkSR6Rs2Pjp45BzstHC1WBhk9QLdQB19KjdI=; b=B9xN7opoivyLKL4DWBP1psnS3cFnK5mJpb3WPdqY0ahuyyraCZl7bx/R9P8/1/XqN9OgRB YIBg6FqKHFPwBvWoL57E7Rhl6gxvaeKcnK9AvGK+oOvLBkQLpXhmOmv0mNTBQPBJAVIBul BW5AD1DtldOIiEh3MtW9Ok0KWwjwAQQaYgo0YXwqGnle4g31PBAIGvUfV3NrGXYDUC1Ycv d5OsU6A/TmLpTfiPiXiZK7pydZ/0BPXxIs2Rf4qFmqNzU6JwJ2T33OzBVkOYZbNuLRaEF5 DpVDODUl76emZDahuEsFaFhm7bYpXjdHsDLFzPBZrlUGuJuPzABc455Z5+QH0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oRsBjXFHkSR6Rs2Pjp45BzstHC1WBhk9QLdQB19KjdI=; b=CikOFzZ9WHlD+qOobDNr83kHJ23g6BKGhJpR4Opmg96K70gAkSviAhOmMTn/xTfuNPWlTa sUrCSXFdhHJ+XaBDMeQFpKdLm+sfH0a5z6sw4js3saaTuVN8+cs6HAmw5TjuTVthYF4iBe L/o31XsyCyjPIijZgOJub//F+XkyEfpFx42efknaw99iPVL7yDtV0flYL2c7H6kDAeTMUn W0asU7NRFlTKsaMOXsXtazHRgwFejhci+uV/CWmytTRu8/JLw44yjv6vx90KIBSr4Lf2K/ NhXPTAwXV8Ri5b5zNTCSZgb8AO6Bji/8zbaQBGu5/h9RrUiK3Bsd0RLLr0Ostg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737748252; a=rsa-sha256; cv=none; b=Kr3gO3qYVaK7M05DZUUG/P4RbR3czNIX/Gq5rXuz8cw0BWRJStN74WNN3d9hhvLL0zAECq EFQuuRdNL1BQneuD59ptiGgy9DBGgdXUzVdp9XnRs0fvmt78naPomIhlVB7j36on6vawVl 5LpOG2LMClBqQc3T9cs2u3CqiPuqQae1MG/02A8uoDbSw4jh64ofEZ6I5WZEZrDaSPwJpC oeUjhtG3MTQEA6RFd9cWD1h718JmE09XAqDVVZEXjMJtqv84WGRJ0uXZ/mX+gVyihM1Z/B 522V0granUjPEkV5Uyvcu28SXLO29ad2OPeRUGQUiZ2SzbX8s7+fChrhmsx7rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfpMc4xv2zg6x; Fri, 24 Jan 2025 19:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJoqtZ097965; Fri, 24 Jan 2025 19:50:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJoqB4097962; Fri, 24 Jan 2025 19:50:52 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:50:52 GMT Message-Id: <202501241950.50OJoqB4097962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 880f1dee7ea2 - stable/14 - tcp_wrappers: Use default C standard 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 880f1dee7ea25053a1f12effb1ab6dfb5d0321f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=880f1dee7ea25053a1f12effb1ab6dfb5d0321f7 commit 880f1dee7ea25053a1f12effb1ab6dfb5d0321f7 Author: Minsoo Choo AuthorDate: 2024-04-06 00:30:50 +0000 Commit: Ed Maste CommitDate: 2025-01-24 19:50:38 +0000 tcp_wrappers: Use default C standard version Reviewed by: emaste, arichardson, jhb Differential Revision: https://reviews.freebsd.org/D43236 (cherry picked from commit 2cadbe468a8e8aef193429565b729d34ec48b266) --- contrib/tcp_wrappers/tcpd.c | 1 + libexec/tcpd/Makefile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/tcp_wrappers/tcpd.c b/contrib/tcp_wrappers/tcpd.c index a0ba42f71f86..164132570a36 100644 --- a/contrib/tcp_wrappers/tcpd.c +++ b/contrib/tcp_wrappers/tcpd.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32"; int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ +int main(int argc, char **argv) { struct request_info request; diff --git a/libexec/tcpd/Makefile b/libexec/tcpd/Makefile index 408db9c39744..892855d1d8a7 100644 --- a/libexec/tcpd/Makefile +++ b/libexec/tcpd/Makefile @@ -7,7 +7,6 @@ PACKAGE= tcpd PROG= tcpd MAN= tcpd.8 -CSTD?= c89 CFLAGS+=-DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" \ From nobody Fri Jan 24 19:57: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 4YfpW9348zz5lr1Q; Fri, 24 Jan 2025 19:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfpW91LvPz3XHD; Fri, 24 Jan 2025 19:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/9BFLxUv3qZPqZwhW50Q+woLbATuP1JlemHkyzHrNU4=; b=R1EfQOmVaISPoNV76Z97DZI8CJOn4iyJNbdoC2H5Xy+YRlxl5cqiIgvD3TVgtoQaoBiYWJ WoUfxJFugdVp8Eak7047/swdu71wdytblDqkcndilMTOgFpY2bjE5PC11fZXxqYES9Qqy8 phQAb36cDWhoV4hpptgNgTyjB9NWC657lo+FMM5CNEv6yTsuuKUW+tukJwkpZEBFMqfFul 6t69vABcom5sV2UhCJYkW19Qf6Jkq0flY59zvtjmm6Y7dmBdAef4ToEvRUiKcJsMPr1J10 Vdu7/z2VLxGUG38/B6pzbqIVuarNANPPLY4EwT//7E+4CCrna8+Z+aY9aq93+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/9BFLxUv3qZPqZwhW50Q+woLbATuP1JlemHkyzHrNU4=; b=ueQ1vCXrsc7XQoiJ610t8O06uSd0+RXHaiYdN8ho8efz5cg39gsNMqG9DWsE7JgQyfSewO bNBXiYTHICgQHR8p1WZr9uU2uOIyJdXA6CDG872KjMiyMXRhmFpM5t7n1lB1cYkWjZTfOG kUGO87Yl0mkjlvZ1kZmX3VXdxA4WO8Ods0shWtWRD2rrg+e1Y22WTV26EUuI0AUKNuIav3 1Bn1kXcTMW52P9OpEvEHDIPrYqhFB760WLzlqhPiuMEhK4T5sHFk6gPXd2GH9tBTZmPjPQ /CBjonhU1So6KHlchO5CCU+V+4CMe0c6ysDNdP5BGvZ1WDB2gIUqFWvNMazm7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737748645; a=rsa-sha256; cv=none; b=uvzUirEd0rLGFPAUPCxKYHRigOpVEmk2fRypZ0Rr90FRpgwjR4A1wKuJlsil5rxzzsvgOx fvCizBRpevbkKGV8iKHi8EsBBJsRNNRCm5n9/fl8pyU+tXgDjM8Y9VQLLCuJg0FNuIrUG2 qvB+mZVv4La7VMO7M012OtaCT8VOtS/yEauY3KHhByYy8VFoo9T70kPijn6ge143K3qIAl SZ3ZXxrPs6/PrZGMmFequgX+/mFgZPoPieEeJp/BTFexZR70KyBHcBsNqm8sOPxWrIt/Yk M//uu+JLVHIcPYltf3HhWprH69fJVX2YooinbnM7TidwmIiWst2xlayo2JU82w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfpW90Rf9zgm9; Fri, 24 Jan 2025 19:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJvOE4006353; Fri, 24 Jan 2025 19:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJvOeD006349; Fri, 24 Jan 2025 19:57:24 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:57:24 GMT Message-Id: <202501241957.50OJvOeD006349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 26336203d32c - stable/14 - contrib/spleen: Update to Spleen 2.1.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: 26336203d32c7936d7743cbec20f2da733db227e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=26336203d32c7936d7743cbec20f2da733db227e commit 26336203d32c7936d7743cbec20f2da733db227e Author: Ed Maste AuthorDate: 2025-01-21 02:55:47 +0000 Commit: Ed Maste CommitDate: 2025-01-24 19:57:10 +0000 contrib/spleen: Update to Spleen 2.1.0 Merge commit 'e364562a4012d6d9cb334795b97e929cfa2a5dff' (cherry picked from commit 18270a76e24e7f17f533a7a683eed3327a3c135a) --- contrib/spleen/ChangeLog | 31 + contrib/spleen/LICENSE | 2 +- contrib/spleen/README.md | 69 +- contrib/spleen/spleen-12x24.bdf | 2368 ++- contrib/spleen/spleen-16x32.bdf | 19138 +++++++++++--------- contrib/spleen/spleen-32x64.bdf | 36002 +++++++++++++++++++++----------------- contrib/spleen/spleen-5x8.bdf | 8 +- contrib/spleen/spleen-6x12.bdf | 1456 +- contrib/spleen/spleen-8x16.bdf | 10156 ++++++----- 9 files changed, 39463 insertions(+), 29767 deletions(-) diff --git a/contrib/spleen/ChangeLog b/contrib/spleen/ChangeLog index dd49696db5f4..bbe2cd4d422e 100644 --- a/contrib/spleen/ChangeLog +++ b/contrib/spleen/ChangeLog @@ -1,3 +1,34 @@ +Spleen 2.1.0 (2024-03-22) + +- Document how wsfont header files (for OpenBSD and NetBSD) are generated +- Add base cyrillic (basic alphabet + most used extended) characters (Thanks + Slava Voronzoff!) +- Fix latin small letter 'u' smoothing in the 32x64 version +- Fix smoothing on more variants of 'u' in the 32x64 version + + + +Spleen 2.0.2 (2023-12-25) + +- Fix MALE and FEMALE character ordering in the 16x32 and 32x64 + versions (Thanks Mike Cui) +- Update README to add a link to the Alpine Linux package + + + +Spleen 2.0.1 (2023-11-17) + +- Add a 'com' target to generate SPLEEN.COM, the DOS version of Spleen +- Also add 'com' in the 'all' target +- Update README to add a link to the Guix package +- In the Spleen loader for DOS, put 4C00h in ax and not 4Ch +- README.md: add Gentoo package link +- Switch to using Oxipng as it compresses even more than OptiPNG +- Add a new FAQ file answering frequently asked questions about Spleen +- Remove C0 control characters range in the 8x16, 16x32, and 32x64 versions + + + Spleen 2.0.0 (2023-05-28) - Add full support for CP437 (IBM PC) in the 8x16, 16x32, and 32x64 versions diff --git a/contrib/spleen/LICENSE b/contrib/spleen/LICENSE index 7f639bf61a6d..4387948e8467 100644 --- a/contrib/spleen/LICENSE +++ b/contrib/spleen/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2023, Frederic Cambus +Copyright (c) 2018-2024, Frederic Cambus All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/contrib/spleen/README.md b/contrib/spleen/README.md index ce2e6addc305..a80773ec8420 100644 --- a/contrib/spleen/README.md +++ b/contrib/spleen/README.md @@ -104,6 +104,9 @@ Spleen packages are available for: - [Debian][15] - [Ubuntu][16] - [MacPorts][17] +- [Guix][18] +- [Gentoo][19] +- [Alpine Linux][20] ## Manual installation @@ -114,6 +117,8 @@ Clone the repository, convert the files to the Portable Compiled Format Alternatively, release tarballs provide PCF files for each size. +OTB versions are also available. + ### macOS macOS users should use the `.dfont` files provided in the release tarballs. @@ -150,7 +155,7 @@ Update **.Xdefaults** and add one of the following directives: Launch **xterm**. Ubuntu has bitmap fonts support disabled by default, instructions to enable -it are available [here][18]. +it are available [here][21]. ### Linux console @@ -178,9 +183,12 @@ For example, to load Spleen 16x32: ### OpenType versions Spleen release tarballs now contains OTF versions generated automatically -from the BDF files, using [bdf2sfd][19]. Each font has a different name, +from the BDF files, using [bdf2sfd][22]. Each font has a different name, allowing them to be installed alongside. +Please note that OTF versions should be used as last resort, always prefer +bitmap versions if they are supported on your platform. + They should be used in the exact size specified below, with anti-aliasing disabled. @@ -203,26 +211,27 @@ Spleen is developed by Frederic Cambus. ## Resources -- [Spleen - Monospaced bitmap fonts][20] (2018) -- [New console font Spleen made default][21] (2019) -- [NetBSD, CTWM, and Spleen][22] (2021) +- [Spleen - Monospaced bitmap fonts][23] (2018) +- [New console font Spleen made default][24] (2019) +- [NetBSD, CTWM, and Spleen][25] (2021) +- [Spleen 2.0.0 released with full CP437 support][26] (2023) GitHub: https://github.com/fcambus/spleen ## Trivia -- Spleen was imported in the OpenBSD src tree in [September 2018][23] -- Spleen is the default font for OpenBSD consoles since [January 2019][24] -- Spleen was imported in the NetBSD src tree in [March 2019][25] -- Spleen 12x24 was used in the Haiku [kernel debugger][26] (on high resolution +- Spleen was imported in the OpenBSD src tree in [September 2018][27] +- Spleen is the default font for OpenBSD consoles since [January 2019][28] +- Spleen was imported in the NetBSD src tree in [March 2019][29] +- Spleen 12x24 was used in the Haiku [kernel debugger][30] (on high resolution displays) from May 2021 to June 2022 -- Spleen was imported in the FreeBSD base system in [May 2023][27] -- [msTERM][28], a Terminal program for MailStation devices uses Spleen 5x8 -- [FBInk][29], a library to print text & images to an eInk Linux framebuffer +- Spleen was imported in the FreeBSD base system in [May 2023][31] +- [msTERM][32], a Terminal program for MailStation devices uses Spleen 5x8 +- [FBInk][33], a library to print text & images to an eInk Linux framebuffer embeds Spleen 16x32 -- [U8g2][30], a monochrome graphics library for embedded devices includes +- [U8g2][34], a monochrome graphics library for embedded devices includes all Spleen sizes -- [Ansilove][31], an ANSI and ASCII art to PNG converter includes Spleen +- [Ansilove][35], an ANSI and ASCII art to PNG converter includes Spleen [1]: https://www.cambus.net/content/2018/09/spleen-hello.png [2]: https://www.cambus.net/content/2018/09/spleen-etranger.png @@ -241,17 +250,21 @@ GitHub: https://github.com/fcambus/spleen [15]: https://packages.debian.org/search?keywords=spleen [16]: https://packages.ubuntu.com/search?keywords=spleen [17]: https://ports.macports.org/port/font-spleen/ -[18]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts -[19]: https://github.com/fcambus/bdf2sfd -[20]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ -[21]: https://undeadly.org/cgi?action=article;sid=20190110064857 -[22]: https://www.cambus.net/netbsd-ctwm-and-spleen/ -[23]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H -[24]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm -[25]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB -[26]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 -[27]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 -[28]: https://github.com/jcs/msTERM -[29]: https://github.com/NiLuJe/FBInk -[30]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen -[31]: https://www.ansilove.org +[18]: https://packages.guix.gnu.org/packages/font-spleen/ +[19]: https://packages.gentoo.org/packages/media-fonts/spleen +[20]: https://pkgs.alpinelinux.org/packages?name=font-spleen +[21]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts +[22]: https://github.com/fcambus/bdf2sfd +[23]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ +[24]: https://undeadly.org/cgi?action=article;sid=20190110064857 +[25]: https://www.cambus.net/netbsd-ctwm-and-spleen/ +[26]: https://www.cambus.net/spleen-2.0.0-released-with-full-cp437-support/ +[27]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H +[28]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm +[29]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB +[30]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 +[31]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 +[32]: https://github.com/jcs/msTERM +[33]: https://github.com/NiLuJe/FBInk +[34]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen +[35]: https://www.ansilove.org diff --git a/contrib/spleen/spleen-12x24.bdf b/contrib/spleen/spleen-12x24.bdf index 24ae2e78f4b2..1c4fa12beb9a 100644 --- a/contrib/spleen/spleen-12x24.bdf +++ b/contrib/spleen/spleen-12x24.bdf @@ -1,11 +1,11 @@ STARTFONT 2.1 COMMENT /* -COMMENT * Spleen 12x24 2.0.0 -COMMENT * Copyright (c) 2018-2023, Frederic Cambus +COMMENT * Spleen 12x24 2.1.0 +COMMENT * Copyright (c) 2018-2024, Frederic Cambus COMMENT * https://www.cambus.net/ COMMENT * COMMENT * Created: 2018-08-15 -COMMENT * Last Updated: 2023-04-28 +COMMENT * Last Updated: 2024-03-22 COMMENT * COMMENT * Spleen is released under the BSD 2-Clause license. COMMENT * See LICENSE file for details. @@ -18,7 +18,7 @@ FONTBOUNDINGBOX 12 24 0 -5 STARTPROPERTIES 20 FAMILY_NAME "Spleen" WEIGHT_NAME "Medium" -FONT_VERSION "2.0.0" +FONT_VERSION "2.1.0" FOUNDRY "misc" SLANT "R" SETWIDTH_NAME "Normal" @@ -33,11 +33,11 @@ CHARSET_ENCODING "1" MIN_SPACE 12 FONT_ASCENT 19 FONT_DESCENT 5 -COPYRIGHT "Copyright (c) 2018-2023, Frederic Cambus" +COPYRIGHT "Copyright (c) 2018-2024, Frederic Cambus" DEFAULT_CHAR 32 _GBDFED_INFO "Edited with gbdfed 1.6." ENDPROPERTIES -CHARS 840 +CHARS 916 STARTCHAR SPACE ENCODING 32 SWIDTH 500 0 @@ -11880,6 +11880,2362 @@ BITMAP 0000 0000 ENDCHAR +STARTCHAR COMBINING BREVE +ENCODING 774 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +1980 +1980 +0F00 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR COMBINING DIAERESIS +ENCODING 776 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +30C0 +30C0 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER IO +ENCODING 1025 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +30C0 +30C0 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +7F80 +6000 +6000 +6000 +6000 +6000 +3000 +1FE0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +ENCODING 1030 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +3FC0 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +3FC0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER YI +ENCODING 1031 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +30C0 +30C0 +0000 +3FC0 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +3FC0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER SHORT U +ENCODING 1038 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +1980 +1980 +0F00 +0000 +6060 +6060 +6060 +6060 +6060 +6060 +3060 +1FE0 +0060 +0060 +0060 +0060 +0060 +00E0 +7FC0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER A +ENCODING 1040 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1F80 +30C0 +6060 +6060 +6060 +6060 +6060 +7FE0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER BE +ENCODING 1041 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +6000 +6000 +6000 +6000 +6000 +6000 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER VE +ENCODING 1042 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER GHE +ENCODING 1043 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER DE +ENCODING 1044 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +0FC0 +18C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +3FC0 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER IE +ENCODING 1045 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +7F80 +6000 +6000 +6000 +6000 +6000 +3000 +1FE0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ZHE +ENCODING 1046 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6660 +6660 +6660 +6660 +6660 +6660 +36C0 +1F80 +36C0 +6660 +6660 +6660 +6660 +6660 +6660 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ZE +ENCODING 1047 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +00C0 +0060 +0060 +0060 +00C0 +1F80 +00C0 +0060 +0060 +0060 +0060 +0060 +00C0 +7F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER I +ENCODING 1048 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +60E0 +60E0 +61E0 +61E0 +6360 +6360 +6660 +6660 +6C60 +6C60 +7860 +7860 +7060 +7060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER SHORT I +ENCODING 1049 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +1980 +1980 +0F00 +0000 +6060 +60E0 +60E0 +61E0 +61E0 +6360 +6360 +6660 +6660 +6C60 +6C60 +7860 +7860 +7060 +7060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER KA +ENCODING 1050 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +6060 +6060 +6060 +6060 +60C0 +6180 +7F00 +6180 +60C0 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER EL +ENCODING 1051 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER EM +ENCODING 1052 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +70E0 +79E0 +6F60 +6660 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER EN +ENCODING 1053 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +7FE0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER O +ENCODING 1054 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1F80 +30C0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +30C0 +1F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER PE +ENCODING 1055 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7FE0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ER +ENCODING 1056 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ES +ENCODING 1057 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +3000 +1FE0 +0000 +0000 +0000 +0000 *** 88287 LINES SKIPPED *** From nobody Fri Jan 24 22:33: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 4YfszX58dBz5lVnv; Fri, 24 Jan 2025 22:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfszX3yHwz3rYt; Fri, 24 Jan 2025 22:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VhxSNBBcca2fpUbFTGPehWTe4kl29Qz38xLDVCYiExQ=; b=BLzewX7FE+Dr0vyp3yv4ObShGsx9IyCkiu8uIfGXG8jaa51mCENnADBC7Otp8kHl1ZLBtr JaQGrXFdCaVnxZ7wPrV30lqDc6w7Tvqh/cSSWXUrwGXv1AP5MNP/wH8grzYID21+S+1EK4 IMITKrDm7GgVT1fndz3omIWBcLdcYbzzfM9Lgqapo2B5TRNNIlZIDmyNr3sVVwC0dGD+wj 9tXP+jN5EfTWEPvdCBm0q/UlmR9WhcbjD+15zPILzScxD9P7J6RMd7Qi2CBlW8fw2SRx+F 7FsACJ1xxebTpZ8RJwv3+DSLUP6DQXLhYi/e4Sn6P6bdXIeU05AJt0oRijdSEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VhxSNBBcca2fpUbFTGPehWTe4kl29Qz38xLDVCYiExQ=; b=wZRuRN1D3mhs1JzgD+K6Li1rpzyp9xHCkvlmUw9kRN5fhxT40D02aX4O8F3xIhubAyz0VT bBk8ddAUk3fDwWuOeeF9pUKz0HPPqsgm2o+QKeC7hloHyW5uSl4FOwVPr6dFFAKlCiru7R hXgAC6pQ/byHT9+cycr5fAk5vPQfXSvzRIPPXZqmR6HryBvwqddO1hm5UZ9twiVTUS7eWN jXJxt50gn0E3ySpZ2jylQbOoCGxr9VThvFDE2M4xLKGA/Y77LWFfkXLLvoYYVC3vptRSJX 7pOfKaJO8Sqwj2Bvz2hMDc4djITrOJuzPUsfLW773d/a46iktFfLK+4AYbdiGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737758024; a=rsa-sha256; cv=none; b=Odbo3mmDEcgjIsw42zk1qXVNlpKBtnvHd18qx5AA/8/dSe1+ca87+17xQUZoTpa8Mea+LL PqTJqOZ5+sfh3oBcr5RWZrbLlmyAIQRc3ezim2OZAO5INWyyeYj7Qas/Wr1W5Ve73ylLDq zn76CY/100Ui0yCcLfF6BK2o41YcqYwhG/KPImHfupoBzDSg8QBhRJvKCfDPxkhTb8WcsC QFazjwStzNVRz9IsFA4QKF15t9DVVoOOvYuiJclgRMgyRJQcIrhJQ7YNX/2b8C4RuG/chK i/8Q1SLYbt8lQkAEaoQ4+DxYPemkKsG1Op4nI6gB1/eU0k6bgnsEY/6+61+/Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfszX3Pv0zl7w; Fri, 24 Jan 2025 22:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OMXibd007074; Fri, 24 Jan 2025 22:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OMXiPc007071; Fri, 24 Jan 2025 22:33:44 GMT (envelope-from git) Date: Fri, 24 Jan 2025 22:33:44 GMT Message-Id: <202501242233.50OMXiPc007071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6a0afbcbf6a0 - stable/14 - cam: Add 3e/3 as a fatal 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a0afbcbf6a0aec6392ee9357428ac5b140bbdc1 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a0afbcbf6a0aec6392ee9357428ac5b140bbdc1 commit 6a0afbcbf6a0aec6392ee9357428ac5b140bbdc1 Author: Warner Losh AuthorDate: 2025-01-17 21:06:32 +0000 Commit: Warner Losh CommitDate: 2025-01-24 22:34:19 +0000 cam: Add 3e/3 as a fatal code We see this error: (da4:mps0:0:3:0): SCSI sense: HARDWARE FAILURE asc:3e,3 (Logical unit failed self-test) for drives that have failed. Our vendor tells us there's no recovery from that state, though we can still grab logs from the drives and run their diagnostics. Drives in this state need to bascially be remanufactured because some part of them has failed. The prior default behavior is to retry, and retrying takes a long time to work out. Instead, short-circuit the retries and fail right away. I selected ENXIO because no I/O to LBAs is possible for drives in this state (both my experience and per vendor). Some googling suggests that other vendors behave identically, but it was inconclusive. Should this be too pessimistic, we can adjust in the future. Also, this is with some aging drives in our fleet, and if we have more than one drive in this state, our systems take so long to get to mountroot that the watchdog fires sometimes. Adding this patch makes them boot reliably again. MFC After: 1 week Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D48505 (cherry picked from commit a8b49e7c66292852339481536f039719e7914200) --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 0e42403d74a6..20c1e961bf63 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2309,7 +2309,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x3E, 0x02, SS_RDEF, "Timeout on logical unit") }, /* DTLPWROMAEBKVF */ - { SST(0x3E, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x3E, 0x03, SS_FATAL | ENXIO, "Logical unit failed self-test") }, /* DTLPWROMAEBKVF */ { SST(0x3E, 0x04, SS_RDEF, /* XXX TBD */ From nobody Fri Jan 24 22:34: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 4Yft050W2pz5lW7d; Fri, 24 Jan 2025 22:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yft046zQHz3rm2; Fri, 24 Jan 2025 22:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QN48Ah3/uhJZ/dSE4An+NudGtJ4JY78et5LJ5uKnoYU=; b=VLTUjH5HnMMX499fxK1CWe2/D9sFq0rpV2y4MTcOdPTUgPYcu02xkoYaAlWvUA0+p9zp+7 Z1nROHqqWKqRvraXwDhbTxC4SlljS9oYzbZcnKHmW1lihWONZPpfvDIPs+pYXe2NVgTGqG Gkx3Lpz8NARukT2cBCIUK5vxV/qy51S0pqwcpEKlT5DWLBpKcqc/0uFw5aRWP0MzpN6KVL wXJmS3O13Cy/dat9TM+Uo3com0Ha+Lk+a92v0V6ErSVPzXW3GwjAu8UX0td1qu18XUW8oA +TBrtleSpGObI+6+1TD7CX0+6p/kf7jM0KDOCRMNNMZ0ZhVL8OKsRx20nIiCWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QN48Ah3/uhJZ/dSE4An+NudGtJ4JY78et5LJ5uKnoYU=; b=BuKSUnehsOZ5SG97BA6nDkA/5NpOll4aQAVeocMP6NzwXhvt0H0ZLPo2QqtKOLvD+hyrcT UBcMEY8tqSSz+I1z0ub1BJ7GQ3cK3QsSfsrOCxA3Inf1QRBfauV8CD4jroTUKxoDAk95pY al27zKa98oknRFkBC7nlJzZceV7wVroJT5RTtMELoHOfy8UTprRIAHJzeCF6HcuTsdjVP9 ET2dE3n9++jF2q4KnveaZFxTtrBB5j/RyH1Qfb4vBi/1XzxiB14DJRlUDlqVbYFGgpkWqY 6R6yhyH+yvUyjiBNQu7/kvGLthIM8DOj2eqetj6UzxD0Pf+Cr9VhpYIBLAXBPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737758053; a=rsa-sha256; cv=none; b=XMm3AvgYLB+VKV43oz9eBRKd6iMOtPj0J4PY+oqsr1tKGoxmYuoAcgjW2G2bkwcGwAsURi 4yx5eRLG+Vx4cmhc11F0GGosFv2+e1lnztdDtHpfMhuUdToka0AaJXQjaFdE3bXYhep7oZ 9P6tHwGLXAwQdOb3Gi/tYNQp63iQO543wHn/hV4S2czV/nkAyCZkGOySsxrc256Muiqwjw iOOs29cTbsd//ItfzI7Ftrnf2b5AnjfaseXYSRymaUuQqOem37/bQMsfk52+Hpeyh5Ewkh Eyk1QmybQ7GR7+RUMYncQXujjnPwYg6vrBv6VoI+7e1TyJxEBHIQzNj+AfiPMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yft046LD0zlhr; Fri, 24 Jan 2025 22:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OMYC2c007349; Fri, 24 Jan 2025 22:34:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OMYCRQ007346; Fri, 24 Jan 2025 22:34:12 GMT (envelope-from git) Date: Fri, 24 Jan 2025 22:34:12 GMT Message-Id: <202501242234.50OMYCRQ007346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 98983f3c9dec - stable/13 - cam: Add 3e/3 as a fatal 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 98983f3c9dec93285609c6ec5a615d6159b4ab65 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=98983f3c9dec93285609c6ec5a615d6159b4ab65 commit 98983f3c9dec93285609c6ec5a615d6159b4ab65 Author: Warner Losh AuthorDate: 2025-01-17 21:06:32 +0000 Commit: Warner Losh CommitDate: 2025-01-24 22:34:47 +0000 cam: Add 3e/3 as a fatal code We see this error: (da4:mps0:0:3:0): SCSI sense: HARDWARE FAILURE asc:3e,3 (Logical unit failed self-test) for drives that have failed. Our vendor tells us there's no recovery from that state, though we can still grab logs from the drives and run their diagnostics. Drives in this state need to bascially be remanufactured because some part of them has failed. The prior default behavior is to retry, and retrying takes a long time to work out. Instead, short-circuit the retries and fail right away. I selected ENXIO because no I/O to LBAs is possible for drives in this state (both my experience and per vendor). Some googling suggests that other vendors behave identically, but it was inconclusive. Should this be too pessimistic, we can adjust in the future. Also, this is with some aging drives in our fleet, and if we have more than one drive in this state, our systems take so long to get to mountroot that the watchdog fires sometimes. Adding this patch makes them boot reliably again. MFC After: 1 week Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D48505 (cherry picked from commit a8b49e7c66292852339481536f039719e7914200) --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 3c5e509c99ad..0593dd627fda 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2249,7 +2249,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x3E, 0x02, SS_RDEF, "Timeout on logical unit") }, /* DTLPWROMAEBKVF */ - { SST(0x3E, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x3E, 0x03, SS_FATAL | ENXIO, "Logical unit failed self-test") }, /* DTLPWROMAEBKVF */ { SST(0x3E, 0x04, SS_RDEF, /* XXX TBD */ From nobody Sat Jan 25 12:00: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 4YgCst0FKfz5lDNp; Sat, 25 Jan 2025 12:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgCss59JQz3mr1; Sat, 25 Jan 2025 12:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737806401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD0jZNuDjp2Q2EsTmMQNxF5TnsnoF/A6xaw5ZkdplJM=; b=Q3+1BomkSZaytpyCUNtHg1dVPUIVjs4DNCn8xX7b8RFtLENK0ouSErjVBhQ5FrPsVimcHV zigD6g9CIkZJf/JxozWdOFAEo7hPF/D8qLT9QNtKXdXZfQDBouH6Swff+MRSDbQGxaSjQR KNJ4bYL1X/POx8GoMUwsYdW2x4VZYt+65lxosZLJSwowyCk3BeQ6pdDHwDxLmzvcyoCmmX 9EEc+db4JzKzku0zgANHhF8ogkyHrBnGex93Z3sGMAA06xE+RHrWgCTY3UnIxWTjQO7k8I j0yP8qV9kWonr/sbWkVFOMXuURpaEZ8PJIgw7pbbncXR7R0YuePQKKaFFtQXBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737806401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD0jZNuDjp2Q2EsTmMQNxF5TnsnoF/A6xaw5ZkdplJM=; b=QHAMqdEiB8CRHRBHZw3B/xz7jmi/STgJUz6Oxhffcp4x1Ko+k2OQoqvWRrIR3GCBxEOvGD BnTKazjNc9k5Zbtx2Q6nEmKuba9VMbC49gYhdTRgc5cC8WRtVmBJjK73e67M/vgtG8O+qa TxmDLtjLmN7T1hPLIaAbGUkwqZvCX1fphvPrFSUne1t3Den2pZ7Ysg0M04iolD8ZVlTAlK Q5+k2LOkLaHNC9AhxYDlYSgi6WldTJLOJXiVK3KCMKaHw04Y2O6+UCoY5EY7CWX0e19bFb cB1daiNZMHaXhUVRlP4K7cam47U6HD8MovcZ61atGIR2x74+RS6/svl3kOZ3hQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737806401; a=rsa-sha256; cv=none; b=Zi0p1YVLMQBXvWdUGDW+9DVWdMfHHPgJL+PoSLFqkPrZIiN4mOZI/YV1+IJqmJ+DBzC3RY H/HrMBKl5/CCDarzHjdRcDmfDdLbqZggbqLPt20Dns3dW0T68Xfb1d1XeMvHe2DNsg4+LP MF4iZkmQxu89s+zzPHTZbE1XWnBRvd/XTegANpZXb3pkYQJc9t0M72Q77QMRHFMikKs7/v CQn9j6PBFk0CVgIRXf/D/6OB0gHLY0sAjIUUAz314Bl/KQf8zAc1jSo205qLqS02MteL82 YdVTLx1geF1EZp3f6hcNtXQ5JJ2+bZrETGXnjHb0XHA5zEJHEC4T8LgegT1hbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgCss4dGFz19jx; Sat, 25 Jan 2025 12:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PC01an013065; Sat, 25 Jan 2025 12:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PC01oR013057; Sat, 25 Jan 2025 12:00:01 GMT (envelope-from git) Date: Sat, 25 Jan 2025 12:00:01 GMT Message-Id: <202501251200.50PC01oR013057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 47560d54be59 - stable/13 - sysctl: Fix usage() and SYNOPSIS section of man 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 47560d54be59f89e1768e7b4d81f5c599a9c59ef Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=47560d54be59f89e1768e7b4d81f5c599a9c59ef commit 47560d54be59f89e1768e7b4d81f5c599a9c59ef Author: Zhenlei Huang AuthorDate: 2025-01-23 07:24:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-25 11:56:41 +0000 sysctl: Fix usage() and SYNOPSIS section of man page I forgot to update the usage() and SYNOPSIS section of man page when adding the two options -J and -V. While here, fix the options sort order in SYNOPSIS section. Fixes: 5ec83c660aca sysctl: Add flags to filter jail prison and vnet variables MFC after: 1 day (cherry picked from commit 0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3) (cherry picked from commit 1d890d546b064f2c7753b949f5dbf00d79cde292) --- sbin/sysctl/sysctl.8 | 6 +++--- sbin/sysctl/sysctl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index ff0a8cea266d..a7af56720361 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd October 29, 2024 +.Dd January 23, 2025 .Dt SYSCTL 8 .Os .Sh NAME @@ -35,13 +35,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehiNnoTtqWx +.Op Fl bdehiJNnoqTtVWx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value Ns Op , Ns Ar value .Ar ... .Nm -.Op Fl bdehNnoTtqWx +.Op Fl bdehJNnoqTtVWx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 0fe6c92dc386..887de78d269b 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -122,8 +122,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdehNnoqTtWx] [ -B ] -a"); + "usage: sysctl [-bdehiJNnoqTtVWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdehJNnoqTtVWx] [ -B ] -a"); exit(1); } From nobody Sat Jan 25 19:46: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 4YgQDg3tVpz5lqGB; Sat, 25 Jan 2025 19:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgQDg2pf8z3VB7; Sat, 25 Jan 2025 19:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737834419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHWsm3KrDMGos0Xf85z5Z130f/rC3mM2D0z0o1WQqeY=; b=W7wrR8atA3sNm9YKvWUfG2lJDzp7pipmfJ864sZOSndHlA7sD4jT3uK1Fe69TdpXtWjhCN 4kMHdzFkuAdT4vBvoKjoZYN6IeWFGF+QMvOHiytJZ78Hq+p89k1nhoELDfv50NddkLk4Cp st1IUN3q5Jw3leeM1mN9UcNiqm/RCw7mEVKOas0SmsmXB/x6fM4kMdbf7479IfJz29GBvb AQFHnrVnmiBmHHRBpfQXMVQDqorbQqX2DNfUHHBq9NJHNlLMxZrz6yY8eUESQRGXuIgN1l VOktjBzRyzmqtY6uZNr/kftpggi4mG9gU3SrWqz6rrB5fqaqSskh/ySHj9PBtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737834419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHWsm3KrDMGos0Xf85z5Z130f/rC3mM2D0z0o1WQqeY=; b=H6tTh7eEop3VO8IFTl3uHsFxuqNxVXz+yc3u/4trwxH4Pa7OJn4swJlgC5dexGk7d1tihK CH1/zS0HnZ2frLpOBRYbW8w19ixptrpTKO2ZOjkXgZEeJz0PMX0+4kSA9h3pV+Rw4K4I1u VkIxMXExz13Uco9PIBIx6+Fu26Wo0AfHQhJo1h1+YZP/+f0d+8QC66x+VCILG3C/D5py0n PdXKVAuPSBpxCQrO0JXNTaIuuOHm8QwXdbeO1t+59ADfJps2yCeSAv+d3BD9GnJWFaQfTj rLcWltsJHBdhhMbPtdDrWS3gOONcp2yRpy8tJVX25HjsUSTYmdROv8UFwUHzzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737834419; a=rsa-sha256; cv=none; b=n4lE5gVncLWv9ptBDBHKFbXwK5Jy52n83Bp0spWh8Eo+DVsSTqkkm5K7tHZeI8zds0VoVz 9pjOtUjwAmVeTMMRRtlQoBD0CyjS2rF+KReVkTppDFeD4kTlwpj5Q38yUr5vhs4GtDetCK rb/FAfoAZBbBkOcAP68mJ0Y1S6LIejAaV9FaNGCSvygHE6pzM8uGYBYCOgrF9vlFL17MUV JwhMgBhoXkYWMRmU9PAIu+YfcTHamz+OMLTAyO2IjMNBll96AmII3ngDTO4xxzhcAC8vb9 VcS8cCMYzFdXvUJ+Qfa1XPInOPT8t/LoWPOuJFceFpuPw2/aXZgZSM3sF+cJAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgQDg2M9Kz1PbT; Sat, 25 Jan 2025 19:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PJkxIL088454; Sat, 25 Jan 2025 19:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PJkxpK088450; Sat, 25 Jan 2025 19:46:59 GMT (envelope-from git) Date: Sat, 25 Jan 2025 19:46:59 GMT Message-Id: <202501251946.50PJkxpK088450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Igor Ostapenko Subject: git: b40ca26721d7 - stable/14 - kyua: Support is_exclusive metadata coming from an ATF test 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: igoro X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b40ca26721d70c76a4a4953ebe90b27daf0b3d58 Auto-Submitted: auto-generated The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=b40ca26721d70c76a4a4953ebe90b27daf0b3d58 commit b40ca26721d70c76a4a4953ebe90b27daf0b3d58 Author: Igor Ostapenko AuthorDate: 2024-12-24 08:36:33 +0000 Commit: Igor Ostapenko CommitDate: 2025-01-25 19:42:59 +0000 kyua: Support is_exclusive metadata coming from an ATF test case On ATF side it is named "is.exclusive". Reviewed by: ngie, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47671 (cherry picked from commit 2ed24e28d1d95c62cc37ca3534d4d33360b4cef2) --- contrib/kyua/engine/atf_list.cpp | 2 ++ contrib/kyua/engine/atf_list_test.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/contrib/kyua/engine/atf_list.cpp b/contrib/kyua/engine/atf_list.cpp index c9c2fed70175..c4f348ada2f6 100644 --- a/contrib/kyua/engine/atf_list.cpp +++ b/contrib/kyua/engine/atf_list.cpp @@ -125,6 +125,8 @@ engine::parse_atf_metadata(const model::properties_map& props) mdbuilder.set_string("execenv", value); } else if (name == "execenv.jail.params") { mdbuilder.set_string("execenv_jail_params", value); + } else if (name == "is.exclusive") { + mdbuilder.set_string("is_exclusive", value); } else if (name == "require.config") { mdbuilder.set_string("required_configs", value); } else if (name == "require.files") { diff --git a/contrib/kyua/engine/atf_list_test.cpp b/contrib/kyua/engine/atf_list_test.cpp index 7f19ca8fbec5..7648ee2c6a80 100644 --- a/contrib/kyua/engine/atf_list_test.cpp +++ b/contrib/kyua/engine/atf_list_test.cpp @@ -64,6 +64,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) model::properties_map properties; properties["descr"] = "Some text"; properties["has.cleanup"] = "true"; + properties["is.exclusive"] = "true"; properties["require.arch"] = "i386 x86_64"; properties["require.config"] = "var1 var2 var3"; properties["require.files"] = "/file1 /dir/file2"; @@ -93,6 +94,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) .add_required_program(fs::path("svn")) .set_description("Some text") .set_has_cleanup(true) + .set_is_exclusive(true) .set_required_memory(units::bytes::parse("1m")) .set_required_user("root") .set_timeout(datetime::delta(123, 0)) @@ -261,6 +263,36 @@ ATF_TEST_CASE_BODY(parse_atf_list__many_test_cases) } +ATF_TEST_CASE_WITHOUT_HEAD(parse_atf_list__is_exclusive_support); +ATF_TEST_CASE_BODY(parse_atf_list__is_exclusive_support) +{ + const std::string text = + "Content-Type: application/X-atf-tp; version=\"1\"\n" + "\n" + "ident: first\n" + "is.exclusive: false\n" + "descr: This is the descr\n" + "\n" + "ident: second\n" + "is.exclusive: true\n" + "\n" + "ident: third\n"; + std::istringstream input(text); + const model::test_cases_map tests = engine::parse_atf_list(input); + + const model::test_cases_map exp_tests = model::test_cases_map_builder() + .add("first", model::metadata_builder() + .set_description("This is the descr") + .build()) + .add("second", model::metadata_builder() + .set_is_exclusive(true) + .build()) + .add("third") + .build(); + ATF_REQUIRE_EQ(exp_tests, tests); +} + + ATF_INIT_TEST_CASES(tcs) { ATF_ADD_TEST_CASE(tcs, parse_atf_metadata__defaults); @@ -275,4 +307,5 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_syntax); ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_properties); ATF_ADD_TEST_CASE(tcs, parse_atf_list__many_test_cases); + ATF_ADD_TEST_CASE(tcs, parse_atf_list__is_exclusive_support); } From nobody Sat Jan 25 21:11: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 4YgS5c4cW1z5lwL9; Sat, 25 Jan 2025 21:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgS5c3vX8z3gWy; Sat, 25 Jan 2025 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737839460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gu3xC3TRWOavB3iEUoUPbUKjAhxNsialJ+zFf0Cqd8k=; b=jidrPyXV08e9P/eTwylSjeySIDbGPUFd45Th2tNew49Edv+cc7kz0WwLDLYswsrTJlRBxA NKw5lVNdkS8uZ4zHPUbNtINhoaQwTp3PED8zxoDDfcHJ5SH8FTlNHhoZsayHqT5OMFwqxo r2sakmoKTBUCde6/djFr15rXwFWOnRncmUvsbSHXE0qNAXLlHk7VyyKf1bh/SnyD/r/Jzg eiQTE0FooG4Yt0spn9ZsRqxahZYkyhL+fbcRWmpN6MqtGxVOYLy0yMNSVhmPbMnv4O5W7P osXHrzU8d6i2Q6oel6Z4Wmfl4JniYJKe43CYlKqsArsF0z1FKqHxkgEltuSjyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737839460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gu3xC3TRWOavB3iEUoUPbUKjAhxNsialJ+zFf0Cqd8k=; b=GSR2hENorBTys4FA4iTYSzTOuRJVMjSxLQ8WEU2PXMi3TM0rWiTMm9h9az9UwTWxMOkQu0 DIPKRTBP9PqPRacyEicgx3weYnKQR2t/i9VHaxtxavoipUVhA3hLKqeIH6nSgyqO8wRilH 9RjLIPSXzJXEa049JQ3KapAWTjFa76XDmpsGgT+B7/9TeYs8o9ZoY715eSqULzBQoaPnq4 W3KbTV3LkdfIQ7SIvPO6d9/NeB8n5Y743CaRNE8AyU817AywJDHTqpXJW4wjfxw/mGZl1E 71l969as0A0x4QHsWu290YXajVka4CG/Xz4hUzkUYCndAuTcpym7+BjGIsSZ5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737839460; a=rsa-sha256; cv=none; b=K3YzmThpLZmJ1XpwYWpP7+YJv7V2HEIBey1w50nXmAWqyKOyklPmNF0Eh1vzwCZtVG/41d u9vxIjrCEYhb0MFU5GRTQMf/KqxofMSai3hDd0GOIpdSJxDOW5ONtZwmBYJTef0+ncssoX 5zEdSJOpe1gtnodv30iP0Mn16AaYO+x1dMpSat7mQIvCJcQ7/HL3Gz9v81Tl8/lp1lfRQ4 mjEOXTK4cX19LIi1Aw/zusn7akfLu6CwoZdwjikdT+0OqNftawzK307JGUUrDJMdKlr8p6 Brnu3uqtJimMzV7PSQonBC3o00wPVAX4jLs7pQZ1O8oC3L14j0/gdB9mpzjcpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgS5c3Vhbz1RSl; Sat, 25 Jan 2025 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PLB05n048125; Sat, 25 Jan 2025 21:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PLB0Ih048122; Sat, 25 Jan 2025 21:11:00 GMT (envelope-from git) Date: Sat, 25 Jan 2025 21:11:00 GMT Message-Id: <202501252111.50PLB0Ih048122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 6a356edd4fc3 - stable/13 - Fix backward compatibility with UFS1 filesystems created before June 2002 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a356edd4fc3c8d7959fcc6a2447c7193d830392 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=6a356edd4fc3c8d7959fcc6a2447c7193d830392 commit 6a356edd4fc3c8d7959fcc6a2447c7193d830392 Author: Kirk McKusick AuthorDate: 2025-01-16 18:43:48 +0000 Commit: Kirk McKusick CommitDate: 2025-01-25 21:10:20 +0000 Fix backward compatibility with UFS1 filesystems created before June 2002 See the Pahabricator review for more details. Reviewed-by: kib Tested-by: Peter Holm Differential-Revision: https://reviews.freebsd.org/D48472 (cherry picked from commit 661ca921e8cd56b17fc6615bc7e596e56e0e7c31) --- sbin/growfs/debug.c | 2 - sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_snapshot.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 +- sys/ufs/ffs/ffs_subr.c | 81 +++++++++++++++++++++++++++++++++++++- sys/ufs/ffs/ffs_vfsops.c | 96 +--------------------------------------------- sys/ufs/ffs/fs.h | 5 ++- 7 files changed, 88 insertions(+), 104 deletions(-) diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index 456e67dbc5c2..ab4539d06a69 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -305,8 +305,6 @@ dbg_dump_fs(struct fs *sb, const char *comment) sb->fs_avgfilesize); fprintf(dbg_log, "avgfpdir int32_t 0x%08x\n", sb->fs_avgfpdir); - fprintf(dbg_log, "save_cgsize int32_t 0x%08x\n", - sb->fs_save_cgsize); fprintf(dbg_log, "flags int32_t 0x%08x\n", sb->fs_flags); fprintf(dbg_log, "contigsumsize int32_t 0x%08x\n", diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 89ef325b87e3..2e9b485d482b 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -84,7 +84,7 @@ int ffs_inotovp(struct mount *, ino_t, uint64_t, int, struct vnode **, int); int ffs_isblock(struct fs *, uint8_t *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, uint8_t *, ufs1_daddr_t); -void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +void ffs_oldfscompat_write(struct fs *); int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index bc4dbdf52e5b..6e2a8d66b54f 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -840,7 +840,7 @@ resumefs: copy_fs->fs_fmod = 0; bpfs = (struct fs *)&nbp->b_data[loc]; bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (uint64_t)fs->fs_sbsize); - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 62af80d7eb40..e14e333f70bb 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9932,7 +9932,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) if (pino == 0) { bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, @@ -9964,7 +9964,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) (int)fs->fs_sbsize, 0, 0, 0); bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index ca595ed5bd80..351559882ca2 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -130,6 +130,7 @@ ffs_update_dinode_ckhash(struct fs *fs, struct ufs2_dinode *dip) static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int, int (*)(void *, off_t, void **, int)); +static void ffs_oldfscompat_read(struct fs *, ufs2_daddr_t); static int validate_sblock(struct fs *, int); /* @@ -273,6 +274,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, if (fs->fs_magic == FS_UFS1_MAGIC && !isaltsblk && fs->fs_bsize == SBLOCK_UFS2 && sblockloc == SBLOCK_UFS2) return (ENOENT); + ffs_oldfscompat_read(fs, sblockloc); if ((error = validate_sblock(fs, isaltsblk)) > 0) return (error); /* @@ -317,6 +319,83 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, return (0); } +/* + * Sanity checks for loading old filesystem superblocks. + * See ffs_oldfscompat_write below for unwound actions. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +static void +ffs_oldfscompat_read(struct fs *fs, ufs2_daddr_t sblockloc) +{ + uint64_t maxfilesize; + + /* + * If not yet done, update fs_flags location and value of fs_sblockloc. + */ + if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { + fs->fs_flags = fs->fs_old_flags; + fs->fs_old_flags |= FS_FLAGS_UPDATED; + fs->fs_sblockloc = sblockloc; + } + /* + * If not yet done, update UFS1 superblock with new wider fields. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { + fs->fs_maxbsize = fs->fs_bsize; + fs->fs_time = fs->fs_old_time; + fs->fs_size = fs->fs_old_size; + fs->fs_dsize = fs->fs_old_dsize; + fs->fs_csaddr = fs->fs_old_csaddr; + fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; + fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; + fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; + fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; + } + if (fs->fs_magic == FS_UFS1_MAGIC && + fs->fs_old_inodefmt < FS_44INODEFMT) { + fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; + fs->fs_qbmask = ~fs->fs_bmask; + fs->fs_qfmask = ~fs->fs_fmask; + } + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_save_maxfilesize = fs->fs_maxfilesize; + maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; + if (fs->fs_maxfilesize > maxfilesize) + fs->fs_maxfilesize = maxfilesize; + } + /* Compatibility for old filesystems */ + if (fs->fs_avgfilesize <= 0) + fs->fs_avgfilesize = AVFILESIZ; + if (fs->fs_avgfpdir <= 0) + fs->fs_avgfpdir = AFPDIR; +} + +/* + * Unwinding superblock updates for old filesystems. + * See ffs_oldfscompat_read above for details. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +void +ffs_oldfscompat_write(struct fs *fs) +{ + + /* + * Copy back UFS2 updated fields that UFS1 inspects. + */ + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_old_time = fs->fs_time; + fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; + fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; + fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; + fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; + fs->fs_maxfilesize = fs->fs_save_maxfilesize; + } +} + /* * Verify the filesystem values. */ @@ -482,7 +561,7 @@ validate_sblock(struct fs *fs, int isaltsblk) sizepb *= NINDIR(fs); maxfilesize += sizepb; } - CHK(fs->fs_maxfilesize, !=, maxfilesize, %jd); + CHK(fs->fs_maxfilesize, >, maxfilesize, %jd); /* * These values have a tight interaction with each other that * makes it hard to tightly bound them. So we can only check diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index d97f5413c647..62d63210531a 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -85,8 +85,6 @@ static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; VFS_SMR_DECLARE; static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); -static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, - ufs2_daddr_t); static void ffs_ifree(struct ufsmount *ump, struct inode *ip); static int ffs_sync_lazy(struct mount *mp); static int ffs_use_bread(void *devfd, off_t loc, void **bufp, int size); @@ -823,7 +821,6 @@ ffs_reload(struct mount *mp, int flags) free(fs, M_UFSMNT); fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -1040,7 +1037,6 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); sx_init(&ump->um_checkpath_lock, "uchpth"); - ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; fs->fs_active = NULL; mp->mnt_data = ump; @@ -1251,96 +1247,6 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int size) return (0); } -static int bigcgs = 0; -SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, ""); - -/* - * Sanity checks for loading old filesystem superblocks. - * See ffs_oldfscompat_write below for unwound actions. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -static void -ffs_oldfscompat_read(struct fs *fs, - struct ufsmount *ump, - ufs2_daddr_t sblockloc) -{ - off_t maxfilesize; - - /* - * If not yet done, update fs_flags location and value of fs_sblockloc. - */ - if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { - fs->fs_flags = fs->fs_old_flags; - fs->fs_old_flags |= FS_FLAGS_UPDATED; - fs->fs_sblockloc = sblockloc; - } - /* - * If not yet done, update UFS1 superblock with new wider fields. - */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { - fs->fs_maxbsize = fs->fs_bsize; - fs->fs_time = fs->fs_old_time; - fs->fs_size = fs->fs_old_size; - fs->fs_dsize = fs->fs_old_dsize; - fs->fs_csaddr = fs->fs_old_csaddr; - fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; - fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; - fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; - fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; - } - if (fs->fs_magic == FS_UFS1_MAGIC && - fs->fs_old_inodefmt < FS_44INODEFMT) { - fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; - fs->fs_qbmask = ~fs->fs_bmask; - fs->fs_qfmask = ~fs->fs_fmask; - } - if (fs->fs_magic == FS_UFS1_MAGIC) { - ump->um_savedmaxfilesize = fs->fs_maxfilesize; - maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; - if (fs->fs_maxfilesize > maxfilesize) - fs->fs_maxfilesize = maxfilesize; - } - /* Compatibility for old filesystems */ - if (fs->fs_avgfilesize <= 0) - fs->fs_avgfilesize = AVFILESIZ; - if (fs->fs_avgfpdir <= 0) - fs->fs_avgfpdir = AFPDIR; - if (bigcgs) { - fs->fs_save_cgsize = fs->fs_cgsize; - fs->fs_cgsize = fs->fs_bsize; - } -} - -/* - * Unwinding superblock updates for old filesystems. - * See ffs_oldfscompat_read above for details. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -void -ffs_oldfscompat_write(struct fs *fs, struct ufsmount *ump) -{ - - /* - * Copy back UFS2 updated fields that UFS1 inspects. - */ - if (fs->fs_magic == FS_UFS1_MAGIC) { - fs->fs_old_time = fs->fs_time; - fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; - fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; - fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; - fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; - fs->fs_maxfilesize = ump->um_savedmaxfilesize; - } - if (bigcgs) { - fs->fs_cgsize = fs->fs_save_cgsize; - fs->fs_save_cgsize = 0; - } -} - /* * unmount system call */ @@ -2224,7 +2130,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size) UFS_UNLOCK(ump); fs = (struct fs *)bp->b_data; fs->fs_fmod = 0; - ffs_oldfscompat_write(fs, ump); + ffs_oldfscompat_write(fs); fs->fs_si = NULL; /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index cc89df9aca66..1c8890fa94ff 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -374,7 +374,8 @@ struct fs { int64_t fs_unrefs; /* number of unreferenced inodes */ int64_t fs_providersize; /* size of underlying GEOM provider */ int64_t fs_metaspace; /* size of area reserved for metadata */ - int64_t fs_sparecon64[13]; /* old rotation block list head */ + uint64_t fs_save_maxfilesize; /* save old UFS1 maxfilesize */ + int64_t fs_sparecon64[12]; /* old rotation block list head */ int64_t fs_sblockactualloc; /* byte offset of this superblock */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ @@ -387,7 +388,7 @@ struct fs { uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ uint32_t fs_avgfilesize; /* expected average file size */ uint32_t fs_avgfpdir; /* expected # of files per directory */ - int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ + uint32_t fs_available_spare; /* old scratch space */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ int32_t fs_sparecon32[21]; /* reserved for future constants */