From nobody Mon Sep 2 04:29:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxwl60DTGz5Tqmy; Mon, 02 Sep 2024 04:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wxwl5523Cz4qqB; Mon, 2 Sep 2024 04:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725251377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ie+NyzVDTKVdpVQrV4oaK7v21bikuqwxY9utdUShqok=; b=Z6ix2KfvMfKKLj+ZEDGqVfDyN1NPzUEeuLEeLRkvTbxUxt9u59lYH1J2EZMUh9/TIRCEnB AF6m41GHHn5F+A8AXFlGSLI8PHUAxBVyroO0mGVeRLFB0e5BnH9qSdZmYSTNBtX4DbVHnv Q/aelp/2s6YUbCTQhYD3w5w+L/wZZYPDZly41isWCjw33J+sW0ykWw53idxb39gb3R0GGi 0ZP4MYeAKrZeoNSDbOr0Fm9XmgVHLPBqvauUDhH1VP4dqWKMAvxYmRYkt/7Q3Ln+n5rWk8 OyTfulxlH8CUCgEveR4ZQu6vsBsBh+sCRTxSRdO1tKDfR0d5d9Oz/ThrQXH4IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725251377; a=rsa-sha256; cv=none; b=wKjCidJBjN1D4Hg1DxBcezESyfuOi4ViI5A1jc2Ta28tu9SXQX0Jo6rK0I8Jy+9gbzYUhT bypCQGVnib1i2hKzGZMfQBQMdd0jYDNffwbeBTITCMzamz1no7+9kfxILbVB/YXGgPyIZo iE0LI/W1v3pDiUGamj72xmJqejGDD5wuYIHTddLEapYFhP9m/WRvLk5XHU9U3gmPd/GdBK L6IkaEi8S6tEDQKGaPC3mwFuUM7ZV8Ykq03WHtKhzWt2qQALjOh1koRHhzzRZpWjPkhcGh e3puEOhp/lU0Fe1/suXTOVZI3cvmZj4zZr3Jp9C+aRWV+FLhVqus8eVjVbT4Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725251377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ie+NyzVDTKVdpVQrV4oaK7v21bikuqwxY9utdUShqok=; b=Xnn5BY0fBG/mK9Dt3ftYRC2xJMtQWeCYcwwIyAkgeHYsetZ/pIkSSzPEaqEDr+FcMwv+6B ZpGbCzgVB4QKbVG+2X6t3ZfhlPpfjg+JOnUxqGCh0dlciVyXaQJjf3cG2vGpCknsrSRD4t SANaNAFMnzubzn9HdAbevrzC/T85iy3Typ5WD7fM3iExHQ4b/lJiDMft2E4dV1sYOu1zdL C5/rirQ4/IMCN0grdBtWbKGKf+jZSw31aKp3oSZ+rj3aToKHFx7wd+IQH5MdjhzxLFpbo8 hL39xx4yvKYL0s1hVC7bNOYo6P8464C1VBkKvT4OCZ8KL1iM0eYoiuB8guE/kw== 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 4Wxwl54dnSzxc8; Mon, 2 Sep 2024 04:29: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 4824TbqK056220; Mon, 2 Sep 2024 04:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4824TbKK056217; Mon, 2 Sep 2024 04:29:37 GMT (envelope-from git) Date: Mon, 2 Sep 2024 04:29:37 GMT Message-Id: <202409020429.4824TbKK056217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3e76d05231b0 - main - kernel: Add defination of .init_array and .fini_array for all other platforms List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e76d05231b0aa77d922bdbc9abf62d9747a91ab Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3e76d05231b0aa77d922bdbc9abf62d9747a91ab commit 3e76d05231b0aa77d922bdbc9abf62d9747a91ab Author: Zhenlei Huang AuthorDate: 2024-09-02 04:26:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 04:26:48 +0000 kernel: Add defination of .init_array and .fini_array for all other platforms Currently these sections are not used but defined only for amd64 and i386. Added them for all other platforms to keep all platforms in sync. There should be no functional change. This change is extracted from a bigger patch [1] of hselasky, with additional fix for the order of .fini_array section. 1. https://reviews.freebsd.org/D40467 Obtained from: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45214 --- sys/conf/ldscript.arm | 14 ++++++++++++++ sys/conf/ldscript.arm64 | 14 ++++++++++++++ sys/conf/ldscript.powerpc | 16 ++++++++++++++-- sys/conf/ldscript.powerpc64 | 15 ++++++++++++++- sys/conf/ldscript.powerpc64le | 15 ++++++++++++++- sys/conf/ldscript.powerpcspe | 16 ++++++++++++++-- sys/conf/ldscript.riscv | 14 ++++++++++++++ 7 files changed, 98 insertions(+), 6 deletions(-) diff --git a/sys/conf/ldscript.arm b/sys/conf/ldscript.arm index 0764c99f9042..e8d2db3f854b 100644 --- a/sys/conf/ldscript.arm +++ b/sys/conf/ldscript.arm @@ -83,6 +83,20 @@ SECTIONS } .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index 32af035105d0..0d50eef431cf 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -100,6 +100,20 @@ SECTIONS . = ALIGN(128); .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : diff --git a/sys/conf/ldscript.powerpc b/sys/conf/ldscript.powerpc index 0e11dd4459db..3a407a4dbf88 100644 --- a/sys/conf/ldscript.powerpc +++ b/sys/conf/ldscript.powerpc @@ -78,8 +78,20 @@ SECTIONS . = ALIGN(4096); .got : { *(.got) } .got.plt : { *(.got.plt) } - - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64 index 58a3dc69931b..a342a48b9daf 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -104,7 +104,20 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.powerpc64le b/sys/conf/ldscript.powerpc64le index a65b39b3d9eb..1d5f3efe64fd 100644 --- a/sys/conf/ldscript.powerpc64le +++ b/sys/conf/ldscript.powerpc64le @@ -104,7 +104,20 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.powerpcspe b/sys/conf/ldscript.powerpcspe index 66630aaabaae..fa82cbe8330f 100644 --- a/sys/conf/ldscript.powerpcspe +++ b/sys/conf/ldscript.powerpcspe @@ -79,8 +79,20 @@ SECTIONS . = ALIGN(4096); .got : { *(.got) } .got.plt : { *(.got.plt) } - - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.riscv b/sys/conf/ldscript.riscv index b964a8739b7c..c730b423ccc2 100644 --- a/sys/conf/ldscript.riscv +++ b/sys/conf/ldscript.riscv @@ -71,6 +71,20 @@ SECTIONS } .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : From nobody Mon Sep 2 04:46:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxx6J0ZLsz5MRRf; Mon, 02 Sep 2024 04:46: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 4Wxx6H5MNnz4sVN; Mon, 2 Sep 2024 04:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725252375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ox3bFwbAaDzKJojYQJmy9nHrPrDp9tb6ohNVTbkDQOs=; b=JBGV7jo1NpJLGQDV9bxI0tAXEXDRkgPfrjoNhfiSEcri4HMkiTXE9A1U5Eq4u/ieacA7oY bHuW6XrbUwFSyLlGXU9GpzN7X9OXQTVXlcuc5Rr8y7kk0RsgUpI2TMS2WzWIz9ZK4+MlS8 yrZpn0qx8wIqZ8N09zbVXMXPjqxQztMGH3eWprW8i6fwFxGFEkdZea+fy0QgipmSJQ6kPI JvgRWxmLbolwye3St1wqF+zLPWXQxmBgagGlKsQAqVfB82Mq4YDVMG9Hgle409foE/9HZ9 BK0lGdSzw8ywnP6LDdl3t+KLfXHxg8uxzpa1lyrMs5hSOVvV0e2BJOvkjkJBlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725252375; a=rsa-sha256; cv=none; b=IHOEqhLcD8JT/5Ak30r3IWOPIqgteBGy1AeZSx0u48LHXRN7LfHgQrL/KtcoaMDuFzq/Wi 3JdYxCEBgoYMCMewiHCWHdeIhjtlzK3NQEIKDjDS1Xk0uPtz5vuFWv53G8DIy7K+4A5Cy2 EN2KeG3yea+6ySq7nsUOjoDwTaOzINJjjYC2enSbZ83arzR5K4halp+leHpRb44otdotc2 NjEDOf19Hc0O6j32Q3836oCsM2bMZSBwvsCES9bH36JNU35Oj/xV6zlfjkQnNLclkSP60M MR3pHMZyE3FS6vztxMiVawbjQXCRjTuZlhl6N4zQ7RQ+j/OsY3tSs1VByFu4ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725252375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ox3bFwbAaDzKJojYQJmy9nHrPrDp9tb6ohNVTbkDQOs=; b=s+XWA6oX9iqsi41tjid94Y2rLNRzR69nLNLtXNvkBLRtD46MNTb+De1WZcGlhOeh147tsg niBJ6RMcXPG0RM/fT8D+MXncP1wzONMZJtj1rDMpcExvKl8qafxrzdfW/7P3X/yG7Qb2rW REwYKfE9CrajLoDt3UzDqe/eMyvoBOprWXFOCH7OHA6QuF3A/9akBW9JePqWPY3PbMHSPw LZEBne8ZISVgznD5DR21e13NnNY1oDdngwFdOOUA5KdwBHuaCEBifMRUDU0i6A9P00Ug+r D+eKyP/F1dOkPxNPVPb+aOOMIcjXCQuqweRajPikyK+FUS8YTNk94OqBIlRccg== 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 4Wxx6H4dKFzyZj; Mon, 2 Sep 2024 04:46: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 4824kFoC089731; Mon, 2 Sep 2024 04:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4824kFj3089728; Mon, 2 Sep 2024 04:46:15 GMT (envelope-from git) Date: Mon, 2 Sep 2024 04:46:15 GMT Message-Id: <202409020446.4824kFj3089728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 3e6d533dd174 - stable/14 - u3g: add SIERRA AC340U List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e6d533dd1746ba1809da965a1767bcbe59b3d56 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=3e6d533dd1746ba1809da965a1767bcbe59b3d56 commit 3e6d533dd1746ba1809da965a1767bcbe59b3d56 Author: Franco Fichtner AuthorDate: 2024-08-23 11:26:38 +0000 Commit: Xin LI CommitDate: 2024-09-02 04:46:02 +0000 u3g: add SIERRA AC340U Pull request: https://github.com/freebsd/freebsd-src/pull/1397 MFC after: 3 days (cherry picked from commit 4b6e76eff8b63d691c05772520849b6c94d535e8) --- sys/dev/usb/serial/u3g.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 88f94ddaecc6..28a403a846bd 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -568,6 +568,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(SIERRA, MC5728, 0), U3G_DEV(SIERRA, MC7354, 0), U3G_DEV(SIERRA, MC7355, 0), + U3G_DEV(SIERRA, AC340U, 0), U3G_DEV(SIERRA, MC7430, 0), U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 2a217b1eaf17..39bfd258502b 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4363,6 +4363,7 @@ product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 product SIERRA MC7354 0x68C0 MC7354 product SIERRA MC7355 0x9041 MC7355 +product SIERRA AC340U 0x9051 Sierra Wireless AirCard 340U product SIERRA MC7430 0x9071 Sierra Wireless MC7430 Qualcomm Snapdragon X7 LTE-A product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer From nobody Mon Sep 2 04:46:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxx721pT7z5MRC7; Mon, 02 Sep 2024 04:46: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 4Wxx721G8bz4scB; Mon, 2 Sep 2024 04:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725252414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NgkU8RuBY9W3rCKgCSbCRKFu5TJQTEpRG/OH8zxLs/0=; b=gCFUDOaRTkwOwegoO1k7Wl6tJzlFdhdDs4O2ukUkFLqWP59wYIezitmszNxityUwVZbHFY Emycr4D87tFhBOLpy1sgjt/KXSYhJcvJQXCbkUaOcCy/8wivOkvKCcEQ9O5IrFUaZPJVJ7 YxJdeF8SAECJPZDGMnYaMCH4XWLbhokBCUp83DXH1AySLntKkJHQnBczgDR7UtphrBI0lo bG4Sgj+7G9f8JWWU+ajPfgxcR9fiTQLgWlfV+TjcpZsg/5se5f83qkTCqbdeuO0oFZe4mt zNuv7gGNtuJzGLGKd8HgeulprQdvIGPLKyaglz++24Y7YKkDH5HLsS9W8bUgAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725252414; a=rsa-sha256; cv=none; b=D+C9eHyudvgDdjgV6Cc1AjxGqgMY/qU+bSNkgcKdWggikfvKyAnarGovOUydg7cCNtd3r6 8mFNUvwr+IqoUB3Xq+YpTamtwbla49aiDv6eNnUkalSx3FvITw5fhRiILyPc1njmH+AMBY YCy37RJAeUQlocQ2a79kqna66V063d6HDNek3x/y79ZpycfvzeWbiY869VLJB8CE/Q0W/0 LcGvL6UTgIHgio/h31Fd2IN5ylfaGDc7ezzpbMeoiEufpaIm/1B/aa6SlMjqWzgC7tcKeH Vmlz++ROyGFi0vUqx/X/GVyBhpqNVFU5upB0KfFw63MF/ztWtvXr9FJffIdxNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725252414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NgkU8RuBY9W3rCKgCSbCRKFu5TJQTEpRG/OH8zxLs/0=; b=XoQUjpDL7UKb4F37Rft+U1RBLFrvvTew40slzYEavzvxVUzTjB3yHSXgkgi8Jd5titLDDM A+Zsauo51C2M+XM1t5ZpfHP3wl9xO0jzDUeK+oEh/iPgJY7EnLfSQtd+4dPrIc/9xNOKQy W4jWvCEZmylWlDM3i3/ZB4YGBZdSbVsRva+6VvIqsqlP5Bnyu0fKb/okcV9JLTW3MsDEgA H2p/6ZqOAhIh+WF3cp1U6zwG5rj2nZjd1w+SdQwXUQxGrY/dsC7tJ5g4dlT79jr/JcO27r faDM4uwL3Y3CMh6NciTxzYHE/z072rxaXgenekSs6ScgegyOqpxbFV2VWNtdOA== 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 4Wxx720nZPzxm6; Mon, 2 Sep 2024 04:46: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 4824ksWK089958; Mon, 2 Sep 2024 04:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4824ksKG089955; Mon, 2 Sep 2024 04:46:54 GMT (envelope-from git) Date: Mon, 2 Sep 2024 04:46:54 GMT Message-Id: <202409020446.4824ksKG089955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: feb14552cc49 - stable/13 - u3g: add SIERRA AC340U List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: feb14552cc494ca893e059d308b3f1040dda32b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=feb14552cc494ca893e059d308b3f1040dda32b5 commit feb14552cc494ca893e059d308b3f1040dda32b5 Author: Franco Fichtner AuthorDate: 2024-08-23 11:26:38 +0000 Commit: Xin LI CommitDate: 2024-09-02 04:46:43 +0000 u3g: add SIERRA AC340U Pull request: https://github.com/freebsd/freebsd-src/pull/1397 (cherry picked from commit 4b6e76eff8b63d691c05772520849b6c94d535e8) --- sys/dev/usb/serial/u3g.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 986e243c60d3..4bfe0ee67a65 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -550,6 +550,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(SIERRA, MC5728, 0), U3G_DEV(SIERRA, MC7354, 0), U3G_DEV(SIERRA, MC7355, 0), + U3G_DEV(SIERRA, AC340U, 0), U3G_DEV(SIERRA, MC7430, 0), U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index a32a53d49735..0ce6092c423e 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4342,6 +4342,7 @@ product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 product SIERRA MC7354 0x68C0 MC7354 product SIERRA MC7355 0x9041 MC7355 +product SIERRA AC340U 0x9051 Sierra Wireless AirCard 340U product SIERRA MC7430 0x9071 Sierra Wireless MC7430 Qualcomm Snapdragon X7 LTE-A product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer From nobody Mon Sep 2 05:02:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxxT95FSqz5MSbn; Mon, 02 Sep 2024 05:02: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 4WxxT94MLcz4ttJ; Mon, 2 Sep 2024 05:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PkH5UxA7PpQe4abPLu7zwV1f2TFB3s1f/82kxBsqSbM=; b=BhrPL8RwViEKjqsM6/wJxa5TTRq8gvhqzDgEn+oi5PEOuuPtobINUBSBLflB1CTWscol9f p3pxFD+olqm8eNuONhpEGC6wH//ih09zuxNF/5ES8I20M1WPDf2im9njp2LK+Fq7qnKLul NUro/Y8Ng7GxNrrTTCYNWRg7k9om8EjZ8Mkt361toEsr5eWCJxEQmA4A2JdHsJisUfG48P 9BLyCZuoPJfl/HUa8CBh0X1wDZKcTF5sUTfH9EaTRvTBTLOlQq//+EU5ezuQohVb0umKzk FWCg2amCnkthXhccaC3pRLDq1ANMH4oIXRx33Qc2NqqBnno8IkMo1yC0TMQ9Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725253357; a=rsa-sha256; cv=none; b=BQ/k8VXtYz/p9eEVIx2N14qIciIS9JrfocDGiTfZNZuOhkQHFv6Gs3KLga0EQLbX1nv6J5 ehoUWL2F5/zTKTnG2VyzFYIlyxtEpaLy2gbe2jrKdblKAagGopEYq04KlKNxD0MpiBygDa 8YiDMgmRMjxXE7kxqiEMwMaDhdGlhk1PrPOY6YV8DxER4mjisblGvgLyQnMhDFSqucrf1t VNPBkfGcUsnLNMqAf6ZD8Qh246DovkCFaTbFungIwGJTLHwCUIQugGUFLeCa9efzZZjMM/ fxStdkKhdQyMi6smOGx9xOUfL02wsQDyNnU12dV8HVg76vyZ5HbjmOOOsgOWeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PkH5UxA7PpQe4abPLu7zwV1f2TFB3s1f/82kxBsqSbM=; b=MBMKAYWGbVfUhBLyM5TbYo3pbMC6gngNdnN7ghmxuRRRYc113ZWI3xJG33E9ZE4BmwGciA ftJw7YfCSxNWn15SDUa5RjoyT6uZiLsTgRoTExYJ1Nkpid3QWO0lWr2NTgg/3VQCR7FwDb jb8BOyVxGa4oz97yzGZz0WkMoypivwc5RvKXHDo4Lku2qyAI9Zs1q0/hWktfReh7b/Wxn4 1FTU6jEMeAHySUG98OmcAatjIUCj4mZrZhuvrsl2EIapzvEUthM8f7S3oiGrSTbsqDqCkC dv3S+Hlbuc5Xzh8SGuNQFRqH6f+u7wz/UKcWXGwKbnlqZHtn1smMw1urzfvJTg== 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 4WxxT93vjhzyyN; Mon, 2 Sep 2024 05:02: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 48252buB024118; Mon, 2 Sep 2024 05:02:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48252bkn024115; Mon, 2 Sep 2024 05:02:37 GMT (envelope-from git) Date: Mon, 2 Sep 2024 05:02:37 GMT Message-Id: <202409020502.48252bkn024115@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: b6728c3f0b47 - stable/14 - init_main: Sprinkle const qualifiers where appropriate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b6728c3f0b47408610373fc2744e98f3178ddf83 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b6728c3f0b47408610373fc2744e98f3178ddf83 commit b6728c3f0b47408610373fc2744e98f3178ddf83 Author: Zhenlei Huang AuthorDate: 2024-08-21 10:01:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 05:01:39 +0000 init_main: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week (cherry picked from commit 7412517f2947342d599e42dd563fd6b3a7656e29) --- sys/kern/init_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 8d650c7ea084..917c3ea07baf 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -349,13 +349,13 @@ mi_startup(void) } static void -print_caddr_t(void *data) +print_caddr_t(const void *data) { - printf("%s", (char *)data); + printf("%s", (const char *)data); } static void -print_version(void *data __unused) +print_version(const void *data __unused) { int len; From nobody Mon Sep 2 05:02:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxxTB62l4z5MSW7; Mon, 02 Sep 2024 05:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxxTB5b59z4tlf; Mon, 2 Sep 2024 05:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UdiAlk663sAyqyMYx4UP29QD7VACuBKH9HclWExmheA=; b=X50ehUTcenT/5XappHL+BwU++PzvjgGQ1S1atLkS2SzSQmVSTrkNslvPTv/mQIPqrFygrw 29E23H6klkrr7OUGfwkVd6s572coFeBzsbH0/mEqjem4fUSfwdht21CQALXmn5/HejShfR rI+Fcd6KwgihfztCd0xPI4+Qk3FU1Vwy4bHesO3XWuYo4jWvGC+d1au0vTrdbWua9d6lqB ZgPU4I9gw8vhhONqI+OnMRMZ4QdcAQtazK5B99LyQK+dXyP1vyNRD4VieeNzjDt6G78GRk KGL+SNTL7tmqkrr3p3YYOgTzxH6fON0MNg1YmjhIVlhkhPnzHIAt1B138/tQ8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725253358; a=rsa-sha256; cv=none; b=Nd72y/0Gl4xlILNAkxuuZ6aSM3eGwVuVQkm1dI8A2GOtas5JIV/vc0I2K+E99YGwtV4KcH 4fVAyzPCB+IW6BYsa5UpJj/PI73K51SGSPwldWNU9C7A6yQEChUyR3QBbRBvRm0RJrO2PC UI8Mhee5Q+IXD4cJznzSaqQr/h7FQNVuovt/g9eqD8M9F4/Iu8CGYQV6rwCRCI9a39F2l2 F+TzU0Rb0hvjmMbsy64IkAM8Uhw34f4v3N62sh6E5cc9K13QpHayPaAO1SKyS0w9eAEt3C +yGzsPRgI57K7uSD09r+bYsr3u6NNodDqko7ZZDboVCsFEw8u8NOuTXGhqNOlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UdiAlk663sAyqyMYx4UP29QD7VACuBKH9HclWExmheA=; b=vQcM92JjtLdAJGvMsP+L0951tZn3zaDxSkayx33TlMFW91tYBJqvVtEsS8RZaSCGo2MLTO I8OkawEp5JlsFuGp/QQnTlg399wZMrsUKHesV2+zNWMsJKm1zbutCvARlW/oTpbRJTRXhe 9sfABbNhP8O0qSeUyVG0HavWqUKUqsF6q7B2shOr0+o9Pbe8MImqK93Eq/zIqVOvO22SaP eI+H6vv20e7TrgLao18ovRq3jL6mFV3eUP1NPkEH09tPkasYjrEsNIVv9/2GQlFibg0YEY liFeZpVkcHZadVgi2q1Cim5ZvMMWywOV488Ah/STw2gj4IRzyCaScw/dL847bw== 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 4WxxTB5B7lzyyP; Mon, 2 Sep 2024 05:02: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 48252cHI024179; Mon, 2 Sep 2024 05:02:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48252chY024176; Mon, 2 Sep 2024 05:02:38 GMT (envelope-from git) Date: Mon, 2 Sep 2024 05:02:38 GMT Message-Id: <202409020502.48252chY024176@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: d6271b6507b2 - stable/14 - kern: Align the declaration of kernconfstring with its definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d6271b6507b2404bd03f21f76a4e8394e083ae80 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d6271b6507b2404bd03f21f76a4e8394e083ae80 commit d6271b6507b2404bd03f21f76a4e8394e083ae80 Author: Zhenlei Huang AuthorDate: 2024-08-22 10:00:34 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 05:01:40 +0000 kern: Align the declaration of kernconfstring with its definition It is defined as const char[] in config.c which is auto generated by usr.sbin/config/kernconf.tmpl . While here prefer macro SYSCTL_CONST_STRING to avoid casting. MFC after: 1 week (cherry picked from commit 0f64fc6a3486454ad708f517633f930e611fd6d2) --- sys/kern/kern_mib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 8ce09a47ef58..10bf4cde6489 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -460,10 +460,10 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, #ifdef INCLUDE_CONFIG_FILE /* Actual kernel configuration options. */ -extern char kernconfstring[]; +extern const char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, - kernconfstring, 0, "Kernel configuration file"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, + kernconfstring, "Kernel configuration file"); #endif static int From nobody Mon Sep 2 05:04:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxxVy3Nt1z5MSyr; Mon, 02 Sep 2024 05:04: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 4WxxVy2tN3z4vfW; Mon, 2 Sep 2024 05:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=72dMyl9tgxRYW64uzSz/XhYrlnSU3wN8AyyWPHt3++4=; b=ol/D+rMDDr4Bnur5M0Sm+s/KDZ4obnxTUj2VIs8YiFEfkf02mD0bDqHr9KiMsXR9rKmJbM pm6uIO//zbAqeuzmDhQgtk+pOrNBYIuNDuELGrLCDgHQhomWHJC1KYTYNo/erQvDPicNKy Hh+8XBkpEEGbt/1tldDognmtAtfnYDpHBHlInR+2mdlpyfHFyx96K4MHltkB5ofUgBBS1v XsJz7Rj60PThTN+jm1+wA921Wwiburv17b92nDrB/g7gSGuI0A6UXFscYT1lXOY1BmSL67 aBWuvcdN4x2te07UcbUOmf6EO0AHlKpLXrGrMkGRiqZ1h1fwud7K6xCIC8tgQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725253450; a=rsa-sha256; cv=none; b=NNG9t/728e5K5ZkEeGXfJ4b6+MhWckGsZEim2nNLmrFJj/HoDKABKKzSyPg4gn/9EeKpi4 92Hs/JhDehZTWb6uPGkRNH+nl6I7CR/JP6IBBCvOCbsDuzWs9+m+j2kOk43fHna1MbJhw5 XLhaVpKVWyO6uOwOE0Xi8JbERyg1wk9es9Cn2It51Nvs3GPj8ywF3hXhunJnCh1sG6LzSz mE71y6NAmgayfcG03LjQBmLlOlKE9IjuFFnQC6edwagAJQ9+QlOR9hPSufggvBVtYIq3KF 3LgnyqHIU64VizJrp7Aa+rKNtUFAIJhMWrCM6WC5D+88/97GujdmVDZEJkhp5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=72dMyl9tgxRYW64uzSz/XhYrlnSU3wN8AyyWPHt3++4=; b=Q3Q6gPWQJre5B1tKn3m/rpQVQBu7lZqnrBhFZFssyp2zXbjmwfIrA2QllQYyVue/XNdh1d Zr8M5/calEEqojXQSTPChEyRo3R71m1x3SIo9qbeHH3IeSe2Upr0r/foD4TRQH0b1MySPs bqj4/uT2nrwKCTS6gXbzBnH/uxiPKn+md9Odxc8z4fwtFVOTG9L7dY+HBxvxvEr+B/RbhI oECgpRXdNxA5N75nfLVfCvOo8CfWy6nERSg7k+gu9L2AWi2WTfj/v/9j8Ju0b/Ej2xVJDT JKICE/3KWlS3n78nNZQLS1IX04w4oTEBJ6EJ1AsJ8Q0gi0toNX3PGDRphJO7Tg== 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 4WxxVy2Trtzynq; Mon, 2 Sep 2024 05:04: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 48254Apc024494; Mon, 2 Sep 2024 05:04:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48254AlA024491; Mon, 2 Sep 2024 05:04:10 GMT (envelope-from git) Date: Mon, 2 Sep 2024 05:04:10 GMT Message-Id: <202409020504.48254AlA024491@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: 5863982b3d02 - stable/13 - init_main: Sprinkle const qualifiers where appropriate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5863982b3d0294beb4edf843f8733a1c4bf13296 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5863982b3d0294beb4edf843f8733a1c4bf13296 commit 5863982b3d0294beb4edf843f8733a1c4bf13296 Author: Zhenlei Huang AuthorDate: 2024-08-21 10:01:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 05:03:41 +0000 init_main: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week (cherry picked from commit 7412517f2947342d599e42dd563fd6b3a7656e29) (cherry picked from commit b6728c3f0b47408610373fc2744e98f3178ddf83) --- sys/kern/init_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 1a8269b8b367..d2c87cf5b777 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -344,13 +344,13 @@ restart: } static void -print_caddr_t(void *data) +print_caddr_t(const void *data) { - printf("%s", (char *)data); + printf("%s", (const char *)data); } static void -print_version(void *data __unused) +print_version(const void *data __unused) { int len; From nobody Mon Sep 2 05:04:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxxVz51shz5MSYC; Mon, 02 Sep 2024 05:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxxVz3ryqz4vLY; Mon, 2 Sep 2024 05:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yY0dcuRZQjpV11lSlSA4U4QUEd4tAIwPmZLrrgGCPXo=; b=M96DLlo+rgVhThG6np6IDPgvhqbcgKRqFKAoOBtVhORcLiZDfBQsOJRS3Oi+MiJnstq0P8 RQcC3VG+MI0f8OLrkdt9GDQxlDUGKfQbFbeEG4aA6zH9Vvb9URxJYcA8GB9y98Ibbsnoic 0h1zZ+2ibOxQfK8q7Smm8sAa1a4AHbBlbwg08OS7xNVOBO9JL6uJPipI1eTkxxaXF0oa4h 7ia07m2u93R0iF638VpPasRg29Xp/CaCb13tnNPgN2wNnrymREdsjK1Dm85AXCn46ZQ1pN xO/BSikcP+B8ppcCpvPoNzJ+MTqy4XP+28xmeQI3TA7tTQtyht9WIzZs5JlLpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725253451; a=rsa-sha256; cv=none; b=mNJz7YdQEe9KYI73KuClHXwYBRJvksx8vvPQIYKJVoXrml+YSW7wsXyS6LkpNNPa4k8DWa b/d1nu6t9WDu01S85ULhzOZRZg9Hzgdmt36Ah0AU/X/zKWmQFPTILAKnQrnsz0a9E4/saz J00jb+TUUxsEZ3LF2gZdDB/f2AwvTKCBJ4y/F/+avgIpljuwNPKec/REYPvbq3+DcycOPr kEK8cOl2NAEKpvydw7nqkxaQiBM15yklvGInNXISmhZs4gPNYKrdCfPaNok2PDevGm2/Gg pzXjBAfahOUTq4f7IH+vXrMASk9q4uTcbeL0kV/ZfryE6jGdMAdjqvta3b4t3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725253451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yY0dcuRZQjpV11lSlSA4U4QUEd4tAIwPmZLrrgGCPXo=; b=k2ZLh2OqC+OLKLtDyeiu+/B5spUC/MpmQ7aJSi9o9C5i/k1OCeM4iV0ZqCSmyEs6ZByT64 63XKIjDmJ+yZE3XfeXP4FdABgeObCmjml0xzOZ0LMypgdbHsDOwNcBLkRgvBrLpXrc/H/U TWnRhpz9jqya1rbkhlO8a2e6Vb8/OmiN8t+gg/hFM0AdXB74AuX4lND3Rkzjof6OUauRe8 LndOzdIUSWLMwt0GCCARecPRmgaajQ4v9I5DVVUXTX0cnsd5HjA0psA7SqJJfGFKH8iT/q SHg9fLj/SLBYsk9c9EeFw0AgFxEtkP1Ly2cieV+dFcYXlvtOLbmE4qpXLbiagQ== 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 4WxxVz3SRhz1085; Mon, 2 Sep 2024 05:04:11 +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 48254BGc024555; Mon, 2 Sep 2024 05:04:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48254BOf024552; Mon, 2 Sep 2024 05:04:11 GMT (envelope-from git) Date: Mon, 2 Sep 2024 05:04:11 GMT Message-Id: <202409020504.48254BOf024552@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: 38ffc3f3194f - stable/13 - kern: Align the declaration of kernconfstring with its definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38ffc3f3194f048bbfec9b2389b975ef359d896e Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=38ffc3f3194f048bbfec9b2389b975ef359d896e commit 38ffc3f3194f048bbfec9b2389b975ef359d896e Author: Zhenlei Huang AuthorDate: 2024-08-22 10:00:34 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 05:03:41 +0000 kern: Align the declaration of kernconfstring with its definition It is defined as const char[] in config.c which is auto generated by usr.sbin/config/kernconf.tmpl . While here prefer macro SYSCTL_CONST_STRING to avoid casting. MFC after: 1 week (cherry picked from commit 0f64fc6a3486454ad708f517633f930e611fd6d2) (cherry picked from commit d6271b6507b2404bd03f21f76a4e8394e083ae80) --- sys/kern/kern_mib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index aa4798a5a956..b2e9e06f5793 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -451,10 +451,10 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, #ifdef INCLUDE_CONFIG_FILE /* Actual kernel configuration options. */ -extern char kernconfstring[]; +extern const char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, - kernconfstring, 0, "Kernel configuration file"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, + kernconfstring, "Kernel configuration file"); #endif static int From nobody Mon Sep 2 08:50:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XB5kZ6z5MnSS; Mon, 02 Sep 2024 08:50: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 4Wy2XB5CFgz421b; Mon, 2 Sep 2024 08:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYVYwuRpjjFGd1nw0c5y0/2PQgp4OfX4XslXi0YWrbg=; b=ce9G2C1l/WOK6izz0+ZARKMDHDuMH9+9xY7ETPGrPm+er+Pkx3k7Dh99LxYydB20G1W6UG j7jcZh3rDqoktW1OKvD3mhkKIFts7HUloyZWGduo0day9ZcMvGEnNdHuKNGlkRO9H9OArH EJyg43maBS5gxHiRKVcA17BFKgKzh8n3OMwtgNKDyoLn0+CXg/GMOJr5uLUcr7bea14dp7 IR9aTEhCsDEW5pk4KVKz+ALMzyU9GX87MkUXspeWWLme+6uct+QZTwXlUzHEkBtRLI4GCN AQTB+SJJ+/gEGW1ZDX1gjNqzXu9KVO9grkYE0TUGSYIITnU8CFQVXlV9q8HIiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267034; a=rsa-sha256; cv=none; b=K73BlaL0jVdWRjMG/B6XlEoJMXOgClz+Qi5ouzAP0xtdPwG8FbI2gppe1ybnzUrKxUTGT5 CI45j2lhTqLD904aFfueW+vjt3VdBpduxOH8HA1dMkCNxrHQD+mIRiEkUx+8Lpc0uyLFsh 7l+z5+EYu5nVa5Y2nIySDPXSMFesGMU5fng8tiBBuiQw6mRf/px4Db/2d0lCEoOUaHpCF7 c1aVoyPxcrbrynFFCY6Y/dLuh9y/mcLV6dWiNXWsvoDfBwA3OvoLU1hK6OHREoUUCgV4NG a3I9T4ygRrE4QBkcyY/8dY9eBbki2dtCllz6hpLF/8yiD5uPxQonjmcTCbaPPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYVYwuRpjjFGd1nw0c5y0/2PQgp4OfX4XslXi0YWrbg=; b=CBYRKLabZKiN/AQ9R6zeYktM48c3jNxDl4S7fsTCCI23vDPZzJ3UULb8HLGA0+Entnx5E1 ynL6+Fm/ECHBobDICVAC4bLi1xrIhIHZoMfdwGHiTjNVYROi88SG4ccqk0N37ZatJJxf6Y E067Vq6PUKvaKx1WUw9vKC4zqd8aJyN2GGBH3yZVD/NT1s/G/xRo0g10UlHn8w5//AwCmA mZyKqENXmCP0TqGl0BchSw7UZdQMoMzM9vjMVjgtUr6O/xFNacz8JocPNzx41KSSJfMGiF YlNbU0XktU6QGMMfYO6Pfj7ZkG739RKkaVEHflUkv3z0kfKR2flNSGwcTtkplw== 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 4Wy2XB4d35z158y; Mon, 2 Sep 2024 08:50: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 4828oYX4006758; Mon, 2 Sep 2024 08:50:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oYTH006755; Mon, 2 Sep 2024 08:50:34 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:34 GMT Message-Id: <202409020850.4828oYTH006755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3736b79f0fa7 - stable/14 - vm: Use vmem_xalloc in kva_alloc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3736b79f0fa7655288f922d085b90eb5e0347067 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3736b79f0fa7655288f922d085b90eb5e0347067 commit 3736b79f0fa7655288f922d085b90eb5e0347067 Author: Andrew Turner AuthorDate: 2023-11-29 12:11:37 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:43:01 +0000 vm: Use vmem_xalloc in kva_alloc The kernel_arena used in kva_alloc has the qcache disabled. vmem_alloc will first try to use the qcache before falling back to vmem_xalloc. Rather than trying to use the qcache in vmem_alloc just call vmem_xalloc directly. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42831 (cherry picked from commit 8daee410d2c13b4e8530b00e7877eeecf30bb064) --- sys/vm/vm_kern.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index f94200d77c47..35dbae20449f 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -149,7 +149,8 @@ kva_alloc(vm_size_t size) TSENTER(); size = round_page(size); - if (vmem_alloc(kernel_arena, size, M_BESTFIT | M_NOWAIT, &addr)) + if (vmem_xalloc(kernel_arena, size, 0, 0, 0, VMEM_ADDR_MIN, + VMEM_ADDR_MAX, M_BESTFIT | M_NOWAIT, &addr)) return (0); TSEXIT(); @@ -170,7 +171,7 @@ kva_free(vm_offset_t addr, vm_size_t size) { size = round_page(size); - vmem_free(kernel_arena, addr, size); + vmem_xfree(kernel_arena, addr, size); } /* From nobody Mon Sep 2 08:50:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XC6DRhz5MnqY; Mon, 02 Sep 2024 08: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 4Wy2XC5YWBz421c; Mon, 2 Sep 2024 08: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=1725267035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZ+TyEe0i75FreZwL9xORTfDOdomffbl5Wm7TAYtUPI=; b=O67F+DHd30Ag5dJFRGrMOAgYauomVpOeqd/m5v7FeO3w4zGF9rgUN4eUhLvWwwyvgxYKgx eOdXLWgXhOAu/8pWw9antyhsrZnkyMBfnCoybr7tli7gEO7rRgrGlXHzOLotF3c6kBjrjV alTCEjVHsHDD9atV6twwmCzOdfTHTUIk3jTPeMChs0k/FUjAJi78LuTSnBbEWAQbWmTSeD nPTy/OcHJM+QJCy4eOREJVsZHgIIZXt3McNlzpb5tOXDGolcxVNd68Z2orz5uRJiVPBzhS e3romfLxwuxHD1GwESTF1D06meeLDGrSVUIsH5l3z4becThXnAGKtMWZRjCsWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267035; a=rsa-sha256; cv=none; b=xWk2hOPpGo050tPVVcW7jwoF0eh1lBW1sx6lRaQv5cHseC97z4edoHdbVQR7blgnhcpPSA lNivUmXbPrSVWYL7zYuiyzPoKakGIEzhGAIODqUmiZg/uzVWAoGtdagVoDUF0XrBEJHSyZ EWmdbsanvH2XRvqMvk+TiGQkYpGQbLDBq0w/lrqVFxa9QJoMbwkhCcdntLN1xoAqg8rZOW ePhmTp7Hhvae0dSRCG5dH2kiMO+oSbOGvE+KXDP1s70gBqmdjrcMroC5kOrU/YqwXfO5D3 j5N4OMIPdfoXTRZyy+shqB2wYNx2DDSE9uYoR9HRK1UXqnC4OKU8+Qx6kONqRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZ+TyEe0i75FreZwL9xORTfDOdomffbl5Wm7TAYtUPI=; b=vsS7Wy5ZCauObQcyZ/tnL5eS+qfbEOgQAlqhfLeJW6hNpUvrVcD2WDQ6LNsYuJMcXFygy1 QGLI9/i2qR1Mt13L7g1p1KWhRQqFPOF0EZMvx+ndZIZyZxxX298LJuLGGdrzMl3nZ5dX6m Ggs9iACh0Iix7hT2TlmqOA6HZKNzdUhEAguMtVetcBSBNzxDsUvDgVAKc9+my8TrXS6ca2 YDDpiJNDDHjXrlY1FHNUnZ2wrlSbDsFA2o08IyB9DFTWXRTfA1XO/j++fwbeMdoNS1WU+9 t5UHKsJYLwArAtDn10iabN5Ngp1Hd5+Ts7uSwCQ86IC872fWg3zs8a1IDUXpoQ== 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 4Wy2XC4zC6z156d; Mon, 2 Sep 2024 08: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 4828oZsA006798; Mon, 2 Sep 2024 08: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 4828oZal006795; Mon, 2 Sep 2024 08:50:35 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:35 GMT Message-Id: <202409020850.4828oZal006795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: bdbb0be0436a - stable/14 - vm: Add kva_alloc_aligned List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bdbb0be0436a6db70c043a3cd8710de59b497e88 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=bdbb0be0436a6db70c043a3cd8710de59b497e88 commit bdbb0be0436a6db70c043a3cd8710de59b497e88 Author: Andrew Turner AuthorDate: 2023-11-29 12:54:49 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:43:18 +0000 vm: Add kva_alloc_aligned Add a function like kva_alloc that allows us to specify the alignment of the virtual address space returned. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42788 (cherry picked from commit 839999e7efdc980d5ada92ea93719c7e29765809) --- sys/vm/vm_extern.h | 1 + sys/vm/vm_kern.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 4bcd8ac601ae..566c837aab7e 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -49,6 +49,7 @@ struct domainset; /* These operate on kernel virtual addresses only. */ vm_offset_t kva_alloc(vm_size_t); +vm_offset_t kva_alloc_aligned(vm_size_t, vm_size_t); void kva_free(vm_offset_t, vm_size_t); /* These operate on pageable virtual addresses. */ diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 35dbae20449f..387d73d2e46e 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -157,6 +157,27 @@ kva_alloc(vm_size_t size) return (addr); } +/* + * kva_alloc_aligned: + * + * Allocate a virtual address range as in kva_alloc where the base + * address is aligned to align. + */ +vm_offset_t +kva_alloc_aligned(vm_size_t size, vm_size_t align) +{ + vm_offset_t addr; + + TSENTER(); + size = round_page(size); + if (vmem_xalloc(kernel_arena, size, align, 0, 0, VMEM_ADDR_MIN, + VMEM_ADDR_MAX, M_BESTFIT | M_NOWAIT, &addr)) + return (0); + TSEXIT(); + + return (addr); +} + /* * kva_free: * From nobody Mon Sep 2 08:50:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XF2N9kz5MnlQ; Mon, 02 Sep 2024 08:50: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 4Wy2XD5tmXz428H; Mon, 2 Sep 2024 08: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=1725267036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vkuo2mZiVYRL2/tx9RNoNpiSdDA/ISRIOEdrJFh/ins=; b=r2tfVnr5ncwLCcUpepOUVVc2fBYMagVjwb0SMw+jQszhaaYt/0LVcuifeeIsB3+ysoSJ7+ N8M9rKGhh7Y+1uVcSc9SVEXzUZ0A4NeXR8UsUC2Qc0/3bM2SXbCJlbnB9Ba9hpPLs5e9Me Yd2li9JtYE0lH+n8Z5XtmFNOOmp/31N0cfzEX9vLpqKPWtzyEBbzPYwxI11Yjh8QNgj8MV z7FzxEqqBOI14bi0VIU9/RdBHHVGN5qRiQO1/YcwAucBREw7q7gFm6QYlPfGc/zz3JUbHn 1l3iDBdt51W8KqT48IdA+xidW/dU85l5krlLjWUEsmx90noUNSrVvFogT4xXtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267036; a=rsa-sha256; cv=none; b=WOFHRpWep6q33opu+Tc7miMd9Yj+aOek2nECW9dpBir1uBeY7+zvIMSm4SXWZrAhmVE+Og RnF3GW7X8HdENGUHxhGmtzqHCVddH1B4sLLdQS2nZSuUmif8sH768VAsRZkK7JIxinPpSE E/5lz63cFJb1z/lHBY1MVbtzWVe3zX/PD/AU7NyzSexlCCN42w0LqPHHaekPsw3R8UktB7 bNzj/1N0BkeH8mTubDv8w3E3YjK8ezz84SSPofxFHTyjCvN9xwS0BNGavnLh6ProQAZazq A5f/6ZZgTw5bG1ojfVl+wMyxYTq5EgTG6FgVEI7RiOHTCffmZuwmx9/ybR71XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vkuo2mZiVYRL2/tx9RNoNpiSdDA/ISRIOEdrJFh/ins=; b=B37eKo0eWItJTkVWx5riQ9WxPCr+FvEEZs2vpQzE7Zl5aGjgHOJ2q8q+gN8gHP0Qdse3D7 HoUxlueIgC+HKnqh6LZYisRwpVs4pnzhGIu3Jh3yeTWoMTi05zbHbQiZyaBXFWsssm95wn +AvnyRhD2XJwHeN3ghYsiK40QkSCzv9xISg4CjELdAQAJtVJOIkOJ1ofC4ic659w/+Q0Ib tm+weyI/wDxmbar8laIMGiW3t4i3z5qjV4nsaMgZkTsyePPU7/VE+IJHE30d5iD0oyLBwo IJvWpq4XvTzY2Dh1Ksu3W/B5YZ/aGUZkFEJn5JlUfvbawIQBi3tQBmjArD6JFA== 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 4Wy2XD5Q9qz14qK; Mon, 2 Sep 2024 08: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 4828oahC006856; Mon, 2 Sep 2024 08: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 4828oao9006853; Mon, 2 Sep 2024 08:50:36 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:36 GMT Message-Id: <202409020850.4828oao9006853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: f48bd7527bba - stable/14 - uart: Split out initilisation of the acpi devinfo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f48bd7527bba62d4d8019fd4bbdb966aecdbac0b Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f48bd7527bba62d4d8019fd4bbdb966aecdbac0b commit f48bd7527bba62d4d8019fd4bbdb966aecdbac0b Author: Andrew Turner AuthorDate: 2024-03-12 18:06:18 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:43:42 +0000 uart: Split out initilisation of the acpi devinfo Split out the common parts of building the uart devinfo from ACPI tables from the SPCR parser. This will be used when we support the DBG2 table to find the debug uart to be used by the kernel gdb stub. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44357 (cherry picked from commit 473c0b44ae8c51b2aebc51887714b2ed14de50bf) --- sys/dev/uart/uart_cpu_acpi.c | 86 +++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c index a0534c7af230..6805d187cb99 100644 --- a/sys/dev/uart/uart_cpu_acpi.c +++ b/sys/dev/uart/uart_cpu_acpi.c @@ -70,35 +70,10 @@ uart_cpu_acpi_scan(uint8_t interface_type) return (NULL); } -int -uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) +static int +uart_cpu_acpi_init_devinfo(struct uart_devinfo *di, struct uart_class *class, + ACPI_GENERIC_ADDRESS *addr) { - vm_paddr_t spcr_physaddr; - ACPI_TABLE_SPCR *spcr; - struct acpi_uart_compat_data *cd; - struct uart_class *class; - int error = ENXIO; - - /* SPCR only tells us about consoles. */ - if (devtype != UART_DEV_CONSOLE) - return (error); - - /* Look for the SPCR table. */ - spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); - if (spcr_physaddr == 0) - return (error); - spcr = acpi_map_table(spcr_physaddr, ACPI_SIG_SPCR); - if (spcr == NULL) { - printf("Unable to map the SPCR table!\n"); - return (error); - } - - /* Search for information about this SPCR interface type. */ - cd = uart_cpu_acpi_scan(spcr->InterfaceType); - if (cd == NULL) - goto out; - class = cd->cd_class; - /* Fill in some fixed details. */ di->bas.chan = 0; di->bas.rclk = 0; @@ -108,7 +83,7 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) di->ops = uart_getops(class); /* Fill in details from SPCR table. */ - switch (spcr->SerialPort.SpaceId) { + switch (addr->SpaceId) { case 0: di->bas.bst = uart_bus_space_mem; break; @@ -117,10 +92,10 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) break; default: printf("UART in unrecognized address space: %d!\n", - (int)spcr->SerialPort.SpaceId); - goto out; + (int)addr->SpaceId); + return (ENXIO); } - switch (spcr->SerialPort.AccessWidth) { + switch (addr->AccessWidth) { case 0: /* EFI_ACPI_6_0_UNDEFINED */ /* FALLTHROUGH */ case 1: /* EFI_ACPI_6_0_BYTE */ @@ -137,10 +112,10 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) break; default: printf("UART unsupported access width: %d!\n", - (int)spcr->SerialPort.AccessWidth); - goto out; + (int)addr->AccessWidth); + return (ENXIO); } - switch (spcr->SerialPort.BitWidth) { + switch (addr->BitWidth) { case 0: /* FALLTHROUGH */ case 8: @@ -157,9 +132,46 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) break; default: printf("UART unsupported bit width: %d!\n", - (int)spcr->SerialPort.BitWidth); - goto out; + (int)addr->BitWidth); + return (ENXIO); } + + return (0); +} + +int +uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) +{ + vm_paddr_t spcr_physaddr; + ACPI_TABLE_SPCR *spcr; + struct acpi_uart_compat_data *cd; + struct uart_class *class; + int error = ENXIO; + + /* SPCR only tells us about consoles. */ + if (devtype != UART_DEV_CONSOLE) + return (error); + + /* Look for the SPCR table. */ + spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); + if (spcr_physaddr == 0) + return (error); + spcr = acpi_map_table(spcr_physaddr, ACPI_SIG_SPCR); + if (spcr == NULL) { + printf("Unable to map the SPCR table!\n"); + return (error); + } + + /* Search for information about this SPCR interface type. */ + cd = uart_cpu_acpi_scan(spcr->InterfaceType); + if (cd == NULL) + goto out; + class = cd->cd_class; + + error = uart_cpu_acpi_init_devinfo(di, class, &spcr->SerialPort); + if (error != 0) + goto out; + switch (spcr->BaudRate) { case 0: /* Special value; means "keep current value unchanged". */ From nobody Mon Sep 2 08:50:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XG3FMLz5Mnnf; Mon, 02 Sep 2024 08:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy2XF6vh1z428W; Mon, 2 Sep 2024 08:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IeW3xNlzfzes12auYJumS40hCPATrVQc/Tp5aRmV6qU=; b=bB2k7iFGC/BAyUIqKcmH1T5a493OukXvqHpMGpx6Dp0b7N5Iu5KMAim1bsS8xXD2sNj2vm 8GiE/xwMcwviirr495ZhI3C1c8wFoyE/GQxZrKEnpzhMt5kv0q0xWnTVVGRlG9XOnwJ+Ug pUJtYp7GuAgBHfKxHba5uPrtaSB9Xw/OTvNAgroz+PAapyReJj8/m+QKQPheRwBIZGqK7C FzoYGqzV2sD9lFlhLS8+buJ8UDJezwPFR6utYZkvo8TxoJ0qCRaXZWJ7ydkiKOZadSqr9D iW6R/HFELZpYhEo9McVVKfNmLMA0BwfSkbcIGtq03e9ib7aQ83nOsudpJesrzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267038; a=rsa-sha256; cv=none; b=OR2tcjlUKwL8ee+oZ3FfApUUOV3rvgDccqu3uj2LFMGWFRry1d1biFg+6sm0Ir02wawbkp Sfxa8YdsljsaraZ9UuRccP38XPb4eqzE+yLfsIme2CvEucbO+NGS4UXDO8E92o6yXeL0uj iDV1ZS+eWZ2vWZqVuzB1JZjWJ3kJRRStR/7G03oTdaebYCQmPRxOPDnbh/OMjSi0QD7+sG wwZvIVUYYvqWRIbRoccLyv2pMv7KK7x0Etg6ueLiKDihLwNj4vxBXxleJZkPPbaRTxn8Av K9jYB+mqimXNevH344SGTrQ8Gq92UOkljCx39OK2vsIXVa9X+VtpczwbL1GdEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IeW3xNlzfzes12auYJumS40hCPATrVQc/Tp5aRmV6qU=; b=QQYSpmlbFmjjv6q5QFpJg3Qsa3TJrvT8zkgq+NaeWSd3vb8srAGfJqn8gi41wxc/ooSjC+ a7hmQ9N08IzYebWQkU2odqXhkoOR52z+83+byeNedGsxr5KOHyUIxh0x0/GymAW3wFuDdf jvNHI/GwEkWgKJBKP5+y3IKvwEUt49ask3QgOnNOJiAZhsL5F/hq7Em/mUV+Jfuy1SjTbH dbsKsgetDntbPzvBKehFQ/AQU4V4tyq7W/BiBVMTKLOsPGcBf9v0KiCGVkSo90jpZ8u4gG IA1POeGqVkN21fnF1kNlHh63Fy1w32zorWgWtfKq5DEcEswAwxJJSqQyWnOo9A== 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 4Wy2XF678bz156f; Mon, 2 Sep 2024 08:50: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 4828obAR006910; Mon, 2 Sep 2024 08:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828obmq006907; Mon, 2 Sep 2024 08:50:37 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:37 GMT Message-Id: <202409020850.4828obmq006907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 254d54f0733f - stable/14 - arm64: Support passing more registers to signals List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 254d54f0733fe139108cb576cf37f16102659181 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=254d54f0733fe139108cb576cf37f16102659181 commit 254d54f0733fe139108cb576cf37f16102659181 Author: Andrew Turner AuthorDate: 2024-03-21 10:13:16 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:44:19 +0000 arm64: Support passing more registers to signals To support recent extensions to the Arm architecture we may need to store more or larger registers when sending a signal. To support this create a list of these extra registers. Userspace that needs to access a register in the signal handler can then walk the list to find the correct register struct and read/write its contents. Reviewed by: kib, markj (earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43302 (cherry picked from commit 7e6437c08415ade75403f1ecad75167257e8ea3c) --- sys/arm64/arm64/exec_machdep.c | 85 +++++++++++++++++++++++++++++++++++++++--- sys/arm64/include/ucontext.h | 16 +++++++- 2 files changed, 94 insertions(+), 7 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index 4efa3ceaae40..bc4ee178db23 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -462,8 +462,12 @@ int set_mcontext(struct thread *td, mcontext_t *mcp) { #define PSR_13_MASK 0xfffffffful + struct arm64_reg_context ctx; struct trapframe *tf = td->td_frame; uint64_t spsr; + vm_offset_t addr; + int error; + bool done; spsr = mcp->mc_gpregs.gp_spsr; #ifdef COMPAT_FREEBSD13 @@ -502,8 +506,35 @@ set_mcontext(struct thread *td, mcontext_t *mcp) READ_SPECIALREG(mdscr_el1) | MDSCR_SS); isb(); } + set_fpcontext(td, mcp); + /* Read any register contexts we find */ + if (mcp->mc_ptr != 0) { + addr = mcp->mc_ptr; + + done = false; + do { + if (!__is_aligned(addr, + _Alignof(struct arm64_reg_context))) + return (EINVAL); + + error = copyin((const void *)addr, &ctx, sizeof(ctx)); + if (error != 0) + return (error); + + switch (ctx.ctx_id) { + case ARM64_CTX_END: + done = true; + break; + default: + return (EINVAL); + } + + addr += ctx.ctx_size; + } while (!done); + } + return (0); #undef PSR_13_MASK } @@ -586,6 +617,31 @@ sys_sigreturn(struct thread *td, struct sigreturn_args *uap) return (EJUSTRETURN); } +static bool +sendsig_ctx_end(struct thread *td, vm_offset_t *addrp) +{ + struct arm64_reg_context end_ctx; + vm_offset_t ctx_addr; + + *addrp -= sizeof(end_ctx); + ctx_addr = *addrp; + + memset(&end_ctx, 0, sizeof(end_ctx)); + end_ctx.ctx_id = ARM64_CTX_END; + end_ctx.ctx_size = sizeof(end_ctx); + + if (copyout(&end_ctx, (void *)ctx_addr, sizeof(end_ctx)) != 0) + return (false); + + return (true); +} + +typedef bool(*ctx_func)(struct thread *, vm_offset_t *); +static const ctx_func ctx_funcs[] = { + sendsig_ctx_end, /* Must be first to end the linked list */ + NULL, +}; + void sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { @@ -594,6 +650,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) struct trapframe *tf; struct sigframe *fp, frame; struct sigacts *psp; + vm_offset_t addr; int onstack, sig; td = curthread; @@ -613,19 +670,15 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + + addr = ((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif } else { - fp = (struct sigframe *)td->td_frame->tf_sp; + addr = td->td_frame->tf_sp; } - /* Make room, keeping the stack aligned */ - fp--; - fp = (struct sigframe *)STACKALIGN(fp); - /* Fill in the frame to copy out */ bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); @@ -637,6 +690,26 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(td->td_proc); + for (int i = 0; ctx_funcs[i] != NULL; i++) { + if (!ctx_funcs[i](td, &addr)) { + /* Process has trashed its stack. Kill it. */ + CTR4(KTR_SIG, + "sendsig: frame sigexit td=%p fp=%#lx func[%d]=%p", + td, addr, i, ctx_funcs[i]); + PROC_LOCK(p); + sigexit(td, SIGILL); + /* NOTREACHED */ + } + } + + /* Point at the first context */ + frame.sf_uc.uc_mcontext.mc_ptr = addr; + + /* Make room, keeping the stack aligned */ + fp = (struct sigframe *)addr; + fp--; + fp = (struct sigframe *)STACKALIGN(fp); + /* Copy the sigframe out to the user's stack. */ if (copyout(&frame, fp, sizeof(*fp)) != 0) { /* Process has trashed its stack. Kill it. */ diff --git a/sys/arm64/include/ucontext.h b/sys/arm64/include/ucontext.h index e9b914315a19..dedbd061ec6b 100644 --- a/sys/arm64/include/ucontext.h +++ b/sys/arm64/include/ucontext.h @@ -51,15 +51,29 @@ struct fpregs { int fp_pad; }; +/* + * Support for registers that don't fit into gpregs or fpregs, e.g. SVE. + * There are some registers that have been added so are optional. To support + * these create an array of headers that point at the register data. + */ +struct arm64_reg_context { + __uint32_t ctx_id; + __uint32_t ctx_size; +}; + +#define ARM64_CTX_END 0xa5a5a5a5 + struct __mcontext { struct gpregs mc_gpregs; struct fpregs mc_fpregs; int mc_flags; #define _MC_FP_VALID 0x1 /* Set when mc_fpregs has valid data */ int mc_pad; /* Padding */ - __uint64_t mc_spare[8]; /* Space for expansion, set to zero */ + __uint64_t mc_ptr; /* Address of extra_regs struct */ + __uint64_t mc_spare[7]; /* Space for expansion, set to zero */ }; + typedef struct __mcontext mcontext_t; #ifdef COMPAT_FREEBSD32 From nobody Mon Sep 2 08:50:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XH3YHFz5MnlW; Mon, 02 Sep 2024 08:50: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 4Wy2XH0KDYz424P; Mon, 2 Sep 2024 08:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6HSaR5Ag5KQ05MxtTGyGmZmELXvIqfeF376/5Y7Tubk=; b=OAjsPNaTgNx0sMqD3ZWbKiuwEQVNlwEcxVc3FQhbjj6W0CKz3y+QhbDQowmrPtuOLIHDWp ip2vOpJd0wY8gKWK6M1yH4CF+H9cRopJ4osfibnfsUxhnJu7wfdqly2/sXlWy6IHJBPy2y lGMVctE+XKj47637uspfiWT8qeiYxB510A+8qWs1Ose9pTL8hduB0+ae9h7LZPKwJ/R6Yg Z8dk7rCNmb3N5BCOXoS01ADby7zFnpohw0AYuxlt+qRvhYRYzbFipZZ0IrZItZc5gqfhzr QrV6AV1Ntu9CwLqBy6/TLLoO2APVmzKROg3BdK+7AZhscVpNuwyW4hca9RfArQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267039; a=rsa-sha256; cv=none; b=vlbC6vHeuARI5lOe8ftjL0XA4jcnvIxbLqxFeebBOtdfD0ShlIh25Lr/WH3eIFBTHbDAj0 aLwE3ymdjnYgOI4eSaKOZlVTBUoVUvbHznE6Jvf/MqUD3C5PHKoCcj+IknH8IHTDSkMspR A5Qghhuaa/GLILc9oRtuDPtXyzScr4LBFQcqDL5uxBk/77CLRXnBDWSG3b9eUv4rmfjWp/ vooflLWt4nzzpIbL5jA4Ju5CaHPG0gsuCBEsiqXOVP4a+7mXkuURzQB/82OGz+T3S3aaod f0dYGZRxSL3IejlyoH0yH37JblxltDAbgNSK8HsyhUEZvbm1ZGFkoljdDzhnIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6HSaR5Ag5KQ05MxtTGyGmZmELXvIqfeF376/5Y7Tubk=; b=vbaToSH09vv9FqO40m2PnmWT07cCnXs4pFNQCsu9+2K2S/rKLcGKGG7AGFmn1Qh8LQVnuK 8dCWSLt/LGZgqxqoO8Df7qwq91iqp6IVTlUS9EXWPXg4Cync8rlUUNLbrhyrBg91KsYcdt fG3V+wlml39t/ZQ1OGfH1bwYMCaS1UK4FFffmBI01j4qkNXIXqIRrWl0m9EzOXf391IMZE sUUedP+lCsDnDQdaLGlZIq3bQl/pnA5H6WYV4ExSxPz5u+8LUGrNIFDmzJwFcHlR13wYZr kf4nhGKTYrIr95x6HHJy0bmX5xuBe/dHUOwiqjM+nROifj5VChXKjmYXl2LwQg== 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 4Wy2XG716Lz1590; Mon, 2 Sep 2024 08:50: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 4828ocdx006953; Mon, 2 Sep 2024 08:50:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ocVY006950; Mon, 2 Sep 2024 08:50:38 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:38 GMT Message-Id: <202409020850.4828ocVY006950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: fd443b71fa2e - stable/14 - libc/aarch64: Copy the trivial getcontextx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fd443b71fa2eda2a125856acb446dd3cc72e053c Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fd443b71fa2eda2a125856acb446dd3cc72e053c commit fd443b71fa2eda2a125856acb446dd3cc72e053c Author: Andrew Turner AuthorDate: 2024-02-28 16:09:17 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:44:29 +0000 libc/aarch64: Copy the trivial getcontextx This will be used as the base of a non-trivial implementation. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44254 (cherry picked from commit fd6b1cc34e4175c1e223f42540debb74cfe3c3e6) --- lib/libc/aarch64/gen/Makefile.inc | 4 +-- lib/libc/aarch64/gen/getcontextx.c | 73 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc index 5e4fccf143e4..4f4fb3d199bf 100644 --- a/lib/libc/aarch64/gen/Makefile.inc +++ b/lib/libc/aarch64/gen/Makefile.inc @@ -6,10 +6,10 @@ SRCS+= _ctx_start.S \ flt_rounds.c \ fpgetmask.c \ fpsetmask.c \ + getcontextx.c \ infinity.c \ ldexp.c \ makecontext.c \ _setjmp.S \ setjmp.S \ - sigsetjmp.S \ - trivial-getcontextx.c + sigsetjmp.S diff --git a/lib/libc/aarch64/gen/getcontextx.c b/lib/libc/aarch64/gen/getcontextx.c new file mode 100644 index 000000000000..b9d4522d96ee --- /dev/null +++ b/lib/libc/aarch64/gen/getcontextx.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2011 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +int +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx2(char *ctx) +{ + + return (0); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} From nobody Mon Sep 2 08:50:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XJ4Bj7z5MnlX; Mon, 02 Sep 2024 08:50: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 4Wy2XJ1v72z42Kc; Mon, 2 Sep 2024 08:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EDY6P4x/Yb+NUxWfGkFZP8Xp0o+4NERKtG9oGe/Ze5Y=; b=C3UuszD1hrYDag1hS4IG+RZFd5JqAdTqMx2ybvce8viBtHkJBluHIrynJLUVsSVZmYK+mT wmXmrm9LnVNVeEDHK24tvSSrhUVG4XvvqEKD/iVvtEzrxDQhBn+C6n8D1qcwaaCzr8AOWk nWnVh30BnlIbUMeC3YoEMOJbLDfnCQ7sEPxvPD55/cYrfIWr+VEUJIEuPqYbfT4QFiAm9w nqG3Gn5nhfQmohcDdyqgaSDhYBIsNOXY6RvShFqgVOOkNKYO2upC2Xd8MYkoLXuZ0pUvTL VRPHxfliRoLMeuArYM6Atgm1vwdRVXVKbxmgdHrGvBKjua8T0TLqY0lr3x5Gcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267040; a=rsa-sha256; cv=none; b=XqYvNaJs5edpxVCI+RIxYg80a/+RKSnIiwoq5K0Te80rCkTqKRQ+4/ahOdwhlfxY+NFf63 c8GHeh8gOKaMoU9B56mMCBwebxkvt5fwq1JmJB0ZRk+635Qclqrp9vRsLaRxXYBXE0QUg8 wgbrd2QzdwsK7hcqbHaVlI2fyvvRct9JTiCVYGskIcbCnHY7IVcSY6F5bSpvKUQUtlDuaK ZWZJvKWftQPF3/APb/SLM5ftM+dIO002R0fCBulW9mxptlUis/8FtzvOSfrUM/6IRfS4JW G21FI+UupnPvigmj+94l9TihSOu32XCEyzwvnTc/oAJ+08i+xXCWLpPwQtoXUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EDY6P4x/Yb+NUxWfGkFZP8Xp0o+4NERKtG9oGe/Ze5Y=; b=Sfnr7s/jnKYNgZEm403DpvWRPlBc/ZYYBOfr0U+7+RJFI+XLWw5Gr0wPS6qXK5hqtTPHhv YYcP0Dvh2Qfj1FMLX++Auaez9kqH8ljJ0ttu5Oy+ITpMltL+HA34uQq7Jm2UBwFeirAQwk l/WR9l4gGiEey7JefJ3zALPQVPKw/OaJgJow2mOr37+CRim3BtLIPLrHSUn90MjR4gsSYK +ivoAeyZOYNlF1GnNdtsM6+zNUMV7lkpivFGSonyELhGpD0MWCpc7zxE5wpFOA5z14Mj2/ muBP5TkbgKB+c/uN8ltb/beDU4992s89ThaKovaeGtt7qT4HylAMwQ2bGbr/vQ== 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 4Wy2XJ1BKDz15Nv; Mon, 2 Sep 2024 08:50: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 4828oeDV006995; Mon, 2 Sep 2024 08:50:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oewO006992; Mon, 2 Sep 2024 08:50:40 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:40 GMT Message-Id: <202409020850.4828oewO006992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 519141de7e66 - stable/14 - libc/aarch64: Add a non-trivial getcontextx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 519141de7e6639e4df3485073d2521dc95b60207 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=519141de7e6639e4df3485073d2521dc95b60207 commit 519141de7e6639e4df3485073d2521dc95b60207 Author: Andrew Turner AuthorDate: 2024-03-06 12:51:18 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:44:40 +0000 libc/aarch64: Add a non-trivial getcontextx Add support for extra registers to the arm64 getcontextx. As no registers are defined this just adds the extra register list and an end context. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44255 (cherry picked from commit 5202ca77aaf552310bcbaccba750ee9f0888d0d8) --- lib/libc/aarch64/gen/getcontextx.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/gen/getcontextx.c b/lib/libc/aarch64/gen/getcontextx.c index b9d4522d96ee..9972d3208d08 100644 --- a/lib/libc/aarch64/gen/getcontextx.c +++ b/lib/libc/aarch64/gen/getcontextx.c @@ -32,13 +32,26 @@ int __getcontextx_size(void) { + size_t size; - return (sizeof(ucontext_t)); + size = sizeof(ucontext_t); + size += sizeof(struct arm64_reg_context); /* Space for ARM64_CTX_END */ + + return (size); } int __fillcontextx2(char *ctx) { + struct arm64_reg_context *reg_ctx; + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + ucp->uc_mcontext.mc_ptr = (uint64_t)(ucp + 1); + + reg_ctx = (struct arm64_reg_context *)ucp->uc_mcontext.mc_ptr; + reg_ctx->ctx_id = ARM64_CTX_END; + reg_ctx->ctx_size = sizeof(struct arm64_reg_context); return (0); } @@ -49,7 +62,10 @@ __fillcontextx(char *ctx) ucontext_t *ucp; ucp = (ucontext_t *)ctx; - return (getcontext(ucp)); + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); } __weak_reference(__getcontextx, getcontextx); From nobody Mon Sep 2 08:50:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XK5l54z5Mp3m; Mon, 02 Sep 2024 08:50: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 4Wy2XK2jGPz424w; Mon, 2 Sep 2024 08:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DvzGxf0KeIUfBWcGLutR39pbhhnJwz2VZnbxSKfj7aE=; b=vYT7ot9lthYzkJgiLBN12RYD+9l2C9r6nFX2hF0gMCpbF+NwxY5gKikHMJkBWaByQHW1FP 1OyP8/LhxiCtPQbQIicQORM+LUFypa3LrHApaDYyAiv5srbiiZzR+VhD3RQO8bkVgZY1Mt TBE86/4LfRY/UAX7IIoUEWG+2Nj7fVWHD3mGRt243yJcsW792IIqrxFgBarbXtoyxmhJT2 jdX6IXg/pqoj69cgndR0gOWimU36ldKDKk0ngxfCks8ePKLWR/ffC/P+i2a7NKVbYcfpt4 YRkYhIbezNLTzcjNEhigHZjKcIo/Ib1YAjBgwrVnoAoV6Wqj/HjfQ/QQEcMY4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267041; a=rsa-sha256; cv=none; b=RCdo3NfbcKWzQyYP0jUliOUEj9arJ1ojMEpvqXWSytrLKueiaqsmya3jQHU9Q3GrMLp2wm MiEi4FkEXAM/4nVY8WE1iWxD+0claMK/tvITiDt+j8soLIyRTI9Xee9yc0xfDud3PM0V4N Sv59IDBLda206bVgtf+S9aKmrY1CJq/Ur3ciIZtkRWbcfjJFVYhyEDZRk1H0hD7J9+lfsv gLFMiOXLp0XIdA7ZdF0XF4DmtrTJi10lOzasgspQpal0UHyIKUWFRJ8JTS0/ww6NPI0lWz 9emJbQClf2RfNOBaekAotciIRwoyttwZIVP0yCeaCu/632oA57USIkJ+gqDNKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DvzGxf0KeIUfBWcGLutR39pbhhnJwz2VZnbxSKfj7aE=; b=Wyk3oXpum2Ubh28jN2XEAAg6olhcDS7d3KPx6YJ6Kl6HKSxpM/A1KOBtWIdSQwC8IZb6SO EeYWHhB0AB9kolHeuJljtlLlqpCe+Smm4B8mqcr5QT2chrkaoLZi+pwiv/mdgqpFsfpl36 UoTPJClcqCcRkVjySArcFua7dVFOxvO+MufL27K8asgEs/FCgZnXa7RVabAu2AJO1UatfH yhe9C6cNhxr9WKBReGsCcPdBMkV0uVe/LgnVIqz+6sdFzRf/HAR4ztdHt9EiaWCSOWxENj xCwu7gcZTQ+4zL8r1WzWwJD4hgSr2Zn5wSaRsteEHcjLsa21l8jpaNJaVXcCFw== 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 4Wy2XK2Gvbz1594; Mon, 2 Sep 2024 08:50: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 4828ofCP007034; Mon, 2 Sep 2024 08:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ofhn007031; Mon, 2 Sep 2024 08:50:41 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:41 GMT Message-Id: <202409020850.4828ofhn007031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 4047cec13239 - stable/14 - scmi: Implement scmi_clknode_recalc_freq method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4047cec13239e2bfa5b4fbd98de56bdb214e15bc Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4047cec13239e2bfa5b4fbd98de56bdb214e15bc commit 4047cec13239e2bfa5b4fbd98de56bdb214e15bc Author: Cristian Marussi AuthorDate: 2023-12-10 22:14:21 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:46:27 +0000 scmi: Implement scmi_clknode_recalc_freq method Allow the SCMI clock frequency to be queried back, useful for testing the IRQ path via sysctl access. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43038 (cherry picked from commit ecd8cc84dcee7d08be8663f721f0502dc5b65808) --- sys/dev/firmware/arm/scmi_clk.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi_clk.c b/sys/dev/firmware/arm/scmi_clk.c index 30d630c8ef57..48259d81a60a 100644 --- a/sys/dev/firmware/arm/scmi_clk.c +++ b/sys/dev/firmware/arm/scmi_clk.c @@ -56,7 +56,7 @@ struct scmi_clknode_softc { int clock_id; }; -static int __unused +static int scmi_clk_get_rate(struct scmi_clk_softc *sc, int clk_id, uint64_t *rate) { struct scmi_clk_rate_get_out out; @@ -155,8 +155,18 @@ scmi_clknode_init(struct clknode *clk, device_t dev) static int scmi_clknode_recalc_freq(struct clknode *clk, uint64_t *freq) { + struct scmi_clknode_softc *clk_sc; + struct scmi_clk_softc *sc; + uint64_t rate; + int ret; - return (0); + clk_sc = clknode_get_softc(clk); + sc = device_get_softc(clk_sc->dev); + ret = scmi_clk_get_rate(sc, clk_sc->clock_id, &rate); + if (ret == 0) + *freq = rate; + + return (ret); } static int From nobody Mon Sep 2 08:50:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XL5RPSz5Mnnt; Mon, 02 Sep 2024 08:50: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 4Wy2XL3jb1z42L9; Mon, 2 Sep 2024 08:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TalzPi+Y9E54oyc59D48F/9Rk1KWE7myB1BvpzhijHM=; b=U7sWgBU6tSHO/I470kfyZ2grnFa7MoSJg02QWlZaYsSSfHaL+9Z14j8MyoiLwuUHCHcxu1 zUCc3CF9lHDejKBnZV1jcjSO9J903wIRsNfn29PTh3wGHrxqO+wngYgkZd7xDnIpYc7g7G ZWXHgHBXsmqVJDOjI12+fZIkyvs+prXbiipWYpF4WNhtnue8dhPXgqult17wdl8nrF5OOD uizf9LDv+pLO8kLiNl3aIbROMgRTbkkHJw1zoJFDPp/1/1ja4wlkd+oPfEd5hs16V25cUY PHzjW66fHg7M+A/LjvIl+kXlSEi1t0Uya7UCW+j+XYm8B3ZAO6e22N8Dd4+K9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267042; a=rsa-sha256; cv=none; b=ez8RIbDF09JJVX7Wvqtw3mFT503cZaUP1F6kid4cjaD66p2ei51X9ic5iSYXVHs+CMFrWS HaZ+zCfBB8DflQrWhILgbXAoDSUmnmM+Yf7tkjORbzzrgCHJF0rROvlflYp9zQoXCUdUm2 gZIEJsJ3Lxt+S3FjnYQ4p6+/jMXiAmx0DbJLopd+L49i4Pa/fJYIDWg37cpvlso+As1J9y rrQ3212fGz6cLJfqH4V4Fcf9SvMGYDZ35DoNoVc6lCsu52wvW8NWHlnVzPigmvSJ31kau+ n5TBp1xAiYvR5tamdj5eRw8CzsZFdF8wcFTkk9YaTkjpib9xF+C1D6xJw1Q6eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TalzPi+Y9E54oyc59D48F/9Rk1KWE7myB1BvpzhijHM=; b=Zr3QOXN+IctPTbI7nV03WE9iQKODgOy0JT5rJ3atlLqWu1JrBYLAcy0ipGFCSEI0xigWmU WJ4T3vIij5VDQr2/3ZVD1/28XAnUvx4oX3Z2bmLIFUtouXAZ/pIRXPNNHRcSch/UuUfcMP VDxQJd3qD0XiGq0/jKnsxyiORbSftTVz+BigAi5tPQsEOvh40N3q5UzHr4/9DZJO6t8s2A RibYKnQfS3q6sjC/u3oRjt3hhW5qU6CBmozzScUb+48RBOBJkuTVH25aOmy1rGdA+061nf Bc1vZhS2XI6mQKQOS/iEJ3hI/WeUQerUuLn/B+u65xEAhIwdlmhNm19/1kD/ug== 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 4Wy2XL3CmDz15YG; Mon, 2 Sep 2024 08:50: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 4828ogrQ007094; Mon, 2 Sep 2024 08:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ogxM007091; Mon, 2 Sep 2024 08:50:42 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:42 GMT Message-Id: <202409020850.4828ogxM007091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: d5e29c62e923 - stable/14 - linux64: Fix the build on arm64 with bti checking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d5e29c62e923bd8e7a7355a0d3c5e4767c869ddf Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d5e29c62e923bd8e7a7355a0d3c5e4767c869ddf commit d5e29c62e923bd8e7a7355a0d3c5e4767c869ddf Author: Andrew Turner AuthorDate: 2024-06-04 12:47:52 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:10 +0000 linux64: Fix the build on arm64 with bti checking When we enable checking for BTI on arm64 we need to include an ELF note in all object files linked into a module. As using objcopy from a binary to an ELF object file doesn't add the note switch to using .incbin from an assembly file. This allows us to add the needed note without affecting the included object. Reviewed by: imp, kib, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45468 (cherry picked from commit bed65d85c631c3a8e60a81a15a5a745c8ef92fbe) (cherry picked from commit ec69d230933f82c7c142b053882255aa57475463) --- sys/arm64/linux/linux_support.S | 4 ++++ sys/compat/linux/linux_vdso_inc.S | 39 +++++++++++++++++++++++++++++++++++++++ sys/modules/linux64/Makefile | 17 +++-------------- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/sys/arm64/linux/linux_support.S b/sys/arm64/linux/linux_support.S index 151ede7e1c19..3b16583e9d54 100644 --- a/sys/arm64/linux/linux_support.S +++ b/sys/arm64/linux/linux_support.S @@ -26,6 +26,8 @@ * SUCH DAMAGE. */ +#include + #include #include #include @@ -172,3 +174,5 @@ ENTRY(futex_xorl) str w4, [x2] ret END(futex_xorl) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/sys/compat/linux/linux_vdso_inc.S b/sys/compat/linux/linux_vdso_inc.S new file mode 100644 index 000000000000..44cc357b4a4a --- /dev/null +++ b/sys/compat/linux/linux_vdso_inc.S @@ -0,0 +1,39 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2020 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + .section .data + .globl _binary_linux_vdso_so_o_start +_binary_linux_vdso_so_o_start: + .incbin "linux_vdso.so.o" + .globl _binary_linux_vdso_so_o_end +_binary_linux_vdso_so_o_end: + +#if defined(__aarch64__) +#include +#include +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) +#endif diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 05fe76ba6a51..5d0174aa8e9b 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -35,7 +35,8 @@ SRCS= linux_dummy_machdep.c \ bus_if.h \ device_if.h \ vnode_if.h \ - linux_support.S + linux_support.S \ + linux_vdso_inc.S .if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux_dummy_x86.c .endif @@ -47,7 +48,6 @@ SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \ genassym.o linux_vdso_gtod.o linux_vdso.so.o -OBJS= linux_vdso.so linux_assym.h: linux_genassym.o sh ${SYSDIR}/kern/genassym.sh linux_genassym.o > ${.TARGET} @@ -83,18 +83,7 @@ linux_vdso.so.o: linux_locore.o linux_vdso_gtod.o -T${SRCTOP}/sys/${MACHINE}/linux/linux_vdso.lds.s \ -o ${.TARGET} ${.ALLSRC:M*.o} -.if ${MACHINE_CPUARCH} == "aarch64" -OBJCOPY_TARGET=--output-target elf64-littleaarch64 --binary-architecture aarch64 -.elif ${MACHINE_CPUARCH} == "amd64" -OBJCOPY_TARGET=--output-target elf64-x86-64 --binary-architecture i386:x86-64 -.else -.error ${MACHINE_CPUARCH} not yet supported by linux64 -.endif - -linux_vdso.so: linux_vdso.so.o - ${OBJCOPY} --input-target binary ${OBJCOPY_TARGET} \ - linux_vdso.so.o ${.TARGET} - ${STRIPBIN} -N _binary_linux_vdso_so_o_size ${.TARGET} +linux_vdso_inc.o: linux_vdso.so.o linux_support.o: linux_support.S assym.inc linux_assym.h ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ From nobody Mon Sep 2 08:50:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XP12VMz5Mp6S; Mon, 02 Sep 2024 08:50: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 4Wy2XN5sJWz429t; Mon, 2 Sep 2024 08:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eV6CQl0VlKdI9NT4xTJ1rGq5g3zFe/FrM2aG96E0gt0=; b=pGOO2+FCtp1DH8fLMZueLR/CwFILZB1j5sEXLkm6hSlZSCL34k80Z+W+6ObeT0X+WZWPnM PzhNES9qIRDorwSIhRpLxiEprk998M1GBGHb51rW/Wv9aWWpcDcbkNQ4DWskE3WdDJcvw4 6DEDz4RwGZWaMiatQHPg6tNo4jCkzX8NFN0jSZY3SJf5rbgRSGTyYpIgCxjvxXMzqbXuNh 46/I2kwsPg24gPdlh6689Qfick9EPq3tBVCYmBJ1XwQG70trwMyKkGUuDWQF78exHtVus7 knReOxFLrdNjBhbw9IyPIENc4VF2CHYbHFuB+Lug/EzwfSTYpQOUfvjA1oCBow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267044; a=rsa-sha256; cv=none; b=LQF3gPjrBMoQ0XkYRyneZhZnzGIVncSWq4dSno0N5+qrrpfwrTVjCOw1lbrNwjY4RpRJjm qckT5o0F71ZvZSycKCJ20pq45t47KLDjjnkFCgXcQIBfWf5+aLa8E5oVlA2GTBOzSWkujC 1MMhN5xk9MHccEH8FNrkKmdR50KW1VuulRYNu6sn0wDKoT025CrU9xvyK8tEUUQMsqdv+A IrXeyQWjO1NGRktDfQ70631lcZY9aNIacwZfB9L3S5MZITq7jDoTgOczRIy/bjNQVUUuy6 XxvfGWZNG32USOMV/KdNeMZlTrSKq4THyrk3aAWXeVeFpkztUqjrHQ8jRP78HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eV6CQl0VlKdI9NT4xTJ1rGq5g3zFe/FrM2aG96E0gt0=; b=D+Mu98VL8U/zEaHuS1ATKJ3Q24DQImDLIU4UQJe6NRI3uRbutR2LEwSV96GGxboubl13u6 rumcT2fuagBce170yzD+/7+OATz5WVSy8hfgaWgmuao+3Kjh27zUAvlUh/BoAQ2JOy9Vp3 ZZu5PGn8NQHHRG5UWgYEPUy/zYYh5jQeensdCH6QtTp+/IrhE4czLFo9ywtyAed1Gm6arh IvzI0u/xwHmEHJ3NeMl+jm9cfUfpy7b+sjqLbWHv0wQkJkDtBKln5Dzdi7hAbDznjuZdOK qBupbrG0/8Y0BxvccWdM3W0DfZzQo/vJRrLAa2FydJrsoMWP6nJk5CztP7bT3w== 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 4Wy2XN5Bgqz153X; Mon, 2 Sep 2024 08:50: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 4828oivR007199; Mon, 2 Sep 2024 08:50:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oioQ007196; Mon, 2 Sep 2024 08:50:44 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:44 GMT Message-Id: <202409020850.4828oioQ007196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 570fae59a8bf - stable/14 - arm64: Support counter access with E2H List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 570fae59a8bf9ded19c4de9bf001ee0fa2cf7229 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=570fae59a8bf9ded19c4de9bf001ee0fa2cf7229 commit 570fae59a8bf9ded19c4de9bf001ee0fa2cf7229 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:00 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:25 +0000 arm64: Support counter access with E2H When entering the kernel with the E2H field set the layout of the cnthctl_el2 register changes. Use the correct field locations to enable access to the counter and timer registers from EL1. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45529 (cherry picked from commit 997511dffe651e1d2d708f37f2ced430a6ab3349) --- sys/arm64/arm64/locore.S | 6 ++++-- sys/arm64/include/hypervisor.h | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 9f3739c85534..e637749b1321 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -317,8 +317,10 @@ LENTRY(enter_kernel_el) msr hstr_el2, xzr /* Enable access to the physical timers at EL1 */ - mrs x2, cnthctl_el2 - orr x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + tst x4, #HCR_E2H + ldr x3, =(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + ldr x5, =(CNTHCTL_E2H_EL1PCTEN | CNTHCTL_E2H_EL1PTEN) + csel x2, x3, x5, eq msr cnthctl_el2, x2 /* Set the counter offset to a known value */ diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 85ac5cda7037..418047cb22f2 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -37,10 +37,15 @@ /* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ #define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ +/* Valid if HCR_EL2.E2H == 0 */ +#define CNTHCTL_EL1PCTEN (1 << 0) /* Allow physical counter access */ +#define CNTHCTL_EL1PCEN (1 << 1) /* Allow physical timer access */ +/* Valid if HCR_EL2.E2H == 1 */ +#define CNTHCTL_E2H_EL1PCTEN (1 << 10) /* Allow physical counter access */ +#define CNTHCTL_E2H_EL1PTEN (1 << 11) /* Allow physical timer access */ +/* Unconditionally valid */ #define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ #define CNTHCTL_EVNTEN (1 << 2) /* Enable event stream */ -#define CNTHCTL_EL1PCEN (1 << 1) /* Allow EL0/1 physical timer access */ -#define CNTHCTL_EL1PCTEN (1 << 0) /*Allow EL0/1 physical counter access*/ /* CPTR_EL2 - Architecture feature trap register */ /* Valid if HCR_EL2.E2H == 0 */ From nobody Mon Sep 2 08:50:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XN3x06z5MnyS; Mon, 02 Sep 2024 08:50: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 4Wy2XM4rNwz42DN; Mon, 2 Sep 2024 08:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MgTWGISPQAg78jF3GPeFxZViEd3cmy2wUuvX549J5o=; b=tksKXnkD3jSg0utWvDfOGmGBJKzje6dQ7xdDvpeH7ZaYRcp+RLmL/cM+uVRMoZDgJWg8qw IYwg72t0RVcOX0mXfgZ5R+7w212Muyn/WcTLP/vdyNKGDe1iLgYyYs6C1AKaDMbp8t+Try wnyvR4tXn3R4W3WdTOuS4TbyRY+V82g2CCxmepN9S0G7lfEE/07KHvGh/FhQqtozy1Qmja jxHGit7/M650dv6uNRXogs7Z6Q3NS+uTUlJC5zk3HmOA0d6gDmAhppO7PWAmY9DPfGQt6k tBPS3aGVFrXaXdrublZ2nxamT0YmPx90qOEBtX2vxmdphKCbwC50lZGkhkazVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267043; a=rsa-sha256; cv=none; b=b5BRulIm4NjRI8LlTDmrrA1UDpJkHyUrIxJDsq2wLz3qos3cDXQrOuJ4S3HbPCpbDxHmWi 2pfJ2JYGFuYYTEqL4SI370ly6jKtcPnICe2UeONpyRHBpUBm5Oa8gL1jKkbZXtX1eh0ukQ cxtv0k7BSg05axY6CcX0jm+vaQBit9LmROTt/AwtwkEES39YTzGE+pd1AVVBYEaBmEeIy5 oEiogJA3FKnkfjd7G19kGHuUCq3yPkUGnlgl7GBKpIlCIPxdF1+Q4tJnl75IVAZhypwD+k F/F6uCajaAOES63OWR9puvzEjWJpSFY6lrBwPGaXSt6jw+Wsh1qDJpXB/ZCWig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MgTWGISPQAg78jF3GPeFxZViEd3cmy2wUuvX549J5o=; b=A7cr9AzgJGNZ+ragnNJCl0hqsK9RopPVq7KiCQ7xLK1/0FEusOXrhtrGBuEZQfP3T9Xsg8 OslgaTq4kjzrhZs3T1ZONMRkddWCK9I2IcqdM/wapVmrGRG5mosYINX38S2ah5j+sp/W+q WJfCkJVYJCLdWYlDK2GL+R1zxYt3bwCh6pg8BU+vJeXe2nrckMnwgSjhghC1KxGuR51OXS RWKpVjCD0pkJ2uE1qu7PTl8qhGqiK6L0zbOe8SSBXSszBKSc40mVf3nmV6konL+hXQYzgL QMG9nm5g8RJjefWVhhqb6KwKPpyRdYmqLxb4qLEJ5pKIh5XdTI+s764xQJpZeA== 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 4Wy2XM4Pnbz1595; Mon, 2 Sep 2024 08:50: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 4828ohcb007153; Mon, 2 Sep 2024 08:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oha5007150; Mon, 2 Sep 2024 08:50:43 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:43 GMT Message-Id: <202409020850.4828oha5007150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 8b9f8a7e763d - stable/14 - arm64: Clear td_frame when returning to userspace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b9f8a7e763dfc533ce2abd5b48d1ba9f54165e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8b9f8a7e763dfc533ce2abd5b48d1ba9f54165e2 commit 8b9f8a7e763dfc533ce2abd5b48d1ba9f54165e2 Author: Andrew Turner AuthorDate: 2024-06-12 13:08:13 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:17 +0000 arm64: Clear td_frame when returning to userspace When returning from an exception to userspace clear the saved td_frame. On the next exception this should point to the frame, however this is not guaranteed. To ensure the trap frame pointer is either valid or NULL clear it before returning to userspace in the EL0 synchronous exception handler. Reviewed by: kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44807 (cherry picked from commit 4eec584d79c1e8375d863c7eec7229ac7ec3f13b) --- sys/arm64/arm64/exception.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index b1990fc71281..0df440863632 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -214,9 +214,11 @@ ENTRY(handle_el0_sync) save_registers 0 ldr x0, [x18, #PC_CURTHREAD] mov x1, sp + mov x22, x0 str x1, [x0, #TD_FRAME] bl do_el0_sync do_ast + str xzr, [x22, #TD_FRAME] restore_registers 0 ERET END(handle_el0_sync) From nobody Mon Sep 2 08:50:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XR1xgwz5MnyV; Mon, 02 Sep 2024 08:50: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 4Wy2XR0P31z42X2; Mon, 2 Sep 2024 08:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eX+P5vB1w52SG91CuMGNxRvOHgT6O/Fs6LjPcPz1/+E=; b=jyk5/23aShPdH5MSFmo1dcoI+W+aKgRsd96RIapBfk0lRgkL2smQ5gEGBj/RKZT2ePhdKf AW8czTFzcWo2jMok+r+wuIr5gs8M7SqEG7m7XCI/rqqw39LeBUV4Xz81IknJ5DroZ7xjkb jMaYUGvGMmaRUN9m1P0y/fb5qj1g7rSq/9p4REAZq+gzUhTuhRQ7ONVAtNshMpRU8NpMOp qmxprECq5WV0+HzF/5WDtPJ33YnZo9MgBBDQTjZ9IozrD+wYQLq7oAhEibp+oNG+lOMYx5 gbdG7Yxen3+af5ZgQGpMRhh5XqDlxsm7cc6R6pEq9QVaHrHeJ2wf6HCrWtpwkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267047; a=rsa-sha256; cv=none; b=h007sTa/hPlEzepZAS7G5D1C4FcyLEuBaXAlG1Mg1gT8LI8HGjq6CTTmIsHX/w1l6xiG1A CQhiLRts00MRiicN2HNicVm9j9uf6aMpqZ+0Qz7uPkyKmWHWKARaQjk0zSPSdeyfhX5DAq VEOg4yloLDdP+NPTJHydm/DRqc+kXOtV1dOUOLyOkcpxPCidx5QpIh3T/YSrfNQtdD+Lyw hs3oBpAw+v2TuZ57EeFH7rHFcj5oM3LR0lPO/HP4JeR2sM0NJMD5x8idXd//yYGmzfE8bb DYYevC1yC6BGsZlVZIbyFSYCxE4b3LesCFFXvyWElMeWwJsvFG1L5CQwKnEXUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eX+P5vB1w52SG91CuMGNxRvOHgT6O/Fs6LjPcPz1/+E=; b=X7+NXsaGjlM6yWx6xdHd/hgcagIqngvGBzUNa6pNU34YHYX5Uk5P0ip31Ws5/CCE2pitwS L8/HhqFXnf/IIUqGLw4eRez5D1AztpmXLGQ81zlSgYgPtHAmhRBt4KsXfTOUgaaJX7wdh3 he5j0ZBx42rzD0t+FqARo5O6mSOZQqkTVF5NiGn2nAx6CXJlXOzXjgowo8E5pmWK5qxbRO cPPvKUvOuYLWjwnYi1VViNCsrraM4APeuM0vs6AJtdp05lCvMCNEljUCZGjMTA/bkBEoQd U8xNwN1iSfcls59HVr6G8cC+6thRKu+YekZZr9L4ZCMci4znDP9x6dxSjC0RgA== 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 4Wy2XQ74PMz14qM; Mon, 2 Sep 2024 08:50: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 4828okE7007304; Mon, 2 Sep 2024 08:50:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ok16007301; Mon, 2 Sep 2024 08:50:46 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:46 GMT Message-Id: <202409020850.4828ok16007301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0fbb9df20dd8 - stable/14 - arm64: Ensure sctlr and pstate are in known states List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0fbb9df20dd88ba448ea622cf40b3855959653fe Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0fbb9df20dd88ba448ea622cf40b3855959653fe commit 0fbb9df20dd88ba448ea622cf40b3855959653fe Author: Andrew Turner AuthorDate: 2024-07-23 09:18:24 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:43 +0000 arm64: Ensure sctlr and pstate are in known states Before entering the kernel exception level ensure sctlr_el2 and sctlr_el1 are in a known state. The EOS flag needs to be set to ensure an eret instruction is a context synchronization event. Set spcr_el1 when entering the kernel from EL1 and use an eret instruction to return to the caller. This ensures the CPU pstate is consistent with the value in spcr_el1 as it is the only way to set it directly. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45528 (cherry picked from commit 034c83fd7d85f57193850a73cc0ac957a211f725) --- sys/arm64/arm64/locore.S | 52 ++++++++++++++++++++++-------------------- sys/arm64/include/hypervisor.h | 4 ++++ 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index debfb90e74e2..3db1d3025967 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -65,19 +65,6 @@ ENTRY(_start) /* Enter the kernel exception level */ bl enter_kernel_el - /* - * Disable the MMU. We may have entered the kernel with it on and - * will need to update the tables later. If this has been set up - * with anything other than a VA == PA map then this will fail, - * but in this case the code to find where we are running from - * would have also failed. - */ - dsb sy - mrs x2, sctlr_el1 - bic x2, x2, SCTLR_M - msr sctlr_el1, x2 - isb - /* Set the context id */ msr contextidr_el1, xzr @@ -266,19 +253,37 @@ END(mpentry) * registers and drop to EL1. */ LENTRY(enter_kernel_el) +#define INIT_SCTLR_EL1 (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_EIS | \ + SCTLR_TSCXT | SCTLR_EOS) mrs x23, CurrentEL lsr x23, x23, #2 cmp x23, #0x2 b.eq 1f - ret + + ldr x2, =INIT_SCTLR_EL1 + msr sctlr_el1, x2 + /* SCTLR_EOS is set so eret is a context synchronizing event so we + * need an isb here to ensure it's observed by later instructions, + * but don't need it in the eret below. + */ + isb + + /* Ensure SPSR_EL1 and pstate are in sync. The only wat to set the + * latter is to set the former and return from an exception with eret. + */ + mov x2, #(PSR_DAIF | PSR_M_EL1h) + msr spsr_el1, x2 + msr elr_el1, lr + eret + 1: + dsb sy /* - * Disable the MMU. If the HCR_EL2.E2H field is set we will clear it - * which may break address translation. + * Set just the reserved bits in sctlr_el2. This will disable the + * MMU which may have broken the kernel if we enter the kernel in + * EL2, e.g. when using VHE. */ - dsb sy - mrs x2, sctlr_el2 - bic x2, x2, SCTLR_M + ldr x2, =(SCTLR_EL2_RES1 | SCTLR_EL2_EIS | SCTLR_EL2_EOS) msr sctlr_el2, x2 isb @@ -298,8 +303,8 @@ LENTRY(enter_kernel_el) mrs x2, mpidr_el1 msr vmpidr_el2, x2 - /* Set the bits that need to be 1 in sctlr_el1 */ - ldr x2, .Lsctlr_res1 + /* Set the initial sctlr_el1 */ + ldr x2, =INIT_SCTLR_EL1 msr sctlr_el1, x2 /* @@ -355,10 +360,7 @@ LENTRY(enter_kernel_el) isb eret - - .align 3 -.Lsctlr_res1: - .quad SCTLR_RES1 +#undef INIT_SCTLR_EL1 LEND(enter_kernel_el) /* diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 418047cb22f2..011f86e83fdf 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -148,10 +148,14 @@ #define SCTLR_EL2_C (0x1UL << SCTLR_EL2_C_SHIFT) #define SCTLR_EL2_SA_SHIFT 3 #define SCTLR_EL2_SA (0x1UL << SCTLR_EL2_SA_SHIFT) +#define SCTLR_EL2_EOS_SHIFT 11 +#define SCTLR_EL2_EOS (0x1UL << SCTLR_EL2_EOS_SHIFT) #define SCTLR_EL2_I_SHIFT 12 #define SCTLR_EL2_I (0x1UL << SCTLR_EL2_I_SHIFT) #define SCTLR_EL2_WXN_SHIFT 19 #define SCTLR_EL2_WXN (0x1UL << SCTLR_EL2_WXN_SHIFT) +#define SCTLR_EL2_EIS_SHIFT 22 +#define SCTLR_EL2_EIS (0x1UL << SCTLR_EL2_EIS_SHIFT) #define SCTLR_EL2_EE_SHIFT 25 #define SCTLR_EL2_EE (0x1UL << SCTLR_EL2_EE_SHIFT) From nobody Mon Sep 2 08:50:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XQ0Hxpz5Mnqp; Mon, 02 Sep 2024 08:50: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 4Wy2XP6CWgz42GQ; Mon, 2 Sep 2024 08:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L19UTrLolykX/oC8EaP7So2K1coaVyD+GA2CBYUhPGc=; b=GVvjW+LnRZHd8uTJJp5NyyuNUNydBfg4S2CNIk4x87GKlpcQ36LI4nTPziVFrcyt9Ne6t6 lkDwk/bn6HOuZdu4R/B7tr6UlIKnqVGZgAYLJ/tAjS3yZy8MV7zS2OiWAsYG7Xq7Z1jItp 7hwuOArdqz6uZWKYgrgiuzQSbl1nZuOrxUiuVdvkcSJ7nv1qBQrjV+xfK3xu8xxFDMPLCu sG4zjYtgJ+TrgTHu1LqM/j9wkjha0F4Clov9Sn/CkT6Ll8JRp/YHAZRCo3pakgRhIZZRNn B6RrwQO2CLJVch571JVGOP55TLKnrz9EHW8Lt84CAhiUaNkSpKJz+ZKKVc2avw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267045; a=rsa-sha256; cv=none; b=q9z038jGZ/nWgUvhuhGA3wHx4fts/+O7hpqh7pi2H90yhtS7yrLMzG4IaubnIdzpJCcucL WQ+jcqrKvR1q/ggDRaqUz/aP/tLxZaCH3j6JrzFxeW9Nq41tOGeVMg1Opwrgumfr/JAkxM UkI2iu3ICathjIER2imE+q6246YMl39ywTA42T0Y3XgZHeXiuEf8/ampRt7VBkSv+o6OfU mgM8NiwFTzNDxlh5vkbDGDRnDaCDo49hfX7oyLlpnwAdjvHkS8K9Q3PpD24Vhi02hNya/r E336tfCnVZ51jbTdy5Xw69OBW2WEFBtAlsbcteF3aA4+VUsLsWMn1NaB7jFFwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L19UTrLolykX/oC8EaP7So2K1coaVyD+GA2CBYUhPGc=; b=S+O/dBQ7CmKLFbG019MNcJ0AP+/TZvoxZBV0zJb3+uuQv40/XdIrLAZieCkbEfKT0cusI0 9HgpeEZvmwEmcRFvzuHXMUF3H8yYf7oGNZ9+0JP8ITfpV2lsBe3Vcmdd1ZdFmuN7MdRE9w 4j/3YyA0YD8kGDCEmsKlRZElngQ1cHao/wID0JhGbz7lTsXkNFbHSJQqz1qUXLx72Ptwgc bv0l6/zd9Fsm+uURN6wUsu40HspyyHs1ANC9pyg7E3vPiylkfcFM90G9W1Nt4UKfHbDwKx +ITvWb+5piqSyefA4xe3p5sGyvloAW1D/iye6q4l6x4rqLH6op4n+AabX5R7lA== 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 4Wy2XP5qctz15Ny; Mon, 2 Sep 2024 08:50: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 4828ojVF007248; Mon, 2 Sep 2024 08:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oj71007245; Mon, 2 Sep 2024 08:50:45 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:45 GMT Message-Id: <202409020850.4828oj71007245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 94865825c014 - stable/14 - arm64: Fix the gicv3 check in locore.S List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 94865825c014dfaab300ea785b8cb7013d23187c Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=94865825c014dfaab300ea785b8cb7013d23187c commit 94865825c014dfaab300ea785b8cb7013d23187c Author: Andrew Turner AuthorDate: 2024-07-23 09:18:08 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:32 +0000 arm64: Fix the gicv3 check in locore.S In locore.S we need to configure access to the GICv3. To check if it's available we read the id_aa64pfr0_el1 register, however we then only check if a GICv3.0 or 4.0 is present. If the system has a GICv4.1 this check would fail. Move to checking if the GICV3+ is not absent so this will still work if the field is updated again. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45530 (cherry picked from commit 57ef7935eb114e98e7e554c5ffbded68fd038c04) --- sys/arm64/arm64/locore.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index e637749b1321..debfb90e74e2 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -341,9 +341,8 @@ LENTRY(enter_kernel_el) mrs x2, id_aa64pfr0_el1 /* Extract GIC bits from the register */ ubfx x2, x2, #ID_AA64PFR0_GIC_SHIFT, #ID_AA64PFR0_GIC_BITS - /* GIC[3:0] == 0001 - GIC CPU interface via special regs. supported */ - cmp x2, #(ID_AA64PFR0_GIC_CPUIF_EN >> ID_AA64PFR0_GIC_SHIFT) - b.ne 2f + /* GIC[3:0] != 0000 - GIC CPU interface via special regs. supported */ + cbz x2, 2f mrs x2, icc_sre_el2 orr x2, x2, #ICC_SRE_EL2_EN /* Enable access from insecure EL1 */ From nobody Mon Sep 2 08:50:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XS3rZNz5Mp3r; Mon, 02 Sep 2024 08:50: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 4Wy2XS28BVz42Zq; Mon, 2 Sep 2024 08:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgJcqG5v6czXF0pSWYl9EyXDB00l1sVwfW3xz27MFCY=; b=AEarLXJYWmv6YR97ARO/KiKEx/+L5iU6G4/czsBJW6aEpuY1dKOs8WVz92555mTGRljgdz c2rBKr9qhJvUToLuNU30+yxbtlD9Xfg+C/rV08jLWb0zCbKWxEHRKTrSY0Pcq0XvR4lcc+ zeag3cKVR+6FxXbE1CnyaokZWplKsXKTVnip/VRtKNH6vkqhIAqrT176R45CeVbG4AnOBF hPLB6q/BvWFzpXL0Oc4RUb+g+LN92yTpYHT8lUQ+Y5P4M/VUxuusP2CUOymYlsRq0pMgjk leKpiRc8vpVv6K5LwMk+qCwo/ttIujjdMaUBsBC9ivAiEwmX93YwEEiJU/28eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267048; a=rsa-sha256; cv=none; b=On3mEb2v3m+mMePJ+He6XZmd6Goi8//UeFc9dxc14B1/Diay0ZeTHtrGWZ2sh/fMQqZ+MM NN5v7hYPN0JakrcWD96wKYdP7YEO5q+kZcVPWrLbm5CZF+SJMXpw/dQFUiRgI/2y0hq9gL Pjaf09TS/kGkgKBEGDZn23xOmWwXJ7NNic1wd06WHOIKYlLkAQRoaaDXqKAIUEE3sE3XGX 9en47Q/1ZbbO96ABivpySO8PXoz1mUBzaJ+4vcy0p7IFhq6rC4KIhR8lj+xOuZuW/vaqXH h/EU5e6I0ZVdgZNFu8cb25pJdJw/vtgCQjs6p/6INNuG1VXXpeCPveRiQTtIZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgJcqG5v6czXF0pSWYl9EyXDB00l1sVwfW3xz27MFCY=; b=L6/TdVDjkshErYqYfgAIxb2SifY/1FulE2Ol1P9zNrIfBp2bdeW/uEpxA0sId4u0D6KSow A2psU5fz8GbkvbLpwwzvQtvHPeVp+xI6x0zyJBjqojS2cJIHj1U6OUORM/58nTu9Xu1X1w xTu+y+dp+V2cAsZtir7i62T08PKym5mS7UTVZoEUSBXLP1dbYXLG4vzuaQ32+T+sdED+ix R8OxB/K77IFqmNWd8DdQRVD1Z3JGQq5a8cr+6Lt6YSYqKdREIxMkx5vmnlmSc8qq67fSmj OIHhEHWRMKeRuxXbFNJCPgaASOZ9+VcO36mEb3TnItMcW54k0Daz4Ey8/sV8oA== 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 4Wy2XS0RQVz153Z; Mon, 2 Sep 2024 08:50: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 4828ol7Q007370; Mon, 2 Sep 2024 08:50:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ol46007366; Mon, 2 Sep 2024 08:50:47 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:47 GMT Message-Id: <202409020850.4828ol46007366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 75861a57b6fd - stable/14 - dev/uart: Add APMC0D08 as found in the Intel E2100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75861a57b6fd721e47c8a7cb43c4882c200cca1d Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=75861a57b6fd721e47c8a7cb43c4882c200cca1d commit 75861a57b6fd721e47c8a7cb43c4882c200cca1d Author: Andrew Turner AuthorDate: 2024-07-23 09:18:36 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:54 +0000 dev/uart: Add APMC0D08 as found in the Intel E2100 This uart has the requirement for 32-bit sized and aligned memory accesses. It is also described in the Serial Port Console Redirection Table (SPCR) with a different interface type value. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45834 (cherry picked from commit 9840598aa31f2a89272f5bef6545e316f254f0c6) --- sys/dev/uart/uart_dev_ns8250.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index a49215218830..ced3b44b5749 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -447,6 +447,7 @@ struct uart_class uart_ns8250_class = { static struct acpi_uart_compat_data acpi_compat_data[] = { {"AMD0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, {"AMDI0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"APMC0D08", &uart_ns8250_class, ACPI_DBG2_16550_COMPATIBLE, 2, 4, 0, 0, "APM compatible UART"}, {"MRVL0001", &uart_ns8250_class, ACPI_DBG2_16550_SUBSET, 2, 0, 200000000, UART_F_BUSY_DETECT, "Marvell / Synopsys Designware UART"}, {"SCX0006", &uart_ns8250_class, 0, 2, 0, 62500000, UART_F_BUSY_DETECT, "SynQuacer / Synopsys Designware UART"}, {"HISI0031", &uart_ns8250_class, 0, 2, 0, 200000000, UART_F_BUSY_DETECT, "HiSilicon / Synopsys Designware UART"}, From nobody Mon Sep 2 08:50:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XT6lR7z5Mp6d; Mon, 02 Sep 2024 08:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy2XT1v2pz42MY; Mon, 2 Sep 2024 08:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SpT5rEju7Ew++r/DNDb2jrNqM3ebjua9OoVHfLc7JXg=; b=o/YunXOcHnJGThmj2fUgTymiLIoZ9Dv9fa+EJJd6mBwrbcUpV8P5ZBIQu0XfUOLeMgGU4a SZHyXfTlvwEz3XRss0o89CjVa2VQdsG6Scu6ZVuZy7wTcJa5Xms++U1T+Y30HaFSWUmp8X JGpfkQxYTJoiCwLwwAl05DQiXT26owBw+1c40qKNj6Cj9Zwjbk11L/kBbwucpMutt3YMP7 q6PrGAjvJqn7FSLXMi+3Bzh6PuTAAMQLIk5NqJrz8ZG+DKM5iZFBzML4OqgnYYQn25otd/ +qk5aJ4em673BSsAAUxcZDNiYYxayGauetlIEcjBNKy3bkvdAGYMDv+mDdC6SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267049; a=rsa-sha256; cv=none; b=QgRdXxcpW8fEZ27uQoUZOFjctdcePO8JAJwp49KQ7PDUCj2J4ZUIuGDpmCQ8vjmOE6bn2A kh9S3GDbCIA4X4K00Yu11vuP0pIq3WUwLs4UFaOZ7z509SKPL2k+Myu6/9IAa+MxV9IRIU 3OeHswUlY3ISv2tCTo+Rd7vv4M/5s1hiI6obNvH9YsPmfM2i1aohgDAtTYU9j+7/iVkofn 29OEHvAXeSR0arSebnZBFx9R2D98FiOI5yVtIG6gbq/oqDt+MV3gIFCBv7NOZd6Nq6y/M0 3P8xNdRCBOkGAh91PM6QV+btASPT4Qb4N0ARinvCBL+OxT5NDQdbydDguiVv2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SpT5rEju7Ew++r/DNDb2jrNqM3ebjua9OoVHfLc7JXg=; b=etm6+SGgdu0MGZ2ksuzYjYoXPun2cgFi36XOU+tRGmhAqrknrfT3mWs76XtUu1kQIEKYrb SXt6DJm+fkhgq6pPUMeJkmgtMuZ+TpaL2D9RWotjGCa1LMFulzNG85lUxc1MD/anObaQa8 /gt1h+1/Unzb2+7P/c+EBvBxrs+TK+UtCCgXNV7uyYU4rQJ4JNkt24EJWZInY0JB42/J2V SdYkmrRZMo+lU9Y5i4+Ta88OpzsVRvL0XXcfv4/wEgj9LLYwVPUjwdaAgkFImOWCbiZPYK XxhrcFEv4vySseVg+Ijnd/uYx/4zqn/J1wbVQWNf6w9WMwveEqS+V/1njwVYZA== 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 4Wy2XT1TJpz1597; Mon, 2 Sep 2024 08:50:49 +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 4828on55007411; Mon, 2 Sep 2024 08:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828on7K007408; Mon, 2 Sep 2024 08:50:49 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:49 GMT Message-Id: <202409020850.4828on7K007408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: be3d6ab9e147 - stable/14 - buf_ring: Remove PREFETCH_DEFINED List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: be3d6ab9e14790848e9331db27d48f92d6160bef Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=be3d6ab9e14790848e9331db27d48f92d6160bef commit be3d6ab9e14790848e9331db27d48f92d6160bef Author: Andrew Turner AuthorDate: 2024-07-29 10:28:15 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Remove PREFETCH_DEFINED I'm not able to find anything in the tree that ever defined it. Remove as it's unused so is untested. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46148 (cherry picked from commit 5048308bdb76f40e88c9133658fc61d82158ded2) --- sys/sys/buf_ring.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index cb18175c3a75..6bd3b91dcd04 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -165,9 +165,6 @@ static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { uint32_t cons_head, cons_next; -#ifdef PREFETCH_DEFINED - uint32_t cons_next_next; -#endif uint32_t prod_tail; void *buf; @@ -204,20 +201,10 @@ buf_ring_dequeue_sc(struct buf_ring *br) prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = (cons_head + 1) & br->br_cons_mask; -#ifdef PREFETCH_DEFINED - cons_next_next = (cons_head + 2) & br->br_cons_mask; -#endif if (cons_head == prod_tail) return (NULL); -#ifdef PREFETCH_DEFINED - if (cons_next != prod_tail) { - prefetch(br->br_ring[cons_next]); - if (cons_next_next != prod_tail) - prefetch(br->br_ring[cons_next_next]); - } -#endif br->br_cons_head = cons_next; buf = br->br_ring[cons_head]; From nobody Mon Sep 2 08:50:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XV50PXz5Mnyb; Mon, 02 Sep 2024 08:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy2XV30hwz42QF; Mon, 2 Sep 2024 08:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ek5YanpJxnukBV7V+v2Qwn/0+60xYAECF130XLZoC2A=; b=EZn9sd4i5H/Tw51vSRtx1YK3h7xCcLYTh5srX2qTTe2bnRtYTuNhtfgq/ZQSmLv1Ab4U8Y z3kG0acRA8JejPsD8a/MLj2rfMLeb2JqFYC3959jMwI2IBRMkrFLqOrXAP4cFaGkF32Bla eY+QNUCLsgbqtZkoK0eKZPqkdjHB+eJZkMTVCiLsUrPx60Kg0vkpyjS2SVv3m8cdA5Pljm FHIreNBsE8mV+6OHzv68o6SYiHpbkmEdLc2sWAiQ8mh0EQ8YL4QF83mRJ+DQ8Ysa0mRiyV heyzmj31kFmSYl6QymO36vvZ9c+A+73SlffSa00tYap3caRHs++fonJS/v5OCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267050; a=rsa-sha256; cv=none; b=xoKRKrZoy1038x7v5kvRm1tZCgTkF71RrmOzpWPZw2oIorxO+4evTOqFZ5oIWbNE4+Vc5h UuoGh1Y9NuNMP35W1irAxpVrl9D41UMjuLmPwL28v73IED4u0jJM4wHqHh/dEcor5B2vAE dS13NzT3HD6Qi/OYvKmtAsLeZZ78HDP1YLrBV9W7IxidBMujIjTbFW40p6DIHhuzN467Je hdB4F9BzPssB6FG5BQ78/qwKpADrfaP3BuWYPAZryLJtA0ryiKSDEIaLpJGzLIZOWuT1tz sOflVEEmPd2uUTCZWSvqNXnD1iEIO/7qyQyJsljgDUpFRBJS/BFKaS9StuQm6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ek5YanpJxnukBV7V+v2Qwn/0+60xYAECF130XLZoC2A=; b=MsFwqx328bm7Qp8wgDuN/X9WKyqDHQcQnAWwvVe2ZnsbyQ6Zh6M5PQ/nYgiJuqV1S/xcwi bVidz6Mf7nDMkRAdaCU7WVxyv7gg5zo7MnHSWKvZ1x0IFkDXqc2YA/ApLJVx6zi6TG1+rA tGlPmsF9LeyQVGSR/njrKmxkQbKZbZwrINySejH0HpHRwZh2w413McD6Vjh2i/MkT3QsoT 14Hg7ycsQ+m4rhDcbGjSyXdugJ6AbvqBTOUPEOG4/pa96TDl5iMTGzpZOZ188nqjUVd2a3 IBuwAQWPPis0kCK4P4mlMYONfO0dchZouk6PM0RXmxfeHFSCY4/KCBe/AyPaeg== 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 4Wy2XV2D2sz15LW; Mon, 2 Sep 2024 08:50:50 +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 4828ooKm007463; Mon, 2 Sep 2024 08:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ooVJ007460; Mon, 2 Sep 2024 08:50:50 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:50 GMT Message-Id: <202409020850.4828ooVJ007460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 8ecb8e1c38e8 - stable/14 - buf_ring: Support DEBUG_BUFRING in userspace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ecb8e1c38e80ec2aae73536522fe2932af65ee8 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8ecb8e1c38e80ec2aae73536522fe2932af65ee8 commit 8ecb8e1c38e80ec2aae73536522fe2932af65ee8 Author: Andrew Turner AuthorDate: 2024-07-29 10:28:24 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Support DEBUG_BUFRING in userspace The only part of DEBUG_BUFRING we don't support in userspace is the mutex checks. Add _KERNEL checks around these so we can enable the extra debugging. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46149 (cherry picked from commit d3d34d56bee4222b3bf3ec26d7877998405115a3) --- sys/sys/buf_ring.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 6bd3b91dcd04..2d61f393712d 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -35,13 +35,9 @@ #include #include -#ifdef DEBUG_BUFRING -#ifdef _KERNEL +#if defined(DEBUG_BUFRING) && defined(_KERNEL) #include #include -#else -#error "DEBUG_BUFRING is only supported in kernel" -#endif #endif struct buf_ring { @@ -54,7 +50,7 @@ struct buf_ring { volatile uint32_t br_cons_tail; int br_cons_size; int br_cons_mask; -#ifdef DEBUG_BUFRING +#if defined(DEBUG_BUFRING) && defined(_KERNEL) struct mtx *br_lock; #endif void *br_ring[0] __aligned(CACHE_LINE_SIZE); @@ -210,8 +206,10 @@ buf_ring_dequeue_sc(struct buf_ring *br) #ifdef DEBUG_BUFRING br->br_ring[cons_head] = NULL; +#ifdef _KERNEL if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); +#endif if (br->br_cons_tail != cons_head) panic("inconsistent list cons_tail=%d cons_head=%d", br->br_cons_tail, cons_head); @@ -277,7 +275,7 @@ static __inline void * buf_ring_peek(struct buf_ring *br) { -#ifdef DEBUG_BUFRING +#if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif @@ -296,9 +294,9 @@ buf_ring_peek(struct buf_ring *br) static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { -#ifdef DEBUG_BUFRING void *ret; +#if defined(DEBUG_BUFRING) && defined(_KERNEL) if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif @@ -320,17 +318,15 @@ buf_ring_peek_clear_sc(struct buf_ring *br) atomic_thread_fence_acq(); #endif + ret = br->br_ring[br->br_cons_head]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - ret = br->br_ring[br->br_cons_head]; br->br_ring[br->br_cons_head] = NULL; - return (ret); -#else - return (br->br_ring[br->br_cons_head]); #endif + return (ret); } static __inline int From nobody Mon Sep 2 08:50:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XW67hSz5Mp41; Mon, 02 Sep 2024 08:50: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 4Wy2XW43qxz42ST; Mon, 2 Sep 2024 08:50:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hz2dtQHA6NzTAvt5HdBvOxnt2tqmo1RHVMhwL8tCYvc=; b=Mi9podq6+a+94dOXrQ+6wOT4quar0+M5Njt/cbAdcAhs2u8y2HksJ5GcnyhJlui0p4gaJS iiluLF60WOVJfKTFtrVJjm2NGfB9CaCM9HJyuqqd8p1mjvTDPtEKDCjh2mELcMV7bO+HBx RrnpPp+BDvZ6jyqPQNejlv0NrHYU/iW00Mk7VF+vbFFubpxFHKfIRWHA3MvQMbvMvKA8h5 OnN/eh4lkQPZnda/ilW3G0Vf2lhiC+aG1HrDNqRB9xyclKkm/6mXEk/0POQXU1D9TtuMTJ kZnh6yawLZT7Ine3rSBkMyt9iWEyz6qRAhuKm2j5rpKZIM2rsUMYn9OXw0llUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267051; a=rsa-sha256; cv=none; b=CyW31pyKo8fh3RDOxS6Z1eoqB4/cLnf8SucJiVJNIb68k4v+QMulWCaYFYu9cstXKWcsDb 0lLn+XdT8T6DA6DwKH9AJDgO+GGqYhacSo2ZgkprFepZ1nnF0WwpB6oopwM6We8KMjKiyz C45SFnMKQbb1qwaBId7PZuBAWOYag2oNV3BT2jJiF+zY7RIOdNm1QgurO4vDxkZnlqlyA9 J4hrDUIxTKSUeYsBsylFW6EP8CHEWQUuAwIW+8heiz7dg9Yi9d4ns62rH4Vw6Ee5ksHVOU IHJF3+Ag+UyD7afDbqnvYa9Xs1xGlLUAN8oHnEkjRL/I5ReOlPd+XpROWgxpNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hz2dtQHA6NzTAvt5HdBvOxnt2tqmo1RHVMhwL8tCYvc=; b=XsXLyMXWSNs2rDJrjgpaLOY2JmfW/eLF4iwIYYYJCUbNfgKjI6OIFgUGOxvDdGBZlm8wvV X4gPA4BYQLebC14KZzzisJWGYcrgBqqMtVBvIN6oSVrvsVVo07SqYpwF9SfOKBILltiM1k 5oyg6V9gYOoDxmovUfah88ZUsxUXg9lI6r9RGVyPU7VFgNX3G9CAbIjEr/9DZNHsKfUGly 5oVUPiNEnB9HY7z0aTDC+h3Zj4Guge0ACJlQh7yOMq2WTKKuCl3J4EZ7VPIhXsWRV/H7t2 TNIC/JClalvgHmH8crSztpWZyxj3TVIORm78GIV9W+ggY/blQqSIz9TTThshYg== 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 4Wy2XW3Wk5z15P0; Mon, 2 Sep 2024 08:50: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 4828opOp007503; Mon, 2 Sep 2024 08:50:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828op7D007500; Mon, 2 Sep 2024 08:50:51 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:51 GMT Message-Id: <202409020850.4828op7D007500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: be17061faf3b - stable/14 - buf_ring: Consistently use atomic_*_32 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: be17061faf3b9811202b335cbf19b2b14aacfa01 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=be17061faf3b9811202b335cbf19b2b14aacfa01 commit be17061faf3b9811202b335cbf19b2b14aacfa01 Author: Andrew Turner AuthorDate: 2024-07-29 10:28:33 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Consistently use atomic_*_32 We are operating on uint32_t values, use uint32_t atomic functions. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46150 (cherry picked from commit 17a597bc13aa59ee90facaf9b8dada80f32eb52d) --- sys/sys/buf_ring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 2d61f393712d..47ed04f570c1 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -94,7 +94,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) } continue; } - } while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); #ifdef DEBUG_BUFRING if (br->br_ring[prod_head] != NULL) panic("dangling value in enqueue"); @@ -108,7 +108,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) */ while (br->br_prod_tail != prod_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_prod_tail, prod_next); + atomic_store_rel_32(&br->br_prod_tail, prod_next); critical_exit(); return (0); } @@ -132,7 +132,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_exit(); return (NULL); } - } while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next)); + } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); buf = br->br_ring[cons_head]; #ifdef DEBUG_BUFRING @@ -146,7 +146,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) while (br->br_cons_tail != cons_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_cons_tail, cons_next); + atomic_store_rel_32(&br->br_cons_tail, cons_next); critical_exit(); return (buf); From nobody Mon Sep 2 08:50:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XY0cwwz5Mp21; Mon, 02 Sep 2024 08:50: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 4Wy2XX4XG2z42KY; Mon, 2 Sep 2024 08: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=1725267052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aOMO3ZOq0qcGEScm3ooxL+ZR68Fehsvhi+5f0Agj9dw=; b=iBTFBSPMQwmkQdfBQIfv/3mYK8cXFraZl73JvFDUvzV9bl6DIpcYV/3dwvL7NSeYQnLWJz EcjlevDBerXiU1EcCXCjLbmTPNDHF8l52IrZmT2Tcb+k60R2eqD6eL63TIS7eqgpJ99HeU tXMtiS6jhjAJKWjKzdaOO/xJpkuyT4jeIAIwe/Q54KM3ZSX3sCs6xRu3khvGqX+D2g0hGi 1EdSALog/kVK6Cork4fjJWDCf5VqffSYOjwiAc8AkxNFDei+f/M2ri30C78QKpANWYlx26 bKyCcr/aALbqN65Q/menBnd8C+w/iNC8javwnLggbXbmgl3nQSreNrMNJ2NVpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267052; a=rsa-sha256; cv=none; b=xvKlR2zwcVsUskPiwEI/TvBU+kfGUV3gEqvllNGulRR3ejHJaLfmbLtRzrsiLVr3TDUZpS 8b9IaDYzWhh/rud2H+q28oTQv5kh2hYdkjYArol9vwyagDWepLV868BIiiYJhgCuLuzxpn KiD4rm9IxKKj6NlPOpkAs4sxRXxPLzFMVzujcz+GIIhcrQRzCYBTFMBeABYH4rvAaUuZl4 3nrXDcHDOJCN8T6lDrMxKfL9i5/lPV01UCbGXJ848vkgbf0zCB9U+RQNzO92BfisRw46BC 6Ur++zcnBQfsjfQrZTYKkiEgsa36Mrix4IQo4i4eUXCXlDjXFJjgTMn9UtF8Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aOMO3ZOq0qcGEScm3ooxL+ZR68Fehsvhi+5f0Agj9dw=; b=px9DjQ1OVrC4a0Hz4jhQzj+PkrKbk9bMSq2TnWi5sT/JQiQ8c3thQO4mnGZNvkaAfkq7Ba lXvjFd7gBR3JZXJ2IPvHKmF9oA253UjJNndI9ZZa8dfapSPivV6qK7tKyPoPOQN4v+N1e/ SAKB90aV5pQNTfuEe+sNS4baDy6iPTN02XMh5Prs6PKAxaloyZL1ldeMMTDJqb+MUWmttq F+7BD9LRm4GxQKLYLSPgf/l6c9ekzkU3Ddu4zQ/aupqO+1MDEl1jHM/vJTpO/kMU9Uiyku BMgNkLFt7/ugbPhyvsMSvacoR7myre+vyS3oUXxbo2HqqssNrmwOtMOF0Y1/Zg== 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 4Wy2XX43gDz14qP; Mon, 2 Sep 2024 08: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 4828oqlE007554; Mon, 2 Sep 2024 08: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 4828oq8x007551; Mon, 2 Sep 2024 08:50:52 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:52 GMT Message-Id: <202409020850.4828oq8x007551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 56e8c3ec5241 - stable/14 - buf_ring: Keep the full head and tail values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 56e8c3ec5241ec4747b8fdd42e0172325c7fc378 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=56e8c3ec5241ec4747b8fdd42e0172325c7fc378 commit 56e8c3ec5241ec4747b8fdd42e0172325c7fc378 Author: Andrew Turner AuthorDate: 2024-08-19 09:06:44 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Keep the full head and tail values If a thread reads the head but then sleeps for long enough that another thread fills the ring and leaves the new head with the expected value then the cmpset can pass when it should have failed. To work around this keep the full head and tail value and use the upper bits as a generation count. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46151 (cherry picked from commit 3cc603909e09c958e20dd5a8a341f62f29e33a07) --- sys/sys/buf_ring.h | 87 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 31 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 47ed04f570c1..dec0f971ae44 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -40,6 +40,15 @@ #include #endif +/* + * We only apply the mask to the head and tail values when calculating the + * index into br_ring to access. This means the upper bits can be used as + * epoch to reduce the chance the atomic_cmpset succeedes when it should + * fail, e.g. when the head wraps while the CPU is in an interrupt. This + * is a probablistic fix as there is still a very unlikely chance the + * value wraps back to the expected value. + * + */ struct buf_ring { volatile uint32_t br_prod_head; volatile uint32_t br_prod_tail; @@ -63,28 +72,28 @@ struct buf_ring { static __inline int buf_ring_enqueue(struct buf_ring *br, void *buf) { - uint32_t prod_head, prod_next, cons_tail; -#ifdef DEBUG_BUFRING - int i; + uint32_t prod_head, prod_next, prod_idx; + uint32_t cons_tail, mask; + mask = br->br_prod_mask; +#ifdef DEBUG_BUFRING /* * Note: It is possible to encounter an mbuf that was removed * via drbr_peek(), and then re-added via drbr_putback() and * trigger a spurious panic. */ - for (i = br->br_cons_head; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if (br->br_ring[i] == buf) + for (uint32_t i = br->br_cons_head; i != br->br_prod_head; i++) + if (br->br_ring[i & mask] == buf) panic("buf=%p already enqueue at %d prod=%d cons=%d", buf, i, br->br_prod_tail, br->br_cons_tail); #endif critical_enter(); do { prod_head = br->br_prod_head; - prod_next = (prod_head + 1) & br->br_prod_mask; + prod_next = prod_head + 1; cons_tail = br->br_cons_tail; - if (prod_next == cons_tail) { + if ((int32_t)(cons_tail + br->br_prod_size - prod_next) < 1) { rmb(); if (prod_head == br->br_prod_head && cons_tail == br->br_cons_tail) { @@ -95,11 +104,12 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) continue; } } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); + prod_idx = prod_head & mask; #ifdef DEBUG_BUFRING - if (br->br_ring[prod_head] != NULL) + if (br->br_ring[prod_idx] != NULL) panic("dangling value in enqueue"); #endif - br->br_ring[prod_head] = buf; + br->br_ring[prod_idx] = buf; /* * If there are other enqueues in progress @@ -120,23 +130,26 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { - uint32_t cons_head, cons_next; + uint32_t cons_head, cons_next, cons_idx; + uint32_t mask; void *buf; critical_enter(); + mask = br->br_cons_mask; do { cons_head = br->br_cons_head; - cons_next = (cons_head + 1) & br->br_cons_mask; + cons_next = cons_head + 1; if (cons_head == br->br_prod_tail) { critical_exit(); return (NULL); } } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); + cons_idx = cons_head & mask; - buf = br->br_ring[cons_head]; + buf = br->br_ring[cons_idx]; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_idx] = NULL; #endif /* * If there are other dequeues in progress @@ -160,8 +173,8 @@ buf_ring_dequeue_mc(struct buf_ring *br) static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next; - uint32_t prod_tail; + uint32_t cons_head, cons_next, cons_idx; + uint32_t prod_tail, mask; void *buf; /* @@ -189,6 +202,7 @@ buf_ring_dequeue_sc(struct buf_ring *br) * * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. */ + mask = br->br_cons_mask; #if defined(__arm__) || defined(__aarch64__) cons_head = atomic_load_acq_32(&br->br_cons_head); #else @@ -196,16 +210,17 @@ buf_ring_dequeue_sc(struct buf_ring *br) #endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); - cons_next = (cons_head + 1) & br->br_cons_mask; + cons_next = cons_head + 1; - if (cons_head == prod_tail) + if (cons_head == prod_tail) return (NULL); + cons_idx = cons_head & mask; br->br_cons_head = cons_next; - buf = br->br_ring[cons_head]; + buf = br->br_ring[cons_idx]; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_idx] = NULL; #ifdef _KERNEL if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); @@ -226,18 +241,21 @@ buf_ring_dequeue_sc(struct buf_ring *br) static __inline void buf_ring_advance_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next; - uint32_t prod_tail; + uint32_t cons_head, cons_next, prod_tail; +#ifdef DEBUG_BUFRING + uint32_t mask; + mask = br->br_cons_mask; +#endif cons_head = br->br_cons_head; prod_tail = br->br_prod_tail; - cons_next = (cons_head + 1) & br->br_cons_mask; - if (cons_head == prod_tail) + cons_next = cons_head + 1; + if (cons_head == prod_tail) return; br->br_cons_head = cons_next; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_head & mask] = NULL; #endif br->br_cons_tail = cons_next; } @@ -261,9 +279,12 @@ buf_ring_advance_sc(struct buf_ring *br) static __inline void buf_ring_putback_sc(struct buf_ring *br, void *new) { - KASSERT(br->br_cons_head != br->br_prod_tail, + uint32_t mask; + + mask = br->br_cons_mask; + KASSERT((br->br_cons_head & mask) != (br->br_prod_tail & mask), ("Buf-Ring has none in putback")) ; - br->br_ring[br->br_cons_head] = new; + br->br_ring[br->br_cons_head & mask] = new; } /* @@ -274,11 +295,13 @@ buf_ring_putback_sc(struct buf_ring *br, void *new) static __inline void * buf_ring_peek(struct buf_ring *br) { + uint32_t mask; #if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif + mask = br->br_cons_mask; /* * I believe it is safe to not have a memory barrier * here because we control cons and tail is worst case @@ -288,12 +311,13 @@ buf_ring_peek(struct buf_ring *br) if (br->br_cons_head == br->br_prod_tail) return (NULL); - return (br->br_ring[br->br_cons_head]); + return (br->br_ring[br->br_cons_head & mask]); } static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { + uint32_t mask; void *ret; #if defined(DEBUG_BUFRING) && defined(_KERNEL) @@ -301,6 +325,7 @@ buf_ring_peek_clear_sc(struct buf_ring *br) panic("lock not held on single consumer dequeue"); #endif + mask = br->br_cons_mask; if (br->br_cons_head == br->br_prod_tail) return (NULL); @@ -318,13 +343,13 @@ buf_ring_peek_clear_sc(struct buf_ring *br) atomic_thread_fence_acq(); #endif - ret = br->br_ring[br->br_cons_head]; + ret = br->br_ring[br->br_cons_head & mask]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - br->br_ring[br->br_cons_head] = NULL; + br->br_ring[br->br_cons_head & mask] = NULL; #endif return (ret); } @@ -333,7 +358,7 @@ static __inline int buf_ring_full(struct buf_ring *br) { - return (((br->br_prod_head + 1) & br->br_prod_mask) == br->br_cons_tail); + return (br->br_prod_head == br->br_cons_tail + br->br_cons_size - 1); } static __inline int From nobody Mon Sep 2 08:50:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2XY6Xztz5Mnxg; Mon, 02 Sep 2024 08:50: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 4Wy2XY5QPqz42YJ; Mon, 2 Sep 2024 08:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/JLzZTw6sE3FhxkAikcxI9MLfHpGjV4cKMkYvL9LWLs=; b=RDsEzNthuIngbNQPiKLgK+kmnKZKAe3fRSdsPe4LjDSjadzfU+V9gUYdIHTAIZxc4oaTVr Tbwj6rEih+7XR8drqa/elAnX5nsmTLogSslyqwiMazXwULoT0K49OOfvWkIcJD0Pc8SEbc jDdsBSTvS44zjh/l5IqRAV+ETGu6jn6SYQPHSM7n5g9OdqXF93WacE/CGUEg82CZC7DzIJ 1Yh6cMJ3CYj6T0WKfcq7HCjOrvkfuuw/2wM8QT8XBnLX3tFnRPfMpPaAyU1h4w/D+4fyIM 0fV46t0ctOXWKZrQgb4gdQ6ZewcGFvvD6xZXNdn5v6VkuOdWzoKWyxrsvP56YA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267053; a=rsa-sha256; cv=none; b=bR8pZZxploI8Oz8Tn3hvln6oS0q5kDqWip54Dc+ja7ksyooUmMauKdF9vNy1ce1x3jDT8L TA8lZJbo1oKup+d3bhnKYbpQIQgWJmImmIoXcHtAC0UFyPkCmw3HQb/jRPL0SmsXYdkUoq x1kbeY+tkq1ePC4yg7YbTCIivTnHkOFc0l7uQtNMfeErq30kUB4GRsoOL2jw6nsQojs27t ekQmDRpTsjTQsQI62IprHid8biDmUIrYk+nJ36/gZJR9T26HUhhAJ4Ug/MDz7GFx6ehrYS rv/nvsnSFx2jDen1Uc12AeURVwYeMO11C/dYpNJXv5VMLD0MAXoLpS5pFORBEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/JLzZTw6sE3FhxkAikcxI9MLfHpGjV4cKMkYvL9LWLs=; b=W0aqHQKGoyTGZ5wllbo3UgIaL22ul8l/p95chR1HGmZ+boWOh+lSViROCmOp6XHH6GXWwa a0GqZP+OrGHjf9DmKUZ9ZwonbVE3RKqOv0IzdXCGZ/3hiAaIstUIFMTJWg5SOG3AfSUWHV oHqRSBjL+yp0RgWLRkVgE6vSsvb60AEeriMHTlSJ6MQLFtyylGtqN9Zshr3+0kIbwBxabn dfiNnBXLNCh0+rAXQkApqeP/QKZqE5xo8KNa4t1vQDwEgBlQkqOHw2GeGvrlvtg4yHmDyX wUW8AFictI+sVcI3LQP4ptZrx3jIncdSwbl0BJp8qlHGIAvFhTy3K4YMOPZw5g== 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 4Wy2XY52QLz15LZ; Mon, 2 Sep 2024 08:50: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 4828orZx007604; Mon, 2 Sep 2024 08:50:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828orij007601; Mon, 2 Sep 2024 08:50:53 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:53 GMT Message-Id: <202409020850.4828orij007601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 80df53c7fb1c - stable/14 - buf_ring: Use atomic operations with br_cons_tail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80df53c7fb1cefffff419adbb0767f36a44c27d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=80df53c7fb1cefffff419adbb0767f36a44c27d2 commit 80df53c7fb1cefffff419adbb0767f36a44c27d2 Author: Andrew Turner AuthorDate: 2024-08-19 09:06:52 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Use atomic operations with br_cons_tail Use an atomic operation with a memory barrier loading br_cons_tail from the producer thread and storing to it in the consumer thread. On dequeue we need to read the pointer value from the buf_ring before moving the consumer tail as that indicates the entry is available to be used. The store release atomic operation guarantees this. In the enqueueing thread we then need to use a load acquire atomic operation to ensure writing to this entry can only happen after the tail has been read and checked. Reported by: Ali Saidi Co-developed by: Ali Saidi Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46152 (cherry picked from commit 44e1cfca417c5ef0db908f3836ec3ba704ef1de2) --- sys/sys/buf_ring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index dec0f971ae44..9aeb5aa19fa8 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -91,7 +91,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) do { prod_head = br->br_prod_head; prod_next = prod_head + 1; - cons_tail = br->br_cons_tail; + cons_tail = atomic_load_acq_32(&br->br_cons_tail); if ((int32_t)(cons_tail + br->br_prod_size - prod_next) < 1) { rmb(); @@ -229,7 +229,7 @@ buf_ring_dequeue_sc(struct buf_ring *br) panic("inconsistent list cons_tail=%d cons_head=%d", br->br_cons_tail, cons_head); #endif - br->br_cons_tail = cons_next; + atomic_store_rel_32(&br->br_cons_tail, cons_next); return (buf); } @@ -257,7 +257,7 @@ buf_ring_advance_sc(struct buf_ring *br) #ifdef DEBUG_BUFRING br->br_ring[cons_head & mask] = NULL; #endif - br->br_cons_tail = cons_next; + atomic_store_rel_32(&br->br_cons_tail, cons_next); } /* From nobody Mon Sep 2 08:50:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xb0LhJz5Mp6m; Mon, 02 Sep 2024 08:50: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 4Wy2XZ6cMtz42md; Mon, 2 Sep 2024 08:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eGPJKDw7lpWixfg75LaM//VdNbJnlrPut6do6exlhnM=; b=VFwTiqzeavU+8mQ0US5A8D3pEREp0tR++l7Tah8CpDOHCV/CvOIMt33L8daGQNDvBHjS+V v9PAQfQRTjTx/HVLtjjK3ze1iFGQ9r9bgj9hBUxUoUt8NKyKT1sFpgPQb4bsTSOQjAGyc3 Se05bCC6kdjD42wLCuBBn2F523CwUVU6OYf4RljfOO3mo3AYsZ1HZ7P0/kxy+L/vgqSVrn SnGSsSijZFicrhT1GoZGRgivYJavwCz5nmqSInjDKfBPrX/6IOyJZ/qjVX44XCrhP7T9PE HqGZClnf5bTQ4TdNV4PdmpkRz2tYCLryLLM14wzz0K0ftN3V86wxxub7/C7LGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267054; a=rsa-sha256; cv=none; b=cjGfx2ne/WWGKDh82PspSj111hrjR60ciIf4BUTO/9nLFh5uyUYAFZABbCA9r4uxS2qSD6 U3bROBW9sIMQDg+0T6rCM5ItJDTD3iy5jo8vnnIcsp3qY1//FsnQmZGkhR0SbAD/4j6/wh Ex7/7N7S6/J9Itf0Ga8I1I5Cmohmm76zCX/7FU8/IgA0m2LEDBCsXnd0FG42MB33xonKDC PacN1E1lc7gEJzpJubphrtRAsnHUF/9Tuvzazi5XD6TZrcMmo2eR2YnelNF4kABqBntgOC 7mjkpU7A2cSgRc80wBUz7MVJnKL/KTyauhovhFczER0ogtb5TMh0oZF22rkPNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eGPJKDw7lpWixfg75LaM//VdNbJnlrPut6do6exlhnM=; b=keMSXekhuy594DsQjC5pt2CCV+Dar2fNb3tYS2dJNFdoH75e7n4HqGWUjvLkQR4sI6bjBP 1GoVyB94msjtxiF8b3NzxiqDR84tCF6f5ie3ucYkqeV59IjstfSLluW/SeKi3akG4BMYXv n6cD72WcU3BsFqxoyk6wD88TG7O4JbHN6LPkHocaYKLfGyInxyyFwrBQ1N2FtZg5Kk1o9h LpQ2SLEgmZRsOaZ650uF0r3X5thnQVSlWlSgSPMvaYNcfhvwPLedSsmf0VQqeINnyrvGC9 diRDnKCuVBD5jUMw8HfjSffmHf+Zv6YE/s2XoNlwjPf1Ah0LEM9c99YTwN8Dew== 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 4Wy2XZ69pPz14qQ; Mon, 2 Sep 2024 08:50: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 4828osa4007653; Mon, 2 Sep 2024 08:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828os6C007650; Mon, 2 Sep 2024 08:50:54 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:54 GMT Message-Id: <202409020850.4828os6C007650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 14c779e5caf0 - stable/14 - buf_ring: Remove old arm-only dequeue code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14c779e5caf09746a0e098378c2c09b897f0e177 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=14c779e5caf09746a0e098378c2c09b897f0e177 commit 14c779e5caf09746a0e098378c2c09b897f0e177 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:10 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Remove old arm-only dequeue code In the single consumer dequeue the consumer thread controls br_cons_head. As such no ordering between this and other data are required. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46153 (cherry picked from commit 7eb0fffc7792bc294d6b86546a3923e2e2f83f8a) --- sys/sys/buf_ring.h | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 9aeb5aa19fa8..ad463fba27cb 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -177,37 +177,8 @@ buf_ring_dequeue_sc(struct buf_ring *br) uint32_t prod_tail, mask; void *buf; - /* - * This is a workaround to allow using buf_ring on ARM and ARM64. - * ARM64TODO: Fix buf_ring in a generic way. - * REMARKS: It is suspected that br_cons_head does not require - * load_acq operation, but this change was extensively tested - * and confirmed it's working. To be reviewed once again in - * FreeBSD-12. - * - * Preventing following situation: - - * Core(0) - buf_ring_enqueue() Core(1) - buf_ring_dequeue_sc() - * ----------------------------------------- ---------------------------------------------- - * - * cons_head = br->br_cons_head; - * atomic_cmpset_acq_32(&br->br_prod_head, ...)); - * buf = br->br_ring[cons_head]; > - * br->br_ring[prod_head] = buf; - * atomic_store_rel_32(&br->br_prod_tail, ...); - * prod_tail = br->br_prod_tail; - * if (cons_head == prod_tail) - * return (NULL); - * ` - * - * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. - */ mask = br->br_cons_mask; -#if defined(__arm__) || defined(__aarch64__) - cons_head = atomic_load_acq_32(&br->br_cons_head); -#else cons_head = br->br_cons_head; -#endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = cons_head + 1; From nobody Mon Sep 2 08:50:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xc2xWKz5Mntn; Mon, 02 Sep 2024 08:50: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 4Wy2Xc06lnz42my; Mon, 2 Sep 2024 08:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s0nqLoe2cv9W6NRXOvb9hMHqHPvanWKX4/kPjk1jgDs=; b=Tk1pGjcDagf+NKe1rZCwuKq1uXK/Kc80BqHHqYVbxjgVLP5l/cX6PBQ9gFxPOZao8Ady14 UBJCMbTM96M+sN4vULyNI98YQw4e2A8uxSQesdlFyY8x6S0h28uvW9cBHL6jdpi+5H64or a8Su1MwrOluVME/Bt25H6Xhsf0+KJR3X+U8u8xxSV4faj9Qb1XdiIdSGkI2VT7KkH8abd/ JPE9YjoSt+yJUrTfaObfpsWf8Wb+s4VfSXEbLgVo4EYzIdp4rY/ysUr6jaLN6lGynj07R4 OzJzys8GLcIC4Us1GUoATUxywErDrWu2z9n7G63oaT1I8KSzQQnZs7D8MRB66A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267056; a=rsa-sha256; cv=none; b=DXbgPMMVeKRw1+WJXRiy2KXtMn/wS0kUJBqPXWOsy0poAjnqYTFaLkCtipaqdmRiW9EoXf EQf0fXhs6IzpHrNs2I1BgBda6KsssPwMkYWKmV8ADN6ZTPTcqlcye+FR3St4VoN1/kB2hs poB8wPdJWI+qWT5hE1Q++4vzut9gT5yeqCCuCWrfJ3JsFfhM/1FVQg5VUBVqnB8MQumsrY D+KfkduhS27uXZm2lkIK1jyT1EwQiwrcHabPl72s5imFREIfSO8ZlZSBuvSeVqTiw48zsX F/ToU76rxyBA5/GcG9kuyo7mpkeXS/zFFR/5WFRFABkGdziEZBdrkSkfuAKWHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s0nqLoe2cv9W6NRXOvb9hMHqHPvanWKX4/kPjk1jgDs=; b=tReBp6e72H7kun+0FTxnuS+Gq7AHL4XjUeWh2LTiQBZdT2jxNX9RHsvk/jhoHzBHgz3pgj 9dqSULsKRdl9/Ip4pTylIvZTWN7lIwZue/S1KfJygL71FNXhPsoiV1qzoAj0nDQzWu36vH X5ZLeraCFJWnZ0HktVLB/yVr8Yzie90ia7Lzy7XHszMy7CbiGYAmQN2DQXbNNiD0rK2qUG 5bOJ9n6aAcPDE2jP0nperzxSpqDaAtDf6HtEV6GRVQqQSUsdqXnOuNXsX2+2NMeRLzrKHK VqoJaRLFothJMKUuXLn59EPaUFAjmxmGD+zBVzEtADkMHaI0jHiV422s237gkw== 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 4Wy2Xb6mJqz156h; Mon, 2 Sep 2024 08:50: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 4828otVC007698; Mon, 2 Sep 2024 08:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828otAI007695; Mon, 2 Sep 2024 08:50:55 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:55 GMT Message-Id: <202409020850.4828otAI007695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: bfd435bfe8e1 - stable/14 - buf_ring: Use atomic operations with br_prod_tail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bfd435bfe8e1b740d932355831b8a3cc644c14ed Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=bfd435bfe8e1b740d932355831b8a3cc644c14ed commit bfd435bfe8e1b740d932355831b8a3cc644c14ed Author: Andrew Turner AuthorDate: 2024-08-19 09:07:19 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Use atomic operations with br_prod_tail As with br_cons_tail use an atomic load acquire to read br_prod_tail in buf_ring_dequeue_mc and buf_ring_peek*. On dequeue we need to ensure we don't read the entry from the buf_ring until it is available and prod_tail has updated. There is already an appropriate store in the enqueue path and an appropriate load in the single consumer dequeue, we just need one in the other functions that read from the buf_ring. Reviewed by: imp, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46154 (cherry picked from commit 947754af55edc217c10e3456d97558c4eb6d0f99) --- sys/sys/buf_ring.h | 45 ++++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index ad463fba27cb..66e1e55bc5e9 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -131,7 +131,7 @@ static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { uint32_t cons_head, cons_next, cons_idx; - uint32_t mask; + uint32_t prod_tail, mask; void *buf; critical_enter(); @@ -139,8 +139,9 @@ buf_ring_dequeue_mc(struct buf_ring *br) do { cons_head = br->br_cons_head; cons_next = cons_head + 1; + prod_tail = atomic_load_acq_32(&br->br_prod_tail); - if (cons_head == br->br_prod_tail) { + if (cons_head == prod_tail) { critical_exit(); return (NULL); } @@ -266,29 +267,26 @@ buf_ring_putback_sc(struct buf_ring *br, void *new) static __inline void * buf_ring_peek(struct buf_ring *br) { - uint32_t mask; + uint32_t cons_head, prod_tail, mask; #if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif mask = br->br_cons_mask; - /* - * I believe it is safe to not have a memory barrier - * here because we control cons and tail is worst case - * a lagging indicator so we worst case we might - * return NULL immediately after a buffer has been enqueued - */ - if (br->br_cons_head == br->br_prod_tail) + prod_tail = atomic_load_acq_32(&br->br_prod_tail); + cons_head = br->br_cons_head; + + if (cons_head == prod_tail) return (NULL); - return (br->br_ring[br->br_cons_head & mask]); + return (br->br_ring[cons_head & mask]); } static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { - uint32_t mask; + uint32_t cons_head, prod_tail, mask; void *ret; #if defined(DEBUG_BUFRING) && defined(_KERNEL) @@ -297,30 +295,19 @@ buf_ring_peek_clear_sc(struct buf_ring *br) #endif mask = br->br_cons_mask; - if (br->br_cons_head == br->br_prod_tail) - return (NULL); + prod_tail = atomic_load_acq_32(&br->br_prod_tail); + cons_head = br->br_cons_head; -#if defined(__arm__) || defined(__aarch64__) - /* - * The barrier is required there on ARM and ARM64 to ensure, that - * br->br_ring[br->br_cons_head] will not be fetched before the above - * condition is checked. - * Without the barrier, it is possible, that buffer will be fetched - * before the enqueue will put mbuf into br, then, in the meantime, the - * enqueue will update the array and the br_prod_tail, and the - * conditional check will be true, so we will return previously fetched - * (and invalid) buffer. - */ - atomic_thread_fence_acq(); -#endif + if (cons_head == prod_tail) + return (NULL); - ret = br->br_ring[br->br_cons_head & mask]; + ret = br->br_ring[cons_head & mask]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - br->br_ring[br->br_cons_head & mask] = NULL; + br->br_ring[cons_head & mask] = NULL; #endif return (ret); } From nobody Mon Sep 2 08:50:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xd2kKCz5Mp28; Mon, 02 Sep 2024 08:50: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 4Wy2Xd13T4z42kh; Mon, 2 Sep 2024 08:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJuNjRykyiwxYjF4cNlOksA57NMun+Ae4V9GKDzrCKo=; b=qk5fN2cGFJuxtn1LPsDW0Myy4ZMQqneCPqk8Vk7AQi/uM8OvcYWuEWJWy0BX8BFoI0TaBB yL81vUHk4NxFqNPVgFx8IkR8bAlL/RQJeM2F8Vtdf+HCeGyNZRMGBEzbnlAkRD4eATNBZn SpT1sV3sKzVpxK/i+f04bYgLt8I5zl6Een4ImoOB5Kx5SPgdoCPb1AlldlNe+lMkyevah9 op/7sE1J848wBlcrqn4+jQ60CFk/OGp97F5jx+1aVxAU7NapWzzRuwBXZW8N3ullMebQ41 XjhgVsCrdQym28fPMmdccSAHNZ6KQHw/DAhJ9WRTF3sM/+bOuOtXZ3QXykDGrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267057; a=rsa-sha256; cv=none; b=FCuJCl42VK0r5n14Rglc5/7v0R19IAdWq1kW57d3NDgcwpgNnsioiZGUcB0A44LzPpza5J 3Osn4hs25KBg22fiNmyyoOOlPSEwJkiQTPxqAMYrJ8uK4WoBMOtbaxr4JZNGjOzc8DmzxM KrRt1zSJmuq98ySN1sRq/YI2JckGixpiXIC5DcWkjUa/5OsSX1DNyQq+bcKJGoMkKWjIH5 8OaZ27WgXr1IXM0a1I21pz1yjm/lwv+m3F00GcJrs2iaQRZuUH2n94OsIHZ4Ei1g/+IKxc 2oX9lwDIEJUzmoHB32+FhAPZzwI9k8xCrBJxZd4h8d2nyHn/uvi/y5YMAc75Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJuNjRykyiwxYjF4cNlOksA57NMun+Ae4V9GKDzrCKo=; b=AnwVF3Dos6pSrdRogty5lV571acDKAzZeaYKAgqjl9et4jNT/gT94hvhUsw8xs7e4jFuM6 pabOUJVQ9EI/RSzhNxpFG+MWQnMZEkUTIv0mf/muMo3faxriJ6w3Yp9jibU3TYlxzSTX1N VM0KSNrijT0aGkx2TxiH6ntCLlJBhllf1gmrsLo856K1R8ZAwFR4MeKfL3Vbxu6jidy0wC BVjx2vAMExUzgnHGxtjYEJ4ueFOa3c3qyspb8AXjAWqDjX0dvFsMpJ2O+GRC5a1OE+iUSI quvexz5/xOYi5XS3i1d9fy1B+6quijVcRPtKK0ztklz8HXx9ucrtx9IK1r94Qw== 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 4Wy2Xd0c9fz153d; Mon, 2 Sep 2024 08:50: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 4828ourP007743; Mon, 2 Sep 2024 08:50:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828ouWI007740; Mon, 2 Sep 2024 08:50:56 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:56 GMT Message-Id: <202409020850.4828ouWI007740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 72ac0bd83df9 - stable/14 - buf_ring: Ensure correct ordering of loads List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72ac0bd83df93437d39bad7c4c3f196a398d40f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=72ac0bd83df93437d39bad7c4c3f196a398d40f0 commit 72ac0bd83df93437d39bad7c4c3f196a398d40f0 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:26 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Ensure correct ordering of loads When enqueueing on an architecture with a weak memory model ensure loading br->br_prod_head and br->br_cons_tail are ordered correctly. If br_cons_tail is loaded first then other threads may perform a dequeue and enqueue before br_prod_head is loaded. This will mean the tail is one less than it should be and the code under the prod_next == cons_tail check could incorrectly be skipped. buf_ring_dequeue_mc has the same issue with br->br_prod_tail and br->br_cons_head so needs the same fix. Reported by: Ali Saidi Co-developed by: Ali Saidi Reviewed by: imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46155 (cherry picked from commit fe2445f47d027c73aa7266669e7d94b70d3949a4) --- sys/sys/buf_ring.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 66e1e55bc5e9..512f20dc13e2 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -89,7 +89,17 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) #endif critical_enter(); do { - prod_head = br->br_prod_head; + /* + * br->br_prod_head needs to be read before br->br_cons_tail. + * If not then we could perform the dequeue and enqueue + * between reading br_cons_tail and reading br_prod_head. This + * could give us values where br_cons_head == br_prod_tail + * (after masking). + * + * To work around this us a load acquire. This is just to + * ensure ordering within this thread. + */ + prod_head = atomic_load_acq_32(&br->br_prod_head); prod_next = prod_head + 1; cons_tail = atomic_load_acq_32(&br->br_cons_tail); @@ -137,7 +147,12 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_enter(); mask = br->br_cons_mask; do { - cons_head = br->br_cons_head; + /* + * As with buf_ring_enqueue ensure we read the head before + * the tail. If we read them in the wrong order we may + * think the bug_ring is full when it is empty. + */ + cons_head = atomic_load_acq_32(&br->br_cons_head); cons_next = cons_head + 1; prod_tail = atomic_load_acq_32(&br->br_prod_tail); From nobody Mon Sep 2 08:50:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xf3pXSz5Mp6s; Mon, 02 Sep 2024 08:50: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 4Wy2Xf29SSz42kp; Mon, 2 Sep 2024 08:50:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzrB+M7EIGIiJvIjKLpQ3iKqmhkaK+LbhtXPBUrNd5g=; b=MMlobEqlHVpEv/NDzUBmxVrRnq/ZyVIUlqP5oPUzjI6GXjIVPbWfHQQEyOcb//kk4B/xgM J11zKeIucHdvn7OrKoLlSzsnr4exCiAVeizxOsvKyKl2WwkaM6ODPmYpZNUL4Rr/HnMIy+ 6X6lIATHt+ZlGMAwlzko1dex66andqvWUSsv9/OAfhafeMutNJz7tGRomTOlxGqGeCJvZt QVGZLDFj7JY/LdlhSwrcaz6WNKh01qbh9isDt6V09XWyoNdJqX82rnNcHGh3+B8b3VPism U9UJ96ltOSj0/jGH1GO7d+oC7GTvgV5c3OAuC29VNWUWehjQvQlwM3oP2Ock0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267058; a=rsa-sha256; cv=none; b=C+4P3xBZMT69BC74aeT2g7a3Og2rWRu6SDu9QefbYd24Js8/NGmIhknckduEcaftp7iJ6J raC35tbt3KyjrD8Q6ZiH4Ck6WVAxbM4jR8RZlRlNQIpy7S7Z5rIsZDnPqlzHLzMPf63Zgv ihTIIkj2jF2+D6TqWauDQA7nu8ng/hbq1ALf/a3ryVa/lGyGVMyLaqMTCuNKRQuY6hRyGv bPiacRfZTV2NwDFobQSJqBRAksqgSbZrMlJKtOcxnTlf9TChEUbQnoxboqf5ZDKn9+GqF3 rOWEdfXM1n6fGxFkwEwmSo596mquR5J0ZnPC+uHI0eF/M9lqDNiubY6Myd8D1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzrB+M7EIGIiJvIjKLpQ3iKqmhkaK+LbhtXPBUrNd5g=; b=TK3JJuTkhoINmRla5hoWC13K9XFwcaEFOwD2ftQDf74hcuYGeXyVYtU1OimYpsdtXhxrs7 HQP+gdpUjtqBWxPxZ7Mj+0z+j15b8sV/QKXO3FePCLGGEovqJYBudEwxjzXEcd+bkhvckF BVNkd18DXaREIx0/VtpDAzRfqfkpTwpquO+aUcK9/VAWsM+tCU12gEPGmG+HoNFBO7OKol 6T25oW9NsnBZeLNW7PuIvOMdyeqhYpFDWRw5L1KEi3Slb0ot1k9BdwovDzq1wd2DAcntvs t4DKw0DqDc/rPnRK+NnI0AhT1PcCsvx0jlBpM0UH7FOmFi6ybfGqygplWDATDw== 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 4Wy2Xf1cb9z14d7; Mon, 2 Sep 2024 08:50: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 4828owSZ007785; Mon, 2 Sep 2024 08:50:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828owKG007782; Mon, 2 Sep 2024 08:50:58 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:58 GMT Message-Id: <202409020850.4828owKG007782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0a5e9d280303 - stable/14 - buf_ring: Add an Arm copyright List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0a5e9d280303254f325d1530fcd9d60286056715 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0a5e9d280303254f325d1530fcd9d60286056715 commit 0a5e9d280303254f325d1530fcd9d60286056715 Author: Andrew Turner AuthorDate: 2024-08-19 09:08:20 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 buf_ring: Add an Arm copyright I've change enough of this file to add Arm as a copyright holder. Add it after the "All rights reserved" line as that's not needed. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46157 (cherry picked from commit 87940d2b331c2575f96fbff2600d8da35191157b) --- sys/sys/buf_ring.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 512f20dc13e2..c99cf81d8b6d 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -3,6 +3,7 @@ * * Copyright (c) 2007-2009 Kip Macy * All rights reserved. + * Copyright (c) 2024 Arm Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From nobody Mon Sep 2 08:50:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xh11gBz5MpCM; Mon, 02 Sep 2024 08:51: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 4Wy2Xg39wxz42ym; Mon, 2 Sep 2024 08:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2WSLc3pBXEV04PopHmurE7O56SSSkQZXe7r4k9kWRt0=; b=b5Q0N19CgyL1EdL2qZ0qOul7WOblRqy7WO9OTE2CDtcgjBwBx8Of2dBG/9Hj2rn3KzHqsK IH6hNCH/Jnm62iou9XGcI24yFcZEVNaMsL7wKgXNNPMNOg6uGab4AwE/lNDzIBes2y4Yft lyMypE+T9djMJxxIvtJJItfynoTr3/DsNGgrEQiK4uhf/CmWcW5c3YNxj9DnIp0+iHY1eD NO+EVhrM8rZCBB2WfnYJJ1pn7OGkTizR0kgR5VC/Kpy5B3srnNCNecbjJEGE9Eil5qXq1X YgPdiwDTrnGzxtSKv3oyHoSiVBQWoAXHFkjgD6OrtY0JUjmhny3lQMC6vNLBfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267059; a=rsa-sha256; cv=none; b=LoymgZwX/4DrFt7t8gnZNq3pzmgQFdHwvy13Z0OqoWlYHEheEx08wRSF+O02IPp7/lc9b9 rUADR6B7M8CprKufG2mB6yILqooH6Fiy12d4+LfdEvMVy3nG1zmVcSK68twqa1u+tbEqwx S8oYI248WHnps5ZTib6mNvjVyQjEhaCrmf7Zj9oxe+dXWCe4xtU+bEQWd0vd1M3L8jNs0U M+AjSSGcIMKjNIgm88up7I0/vs/WHFB387T4K5H5hKKo9UmM0AydGhj1bvVXfmpmfBU6Q1 JgyoKIQkYg0FuTO5Fn3WNKyM5KnRJ/4JVc8MV8LvYT9ElwMGBRaffdnWLZ7dYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2WSLc3pBXEV04PopHmurE7O56SSSkQZXe7r4k9kWRt0=; b=icVvZVoKWwECyBwYjmLa999jB+OZZSsfL1ELtG4gwGh6427dlIJHQiLjI4hTC760//bucz Vi5n67bktChAO4CGo+2RKfxOyeuNI0kZgn7l+vm4CWDCVCdVN7e0kjt9DdDw4BRN0ZIJt0 /4iySpyVX9v22+oiC1L4R2aIFfVrwtr7aCGUMHurNNSV2V2v8xSkrCs7azrZE1nFnuDyQA FIJq1xuowBFB/N+KWQr81Jh9fSbbCsag+lnnENMG9HRrhH4wQmjp8SzqFma78QQZSpMHRX 96zk6jGdWOBUf+hT7RnjM2VOBWleFOjLlpccGU4v/izNjx944BKOkRkKD4aeqg== 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 4Wy2Xg2hk9z156k; Mon, 2 Sep 2024 08:50: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 4828oxNQ007834; Mon, 2 Sep 2024 08:50:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oxZW007831; Mon, 2 Sep 2024 08:50:59 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:59 GMT Message-Id: <202409020850.4828oxZW007831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: e95c22c4135a - stable/14 - arm64: Expand the use of Armv8.1-A atomics List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e95c22c4135afe54f4f04949553e7f55bd3cb6cb Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e95c22c4135afe54f4f04949553e7f55bd3cb6cb commit e95c22c4135afe54f4f04949553e7f55bd3cb6cb Author: Andrew Turner AuthorDate: 2024-07-30 09:26:21 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 arm64: Expand the use of Armv8.1-A atomics When targeting Armv8.1 we can assume FEAT_LSE is available and can use the atomic instructions this provides without needing to check for support first. Reviewed by: imp, markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46159 (cherry picked from commit 7a345763f96d86eee9ab578e64311bf452e58900) --- sys/arm64/include/atomic.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h index 76ca951678d4..c7aaa76d9de9 100644 --- a/sys/arm64/include/atomic.h +++ b/sys/arm64/include/atomic.h @@ -65,8 +65,9 @@ extern _Bool lse_supported; #include -#ifdef _KERNEL - +#if defined(__ARM_FEATURE_ATOMICS) +#define _ATOMIC_LSE_SUPPORTED 1 +#elif defined(_KERNEL) #ifdef LSE_ATOMICS #define _ATOMIC_LSE_SUPPORTED 1 #else From nobody Mon Sep 2 08:51:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xh65l4z5MpCk; Mon, 02 Sep 2024 08:51: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 4Wy2Xh4C3Dz42tL; Mon, 2 Sep 2024 08:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ee7pwLI0NUefWebC6ju0uOEU1aj9RUtMclYzbyaRVco=; b=EsjFePOD6zReDDpF9ilM7sS4iBt4xHvqr1FeSqxL8H9O3s+lOA9FPiO4eaaj7U1CiOv3/b 2d1qd9G1TyKFzF7YPy8imTkBgTDsOHXuL0OxxHqkLMjWwjrCZ0mXkx22CcK0WaVk7Puv6g QWOT6IX25NBpephplXk72zU8IGoWWf+0S4VjyTIJRvfaHaLZxjwNTxA3NEkbLLvRi/dXUq hKdHLEcVeve7PaGOiXNKp2fXuCpr1abDivq2RWiY5vq2aIEjTo4EzPWjJ713FiBpiBni03 OlCQzC0ZrrLvFPzsDG+SF8EMoM/d3ZRMsDdhFMrPNGXLSCbwO7UUP5G0UZ0xCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267060; a=rsa-sha256; cv=none; b=l6dXc+CC520nEUnw2mJWDQ6M6XYEBmYCLMdTkoymkWuO31pdAcJy/WlQWgrHxJsLnYD4Ad MBNARbFTmDy1r63HoGeTmWnVrepq4m+Vzaj34L7CllvamEMUW1R8gikuUUSIX+RfWZanM1 dLwHKDvNW/l3JwWxiimxEyOdW/xO4kBmnjJV9u+Y1NHqY/3NPrmhy47QH9K1PaCNRQp0BQ VV0tHATEMlU641HabHQC6IIBqpgvVDIo+x0q7UUdrpB2SaRjqhmBUW9GHSMc6ArTmKg/t+ aFSCb0BMGo5B/BtvuGMoqy+7OjC7UMy0z77PenzJVqjhB+rR+eaQNW2p/7lSrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ee7pwLI0NUefWebC6ju0uOEU1aj9RUtMclYzbyaRVco=; b=ESaeEExiN4OHrWJMvk3E7JRXUPJq22Rrv2pEXeH/BiJ5SQQC/BwLX1FBd1z/nxlzr/2eTI PlUiVxhtYsoUgFmAbvIsp7SlQrCKwDhbLHxL0uD7mEKdQeewhJbwOAUR43y3YQHNq3oPt/ p72Yo5PWLUXanJ9TtAFrvxoJg2FXXy7Pr+QkIbjo4X2kez1aDBO3Gq7qaycQngpaSC1AHo CK0FrEynpxenU6MWXpTawleJedJHy2LjzVK3ta8YZq3elBa/jET2xstACBjwtzppVM1GCW 6FunW2FKVXAVQ+CvLMek5N4W1Owyx3HnyXe+YYvBVIRxpsliUOCoz43f1SUMDA== 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 4Wy2Xh3qYTz15P2; Mon, 2 Sep 2024 08:51: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 4828p0vo007897; Mon, 2 Sep 2024 08:51:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828p0tc007894; Mon, 2 Sep 2024 08:51:00 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:51:00 GMT Message-Id: <202409020851.4828p0tc007894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: a194eabe088b - stable/14 - arm64: Use store-pair to zero the kernel bss List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a194eabe088bcc33ee07eefe3aace2aa3e2a3d25 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a194eabe088bcc33ee07eefe3aace2aa3e2a3d25 commit a194eabe088bcc33ee07eefe3aace2aa3e2a3d25 Author: Andrew Turner AuthorDate: 2024-08-20 17:14:28 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:38 +0000 arm64: Use store-pair to zero the kernel bss While this won't be noticed by most users the time to zero the bss while using instruction tracing in the Arm FVP models (simulators) is noticeable. Reduce this time by using a store-pair instruction to double the size of memory we zero on each iteration of the loop. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42733 (cherry picked from commit f1bc3750cf9a6623b0c0861984ef2a8ac966a4e3) --- sys/arm64/arm64/locore.S | 2 +- sys/conf/ldscript.arm64 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 3db1d3025967..d448f06b2580 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -109,7 +109,7 @@ virtdone: ldr x15, .Lbss ldr x14, .Lend 1: - str xzr, [x15], #8 + stp xzr, xzr, [x15], #16 cmp x15, x14 b.lo 1b diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index 185b4485e07a..21c7dc35d9b7 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -119,6 +119,7 @@ SECTIONS .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); + . = ALIGN(16); __bss_start = .; .sbss : { *(.sbss) *(.scommon) } .bss : @@ -126,7 +127,7 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) - . = ALIGN(8); + . = ALIGN(16); __bss_end = .; /* A section for the initial page table, it doesn't need to be in the kernel file, however unlike normal .bss entries should not be zeroed From nobody Mon Sep 2 08:51:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy2Xk1GbLz5MpD3; Mon, 02 Sep 2024 08:51: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 4Wy2Xj59QBz42rc; Mon, 2 Sep 2024 08:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDF5dq05NFFjo4apkRzuUqy6/rIB+u9xL5CwQKDXN9w=; b=sfa+IdzMql8ELXEtnj6BhC2n8vzmm5Ce7F4vUMf+h3vfHkRkMuoENpm4dQaxoLa/lkBPo4 JHA7Dyyim8E95Y2tQScYBzJ4rSFVY6e0WX1ecFm//m581+Vkgb8OFqNI1NLX2/X5wIamzC gc56sVDMYc5PKs04lzU7BAERerCoU+ZH6tgqU1pxyLUpEpXHDNyGtgR7IgI8LVkYtY/MiO 9B1tmubii63C5harXJ3QQbLA6Io+REXmIQ8LxMI/mlRYHprid8ndQ91ZYgvhP0Eqbt8HdX /nTU+CTexQ/1vktF8+XyArSLJq45PZo4UlBZuJ6gEIFz3ZJyhCvHQeU5QMlsdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267061; a=rsa-sha256; cv=none; b=sn5+1dBP9uTzpk6KOljtAS+CatgbEwy/o7kDIEgeAcIW332IijWX5K9soCHZzO81jmzZ5g ekskYGalx4gd7pIHzJqNxopGGweQTZ+s08vEQZ8WSVHI8Dt4scz/LK26H6pL/GMoE3bIdo PARVKeVa869am0gzrbBHEhhYQBVFKQTVFuzMwwj9Eex6X+x8ochJdaLXwpcPkwdB/HanF8 SedJRwITAghKsNchi1OtxDHlaKJ8XQFxOcYbDsk/D/T4di6n+NF6vfyh3hW+EhYEI16oCz iOaB3rtbdi2lLuCgOWVBGcy9SXveSa7ZUi0Uo5Sr/IyIov1bQVQsRqKla+2A5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDF5dq05NFFjo4apkRzuUqy6/rIB+u9xL5CwQKDXN9w=; b=FNpHvL2QKiSaleJmCRepmZ1ZuIpCyYLSk+IKGW+LstmOlfw2brMMvMqynXLCiEokZJreJH THo/neKmVr3J+VtfmdqJ0Cerh103bTDCgR3AoCKSA5ZZU/414M/FcqRSdX/RUPe9UjlPJE kD2a+C6nxgJA8GkoTD7/KHcspY9aI2X6djdMQo5MMKYZ4gO70lUukkf0BZ4MTdmQrNwuSw ckE/ESE0Lb7sDvyd/4Y1U7xSbTBBY05w3/Fv1r+ZUcZ0TQjv9KhxMSMs5hwB8k/6uonbM5 ONqOLfKPfF/BzhETdfggARhWhLT3vOxRptYEWLFQTmQyFteoAl+6ljsGfrFCVg== 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 4Wy2Xj4mljz15Lb; Mon, 2 Sep 2024 08:51: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 4828p1Oh007943; Mon, 2 Sep 2024 08:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828p1GR007940; Mon, 2 Sep 2024 08:51:01 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:51:01 GMT Message-Id: <202409020851.4828p1GR007940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: ca84f1ed4d3c - stable/14 - libc/aarch64: Remove an unneeded weak symbol List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ca84f1ed4d3c585b9b4eaed40ef012d757d68114 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ca84f1ed4d3c585b9b4eaed40ef012d757d68114 commit ca84f1ed4d3c585b9b4eaed40ef012d757d68114 Author: Andrew Turner AuthorDate: 2024-01-02 16:32:08 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:49:39 +0000 libc/aarch64: Remove an unneeded weak symbol The index symbol doesn't belong in memcpy.S as it is already in strchr.S where it belongs. Sponsored by: Arm Ltd (cherry picked from commit 024248c933c5741a21c17eda63092f330dd98337) --- lib/libc/aarch64/string/memcpy.S | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/libc/aarch64/string/memcpy.S b/lib/libc/aarch64/string/memcpy.S index ac4fbe8d6175..f403dd2e42a8 100644 --- a/lib/libc/aarch64/string/memcpy.S +++ b/lib/libc/aarch64/string/memcpy.S @@ -1,6 +1,3 @@ #define __memcpy_aarch64 memcpy #define __memmove_aarch64 memmove #include "aarch64/memcpy.S" - -.weak index -.equ index, strchr From nobody Mon Sep 2 09:12:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31Y1ZM2z5MqlL; Mon, 02 Sep 2024 09:12: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 4Wy31Y0chBz4Brj; Mon, 2 Sep 2024 09:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ET+uhm/4Qr2LbiY4KDrJvfXHB0jXjxO7JlzlYZVZ3s4=; b=rDtzpFdAe/UlqHdHFEUB8B+KcU8tw6aQ/poZhDKeF8W0ljNzTA8oWucpYFKGQef8QAfIgE 21tcMKx2YQ+0DV2Ce0I56xp0hzVq0Hi1hjPFvqW9oTGh+qruw5u71z/1quuFPu0LeOhM5a JhTIaq9WkO8eguc5UjcZgy926I8nhJFHJb+OUrhNsL5/taJKUwfcpDYGX0BqXwqIlIaNtP qDgBpcaS5xzFx2V9F6zk6WeDFDNmtws+drVTeFlGI2uxRA1HlgvkrZkQfbZ47FCbP+H7SH LkfpBWO2foZshVrjBz/DqtKMRpEk6p4TIZNxNUSLyFAQBm/Wsyhve4e1nbKpaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268353; a=rsa-sha256; cv=none; b=wVPSq1w1GhY3L2iSJskM6jFLqjZqpUj9Tg3aeoVSqi1ZvXMcdbh1o7S9+ZJOE3MDNkq8iO 3zFRcs/MNNcSuL+/2n0HxdWbCXAXrvnbdjGtiY1bKTD6joMpAv9eIjWPgMfauEja06Acwj rbGKVEbJQXVeMRj2A7YW+n09yw3/CoAjID8McA8DkXVKSj4lEzqQ0Ir5vQ97pJW4q4zvXW /SMWi8Vp9RmM/ifolNrbXq7Jq+4p2/668oxFYJ6TZY8EC3jpOOkxjUBHhQ9Bl/22jb/ZxH jfllGAM7eYKoFSD/W/6NiP8F2NAI+lSI0iSpLEuki6s1IuMe+q3fPmQOPjwdNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ET+uhm/4Qr2LbiY4KDrJvfXHB0jXjxO7JlzlYZVZ3s4=; b=lG70ZOuQD7Vjbhu3jUZZHstrVVJPSJB2lLwU8XQeMIHGMVd1JkKj8gdXZdN+YM3aIBLJP4 rInxUqNFWxb3S79ftvDGrleI9/93Rv766GJav3DPgy2+3fLCnL3pRIsobVLlEpQtskp9xa El7tu3XggO9JsNbcWGAyqhnH8W1L+UrqnU8hTI8QMA7liWtwbIhipwms9YQEjKh7AhIylP fZg13AAsb2vFzhZZBLmVfknS4DzgusFvBIs/sDN0qM8HKO5SAvwnq8w4CMtH+2SCrp1EgI aOldip8vZEjttATA0BGSwnA1EQXhpoxIjSgcEnhNh8wWmmuSJpa8GvBwZVVmEA== 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 4Wy31Y09Q2z16Dj; Mon, 2 Sep 2024 09:12: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 4829CWIG049337; Mon, 2 Sep 2024 09:12:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CWDm049334; Mon, 2 Sep 2024 09:12:32 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:32 GMT Message-Id: <202409020912.4829CWDm049334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: c603969fa9e3 - stable/13 - vm: Use vmem_xalloc in kva_alloc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c603969fa9e38c9db488eae1bdadfbb2be62b6fa Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c603969fa9e38c9db488eae1bdadfbb2be62b6fa commit c603969fa9e38c9db488eae1bdadfbb2be62b6fa Author: Andrew Turner AuthorDate: 2023-11-29 12:11:37 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 vm: Use vmem_xalloc in kva_alloc The kernel_arena used in kva_alloc has the qcache disabled. vmem_alloc will first try to use the qcache before falling back to vmem_xalloc. Rather than trying to use the qcache in vmem_alloc just call vmem_xalloc directly. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42831 (cherry picked from commit 8daee410d2c13b4e8530b00e7877eeecf30bb064) --- sys/vm/vm_kern.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 2d5d20d931d3..ba3badf29c3b 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -147,7 +147,8 @@ kva_alloc(vm_size_t size) vm_offset_t addr; size = round_page(size); - if (vmem_alloc(kernel_arena, size, M_BESTFIT | M_NOWAIT, &addr)) + if (vmem_xalloc(kernel_arena, size, 0, 0, 0, VMEM_ADDR_MIN, + VMEM_ADDR_MAX, M_BESTFIT | M_NOWAIT, &addr)) return (0); return (addr); @@ -167,7 +168,7 @@ kva_free(vm_offset_t addr, vm_size_t size) { size = round_page(size); - vmem_free(kernel_arena, addr, size); + vmem_xfree(kernel_arena, addr, size); } static vm_page_t From nobody Mon Sep 2 09:12:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31Z2zrHz5Mqc7; Mon, 02 Sep 2024 09:12: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 4Wy31Z1GV5z4CRQ; Mon, 2 Sep 2024 09:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jLEHXvnlEU6I86I7i0y3KxRoKfE2Vw/AhHLVJ/6BRqc=; b=gjpxgzupbHrwEQaT9ym2b7Ga0kWg4m49R7/IKGs9xEJbOyk0WjImAzw0N+eHidKl/I6CPZ YRZrKWXlBYslrTq4G+wDXUoCZvm5PDlZqFrKQ9fVdcIVjcPiu6AMAlb8AxcvQLizKp0act +ThQ9VKkggLHUTJIAE3w5HLcBV6dTHNM2me5WPvbWjybg57bZXUWkWE5+EF1BwvNytpDMp l6ZH4GhpHJEXn3MEYBlvOS01/D8fhbMjE9jF7q2cznJcgjAZ9NcHMKi8HugQT8u3RDbY09 WSRyPXtoTG1neYg2g12DIKG5/ScSSLq6Oi5Bf5uJX7v3nJGiPnegszzxiKioxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268354; a=rsa-sha256; cv=none; b=tIOuJNathBoXHfqLyUHZbu7YEbbbM0Y6WrK6NNaZLbPettXc0/m5yAX+p3oSp3nsKP+2l+ gkKe51A5lA3qHB4L3RMtS+NKECOWHpiYl7wzBc+I57hGdw9mVPu9AftzVB2JGhSnMz+qn0 6yTWAsphg8Bxp6ADg95kcMUl+RvP4uXcnq5Brqo4b31oRoffAc89LjMtQP2XSrN4uXpvL4 /76ud7ifoa0DEoZo9icXVHysbDMSYlgpn27EbdrfQjg2vSfS0gARIWwnbRBjCr9XOxv+x6 ECJa5DLmlzUUbyPCdK8Eo6Fa8/x6jFdcE4V4J75z+3pKRveQdyxRBfO+zaXpNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jLEHXvnlEU6I86I7i0y3KxRoKfE2Vw/AhHLVJ/6BRqc=; b=epL7gRfu4An9U9dycj5WbnWecDfFlwA/GK3R1iOnexvme68a3zDvrlBaKIpG0uwDikiSTx iohnmNieuQ9BdtwW2VeBgoZRML30HxyetOfShNX0fjxOGiYInZAeBJtBFbU78TdySPU46z tOW02E8xfkehavSHKA3vyBWkOl2P63IaKJjvf//s6hldHu/keIxYdTJRX3wpOEeqU9tPXI zLS8RB3NHgAMBqnFOo9EZb2emhnSg8prxuy1/kzmOE3Ekr/aXvTCafusb1FJDy8wINNW7M scjqJ1bQP8p5qG+ujmHgYXK+2CHOEeKG9dB/uo764qQKpSb3VVFg3CvhB8Zr/w== 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 4Wy31Z0qvTz167t; Mon, 2 Sep 2024 09:12: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 4829CYf4049389; Mon, 2 Sep 2024 09:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CYrC049386; Mon, 2 Sep 2024 09:12:34 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:34 GMT Message-Id: <202409020912.4829CYrC049386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 8876ff3c4aae - stable/13 - vm: Add kva_alloc_aligned List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8876ff3c4aae7713f57eceede0173732c73c01d6 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8876ff3c4aae7713f57eceede0173732c73c01d6 commit 8876ff3c4aae7713f57eceede0173732c73c01d6 Author: Andrew Turner AuthorDate: 2023-11-29 12:54:49 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 vm: Add kva_alloc_aligned Add a function like kva_alloc that allows us to specify the alignment of the virtual address space returned. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42788 (cherry picked from commit 839999e7efdc980d5ada92ea93719c7e29765809) --- sys/vm/vm_extern.h | 1 + sys/vm/vm_kern.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index a1aba0ba5b26..c867d3c20eb2 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -49,6 +49,7 @@ struct domainset; /* These operate on kernel virtual addresses only. */ vm_offset_t kva_alloc(vm_size_t); +vm_offset_t kva_alloc_aligned(vm_size_t, vm_size_t); void kva_free(vm_offset_t, vm_size_t); /* These operate on pageable virtual addresses. */ diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index ba3badf29c3b..defc862a4ac5 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -154,6 +154,27 @@ kva_alloc(vm_size_t size) return (addr); } +/* + * kva_alloc_aligned: + * + * Allocate a virtual address range as in kva_alloc where the base + * address is aligned to align. + */ +vm_offset_t +kva_alloc_aligned(vm_size_t size, vm_size_t align) +{ + vm_offset_t addr; + + TSENTER(); + size = round_page(size); + if (vmem_xalloc(kernel_arena, size, align, 0, 0, VMEM_ADDR_MIN, + VMEM_ADDR_MAX, M_BESTFIT | M_NOWAIT, &addr)) + return (0); + TSEXIT(); + + return (addr); +} + /* * kva_free: * From nobody Mon Sep 2 09:12:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31b52mHz5MqlQ; Mon, 02 Sep 2024 09:12: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 4Wy31b2XnQz4C97; Mon, 2 Sep 2024 09:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pbJeV7QQL+rZGXA/RCMjdW6OjCvLQU9ZnNtlt49iqCE=; b=I0E8yVCdRsFwqmtyGgkjujPMD8UD9rMafWJEtnQkP4WRrieP9b1NrkgeNBAxlyDZKtGbB5 nZaGdLAB1U0jnbdoSznnTZTbB5hMtxRsR4X0ieDnaOL09Y5GgUYSMuv/LIlebuJ9/HEet4 48mFsFXXapOrcVh8XMcupkpDkBQEhz8GG6PktWjflOGF79k8CXa/IISPsyyYsdxpeXb66o YzgFB+Sspek1YCy/Cpr3QrTWkGxtgVYEYKfP7YGsqko0kxp4ZvSAMCROMFfGt4BQN6gPdm UFeKFnVwIPSdwRDUry8eyScXTnrVwg2KSGUNuzW3bIeC7UHBXZm14Awp8D/uSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268355; a=rsa-sha256; cv=none; b=xFQXFseKyRIenkZoV3BQAMkskP4H8R3/MfpKSJDicCkzz/lfR6UyEheZTU2n/s90vOuGqY YEkvWbrMQxPNw0d7pTmkeDGC8trrXlEF1/ER9QS4U7TEJNvlOlufbUUK9l4rkY4/zy4+Ur q2G2gOsosTO3YrogKvM/PgNKRLgq0U9TFTfyv1OEl5EJiOsWGI5AM+CgmUcWuzemmYlToS ijDkXMtIijMknlOGgWRFtRS8bTSKVDN1zAl5Z2VGUVNQfc02sx9P2ucXEQ8YkFOa7/qMcQ fnOEucZa0OIe1ab1lz1yQgVmdFvcvAs9+Lp1aA4DEFmbXsfH+E/bIVacMPHDEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pbJeV7QQL+rZGXA/RCMjdW6OjCvLQU9ZnNtlt49iqCE=; b=o+NnIfH7p+BUz91uPBmTwUBNTLH8VlKXpQcuECrrod7HoAzwepOI+k7/XtBMqzcBM4g6EF c/9s/UYjFFTOUYCX0FjiSIFrLl6BnCPvqXHTORU1vRkZt1HLSS5vvxCCCR07NyqOTQO8kL 4J4wDqR1I3u2aHY7EoF8xa2lSr5Jg7PXh8LBCQgl1CCAmgrGaZYDlDwHrfO8iNzy55lQMq /wt1xJGOjKu8vgV/sJg8oSZ1KySqED6Hv/P3h78v2sFTJRW34yj7afwwOxvdcC3aIk4T6y AdPvBgjbgistJ/3lz9nrNswTjLPeUp9weX5jx/ZeoWoXzwmjT5A+TyI8+TSGZw== 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 4Wy31b1s1Jz167v; Mon, 2 Sep 2024 09:12: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 4829CZ6J049440; Mon, 2 Sep 2024 09:12:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CZgP049437; Mon, 2 Sep 2024 09:12:35 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:35 GMT Message-Id: <202409020912.4829CZgP049437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: e4f74109173e - stable/13 - uart: Split out initilisation of the acpi devinfo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4f74109173e64be6eaf2e24d0e6ef16da38b25c Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e4f74109173e64be6eaf2e24d0e6ef16da38b25c commit e4f74109173e64be6eaf2e24d0e6ef16da38b25c Author: Andrew Turner AuthorDate: 2024-03-12 18:06:18 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 uart: Split out initilisation of the acpi devinfo Split out the common parts of building the uart devinfo from ACPI tables from the SPCR parser. This will be used when we support the DBG2 table to find the debug uart to be used by the kernel gdb stub. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44357 (cherry picked from commit 473c0b44ae8c51b2aebc51887714b2ed14de50bf) --- sys/dev/uart/uart_cpu_acpi.c | 86 +++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c index a0534c7af230..6805d187cb99 100644 --- a/sys/dev/uart/uart_cpu_acpi.c +++ b/sys/dev/uart/uart_cpu_acpi.c @@ -70,35 +70,10 @@ uart_cpu_acpi_scan(uint8_t interface_type) return (NULL); } -int -uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) +static int +uart_cpu_acpi_init_devinfo(struct uart_devinfo *di, struct uart_class *class, + ACPI_GENERIC_ADDRESS *addr) { - vm_paddr_t spcr_physaddr; - ACPI_TABLE_SPCR *spcr; - struct acpi_uart_compat_data *cd; - struct uart_class *class; - int error = ENXIO; - - /* SPCR only tells us about consoles. */ - if (devtype != UART_DEV_CONSOLE) - return (error); - - /* Look for the SPCR table. */ - spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); - if (spcr_physaddr == 0) - return (error); - spcr = acpi_map_table(spcr_physaddr, ACPI_SIG_SPCR); - if (spcr == NULL) { - printf("Unable to map the SPCR table!\n"); - return (error); - } - - /* Search for information about this SPCR interface type. */ - cd = uart_cpu_acpi_scan(spcr->InterfaceType); - if (cd == NULL) - goto out; - class = cd->cd_class; - /* Fill in some fixed details. */ di->bas.chan = 0; di->bas.rclk = 0; @@ -108,7 +83,7 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) di->ops = uart_getops(class); /* Fill in details from SPCR table. */ - switch (spcr->SerialPort.SpaceId) { + switch (addr->SpaceId) { case 0: di->bas.bst = uart_bus_space_mem; break; @@ -117,10 +92,10 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) break; default: printf("UART in unrecognized address space: %d!\n", - (int)spcr->SerialPort.SpaceId); - goto out; + (int)addr->SpaceId); + return (ENXIO); } - switch (spcr->SerialPort.AccessWidth) { + switch (addr->AccessWidth) { case 0: /* EFI_ACPI_6_0_UNDEFINED */ /* FALLTHROUGH */ case 1: /* EFI_ACPI_6_0_BYTE */ @@ -137,10 +112,10 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) break; default: printf("UART unsupported access width: %d!\n", - (int)spcr->SerialPort.AccessWidth); - goto out; + (int)addr->AccessWidth); + return (ENXIO); } - switch (spcr->SerialPort.BitWidth) { + switch (addr->BitWidth) { case 0: /* FALLTHROUGH */ case 8: @@ -157,9 +132,46 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) break; default: printf("UART unsupported bit width: %d!\n", - (int)spcr->SerialPort.BitWidth); - goto out; + (int)addr->BitWidth); + return (ENXIO); } + + return (0); +} + +int +uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) +{ + vm_paddr_t spcr_physaddr; + ACPI_TABLE_SPCR *spcr; + struct acpi_uart_compat_data *cd; + struct uart_class *class; + int error = ENXIO; + + /* SPCR only tells us about consoles. */ + if (devtype != UART_DEV_CONSOLE) + return (error); + + /* Look for the SPCR table. */ + spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); + if (spcr_physaddr == 0) + return (error); + spcr = acpi_map_table(spcr_physaddr, ACPI_SIG_SPCR); + if (spcr == NULL) { + printf("Unable to map the SPCR table!\n"); + return (error); + } + + /* Search for information about this SPCR interface type. */ + cd = uart_cpu_acpi_scan(spcr->InterfaceType); + if (cd == NULL) + goto out; + class = cd->cd_class; + + error = uart_cpu_acpi_init_devinfo(di, class, &spcr->SerialPort); + if (error != 0) + goto out; + switch (spcr->BaudRate) { case 0: /* Special value; means "keep current value unchanged". */ From nobody Mon Sep 2 09:12:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31c6lLFz5MqYS; Mon, 02 Sep 2024 09:12: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 4Wy31c3FHSz4C9l; Mon, 2 Sep 2024 09:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ynrU2FS91694aEVc1Q3rn0QXsOlZ3jsibjjRJYaENw4=; b=scmZwIa2F/NI79yHOtWxvCQiJfSR7qeVhP7TzLwAkQjmOixFhNbvQaKoDkUVOXVmTG2bNT s2djZ7iZJHhmrZBfU8okP40AvgsEUrNPBZm39Ld4XzHArmGYcXivyVfdIdFVXDx0dCw44g hJRUEb7q66d1g5ZqqZnmadaZQ5NEq4qHu9pNlgDwFX5xgwJWl2dzuEu4+vqr4bu+vPI+Tw E0XWupQRWbj/U4F2lLmxhNjMBH3bBjJj+FDRpATwrzmtR/y6GHu/yxLhTnl+d9zU/4fR1o lVV+HhjR/twkMyfOmd5Vu0aT0VYIRnw//IulT3Imcm/aR2L2/ogslD/4NMTOHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268356; a=rsa-sha256; cv=none; b=FU+iB32trgBb6vprWe8A7j/+wLJVwLPrJszRf8tMrCv4JsJgefUdwEJsGnEl+dL94PmiOs tToMCbUbVIM8f9mqlWKhslYguFfMlrBtCzUJ75cGw2cv4wzPeDY7qf7RgkPVFkcm4fJ3SV t0AroFezRo/dnIkDvc8k2V8mh4N9RyDrqjJ7xEaMoAya18OnfUDBpRNpi6eNGVot9n9CNW iDaVSUg+/QvfaA+k2KLevgulinMrn+DNnr4qRmzWVwGG74sNiu7NY3keBKA4qXr84MQ1rY 4g2ejUf6DFFW9557uCYx5GGLLtyfCBDteqTXJBV9NsL0N63YfhHZFZJUwaFbwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ynrU2FS91694aEVc1Q3rn0QXsOlZ3jsibjjRJYaENw4=; b=WqxpbGakwBkS7psXmHki5H3YLGyTivKr2sv2l/pYFnvmgBYNfJjlmwxqUTFUZeRnDXcG51 XriIBtzYYRYpzL1lWA1nVw83EW9Qtf9IpRmAgikNskolrdrNMc+W6se73ZoJfZZxi9Oqh0 aNHMu5rjFM+CqbChqYb8KhdLcsRfuLjb5s/E8rN7NzKsI8t2UuOwX28n4jG2TcEkQBwZ28 TrDfIwc/Jo5dH9WvRgwr/Aj7kZK2ENM9w3Dc4MMuLtEogGo07NfYzDoVAF0oBlDsG2qhXS sZT2rIBX8oYJ9Mim7GwRPQZSFzcCFPXcFTP6b3gDhNHgYDMgJTRUcpKmf8Of7g== 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 4Wy31c2sYTz16GZ; Mon, 2 Sep 2024 09:12: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 4829CaCQ049489; Mon, 2 Sep 2024 09:12:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829Cait049486; Mon, 2 Sep 2024 09:12:36 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:36 GMT Message-Id: <202409020912.4829Cait049486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 10595e9b2f65 - stable/13 - arm64: Support counter access with E2H List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10595e9b2f659693c4e3d486a577c18f1d2e7efe Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=10595e9b2f659693c4e3d486a577c18f1d2e7efe commit 10595e9b2f659693c4e3d486a577c18f1d2e7efe Author: Andrew Turner AuthorDate: 2024-07-23 09:18:00 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 arm64: Support counter access with E2H When entering the kernel with the E2H field set the layout of the cnthctl_el2 register changes. Use the correct field locations to enable access to the counter and timer registers from EL1. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45529 (cherry picked from commit 997511dffe651e1d2d708f37f2ced430a6ab3349) --- sys/arm64/arm64/locore.S | 6 ++++-- sys/arm64/include/hypervisor.h | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4bde1df945cb..007ffdcae513 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -273,8 +273,10 @@ LENTRY(enter_kernel_el) msr hstr_el2, xzr /* Enable access to the physical timers at EL1 */ - mrs x2, cnthctl_el2 - orr x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + tst x4, #HCR_E2H + ldr x3, =(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + ldr x5, =(CNTHCTL_E2H_EL1PCTEN | CNTHCTL_E2H_EL1PTEN) + csel x2, x3, x5, eq msr cnthctl_el2, x2 /* Set the counter offset to a known value */ diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index ff6aff00e226..0ed21bf311c7 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -37,10 +37,15 @@ /* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ #define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ +/* Valid if HCR_EL2.E2H == 0 */ +#define CNTHCTL_EL1PCTEN (1 << 0) /* Allow physical counter access */ +#define CNTHCTL_EL1PCEN (1 << 1) /* Allow physical timer access */ +/* Valid if HCR_EL2.E2H == 1 */ +#define CNTHCTL_E2H_EL1PCTEN (1 << 10) /* Allow physical counter access */ +#define CNTHCTL_E2H_EL1PTEN (1 << 11) /* Allow physical timer access */ +/* Unconditionally valid */ #define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ #define CNTHCTL_EVNTEN (1 << 2) /* Enable event stream */ -#define CNTHCTL_EL1PCEN (1 << 1) /* Allow EL0/1 physical timer access */ -#define CNTHCTL_EL1PCTEN (1 << 0) /*Allow EL0/1 physical counter access*/ /* CPTR_EL2 - Architecture feature trap register */ #define CPTR_RES0 0x7fefc800 From nobody Mon Sep 2 09:12:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31d6B5gz5MqnM; Mon, 02 Sep 2024 09:12: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 4Wy31d4Gv1z4CMm; Mon, 2 Sep 2024 09:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eWPtULs2XEKp84f9r0QJ3FE9hX/0Y4W4OcNb6/xNcU0=; b=lWUxFLc0JZmC1jCWXTXL3wEOA+dxQrAotdsBfIbgjVWYlLXrObpV8PsCyCcCYjOpo4/fpb 8uaOm+c1XzYy7oonMwoL6Z6F2K+CCLZcXdrJxdWS5EBzJUIlBB46wwfDhqmKT/Ae+FRHhq hWJ+XXt1eoOFxxaCC7um6xNqeOeuVoBhYJb3SHyztSypXbFFh5h5ATGQFIU4mrcaZPdOfd rB392OvLsud2H7PeUI9NxHCZV/1lo/ebUR3KauTC5ZRshJ0q4jwe/aERWiD+c6GRuhYv6p d4QxnTOGxsq1VuFx7HOyafWTeDhH0dHcBWRC0j0Dzk9YTOVGLXFJvNRXjYJ8sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268357; a=rsa-sha256; cv=none; b=g8k/yQbPc9zbjh195HoTZcQDQMIkvg2ADC1/6NW5AcJMropj9Mx3C0NHr3Cb3ZBdwoEaiM Pt8nAifO6OmzK1D8uSzqPo14T0WZwb7Soj9QOUbWCiWCqJiD10sCiysnISplRvQaH1oRyX xsp6IDSTPW4wga6iuWyjxC8+hgTJme9L+a1/sDxlitD2NH7ZaAs6F4RF46MMDghOMXnd4/ 5uvVAFE/1yaZUu1fNzwhblqJnSgoWSkzVUsR+uYzBNMn9O6uGj/0/mp6Dy0Tr+uK/xKy0D eE9UUxyif/+IYJ1SjhKOFel2mwPOqOQJ9rz6GWlEFKtS+N+HilEOefpnwZ5sfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eWPtULs2XEKp84f9r0QJ3FE9hX/0Y4W4OcNb6/xNcU0=; b=bMtrE2giPruFLS9Gf968q/aBtpuvLmItILFE+vwQZfrxMbUUquo2RO0+3QfrSXIPcoB2yN 6nNHsIZHsx/+odVbAMcuyefDnWlmqyCj7RZJDFp0bmO/VUhs/cqKnlZbAWRuRqdmFB2OsR fL1WoHs1CGJwuaS+Yf6k6dV4Gb/OwJsKLpKuU6a6B7eugQLyfN00nxvliKOxlgiysiIEmY UWHbNvnhXbyEE6jNe1lfmTGLdsvkhk8GpVx3hcK1PinkjxWLdIf1oLrs3DySdFX6f4JkxP eu1fEE47cX+JzqRQSPLRTIpNmmyOR4T4TE3MqWUmY7Y9vdYIivW2rKz9ro7oUQ== 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 4Wy31d3vBHz16Dk; Mon, 2 Sep 2024 09:12: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 4829CbOG049544; Mon, 2 Sep 2024 09:12:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CbH4049541; Mon, 2 Sep 2024 09:12:37 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:37 GMT Message-Id: <202409020912.4829CbH4049541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: af603143e873 - stable/13 - arm64: Fix the gicv3 check in locore.S List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af603143e8732dc279e3ffda012e1b39cea32b96 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=af603143e8732dc279e3ffda012e1b39cea32b96 commit af603143e8732dc279e3ffda012e1b39cea32b96 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:08 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 arm64: Fix the gicv3 check in locore.S In locore.S we need to configure access to the GICv3. To check if it's available we read the id_aa64pfr0_el1 register, however we then only check if a GICv3.0 or 4.0 is present. If the system has a GICv4.1 this check would fail. Move to checking if the GICV3+ is not absent so this will still work if the field is updated again. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45530 (cherry picked from commit 57ef7935eb114e98e7e554c5ffbded68fd038c04) --- sys/arm64/arm64/locore.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 007ffdcae513..ada9c5b2e54f 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -297,9 +297,8 @@ LENTRY(enter_kernel_el) mrs x2, id_aa64pfr0_el1 /* Extract GIC bits from the register */ ubfx x2, x2, #ID_AA64PFR0_GIC_SHIFT, #ID_AA64PFR0_GIC_BITS - /* GIC[3:0] == 0001 - GIC CPU interface via special regs. supported */ - cmp x2, #(ID_AA64PFR0_GIC_CPUIF_EN >> ID_AA64PFR0_GIC_SHIFT) - b.ne 2f + /* GIC[3:0] != 0000 - GIC CPU interface via special regs. supported */ + cbz x2, 2f mrs x2, icc_sre_el2 orr x2, x2, #ICC_SRE_EL2_EN /* Enable access from insecure EL1 */ From nobody Mon Sep 2 09:12:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31g0ZDXz5MqnN; Mon, 02 Sep 2024 09:12: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 4Wy31f5VqCz4CPv; Mon, 2 Sep 2024 09:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wI66D3pk4XbCjJ8ys40UNpRK6y1Utxc809O2Lpsf1LY=; b=Yxq75afNiSAcKUYkSAE4stcZB3ev+5IRxC1WMx3f+lReDIZvy2y89rM1rucEeA/XMiN/hQ 5vbbRDN9ijxaVl0IkF9sjXeV/J/KKwwAX1CaBcl3td5fjR/IGyxvsfMZ/N31clvGBenupq mrKixr4PY/P5633RAFjlzu1Ck7c6UMD3zbMvSaGE21NZs7PZrc1/DO2hZQ3x/1fOgjvy/7 Bbp6lpLA8C+JidV7JG9gtGSAhEBERxHttVoedtKUT8j8EJ49aQDJcS75PO4h0i/lOWfxu6 MGYw14kkqpnpAVk0F5/fKXtQN8wN1cuQsQFgvNw2xxTEZPIKAAxRg5fJBYAaMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268358; a=rsa-sha256; cv=none; b=uxBNfpR/rEGOrWesWZdbhBzkgfmw/YdNBc4iZrKvla/JCsOXM24TL1PDoEqON/LnKvLjhH MeVgZH4Hok2OQZYyapvE8yhI4X4NY95SG0NfXYJE4RHlE8JOdGO3TU3X9m59yAtgiU1ltw UpqlIqE8lxFiniwUNRGhFe+p9d0NjNmtWUhMTeSL8XJZ6FNSF0A1y4n9LlBUxY0ihDrnN0 pddNrl42G8uR3jKf7wtN/KNkR0PZZ90vizFDECc4atUz5CsYHOhyxcsLGQgZ7USms5YxpD e9E+BgCrV4EcXCX6jvxnb4wzlQj4gZVrGEfD5Qrw2dowN3FFUP6rl6wrjtKpxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wI66D3pk4XbCjJ8ys40UNpRK6y1Utxc809O2Lpsf1LY=; b=YAyaBSBOYwLOsOjBpHB/9VGFvMG6yE18Zv7baVuNxWzSVgF/kv/s74z/InaqAFmLITMoTG QZT+prq8RifbEE/TpDVg2fIrXur0rNyNbD/Rot2UBlHq5hFfCiAyt9qeJwVOeec56JE1SL Na2nEftMlpB+yyD9706zK5u1LaUjty9E/kDvi3BRLxsht03yU98u5vMmbtMuopfu343BdW nGPWAPWIsMEBfwjlGWG9YSFQAZFOrhLoMLsfPwNFdGR6fZ0CVewkX7cPmqp43N/bS6ZtnH wnRXLOyJ/Lw8v0SCW271Qh9afXWy7hUWjQJoCjqbLfTwJV9qcgtrQZxpG8mIUg== 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 4Wy31f4zCxz167w; Mon, 2 Sep 2024 09:12: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 4829CcGk049598; Mon, 2 Sep 2024 09:12:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CcXK049595; Mon, 2 Sep 2024 09:12:38 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:38 GMT Message-Id: <202409020912.4829CcXK049595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: e70860e519df - stable/13 - arm64: Ensure sctlr and pstate are in known states List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e70860e519df08de336b92aaa0ae8b927fe13ad4 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e70860e519df08de336b92aaa0ae8b927fe13ad4 commit e70860e519df08de336b92aaa0ae8b927fe13ad4 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:24 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 arm64: Ensure sctlr and pstate are in known states Before entering the kernel exception level ensure sctlr_el2 and sctlr_el1 are in a known state. The EOS flag needs to be set to ensure an eret instruction is a context synchronization event. Set spcr_el1 when entering the kernel from EL1 and use an eret instruction to return to the caller. This ensures the CPU pstate is consistent with the value in spcr_el1 as it is the only way to set it directly. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45528 (cherry picked from commit 034c83fd7d85f57193850a73cc0ac957a211f725) --- sys/arm64/arm64/locore.S | 52 ++++++++++++++++++++++-------------------- sys/arm64/include/hypervisor.h | 4 ++++ 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index ada9c5b2e54f..20e1647a503d 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -52,19 +52,6 @@ ENTRY(_start) /* Enter the kernel exception level */ bl enter_kernel_el - /* - * Disable the MMU. We may have entered the kernel with it on and - * will need to update the tables later. If this has been set up - * with anything other than a VA == PA map then this will fail, - * but in this case the code to find where we are running from - * would have also failed. - */ - dsb sy - mrs x2, sctlr_el1 - bic x2, x2, SCTLR_M - msr sctlr_el1, x2 - isb - /* Set the context id */ msr contextidr_el1, xzr @@ -233,19 +220,37 @@ END(mpentry) * registers and drop to EL1. */ LENTRY(enter_kernel_el) +#define INIT_SCTLR_EL1 (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_EIS | \ + SCTLR_TSCXT | SCTLR_EOS) mrs x23, CurrentEL lsr x23, x23, #2 cmp x23, #0x2 b.eq 1f - ret + + ldr x2, =INIT_SCTLR_EL1 + msr sctlr_el1, x2 + /* SCTLR_EOS is set so eret is a context synchronizing event so we + * need an isb here to ensure it's observed by later instructions, + * but don't need it in the eret below. + */ + isb + + /* Ensure SPSR_EL1 and pstate are in sync. The only wat to set the + * latter is to set the former and return from an exception with eret. + */ + mov x2, #(PSR_DAIF | PSR_M_EL1h) + msr spsr_el1, x2 + msr elr_el1, lr + eret + 1: + dsb sy /* - * Disable the MMU. If the HCR_EL2.E2H field is set we will clear it - * which may break address translation. + * Set just the reserved bits in sctlr_el2. This will disable the + * MMU which may have broken the kernel if we enter the kernel in + * EL2, e.g. when using VHE. */ - dsb sy - mrs x2, sctlr_el2 - bic x2, x2, SCTLR_M + ldr x2, =(SCTLR_EL2_RES1 | SCTLR_EL2_EIS | SCTLR_EL2_EOS) msr sctlr_el2, x2 isb @@ -261,8 +266,8 @@ LENTRY(enter_kernel_el) mrs x2, mpidr_el1 msr vmpidr_el2, x2 - /* Set the bits that need to be 1 in sctlr_el1 */ - ldr x2, .Lsctlr_res1 + /* Set the initial sctlr_el1 */ + ldr x2, =INIT_SCTLR_EL1 msr sctlr_el1, x2 /* Don't trap to EL2 for exceptions */ @@ -311,10 +316,7 @@ LENTRY(enter_kernel_el) isb eret - - .align 3 -.Lsctlr_res1: - .quad SCTLR_RES1 +#undef INIT_SCTLR_EL1 LEND(enter_kernel_el) /* diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 0ed21bf311c7..92ec8ea84546 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -144,10 +144,14 @@ #define SCTLR_EL2_C (0x1UL << SCTLR_EL2_C_SHIFT) #define SCTLR_EL2_SA_SHIFT 3 #define SCTLR_EL2_SA (0x1UL << SCTLR_EL2_SA_SHIFT) +#define SCTLR_EL2_EOS_SHIFT 11 +#define SCTLR_EL2_EOS (0x1UL << SCTLR_EL2_EOS_SHIFT) #define SCTLR_EL2_I_SHIFT 12 #define SCTLR_EL2_I (0x1UL << SCTLR_EL2_I_SHIFT) #define SCTLR_EL2_WXN_SHIFT 19 #define SCTLR_EL2_WXN (0x1UL << SCTLR_EL2_WXN_SHIFT) +#define SCTLR_EL2_EIS_SHIFT 22 +#define SCTLR_EL2_EIS (0x1UL << SCTLR_EL2_EIS_SHIFT) #define SCTLR_EL2_EE_SHIFT 25 #define SCTLR_EL2_EE (0x1UL << SCTLR_EL2_EE_SHIFT) From nobody Mon Sep 2 09:12:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31h2skRz5Mr5R; Mon, 02 Sep 2024 09:12: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 4Wy31g6vTcz4CMm; Mon, 2 Sep 2024 09:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2JV4eYNLGJMY0rvtGVuWrvBJFmvyxt894KOr/T8Cgmc=; b=jLNKMUhUgYIM50ysKLzpz+ZC8vVR5RsR5/aieSThObcdaeRqyW1ndkXHDXKMoJOqxmPlrm rM2L7chxDX89kXX/aM/t6GYyRh28Q5adgF3vQ6B2CY3LZeE3J/galvUbCrh/sPjHqydNLN LtCfdbinU0u+SJN2HWVb3MzFWIMMeFYu8xcLTuP3pRSx110nqg/lsDs9hhDD/aaIEzvV+j gErlyj7ThF8YeRa/Tqy3QdHWzD7ORn37XmJeegV1vKxxj7VoTAlsrNzmVPx24ltWUzDzcr 3N2kMqKNprCEMS6nksP4sexTNbZnZqWVjBoGJRN3hV3batYnuCttH0l+OZKDbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268360; a=rsa-sha256; cv=none; b=t7AokBOGZ5SryySPFVxirIxVGTdX5E5GV8ryDMHJolBBXKOdA4HbMH4TqpX9aUxOUVtvXb 5kWmFCvZWU3By4SIAmz64K6c2Dgq50Zo07zUHIKl+aq1p/fD559BcgZnY4lVzqbFNDqDV1 08xKIoD2hGlqX6gLj8/DJJdz5oXYpJPojLpUF8rgYKIR2x8kDdN4vF06yewSR0iZohRJgr p+uZs6ox7oiHlSNauyN5oj6H/RQ+wLlfwdqmZR7uM5ArkZbQ/azsVD1/ybx5Szzi+i9Ljh RXPID5JXYmnpiqHIL760fe/YlfzrbeJClMFeudg13KrzyAPaagm2XBQNJi/B8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2JV4eYNLGJMY0rvtGVuWrvBJFmvyxt894KOr/T8Cgmc=; b=xoVaD8aIQxuL6d+eVKGeJG6ZPPSYfrfcvNx9ZcNPFtuHwJCKQYdwGXMYWezkfqKLKBqwv0 5AazM5TKVEctJnBZu118hasCw68RU38IB3BOaZ23iWpPt62KcKQp40nmcK5DgIVEy8BuCy ySEp7Sja79cyRQkTQQy3NOvcFdrXoO20Er0666qF29IbTG6oOTiz1QtEPX2pxLB76dMAP8 CTqm5EH26lJlDBBW920v6FiEW3bEs1SsxDdswUIibNy/7+VhesSH01vt7LghTnEfV5BjwP 7RlTaGPWc6Asrj2xP5bZJTKMifZbTquAu3+kKPcjYTFhtKhnbKGwi57pRFiMvg== 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 4Wy31g65x2z15lb; Mon, 2 Sep 2024 09:12: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 4829CdcH049657; Mon, 2 Sep 2024 09:12:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CdBe049654; Mon, 2 Sep 2024 09:12:39 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:39 GMT Message-Id: <202409020912.4829CdBe049654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 556739a53c92 - stable/13 - dev/uart: Add APMC0D08 as found in the Intel E2100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 556739a53c924eb97253c95f777b61261e3d1b2e Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=556739a53c924eb97253c95f777b61261e3d1b2e commit 556739a53c924eb97253c95f777b61261e3d1b2e Author: Andrew Turner AuthorDate: 2024-07-23 09:18:36 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 dev/uart: Add APMC0D08 as found in the Intel E2100 This uart has the requirement for 32-bit sized and aligned memory accesses. It is also described in the Serial Port Console Redirection Table (SPCR) with a different interface type value. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45834 (cherry picked from commit 9840598aa31f2a89272f5bef6545e316f254f0c6) --- sys/dev/uart/uart_dev_ns8250.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 879fe6e04a70..8b3ea502a8af 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -415,6 +415,7 @@ struct uart_class uart_ns8250_class = { static struct acpi_uart_compat_data acpi_compat_data[] = { {"AMD0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, {"AMDI0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"APMC0D08", &uart_ns8250_class, ACPI_DBG2_16550_COMPATIBLE, 2, 4, 0, 0, "APM compatible UART"}, {"MRVL0001", &uart_ns8250_class, ACPI_DBG2_16550_SUBSET, 2, 0, 200000000, UART_F_BUSY_DETECT, "Marvell / Synopsys Designware UART"}, {"SCX0006", &uart_ns8250_class, 0, 2, 0, 62500000, UART_F_BUSY_DETECT, "SynQuacer / Synopsys Designware UART"}, {"HISI0031", &uart_ns8250_class, 0, 2, 0, 200000000, UART_F_BUSY_DETECT, "HiSilicon / Synopsys Designware UART"}, From nobody Mon Sep 2 09:12:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31j1sKMz5MqZQ; Mon, 02 Sep 2024 09:12: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 4Wy31j0Ctsz4CS3; Mon, 2 Sep 2024 09:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vq6xW3F9wBub8udzyCx/ufr05U81bazozwnAYYK8KFo=; b=ksh7Ta1gvK6nFlcGjOhFpq9GAxsCCIWRU4ECRIQpuVW4xWlz3tPR+O8wekqtfPf08xZ3hl WE5+5VYRTH1Fcw3FD1VdlePMSBR528wz5nR9B+19adAmNxLqsBtNxbwrrQmwhCDm/vFJrs UAyqwLqMwtpDFt5py8rPlMustHw2fBUnKjxlexaZVi901lyHyOnEIBNj6QbNE624MUJLhk biMHR+2TqZ/I7wJMjQBFUnPkg0PeZQFw7J2QDLmUDnjsF34aVytntnaYzOZ7RE2U6nf5BN XhKKPmxTItqZ4m5nn06bNuoH8NwqN6vyIg2yXVtILcbzcb1ZQCWrnKQ/s7j/Pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268361; a=rsa-sha256; cv=none; b=lfb4+FijMOjT45rqg60WVBtvPelK6TmoL75cyKm6oL02Xh0L4qfebAtH48SW+g/2p1n2Wr PHxJJ4cAq4Pm83/q2U6qeWSEViFXgFbiJEGeI4cBujATxLp1URicSR2MYYnNZ4Ia2Sqf7K GNsB5EHYs0pBAewS1NvVsjzP2089gSoVfvsfbIzV8z7yeSwGTBPCMjxL9lvGHav/o8UyzZ dl+gMK/fuw8frrkFgZDmErDL7NYRJBSlqH1exdT2MuA8jb8ib/f1iOgFDkGRCkZBJ8jmgC mSJ/Y+3y/SNU8BdxxMiaWYK3kXamUjF6hLRingEqFzzQB6jwm/LuEcf1Wyf35g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vq6xW3F9wBub8udzyCx/ufr05U81bazozwnAYYK8KFo=; b=BjwVN8Vi3YYX7cAlVbKMkkDpAsrotnvjb6YCoqQ5PO89WxLXQJJ1O4oXXMsCeXgp8BMMH3 ljvvVSl4S0t13554LaXO22BIcGMlrVdeKCo0ociepp88ambPk+DlxWJWX+ivDbNZj7z7TP IVav6qJQfGcwh0hen4W9gucE4ZzpPS1ea3ZY78JfV76rq9AfyuWlY+mr7em2IvRACqLbC3 sublELTTGO0MFZVWzde4uk4waAaqjhw9xv7RXQYaoK8lidDJJZTIvewI+vx7W5MtjHzzE9 vEw2U1VSZ2fMBwz27n6ZaZd8b6d5dlkDuewVXCwfozefSGuumwmMhS7Xt2naWg== 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 4Wy31h6yDqz160j; Mon, 2 Sep 2024 09:12: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 4829Cebm049707; Mon, 2 Sep 2024 09:12:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829Ce9t049704; Mon, 2 Sep 2024 09:12:40 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:40 GMT Message-Id: <202409020912.4829Ce9t049704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 292b2f9c5d14 - stable/13 - buf_ring: Make buf_ring.h amenable to userspace compilation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 292b2f9c5d141fbc4a9f7ef2df3e3950a467e69f Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=292b2f9c5d141fbc4a9f7ef2df3e3950a467e69f commit 292b2f9c5d141fbc4a9f7ef2df3e3950a467e69f Author: Mark Johnston AuthorDate: 2024-07-11 18:55:11 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Make buf_ring.h amenable to userspace compilation This will be useful for adding test cases. Reviewed by: andrew MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45869 (cherry picked from commit a161269b2451140a45de2d0cae0dad84f9e7b439) --- sys/sys/buf_ring.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 21e221220331..0645f97aa77c 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -30,11 +30,18 @@ #ifndef _SYS_BUF_RING_H_ #define _SYS_BUF_RING_H_ +#include +#include +#include #include #ifdef DEBUG_BUFRING +#ifdef _KERNEL #include #include +#else +#error "DEBUG_BUFRING is only supported in kernel" +#endif #endif struct buf_ring { @@ -361,8 +368,36 @@ buf_ring_count(struct buf_ring *br) & br->br_prod_mask); } +#ifdef _KERNEL struct buf_ring *buf_ring_alloc(int count, struct malloc_type *type, int flags, struct mtx *); void buf_ring_free(struct buf_ring *br, struct malloc_type *type); +#else -#endif +#include + +static inline struct buf_ring * +buf_ring_alloc(int count) +{ + struct buf_ring *br; + + KASSERT(powerof2(count), ("buf ring must be size power of 2")); + + br = calloc(1, sizeof(struct buf_ring) + count * sizeof(void *)); + if (br == NULL) + return (NULL); + br->br_prod_size = br->br_cons_size = count; + br->br_prod_mask = br->br_cons_mask = count - 1; + br->br_prod_head = br->br_cons_head = 0; + br->br_prod_tail = br->br_cons_tail = 0; + return (br); +} + +static inline void +buf_ring_free(struct buf_ring *br) +{ + free(br); +} + +#endif /* !_KERNEL */ +#endif /* _SYS_BUF_RING_H_ */ From nobody Mon Sep 2 09:12:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31k4J06z5MqZS; Mon, 02 Sep 2024 09:12: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 4Wy31k1JLvz4CSl; Mon, 2 Sep 2024 09:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0lTnEKAp1/RMXWnO32ex32GHNi3sxSWJhEY+6mHle/8=; b=suyiKH96ctbaTP+V/AxlUzB6DDrsnKaiN1MnsctniHmAIiRWbxlTBwIM2Pvjxul/+ac8fs XDIdeVUy/huhuWTsSQyQd7qkANRztLp98ojek+bx9gf30+mcECv2YljIldL5XKxM8AkhJj 3leqTT9onBZ3DLLzLcJSvTIBESjL+VetPS0n1U6jcbu24X4bk4XiGObzmyX1ITgnjn8SD4 SeL/dsJw5fVUxpvHLeS9XgEYez6hG3DueXjuhaSfsccgKcEc89spb5MMup8d4iVXg+Afy+ PxCX45xK57pPeFsPTllRv4VtzeKHlWem3mC4GQf8G5WxPdyE09y9pFKI0mHzRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268362; a=rsa-sha256; cv=none; b=dnUaflfF7tTcbrIeZvNtbHj+n08bbLdcQLp+Yxn3Dv5btS0Q32I9G6LDmlsPq1kec6TkMR auxCrR5qq2Bh7Tldu+W9ACV2rSZQvg+gIbBw/56Dnb9TQAMLYv0vTQWKe8uxar8A0eKxCH dImdiWL2ZUVg+A0QiTYP64Oe5/unGw8fnoDVrgiBaLCKhHG1FRD5pth/WX4JkXXY/DyZb4 TayyYvzX5cVltZPR/jXL3wNDgw0EUX2sJgbc0tz2lQP1w8Fbl/sYfhVlTF2INq9QmN0fwz cm5ASsdnx7Y4y04EE5I7owcWmk1KnPYMv/Ev1J0tmnHzzUUvAnm3YTEWHeA/vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0lTnEKAp1/RMXWnO32ex32GHNi3sxSWJhEY+6mHle/8=; b=EfVb+FjnIDX+/RUlgY3+CBuhNjGRrLSQSL1CXMmx2yqmzJ+AID53XHRtz3w6M4XWNukAZa 3I2VoYEJucsWpK8h+g0nIt4ZADDTMS4Sjz7e7kedIXhL8pou5CGHHZ64afdrCOjHS9qh8f +Akfrlb6cBMoQa17DQS/BtNT832ggghOtI8ZF/7eql/WJayntCNjfqvfRcGnffVEOnrYVF pEB9pJQKDx8BPClFWo6Xdyb0OHAZz4JEy9QxfoJE5COSIAJINZVrKfIafucCrtQQfeUpHC CfeXiY+7NrdtVhvZLXuZSkHZbfGsP541YHPbZl5RbsSc6AE+H2dTKwhQiZQu8g== 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 4Wy31k0vvYz160k; Mon, 2 Sep 2024 09:12: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 4829CgF4049743; Mon, 2 Sep 2024 09:12:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829Cgcw049740; Mon, 2 Sep 2024 09:12:42 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:42 GMT Message-Id: <202409020912.4829Cgcw049740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 6793d9305bfc - stable/13 - buf_ring: Remove PREFETCH_DEFINED List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6793d9305bfc8b758f2308d9ea437e80fc02b3d7 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6793d9305bfc8b758f2308d9ea437e80fc02b3d7 commit 6793d9305bfc8b758f2308d9ea437e80fc02b3d7 Author: Andrew Turner AuthorDate: 2024-07-29 10:28:15 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Remove PREFETCH_DEFINED I'm not able to find anything in the tree that ever defined it. Remove as it's unused so is untested. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46148 (cherry picked from commit 5048308bdb76f40e88c9133658fc61d82158ded2) --- sys/sys/buf_ring.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 0645f97aa77c..ad87a48bc695 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -165,9 +165,6 @@ static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { uint32_t cons_head, cons_next; -#ifdef PREFETCH_DEFINED - uint32_t cons_next_next; -#endif uint32_t prod_tail; void *buf; @@ -204,20 +201,10 @@ buf_ring_dequeue_sc(struct buf_ring *br) prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = (cons_head + 1) & br->br_cons_mask; -#ifdef PREFETCH_DEFINED - cons_next_next = (cons_head + 2) & br->br_cons_mask; -#endif if (cons_head == prod_tail) return (NULL); -#ifdef PREFETCH_DEFINED - if (cons_next != prod_tail) { - prefetch(br->br_ring[cons_next]); - if (cons_next_next != prod_tail) - prefetch(br->br_ring[cons_next_next]); - } -#endif br->br_cons_head = cons_next; buf = br->br_ring[cons_head]; From nobody Mon Sep 2 09:12:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31l5C49z5MqnY; Mon, 02 Sep 2024 09:12: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 4Wy31l2S5Pz4Ck2; Mon, 2 Sep 2024 09:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZoKY5JWkIzq9VlufBAFztJUjKx3rKjOdO/BzBB3KsA=; b=aKl7iekQ+QyaPfpx3iddOQku4LCqPZ7ND16hjJIdDGr2NvlMR9kWcqdm98D66RI+0FpWrP 3dL3u4jDIEtIAkH9vnEEMJWpIVg2TazZrUxYdt5Oa9IagvyFObA9oyE3dc6CaiZoQKW5Eo zjRRXGyDjA0dXpbiAL5Wlt0XvxlAyLXO1p9SNgrDVoWE89O0bAM87pVbVUPtFAU+dizLDT 30d+Ufvcq9B6GPAtNLtnnabqRlfB1mc3LN1BIEtq8FIe313To19g4921djBohy7IWrzQlm YyRNLYaMH6F2zJ9a3LKP9+oFJhU7AZliqWQS3ouEeg2RcnQo/JODRUoIsteiIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268363; a=rsa-sha256; cv=none; b=RbQpfrq6Uv+KXzYmvwpwxoITm38nYvuXBrPmzsZ6zDT5siF3SG5AHrSFccJgP5OLRDjqY/ liU2op0F7SXQSNMtHxU7WrrXlZN7XFOdhU6nvQi8ml7xTTWqsxT70jnEogGIx7An9EHLXD yxo4DehszXwaBHBi7w7dfdiDIMF47yuNJ/fnbHu7Kj7xtjGBywwJFiRlE2lW1/Y/c23f/C WfdbpcJ9K4yd19G8EquKNWVgpBQGAvOYEKoDLRc3SyqfxYUWQ2b5snKquRzgLkT4OFiXxR Yk4h8If9aQP8jzPPh+tRlefU37lQYTfWd1NbOEphnySlNdsdta4Jx3LH1hMuCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZoKY5JWkIzq9VlufBAFztJUjKx3rKjOdO/BzBB3KsA=; b=lW/+VRg+nhV8fuWTThIDViUH8ap7jnS9MDRhDUkYqNKwQHvM3yMjFJC+De3OyF93tNJmeU tJIBtszmDM0y90bkSaFD3R9XgCtYL1toy6DcyQeygEJjRTzkEPM2qn2Elh/l1ZtqVPZflj +5vZg94gLzaap8IXjQl6B9JsA/Q7CGzanPQz9jQcG8vPbJdv2/L83fcbEU8MHopUyar4w4 8I8K2CPTsL6gplPWlIwZYZwa6OT9qoI2sNDIRRP0O+hBfjeRjwDFIRnfr/SGutEEqnRxc2 mC0VPzfDSTfDFKppGNI7nFZYu/kff7UfqaM523UZL85rSUxdq+Sj+U5FVB1JCQ== 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 4Wy31l1w0Gz15lc; Mon, 2 Sep 2024 09:12: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 4829ChVh049791; Mon, 2 Sep 2024 09:12:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829ChIU049788; Mon, 2 Sep 2024 09:12:43 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:43 GMT Message-Id: <202409020912.4829ChIU049788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0f85e71ab563 - stable/13 - buf_ring: Support DEBUG_BUFRING in userspace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0f85e71ab5636fd32482e3241cfce57015c99436 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0f85e71ab5636fd32482e3241cfce57015c99436 commit 0f85e71ab5636fd32482e3241cfce57015c99436 Author: Andrew Turner AuthorDate: 2024-07-29 10:28:24 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Support DEBUG_BUFRING in userspace The only part of DEBUG_BUFRING we don't support in userspace is the mutex checks. Add _KERNEL checks around these so we can enable the extra debugging. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46149 (cherry picked from commit d3d34d56bee4222b3bf3ec26d7877998405115a3) --- sys/sys/buf_ring.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index ad87a48bc695..77a8e5ec65b8 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -35,13 +35,9 @@ #include #include -#ifdef DEBUG_BUFRING -#ifdef _KERNEL +#if defined(DEBUG_BUFRING) && defined(_KERNEL) #include #include -#else -#error "DEBUG_BUFRING is only supported in kernel" -#endif #endif struct buf_ring { @@ -54,7 +50,7 @@ struct buf_ring { volatile uint32_t br_cons_tail; int br_cons_size; int br_cons_mask; -#ifdef DEBUG_BUFRING +#if defined(DEBUG_BUFRING) && defined(_KERNEL) struct mtx *br_lock; #endif void *br_ring[0] __aligned(CACHE_LINE_SIZE); @@ -210,8 +206,10 @@ buf_ring_dequeue_sc(struct buf_ring *br) #ifdef DEBUG_BUFRING br->br_ring[cons_head] = NULL; +#ifdef _KERNEL if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); +#endif if (br->br_cons_tail != cons_head) panic("inconsistent list cons_tail=%d cons_head=%d", br->br_cons_tail, cons_head); @@ -277,7 +275,7 @@ static __inline void * buf_ring_peek(struct buf_ring *br) { -#ifdef DEBUG_BUFRING +#if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif @@ -296,9 +294,9 @@ buf_ring_peek(struct buf_ring *br) static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { -#ifdef DEBUG_BUFRING void *ret; +#if defined(DEBUG_BUFRING) && defined(_KERNEL) if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif @@ -320,17 +318,15 @@ buf_ring_peek_clear_sc(struct buf_ring *br) atomic_thread_fence_acq(); #endif + ret = br->br_ring[br->br_cons_head]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - ret = br->br_ring[br->br_cons_head]; br->br_ring[br->br_cons_head] = NULL; - return (ret); -#else - return (br->br_ring[br->br_cons_head]); #endif + return (ret); } static __inline int From nobody Mon Sep 2 09:12:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31m642Rz5Mqnc; Mon, 02 Sep 2024 09:12: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 4Wy31m4gBxz4C9V; Mon, 2 Sep 2024 09:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p842QrH7MSB+dDRDRahjxr2EyYAYdoffVeBZ/mTVuIA=; b=P6pnON/AmcWaWv7PyACFYTPV+9JrU91d3Rw+Mua0wbaFiYBk/wzyFHTMGNb3bD1OFTbLzK wctxJ/QWWxTCjQFqxVLYPn+izfC76jSVnDuoPx4aABYATdCxvbX7Jc2+fTouwBlneinb6L 1s3tIm0E3CgeJk63Q+7cXicq3InttF+3VYwPL7CJCmrjkSSKdn3JD5n/R31K+UCWrXpcW1 1YDe3+1L3qIET5lcPNCDVDCMlMK1GylMjSUIXANfxDgWEASi6XRZSuEiH3WcIPcLN4iRcm Tkk7piqS4FaBwUFzRkrHpS4k5/nR7es3FPbLfQn6JijDp8URr/00eqOW9r8ugw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268364; a=rsa-sha256; cv=none; b=FQJ9txblGI/ehJcUAQqfMHYK8DzNIs7xLAUDyUat7sg1IvPL6GViGs60AGnv6b1EgZoUJ2 Nbwx2yzENDkLWW7CK1A6uxeFLmwwrQj2xrZoSMAYGKGin84cQOdeIMPorqjtIG/8PSg3Fu Toagah0304V8oG57Z2yI7FzzCTQ/sfGMjJdyhsW5Iq2i2umUjEBcDEu4u0fdvAyPY+RfDz uCG9ytZpa0CPe/tYy5ONOCoboefLVeteHS26x+eADslF/+20NipSDVmHzlijdw8gwtbh4r wqDXDvT/7idlpJ6NmacWYNKV+x/6e4B0wn9IoF8Iz5OtG52i29RIQ9Kx6435GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p842QrH7MSB+dDRDRahjxr2EyYAYdoffVeBZ/mTVuIA=; b=RnR18wmzHKo/sqFcK27EOkqzZj+Fe8iMB5/V3ALXtFQOxL2XYnX7dT3u1HRgdgjT2NNLL7 hzWpTUpsjbckY4DP4c9ueoG+LUtA7H9AVUuhfxTqRhZ7lXmwiF5LIh5nZ9T2k9cOsDccKz ZxaRDB4pUpdwoGhUoeSPtSnaexa/koAYWQfYTD+0MrxCdxF06bl1WKj3eHRgM6heM6VAYf kfSmKcfuH430Y/vmA0me4KRg1ZsPDNbq4/930w3lVzjjhTBm8/SrpM9nnl8dkRzwVjimdH wRYYp286FLWRYQgNiVJqxQN/harH4tgNnsDzTqaN4HIy8fc8ilSSVqOv6VoV5g== 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 4Wy31m2zdGz16Dl; Mon, 2 Sep 2024 09:12: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 4829CiGP049832; Mon, 2 Sep 2024 09:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CiiI049829; Mon, 2 Sep 2024 09:12:44 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:44 GMT Message-Id: <202409020912.4829CiiI049829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 351c7a18d429 - stable/13 - buf_ring: Consistently use atomic_*_32 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 351c7a18d429cc179238cf3ae65e98f95ec5b12f Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=351c7a18d429cc179238cf3ae65e98f95ec5b12f commit 351c7a18d429cc179238cf3ae65e98f95ec5b12f Author: Andrew Turner AuthorDate: 2024-07-29 10:28:33 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Consistently use atomic_*_32 We are operating on uint32_t values, use uint32_t atomic functions. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46150 (cherry picked from commit 17a597bc13aa59ee90facaf9b8dada80f32eb52d) --- sys/sys/buf_ring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 77a8e5ec65b8..39c75dd5b09f 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -94,7 +94,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) } continue; } - } while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); #ifdef DEBUG_BUFRING if (br->br_ring[prod_head] != NULL) panic("dangling value in enqueue"); @@ -108,7 +108,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) */ while (br->br_prod_tail != prod_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_prod_tail, prod_next); + atomic_store_rel_32(&br->br_prod_tail, prod_next); critical_exit(); return (0); } @@ -132,7 +132,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_exit(); return (NULL); } - } while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next)); + } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); buf = br->br_ring[cons_head]; #ifdef DEBUG_BUFRING @@ -146,7 +146,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) while (br->br_cons_tail != cons_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_cons_tail, cons_next); + atomic_store_rel_32(&br->br_cons_tail, cons_next); critical_exit(); return (buf); From nobody Mon Sep 2 09:12:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31n5n02z5Mqlk; Mon, 02 Sep 2024 09:12: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 4Wy31n4ZPnz4Cbb; Mon, 2 Sep 2024 09:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V9IIdhlqY0nHVOWZ58Qqy+fW3ge1/F6ZKsBYYdpJK6g=; b=sbSrcnqbwRwlEtEF3JJzAWDg9RyT9Jh9t8fHSp2ULK03PPQs7+A7dRQ26gEInbF1Bqso4/ XwMFAyMxPIsckVcj4jOsRHMa5+tzx92hcQmqomyLHmeH0Go55iT7KE/VWfCJVDSu+nNbUp XPmzQiFdp1NINbHUk92hXQOIro+F+beuBiETonSHJ6OKFzLPStFInL5NwQfUKhkAFoBTWk hND3NpwjHnBS2oXafPIQaig6fqFgDDsm8QpSPRI7KkwAiPJYzZlEWSw8T7EUBZqLNfS06t t2OBYv2T8J1txZZXDzpFZzJGRsdrA/acbNHcv/G7VDxp5Q7Zo0G5ZPTI3GAD9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268365; a=rsa-sha256; cv=none; b=TmO092PxinnX3yfdG7tcAy0IZFgRje0XSKZsmxNTKlgvcOwCL+KyCbCwmD6/H/IavAnDNG xFgcWrQsfCM3pnZZhtBxfpmM1dvXCHgmi8YMo889DqMpqf/Pg2vOVVFIq4m/ENyBCFh7Jl vzWghYdX0h03oO3q0E8XOdl3pmmqtYvoT/aDLSV7Oe5DLmBwT8dbF7sZ2uRMIZKcYlakni fIu6sj2hzrKYqgj41O0EaSRAmJ+RzKF4bMYvq+UJYKf5t/aODJo2wRlmmMLT3GVInElaNh T+3bf6N7OB6Iw3/11u/zi88lNRyiCUc7xXqFKO/WXwFzjwoy6e+ehsvOG19kSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V9IIdhlqY0nHVOWZ58Qqy+fW3ge1/F6ZKsBYYdpJK6g=; b=i7s+Ihou+mWQGDcmANe7W8zYzuporAsWKSTYEQJOP6KIMpCrviX9310tIp+umCenUG5CYs udMJRG8FXZZnekTi6fToIN70W9GQptgQF/rtXVnFqy6m1gL58FRTo2M28dGKVlnXe3z+H5 wkdBJXDv51WPBjmUu0SlkUWJhSgeh/hV2Ctdc/i61tTAG/T8/d1ppWUJP8/cZJvXT2kteP uSQOM9Z7lTVLeE6+9uKCLp6Aktf1KMsww5k6EswT0SHV9Sa4z5CMQ1oL+s0+HPteUu3nC0 8ryoEYtybtXbEEsa9kQ4rrDS3mRj7ot+BxH459ldHe7u3NTOLoPQp9F6JOjPdw== 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 4Wy31n47mwz16Dm; Mon, 2 Sep 2024 09:12: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 4829CjwN049888; Mon, 2 Sep 2024 09:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CjQf049885; Mon, 2 Sep 2024 09:12:45 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:45 GMT Message-Id: <202409020912.4829CjQf049885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 7ab139235534 - stable/13 - buf_ring: Keep the full head and tail values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ab139235534ce9cdcafc5f33f312e3def501b29 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7ab139235534ce9cdcafc5f33f312e3def501b29 commit 7ab139235534ce9cdcafc5f33f312e3def501b29 Author: Andrew Turner AuthorDate: 2024-08-19 09:06:44 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Keep the full head and tail values If a thread reads the head but then sleeps for long enough that another thread fills the ring and leaves the new head with the expected value then the cmpset can pass when it should have failed. To work around this keep the full head and tail value and use the upper bits as a generation count. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46151 (cherry picked from commit 3cc603909e09c958e20dd5a8a341f62f29e33a07) --- sys/sys/buf_ring.h | 87 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 31 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 39c75dd5b09f..dec0f971ae44 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -40,6 +40,15 @@ #include #endif +/* + * We only apply the mask to the head and tail values when calculating the + * index into br_ring to access. This means the upper bits can be used as + * epoch to reduce the chance the atomic_cmpset succeedes when it should + * fail, e.g. when the head wraps while the CPU is in an interrupt. This + * is a probablistic fix as there is still a very unlikely chance the + * value wraps back to the expected value. + * + */ struct buf_ring { volatile uint32_t br_prod_head; volatile uint32_t br_prod_tail; @@ -63,28 +72,28 @@ struct buf_ring { static __inline int buf_ring_enqueue(struct buf_ring *br, void *buf) { - uint32_t prod_head, prod_next, cons_tail; -#ifdef DEBUG_BUFRING - int i; + uint32_t prod_head, prod_next, prod_idx; + uint32_t cons_tail, mask; + mask = br->br_prod_mask; +#ifdef DEBUG_BUFRING /* * Note: It is possible to encounter an mbuf that was removed * via drbr_peek(), and then re-added via drbr_putback() and * trigger a spurious panic. */ - for (i = br->br_cons_head; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if(br->br_ring[i] == buf) + for (uint32_t i = br->br_cons_head; i != br->br_prod_head; i++) + if (br->br_ring[i & mask] == buf) panic("buf=%p already enqueue at %d prod=%d cons=%d", buf, i, br->br_prod_tail, br->br_cons_tail); #endif critical_enter(); do { prod_head = br->br_prod_head; - prod_next = (prod_head + 1) & br->br_prod_mask; + prod_next = prod_head + 1; cons_tail = br->br_cons_tail; - if (prod_next == cons_tail) { + if ((int32_t)(cons_tail + br->br_prod_size - prod_next) < 1) { rmb(); if (prod_head == br->br_prod_head && cons_tail == br->br_cons_tail) { @@ -95,11 +104,12 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) continue; } } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); + prod_idx = prod_head & mask; #ifdef DEBUG_BUFRING - if (br->br_ring[prod_head] != NULL) + if (br->br_ring[prod_idx] != NULL) panic("dangling value in enqueue"); #endif - br->br_ring[prod_head] = buf; + br->br_ring[prod_idx] = buf; /* * If there are other enqueues in progress @@ -120,23 +130,26 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { - uint32_t cons_head, cons_next; + uint32_t cons_head, cons_next, cons_idx; + uint32_t mask; void *buf; critical_enter(); + mask = br->br_cons_mask; do { cons_head = br->br_cons_head; - cons_next = (cons_head + 1) & br->br_cons_mask; + cons_next = cons_head + 1; if (cons_head == br->br_prod_tail) { critical_exit(); return (NULL); } } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); + cons_idx = cons_head & mask; - buf = br->br_ring[cons_head]; + buf = br->br_ring[cons_idx]; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_idx] = NULL; #endif /* * If there are other dequeues in progress @@ -160,8 +173,8 @@ buf_ring_dequeue_mc(struct buf_ring *br) static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next; - uint32_t prod_tail; + uint32_t cons_head, cons_next, cons_idx; + uint32_t prod_tail, mask; void *buf; /* @@ -189,6 +202,7 @@ buf_ring_dequeue_sc(struct buf_ring *br) * * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. */ + mask = br->br_cons_mask; #if defined(__arm__) || defined(__aarch64__) cons_head = atomic_load_acq_32(&br->br_cons_head); #else @@ -196,16 +210,17 @@ buf_ring_dequeue_sc(struct buf_ring *br) #endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); - cons_next = (cons_head + 1) & br->br_cons_mask; + cons_next = cons_head + 1; - if (cons_head == prod_tail) + if (cons_head == prod_tail) return (NULL); + cons_idx = cons_head & mask; br->br_cons_head = cons_next; - buf = br->br_ring[cons_head]; + buf = br->br_ring[cons_idx]; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_idx] = NULL; #ifdef _KERNEL if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); @@ -226,18 +241,21 @@ buf_ring_dequeue_sc(struct buf_ring *br) static __inline void buf_ring_advance_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next; - uint32_t prod_tail; + uint32_t cons_head, cons_next, prod_tail; +#ifdef DEBUG_BUFRING + uint32_t mask; + mask = br->br_cons_mask; +#endif cons_head = br->br_cons_head; prod_tail = br->br_prod_tail; - cons_next = (cons_head + 1) & br->br_cons_mask; - if (cons_head == prod_tail) + cons_next = cons_head + 1; + if (cons_head == prod_tail) return; br->br_cons_head = cons_next; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_head & mask] = NULL; #endif br->br_cons_tail = cons_next; } @@ -261,9 +279,12 @@ buf_ring_advance_sc(struct buf_ring *br) static __inline void buf_ring_putback_sc(struct buf_ring *br, void *new) { - KASSERT(br->br_cons_head != br->br_prod_tail, + uint32_t mask; + + mask = br->br_cons_mask; + KASSERT((br->br_cons_head & mask) != (br->br_prod_tail & mask), ("Buf-Ring has none in putback")) ; - br->br_ring[br->br_cons_head] = new; + br->br_ring[br->br_cons_head & mask] = new; } /* @@ -274,11 +295,13 @@ buf_ring_putback_sc(struct buf_ring *br, void *new) static __inline void * buf_ring_peek(struct buf_ring *br) { + uint32_t mask; #if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif + mask = br->br_cons_mask; /* * I believe it is safe to not have a memory barrier * here because we control cons and tail is worst case @@ -288,12 +311,13 @@ buf_ring_peek(struct buf_ring *br) if (br->br_cons_head == br->br_prod_tail) return (NULL); - return (br->br_ring[br->br_cons_head]); + return (br->br_ring[br->br_cons_head & mask]); } static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { + uint32_t mask; void *ret; #if defined(DEBUG_BUFRING) && defined(_KERNEL) @@ -301,6 +325,7 @@ buf_ring_peek_clear_sc(struct buf_ring *br) panic("lock not held on single consumer dequeue"); #endif + mask = br->br_cons_mask; if (br->br_cons_head == br->br_prod_tail) return (NULL); @@ -318,13 +343,13 @@ buf_ring_peek_clear_sc(struct buf_ring *br) atomic_thread_fence_acq(); #endif - ret = br->br_ring[br->br_cons_head]; + ret = br->br_ring[br->br_cons_head & mask]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - br->br_ring[br->br_cons_head] = NULL; + br->br_ring[br->br_cons_head & mask] = NULL; #endif return (ret); } @@ -333,7 +358,7 @@ static __inline int buf_ring_full(struct buf_ring *br) { - return (((br->br_prod_head + 1) & br->br_prod_mask) == br->br_cons_tail); + return (br->br_prod_head == br->br_cons_tail + br->br_cons_size - 1); } static __inline int From nobody Mon Sep 2 09:12:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31p6xqYz5MrBd; Mon, 02 Sep 2024 09:12: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 4Wy31p4xlgz4C9r; Mon, 2 Sep 2024 09:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f6XGelX87Mj17vnyDmJKjUYg3G2afxC5k6pPsF8aKew=; b=Oe2CrfTiTsMDbBaZ2s/GsJvauVXm12Tm0l68rcKGVfuDnBz4oQIrEcJhphpsoVmOOIlm8i SYJRCxfvWa3Ih7A+6fiG53NmeIYaOkkR7C9wBJqzkMD9/iEEG3ueDhdE7/OA8WpbNdiSWc wXGSJcI3dQ1WM0sK/dOh3UdWFjd40AKX7HM5XCdu26C4mQdMXXhN12p0cULJ4mV8onHXCq OEtIC+NfvbgrFKC6Gjfscfa5/t5lIUcqnU+Ln+lIyPlbycMhzRpQFW+0j/+UdiTcc4q8Io fITAilzuHg9w4HIj/M1PB84X+DS5yr0xleQFxOEFHXb3UHFdDyn+Z1f8bSXQ5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268366; a=rsa-sha256; cv=none; b=QtRhp4nMgHPpoUOG8b45oaXD1ncFcU+ZjdrJKr3eBwdK7yCnLiwqcDz8jihPeQST/Gjqd+ t4mxe8YyiAyLPMwV7MbWTwCse8u23irtBgiq/uLrJYKIgdxJie9QHn17r8FevL+k5SxMqU oCxpkSK83I+RDA/T41B5AfizSpDmsTyBpHRRIsdS4ipBKvYM4ORJ9B6f+cyJd18yqnC7pb 8Vu8IKb63N7Jo2wyJ1YHJlytS/QZ6klDhLiDjksdXdUlUZWns4dNMSoxb6SmASNCzQyR+c nR+Sw26XBTTYMYr2D24MQvouwaZlQEEPKH/BtNYk6KYAivEPaYbaHRc6300h0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f6XGelX87Mj17vnyDmJKjUYg3G2afxC5k6pPsF8aKew=; b=cNG9bZnkBPjYlZ9hfyk+T/NKcETv/YtTVuT+D4sdv7d5t/YE29m0oWQ+NRmgS34/ReJRmB FL1KvmH4YXUKa3Tdymh27NeDaqFr2mBiLEm/qjnBYP0kv/aVeFkN7VvyETGA27lRUV0ca4 xC7lWw6TMbAoVkKd8CaixntRwvJ+TylT3XBYjbT3rjM2NNMIXGXsqLOW9Fv/3VhF9ajcj6 A3gwWSt+ngMj7V8OxsBaxEl2HuKwiCJZg1ktxaLDcPp0eGx4m65erfAj0yJWhLxl6AWYxy ruoNX/Zl3tNN8N8SoPurnzzpP9vGVF5+PFLaxHot6AweSVWntC4P4yKeeF6epA== 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 4Wy31p4YlJz16Dn; Mon, 2 Sep 2024 09:12: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 4829Ckmo049933; Mon, 2 Sep 2024 09:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CkXS049930; Mon, 2 Sep 2024 09:12:46 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:46 GMT Message-Id: <202409020912.4829CkXS049930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3c15d02bb8a1 - stable/13 - buf_ring: Use atomic operations with br_cons_tail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c15d02bb8a193d7c38cb9689454e4f26d12bb21 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3c15d02bb8a193d7c38cb9689454e4f26d12bb21 commit 3c15d02bb8a193d7c38cb9689454e4f26d12bb21 Author: Andrew Turner AuthorDate: 2024-08-19 09:06:52 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Use atomic operations with br_cons_tail Use an atomic operation with a memory barrier loading br_cons_tail from the producer thread and storing to it in the consumer thread. On dequeue we need to read the pointer value from the buf_ring before moving the consumer tail as that indicates the entry is available to be used. The store release atomic operation guarantees this. In the enqueueing thread we then need to use a load acquire atomic operation to ensure writing to this entry can only happen after the tail has been read and checked. Reported by: Ali Saidi Co-developed by: Ali Saidi Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46152 (cherry picked from commit 44e1cfca417c5ef0db908f3836ec3ba704ef1de2) --- sys/sys/buf_ring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index dec0f971ae44..9aeb5aa19fa8 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -91,7 +91,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) do { prod_head = br->br_prod_head; prod_next = prod_head + 1; - cons_tail = br->br_cons_tail; + cons_tail = atomic_load_acq_32(&br->br_cons_tail); if ((int32_t)(cons_tail + br->br_prod_size - prod_next) < 1) { rmb(); @@ -229,7 +229,7 @@ buf_ring_dequeue_sc(struct buf_ring *br) panic("inconsistent list cons_tail=%d cons_head=%d", br->br_cons_tail, cons_head); #endif - br->br_cons_tail = cons_next; + atomic_store_rel_32(&br->br_cons_tail, cons_next); return (buf); } @@ -257,7 +257,7 @@ buf_ring_advance_sc(struct buf_ring *br) #ifdef DEBUG_BUFRING br->br_ring[cons_head & mask] = NULL; #endif - br->br_cons_tail = cons_next; + atomic_store_rel_32(&br->br_cons_tail, cons_next); } /* From nobody Mon Sep 2 09:12:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31r29XZz5Mr7V; Mon, 02 Sep 2024 09:12: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 4Wy31q6pfYz4Cc5; Mon, 2 Sep 2024 09:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvylgYgoruarWN75cRWGqmVv1JprXwyGRBCMh+yOYTQ=; b=LPmH+uMrevcVGu8rC23A4Y4FYBMjRDdysEe/HKhDfgXRsitDy+IREtOR/0jzgEbTayhoU6 qON/sC8uWTjmB4IvSiZBRlsecnICfeHGJiIOGXEPOjNrgmk7kxQ24l9u8SrkQez57H47bJ gRb1MVbVJfnNvwngXGcd7wpFEBiB2GJKjcB8l21Zb2x9R1G4WEgoVuwGw1Rz6EENOORX4q JG9P7pE6PuqHEv1892r5kSFBPV4e6F6GujdjYQXqlVv2l4iT5sB5/MR0MFKGSgEbnDcWVG 7RtWewcPMOgXnSf+s7qG/3lAh5kXLwuWAs7ePfpesDrEVS3QbEwgLRHEqdFr3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268368; a=rsa-sha256; cv=none; b=y3Js7h1jcHrQ7QbktBY4FTXHsbRT/bvE9e6s3bNNjC/xsbV1iHL7B38PvKPFPX9HAxOjQk aTVTwTpJcVbgQGAlIAMjzJeZ8BnRass9WnuKvAOxkVcVMi75DLO0z441jtaWoRgeADDY8m V/4bz6i3u7IVAcVVkyCkN5IW9LNQPDMTDmyTw1441EZgGG2bgzYPwQaqio+ldG2nqi72hc pEDBy6Fd7+kRjtVWY9eiH1r2iCwqALvq6VGTkiMTnlUNWZGC5jFwr8s+hvIZqoZN+YtvgB 1RhQdoESReLG8NJPkTq0GYP+zNgzTdwRocPkkwP/O8bgGDP/ylXyqkPYOQmmpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvylgYgoruarWN75cRWGqmVv1JprXwyGRBCMh+yOYTQ=; b=Dw4BT8Tprp7zQ3xXtOROfZfQdTz5xe/TfVPKpDAV7wxUwwCx7+dc+mT1Qx3es53GGg98/t TPaosRwvtL9WVJQ9APS/mm7ooG/I4wXNBupIPsIqly1+EA4F8gpNsODUolKW+KQ7DSiziA cFQeT8wB05AcPz0UMUX9Aus12kSIcIXKPyBBgmc9CSOjPxy6dVSd85C3dU3+j5sliDIsB2 oZcVXbgrQvo7nW1C2GjrhOJsh0gdm/d3zF+Oen3hcJ0W0OoFeswUrKwlgc4oVhahoLgNaI 9Ik1Jx1IBEuMdNPQ/vtMRsGYDgXis1qY9v3oFm6ZbHgNBaLvgOMqDEpOZWd3PA== 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 4Wy31q5w5wz15ld; Mon, 2 Sep 2024 09:12: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 4829ClGO049978; Mon, 2 Sep 2024 09:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829ClSP049975; Mon, 2 Sep 2024 09:12:47 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:47 GMT Message-Id: <202409020912.4829ClSP049975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: b5410efe42c5 - stable/13 - buf_ring: Remove old arm-only dequeue code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b5410efe42c5bcf78d3f41052266a758e4fd03fc Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b5410efe42c5bcf78d3f41052266a758e4fd03fc commit b5410efe42c5bcf78d3f41052266a758e4fd03fc Author: Andrew Turner AuthorDate: 2024-08-19 09:07:10 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Remove old arm-only dequeue code In the single consumer dequeue the consumer thread controls br_cons_head. As such no ordering between this and other data are required. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46153 (cherry picked from commit 7eb0fffc7792bc294d6b86546a3923e2e2f83f8a) --- sys/sys/buf_ring.h | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 9aeb5aa19fa8..ad463fba27cb 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -177,37 +177,8 @@ buf_ring_dequeue_sc(struct buf_ring *br) uint32_t prod_tail, mask; void *buf; - /* - * This is a workaround to allow using buf_ring on ARM and ARM64. - * ARM64TODO: Fix buf_ring in a generic way. - * REMARKS: It is suspected that br_cons_head does not require - * load_acq operation, but this change was extensively tested - * and confirmed it's working. To be reviewed once again in - * FreeBSD-12. - * - * Preventing following situation: - - * Core(0) - buf_ring_enqueue() Core(1) - buf_ring_dequeue_sc() - * ----------------------------------------- ---------------------------------------------- - * - * cons_head = br->br_cons_head; - * atomic_cmpset_acq_32(&br->br_prod_head, ...)); - * buf = br->br_ring[cons_head]; > - * br->br_ring[prod_head] = buf; - * atomic_store_rel_32(&br->br_prod_tail, ...); - * prod_tail = br->br_prod_tail; - * if (cons_head == prod_tail) - * return (NULL); - * ` - * - * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. - */ mask = br->br_cons_mask; -#if defined(__arm__) || defined(__aarch64__) - cons_head = atomic_load_acq_32(&br->br_cons_head); -#else cons_head = br->br_cons_head; -#endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = cons_head + 1; From nobody Mon Sep 2 09:12:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31s6m9Sz5Mr5p; Mon, 02 Sep 2024 09:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy31s0RTsz4Cj5; Mon, 2 Sep 2024 09:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=223n5vHzBTjjuiGZTBrtQPgxJipI82R6hQSVnZJx1uw=; b=e5SEBFUfLXnqzE9KHyakSuhdlhPlKnLEAtBDm0RkuizbtHF7N+zu3JWgiC2LDZr/cFoX/D JgrbJzJLADmPZns/NtS5I4ZNEH5lMpaDhO1Ad7cUD5I+Q4tLpFKQ3iypYlLo1Pzb3wVFxj YS431XMeL38YX6T058xkfMMXUrAxKY6yshQSTnDF7upebuDyYcSh7s9hyhOF3RmhUtsa1r 6KCzCNDSZBpsdOz0b9BiZTUL2p3ozQ96Mx5nUJ/FaUDYjkww+xUa6A1m3+DtbE3AqSaZfu OVfs+M5giOu0At5py1ztwQS0jm4iiMW2JcECDJpgDuvdaWhy65FNYfj599a0jA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268369; a=rsa-sha256; cv=none; b=USR7I6ahww8Y3Q8hddQxgTH3Ppq8O/O4+wEzdmf2JvvG+JBwD6LCAo8ILsvrmWuSyNm83Z k82YZNd5Bf2M66xxV64WynHO9kCb6qL7M2XyTXqln0FbUCTWjICKfvxBwlreVXjtipMwdQ wNusjc484nPvXzHyKdD77kDjukMd6KHiel2E98QERoG//t2xB4YYu426uio9OQu81rD0U7 TkW5zsQclmusX5WqSPprTNRUZv3iWl5GjfpT7kiEvXTy5dhnK18+bpoHO3WSWyHUKGL+qh yDY6b81nObX3oIHuOyXAHZ0kDN1WFQL++j1GLsiGnpjVFNiqBNFbbVRXyS2H1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=223n5vHzBTjjuiGZTBrtQPgxJipI82R6hQSVnZJx1uw=; b=p3rYlasFt3Ys6hE1qxi+vpgi+JPCVJ1iaB7vF4W3MIRvWn7NlO79LzMwv6/GdEWfeLgHlJ F1otUPDm77A62ljjcf/ue0Qrav6y6NUngZAcEXzkd+ssLLlx0rgHifST9D104+Ofim3Ahe FT+QKcWrDysqR442IAJn7+JNA4SgXZiy4fr1VkSdum2ByAvsc43PHuaTIS2+P13I2BrQC1 jgK44L/PdzSAqAsYGIKE/FRzxr/g1T3GbF8D4sIcv+DNuyOlwu+RuCMeGaZ8kyW0Q0mhRy Lk4jO7aj2//5aMGXl7tzLNFVIq6YbP3F859N7VmcT95H02Nq0JqIF70MIwp97g== 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 4Wy31r75kZz16Gb; Mon, 2 Sep 2024 09:12: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 4829Cmpg050033; Mon, 2 Sep 2024 09:12:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829CmYm050030; Mon, 2 Sep 2024 09:12:48 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:48 GMT Message-Id: <202409020912.4829CmYm050030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 74538cec0cfb - stable/13 - buf_ring: Use atomic operations with br_prod_tail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 74538cec0cfba5d336f294dcdf7357db6aa5a850 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=74538cec0cfba5d336f294dcdf7357db6aa5a850 commit 74538cec0cfba5d336f294dcdf7357db6aa5a850 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:19 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Use atomic operations with br_prod_tail As with br_cons_tail use an atomic load acquire to read br_prod_tail in buf_ring_dequeue_mc and buf_ring_peek*. On dequeue we need to ensure we don't read the entry from the buf_ring until it is available and prod_tail has updated. There is already an appropriate store in the enqueue path and an appropriate load in the single consumer dequeue, we just need one in the other functions that read from the buf_ring. Reviewed by: imp, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46154 (cherry picked from commit 947754af55edc217c10e3456d97558c4eb6d0f99) --- sys/sys/buf_ring.h | 45 ++++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index ad463fba27cb..66e1e55bc5e9 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -131,7 +131,7 @@ static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { uint32_t cons_head, cons_next, cons_idx; - uint32_t mask; + uint32_t prod_tail, mask; void *buf; critical_enter(); @@ -139,8 +139,9 @@ buf_ring_dequeue_mc(struct buf_ring *br) do { cons_head = br->br_cons_head; cons_next = cons_head + 1; + prod_tail = atomic_load_acq_32(&br->br_prod_tail); - if (cons_head == br->br_prod_tail) { + if (cons_head == prod_tail) { critical_exit(); return (NULL); } @@ -266,29 +267,26 @@ buf_ring_putback_sc(struct buf_ring *br, void *new) static __inline void * buf_ring_peek(struct buf_ring *br) { - uint32_t mask; + uint32_t cons_head, prod_tail, mask; #if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif mask = br->br_cons_mask; - /* - * I believe it is safe to not have a memory barrier - * here because we control cons and tail is worst case - * a lagging indicator so we worst case we might - * return NULL immediately after a buffer has been enqueued - */ - if (br->br_cons_head == br->br_prod_tail) + prod_tail = atomic_load_acq_32(&br->br_prod_tail); + cons_head = br->br_cons_head; + + if (cons_head == prod_tail) return (NULL); - return (br->br_ring[br->br_cons_head & mask]); + return (br->br_ring[cons_head & mask]); } static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { - uint32_t mask; + uint32_t cons_head, prod_tail, mask; void *ret; #if defined(DEBUG_BUFRING) && defined(_KERNEL) @@ -297,30 +295,19 @@ buf_ring_peek_clear_sc(struct buf_ring *br) #endif mask = br->br_cons_mask; - if (br->br_cons_head == br->br_prod_tail) - return (NULL); + prod_tail = atomic_load_acq_32(&br->br_prod_tail); + cons_head = br->br_cons_head; -#if defined(__arm__) || defined(__aarch64__) - /* - * The barrier is required there on ARM and ARM64 to ensure, that - * br->br_ring[br->br_cons_head] will not be fetched before the above - * condition is checked. - * Without the barrier, it is possible, that buffer will be fetched - * before the enqueue will put mbuf into br, then, in the meantime, the - * enqueue will update the array and the br_prod_tail, and the - * conditional check will be true, so we will return previously fetched - * (and invalid) buffer. - */ - atomic_thread_fence_acq(); -#endif + if (cons_head == prod_tail) + return (NULL); - ret = br->br_ring[br->br_cons_head & mask]; + ret = br->br_ring[cons_head & mask]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - br->br_ring[br->br_cons_head & mask] = NULL; + br->br_ring[cons_head & mask] = NULL; #endif return (ret); } From nobody Mon Sep 2 09:12:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31t2Vtcz5Mr5v; Mon, 02 Sep 2024 09:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy31t1SLnz4Csh; Mon, 2 Sep 2024 09:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GzauxNYGekcGYl1qzNlmAdBHCTy8I3GO7dgJjGnpcaI=; b=fUn+OXiNK3b6LmZsquEwHoq+I8cQcopjNX4LrVx+DAcCXpYUZ71Pao2B06KRVkzU0EyKV8 1WSymT/ai2kWOOYG0Yv2QmeYleVjmpgaruqK/4sY32agtqFJ3xohfrnOTsY0F/HM5UjkuT NPZoUcoE/hFqJaqSCAb0/xWXUnQn3wo8UrCKhziiK5KwFTkvxMnmhZMB/rsvJrc3qh7ghF 8LRtFQJBCDnSY1I1CoFmAyUNE2vWrBMTZc/OsttJymLW0OM7fiCNjcBW80GlXg/ADXZz3A 0nQGZ35aG7FpTgAQyeQUl2Dme9i9kPoQUR+FWR6XU0bM7hWNoO/+2KFSZorS7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268370; a=rsa-sha256; cv=none; b=qCJfWNH7xBilZoZLN+iAyknpIHwz8E5kTtjtdizKY+z06bY0eOXFy8ehubsY3BwOq9fxhz myWufQCtlHmnVEeVg6CoZK+uQ3p3Qta+aK1T9dWmI1aeCWIU65h9KADLosNlYwwpWrVgid ZpfYEigL5Uqp1qsMif2bUelimgihPRolSNSkOCBrTnF/72XA0F9oCP4CkZrBhUvaMJprxO r3jbN7zOBtHf4du3NlmEOAfzHn0LLh9Tzn/sx3pjxQkOZNeHt6cIGUslA35Un8eFg+f57/ /8IHXYggrbdJBaG3dwdGajY9w1wAOmIjutTaa8P0FTv+4eDkv0lHHJl9ckGB2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GzauxNYGekcGYl1qzNlmAdBHCTy8I3GO7dgJjGnpcaI=; b=krBBP1b5KtulWXEjnRPGH7l17nlbsyQoJWruuvb4zyvl6gyvt0QzENBNpTnLBYUxbHnqo0 twfijZ8cs4DxgOxIBe9LkGlqt5zcHnpA7OHj5U1/2LwIvHwSH6kqd2iWAEQjzbmX0ETurl 3NKaASmzwuRfyPtGStA28Bufun7wq76mhhhv9neDAnpOi3I/66bNApxCRI4cyyJqi05DdO 0aWBfr8H7tJqUWIL2RehteTeyo313037zxOLCrX4hjeOBkY/Nq8VyNFqnvhus2eFROUUa6 ykVo58cJcICcY3nNQoUMSR2g3KfZGRVLiNqJnVjOGurnthJ7ITIL51Ct9+2hpw== 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 4Wy31t10wPz16Dp; Mon, 2 Sep 2024 09:12:50 +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 4829Coru050086; Mon, 2 Sep 2024 09:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829Cort050083; Mon, 2 Sep 2024 09:12:50 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:50 GMT Message-Id: <202409020912.4829Cort050083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 39757e10689d - stable/13 - buf_ring: Ensure correct ordering of loads List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39757e10689d44036b5d10de41d766641e59eec0 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=39757e10689d44036b5d10de41d766641e59eec0 commit 39757e10689d44036b5d10de41d766641e59eec0 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:26 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:57 +0000 buf_ring: Ensure correct ordering of loads When enqueueing on an architecture with a weak memory model ensure loading br->br_prod_head and br->br_cons_tail are ordered correctly. If br_cons_tail is loaded first then other threads may perform a dequeue and enqueue before br_prod_head is loaded. This will mean the tail is one less than it should be and the code under the prod_next == cons_tail check could incorrectly be skipped. buf_ring_dequeue_mc has the same issue with br->br_prod_tail and br->br_cons_head so needs the same fix. Reported by: Ali Saidi Co-developed by: Ali Saidi Reviewed by: imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46155 (cherry picked from commit fe2445f47d027c73aa7266669e7d94b70d3949a4) --- sys/sys/buf_ring.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 66e1e55bc5e9..512f20dc13e2 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -89,7 +89,17 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) #endif critical_enter(); do { - prod_head = br->br_prod_head; + /* + * br->br_prod_head needs to be read before br->br_cons_tail. + * If not then we could perform the dequeue and enqueue + * between reading br_cons_tail and reading br_prod_head. This + * could give us values where br_cons_head == br_prod_tail + * (after masking). + * + * To work around this us a load acquire. This is just to + * ensure ordering within this thread. + */ + prod_head = atomic_load_acq_32(&br->br_prod_head); prod_next = prod_head + 1; cons_tail = atomic_load_acq_32(&br->br_cons_tail); @@ -137,7 +147,12 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_enter(); mask = br->br_cons_mask; do { - cons_head = br->br_cons_head; + /* + * As with buf_ring_enqueue ensure we read the head before + * the tail. If we read them in the wrong order we may + * think the bug_ring is full when it is empty. + */ + cons_head = atomic_load_acq_32(&br->br_cons_head); cons_next = cons_head + 1; prod_tail = atomic_load_acq_32(&br->br_prod_tail); From nobody Mon Sep 2 09:12:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy31v4vLpz5MqrB; Mon, 02 Sep 2024 09:12: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 4Wy31v2R5zz4Cp8; Mon, 2 Sep 2024 09:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S64LBSnb3A6UoNpze6pARF4jrotiC5eMry9yh3IanXs=; b=vt1N+Unn75PHOe39bo149ZMA9lWWxcHKFxxjZkjms+PQZ2huv3xwN9M7FLe9HL2bTTtVQa gR16yKShMuEs9GZ3jqJ+43y0H7tsY2VZb8VWcsPK0lkwypAQhOif1FM2VPXkXEB8mJsvzF dtP1e1TGWBSYwjjJjB4uvld0fwxMGjklQ4Mi8NK6NUT+QNtHutZCKLMpQ8y0z233CKwsmI iF81VNIk8qIFqiRpAfdfpDfdc9yOq7D6FJ7s+dZU0Z+5VQttsPeiAZgYB/q/7PIj8tM5Wj ZEMwl9oZqBC4smEL+DhOVL/68vbVR0FGqvJKUF4VM9CTk41jTr9XpbdsHmcGUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725268371; a=rsa-sha256; cv=none; b=VDT+5L7hy8jjRKJ9zGv9Azt8FPK6UsPdVTGims0VQgF13MkDLFXG04n/vOydJkhCsePmR4 AeLb+EfH7cDmSYnTQfLD0AZPlkiPMN/Ko9iV146up6/4Zqb6fpG4jomUs73y5lGTKmAxIl 1JhZd0pn4UKJZaP2za9H2IE/R6eLTFIdV9V00HomU+KPc4NfT+juaK3qSkpxodW80/uAzC N20vSyoYvRI82x5f0fZ6X6QfMxRu5/N+7St2eJcyF23B/n50tpj3QNZ+vwbnGlkMtNV0YE 51V/Gtc+rqfSNSn87fJnhqP03J/KvwQMxBbfh45TpSr7RRiHq5Whpoh35Lbzgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725268371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S64LBSnb3A6UoNpze6pARF4jrotiC5eMry9yh3IanXs=; b=onaOlNlrwyLQ65SGBzFNOw+ifX/ZE1k3/TsGg7/L2+W7DzPK0gWzl6BZ/jDta5ZiHyOs+s x858fbOqUTPQfuG+c2bI4nNs16kPPvLpx/kz5e4kkBVJpF0/tHSfOb7ZbPwc899IBqCGsg 35BKpUVuyg5PYyBfiSH7RKsVXtomtVPCJKaUfichtm5r1s+pDRJjB6sVr0JMdYuI6ybPOr puWyI7+/eldDpvCdWUpyX6HtUf2QH6a3v8r7OJTjE6bMOiFB0Hvb5KolXfgjdNkViftU5E M6DjCPpk9pMIZscEtsZCgIxPYQE0e9WAjDTVQPuslbcsdhTMXit6wyNfIro0jQ== 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 4Wy31v23VLz16K2; Mon, 2 Sep 2024 09:12: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 4829CpN4050128; Mon, 2 Sep 2024 09:12:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829Cpc9050125; Mon, 2 Sep 2024 09:12:51 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:12:51 GMT Message-Id: <202409020912.4829Cpc9050125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: c3a00482a3dd - stable/13 - buf_ring: Add an Arm copyright List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c3a00482a3dd95ddaa8228656530efbdb6d64246 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c3a00482a3dd95ddaa8228656530efbdb6d64246 commit c3a00482a3dd95ddaa8228656530efbdb6d64246 Author: Andrew Turner AuthorDate: 2024-08-19 09:08:20 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 09:11:58 +0000 buf_ring: Add an Arm copyright I've change enough of this file to add Arm as a copyright holder. Add it after the "All rights reserved" line as that's not needed. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46157 (cherry picked from commit 87940d2b331c2575f96fbff2600d8da35191157b) --- sys/sys/buf_ring.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 512f20dc13e2..c99cf81d8b6d 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -3,6 +3,7 @@ * * Copyright (c) 2007-2009 Kip Macy * All rights reserved. + * Copyright (c) 2024 Arm Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From nobody Mon Sep 2 09:56:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy40C2JsMz5MvHv; Mon, 02 Sep 2024 09:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy40C1WFRz4KbG; Mon, 2 Sep 2024 09:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725270987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohAQ8V2+mfrqAoJsTkQCXskZqjxsA26JW6n4WF4IXWA=; b=W43CR67Wo9wllD9ljIQ8Lqyc2ghljmWTe1plbjnls360JbIczZFCKEYNvvCZzezn5zEfOL Qtsk2hEFp5tZYFDYdEb9TB0r7PzdkSEWFdJpA/oD17sA7hXmV3TdmU1Jom+tTt55gJsI71 BZAuU/6qCf1K7U0bLQpCwRCTBGFmfNtnrfQFh6rbHd9NsdoDDjooQytX6YIKPbRBxcLtGd drqjtRkAvUAsDH1+wdUL0Hk/lGAFugnaEQmQUGnhN+Bn1GrIuwK8QfiWGPhBY8eNwVpEKc xXCabLWMtS6CerO4qPy52yf5ZjpxDTx+Zc+VUyRu+AI72FWvUk+V146VUlME2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725270987; a=rsa-sha256; cv=none; b=v04Zweg4wGB84yOZkNe+uaSAKjK2AAa/S+4TFMOW62+RrvllgHc+THCDA7K9k7D6riq1R+ l91Rho2LJHCahTOrYhs3Ryr2MlM2OCEKprNeCrPiz7D6tMJB4WnbaNovma943xLQ8T1TK/ IxPWHAcyg1qn3RBriGQOlgRFsC7aXrELOzrkuoxt8N/tBPqzqwP6uRB17aos5PqYzigWJ3 u8hw8hKnLjJtEs2KuumVIio5u92FxWkJK9VxYwM1Faoz9yopgd/Um1hUCWDA9CjorRkT9z QUcsSysVjOUXv2GNmbicmBSynzQZj1FmYtC5UqOUwYtz6ZMXlmfk/RkYXX1rQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725270987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohAQ8V2+mfrqAoJsTkQCXskZqjxsA26JW6n4WF4IXWA=; b=pczDzEq843XzvQZnzR19BtTcqyu8LL7WRc1DbLvY0pYLRILZcdOQee1ambn4YB2vGW7dCe O+RyaAx/ApC9Oa9DaNqNwTae9C0HDXumarXfRZ46MZtPuvj5J771/HXC/WrbxNEDZIYvv0 ZrMgoaCPOEaZvLWuzeToyKTNijlw06VPw/xSi9eD+9MymCURaXAf/W8B5MALlW20IIhwU9 IcJfNXQFafhBJ/AWuXFVDk1qEi3muAp6MRp4iv/1G8Ca8maB+32Twju0RFLkvSKxm1fCgl rsiu3f3Nxb16+iDE0kUFjKI40c8OaKchUC3dOP7wfb6skO8dnsm6bGwziimeyw== 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 4Wy40C14PXz17Fc; Mon, 2 Sep 2024 09:56:27 +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 4829uR74018132; Mon, 2 Sep 2024 09:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4829uRjl018129; Mon, 2 Sep 2024 09:56:27 GMT (envelope-from git) Date: Mon, 2 Sep 2024 09:56:27 GMT Message-Id: <202409020956.4829uRjl018129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 9867b4af50c6 - main - Makefile.inc1: show time for `make installworld' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9867b4af50c627586c68b26ddc5a7344286eefaf Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=9867b4af50c627586c68b26ddc5a7344286eefaf commit 9867b4af50c627586c68b26ddc5a7344286eefaf Author: Wolfram Schneider AuthorDate: 2024-09-02 09:55:10 +0000 Commit: Wolfram Schneider CommitDate: 2024-09-02 09:55:10 +0000 Makefile.inc1: show time for `make installworld' For years we display the time in seconds how long it takes to run `make buildworld' (see PR 224433). Now we will display the time for "installworld" and "installkernel" as well. e.g.: -------------------------------------------------------------- >>> Installing everything completed on Sun Jul  7 16:11:37 UTC 2024 >>> Install world completed in 110 seconds, ncpu: 2, make -j2 -------------------------------------------------------------- This is an improved version of commit e5a0202f96948a95bf1b879727e155a4f1d1da93 PR: 280187 Differential Revision: https://reviews.freebsd.org/D45912 --- Makefile.inc1 | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 5400cb5e734a..a4e2889004b7 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1241,11 +1241,19 @@ WMAKE_TGTS+= build${libcompat} .endif WMAKE_TGTS+= everything -# record buildworld time in seconds +# record buildworld / install time in seconds .if make(buildworld) _BUILDWORLD_START!= date '+%s' .export _BUILDWORLD_START .endif +.if make(reinstall) || make(restage) +_INSTALLWORLD_START!= date '+%s' +.export _INSTALLWORLD_START +.endif +.if make(*installkernel*) +_INSTALLKERNEL_START!= date '+%s' +.export _INSTALLKERNEL_START +.endif buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue @@ -1313,11 +1321,11 @@ kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY installcheck: _installcheck_world _installcheck_kernel .PHONY _installcheck_world: .PHONY @echo "--------------------------------------------------------------" - @echo ">>> Install check world" + @echo ">>> Install check world started on `LC_ALL=C date`" @echo "--------------------------------------------------------------" _installcheck_kernel: .PHONY @echo "--------------------------------------------------------------" - @echo ">>> Install check kernel" + @echo ">>> Install check kernel started on `LC_ALL=C date`" @echo "--------------------------------------------------------------" # @@ -1641,6 +1649,8 @@ restage reinstall: .MAKE .PHONY .endfor @echo "--------------------------------------------------------------" @echo ">>> Installing everything completed on `LC_ALL=C date`" + @seconds=$$(($$(date '+%s') - ${_INSTALLWORLD_START})); \ + echo ">>> Install world completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" @echo "--------------------------------------------------------------" redistribute: .MAKE .PHONY @@ -1873,6 +1883,9 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" + @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \ + echo ">>> Install kernel(s) ${INSTALLKERNEL} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" + @echo "--------------------------------------------------------------" .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} @@ -1887,6 +1900,9 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY @echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" .endfor + @seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \ + echo ">>> Install kernel(s) ${BUILDKERNELS} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" + @echo "--------------------------------------------------------------" .endif distributekernel distributekernel.debug: .PHONY From nobody Mon Sep 2 10:15:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wy4Qh2nvZz5PQKb; Mon, 02 Sep 2024 10:15: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 4Wy4Qh1yKDz4MGZ; Mon, 2 Sep 2024 10:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725272156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzptZCq+CmywKLYWVUAOnENmjhkGLR3YzKylF2eAsvc=; b=H1r6GDEaj4KGhypL+r92fPmZohjGEtJXyhvvyccJ4l2kVISKXLfL4BEzda5rjetVopraAf pLqIryEEFKxXl/ZHNulcmnuy8OCfCZojErbCRG00hyTbAIoYfmlfnKqXE0zdlojm7+456l 0unt06xa8bvzEdS5jMy1OAabdzXv7EfgVWGTKFM6uCMQyN4jIC6H0MQvqjgoqsMqPTQUc8 MsyEoNNrLCbj0DVoUqE3m8OXKUYHM3sY4At0ziraDCHKrKaRAkQOBdUF8N/oZ7vbuLcxXr 7eTiGAM8jSOzPa2KB2Z7Wg6f1A5RPlG6XaQZObPNEoQgSMe8lqcTBUVfUiJKxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725272156; a=rsa-sha256; cv=none; b=fKTsgSuCfVz8JUuzdAUnhfC102Bx0YxsDSL9l4rS9HIm26GljlSjaLYv/j/Npff//KBtey SoLMe3W6IAgAG8NcccDIlQCHtGvHuN3WOEcNKvt5y6M/qrvMlkc+uQtsHTpgPzAf3n17nK 6DwBvHvgfsEMyAe/9Rmx1PWLnKWn2rdPsCbn6uaAvQWm49ocMSD2WQ0Qbfb3x/pMOCkKr5 BGqM38CpWaOuudVlGmfTW9A97v3PRDXpjYd/EYaZcnoVP++k1SFZ3oazjo2NZyk+KVv5Uo pIcx1kDygpU4Jug+GFfc4EREHYeSiB93VLkec1USKxlJp6r5CeozGzds3UDKhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725272156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzptZCq+CmywKLYWVUAOnENmjhkGLR3YzKylF2eAsvc=; b=TG8FHXbJpuA8bU+XQXT8015c1zYF4r5ToJr5WONaEXQznZLECHEbgf3ePHGntqAEq03mfr 3NR8tLLh5KvZTLo5ursdroFFBarfJ94BKxMp+dwC/9+3P78Gc/lcINeZWgwILvYbi9oLjE kP8/hm8vC7159SAi1oIdD3OU7c3oVj48S2lUeImdp3c3MhTF9ImZBZwdzCeaezx9cfvVDF FzmGNm6Qv1i5ZonIHsCVm2cOWFJoBEs3iYIGrSQj3QEQj3JvfN/0STQygSfvb2O7WfcO4x DXGBPGfew0gwlcVD6+XfGvaW5UnhXCPPawC6by4nQR1ll4XvZ10gwJ/vu1Bgnw== 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 4Wy4Qh1Xnvz175m; Mon, 2 Sep 2024 10:15: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 482AFurR052361; Mon, 2 Sep 2024 10:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 482AFuQU052358; Mon, 2 Sep 2024 10:15:56 GMT (envelope-from git) Date: Mon, 2 Sep 2024 10:15:56 GMT Message-Id: <202409021015.482AFuQU052358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 209905ec384e - main - ndp: Fix libxo formatting for the header of neighbor cache List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 209905ec384eedd58f1b9b7ab774029d22787dfb Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=209905ec384eedd58f1b9b7ab774029d22787dfb commit 209905ec384eedd58f1b9b7ab774029d22787dfb Author: Helge Oldach AuthorDate: 2024-09-02 10:12:43 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 10:15:15 +0000 ndp: Fix libxo formatting for the header of neighbor cache PR: 272749 Reviewed by: zlei Fixes: e1c7783e220b ndp(8): add structured output formatting via libxo Fixes: 91fbe0819bb9 ndp: convert ndp(8) to netlink MFC after: 3 days --- usr.sbin/ndp/ndp.c | 2 +- usr.sbin/ndp/ndp_netlink.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 637aac2823ed..7c7bc60451c8 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -633,7 +633,7 @@ dump_rtsock(struct sockaddr_in6 *addr, int cflag) if (!opts.tflag && !cflag) { char xobuf[200]; snprintf(xobuf, sizeof(xobuf), - "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:%%1s} {T:%%5s}\n", + "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:/%%1s} {T:/%%5s}\n", W_ADDR, W_ADDR, W_LL, W_LL, W_IF, W_IF); xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags"); } diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c index e18d64175619..bafa9f2a143d 100644 --- a/usr.sbin/ndp/ndp_netlink.c +++ b/usr.sbin/ndp/ndp_netlink.c @@ -341,7 +341,7 @@ print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag) if (!opts.tflag && !cflag) { char xobuf[200]; snprintf(xobuf, sizeof(xobuf), - "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:%%1s} {T:%%5s}\n", + "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:/%%1s} {T:/%%5s}\n", W_ADDR, W_ADDR, W_LL, W_LL, W_IF, W_IF); xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags"); } From nobody Mon Sep 2 20:45:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyLNz6C5Mz5V1dl; Mon, 02 Sep 2024 20:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyLNz5JJQz4LfD; Mon, 2 Sep 2024 20:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725309923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VIYIYlXSDvzJlJlzH6EuCgMeiNTQrcykm2DCjPoTkSc=; b=M/yaUjjOROeLDcHm40ULvTwrmyd+tcLfpwolrLKooMseOqi4+Emo8NhjscRQ+FLYTWXtiz HfTgp5/iCDMDfsFFdbFcHM4yTyZSWiHAlmufmpfUSX5TXV5BQCZ5xF8E1dNdCpFIuYCsMo 23dIr0gA9H5nnKR0dw4pDUmOIYVB+V/vXf5OIG8CwtIFOXKiAGKpfnM4QwjJhZojR1P5H3 pNDjhp47ccEUgWaqEw+nRJYUSl7LHWDRa2WhDdQX+3Qm8sl/fVWp2L5T5l45L2PscFPnPm wS6wkb4kB5aDUJSBKvpPo2TkXM7nFnQQTnHcnotn6iEFM9SO/+QzuhqkYNipJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725309923; a=rsa-sha256; cv=none; b=iYkzqdptTigc7ij106ygU8zQUhjJEUwKqlDtFIDpqdkAoK9O/uDYolFuv92C1BJbLqLvjG MsPEwn3CG7nwtP8ukrLzHs2UcwdGT/zJ+N9iHScGSMRf6dy9AmXt284kE8nE2gXNvYsf7t msiLtmawUYJMVXY81fj0TY6kCgeoVV2VHauA1yj5rWal/nrD+yi0He77btIx0G8opilMvF gEguIavdVhxw1YP+Yq1NGUQ4e8lins9GVBoSoYeni/t1V0z6uXLRcBENct+drncyAKYnnQ tGfuwF4lLLdVvcB645WrEZDO0AXThaMFiXR39tcwRoqVjh6T4Flb83yKSYEd2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725309923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VIYIYlXSDvzJlJlzH6EuCgMeiNTQrcykm2DCjPoTkSc=; b=iJTG5tzO4dDIZ7hRUKzNQ+02dtGbikCTj0Udung9TN/tc8daKK4jXkSj2vHPTq+ovLUAK6 gKTCiOhoN6nXrZEOcH7DQ9x8CHm0AMGgm1cN6wks4tqIf7N9UZRhqO9qNSu+wzKCFjph6N T38/yGlJsgVSIbQ+2EV022Ync0MUGF0o+bOFMRiJv6RSWF8p1SNa40yXSgxYd176SLAf3F jkS9ISm6dblhRVvYBeGo/hHS4BKHQvZWY+28DnuG4Y9fIC3PXgpd3X0kfJIU3PudtSMCcv 7f5wpLENdFZdaqiex948s9/PJuuhlJ9IyHSFI11x5O+HA/sFYoyecutNsSgIyg== 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 4WyLNz4lhSz1RBB; Mon, 2 Sep 2024 20:45: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 482KjNYF019420; Mon, 2 Sep 2024 20:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 482KjNjk019417; Mon, 2 Sep 2024 20:45:23 GMT (envelope-from git) Date: Mon, 2 Sep 2024 20:45:23 GMT Message-Id: <202409022045.482KjNjk019417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1a19741860d7 - main - UPDATING: remove 20240813 DMAR entry List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a19741860d777bea1b7fe000f87136538020c3b Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1a19741860d777bea1b7fe000f87136538020c3b commit 1a19741860d777bea1b7fe000f87136538020c3b Author: Ed Maste AuthorDate: 2024-08-29 12:43:16 +0000 Commit: Ed Maste CommitDate: 2024-09-02 20:44:55 +0000 UPDATING: remove 20240813 DMAR entry The associated commit has been reverted and DMAR is not enabled by default any longer. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46474 --- UPDATING | 5 ----- 1 file changed, 5 deletions(-) diff --git a/UPDATING b/UPDATING index bbcbdad9bfd7..cffafdb5d247 100644 --- a/UPDATING +++ b/UPDATING @@ -27,11 +27,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20240813: - DMAR is now enabled by default on Intel. If your system crashes in the - dmar code on boot, please set 'hw.dmar.enable=0' in /boot/loader.conf - and file a bug. - 20240729: The build now defaults to WITHOUT_CLEAN - i.e., no automatic clean is performed at the beginning of buildworld or buildkernel. The From nobody Mon Sep 2 22:22:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyNXY0gZhz5V935; Mon, 02 Sep 2024 22: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 4WyNXY0FZ6z4TKY; Mon, 2 Sep 2024 22: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=1725315725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h2Ze1E629sPEQKjQxUjZ6BL/FZMqX0rrvhpXmpdyPX4=; b=DBkx/Dc5FrbiSkGoubSRstsLaLoOSJLUtRLyXloWcfzc/ByLiE8hlvoePBPCThbLL2Xbns RMQj0e9yB6JSwi5p0A37XDV9r3/aJGTF7rf/0tvnb58pMQ6rKWkEqoSOsXJP5+W91TfV1r iGzJtrxpsPflr2Rs6f21MEscrpAdspYX0mhZ9XTWNHx1xKaLe90d8AOmnr1qVK0K737oVc wF4ov+gBNEZeFKbdIo3kN1eE4ZIeIfmt4PdqcQQ9UCqFLFMwGwuVx7RiHoIqciPgjkIsJ8 eonP1mbTbeZHQd7PUXm32lc0WcTA6Id9DhwBdyg9CnyBlw+dPmqr03ipOZWmtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725315725; a=rsa-sha256; cv=none; b=nQIzrjujnFBfiR+/R+lfdiGhwvs0AQmUDdoIfLxBVzZA/gAJbtvPH6oArfG3ikRQv+QiQe aSzVG5Z77sDvnuv2vPD8udl6Ub0uniLHYa/426EhyjgMgbD+jKAYb8u5K3Q8QgZIPq0B+3 BQDMxpF3T5bZGgAeMZBbuLMlaFCB8wlUIe7HnlT6hCIsmhTogaG+b3+e/XE1AgfIa0cy+q OLSWA9MUlJlLbTr8KkF/8EAVfPlZi6J57T/loz/I5ZqLus5aJ+OnerATsH6nRpcjhMKN6Y YEiH7+FUlTTARv3PRvC333mPHb6aNvAm47WBYN1uR8E0UBfqpgeBgoy0ESlPxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725315725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h2Ze1E629sPEQKjQxUjZ6BL/FZMqX0rrvhpXmpdyPX4=; b=wY9T/QzTfZXs1zLeYmt6xH3x+2tsX1iZIwuIxlyYOQRbtmod1IBClaprQQFGNsfUTDMs6w JFx4HQxL6ED2TTyi5xFmeb4SqgKWK/qyHWN8a/IwBGOuIJ4ziA/RwPOFPwpUr0L9wmjPzs sH9R/RcEtUbK9hz9kAFnEU77us5gHo1999wNlLjyP/LrfMGLq1J8kNXgmJErUuvqKI24M4 r7Lrsfrpd287plMv+DJtYM3UhdPjUgevyuLK2WyKZ8v/wWLZHJu06ziRYDHDrpP5yTZnqN CVYzZaVofOIZ3aT3ONvQ6m1UJFpHNUnDclG7q+Gi842Elo2/YkG8RGtyGUh6zA== 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 4WyNXX6yn8zFT4; Mon, 2 Sep 2024 22: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 482MM4Ta082708; Mon, 2 Sep 2024 22: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 482MM43B082705; Mon, 2 Sep 2024 22:22:04 GMT (envelope-from git) Date: Mon, 2 Sep 2024 22:22:04 GMT Message-Id: <202409022222.482MM43B082705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: b162fc3f3094 - main - gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b162fc3f3094c50c8ed47ab50981c5448cf0052c Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=b162fc3f3094c50c8ed47ab50981c5448cf0052c commit b162fc3f3094c50c8ed47ab50981c5448cf0052c Author: Jessica Clarke AuthorDate: 2024-09-02 22:21:18 +0000 Commit: Jessica Clarke CommitDate: 2024-09-02 22:21:18 +0000 gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID This is a platform-independent UUID, and this is the name U-Boot uses. MFC after: 1 week --- lib/geom/part/gpart.8 | 7 ++++++- sys/geom/part/g_part.c | 1 + sys/geom/part/g_part.h | 1 + sys/geom/part/g_part_gpt.c | 2 ++ sys/sys/disk/gpt.h | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8 index fa0b247c6174..121e6d6a5119 100644 --- a/lib/geom/part/gpart.8 +++ b/lib/geom/part/gpart.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 26, 2023 +.Dd September 2, 2024 .Dt GPART 8 .Os .Sh NAME @@ -1008,6 +1008,11 @@ A illumos/Solaris partition dedicated to reserved space. The scheme-specific type is .Qq Li "!6a945a3b-1dd2-11b2-99a6-080020736631" for GPT. +.It Cm u-boot-env +A raw partition dedicated to U-Boot for storing its environment. +The scheme-specific type is +.Qq Li "!3de21764-95bd-54bd-a5c3-4abe786f38a8" +for GPT. .It Cm vmware-vmfs A partition that contains a VMware File System (VMFS). The scheme-specific types are diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index f0807c83dacf..d72efa09c46d 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -130,6 +130,7 @@ struct g_part_alias_list { { "solaris-home", G_PART_ALIAS_SOLARIS_HOME }, { "solaris-altsec", G_PART_ALIAS_SOLARIS_ALTSEC }, { "solaris-reserved", G_PART_ALIAS_SOLARIS_RESERVED }, + { "u-boot-env", G_PART_ALIAS_U_BOOT_ENV }, { "vmware-reserved", G_PART_ALIAS_VMRESERVED }, { "vmware-vmfs", G_PART_ALIAS_VMFS }, { "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG }, diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h index ffeeca9022fe..13bbb1e4126a 100644 --- a/sys/geom/part/g_part.h +++ b/sys/geom/part/g_part.h @@ -103,6 +103,7 @@ enum g_part_alias { G_PART_ALIAS_SOLARIS_HOME, /* A Solaris /home partition entry. */ G_PART_ALIAS_SOLARIS_ALTSEC, /* A Solaris alternate sector partition entry. */ G_PART_ALIAS_SOLARIS_RESERVED, /* A Solaris reserved partition entry. */ + G_PART_ALIAS_U_BOOT_ENV, /* A U-Boot environment partition entry. */ G_PART_ALIAS_VMFS, /* A VMware VMFS partition entry */ G_PART_ALIAS_VMKDIAG, /* A VMware vmkDiagnostic partition entry */ G_PART_ALIAS_VMRESERVED, /* A VMware reserved partition entry */ diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index b269faee276c..a856a34f99d9 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -223,6 +223,7 @@ static struct uuid gpt_uuid_solaris_var = GPT_ENT_TYPE_SOLARIS_VAR; static struct uuid gpt_uuid_solaris_home = GPT_ENT_TYPE_SOLARIS_HOME; static struct uuid gpt_uuid_solaris_altsec = GPT_ENT_TYPE_SOLARIS_ALTSEC; static struct uuid gpt_uuid_solaris_reserved = GPT_ENT_TYPE_SOLARIS_RESERVED; +static struct uuid gpt_uuid_u_boot_env = GPT_ENT_TYPE_U_BOOT_ENV; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; static struct uuid gpt_uuid_vmfs = GPT_ENT_TYPE_VMFS; static struct uuid gpt_uuid_vmkdiag = GPT_ENT_TYPE_VMKDIAG; @@ -295,6 +296,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_solaris_home, G_PART_ALIAS_SOLARIS_HOME, 0 }, { &gpt_uuid_solaris_altsec, G_PART_ALIAS_SOLARIS_ALTSEC, 0 }, { &gpt_uuid_solaris_reserved, G_PART_ALIAS_SOLARIS_RESERVED, 0 }, + { &gpt_uuid_u_boot_env, G_PART_ALIAS_U_BOOT_ENV, 0 }, { &gpt_uuid_vmfs, G_PART_ALIAS_VMFS, 0 }, { &gpt_uuid_vmkdiag, G_PART_ALIAS_VMKDIAG, 0 }, { &gpt_uuid_vmreserved, G_PART_ALIAS_VMRESERVED, 0 }, diff --git a/sys/sys/disk/gpt.h b/sys/sys/disk/gpt.h index 596a5cba1681..426ae835c0c1 100644 --- a/sys/sys/disk/gpt.h +++ b/sys/sys/disk/gpt.h @@ -259,6 +259,9 @@ CTASSERT(sizeof(struct gpt_ent) == 128); #define GPT_ENT_TYPE_HIFIVE_BBL \ {0x2e54b353,0x1271,0x4842,0x80,0x6f,{0xe4,0x36,0xd6,0xaf,0x69,0x85}} +#define GPT_ENT_TYPE_U_BOOT_ENV \ + {0x3de21764,0x95bd,0x54bd,0xa5,0xc3,{0x4a,0xbe,0x78,0x6f,0x38,0xa8}} + /* * Boot partition used by GRUB 2. */ From nobody Tue Sep 3 00:02:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyQm936Glz5VHSk; Tue, 03 Sep 2024 00:02: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 4WyQm92jyzz4gkM; Tue, 3 Sep 2024 00:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725321737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P7BDXXNFzEqf8bf8nUSwoIN2RPjX1SGMDWwKu/sjWSQ=; b=cAY/IY3VGpQZZEfaWlT+bdBD2PPzq5qbHSFx4bIMq7Pk0RLYehn2sF6aDFijZJFcePpqZu Q+POx87C6OQLO633oJHXkfgd5U4H+UY3dRt3vG8s2vEG/7inD3r+L1Y3VcyWFbovdiqNhr b4XEPxBY23FT+m/XufirMjzUqMcLReVSifPMd11wG3tRQN0JjDhMwgzL6wHW3qoAOXM7kT 9bnjJHMiOJW0OwwTv/KQdjB0Z1tgZhqvwqNRF1Btvbdx6JGaaGaP/brPLE80Z9NjxUqwbZ Pg2tNa0Aw653/Ic4HASGeSO/Pkc8zpT4zIPBKgKR8Pgq4rAOpd4tKy52YvU39Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725321737; a=rsa-sha256; cv=none; b=GbsvUm93d5tiUoZyUqTQ0LjbpIdDs6mzMdHjiiRbx0kgkkDLgJnPTq2aGQL49y3hKK6zWK Il+Azf8JEcrZPUKSN+9hyGc8FeYPflEvlSCCSd57ctR4d5HQkSmR3JoVPdsof5VMFu8n1e 4nty9tak4u3ISfZrDzUsgP5WVgxZ+DFHdDcDwjQZzxelQRgdPGjNDP+/5AH7cZch+9Zp2L NgImEC7gRDjHz89hZstE49Np46IEZ0++yOpctEL3OCO09dYdCKX8ulev027zu2rMk8+BHY 3acjWsgkKg4cPdITuN+oIPfpsIALy74vxKwYKpXv5STqJmOUkgFi3hmNts7uEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725321737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P7BDXXNFzEqf8bf8nUSwoIN2RPjX1SGMDWwKu/sjWSQ=; b=bBye4VSSFs6xm2JBQsq4a21Ff67oWKwaN8QCG7zIWYsUghOK2yp4eoZ3yMYJcg7wZNut2Z uril0NRQzKL4L4G0FrYR3CPajGzWyc+W2IxzlCNeYQ3/9ZGP4LDxZD8NevQ5FZYVShe0HN xNJFfDn8ugO9pvSlKbpZ7Xbvq44xzveFfI8z22XrWNrRNVXhI5tirflq4/lFStlSIq9loj mCiKcJV8mfhbU8bwKyLzcH7fw1cm9peD7fTTfHApIKmsMYT+v0R3NVvAfAgD1rUv0YTeBB AjmsQnYdUzeVZ/LT6Th/PTKDXa9XR+wydKnu63rr9yrSOxOs8LfiCA6YbfjIVg== 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 4WyQm92JXdzHx1; Tue, 3 Sep 2024 00:02: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 48302Hgg055444; Tue, 3 Sep 2024 00:02:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48302GD6055441; Tue, 3 Sep 2024 00:02:16 GMT (envelope-from git) Date: Tue, 3 Sep 2024 00:02:16 GMT Message-Id: <202409030002.48302GD6055441@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: 762274a14913 - stable/14 - sqlite3: Vendor import of sqlite3 3.46.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 762274a14913546b95b147718d68838685193444 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=762274a14913546b95b147718d68838685193444 commit 762274a14913546b95b147718d68838685193444 Author: Cy Schubert AuthorDate: 2024-08-26 20:00:23 +0000 Commit: Cy Schubert CommitDate: 2024-09-03 00:01:33 +0000 sqlite3: Vendor import of sqlite3 3.46.1 Release notes at https://www.sqlite.org/releaselog/3_46_1.html. Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz MFC after: 1 week Merge commit '657ea345f331704c612a35e5a74968bef9ffcfd8' into sqlite3 (cherry picked from commit de9468837c92cab304c658480bd32dbe4e022d01) --- contrib/sqlite3/configure | 20 ++--- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 40 +++++----- contrib/sqlite3/sqlite3.c | 154 ++++++++++++++++++++------------------- contrib/sqlite3/sqlite3.h | 6 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 ++--- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 127 insertions(+), 117 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index f2f70b5ae802..fcab0424fc5a 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.46.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.46.1. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.46.0' -PACKAGE_STRING='sqlite 3.46.0' +PACKAGE_VERSION='3.46.1' +PACKAGE_STRING='sqlite 3.46.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.46.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.46.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.46.0:";; + short | recursive ) echo "Configuration of sqlite 3.46.1:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.46.0 +sqlite configure 3.46.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.46.0, which was +It was created by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.46.0' + VERSION='3.46.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.46.0, which was +This file was extended by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.46.0 +sqlite config.status 3.46.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index c83f381d90b1..806255961fda 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.46.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.46.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 7d46e4acac57..b08671e14de3 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -604,11 +604,6 @@ zSkipValidUtf8(const char *z, int nAccept, long ccm); # define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */ #endif -#if CIO_WIN_WC_XLATE -/* Character used to represent a known-incomplete UTF-8 char group (�) */ -static WCHAR cBadGroup = 0xfffd; -#endif - #if CIO_WIN_WC_XLATE static HANDLE handleOfFile(FILE *pf){ int fileDesc = _fileno(pf); @@ -12547,7 +12542,7 @@ static int expertFilter( pCsr->pData = 0; if( rc==SQLITE_OK ){ rc = idxPrintfPrepareStmt(pExpert->db, &pCsr->pData, &pVtab->base.zErrMsg, - "SELECT * FROM main.%Q WHERE sample()", pVtab->pTab->zName + "SELECT * FROM main.%Q WHERE sqlite_expert_sample()", pVtab->pTab->zName ); } @@ -13421,7 +13416,7 @@ struct IdxRemCtx { }; /* -** Implementation of scalar function rem(). +** Implementation of scalar function sqlite_expert_rem(). */ static void idxRemFunc( sqlite3_context *pCtx, @@ -13434,7 +13429,7 @@ static void idxRemFunc( assert( argc==2 ); iSlot = sqlite3_value_int(argv[0]); - assert( iSlot<=p->nSlot ); + assert( iSlotnSlot ); pSlot = &p->aSlot[iSlot]; switch( pSlot->eType ){ @@ -13545,7 +13540,8 @@ static int idxPopulateOneStat1( const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0); const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1); zCols = idxAppendText(&rc, zCols, - "%sx.%Q IS rem(%d, x.%Q) COLLATE %s", zComma, zName, nCol, zName, zColl + "%sx.%Q IS sqlite_expert_rem(%d, x.%Q) COLLATE %s", + zComma, zName, nCol, zName, zColl ); zOrder = idxAppendText(&rc, zOrder, "%s%d", zComma, ++nCol); } @@ -13678,13 +13674,13 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ if( rc==SQLITE_OK ){ sqlite3 *dbrem = (p->iSample==100 ? p->db : p->dbv); - rc = sqlite3_create_function( - dbrem, "rem", 2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0 + rc = sqlite3_create_function(dbrem, "sqlite_expert_rem", + 2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0 ); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function( - p->db, "sample", 0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0 + rc = sqlite3_create_function(p->db, "sqlite_expert_sample", + 0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0 ); } @@ -13736,6 +13732,9 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); } + sqlite3_create_function(p->db, "sqlite_expert_rem", 2, SQLITE_UTF8, 0,0,0,0); + sqlite3_create_function(p->db, "sqlite_expert_sample", 0,SQLITE_UTF8,0,0,0,0); + sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0); return rc; } @@ -16836,8 +16835,8 @@ static int recoverError( va_start(ap, zFmt); if( zFmt ){ z = sqlite3_vmprintf(zFmt, ap); - va_end(ap); } + va_end(ap); sqlite3_free(p->zErrMsg); p->zErrMsg = z; p->errCode = errCode; @@ -27085,7 +27084,6 @@ static int do_meta_command(char *zLine, ShellState *p){ import_cleanup(&sCtx); shell_out_of_memory(); } - nByte = strlen(zSql); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); zSql = 0; @@ -27104,16 +27102,21 @@ static int do_meta_command(char *zLine, ShellState *p){ sqlite3_finalize(pStmt); pStmt = 0; if( nCol==0 ) return 0; /* no columns, no error */ - zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 ); + + nByte = 64 /* space for "INSERT INTO", "VALUES(", ")\0" */ + + (zSchema ? strlen(zSchema)*2 + 2: 0) /* Quoted schema name */ + + strlen(zTable)*2 + 2 /* Quoted table name */ + + nCol*2; /* Space for ",?" for each column */ + zSql = sqlite3_malloc64( nByte ); if( zSql==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); } if( zSchema ){ - sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?", + sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?", zSchema, zTable); }else{ - sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); + sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); } j = strlen30(zSql); for(i=1; i=2 ){ oputf("Insert using: %s\n", zSql); } diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index eaa24a131073..946815f13ec8 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.46.0. By combining all the individual C code files into this +** version 3.46.1. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 96c92aba00c8375bc32fafcdf12429c58bd8. +** c9c2ab54ba1f5f46360f1b4f35d849cd3f08. */ #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 @@ -459,9 +459,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.46.0" -#define SQLITE_VERSION_NUMBER 3046000 -#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e" +#define SQLITE_VERSION "3.46.1" +#define SQLITE_VERSION_NUMBER 3046001 +#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -19361,7 +19361,7 @@ struct SrcList { #define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */ #define WHERE_ORDERBY_LIMIT 0x0800 /* ORDERBY+LIMIT on the inner loop */ #define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */ - /* 0x2000 not currently used */ +#define WHERE_KEEP_ALL_JOINS 0x2000 /* Do not do the omit-noop-join opt */ #define WHERE_USE_LIMIT 0x4000 /* Use the LIMIT in cost estimates */ /* 0x8000 not currently used */ @@ -90173,7 +90173,8 @@ SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff assert( iVar>0 ); if( v ){ Mem *pMem = &v->aVar[iVar-1]; - assert( (v->db->flags & SQLITE_EnableQPSG)==0 ); + assert( (v->db->flags & SQLITE_EnableQPSG)==0 + || (v->db->mDbFlags & DBFLAG_InternalFunc)!=0 ); if( 0==(pMem->flags & MEM_Null) ){ sqlite3_value *pRet = sqlite3ValueNew(v->db); if( pRet ){ @@ -90193,7 +90194,8 @@ SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff */ SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){ assert( iVar>0 ); - assert( (v->db->flags & SQLITE_EnableQPSG)==0 ); + assert( (v->db->flags & SQLITE_EnableQPSG)==0 + || (v->db->mDbFlags & DBFLAG_InternalFunc)!=0 ); if( iVar>=32 ){ v->expmask |= 0x80000000; }else{ @@ -106950,7 +106952,7 @@ static void extendFJMatch( static SQLITE_NOINLINE int isValidSchemaTableName( const char *zTab, /* Name as it appears in the SQL */ Table *pTab, /* The schema table we are trying to match */ - Schema *pSchema /* non-NULL if a database qualifier is present */ + const char *zDb /* non-NULL if a database qualifier is present */ ){ const char *zLegacy; assert( pTab!=0 ); @@ -106961,7 +106963,7 @@ static SQLITE_NOINLINE int isValidSchemaTableName( if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){ return 1; } - if( pSchema==0 ) return 0; + if( zDb==0 ) return 0; if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1; if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1; }else{ @@ -107144,7 +107146,7 @@ static int lookupName( } }else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){ if( pTab->tnum!=1 ) continue; - if( !isValidSchemaTableName(zTab, pTab, pSchema) ) continue; + if( !isValidSchemaTableName(zTab, pTab, zDb) ) continue; } assert( ExprUseYTab(pExpr) ); if( IN_RENAME_OBJECT && pItem->zAlias ){ @@ -108876,6 +108878,9 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames( ** Resolve all names for all expression in an expression list. This is ** just like sqlite3ResolveExprNames() except that it works for an expression ** list rather than a single expression. +** +** The return value is SQLITE_OK (0) for success or SQLITE_ERROR (1) for a +** failure. */ SQLITE_PRIVATE int sqlite3ResolveExprListNames( NameContext *pNC, /* Namespace to resolve expressions in. */ @@ -108884,7 +108889,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( int i; int savedHasAgg = 0; Walker w; - if( pList==0 ) return WRC_Continue; + if( pList==0 ) return SQLITE_OK; w.pParse = pNC->pParse; w.xExprCallback = resolveExprStep; w.xSelectCallback = resolveSelectStep; @@ -108898,7 +108903,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( #if SQLITE_MAX_EXPR_DEPTH>0 w.pParse->nHeight += pExpr->nHeight; if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ - return WRC_Abort; + return SQLITE_ERROR; } #endif sqlite3WalkExprNN(&w, pExpr); @@ -108915,10 +108920,10 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); } - if( w.pParse->nErr>0 ) return WRC_Abort; + if( w.pParse->nErr>0 ) return SQLITE_ERROR; } pNC->ncFlags |= savedHasAgg; - return WRC_Continue; + return SQLITE_OK; } /* @@ -117457,7 +117462,7 @@ static int renameResolveTrigger(Parse *pParse){ /* ALWAYS() because if the table of the trigger does not exist, the ** error would have been hit before this point */ if( ALWAYS(pParse->pTriggerTab) ){ - rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab); + rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab)!=0; } /* Resolve symbols in WHEN clause */ @@ -124426,8 +124431,9 @@ create_view_fail: #if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) /* ** The Table structure pTable is really a VIEW. Fill in the names of -** the columns of the view in the pTable structure. Return the number -** of errors. If an error is seen leave an error message in pParse->zErrMsg. +** the columns of the view in the pTable structure. Return non-zero if +** there are errors. If an error is seen an error message is left +** in pParse->zErrMsg. */ static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){ Table *pSelTab; /* A fake table from which we get the result set */ @@ -124550,7 +124556,7 @@ static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){ sqlite3DeleteColumnNames(db, pTable); } #endif /* SQLITE_OMIT_VIEW */ - return nErr; + return nErr + pParse->nErr; } SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ assert( pTable!=0 ); @@ -130848,6 +130854,8 @@ static void groupConcatValue(sqlite3_context *context){ sqlite3_result_error_toobig(context); }else if( pAccum->accError==SQLITE_NOMEM ){ sqlite3_result_error_nomem(context); + }else if( pGCC->nAccum>0 && pAccum->nChar==0 ){ + sqlite3_result_text(context, "", 1, SQLITE_STATIC); }else{ const char *zText = sqlite3_str_value(pAccum); sqlite3_result_text(context, zText, pAccum->nChar, SQLITE_TRANSIENT); @@ -133602,6 +133610,7 @@ SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList pRet->pSrc->nSrc = 1; pRet->pPrior = pLeft->pPrior; pRet->op = pLeft->op; + if( pRet->pPrior ) pRet->selFlags |= SF_Values; pLeft->pPrior = 0; pLeft->op = TK_SELECT; assert( pLeft->pNext==0 ); @@ -166067,7 +166076,9 @@ static int whereLoopAddBtree( " according to whereIsCoveringIndex()\n", pProbe->zName)); } } - }else if( m==0 ){ + }else if( m==0 + && (HasRowid(pTab) || pWInfo->pSelect!=0 || sqlite3FaultSim(700)) + ){ WHERETRACE(0x200, ("-> %s a covering index according to bitmasks\n", pProbe->zName, m==0 ? "is" : "is not")); @@ -167956,6 +167967,10 @@ static void showAllWhereLoops(WhereInfo *pWInfo, WhereClause *pWC){ ** the right-most table of a subquery that was flattened into the ** main query and that subquery was the right-hand operand of an ** inner join that held an ON or USING clause. +** 6) The ORDER BY clause has 63 or fewer terms +** 7) The omit-noop-join optimization is enabled. +** +** Items (1), (6), and (7) are checked by the caller. ** ** For example, given: ** @@ -168369,6 +168384,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( if( pOrderBy && pOrderBy->nExpr>=BMS ){ pOrderBy = 0; wctrlFlags &= ~WHERE_WANT_DISTINCT; + wctrlFlags |= WHERE_KEEP_ALL_JOINS; /* Disable omit-noop-join opt */ } /* The number of tables in the FROM clause is limited by the number of @@ -168669,10 +168685,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. */ notReady = ~(Bitmask)0; - if( pWInfo->nLevel>=2 - && pResultSet!=0 /* these two combine to guarantee */ - && 0==(wctrlFlags & WHERE_AGG_DISTINCT) /* condition (1) above */ - && OptimizationEnabled(db, SQLITE_OmitNoopJoin) + if( pWInfo->nLevel>=2 /* Must be a join, or this opt8n is pointless */ + && pResultSet!=0 /* Condition (1) */ + && 0==(wctrlFlags & (WHERE_AGG_DISTINCT|WHERE_KEEP_ALL_JOINS)) /* (1),(6) */ + && OptimizationEnabled(db, SQLITE_OmitNoopJoin) /* (7) */ ){ notReady = whereOmitNoopJoin(pWInfo, notReady); nTabList = pWInfo->nLevel; @@ -168992,26 +169008,6 @@ whereBeginError: } #endif -#ifdef SQLITE_DEBUG -/* -** Return true if cursor iCur is opened by instruction k of the -** bytecode. Used inside of assert() only. -*/ -static int cursorIsOpen(Vdbe *v, int iCur, int k){ - while( k>=0 ){ - VdbeOp *pOp = sqlite3VdbeGetOp(v,k--); - if( pOp->p1!=iCur ) continue; - if( pOp->opcode==OP_Close ) return 0; - if( pOp->opcode==OP_OpenRead ) return 1; - if( pOp->opcode==OP_OpenWrite ) return 1; - if( pOp->opcode==OP_OpenDup ) return 1; - if( pOp->opcode==OP_OpenAutoindex ) return 1; - if( pOp->opcode==OP_OpenEphemeral ) return 1; - } - return 0; -} -#endif /* SQLITE_DEBUG */ - /* ** Generate the end of the WHERE loop. See comments on ** sqlite3WhereBegin() for additional information. @@ -169311,16 +169307,10 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ ** reference. Verify that this is harmless - that the ** table being referenced really is open. */ -#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 - || cursorIsOpen(v,pOp->p1,k) - || pOp->opcode==OP_Offset - ); -#else - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 - || cursorIsOpen(v,pOp->p1,k) - ); -#endif + if( pLoop->wsFlags & WHERE_IDX_ONLY ){ + sqlite3ErrorMsg(pParse, "internal query planner error"); + pParse->rc = SQLITE_INTERNAL; + } } }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; @@ -172591,9 +172581,9 @@ static void updateDeleteLimitError( break; } } - if( (p->selFlags & SF_MultiValue)==0 && - (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 && - cnt>mxSelect + if( (p->selFlags & (SF_MultiValue|SF_Values))==0 + && (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 + && cnt>mxSelect ){ sqlite3ErrorMsg(pParse, "too many terms in compound SELECT"); } @@ -237004,7 +236994,11 @@ static int sqlite3Fts5ExprNew( } sqlite3_free(sParse.apPhrase); - *pzErr = sParse.zErr; + if( 0==*pzErr ){ + *pzErr = sParse.zErr; + }else{ + sqlite3_free(sParse.zErr); + } return sParse.rc; } @@ -239132,6 +239126,7 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( assert( pRight->eType==FTS5_STRING || pRight->eType==FTS5_TERM || pRight->eType==FTS5_EOF + || (pRight->eType==FTS5_AND && pParse->bPhraseToAnd) ); if( pLeft->eType==FTS5_AND ){ @@ -251299,6 +251294,7 @@ static int fts5UpdateMethod( rc = SQLITE_ERROR; }else{ rc = fts5SpecialDelete(pTab, apVal); + bUpdateOrDelete = 1; } }else{ rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]); @@ -252473,14 +252469,16 @@ static int sqlite3Fts5GetTokenizer( if( pMod==0 ){ assert( nArg>0 ); rc = SQLITE_ERROR; - *pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]); + if( pzErr ) *pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]); }else{ rc = pMod->x.xCreate( pMod->pUserData, (azArg?&azArg[1]:0), (nArg?nArg-1:0), &pConfig->pTok ); pConfig->pTokApi = &pMod->x; if( rc!=SQLITE_OK ){ - if( pzErr ) *pzErr = sqlite3_mprintf("error in tokenizer constructor"); + if( pzErr && rc!=SQLITE_NOMEM ){ + *pzErr = sqlite3_mprintf("error in tokenizer constructor"); + } }else{ pConfig->ePattern = sqlite3Fts5TokenizerPattern( pMod->x.xCreate, pConfig->pTok @@ -252539,7 +252537,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33", -1, SQLITE_TRANSIENT); } /* @@ -252574,17 +252572,23 @@ static int fts5IntegrityMethod( assert( pzErr!=0 && *pzErr==0 ); UNUSED_PARAM(isQuick); + assert( pTab->p.pConfig->pzErrmsg==0 ); + pTab->p.pConfig->pzErrmsg = pzErr; rc = sqlite3Fts5StorageIntegrity(pTab->pStorage, 0); - if( (rc&0xff)==SQLITE_CORRUPT ){ - *pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s", - zSchema, zTabname); - rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM; - }else if( rc!=SQLITE_OK ){ - *pzErr = sqlite3_mprintf("unable to validate the inverted index for" - " FTS5 table %s.%s: %s", - zSchema, zTabname, sqlite3_errstr(rc)); + if( *pzErr==0 && rc!=SQLITE_OK ){ + if( (rc&0xff)==SQLITE_CORRUPT ){ + *pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s", + zSchema, zTabname); + rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM; + }else{ + *pzErr = sqlite3_mprintf("unable to validate the inverted index for" + " FTS5 table %s.%s: %s", + zSchema, zTabname, sqlite3_errstr(rc)); + } } + sqlite3Fts5IndexCloseReader(pTab->p.pIndex); + pTab->p.pConfig->pzErrmsg = 0; return rc; } @@ -254018,7 +254022,7 @@ static int fts5AsciiCreate( int i; memset(p, 0, sizeof(AsciiTokenizer)); memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar)); - for(i=0; rc==SQLITE_OK && ibFold = 1; pNew->iFoldParam = 0; - for(i=0; rc==SQLITE_OK && iiFoldParam!=0 && pNew->bFold==0 ){ rc = SQLITE_ERROR; diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index 57df8dcf2027..f64ca0172782 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.46.0" -#define SQLITE_VERSION_NUMBER 3046000 -#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e" +#define SQLITE_VERSION "3.46.1" +#define SQLITE_VERSION_NUMBER 3046001 +#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index eb16b8fffb92..07facc833868 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,46,0 +#define SQLITE_RESOURCE_VERSION 3,46,1 #endif diff --git a/contrib/sqlite3/tea/configure b/contrib/sqlite3/tea/configure index 011ef2101151..2c5190d630e3 100755 --- a/contrib/sqlite3/tea/configure +++ b/contrib/sqlite3/tea/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.46.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.46.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.46.0' -PACKAGE_STRING='sqlite 3.46.0' +PACKAGE_VERSION='3.46.1' +PACKAGE_STRING='sqlite 3.46.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1331,7 +1331,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.46.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.46.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1393,7 +1393,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.46.0:";; + short | recursive ) echo "Configuration of sqlite 3.46.1:";; esac cat <<\_ACEOF @@ -1496,7 +1496,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.46.0 +sqlite configure 3.46.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1795,7 +1795,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.46.0, which was +It was created by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -9560,7 +9560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.46.0, which was +This file was extended by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9615,7 +9615,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.46.0 +sqlite config.status 3.46.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/tea/configure.ac b/contrib/sqlite3/tea/configure.ac index f188f22039ba..ea7eeda70fff 100644 --- a/contrib/sqlite3/tea/configure.ac +++ b/contrib/sqlite3/tea/configure.ac @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so that we create the export library with the dll. #----------------------------------------------------------------------- -AC_INIT([sqlite],[3.46.0]) +AC_INIT([sqlite],[3.46.1]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From nobody Tue Sep 3 00:03:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyQnF1zmhz5VHrh; Tue, 03 Sep 2024 00:03: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 4WyQnF1MTcz4hJw; Tue, 3 Sep 2024 00:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725321793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2IvB4r5etY06hAt1qrb1eopWBmKOsB2leLoGPjEHqBE=; b=OEAh1VzQW+QArD7tZBMAsRh43VD685TlSNfxNTfmB5UlCVmRjTfRJURNmDh3Wi0t3OjXIy B8bMahInE6A3AjwqM9LOS+rkGs5XyZd7X5c8LlCTTTEbbZHrmifxy0iwWU/TFaEzR+sf6w JRTiKKzy8vu0IlGyD+xAuzoulyalTbhEUAwbSPKvNm7sbtIFAanvzqlqLMh+0iaMNiffQX EEY1feV3Dp6BMahPc2spdgwP9K7QHzwR9LX/X1ivlG+1OSPAKCI512QETnxKP994H6klxY YGZEsuak/8dScx/l2rUf/uE9SbgZY36Z6dsshIqVhOeQVqxMlribLtrhjRH5oA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725321793; a=rsa-sha256; cv=none; b=hS/UeOwom6///8uYDpjTIdhUMq4c1NfXiuWmibEkbsaRN+9n1UFgTLD/Oma6go63j7isUa kZUWnBkALCfvJIhgv/cE3CEk6CW28X4DB8TVbeXeg4XS8h55OQ3sOv1ryHP2giZjfsNgUE DlAHfXKhnkpikAuOEnV/+d62UXMrUflXkW/YVHpewQU8ku3LTtUejesUaWHJBG98KNZuox zdW4B3BgB7sbxMcVe4Gj3Ojk11IhyNMg1wsim9DbIZo0eNuMPIVg76BYd/Rmc7YbLA3QEp OE3CHrwrIFcepH9txtETw2lKi/Ct3iLnGsEwUm0WJJC2sSTAQvw6WLerIFTWzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725321793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2IvB4r5etY06hAt1qrb1eopWBmKOsB2leLoGPjEHqBE=; b=d69Ss/okoiaZ6ffVtT/bSxdnAmSMykS9q33H4hZ/XSQyTc3IVIT3Pq2gv63pl0DQEx1Qsj ZcnjzyUpDamnslmXFktG7Vraen4qrKzuXX2eoTUx79itLvj940Ody51TAkre6/gCTTmSf8 qZ53cu8nBuhD0KPD3xCyD9i4MZZmIWvDoCVf7b94fdnaUZezsFlHUahO+7eFG29qfcWA3O E/3ezDdV5NuPb3zYk/7m7eOr9jQ9b3P4+9aUPBrS33GfqkSw83P1/+utLzdbM1a4JCGBoy yeSMRgvEXr9gM2TdGLXU33v/q1mdO55KmggtzOesVLIK+fwprpUzJdOW0VgiCg== 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 4WyQnF0sd2zHH3; Tue, 3 Sep 2024 00:03: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 48303DiK056994; Tue, 3 Sep 2024 00:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48303CY5056991; Tue, 3 Sep 2024 00:03:12 GMT (envelope-from git) Date: Tue, 3 Sep 2024 00:03:12 GMT Message-Id: <202409030003.48303CY5056991@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: bee9d305ee57 - stable/13 - sqlite3: Vendor import of sqlite3 3.46.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bee9d305ee57fb468237740b31ec443db255e5ce Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=bee9d305ee57fb468237740b31ec443db255e5ce commit bee9d305ee57fb468237740b31ec443db255e5ce Author: Cy Schubert AuthorDate: 2024-08-26 20:00:23 +0000 Commit: Cy Schubert CommitDate: 2024-09-03 00:03:05 +0000 sqlite3: Vendor import of sqlite3 3.46.1 Release notes at https://www.sqlite.org/releaselog/3_46_1.html. Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz MFC after: 1 week Merge commit '657ea345f331704c612a35e5a74968bef9ffcfd8' into sqlite3 (cherry picked from commit de9468837c92cab304c658480bd32dbe4e022d01) --- contrib/sqlite3/configure | 20 ++--- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 40 +++++----- contrib/sqlite3/sqlite3.c | 154 ++++++++++++++++++++------------------- contrib/sqlite3/sqlite3.h | 6 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 ++--- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 127 insertions(+), 117 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index f2f70b5ae802..fcab0424fc5a 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.46.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.46.1. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.46.0' -PACKAGE_STRING='sqlite 3.46.0' +PACKAGE_VERSION='3.46.1' +PACKAGE_STRING='sqlite 3.46.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.46.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.46.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.46.0:";; + short | recursive ) echo "Configuration of sqlite 3.46.1:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.46.0 +sqlite configure 3.46.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.46.0, which was +It was created by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.46.0' + VERSION='3.46.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.46.0, which was +This file was extended by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.46.0 +sqlite config.status 3.46.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index c83f381d90b1..806255961fda 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.46.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.46.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 7d46e4acac57..b08671e14de3 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -604,11 +604,6 @@ zSkipValidUtf8(const char *z, int nAccept, long ccm); # define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */ #endif -#if CIO_WIN_WC_XLATE -/* Character used to represent a known-incomplete UTF-8 char group (�) */ -static WCHAR cBadGroup = 0xfffd; -#endif - #if CIO_WIN_WC_XLATE static HANDLE handleOfFile(FILE *pf){ int fileDesc = _fileno(pf); @@ -12547,7 +12542,7 @@ static int expertFilter( pCsr->pData = 0; if( rc==SQLITE_OK ){ rc = idxPrintfPrepareStmt(pExpert->db, &pCsr->pData, &pVtab->base.zErrMsg, - "SELECT * FROM main.%Q WHERE sample()", pVtab->pTab->zName + "SELECT * FROM main.%Q WHERE sqlite_expert_sample()", pVtab->pTab->zName ); } @@ -13421,7 +13416,7 @@ struct IdxRemCtx { }; /* -** Implementation of scalar function rem(). +** Implementation of scalar function sqlite_expert_rem(). */ static void idxRemFunc( sqlite3_context *pCtx, @@ -13434,7 +13429,7 @@ static void idxRemFunc( assert( argc==2 ); iSlot = sqlite3_value_int(argv[0]); - assert( iSlot<=p->nSlot ); + assert( iSlotnSlot ); pSlot = &p->aSlot[iSlot]; switch( pSlot->eType ){ @@ -13545,7 +13540,8 @@ static int idxPopulateOneStat1( const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0); const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1); zCols = idxAppendText(&rc, zCols, - "%sx.%Q IS rem(%d, x.%Q) COLLATE %s", zComma, zName, nCol, zName, zColl + "%sx.%Q IS sqlite_expert_rem(%d, x.%Q) COLLATE %s", + zComma, zName, nCol, zName, zColl ); zOrder = idxAppendText(&rc, zOrder, "%s%d", zComma, ++nCol); } @@ -13678,13 +13674,13 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ if( rc==SQLITE_OK ){ sqlite3 *dbrem = (p->iSample==100 ? p->db : p->dbv); - rc = sqlite3_create_function( - dbrem, "rem", 2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0 + rc = sqlite3_create_function(dbrem, "sqlite_expert_rem", + 2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0 ); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function( - p->db, "sample", 0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0 + rc = sqlite3_create_function(p->db, "sqlite_expert_sample", + 0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0 ); } @@ -13736,6 +13732,9 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); } + sqlite3_create_function(p->db, "sqlite_expert_rem", 2, SQLITE_UTF8, 0,0,0,0); + sqlite3_create_function(p->db, "sqlite_expert_sample", 0,SQLITE_UTF8,0,0,0,0); + sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0); return rc; } @@ -16836,8 +16835,8 @@ static int recoverError( va_start(ap, zFmt); if( zFmt ){ z = sqlite3_vmprintf(zFmt, ap); - va_end(ap); } + va_end(ap); sqlite3_free(p->zErrMsg); p->zErrMsg = z; p->errCode = errCode; @@ -27085,7 +27084,6 @@ static int do_meta_command(char *zLine, ShellState *p){ import_cleanup(&sCtx); shell_out_of_memory(); } - nByte = strlen(zSql); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); zSql = 0; @@ -27104,16 +27102,21 @@ static int do_meta_command(char *zLine, ShellState *p){ sqlite3_finalize(pStmt); pStmt = 0; if( nCol==0 ) return 0; /* no columns, no error */ - zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 ); + + nByte = 64 /* space for "INSERT INTO", "VALUES(", ")\0" */ + + (zSchema ? strlen(zSchema)*2 + 2: 0) /* Quoted schema name */ + + strlen(zTable)*2 + 2 /* Quoted table name */ + + nCol*2; /* Space for ",?" for each column */ + zSql = sqlite3_malloc64( nByte ); if( zSql==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); } if( zSchema ){ - sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?", + sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?", zSchema, zTable); }else{ - sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); + sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); } j = strlen30(zSql); for(i=1; i=2 ){ oputf("Insert using: %s\n", zSql); } diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index eaa24a131073..946815f13ec8 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.46.0. By combining all the individual C code files into this +** version 3.46.1. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 96c92aba00c8375bc32fafcdf12429c58bd8. +** c9c2ab54ba1f5f46360f1b4f35d849cd3f08. */ #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 @@ -459,9 +459,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.46.0" -#define SQLITE_VERSION_NUMBER 3046000 -#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e" +#define SQLITE_VERSION "3.46.1" +#define SQLITE_VERSION_NUMBER 3046001 +#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -19361,7 +19361,7 @@ struct SrcList { #define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */ #define WHERE_ORDERBY_LIMIT 0x0800 /* ORDERBY+LIMIT on the inner loop */ #define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */ - /* 0x2000 not currently used */ +#define WHERE_KEEP_ALL_JOINS 0x2000 /* Do not do the omit-noop-join opt */ #define WHERE_USE_LIMIT 0x4000 /* Use the LIMIT in cost estimates */ /* 0x8000 not currently used */ @@ -90173,7 +90173,8 @@ SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff assert( iVar>0 ); if( v ){ Mem *pMem = &v->aVar[iVar-1]; - assert( (v->db->flags & SQLITE_EnableQPSG)==0 ); + assert( (v->db->flags & SQLITE_EnableQPSG)==0 + || (v->db->mDbFlags & DBFLAG_InternalFunc)!=0 ); if( 0==(pMem->flags & MEM_Null) ){ sqlite3_value *pRet = sqlite3ValueNew(v->db); if( pRet ){ @@ -90193,7 +90194,8 @@ SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff */ SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){ assert( iVar>0 ); - assert( (v->db->flags & SQLITE_EnableQPSG)==0 ); + assert( (v->db->flags & SQLITE_EnableQPSG)==0 + || (v->db->mDbFlags & DBFLAG_InternalFunc)!=0 ); if( iVar>=32 ){ v->expmask |= 0x80000000; }else{ @@ -106950,7 +106952,7 @@ static void extendFJMatch( static SQLITE_NOINLINE int isValidSchemaTableName( const char *zTab, /* Name as it appears in the SQL */ Table *pTab, /* The schema table we are trying to match */ - Schema *pSchema /* non-NULL if a database qualifier is present */ + const char *zDb /* non-NULL if a database qualifier is present */ ){ const char *zLegacy; assert( pTab!=0 ); @@ -106961,7 +106963,7 @@ static SQLITE_NOINLINE int isValidSchemaTableName( if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){ return 1; } - if( pSchema==0 ) return 0; + if( zDb==0 ) return 0; if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1; if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1; }else{ @@ -107144,7 +107146,7 @@ static int lookupName( } }else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){ if( pTab->tnum!=1 ) continue; - if( !isValidSchemaTableName(zTab, pTab, pSchema) ) continue; + if( !isValidSchemaTableName(zTab, pTab, zDb) ) continue; } assert( ExprUseYTab(pExpr) ); if( IN_RENAME_OBJECT && pItem->zAlias ){ @@ -108876,6 +108878,9 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames( ** Resolve all names for all expression in an expression list. This is ** just like sqlite3ResolveExprNames() except that it works for an expression ** list rather than a single expression. +** +** The return value is SQLITE_OK (0) for success or SQLITE_ERROR (1) for a +** failure. */ SQLITE_PRIVATE int sqlite3ResolveExprListNames( NameContext *pNC, /* Namespace to resolve expressions in. */ @@ -108884,7 +108889,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( int i; int savedHasAgg = 0; Walker w; - if( pList==0 ) return WRC_Continue; + if( pList==0 ) return SQLITE_OK; w.pParse = pNC->pParse; w.xExprCallback = resolveExprStep; w.xSelectCallback = resolveSelectStep; @@ -108898,7 +108903,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( #if SQLITE_MAX_EXPR_DEPTH>0 w.pParse->nHeight += pExpr->nHeight; if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ - return WRC_Abort; + return SQLITE_ERROR; } #endif sqlite3WalkExprNN(&w, pExpr); @@ -108915,10 +108920,10 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); } - if( w.pParse->nErr>0 ) return WRC_Abort; + if( w.pParse->nErr>0 ) return SQLITE_ERROR; } pNC->ncFlags |= savedHasAgg; - return WRC_Continue; + return SQLITE_OK; } /* @@ -117457,7 +117462,7 @@ static int renameResolveTrigger(Parse *pParse){ /* ALWAYS() because if the table of the trigger does not exist, the ** error would have been hit before this point */ if( ALWAYS(pParse->pTriggerTab) ){ - rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab); + rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab)!=0; } /* Resolve symbols in WHEN clause */ @@ -124426,8 +124431,9 @@ create_view_fail: #if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) /* ** The Table structure pTable is really a VIEW. Fill in the names of -** the columns of the view in the pTable structure. Return the number -** of errors. If an error is seen leave an error message in pParse->zErrMsg. +** the columns of the view in the pTable structure. Return non-zero if +** there are errors. If an error is seen an error message is left +** in pParse->zErrMsg. */ static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){ Table *pSelTab; /* A fake table from which we get the result set */ @@ -124550,7 +124556,7 @@ static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){ sqlite3DeleteColumnNames(db, pTable); } #endif /* SQLITE_OMIT_VIEW */ - return nErr; + return nErr + pParse->nErr; } SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ assert( pTable!=0 ); @@ -130848,6 +130854,8 @@ static void groupConcatValue(sqlite3_context *context){ sqlite3_result_error_toobig(context); }else if( pAccum->accError==SQLITE_NOMEM ){ sqlite3_result_error_nomem(context); + }else if( pGCC->nAccum>0 && pAccum->nChar==0 ){ + sqlite3_result_text(context, "", 1, SQLITE_STATIC); }else{ const char *zText = sqlite3_str_value(pAccum); sqlite3_result_text(context, zText, pAccum->nChar, SQLITE_TRANSIENT); @@ -133602,6 +133610,7 @@ SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList pRet->pSrc->nSrc = 1; pRet->pPrior = pLeft->pPrior; pRet->op = pLeft->op; + if( pRet->pPrior ) pRet->selFlags |= SF_Values; pLeft->pPrior = 0; pLeft->op = TK_SELECT; assert( pLeft->pNext==0 ); @@ -166067,7 +166076,9 @@ static int whereLoopAddBtree( " according to whereIsCoveringIndex()\n", pProbe->zName)); } } - }else if( m==0 ){ + }else if( m==0 + && (HasRowid(pTab) || pWInfo->pSelect!=0 || sqlite3FaultSim(700)) + ){ WHERETRACE(0x200, ("-> %s a covering index according to bitmasks\n", pProbe->zName, m==0 ? "is" : "is not")); @@ -167956,6 +167967,10 @@ static void showAllWhereLoops(WhereInfo *pWInfo, WhereClause *pWC){ ** the right-most table of a subquery that was flattened into the ** main query and that subquery was the right-hand operand of an ** inner join that held an ON or USING clause. +** 6) The ORDER BY clause has 63 or fewer terms +** 7) The omit-noop-join optimization is enabled. +** +** Items (1), (6), and (7) are checked by the caller. ** ** For example, given: ** @@ -168369,6 +168384,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( if( pOrderBy && pOrderBy->nExpr>=BMS ){ pOrderBy = 0; wctrlFlags &= ~WHERE_WANT_DISTINCT; + wctrlFlags |= WHERE_KEEP_ALL_JOINS; /* Disable omit-noop-join opt */ } /* The number of tables in the FROM clause is limited by the number of @@ -168669,10 +168685,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. */ notReady = ~(Bitmask)0; - if( pWInfo->nLevel>=2 - && pResultSet!=0 /* these two combine to guarantee */ - && 0==(wctrlFlags & WHERE_AGG_DISTINCT) /* condition (1) above */ - && OptimizationEnabled(db, SQLITE_OmitNoopJoin) + if( pWInfo->nLevel>=2 /* Must be a join, or this opt8n is pointless */ + && pResultSet!=0 /* Condition (1) */ + && 0==(wctrlFlags & (WHERE_AGG_DISTINCT|WHERE_KEEP_ALL_JOINS)) /* (1),(6) */ + && OptimizationEnabled(db, SQLITE_OmitNoopJoin) /* (7) */ ){ notReady = whereOmitNoopJoin(pWInfo, notReady); nTabList = pWInfo->nLevel; @@ -168992,26 +169008,6 @@ whereBeginError: } #endif -#ifdef SQLITE_DEBUG -/* -** Return true if cursor iCur is opened by instruction k of the -** bytecode. Used inside of assert() only. -*/ -static int cursorIsOpen(Vdbe *v, int iCur, int k){ - while( k>=0 ){ - VdbeOp *pOp = sqlite3VdbeGetOp(v,k--); - if( pOp->p1!=iCur ) continue; - if( pOp->opcode==OP_Close ) return 0; - if( pOp->opcode==OP_OpenRead ) return 1; - if( pOp->opcode==OP_OpenWrite ) return 1; - if( pOp->opcode==OP_OpenDup ) return 1; - if( pOp->opcode==OP_OpenAutoindex ) return 1; - if( pOp->opcode==OP_OpenEphemeral ) return 1; - } - return 0; -} -#endif /* SQLITE_DEBUG */ - /* ** Generate the end of the WHERE loop. See comments on ** sqlite3WhereBegin() for additional information. @@ -169311,16 +169307,10 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ ** reference. Verify that this is harmless - that the ** table being referenced really is open. */ -#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 - || cursorIsOpen(v,pOp->p1,k) - || pOp->opcode==OP_Offset - ); -#else - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 - || cursorIsOpen(v,pOp->p1,k) - ); -#endif + if( pLoop->wsFlags & WHERE_IDX_ONLY ){ + sqlite3ErrorMsg(pParse, "internal query planner error"); + pParse->rc = SQLITE_INTERNAL; + } } }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; @@ -172591,9 +172581,9 @@ static void updateDeleteLimitError( break; } } - if( (p->selFlags & SF_MultiValue)==0 && - (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 && - cnt>mxSelect + if( (p->selFlags & (SF_MultiValue|SF_Values))==0 + && (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 + && cnt>mxSelect ){ sqlite3ErrorMsg(pParse, "too many terms in compound SELECT"); } @@ -237004,7 +236994,11 @@ static int sqlite3Fts5ExprNew( } sqlite3_free(sParse.apPhrase); - *pzErr = sParse.zErr; + if( 0==*pzErr ){ + *pzErr = sParse.zErr; + }else{ + sqlite3_free(sParse.zErr); + } return sParse.rc; } @@ -239132,6 +239126,7 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( assert( pRight->eType==FTS5_STRING || pRight->eType==FTS5_TERM || pRight->eType==FTS5_EOF + || (pRight->eType==FTS5_AND && pParse->bPhraseToAnd) ); if( pLeft->eType==FTS5_AND ){ @@ -251299,6 +251294,7 @@ static int fts5UpdateMethod( rc = SQLITE_ERROR; }else{ rc = fts5SpecialDelete(pTab, apVal); + bUpdateOrDelete = 1; } }else{ rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]); @@ -252473,14 +252469,16 @@ static int sqlite3Fts5GetTokenizer( if( pMod==0 ){ assert( nArg>0 ); rc = SQLITE_ERROR; - *pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]); + if( pzErr ) *pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]); }else{ rc = pMod->x.xCreate( pMod->pUserData, (azArg?&azArg[1]:0), (nArg?nArg-1:0), &pConfig->pTok ); pConfig->pTokApi = &pMod->x; if( rc!=SQLITE_OK ){ - if( pzErr ) *pzErr = sqlite3_mprintf("error in tokenizer constructor"); + if( pzErr && rc!=SQLITE_NOMEM ){ + *pzErr = sqlite3_mprintf("error in tokenizer constructor"); + } }else{ pConfig->ePattern = sqlite3Fts5TokenizerPattern( pMod->x.xCreate, pConfig->pTok @@ -252539,7 +252537,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33", -1, SQLITE_TRANSIENT); } /* @@ -252574,17 +252572,23 @@ static int fts5IntegrityMethod( assert( pzErr!=0 && *pzErr==0 ); UNUSED_PARAM(isQuick); + assert( pTab->p.pConfig->pzErrmsg==0 ); + pTab->p.pConfig->pzErrmsg = pzErr; rc = sqlite3Fts5StorageIntegrity(pTab->pStorage, 0); - if( (rc&0xff)==SQLITE_CORRUPT ){ - *pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s", - zSchema, zTabname); - rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM; - }else if( rc!=SQLITE_OK ){ - *pzErr = sqlite3_mprintf("unable to validate the inverted index for" - " FTS5 table %s.%s: %s", - zSchema, zTabname, sqlite3_errstr(rc)); + if( *pzErr==0 && rc!=SQLITE_OK ){ + if( (rc&0xff)==SQLITE_CORRUPT ){ + *pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s", + zSchema, zTabname); + rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM; + }else{ + *pzErr = sqlite3_mprintf("unable to validate the inverted index for" + " FTS5 table %s.%s: %s", + zSchema, zTabname, sqlite3_errstr(rc)); + } } + sqlite3Fts5IndexCloseReader(pTab->p.pIndex); + pTab->p.pConfig->pzErrmsg = 0; return rc; } @@ -254018,7 +254022,7 @@ static int fts5AsciiCreate( int i; memset(p, 0, sizeof(AsciiTokenizer)); memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar)); - for(i=0; rc==SQLITE_OK && ibFold = 1; pNew->iFoldParam = 0; - for(i=0; rc==SQLITE_OK && iiFoldParam!=0 && pNew->bFold==0 ){ rc = SQLITE_ERROR; diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index 57df8dcf2027..f64ca0172782 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.46.0" -#define SQLITE_VERSION_NUMBER 3046000 -#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e" +#define SQLITE_VERSION "3.46.1" +#define SQLITE_VERSION_NUMBER 3046001 +#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index eb16b8fffb92..07facc833868 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,46,0 +#define SQLITE_RESOURCE_VERSION 3,46,1 #endif diff --git a/contrib/sqlite3/tea/configure b/contrib/sqlite3/tea/configure index 011ef2101151..2c5190d630e3 100755 --- a/contrib/sqlite3/tea/configure +++ b/contrib/sqlite3/tea/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.46.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.46.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.46.0' -PACKAGE_STRING='sqlite 3.46.0' +PACKAGE_VERSION='3.46.1' +PACKAGE_STRING='sqlite 3.46.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1331,7 +1331,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.46.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.46.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1393,7 +1393,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.46.0:";; + short | recursive ) echo "Configuration of sqlite 3.46.1:";; esac cat <<\_ACEOF @@ -1496,7 +1496,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.46.0 +sqlite configure 3.46.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1795,7 +1795,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.46.0, which was +It was created by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -9560,7 +9560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.46.0, which was +This file was extended by sqlite $as_me 3.46.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9615,7 +9615,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.46.0 +sqlite config.status 3.46.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/tea/configure.ac b/contrib/sqlite3/tea/configure.ac index f188f22039ba..ea7eeda70fff 100644 --- a/contrib/sqlite3/tea/configure.ac +++ b/contrib/sqlite3/tea/configure.ac @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so that we create the export library with the dll. #----------------------------------------------------------------------- -AC_INIT([sqlite],[3.46.0]) +AC_INIT([sqlite],[3.46.1]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From nobody Tue Sep 3 01:22:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WySY46Wvdz5VPF2; Tue, 03 Sep 2024 01:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WySY44VTkz4t3V; Tue, 3 Sep 2024 01:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725326568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XgGbLL/nSsjeMBU766Hz65/wJj3ZoKQJkYkdlmtEcpk=; b=ccSCkSfvK29jCIht8ctdY+mVXfshm3sGqpERq/lUvT3yzI1/4UcbJZg14yYpZHufh1Q6Z+ a4RWiIODFre/wiIvtL5icZBLsG4yoscBd2RpXMSGWsgAuKOqbQ93qV34J+jNvlvX4KSAdl Y5cM4s1Qnn9jMAXCOCKqX5XbcnxgfZGKKjSXcHmtqoED0KhY0KSysDLVYUgRst5uPUZfQO 45LcHu9uqKa/T0QgX24Vog+IoT6WeuG8aL+yS2jpTjg/EPsqlhfyoyzPNjm1vMIICnI05n QTamE03oB2EqkGU/FwPUu3IhDfo7c72heV3gddE2hI6mqi0GtWe+/kSCG3lx3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725326568; a=rsa-sha256; cv=none; b=KcDjAzjtNo7B3T5Q8K2ZYOhgkDwV9PtY26DCgBIQISygUyxeYT2lUxR0d1OlwDjCAfji8N 3T9NtV1X4GyISgjK5KeqIElX6QPa2edm7XDbuFp/8jIl3ICTfmbxZROzLoq20X/BSOUxAz bf7VBNZYXIGPf+a3JKC+4D414lCoNFYatJAQLG4eup03SJR9M/9c1jiJ3rrqNDxwyH7uZN ltDRU14fNZ9pMvSsR3K94ynpBoJm89jB9M+wpXjrsbsTw17wkM5HFXmUFBQrB6n/f/EH5K p81P/PVBP82ZBXkuSbiZg8e24fMxhtUfaaC11FWF3zbRP7g11XynbjOxwgMFZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725326568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XgGbLL/nSsjeMBU766Hz65/wJj3ZoKQJkYkdlmtEcpk=; b=H4Y2jx5j8iJPaYLjn2RJH1ZwbTmFtHDYDbM2tN36tnG6qT9Rq0yZcumuUAqqcQdaMTNktw k0/npf1alJLvOwK/k2ml+eSZaQz40kdOQ/vqKxiKt8QhA/71liPYT5ZDuWJ0i1AcUMn7IN yfWF1AwJcLI3jfWfTjyThqcEf4rfWX8H911Ru1W9YoYGp01U+/6tBibVs/bLlJdaWojOir SU0W9aAofCLPQTbg6soI+VQ3J+dFtBHk2gcifakFB9vxy4j2YlNHxlg8Z/m3uBYS1pD35u XaoDer8dsTXWmKzjkKHZiqoOLG69o2CSz1AvhSnbXq5e1qIFwguXAmhpchGXIw== 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 4WySY43j8hzL1L; Tue, 3 Sep 2024 01:22: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 4831MmFK091683; Tue, 3 Sep 2024 01:22:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4831MmOO091680; Tue, 3 Sep 2024 01:22:48 GMT (envelope-from git) Date: Tue, 3 Sep 2024 01:22:48 GMT Message-Id: <202409030122.4831MmOO091680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: c7dd97ec9968 - main - vmstat: Add root element to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7dd97ec99687996de49ec0b1a23bf007e5199b9 Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=c7dd97ec99687996de49ec0b1a23bf007e5199b9 commit c7dd97ec99687996de49ec0b1a23bf007e5199b9 Author: Bram Ton AuthorDate: 2024-07-17 07:23:30 +0000 Commit: Xin LI CommitDate: 2024-09-03 01:22:14 +0000 vmstat: Add root element to libxo output Current libxo output does not have a root element. Valid XML requires a single root element. This commit adds this root element. The libxo output version bumped accordingly. PR: 254635 MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1330 --- usr.bin/vmstat/vmstat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 21068d632a8c..e7790ad6e2f6 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -66,7 +66,7 @@ #include #include -#define VMSTAT_XO_VERSION "1" +#define VMSTAT_XO_VERSION "2" static char da[] = "da"; @@ -282,6 +282,7 @@ main(int argc, char *argv[]) argv += optind; xo_set_version(VMSTAT_XO_VERSION); + xo_open_container("vmstat"); if (!hflag) xo_set_options(NULL, "no-humanize"); if (todo == 0) @@ -383,6 +384,7 @@ nlist_ok: dointr(interval, reps); if (todo & VMSTAT) dovmstat(interval, reps); + xo_close_container("vmstat"); xo_finish(); exit(0); } From nobody Tue Sep 3 05:48:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyZRW0Tsjz5W07G; Tue, 03 Sep 2024 05:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyZRW013qz4LZN; Tue, 3 Sep 2024 05:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725342503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RM30ponjqAxqwmj9jj30h35EnI5FMSAc4ycJB6DKZx4=; b=DEpBiaDu2NBWgnOZDrmqUKteQ8uTT415g4G9OkSbL5bVnBHl7LoN83MPOUpWgrCM0nTVTF L8ov+eSStJ6OfPHyG3JcFU/0QMlFLfvtuO5iFPJIOqPk72qr3p4487BIDJ+B0YpCEXCjOW HzG+tPvycfliZX5a9DeRtZ6eYVCY0KJjCQzTuDmgRKlnFS1KZFAUPJNpojWMYtqX9i9N8H sHrxHmec0wAoPf7KTBloFPVxX011DQnzp0T4kOFFMh2FjUaNKS88QiPK/HGMKniVryJwSu M1OaTABYQYahbcLr8jX6NbeVSI+72UdH5ShiJXooEXRYlgl4jwV7rJO7Fdi67A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725342503; a=rsa-sha256; cv=none; b=eAOK8bVN3IeZgnu5V1W251H3Kz8N1VKX7BllqgzWPwNhBHMYZOdhZ7v+Q+l5ljWyc2gxv8 NU2qOY0uuA0IOgo/YmMn+lm76C5JSROWGTE9MMSj9DyE8dfVD4HZ18AnW5AD1sIYdYCSA+ zknRkJclvPF9C0AlHCTyqcNIQFbH0PHm+OlC6MjRb9fIhBXRfg91FpFaicETim0cVTA8JX n6v8KlCZmYnmm9KE2UQ+lvE4i14PgIrN9sGQv79xpnzRbbybVkc8cej4VHMILuAnfGYsGa 8V42TyPGNmUaJsY9+2bKwcZy40hc8Xpwh0sNggugBGAUfl9XoGYCYHCMLmlyow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725342503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RM30ponjqAxqwmj9jj30h35EnI5FMSAc4ycJB6DKZx4=; b=bOxJ6x0fo75fvnRu+FxdHoNSdUr9N2bm+46vsXL/BNBgJUwvBgyoUNH/qeLspDwjptvhDi AFqbFI4hwBEWywxhNipSZdUgYiw0zVss1c6xXNL+Asmcz/glGsEZ2dPy6GDcEt1233EGdM tN8HQg6FMLmNzczBo3A+r767GVwjAoJYBF1DfiMPhtBSyBx1ZuG5UccQGO6wYkFRTq+nza X28G0TyrRcpXB+YLH9AKGuk37hMUar9rZc45yLbSJySRvz2VholuMeku31faKvTMfNuRkU L83bMNX5/QtyKsbqPews4JeMBtawCov69vntzv+yYqZW+yerBUauXL58ud7UHw== 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 4WyZRV6c60zS80; Tue, 3 Sep 2024 05:48: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 4835mMWx033076; Tue, 3 Sep 2024 05:48:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4835mMPs033073; Tue, 3 Sep 2024 05:48:22 GMT (envelope-from git) Date: Tue, 3 Sep 2024 05:48:22 GMT Message-Id: <202409030548.4835mMPs033073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: bac98f86c984 - main - mfiutil: Handle potential ioctl(2) failures in mfi_flash.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bac98f86c98421f6153c749b6c77995ef778e2fb Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=bac98f86c98421f6153c749b6c77995ef778e2fb commit bac98f86c98421f6153c749b6c77995ef778e2fb Author: WHR AuthorDate: 2024-09-03 05:12:20 +0000 Commit: Xin LI CommitDate: 2024-09-03 05:46:51 +0000 mfiutil: Handle potential ioctl(2) failures in mfi_flash.c The return value of function 'mfi_dcmd_command' should always be checked for the potential ioctl(2) failure. PR: 281158 MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1403 --- usr.sbin/mfiutil/mfi_flash.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/usr.sbin/mfiutil/mfi_flash.c b/usr.sbin/mfiutil/mfi_flash.c index 2fbfc978edac..4d1930af4941 100644 --- a/usr.sbin/mfiutil/mfi_flash.c +++ b/usr.sbin/mfiutil/mfi_flash.c @@ -129,9 +129,15 @@ flash_adapter(int ac, char **av) /* First, ask the firmware to allocate space for the flash file. */ mbox_store_word(mbox, sb.st_size); - mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_OPEN, NULL, 0, mbox, 4, &status); + if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_OPEN, NULL, 0, mbox, 4, + &status) < 0) { + error = errno; + warn("Failed to allocate flash memory"); + goto error; + } if (status != MFI_STAT_OK) { - warnx("Failed to alloc flash memory: %s", mfi_status(status)); + warnx("Failed to allocate flash memory: %s", + mfi_status(status)); error = EIO; goto error; } @@ -148,19 +154,26 @@ flash_adapter(int ac, char **av) nread = read(flash, buf, FLASH_BUF_SIZE); if (nread <= 0 || nread % 1024 != 0) { warnx("Bad read from flash file"); - mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0, - NULL, 0, NULL); + if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, + NULL, 0, NULL, 0, NULL) < 0) { + warn("Failed to discard flash memory"); + } error = ENXIO; goto error; } mbox_store_word(mbox, offset); - mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_DOWNLOAD, buf, nread, - mbox, 4, &status); + if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_DOWNLOAD, buf, nread, + mbox, 4, &status) < 0) { + error = errno; + warn("Failed to download firmware"); + goto error; + } if (status != MFI_STAT_OK) { - warnx("Flash download failed: %s", mfi_status(status)); - mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0, - NULL, 0, NULL); + warnx("Failed to download firmware: %s", + mfi_status(status)); + mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, + 0, NULL, 0, NULL); error = ENXIO; goto error; } @@ -171,8 +184,12 @@ flash_adapter(int ac, char **av) /* Kick off the flash. */ printf("WARNING: Firmware flash in progress, do not reboot machine... "); fflush(stdout); - mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_FLASH, &dummy, sizeof(dummy), - NULL, 0, &status); + if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_FLASH, &dummy, sizeof(dummy), + NULL, 0, &status) < 0) { + error = errno; + printf("failed:\n\t%s\n", strerror(error)); + goto error; + } if (status != MFI_STAT_OK) { printf("failed:\n\t%s\n", mfi_status(status)); error = ENXIO; From nobody Tue Sep 3 07:08:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycCh4NzBz5W57x; Tue, 03 Sep 2024 07:08: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 4WycCh3tKTz4TPj; Tue, 3 Sep 2024 07:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5N+ls3lw6OpjtZ8nRtmADSLsgBjBo6/cI+loYyYN58=; b=nVSNfm1MnE2YTlurSzbFaT5h+9Zo7xnsImXGvF4soJVY6UTSmtX4gvwISRySRr+gg6cti0 k2dAqo/2YvfIJycJDD/dk5cLwig5bxwCekzgLFuR9h8jdHk5GJsQTrkPP0YHIXR8dKrICn VPw6Id0teufl/NbWklbgZwj0fPpITFXMcPnDPMbOTttVy5i7gPECDzb2Sk5SymvjSWMgY5 4DlVfGpVzH31zIPeUGrfoD3mspyvtjJ8/rez1anE8BC0IPmjX5s3b5ZuHqOmsZa4dkIHsV BtnUSfJO+pu9ic2dHpCbRNibmg0w8quZWAHn6pTw+8wI1KHHlfNmmp8Ud4s7ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347296; a=rsa-sha256; cv=none; b=Mq9HOdfU/mCdStr+uNWsf77MiAHNYvB/ZrU1XcxX+JVeZ9ZRiXEu6CkC0+bAPBLhugvHtp yv8Ki6q7O4ZT79DDfm1M0SLWbYU05P0VbM/+g6iAhP7BAJfBtlru9BHNYA3e6EKR4Vut/M Po9p0CnRb9ZffD7FC3+C1H2HfFcRHFy+k/M9EgvjiK0JSpOJtzIGr6fU3oHG+Z6gZ6UcUx Rlwt0vQWzBzXydlJ5S7wg3mk4QAnNJ8CLN5G5Ixkh8dvPEULx+0bVvAXINYGVUlHaYvCrM VHyu7h9uRfddu9kKKWTR27UdNMNSOwcWSLSJpCRtWooP3/uGF/GuodtY8cSRqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5N+ls3lw6OpjtZ8nRtmADSLsgBjBo6/cI+loYyYN58=; b=oOECLwEF8ym8gzYBUduqepUnM8tZNtBDuDs/5+SLCCcNd0rC4hY+03rRA/ARQNRFkoI+2A 1ruBeruGXWODs7xZDiS9zCF+v/Papvt3k1ZUqLr1jxzHMe+k45D3o/N5w7VcI24H7Xt0rB fLugG8imW2AS841VCsKvyU/n1DEmwY/fbq8g0tpKgofAO4GNvfDEfMPIEhhpcL3gu+nNm8 PxYm6uuRVLArWCr4vCAPHzkP1+ClS8D+C7Ov5mdRo2CdaVJ7jxXZ8icTkP1GlV1lbUdY27 9guxn866LS3w4QdSwmk4Ig9u52mMy0ftglzPt9WYLxHgHn8YjDJyLjsf9fFYgg== 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 4WycCh3VD7zWNC; Tue, 3 Sep 2024 07:08: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 48378GA7068977; Tue, 3 Sep 2024 07:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378GoU068974; Tue, 3 Sep 2024 07:08:16 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:16 GMT Message-Id: <202409030708.48378GoU068974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 28094582f0a5 - stable/14 - nuageinit: check for both user_data and user-data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 28094582f0a5b1e6cbded199a96dd4ad2773f989 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=28094582f0a5b1e6cbded199a96dd4ad2773f989 commit 28094582f0a5b1e6cbded199a96dd4ad2773f989 Author: Baptiste Daroussin AuthorDate: 2024-06-27 08:30:07 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 nuageinit: check for both user_data and user-data openstack, ec2 and other implementation of cloudinit disagrees on the name of the file "user-data" or "user_data", test both and use the first found PR: 279876 (cherry picked from commit cde6642431bb0ca21aeebc7c521e99c681d31ffb) --- libexec/nuageinit/nuageinit | 17 ++++++++++---- libexec/nuageinit/tests/nuageinit.sh | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index df637bbc5064..f268f9b0f52c 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -190,18 +190,27 @@ else end -- deal with user-data -local f = io.open(path..'/user-data', "r") +local ud = nil +local f = nil +userdatas = { "user-data", "user_data" } +for _,v in pairs(userdatas) do + f = io.open(path..'/' .. v, "r") + if f then + ud = v + break + end +end if not f then os.exit(0) end local line = f:read('*l') f:close() if line == "#cloud-config" then - f = io.open(path.."/user-data") + f = io.open(path.."/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then - nuage.err("nuageinit: error parsing cloud-config file: user-data") + nuage.err("nuageinit: error parsing cloud-config file: " .. ud) end if obj.groups then for n,g in pairs(obj.groups) do @@ -298,7 +307,7 @@ if line == "#cloud-config" then routing:close() end else - local res,err = os.execute(path..'/user-data') + local res,err = os.execute(path..'/' .. ud) if not res then nuage.err("nuageinit: error executing user-data script: ".. err) end diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 42c95e1b2abd..54c88ceb539a 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -1,11 +1,13 @@ atf_test_case args atf_test_case nocloud atf_test_case nocloud_userdata_script +atf_test_case nocloud_user_data_script atf_test_case nocloud_userdata_cloudconfig atf_test_case nocloud_userdata_cloudconfig_users atf_test_case nocloud_network atf_test_case config2 atf_test_case config2_pubkeys +atf_test_case config2_pubkeys_user_data atf_test_case config2_network atf_test_case config2_network_static_v4 @@ -45,6 +47,16 @@ nocloud_userdata_script_body() atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud } +nocloud_user_data_script_body() +{ + here=$(pwd) + mkdir -p media/nuageinit + printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "#!/bin/sh\necho "yeah"\n" > ${here}/media/nuageinit/user_data + chmod 755 ${here}/media/nuageinit/user_data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud +} + nocloud_userdata_cloudconfig_users_body() { here=$(pwd) @@ -199,6 +211,36 @@ EOF atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } + +config2_pubkeys_user_data_body() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + if [ $(id -u) -ne 0 ]; then + atf_skip "root required" + fi + mkdir -p media/nuageinit + touch media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << EOF +#cloud-config + +ssh_authorized_keys: + - "ssh-rsa AAAAB3NzaC1y...== Generated by Nova" +EOF + mkdir -p etc + cat > etc/master.passwd < etc/group < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: c7887c8e2e1c - stable/14 - nuageinit: Accept plain text passwords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7887c8e2e1c3e8234db21b4a63770abbaf73b8b Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c7887c8e2e1c3e8234db21b4a63770abbaf73b8b commit c7887c8e2e1c3e8234db21b4a63770abbaf73b8b Author: Jose Luis Duran AuthorDate: 2024-07-23 03:49:36 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 nuageinit: Accept plain text passwords Per pw(8), when -H is set, the password should be supplied already encrypted in a form suitable for writing directly to the password database (passwd in cloud-init tems); -h provides a special interface by which interactive scripts can set an account password using pw(8) in plain text (plain_text_passwd in cloud-init terms). The default user (freebsd) is defined with a plain_text_passwd (freebsd), not with an encrypted one. (cherry picked from commit 7b73ecfe648487c7706ac2b854dcf1435e60e4ca) --- libexec/nuageinit/nuage.lua | 2 +- libexec/nuageinit/tests/nuageinit.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index ca70c778791b..81fb40c0d8eb 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -112,7 +112,7 @@ local function adduser(pwd) postcmd = " -H 0 " elseif pwd.plain_text_passwd then precmd = "echo "..pwd.plain_text_passwd .. "| " - postcmd = " -H 0 " + postcmd = " -h 0 " end cmd = precmd .. "pw " if root then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 54c88ceb539a..c6a86bc15486 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -104,6 +104,7 @@ sys:*:1:0::0:0:Sys:/home/sys:/bin/csh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF + sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd atf_check -o file:expectedgroup cat ${here}/etc/group } From nobody Tue Sep 3 07:08:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycCl2V9Jz5W580; Tue, 03 Sep 2024 07:08: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 4WycCk5wHYz4TGy; Tue, 3 Sep 2024 07:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7LcpfZ5+kHXn9QKNjMcXzhAocSRSdMyJxhxRuM7mV50=; b=DWqektQuPtZOJ87YvkLgFUY2p7T64D8+mWHSYgVa7QmI/YFxftDvwDEe+2rGnwjcxOWyVR zg427/UlygjDXHrlNhl64zFIJ73644/cCn9ZkqtasUxHT4CuQkTZuwYPJ+4JMGf24N1Txj 3YNVMAgtt7dj6rWdg0RprhotWQLdDynKcqovd2OxMwHB7vnMUQg1ha2NjxwjzuaTPsi031 loUyDiijgqkQw/G3CqPdFpI1iCvQU+qWPkxvApsjpstPATNfQgEjnVuHp5XhrtI324W8A9 i6RBcMfzlN7vi4rt3H2zg5yCTYay228JAwAyBdOh4KQWEsRHE8aSetyJqE+ztg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347298; a=rsa-sha256; cv=none; b=ITRIUR4yGGnU3HITt1YyTwO39fv3dfsW1O351Q7aZIWg7fpvYKTef3NrPiRmmNvXYZnnP1 pQyILIVNAjaB0oPnNMfUGMgqYE0q+d8AnFlwGstEDZF+ogMJpZALE6BYepfonXzCihg4p7 CGigmxkTeTiFauAjdkHyPZXXTMBK+/d48jPsDSzaAgj8CpnPozCU/LWMSOl47I0sTtpO4S dquThjKmU2oZhu/Iuw5W6pUAifjkB2IX9sqV4pAjfYIdw0zHpW6GkYzxs5bc7P1JrQKgGH /VnOgAuGWf6lcjnV/u4kS6EI3B8J/wb9KOQUfUv4Jpbtt3n9WKhRi00LKVJePw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7LcpfZ5+kHXn9QKNjMcXzhAocSRSdMyJxhxRuM7mV50=; b=H5d/2DG7n9GFRyXRr8KVJS/iV14jtwqz+0pgtlkbD/29YsVZG7em9Hd44COSDm0M9f6xpH ZlyxxOXXL0l62Y5OU++IJpYVOPTViLtYPZKX4EcNY5FoZJT5AFzY4j0rEMpBc/sX0Fga7d 1esfPJfsflLma+XD5ku6x69ZkcfEfkr7syJlcpiuiQzn5SINfv29lf+5uJZA5bQup9tldd mJ/GPoovZeddACH34vn30aBmOvRaE8HObNjVm5ki4RN44XF6zLVpTMahty1b/17mAWfPuN lhEk1yexHze0CB1iN6xYVpKrivD6w0vS5CTcpaeSkacrUAf6j3A8uG42IED4qQ== 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 4WycCk59R1zWND; Tue, 3 Sep 2024 07:08: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 48378Ieu069072; Tue, 3 Sep 2024 07:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378I4d069069; Tue, 3 Sep 2024 07:08:18 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:18 GMT Message-Id: <202409030708.48378I4d069069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 617179178727 - stable/14 - nuageinit: Set recommended SSH permissions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 617179178727b61123b17e5de6e369ff5dbb8117 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=617179178727b61123b17e5de6e369ff5dbb8117 commit 617179178727b61123b17e5de6e369ff5dbb8117 Author: Jose Luis Duran AuthorDate: 2024-07-23 08:59:09 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 nuageinit: Set recommended SSH permissions As stated in sshd(8), the recommended permissions for ~/.ssh are read/write/execute for the user, and not accessible by others; and the recommended permissions for ~/.ssh/authorized_keys are read/write for the user, and not accessible by others. (cherry picked from commit 07d17ca189fcf3cc44b7706040b05ca8135c3b85) --- libexec/nuageinit/nuage.lua | 2 ++ libexec/nuageinit/tests/nuage.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 81fb40c0d8eb..10451dc0bdc4 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -205,9 +205,11 @@ local function addsshkey(homedir, key) f:write(key .. "\n") f:close() if chownak then + os.execute("chmod 0600 " .. ak_path) pu.chown(ak_path, dirattrs.uid, dirattrs.gid) end if chowndotssh then + os.execute("chmod 0700 " .. dotssh_path) pu.chown(dotssh_path, dirattrs.uid, dirattrs.gid) end end diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index bbf306eae51f..531c171a3271 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -17,6 +17,8 @@ addsshkey_body() { if [ ! -f .ssh/authorized_keys ]; then atf_fail "ssh key not added" fi + atf_check -o inline:".ssh: 040700 [drwx------ ] -> 040700 [drwx------ ]\n" chmod -vv 0700 .ssh + atf_check -o inline:".ssh/authorized_keys: 0100600 [-rw------- ] -> 0100600 [-rw------- ]\n" chmod -vv 0600 .ssh/authorized_keys atf_check -o inline:"mykey\n" cat .ssh/authorized_keys atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys From nobody Tue Sep 3 07:08:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycCm2PW6z5MQgZ; Tue, 03 Sep 2024 07:08: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 4WycCl6j8Dz4THC; Tue, 3 Sep 2024 07:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sAvcS3LV85YA30WTuXICg0Gz4RfT1v334FOaqLZifes=; b=pl5LOAql66CLjTLraEVUu2JWVJksiP52IKHUK+c2F1/Z9jUAr1ihgzz4jDungEzFogT5MJ 45X2vtpMU6oYxqiM7RiciVeFncCuu24lRQH+dyWadlw+EJ1oCuoGVoVLvGSz88cxgYGCWK iG7Vb8fAlxMqUI3C8hP+HIRFENqx2bJXn+eDMlNNFxdjcZiKBVyTZT2rFYDXJYiWNJ95eL eqv/83T8e/cM4fo1KITYqEdMlNSUOE1KuS/l1wR17I1sMpejb5Mb9H99T11adBwJnLwYDU FtVeMiA/UI6q/Q2XFq3lnyL+m5aaDUQtG3jy2r9nPffBXP9FNM/LIpp8Na6QBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347299; a=rsa-sha256; cv=none; b=a4ZA/l75IAcbN6Ny0u2quzj9r8zdn6xGRUWJ+LbVsqFczVWPq6jKbn2KrlvhroWBAW9ikr BiW31xn2LgPXpV3yoKMCcw7BBk1PKsmSA53gPsbDnkgeX95A7tUPQ7K4UiMY9vQkyICmhO 0adt04rItvUgOfIWDk2jAAiFQjtiEqAzDWIhcwrQW7HMcEnkAuYN14N9bkvvzQEzs+ATiG mWpYx45Je/Q/mV3dBONLQ+0F0BnCtI0tQ4PV74pG0yxdZ5gIgtw9Dak2gitMyqithuYCun yNM13K6WZk+IwH4amHd9AIxwedFlCYcvntykrP1kb3sbuvBseydD0kUGBA0GWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sAvcS3LV85YA30WTuXICg0Gz4RfT1v334FOaqLZifes=; b=heverjzD63YvEfGL4ihzkU4ew+KNDQ/p6ZRlZr+jYaNTnfxjCS0LUyMVnr2rv/lQcihCnB 1DdCN1n6YoC6JO1+FWAHNOB+n0L8rQ/5fKEyIMjVxV5badGVneGHIqFFKbWA4IqWppkl3H l95/LAdTiQg/SPziPSQ1oq5aaKnfzXnTkMJ/0wN3LYxKcGqbARYVik9MBP5Pk4xLP+2L7i oQubjefaqXEh000flbShMnQVG8dg1zHwpqmcUBarz3hH4KCIzmTVw1ONxGB1gi1HIp857P 5y615BAkNuWB/nQ78HlkGIDjmCfn4KCm4ck8IbiL0LVYKzI7iBnnvnct4x/Z3Q== 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 4WycCl6K7BzWl8; Tue, 3 Sep 2024 07:08:19 +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 48378J5r069121; Tue, 3 Sep 2024 07:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378Jtu069118; Tue, 3 Sep 2024 07:08:19 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:19 GMT Message-Id: <202409030708.48378Jtu069118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 3dbc333a9ef4 - stable/14 - nuageinit: Fix the homedir variable name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3dbc333a9ef40c71f56507c672e919547eaea248 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3dbc333a9ef40c71f56507c672e919547eaea248 commit 3dbc333a9ef40c71f56507c672e919547eaea248 Author: Jose Luis Duran AuthorDate: 2024-07-23 19:54:54 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 nuageinit: Fix the homedir variable name cloud-init uses homedir, not home. (cherry picked from commit 7aecd689e362330a035a199afbe5707a8c4edc9c) --- libexec/nuageinit/nuage.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 10451dc0bdc4..cca1fe9b4678 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -86,8 +86,8 @@ local function adduser(pwd) if not pwd.gecos then pwd.gecos = pwd.name .. " User" end - if not pwd.home then - pwd.home = "/home/" .. pwd.name + if not pwd.homedir then + pwd.homedir = "/home/" .. pwd.name end local extraargs="" if pwd.groups then @@ -120,7 +120,7 @@ local function adduser(pwd) end cmd = cmd .. "useradd -n ".. pwd.name .. " -M 0755 -w none " cmd = cmd .. extraargs .. " -c '".. pwd.gecos - cmd = cmd .. "' -d '" .. pwd.home .. "' -s "..pwd.shell .. postcmd + cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s "..pwd.shell .. postcmd local r = os.execute(cmd) if not r then @@ -136,7 +136,7 @@ local function adduser(pwd) cmd = cmd .. "lock " .. pwd.name os.execute(cmd) end - return pwd.home + return pwd.homedir end local function addgroup(grp) From nobody Tue Sep 3 07:08:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycCn2TDnz5MQgf; Tue, 03 Sep 2024 07:08: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 4WycCn0dcDz4TFn; Tue, 3 Sep 2024 07:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n67YOxjhNm/KVrWJUbREEgOp6R7KNBVcyb+LK39Weu4=; b=A/W0v5CFmbBhJqc5pWWW9uCgJvJljNtTaKW+Rq2SdOQXxqaTUb0fjlA4InA5Vo25yF7Ed4 U2uOddlaezLhCy4JJ4bywuEnRe63OrTGJcyldfjnIgC5vUfCVl36NbxQyL9IH+d+LY6Nar 7VsZJNrs371rudaBKyrp/Y/nsqVEOeKfjl7NugomKLdH8FsD91GSqc1zGiBX0io3HNUTaP NS5Ha6cv6xesM4T1BE6yujVxi3I34j8DQ6EkpdnciMYoVm8cNtZtzPzGlf01Ftl0MFipus ftZJ10907HXbGvK9jw2tRVk/jserh1jcRmLrObA3F8x+L5GJI6Z8QQ7Nhj0Ugg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347301; a=rsa-sha256; cv=none; b=obHRynlqNAB2XyCoM7PLHQ4QAKP31OCuVegW/rBY7IR+nvAw5ywGNnwW6fdZPC+PwOj0CZ M9K25ImBcdZuX7Uy4V1bQgv/HIir8N9Bvp8/9ObzwwQieZia9Bdaf1wa7LWF8zVplsjYJU +lmLlwesWtMR0l6BROfGOhry7Iv4Us5cEeq+rKOJHu40pPwgukcthQl7W+O5o2MzuQgThX v1uvrHoWrOdEOyXKQbVrMjI/Ux2UYQzVzejlMAP84Gf1Y7NPSu2O+FR6GYc4Y4SOV0UMbc BRwO8HTpkzba2hIWR2KMjGdY+hp4z1lWqlok0xtEnJvVeMzu058yI7zlU2iYIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n67YOxjhNm/KVrWJUbREEgOp6R7KNBVcyb+LK39Weu4=; b=eqteJy3N/boN8LZ/8laxjWP9CBfRJqmrYvCO62/HefsEc9C8apTromoqI2BnLojabPlpmd LODpN7nvdCblCpnbX1lipdTO9HHKKIqx130asCrDNIMzOA+AQjMzfmjjT3kXDDuF7yzjUM oVmTO7eGg79fLhNmSEeHBDUWoeb7VKUyKXdAH0MN7qDUS04oIj36fB/XGUUyGuQAh6n2wd OJjC+g4/dfVd/wgKtZkeTV4PzvMfDWZByeacpZGOig339MYHcZI+HsFSFzBNBvAJMCuzva B4B56zoyZVYIYjOhOCHPFbh0iEqnXPTRoaS8FnJFk/SiStcCibkQfEUcOYqhRw== 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 4WycCn0BDFzX3J; Tue, 3 Sep 2024 07:08: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 48378KuK069157; Tue, 3 Sep 2024 07:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378KAR069154; Tue, 3 Sep 2024 07:08:20 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:20 GMT Message-Id: <202409030708.48378KAR069154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 5f7256579cd0 - stable/14 - nuageinit: Fix tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5f7256579cd0b663e4a7013e81067d11b632fe10 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5f7256579cd0b663e4a7013e81067d11b632fe10 commit 5f7256579cd0b663e4a7013e81067d11b632fe10 Author: Jose Luis Duran AuthorDate: 2024-07-23 22:28:45 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 nuageinit: Fix tests Commit 07d17ca189fcf3cc44b7706040b05ca8135c3b85 set the recommended permissions for the SSH authorized keys file and directory. The tests, however, were failing on CI. Use stat to check for the proper permissions. Fixes: 07d17ca189f nuageinit: Set recommended SSH permissions Reported by: Jenkins (cherry picked from commit 8edd6c07c8dafcc5828bceb5fea0684c7d0d0775) --- libexec/nuageinit/tests/nuage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 531c171a3271..29842bff3d6b 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -17,8 +17,8 @@ addsshkey_body() { if [ ! -f .ssh/authorized_keys ]; then atf_fail "ssh key not added" fi - atf_check -o inline:".ssh: 040700 [drwx------ ] -> 040700 [drwx------ ]\n" chmod -vv 0700 .ssh - atf_check -o inline:".ssh/authorized_keys: 0100600 [-rw------- ] -> 0100600 [-rw------- ]\n" chmod -vv 0600 .ssh/authorized_keys + atf_check -o inline:"40700\n" stat -f %p .ssh + atf_check -o inline:"100600\n" stat -f %p .ssh/authorized_keys atf_check -o inline:"mykey\n" cat .ssh/authorized_keys atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys From nobody Tue Sep 3 07:08:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycCp5RKbz5MQdd; Tue, 03 Sep 2024 07:08: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 4WycCp2GPJz4TL5; Tue, 3 Sep 2024 07:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ZE2py6Bvd4fpYOW4wFAT32Cz8Kw6Ot9oUGDdh2Dpf4=; b=BNV0izJNuKSA57YCh5UI9UNtkw8zLkf8Aw+Pz6kEmq2bLpVHQ+mv8tyOdzs5C3CTpGGnr7 PhqQNUIMzXmTp2fMjAFyDVyJuxNOtY3J7FKaNjmfB7/RWfeTdyRTASG705FmSC+h33xlmc nbjqVgX0srC9yxaVs15eFeTuTvooWakiWx3+LC5iPvPbOpcssDcRYPfmTrs8QDlwpEg72k Q6tYfTJa1BnKBsSs/Lu70D73b8J473ng8oazhsbcEjgS98cIrkdEGNhA/5KzKJDigCz4Gv WidsANLLmY6/q1YWwm8UbfJV6J64LUFXfUI7DduRzkCn46Bp2wCIEC5vlp8X8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347302; a=rsa-sha256; cv=none; b=qSrEdrDed2lJdZERM6N4Sldw2fU/mnnIigRoETgMW5wRFAgbMNUMxhcL/VkzxSBiASes0g Gkn2rkJhm+ttWO/fr7M79Lp2JKxAByxH/JnjEecgrI/ql/S370If1CwDq5W2VAdOvLdRFq bHgj28Put03o0P82MWA5zeHlqfb4QhMqmyQLSwwjvQH2yPJ/Nxjc9cE9V1aviaGj/t1bIS dkxwpfrqElL675AAihSGBWW+chpNPJcQAscvDiuffRKRD0xAxf2n9H0qVHzXXOCry4Tg4h Sc4rZbUaI4gf2THA5y5EfagfPV0Prs8CZHfEyuchCHn3MCD2AcHAdzPnnfsSDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ZE2py6Bvd4fpYOW4wFAT32Cz8Kw6Ot9oUGDdh2Dpf4=; b=XpzBpvrnYtTMMNNWQ3cC42Ft7Eu5j5wPhipiSP0MFwiUxbIFeT+BokbY7rnM+AC6KhWhXe Tt+87ZNh721hY3lRK6y36dOL567eUJoNCcfm5ugrw54AK16kHuIOhYCm4fX52KM8qc8hgJ 5D9eRUnZnser94Md3u0AKd/G+1qvwhUjZIQwbVIWg2+UY5h/BGzRnrBftDVmbWs7EXwCSk 4P2cpB30SZmvWVQQdHDo8nfcyJ8g42OpNAb4UxMdld6OpAwd5Gt0q06pUbHSeSXKLBeZDK Wf4Rh3vo2Z9KfnQgMmpkxfQMlXtSl7Ku5qVfLBV8ErxN84HrFrXwXETeeDNxCg== 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 4WycCp17YHzWlx; Tue, 3 Sep 2024 07:08: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 48378MJo069193; Tue, 3 Sep 2024 07:08:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378M6K069190; Tue, 3 Sep 2024 07:08:22 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:22 GMT Message-Id: <202409030708.48378M6K069190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 56c59177a1b7 - stable/14 - CODEOWNERS: Add nuageinit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 56c59177a1b7ec842b48650f1cacad9551b44da1 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=56c59177a1b7ec842b48650f1cacad9551b44da1 commit 56c59177a1b7ec842b48650f1cacad9551b44da1 Author: Jose Luis Duran AuthorDate: 2024-07-23 18:06:37 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 CODEOWNERS: Add nuageinit (cherry picked from commit 1991946cff2a4c87c9272c2ccc1c2fb3b1cfba96) --- .github/CODEOWNERS | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bd735363716e..5d9e43f4e725 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,7 +2,7 @@ # No locks listed here are valid. The only strict review requirements # are granted by core. These are documented in head/LOCKS and enforced # by svnadmin/conf/approvers. -# +# # The source tree is a community effort. However, some folks go to the # trouble of looking after particular areas of the tree. In return for # their active caretaking of the code it is polite to coordinate changes @@ -11,21 +11,21 @@ # committers can easily find somebody who is familiar with it. The notes # should specify if there is a 3rd party source tree involved or other # things that should be kept in mind. -# +# # However, this is not a 'big stick', it is an offer to help and a source # of guidance. It does not override the communal nature of the tree. # It is not a registry of 'turf' or private property. -# +# # *** # This list is prone to becoming stale quickly. The best way to find the recent # maintainer of a sub-system is to check recent logs for that directory or # sub-system. # *** -# +# # *** # Maintainers are encouraged to visit: # https://reviews.freebsd.org/herald -# +# # and configure Phabricator notifications for parts of the tree which they # maintain. Notifications can automatically be sent when someone proposes a # revision or makes a commit to the specified subtree. @@ -56,6 +56,7 @@ /lib/libfigpar @dag-erling /lib/libpam/ @dag-erling /lib/libvmmapi @bsdjhb @grehan-freebsd +/libexec/nuageinit/ @bapt /libexec/rc/rc.d/rctl/ @trasz /sbin/mount_fusefs @asomers /secure/usr.bin/openssl/ @juikim From nobody Tue Sep 3 07:08:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycCq5JHjz5W53m; Tue, 03 Sep 2024 07:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WycCq2cPBz4TCW; Tue, 3 Sep 2024 07:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g2DUqSlFMr/cG7YCIxvMdr0AVkgtofs3oiX+CYeeBKA=; b=Yu1CApy12zTnNMYxtgk1RaMvi5CHo7NefYL8f5W+cnHqlmSsHS+rwISsKAs4K4iKHtIAQj 1cvR/vItOkfFHhQBIwsbl/lQ+g+Uf1SRIIhW0SDXoOZFV+JxPIPJL0vH5gNzDniGUj91Tp yQrCKEudrWTgAhC+1nzdkv55cJ/NDlOZLofbw3lBE2KBEp/NIuqQ4c6gC43E2+C5yjvGYU vbNqFNM0WGrKZX+kl0BPReoIpF/C89CdusGoRkJT463GOl4tm32As5aFRj7EfEuRUV35dk wwH0Q3wGyv/SNoZFuvmJfvSPDGrYs14toprU4mriU9KEqfJC+u0YbbGoyub1Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347303; a=rsa-sha256; cv=none; b=mDihtEHMnv6fEI93BuaxZ1BNBLJL/WoCxGiusbB7cye8lLMtm6tMTqAEoJtKA4l5ARbJF+ 2/5wfrGIgiAPyplVpVDfOvIVPBZMtL6NPTSzjKwgWvCA8qFfs4/5MIrDktYekR1+YllOvI qms8YFbzTZjuOiHSpesGbnyot1aUXzjePPQr2P9NtCogMRKWsdEv9SeUfGKnwrWzZuZQeC +KzkFRvPLhZATs21IUWN43YdddoETXByLsO4J5Wf1LG/oiuoopDPH4R4jOfjRdvqF0NAyi 0p392GLz7JHlMRynnYLjnmWQ/aA7Q3CQpyWBGzxbGLF5iqVVsJOxgKl6c7RDOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g2DUqSlFMr/cG7YCIxvMdr0AVkgtofs3oiX+CYeeBKA=; b=VseuE84gBqhY8pLOZQH+NesC6Hodt6R/Jn4CF1QdtwkgM1sUdZJhMU9fWSX4QvAz0G1JAQ rM4IUF7ZnNWyMvjWKFcIXg1f7ziCbDpjdi4zvTQ9vOb+Tv9v/DUGnWyxxl2/G2CTGaYYmi GVz/4NSRRyHw9vTmY0Ww0cY3mZgE/poVeAy+05wgzLNZW0vqXm6QLJft1xf8IedZrMVVV2 ct1M/kqhhkbp2VycfYAU9h0kO7i9CgrJlmdoZkIptBhWiitV+RRd//bNLfqcdNNGUSNIux ucthIhX5FR4a5pTOHb97d1avxAeZ0/CyRHdcmt82Zqdx78Qxh2HJMTVpnPWTPw== 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 4WycCq2CDpzWlS; Tue, 3 Sep 2024 07:08: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 48378NgQ069252; Tue, 3 Sep 2024 07:08:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48378NR8069249; Tue, 3 Sep 2024 07:08:23 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:08:23 GMT Message-Id: <202409030708.48378NR8069249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 3a73c77f2d86 - stable/14 - nuageinit: readd ssh key parsing when key is in meta_data.json List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a73c77f2d862f2754483ab26e252befc4f8f4e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3a73c77f2d862f2754483ab26e252befc4f8f4e6 commit 3a73c77f2d862f2754483ab26e252befc4f8f4e6 Author: Baptiste Daroussin AuthorDate: 2024-08-20 10:04:01 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:24 +0000 nuageinit: readd ssh key parsing when key is in meta_data.json in openstack when no user is specified but a sshkey is provided the information is stored in meta_data.json under "public_keys" PR: 280461 Reported by: tdb (cherry picked from commit 19fb9ad746517c7af9d79a982334b2550f285355) --- libexec/nuageinit/nuageinit | 6 +++++ libexec/nuageinit/tests/nuageinit.sh | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index f268f9b0f52c..622e294bb531 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -164,6 +164,12 @@ if citype == "config-2" then nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) end local obj = parser:get_object() + if obj.public_keys then + local homedir = nuage.adduser(default_user) + for _,v in pairs(obj.public_keys) do + nuage.addsshkey(homedir, v) + end + end nuage.sethostname(obj["hostname"]) -- network diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index c6a86bc15486..b5078e256853 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -8,6 +8,7 @@ atf_test_case nocloud_network atf_test_case config2 atf_test_case config2_pubkeys atf_test_case config2_pubkeys_user_data +atf_test_case config2_pubkeys_meta_data atf_test_case config2_network atf_test_case config2_network_static_v4 @@ -242,6 +243,52 @@ EOF atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } +config2_pubkeys_meta_data_body() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + if [ $(id -u) -ne 0 ]; then + atf_skip "root required" + fi + mkdir -p media/nuageinit + cat > media/nuageinit/meta_data.json < etc/master.passwd < etc/group < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 701ac3adcb75 - stable/14 - nuageinit: improve debugging when mkdir fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 701ac3adcb75951737d4dc09e19021ebb3a2b1f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=701ac3adcb75951737d4dc09e19021ebb3a2b1f4 commit 701ac3adcb75951737d4dc09e19021ebb3a2b1f4 Author: Baptiste Daroussin AuthorDate: 2024-08-20 10:05:25 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:05:25 +0000 nuageinit: improve debugging when mkdir fails (cherry picked from commit a6ecbf2b35856e312d1e826b206142b9f930a760) --- libexec/nuageinit/nuage.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index cca1fe9b4678..116ab143ccfa 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -188,10 +188,7 @@ local function addsshkey(homedir, key) chownak = true dirattrs = lfs.attributes(dotssh_path) if dirattrs == nil then - if not lfs.mkdir(dotssh_path) then - warnmsg("nuageinit: impossible to create ".. dotssh_path) - return - end + assert(lfs.mkdir(dotssh_path)) chowndotssh = true dirattrs = lfs.attributes(homedir) end From nobody Tue Sep 3 07:09:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycDy6SxPz5MQq2; Tue, 03 Sep 2024 07:09: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 4WycDy4kdgz4WYM; Tue, 3 Sep 2024 07:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/VFPgdBUkMB3C5hG6DOn6fIbHMqC1KyFLDy4fK2+siw=; b=WmQxmMI3ANap+7p21iqSj3shZKdXFbjxRW35M/OaYAu2oN/pnuKbvtBLsodrnvvHQj68GP Nv8UoPgT0W/SKx99f8HEwc5ffl0dCXe/xMTL2ndCyBjtPY/Jy71egLsFVPUNBmw2WpEX1m X5m6A+75YGvmMGy9um4m0eJL0fpyo77MskM/mK9NCrw8SoDrXZGXdsA0XNIaB9BHR5sdMu DL1jzkPy8o0N6ZYyg163iJFs/6/Lhrh6LmvFC6v7pYpceM6OVk3VJCxOqh32BA4nfBM9q5 wjlAIsMtHkigmxr4fA6ix7gFQ691LiFYc2/lZbL//Q9nIqWH2bMzQ8Zf8xu2xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347362; a=rsa-sha256; cv=none; b=FmD0A+4Zh7QLKWa04klFASWzpfNn6ALOxrGu3saejrFL23rcHLJYa0SK/rppZjxb8PT6o/ ss7oQsSmzQsYcNMeoK3vLdKtXo1tfZqTXWvntJksEnmVNJ/L+Fp2H8BSzlcihlzu5YoM7i Vg74eTlvvsWAe+qEdZHRgVS56FsHL6XL76Rwl/6/HhoU/bSLcaBPwdh/DbZMiAIxzDd2d2 5/6ZEZW6Ps98lO16m7zALYmXa4uq7MG4yXoPae2SSgiz3mrG3sRWnZr8xWZd8ycIn07F5l +ltLlpPeSikNH4gLqPGUhsscaipkRP06bVoW3LR/wTC1Xgc/sOB3BH6jvIyZWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/VFPgdBUkMB3C5hG6DOn6fIbHMqC1KyFLDy4fK2+siw=; b=aneRBKjAmcsrqHdmI4BCCuRJq4pfCLq3scdytSvwundgtOvgt+xeL9AU4ErE347wVeN2Yz /N4S/SSQaOHuzuw+5xwiwwxa4wah9cQshx1yhfq8TtSggMYrBVPQLdSblU1dUF3Haiu5TN xZuv3fsMLNMA7ZDg+qSZh3LDvocndkkY1VtX5zPilphWowV5sp0UaRnw6kob5gGgQhx3xN jB6g/5srY1tcHq1Y9Xn8qbrlC9wTIrXEeNd9OAAAONBrsnUCHqpTX+m2D/CgshttWAn5Ce i7tx2dl5fhg/3GO2A2gmqMUYfnbvxK/dgiQW2/Y/zqEKna/F5rXwXKOhsYFyrA== 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 4WycDy3yVbzWlD; Tue, 3 Sep 2024 07:09: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 48379MNe069585; Tue, 3 Sep 2024 07:09:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48379MR9069581; Tue, 3 Sep 2024 07:09:22 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:09:22 GMT Message-Id: <202409030709.48379MR9069581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: ea0a7e8c6570 - stable/14 - pci_vendors: update to 2024.06.23 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ea0a7e8c6570799385a1e7c4b59824a28500c4f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ea0a7e8c6570799385a1e7c4b59824a28500c4f8 commit ea0a7e8c6570799385a1e7c4b59824a28500c4f8 Author: Baptiste Daroussin AuthorDate: 2024-08-19 16:10:55 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:06:55 +0000 pci_vendors: update to 2024.06.23 (cherry picked from commit b9d1249b5b686dad0346e7d211693456c64049ec) --- share/misc/pci_vendors | 238 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 215 insertions(+), 23 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index df152a4e97e0..f168678909c8 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2024.05.14 -# Date: 2024-05-14 03:15:02 +# Version: 2024.06.23 +# Date: 2024-06-23 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -104,6 +104,17 @@ 025e d81d NVMe DC SSD E1.L 9.5mm [D5-P5336] 0b70 NVMe DC SSD [Yorktown controller] 2b59 NVMe DC SSD [Atomos Prime] + 025e 0008 NVMe DC SSD U.2-SFF 15mm [D7-PS1010] + 025e 0019 NVMe DC SSD E3.S-1T 7.5mm [D7-PS1010] + 025e 0108 NVMe DC SSD U.2-SFF 15mm [D7-PS1030] + 025e 0119 NVMe DC SSD E3.S-1T 7.5mm [D7-PS1030] + 108e 48a0 NVMe DC SSD U.2-SFF 15mm 3.84TB [D7-PS1010 Custom] + 108e 48a1 NVMe DC SSD U.2-SFF 15mm 7.68TB [D7-PS1010 Custom] + 108e 48a2 NVMe DC SSD U.2-SFF 15mm 15.36TB [D7-PS1010 Custom] + 108e 48a3 NVMe DC SSD Add-In-Card [D7-PS1030 Custom] + 108e 48a4 NVMe DC SSD E3.S-1T 7.5mm 3.84TB [D7-PS1010 Custom] + 108e 48a5 NVMe DC SSD E3.S-1T 7.5mm 7.68TB [D7-PS1010 Custom] + 108e 48a6 NVMe DC SSD E3.S-1T 7.5mm 15.36TB [D7-PS1010 Custom] f1ab P41 Plus NVMe SSD (DRAM-less) [Echo Harbor] f1ac P44 Pro NVMe SSD [Hollywood Beach] 0270 Hauppauge computer works Inc. (Wrong ID) @@ -616,6 +627,7 @@ 1bd4 000e 6G SAS2008IR 1bd4 000f 6G SAS2008IT SA5248 1bd4 0010 6G SAS2008IR SA5248 + 4c52 96c8 LRSA96C8 8-Port SATA3(6Gb/s)Exchange Adapter (with Raid) 8086 350f RMS2LL040 RAID Controller 8086 3700 SSD 910 Series 0073 MegaRAID SAS 2008 [Falcon] @@ -1082,6 +1094,12 @@ 10e4 MegaRAID 12GSAS/PCIe Unsupported SAS38xx 10e5 MegaRAID 12GSAS/PCIe SAS38xx 10e6 MegaRAID 12GSAS/PCIe Secure SAS38xx + 1000 04d9 3808N iMR ROMB + 1000 04da 3808N iMR ROMB + 1000 04db 3808N iMR ROMB + 1000 04dc 3808N iMR ROMB + 1000 04dd 3808N iMR ROMB + 1000 40d8 MegaRAID 9524-8i 1000 40e0 MegaRAID 9540-2M2 1028 2172 PERC H355 Adapter 1028 2173 PERC H355 Front @@ -1127,6 +1145,7 @@ 1000 a064 PEX88064 64 lane/port PCIe Gen 4 Switch 1000 a080 PEX88080 80 lane/port PCIe Gen 4 Switch 1000 a096 PEX88096 98 lane/port PCIe Gen 4.0 Switch + 4c52 9f48 LRNV9F48 4-port Built-in 8654 NVMe Switching Adapter c012 PEX880xx PCIe Gen 4 Switch # Virtual endpoint used in Broadcom synthetic PCIe switches for resource reservation 1000 100b PEX88000 PCIe Gen 4 Virtual Upstream/Downstream Port @@ -1249,7 +1268,7 @@ 103c 8b17 ProBook 445 G9/455 G9 [Ryzen 7 Integrated Radeon GPU] 15ff Fenghuang [Zhongshan Subor Z+] 1607 Arden - 1636 Renoir [Radeon RX Vega 6 (Ryzen 4000/5000 Mobile Series)] + 1636 Renoir [Radeon Vega Series / Radeon Vega Mobile Series] 1637 Renoir Radeon High Definition Audio Controller 1638 Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] 1043 16c2 Radeon Vega 8 @@ -3987,6 +4006,8 @@ 1458 2408 Radeon RX 6750 XT GAMING OC 12G 1462 3980 Radeon RX 6700 XT Mech 2X 12G [MSI] 148c 2409 Red Devil RX 6700 XT +# Dual fan version + 1849 5210 Radeon RX 6700 XT Challenger D 1849 5219 Radeon RX 6700 XT Challenger D 1849 5222 RX 6700 XT Challenger D OC # Gaming 1440/QHD Overclock edition with 12 Gb GDDR6 and PCIe 4.0 of Radeon RX 6700 XT by Sapphire PULSE manufactured on autumn 2022 / C1 reviseion @@ -4022,13 +4043,17 @@ 7448 Navi 31 [Radeon Pro W7900] 744c Navi 31 [Radeon RX 7900 XT/7900 XTX/7900M] 1002 0e3b RX 7900 GRE [XFX] + 1043 0506 TUF Gaming Radeon RX 7900 XTX OC + 1849 5304 Radeon RX 7900 XTX 1da2 471e PULSE RX 7900 XTX + 1da2 475e PULSE RX 7900 GRE 1da2 e471 NITRO+ RX 7900 XTX Vapor-X 1eae 7901 RX-79XMERCB9 [SPEEDSTER MERC 310 RX 7900 XTX] 745e Navi 31 [Radeon Pro W7800] + 7460 7460 Navi32 GL-XL [AMD Radeon PRO V710] 7470 Navi 32 [Radeon PRO W7700] 747e Navi 32 [Radeon RX 7700 XT / 7800 XT] - 7480 Navi 33 [Radeon RX 7700S/7600/7600S/7600M XT/PRO W7600] + 7480 Navi 33 [Radeon RX 7600/7600 XT/7600M XT/7600S/7700S / PRO W7600] 1849 5313 RX 7600 Challenger OC 7483 Navi 33 [Radeon RX 7600M/7600M XT] 7489 Navi 33 [Radeon Pro W7500] @@ -5460,10 +5485,12 @@ 1849 43c8 Fatal1ty X370 Professional Gaming 43b6 X399 Series Chipset SATA Controller 43b7 300 Series Chipset SATA Controller + 43b8 A320 Chipset SATA Controller [AHCI mode] 43b9 X370 Series Chipset USB 3.1 xHCI Controller 1849 43d0 Fatal1ty X370 Professional Gaming 43ba X399 Series Chipset USB 3.1 xHCI Controller 43bb 300 Series Chipset USB 3.1 xHCI Controller + 43bc A320 USB 3.1 XHCI Host Controller 43c6 400 Series Chipset PCIe Bridge 43c7 400 Series Chipset PCIe Port 43c8 400 Series Chipset SATA Controller @@ -9186,12 +9213,17 @@ 8717 PEX 8717 16-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch with DMA 8718 PEX 8718 16-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch 8724 PEX 8724 24-Lane, 6-Port PCI Express Gen 3 (8 GT/s) Switch, 19 x 19mm FCBGA + 4c52 9234 LRNV9324 2-port Built-in 8643 NVMe Exchange Adapter + 4c52 9524 LRNV9524 2-port M.2 NVMe SSD Exchange Adapter 8725 PEX 8725 24-Lane, 10-Port PCI Express Gen 3 (8.0 GT/s) Multi-Root Switch with DMA 8732 PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch 8734 PEX 8734 32-lane, 8-Port PCI Express Gen 3 (8.0GT/s) Switch 8747 PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch + 4c52 9347 LRNV9347L 2-port Built-in 8643 NVMe Switching Adapter + 4c52 9547 LRNV9547 4-port M.2 NVMe SSD Exchange Adapter 8748 PEX 8748 48-Lane, 12-Port PCI Express Gen 3 (8 GT/s) Switch, 27 x 27mm FCBGA 8749 PEX 8749 48-Lane, 18-Port PCI Express Gen 3 (8.0 GT/s) Multi-Root Switch with DMA + 4c52 9349 LRNV9349 8-port SFF-8643 NVMe SSD Exchange Adapter 87a0 PEX PCI Express Switch NT0 Port Link Interface 87a1 PEX PCI Express Switch NT1 Port Link Interface 87b0 PEX PCI Express Switch NT0 Port Virtual Interface @@ -12959,6 +12991,8 @@ 2296 Tegra PCIe Endpoint Virtual Network 22a3 GH100 [H100 NVSwitch] 22ba AD102 High Definition Audio Controller + 22bc AD104 High Definition Audio Controller + 22bd AD106M High Definition Audio Controller 2302 GH100 2313 GH100 [H100 CNX] 2321 GH100 [H100L 94GB] @@ -13080,6 +13114,7 @@ 2681 AD102 [RTX TITAN Ada] 2684 AD102 [GeForce RTX 4090] 2685 AD102 [GeForce RTX 4090 D] + 2689 AD102 [GeForce RTX 4070 Ti SUPER] 26b1 AD102GL [RTX 6000 Ada Generation] 26b2 AD102GL [RTX 5000 Ada Generation] 26b3 AD102GL [RTX 5880 Ada Generation] @@ -13299,6 +13334,7 @@ 8043 LANai4.x [Myrinet LANai interface chip] 8062 S5933_PARASTATION 807d S5933 [Matchmaker] + 8081 GPIB interface card [IOtech Inc. PCI488] 8088 Kongsberg Spacetec Format Synchronizer 8089 Kongsberg Spacetec Serial Output Board 809c S5933_HEPC3 @@ -16238,7 +16274,9 @@ 11ae Aztech System Ltd 11af Avid Technology Inc. 0001 Cinema + ee21 Digidesign DSP Farm ee40 Digidesign Audiomedia III + ee60 Digidesign SampleCell II / II Plus 11b0 V3 Semiconductor Inc. 0002 V300PSC 0292 V292PBC [Am29030/40 Bridge] @@ -17445,7 +17483,8 @@ 10a9 8002 Acenic Gigabit Ethernet 12ae 0002 Gigabit Ethernet-T (3C986-T) 00fa Farallon PN9100-T Gigabit Ethernet -12af TDK USA Corp +12af TDK Corporation + 5831 GBDriver GX1 x2 NVMe SSD Controller (DRAM-less) 12b0 Jorge Scientific Corp 12b1 GammaLink 12b2 General Signal Networks @@ -18916,6 +18955,9 @@ 580b Secure Flash Controller (Xenon) 580d System Management Controller (Xenon) 5811 Xenos GPU (Xenon) + 5821 Xenos GPU (Zephyr/Falcon) + 5831 Xenos GPU (Jasper) + 5841 Xenos GPU (Slim) 1415 Oxford Semiconductor Ltd 8401 OX9162 Mode 1 (8-bit bus) 8403 OX9162 Mode 0 (parallel port) @@ -19859,6 +19901,7 @@ 144d a801 SM963 2.5" NVMe PCIe SSD a806 NVMe SSD SM0032L a808 NVMe SSD Controller SM981/PM981/PM983 +# Used by different variants of SSD 970 EVO and PRO 144d a801 SSD 970 EVO/PRO 1d49 403b Thinksystem U.2 PM983 NVMe SSD a809 NVMe SSD Controller 980 (DRAM-less) @@ -19886,7 +19929,7 @@ # Actually 88SS1322 according to techpowerup a80b NVMe SSD Controller PM9B1 (DRAM-less) a80c NVMe SSD Controller S4LV008[Pascal] - a80d NVMe SSD Controller PM9C1a + a80d NVMe SSD Controller PM9C1a (DRAM-less) a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -20844,6 +20887,7 @@ 14e4 5250 NetXtreme-E BCM57504 4x25G KR Mezz 14e4 5425 NetXtreme-E Quad-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957504-N425G) 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE + 1590 0420 HPE Ethernet 25/50Gb 2-port 6310C Adapter 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 1760 BCM57608 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet 14e4 d125 BCM57608 2x200G PCIe Ethernet NIC @@ -21908,11 +21952,13 @@ 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image - 0270 Spectrum-4L, Flash recovery mode + 0270 Spectrum-5 in Flash Recovery Mode 0271 Spectrum-4L, RMA - 0274 Spectrum-4C, Flash recovery mode + 0274 Spectrum-6 in Flash Recovery Mode 0275 Spectrum-4C RMA 0277 Spectrum-4TOR RMA + 0278 Quantum-4 in Flash Recovery Mode + 0279 Quantum-4 RMA 0281 NPS-600 Flash Recovery 0282 ArcusE Flash recovery 0283 ArcusE RMA @@ -22132,6 +22178,7 @@ d2f2 Quantum-2 NDR (400Gbps) switch d2f4 Quantum-3 d2f6 Quantum-3CPO + d2f8 Quantum-4 15b4 CCI/TRIAD 15b5 Cimetrics Inc 15b6 Texas Memory Systems Inc @@ -23338,7 +23385,8 @@ 1108 IPQ95xx/97xx PCIe Root Port 1109 QCN62xx/92xx Wireless Network Adapter 17cc NetChip Technology, Inc - 2280 USB 2.0 + 2280 NET2280 PCI to USB 2.0 Hi-Speed Peripheral Controller + 2282 NET2282 PCI to USB 2.0 Hi-Speed Peripheral Controller 17cd Cadence Design Systems, Inc. 17cf Z-Com, Inc. 17d3 Areca Technology Corp. @@ -23925,6 +23973,7 @@ 0013 SH7757 PCIe Switch [PS] 0014 uPD720201 USB 3.0 Host Controller 0015 uPD720202 USB 3.0 Host Controller + 4c52 9a72 LRSU9A72 2-Port USB 3.0 Exchange Adapter 001a SH7758 PCIe-PCI Bridge [PPB] 001b SH7758 PCIe End-Point [PBI] 001d SH7758 PCIe Switch [PS] @@ -24087,6 +24136,8 @@ 1942 ClearSpeed Technology plc e511 Advance X620 accelerator card e521 Advance e620 accelerator card +1945 MERA + 6200 PXI/PXIe measurement module 1947 C-guys, Inc. 4743 CG200 Dual SD/SDIO Host controller device 1948 Alpha Networks Inc. @@ -24184,6 +24235,7 @@ 7010 MPC8641 PCI Host Bridge 7011 MPC8641D PCI Host Bridge 7018 MPC8610 + 81c0 LS1046A PCI Express Bridge c006 MPC8308 1a56 1201 Bigfoot Killer E2100 Gigabit Ethernet Controller # PCIe interface for emulator @@ -24773,6 +24825,7 @@ 1050 Virtio 1.0 GPU 1052 Virtio 1.0 input 1053 Virtio 1.0 socket + 1058 virtio-mem 105a Virtio file system 1110 Inter-VM shared memory 1af4 1100 QEMU Virtual Machine @@ -24797,6 +24850,7 @@ 0612 ASM1061/ASM1062 Serial ATA Controller 1849 0612 Motherboard 0622 ASM106x Serial ATA AHCI Controller + 4c52 9661 LRST9661 2-port M.2 SATA3(6Gb/s) Raid Adapter 0624 ASM106x SATA/RAID Controller 0625 106x SATA/RAID Controller 1040 ASM1040 SuperSpeed USB Host Controller @@ -24818,6 +24872,7 @@ 1187 ASM1187e 7-Port PCIe x1 Gen2 Packet Switch 118f ASM1187e 7-Port PCIe x1 Gen2 Packet Switch 1242 ASM1142 USB 3.1 Host Controller + 4c52 9a42 LRSU9A42 2-Port Type-A Exchange Adapter 1343 ASM1143 USB 3.1 Host Controller 1806 ASM1806 4-Port PCIe x2 Gen2 Packet Switch 1812 ASM1812 6-Port PCIe x4 Gen2 Packet Switch @@ -24907,10 +24962,13 @@ 1028 2113 BOSS-N1 Modular 1028 2151 BOSS-N1 Modular ET 1028 2196 ROR-N1 + 1028 2286 BOSS-N1 DC-MHS + 1028 2287 BOSS-N1 Modular 1b4b 2241 Santa Cruz NVMe Host Adapter 1b96 4000 WD_BLACK AN1500 NVMe SSD 1d49 0306 ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit 1d49 0307 ThinkSystem 7mm NVMe 2-Bay Rear RAID Enablement Kit + 4c52 9541 LRNV9541 2-port M.2 NVMe Raid Adapter 2b42 88W8997 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 5 (802.11ac) + Bluetooth® 5.3 Solution 2b43 NXP 88W9098 Wi-Fi 6 (ax) MAC #1 2b44 NXP 88W9098 Wi-Fi 6 (ax) MAC #2 @@ -24919,6 +24977,7 @@ 9123 88SE9123 PCIe SATA 6.0 Gb/s controller dc93 600e DC-6xxe series SATA 6G controller 9125 88SE9125 PCIe SATA 6.0 Gb/s controller + 4c52 9615 LRST9615 4-port SATA3(6Gb/s) Exchange Adapter 9128 88SE9128 PCIe SATA 6 Gb/s RAID controller 9130 88SE9128 PCIe SATA 6 Gb/s RAID controller with HyperDuo 1043 8438 P8P67 Deluxe Motherboard @@ -24947,6 +25006,7 @@ 1d49 0303 ThinkSystem SE350 M.2 SATA 4-Bay Data RAID Mirroring Enablement Kit 1d49 0304 ThinkSystem M.2 SATA 2-Bay RAID Enablement Kit 1d49 0305 ThinkSystem 7mm SATA 2-Bay Rear RAID Enablement Kit + 4c52 9630 LRST9630 4-port SATA3(6Gb/s) Raid Adapter 9235 88SE9235 PCIe 2.0 x2 4-port SATA 6 Gb/s Controller 9445 88SE9445 PCIe 2.0 x4 4-Port SAS/SATA 6 Gbps RAID Controller 9480 88SE9480 SAS/SATA 6Gb/s RAID controller @@ -24960,6 +25020,21 @@ # 2xHDMI and 2xHD-SDI inputs e5f4 MPEG2 and H264 Encoder-Transcoder f1c4 Dual ASI-RX/TX-CI card +1b5e STAR-Dundee Ltd. + 0001 SpaceWire PCI Mk2 + 0002 SpaceWire PCIe Mk1 + 0003 SpaceWire cPCI Mk2 + 0004 SpaceWire PXI Recorder Mk1 + 0005 SpaceWire PXI Interface Mk1 + 0006 SpaceWire PXI Interface Mk1 with RMAP Target + 0008 SpaceWire PXI Router Mk1 + 000b SpaceWire PXI Interface Mk2 + 000c SpaceWire PXI Interface Mk2 with RMAP Target + 000d SpaceWire PXI Router Mk2 + 000e SpaceWire PXI Recorder Mk2 + 0100 STAR-Ultra PCIe + 0102 STAR-Ultra Single-Lane Router + 0200 SpaceWire PCIe Mk2 1b61 Byd Precision Manufacture Co.,Ltd 1b66 DELTACAST 0007 DELTA-3G-elp-d @@ -25121,11 +25196,14 @@ 1bb1 0179 Nytro 5360S - E3.S # Nytro 5360S (Rocinante Single Port) TCG - E3.S 1bb1 0180 Nytro 5360S TCG - E3.S +# Nytro 5060H (Rocinante High Performance) non-SED + 1bb1 0181 Nytro 5060H 1bb1 01a1 Nytro XP7102 5012 FireCuda/IronWolf 510 SSD 5013 BarraCuda Q5 NVMe SSD (DRAM-less) 5016 FireCuda 520/IronWolf 525 SSD 5018 FireCuda 530 SSD + 5019 BarraCuda PCIe SSD (DRAM-less) # 2TB 5021 FireCuda 520 SSD # 1TB @@ -25315,6 +25393,7 @@ 0023 Ultrastar SN200 Series NVMe SSD 1c58 8823 Ultrastar Memory (ME200) 1c5c SK hynix + 1069 PCB01 NVMe Solid State Drive 1282 PC300 NVMe Solid State Drive 128GB 1283 PC300 NVMe Solid State Drive 256GB 1284 PC300 NVMe Solid State Drive 512GB @@ -25525,6 +25604,7 @@ 5762 FALCON, GAMMIX S41, SPECTRIX S40G NVMe SSD (DRAM-less) 5763 XPG GAMMIX S5 NVMe SSD (DRAM-less) 5766 XPG GAMMIXS1 1L, XPG GAMMIX S5, LEGEND 710 / 740, SWORDFISH NVMe SSD (DRAM-less) + 5772 LEGEND 850 LITE NVMe SSD (DRAM-less) 612a LEGEND 750 NVMe SSD (DRAM-less) 613a ATOM 50, LEGEND 840 NVMe SSD (DRAM-less) 621a LEGEND 850 NVMe SSD (DRAM-less) @@ -25565,6 +25645,7 @@ 6304 AM630 PCIe 4.0 NVMe SSD 1024GB 6a02 AM6A0 PCIe 4.0 NVMe SSD 256GB 6a03 RPETJ512MKP1QDQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) + 6a13 RPJYJ512MKN1QWQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) 6a14 RPEYJ1T24MKN2QWY PCIe 4.0 NVMe SSD 1024GB (DRAM-less) 8030 NVMe SSD Controller UH8X2X/UH7X2X series 1cc4 1122 NVMe SSD UH812a U.2 1.92TB @@ -25662,7 +25743,7 @@ 071a KX-5000/KX-6000/KX-6000G/KH-40000 PCI Express Root Port 071b KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port 071c KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port - 071d KX-5000/KX-6000/KX-6000G/KH-40000 PCI Express Root Port + 071d KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port 071e KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port 071f ZX-200 Upstream Port of PCI Express Switch 0720 ZX-200 PCIE RC6 controller @@ -25851,6 +25932,9 @@ 1024 AR-TK242 [2x10GbE Packet Capture Device] 1025 AR-TK242-FX2 [2x100GbE Gen5 Packet Capture Device] 1026 AR-TK242-FX2 [1x200GbE Gen5 Packet Capture Device] + 1027 AR-P2P-DBG [P2P Debug Function] + 1028 AR-P2P-ATR [P2P Actor Function] + 1029 AR-P2P-UTL [P2P Utility Function] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d72 Xiaomi 1d78 DERA Storage @@ -25979,6 +26063,7 @@ 1062 Lexar NM710 NVME SSD 1160 FORESEE P900 BGA NVMe SSD (DRAM-less) 1202 Lexar NM610 PRO NVME SSD (DRAM-less) + 12e4 ORCA 4836 Series eSSD 1602 Lexar NM790 NVME SSD (DRAM-less) 1d97 Lexar NM620 NVME SSD (DRAM-less) 2263 SM2263EN/SM2263XT-based OEM NVME SSD (DRAM-less) @@ -26058,6 +26143,9 @@ 1dbe 2006 Dongting-N2 DC SSD U.2 7680GB 1dbe 3001 Donghu-Z2 DC ZNS SSD U.2 4000GB 1dbe 3002 Donghu-Z2 DC ZNS SSD U.2 8000GB + 5666 NVMe SSD Controller IG5666 + 5668 NVMe SSD Controller IG5668 + 5669 NVMe SSD Controller IG5669 [Tacoma] 1dbf Guizhou Huaxintong Semiconductor Technology Co., Ltd 0401 StarDragon4800 PCI Express Root Port 1dc2 Alco Digital Devices Limited @@ -26410,6 +26498,7 @@ 1df8 d100 M.2 NVMe SSD 1df8 d201 M.2 NVMe SSD 1df8 d600 M.2 NVMe SSD +1dfa Astera Labs, Inc. 1dfc JSC NT-COM 1181 TDM 8 Port E1/T1/J1 Adapter 1e0d SambaNova Systems, Inc @@ -26595,10 +26684,12 @@ 1e3b 0069 Enterprise NVMe SSD U.2 3.20TB (R5301D) 1e3b 006c Enterprise NVMe SSD U.2 1.92TB (R5101) 1e3b 006d Enterprise NVMe SSD U.2 1.60TB (J5301) - 1e3b 00b9 Enterprise NVMe SSD U.2 QDP 25.60TB (R5300) - 1e3b 00be Enterprise NVMe SSD U.2 QDP 30.72TB (R5100) - 1e3b 00c1 Enterprise NVMe SSD U.2 QDP 25.60TB (R5300D) - 1e3b 00c4 Enterprise NVMe SSD U.2 QDP 30.72TB (R5100D) + 1e3b 00b9 Enterprise NVMe SSD U.2 ODP 25.60TB (R5301)/(J5301) + 1e3b 00be Enterprise NVMe SSD U.2 ODP 30.72TB (R5101)/(J5101) + 1e3b 00c1 Enterprise NVMe SSD U.2 ODP 25.60TB (R5301D)/(J5301D) + 1e3b 00c4 Enterprise NVMe SSD U.2 ODP 30.72TB (R5101D)/(J5101D) + 1e3b 00c7 Enterprise NVMe SSD U.2 ODP 25.60TB (J5300) + 1e3b 00c8 Enterprise NVMe SSD U.2 ODP 30.72TB (J5100) 1e3b 00c9 Enterprise NVMe SSD U.2 ODP 15.36TB (J5001) 1e3b 00ca Enterprise NVMe SSD U.2 ODP 3.84TB (J5102) 1e3b 00cb Enterprise NVMe SSD U.2 ODP 7.68TB (J5102) @@ -26609,12 +26700,16 @@ 1e3b 00dc Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM (J5001) 1e3b 00dd Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001) 1e3b 00de Enterprise NVMe SSD U.2 ODP 15.36TB with SK 16GB DRAM(J5001D) - 1e3b 00df Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM(J5001D) + 1e3b 00df Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM(J5001) 1e3b 00e7 Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001D) 1e3b 00e8 Enterprise NVMe SSD U.2 QDP 3.20TB (J5301) 1e3b 00e9 Enterprise NVMe SSD U.2 ODP 6.40TB (J5301) 1e3b 00ea Enterprise NVMe SSD U.2 QDP 3.20TB (J5301D) 1e3b 00eb Enterprise NVMe SSD U.2 ODP 6.40TB (J5301D) + 1e3b 00ec Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5101) + 1e3b 00ed Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(R5101) + 1e3b 00ee Enterprise NVMe SSD U.2 ODP 15.36B with SK 16GB DRAM(J5101) + 1e3b 00ef Enterprise NVMe SSD U.2 ODP 12.80TB with SK 16GB DRAM(J5301) 1e3b 00f0 Enterprise NVMe SSD U.2 0.40TB (X2900) 1e3b 00f1 Enterprise NVMe SSD U.2 0.80TB (X2900) 1e3b 00f2 Enterprise NVMe SSD U.2 1.60TB (X2900) @@ -26786,6 +26881,7 @@ 1001 Video Accelerator 1eb4 Quantum Nebula Microelectronics Technology Co.,Ltd. 3401 SSD Contoller +1eb6 Wuxi Stars Microsystem Technology Co., Ltd 1eb9 Senscomm Semiconductor, Inc 2020 SCM2625 Wi-Fi6 Network Adapter 1ebd EMERGETECH Company Ltd. @@ -26829,12 +26925,14 @@ 1eca Lightmatter 0000 Envise-B 1ed0 Hosin Global Electronics + 2283 Patriot P300 NVMe SSD (DRAM-less) 1ed2 FuriosaAI, Inc. 0000 Warboy 1111 RNGD 0000 1111 RNGD-S 0000 2222 RNGD VF 0000 3333 RNGD-S VF + 2222 RNGD-S 1ed3 Yeston 1ed5 Moore Threads Technology Co.,Ltd 0100 MTT S10 @@ -26918,6 +27016,7 @@ 1ef6 GrAI Matter Labs 1ef7 Shenzhen Gunnir Technology Development Co., Ltd 1efb Flexxon Pte Ltd +1eff Rebellions Inc. 1f02 Beijing Dayu Technology 1f03 Shenzhen Shichuangyi Electronics Co., Ltd 1202 MAP1202-Based NVMe SSD (DRAM-less) @@ -26947,7 +27046,27 @@ 1a01 M16104 Family Virtual Function 1f0f 0001 M16104 Family Virtual Function 2022 D1055AS PCI Express Switch Upstream Port + 3403 M18110 Family + 3404 M18110 Lx Family + 3405 M18110 Family BASE-T + 3406 M18110 Lx Family BASE-T + 3407 M18110 Family OCP + 3408 M18110 Lx Family OCP + 3409 M18110 Family BASE-T OCP + 340a M18110 Lx Family BASE-T OCP + 340b M18120 Family + 340c M18120 Lx Family + 340d M18120 Family BASE-T + 340e M18120 Lx Family BASE-T + 340f M18120 Family OCP + 3410 M18120 Lx Family OCP + 3411 M18120 Family BASE-T OCP + 3412 M18120 Lx Family BASE-T OCP + 3413 M18100 Family Virtual Function 9088 D1055AS PCI Express Switch Downstream Port +1f16 XConn Technologies +# XConn XC50256 CXL2.0/PCIe5.0 switch + c500 XC50256 1f17 Zettastone Technology 1f24 xFusion Digital Technologies Co., Ltd. 1058 EP500/EP600 NVMe SSD @@ -27148,6 +27267,25 @@ 1fe4 0077 Enterprise NVMe SSD U.2 6.40TB(HP630) 1fe4 0078 Enterprise NVMe SSD U.2 3.20TB(HP630) 1fe9 MemryX +# LinkData Technology (Tianjin) Co., LTD +1ff2 Linkdata + 10a1 NIC1160 Ethernet Controller Family + 1ff2 0c11 10GE Ethernet Adapter 1160-2X + 10a2 NIC1160 Ethernet Controller Virtual Function Family + 20a1 IOC2110 Storage Controller + 1ff2 0a11 2120-16i SATA3/SAS3 HBA Adapter + 1ff2 0a12 2120-8i SATA3/SAS3 HBA Adapter + 20a2 IOC2250 Storage Controller + 1ff2 0a21 2230-18i Tri-mode HBA Adapter + 1ff2 0a22 2230-10i Tri-mode HBA Adapter + 1ff2 0a23 2230-16i Tri-mode HBA Adapter + 1ff2 0a24 2230-8i Tri-mode HBA Adapter + 1ff2 0a28 2233-16i Tri-mode HBA Adapter + 30a2 ROC3250 Storage Controller + 1ff2 0b21 3260-18i Tri-mode RAID Adapter + 1ff2 0b22 3260-10i Tri-mode RAID Adapter + 1ff2 0b23 3260-16i Tri-mode RAID Adapter + 1ff2 0b24 3260-8i Tri-mode RAID Adapter 1ff4 DEEPX Co., Ltd. 0000 DX_M1 0001 DX_M1A @@ -27600,10 +27738,8 @@ 4c52 LR-LINK 1001 Smart Network Adapter 4c52 a008 LREG1008PT Single-port 1Gb Smart Ethernet Network Adapter - 4c52 a009 LREG1009PT Single-port 2.5Gb Smart Ethernet Network Adapter 1002 Smart Network Adapter 4c52 a006 LREG1006PT Single-port 1.2Gb Network Security Isolation Adapter - 4c52 a007 LREG1007PT Quad-port 10Gb Smart Ethernet Network Adapter 1003 Smart Network Adapter 1004 Smart Network Adapter 4c52 b010 LREG1010PF Single-port 10Gb FPGA Network Security Isolation Adapter @@ -27667,6 +27803,9 @@ 50b2 TerraTec Electronic GmbH 50ce System-on-Chip Engineering S.L. 0001 RELY-MIL-XMC-TSN-SWITCH + 0100 XMC_AV-Dual-ETH + 0101 XMC_AV-ETSN + 0102 XMC_AV-AFDX 5136 S S Technologies 5143 Qualcomm Inc 5145 Ensoniq (Old) @@ -29738,7 +29877,12 @@ 125d Ethernet Controller I226-IT 12d1 Ethernet Controller E830-CC for backplane 12d2 Ethernet Controller E830-CC for QSFP + 8086 0002 Ethernet Network Adapter E830-C-Q2 for OCP 3.0 + 8086 0004 Ethernet Network Adapter E830-CC-Q1 for OCP 3.0 12d3 Ethernet Controller E830-CC for SFP + 8086 0001 Ethernet Network Adapter E830-XXV-2 for OCP 3.0 + 8086 0003 Ethernet Network Adapter E830-XXV-2 + 8086 0004 Ethernet Network Adapter E830-XXV-4 for OCP 3.0 12d4 Ethernet Controller E830-CC for SFP-DD 12d5 Ethernet Controller E830-C for backplane 12d8 Ethernet Controller E830-C for QSFP @@ -30368,6 +30512,7 @@ 15fc Ethernet Connection (13) I219-V 15ff Ethernet Controller X710 for 10GBASE-T 1014 0000 PCIe3 4-port 10GbE Base-T Adapter + 108e 7b1f Quad Port 10GBase-T Adapter - CP 1137 0000 X710TLG GbE RJ45 PCIe NIC 1137 02c1 X710T2LG 2x10 GbE RJ45 PCIe NIC 1137 02c2 X710T4LG 4x10 GbE RJ45 PCIe NIC @@ -34334,6 +34479,7 @@ 37d9 X722 Hyper-V Virtual Function 3882 Ice Lake LPC Controller 38a4 Ice Lake SPI Controller + 38c8 Ice Lake-LP Smart Sound Technology Audio Controller 38e0 Ice Lake Management Engine Interface 3a00 82801JD/DO (ICH10 Family) 4-port SATA IDE Controller 3a02 82801JD/DO (ICH10 Family) SATA AHCI Controller @@ -34932,6 +35078,7 @@ 4641 12th Gen Core Processor Host Bridge/DRAM Registers 1028 0b10 Precision 3571 464d 12th Gen Core Processor PCI Express x4 Controller #0 + 464e Alder Lake-N Thunderbolt 4 USB Controller 464f 12th Gen Core Processor Gaussian & Neural Accelerator 1028 0b10 Precision 3571 4650 12th Gen Core Processor Host Bridge @@ -34978,8 +35125,13 @@ 4908 DG1 [Iris Xe Graphics] 4909 DG1 [Iris Xe MAX 100] 4940 4xxx Series QAT - 4942 4xxx Series QAT - 4944 4xxx Series QAT + 4941 4xxx Series QAT Virtual Function + 4942 401xx Series QAT + 4943 401xx Series QAT Virtual Function + 4944 402xx Series QAT + 4945 402xx Series QAT Virtual Function + 4946 420xx Series QAT + 4947 420xx Series QAT Virtual Function 4b00 Elkhart Lake eSPI Controller 4b23 Elkhart Lake SMBus Controller 4b24 Elkhart Lake SPI (Flash) Controller @@ -35107,6 +35259,7 @@ 51b0 Alder Lake PCI Express Root Port #9 51b1 Alder Lake PCI Express x1 Root Port #10 51bb Alder Lake-P PCH PCIe Root Port #4 + 51bd Alder Lake-P PCH PCIe Root Port #6 51bf Alder Lake PCH-P PCI Express Root Port #9 51c5 Alder Lake-P Serial IO I2C Controller #0 51c6 Alder Lake-P Serial IO I2C Controller #1 @@ -35166,7 +35319,15 @@ 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter 530d 80310 (IOP) IO Processor 5481 Alder Lake-N PCH eSPI Controller + 54a3 Alder Lake-N SMBus + 54a4 Alder Lake-N SPI (flash) Controller + 54a8 Alder Lake-N Serial IO UART Host Controller + 54b0 Alder Lake-N PCI Express Root Port #9 + 54b1 Alder Lake-N PCI Express Root Port #10 + 54b2 Alder Lake-N PCI Express Root Port #11 + 54b3 Alder Lake-N PCI Express Root Port #12 54c8 Alder Lake-N PCH High Definition Audio Controller + 54d3 Alder Lake-N SATA AHCI Controller 54e0 Alder Lake-N PCH HECI Controller 54ed Alder Lake-N PCH USB 3.2 xHCI Host Controller 54ef Alder Lake-N PCH Shared SRAM @@ -35205,7 +35366,7 @@ 56bf DG2 [Arc Graphics A580E] 56c0 ATS-M [Data Center GPU Flex 170] 56c1 ATS-M [Data Center GPU Flex 140] - 56c2 ATS-M [Data Center GPU Flex 170G] + 56c2 ATS-M [Data Center GPU Flex 170V] 5780 Thunderbolt 80/120G Bridge [Barlow Ridge Host 80G 2023] 5781 Thunderbolt 80/120G NHI [Barlow Ridge Host 80G 2023] 5782 Thunderbolt 80/120G USB Controller [Barlow Ridge Host 80G 2023] @@ -35219,9 +35380,12 @@ 579e Ethernet Connection E825-C for SFP 57a4 Thunderbolt Bridge [Barlow Ridge Hub 40G 2023] 57a5 Thunderbolt USB Controller [Barlow Ridge Hub 40G 2023] + 57ae Ethernet Controller E610 Backplane + 57af Ethernet Controller E610 SFP 57b0 Ethernet Controller E610 10GBASE T 57b1 Ethernet Controller E610 2.5GBASE T 8086 0000 Ethernet Converged Network Adapter E610 + 57b2 Ethernet Controller E610 SGMII 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5900 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers @@ -35600,6 +35764,7 @@ 7a27 Raptor Lake-S PCH Shared SRAM 7a30 Raptor Lake PCI Express Root Port #9 7a38 Raptor Lake PCI Express Root Port #1 + 7a3a Raptor Point-S PCH - PCI Express Root Port 3 7a3b Raptor Lake PCI Express Root Port #4 7a40 Raptor Lake PCI Express Root Port #17 7a44 Raptor Lake PCI Express Root Port #21 @@ -35646,7 +35811,10 @@ 8086 0094 Wi-Fi 6 AX201 160MHz 7afc Alder Lake-S PCH Serial IO I2C Controller #4 7afd Alder Lake-S PCH Serial IO I2C Controller #5 + 7d03 Meteor Lake-P Dynamic Tuning Technology 7d0b Volume Management Device NVMe RAID Controller Intel Corporation + 7d0d Meteor Lake-P Platform Monitoring Technology + 7d19 Meteor Lake IPU 7d1d Meteor Lake NPU 7d40 Meteor Lake-M [Intel Graphics] 7d41 Arrow Lake-U [Intel Graphics] @@ -35668,10 +35836,15 @@ 7e30 Meteor Lake-P Serial IO SPI Controller #1 7e40 Meteor Lake PCH CNVi WiFi 8086 0094 Wi-Fi 6E AX211 160MHz +# Refer from Intel Meteor Lake EDS (doc#640228) under its "Device IDs" section. + 7e45 Meteor Lake-P Integrated Sensor Hub 7e46 Meteor Lake-P Serial IO SPI Controller #2 + 7e4c Meteor Lake-P Gaussian & Neural-Network Accelerator 7e50 Meteor Lake-P Serial IO I2C Controller #4 7e51 Meteor Lake-P Serial IO I2C Controller #5 7e52 Meteor Lake-P Serial IO UART Controller #2 + 7e70 Meteor Lake-P CSME HECI #1 + 7e73 Meteor Lake-P Keyboard and Text (KT) Redirection 7e78 Meteor Lake-P Serial IO I2C Controller #0 7e79 Meteor Lake-P Serial IO I2C Controller #1 7e7a Meteor Lake-P Serial IO I2C Controller #2 @@ -36758,6 +36931,7 @@ a72f Raptor Lake-P Thunderbolt 4 PCI Express Root Port #2 a73e Raptor Lake-P Thunderbolt 4 NHI #0 1028 0c06 Precision 3580 + a740 Raptor Lake-S 8+12 - Host Bridge/DRAM Controller a74d Raptor Lake PCIe 4.0 Graphics Port a74f GNA Scoring Accelerator module 1028 0c06 Precision 3580 @@ -36851,6 +37025,11 @@ d156 Core Processor Semaphore and Scratchpad Registers d157 Core Processor System Control and Status Registers d158 Core Processor Miscellaneous Registers + e202 Battlemage G21 [Intel Graphics] + e20b Battlemage G21 [Intel Graphics] + e20c Battlemage G21 [Intel Graphics] + e20d Battlemage G21 [Intel Graphics] + e212 Battlemage G21 [Intel Graphics] f1a5 SSD 600P Series 8086 390a SSDPEKKW256G7 256GB f1a6 SSD DC P4101/Pro 7600p/760p/E 6100p Series @@ -36921,7 +37100,7 @@ 0119 WX1860-LC Gigabit Ethernet Controller Virtual Function 011a WX1860A1 Gigabit Ethernet Controller Virtual Function 011b WX1860AL1 Gigabit Ethernet Controller Virtual Function - 1000 Ethernet Controller RP1000 Virtual Function for 10GbE SFP+ + 1000 Ethernet Controller SP1000A Virtual Function for 10GbE SFP+ 1001 Ethernet Controller SP1000A for 10GbE SFP+ 1bd4 0084 Ethernet Controller SP1000A for 10GbE SFP+(lldp) 1bd4 0085 Ethernet Controller SP1000A for 10GBASE-T @@ -36931,7 +37110,7 @@ 8088 0000 Ethernet Network Adaptor RP1000 for 10GbE SFP+ 8088 0300 Ethernet Network Adaptor RP1000-A03 for 10GbE SFP+ 8088 0400 Ethernet Network Adaptor RP1000-A04 for 10GbE SFP+ - 2000 Ethernet Controller RP2000 Virtual Function for 10GbE SFP+ + 2000 Ethernet Controller WX1820AL Virtual Function for 10GbE SFP+ 2001 Ethernet Controller WX1820AL for 10GbE SFP+ 8088 2000 Ethernet Network Adaptor RP2000 for 10GbE SFP+ 8088 2300 Ethernet Network Adaptor RP2000-A03 for 10GbE SFP+ @@ -36943,7 +37122,17 @@ 8384 SigmaTel 8401 TRENDware International Inc. 8510 Sietium Semiconductor Co., Ltd. - 0201 GenBu02 [GB2062-PCIe-C0] + 0201 GenBu02 Series GPU + 8510 0001 GB2062-PUB-LPDDR + 8510 0002 GB2062-PCIe-C0 + 8510 0003 GB2062-PCIe-C41 + 8510 0004 GB2062-PCIe-HIEILP4 + 8510 0005 CQ2040-PCIe-C21 + 8510 0007 GB2062-PCIe-C40 + 8510 0008 CQ2040-MXM-M60 + 8510 0009 GB2062-PCIe-C20 + 8510 000c CQ2040-PUB + 8510 0201 GB2062-PUB-DDR # nee ScaleMP 8686 SAP 1010 vSMP Foundation controller [vSMP CTL] @@ -37316,6 +37505,9 @@ 103c 1101 Smart Array P416ie-m SR G10 105b 1211 HBA 8238-16i 105b 1321 HBA 8242-24i + 1137 02f8 24G TriMode M1 RAID 4GB FBWC 32D + 1137 02f9 24G TriMode M1 RAID 4GB FBWC 16D + 1137 02fa 24G TriMode M1 HBA 16D 13fe 8312 SKY-9200 MIC-8312BridgeB 152d 8a22 QS-8204-8i 152d 8a23 QS-8238-16i From nobody Tue Sep 3 07:09:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WycF00Jd3z5W541; Tue, 03 Sep 2024 07:09: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 4WycDz5p6wz4WWH; Tue, 3 Sep 2024 07:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N79sJfzSxNGw6kRIzbefNc3ottZ+xyajsU1hRqDzPck=; b=V1Zu5JZL1NlCvHe4FJhVS9QYuo2EAkEmYpgwA8ZkbQqQWyK6yuqItXIOMAFYlgWcY7R92B PgnkOLIFeJ0GtwZH+41e2DCgTyq9Xd373ys5bGBx1neqhQrYzOmpQUP2BBtmaIJLTfFM1J SuAG+VbHfAtpCssz+oMYDxHB/yGOlr2JA0i1BaySIMcolOqKPZG21rSVhr7k6+Yaw8rHGI nksk9KCcvOYiL2G8wU/xaj4wQC+oQzjk4mM97MEO9Uzkzi9UhJX0EYfyO1iSilr8VP6Gfu Tyq/T7yulzTJ/fiBhQGEqcRx69jrX9DgGB4oMd0G34jdzfCUUGyNQR32eN5Ztg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725347363; a=rsa-sha256; cv=none; b=uYiXxAVaEqFoO+Br66VnMRwTf5ZaS5pz3RMy6N+4XslyHWH6XQ3V9cb+blh9ACq9Wfs4w1 QnUCmqLNcRuCy24ZhSowClZ4ohbNgdr1fDSaBwEhXsTCGyjP23IcTD9AuHQptDy2y0c/Y0 EQA9GlbLw+qhxWtSivkGy/YjoUyEzHwxrrCu5jcj0f01HsXrZQHOPFehORQglCaP6qPj6/ VkhrPYo9UXgsKkKJm8OwO4LO815P86Wzf4WOpzIW4e3uK3p43w3zhO8Arxjfd2lcAXZfRX JwPvpNilTKkg/LRpqEj+hA52l78hK3pe/BCCDBtnqhvIKYSBxOOA50lmaRZXjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725347363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N79sJfzSxNGw6kRIzbefNc3ottZ+xyajsU1hRqDzPck=; b=jwFUBjGUXExl8r/zY942a2wJrbyB1ZUC1X/jtUU0hZBBtuXnCcctrsmIS1C4SOyzWwYGVJ TeqQJLL1dAHNZQfvOJp/3/ixTwaOBDUR7zIq9IjKfEixv6E71HVaTPYeli0xzC+ek9/ja8 twz6kKt7lOt322x/9x1u1YSaLdUnqeZlFmHtfLUtW703eidsWcxSsP/qylNCBzCHs42dCy zqct8+CABz8nO1SFxPGE1iuRVCFHkusd7ut43JmYjDemAVKpbVbgwq3ZacoU+z6yvfCCpB OPexjIgEXN4Tw1JF6mMFRybDJIgtiLUTVSr5Qt1sS8BpVrlcbbAkiJtGeEpGyA== 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 4WycDz575bzX3K; Tue, 3 Sep 2024 07:09: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 48379N9i069627; Tue, 3 Sep 2024 07:09:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48379N9D069624; Tue, 3 Sep 2024 07:09:23 GMT (envelope-from git) Date: Tue, 3 Sep 2024 07:09:23 GMT Message-Id: <202409030709.48379N9D069624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 9a3dee859da4 - stable/14 - usb_vendors: update to 2024.07.04 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a3dee859da41669020654274b80b2d6aac7091c Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9a3dee859da41669020654274b80b2d6aac7091c commit 9a3dee859da41669020654274b80b2d6aac7091c Author: Baptiste Daroussin AuthorDate: 2024-08-19 16:11:41 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-03 07:06:56 +0000 usb_vendors: update to 2024.07.04 (cherry picked from commit 3cd90cb66d96b7604b8c5fde6f061e68eddbfc82) --- share/misc/usb_vendors | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/share/misc/usb_vendors b/share/misc/usb_vendors index a1e3ea4acd1d..41b367d1a0d6 100644 --- a/share/misc/usb_vendors +++ b/share/misc/usb_vendors @@ -9,8 +9,8 @@ # The latest version can be obtained from # http://www.linux-usb.org/usb.ids # -# Version: 2024.03.18 -# Date: 2024-03-18 20:34:02 +# Version: 2024.07.04 +# Date: 2024-07-04 20:34:02 # # Vendors, devices and interfaces. Please keep sorted. @@ -2400,6 +2400,7 @@ 02e3 Xbox One Elite Controller 02e6 Xbox Wireless Adapter for Windows 02ea Xbox One Controller + 02f3 Xbox One Chatpad 02fd Xbox One S Controller [Bluetooth] 02fe Xbox Wireless Adapter for Windows 0306 Surface Pro 7 SD Card Reader @@ -4992,7 +4993,7 @@ 0a28 INDI AV-IN Device 1301 Network Controller 1302 i3 Gateway - 1303 3 Micro Module + 1303 i3 Micro Module 1304 i3 Module 1305 i3 Multi Sensing Module 04c1 U.S. Robotics (3Com) @@ -6433,6 +6434,7 @@ 2060 PT-E550W P-touch Label Printer 2061 PT-P700 P-touch Label Printer 2064 PT-P700 P-touch Label Printer RemovableDisk + 2065 PT-P750W P-Touch Label Writer 2074 PT-D600 P-touch Label Printer 209b QL-800 Label Printer 209c QL-810W Label Printer @@ -7439,6 +7441,7 @@ 03dd PTH-460 [Intuos Pro BT (S)] tablet 03ec DTH134 [DTH134] touchscreen 03ed DTC121 [DTC121] touchscreen + 03f0 DTH135 [Movink 13] 0400 PenPartner 4x5 4001 TPC4001 4004 TPC4004 @@ -9049,6 +9052,7 @@ 0752 micros Reader 0760 USB 2.0 Card Reader/Writer 0761 Genesys Mass Storage Device + 0769 SPR2801S [Lightspeeur 2801] 0780 USBFS DFU Adapter 07a0 Pen Flash 0880 Wasp (SL-6612) @@ -10898,7 +10902,7 @@ 0056 Agfa AP1100 Photo Printer 005d Mobile Mass Storage 005f Laser Pro LL [MFPrinter] - 0062 XG-76NA 802.11bg + 0062 XG-76NA / XG-760N 802.11b/g Wireless adapter 0078 Laser Pro Monochrome MFP 079d Alfadata Computer Corp. 0201 GamePort Adapter @@ -11169,6 +11173,7 @@ 1228 MPEG-2 Capture Device (M038) 1830 AVerTV Volar Video Capture (H830) 1871 TD310 DVB-T/T2/C dongle + 2553 Live Gamer Ultra 2.1 3835 AVerTV Volar Green HD (A835B) 850a AverTV Volar Black HD (A850) 850b AverTV Red HD+ (A850T) @@ -11180,6 +11185,7 @@ b300 A300 DVB-T TV receiver b800 MR800 FM Radio c039 DVD EZMaker 7 + d553 Live Gamer Ultra Pro-RGB e880 MPEG-2 Capture Device (E880) e882 MPEG-2 Capture Device (E882) 07cb Kingmax Technology, Inc. @@ -12286,7 +12292,7 @@ 0a0b WLU5053 802.11abgn Wireless Module [Broadcom BCM43236B] 0a13 AX88179 Gigabit Ethernet [Toshiba] 0b05 PX1220E-1G25 External hard drive - 0b09 PX1396E-3T01 External hard drive + 0b09 PX139xE 3.5 External HDD 0b1a STOR.E ALU 2S 1300 Wireless Broadband (CDMA EV-DO) SM-Bus Minicard Status Port 1301 Wireless Broadband (CDMA EV-DO) Minicard Status Port @@ -12420,6 +12426,7 @@ 010f nanoKONTROL studio controller 0117 nanoKONTROL2 MIDI Controller 012f SQ-1 + 0154 NTS-1 digital kit mkII 0203 KRONOS 0f03 K-Series K61P MIDI studio controller 0945 Pasco Scientific @@ -13004,6 +13011,7 @@ 5803 BCM5880 Secure Applications Processor with secure keyboard 5804 BCM5880 Secure Applications Processor with fingerprint swipe sensor 5832 BCM5880 Secure Applications Processor Smartcard reader + 5843 BCM58200 ControlVault 3 (FingerPrint sensor + Contacted SmartCard) 6300 Pirelli Remote NDIS Device 6410 BCM20703A1 Bluetooth 4.1 + LE bd11 BCM4320 802.11bg Wireless Adapter @@ -13020,11 +13028,14 @@ 0009 LP2844 Printer 0027 ZTC LP2844-Z-200dpi 0050 P120i / WM120i + 0062 GK420d Label Printer + 0065 ZM400 Label Printer 0080 GK420d Label Printer 0081 GK420t Label Printer 0084 GX420d Desktop Label Printer 008b HC100 wristbands Printer 008c ZP 450 Printer + 00a1 TLP2824 Plus 00d1 GC420d Label Printer 0110 ZD500 Desktop Label Printer 011c ZD410 Direct Thermal Label Printer @@ -13035,6 +13046,7 @@ 0010 MPMan MP-F40 MP3 Player 0a66 ClearCube Technology 0a67 Medeli Electronics Co., Ltd + ffff LCS Audio 0a68 Comaide Corp. 0a69 Chroma ate, Inc. 0a6b Green House Co., Ltd @@ -13246,10 +13258,11 @@ 0ac9 Micro Solutions, Inc. 0000 Backpack CD-ReWriter 0001 BACKPACK 2 Cable - 0010 BACKPACK + 0010 BACKPACK CD Drive 0011 Backpack 40GB Hard Drive 0110 BACKPACK 0111 BackPack + 10ff BACKPACK 1234 BACKPACK 0aca OPEN Networks Ltd 1060 OPEN NT1 Plus II @@ -13308,7 +13321,7 @@ 3102 MemoryStick Card Reader 3201 MMC/SD+MemoryStick Card Reader 3216 HS Card Reader - 3260 7-in-1 Card Reader + 3260 ND3260 7-in-1 Card Reader 5010 ND5010 Card Reader 0af0 Option 5000 UMTS Card @@ -13382,6 +13395,7 @@ 17a0 Xonar U3 sound card 17a1 Eee Note EA800 (mass storage mode) 17ab USB-N13 802.11n Network Adapter (rev. B1) [Realtek RTL8192CU] + 17b5 Broadcom BCM20702A0 Bluetooth 17ba N10 Nano 802.11n Network Adapter [Realtek RTL8192CU] 17c2 ROG Spitfire 17c7 WL-330NUL From nobody Tue Sep 3 10:26:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcg4NQxz5MkL9; Tue, 03 Sep 2024 10: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 4Wyhcg3t3Dz4rlr; Tue, 3 Sep 2024 10:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2F5EywPFcMd4t3CyuZfHUbw2TAvQwyflDGlDk0AAn7I=; b=UOcDPdbZVyZd1DbJunTJZoI6d1WMCmxbQhqZ14HVDqjVFVo+cmbDxsH8eGEoz7bgcGVEOQ F+jVMmd7zf8L+KiTt7FiB4202rYjjVdDXkx2OqsTvlKKsrTDppUBimEYhnhvSt0aGO4C6i h3W4Lbgthqrlm2ZvxzN/JODGSqGvr2gCrXfZ8v+/m5ZE8zCKURvA+dMrqPOfzErPzivCX9 7EVyvaeGFxb//kX3TymipWju3MYK+q+p5dVldB5XisAkgO8uwkvXxcg6WHXr70aVV8RTmp GvD6HCRxc5IcZ01b7H6Xh507wR7Hy6jmsrYl9K/blMRCB+Amsm1sCHJAwICClg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359203; a=rsa-sha256; cv=none; b=ZvhrtBy67T/Kt07+c87tqzxm8ZHqANkHY3SEKEnr5s+9Ho0byQLLDllAxgeBWTzIdfc2SP 6PVyPuTkX8J2iWJZdx9+oKDhfNL55F8afbN90B61vVxyKFhM/gqOSAf33G6T6mUEcDSUwb bFPCu2v7H2321UP+OqclD81CzDdxUQRgPKC86hcH6JELpG3oomjw3sF68BpwlqP7a/NmyS oeyVjuarNYoZsGE8g0ARPmV2KIGmTCzwvvYmXVdwIfUamYbt/1vaIcuDpn4CxLohLggfDk 47FcTlEO99wLPKtqEfN3STd0gC7001FIQeCHCttr3fZT2CvKEMfmSyocTNtmag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2F5EywPFcMd4t3CyuZfHUbw2TAvQwyflDGlDk0AAn7I=; b=pVPca0iNWcv37JFvJhGn/bjNV8vOF6O8/ix12MskCKDkDor5i+81DVrA72gD4InxMzQvq8 +n0iB9iqcEKsFY2fCCTWDgz0NFXH9KHSH9XPVDD7xTVIaMSUH+qcHDKc+rgZmeIhvG5PWp g1P1gt0I0DZMRnK3U+noEhZi/L0vAU/1AYW9DEWFX7+rnPg3hoPgG2EK76agZc+5ywS7DV PgNn7WDtisZyE8ib/TtgPXwzkvWi+6zSHz13wx6wv827viw9JzHmmldbP4dfaUVAf8BDMX DzbCBrCJJrYdw4ji0YwaiLBDcTre8TTJg48O3hkRFT16x6aHyQKZYRHgQnezGg== 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 4Wyhcg3TnTzcJs; Tue, 3 Sep 2024 10:26: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 483AQhrt008713; Tue, 3 Sep 2024 10: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 483AQhUJ008710; Tue, 3 Sep 2024 10:26:43 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:43 GMT Message-Id: <202409031026.483AQhUJ008710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 6a2a385507c7 - main - kern_fail: Stop checking for failures from fp_malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a2a385507c79abaa9db9eabfdd827362f3dc7ed Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6a2a385507c79abaa9db9eabfdd827362f3dc7ed commit 6a2a385507c79abaa9db9eabfdd827362f3dc7ed Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:16 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:16 +0000 kern_fail: Stop checking for failures from fp_malloc(M_WAITOK) `fp_malloc` is defined as a macro that redirects to `malloc`. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/kern/kern_fail.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_fail.c b/sys/kern/kern_fail.c index 883b664aef0d..258268bb874f 100644 --- a/sys/kern/kern_fail.c +++ b/sys/kern/kern_fail.c @@ -479,11 +479,10 @@ fail_point_init(struct fail_point *fp, const char *fmt, ...) /* Allocate the name and fill it in. */ name = fp_malloc(n + 1, M_WAITOK); - if (name != NULL) { - va_start(ap, fmt); - vsnprintf(name, n + 1, fmt, ap); - va_end(ap); - } + va_start(ap, fmt); + vsnprintf(name, n + 1, fmt, ap); + va_end(ap); + fp->fp_name = name; fp->fp_location = ""; fp->fp_flags |= FAIL_POINT_DYNAMIC_NAME; From nobody Tue Sep 3 10:26:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhch5PZ2z5MkJS; Tue, 03 Sep 2024 10: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 4Wyhch4kqhz4rrL; Tue, 3 Sep 2024 10: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=1725359204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WzycGuoTX+NaoyQSW/ys9kO/J251hQi6BQMEUQjX+mg=; b=Ivayvj0Vn6VJ+5/WxB9HbBxXMWaF9YbEVm9chYq92KPQafw/+GzXNn7mRLMe/q3cXFUx3D CE9vW992knnqbZQ9SbB0/SlmfolItdKZ7nv95tAjMPlv7g0VB5HTeJPWvGGwI8xEaXuD/a I46tjSMqn+LF2nStEW+iHuDCTGYhjkMXAxKbDNgHGCpuHLeK4Qb4Qa/+z1Jldm1Pc126/S iNAXxihVqUSusiCLXPBu94jL0pl6FTwyxj8ef8zrubt2KXFmJ8lfxdldCTmodfCOQUMbjB pY8D7bu8PjKHqtULTt7hCV4CGwUh19k2EfxuEtpkIAA0U8N18i93wvAFPgaHuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359204; a=rsa-sha256; cv=none; b=mH37DcFsl3Ed8pT2EzagCIB7XQCOqM7BTjGAiZbrmTSscn2h1QwRWaCdsxALfViEy69pIe HEzHeqANo+WYvWPNpcTq7KIER9zedH0FXmiMbmVMD6hrmk1Am7gu0aimvFdKZl8dis2enn NT1DfyN5l+X+vtXkjYyD9ocBLX/IUQhLJ85LVJs6tlQukOnTvFsM7tjlzZVLQoijTgM8d+ S6GAL8tilkqdg1P9JcTQk+d5BzhKtW4hVrsIC9ei5t9L0nzhwutNmLfd8SEccCVK+Ka18Q sEGEYNP/BxWjGKNDqiu8UaK8A77cui9Boe3AqzC8UYxQ/f2XwIbVmUcAJKzldQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WzycGuoTX+NaoyQSW/ys9kO/J251hQi6BQMEUQjX+mg=; b=Y1ZWUuLTj2Xp/AhXO/c3/8NnPIUZnpssSH/mv9oks2COpgXZat9uoi5nDdYEz9xRSghsAw bMl01NYfTcD5aWLHsxAokFhNBCfNKuc4lSR4HgIFbO3R17MTfEFXC376gYgneLEuzvX5Ss fVSiU+dWsGkc/AxdiDnLwfQAxG4WNrROS1rCC5z+z6kEOArDRtCkV6T7TGupBPw6SgT3Gl iVZJtoyyJqBzxjhSZkKNrEvpgn7FZ46ITC1kME8u6sxwBeYoujuIKYHQAjGlWZ9z2oDyRz cm4eAb6KTWR/8+mmEblgDJvNjBIvdiZh2bTxymeMoVe9c6TmAZPwlp84ZZKS8g== 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 4Wyhch49DpzcnB; Tue, 3 Sep 2024 10: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 483AQi2l008761; Tue, 3 Sep 2024 10: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 483AQiC5008758; Tue, 3 Sep 2024 10:26:44 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:44 GMT Message-Id: <202409031026.483AQiC5008758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f444db950e87 - main - boottrace: Stop checking for failures from realloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f444db950e877596805aed897c3fbb975be28711 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f444db950e877596805aed897c3fbb975be28711 commit f444db950e877596805aed897c3fbb975be28711 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:17 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:17 +0000 boottrace: Stop checking for failures from realloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/kern/kern_boottrace.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/kern/kern_boottrace.c b/sys/kern/kern_boottrace.c index 1b097e7378ad..5516f3160587 100644 --- a/sys/kern/kern_boottrace.c +++ b/sys/kern/kern_boottrace.c @@ -561,9 +561,6 @@ boottrace_resize(u_int newsize) } rt.table = realloc(rt.table, newsize * sizeof(struct bt_event), M_BOOTTRACE, M_WAITOK | M_ZERO); - if (rt.table == NULL) - return (ENOMEM); - rt.size = newsize; boottrace_reset("boottrace_resize"); return (0); From nobody Tue Sep 3 10:26:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhck04VNz5MkT4; Tue, 03 Sep 2024 10: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 4Wyhcj5Jhtz4rrh; Tue, 3 Sep 2024 10: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=1725359205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWhRh3IHIhR9EJIB1bNvgdBV1Fbs755RpaxrVFmEIWc=; b=wC33yW1OX5k3e2BSx15zfac7he9ZAWkRcJ8DS12YqOU86SwxXmgIK1ND3y/DMKKfLk3NBV 3Nk5HcPZMfbRCT5Df4c44tCbK8Q4TFh9rmfOOUceLIWI1i1I0iAGyGExPArtBHuW6lcpn5 qT9UdoZEoU9Vp4V9T7YT7DkbuG7VghYXHElWyffVBW1RZYi7k6M+xcx+q1FMo/CVzQscEQ RTrkw3m4bu8iaGnppzQ74Nptg4NUm8HDfKNneJnIKDM2rjJ7jTDuAyT9HuKFNfRuxQx/tt WBr3W959IBltTwu9k9vZ4qLG3dHGkHV7mi3iH4yt9f9wWgP7lESyaR4giew5Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359205; a=rsa-sha256; cv=none; b=EoNkbl8i6ldT5NrINn5ZyyW02//cl6jZ2OKgB7H2LYWDOca4k84BS6t8t51n/AE7doMFKk d3UY9JHtuXevEVFrfsB4QIQ3HC0JM0n8Sf2/dZpL6kuldE05XLQ5YSux/+Cx19VaHs1zGC nmGU8TxaGnRV5AIAd7JWVnkT7nL/yYXU/VICkq1Asaf09Fh/ZrD6NDxA6gjLsiJshVzKPM vdRcyDGhqkYaumXrolHQj2zUmt8Nj8ZehYjZFFkk7jWyKVKS5OdHdRh86RvrfCvhfJcBTw va173okwJEb9CsD7KQZ2js3aztkWf6cxRqteZSdhdZowtv2TF+TbIo0eym5lCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWhRh3IHIhR9EJIB1bNvgdBV1Fbs755RpaxrVFmEIWc=; b=rvfLAOIMKUgOieuxBRxHoaDex3DR4c134gKvW2SbMHRQgoxS9lHk3isBR75fiASvY2stLT jmRQtE1brNYUe5xy0CgWB9n1yWix031rOvbpXTw9ud+uFMK58y8z04hbVIyiLux2comLxh GZg6jC+GLDdbk+C+LiGLzRuiDYvNW6/683KYUNMf18GqS+6ZgXRo94/QKa8r3TlHkwWRsz AOIxpMjxCYGrmUiKFJGF2dRnNv2lveo49i+Rnv6tdYOfLHkmr9S1KjQWO2TCd59/TYCMRm PokdXRjQyBtuh8o2ZUEogltlIdAo1y0wzecjwzPvyhTORatCA+H2CXkeOuc47w== 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 4Wyhcj4vYGzcxk; Tue, 3 Sep 2024 10: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 483AQjI6008809; Tue, 3 Sep 2024 10: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 483AQjCF008806; Tue, 3 Sep 2024 10:26:45 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:45 GMT Message-Id: <202409031026.483AQjCF008806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 99e3bb555cb1 - main - subr_bus: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99e3bb555cb1ef5572de54be0ffed2aa6fc080cd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=99e3bb555cb1ef5572de54be0ffed2aa6fc080cd commit 99e3bb555cb1ef5572de54be0ffed2aa6fc080cd Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:17 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:17 +0000 subr_bus: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/kern/subr_bus.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 71d04e483d4d..7fe46995ee54 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -5422,8 +5422,6 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) * Populate the return item, careful not to overflow the buffer. */ udev = malloc(sizeof(*udev), M_BUS, M_WAITOK | M_ZERO); - if (udev == NULL) - return (ENOMEM); udev->dv_handle = (uintptr_t)dev; udev->dv_parent = (uintptr_t)dev->parent; udev->dv_devflags = dev->devflags; From nobody Tue Sep 3 10:26:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhck6nTlz5MkJT; Tue, 03 Sep 2024 10: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 4Wyhck67btz4rkX; Tue, 3 Sep 2024 10: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=1725359206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZKBNWY4sA/RHucHULsNjttc3Tt4PyrIDZrkhwHbl6ZM=; b=SFRxudQJFCFGA3vQse5wlSgRe4KuP4unyzgVVtP8BPoZx9IMfA5GXCnekj91T/kKyfFZ7i pW56W5lXlzKuyxHhAvh3lkASlJxWkB9+Iz2TGJLmIOfbHEE4y9DQDY72r9uPEAL7LVZ8F2 unsT4vLxNplPPtTkxjwINTWeb9K0OhehwiqcZpLa2w53esA3z9f2fEwv77PIC4Xd21ILfV YIRnq1rM9SRtMmv7RMXOL7kzYvEDEROJO5/CcUwrrRIDfeu4JI9c5+47tmETzpYgDEsl80 WRe43gMRxUU1VRQ20keUaEwdYV89bxnpQ2SNYFF4hD36UD0aM9vgbk/y83rv9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359206; a=rsa-sha256; cv=none; b=NsAuB+vS1Me9JzssBPlXKLPQoqTD3Zn7kPqSj4w1y62Gm+lxsF3kdu9Fn/5fgRbSKiA8d2 tTA0qruYPhFg4/RY5wIwm+jJch7mNBMmi4uIPxNPzC3yUZXKNBZFxd7QL02IRb7aL65dk3 3AfPa0neib74003pz/TlrT4jPvClHuxAQOicPUIRsItpzqxFQyRM9NVCfZMFg6DcW0tQAG fU3Ok7KwDvKEk7oX4jl9EDEJPORUviH1d7lVKn6A1DtA5r53VpDm9/IqblL1thDma6DkcJ WvsDS/gzcomj1ksPdewPFIKmvqLg0Q9Oeafk1el9icAsPUauWW0EPB27H9tRKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZKBNWY4sA/RHucHULsNjttc3Tt4PyrIDZrkhwHbl6ZM=; b=Y7k+6Cjf6qIv5+MrejCykm53bcN/kxJsaMf+DE2JOnOOAxNIJzSzqH1l2rF8rsX3/AMe23 llGIiKyuwriMtT37bB0NTt/jOcaqgX4pIYrE8jxACaJXyjR490FnxkNMhVp9uWaXzl+pzu FdoW11CpckrOGCBZunvZ3hGwkEor//7xeWgKXhBmWSpxJdKx4efTxrhg7pm4pCDezsTvrT eKnRjpTAFFzUQZXQpRtHVyxHi5jkP4LXD1sRkeuegs3r+kg/y2zijS3aA3+rK9oDN1Vgtf bgGM7HFmnAss5vIM7aV5wWwPBz7kWuQxn8p0Qaf+ea6vR89W8Ul/ZRTPdgJcgQ== 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 4Wyhck5lmGzcnC; Tue, 3 Sep 2024 10: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 483AQkqo008857; Tue, 3 Sep 2024 10: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 483AQkq1008854; Tue, 3 Sep 2024 10:26:46 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:46 GMT Message-Id: <202409031026.483AQkq1008854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 8e6dd4185871 - main - ctl: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e6dd4185871cd9b785869178ab2191a0d6c0b53 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8e6dd4185871cd9b785869178ab2191a0d6c0b53 commit 8e6dd4185871cd9b785869178ab2191a0d6c0b53 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:18 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:18 +0000 ctl: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/cam/ctl/ctl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 845cffe77a5d..82420396aca1 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -2687,12 +2687,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, } entries = malloc(ooa_hdr->alloc_len, M_CTL, M_WAITOK | M_ZERO); - if (entries == NULL) { - printf("%s: could not allocate %d bytes for OOA " - "dump\n", __func__, ooa_hdr->alloc_len); - retval = ENOMEM; - break; - } mtx_lock(&softc->ctl_lock); if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && From nobody Tue Sep 3 10:26:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcm5B90z5MkW8; Tue, 03 Sep 2024 10:26: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 4Wyhcm07Bhz4rpW; Tue, 3 Sep 2024 10:26:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SnvByBTQI9/2d8bQkLMCKOPXCa2nnZnkOoJcBYwmTr8=; b=J7RFlx4wy/9g7C5p3WfNFwr//cX7xoHM9B2+zLKnPngNaO01sEzK9L+XNaqYsO5z4PczoQ B8yZLJgiG4kd3x55F3PNvgerx84sGgWFF/B+VfUyvcaJS5EWQ5gdwP6wD0qPc8HpxNzw+7 j1zD2E0vv+O8g0k9AAyFN31Mj6CMiwyV4O9L/pwAbO/aTfVfrRJrXMw44mhb76N6T32CcB rUv5khj/o42K43o7psiY6ODInx/9815tD6LioPjXPvED/J8aqWG+POigxoFabsgbF/COYP a/zMaOXNiK7OTkDXTab2ST3VaZVk56Zgr2w75dZREtblmL6/+BizGKnDqdsXjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359208; a=rsa-sha256; cv=none; b=chNKogM2NDbct7PlsuAuoUhZeuc5ZGK12Xn87uGOESqH212JcftKk64JzDl7B7v/hMmpZD /UAqzG8kNZozhp4Iu9bQOzRthur79faiABsEmWgmGKHOSDYv1Dm/G3Smbjm7vyxfDeC7gK R7vi07FjoSfizpLYfblxhdTw0Kgz88ax4Zou0qmBgGdhWRKDFwd8QBZHXfhxhJi3KRq8LZ gVwkKovzeHR8M1mm5XHlQZh/AbpcWJogJqmiOYMW51Csr21HB0bKSjQ3LfFzCJfSQ2sowU WxAlZHZIQKyWjE87l7v4npQp7K5Qa/dScVtd2VMW111Ab+Pydeu7tKDm10i+UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SnvByBTQI9/2d8bQkLMCKOPXCa2nnZnkOoJcBYwmTr8=; b=LlYjzf7TgqQyXYNjUeLF3fIU3rBr1du7NzIcMSW0BmFegaGbH6QflnrdgNgzd+sNJB/CsO wuek8TeQIGHc8Lg+4VTiv7D+rOhepvDzP2o7WJ/jGiwk3B4YIh6Ulx7QNwzQx2aIiCWWJ1 xNe1OxjFAgZOcwEQr7PXdqHsmAY0/eUVgbeMCbmq2aPncK0Q1N4odG94DT2JBZk90DZbQA 59tqDmzWVYPqDI2hFNp/PjHSE+KgDJ12l2d+roDkoBWLZGa0u0EevENDBYdT3Z6gE6Uv6p FMrV3JiHrUE9l+BnDfgYWJgpLpCCrBmsgd+Oxro0EKPEydgbzzPZVQdlpB+ukQ== 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 4Wyhcl6mmBzcsq; Tue, 3 Sep 2024 10:26: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 483AQlYF008909; Tue, 3 Sep 2024 10:26:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQlYm008906; Tue, 3 Sep 2024 10:26:47 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:47 GMT Message-Id: <202409031026.483AQlYm008906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3feb35dc465a - main - udf: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3feb35dc465a8247d70e50792680c230954ef1c1 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3feb35dc465a8247d70e50792680c230954ef1c1 commit 3feb35dc465a8247d70e50792680c230954ef1c1 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:18 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:18 +0000 udf: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/fs/udf/udf_vnops.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index f230ca0c72fa..98a779280690 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -800,8 +800,6 @@ udf_readdir(struct vop_readdir_args *a) */ ncookies = uio->uio_resid / 8; cookies = malloc(sizeof(*cookies) * ncookies, M_TEMP, M_WAITOK); - if (cookies == NULL) - return (ENOMEM); uiodir.ncookies = ncookies; uiodir.cookies = cookies; uiodir.acookies = 0; From nobody Tue Sep 3 10:26:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcn51jxz5MkLH; Tue, 03 Sep 2024 10:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhcn14Qyz4rds; Tue, 3 Sep 2024 10:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2+PrYPFYhE89ZGoWrTRH3XeVhPSxj9Ndt+NuzW6kf08=; b=mNH6VvvKmOoum9HaQvlkTF0hms1bOHiKIDCqomheMKbRnew4yeYMOYqs6nq+A5j3CxXULW Z9S5AyserFa29csYhVZVDAaMFvInEiHbS8tqE/IrtV/nhl7BJRolRsH6sUX4O1JoEWOeRc U0AzC5CZf5QXGGIbskGUH/TdqkkCsX9Jd/80c0uQzjJXweZ3yARgCEFYfrDl7ipD0KclRR LB0m7Jb9wtwlMisEMqryOa3sAFNWYgSEBn34KHi/aqZad+WPkN69EX3PeRSAxzusqIzoqO nxTufA8UZCt/HjQkqZa8KZvVXdfzJeSqsPnW3m36al/XRhzTh8kWMTfDHgoc4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359209; a=rsa-sha256; cv=none; b=qtc2LT2JFIda1o53fjQxJs1LXLEzjyECYHFCVzRIdqbMvfnAstwCpglt1/aYZXrxrdCn+9 8WLgJYojIle56b3ax1TDDOSk7l9tMcL12de33ORuO3Y38vveo2oEtD1Py6a8on/qEuP7iL 2U4RkSvDhyNGiy2ZHqBVrx6bSkQzLrKkBebpyNCrPwxXq7r8TjXl0QptHh14Gl5KlWk3N7 mo5hEAeUZ80nIxlbrDqRvf1IOkJVt/Ih++g+TlfA5S2rBHjU3eDZ6bRTYj4gqCYppKLxko DeK1dhBOLA73P3EI9IVZVWA1nP2MbeYTPgPTJ9+SOtb34fxTrl8QAUrKNStRPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2+PrYPFYhE89ZGoWrTRH3XeVhPSxj9Ndt+NuzW6kf08=; b=LZtw2cgytf1lL90VVaCcQ/BWPpiFJgaWajYCIZoU+whPJPatOoIh2j34Mp7pMmyxeC1ipJ zWNWGGyOpH5knLd6OhxhGZdFHTKVD437gl4H2gqYGWVntlqq0Wn/Mo4/khDbU1/bDIVVn7 uw/A2S4cwV8Ic2VbOLmJUwVTtwdoyPwbuPkKd11NEMINgjd26ud6tDXzkjKKBqdIrWErRw hq2WIrx4LwBbvlhyJTUIKWZDtKL7NVqmoQqkjMvRSan0dc5u5YGVngZ1u8WHQ0ZdhcqpnK JzX5V/eQnsGl9K6Mc4BiR0rrw28UR2gYRqV0I+FQ4HMR+T9H7SELVxJ5I2KxxQ== 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 4Wyhcn0g0VzcJt; Tue, 3 Sep 2024 10:26:49 +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 483AQmdr008964; Tue, 3 Sep 2024 10:26:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQmB0008961; Tue, 3 Sep 2024 10:26:48 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:48 GMT Message-Id: <202409031026.483AQmB0008961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 2a119886630b - main - altq: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a119886630bb5fe8283e20db5acb7c0cdba31c3 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2a119886630bb5fe8283e20db5acb7c0cdba31c3 commit 2a119886630bb5fe8283e20db5acb7c0cdba31c3 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:19 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:19 +0000 altq: Stop checking for failures from malloc(M_WAITOK) While here, prefer malloc(M_ZERO) over bzero(). MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/net/altq/altq_subr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index 3ade724818dd..534841289611 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -1327,12 +1327,7 @@ acc_add_filter(classifier, filter, class, phandle) return (EINVAL); #endif - afp = malloc(sizeof(struct acc_filter), - M_DEVBUF, M_WAITOK); - if (afp == NULL) - return (ENOMEM); - bzero(afp, sizeof(struct acc_filter)); - + afp = malloc(sizeof(*afp), M_DEVBUF, M_WAITOK | M_ZERO); afp->f_filter = *filter; afp->f_class = class; From nobody Tue Sep 3 10:26:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcp4mggz5MkWF; Tue, 03 Sep 2024 10:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhcp29gzz4rpv; Tue, 3 Sep 2024 10:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0zpUAu+ymUwSwvLxTkFzfrUKGJgEZ1kSEfnWQG6BvRk=; b=CqCQ+L1H8lvs+IuQW0e3bXeO5h9G1UA3KTzkfxIs92CJKXGbK2PkPb8I7RVehmhfFeLPfo 8S4KPuR+lOo0g9EI1h2rd6IYuHrXl5MNYgErtbmnU0adwy73SS1naUHFsqP4m69fHNIoUp djiC/iuxPMNZlFSlACn702/sM8Pif6J7696GsE6RgcjZpF1t7kvqXYMNqt3UbSkXaK5wBL I+aybnaXmqf9x8BdbefYk7lf0ItW5YJYaHcpA1Nvmhv7SEUR5v9FgKeNE88gkYJ/fb0cA8 Z0s8MXdyT28bMaDWrl4w4/CzIv75SGDIR/e738+gMdNs+VNyaISHuhP2NNtSRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359210; a=rsa-sha256; cv=none; b=NUKFDm6hqZwURnPe9bi2BZTIK8iTtNv5bO79vfvkpIqvB5fbf4nD9tsN2CLFDMKBHLbEtr 2J824sDNvwdRnaQ3YOaz0i+CsoyLG88ICRvCBsxSD52qf8dZwTqAIo5mEnUpcqVpXZb7aR oiqoTpx9yv99eNj+hA6U2ZuvlY+K4XO+tKwyhA9SsWZwl/TQuePeouMY46uuuovWFSRC/w YVgkwrQ71RB4mmaGN0HDmzX3gCnanCfuYFTA0H42w+9olvPJnaGtpWR60LMbqmi1/Zx6vV zfe+l8ADDr/FPqZhWT/nKCcDgxJhAWnDvRusAmG06t/lPlexHSPQt28mSzm6iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0zpUAu+ymUwSwvLxTkFzfrUKGJgEZ1kSEfnWQG6BvRk=; b=emBwxy5IvlZHzI4UiDUqC+9TOLuWOeeNrwkKHTlidfrTTQQaacT4rZQ3gpYZY9+ydwC9Ez WopGn6EYLezAJ0kbjxDEs8KAHLpEbmB9EA3zjhevNHXm7y1atG6TupS+aMo6ACXroF8SKE VcNc9F/qazRYSl1N6GkXHLybIG4h+yggQvaHJOXkT2503Az/VWegNf0ocPHkuPzlLp9yNL /TM8On7txgCHX4zydbiabrmifdZMnl3h5m060mJN15ZqWyNaO4aR/D1VuKce2KeyzzIzVg iivLYKHBcemvV4sWjuXO9C9d9jGQX2cfFqnqHSWBLznCMgMw3jKOHTsqgwMtrw== 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 4Wyhcp1gPhzcxl; Tue, 3 Sep 2024 10:26:50 +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 483AQoMc009012; Tue, 3 Sep 2024 10:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQoVE009009; Tue, 3 Sep 2024 10:26:50 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:50 GMT Message-Id: <202409031026.483AQoVE009009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 07b16b1e2aea - main - if_vlan: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07b16b1e2aeab0b30f68a013de31a4c322a61246 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=07b16b1e2aeab0b30f68a013de31a4c322a61246 commit 07b16b1e2aeab0b30f68a013de31a4c322a61246 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:19 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:19 +0000 if_vlan: Stop checking for failures from malloc(M_WAITOK) Fixes: b08d611de835 fix vlan locking to permit sx acquisition in ioctl calls MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/net/if_vlan.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index a30db9173383..774298d4a53a 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -509,11 +509,6 @@ vlan_growhash(struct ifvlantrunk *trunk, int howmuch) return; hash2 = malloc(sizeof(struct ifvlanhead) * n2, M_VLAN, M_WAITOK); - if (hash2 == NULL) { - printf("%s: out of memory -- hash size not changed\n", - __func__); - return; /* We can live with the old hash table */ - } for (j = 0; j < n2; j++) CK_SLIST_INIT(&hash2[j]); for (i = 0; i < n; i++) From nobody Tue Sep 3 10:26:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcq6wvWz5MkLP; Tue, 03 Sep 2024 10:26: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 4Wyhcq36TCz4rhH; Tue, 3 Sep 2024 10:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9uCwRm4T9EyDLb3h0uteOIx6RYCnAEKW+UdnAAs3ts=; b=pG0RfAspWc/sZbQmZBwByhutExCJcK42gNCoMjErPTKMA21Ydn5fY4/wDOH7np0cRXjh5m 6cyTdmgzwDJ2SHUvkU432nj5FRXLwB+irZvl++Z8sDHH8CdrPRd0G2txGg4TrHt+jUFEjl H+UAMODsX3pOTIljV+19kvcNeBFVVDOncjZuKiFR95JAAS6zaMR30zCA2xpjGNECmYx0Dz akHxvTdzrVr07GNBWYlVUyg8RyG355oj5NsWh+FSjgcqQjc0C0c/wRLEQTYLPGwJpufbGr PMZDI//boFRfsYE5IIAc2I+d1j7ODtjuivPKhG5jNgmOm5/XFgBcwnJ9zuilWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359211; a=rsa-sha256; cv=none; b=w6XNanf+lD3JQbAFpNQ2DN7C2+PsCuuvVMzot/6EpOzZ+gXV8skjX7uMX3QrNBGqJoBa4P FSADIvlz9BYH06cnb39eqazB2OUu76965PG2WoGGUt6w6hnsRp0mz53892tf1kfsKF94JL YiKVNodaae2dUiu9AFazjqwA5nQgnP7pitj9RFJrd5LkpxyZqrpHgAmfLkXUUnrj2H72WW TVOGu+azbANCFIDdATHW9z8ZnxZ+xxfiByzr1FimEh1IpxGK3p3Pvm1dAUnt+zXZNkRbNI GBgdz2zqgvDWLVl06CbMeXvcoWatW/fzCuRECPcGlkmy1m+5417Xh3mkecftqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9uCwRm4T9EyDLb3h0uteOIx6RYCnAEKW+UdnAAs3ts=; b=u+ikqIvFwQmD+x/GC0e3hGtAKYIlryKGKQ4YnMJrUWzpVRCUjUTzrfe9o5Pf67YaRkfcqe LaJLtE4Pqp3Gj073b1p3iNYcfc4a/sz3Xpb1oRCHwCGLHVAXzf3GC2nbtIfkNi9Wd83097 ppsFTbX4YerBLQ9ZRzXpmy1l4iUnm4TR6t+9shr5k9xDEeBBg3XhemSRIm5lQG4DM1JS5e pmmNx5Syuc1CqTzgEXla4XCFYOIkzP18H56pwO4kYalS4rD29KoJnuZlgcS5Ogo2Sx24+L RotbF2NdrwLKIoeP+HWprwgyMlWGYm5Cxpi6Mf8Ygz/qahZGA+n0NFkXJN+lRw== 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 4Wyhcq2W11zcLD; Tue, 3 Sep 2024 10:26: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 483AQpW4009060; Tue, 3 Sep 2024 10:26:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQpDs009057; Tue, 3 Sep 2024 10:26:51 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:51 GMT Message-Id: <202409031026.483AQpDs009057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 5b00557330b3 - main - pf: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b00557330b3b69db84969e33f2e201288208dd9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5b00557330b3b69db84969e33f2e201288208dd9 commit 5b00557330b3b69db84969e33f2e201288208dd9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:20 +0000 pf: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/netpfil/pf/pf_ioctl.c | 32 -------------------------------- sys/netpfil/pf/pf_syncookies.c | 3 --- 2 files changed, 35 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index d22ffc2245cb..64086bf08871 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2823,9 +2823,6 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td /* Copy the request in */ packed = malloc(nv->len, M_NVLIST, M_WAITOK); - if (packed == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, packed, nv->len); if (error) ERROUT(error); @@ -2903,9 +2900,6 @@ DIOCGETETHRULES_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -3003,9 +2997,6 @@ DIOCGETETHRULE_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -3036,8 +3027,6 @@ DIOCGETETHRULE_error: } rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK); - if (rule == NULL) - ERROUT(ENOMEM); rule->timestamp = NULL; error = pf_nveth_rule_to_keth_rule(nvl, rule); @@ -3136,9 +3125,6 @@ DIOCADDETHRULE_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -3214,9 +3200,6 @@ DIOCGETETHRULESETS_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -3409,9 +3392,6 @@ DIOCADDRULENV_error: /* Copy the request in */ nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6003,9 +5983,6 @@ pf_keepcounters(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6131,9 +6108,6 @@ pf_killstates_nv(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6192,9 +6166,6 @@ pf_clearstates_nv(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6253,9 +6224,6 @@ pf_getstate(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index c5ee64c6aed0..538ab1dfd94c 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -201,9 +201,6 @@ pf_set_syncookies(struct pfioc_nv *nv) return (ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - return (ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); From nobody Tue Sep 3 10:26:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcr75Zsz5MkT7; Tue, 03 Sep 2024 10:26: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 4Wyhcr41Ssz4rqR; Tue, 3 Sep 2024 10:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h70JcTIDxO1yrZdSbpc7bhFs7iDj0ceT0X7ow9mKUUY=; b=jTmMZ3Qfm+C80fDJeevVDGdGiTRSsywOERuNv0BPbqFDMoJC9T7XBFuJv0OZiBlSuHi2UB R60RqKe2Z6wjuUosBqDhso3PMuaLqoDvk7u7B41cVeRhc0zD/HsMFbhwLRK9gL6SpFjg5B NCHmhJ681fTDmm1jhkqp1rWtD1zvkNLeFwSsOMRzOObD8aFjJGauLrj57QV8ZThIGoWPAN LXBGj58/+zhqY5GUW77GAxkBnbBI8Z5KaBo03hJkx5HAHSyrRxYO7AgOpaRjADK/ORHqmc imijbENjHEH2ryIXIupKdkXH2pOIzfNZ4F+mV1ehDPrk0LhfBBevWeELj0pjEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359212; a=rsa-sha256; cv=none; b=D5PqNebOyzmcMrdhJzjRUYKBE21ipJIxycucaDVuQCxRW8UDTCO2uvo74GDfKCcK7IYduP 0sE68HgeSp1pB2RyfZCLoI4OA7DyAuaPbrs9q1RzdfMDcv4POsB1zL21EpvuCj1+a8Xon8 M9PCKM3JrHKJDr1bNYMjqQNy12aCqhTtAslERrioaGJ1t9125wZuAxilb9Wj/NgcAaX1HL CQ0vCrSublbebqSwKaUPx/JxM1w5fHPGRNdkm/S14fsIOmvC6ArjhFuplAlcTjxZtaZIfL C+/JpdsPDy1QsilU4ZmS/ilUPZc47gJZJcs4a3BzaCoAFkYTGjoBjYCfam9OGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h70JcTIDxO1yrZdSbpc7bhFs7iDj0ceT0X7ow9mKUUY=; b=c0LJINP/6+HrnR9QdXnyXl9xpVHp9L/kLShrnPav60pvBYVnW85kHbTCtMicn5JoCwBj7P 6DN5lHM4P1pSVygT9Km0EYXRhU2I6s1iV+vvn1whvWW46vLZ6ohTA+kjp29EX7Q0zTfL8t FWiOK4AmLV7RCtrKZ5SbR/EJvOL0ErAo+SEZajo+zHQOF0TdIPcxucstsLZIG6tcXOdjV7 sPK6s8OQEXKEqrnYL5+xQTqEzhZXK/QN5TLMdAvs0ekd2jkJgEsiwc1xVAFZTLFBb/t3Ef h6uB5J+zjFaXRJ3esF91W7Rgxblt2FWjKWZcXqBAWuTNZ0XKSkImaf33RpHKPw== 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 4Wyhcr3d17zcxm; Tue, 3 Sep 2024 10:26: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 483AQqcU009109; Tue, 3 Sep 2024 10:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQqWY009106; Tue, 3 Sep 2024 10:26:52 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:52 GMT Message-Id: <202409031026.483AQqWY009106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 6e50988cf822 - main - netsmb: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e50988cf822f87a524b8da2fdc35b234078cc2f Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6e50988cf822f87a524b8da2fdc35b234078cc2f commit 6e50988cf822f87a524b8da2fdc35b234078cc2f Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:20 +0000 netsmb: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/netsmb/smb_rq.c | 4 ---- sys/netsmb/smb_subr.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c index a33598489aa1..b2642f1aaa6d 100644 --- a/sys/netsmb/smb_rq.c +++ b/sys/netsmb/smb_rq.c @@ -64,8 +64,6 @@ smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred, int error; rqp = malloc(sizeof(*rqp), M_SMBRQ, M_WAITOK); - if (rqp == NULL) - return ENOMEM; error = smb_rq_init(rqp, layer, cmd, scred); rqp->sr_flags |= SMBR_ALLOCED; if (error) { @@ -376,8 +374,6 @@ smb_t2_alloc(struct smb_connobj *layer, u_short setup, struct smb_cred *scred, int error; t2p = malloc(sizeof(*t2p), M_SMBRQ, M_WAITOK); - if (t2p == NULL) - return ENOMEM; error = smb_t2_init(t2p, layer, setup, scred); t2p->t2_flags |= SMBT2_ALLOCED; if (error) { diff --git a/sys/netsmb/smb_subr.c b/sys/netsmb/smb_subr.c index fbb951a37cef..68469cf5cc35 100644 --- a/sys/netsmb/smb_subr.c +++ b/sys/netsmb/smb_subr.c @@ -149,8 +149,6 @@ smb_memdup(const void *umem, int len) if (len > 8 * 1024) return NULL; p = malloc(len, M_SMBSTR, M_WAITOK); - if (p == NULL) - return NULL; bcopy(umem, p, len); return p; } From nobody Tue Sep 3 10:26:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcv1vYQz5MkLc; Tue, 03 Sep 2024 10:26: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 4Wyhct6RL1z4rys; Tue, 3 Sep 2024 10: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=1725359214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KovJX751ir8Agnl2AB4hfK3sJw2pC86gINKMyV5DjiE=; b=r+0fxYyGpPOhbbZBiqUPUDb5KHXQ1t1joqEYkO3FY/GyV3q0NviNSw0k3R3V/suT/fCqqD Bcd6i3Khbg39Hf/tTn6Klx8YvxrQ2Ar7rmR3XyHu2BZM6EJWd9aHxPXApTM0jEOd6ym1l8 HGNN/dRtZq/MMCpOl7WGPUztJ8OiDA5N/uN6jEp/NxlUmeXOGdo9tLjtVMIGDwqJIEkZy0 C1K5nwNpoRBhV3umlPyPQrHp90PSHHKK7zxov9N4xwpq42WF042OXzUxZgyJ2D8+AiiR7X xIZWVhiQhp+Ua61Gweg7GI1yb3aU8MTqlh8kBp4aM6Y57VWezh/r9xVb3ad28A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359214; a=rsa-sha256; cv=none; b=RYEV3qISgRm3Jz4rgC6NOC+D7V//Ir8KCD+msaEpRyQWJz6absBU0HMRQ1p6odkNMr9Dis nd7NNq83tJB7mqo0B28md1oLYqxjAU95BiKcbPLtDA+QRgM40bFRx0vZaBKgB+fPLQAxZP vdMVZCiL55CxhbUHC1dNvmJXV3MeHB6Fs/ey1fQluD3derslVkRi3cH7xm4At7vWNyAyNJ 1RTjtPtJneYtuJ1+f5Oaytpm8SdGkzh4UdxUyc2E9y0iRWxlU4DWkedqoSDPzCheXREBTD jfHVVstp3MdNUtAS8iqweYbHLNy72za5dd0tlEf37PatihMBgkmUwPOyKBi+EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KovJX751ir8Agnl2AB4hfK3sJw2pC86gINKMyV5DjiE=; b=vta01l18GObNynlCTAPwtlYqex4kL+GqnNMJRL4d77AZzj+aeMpRXcE7U/DFL1raDl7m01 xkxnS++LyJBDaTVh1VMxE87i8qBuvAht8R5l80lPM4nw8M3NnR4kQ1ZJyBkJ4gLaxptHWR FaCLA/fuawsX2q4b5RbC9wmIuqiGAmw5vF1HIofLn2/GiK/ttDHo0NtBhfW+UTPzNBdeyu F4JAd37VTWeXrmkFYpZ+xR0wWqFm1grqZOtx+NYefatKKXO1sEdOz7j7/zXqEd0HxcciQv OVuMIUYasDJYc8VhJY3AnsKmrK0ddPN08s9XVkhMUgAa8+pgdMOGqoDyG8UD7Q== 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 4Wyhct5gmyzcFc; Tue, 3 Sep 2024 10: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 483AQsdb009220; Tue, 3 Sep 2024 10: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 483AQsha009217; Tue, 3 Sep 2024 10:26:54 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:54 GMT Message-Id: <202409031026.483AQsha009217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 7bcb1228558b - main - LinuxKPI: 802.11: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bcb1228558b4325fab39616e2e3b2573a9e7da6 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7bcb1228558b4325fab39616e2e3b2573a9e7da6 commit 7bcb1228558b4325fab39616e2e3b2573a9e7da6 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:21 +0000 LinuxKPI: 802.11: Stop checking for failures from malloc(M_WAITOK) As a consequence lkpi_ieee80211_ifalloc() now does not fail. Remove unneeded NULL check. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/compat/linuxkpi/common/src/linux_80211.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b46e56133725..a2791d20a727 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4401,8 +4401,6 @@ lkpi_ieee80211_ifalloc(void) struct ieee80211com *ic; ic = malloc(sizeof(*ic), M_LKPI80211, M_WAITOK | M_ZERO); - if (ic == NULL) - return (NULL); /* Setting these happens later when we have device information. */ ic->ic_softc = NULL; @@ -4454,10 +4452,6 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) /* BSD Specific. */ lhw->ic = lkpi_ieee80211_ifalloc(); - if (lhw->ic == NULL) { - ieee80211_free_hw(hw); - return (NULL); - } IMPROVE(); From nobody Tue Sep 3 10:26:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhct1Q0pz5MkWL; Tue, 03 Sep 2024 10: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 4Wyhcs5XjJz4rqh; Tue, 3 Sep 2024 10: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=1725359213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3h4g3PxTwSchPhU7Zv5h4bjo8PbqKTPBrxfYcGLUwE=; b=B/zm+NVxP+WPertStdIKq/UDnDs8T0PUs84M7h4QOBzYqSM0KOVg4j71cQHILayZbwl+FX BrZAqQA2mTjY16KImqrxMH1UP0im06mvuU+Y9P0X3JjO22w+oLj9C+H8cCN/795r9zebrz btR2mcV0kWDbl/9KNfLYwD95jBX3MvX7hMiN/ZURreATzDjVpKeYcm6CMTL+pIiCIGvisg Dfg6Io5wdXM/gApv2Un8dVtmMY1Ho91scO7gs2umYnTQITnnufs9ruywLqbckZja4s4rGz GTY0Ym1xlgUYnPVAyFLxawxX2qQenauxqxcE40d1wxrQel85qTPOwDq9Fks4yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359213; a=rsa-sha256; cv=none; b=VivaYjI/oWa3X4jAlnIYHlE4pjdbWIYrzhmZWlXeAbmmo7s+as/oVCeMpUT+dCDJQ1ynH3 yShcOWdZINcbMbbIFNIRBl4xBlhfHZYmr9mtm4U/jB3vBirRq0wbOCvvPD3hyjhDXfXd3O nfqNvJ85QssOzkyk8kgPvOBTSX/WLCVNgluRVhDeHl6ti4FqeaKPnc5j6JbzPFskKLU9Br xuLTi09wy1TbPYslgmebU1Kqe+LsPYFppYpCg6VZihKeByQs7rHVgzsJ6jplEkSvDSyFLM DWyI/5Tp8G8Yz1eP31hm0+8EvPsaoBoAfOKushK7I4lcfqZrU30L1IDePqZiyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3h4g3PxTwSchPhU7Zv5h4bjo8PbqKTPBrxfYcGLUwE=; b=lZfvkDdkp26OUMqp2MPpbKN5TS5kqVF62a1PdMW2SntZ8PEC2tOIHsptnIeekolqB42og6 1yYFdiqrssq8FhsjZpDvxYubnDRemHyCu6dRzBp+ZebkezBS8XCknItoIF6SkvVU93pTWK 6vLQuk7/mYEmkzetisfhcegjMTxYzpjjiPHEIRALXx9dZr9ltchnA97uoAbxWpF3Oajhf1 VHohtSRf21rYZeFi/QBOteDEyWEyKMEp1JMnjjCNr2AzUcWLu00qwBkobuf9u/tm8xwpYv 5rlVP/moFxtnhJ1yOoWX4SF+s6kECpR//Xt+Vf0gwm+air8W0FbgPQ99s+Jk/g== 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 4Wyhcs4fmhzcxn; Tue, 3 Sep 2024 10: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 483AQrlo009163; Tue, 3 Sep 2024 10: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 483AQr23009160; Tue, 3 Sep 2024 10:26:53 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:53 GMT Message-Id: <202409031026.483AQr23009160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 7a720bf67d73 - main - xdr: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a720bf67d73ba565a0a1130065f798870eb5faa Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7a720bf67d73ba565a0a1130065f798870eb5faa commit 7a720bf67d73ba565a0a1130065f798870eb5faa Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:20 +0000 xdr: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/xdr/xdr_sizeof.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/xdr/xdr_sizeof.c b/sys/xdr/xdr_sizeof.c index 6b4ee0352c9e..bcacf918f4fd 100644 --- a/sys/xdr/xdr_sizeof.c +++ b/sys/xdr/xdr_sizeof.c @@ -94,10 +94,7 @@ x_inline(XDR *xdrs, u_int len) /* Free the earlier space and allocate new area */ if (xdrs->x_private) free(xdrs->x_private, M_RPC); - if ((xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK)) == NULL) { - xdrs->x_base = 0; - return (NULL); - } + xdrs->x_private = malloc(len, M_RPC, M_WAITOK); xdrs->x_base = (caddr_t)(uintptr_t) len; xdrs->x_handy += len; return ((int32_t *) xdrs->x_private); From nobody Tue Sep 3 10:26:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcw3zxLz5MkQn; Tue, 03 Sep 2024 10:26: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 4Wyhcv6h7qz4s1t; Tue, 3 Sep 2024 10:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkLF24+DwR6EfaNjO9keDKhQzjvtnxIhBqNCDbvwpbk=; b=sCcj9OKCb/vMYFazrIyUe7w/nBRrK+CdCIUySwUhoCrs0J1nhGDM0hiedO2yqPebKxcmDy lC/CgQAsQTmzBc4FxyZo+NBysIlwrhJc8cQRUckLAyskhMAgwNIble4Ree8SLxW1kcKmAl MZlMPnjdZ4MblSRgCV6jAjgQVRXhBrsMoS5RPeA/U8M2xq37jiBM+FanRmraSGPKjRXDgJ 9Sfsz7+6FOFk2FcErTVvyyjX48SUYrv0+RodYL9FUAxmRFeeJIMdUyVBOJ2Oe7rIh0LCRx xGlDla5jlnFCpHYXkYMMF2peBHbtKhVT2rORTX3XWAI6NJpQtMWsPNO3/huzKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359215; a=rsa-sha256; cv=none; b=tH3BICPddn86dOuG/u5cTFKDBULxfFuVWAt5En+VlIEARxJvaou16mWnVDHq3d4FGUkL+C BomcbFkublDwJJCwYWSXg2mKfeg4JLCi8GpECKYEY3NTHMwzrKN1n5QZ9lgot0W+IFEqMg RQTgcGLFfcTrmxDgggLPaJjB8+2DF3uDw6mH2UR8eg53T/jPAWkfOzu07LITRUtwC5vWle dPBTdml4aXgonM4RnU7IiavuiFoJJlAICxiVdFcJaRfrNg+3v48UpAWYDI9VxMroRb3qBo r58PMnFT2ddyt7hG0WwBElzACH7V2L+AhrhvvaxgBnTO1X/RjayHlmBSbvjkVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkLF24+DwR6EfaNjO9keDKhQzjvtnxIhBqNCDbvwpbk=; b=Zai09Puge7+z6i/fHtZDeFxake1MwL1VNNL9r+4GONWr5wjA07EX3mZ1ToRB0gXRfUWoeQ pb2yNN+Sxu82qvsHfOzwOWpa4k0955VxFAIwsRURoswqBxc8S4aGEfRVjxUGhSlcduqcKQ 0ZcoVCCgquQyuts706VKXtxq8nTKwNYLli6C07CNmeM/n7+i3O4ctH4SpD5PBcmKnMbQ+5 qWTMpdDdOwpeyFw0r85kW2rnYfRNcMBumkh0BSI0ALMdZ8v0pB92Y45ZAQbnCsRlhz1nO5 0yb//UDik3jQC5vgfTygOfoJ8Ca3vcVM/q/2Hj3rs2ztZvF/N9aoHA4kITIMvg== 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 4Wyhcv6JXbzcLF; Tue, 3 Sep 2024 10:26: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 483AQtk7009268; Tue, 3 Sep 2024 10:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQtJd009265; Tue, 3 Sep 2024 10:26:55 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:55 GMT Message-Id: <202409031026.483AQtJd009265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 66c35a6675ff - main - krping: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66c35a6675ff987b52a2018871231658b1980a6c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=66c35a6675ff987b52a2018871231658b1980a6c commit 66c35a6675ff987b52a2018871231658b1980a6c Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:21 +0000 krping: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/contrib/rdma/krping/krping_dev.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/contrib/rdma/krping/krping_dev.c b/sys/contrib/rdma/krping/krping_dev.c index eea3c772ea4f..59aa19672443 100644 --- a/sys/contrib/rdma/krping/krping_dev.c +++ b/sys/contrib/rdma/krping/krping_dev.c @@ -174,12 +174,7 @@ krping_write(struct cdev *dev, struct uio *uio, int ioflag) char *cp; krping_t *krpingmsg; - krpingmsg = malloc(sizeof *krpingmsg, M_DEVBUF, M_WAITOK|M_ZERO); - if (!krpingmsg) { - uprintf("Could not malloc mem!\n"); - return ENOMEM; - } - + krpingmsg = malloc(sizeof *krpingmsg, M_DEVBUF, M_WAITOK | M_ZERO); cp = krpingmsg->msg; while (uio->uio_resid) { amt = MIN(uio->uio_resid, remain); From nobody Tue Sep 3 10:26:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcx2Q97z5MkNJ; Tue, 03 Sep 2024 10:26: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 4Wyhcx0YbFz4s0P; Tue, 3 Sep 2024 10:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRYcuNCh3MACQZVpbyN2lvsQ46OzBS4zm198iIiOKV4=; b=COhKEhOTUqeBO2X2rFB+p0EbqsOzHpwrq5fa1K+Cu2PbBUzuoar+BlJdIiTZvi8uaNUeFx DUBfoVLevTXReg8C3FSaqiN+QT5Grx88a/0zmCZ1zU/lUG785egJWkvCNluY6GvJ2ckbCY fQUwqHEJo/hsjGsQHDuToHKM5wwpC9R+AmYoLtpg0lhFhpFb4RLS+27YGRBU99jk0AkSse LWzdvbm5zY/cCTnmO0Ymn6dbWIHW4/KHzqFD3bRGFXTfFKYlRbFOAmEiGfkmag/KiJKB1i m4i/qNo22rNh20aWE74aNCitHX8AjFHpyJikEuAK7KviZHUNz9MN2SBUIVJeCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359217; a=rsa-sha256; cv=none; b=jL3SGeH1+WBS7aRGSnPqER3u2xW6CpSZkcFnQa5/nNAO3QW772lmpwjrGVUe4IhDcJ2EpF w4LZsnszwfn+jFx79by1mR5KVftcaUeLQN5l322E14qnvWBxd5nPKLmZW0x7z1grl8AW9G n7jo9KyeC30J8z/jiZO9Dc/dklTKyKylmvh6qbtsdDfDtZDB2VENKbskL3xeO6A+Q9BEiP i3Wh0ZVvutMDLGzrioZord2gTFLu1tvnJyU+UeFFyq/ILg1w5OlWLtGURrgt+U56U7aRHF rzclT4a9CM9GTD/1H5U0y6XUHTaWg3c06QZ3Q9ka8rynIz9Cj8QiZPFzWxUtYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRYcuNCh3MACQZVpbyN2lvsQ46OzBS4zm198iIiOKV4=; b=Sa0TgObNKhBJY2viwTfva9PSl7KTtSAnmZBab3iySDwbEdBgVW5e7UvkE3c3QNOBQxTIos E5n2NWgvL7ofix42+f31lSJw9ca1lB2TgJqHoFBATfrY/IsoKXXJR5oEvAL0tKlqMDk0uW dKXNIadYv02MvHR5LgIp1Pj3eDNmqt87GJ3J2Z1LPjuyjksqF6T+KDqJEquM01G9wYnNl8 H8YeS/lOJDR8xQ6EVPL1Avt0gLbHj4CdCazUyvbb3YEacdhU4YybSTvYSraUFoFfUV8lF0 2xrIuy2WTZv8b0TsoSrs7ZNZSq7HlY9hhrZk4laTfoiqkTRa4RHX758lTCD6tA== 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 4Wyhcx0B7szcVP; Tue, 3 Sep 2024 10:26: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 483AQuvn009316; Tue, 3 Sep 2024 10:26:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQuRF009313; Tue, 3 Sep 2024 10:26:56 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:56 GMT Message-Id: <202409031026.483AQuRF009313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: aac6c41d4ba9 - main - tests: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aac6c41d4ba9b0a1aef561f6c4bfd284ab369ebf Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=aac6c41d4ba9b0a1aef561f6c4bfd284ab369ebf commit aac6c41d4ba9b0a1aef561f6c4bfd284ab369ebf Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:21 +0000 tests: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/tests/framework/kern_testfrwk.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/tests/framework/kern_testfrwk.c b/sys/tests/framework/kern_testfrwk.c index 19691f1febfc..949300290b9d 100644 --- a/sys/tests/framework/kern_testfrwk.c +++ b/sys/tests/framework/kern_testfrwk.c @@ -192,10 +192,6 @@ kerntest_execute(SYSCTL_HANDLER_ARGS) } /* Grab some memory */ kte = malloc(sizeof(struct kern_test_entry), M_KTFRWK, M_WAITOK); - if (kte == NULL) { - error = ENOMEM; - goto out; - } KTFRWK_LOCK(); TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) { if (strcmp(li->name, kt.name) == 0) { @@ -244,10 +240,6 @@ kern_testframework_register(const char *name, kerntfunc func) return (E2BIG); } te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK); - if (te == NULL) { - error = ENOMEM; - goto out; - } KTFRWK_LOCK(); /* First does it already exist? */ TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) { From nobody Tue Sep 3 10:26:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcy47Gkz5MkQq; Tue, 03 Sep 2024 10:26: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 4Wyhcy1JWkz4s6j; Tue, 3 Sep 2024 10:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7wxfPr0BcKNbQ7aFxiekFpCzDqzM43XFcnliugXvXrg=; b=x/6geADeQDpqrQQH8DfMObykDwk0IUCcUcxhvvw6EqQ3ejtlnqj68R7LiWJaijbz/dOlAl Fx7gs6qA3VDwugiKfPf59UCFUHruL3XEk0nGsz0be/M/ZnVHu2MPJz4h7evKrly+sYdIrR R9sGLL+RywbyxULhLVjzpv4Qymro+oqP0ql0aKpIRw41ydYbSF34Uies8k71wqcpoiU4H6 E/DF5RRPeNdLkUkpMYYhTqctTGRrrk4vvT9izJ3D6s6bAPRwhrp0QGUP8vitE6j2QkRex0 LbIdJZquuYP4Ypy+0cTwZq3PUPRPtWSWsncU/LNAr8BTLJOPXAaydVPSjowbCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359218; a=rsa-sha256; cv=none; b=kdUzDqM0VVYHhYo12AbuWGBbnf62dQW3IRPminEFQrDm5M9C/042v4xOLZlp8rsIz5V6oG xGOEc/fNxXGBUb9cNkpFPZoDCK6ydTEEibuvbzHIFb0lndvv1BCPmFxS0YGReZcB+Z4I6s 2crXTXp88EOsuJfQ8jf3AhpglR0BPRlibIPm7yksSJ5vMWSH8IeXchTXbsEac4hCDwSNYi c/TR7YxrKu0GBBlRHlDAD+X5vriync3Cvt4qApBGUgkVIz+rPYKXIyey4RRlFjWyeaVcnw onZ184YqPjHzFvUWw0BBYXnrZROv7kfZoSH6HvQl3J+e870YFlj2FETCf7hOtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7wxfPr0BcKNbQ7aFxiekFpCzDqzM43XFcnliugXvXrg=; b=dZchhSNEseLZNRRsQThXUhUgPgILyzGZNHBkZ6gA2lPVVG0ZOD36nKfIsmqlTjTqsYzXhW TgQujCGPtqRwCOHTpDBEeM1j8ScYtbvkqPpuG6JGxN+7lMwHKt2JZEpb0p99X62qXGJNcc xfX2Zu0ebEeFPR02crsuQmj/3v0azmOrZ3RUeFOsKUX46Kz8PPlhhKLk/+Ohv9h3NMXNKu H5d5N+kWCWKX4rNdeLPV0ufFCrhnBuhUic457DZ9tMa8PsrHdhcN+dks7nOcQvH70JCpNi lApuB2aztJ+IRC4it5FxMIb9TQHSq5BZVTcoSaZuoVmhbS11CLFfD4tR1WxXjA== 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 4Wyhcy0vwszcxp; Tue, 3 Sep 2024 10:26: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 483AQw1b009367; Tue, 3 Sep 2024 10:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQwYC009364; Tue, 3 Sep 2024 10:26:58 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:58 GMT Message-Id: <202409031026.483AQwYC009364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: fe6985ef87e1 - main - arm ti: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe6985ef87e1aedf8e5c9b3b959c7dd54a03e2fe Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fe6985ef87e1aedf8e5c9b3b959c7dd54a03e2fe commit fe6985ef87e1aedf8e5c9b3b959c7dd54a03e2fe Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:22 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:22 +0000 arm ti: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/arm/ti/ti_pruss.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/arm/ti/ti_pruss.c b/sys/arm/ti/ti_pruss.c index 85d075419fe8..b7a04f2cfb42 100644 --- a/sys/arm/ti/ti_pruss.c +++ b/sys/arm/ti/ti_pruss.c @@ -184,9 +184,6 @@ ti_pruss_irq_open(struct cdev *dev, int oflags, int devtype, struct thread *td) sc = dev->si_drv1; irqs = malloc(sizeof(struct ctl), M_DEVBUF, M_WAITOK); - if (!irqs) - return (ENOMEM); - irqs->cnt = sc->tstamps.ctl.cnt; irqs->idx = sc->tstamps.ctl.idx; From nobody Tue Sep 3 10:26:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhcz5VSpz5MkYY; Tue, 03 Sep 2024 10:26: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 4Wyhcz2pDHz4s5K; Tue, 3 Sep 2024 10:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sPkUsLLelb1WbRu1JKBEMLAOiMvIc9ms3zuw+GhXwY8=; b=jMuMbd49tZ6YIgceVvWgNzsCZEKu81RpCzRsFyB+LtoaVU+EpWrHkYv0nE7XEmQ+thjG5f HhBrFB5/ePrXSZvVX1uy99cCZgyW0OrEbND5o/i7CF3P2C9NNCGMuIt1nnLxbBNxH/5Ph9 OUeopmrVE+CmOoGJr9V/u6G8A+aZP4tCHpUFYsAoruPPHuKr11aFo0z/g/OPoqPaMOYdd8 FTrLBrm3orIg6pbU7Ov9pVpjP9Uih8iGY0SYZlDLPy9AOURYhj5iGcpboDoqyg+DLkV4Sw FTV70RR/UZJ/U+xuNZgC/ULH/KF3QDKjoLMY1RvonLTUEQPnZOx7X0PxezPM8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359219; a=rsa-sha256; cv=none; b=ZjveKVMp3dmwtJzKzx/uKS/clB53tE0yQIzqG9LlupuCBAQjEzO4bEyNbXY5hqy3Q403c9 HqPDMNMFIwHX9MddPmxt1c7A300lgViE8KWQNHpOcYyZVoub5Kry+QELLFj4LnLiYWgMzm 2aZodZpTdY4o1Vd4hEI2AAlJnnC+28Hb+kQGY8EAu8m9yAMhpn9uIhQHf7fxtKkSY3yULg Hn8xgFHn93vK8cBZnAQ0osym/ZLUDyF4EO70ZutJAqk3ClKxHPFHlwxqKh+IOOsc8Gzav2 h6wyDwldsGBrHVCG8+CubIT9t08LaKVfWW5XlbvcbRZctfiCn/L6Zx2ztANVvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sPkUsLLelb1WbRu1JKBEMLAOiMvIc9ms3zuw+GhXwY8=; b=S9jGFKPXD6XAFrVGPm3SR5y+YkJZvzEMFVMq5tUsJBYLzBFNqxSfsBXctxK6ePPcy426Xq vwvhlSuXOkpPrY8CDEgVfwoLIQRFGEkRzeEH7xM3HXB2mpubt3kULs+vDZX72yUGR3ngIn Ep7xubrLffFWpnqKbx9gmYREPK/7wD0OohtcFvQqj9fg/F28SRGOcTC15SL7khpDAT7B1L G5LrurfNmqwzuilXOqBu4zxDjq+Vqdc+T/U1nvf5sH6aG+j1WKNfo118ZOOBhC+aTsxhox 1NWiDPbyT2YT7q3tpE0EkvrxSZS8+I0IyxMlSX1/UQHL2XeR+2/N1EC4SYfEmQ== 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 4Wyhcz2JnRzcnD; Tue, 3 Sep 2024 10:26: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 483AQxR9009416; Tue, 3 Sep 2024 10:26:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQxmO009413; Tue, 3 Sep 2024 10:26:59 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:59 GMT Message-Id: <202409031026.483AQxmO009413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 1d321c1907c2 - main - cmn600: Stop checking for failures from malloc/mallocarray(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d321c1907c210a33192ff5293f5c23554c96867 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d321c1907c210a33192ff5293f5c23554c96867 commit 1d321c1907c210a33192ff5293f5c23554c96867 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:22 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:22 +0000 cmn600: Stop checking for failures from malloc/mallocarray(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/arm64/arm64/cmn600.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/arm64/arm64/cmn600.c b/sys/arm64/arm64/cmn600.c index 4e3be8fee40e..530cdcdc3d06 100644 --- a/sys/arm64/arm64/cmn600.c +++ b/sys/arm64/arm64/cmn600.c @@ -332,9 +332,6 @@ cmn600_create_node(struct cmn600_softc *sc, off_t node_offset, int i; node = malloc(sizeof(struct cmn600_node), M_DEVBUF, M_WAITOK); - if (node == NULL) - return (NULL); - node->sc = sc; node->nd_offset = node_offset; node->nd_parent = parent; @@ -399,8 +396,6 @@ cmn600_create_node(struct cmn600_softc *sc, off_t node_offset, node->nd_children = (struct cmn600_node **)mallocarray( node->nd_child_count, sizeof(struct cmn600_node *), M_DEVBUF, M_WAITOK); - if (node->nd_children == NULL) - goto FAIL; for (i = 0; i < node->nd_child_count; i++) { val = node->nd_read8(node, child_offset + (i * 8)); node->nd_children[i] = cmn600_create_node(sc, val & @@ -420,9 +415,6 @@ cmn600_create_node(struct cmn600_softc *sc, off_t node_offset, break; } return (node); -FAIL: - free(node, M_DEVBUF); - return (NULL); } static void From nobody Tue Sep 3 10:27:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd05sCbz5MkLv; Tue, 03 Sep 2024 10:27: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 4Wyhd04N7Kz4sG7; Tue, 3 Sep 2024 10:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nU+lp8k+LV1c3yYym7YcUY4XB5JfKLUrMwyk5m/gKAw=; b=VnKIdL8pPEI+tLAXYf22BagtopCahn94mNdeenvIGyzvpyx7fvOUClZCuCRpbFf7fjLQ0C bMwiGM7KPcjqQC+5ExO6Q0Z4xgULQW+vixaweVhiOhcmiEO8ziyqdUjjcoohhBC53zGKmz acPL0hWRuVnFUTss+9x72kBiMPuFxllTmnQb2OZaEw79Ragiw2UBokfUkfIkzwlWj84A8c oc3oI8NA5S6+rS+KEooV6s52AmE2eqy8A3WzyaAV+nacpJuqYeRJuoMKT1dEPSD7PAFcDZ a7vNjczbnSC//5WyGzFVN3jYI5RpF3h3F1THuwqF5lBnXf+PD+QYvMHRILHJeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359220; a=rsa-sha256; cv=none; b=QzfJknG+9i6cbZRcbYotAi1sA5Q48l6mJ0djPrdj1cR9x5WMHvM4V48+gxxbEVZaMWUBoI yfQtdN/kmIdbGp+ap+PC8Nusu6m8k03p+Ev3qPnsTDW400fU0t2e91xS7gi0DjAs0INPTF JZFaWfDjqCqjXEZgUMNVOOj3cxQxEeGSKH6qXhQk+P65YM5OmqNBFB1C3r3PkDOsG/GWET bcW72sWZCjMWH8ufVIWa7dHpjvO3MQTIvnz+/lbzMeLheL2tcT0JJMNFSwz7YJxWlmZboU jF4xpW0zbxojbrW8MVsRM/Vc56c5KMk3ZSmJ7rBsQwpt88yeTEyqeoVsXmASqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nU+lp8k+LV1c3yYym7YcUY4XB5JfKLUrMwyk5m/gKAw=; b=OSc6lSek9KqAkOjWn0M2g5UjRzLCt8Njm59DxfqkNUIq1phGQJ8a30D335Z3E+WkAWAUam XoeGxpNvWdgHc9XYMTvWKDCLJHsg/bN9OyYmSsx763E8Yc01Lb6nwd7RFZitKEQSCvmhq7 cw/Oc4C5m6az6Z5knD4b8+ueOQeBS41trrTf1Ye6ucNJuM2wOQ5OHgYVygLeiEWXjjT+E7 gMgOMJfGiYPVkqePSjm3cPaiNManOgIQ+geB83Dust8nhWmEtBGZW8HJoW5gRkIs5YW4Vs ICjr1uNSbjroa2A00n62wLiJhb1KibwcM+usy1pRCPFujdqP7RyqdFoKYaKEhQ== 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 4Wyhd03Smgzcsr; Tue, 3 Sep 2024 10:27: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 483AR01W009476; Tue, 3 Sep 2024 10:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR0Ed009473; Tue, 3 Sep 2024 10:27:00 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:00 GMT Message-Id: <202409031027.483AR0Ed009473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f75ceecad215 - main - smmu: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f75ceecad2157a0d3aca61a4893ab78f2dec21ee Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f75ceecad2157a0d3aca61a4893ab78f2dec21ee commit f75ceecad2157a0d3aca61a4893ab78f2dec21ee Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:23 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:23 +0000 smmu: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/arm64/iommu/smmu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c index 93b0cbb7c8e4..a832f6a6ec70 100644 --- a/sys/arm64/iommu/smmu.c +++ b/sys/arm64/iommu/smmu.c @@ -960,10 +960,6 @@ smmu_init_strtab_2lvl(struct smmu_softc *sc) sz = strtab->num_l1_entries * sizeof(struct l1_desc); strtab->l1 = malloc(sz, M_SMMU, M_WAITOK | M_ZERO); - if (strtab->l1 == NULL) { - free(strtab->vaddr, M_SMMU); - return (ENOMEM); - } reg = STRTAB_BASE_CFG_FMT_2LVL; reg |= size << STRTAB_BASE_CFG_LOG2SIZE_S; From nobody Tue Sep 3 10:27:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd15Tlyz5MkJv; Tue, 03 Sep 2024 10:27: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 4Wyhd14n1sz4s2t; Tue, 3 Sep 2024 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAimFSsosdG+ZKS9aUVF6OYxdRPMzobc7MjAh6Zcv4g=; b=bUWmh9BlYMT8x5PFU8Z5EMOUOTGUSwf2tcb2rRButNX5cKhjGAhLmpg6H4S8SFH72V6fBQ Dl45Gpm6bYmWRw0vAXA7Mq/pOJCnJQTa9wOTKJtovV8OdH6waYkGjp5rC19Noh5JkvjPiN 79ZPknxvVYRcfXFUdC9iIKh37f99VCuolL1GjBYjldChfDFwxhUpxQcHoeOApU7DrcjHHA h7C2WAIPxdxAo07PUjj/rtHHMXZozuszlJcUXuzrUeWQ3E/hOe1Q7CkMBUdLfo8Vc95XEd T3ZWSIaXRgCIcps/HnIZHUtMmmBSTx7v3/uNRqyAHF1doiiWhq0o7v7tsxzPig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359221; a=rsa-sha256; cv=none; b=eRkUOiP6idZL06HcmQlXGlNCeHbwPLuzC6EWWH1ay7XNlr+GktIaf0B8a3ccDrox7WUB4w YsS47zl7uRRg+dxHi338kOnOytwhgX6UrInZd8dWmQm8hMISqcw6FNXw/UzBKsE0PlZbP6 2UcXeHXuU3n7tQiyGkWGs/bEte+row3wwTJ/sQiKCjqoHYM5UTFzQ8Xi1+xdKetvHGemfW PMu4Ht7lZf61Bn5tkhXF6iwuXmKcfZCp7C4FkyrRenwJ8gneX/c8AxES6ZbI0Eb4hyvo/b wl5JQfnweTm/UMTDamSkhJFywj/Unl+Wbr1u//G51t8XDQaujxT1/xpzQ1R/EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAimFSsosdG+ZKS9aUVF6OYxdRPMzobc7MjAh6Zcv4g=; b=nt0R1E+gZxFcpFmEsHGg8qceRKFpy6z/B+pKQimg5/6Vj0X1DE1BnmLcMK4xq5APRTop1N +eVZJt7+kU4mzU6kpigIXf3LVljTf/175j2hUT7davQWG9eHbzCIiuKLTNf7YUtEgmGIlI jpKZEQWGYh/fbmPSik/yJ3ktzHMYp5XvS3uF5iSyzxjrM49V3jq+3p8aN7U5rPrOVVpyJy LzLQr33k943HW6xDP30+zKsll/XF+Rg9/XbHMfgCHeWHYzKMsjKzFQbb7RRWpQM15B5BPB Wja1k0uKu2XLIc0xRIXLQsAnuvHTVkmYx7oloYWEC1Z6WCodU94nL1ybgldiqA== 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 4Wyhd14H2PzcJv; Tue, 3 Sep 2024 10:27: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 483AR1dp009524; Tue, 3 Sep 2024 10:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR1iM009521; Tue, 3 Sep 2024 10:27:01 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:01 GMT Message-Id: <202409031027.483AR1iM009521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 00ae9c1be02e - main - al_eth: Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00ae9c1be02e2db6ede1abd5b787bb9a3fbd76b0 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=00ae9c1be02e2db6ede1abd5b787bb9a3fbd76b0 commit 00ae9c1be02e2db6ede1abd5b787bb9a3fbd76b0 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:23 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:23 +0000 al_eth: Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/al_eth/al_eth.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c index b8dd95e7ca58..e12c8dfcc281 100644 --- a/sys/dev/al_eth/al_eth.c +++ b/sys/dev/al_eth/al_eth.c @@ -2004,14 +2004,6 @@ al_eth_enable_msix(struct al_eth_adapter *adapter) adapter->msix_entries = malloc(msix_vecs*sizeof(*adapter->msix_entries), M_IFAL, M_ZERO | M_WAITOK); - - if (adapter->msix_entries == NULL) { - device_printf_dbg(adapter->dev, "failed to allocate" - " msix_entries %d\n", msix_vecs); - rc = ENOMEM; - goto exit; - } - /* management vector (GROUP_A) @2*/ adapter->msix_entries[AL_ETH_MGMT_IRQ_IDX].entry = 2; adapter->msix_entries[AL_ETH_MGMT_IRQ_IDX].vector = 0; @@ -2299,9 +2291,6 @@ al_eth_setup_tx_resources(struct al_eth_adapter *adapter, int qid) size = sizeof(struct al_eth_tx_buffer) * tx_ring->sw_count; tx_ring->tx_buffer_info = malloc(size, M_IFAL, M_ZERO | M_WAITOK); - if (tx_ring->tx_buffer_info == NULL) - return (ENOMEM); - tx_ring->descs_size = tx_ring->hw_count * sizeof(union al_udma_desc); q_params->size = tx_ring->hw_count; @@ -2324,10 +2313,6 @@ al_eth_setup_tx_resources(struct al_eth_adapter *adapter, int qid) mtx_init(&tx_ring->br_mtx, "AlRingMtx", NULL, MTX_DEF); tx_ring->br = buf_ring_alloc(AL_BR_SIZE, M_DEVBUF, M_WAITOK, &tx_ring->br_mtx); - if (tx_ring->br == NULL) { - device_printf(dev, "Critical Failure setting up buf ring\n"); - return (ENOMEM); - } /* Allocate taskqueues */ TASK_INIT(&tx_ring->enqueue_task, 0, al_eth_start_xmit, tx_ring); @@ -2476,9 +2461,6 @@ al_eth_setup_rx_resources(struct al_eth_adapter *adapter, unsigned int qid) size += 1; rx_ring->rx_buffer_info = malloc(size, M_IFAL, M_ZERO | M_WAITOK); - if (rx_ring->rx_buffer_info == NULL) - return (ENOMEM); - rx_ring->descs_size = rx_ring->hw_count * sizeof(union al_udma_desc); q_params->size = rx_ring->hw_count; From nobody Tue Sep 3 10:27:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd30bLqz5MkR4; Tue, 03 Sep 2024 10:27: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 4Wyhd264XJz4sGP; Tue, 3 Sep 2024 10:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymxQFqvsMpubtCu2ikT5jCpg0GFOkVQGEjADwGNWJ4I=; b=fJOsLH0tgBAxz0BTxQyvwpqoo5pfmidYaUOxvIf1Stgfq3Fp8ZeNdDCSl8vnY5aPBpVJKX udilLB7EOWuXNV36EEP1jXPW1AGBw+kBEVTgbC3Y+DAy6TMrOK9A5uJ1ebj468Z5R9F/AA L/j7gmtVHoaaJc3l2Yrb+0ezaaAtEPDxtsss9m5vssYXmZAdj3YgU2HNjkp+hj64sUyxoV JVz3DqYuBD3OGpxrxei/zQdo9bYR/zQzoPCHy8XmDpP1WzgJFmBELVt5H/jqGEHv6dOqXR +ekL1h2p/0swxNmBB816v/B4h1PRl45witrNBO+EiHTPGrke7xd5nC1M5ynHBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359222; a=rsa-sha256; cv=none; b=kK+FIUS20hgV1WvAWkcTmuxjkdkyXbvjBCuwMEpp1eT0xEWfZO47N7wPMFaHm7jfgoFrJh vfHWKgkS6Ybsnli15wiZkLwxbchsJQx+ELvGaubA4hLuGzgRjIdkbS5RuttM2fMewfB9Vq HXqF3lbzHSA4UfEHnMVVUHb6qVE/e4+Sh/hYR3kvnDPxQSwCOdbGzFirf9lP/ooVIv3tds nOucrFo151r2Uz2VWOZQu5hAi9j/27lqVmuPm31QoiPmJwWB7fndMHPsr4PsWteVbHh7to ZbTMp+3OWPRRfdLrpfgp7pHtCZNca+Ol3cmoCdo4NZmGzMiUhdfWCqkg+cQYvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymxQFqvsMpubtCu2ikT5jCpg0GFOkVQGEjADwGNWJ4I=; b=m+ciY+OpUIj6i0x706eBXlz3/gTLk8RXwYQpAglhsGgW490/EbcbXzU58emNzx7xBZREji oL+VxelgkXPama9UhyIpj3gqTqFnInJ5qh/7h8aY9f3xChlTo6xWH3UZKh07JeJxfLzqNd bSby2IfeZUROcnjXn6b/LAIXc+wQ2/oRXV0EtNKIe8kjMWJvPm93gnr0b6J0fc76QnRRDy f0wrlzEVekr8O7iQz+L5HxSKPquC0wqiFQ3ppWifpoNGccumZ/ymmmTwq0QRin9yjHdURP ELBoIHtZxls/5m7B1atsDjF8HlWG7nFMaf4rTYhAjh5dbX/W3vIlBX8M/xqJqQ== 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 4Wyhd25jDnzcb3; Tue, 3 Sep 2024 10:27: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 483AR24I009572; Tue, 3 Sep 2024 10:27:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR2E3009569; Tue, 3 Sep 2024 10:27:02 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:02 GMT Message-Id: <202409031027.483AR2E3009569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: e06e2c840747 - main - altera: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e06e2c84074740a0087193d5929d09f1bc7e1c4b Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e06e2c84074740a0087193d5929d09f1bc7e1c4b commit e06e2c84074740a0087193d5929d09f1bc7e1c4b Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:24 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:24 +0000 altera: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/altera/msgdma/msgdma.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/altera/msgdma/msgdma.c b/sys/dev/altera/msgdma/msgdma.c index bb35d7315b6c..c5c75a5fb5e1 100644 --- a/sys/dev/altera/msgdma/msgdma.c +++ b/sys/dev/altera/msgdma/msgdma.c @@ -356,11 +356,6 @@ msgdma_desc_alloc(struct msgdma_softc *sc, struct msgdma_channel *chan, /* Descriptors. */ chan->descs = malloc(nsegments * sizeof(struct msgdma_desc *), M_DEVBUF, (M_WAITOK | M_ZERO)); - if (chan->descs == NULL) { - device_printf(sc->dev, - "%s: Can't allocate memory.\n", __func__); - return (-1); - } chan->dma_map = malloc(nsegments * sizeof(bus_dmamap_t), M_DEVBUF, (M_WAITOK | M_ZERO)); chan->descs_phys = malloc(nsegments * sizeof(bus_dma_segment_t), From nobody Tue Sep 3 10:27:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd42jsCz5MkWl; Tue, 03 Sep 2024 10:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhd36xz4z4sKN; Tue, 3 Sep 2024 10:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XbN/JETQK4s4R887eJsjnhwPQ4dFtXuyyNSa+LhVlsg=; b=Hg4QB32H0jaqT4O3mtKmCFu2xm+xAjNeKutYREDeJwQR0DsCO2pnEKUfq0ernUo1I/OqkC dZSeF+zfkspmQaud2a7wLlVavjt8753gUrtpIjlPNS1YZed4MyWfC0xP6zO40fE9ZEbEPE FR6XnJKH4vQYOo+gjlMBlNKp/bVHU6exNpXLB/HlHf7j5fIDw8WK7RYxky1RRHvYcPyYvE 6B/QwlNAysGmbmw2aiZdax+denyUn1a+4fwSttL/rhVaGBZRb2uDFGuq5WUM4VQ8bx1+7r jhbFEwMqVoq+dCdyzvtxKNM1MyDzNPJXxdeZXPql2Ayo1wVg+mmbvpGKf76zzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359224; a=rsa-sha256; cv=none; b=uJXLanu+4CB4skXWmwfGS0D6aLj3l0XkyYRGOYzvcXzQRV4kDPI/Oce6NKu/+KBZXFNjXq YQyt/8gj51JoeX2hzeP5L7WVgqcoo4eKyItsWZSUcTnK0MmUI1mJ95ZcBS/9lupTbwLKt2 gOJAC9BeFrFinYFNetjMnxH0wMcq2N303VtoZJa8J448LNXAzm2FEh/xGkccc69MOOMrxB 4FAOTncJqiEMqfnTp7rJqbSD4BZDQEZv30jKNcjzS0adFgNbMUHRidjUpBfoadXB5ysfIP 5YGX8T4U6wVfVzGngiInxhsS05M0/hLI4soC0LbCwvZnljGlQ7lIv3aUpDM/cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XbN/JETQK4s4R887eJsjnhwPQ4dFtXuyyNSa+LhVlsg=; b=H4L2zUONB1mJPFbQLR9+lDMS16Z6y47ga1dkxUv22zpLYLaxf1Ujx1Ag/TwVA2aWLcufVO JB0C5HrQR5HLqi74fNY2t/6g8/FlG8p6pzt6MH5Sge9uuZCfqIeyQh4XaeydWN7AXM05Xp 1eGnKw+2JxAXC0iRYxjcnNNSI8WW/rbZuqcbHBDjU6k0LSkwL8fgSWOEsJNIkGXEkXxrj6 3lXsZvhlvMMXsQzYmQGI6PUNrGaJOOuhorvolX5e/Dra78jC5E+r5BZerbPOa7Jqu42wxx OxvxpBSri/ouZVxz5W6UFqDKzQJQwPl/cUnQFC841Xc3DvvHIiTsd4Xfykjd2A== 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 4Wyhd36YyZzcss; Tue, 3 Sep 2024 10:27: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 483AR3hj009626; Tue, 3 Sep 2024 10:27:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR3LO009623; Tue, 3 Sep 2024 10:27:03 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:03 GMT Message-Id: <202409031027.483AR3LO009623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3fdf587ab02f - main - ath(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fdf587ab02f33018bd042094e3d0bd4169352ed Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3fdf587ab02f33018bd042094e3d0bd4169352ed commit 3fdf587ab02f33018bd042094e3d0bd4169352ed Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:24 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:24 +0000 ath(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/ath/if_ath_lna_div.c | 6 ------ sys/dev/ath/if_ath_pci.c | 5 ----- sys/dev/ath/if_ath_spectral.c | 7 ------- 3 files changed, 18 deletions(-) diff --git a/sys/dev/ath/if_ath_lna_div.c b/sys/dev/ath/if_ath_lna_div.c index 1b20591fc64e..0755bb667716 100644 --- a/sys/dev/ath/if_ath_lna_div.c +++ b/sys/dev/ath/if_ath_lna_div.c @@ -96,12 +96,6 @@ ath_lna_div_attach(struct ath_softc *sc) ss = malloc(sizeof(struct if_ath_ant_comb_state), M_TEMP, M_WAITOK | M_ZERO); - if (ss == NULL) { - device_printf(sc->sc_dev, "%s: failed to allocate\n", - __func__); - /* Don't fail at this point */ - return (0); - } /* Fetch the hardware configuration */ OS_MEMZERO(&div_ant_conf, sizeof(div_ant_conf)); diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c index 72f0a802aa5f..a242eab7a694 100644 --- a/sys/dev/ath/if_ath_pci.c +++ b/sys/dev/ath/if_ath_pci.c @@ -269,11 +269,6 @@ ath_pci_attach(device_t dev) __func__, fw->data); sc->sc_eepromdata = malloc(fw->datasize, M_TEMP, M_WAITOK | M_ZERO); - if (! sc->sc_eepromdata) { - device_printf(dev, "%s: can't malloc eepromdata\n", - __func__); - goto bad4; - } memcpy(sc->sc_eepromdata, fw->data, fw->datasize); firmware_put(fw, 0); } diff --git a/sys/dev/ath/if_ath_spectral.c b/sys/dev/ath/if_ath_spectral.c index 58f21b526e93..951d66605981 100644 --- a/sys/dev/ath/if_ath_spectral.c +++ b/sys/dev/ath/if_ath_spectral.c @@ -112,13 +112,6 @@ ath_spectral_attach(struct ath_softc *sc) ss = malloc(sizeof(struct ath_spectral_state), M_TEMP, M_WAITOK | M_ZERO); - - if (ss == NULL) { - device_printf(sc->sc_dev, "%s: failed to alloc memory\n", - __func__); - return (-ENOMEM); - } - sc->sc_spectral = ss; (void) ath_hal_spectral_get_config(sc->sc_ah, &ss->spectral_state); From nobody Tue Sep 3 10:27:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd52852z5MkcR; Tue, 03 Sep 2024 10:27: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 4Wyhd514L4z4sMp; Tue, 3 Sep 2024 10:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kq6tYe4ztHlNPh7QK/j/QCVpUY3wYsOPLg2CF5TsbaU=; b=Rgpo5vN0nALnMUMcnNfcDE3eW+BhRs7uXGk62qv40kPr1xv9CiTDP+/k5Qv/vWiErRz9Jx C5Kutyav+w8nb+lvRm47DUC5+G3Fple9cv3aRbR7vFrpEoaZRQDBlnjBI+h9xJEXr55EPI c3PrRIqBqAa61d5WUh/czTkMjj8dOxGBW9IkG20oQsoulAhyAdAk2b0C6GsNH7u5h8B+91 Mt9PKpJfIkzjnVhkOxNrFXzbjgpbLEKuEOS2xPyydANpcRXloEwdcvnAM7PDOCB4e0ESUn m0dMwYaikFshLydGLuSBpnTNwAl5CE60WFtiLqUPmRgFpcSGrZkSXhr05wZtWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359225; a=rsa-sha256; cv=none; b=YsDtq3NpOZ7fvDE2Pdau1LJ+KtBxWTf2cSPL93iA6QEQ2Adn52/ez5SOGq3tsHy9qrsrTu iVzYb6AqrQMYHxEGmaTvJPs3h8AB8eXEFWkYoBqszQBGE/KH9MMKpOyK0h30PQIX2dh0/G o1zAbjGHRh8t85pf51HE6OFbAFeg+mkdGE3kqCMn+FgLCDugTk9D14BEDYAwKX1UJj8ke5 SEogMLz7/4yEMY8nkmoR3CgRpQiJuIGCQugp8ToQOFvVJEj7arY9V5DENZrLsQNRETtgoU 41S9YN+7dHR7jbKm1uSrXRIQN9yj7Yqfvk0Tfv/FPW0wqd/X155Po0JS7oYl7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kq6tYe4ztHlNPh7QK/j/QCVpUY3wYsOPLg2CF5TsbaU=; b=NtmhxMiFEc8t2qBraYBV3SACBcxeDudD2/bstd3p8I7M8zhlRcX+bCTU1C2kz2Fa5F1Wdb 1tIQkEGycJ5lyRgl7kFdgUXOgV+Fqa3Fbxv+iA8ZWnI0FPNkHvATLD0gJnItqzIoCHymId 1+pRNy7/R8ipBZQSbVIHHb3aTbQo2z8b8/VWDQ+kR/WcYRVvbQiRq+hVnmyh+PnwEn7/D3 WHbjUy4m3ab9Yj7cJ/vN5PaOdZFrWeLze9lnGsufbI2Hc3OBHVma604TtEdyId66+nZhwd m45MzYmfXK7H3Vm6EUkBFbm9N8wxwHMpcbhacqGuaTm+BoRkEJrpgoNue6ijNA== 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 4Wyhd50g1WzcnF; Tue, 3 Sep 2024 10:27:05 +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 483AR4Dm009677; Tue, 3 Sep 2024 10:27:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR4rf009674; Tue, 3 Sep 2024 10:27:04 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:04 GMT Message-Id: <202409031027.483AR4rf009674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: ab0b996bddd9 - main - axgbe: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab0b996bddd96300d56b7d2aa830e2479cdfa92b Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ab0b996bddd96300d56b7d2aa830e2479cdfa92b commit ab0b996bddd96300d56b7d2aa830e2479cdfa92b Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:25 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:25 +0000 axgbe: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/axgbe/xgbe-phy-v2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/axgbe/xgbe-phy-v2.c b/sys/dev/axgbe/xgbe-phy-v2.c index 5b39d61694e6..8c6069f83076 100644 --- a/sys/dev/axgbe/xgbe-phy-v2.c +++ b/sys/dev/axgbe/xgbe-phy-v2.c @@ -3771,8 +3771,6 @@ xgbe_phy_init(struct xgbe_prv_data *pdata) return (ret); phy_data = malloc(sizeof(*phy_data), M_AXGBE, M_WAITOK | M_ZERO); - if (!phy_data) - return (-ENOMEM); pdata->phy_data = phy_data; phy_data->port_mode = XP_GET_BITS(pdata->pp0, XP_PROP_0, PORT_MODE); From nobody Tue Sep 3 10:27:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd66jc4z5MkYt; Tue, 03 Sep 2024 10:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhd62VkYz4sPp; Tue, 3 Sep 2024 10:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TlSiW4OB6Wh1wa/6DypqGKEHReHAqX3DOQsmjJnXDyc=; b=MxKGiSbQ6SvybPGM5c00A8maGRrPtWS6htIkFOtI32a6Q6n1Q0bpoldVftlhZ2APFYv3io KVhsOmtUG5o90D8QE4iSSUhRC5wVqX13DFD7XX3VhPm+n34z59kaxmuTBCXruGdITxELE5 1m6TdkTgdELO0gKaV5IGIBFE9rTW/GarAE71yy0gdxxzTL7WXnVByJhEiasUlmqYH8I5Ap 1gYZBhSbVJdOzhEbAX51oseyqyfDlS8sjSmPzJSr471GFeEX/MxgxZSYqXJduKUSHm7bny ujulbxvNpU9ICW2a91+cOFOZcoKwPsyJH1qrcgSyRHIxl9GoJ8zgxIjlzQVqfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359226; a=rsa-sha256; cv=none; b=XaBXGv3TeO33CaXcFgIFjfVHecMzx6kgjHqQnJndwuTTlkYezsTf3wNg9UV7LcGvYHml2t FZFtak/xx39iZotFWh1c2ozyblLrQ0HS0wnpej1LaRJzRQsNUQoeinnfdAYTkdbB3hha+o bTdi5/miBlMSjpoVSunjpBkpJcwiqHBhHcrBlEbRhTQjI0N8wNJKVLpQ5wjXDjnr/7W8lV 3OrAmlGoXVqXDWk8IKzvq2wOGW9HnEr1NGyHv2E5SpgugT6v9EPyJsrrFOZL1V50XQPQ7o vGEQ7W1ttiMQLe70F3zKwesQmYUSDuVNkIQ5qnFTt7MMD30xoh+y32Ut8Z1yxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TlSiW4OB6Wh1wa/6DypqGKEHReHAqX3DOQsmjJnXDyc=; b=fslX2D7ZGkbKDeNQYgaaMTPXyt5z3PZi6A+ghnWulLxmg2gf+jxuTbANsIA3LEDxlPx0t3 9bPrwN2J9+1IXneuyGGils0F6VKOT9WmaAsrilupDRHzevNTV1PQpN4Bdyivrtjq+1n6Yd V5ipzOwFPS9wDsfzA0iADsE1RHaOwTGOii57qhtvp9yaj/VdztE5Xp7yzy8vTqw/1W6fdO hsJ//lynTj3o36nU9euPEpYeWVJENqoGzTvweIbWhzusVMsH8LxFbJWnTmUw219vLVtAlm KKV6qVtq5dEFruAw/zR6pI+QAL+uOG24OvcR98nd8s66sOCxI+Mk0sp7/3j+6w== 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 4Wyhd61PsJzcnG; Tue, 3 Sep 2024 10:27: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 483AR6JZ009731; Tue, 3 Sep 2024 10:27:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR6Go009728; Tue, 3 Sep 2024 10:27:06 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:06 GMT Message-Id: <202409031027.483AR6Go009728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: dcd387aaa5d4 - main - bnxt(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcd387aaa5d4409a7e99376e0254029fce1a48a8 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=dcd387aaa5d4409a7e99376e0254029fce1a48a8 commit dcd387aaa5d4409a7e99376e0254029fce1a48a8 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:25 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:25 +0000 bnxt(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/bnxt/bnxt_en/bnxt_mgmt.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c index 2f82580352cb..72704c3db452 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c @@ -205,19 +205,7 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, } req = malloc(msg_temp.len_req, M_BNXT, M_WAITOK | M_ZERO); - if(!req) { - device_printf(softc->dev, "%s:%d Memory allocation failed", - __FUNCTION__, __LINE__); - return -ENOMEM; - } - resp = malloc(msg_temp.len_resp, M_BNXT, M_WAITOK | M_ZERO); - if(!resp) { - device_printf(softc->dev, "%s:%d Memory allocation failed", - __FUNCTION__, __LINE__); - ret = -ENOMEM; - goto end; - } if (copyin((void *)msg_temp.usr_req, req, msg_temp.len_req)) { device_printf(softc->dev, "%s:%d Failed to copy data from user\n", @@ -237,12 +225,6 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, (num_ind * sizeof(struct dma_info)); msg2 = malloc(size, M_BNXT, M_WAITOK | M_ZERO); - if(!msg2) { - device_printf(softc->dev, "%s:%d Memory allocation failed", - __FUNCTION__, __LINE__); - ret = -ENOMEM; - goto end; - } if (copyin((void *)mgmt_req.req.hreq, msg2, size)) { device_printf(softc->dev, "%s:%d Failed to copy" From nobody Tue Sep 3 10:27:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd74pZbz5MkRC; Tue, 03 Sep 2024 10:27: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 4Wyhd72vyLz4sL0; Tue, 3 Sep 2024 10:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b65/+IakpNO18QWJY5byk1MARlBeW2r8AweoAw4SZsA=; b=IsFtKu46IOKVo3nlHw949wnbToEgsr940pL97ou5pAPnV5SzhD/nugf42XZxFh+0cSXkJI 4nCeLZVyIHtIGJZ09qwayD6Xc8Ry/T4Prr1Cjjx0RCSHWCmku0a+LWdRshWEHtU7Dp4O3G NBDpy6JYXOOWjWd3a78L9ddqwNzPSF8P2KKuy3aJhVt5X58upAQr7gpjs8wVZwvX0ZPO7/ DI7EnJtWIxfO8NwNcIGcw+T7bG36FViYE+N7hYDgheokYnwB49cWAwSsWxTK+KYIP+1kvF eMirQmsa5aY67hKNAtVJh29zLXg4rAnfT4B20OwjZecbOjEvza3atG0IOODeoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359227; a=rsa-sha256; cv=none; b=mvarakxIuQUM2TStn4Y5cChd3cob1SFImWARY34yQhrj4aCSCq8mcDdPQ5mHL65Ddv2w+x 6d/7JHXsqLbXi+f2yUa+i9++CYkw6vTpFeXvfs3bVnYfwEpVpZ96XMuvYtp7eFwOycm4OE 4uR98TfgfSeR15F7dGwtKDYIuAVL8Ti4EyCQEdAHki4i0h8AQ0yibD+NGpDbsxxV4RDt9O icxFsmorEbuA+lQ9lPWopiiwTG/7EddbEDxYXHgFvZrbqeO7R6QMdM2+fM7vM79qWG+O1l jAjocO5SP4D1Rwp97dBHalLixPZOf/DXb/6WBv2g/SjeQgxe/LXCojCfxjeVSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b65/+IakpNO18QWJY5byk1MARlBeW2r8AweoAw4SZsA=; b=OkkTkYhnofVnpT3jDgYqZLb7t+P7r51hymaUoiLr8vIdSnBwJQatw8vdFp84HjhWzldEab /kcPVyEklVhgcctTkIu3mE+tWeDDu4yHPz83e1rH3/4cVyfpeDY9O4EMC5wnBJMn8SUJ2T 3lj0r6RfwCLnPMqVElzZ8FfZb7nk4++lPcnXfJiZ/mCoC383mIxNPYoMyuo6c/96utaurp Ws5MfpgWVChnxfGbWukOqmUsaijq+IZYaE3r9y7lcY0KKkFgYXIZ1dP7tuWd3Crc6/aIFR 7vTE57c28BIqyz0E5H7pKRhNr+WnUu+SMr6Dwrqkg2yXnAqET7eu28YHD4johg== 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 4Wyhd72RBSzcb4; Tue, 3 Sep 2024 10:27: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 483AR7bG009779; Tue, 3 Sep 2024 10:27:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR7Dv009776; Tue, 3 Sep 2024 10:27:07 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:07 GMT Message-Id: <202409031027.483AR7Dv009776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: bb51f7c8a48a - main - cxgb(4): Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb51f7c8a48a4cd5dfa67fefa81f3d5d199da92b Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bb51f7c8a48a4cd5dfa67fefa81f3d5d199da92b commit bb51f7c8a48a4cd5dfa67fefa81f3d5d199da92b Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:25 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:25 +0000 cxgb(4): Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/cxgb/cxgb_main.c | 4 +--- sys/dev/cxgb/cxgb_sge.c | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 9bcdb86312c4..4d754aa8b1b7 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -2472,9 +2472,7 @@ set_eeprom(struct port_info *pi, const uint8_t *data, int len, int offset) aligned_len = (len + (offset & 3) + 3) & ~3; if (aligned_offset != offset || aligned_len != len) { - buf = malloc(aligned_len, M_DEVBUF, M_WAITOK|M_ZERO); - if (!buf) - return (ENOMEM); + buf = malloc(aligned_len, M_DEVBUF, M_WAITOK | M_ZERO); err = t3_seeprom_read(adapter, aligned_offset, (u32 *)buf); if (!err && aligned_len > 4) err = t3_seeprom_read(adapter, diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 1b82f2ebcaae..52ffa5cdaffa 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2419,11 +2419,8 @@ t3_sge_alloc_qset(adapter_t *sc, u_int id, int nports, int irq_vec_idx, q->port = pi; q->adap = sc; - if ((q->txq[TXQ_ETH].txq_mr = buf_ring_alloc(cxgb_txq_buf_ring_size, - M_DEVBUF, M_WAITOK, &q->lock)) == NULL) { - device_printf(sc->dev, "failed to allocate mbuf ring\n"); - goto err; - } + q->txq[TXQ_ETH].txq_mr = buf_ring_alloc(cxgb_txq_buf_ring_size, + M_DEVBUF, M_WAITOK, &q->lock); if ((q->txq[TXQ_ETH].txq_ifq = malloc(sizeof(struct ifaltq), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { device_printf(sc->dev, "failed to allocate ifq\n"); From nobody Tue Sep 3 10:27:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd84gwRz5MkcX; Tue, 03 Sep 2024 10:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhd83XTMz4sbH; Tue, 3 Sep 2024 10:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I8v98jDd30Hm6ZmS9vjXszGztSS881o1Gv5v1licQIQ=; b=Scd0GSLrBuncAHgLUerWkj/+Bi4frNivaHFhcy+JCPK/9v+TxGBk5PFqyMoIq3tl8aAtsv ml4Z2AmlMDkzgP2oKkiGw+Rg8eY8JYlzDO/I3sW03LXLI61CTBHLTt4YiWUaAbMZGYBUxK I8QArFjE1NKgOJfOi6e6Mxxi92In9HwWxe5OrAHdpzIBDhJSWVxN0OfTA/ARCssad82PQz hqVqeUnfktl4+aNhDbfku+rsAb7kpIkrC/W20IooxpYnNw02SY0HgNXKPdZ+Mil0Fnf1wK +kCFF/wT/zbdJYKMSTQUb9cj3SL4GHmJY++xV/u6KJeBZPSC8lsyJQkptfyODQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359228; a=rsa-sha256; cv=none; b=JCrFEm/adz8uFhubzskw7PTmczqb/r4kpX407xyxnETTZ91J2QPVGiyYa5Q5Yup7Jg88wy Z6XZXgqV9/XaZpvqbqbP4m0N8rGpOybTF1jMCznG4wsLYV6AU++ZBXuinHi3BeatvU7frN /071yhqgOcMJm3HoBUME6TKDZcC6UlSK+J1ev13VbmJ02glVn8peyI7Zy/qVTLd/eP9Hb7 bhJC1qCeQlVYwk99gITUe//lgsg1R+1uWWjf0bGhHqKoJm62bTS+noADYo+SAbE8ZTHi3f /FzpfApni6mu3d/Jtahq3txmTsuJKVLFL5hZod60okvN2BAipRvZpWlXh4eYgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I8v98jDd30Hm6ZmS9vjXszGztSS881o1Gv5v1licQIQ=; b=NS3AgV/Y3QZP5wjToOEHHAgXmjmZhH2l2yRS664qtNDdnByL/9rAD+LHkrhYnf3P4xbBOC DmOFRMzpYkFD/lUGn2Jl+4hImebEYsj4lR8luTeIAwZRSArtS4/kIdo+fiIpy7AEkm5mRo k2WUSzVNuhKW+GqBsCE7XvdO2EOyeoJ7alDMnBgXO89ohH+eTRRfMb3nyt06oYlLvzSN54 gSm9ox2/lNAMuoj2yEWCptuJFjS0HD74tEjLgk5l1LlzxThSvQblwE3+FjD0bRjDLcEOXS FtFz/jxKrUrYt18BkzR6XCBFYfsltWxSic8JpF9Sd/+/dEmKEEb/yF/dRzGFWA== 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 4Wyhd83932zcFd; Tue, 3 Sep 2024 10:27: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 483AR8w4009827; Tue, 3 Sep 2024 10:27:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR81f009824; Tue, 3 Sep 2024 10:27:08 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:08 GMT Message-Id: <202409031027.483AR81f009824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 955b380365af - main - cxgbe(4): Stop checking for failures from malloc/mb_alloc_ext_pgs(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 955b380365af174b3d35905b7b8afae97506a0bd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=955b380365af174b3d35905b7b8afae97506a0bd commit 955b380365af174b3d35905b7b8afae97506a0bd Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:26 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:26 +0000 cxgbe(4): Stop checking for failures from malloc/mb_alloc_ext_pgs(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/cxgbe/cxgbei/cxgbei.c | 3 --- sys/dev/cxgbe/tom/t4_cpl_io.c | 5 ----- 2 files changed, 8 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index 04454a98e247..ccca45f5f761 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -842,9 +842,6 @@ cxgbei_activate(struct adapter *sc) /* per-adapter softc for iSCSI */ ci = malloc(sizeof(*ci), M_CXGBE, M_ZERO | M_WAITOK); - if (ci == NULL) - return (ENOMEM); - rc = cxgbei_init(sc, ci); if (rc != 0) { free(ci, M_CXGBE); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index cb229d327386..0a40bbda3f3f 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2127,11 +2127,6 @@ alloc_aiotx_mbuf(struct kaiocb *job, int len) break; m = mb_alloc_ext_pgs(M_WAITOK, aiotx_free_pgs); - if (m == NULL) { - vm_page_unhold_pages(pgs, npages); - break; - } - m->m_epg_1st_off = pgoff; m->m_epg_npgs = npages; if (npages == 1) { From nobody Tue Sep 3 10:27:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdB74ldz5MkGD; Tue, 03 Sep 2024 10:27: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 4WyhdB5mMtz4sQk; Tue, 3 Sep 2024 10:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODWryf/qjU14nDtYgh2aWWh3ndiVVrwv5VK7V71fmWY=; b=tJCoOQQ8ILe+m01jWq4R3udyv5r0nCZT6l0qWXvwCibAlzXxbhn/Oq8vMjJ8kOxN+WW1Mc auiF3UlsH0CctI1+kbr4dMZMIxzGo8qOirqnTPezZJPXXQl4ynPu095sN2CTLRfZ5nPs2k dfnuCCB9mJJus4+0RqSb5HJd8bzMuzydnQtNmct/I18r0pYiXovgH8VWNAVdno7afF+1tE zeeLEv1dgPnwbxgedkfVk0PAehg5P8WzqllzTxhzesXwBaLA0IDTUL7HdWQRzPbXuhYm2e Aa3EYuyDtfl458MORnXmwTnS4nty2tBmKp8qRSPEH1UdnXDFSYR/KBIHSr99oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359230; a=rsa-sha256; cv=none; b=c3etPXx3UtZLVbhj0cppMnKN+IQredZHI+MLIvviWZVEHJEHjt3Ofvw59uBcAmQ54yL2vt fgAbGlW442AqT4TsZQLX+SPINaR/p+b6Syec1V7mUWYqb/gKFqDdOpndeA8iaNe945/R8C gtr6YTXZjc37t48eR/9VA6Wf+rDxg6Pu4EYsiLV9JYUplafCxVxFUZ4ZIF+eduhvCq6TLa S10/S9No8uY/sbdSjp/tbUbs5HqcCj1KmB9Hg2jKc1YkVLpGLgd1Lvk4D08FKZzc4PLnRW QkayYtoJFb40sRfLGqqRT8+yEyH5bsu0ILuF5hFaNNwoZt5Mmzc4Vm9y28D+VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODWryf/qjU14nDtYgh2aWWh3ndiVVrwv5VK7V71fmWY=; b=D+7ZGr7xHAYTS1SQ+hwB+5MQ/trFNclw14aSJfZuWNFAWV13nC3fD3RTnA1xCo89rbfOTW RthlTuJoQpjbHb9jvPc5h/UAaNWPYtxQ4eR7JkVZCWmT3ihNmwNDzBatzKvKHsGZmCL50/ l64NAy8AygaPrNFaj9iO8HqFCl/eKPu9Hl2DeCL4Ru9ORdTrPMqPAv+bHtPSSVRjV7y3hT pmqpoZh+LsU5/zrzzaPztKtLlnj4S/p0S76GVKSOWitenVyVHqg0jcRmJJm/+FrEjW3C5+ BHVJW+AA74HX6WnWPmVGHbJDPJHWnfHAJBrVabxUyBHPz8X1qGNjkj8xRGwrMQ== 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 4WyhdB5Nf4zcb5; Tue, 3 Sep 2024 10:27: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 483ARA54009923; Tue, 3 Sep 2024 10:27:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARA3t009920; Tue, 3 Sep 2024 10:27:10 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:10 GMT Message-Id: <202409031027.483ARA3t009920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 51971340bd3f - main - ena(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51971340bd3ff41591adbbfca68e9e753f6eb135 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=51971340bd3ff41591adbbfca68e9e753f6eb135 commit 51971340bd3ff41591adbbfca68e9e753f6eb135 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:26 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:26 +0000 ena(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/ena/ena_rss.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c index d90a7fbb253a..41fa9c62f94a 100644 --- a/sys/dev/ena/ena_rss.c +++ b/sys/dev/ena/ena_rss.c @@ -279,12 +279,9 @@ ena_rss_indir_init(struct ena_adapter *adapter) struct ena_indir *indir = adapter->rss_indir; int rc; - if (indir == NULL) { + if (indir == NULL) adapter->rss_indir = indir = malloc(sizeof(struct ena_indir), M_DEVBUF, M_WAITOK | M_ZERO); - if (indir == NULL) - return (ENOMEM); - } rc = ena_rss_indir_get(adapter, indir->table); if (rc != 0) { From nobody Tue Sep 3 10:27:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhd968Jhz5MkRG; Tue, 03 Sep 2024 10:27: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 4Wyhd94xSXz4sgs; Tue, 3 Sep 2024 10:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ndm46BPlhpyFl+hJRalpfXcNCZ3T2PGCR1EvodDNOY=; b=JqnJnW7cnmrkaZ7vtgW27+kolyvGsO61nf4wdEJBUYUbS1l+CZiMZ6iw/DKYXh1HPrGuzV ZSkFTGJicMUzRg86oVNHARO6mvG5UfmFnVYlT2QSEd7u6BIB/UqB15JiRo1be0kHJ9QRMl Ov70ulyhbnk8ev2a7scKaQHv1hK6JXaZ+/4+hDESJZt41BR3pIfB51wnqcZ/o3AT9JTmye kKNAm47sc6EjQnzg8eLkLbpNq4y4IMFVu7EFIPdghwGSliay1s83nz9aRLBKiS2XO929c3 pBZsBVb3T9NGvZhkinoYvXUHE4Tzyga6/CsRB42c5rmjJ8srf0G1spIlNtwpfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359229; a=rsa-sha256; cv=none; b=sqw1UI2cnK3osDZH+Klw+g47b0oEUu7gj6pJlncGi7J213OM+3csI922rfdanuWGyiZgvj KUb1YjRyjTAuE5QqCASiS4zwci4XKF/RdYvtzKFRQ0zxcYg2qtz8HnIx//dkkcMZWprwLj uelS5ESG9i1+2IBcWr51QIOpciTuxDjPcgOJMImjfRX3lx4pYk3wxmFEnJiJspG5xHiiJb ZlBLHDV7ZFs0maWCnnrETpcO333minS2pu0HSX8GhryTkRrcVdD3WaM8R1gYf+maLDLoqg w6VFW7k6iHLc3RSRnue+ihvsy/4/LUyLYH0ISUdtusADKbErQvSqXT9CIUBzcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ndm46BPlhpyFl+hJRalpfXcNCZ3T2PGCR1EvodDNOY=; b=VuH4goek8my1JLeRPcbnL1lqPUbPEIvBAjGKPloDxsJ7tFFSFg9IXjLBfCqJoyJWTfJpW6 emuXjINdYMr4fCliOOZrk9AMQJGMJLG9ZQMqnRNMZG3cxHj9fTv63VFaFCGqQW1zETH/Le d3I20rnqGwZq6M2dXERQ7uFh3SfOjDtIDCeRp7QEbV7l21kPB75VwWGDRwOdwxkvTJIqGW U2Q2WNCtvblRL7GMocHb7Bs9lsnKzPHT/O6XHZqJsGNcYq0lKJ5zRAIt7XkeBE7IebkvuU 3KexZl2KAhuXhOUrs12YWTTUx2W1rao79Y1HG5Y1aJlQtxiqnNJ1B3+hEzH9fA== 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 4Wyhd94FwCzcst; Tue, 3 Sep 2024 10:27: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 483AR9nD009875; Tue, 3 Sep 2024 10:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AR9Xj009872; Tue, 3 Sep 2024 10:27:09 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:09 GMT Message-Id: <202409031027.483AR9Xj009872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 6dbf3aca4f5c - main - drm2: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dbf3aca4f5c4f7287f186360c2391f2adfea8d6 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6dbf3aca4f5c4f7287f186360c2391f2adfea8d6 commit 6dbf3aca4f5c4f7287f186360c2391f2adfea8d6 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:26 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:26 +0000 drm2: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/drm2/drm_buffer.c | 30 ----------------------------- sys/dev/drm2/drm_crtc.c | 45 +------------------------------------------ sys/dev/drm2/ttm/ttm_object.c | 5 ----- 3 files changed, 1 insertion(+), 79 deletions(-) diff --git a/sys/dev/drm2/drm_buffer.c b/sys/dev/drm2/drm_buffer.c index 8a674397262e..8069f2c8c4c6 100644 --- a/sys/dev/drm2/drm_buffer.c +++ b/sys/dev/drm2/drm_buffer.c @@ -50,45 +50,15 @@ int drm_buffer_alloc(struct drm_buffer **buf, int size) * variable sized */ *buf = malloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *), DRM_MEM_DRIVER, M_ZERO | M_WAITOK); - - if (*buf == NULL) { - DRM_ERROR("Failed to allocate drm buffer object to hold" - " %d bytes in %d pages.\n", - size, nr_pages); - return -ENOMEM; - } - (*buf)->size = size; for (idx = 0; idx < nr_pages; ++idx) { - (*buf)->data[idx] = malloc(min(PAGE_SIZE, size - idx * PAGE_SIZE), DRM_MEM_DRIVER, M_WAITOK); - - - if ((*buf)->data[idx] == NULL) { - DRM_ERROR("Failed to allocate %dth page for drm" - " buffer with %d bytes and %d pages.\n", - idx + 1, size, nr_pages); - goto error_out; - } - } return 0; - -error_out: - - /* Only last element can be null pointer so check for it first. */ - if ((*buf)->data[idx]) - free((*buf)->data[idx], DRM_MEM_DRIVER); - - for (--idx; idx >= 0; --idx) - free((*buf)->data[idx], DRM_MEM_DRIVER); - - free(*buf, DRM_MEM_DRIVER); - return -ENOMEM; } EXPORT_SYMBOL(drm_buffer_alloc); diff --git a/sys/dev/drm2/drm_crtc.c b/sys/dev/drm2/drm_crtc.c index b9415082e7a1..a163c7455773 100644 --- a/sys/dev/drm2/drm_crtc.c +++ b/sys/dev/drm2/drm_crtc.c @@ -662,13 +662,6 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, plane->funcs = funcs; plane->format_types = malloc(sizeof(uint32_t) * format_count, DRM_MEM_KMS, M_WAITOK); - if (!plane->format_types) { - DRM_DEBUG_KMS("out of memory when allocating plane\n"); - drm_mode_object_put(dev, &plane->base); - ret = -ENOMEM; - goto out; - } - memcpy(plane->format_types, formats, format_count * sizeof(uint32_t)); plane->format_count = format_count; plane->possible_crtcs = possible_crtcs; @@ -725,8 +718,6 @@ struct drm_display_mode *drm_mode_create(struct drm_device *dev) nmode = malloc(sizeof(struct drm_display_mode), DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!nmode) - return NULL; if (drm_mode_object_get(dev, &nmode->base, DRM_MODE_OBJECT_MODE)) { free(nmode, DRM_MEM_KMS); @@ -1009,9 +1000,6 @@ int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group) group->id_list = malloc(total_objects * sizeof(uint32_t), DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!group->id_list) - return -ENOMEM; - group->num_crtcs = 0; group->num_connectors = 0; group->num_encoders = 0; @@ -1997,10 +1985,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, connector_set = malloc(crtc_req->count_connectors * sizeof(struct drm_connector *), DRM_MEM_KMS, M_WAITOK); - if (!connector_set) { - ret = -ENOMEM; - goto out; - } for (i = 0; i < crtc_req->count_connectors; i++) { set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr; @@ -2522,11 +2506,6 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, } clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!clips) { - ret = -ENOMEM; - goto out_err1; - } - ret = copy_from_user(clips, clips_ptr, num_clips * sizeof(*clips)); if (ret) { @@ -2773,15 +2752,10 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags, property = malloc(sizeof(struct drm_property), DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!property) - return NULL; - if (num_values) { + if (num_values) property->values = malloc(sizeof(uint64_t)*num_values, DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!property->values) - goto fail; - } ret = drm_mode_object_get(dev, &property->base, DRM_MODE_OBJECT_PROPERTY); if (ret) @@ -2907,9 +2881,6 @@ int drm_property_add_enum(struct drm_property *property, int index, prop_enum = malloc(sizeof(struct drm_property_enum), DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!prop_enum) - return -ENOMEM; - strncpy(prop_enum->name, name, DRM_PROP_NAME_LEN); prop_enum->name[DRM_PROP_NAME_LEN-1] = '\0'; prop_enum->value = value; @@ -3103,9 +3074,6 @@ static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev blob = malloc(sizeof(struct drm_property_blob)+length, DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!blob) - return NULL; - ret = drm_mode_object_get(dev, &blob->base, DRM_MODE_OBJECT_BLOB); if (ret) { free(blob, DRM_MEM_KMS); @@ -3433,10 +3401,6 @@ int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, crtc->gamma_store = malloc(gamma_size * sizeof(uint16_t) * 3, DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (!crtc->gamma_store) { - crtc->gamma_size = 0; - return -ENOMEM; - } return 0; } @@ -3631,13 +3595,6 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, mtx_unlock(&dev->event_lock); e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO); - if (e == NULL) { - mtx_lock(&dev->event_lock); - file_priv->event_space += sizeof e->event; - mtx_unlock(&dev->event_lock); - goto out; - } - e->event.base.type = DRM_EVENT_FLIP_COMPLETE; e->event.base.length = sizeof e->event; e->event.user_data = page_flip->user_data; diff --git a/sys/dev/drm2/ttm/ttm_object.c b/sys/dev/drm2/ttm/ttm_object.c index 8c373618d7ac..31af15cf4c56 100644 --- a/sys/dev/drm2/ttm/ttm_object.c +++ b/sys/dev/drm2/ttm/ttm_object.c @@ -282,11 +282,6 @@ int ttm_ref_object_add(struct ttm_object_file *tfile, if (unlikely(ret != 0)) return ret; ref = malloc(sizeof(*ref), M_TTM_OBJ_REF, M_WAITOK); - if (unlikely(ref == NULL)) { - ttm_mem_global_free(mem_glob, sizeof(*ref)); - return -ENOMEM; - } - ref->hash.key = base->hash.key; ref->obj = base; ref->tfile = tfile; From nobody Tue Sep 3 10:27:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdF1tGjz5Mkfd; Tue, 03 Sep 2024 10:27: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 4WyhdF0bKbz4sc7; Tue, 3 Sep 2024 10:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKkmutQweM84wV++iPj0ZYQGmckerRFDUOuZBhjOBoY=; b=pMVfF8hAm3BJnONpBu0pKTRxWeQcSP1PUSAbR/wCRUBLa/AZCr0SBoTYHJ/2kbQiC2k4g5 pvL8Vc6jDWpQAx+1yUSdXv1RkWRmMbudaXd1r9I4rMlg9i8MZVWW9OjB4PUGA5rmHLMe/3 /kHvzh5gE41e0zHsovgO65/YGP/khfPRVfRvIvxkr+RamYo6S32yUsVqa2MiRCnyW9Ik0E xD3jQooa5YLhKvDMXo3EBg++B14FlnDiO3u0o4a6inRla0IXaccwEPKSFTjkixrI9FPFdK Eewlu93tcm6JvRMnorUXVN2kFcVCNh9AJS0ZmpBEIlVUmYub5s3bpgNYkzEPhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359233; a=rsa-sha256; cv=none; b=FnEol6GoUH2zUKOomGVCZneaXL805j9Bq2zqEhCeoe1Cndyy1csKoSmTkJZK3SKChL1U0M Xz/N/zwRAuntP4FFMCBz1/5pfe759f0o38UxVkypm8ixwrK2/2gHFVihjkuueqGa7d6OKD 0kKKVTcdpj6Mt5YtpjJPeKX7kpMy4P2g51AS3T0cgPPEb8ffpFkS7xYOXRUqR7wFXPLvRd jN/rU8BlwXGeHjF5B35ms5EtiQDCv82oOtRhYLH1TRHNM+prS8kuc+GSVUTcRDWKohsEuE C/KHs8/E+1PVw9wd6uMKOE7Nt3kyhO+/KV1+6DYBCMQ863L+1WPjUpbB4+aJnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKkmutQweM84wV++iPj0ZYQGmckerRFDUOuZBhjOBoY=; b=vjSnaQmICt7sNF6PeVw19l8L7yvaXFMLuThs/YPFXmCgMuxyXZf3QssGpb1y2VOfGZwEQb GvtZ70S2F/8lGcrupAGodN+ihsBti9Q4xBsmYFRfnIFxy7bgjTvMeu7n+kqSxuLRJiE4N1 Yhs8NbzKajPmhf9vv8hCBiU1QCwuAiYhaMzxglVIW1cbzthLeOXgIwSGasrrCzFPZQP/3Z O+rzjeL0MlACuGcYNgklSV9GuvWtHOagOxgnluMF4ObpC+LZBl1Z3JIifGcSlPiQFake0e KlJijXwWDKQNXB5+Q0GoH7sNQMhdEAU2R8t1ZLtKRGEP8olSi2ReM5mm5ZPlQA== 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 4WyhdF03KnzcVR; Tue, 3 Sep 2024 10:27: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 483ARC9f010040; Tue, 3 Sep 2024 10:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARCjh010034; Tue, 3 Sep 2024 10:27:12 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:12 GMT Message-Id: <202409031027.483ARCjh010034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: d1a89bd9b6eb - main - flexspi: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1a89bd9b6eb1524902b619fa092c7d6de63e623 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d1a89bd9b6eb1524902b619fa092c7d6de63e623 commit d1a89bd9b6eb1524902b619fa092c7d6de63e623 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:27 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:27 +0000 flexspi: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/flash/flexspi/flex_spi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/flash/flexspi/flex_spi.c b/sys/dev/flash/flexspi/flex_spi.c index 766a1cfaa332..9382b237ee71 100644 --- a/sys/dev/flash/flexspi/flex_spi.c +++ b/sys/dev/flash/flexspi/flex_spi.c @@ -781,12 +781,6 @@ flex_spi_attach(device_t dev) } sc->buf = malloc(sc->erasesize, SECTOR_BUFFER, M_WAITOK); - if (sc->buf == NULL) { - device_printf(sc->dev, "Unable to set up allocate internal buffer\n"); - flex_spi_detach(dev); - return (ENOMEM); - } - /* Move it to per-flash */ sc->disk = disk_alloc(); sc->disk->d_open = flex_spi_open; From nobody Tue Sep 3 10:27:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdD1hwTz5MkRK; Tue, 03 Sep 2024 10:27: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 4WyhdC6xZNz4skr; Tue, 3 Sep 2024 10:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyLEp43Yrz1iu7VF5bl3uO4oQGLnh8nIrNUYcXg9stc=; b=uo+GeeAtfG2XaiVeJQAdnH13t539dMpdyuj4r5/rkOS6BKSWb+eJJkGtrY0E1Jd+gGarmr EMxTH/SHPutw8S0UyzriQQVhF9gLOyvNBn7SjDSnr6rVhu6sXNnZ3OiYeO+2FtYygtd0kM y9/rF3L9SaULxkGP2Tf8vJBAojQIx8zKJOmCw2D2UIU6rwT5E4RZ5UNjqBArbrGJc1chzn ayfmE5sFfWdUQdb8+6/T0h1oORSXs0HK//GizYv5Mnx04iGk7mHVvyoQC3D2Sdpju+YO81 DCadZZ+TUkEee2PQzlzEkePcEP+QCG7WmIKYX4/6pbakaoV/Zds9xPsQzc9bnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359232; a=rsa-sha256; cv=none; b=mjE94q8D/9+H9S193V421AscybRqMrUHeRrSivbEugEm9HaPQ2pVNOwfNJdMt22Zzzp7Wa eKmZY/hNX5DCZG99VCAylzOlQnEem99Y+Bts/ENTm99jvq62yPTPUark8rTUQpIjXe8T4x WbxdXgUeX6tOBo6h/L9/FVz9oCWgNvNwf65ycEmIkWgCoYvi9YJZ/gU/ztOyNvr/H+k+fJ DErZ/7wOCueseIqeGrzpxKiFGR+cIxrw4l/jwcxD5snROiU4ejceFVGk7IPAaucEHxZVpF BGmTj4J/O9pDfGCKKsOk8axklky3VTyEVqN879DEKSmfiLwBo1yX0uPi7gJwPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyLEp43Yrz1iu7VF5bl3uO4oQGLnh8nIrNUYcXg9stc=; b=fTSovKTMw/+4vi3Z0xtRa2GeRazMArROcTjX9sbgVaPd+9Geo3/e44GvHxudt6s0ggB+H3 b4LAHise8XvfegLnZUfBCmlftOqaZquFKmxgcm7wSUA2fcUO5BBOVYrXUVvVQ/oRa0Y+Jp VrPStcw2kV/EZ9Fk0SyLmZQUX1/z/xlnSZSCWZr71wLJQz9aGbUlepn939CANroUNdUGAu tifvME0QZkk6rHRG6749z2pBjfUIWNwwBoQJpjE5J31Jl/KOb8CGiw2RNtQkiMpRuCaVMP 5pgYPFh61BJpik1W7BX43eDge3FhgZmeET1lNxjCNww7guJkYYTW3IpezqWVdQ== 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 4WyhdC6NfpzcVQ; Tue, 3 Sep 2024 10:27:11 +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 483ARBEc009979; Tue, 3 Sep 2024 10:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARB4A009976; Tue, 3 Sep 2024 10:27:11 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:11 GMT Message-Id: <202409031027.483ARB4A009976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 48741f4ceca7 - main - etherswitch: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48741f4ceca71523aa1fa8da3bb78b184fad4aca Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=48741f4ceca71523aa1fa8da3bb78b184fad4aca commit 48741f4ceca71523aa1fa8da3bb78b184fad4aca Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:27 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:27 +0000 etherswitch: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/etherswitch/infineon/adm6996fc.c | 22 ++++------------------ sys/dev/etherswitch/micrel/ksz8995ma.c | 22 ++++------------------ 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c index 2c6c83a4388d..64f61df93db1 100644 --- a/sys/dev/etherswitch/infineon/adm6996fc.c +++ b/sys/dev/etherswitch/infineon/adm6996fc.c @@ -179,10 +179,6 @@ adm6996fc_attach_phys(struct adm6996fc_softc *sc) if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_ADM6996FC, M_WAITOK | M_ZERO); - if (sc->miibus[port] == NULL) { - err = ENOMEM; - goto failed; - } err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], adm6996fc_ifmedia_upd, adm6996fc_ifmedia_sts, \ BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); @@ -255,12 +251,6 @@ adm6996fc_attach(device_t dev) sc->portphy = malloc(sizeof(int) * sc->numports, M_ADM6996FC, M_WAITOK | M_ZERO); - if (sc->ifp == NULL || sc->ifname == NULL || sc->miibus == NULL || - sc->portphy == NULL) { - err = ENOMEM; - goto failed; - } - /* * Attach the PHYs and complete the bus enumeration. */ @@ -281,14 +271,10 @@ adm6996fc_attach(device_t dev) return (0); failed: - if (sc->portphy != NULL) - free(sc->portphy, M_ADM6996FC); - if (sc->miibus != NULL) - free(sc->miibus, M_ADM6996FC); - if (sc->ifname != NULL) - free(sc->ifname, M_ADM6996FC); - if (sc->ifp != NULL) - free(sc->ifp, M_ADM6996FC); + free(sc->portphy, M_ADM6996FC); + free(sc->miibus, M_ADM6996FC); + free(sc->ifname, M_ADM6996FC); + free(sc->ifp, M_ADM6996FC); return (err); } diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c index e512a86202c6..ccd7dbffa9e9 100644 --- a/sys/dev/etherswitch/micrel/ksz8995ma.c +++ b/sys/dev/etherswitch/micrel/ksz8995ma.c @@ -225,10 +225,6 @@ ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_KSZ8995MA, M_WAITOK | M_ZERO); - if (sc->miibus[port] == NULL) { - err = ENOMEM; - goto failed; - } err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], ksz8995ma_ifmedia_upd, ksz8995ma_ifmedia_sts, \ BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); @@ -305,12 +301,6 @@ ksz8995ma_attach(device_t dev) sc->portphy = malloc(sizeof(int) * sc->numports, M_KSZ8995MA, M_WAITOK | M_ZERO); - if (sc->ifp == NULL || sc->ifname == NULL || sc->miibus == NULL || - sc->portphy == NULL) { - err = ENOMEM; - goto failed; - } - /* * Attach the PHYs and complete the bus enumeration. */ @@ -339,14 +329,10 @@ ksz8995ma_attach(device_t dev) return (0); failed: - if (sc->portphy != NULL) - free(sc->portphy, M_KSZ8995MA); - if (sc->miibus != NULL) - free(sc->miibus, M_KSZ8995MA); - if (sc->ifname != NULL) - free(sc->ifname, M_KSZ8995MA); - if (sc->ifp != NULL) - free(sc->ifp, M_KSZ8995MA); + free(sc->portphy, M_KSZ8995MA); + free(sc->miibus, M_KSZ8995MA); + free(sc->ifname, M_KSZ8995MA); + free(sc->ifp, M_KSZ8995MA); return (err); } From nobody Tue Sep 3 10:27:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdG46z5z5Mkcm; Tue, 03 Sep 2024 10:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdG1r09z4scC; Tue, 3 Sep 2024 10:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LUdg2It9loqIGAMlkEmeu6c38m10eoDbNcgo/zi16ho=; b=foV07igcUyOOxNrFIBAIeQhen3PMZ0NyDAIah+eEOfCIv+NJf6fbEd6GYeql4JPaXtsCpf l4bF4dgaAUQhI5JjhLxinwycjwNxQQYOehtv0SydLcc9yxO5vrCZnaduF8sChl4oERaWdH Ly3k88A9Kqcnc1qBKd9V8aRbqUa7+EYK5dorhj2XtlWGjTbq/9pSlbiRfOvNZOhXkqDneF RhDF+FqGt93jEWz0ahDcMPC9oVUqUmkSjSwwTQp/UArV3e9xjodeoeNCk1gnGfXj4/w2Da v7PIQyMzqhP1FfUkVECGsZ9TCbR2Gk5Zd7dXb15frSBWgNQmOFFdkBnVIdqISA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359234; a=rsa-sha256; cv=none; b=b55ExUXJmFipvBcw7FE+oacg4bJFciFrpbJ7zp7DxUMgEMR4tuk0HE9xOiHzoRwISdNlN7 1kIcJmpFzM2+sz2J5Umccu1lvJW7zX4oMLGe9ToF2vU6jRw1Yu1Sp7Gox4j+HfeKJtqG/I 550Jzc8coDOeOjljlRbXszDROi/e7d0vYUxhaScvqql8qxTB+Sbp0+qHP4nzv2mBGjwwJ6 aQ4I+TCSMIR7bhbevV0odUmbdAK3+m3lhUtDn7uwpQ4XlcpJuu/TUrDe4NKcV/DgHYEdRX m7ecAb9erkN8TEu+LZWe/iIqtMBJwRytm9nj8HvqMfaQPBBQf3bZZdd1QzU2tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LUdg2It9loqIGAMlkEmeu6c38m10eoDbNcgo/zi16ho=; b=shbxsWuxQmX3i8RFR/B4E1XnIyun3TTaqckAqSKpjPIAosxlfiXknuKbmjhkuDfqneQYBs hNg8nmDjYhN8AlxJqkbibqfcBrBIkChZQ7fIKQxfuHkuDORTwHMdMJ6jTmBtB4laX6HJL5 9F62navnDGgh+XvLm+pFe0fziG90Uk5Dw8p9WNj+mf6amBN70Q5jLVwKhdG0GIBZc9I76e b8k3M+7aAwhfxTmf57EaXi4yyCwMrMQgzxMMJBfm8wT0hez2aXSFHb2IOxZ/CGDvW/omOa gOtLgGPRsyFNJn0jKRgll7TD6Q1epejiHL4uS+rwyUT2M6xqfvslcJnoJJjXKg== 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 4WyhdG1SY8zd14; Tue, 3 Sep 2024 10:27: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 483AREAL010088; Tue, 3 Sep 2024 10:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AREXx010085; Tue, 3 Sep 2024 10:27:14 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:14 GMT Message-Id: <202409031027.483AREXx010085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 4d47c7ca7baa - main - fwip(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d47c7ca7baa1ae76cc1fc72ec85b475f1efd41d Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4d47c7ca7baa1ae76cc1fc72ec85b475f1efd41d commit 4d47c7ca7baa1ae76cc1fc72ec85b475f1efd41d Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:28 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:28 +0000 fwip(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/firewire/if_fwip.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 6350ec9cb56e..41143e2e59d4 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -304,13 +304,9 @@ fwip_init(void *arg) xferq->psize = MCLBYTES; xferq->queued = 0; xferq->buf = NULL; - xferq->bulkxfer = (struct fw_bulkxfer *) malloc( + xferq->bulkxfer = malloc( sizeof(struct fw_bulkxfer) * xferq->bnchunk, M_FWIP, M_WAITOK); - if (xferq->bulkxfer == NULL) { - printf("if_fwip: malloc failed\n"); - return; - } STAILQ_INIT(&xferq->stvalid); STAILQ_INIT(&xferq->stfree); STAILQ_INIT(&xferq->stdma); From nobody Tue Sep 3 10:27:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdH5Zd5z5Mkh6; Tue, 03 Sep 2024 10:27: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 4WyhdH3FX6z4sg5; Tue, 3 Sep 2024 10:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CTtaKgVhwStt4k2yZsFWZ2Mfy7IxpzC0sf9+Opz9JKU=; b=r6hx8TgelJ/zEtIrXQTHGix1pzqa6bbN0xeBv+cG0g5KuCAdLgm34VsounSkvzYY+0YBW0 BZ1/Tt4AM/WWl0W2gnZRZxE3y1rUXn2639pgMuwckxbzwv2gP0zJIbLBk4fNejtMbNl5HK MAIw16fHld2nIi8kiJnQt0RfIfG6IEUlVYFz24a2Gc+v1R9Km7Pb6sSuNl9jh4oNb3AkbU e2KmMFvMFJNSjPgfAsw657WG9NXNzfzbFmJp24+0Hc9zCLM5mRZfxyFTtLs02y0e3XnPy8 mK90THg0zLgRxv4nGLg3xNjIOvHlhxFEWw0/5Xn75qhKonApdB9EEUUUvGGntw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359235; a=rsa-sha256; cv=none; b=u6jICHZFAmBGXbGrSEc/xSp0QoMXPazxadaAF0sCrwbKWq7PWzmB5mvc1AojwXRIOJc1hq EYt9yjaGI8d+Cbm0ZaUaj/s5n7WImaSJhH98Db4SdWEuy/LslS7IeOXQxkgdzT/g8tPAUs 8v++9xUfeB5gidNLy7Mx8v9fNeeArH7uXFxvuFLDn5tAd80KzAdkpmLnygiuoRoJEJnEKu qAw70qmO+iHhDY6azE4Mv2LKFskUo6ko/LTD7vTMCVRxHUMkug6IL6NhyLalCWPQfssnNs 4bWvqCTORQGsvmB7vNwAo0u2elVcwijDNGfTh1sYSsDTk5bpa9jijFKZmmZKJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CTtaKgVhwStt4k2yZsFWZ2Mfy7IxpzC0sf9+Opz9JKU=; b=oABoibiMtMy/821BAzY3k/Xc+2IjsKNHvYqaWPjvvvP3BPpkLsw8dQuUuLUnL3oFs0pJy7 Ku+pmDzeYFRaKPDoAjaGnabcT9O9H3hpaEddAoiC90mnmUT8xP3/BCx+rtAVwckm7pozPS Z6gvVogIEwYfle3j/HzAfMQBUhsEuxxhA0PVCb7SvTXc67AuWJGZR9ZYuknxj1GNHWaeDs R0BvRS+r0Fdf/EQjvcn/hxpx14nCfUMiNjtJQULsB7fBCwXwUiD2ij8VKcg7ZfXewFwW1o bQBxvA904q6yUVtisq6o5bdogn4KFYbDHYYJ9esI9ZhcrzLZAEKkvxFJth3MTg== 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 4WyhdH2fSYzcnH; Tue, 3 Sep 2024 10:27: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 483ARFpo010136; Tue, 3 Sep 2024 10:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARFJM010133; Tue, 3 Sep 2024 10:27:15 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:15 GMT Message-Id: <202409031027.483ARFJM010133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 28e413a69983 - main - hpt27xx(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28e413a699838df6fa5b0504c9ceb92a515037d9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=28e413a699838df6fa5b0504c9ceb92a515037d9 commit 28e413a699838df6fa5b0504c9ceb92a515037d9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:28 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:28 +0000 hpt27xx(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/hpt27xx/hpt27xx_osm_bsd.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c index 225c91b44f21..e086a1554940 100644 --- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c +++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c @@ -94,9 +94,6 @@ static int hpt_attach(device_t dev) size = him->get_adapter_size(&pci_id); hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); - if (!hba->ldm_adapter.him_handle) - return ENXIO; - hba->pcidev = dev; hba->pciaddr.tree = 0; hba->pciaddr.bus = pci_get_bus(dev); @@ -114,10 +111,6 @@ static int hpt_attach(device_t dev) if (!ldm_register_adapter(&hba->ldm_adapter)) { size = ldm_get_vbus_size(); vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); - if (!vbus_ext) { - free(hba->ldm_adapter.him_handle, M_DEVBUF); - return ENXIO; - } memset(vbus_ext, 0, sizeof(VBUS_EXT)); vbus_ext->ext_type = EXT_TYPE_VBUS; ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); @@ -168,7 +161,6 @@ static int hpt_alloc_mem(PVBUS_EXT vbus_ext) f->tag, f->count, f->size, f->count*f->size)); for (i=0; icount; i++) { p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK); - if (!p) return (ENXIO); *p = f->head; f->head = p; } @@ -1109,10 +1101,6 @@ static void hpt_final_init(void *dummy) for (i=0; ivbus_ext = vbus_ext; ext->next = vbus_ext->cmdext_list; vbus_ext->cmdext_list = ext; @@ -1327,18 +1315,13 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, stru if (ioctl_args.nInBufferSize) { ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK); - if (!ioctl_args.lpInBuffer) - goto invalid; if (copyin((void*)piop->lpInBuffer, ioctl_args.lpInBuffer, piop->nInBufferSize)) goto invalid; } - if (ioctl_args.nOutBufferSize) { + if (ioctl_args.nOutBufferSize) ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); - if (!ioctl_args.lpOutBuffer) - goto invalid; - } hpt_do_ioctl(&ioctl_args); From nobody Tue Sep 3 10:27:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdK0Lz5z5MkVL; Tue, 03 Sep 2024 10:27: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 4WyhdJ40zrz4scb; Tue, 3 Sep 2024 10:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hGTGHlf/jGA5DKRujz4ZUNNAFGl+6eE3q5M/RLTBY90=; b=fdgzFnN+hCU4yG2fxl6H5tkttTp+PkQd/DU5Qd+HtaOuqRQ9v1Rg5kBFxaAIjbS2rWTfUY sCzH9BNIpkyYZX/Ge8EE6ylPorIeV+U6DrOIVhgNE5Xl2NqCaCZrrEtFzi4Vhgmg0rAyAD ZJVRHq3SDs0L58S7oKVH/5NHdlwMpmSUS2SFSK+WpevtfFZcPXdsxW8x9d83HZkSSU+28o xDgfN3qD5gsVXWCOXq75wx7wpVrYbN1dkpBXCHdzEmuwfK8TyjwStBBiNYJYD0XfWhQTZB bOnYNysOxKFAGdqOrMhj6DsQyue053C+LDE/usakXzIE54ZknVWxNJAcOr5RbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359236; a=rsa-sha256; cv=none; b=VtDQ5QYpmBdx8ZBP/yMVPOqzFcl5cYUsU5kvPcGkjNRcrQcS9Atlavz3I9xjjRhWKa7myq 8ZTAtNMb1/Us5x3IqvX3GMNSsHMCe36srVSE5y7I6+g0kB3beKsGOpHLYyYnS7pBhvF9S1 wrfKevP71us5YYYJyqcPm2rjZ68x2ZKHjcAFOn0ouP0mQ3TZOdHgDYZK4zm4LCuMAuDur0 mu/fZwjVmx+QoGZoV5ULKmnv+ASGxJhUMXpjkv+b5LCJqou/nKnHCi0HusFJIeEDN0Qqey VD3GCl+I+uXpbaH4Om5kuhVQHK7atodfT5RCT6x40WL9jUMdH8n6qVA02F2aaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hGTGHlf/jGA5DKRujz4ZUNNAFGl+6eE3q5M/RLTBY90=; b=pjj/lqI1grm8wYud/TmTaj8MBExYlExffJVzrvpuRb3k+1jLO68bUelmu9RTo2Wt5CPuJB hHMxRPE7qs4BaS4kawi09BW/n12+uMpN1fVg7C+DbhxTl6OGHKutzCcVy7xa1XLacHpTV/ ZEZHBGqhhVgLla9jOT6vxvpAFeSXtmzltWcdqoJ1bdLFqhCjtHwiqLdAaDFQA9oXNnBQGR JrspKgVua/Njto53/XWAGiOBt6UW9LPjMLT0yL0YT9CHbdFwRtKw8ANsmXhlp3V5h9dzsI 4ibJlGEE499isV/yTCcXqDnncbC5xOia2cYj+B+BmnRJJQETT3RCOPNLwmezEw== 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 4WyhdJ3ddLzcb6; Tue, 3 Sep 2024 10:27: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 483ARGkg010184; Tue, 3 Sep 2024 10:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARGQ3010181; Tue, 3 Sep 2024 10:27:16 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:16 GMT Message-Id: <202409031027.483ARGQ3010181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: a3ec5d3ee757 - main - hptnr(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3ec5d3ee7579a26790a86ca4c074512946ab964 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a3ec5d3ee7579a26790a86ca4c074512946ab964 commit a3ec5d3ee7579a26790a86ca4c074512946ab964 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:29 +0000 hptnr(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/hptnr/hptnr_osm_bsd.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c index a8ac77c5ad5a..7426873964fb 100644 --- a/sys/dev/hptnr/hptnr_osm_bsd.c +++ b/sys/dev/hptnr/hptnr_osm_bsd.c @@ -165,7 +165,6 @@ static int hpt_alloc_mem(PVBUS_EXT vbus_ext) f->tag, f->count, f->size, f->count*f->size)); for (i=0; icount; i++) { p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK); - if (!p) return (ENXIO); *p = f->head; f->head = p; } @@ -1389,10 +1388,6 @@ static void hpt_final_init(void *dummy) for (i=0; ivbus_ext = vbus_ext; ext->next = vbus_ext->cmdext_list; vbus_ext->cmdext_list = ext; @@ -1610,19 +1605,14 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, stru if (ioctl_args.nInBufferSize) { ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK); - if (!ioctl_args.lpInBuffer) - goto invalid; if (copyin((void*)piop->lpInBuffer, ioctl_args.lpInBuffer, piop->nInBufferSize)) goto invalid; } - if (ioctl_args.nOutBufferSize) { + if (ioctl_args.nOutBufferSize) ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); - if (!ioctl_args.lpOutBuffer) - goto invalid; - } - + hpt_do_ioctl(&ioctl_args); if (ioctl_args.result==HPT_IOCTL_RESULT_OK) { From nobody Tue Sep 3 10:27:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdL1BBFz5MkPQ; Tue, 03 Sep 2024 10:27: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 4WyhdK51wsz4sqx; Tue, 3 Sep 2024 10:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nwJjeN5OpHYSN/OVy9CNTIJChYEraCGfmdtDpqG+l1g=; b=lJJQCxQA3S4HKuFssa7M0WFI8uJR2DsoAb+qTcyldaVsF3OsfxnpPl0/SYLdvGw2BHALsR HS8AbsP7ETrkyPSb4m/7bjwsTADwH1R4J01N3UQxbZhlEXHEJW6qiexDvFiBoq0Bn7xDbn Yz36S5yhHGXDa9y1tmiTmzJgfUeKmjpYJiW127XisICcxx/WX9T4810ttYtmWqheUJDz6W rYGfLffaNgmwkiEF6HaD5mjkg7oc/AEXh/UHEKTAS9f97HS43x+Q3zdP3P3rruanSUOtdx RoN0TFb4x3XFMz6exvhFlXdLkD3CWOSHYx4K8TRJVmej2QHRRmMEIO/sYbfn5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359237; a=rsa-sha256; cv=none; b=mTsSHw2FZKVU99erL3Av1D60njeEkhl7OcXGMYHCcth1fYdmwuyzja0y9OC5E2Sfwp5dio EmP7Xr86S3zIg2LJxOUEJhnk4fgin0m6tsV6j0KxwTwR8G/Ltxp9W1VkFBtmywt7BP98+2 y6tiQDObcooV/S3hlHQWNG++BLELh0bTedi2HKFPRHjmbeohHUn2NcehQEgOUaGnQl7JhX vc4rL8LY7Sjz4aLTi34lrU+KeoenPOeEx6QLaa1geTsOG35npmC2NK4AzdyYO7xY93hx9f 38WG5IeoOxFbsSeEf6fnsJnqBh/J1oXiLrWwCavZhT5z4GslrXBlBQGHodjK3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nwJjeN5OpHYSN/OVy9CNTIJChYEraCGfmdtDpqG+l1g=; b=lRx2y3R+cUbwBfDkwvgJj9o4DLJjetjCLoUX+ST0XVSwgcLMhhevRwO7+TZMS9WYCJ6k2Y hd6Gczm0pOj0UZDWoIz7ItU7DrAwOTrTURAg2D7OrOBQdgPzC3bGX/ReEGxSvoZAO+WOqx ipZvrgtZiqip3/nDnSwujDiEK/GBqtcidmDLXbs9eVahw1QrQ5o7ZVh5b9yx2DGhVnUcC5 6UxoLbmvyIIn5UvaYeAqUoL3G35M+wDWC2jbKupe1zsqSVNT7RuANb5ZJM6TK/lJSwuYh7 lnrE44mCI2yq7t6PkOrBh/f/dCKKARnM32lcAbFqba+Csa/1EZT5117EXAFZGA== 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 4WyhdK4dMVzcFf; Tue, 3 Sep 2024 10:27: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 483ARHn6010238; Tue, 3 Sep 2024 10:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARHva010235; Tue, 3 Sep 2024 10:27:17 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:17 GMT Message-Id: <202409031027.483ARHva010235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 92b0370ec65d - main - hptrr(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92b0370ec65d5287a1deec84fd513e320a8da736 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=92b0370ec65d5287a1deec84fd513e320a8da736 commit 92b0370ec65d5287a1deec84fd513e320a8da736 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:29 +0000 hptrr(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/hptrr/hptrr_osm_bsd.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c index 68e9af3aff02..42866c1d4297 100644 --- a/sys/dev/hptrr/hptrr_osm_bsd.c +++ b/sys/dev/hptrr/hptrr_osm_bsd.c @@ -1032,10 +1032,6 @@ static void hpt_final_init(void *dummy) for (i=0; ivbus_ext = vbus_ext; ext->next = vbus_ext->cmdext_list; vbus_ext->cmdext_list = ext; @@ -1252,19 +1248,14 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, stru if (ioctl_args.nInBufferSize) { ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK); - if (!ioctl_args.lpInBuffer) - goto invalid; if (copyin((void*)piop->lpInBuffer, ioctl_args.lpInBuffer, piop->nInBufferSize)) goto invalid; } - if (ioctl_args.nOutBufferSize) { + if (ioctl_args.nOutBufferSize) ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); - if (!ioctl_args.lpOutBuffer) - goto invalid; - } - + hpt_do_ioctl(&ioctl_args); if (ioctl_args.result==HPT_IOCTL_RESULT_OK) { From nobody Tue Sep 3 10:27:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdN1SYlz5MkRh; Tue, 03 Sep 2024 10:27: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 4WyhdM6sJFz4swd; Tue, 3 Sep 2024 10:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EIQQ1knZPkQyUwNUnwWIcUuEP4QCZLA5R2sxiwAT8Lo=; b=VyJ/qrNBV4GN/wm/z5zIYOVyMExgK7+r8qwbKMErULYvY6FIaq6mNtSEuvGKAYSlxwS0EK As6iCA2o5KAixKVZPSj+avsq0TQCE07YuW6X5YyG/EuisfqlKXkcHjAiHOaYmWiB5pf6TX 9mMHbXNaE1SWQQvNB8XRwsIgLlYf2oNs6Q+QdbMZuHj5+gDTNUxMqLFXGHWUAGSfpoc9a5 BtX3qPBNW0Tb9ryxztcBy1jdf607AR+sUHa51jvcnbpJivs3KVXg5nOXhnISNHsow0GfuJ ZXLSz/NS0Yf2rhth1fUNlPwaB1G3p07+Ao49JFVlNFOeX/2RdGppHszX6DYSIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359240; a=rsa-sha256; cv=none; b=V7vdf12Q+moc+fxAT+D9UHaU1ZVUMiypcxss0nR2SvgT0MsOSMGU6Asil3waaaCuVWla7J pt7SG4E5DPoTBFZb363kNgWm7ctN+3LBA3aagm9ScUZlBBnXoN26EtHKpPhm1WiLvLDQaM p6TII7cf+5aNidHoGhLMt4zQ7IOpL8MxBJ161Zrb8ziQl6F3B/W/F8jIVu9Ii5teNVIVdQ JEWnfH0n8N/iYidNiovlTnZ1geeYQvXxKzZiJ3+1jPnZncFYTBiP8l/7RCYpkgjuA03ksh 6FgVVxe1ZsuarS8qaVlwwQvMNQvEr4Z9lNUYeuoSqtj5UTosWLwkL7lam+V65A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EIQQ1knZPkQyUwNUnwWIcUuEP4QCZLA5R2sxiwAT8Lo=; b=wwC0bdp+Tnn2GYkFYfUcg1t2eQy+DkzVAoVlD1svBZ3b+ZNgOrvlwLI1a96BkUKiZEuVAr Q/xPOUbF3plG3MEEtdeQUrcmIFjkE2OWEK7jkYHx25mrEwoajyFL0afVLK9Awax1KadpKL 4ti0bEM7aqciTirBaMqdguyu4rLZLDeZtmsS4EKGrXyQbAa7acia9cq0QY/fu0DMd07l67 njKKT1g8XrNDLp9x+Uw7X6bw4Mi4yy+nXcAHgQZ1DiLBKMBPO2rmJ0SuXEsnrqLvrZ9K0/ yeEAaMfhdrnbWBi57NMR9xXQ4P1CR60LckzRjWmG6hz404QZrWSYFt/YNIJF4A== 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 4WyhdM6S9dzcb8; Tue, 3 Sep 2024 10:27:19 +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 483ARJnT010337; Tue, 3 Sep 2024 10:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARJHs010334; Tue, 3 Sep 2024 10:27:19 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:19 GMT Message-Id: <202409031027.483ARJHs010334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 40a6bbc42841 - main - iser(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40a6bbc4284111790d9240f8a24ef11a9a9ecb07 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=40a6bbc4284111790d9240f8a24ef11a9a9ecb07 commit 40a6bbc4284111790d9240f8a24ef11a9a9ecb07 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:30 +0000 iser(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/iser/iser_verbs.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sys/dev/iser/iser_verbs.c b/sys/dev/iser/iser_verbs.c index f5f057b961ef..f0c7e524ccf0 100644 --- a/sys/dev/iser/iser_verbs.c +++ b/sys/dev/iser/iser_verbs.c @@ -212,8 +212,6 @@ iser_create_device_ib_res(struct iser_device *device) device->comps = malloc(device->comps_used * sizeof(*device->comps), M_ISER_VERBS, M_WAITOK | M_ZERO); - if (!device->comps) - goto comps_err; max_cqe = min(ISER_MAX_CQ_LEN, ib_dev->attrs.max_cqe); @@ -280,7 +278,6 @@ cq_err: ib_dealloc_pd(device->pd); pd_err: free(device->comps, M_ISER_VERBS); -comps_err: ISER_ERR("failed to allocate an IB resource"); return (1); } @@ -343,11 +340,6 @@ iser_create_fastreg_desc(struct ib_device *ib_device, struct ib_pd *pd) int ret; desc = malloc(sizeof(*desc), M_ISER_VERBS, M_WAITOK | M_ZERO); - if (!desc) { - ISER_ERR("Failed to allocate a new fastreg descriptor"); - return (NULL); - } - ret = iser_alloc_reg_res(ib_device, pd, &desc->rsc); if (ret) { ISER_ERR("failed to allocate reg_resources"); @@ -509,9 +501,6 @@ iser_device_find_by_ib_device(struct rdma_cm_id *cma_id) goto inc_refcnt; device = malloc(sizeof *device, M_ISER_VERBS, M_WAITOK | M_ZERO); - if (device == NULL) - goto out; - /* assign this device to the device */ device->ib_device = cma_id->device; /* init the device and link it into ig device list */ From nobody Tue Sep 3 10:27:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdM2xjXz5MkjC; Tue, 03 Sep 2024 10:27: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 4WyhdL6Gjfz4sp7; Tue, 3 Sep 2024 10:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cANU/sqJymckDMTDZfeRXN5Inxu9BwtfL+2Djc/OwMc=; b=n1HI6LqN3iS1AQqES/QJ1kiKpGuQf8UaisY1aAshFyALb/yzeKasvMx2TEXKVoDhYODwqK YXuBB8uPpM2UlpjU0T6E9EWRnQ7eYBPlx+QuwnFDPsyK2bN/0qbJdPWETMLKqnmj1SDrF6 VtNod4ZrZX3r8hvPo5qQS9+adKaJUgBFK/CN+HzVm8kCL3eKuJ4F1Z59jJwiKrUzghEMCe u76FFO0IhdGnbULdJlwbzt40kstxcZzEj3+T+1O1p6iHJaxV0Q8eu5Abqhhb4DI47DLTa6 9+08UzwstMV5rz7hTWz2iKm394nnmdMcYTsZDayl9OZUqhV9UfTHoqp/ZZAxiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359238; a=rsa-sha256; cv=none; b=p7vSrZVWfxz+A1t1pSGrRM5lS1bsg1q5OP+yW2T+ofgM9rC76Pt3q+jhLi1RhFNANaZ9u7 1QnldG78zdC67dKzZ79YpP0mgB0xNI8WxRipSlG1WujxNGVF8/cXu4/6EKhgTNHCg13Gqw Uda8Uo6N7y/VG4XG8YqIPDLhWsIj+TbhSW9bTEVRTaT1RYTRoZlKnPL/skEQdc+e+sdCYw eCOtKhhSUz/FQ1BEbGK9zxyPKrmbV2HW60YGLV8OHkqtuKQ0Gu1uEbmk0tFTQx78MjZosb 3kzNXMNM8cUruSRsg9yU7krJKN56tlBrgdZoohmfep/1/70bvcqqmDdy+H0Jkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cANU/sqJymckDMTDZfeRXN5Inxu9BwtfL+2Djc/OwMc=; b=U9GcFQzVrRmlgMUIwU2cYrYiW6RyOz3v5wMgRo7HDfX57/Y+YN6JoxQp1P2VMWHBae1xN3 dx1ypRdvFkvJxPLcwEBcwg/+todoa/VCOCuzk8y0HVjazOYYm3u6bY+Eyp/fdx6RMtLmaI qza/OU4le5qQIQOFhrr+LhRRT+tdqAuFGpZrKnoHUkofKNaHpP9dCJz6S5Uxwx/MZS+r48 RZASKsOQ3AFRiEJyiEIi4/Cs0bCclmhRIDbNA+MwGurGI8GInMmGEgnSwSPJ5y6FBGF3Dl QYlmmzOWGNebUEQfCbA3hM/Os9yRUfkvehF84ohEvG6BkYyQ9ui6uvOA99txug== 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 4WyhdL5rJwzcb7; Tue, 3 Sep 2024 10:27: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 483ARIjk010289; Tue, 3 Sep 2024 10:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARIHD010286; Tue, 3 Sep 2024 10:27:18 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:18 GMT Message-Id: <202409031027.483ARIHD010286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 5f97656fa334 - main - ice(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f97656fa334b494d70866cb1bfff406d3efd92d Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5f97656fa334b494d70866cb1bfff406d3efd92d commit 5f97656fa334b494d70866cb1bfff406d3efd92d Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:29 +0000 ice(4): Stop checking for failures from malloc(M_WAITOK) As a consequence now ice_alloc_vsi_qmap() does not fail. Remove unneeded error checks. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/ice/ice_lib.c | 24 +++--------------------- sys/dev/ice/ice_lib.h | 2 +- sys/dev/ice/if_ice_iflib.c | 13 ++----------- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index 659412450fce..7077859cc877 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -426,31 +426,21 @@ ice_setup_pf_vsi(struct ice_softc *sc) * all queues for this VSI are not yet assigned an index and thus, * not ready for use. * - * Returns an error code on failure. */ -int +void ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, const int max_rx_queues) { - struct ice_softc *sc = vsi->sc; int i; MPASS(max_tx_queues > 0); MPASS(max_rx_queues > 0); /* Allocate Tx queue mapping memory */ - if (!(vsi->tx_qmap = - (u16 *) malloc(sizeof(u16) * max_tx_queues, M_ICE, M_WAITOK))) { - device_printf(sc->dev, "Unable to allocate Tx qmap memory\n"); - return (ENOMEM); - } + vsi->tx_qmap = malloc(sizeof(u16) * max_tx_queues, M_ICE, M_WAITOK); /* Allocate Rx queue mapping memory */ - if (!(vsi->rx_qmap = - (u16 *) malloc(sizeof(u16) * max_rx_queues, M_ICE, M_WAITOK))) { - device_printf(sc->dev, "Unable to allocate Rx qmap memory\n"); - goto free_tx_qmap; - } + vsi->rx_qmap = malloc(sizeof(u16) * max_rx_queues, M_ICE, M_WAITOK); /* Mark every queue map as invalid to start with */ for (i = 0; i < max_tx_queues; i++) { @@ -459,14 +449,6 @@ ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, for (i = 0; i < max_rx_queues; i++) { vsi->rx_qmap[i] = ICE_INVALID_RES_IDX; } - - return 0; - -free_tx_qmap: - free(vsi->tx_qmap, M_ICE); - vsi->tx_qmap = NULL; - - return (ENOMEM); } /** diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index cfd848d370bb..6c010cffc0fd 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -830,7 +830,7 @@ void ice_free_bar(device_t dev, struct ice_bar_info *bar); void ice_set_ctrlq_len(struct ice_hw *hw); void ice_release_vsi(struct ice_vsi *vsi); struct ice_vsi *ice_alloc_vsi(struct ice_softc *sc, enum ice_vsi_type type); -int ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, +void ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, const int max_rx_queues); void ice_free_vsi_qmaps(struct ice_vsi *vsi); int ice_initialize_vsi(struct ice_vsi *vsi); diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 4e451bf3fb55..3de79787f6e8 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -631,12 +631,8 @@ reinit_hw: */ ice_setup_pf_vsi(sc); - err = ice_alloc_vsi_qmap(&sc->pf_vsi, scctx->isc_ntxqsets_max, + ice_alloc_vsi_qmap(&sc->pf_vsi, scctx->isc_ntxqsets_max, scctx->isc_nrxqsets_max); - if (err) { - device_printf(dev, "Unable to allocate VSI Queue maps\n"); - goto free_main_vsi; - } /* Allocate MSI-X vectors (due to isc_flags IFLIB_SKIP_MSIX) */ err = ice_allocate_msix(sc); @@ -3518,12 +3514,7 @@ ice_setup_mirror_vsi(struct ice_mirr_if *mif) mif->vsi = vsi; /* Reserve VSI queue allocation from PF queues */ - ret = ice_alloc_vsi_qmap(vsi, ICE_DEFAULT_VF_QUEUES, ICE_DEFAULT_VF_QUEUES); - if (ret) { - device_printf(dev, "%s: Unable to allocate mirror VSI queue maps (%d queues): %s\n", - __func__, ICE_DEFAULT_VF_QUEUES, ice_err_str(ret)); - goto release_vsi; - } + ice_alloc_vsi_qmap(vsi, ICE_DEFAULT_VF_QUEUES, ICE_DEFAULT_VF_QUEUES); vsi->num_tx_queues = vsi->num_rx_queues = ICE_DEFAULT_VF_QUEUES; /* Assign Tx queues from PF space */ From nobody Tue Sep 3 10:27:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdP4hMZz5MkVS; Tue, 03 Sep 2024 10:27: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 4WyhdP0RVrz4t0b; Tue, 3 Sep 2024 10:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BXo68YeQAE+4AB4unaznuq4c8favXiybtQOQvy264AY=; b=T9hTyLNaKnbLa/DF7fhhOLjBsOevZozVPxx0IAX2j3K+KAONNxOGI2rUsAheG/lgnlqmKs ezhh5PFGTz12WnxMiTLeUkcAqLovy6Y+0t24xT8UNmE7aMCEqb4BzsU1C+vx3Th8O3uxJM /JRa4qYPJ4hQwHoOhp1OQTuwEJ4b1uoeAYrPnG+xSZ4/ZTSO+CJDXKaSQhvwCzhXHA7osl R+/JDbmt5LWNZIHbwDHRmYlCChvF56LCBezf6b0Xrgo8BX/vJfTLssUoHJegAK0FLDr8Vz 881huvjjc2CxAMmMD0GB8ZZtWCOoDXXCcvsFC+skSQL4N9yI+UeBF9ugjB7Q6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359241; a=rsa-sha256; cv=none; b=VFCVLle/fDnN9qqnkI7bxI97kQylgPA2VupOwfV+K4bufoGiYEVnsdwfGcS6R41JkyUxzf LEtl26lImUNWEi9AcV1XYE1QeWiahjrbUejOzxfiwNMtE6vTCpWQsp8250Op02txI/SPr2 vAtPA2ZWz4LKeXML1YYbb3CZfdFAmde7EkKqMS9U5JUHmypk8h+PWJIq8V962EH0Tvwnof 8icdZcSf7fElv/9nhUmKfs+ZIIld9X+KSvwYiby3Hh38WUqBfKvSewdJf/iIB9qMcVG8mp 4d2OoiZ0riGA3nsFZ5/58jlneBu1VH/qiq6XS6jQIxIMVYyXBV5U8uMwdryvHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BXo68YeQAE+4AB4unaznuq4c8favXiybtQOQvy264AY=; b=d2j+KV2wRuZM0KC7JJxsPVO2zrJx2ZS9kRe2SUXFD758uUO9lq2m82vRbWy0LJJrquoJla uA+zMjvy+h0sfYr1JRcVXDbTaxciCVSYRvYxbLVFjJVI7ThwfZm4z9+CgnORWzCPNnchhq 4UdPFww4+QsjiP3Q+taUyHQE4lxuRnysQraq0cpHMqKawNn/BZAuNtKfcA+kbgixkETupF 3/rqCp3ZWwJ4OVFKqIQnoOQRzTRwqZw42YK+qG5zgO/BRN5faYbL83s3eJC+9QNetGjx8l DZ8jmUGFGpQ6zSYjUA4Avk37nj2GbkKGkXv0oxcrsr4O+8M9eTiOvLEd+lWhhA== 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 4WyhdP03Pmzd15; Tue, 3 Sep 2024 10:27: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 483ARK7C010385; Tue, 3 Sep 2024 10:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARKpj010382; Tue, 3 Sep 2024 10:27:20 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:20 GMT Message-Id: <202409031027.483ARKpj010382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 1dc7a7b74b5a - main - mana: Stop checking for failures from malloc/mallocarray/buf_ring_alloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1dc7a7b74b5ad37ff7c8dc22f1a710460a5f1dcd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1dc7a7b74b5ad37ff7c8dc22f1a710460a5f1dcd commit 1dc7a7b74b5ad37ff7c8dc22f1a710460a5f1dcd Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:30 +0000 mana: Stop checking for failures from malloc/mallocarray/buf_ring_alloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/mana/gdma_main.c | 19 ------------------- sys/dev/mana/hw_channel.c | 17 ----------------- sys/dev/mana/mana_en.c | 41 ----------------------------------------- 3 files changed, 77 deletions(-) diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 6f3e182ba1eb..13f2617ad7d4 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -868,9 +868,6 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd, int err; queue = malloc(sizeof(*queue), M_DEVBUF, M_WAITOK | M_ZERO); - if (!queue) - return ENOMEM; - gmi = &queue->mem_info; err = mana_gd_alloc_memory(gc, spec->queue_size, gmi); if (err) @@ -962,9 +959,6 @@ mana_gd_create_dma_region(struct gdma_dev *gd, } req = malloc(req_msg_size, M_DEVBUF, M_WAITOK | M_ZERO); - if (!req) - return ENOMEM; - mana_gd_init_req_hdr(&req->hdr, GDMA_CREATE_DMA_REGION, req_msg_size, sizeof(resp)); req->length = length; @@ -1008,9 +1002,6 @@ mana_gd_create_mana_eq(struct gdma_dev *gd, return EINVAL; queue = malloc(sizeof(*queue), M_DEVBUF, M_WAITOK | M_ZERO); - if (!queue) - return ENOMEM; - gmi = &queue->mem_info; err = mana_gd_alloc_memory(gc, spec->queue_size, gmi); if (err) @@ -1056,9 +1047,6 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd, return EINVAL; queue = malloc(sizeof(*queue), M_DEVBUF, M_WAITOK | M_ZERO); - if (!queue) - return ENOMEM; - gmi = &queue->mem_info; err = mana_gd_alloc_memory(gc, spec->queue_size, gmi); if (err) @@ -1480,9 +1468,6 @@ mana_gd_alloc_res_map(uint32_t res_avail, r->map = malloc(n * sizeof(unsigned long), M_DEVBUF, M_WAITOK | M_ZERO); - if (!r->map) - return ENOMEM; - r->size = res_avail; mtx_init(&r->lock_spin, lock_name, NULL, MTX_SPIN); @@ -1616,10 +1601,6 @@ mana_gd_setup_irqs(device_t dev) gc->irq_contexts = malloc(nvec * sizeof(struct gdma_irq_context), M_DEVBUF, M_WAITOK | M_ZERO); - if (!gc->irq_contexts) { - rc = ENOMEM; - goto err_setup_irq_release; - } for (i = 0; i < nvec; i++) { gic = &gc->irq_contexts[i]; diff --git a/sys/dev/mana/hw_channel.c b/sys/dev/mana/hw_channel.c index 7a40a28894fb..5904389596a3 100644 --- a/sys/dev/mana/hw_channel.c +++ b/sys/dev/mana/hw_channel.c @@ -416,8 +416,6 @@ mana_hwc_create_cq(struct hw_channel_context *hwc, cq_size = MINIMUM_SUPPORTED_PAGE_SIZE; hwc_cq = malloc(sizeof(*hwc_cq), M_DEVBUF, M_WAITOK | M_ZERO); - if (!hwc_cq) - return ENOMEM; err = mana_hwc_create_gdma_eq(hwc, eq_size, ctx, callback, &eq); if (err) { @@ -438,10 +436,6 @@ mana_hwc_create_cq(struct hw_channel_context *hwc, comp_buf = mallocarray(q_depth, sizeof(struct gdma_comp), M_DEVBUF, M_WAITOK | M_ZERO); - if (!comp_buf) { - err = ENOMEM; - goto out; - } hwc_cq->hwc = hwc; hwc_cq->comp_buf = comp_buf; @@ -476,8 +470,6 @@ mana_hwc_alloc_dma_buf(struct hw_channel_context *hwc, uint16_t q_depth, dma_buf = malloc(sizeof(*dma_buf) + q_depth * sizeof(struct hwc_work_request), M_DEVBUF, M_WAITOK | M_ZERO); - if (!dma_buf) - return ENOMEM; dma_buf->num_reqs = q_depth; @@ -560,8 +552,6 @@ mana_hwc_create_wq(struct hw_channel_context *hwc, queue_size = MINIMUM_SUPPORTED_PAGE_SIZE; hwc_wq = malloc(sizeof(*hwc_wq), M_DEVBUF, M_WAITOK | M_ZERO); - if (!hwc_wq) - return ENOMEM; err = mana_hwc_create_gdma_wq(hwc, q_type, queue_size, &queue); if (err) @@ -669,8 +659,6 @@ mana_hwc_test_channel(struct hw_channel_context *hwc, uint16_t q_depth, ctx = malloc(q_depth * sizeof(struct hwc_caller_ctx), M_DEVBUF, M_WAITOK | M_ZERO); - if (!ctx) - return ENOMEM; for (i = 0; i < q_depth; ++i) init_completion(&ctx[i].comp_event); @@ -719,9 +707,6 @@ mana_hwc_establish_channel(struct gdma_context *gc, uint16_t *q_depth, gc->cq_table = malloc(gc->max_num_cqs * sizeof(struct gdma_queue *), M_DEVBUF, M_WAITOK | M_ZERO); - if (!gc->cq_table) - return ENOMEM; - gc->cq_table[cq->id] = cq; return 0; @@ -782,8 +767,6 @@ mana_hwc_create_channel(struct gdma_context *gc) int err; hwc = malloc(sizeof(*hwc), M_DEVBUF, M_WAITOK | M_ZERO); - if (!hwc) - return ENOMEM; gd->gdma_context = gc; gd->driver_data = hwc; diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index 961399172688..90db036ff59b 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -921,13 +921,6 @@ mana_init_port_context(struct mana_port_context *apc) apc->rxqs = mallocarray(apc->num_queues, sizeof(struct mana_rxq *), M_DEVBUF, M_WAITOK | M_ZERO); - if (!apc->rxqs) { - bus_dma_tag_destroy(apc->tx_buf_tag); - bus_dma_tag_destroy(apc->rx_buf_tag); - apc->rx_buf_tag = NULL; - return ENOMEM; - } - return 0; } @@ -1156,8 +1149,6 @@ mana_cfg_vport_steering(struct mana_port_context *apc, req_buf_size = sizeof(*req) + sizeof(mana_handle_t) * num_entries; req = malloc(req_buf_size, M_DEVBUF, M_WAITOK | M_ZERO); - if (!req) - return ENOMEM; mana_gd_init_req_hdr(&req->hdr, MANA_CONFIG_VPORT_RX, req_buf_size, sizeof(resp)); @@ -1325,8 +1316,6 @@ mana_create_eq(struct mana_context *ac) ac->eqs = mallocarray(gc->max_num_queues, sizeof(struct mana_eq), M_DEVBUF, M_WAITOK | M_ZERO); - if (!ac->eqs) - return ENOMEM; spec.type = GDMA_EQ; spec.monitor_avl_buf = false; @@ -2043,8 +2032,6 @@ mana_create_txq(struct mana_port_context *apc, if_t net) apc->tx_qp = mallocarray(apc->num_queues, sizeof(struct mana_tx_qp), M_DEVBUF, M_WAITOK | M_ZERO); - if (!apc->tx_qp) - return ENOMEM; /* The minimum size of the WQE is 32 bytes, hence * MAX_SEND_BUFFERS_PER_QUEUE represents the maximum number of WQEs @@ -2141,14 +2128,6 @@ mana_create_txq(struct mana_port_context *apc, if_t net) txq->tx_buf_info = malloc(MAX_SEND_BUFFERS_PER_QUEUE * sizeof(struct mana_send_buf_info), M_DEVBUF, M_WAITOK | M_ZERO); - if (unlikely(txq->tx_buf_info == NULL)) { - if_printf(net, - "Failed to allocate tx buf info for SQ %u\n", - txq->gdma_sq->id); - err = ENOMEM; - goto out; - } - snprintf(txq->txq_mtx_name, nitems(txq->txq_mtx_name), "mana:tx(%d)", i); @@ -2156,13 +2135,6 @@ mana_create_txq(struct mana_port_context *apc, if_t net) txq->txq_br = buf_ring_alloc(4 * MAX_SEND_BUFFERS_PER_QUEUE, M_DEVBUF, M_WAITOK, &txq->txq_mtx); - if (unlikely(txq->txq_br == NULL)) { - if_printf(net, - "Failed to allocate buf ring for SQ %u\n", - txq->gdma_sq->id); - err = ENOMEM; - goto out; - } /* Allocate taskqueue for deferred send */ TASK_INIT(&txq->enqueue_task, 0, mana_xmit_taskfunc, txq); @@ -2353,9 +2325,6 @@ mana_create_rxq(struct mana_port_context *apc, uint32_t rxq_idx, rxq = malloc(sizeof(*rxq) + RX_BUFFERS_PER_QUEUE * sizeof(struct mana_recv_buf_oob), M_DEVBUF, M_WAITOK | M_ZERO); - if (!rxq) - return NULL; - rxq->ndev = ndev; rxq->num_rx_buf = RX_BUFFERS_PER_QUEUE; rxq->rxq_idx = rxq_idx; @@ -2808,12 +2777,6 @@ mana_probe_port(struct mana_context *ac, int port_idx, *ndev_storage = ndev; apc = malloc(sizeof(*apc), M_DEVBUF, M_WAITOK | M_ZERO); - if (!apc) { - mana_err(NULL, "Failed to allocate port context\n"); - err = ENOMEM; - goto free_net; - } - apc->ac = ac; apc->ndev = ndev; apc->max_queues = gc->max_num_queues; @@ -2892,7 +2855,6 @@ mana_probe_port(struct mana_context *ac, int port_idx, reset_apc: free(apc, M_DEVBUF); -free_net: *ndev_storage = NULL; if_printf(ndev, "Failed to probe vPort %d: %d\n", port_idx, err); if_free(ndev); @@ -2915,9 +2877,6 @@ int mana_probe(struct gdma_dev *gd) return err; ac = malloc(sizeof(*ac), M_DEVBUF, M_WAITOK | M_ZERO); - if (!ac) - return ENOMEM; - ac->gdma_dev = gd; ac->num_ports = 1; gd->driver_data = ac; From nobody Tue Sep 3 10:27:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdQ2swlz5MkZL; Tue, 03 Sep 2024 10:27: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 4WyhdQ1dQ7z4t5D; Tue, 3 Sep 2024 10:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+DpiEWPEJCWGTb97kqj00S0EPHi6+Ak++p18poskGzg=; b=FSaH/lHZqpNBpfVxCP4VJzY85wHHdzR/1YyVgfQN3ofz1PccsKtGcHLY9qi2Yec05nFUCR bj/cAU7mxtMi1MuY1aejvtmCixKkHnpfIoRAE8n+louw2llsVHSe96wF1vPsDtaZSnAZBW JBbt4oPhEIb66zD2V/yAAThwlzjGUPCMcbl3///qwC0c5HWcQognEqCHS/Dj9CVdowE30w wqzFoS7LHJGgURgiOVPSk+pfmBO8gl3XHA8um4K6MFdQSldPtwdzD8dlGMCcS51ti2vRLs X5InZUqeN82mu0DfvMACH54pSb5P+cBj4Qq4cdZ3Sdy6i2qvnpl86D8BtG1RlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359242; a=rsa-sha256; cv=none; b=p2D+x279jjzqEmstXwwr29rtwBTc3VAB0XFNnyc3+xiHjIRsxONf4UTMnvsfWD6xVm2Fex VXi4LoqYMklSOhtJpshD8xDDktFb3Qt3hFtJitnIXNaptTfvRHdXtTZFM2R17YdcyacThf kAZH5Eucz59xOzWb/we66ncXDvDG3wslbzaFlrUy52rkneUQckTq+DVHrelLUCY26bVyLt QmlWK4JHXJtIqQ+fn7VLp389levCoK1Lq2/tRVY5Ctkko55MNTZZu+pZH3QEs0KFNYhb8p HuWx5bfcuDDUZcxgQ3wpg+uhQFzGxBm5d0MQgBu4C7ROFVmuMbxT+bUzuLbd3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+DpiEWPEJCWGTb97kqj00S0EPHi6+Ak++p18poskGzg=; b=xc1GxxlIniwkOM8icYprirhNBeC1mjS31caDk+UIi1mpjXrZYtfvCos8GJfc4cm4pkZjSt r5tIcHd2Lb7VGsRaG9fdVffJaGNgCuE0wzFY6ryzIe7SDUsqUOTvI0t3vzpJ66VxWZ9m74 bKG/8yk6sxOiwwxPuJKcJO9YaOW3QaRPJRBV0VSJW6I5y9aCNPisZr4rA6fjn/6iB9BgQZ 4aJZCcgkHTwmW+pJtFtcXlRfJ9ThuXnY8cEbWpUPbCbBsCm1ATekHhweTIselg8vSAfUHE WZUDneOTi3W++aToUICvyqhine0EMzXM2Mg/Vz2QRaQj1lYW9xsaeUELBfLtvQ== 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 4WyhdQ1DKRzcFg; Tue, 3 Sep 2024 10:27: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 483ARMca010436; Tue, 3 Sep 2024 10:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARMCN010433; Tue, 3 Sep 2024 10:27:22 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:22 GMT Message-Id: <202409031027.483ARMCN010433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 701308ef404f - main - mfi(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 701308ef404f552034f8c3e3e912b41bfef28ee6 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=701308ef404f552034f8c3e3e912b41bfef28ee6 commit 701308ef404f552034f8c3e3e912b41bfef28ee6 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:31 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:31 +0000 mfi(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/mfi/mfi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index 2885bd695f50..328118ef9596 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -3633,11 +3633,8 @@ out: mfi_aen_entry = malloc(sizeof(struct mfi_aen), M_MFIBUF, M_WAITOK); mtx_lock(&sc->mfi_io_lock); - if (mfi_aen_entry != NULL) { - mfi_aen_entry->p = curproc; - TAILQ_INSERT_TAIL(&sc->mfi_aen_pids, mfi_aen_entry, - aen_link); - } + mfi_aen_entry->p = curproc; + TAILQ_INSERT_TAIL(&sc->mfi_aen_pids, mfi_aen_entry, aen_link); error = mfi_aen_register(sc, l_aen.laen_seq_num, l_aen.laen_class_locale); From nobody Tue Sep 3 10:27:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdR4xzWz5MkPl; Tue, 03 Sep 2024 10:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdR2L9nz4sxP; Tue, 3 Sep 2024 10:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1VxNtUW+YJvMq+5ZjSaH5xL3UI4aTBEl5lM2MAUM9z8=; b=PuMw7IcvCKVWNIQVrjy1+NxCr3G8IhJxfP3k3GI84fl0hWp79VoFjX1f2T8j1zYhg002kh PKf+8n3kqNI4L8YlaC/0A+ZL89J24pCJw7j2cYyuYBBW7mduVsIQAXAi/K4rnmJhK9WYZH xa+1sM6NJUMWl/XUcyOqAVPFJAp3fnq8TSrIpMedl/cmvqEDhWlDOfof7ciM+DzxxyxDKP Pe93tXZ4pFK+3aiRpXKZRyiLYmQN5zCcL2Y/BWYWuUhWPlEh/YJ66F/mrEcEHfRtz02ddB 57FhVMHtqOXM6oeOLzlEMl3SR8GeU+x9+C4lEOF2z1Y+9fQUjzSFrGZ+Io/SWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359243; a=rsa-sha256; cv=none; b=NGWBEM/v6Up1Xl6XixqsJ+uk7yW7LFMTjVaHkh7ltiOTIZY865PVGykEG2CiyA0PdIDqhe 4yRoyqtSLqWCnkI8TswNh6yFkd/zUYTDMhLY2X3Nzcf4M0BAEwrQrzg6erwGu6svq6VXFv +ddiLLUCu4M7y8R34NJDvrBjYP4vq1NxY+ddoBxImCisZvnoNES6a2P6DiSFqnyyIz12CJ 4KJ58A3FQ4/sTXmBworXsSgsvHz1vSFF204Bd6Owg2cKd7Q+paeEbgHW+4qNViRfEH6O/j t3Pkx4HlFiy8PAK1oihSmWZuDwF1XHuK78zY/MQXpfWsd1GuGdaZUsMKjh+MZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1VxNtUW+YJvMq+5ZjSaH5xL3UI4aTBEl5lM2MAUM9z8=; b=RKyQzWCLuIPuLc7oZJDwkS0e+24i9DVhkxrKuL7di9ijHp8S3YQK+sQ5JYlTQElXGRkflf eQ70dnc6pkpWEFHoZYguw8mliH6BQKeGTGtjOytYTANge+cV6RRDxJ/Ey7b5I7FYIIcnJq njzxExIjBYj+LjUei7goYcyl3XmtQ33w8TLdsDXwln5B3UXAiDN9vQA5E6gHqz24UoVBFM jFWWUU4FM2U/GiypGgid2lKcyswASq1UALG94OqXRQvN0Xzp76hu9ui0MD4tYxm9RI4eG+ Ha0Im8qDCPTO3XXeLuUOz8906U+cLXVTyqdbAOJLL1tGv/xVy8ggsCAf10GPTA== 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 4WyhdR1xYWzcb9; Tue, 3 Sep 2024 10:27: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 483ARNNi010501; Tue, 3 Sep 2024 10:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARNvp010497; Tue, 3 Sep 2024 10:27:23 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:23 GMT Message-Id: <202409031027.483ARNvp010497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 556cd18fb076 - main - mlx(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 556cd18fb07604e3442819b221afb2a19b924dbd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=556cd18fb07604e3442819b221afb2a19b924dbd commit 556cd18fb07604e3442819b221afb2a19b924dbd Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:31 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:31 +0000 mlx(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/mlx/mlx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 8e86a00222da..7e4cb443894a 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -2075,8 +2075,8 @@ mlx_user_command(struct mlx_softc *sc, struct mlx_usercommand *mu) goto out; } MLX_IO_UNLOCK(sc); - if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) || - (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) { + kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK); + if ((error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) { MLX_IO_LOCK(sc); goto out; } From nobody Tue Sep 3 10:27:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdV0lbSz5MkRy; Tue, 03 Sep 2024 10:27: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 4WyhdT43hTz4sxw; Tue, 3 Sep 2024 10:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6boHawjXqzgJfUlCfphdj5aMt7O0ob6ZvAvdgb/N+oo=; b=vfaWRfSqeoyPnQJfknofLF1BN9Q6pk4kb5W9QDcb/PgJlvpzHsxZl/YJa6eM432CR+GXEt Zi3A/J4xI8qQcKHGffSzg0Ts6Byrsp8nhBhig62j0SmMspxEvLMze+NZEALvdGMKDcZ3dU U2kABQyTGFKrSP4Anl3j/bLbfGNg6257foCwKJ3mCYgJkKYQ93Cj41MYdrycRYSPk8eFZh WL7gZ2XcYyorJlatcAXDVFJRTkPgYUTfkoxnvnaUCWbjBughfrTG+jKJgX8zVbG1KtStb1 PyfGfJmDmXSBDjQc7eGEpbs+Lf+KIjQgAs5P2+vpn3EzmAM6BlY9nBwQ/Wwx/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359245; a=rsa-sha256; cv=none; b=nNd4fo0LDgD9VkK9IBEr6P0dnsTuy10Qz6vFttJ/4H1GjkqNywKltLUvEAczqkvNno5euS IikGllPw/Z3t78v8ofK3tjZb5beapY6Y7SJLi1zaS7TjKyKSmuRfDYE6hL+hksUThZgntX 0WGPyHh2TA5DpQgtLdrMZxGL869fLYslk+dUqdKfhq/CqYUvFurLzvSFpC9LTy0AfjnYA4 xAUe5uI+7nKjGRVfPv+7vxD0d/7D3r71SjLwhXlOAxiP69X+XtFJyZTRV/jM6o7kZLGLde Biz+8LrL3Fcgqwmx/1IxdW1megwZXIalOxmwR3sMpfJ2RAxq3HylPR70Dx5LuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6boHawjXqzgJfUlCfphdj5aMt7O0ob6ZvAvdgb/N+oo=; b=hEuOz2ZtO/jp+96kxYHX2ELj6E24j7Fd7dQwwMjfDEBnpspMtnRpxaWkuF0bfv9QYrE3ov r+IHA9hohZXp5Ao6cBA1NqtnP/o5uflR3PI2r9rwp0/QqJY6A0owu6lNq+G7SxnGd6MzGl y0sTkvbfbHIJx/i9Q+DvaJxY3TFYItdSTUot/MW34H7i1FIpNC30BtK1Ug+9H9b8Q6t+Hw gZ1xlif8S/m1Sh83vO1lhobESsLIywyMOW4kbSEE9XPpy+Xj48ZwBj4nmT0AIkgdmfc7un FVT8hPvhLoDiqy7UsuZkO0L4EG/I8qEjdu7PCZ0RciHCzTNN+uKVru9j8n5MhA== 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 4WyhdT3g0fzcsv; Tue, 3 Sep 2024 10:27: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 483ARPl7010607; Tue, 3 Sep 2024 10:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARP2p010604; Tue, 3 Sep 2024 10:27:25 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:25 GMT Message-Id: <202409031027.483ARP2p010604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: a38d9ad47312 - main - mrsas(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a38d9ad473123dca86108651ba10740055720777 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a38d9ad473123dca86108651ba10740055720777 commit a38d9ad473123dca86108651ba10740055720777 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:32 +0000 mrsas(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/mrsas/mrsas_ioctl.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sys/dev/mrsas/mrsas_ioctl.c b/sys/dev/mrsas/mrsas_ioctl.c index 74eacfbeb9fa..8a85544604a4 100644 --- a/sys/dev/mrsas/mrsas_ioctl.c +++ b/sys/dev/mrsas/mrsas_ioctl.c @@ -462,13 +462,6 @@ mrsas_user_command(struct mrsas_softc *sc, struct mfi_ioc_passthru *ioc) kern_sge[0].length = 0; } else { ioctl_temp_data_mem = malloc(ioc->buf_size, M_MRSAS, M_WAITOK); - if (ioctl_temp_data_mem == NULL) { - device_printf(sc->mrsas_dev, "Could not allocate " - "%d memory for temporary passthrough ioctl\n", - ioc->buf_size); - ret = ENOMEM; - goto out; - } /* Copy in data from user space */ ret = copyin(ioc->buf, ioctl_temp_data_mem, ioc->buf_size); @@ -483,12 +476,6 @@ mrsas_user_command(struct mrsas_softc *sc, struct mfi_ioc_passthru *ioc) */ passcmd = malloc(sizeof(struct mrsas_passthru_cmd), M_MRSAS, M_WAITOK); - if (passcmd == NULL) { - device_printf(sc->mrsas_dev, "Could not allocate " - "memory for temporary passthrough cb struct\n"); - ret = ENOMEM; - goto out; - } passcmd->complete = 0; passcmd->sc = sc; passcmd->cmd = cmd; From nobody Tue Sep 3 10:27:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdT00Ylz5MkjP; Tue, 03 Sep 2024 10:27: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 4WyhdS3KHCz4svb; Tue, 3 Sep 2024 10:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lE0hFGgUbLaQkLIU5BrCsLvB7OxTtd9nf+CqIqiL9qc=; b=Wiajt/1WH2odqpzMzayL77UFy8l51NGIJf7yVZpIO4tQwDNSL3UlKEmUu8EqGAYS7TMdaO 77gOW4mappZx1sMod4FFVm0D59ds8FBSMKgBYpKO1aprpEdbYtblEDy4lZdf0FH1GWUrMt owOjMx55xgktSzC4M/BM07aJvkZhg5GbE8JinXsCe9LsSbomdGx2NX0ewbZahr+wylnfwJ YDGgj8hTKSRlsHZN8zptl+da39hlRwaCsxqubE1CmqQ1kDRf2SKTYm4jEfDhospnK1hbQK hxvnOlek6LMn8w8v8OeZ+L9ioDo5cvfXP4gF+5/gIiqEecBZ11/VNmdL0s7fgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359244; a=rsa-sha256; cv=none; b=GxtdS7jJcMRbS0vPf7005zROuxEqe9OavJ7ZGvGrDmrlcv/eWoHh2eBNGOP2sU66B5vqSo 9hB/7UFir50zyQtbIrjO1H8PEWXMz7UWe7C033/xHFzZjLnh156xUC5QLulrkpZ6g+5t3K bIaYc3AF8jtgVjsZD+WpoZR5S2za71c/B5GB55Jx60dzv6QAWq3Il2bVWZui+WPwiaUybq 1xL+8vh4EPxQX0Z1Fo9K0RIoVfhDtgXr/RILjvpM3ZTOby8tY8UaUReGa2t60Ji0Xm+ZUP ScchdIh6fMj0JAwF9cex8tpKqS1Syseumab7MXOuHJY1msUG1AHRtC/dcNqENA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lE0hFGgUbLaQkLIU5BrCsLvB7OxTtd9nf+CqIqiL9qc=; b=Wzh2GHo+En7G2oAUlIfmGYfEiKDxbQPt7e45GOc9JTZkXr6QA3ltNd4GYXb23af/po6h84 VWd1Vd87KY/xktUNOeoJt2KwCQ00kNekVhemnvJv9x3j8ofP+fHNdIvDfZEDA9n5UBU6QI uxMOnGUouO1s4VdUETuxj94yL3C+9sIu6p1+ClrCsZJWqU2x41qcFYLu5HnC3wQcv2tm4I 0HDpxSJld3Z+tkS5m20VRMNsxrijPqpAyFRrPFb2gzTnpgcm9pdrpHKlxsfD1cs4BfR7et 7oAsVqD7masZjU4zqI00BQppeqYxCdOtbjELV3BiceLgSa5STPgNudUlCfgxEg== 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 4WyhdS2xNdzcLG; Tue, 3 Sep 2024 10:27: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 483AROWw010558; Tue, 3 Sep 2024 10:27:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARORl010555; Tue, 3 Sep 2024 10:27:24 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:24 GMT Message-Id: <202409031027.483ARORl010555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 849f9ac370bd - main - mpi3mr(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 849f9ac370bd66993ce5cc6fca0d2ef9bd03c2c9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=849f9ac370bd66993ce5cc6fca0d2ef9bd03c2c9 commit 849f9ac370bd66993ce5cc6fca0d2ef9bd03c2c9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:31 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:31 +0000 mpi3mr(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/mpi3mr/mpi3mr_cam.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c index e00d61073d96..b4999e204ab7 100644 --- a/sys/dev/mpi3mr/mpi3mr_cam.c +++ b/sys/dev/mpi3mr/mpi3mr_cam.c @@ -2098,12 +2098,6 @@ mpi3mr_cam_attach(struct mpi3mr_softc *sc) mpi3mr_dprint(sc, MPI3MR_XINFO, "Starting CAM Attach\n"); cam_sc = malloc(sizeof(struct mpi3mr_cam_softc), M_MPI3MR, M_WAITOK|M_ZERO); - if (!cam_sc) { - mpi3mr_dprint(sc, MPI3MR_ERROR, - "Failed to allocate memory for controller CAM instance\n"); - return (ENOMEM); - } - cam_sc->maxtargets = sc->facts.max_perids + 1; TAILQ_INIT(&cam_sc->tgt_list); From nobody Tue Sep 3 10:27:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdX2YhJz5MkhT; Tue, 03 Sep 2024 10:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdW5zdFz4t8P; Tue, 3 Sep 2024 10:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lo2Eyw6gDTtNEGQ2oipgxL/KJneIufdg5olvRjBkpB8=; b=Q8CQbTS7N4bJepKyPCpRcYDczXz0wI9cRlwQ6PbJ/6VIV+xDIBuXmfPuJUy1TFw2btyTsb 4ktXq2aBL5FGF8YV9Qa+S4oIsL35lIBlaZB0jSqhenAc7OtA+Jrs9BjNkNvpt8HN4KRBjJ sD7GiwVboJ07SiyrmtWq4ce8n8nkT6sxgFTsTQSpv/4/7CIPOcOCPbIW1vtZFBT92VODeJ JzEMa2drP8xDbS1MLThOAnjZx6u8gWIGgmgWT4MdJc4IFJXYPjlIjWl132TIdnlJ+afaGu RqUD31KgBsWboJHYtkGbxx1DUY3kvpZHIo4xSiru8RDUBjJjz5/KNIOr7aGkng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359247; a=rsa-sha256; cv=none; b=P8gMlu+hx4CYUeClmPl8/teKjWV+nsr6PH0TRwMvTzUzMPcUcyu3TB/LASi8izgpryK3k/ /7harwcgemF0V8FYyJhAoCQS25sOsGlnqiyAYwrHAziq7hS2NzVIpHe+0fzhHtnqsCwrQn n/8BwERWjObsqCC3v5N0YOa8vArEHcVvRI9Hlfhbru5ucacl38q8SYEeRwrc5rj2ZYKMch 7UJLingBnx3q55mAJ04kZ8Ip7p+STNO+3tvexTWX8I4SzqETmYrUzLQf8fkqckgfsJYZfV K6eQFKYcj60OZV2dZZikM5oFVpe6bngBMflOeH44s0eUzjTbAfqwCGKtb4Na4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lo2Eyw6gDTtNEGQ2oipgxL/KJneIufdg5olvRjBkpB8=; b=Msg5b5cAsZu+13g5mttORjtwi+In0mH9xfck3+IATjZ9l1UNzdQMZTPCOWFqEptR9sLVSh c39b+LF9QE+LHoFtRfcJP7R5tvUo7IdN3r5pFy+Bhwg16UULk2qGzNf2F8svuZsO9160SM 8BvX3D58R1I/raVo7wSu5cg3rHfQU55RoqNXvL/ngwuHzyuy6bXuvktOgeLhcfZ0aAHHDC nSEw3JneejMwaSUYUDaLEoPZwHfRttNDP8vyq431sUNPT6tY30j33Kmw9V/VAqrepf0L1p C1NCLsluBmEPguMjnXF9gm/OKnmRaaTxBG1IgMQ1CNnYA78K6NUyAbLyDcIePw== 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 4WyhdW5WHwzcxs; Tue, 3 Sep 2024 10:27:27 +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 483ARRBS010705; Tue, 3 Sep 2024 10:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARRbC010702; Tue, 3 Sep 2024 10:27:27 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:27 GMT Message-Id: <202409031027.483ARRbC010702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 866dc4bd8139 - main - qat(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 866dc4bd81398b478daefe4b7447b92422b4a06c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=866dc4bd81398b478daefe4b7447b92422b4a06c commit 866dc4bd81398b478daefe4b7447b92422b4a06c Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:32 +0000 qat(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/qat/qat_common/adf_freebsd_dev_processes.c | 8 -------- sys/dev/qat/qat_common/adf_freebsd_uio.c | 8 -------- sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c | 3 --- sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c | 5 ----- 4 files changed, 24 deletions(-) diff --git a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c index b8a17344bdea..a70f25d57dcb 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c +++ b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c @@ -146,8 +146,6 @@ adf_processes_open(struct cdev *dev, int oflags, int devtype, struct thread *td) return ENXIO; } prv_data = malloc(sizeof(*prv_data), M_QAT, M_WAITOK | M_ZERO); - if (!prv_data) - return ENOMEM; INIT_LIST_HEAD(&prv_data->list); error = devfs_set_cdevpriv(prv_data, adf_processes_release); if (error) { @@ -573,14 +571,8 @@ adf_state_open(struct cdev *dev, int oflags, int devtype, struct thread *td) int ret = 0; prv_data = malloc(sizeof(*prv_data), M_QAT, M_WAITOK | M_ZERO); - if (!prv_data) - return -ENOMEM; entry_proc_events = malloc(sizeof(struct entry_proc_events), M_QAT, M_WAITOK | M_ZERO); - if (!entry_proc_events) { - free(prv_data, M_QAT); - return -ENOMEM; - } mtx_lock(&mtx); prv_data->cdev = dev; prv_data->cdev->si_drv1 = prv_data; diff --git a/sys/dev/qat/qat_common/adf_freebsd_uio.c b/sys/dev/qat/qat_common/adf_freebsd_uio.c index c109fc79b0f4..64efde72b4b8 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_uio.c +++ b/sys/dev/qat/qat_common/adf_freebsd_uio.c @@ -199,10 +199,6 @@ adf_alloc_bundle(struct adf_accel_dev *accel_dev, int bundle_nr) accel = accel_dev->accel; handle = malloc(sizeof(*handle), M_QAT, M_WAITOK | M_ZERO); - if (!handle) { - printf("ERROR in adf_alloc_bundle %d\n", __LINE__); - return ENOMEM; - } handle->accel = accel; handle->bundle = bundle_nr; @@ -294,10 +290,6 @@ adf_uio_mmap_single(struct cdev *dev, /* Adding pid to bundle list */ instance_rings = malloc(sizeof(*instance_rings), M_QAT, M_WAITOK | M_ZERO); - if (!instance_rings) { - printf("QAT: Memory allocation error - line: %d\n", __LINE__); - return -ENOMEM; - } instance_rings->user_pid = curproc->p_pid; instance_rings->ring_mask = 0; mutex_lock(&bundle->list_lock); diff --git a/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c b/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c index 6fb4cf0bf2f7..954e31c683ce 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c +++ b/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c @@ -123,9 +123,6 @@ get_orphan_bundle(int bank, orphan_bundle = malloc(sizeof(*orphan_bundle), M_QAT, M_WAITOK | M_ZERO); - if (!orphan_bundle) - return ENOMEM; - csr_base = accel->bar->virt_addr; orphan_bundle->csr_base = csr_base; orphan_bundle->bank = bank; diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c index 05a99ae43ab7..9b66ae4b2370 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c @@ -117,11 +117,6 @@ adf_attach(device_t dev) } /* Allocate and configure device configuration structure */ hw_data = malloc(sizeof(*hw_data), M_QAT_4XXXVF, M_WAITOK | M_ZERO); - if (!hw_data) { - ret = -ENOMEM; - goto out_err; - } - accel_dev->hw_device = hw_data; adf_init_hw_data_4xxxiov(accel_dev->hw_device); accel_pci_dev->revid = pci_get_revid(dev); From nobody Tue Sep 3 10:27:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdW161Xz5MkhS; Tue, 03 Sep 2024 10:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdV4fDhz4tDX; Tue, 3 Sep 2024 10:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JkShlhYlyzGMrEEaIsBE7kMg7MromkueJvfeYOWQmk8=; b=XfJsZm9Mlx0CBvs0X5gMBw5rcmgMOqOc6KvRVWRZV6qgfIT4Rcvoh21B0hP92i7lMLjS+1 kQYNsB0B3NwhOzO8BOM3FrsLc9X6T7eeVgTYku4GrEQ8Njw7GP77/QCvNPvTxz1ebKZ7Hw JpHryhx3fJMGICA6MQ1bAp4c0UYGRDblqfXF/O6t+oREF8iCa/WvJ0I3QuP6eQ4JIziBrY cMx3wLQQ12LStutWGBVt+dSJCkvcTGqQQEfKEFqPpbVLl+AqdAnA9nGVfjoEOxo+3l4Zca dkl6noTfbfwF+TMFBAH5eEMDnqtkzcrol6ku8F5hXaJFlS0W7OPH0uvj+AN5Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359246; a=rsa-sha256; cv=none; b=o1PZozC3F5S78hOVJxasij7F7IctzHxeXDQmV7sVM9kkKLPf99LFDkZpv2blKKQTQZLHRO HgvQzBL1VQNDJ6r/PWxvWQJGn7HHwho6AN3fntbVovMCc1V5fBQiCN6qX/jx8xCbugL85l vggOdzPA+12S47OAqHr9hPQD1dXTKN0CHeuT27it5jiSK1utQUNIiiQ5utFiG10rjgZc5Q GT/uxwvkLgxQspKl5h07ayXmrhUz3YcxVnKxWpq2pQSuwfvt0UyTJdQDXirocOhf2y600W asRjFIWOp0z0+esiY6BBKm3Ztu3apnp74BbbO3AYEfAF8L4TLhpxRPtrNru0yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JkShlhYlyzGMrEEaIsBE7kMg7MromkueJvfeYOWQmk8=; b=ULFM0bgq/jjTaW2/Pd+EHifn0VuD7stMD4Rakk42uqh8Y6bXh4H8/v2pN480YGYPansHpg azSN6+/XopAzqC5tukYgKiFTtcyPxhvj6ZY0fgM5bSmDa9lmZ+e6Crdw9b8ecy0pRDVaAf rXQiLk75c6CxwuqT3jC8eufDX6loo0U9GrUZsayVq2qYBq85sa35Gr2cntSjgcsKxOOQmP 85HQ+4kUucQS888cmvl0b6+kfSLczvg47Z7Pd/tEfHbwZsFMJMk+ydiqaHK8p/CytWGowG 6/LWRrAWtMwEbjoXSSOMroaRcUfhS2b+S4L+65PXLnKdGMpLYwnYOVL73zxnHA== 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 4WyhdV4GL3zcxq; Tue, 3 Sep 2024 10:27: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 483ARQfe010656; Tue, 3 Sep 2024 10:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARQwi010653; Tue, 3 Sep 2024 10:27:26 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:26 GMT Message-Id: <202409031027.483ARQwi010653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 4fb8a80a78aa - main - pms(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fb8a80a78aa65e0b30bd5a74373512c678841c9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4fb8a80a78aa65e0b30bd5a74373512c678841c9 commit 4fb8a80a78aa65e0b30bd5a74373512c678841c9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:32 +0000 pms(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 38 +++------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index c8c9eb8c8dd8..cd1b80c3d712 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -318,13 +318,6 @@ int agtiapi_getdevlist( struct agtiapi_softc *pCard, sizeof(void *) ); AGTIAPI_PRINTK("agtiapi_getdevlist: portCount %d\n", pCard->portCount); devList = malloc(memNeeded1, TEMP2, M_WAITOK); - if (devList == NULL) - { - AGTIAPI_PRINTK("agtiapi_getdevlist: failed to allocate memory\n"); - ret_val = IOCTL_CALL_FAIL; - agIOCTLPayload->Status = IOCTL_ERR_STATUS_INTERNAL_ERROR; - return ret_val; - } osti_memset(devList, 0, memNeeded1); pPortalData = &pCard->pPortalData[0]; pDeviceHandleList = (bit8*)devList; @@ -970,13 +963,8 @@ static int agtiapi_attach( device_t devx ) } else { - pmsc->pPortalData = (ag_portal_data_t *) - malloc( sizeof(ag_portal_data_t) * pmsc->portCount, + pmsc->pPortalData = malloc( sizeof(ag_portal_data_t) * pmsc->portCount, M_PMC_MPRT, M_ZERO | M_WAITOK ); - if (pmsc->pPortalData == NULL) - { - AGTIAPI_PRINTK( "agtiapi_attach: Portal memory allocation ERROR\n" ); - } } pPortalData = pmsc->pPortalData; @@ -1227,32 +1215,14 @@ STATIC agBOOLEAN agtiapi_InitCardHW( struct agtiapi_softc *pmsc ) pmsc->flags |= AGTIAPI_SYS_INTR_ON; numVal = sizeof(ag_device_t) * pmsc->devDiscover; - pmsc->pDevList = - (ag_device_t *)malloc( numVal, M_PMC_MDVT, M_ZERO | M_WAITOK ); - if( !pmsc->pDevList ) { - AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d DevList ERROR\n", numVal ); - panic( "agtiapi_InitCardHW\n" ); - return AGTIAPI_FAIL; - } + pmsc->pDevList = malloc( numVal, M_PMC_MDVT, M_ZERO | M_WAITOK ); #ifdef LINUX_PERBI_SUPPORT numVal = sizeof(ag_slr_map_t) * pmsc->devDiscover; - pmsc->pSLRList = - (ag_slr_map_t *)malloc( numVal, M_PMC_MSLR, M_ZERO | M_WAITOK ); - if( !pmsc->pSLRList ) { - AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d SLRList ERROR\n", numVal ); - panic( "agtiapi_InitCardHW SLRL\n" ); - return AGTIAPI_FAIL; - } + pmsc->pSLRList = malloc( numVal, M_PMC_MSLR, M_ZERO | M_WAITOK ); numVal = sizeof(ag_tgt_map_t) * pmsc->devDiscover; - pmsc->pWWNList = - (ag_tgt_map_t *)malloc( numVal, M_PMC_MTGT, M_ZERO | M_WAITOK ); - if( !pmsc->pWWNList ) { - AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d WWNList ERROR\n", numVal ); - panic( "agtiapi_InitCardHW WWNL\n" ); - return AGTIAPI_FAIL; - } + pmsc->pWWNList = malloc( numVal, M_PMC_MTGT, M_ZERO | M_WAITOK ); // Get the WWN_to_target_ID mappings from the // holding area which contains the input of the From nobody Tue Sep 3 10:27:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdY2Cnrz5MkjY; Tue, 03 Sep 2024 10:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdX71lgz4tFG; Tue, 3 Sep 2024 10:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yhe4ayfJfp/x+wB593vOt5mSwzGDnnKT1LUZTbU02E=; b=iG9otWBPEFsOD9JBQYADDa64+fa422CnXB8nj5wEWEdyvhF83HN9fg7JK+teKs/iYX8mYV siOH+TYncUVBw3cgS1bHMmqhdW+44ryls7dCWshxhoR2uQgU7YJv64Q3kHknXfP5BQOmPy d3+C5rEZuojSkwrLeAmiSWDYmU42CzSIR2FCvzGAggFwDOEDasdxH5Xiti6oRFxoTz91mC +pGuzaqQmuhZ/roKDLdLZMCu+/mYDG0yO5kbsRyo5jey7Lp56ufkqPG8A9HITGrO4fGWLY u9yQSLCSkmwEg/z2KZ5e8AECHKVrQknWoJf8npgrVkRs+4jq9UDkuOT0HiSuAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359249; a=rsa-sha256; cv=none; b=u4gUVfSu+Zwx7NS5AZv7sg8cL/B3AeWX+yeZTLTJPB9nDV9HNpG3vrHhAnf6FIYYqPrYDT idO7HsJ0NKmZucIo9aApKJFb1U5/SNJcE+KtWkRkB/hfosqrqgmidTaG7QcEurent/MwG4 Z0GQHWG9wyF+nc6Q7LPPdW6hmellFLbaIcRhb+kgdK0rbMWX1HAF3deI/sJR7qCRKQT0CA dpQGo4zpNQ5GaPDkQN71gBByw0QTChjnpzRdFWsV8rdDhmPILLhEYwBNSggwLkaSLEY5Na PoJCmmNKAUYpla5sH4Rw/ree8v5KvZu0TVadsU3nxwyjNLj3J6EcSBJtSEiCLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yhe4ayfJfp/x+wB593vOt5mSwzGDnnKT1LUZTbU02E=; b=nxR+eFUoi2LyJn32Dys8mMDQPcnHpiTvkA5YmeLA6Om20XYFYT5kCQUKjRI1ZCZOyT+EOF mgkcCOT5JAqRkrFQUchypU4wVfO5F3K7fI9LyFNNQZCEFb2X3HyvPZMgOxikjdE6VUUDiK DJXFi5KOPextSNFYK5kmHx35QWDI+Va16KZUvBRpf5dvVKzL66vxoXuE8LRUcaNgog6bjN 24FR1rD2IXKZ3RHVkvX/gLmQaxmq50fnHvTPcVEIcJJmWCiybd9vMJoCLnneAbRY+IKdAo lYyITB4NCrHo3qYne0s7D9c+nrFxjdQeOFQMMxkxc5kMF9Fl495nntjCdEzZoQ== 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 4WyhdX6WfrzcbD; Tue, 3 Sep 2024 10:27:28 +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 483ARSYv010760; Tue, 3 Sep 2024 10:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARS8K010757; Tue, 3 Sep 2024 10:27:28 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:28 GMT Message-Id: <202409031027.483ARS8K010757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 761339c5544a - main - sume(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 761339c5544a360df9d3bab70675fea246eb6a83 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=761339c5544a360df9d3bab70675fea246eb6a83 commit 761339c5544a360df9d3bab70675fea246eb6a83 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:33 +0000 sume(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/sume/if_sume.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sys/dev/sume/if_sume.c b/sys/dev/sume/if_sume.c index 319853ac3c7a..7b2a27135e43 100644 --- a/sys/dev/sume/if_sume.c +++ b/sys/dev/sume/if_sume.c @@ -1195,16 +1195,11 @@ sume_probe_riffa_buffer(const struct sume_adapter *adapter, { struct riffa_chnl_dir **rp; bus_addr_t hw_addr; - int error, ch; + int ch; device_t dev = adapter->dev; - error = ENOMEM; *p = malloc(SUME_RIFFA_CHANNELS * sizeof(struct riffa_chnl_dir *), M_SUME, M_ZERO | M_WAITOK); - if (*p == NULL) { - device_printf(dev, "malloc(%s) failed.\n", dir); - return (error); - } rp = *p; /* Allocate the chnl_dir structs themselves. */ @@ -1212,11 +1207,6 @@ sume_probe_riffa_buffer(const struct sume_adapter *adapter, /* One direction. */ rp[ch] = malloc(sizeof(struct riffa_chnl_dir), M_SUME, M_ZERO | M_WAITOK); - if (rp[ch] == NULL) { - device_printf(dev, "malloc(%s[%d]) riffa_chnl_dir " - "failed.\n", dir, ch); - return (error); - } int err = bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0, From nobody Tue Sep 3 10:27:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdZ3ZRnz5MkS8; Tue, 03 Sep 2024 10:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdZ0kD0z4tBb; Tue, 3 Sep 2024 10:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Xm4RfxI5hLSYKNG0lf7KGeHKEAJ1YveqBKR0CJQZ9U=; b=EGUdFvkyoGBr6vXiX4q6nE5nZBR30RX3eK6EZTkrvM92QxXWpnv1bRwHAuD4XW1sf3G8DQ fLxUAI7UESyelHQ95A8If3bE1iAqc2MKjwNxY1VQrdzWZGlGJXgQmmP3jnVQWAUUVy0G5O ez+wIvUXXuYHEEyQuQARmeBzi2jTBbY1C+ifv5JaNK1IJ3A5qZVh0i42MDrKG4nApTXOYq FRInVcl9JlGIbDVmKumpe4bzrPpOeMtt/lwsLGEo8EhPP6asJ8PfSlOGuLkmC4OZXF2goT Spafy3RNcHJiSEe85+5wQdZSYjXQEtH/MtuMtvvgkWdk2X03OX4bqgKyJZ6A3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359250; a=rsa-sha256; cv=none; b=J/pOUm4MGjLp/L1HuCrHkm31bMPI2hZvDtqM/WzFgsJd1DYhuPIjYiS8W2/wQRkkM+o0bM JYnHvByS2j6bAmkpyFbbIbOj6tK4oMigQJY2kWZq7kHmWpOdqlwWhSd14siVlMXgl8Fibp sv5l7RIgBjip3OH36xrjzQNJi+HRyy3ghHXg588Nn/AKEqsXbgNySOrk+5o8UoxPIz8NIC baAKDIQ7R80VOgZNXnAsd7suRMwafRWxHEtA/OG0/eWJvWoqrZ4tAGEKDaxRfK3e62nKrC 5WNmc3R/bkdd0yFGks7F5C1iVkm0IZBw6ZZQBaJM0ZZvZ1qzanEamT4jqMSH/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Xm4RfxI5hLSYKNG0lf7KGeHKEAJ1YveqBKR0CJQZ9U=; b=LVcfyur/gCfC3ldPKvdoxYQj4iGJ4IKhFa1Hfo5KU8LEtwxajLNSe6sFwqMx7vkVT3Sv8N ZvQo9WWuUeWgPeY5Pl5w+jAj44t9zSpgCZUm0TGzbdOO2XfaNFa3yNmsr1fJvFKNkqaG+4 TYtX+WpTxNICYfNS3slxDSEO6uB4sDRjNXtz0jk0Gj+P1RSRvwDVdjngYI2XP816yv1UXC tqkF58q3xAozZM6SWoquVMhij2I2P6Vt5yBIaxIm20sAZx4zU+gzKUJM73NNwf/1t1zY1e /lwod7UxNt8wPDKDOxyz7VLcWWKHUpqX0mZUU5hn6CGnXjGTY8pYATAoydt/mQ== 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 4WyhdZ03hvzcLJ; Tue, 3 Sep 2024 10:27:30 +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 483ART79010812; Tue, 3 Sep 2024 10:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARToa010809; Tue, 3 Sep 2024 10:27:29 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:29 GMT Message-Id: <202409031027.483ARToa010809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 59121599bbda - main - sound: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59121599bbda1e4c3fc3c6e887cd48cd5e3afc70 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=59121599bbda1e4c3fc3c6e887cd48cd5e3afc70 commit 59121599bbda1e4c3fc3c6e887cd48cd5e3afc70 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:33 +0000 sound: Stop checking for failures from malloc(M_WAITOK) Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/sound/macio/i2s.c | 6 ++---- sys/dev/sound/usb/uaudio.c | 44 +++++++++++++++++++------------------------- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/sys/dev/sound/macio/i2s.c b/sys/dev/sound/macio/i2s.c index 5f8cb3aa15f7..647d66c27bba 100644 --- a/sys/dev/sound/macio/i2s.c +++ b/sys/dev/sound/macio/i2s.c @@ -241,10 +241,8 @@ i2s_attach(device_t self) * Register a hook for delayed attach in order to allow * the I2C controller to attach. */ - if ((i2s_delayed_attach = malloc(sizeof(struct intr_config_hook), - M_TEMP, M_WAITOK | M_ZERO)) == NULL) - return (ENOMEM); - + i2s_delayed_attach = malloc(sizeof(struct intr_config_hook), + M_TEMP, M_WAITOK | M_ZERO); i2s_delayed_attach->ich_func = i2s_postattach; i2s_delayed_attach->ich_arg = sc; diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 166af8a0857d..0a8878c072d2 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -2687,8 +2687,6 @@ uaudio_chan_init(struct uaudio_chan *ch, struct snd_dbuf *b, DPRINTF("Worst case buffer is %d bytes\n", (int)buf_size); ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); - if (ch->buf == NULL) - goto error; if (sndbuf_setup(b, ch->buf, buf_size) != 0) goto error; @@ -3256,31 +3254,27 @@ uaudio_mixer_add_ctl_sub(struct uaudio_softc *sc, struct uaudio_mixer_node *mc) malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK); int ch; - if (p_mc_new != NULL) { - memcpy(p_mc_new, mc, sizeof(*p_mc_new)); - p_mc_new->next = sc->sc_mixer_root; - sc->sc_mixer_root = p_mc_new; - sc->sc_mixer_count++; + memcpy(p_mc_new, mc, sizeof(*p_mc_new)); + p_mc_new->next = sc->sc_mixer_root; + sc->sc_mixer_root = p_mc_new; + sc->sc_mixer_count++; - /* set default value for all channels */ - for (ch = 0; ch < p_mc_new->nchan; ch++) { - switch (p_mc_new->val_default) { - case 1: - /* 50% */ - p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2; - break; - case 2: - /* 100% */ - p_mc_new->wData[ch] = p_mc_new->maxval; - break; - default: - /* 0% */ - p_mc_new->wData[ch] = p_mc_new->minval; - break; - } + /* set default value for all channels */ + for (ch = 0; ch < p_mc_new->nchan; ch++) { + switch (p_mc_new->val_default) { + case 1: + /* 50% */ + p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2; + break; + case 2: + /* 100% */ + p_mc_new->wData[ch] = p_mc_new->maxval; + break; + default: + /* 0% */ + p_mc_new->wData[ch] = p_mc_new->minval; + break; } - } else { - DPRINTF("out of memory\n"); } } From nobody Tue Sep 3 10:27:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdb4VX8z5Mkjb; Tue, 03 Sep 2024 10:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhdb1zx7z4tKw; Tue, 3 Sep 2024 10:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/5PEn4sXzDlva9VUdImCIsYPcSVNjW4N5O6+KnWFHrg=; b=JS1/O8NLPbOjfvEGEJkUEaHwm3LiT7JpLK2VThaugBZPXP0SyQu0k8gft2wjV475gqY7la 2EUWep1Yz8k2DioSZq4Nhf7lW+gMbwuVXIZuMlac/0FfBafuRYGWTn/nobu2s+S3Jd8jY0 RHC7Rtr/6V6JtCcIOvoJOWccdWC6H/I5/5zlrvEcda50FJbjGpVfluSMllzb4fwtZWO821 4XdoM699iDeQeYOpVRI83x1D+uLDlZnngibIF8vLMmlASIfXFiuM/F+IxOG4bCF74IWKIs 8YVLEBbDgQfodVfHP61QcP4TRkJm8xf/SKMy4hCnYx9Ea1cTl5HGNJ5iB+Nu/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359251; a=rsa-sha256; cv=none; b=V+9SP5L6OKqbjwsOQgunaScDELN7Zgr2UlSH/8P1qW+ZqFobbLFtMaiRD+HNY2dt7YY6uX /W3XgW7Fhhjxn978ktmeePoXk9WtC/HckgaEP6YKK7GQECE7gKp/W78iNCJARQf9WfPHC3 JLngiPmBtJItvD/ieF9XheTymbnN63GCxtCJDKPIBFs1ElB5g2UvtSAYKLwXgvD4PjFKgl phxzE+PdBiMYv5EM0zwfJfCss8r3svq6/mUwZpKmwLfgoYejfihZcQhPYLUCfOy5/3tLrg LPPUAJiCK2LuvmyBsI4dgiMGJ8EIccQXk5euYvkiDq/gFxHcpVRTj+4Y+UbJCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/5PEn4sXzDlva9VUdImCIsYPcSVNjW4N5O6+KnWFHrg=; b=ZvSaNT6ZhOwly/1wXfMzu8TNjApFqR/Vxvj91ja2mGcSANQEu845abQh+UMpYd55/TzYhR lvb6WpbyQR5Wm7lajfKIH58cr3gMoQrqvhZl0iaGt1CCgI12kx/yk0mRzOqgP91GF4EUVJ OkSFyuGyVXEO8hn6oWHW4ah7GgH917ZByx2qMWuE2WBGopF2+8t3pfnPnv+gqapycxcb1L yU8g6Ny8X0mw8a9+yF0u+Hr02XqkobVKCZBp/OGHrYCx2ZTCxh/IBPIYqgEG0Z4ckpw5Ga vfzjk6TOJvG56tYygzCh704RNd+rL5SCvZY7cdywnFTD9AccaKYbXRXPrRGqnQ== 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 4Wyhdb13hhzcbF; Tue, 3 Sep 2024 10:27:31 +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 483ARVhS010860; Tue, 3 Sep 2024 10:27:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARVf7010857; Tue, 3 Sep 2024 10:27:31 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:31 GMT Message-Id: <202409031027.483ARVf7010857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f80483cdd58a - main - sdhci(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f80483cdd58a032ae2cfb2b9119824e9badc2c91 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f80483cdd58a032ae2cfb2b9119824e9badc2c91 commit f80483cdd58a032ae2cfb2b9119824e9badc2c91 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:34 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:34 +0000 sdhci(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/sdhci/sdhci_xenon_acpi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/sdhci/sdhci_xenon_acpi.c b/sys/dev/sdhci/sdhci_xenon_acpi.c index 01b6c14dc5f2..3e8b2c4a349c 100644 --- a/sys/dev/sdhci/sdhci_xenon_acpi.c +++ b/sys/dev/sdhci/sdhci_xenon_acpi.c @@ -86,8 +86,6 @@ sdhci_xenon_acpi_attach(device_t dev) memset(&mmc_helper, 0, sizeof(mmc_helper)); slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK); - if (!slot) - return (ENOMEM); /* * Don't use regularators. From nobody Tue Sep 3 10:27:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdc4bbFz5MkSN; Tue, 03 Sep 2024 10:27: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 4Wyhdc1v75z4tC2; Tue, 3 Sep 2024 10:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yiShXwFClzYpxq+4VNFKVqBq/kUC9qqSm2ICnt3SNQU=; b=Y0ySTZ0tCkLxV5ObT1qShmaxBrlOeN3DhsAp1ijsVT1oUXc1sp+U3vdisy3ZhkVZDh/5JO mT17cSX2WKkfns4DgC6/2xVuA0091VS5KJfWozyWzRQqEaNQ4cQOvi/S/Ko3l69vrNJoyh hTb1gsl7u3qiTJLu8lELHGg4/xtwNjKRy5b64Hu5sQy9hRQQk7kZmXlQCXMS9Uqo4+NjSn HekAN1U7ZBdvsfvk/zEshmr1k19D3dLNFEJzoH+rTvNEYz9RNuO1YS8LYhtzGJ37htcqLP mGa75eyx6j4yYoMIc/gs4YuvIxseQOGtQVShZPTtzWDWSvkZUqPaJB/wv0z9xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359252; a=rsa-sha256; cv=none; b=MWIyP2hyDwebuEq5Zb0yr1UrNIB52CmDr2s5/dYp3epfLeyDGD6yKTXU89Uwp7vSFSXIXc 8bjWkCf1AdqS+868peXP+dU0Gwj1dc8laftW3MyECWyY8DAetLu+JZCduWYRBnhvHinyeo 6NqnZWuQ2BjM3c0hwT/X0YIVAMhseQhIX7YMS63n2tsFJTKHoprpUnkybnYtTi26t1XWgh BNtd8KkTPjiFjibyB2vCT2iHbEbVX0UOn68cTfa+q46aTRdFlQQtaPFGx72Zk15pjI9NBL YkhCwIGT7UfkknFFeTFByd84P8+3DWTh5a5YZ6bG6mOySRP+4FY5a0gB7xo38A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yiShXwFClzYpxq+4VNFKVqBq/kUC9qqSm2ICnt3SNQU=; b=p6KlMlKwEGjEzU9/I02aOUHnS3loG++ZroQXPoUkE+t1L+1lwTfycWrMN0UMhXRacXVTDM SzPBpD9x9jvSTCPRfgyNs+gh7TMQmUYMfFoBt7UkWe8lpCaivSTlI3kGnV2Ne+uO0kU0/Y df4/bT/i/yko87iZCTpdUTxy2sffB3bjkTULmqRwnRNDy11wB5dRmfytvvbT3Z35lyE53N Bapd8OfTVvxXCNviqJ4+hfIuZi1lvg9dz3OGbYnf+NQkvWbxZJpfoM+8q/roJsrLqX/Z5N D8Gx8v5eYBS7WHlHxdjVE2DewnrzFOjWLUTLa4CbCbatylK06UU59/eLMkcu5w== 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 4Wyhdc1W6LzcVT; Tue, 3 Sep 2024 10:27: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 483ARWIc010908; Tue, 3 Sep 2024 10:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARWFP010905; Tue, 3 Sep 2024 10:27:32 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:32 GMT Message-Id: <202409031027.483ARWFP010905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 778ea7ed5a23 - main - vchiq(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 778ea7ed5a23db9c4f9d8dc43a5cea26ded6231c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=778ea7ed5a23db9c4f9d8dc43a5cea26ded6231c commit 778ea7ed5a23db9c4f9d8dc43a5cea26ded6231c Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:34 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:34 +0000 vchiq(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c index 279aacd0880a..ab8981e25cb2 100644 --- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c +++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c @@ -278,8 +278,6 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle, WARN_ON(memhandle != VCHI_MEM_HANDLE_INVALID); bi = malloc(sizeof(*bi), M_VCPAGELIST, M_WAITOK | M_ZERO); - if (bi == NULL) - return VCHIQ_ERROR; ret = create_pagelist((char __user *)offset, size, (dir == VCHIQ_BULK_RECEIVE) From nobody Tue Sep 3 10:27:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdf00XWz5MkpG; Tue, 03 Sep 2024 10:27: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 4Wyhdd3FbFz4tLK; Tue, 3 Sep 2024 10:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRCXzmu4dDlICYzptiFg2o8WZX/HWhAsbIP+OarBiTs=; b=rqHWpAJru3W6H1j1K6WqmMFfaCF/veu6GjOPcPnoznx0f1bWd/8z17AIpPX8Qh7WlGqd7m t+/asWQBsmtaUofjb1cXOV/uHN+rDmawz5LMrlzgNhQC7QJ7iZ5/xuE+hvD6yAndlztGFU XuZJDDlvtGM7dGhY8NbaSB7K3zx2H4v/s5DNxoxVazLp7toumR7QNH9e8AAWZ8PpfoUj8g u0VsSXDXpBiva//dzHtoHSEdk57BELIjzlRDwPI9gmvaAamhQXELtp417rjsNK0kFeNflk 77yG25E/WgcJiGxK0gkUDTHfii/xhXgVJYuYcAM/1kUtt6yN5Caei2/UzwLzSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359253; a=rsa-sha256; cv=none; b=ZpMf/1UFtEgLpht1Za+5uOBluw0+wKt/ZpYPOjzuDktfzfVfqmRa/prw/Gu1GnLZ4HLkB/ ePDMNrvr7SdC+acvvfdyovY/ZyKG6QVHzYmt0stlzel4H/p1KfE/PrG5p2RHHVh3s49PMf 5iexg2v+1TMRNXF8YshYcgUV9Ek/WM7JgQfyVY3252vGv2cj23w1qcuHd2qTqdP747F4ni B7fv4LgESaO4N8dfJIJF60K+rj6uMZIlRbY5H0iya4SV8BDZkdX7jZ723/us620OJ9YFj5 S2oCHE70ll7SyU9XYhX1xMRFSFZBG4YCFMVr/ceJ0BWfM/wKOqY2D55y3zLWSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRCXzmu4dDlICYzptiFg2o8WZX/HWhAsbIP+OarBiTs=; b=IX5MDDbOKNJNNuDRgRx9svuaAptxNp/NecLVqsZQlxjVs512w2AhWttY8QbHEdEc1gIAs1 iRlfkaNcNOIx/jtqsANadlUZT6SIcMYC0FzU2MZnqoaHdvGAu1Ptl0iT8dLyG6PlnEDbWj hlOPf9R6kBCiK3oPsXaXhcjGK24BekKgM32eVFkZ/tXqL9Pqk45D8krZ73IDl+tXg5EGLl C3wb2454VYggGeduqyZqjmlZ/DwBPsQrDoQJb92oEMJDJIFVf/fIFDR9QKagrmCx10VVXs X2xvkuwrYgiOdsSazcoLoguygAvi8tU2pytQ+nuCLI7bRXOg+vKhXdWJ/Hdq2g== 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 4Wyhdd2p9gzcFh; Tue, 3 Sep 2024 10:27: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 483ARX8l010958; Tue, 3 Sep 2024 10:27:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARXk7010955; Tue, 3 Sep 2024 10:27:33 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:33 GMT Message-Id: <202409031027.483ARXk7010955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3f3f3ca25bc4 - main - ae(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f3f3ca25bc453315c6a1f5d16bfcc1189d41bdd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3f3f3ca25bc453315c6a1f5d16bfcc1189d41bdd commit 3f3f3ca25bc453315c6a1f5d16bfcc1189d41bdd Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:34 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:34 +0000 ae(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/ae/if_ae.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/ae/if_ae.c b/sys/dev/ae/if_ae.c index e424e1bd0e76..adbb3e48a4e3 100644 --- a/sys/dev/ae/if_ae.c +++ b/sys/dev/ae/if_ae.c @@ -362,12 +362,6 @@ ae_attach(device_t dev) */ sc->tq = taskqueue_create_fast("ae_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->tq); - if (sc->tq == NULL) { - device_printf(dev, "could not create taskqueue.\n"); - ether_ifdetach(ifp); - error = ENXIO; - goto fail; - } taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->dev)); From nobody Tue Sep 3 10:27:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdg6JWLz5Mkjw; Tue, 03 Sep 2024 10:27: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 4Wyhdg4sm3z4tHs; Tue, 3 Sep 2024 10:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WGUGdKER1SjdnM5If6/CB+gObyV9O2prkDPXnTh+CfE=; b=jz1tM0ZlmfJUXOadd/PKty5SHH6N8juhbHTjFL1Ah410nWpGIbYna/unf90tlNQWB3wbCZ ymsb4jkLjnua3t/Yv8TaSlw8nsb2bxz/TnR+7ZZ9ERL4I+N/cwVqqnUcMrktubnmmzeTbv xmInh1bgBRiWmUNLcTgKlRT9eEEMYTWViSmrkVvBRKYCh+jZa6SPANwjUB6nS5XVDVUMp/ zmFVmnuvdGkLwquBf41xO1nUVrb8Sbinr0Lxj0NDHyTm3uhVtUvanMUPJxFdj8JdE7x3Lk ULBbFCD8o/lXGWu0M2fJqu6vgx2Ve4I8wfxdpaZ2Hi8yozlkjDpFQqJCIhvt0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359255; a=rsa-sha256; cv=none; b=SoVRwDwpv1jkM/TPCPpyp+MXZ2encHN8+RlKp2BxpicIb3cb/kvkLaQDlXoUBWwtJH3bkG MZ64IULZU1MQoWiC+TFfRRvnwoE72gQydmTketM26VGuc+Z+rbv/YNv2xte7KvYFPu6YlY wGt48+NIcvJuSi76QMz7tAa5laU2hqeq1PPvC+h7A5qeavWerAGY2ELRPi28LLSO9wDdYO iM1HD6gk1G6/UgoajaWtU2w1XVGqPRIN9JbkQ39De14L/dt73Npwf5OLkXygVLK1r9LZ+K b0gnVVXLkBlud57QN7fk0hFPhjItRCBufqc/XPBEWHazwkM4CQDlVmUy7afH2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WGUGdKER1SjdnM5If6/CB+gObyV9O2prkDPXnTh+CfE=; b=J2DXNEft6H2Z7m2IxgMzOUCy52mYbhQRKRcsn1p+JkDXolt8cPlMDfUdI/Fk4U1l2nyWfO BgRxnj3m/0Ag8XQE3T9elAw/YgSU5ZpKoG9otxU9mFcogZvrkCWpB2hOSuvS42Ce3x0j6N XgQDGFIZv6pHSeoeQfn0a7h7Qv7iJS7d/aT6vonJzLdrzEZCIOa584XJkdZBjgeELcibjM XjUe+VvMSo+yEQEaGuku8HfIBD/GwUYrr1VqK2SXuiGzHOsA0WU85E3f8F36mOKSobItXQ 2aZP03kw4k/u2uGvQvumFzXi/l0STJ4NgQedcH3spi3epxSTIFsRqtsN3uzvSg== 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 4Wyhdg4QFWzcxt; Tue, 3 Sep 2024 10:27: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 483ARZKB011064; Tue, 3 Sep 2024 10:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARZEG011061; Tue, 3 Sep 2024 10:27:35 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:35 GMT Message-Id: <202409031027.483ARZEG011061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 0cd3976d0762 - main - alc(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cd3976d076218ea10761dc3f38ecf8549768ad5 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd3976d076218ea10761dc3f38ecf8549768ad5 commit 0cd3976d076218ea10761dc3f38ecf8549768ad5 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:35 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:35 +0000 alc(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/alc/if_alc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index 859d1214b46a..07ba02c33c88 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -1639,12 +1639,6 @@ alc_attach(device_t dev) /* Create local taskq. */ sc->alc_tq = taskqueue_create_fast("alc_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->alc_tq); - if (sc->alc_tq == NULL) { - device_printf(dev, "could not create taskqueue.\n"); - ether_ifdetach(ifp); - error = ENXIO; - goto fail; - } taskqueue_start_threads(&sc->alc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->alc_dev)); From nobody Tue Sep 3 10:27:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdf6yWPz5Mkjt; Tue, 03 Sep 2024 10:27: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 4Wyhdf3VGdz4tCQ; Tue, 3 Sep 2024 10:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L/UMDa9ir1YuAOdB0OJysmsk8ZHyhWtjFjlFybudK9k=; b=fJNlhcNFZV9+s/U2BE5X0rhhB2EcBJnjZJkopxVusFJOu7p59sxydXBQYl9JiNIluigSur N0aFmM8ARN8R/3oioep4mdBsO9an+nsDvlJ1VXtjWCkDu+YrzBFUVFVUrPDZpAYGwTAXA/ axzupZaexsgqcqF7cNPjBASWbJ1Q8y/vMcEGsGXtp3jTfWCX7JYtTp54BY50E+MpGPMGjs 9W5FQttREgJNoBWWLqpgM0qK36NbwKMVJjZtrQh2wzanaJ1k4Lv0Ho9AKT/+B0sKfo1HFG Hr57oh8/2iAUtQna+Na0763OldLaH2Uc07HI281FNASytHtyhYWZGfKsrEFOIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359254; a=rsa-sha256; cv=none; b=w+Cz1Hlpbg6e7hs7ETvUueEPAXlHUPoB9wckUC2FfulSCFXf5G7NvckGLERKYxj1IJRqRN l46L/E8YpL9i9dd7XrQ75UTEXjbykCpkjzFYpp/Ez5Axiop+KQoN2ZMISaP5uZJzEKzeV7 /fjF5FA5n8zCn/gCHHdRG5TtOZhG6P5oRshHqAn94BlS9BsRj4PEE4ntZGL85dRruCni/x uMKWbk59ptCSfW6yFFhDWnluEtiYTSOO/JemBZSGHANeJ+x57CBgblJWPbYbjE+iDQA7rH 6E69XhvKhIUgvXhd5H0Pw06knVNI6CIdUAzuejSO84KGcFv2ZSIpRUeuoKCuAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L/UMDa9ir1YuAOdB0OJysmsk8ZHyhWtjFjlFybudK9k=; b=ZF7g4tkTwIk1MLw9Taff2t2wnbO02YYUcUjB/DsZkaDp0CEsfi1LLeIZo5z80VVaDCwfBe 2dSwTsM64BcY8cbwaMMHIjVbNYaNucidtkaCNPOoZSXN7mFJXf8nfiJnSPveZZJ36hts9s ASzYXgnH7WlTSIKx12e5s0jb3RwATsc9pl5PJ49U9C7tvzLYBN8WOPVKHXZ/+RjYw+PTjk 5WKztvmYU912bffTRasXmk/IrT94yDC20Qyi03wTjcv1Z0TjJdEe10hjIMZYR2cga/VQUr 7tv5SrD/k7HjUPHpNjIBCWCPrjU9kzoRuRRF7FjWwUmv7UDZhbdJLEJ35vDuPg== 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 4Wyhdf35J7zct0; Tue, 3 Sep 2024 10:27: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 483ARYAb011012; Tue, 3 Sep 2024 10:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARYND011009; Tue, 3 Sep 2024 10:27:34 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:34 GMT Message-Id: <202409031027.483ARYND011009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 5cece2c24bfa - main - age(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cece2c24bfa618091e778df488fb2380fcecafe Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5cece2c24bfa618091e778df488fb2380fcecafe commit 5cece2c24bfa618091e778df488fb2380fcecafe Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:35 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:35 +0000 age(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/age/if_age.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c index 6630f2cf782d..10f99129401a 100644 --- a/sys/dev/age/if_age.c +++ b/sys/dev/age/if_age.c @@ -628,12 +628,6 @@ age_attach(device_t dev) /* Create local taskq. */ sc->age_tq = taskqueue_create_fast("age_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->age_tq); - if (sc->age_tq == NULL) { - device_printf(dev, "could not create taskqueue.\n"); - ether_ifdetach(ifp); - error = ENXIO; - goto fail; - } taskqueue_start_threads(&sc->age_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->age_dev)); From nobody Tue Sep 3 10:27:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdk1RQ2z5Mkm2; Tue, 03 Sep 2024 10:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyhdk02G6z4tTl; Tue, 3 Sep 2024 10:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=suDeeFlsKcEcZ81H9V69TQc3GVhtoIF5tQ6qVSRoMMw=; b=q11fdhoxhn2Xvk6PmqmbGoJzbaWV9e53T59hcyXACxtfBM11KnM+IjRhYsRkhox9izccyo PlBNj7XOWggCZ3wSK1jZmS+u0vKjicTtituNGnW8XVgUHJ3I5KtPgnwTkV7iPQ8Qd/MNz0 vLjlChE3Z1V2E0SZl6ObPTakAowi0X7/SAri0PlLheNUr0XTFeMNkh8uzxdkTx6xoANrDB zg3DF0KSF/HAGq74YimdOzuK5nuMnWcMs1fsmnCBEgjhGYXjPwgZHzAW5Ee7tOc17nShGl a2yKSXZh9pyVEe7Ry47uG+fk1HNJPm9vJO6kCooBTL7rBNdKM8fLnfS44pwssw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359258; a=rsa-sha256; cv=none; b=ngz+UT/ZIoATljvERl+2d7IUgp+3XkLbflvOG9GVHupNHfFIHrZhpQnPAa0sg5hDPyGG0S gVgbmmbwAafZV7vEzEXNlHg4kuwbgPOFgAyWm8shuV5YwV0mahsXsMHBgcjTke8CRQm32C pVTWbM9uAJ7qed4nAa2wIk0Jj5e3avFN50W7fAM2RqdQSIvaQOqZZLYiQxS1/nYvIqpkce Ah6M0HI5sJI5OHalBxiKrIOmFfgAXF65NKRIuSOx/zxcUs0075UIRWFDwyKCNAq1FGAeVz mVXv/5hNSlVvysRmX7Lt8LqZyxyOE+P5cT00+FQRWfvopIYelzjIA7TGHYFhig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=suDeeFlsKcEcZ81H9V69TQc3GVhtoIF5tQ6qVSRoMMw=; b=XYLoNhzxMAcYJLzjQpli8JefKHHT6uf3SSG/u+zLz/1VMKFkTFY9mYszTz/4BxpW2Nsu+t B8Q1zY+lOflOPGtJz7oBHAhKGD4lZNCN0P5MgzhygMjrqYQJZ95PArBjM+SXsNXHgjNnFj eyGwGKO0C49xS/rXtzNxlaFpsxgOFLWHFB7iJ5Go+JW/2T/9BQp37DgUkTUg8cWqfePBCU 0YSTe6LNUYyfaNOnE+nm/kWGpPzNucNp86O2wqHCLpznQEYjuOZLcX8p2uUXCbkPWD49Q8 HpyEi6R7HXltN4vcpAOwsrpqqSqoT/kXUORDe5M6IzCZCTtIpCb+8DmvXCIyiw== 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 4Wyhdj6h0Gzd17; Tue, 3 Sep 2024 10:27: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 483ARbEt011163; Tue, 3 Sep 2024 10:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARbec011160; Tue, 3 Sep 2024 10:27:37 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:37 GMT Message-Id: <202409031027.483ARbec011160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: b29adaaf44f6 - main - axgbe: Stop checking for failures from taskqueue_create(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b29adaaf44f6cf9433c782bbeeefd12d74d395a5 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b29adaaf44f6cf9433c782bbeeefd12d74d395a5 commit b29adaaf44f6cf9433c782bbeeefd12d74d395a5 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:36 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:36 +0000 axgbe: Stop checking for failures from taskqueue_create(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/axgbe/if_axgbe_pci.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 320799e77188..d3078a1c33c1 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -561,11 +561,6 @@ axgbe_if_attach_pre(if_ctx_t ctx) /* create the workqueue */ pdata->dev_workqueue = taskqueue_create("axgbe", M_WAITOK, taskqueue_thread_enqueue, &pdata->dev_workqueue); - if (pdata->dev_workqueue == NULL) { - axgbe_error("Unable to allocate workqueue\n"); - ret = ENOMEM; - goto free_channels; - } ret = taskqueue_start_threads(&pdata->dev_workqueue, 1, PI_NET, "axgbe dev taskq"); if (ret) { @@ -581,8 +576,6 @@ axgbe_if_attach_pre(if_ctx_t ctx) free_task_queue: taskqueue_free(pdata->dev_workqueue); - -free_channels: axgbe_free_channels(sc); release_bus_resource: From nobody Tue Sep 3 10:27:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdj2HVZz5MkZt; Tue, 03 Sep 2024 10:27: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 4Wyhdh5yQqz4tRL; Tue, 3 Sep 2024 10:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEfdkK3GCsBWzEqfkuO5FOhVxA9vkQxINewBMvOX33M=; b=jcolKhgX8cub/eL0+dj3wVyooaTv5IpGBu5StGw8qLiBONiW3GSc3InUOr43tV4St1qAD3 3sMZYDYIL0k5a02bnVFsfyjLTLsJdkvL0l6j2t4LjzRp7dQSackAi169o0bR8vwber/WaI 8nX9gqQUTW2XFKvrg4u2zNawB1HU3Bo88apMl1f3Y/Ym64GV4+O/urdvHo8LQELuTT8j1c OLdDoJJXAdVX4zmd1XeCVi8wtGFEp8PuOHJI63LrrZsFCTanKIfdDeQ9v+geuRmP513Ytr wmhcibArT5FM1dw/pEXWgrTbpiU8k4nEJ2WmQaTgGT7MRkFm/WJhQJHUTf489w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359256; a=rsa-sha256; cv=none; b=q0M1F0YtF35wRgAV/YVOBmURp72m1+clOu58tStgM60SFm4cZhfQw6iVyaJRZB7PSdp1ZL 03f7A2GCgrKZtStsSJjsv0kLD0q67qFaLkGBLcF5t/HByTNfov3XNKYn2De7yBirhXgsmZ RwDjYaCxSIRXx/SJ9x+9XUP/GaNUbRxH6OIbtctnYB77trnvV59GRYCiJBUzJHknE2NFdS nVX/Ex2f5JrcLtDACwv9LzcBRs85xZtdgxr7Fz1IzzMOUCRIlP7YENMvw61I4HZWr0WYo2 X3AtWl5xb2P/thsiGybDnHa+0xWaASabQgGMWUksjvFKfGqLIHIX7+ac6HxBTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEfdkK3GCsBWzEqfkuO5FOhVxA9vkQxINewBMvOX33M=; b=Gbhk5d9x/fkYRxzKnWLpeMrbfPiupQNsZqt9LjCLKm1nk8+tBt42ANK8OuHZ+qt2pQ0R5P gtB78zbonqd0vt/aXwPuAbCRpDNODS6hXRreFxD9DqZ06hKqJRh4BKXe411UjEhE2deNbq SsjRyLaopxbLqdrLMbOGlzB51rPAD30fTu56Vq755B2S8otpZxQujotGOf/eoFWL40G3qI y7cOuxLAAA8THG0LnZx2u0GOPpasgts2XceS0jUuKACOJ0fKvqfZqbrfxMAA6XUUrKhLdw 9dsooL4uJ600MznhKzeiXej8AT4kExXZJpLBZel5JKnU2acafrIXGJPSnC1bdw== 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 4Wyhdh5X12zcbG; Tue, 3 Sep 2024 10:27: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 483ARamc011115; Tue, 3 Sep 2024 10:27:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARaw9011112; Tue, 3 Sep 2024 10:27:36 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:36 GMT Message-Id: <202409031027.483ARaw9011112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f5524be39e26 - main - ale(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5524be39e26e3d7fb774ffe7711602c676a8b9e Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f5524be39e26e3d7fb774ffe7711602c676a8b9e commit f5524be39e26e3d7fb774ffe7711602c676a8b9e Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:35 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:35 +0000 ale(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/ale/if_ale.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c index 5b3ae438810c..e4d61e636f8b 100644 --- a/sys/dev/ale/if_ale.c +++ b/sys/dev/ale/if_ale.c @@ -655,12 +655,6 @@ ale_attach(device_t dev) /* Create local taskq. */ sc->ale_tq = taskqueue_create_fast("ale_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->ale_tq); - if (sc->ale_tq == NULL) { - device_printf(dev, "could not create taskqueue.\n"); - ether_ifdetach(ifp); - error = ENXIO; - goto fail; - } taskqueue_start_threads(&sc->ale_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->ale_dev)); From nobody Tue Sep 3 10:27:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdl4XVlz5Mkrv; Tue, 03 Sep 2024 10:27: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 4Wyhdl12w8z4tDJ; Tue, 3 Sep 2024 10:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5mwdZaHnNZ9VogacJknWUdGk1VEF/nnC85AkPf9YdM=; b=XJcIajLsPhRT2GlbGD6xiIMAen0vBmwq46lI1qt1oy/4RvNY/TVahWUHJXU8410faawLsX cFQjbs/wnSce+65j5NZe9Q4IT/rjR1ecuPKDDkHAPa7MprLQFCx9MJIRATS2quDwihD3o2 KYdTc4A6+1tZLunmsMK9q7fTV7CC6iNgZ6QkGZPKBse6Hg5SHEjhhLztUwOLHLU/FQZKsI tKzq0v9YQ26/8jUmyTX8DbmO67cMoOwDCOECEExaW1jaJcKR2BRRBqv/2+Hy0aXNriWj5I PQwPHdMj8nYjbqX36dsPtf6t6lzFzPqRmc51+zIi1aMI/ajNZhdyy07mAXZMYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359259; a=rsa-sha256; cv=none; b=d4cO8o5iOdPgSNCfZuYNp8Rj4zgfcqxHkJCFvVdrVTpTuUqEJPCXKGW53oC/oP61+3IDb1 3sjwxSgDiyIqog60jzROf9OI6o3iQ12d8AICPo2zg5YpIsdWcwOeEC7zlAko9rMnZrlbYJ oyc8qTia3+FTDpv0QEVwBxOz58QutNs99laUt136oKWO/6We+c7u6DnHsmHDkzyHt6nhkY y+UXrCXj7+pK0ncdHhqJBznzO+ek9CCrIJdmH14I6L4fKM+XbKnZMG8IB6p2RVaRsgV1It o3F/VkMTa1ouAy6/KkECerafnJRUnRoA8xFoRJqQrFVTlEVpfHKyKtxZN1+g8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5mwdZaHnNZ9VogacJknWUdGk1VEF/nnC85AkPf9YdM=; b=d+zlZ/jDHb6qZGCsS/iE1G23FZJEB0BHoC6QpymAGUPglpTgPVMS+e6FWfSazvFjDArh9O e0C91z8M6TgZrVZHRziKjqQmEK6ky/mEg1DChJ/XI2T4EshyONpP/q9hFdgGB9TKVVp4AF +5z982LfR7LPSiTxOY2fwd7GTp4PwNhFnG1M0TF6TIlUUI+916DLdKV74/7ak4HeEWj5WG 1JTvoBDtcJ7naKZwBKC/TSl3tF0x29wlnfWBIEb/DfcxwnGi7FwPTb8YgSUCrE85i+MedT +nXnDzMd7kZt80ufgAYjnZy0H7x4Yky4SWJ5vN3GWP0wXqbi55L2tgLOvO+nvw== 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 4Wyhdl0Ld7zct1; Tue, 3 Sep 2024 10:27: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 483ARc3u011211; Tue, 3 Sep 2024 10:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARcbw011208; Tue, 3 Sep 2024 10:27:38 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:38 GMT Message-Id: <202409031027.483ARcbw011208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: d44bc2f07b97 - main - bge(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d44bc2f07b971fe1f451a1fff0389650a2502422 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d44bc2f07b971fe1f451a1fff0389650a2502422 commit d44bc2f07b971fe1f451a1fff0389650a2502422 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:36 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:36 +0000 bge(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/bge/if_bge.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 23259179cc62..6c3301b1473a 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -3890,12 +3890,6 @@ again: ~BGE_MSIMODE_ONE_SHOT_DISABLE); sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->bge_tq); - if (sc->bge_tq == NULL) { - device_printf(dev, "could not create taskqueue.\n"); - ether_ifdetach(ifp); - error = ENOMEM; - goto fail; - } error = taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->bge_dev)); if (error != 0) { From nobody Tue Sep 3 10:27:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdn4SD1z5Mkm8; Tue, 03 Sep 2024 10:27: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 4Wyhdn2RvJz4tSG; Tue, 3 Sep 2024 10:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KdSGyUtfQ7uPC0Div044p4o7SSJsbld0ZiH5rOFkvnA=; b=QhkzwK48iRaC4EidziSc1O4Kw3MqOPfhdPy0NdxBHp8+AXPgwGt1zwSooCQ7XScWqaLW7C tlrE4sDlzlWMkXvcQtb4V2Yyc5skFUTF9vyrSXCbgBh5K4nd0Q5+nwvbpxL/FiMa1WkABv Bdv+RqF5i/pHubQD0U48voz/oA8KzskH+j5PozFC0fuZPxCgdqF2wy6NzOnu5HgnChdtPr JeDLykjB9PI6cvahKcd3LmtxqLDodahiD0ojF/+mpZoyvjJwOXRpFKZ6g/AwVMhbgFfTb9 3wy8Iw1m0NkY2YHv2/156aPcriYvpC4HaRnjOLTO3kop899zBC7WEdo0qaJEbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359261; a=rsa-sha256; cv=none; b=bF9y4ixhak5nUGqyov/wuaGlpf/qABIHkg5ailqMGqA65v58y5ZQSAtM3G0E6AvHGjDkax C/w2ue3xa23pg15/MBq2Tur1GaOzqw/36AZF14Qer6hEu0PZY6A4LScFgzE2K95QQsSVvJ MaOnOWAQ/cjivxo9cMfz5BLdu1spYhFi6YW4ZZy4LobetIcVIgb+Yf4Dl14lE90+JEb/Qs uQyIX3bpWhG9eWOsxyvz0IHyyDjIQ0rdUmHlQvvR6c/vKYPDZ6toyxD90usJ0CrN8k5R2/ qx3GZR5ZbujQ/1e7zJDYfi4vjr8XvITrDfGam29fw71XQDjvdS2pc3Blal3NQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KdSGyUtfQ7uPC0Div044p4o7SSJsbld0ZiH5rOFkvnA=; b=mYp84xTkAs1kTMoJubw7yzaR8yBeeXs4ZcheA65jSXUXSpmQ4DFGvC97B12dtZKuw/HAo8 MdZZAqqg5epABc7JKrvYpjidqZpnfHBmpw2wCIVffrnWawVf2TAYKBjghVwhPY4e9C6Htb K1Tzg4QmnqnuJoPDOoCLNNNc0TVY3oKXsFGWmV+qKK10PTDLsk05ro8iNwTb61wZbIaCt/ pmgS/C5v/P8qJAs8jaTcy30KGlWnFhHw6HmcujUync4z81GlPYL7pDKSVnc8zqW5+rxEnK PNhvlDIgRLo6nuJkUmL3gvCkMuYqsGNXMnmBKFry8ouf2zKoW64hwEWhFZqpbg== 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 4Wyhdn21NwzcbJ; Tue, 3 Sep 2024 10:27: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 483ARfKN011316; Tue, 3 Sep 2024 10:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARffk011313; Tue, 3 Sep 2024 10:27:41 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:41 GMT Message-Id: <202409031027.483ARffk011313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 36ef39831fe0 - main - dpaa2: Stop checking for failures from malloc/taskqueue_create(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36ef39831fe0e89f0b1672340a44c4ac1183158e Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=36ef39831fe0e89f0b1672340a44c4ac1183158e commit 36ef39831fe0e89f0b1672340a44c4ac1183158e Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:37 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:37 +0000 dpaa2: Stop checking for failures from malloc/taskqueue_create(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/dpaa2/dpaa2_channel.c | 7 ------- sys/dev/dpaa2/dpaa2_mc.c | 2 -- sys/dev/dpaa2/dpaa2_ni.c | 15 --------------- 3 files changed, 24 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_channel.c b/sys/dev/dpaa2/dpaa2_channel.c index 87b76923a16d..654c6f2baf70 100644 --- a/sys/dev/dpaa2/dpaa2_channel.c +++ b/sys/dev/dpaa2/dpaa2_channel.c @@ -146,12 +146,6 @@ dpaa2_chan_setup(device_t dev, device_t iodev, device_t condev, device_t bpdev, } ch = malloc(sizeof(struct dpaa2_channel), M_DPAA2_CH, M_WAITOK | M_ZERO); - if (ch == NULL) { - device_printf(dev, "%s: malloc() failed\n", __func__); - error = ENOMEM; - goto fail_malloc; - } - ch->ni_dev = dev; ch->io_dev = iodev; ch->con_dev = condev; @@ -281,7 +275,6 @@ fail_dma_setup: /* taskqueue_drain(ch->cleanup_tq, &ch->cleanup_task); */ /* } */ /* taskqueue_free(ch->cleanup_tq); */ -fail_malloc: (void)DPAA2_CMD_CON_DISABLE(dev, child, DPAA2_CMD_TK(&cmd, contk)); fail_con_enable: (void)DPAA2_CMD_CON_CLOSE(dev, child, DPAA2_CMD_TK(&cmd, contk)); diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index 66867a18068c..da8f8a077d6b 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -462,8 +462,6 @@ dpaa2_mc_manage_dev(device_t mcdev, device_t dpaa2_dev, uint32_t flags) return (EINVAL); di = malloc(sizeof(*di), M_DPAA2_MC, M_WAITOK | M_ZERO); - if (!di) - return (ENOMEM); di->dpaa2_dev = dpaa2_dev; di->flags = flags; di->owners = 0; diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c index a21351a20b49..6ed656849709 100644 --- a/sys/dev/dpaa2/dpaa2_ni.c +++ b/sys/dev/dpaa2/dpaa2_ni.c @@ -588,11 +588,6 @@ dpaa2_ni_attach(device_t dev) /* Create a taskqueue thread to release new buffers to the pool. */ sc->bp_taskq = taskqueue_create(tq_name, M_WAITOK, taskqueue_thread_enqueue, &sc->bp_taskq); - if (sc->bp_taskq == NULL) { - device_printf(dev, "%s: failed to allocate task queue: %s\n", - __func__, tq_name); - goto close_ni; - } taskqueue_start_threads(&sc->bp_taskq, 1, PI_NET, "%s", tq_name); /* sc->cleanup_taskq = taskqueue_create("dpaa2_ch cleanup", M_WAITOK, */ @@ -1339,21 +1334,11 @@ dpaa2_ni_setup_tx_flow(device_t dev, struct dpaa2_ni_fq *fq) for (uint64_t j = 0; j < DPAA2_NI_BUFS_PER_TX; j++) { buf = malloc(sizeof(struct dpaa2_buf), M_DPAA2_TXB, M_WAITOK); - if (buf == NULL) { - device_printf(dev, "%s: malloc() failed (buf)\n", - __func__); - return (ENOMEM); - } /* Keep DMA tag and Tx ring linked to the buffer */ DPAA2_BUF_INIT_TAGOPT(buf, ch->tx_dmat, tx); buf->sgt = malloc(sizeof(struct dpaa2_buf), M_DPAA2_TXB, M_WAITOK); - if (buf->sgt == NULL) { - device_printf(dev, "%s: malloc() failed (sgt)\n", - __func__); - return (ENOMEM); - } /* Link SGT to DMA tag and back to its Tx buffer */ DPAA2_BUF_INIT_TAGOPT(buf->sgt, ch->sgt_dmat, buf); From nobody Tue Sep 3 10:27:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdm4XxCz5Mkdm; Tue, 03 Sep 2024 10:27: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 4Wyhdm1v65z4tPs; Tue, 3 Sep 2024 10:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XR4urAIyGNEGjlOS4vr2Vrrl5jSANKLiFuCOgvvA0+o=; b=T2WvJjnHbbYdcWqkzM9Cjxc8mNH5GWhcsx/fqPYbxPugR7QN8cv1wIHKzTZEVxFl6zcP2Z wChOZDQsq0WU1+vD/t9Q/TlD7GhtY5hRcyirRrqQCC+O7BPX5dE3CMjp7UQAVi/mhBmE2o XXjD603V8Pyw6CVEyhVKg0GTAD0umncngr4YH7qdoviBmRHBijRJrTq68GvUJiJsujvg7r 5OCR3cfnzlYIOwOFhGFdB8W/C8Ng4oYJYztKZkOkXE/WZ6nnn5qhc/ZOB0I7gioL1Y875Z 07PcsrNk3OU2rhERl4w5ajs50KGHJq7oXnfqyz+VznU1HJELakdoZtbEJG1S2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359260; a=rsa-sha256; cv=none; b=gvMNxzNtmi/sp6Ueq5BrQZRa41+e4R9/4mQdkLwvoxS/xtbzQ1ecKX/HorDyrjqUuDT4Ds oriT5YhKwnzbqLnS1bVqM38z6joOleDluUcCvq+8nbjJV7kWo2QKx3IOfXX4NKRS/LKXAL XKAOjqfKhs66a0YTJxWKKL6jq+r5TcQOuzZyyUPNGDOp+IeiUIJ/TaCfAOpeowKU26+SUv kwZYFbq0Tfe9HFhiD31p9oqGB0D9EvbmPE1ki/8771Y0+f+IU/i+zU1f/Q0GQUnGHon7dZ w8s51zHHe+YBWi5crHdZIg27sfLQijB9Em8+Sr1PFGhzSOH1ydqX0cdtQUgRrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XR4urAIyGNEGjlOS4vr2Vrrl5jSANKLiFuCOgvvA0+o=; b=yK58myp8pJ3hFHN3FKKcQ1w1Sy4XUs9b1d96dZqrrjC3PhEOX07lr6y40tYbB9M7dn0UTf jPJN49rBaK95RHfAlr84RqKLkPw7er6/YueoQLkNdyrItpc3UMEkIqWwjGmF8RvQyzCLKS vt7VWsLw0oapgOerQ6yuFy/dJV7fzET2de67YX7bBSDHqIf8RcAvST6EBi0+9Xg0eWpFq5 RhUEhBblaz4gfvssqO03SxZdbVSKK2EhVHSUiRqJ4lWPp4SkAuvWil6v0yiAucfAeBTeL6 OZ+nbtDdUagi79WTNTF+v2aRBU25q6kXS9Ep/07PN8YZDk1EyFHcy2talr8Fqw== 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 4Wyhdm1N2HzcbH; Tue, 3 Sep 2024 10:27: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 483ARemI011268; Tue, 3 Sep 2024 10:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AReH1011265; Tue, 3 Sep 2024 10:27:40 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:40 GMT Message-Id: <202409031027.483AReH1011265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: af28fc3c191c - main - cas(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af28fc3c191cf572f7def767c60fff59d48947df Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=af28fc3c191cf572f7def767c60fff59d48947df commit af28fc3c191cf572f7def767c60fff59d48947df Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:37 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:37 +0000 cas(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/cas/if_cas.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c index 76d1b713e5bb..1f684097bd3a 100644 --- a/sys/dev/cas/if_cas.c +++ b/sys/dev/cas/if_cas.c @@ -205,11 +205,6 @@ cas_attach(struct cas_softc *sc) TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); sc->sc_tq = taskqueue_create_fast("cas_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->sc_tq); - if (sc->sc_tq == NULL) { - device_printf(sc->sc_dev, "could not create taskqueue\n"); - error = ENXIO; - goto fail_ifnet; - } error = taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->sc_dev)); if (error != 0) { @@ -462,7 +457,6 @@ cas_attach(struct cas_softc *sc) bus_dma_tag_destroy(sc->sc_pdmatag); fail_taskq: taskqueue_free(sc->sc_tq); - fail_ifnet: if_free(ifp); return (error); } From nobody Tue Sep 3 10:27:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdp67H3z5Mkvm; Tue, 03 Sep 2024 10:27: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 4Wyhdp4R6pz4tm3; Tue, 3 Sep 2024 10:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=irZ6oHGttFuT91LSo0/0mZnHaHVYEW0I0+C8/loYMyY=; b=oiDaFUgYj7VZr4pxgtOxNQSW/Xum30ojERwUtGee2fRs+YAvqufMwFIURvXMBJ/Y2P63CD fj5ITKfOMdsIbYY4ILUUpU3lVRhQApuNHMZc0w7FNt8vprv+xtLEr7AoVsJ8zYRk21tBxB XFldvId5lY8/2DfoqY6/2BOVmPYBvRH1sChHh21JcjEYS7C8+iOXWVlNfkusJX+FJ3Z63V SOJdNOXF4Mziftgv/Qe+Y44J/cxSyniRmIT1q/1h4jdDa1LoSsX6fD5clBVcyyrHAdiFtJ DNbNHUsMNB2t2AbDKpFvZoVxTFXFkTVaFGXWdtu8PHeo0q+LqHJVvcdQQ1uA3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359262; a=rsa-sha256; cv=none; b=yeY6MOtReGbp3c+WOxgEdBDtGNipQ50/1xPs2H6mN1HS8MSqEIE2V0zszPeWawIYVpufix mnOVh/O5HdmxF5yJro3NdfUhRmyvJlBQ7NZMLPUy4k5qmqP1+BbociFiBAJRG1WtMQxK+Y iPUFmJxMXOzFPv/AgbuDzKE+RDgo44uThjHWS7h8DAC61BBI6eq1hn2/rhoAHE86qT9QgR 2YX00rDbmyqqmv1PcvPet9wW0QVNFsg5GP7sJJr/cWZSVVGn3Q6OAYOimjvf3aPvZUQnfi hC3UpZBd66zwYTuSQhNcUg0VP4qu5t9ibQYwFbLi5znXF0X9cxp2c3e2poULGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=irZ6oHGttFuT91LSo0/0mZnHaHVYEW0I0+C8/loYMyY=; b=ufzhN37LOAYAKEBfKGlQbDIbF7R1pLiJYRRU0bdnC22JZfW9Euz1E7oeDSsLsky1NyvruK Ixi2A/fUQgm6E5MbpXnyjOjoqvg40nR94hBXVOYjroj7ZmRLK4k0NXoBZdhDqq6p91eEg+ x9jgd0jgcgtR23zhdRq51BkGdTlAPaZI20FPtTBQkgqvTFnuY2kU7UwfPk4QCvDFC6NVkh DlCguvxuqFTgDYqK/LJRnV/9xc4RO0uZ96PapozF3CCjSyl/dcfSEAPWNlLYc9dXKAy47/ CkOvUnz1lEmCjDBsWfCzPSqIHdQFDze8oIymDcjTlUsr8C/MCqqMyIG9XSsBxQ== 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 4Wyhdp36KrzcbK; Tue, 3 Sep 2024 10:27: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 483ARgR4011364; Tue, 3 Sep 2024 10:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARgBi011361; Tue, 3 Sep 2024 10:27:42 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:42 GMT Message-Id: <202409031027.483ARgBi011361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3fdef8e85502 - main - jme(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fdef8e855027d5c9bec06e2a53e8f99f7d5694b Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3fdef8e855027d5c9bec06e2a53e8f99f7d5694b commit 3fdef8e855027d5c9bec06e2a53e8f99f7d5694b Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:38 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:38 +0000 jme(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/jme/if_jme.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/jme/if_jme.c b/sys/dev/jme/if_jme.c index 96824e2d7f27..4f739ec26347 100644 --- a/sys/dev/jme/if_jme.c +++ b/sys/dev/jme/if_jme.c @@ -872,12 +872,6 @@ jme_attach(device_t dev) /* Create local taskq. */ sc->jme_tq = taskqueue_create_fast("jme_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->jme_tq); - if (sc->jme_tq == NULL) { - device_printf(dev, "could not create taskqueue.\n"); - ether_ifdetach(ifp); - error = ENXIO; - goto fail; - } taskqueue_start_threads(&sc->jme_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->jme_dev)); From nobody Tue Sep 3 10:27:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhdq5cjVz5Mkb1; Tue, 03 Sep 2024 10:27: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 4Wyhdq4D0Rz4tmF; Tue, 3 Sep 2024 10:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xGGo2Ky5H8rp0vL2BaWbq77E2uOEelAKDMFdgxaOsn8=; b=sIvys+xySi/WuzaboiXxdRziO08JLvw8a9vMW7ZZ8lDfuMfmbsXyPAt4QBfp14f6MBpmBV 0UBuz/cMZ0xXhnCP0laA6WQT7jL4hrZbzfmd6a4T20AkCA9QS2pVv9IkWxuJuiooQfMT4z 3obRNVmrXF8jsqfpmvtP6OdOTs/T2ZGpqlr4caBcskEYOhubhGgkbOt2OOthG7HP+dxaen EhhKf4BSyauZElYxEhG2t/5DuJ+mcqGuxymYeJ4O3Xbu87LuUVl+t7CA3YZ6z9/zXMJgJ2 7STSvYM+vYLxIiOgcK6OImPQCgJFNGc6flp41FU+mnpLZluxGzMaUGdDpSK+1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359263; a=rsa-sha256; cv=none; b=lq+dm8lvwB8W92pGeEpR9pIlYG2trRoU6Vg7bUqwORdNBBTxrRvtxc5ZN/6IM/a4S6KWnD Lt4lTshCAKwSfqv7dxh4FRlekcHi7nPEkoE0E6UsqSNW70UcJDhF1tZRH8ULqy0ckyO8PX yTJUNDh35j6sJhzmlw1aOjG+XypMWkq4T52EzFAfoaYSj17vp1PNVQMqPzVx0flnFUAW/W cj0SbLnVoJJcp9yeB7OHg3uui6YBEVEc3cWOODxt54VKD6Q+m/P8DMdhTKhfFHtl+yJfZG 5werf9ce6BkZgE4NSXpA89N6qNgOcZoeZtMki4eZYzJTTf2ipTUewNmGSo5n5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xGGo2Ky5H8rp0vL2BaWbq77E2uOEelAKDMFdgxaOsn8=; b=jMuQbY0xLctZ0rtTkA2mhfUUAjiIfHfXbwroVuY7QYWk6vHWaxy9SHjzoP8UFy12ZYpuPl tCOu2VUDY8+C5bat4mPxNRCAjnI6e1pPg5pih3HQh9d+SXbgCLfD1FbpB2YlBA8xRMxII8 YbtujYSFB3VH1mGVRH1gaF0YImMZ+6vNWa2HsjqQ/obCrtCrCphWjminIRF+buRvbqu5Va oS1QAhWTdN9PVONEpuDayYOvQFACrGIRNyfrnGIt76u3RhKYoghGNqJrEU+B0v4uTMCnGe JbrEpcfWHGgd1AV0AyMPCH5uXMOMNN49t3O8II6TZEN3QMlW1Xrqj4w7+DcPBg== 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 4Wyhdq3rGYzcLK; Tue, 3 Sep 2024 10:27: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 483ARhkM011413; Tue, 3 Sep 2024 10:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARhJL011410; Tue, 3 Sep 2024 10:27:43 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:43 GMT Message-Id: <202409031027.483ARhJL011410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 57cd8f27b727 - main - liquidio(4): Stop checking for failures from malloc/taskqueue_create/buf_ring_alloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57cd8f27b727e7a87312f6f141cfa13807dc81a0 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=57cd8f27b727e7a87312f6f141cfa13807dc81a0 commit 57cd8f27b727e7a87312f6f141cfa13807dc81a0 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:38 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:38 +0000 liquidio(4): Stop checking for failures from malloc/taskqueue_create/buf_ring_alloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/liquidio/base/lio_request_manager.c | 9 --------- sys/dev/liquidio/base/lio_response_manager.c | 4 ---- sys/dev/liquidio/lio_main.c | 4 ---- sys/dev/liquidio/lio_sysctl.c | 3 --- 4 files changed, 20 deletions(-) diff --git a/sys/dev/liquidio/base/lio_request_manager.c b/sys/dev/liquidio/base/lio_request_manager.c index f4eae0c8bf31..95eac12ecf3b 100644 --- a/sys/dev/liquidio/base/lio_request_manager.c +++ b/sys/dev/liquidio/base/lio_request_manager.c @@ -159,11 +159,6 @@ lio_init_instr_queue(struct octeon_device *oct, union octeon_txpciq txpciq, db_tq = &oct->check_db_tq[iq_no]; db_tq->tq = taskqueue_create("lio_check_db_timeout", M_WAITOK, taskqueue_thread_enqueue, &db_tq->tq); - if (db_tq->tq == NULL) { - lio_dev_err(oct, "check db wq create failed for iq %d\n", - iq_no); - return (1); - } TIMEOUT_TASK_INIT(db_tq->tq, &db_tq->work, 0, lio_check_db_timeout, (void *)db_tq); @@ -179,10 +174,6 @@ lio_init_instr_queue(struct octeon_device *oct, union octeon_txpciq txpciq, oct->instr_queue[iq_no]->br = buf_ring_alloc(LIO_BR_SIZE, M_DEVBUF, M_WAITOK, &oct->instr_queue[iq_no]->enq_lock); - if (oct->instr_queue[iq_no]->br == NULL) { - lio_dev_err(oct, "Critical Failure setting up buf ring\n"); - return (1); - } return (0); } diff --git a/sys/dev/liquidio/base/lio_response_manager.c b/sys/dev/liquidio/base/lio_response_manager.c index 12a3ad60521e..ac5fc6229885 100644 --- a/sys/dev/liquidio/base/lio_response_manager.c +++ b/sys/dev/liquidio/base/lio_response_manager.c @@ -59,10 +59,6 @@ lio_setup_response_list(struct octeon_device *oct) ctq = &oct->dma_comp_tq; ctq->tq = taskqueue_create("lio_dma_comp", M_WAITOK, taskqueue_thread_enqueue, &ctq->tq); - if (ctq->tq == NULL) { - lio_dev_err(oct, "failed to create wq thread\n"); - return (-ENOMEM); - } TIMEOUT_TASK_INIT(ctq->tq, &ctq->work, 0, lio_poll_req_completion, (void *)ctq); diff --git a/sys/dev/liquidio/lio_main.c b/sys/dev/liquidio/lio_main.c index 7104ff07674f..3c73a6b10eed 100644 --- a/sys/dev/liquidio/lio_main.c +++ b/sys/dev/liquidio/lio_main.c @@ -1854,10 +1854,6 @@ lio_setup_rx_oom_poll_fn(if_t ifp) rx_status_tq->tq = taskqueue_create("lio_rx_oom_status", M_WAITOK, taskqueue_thread_enqueue, &rx_status_tq->tq); - if (rx_status_tq->tq == NULL) { - lio_dev_err(oct, "unable to create lio rx oom status tq\n"); - return (-1); - } TIMEOUT_TASK_INIT(rx_status_tq->tq, &rx_status_tq->work, 0, lio_poll_check_rx_oom_status, (void *)rx_status_tq); diff --git a/sys/dev/liquidio/lio_sysctl.c b/sys/dev/liquidio/lio_sysctl.c index 729f4d432274..61a7e96098c8 100644 --- a/sys/dev/liquidio/lio_sysctl.c +++ b/sys/dev/liquidio/lio_sysctl.c @@ -744,9 +744,6 @@ lio_get_regs(SYSCTL_HANDLER_ARGS) regbuf = malloc(sizeof(char) * LIO_REGDUMP_LEN_XXXX, M_DEVBUF, M_WAITOK | M_ZERO); - if (regbuf == NULL) - return (error); - switch (oct->chip_id) { case LIO_CN23XX_PF_VID: len += lio_cn23xx_pf_read_csr_reg(regbuf, oct); From nobody Tue Sep 3 10:27:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyhds2nslz5Mkb3; Tue, 03 Sep 2024 10:27: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 4Wyhdr5YJnz4tmR; Tue, 3 Sep 2024 10:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ZO+hZ5YFWgGWGakC/gsbDHr0FnIyPG8D4WEWElzQFE=; b=QjILrLS6XsUbryxVRDT7kG+oy1EDq6ZeKTC2yIkk6PZ6zVql0zv2buFjk0dW6W19YO7uqo w/HUm7x3ZMotjP/wmOXlz9KgXdXpHTbTSoqyOiMsIbB6BhR/HnJVOEcn9Sbl/QpthG3bZI CUtAPPwFzxHGBdeFWqd3cNDwI5ABQHlQ1NmkMBhD124Zo4z3qu+VNrS8Q3K986eAW+0raE dhsaXNFWL8YvS6ORW3aHP7Hmuye+lkFuZyXgnAbwcRVkrYd1H6Zx8ZfT0NjnsF64e+kTPQ IWcsfsjQKUaAA1VA7vLAtgadqALuzsHOHd4ujbAQGn+FhFn4EqsUGKtAU2RmEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359264; a=rsa-sha256; cv=none; b=bKZVKbZKFTvfnFjr7EFj4N8pJ97O3+r0LKx5Ge+FWGiqJifmqejoOtG1MspobP1aSf5BEO 7otfLhYVPuVL9nsM8lvQdeJsA5af13EzKJ9mky8qAS569BT8ppOCNghoEaMoivimDWjVTb BJ8dWh9qRHqGCMLhC6pqis8R3iPkfTAEbrnIDGgaRESgvksXAMQnsvBUSTBtJdhq9cx71o N0Tx0EmGr+bee6CsRIxJ2nHIlGywLI/Ked+RV5LolZsoljD9+JJLmABCyMV9Z/NgJo4fXT Ypxk8yJD04BcEStvgFXQrL4jt4OVW0G6oQH9qrVhDbUtA+QQcjWDVaoYdR+f0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ZO+hZ5YFWgGWGakC/gsbDHr0FnIyPG8D4WEWElzQFE=; b=rH8C+u80B90gYaFXvFjq84TpKk+asJNrbkBsRurWOSivG2X9nt4uLndx7OELeTRIzG4clT FpRuLcPKxB9973yaJnrI2gk8F/3pm7ZQHiGsTCTxkU03DW59eo0Dg4jd0wgHd4nHuxue3/ L8r2k8Q0Gap/XCFBLt/KrCnf78VhokKxlioKdlWvJYgoYC1MBXkEtHHrjOTInLn7lbBlxF 4Fr4z/brzRdwXuPzhwkSe44YQijnGGfXiYlyfm85R/aVm9//mYIG7FKac+kyJUScSyNGeH Ibc65KCUfBVG2TcJKfQe0IZiXY+zTumBGrfjEMFNOF1JLmTc73Yg8FxxzAn/VQ== 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 4Wyhdr56wQzd18; Tue, 3 Sep 2024 10:27: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 483ARitS011466; Tue, 3 Sep 2024 10:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARiEt011463; Tue, 3 Sep 2024 10:27:44 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:44 GMT Message-Id: <202409031027.483ARiEt011463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 7ea3fd3bb5f4 - main - mxge(4): Stop checking for failures from taskqueue_create(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ea3fd3bb5f4039c372fd72aeef004fe12454537 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7ea3fd3bb5f4039c372fd72aeef004fe12454537 commit 7ea3fd3bb5f4039c372fd72aeef004fe12454537 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:38 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:38 +0000 mxge(4): Stop checking for failures from taskqueue_create(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 --- sys/dev/mxge/if_mxge.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c index 47793232d8d5..f36f41d53b40 100644 --- a/sys/dev/mxge/if_mxge.c +++ b/sys/dev/mxge/if_mxge.c @@ -4615,10 +4615,6 @@ mxge_attach(device_t dev) TASK_INIT(&sc->watchdog_task, 1, mxge_watchdog_task, sc); sc->tq = taskqueue_create("mxge_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->tq); - if (sc->tq == NULL) { - err = ENOMEM; - goto abort_with_nothing; - } err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ @@ -4815,7 +4811,6 @@ abort_with_tq: taskqueue_free(sc->tq); sc->tq = NULL; } -abort_with_nothing: return err; } From nobody Tue Sep 3 10:45:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyj2S61J3z5MmFW; Tue, 03 Sep 2024 10:45: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 4Wyj2S5Y4lz4HDW; Tue, 3 Sep 2024 10:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725360336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=udC0h4KcQ+h6lk7aKZXolx79eRmJ6meNvCjWcYABGYc=; b=PP84qKHO3Vb1xQ19mQGfGPkZngYsVLZPX/Vxi+Xvg0F4LT6WhvXptA9VkcPCJz1Is0FrkI EpO4qvnBTGMMeObhj3PmAei0azZL/v9uFJNR9vBdPDlduwTb/CLYxJaobMDE4CeB+Jb4cE 3TdhTCUBYH1zp5+GRkmf8RK1r+5xuhNLfZbsdYfVL9zZztg+S6XIy92URl1NpV542pjL6i 6oYBKGqsDcTgyzBvUuoCpqnC+3wvOy0Q4JQhsBsYHsYdsQUGaBMxeH3sxy8XZv7jRb0SNm bSKkuLiLjWGTUiH6cM7H7CjU8vIy2nClhtGVk52WILPrQfjS3AQid1hj+/QYsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725360336; a=rsa-sha256; cv=none; b=hxLdYDp25QgMFdBhiIZIVnh+20rfmh1eIsSUQNUMi9y2X1nC9ifUtZCS81Qjd3QlFbl3FJ 9kY7yn7jU6TZWJikfn9RTNZqNl+Jwp25a5qh9nKCATD0OTrT4+bGgRmn3gqyqpnlMdvJK+ O/jAo9aB6ptE+cnuHRhO/QW6JCHDCE9iRjH2euCas/4Wi8CZlHhZiwUNzJmuUfRscaN+Zt IJayHBQn5gfBSvC3lPe6LOSJIz6xFKhMid7G34I+C+iQFyR40+VJl7rz466fqeYzJ2cqN3 aKnRNMcg2Fifpzp+KVOn0gW6aPro/JASFSpi7Z5kLG2v3SQCcUOeyBtoyRKeVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725360336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=udC0h4KcQ+h6lk7aKZXolx79eRmJ6meNvCjWcYABGYc=; b=gReUFOY8/yp9PYMkLQ+6Exkk3NNarMs7Bl7sCB/vLpBRTNtei17VtyblnWunfZLBioTrdB qvcMgeL/UDGARiEyFF+yXPvRV2wBTA31A2Eg/hFukUGjQ+LanlGc16z9/jrAGccKNyCIw3 7iqzOw6kUb6s0bzH51SHJKz/JRj4o/bNjyNFpTSRnbvc9R/v/qy2eLy59nkkMKLmMlB0jo aAV65batswkDPyMTHk+shROQU/DrMqxdsLgzdxn5HExgsJ2iMVHs1LNrrQ733GzuaGGTbq 0C45olUNSJaosEIiYiGDIW+k0O3HYs8g8JXYILePw5yQYsd868kTqHaFJsHBtg== 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 4Wyj2S58YvzdVV; Tue, 3 Sep 2024 10:45: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 483Ajap1044526; Tue, 3 Sep 2024 10:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AjagV044523; Tue, 3 Sep 2024 10:45:36 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:45:36 GMT Message-Id: <202409031045.483AjagV044523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: ffaf862df662 - main - Mention that SILI makes tcopy(1) slow on modern tape drives List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffaf862df662d507e8dd2667bffcba91e3745fe6 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=ffaf862df662d507e8dd2667bffcba91e3745fe6 commit ffaf862df662d507e8dd2667bffcba91e3745fe6 Author: Poul-Henning Kamp AuthorDate: 2024-09-03 10:44:20 +0000 Commit: Poul-Henning Kamp CommitDate: 2024-09-03 10:44:20 +0000 Mention that SILI makes tcopy(1) slow on modern tape drives --- usr.bin/tcopy/tcopy.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.bin/tcopy/tcopy.1 b/usr.bin/tcopy/tcopy.1 index da6a5231a843..f608e0af07e4 100644 --- a/usr.bin/tcopy/tcopy.1 +++ b/usr.bin/tcopy/tcopy.1 @@ -97,6 +97,16 @@ command appeared in .Sh BUGS .Bl -item .It +Modern tape drives may return a SCSI "Incorrect Length Indicator (ILI)" +for reach read with a different block size that what is on the +tape, and that slows things down a lot. +This can be disabled with the +.Xr mt 1 +command: +.Bd -literal -offset indent +$ mt param sili -s 1 +.Ed +.It Writing an image of a tape to a file does not preserve much more than the raw data. Block size(s) and tape EOF marks are lost which would From nobody Tue Sep 3 13:16:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WymNt00gBz5PVd6; Tue, 03 Sep 2024 13:16: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 4WymNs6XMRz4dnN; Tue, 3 Sep 2024 13:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725369405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J7C0VzJSrDeC/ELz8HXwmzjKa/fl7K+X82vflZl7HeY=; b=lQNl+5SwFY9VniQ5N/2tvYk/3ua31aTZGRQmf4DjJCoLyIfnawrhx/+xHIJkr17tNbreqa oDPuDH539Z8w1kJy2fEtIf9lDYHaSpN8TrlCecKpFP7xvDc6VcM/Yrd20xoX7RGMvFyIF3 f6SGzCLdua48o/X9yvGuFyX6dScPQTSxtVsOUnIq/LuMgr/hGYd+Bn2wGPPLt9syozOUkz jjy8WCL09KU8YIC2E471RysFaP91ZETZhDnN8ESAwhZuQ/WF+gwCekjR0iayygxrP1b8KF BaWpSuUqmeaWu9PhXLuOBCE6G1NwojthiAqqHgmgfm/PzpvxZJbTcaiSLi2LAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725369405; a=rsa-sha256; cv=none; b=ORSVx4G3fZNIWh6pVq7MxLWEgHiXJGTpix+iFw2aDE3kQ3p4Fk5ySy2qeJg0sYe+Wt+KzH ug7dsnIKkK576grXk7nnT9+eVNqpaJ9i9m7NCVQCN1zHVzFVmSQ1YStHhR6Tuq0SB72Ijb IHkgUD4/1uUJlUxi7YVjpq0SWtgoOi9iHCqhmtTmGMvNGnmEY7/Ot/YUC9ndfqFeRjBEGu pNOGylRin5ED+ghPt0NMdYBMDTO0WeyYiR39d6OMwJXVsvXF5ZIbJQRIRs9GOTQCcYeWa7 HMEeIqTtwE5DKIOWydQ7S+XLB5zp7PXr8vbYZtbHMR9qqpRsZL3xu8WPQwvaMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725369405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J7C0VzJSrDeC/ELz8HXwmzjKa/fl7K+X82vflZl7HeY=; b=eb/n2OVd3oxAqv/bWflJgujLmz66lN5/wBOW6zBNL7StZg68dCvgJShFI68p5KPwBB0oGg HDVxrWHkGkf5SeyJIAPhrQol4smaGOHBRgff+f/ykW1lP2keK+UAnsXg5cyATi2z38nZFP X6NQ8C+UnECumE1PYRoliIBcH/Wm96dXVUx9HsTIM008/y2Nl0fWNrySxyaSZ6wOFv6xf5 583wtQvi19WeF1hHOkUTYWJ9Da34SxobUrdkMQWQnByxovllAwFiLio04XLgr+RBoN0S4E 3Dllir/wZQdXNR+yS7nLiSp5ZqISeGf9p+d1dveQZrT5QnumIxnf6vzXZB5dhA== 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 4WymNs67VQzjJ1; Tue, 3 Sep 2024 13:16: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 483DGjEa000610; Tue, 3 Sep 2024 13:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483DGjiq000607; Tue, 3 Sep 2024 13:16:45 GMT (envelope-from git) Date: Tue, 3 Sep 2024 13:16:45 GMT Message-Id: <202409031316.483DGjiq000607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: ad4cf76ec4d4 - main - bitset: __BIT_FFS_AT(): Fix herald comment, take 2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad4cf76ec4d4524381350e77b02b9abe24eb4b02 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ad4cf76ec4d4524381350e77b02b9abe24eb4b02 commit ad4cf76ec4d4524381350e77b02b9abe24eb4b02 Author: Olivier Certner AuthorDate: 2024-09-03 10:08:49 +0000 Commit: Olivier Certner CommitDate: 2024-09-03 13:16:13 +0000 bitset: __BIT_FFS_AT(): Fix herald comment, take 2 Remove the reference to the nonexistent 'end' parameter. While here, rephrase a bit. I did the initial comment fix (commit "bitset: Fix __BIT_FFS_AT()'s herald comment", f3ab0d86e8070c73) as part of an experiment introducing macros to operate on ranges of bits in a bitset and subject to a predicate (a generalization of some code used in some pending modifications of the ULE scheduler), which was finally ditched as being too verbose and impractical to use. I however then forgot to remove the reference to 'end'. No functional change. Noted by: emaste Approved by: emaste (mentor) MFC after: 3 days MFC with: f3ab0d86e807 Sponsored by: The FreeBSD Foundation --- sys/sys/bitset.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h index 2b26e8bcdbf9..d7e0b4cd7e41 100644 --- a/sys/sys/bitset.h +++ b/sys/sys/bitset.h @@ -232,9 +232,8 @@ } while (0) /* - * 'start' and 'end' are 0-based bit (runtime) indices. Note that, as for ffs(), - * the returned index is 1-based, 0 being reserved to indicate that no bits are - * set. + * 'start' is a 0-based bit index. By contrast, and as for ffs(), the returned + * index is 1-based, 0 being reserved to indicate that no bits are set. */ #define __BIT_FFS_AT(_s, p, start) __extension__ ({ \ __size_t __i; \ From nobody Tue Sep 3 13:40:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wymyg2zqbz5PY8T for ; Tue, 03 Sep 2024 13:42:35 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wymyf2gdYz4mBb for ; Tue, 3 Sep 2024 13:42:34 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.de header.s=s31663417 header.b=snFJ9nEF; dmarc=pass (policy=quarantine) header.from=gmx.de; spf=pass (mx1.freebsd.org: domain of garyj@gmx.de designates 212.227.15.15 as permitted sender) smtp.mailfrom=garyj@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725370952; x=1725975752; i=garyj@gmx.de; bh=IwGMTFK2P2NQarG9ntMfwh0LGzn/IHfanY/73YJbpns=; h=X-UI-Sender-Class:Date:From:To:Subject:Message-ID:In-Reply-To: References:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=snFJ9nEFUnimPCqW3OwCxI1AfzkMHjLZTLg3q+hYQmNOfDIXTqdrpyaKU/27etkY rfX05qd5oDHQKQZ4ezKBcHupMcl9AQr0l2P0ncoPzs073n+C2pXR+GrmnlDA/qysc Lt25aUkad04qQlf/z8loa/G7mCI1lpvAMt7/+kpozoxVNcUxiTII92umrPyC8MoKx lP0SDPKZFCaJrcKxnpT6uWgxMjyLTYcPHhqFj8IA1cQzZp0m9hfWjBv3NjDod51q2 RPxWF3v4qJO+qKRCn3Zx4ESq+Ii0ruUlPXBmDkGjZJt3ttgyNN8N+vDxuyHrbTBU7 6+rKCZR9nph7Hn/BYA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([217.226.54.45]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M4axg-1sjpdu24Gc-00G0em for ; Tue, 03 Sep 2024 15:42:32 +0200 Date: Tue, 3 Sep 2024 13:40:44 +0000 From: Gary Jennejohn To: dev-commits-src-all@freebsd.org Subject: Re: git: ffaf862df662 - main - Mention that SILI makes tcopy(1) slow on modern tape drives Message-ID: <20240903154044.5afa1d21@ernst.home> In-Reply-To: <202409031045.483AjagV044523@gitrepo.freebsd.org> References: <202409031045.483AjagV044523@gitrepo.freebsd.org> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:hh+GqIkwBdcaPFIPZwEehKYxzXo62yrF8R7mgvbnMA2Sm65AADB HORQw4GMViNonKVXZOT1d1HHW8M00P+GmYhcEq6gbTJjULpnpaevtrhbEjPUbL4sWFYbZc1 O6FyqQGSXni1BgrMJpiXKBTxft+0pCp3LIRITjSXyRvv3KfW2+v4wCRd+0i2tA+cLnlFGZW fAhTZ9aCXpHxkBOA2ygqQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:axdv6/utZL0=;kDbtzgP+etf0Le85WlZNwC3ST77 bhwR+CemKxNpt/65IybVSWIqsO2zCGfUbCRy98jWuUa1/fbs/xXNgvEDCer9BuQT0O9Arkjhe 0/x3f1YCaJZLR8lSpNGHv7R6nS/nkYTHpug0fQD+I1XyJv4Iaim0moAnEqsSSPAhBpspRCHc7 5/PZZjvkMMSk8TqP5gkQV1VBiL50baz1EmDsZgMFW/JlKwA9z9aB0ctUhQA5TXcjRcTx9i+8M sMfzmEoxChcU+7v/v7ZTtOAP6LHvNg+syB/QYqZJ8AjFtnodzSQNoydlTsEBWj1FEgmYUU1It myEJhE0AUCkDfAO5m69G9OJvhs0HTLGhkku/00mO/ZndBDGP2I2S6Vc52RcoHFt4BdOGAW5rN 141VjT4tQQB8i0rMilWd3YIeJvDATpz/2jF+Mza1kMDehdSc+syGpc3UOAbZGX+VeO5x50AKm 0euRl8tdJDmKOFO2G2KMnZq8/AY23cjZ2QkTyaJ1456DKmC/AXIPDcrVeTT2+DeVkshPSNAa4 Y25XQ/gZs21lZyaMnAq1ap9Ss9CpyGwDXise5N0de58f2hU5+ItbBSFMn3dN/ohMxSJN7yeU2 h3gYbtviT0jhGoXLPs77boLS91QictS+8z3vabGx0Zmh2T3XOdJ4WtSPbGG3OgWua6gkmf+7v 2g3dVL7HT6EMc524WjdG+Q5IQwD0R3syYbSYbeg43lc2GnJ4X27BojrohaQJdB9pcGZaJ4BaA Vc3gSqos2Szp6AY4RTmg3ixJydNnKHUj0Cg7sfGPWLPxkkeZWGXGvaoWE8rUxpHEYBp2OZMvS EmLPr/Cmq4P5dJF5dKF95i7Q3DCBVf3Ytn/rbqSDIQ504= X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.31 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.77)[-0.769]; DMARC_POLICY_ALLOW(-0.50)[gmx.de,quarantine]; NEURAL_HAM_SHORT(-0.44)[-0.437]; R_DKIM_ALLOW(-0.20)[gmx.de:s=s31663417]; R_SPF_ALLOW(-0.20)[+a:mout.gmx.net]; MIME_GOOD(-0.10)[text/plain]; RWL_MAILSPIKE_GOOD(-0.10)[212.227.15.15:from]; RCVD_IN_DNSWL_LOW(-0.10)[212.227.15.15:from]; ONCE_RECEIVED(0.10)[]; FREEMAIL_ENVFROM(0.00)[gmx.de]; FREEMAIL_FROM(0.00)[gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_REPLYTO(0.00)[gmx.de]; TO_DN_NONE(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmx.de:+]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; HAS_REPLYTO(0.00)[garyj@gmx.de] X-Rspamd-Queue-Id: 4Wymyf2gdYz4mBb On Tue, 3 Sep 2024 10:45:36 GMT Poul-Henning Kamp wrote: > The branch main has been updated by phk: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dffaf862df662d507e8dd2667b= ffcba91e3745fe6 > > commit ffaf862df662d507e8dd2667bffcba91e3745fe6 > Author: Poul-Henning Kamp > AuthorDate: 2024-09-03 10:44:20 +0000 > Commit: Poul-Henning Kamp > CommitDate: 2024-09-03 10:44:20 +0000 > > Mention that SILI makes tcopy(1) slow on modern tape drives > --- > usr.bin/tcopy/tcopy.1 | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/usr.bin/tcopy/tcopy.1 b/usr.bin/tcopy/tcopy.1 > index da6a5231a843..f608e0af07e4 100644 > --- a/usr.bin/tcopy/tcopy.1 > +++ b/usr.bin/tcopy/tcopy.1 > @@ -97,6 +97,16 @@ command appeared in > .Sh BUGS > .Bl -item > .It > +Modern tape drives may return a SCSI "Incorrect Length Indicator (ILI)" > +for reach read with a different block size that what is on the I assume this should be "for each read" and "size than what" > +tape, and that slows things down a lot. > +This can be disabled with the > +.Xr mt 1 > +command: > +.Bd -literal -offset indent > +$ mt param sili -s 1 > +.Ed > +.It > Writing an image of a tape to a file does not preserve much more than > the raw data. > Block size(s) and tape EOF marks are lost which would > =2D- Gary Jennejohn From nobody Tue Sep 3 14:02:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WynPB6SL3z5PZyM; Tue, 03 Sep 2024 14:02:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WynPB4R4zz4r4Z; Tue, 3 Sep 2024 14:02:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725372126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TH+wtYT9NQgbqBS3v0V2MnpwRhBGv2UUgR6+iA6P2eI=; b=ehhP/XfEULNahIIKt2xw3/BaCtuKINcDw9jHj34MGxL1ACR8b53DiJ84KD0RZmKNcuVOFJ DSQV/0DptALdvRa65XqvwksMZFdFLwYJZ/YkNM5IIzQ8Y85jqMwB5M9G9girFTTD4SK2yg /FAnYIe4Xcc+hXuDZLuDgvi51q1de/eE2y+pByMCBkmSxx02vx55FaGzjF1XqgbG6r4kdP uMnjDY30rVmg6D53NxDA28QBk+GrT2BoYAi75ByP0wtZg2OaS6lN4lEQWAtUgBEyxnDYYx WYz1eE+HaBZcuH9clTi2kk++NGfpaIUZmdDTIWdViMC5WprEnMovCaPe6VKXwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725372126; a=rsa-sha256; cv=none; b=Gi6F+b5W2cnB/gNi+j/5wESbY9bb+CEScCrQ+FqR+osoWPhb3CA3XfkPCuFXKchOuc+T8C puGEHuO8yB45pIdF467OmP4+mccTaQwqi+YIopbvLgk1Z5XFRTxzFsotxqduRIKb/SV1Fg 5B5Cgpc8KFaaoQ2Lpmcgrhz4Fgm6WLM5JbdxblooHZV0iGTtHA8UnnYyeE2EYeB41BRlgx ULpMAPTODuf6C5JgCnz0Cf6WqJ9H12esG6PWpnQ9dy8gL9N8x/xbGzAfAIXX2IPi641+ky fmCdfILSsGekZz3jlrd/mm3az3vWsrCjhj1bh6pOXgK0ykdAXSaxcsUdJX97KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725372126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TH+wtYT9NQgbqBS3v0V2MnpwRhBGv2UUgR6+iA6P2eI=; b=NHzu32Vd525xuoZ4+ulrpVTzBCTeUWIoJSRlfSDUZd5DZhLNnkOV9zPGoImhtU47XaD849 MySmlfOpYcHcv8hChoGQNwJvOrLLfnel84yCfCKwpOqKAIVgAQ42yyVDdL1XhL5AFFXxNZ ml01EH+47Mlak2CtG5zRin9yhAo+BpLvSeRVNwzX8un0oCjSDjtOdkF7YiaFudZsMYViqa kGvG4dheQuGLDw4QZbqvjd2rKrtxPeBx8DR+r9UBZFTDqXBoTf+zcjDZQwlt8S6zAmlrAf exnE4V7QPafzh5/or04VA9GeUUwcbLdQxerLFeDWttMvcnfQlwgHxYqgA8EOMg== 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 4WynPB427LzjlY; Tue, 3 Sep 2024 14:02: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 483E26EI084534; Tue, 3 Sep 2024 14:02:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483E26V5084531; Tue, 3 Sep 2024 14:02:06 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:02:06 GMT Message-Id: <202409031402.483E26V5084531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 9e8d504bb5a1 - stable/14 - pam_xdg: Fix user xdg runtime directory's descriptor leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9e8d504bb5a1e7ede55814069e213d4702172b81 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9e8d504bb5a1e7ede55814069e213d4702172b81 commit 9e8d504bb5a1e7ede55814069e213d4702172b81 Author: Olivier Certner AuthorDate: 2024-08-13 21:04:09 +0000 Commit: Olivier Certner CommitDate: 2024-09-03 13:28:58 +0000 pam_xdg: Fix user xdg runtime directory's descriptor leak Approved by: emaste (mentor) Fixes: 6e69612d5df1 ("pam: Add pam_xdg module") MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 06986e899972ac3a127ab2ab46196672d0e1e5b2) Approved by: emaste (mentor) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 2c80f0a0332f..10c6467776a3 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -108,6 +108,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, goto out; } } else { + close(rt_dir); /* Check that the already create dir is correctly owned */ rv = fstatat(rt_dir_prefix, user, &sb, 0); if (rv == -1) { From nobody Tue Sep 3 14:28:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WynzK3k74z5Pcr6; Tue, 03 Sep 2024 14:28: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 4WynzK2nY6z4tG8; Tue, 3 Sep 2024 14:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725373693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LkIvHbQ/uUit5nNa7OvyqYSBO8Ka0nyJHhkvwyy3asQ=; b=rD8DOrNogPFKodtUABqV0eowbF/A2q9/IPgOPjKOO9ingHsAgM/y4j+vNbnw3vNepThJGF MKX523ytguGgTfM7wEzCwhlsfl4PbxJh0f+iSQa7LgtynU2WYYZ31P72GAl+cUNbhVNOHR sSdU2A1wkFG7IwRt7TtVsxrAOtELGtJ2B7qZWrWa9mdXVUkkgwmuSXka0b0TaCYlWrg7im 4PFU+Wpt7VpfpOqcqQMxZ+oL/YI40ep4siQXb32TNbQ3bWlTTFHzo8bFlg2QIIBXOYvfyh UuNl+rtgvh7rOynDPGcLwQt53SMZbpowSr9tMvNwyYRbsMRmhgX0+fJzbF8GEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725373693; a=rsa-sha256; cv=none; b=hgKtdQ1XWRc6Qu/Jbrdi7U9Go8ECNiZC244t2r17nxcM6bkdqNB5mkdnafmft06NH7UbbN O7V2po01chHg3ARdStWo18hCwg/JQv3bZoMtsEOTTyXyFEReV6j5mP/qa+oi2c13NAX3PN TeoC7DOVXT5oT5BhWTR7KNwp7oPvTTd0mfabozTgQtiq+MNAEANytt4a8CrfjPTi+28V17 QjZ82C2GwsdCToUW4FbDCzvhP+OpZFNtReKCcDNBcA4XYeWLDD1TEDU91kNLFuMNSZA408 Xs5yLcKQSGoVgUSB4QLM/ANYuCQqOA8axRLLnWYG/RqOLlDeiMe3REMy3jVsHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725373693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LkIvHbQ/uUit5nNa7OvyqYSBO8Ka0nyJHhkvwyy3asQ=; b=VcgZwaRCZPxesB8hCQnPLWIXV9BoDmDY+H6AwqZPUIaDnPrBJcguyNVX/SIrryJXNB3DkN IfnqDZkTW5/kxAAgHmnLbCiboNJ6c6U2CwO5ZtCpX4s0n8DjIFhJmcZaOyD45Glvn1C/Jm h37GPZnravhrw9wV7ZWimBE3vec8SVLNeuvM2zM98jG7JdaO5g3YTEueWthP56pJGBE9L0 UOtwWPxNzp31P8Qqr1pup9TMQTuiUqtD37kys+xrb7cccgGjC404u2Ncc72v98NytlV5Jd UFBH4boLSroAmVfMrBVmyYI9FOS46lerRlH8qb8cnJpqgCvEVaoKgteuhnmaCg== 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 4WynzK2Lw5zl6T; Tue, 3 Sep 2024 14:28: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 483ESDwW020493; Tue, 3 Sep 2024 14:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ESDAK020490; Tue, 3 Sep 2024 14:28:13 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:28:13 GMT Message-Id: <202409031428.483ESDAK020490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 83325e7b738c - main - beep: show error upon failure to open sound device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83325e7b738ce87d88553585b135b0e7d15997a6 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=83325e7b738ce87d88553585b135b0e7d15997a6 commit 83325e7b738ce87d88553585b135b0e7d15997a6 Author: Ed Maste AuthorDate: 2024-09-03 14:21:46 +0000 Commit: Ed Maste CommitDate: 2024-09-03 14:27:43 +0000 beep: show error upon failure to open sound device If beep cannot open /dev/dsp provide more information to aid the user in diagnosing a problem. Reviewed by: christos Sponsored by: The FreeBSD Foundation --- usr.bin/beep/beep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 151236b4825b..2696bacfacf4 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -202,7 +202,7 @@ main(int argc, char **argv) f = open(oss_dev, O_WRONLY); if (f < 0) - errx(1, "Failed to open '%s'", oss_dev); + err(1, "Failed to open '%s'", oss_dev); c = 1; /* mono */ if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0) From nobody Tue Sep 3 14:53:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypXw3XN7z5TMr7; Tue, 03 Sep 2024 14:53: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 4WypXw1vnwz4wfR; Tue, 3 Sep 2024 14:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lV3D72rVYW0me+RstxspdDDS552mmUPIOICvniRP+wI=; b=aRaO1T1LhgeJ5w80vLyaJjDx8zUiIsPGB+9cgArFfCbWFNf09Xb4PJbLK/+8bv534aExtu GeFfRwVVJuTDMvqTPPqeeIcUnRLYQGsJOI8NDnJ58EY2m4XAY2iVcd2+OfmUHGHbv/ZT8P oUwjXFHhEWwQSZbbYlwaYR0xN+FH0oUsBjDmcAlDK0d1NsWrl645b+LI7w/wgtH4IR103z gss4QHDNJmMvZtjk/IpUc4R4sF2H6RCUo2LXVNZUguVqEeND+avyiXjHvCH5wty/KUFryi EODEtpvDkNLDNXqodXBh/zgKysgD6w9M/8V5bVqotGX2TGTcUB8zkscZAkTvjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375232; a=rsa-sha256; cv=none; b=VmbRFHiMjibxrnaEGmMsQKGJzOyxNfDBcFz7v19ZHHnZbW5ivguoQQGJvKNF/+5BPlISYJ Nn9Qr59sSDjlNPt8DSAXyqsgKIaxbAI/CNjfroJ+A9ZG2I8q8ZvC4om2gJJq/7DL6kkuAJ Zb6ze+cotlSLktxay9abTeY8O2pNmJ3G6SWVgEdrQRvSd+hsotQSJZwGSD9ZWtxV72yTYB tK0x1TeLBYBNZpwJbjZssUKR3XYTJeOOK6JaBm2Dgyt71T0yocsaERMfN+53lume/2k4wt znBItDxd1J+A+DalkGcgdiY1XXzxcxAEw8AjfB4fx6MvtMj3jvn+KEXra2gS0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lV3D72rVYW0me+RstxspdDDS552mmUPIOICvniRP+wI=; b=sAVAPkc/Z2zcclCFkMz3XYHvR7z5gRjB72FXwYv1CgvWT0At6QKrjope8zrJ4yQsrb69NR IfEMik6Hm8gq/TFFF1tt1ftAHCSnPgH5awkKUls5eUI0kX4sH2bErW/WtrN1g/XFyuo+cc 8loQ37qtO2iOhyVmJFjsiUgJMOLQBdCg01FfXuNnMEpJvAY3p90fcTC7LYCQJr7TOK7OxS 8NxdzXZnnpnDHb6OPH8U+UkhKjuDgr79lzG9x777BOzdUOXod2zo2fy4QK+Nd0YAWebtVe G1No32YiupUuEw6h+feNi85oyNF5bbHyGtDCMysIVodIgO7jJm+BrO7itbSx5g== 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 4WypXw1VhWzlcJ; Tue, 3 Sep 2024 14:53: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 483ErqRl070098; Tue, 3 Sep 2024 14:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ErqW8070095; Tue, 3 Sep 2024 14:53:52 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:53:52 GMT Message-Id: <202409031453.483ErqW8070095@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: 4a81e501337c - stable/14 - bhyve: avoid updating fbaddr when vm_mmap_memseg fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4a81e501337cf160d56af2d638f080983e520654 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4a81e501337cf160d56af2d638f080983e520654 commit 4a81e501337cf160d56af2d638f080983e520654 Author: Pierre Pronchery AuthorDate: 2024-07-24 20:51:20 +0000 Commit: Ed Maste CommitDate: 2024-09-03 14:53:19 +0000 bhyve: avoid updating fbaddr when vm_mmap_memseg fails In the function pci_fbuf_baraddr the field sc->fbaddr was set with a user-controlled value, even though the call to vm_mmap_memseg failed. No security risk as currently sc->fbaddr is not really used in the source code. Reported by: Synacktiv Reviewed by: emaste Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46109 (cherry picked from commit 85707cfdaddc179af8bd2623091eb1b8c58fed4a) --- usr.sbin/bhyve/pci_fbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c index a6bf508a46e6..e2d34cfef639 100644 --- a/usr.sbin/bhyve/pci_fbuf.c +++ b/usr.sbin/bhyve/pci_fbuf.c @@ -232,7 +232,8 @@ pci_fbuf_baraddr(struct pci_devinst *pi, int baridx, int enabled, if (vm_mmap_memseg(pi->pi_vmctx, address, VM_FRAMEBUFFER, 0, FB_SIZE, prot) != 0) EPRINTLN("pci_fbuf: mmap_memseg failed"); - sc->fbaddr = address; + else + sc->fbaddr = address; } } From nobody Tue Sep 3 14:55:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZF2Nncz5TN8t; Tue, 03 Sep 2024 14:55: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 4WypZD5wkJz4xBF; Tue, 3 Sep 2024 14:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kk/xarI3yKww3lRQM/QewRgNAu7V9aEU3WRjGeFjLWg=; b=xj/JcbhWnApovRlKzxb5THUVV9qdBTtUSCkddlcvM9+kX6GehLfrDLTva+sP13vgxKIwRa xPJmsKCvb2LA2ljbKSXVDlNKEL2RnlVBelWUNXipg7TyKtRav4fwXkm0zglUDrtO/haMD3 bHE06EjlF/2Ak4cJG7TZvUtRno7/wP+qdnOEW0G9W70exq/1mb8N30qiTJTzwVwZubnLlC TI/pd3rRtRFYQu+AKENT4T/ToQWKeKOFTuPksAZw0HFYpg0+wRC7A0vwed/rl8SUej/FqR lA+R8OSAlZc/2udO4PViGUcaUvBYuTnJJ5SGhb/bgByl/W55L/4lv1UyWDb/Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375300; a=rsa-sha256; cv=none; b=Y7kjS7BUj56Jr7tpRfgE88+sp7kiiNHDu18jLmUb+THXwxBvaJPfXY955En2Q2oINkPvHe Wz0/USaWY4ZC1P2aPpvTx+afv+YgYsMmsfvlWLZC1chJzxx5wOAmMRpSw2VYwEXzPupnM6 7j8alqfscesGAGWnZasjM5Ay4Ion2j8wyHi0moFdc4jOsPR8v71x3zns04927xlz5aMQfj D5VIxcotCdJv88PXk9NtjGYHKey0zTDNHyDwejCb4/iVaPZQaVYKu2xWI74Uv8Oirbqoch LbXHcHUEPt7MhguUr3slTBgtVMcDW57Mbhvy5rpJPfURoFJ+7m/Q/hVKLeiDOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kk/xarI3yKww3lRQM/QewRgNAu7V9aEU3WRjGeFjLWg=; b=ww+niR2XkTedh3hEKGnTK24f6wzpKzwm5ZIMF+KjTpl1N7CGW4a75soV4wxTe5X/0zWrRp o+1QtERS2wN3Aagtyp6qDO5VeiEjhFzC3Tj89peBFuB7iLSdWACYk8mKqsLEhS77rYkEiH q576PZzfWbAYzU9F8ukNcx6YX3WPCl/9ydXUC0fGaYxGjeZa11cmYBS8sdQtHyjRPl9bMj CVsF2Htg+W+YGcR48g+52S3mxYfP2od/wODToJysteVJXUTCnZtYmBOp+X0Hif3d8t9FL4 CaQiO4RVqdYdFX9jLFpIl5fAobgzjA5ITWNvFeQqQTU4UO4WtGjLu15v87LApg== 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 4WypZD5XVbzlld; Tue, 3 Sep 2024 14:55: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 483Et0Bj070580; Tue, 3 Sep 2024 14:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et0Dn070577; Tue, 3 Sep 2024 14:55:00 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:00 GMT Message-Id: <202409031455.483Et0Dn070577@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: 8ae58e0edbfb - stable/14 - netinet: Add a sysctl to allow disabling connections to INADDR_ANY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ae58e0edbfb4c56125fb6d7468ebfea638847b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ae58e0edbfb4c56125fb6d7468ebfea638847b9 commit 8ae58e0edbfb4c56125fb6d7468ebfea638847b9 Author: Mark Johnston AuthorDate: 2024-08-20 21:31:57 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:42 +0000 netinet: Add a sysctl to allow disabling connections to INADDR_ANY See the discussion in Bugzilla PR 280705 for context. PR: 280705 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46259 (cherry picked from commit 417b35a97b7669eb0bf417b43e97cccbedbce6f9) --- sys/netinet/in_pcb.c | 8 +++++++- sys/netinet6/in6_pcb.c | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 0fffd285fb17..897a3ef991d5 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -236,6 +236,12 @@ in_pcbhashseed_init(void) VNET_SYSINIT(in_pcbhashseed_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, in_pcbhashseed_init, 0); +VNET_DEFINE_STATIC(int, connect_inaddr_wild) = 1; +#define V_connect_inaddr_wild VNET(connect_inaddr_wild) +SYSCTL_INT(_net_inet_ip, OID_AUTO, connect_inaddr_wild, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_inaddr_wild), 0, + "Allow connecting to INADDR_ANY or INADDR_BROADCAST for connect(2)"); + static void in_pcbremhash(struct inpcb *); /* @@ -1311,7 +1317,7 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, inp->inp_flowtype = hash_type; } #endif - if (!CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { + if (V_connect_inaddr_wild && !CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { /* * If the destination address is INADDR_ANY, * use the primary local address. diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 90f91eef1daa..8046e0fa530d 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -85,6 +85,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +100,7 @@ #include #include #include +#include #include #include @@ -114,6 +116,14 @@ #include #include +SYSCTL_DECL(_net_inet6); +SYSCTL_DECL(_net_inet6_ip6); +VNET_DEFINE_STATIC(int, connect_in6addr_wild) = 1; +#define V_connect_in6addr_wild VNET(connect_in6addr_wild) +SYSCTL_INT(_net_inet6_ip6, OID_AUTO, connect_in6addr_wild, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_in6addr_wild), 0, + "Allow connecting to the unspecified address for connect(2)"); + int in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred) { @@ -353,7 +363,7 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr_in6 *sin6, if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0) return(error); - if (!CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { + if (V_connect_in6addr_wild && !CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { /* * If the destination address is UNSPECIFIED addr, * use the loopback addr, e.g ::1. From nobody Tue Sep 3 14:54:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZD0412z5TMsm; Tue, 03 Sep 2024 14:55: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 4WypZC4tXTz4x7m; Tue, 3 Sep 2024 14:54:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cRLvVQLRbcc8PvsrtZYEoZureX60mnMauwi05ghPDFU=; b=rgjXwL/Or/mAt+O0audph+U9EyIhJjo/M0AAaiSb76GysOiY2tG63DeEy1obYSfJP62IJO hxy8zNos1XryvtIcUj4+BScbEChEbWxnZOQaNmh+n2yezAZqesCDFRY6uuWvg32nfxIAVK 7T4BDsxwv8pdklRGivCLR1s7XmHXSacTr7Wf6fsuk/PtcYXnkPNYphYYk+NK5ErxskbCfj 3+ao9OijJxn8R/lkb4qb2vMyj1Pa0vag2awLjF903PuGXftnbFJWCYs17iwCpWPoB9CPS7 T3ugUYRgdjcAjku18uGNgvdWWra1QFjp+9gG3K107lJ4uFZS26UXNkMAHE9nVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375299; a=rsa-sha256; cv=none; b=wM4XEvhNS6ZZG8eGm3NF5cgrBLZz26bXQPZBTjhJSmxNeNOHhWjALe2N3iIQ3p/6+rnkCd aCHUEX6QQc+eia89kqZUr28XBhjkG1Bm5Ptg8hfc4rs1TmQSsNYwVrDCCc9MRFl4pUutXI 9oQdSG0mcULQmwqlkFH/Cyg0shDqTTqSnbqoIZKI3uP316lB1EBoxuVbEtnzkAMyELwKu6 r/OjYfR3jZwk2f6lcZ4n8ILCfeq9LM1YezsxoWZJkuACiYCo0pDQ8tIoWS7rhON2zHlc03 XOaV07dj3m0mdgBTI0xWf+jU0AmLulx11/4VlX52eRG+teavGqCRHDJRqDM0aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cRLvVQLRbcc8PvsrtZYEoZureX60mnMauwi05ghPDFU=; b=rdqgX/acoZnX+c7ECxchxc3ntMTzfM4wNi7Oi1OzEIfnzjH5EUT6K8TMkE956RLN2IfUxY NVq8MIglvO5RW6naWFdMivIcbxJPzthxeQNgzXhueK7ElUEBrGMUSqLd5bVKrS4U09qwcy uFdcLTuXZ/HGn4wBlIPGk12lAO9cMklbCidxh5kkhq9QXSRfmhyd3OV8BirYDJMeCk3Xdx U0kMWre7Q29WGyULVXCcL8ho10MxoF+TBmtjuHaMAk3gibfJAYdpYNVxpqM+HvqTbhUp3W tEPf8AyOJ1qiXUnH1FYSEhggf1fkWRobPm+X5j+aD+ctWXqiMC4avenOzkhiGA== 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 4WypZC4V1tzlrB; Tue, 3 Sep 2024 14:54: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 483EsxNg070486; Tue, 3 Sep 2024 14:54:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483EsxjL070483; Tue, 3 Sep 2024 14:54:59 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:54:59 GMT Message-Id: <202409031454.483EsxjL070483@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: 12a9d85c716c - stable/14 - build.7: Document the packages target List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 12a9d85c716c63742f320e1df1f4057459e67b05 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=12a9d85c716c63742f320e1df1f4057459e67b05 commit 12a9d85c716c63742f320e1df1f4057459e67b05 Author: Mark Johnston AuthorDate: 2024-08-19 14:07:37 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:42 +0000 build.7: Document the packages target Reviewed by: manu, emaste MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46286 (cherry picked from commit 1d26746cfd4a19e9d641ecd2a21e764743a7bc03) --- share/man/man7/build.7 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 79c05f5ab63a..427f01e1223d 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -401,6 +401,19 @@ Install the kernel to the directory .Pa ${DISTDIR}/kernel/boot/kernel . This target is used while building a release; see .Xr release 7 . +.It Cm packages +Create a +.Xr pkg 7 +repository containing packages that can be used to create or upgrade an +installation of the base system. +The output repository is placed in the object directory, under +.Pa repo/${PKG_ABI} +where +.Va PKG_ABI +is the +.Xr pkg 7 +ABI for the build target, for example, +.Pa /usr/obj/${SRCDIR}/repo/FreeBSD:15:amd64 . .It Cm packagekernel Archive the results of .Cm distributekernel , From nobody Tue Sep 3 14:54:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZB6ZKbz5TMlX; Tue, 03 Sep 2024 14:54: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 4WypZB3ysdz4xBD; Tue, 3 Sep 2024 14:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMH1ED77LWo1bALTW7Qcwc3tRoo7kSkPSrUx4ha5cHc=; b=kC+R6dX1N4Lm+f5dkeRjtHCHo++ubFxqvlfCS7aK9FAYoRGtkUAw5+UIO3OlFpZ/vrZE9I 7mokoaduOdzK9Esgi7hKVXFeO30eOEs+weYsFIsrws4o9WZ5Z9qAT58P+LNc8hRD9jdcgu ikVdIUmKxNUuu92MZNmk0wuazuFbo8KjDoR2IN7yaqUIYdcOT18CfwhRBRxmLKDvPEash5 0EA6dDe9cWutGuAw+GfAac/pXZVjxjx4oWZvmWSZk8gbsCPy7MhQJvAQ7ltALN/8yiC2o8 OGmUrA5cac5w+QS1ADeCZhOo4nhlDk0nBW3neLwvnG7secGzI3+q2xFKRa5Szg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375298; a=rsa-sha256; cv=none; b=YZrDCz9Z8w//SpBCW/Eo+b8cFyRwk4A/5lHWApLLhmh7vtEL0heK4WWLA+kVBnGFRYaDpj ARacrVVxLLfizKhukEUvF0ks7VzXCLQ8rggW4/D8xrB0YDjl8yEBgzWbfu0CMlNgcUf7ex e8ZQXexIm+3i/lGRhu6YwCEcXUFPI9y1v9JWt34Susp160iHLYKD4ZgedB70mYZJFHnGty /Hk1whvEPxadSeH5chfV5gPdtLfXXbv4AP9HoFyTBMI7LeC3TXHbESXwzZXVwZezds7/kz +8RDGUDZ51LFmT1mIXQ/OfeXq+fzbSr8RXi6cW2wRC+h71VKNMCEimwEEADqNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMH1ED77LWo1bALTW7Qcwc3tRoo7kSkPSrUx4ha5cHc=; b=prxFxiPWbTd1a5+Tql8CLvH1mQh0TaSajhY8UrFLH2YqQoYVYOxABuP8DlxUShthzafBdG lYnEdgBtPxf+blnJBhMUuyC0fJGstw5BF3VQ7wceUuVNHqfCfneqUgW5dU2KcmHBCBqW00 CTR11BYCEiyGtviyjmOFqcUmqfarkeQLfKe0SN0HRjzqLPQH1SiW6MKkV/IqLSR0IWzMjF l/n33IBrqonXz4/+T7p8p/Eo79J+eJ1odhMKbteL5l8pAM6T3wgaSo+hbhS/S9oW5YyjjZ olvP1bZVUTBQwcws5D9zjQJLQ2XZQiDgTQxnA1E6wvN1nXOG7qhvMX1T69wMnw== 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 4WypZB3X6Rzlr9; Tue, 3 Sep 2024 14:54: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 483EswoH070420; Tue, 3 Sep 2024 14:54:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483EswPb070417; Tue, 3 Sep 2024 14:54:58 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:54:58 GMT Message-Id: <202409031454.483EswPb070417@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: 1c8d1f51302e - stable/14 - turnstile: Mention the lock name when panicking due to a sleeping thread List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c8d1f51302e1c6a177240936384245da3b859f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c8d1f51302e1c6a177240936384245da3b859f7 commit 1c8d1f51302e1c6a177240936384245da3b859f7 Author: Mark Johnston AuthorDate: 2024-08-10 15:42:35 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:42 +0000 turnstile: Mention the lock name when panicking due to a sleeping thread This will hopefully make it a bit easier to track down the cause of such panics. MFC after: 2 weeks (cherry picked from commit aea9dba46b81abc5c0fd4c42d3ac762d3bc1de37) --- sys/kern/subr_turnstile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index 0a20f3163e30..544dd9f52e9c 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -246,7 +246,8 @@ propagate_priority(struct thread *td) "Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n", td->td_tid, td->td_proc->p_pid); kdb_backtrace_thread(td); - panic("sleeping thread"); + panic("sleeping thread holds %s", + ts->ts_lockobj->lo_name); } /* From nobody Tue Sep 3 14:55:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZG183Dz5TMhV; Tue, 03 Sep 2024 14:55: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 4WypZF6x6bz4x3M; Tue, 3 Sep 2024 14:55:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UddM1j+QYj4lQqe85lOOMe8+oRAZoK2FJF17PJ0Z8+Q=; b=Sf4qvLwXetNrK1yDDmYAQuI0WeW6eORNfkyh1XG3Byyx+riOdrCMe6i//+GZF+ffGv15pB u8cDoui0A9JpSlGQ+nyn4EN4ojjePSohbYHy1kfGuVmleRrGMY8WEUEEyF08krKpF1xzQ3 xJcahUT3nkamdO7VLrjEK1utc96r51Mm3QaH6580wvhpk10DS7iv9q29zpRvLseawzv5mE BfwEttMfL5INZpij3gqt+iyqB2F+2FWfjbbmHmi7uOylFLpvM1yNgtt+Co09ZxEs/ULWat Ya2Du3833sNuTB6j9qwSJ+N6x6ZA2KjwmFmkpPGhwgshyUXM8iBtXYSyHkFuzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375302; a=rsa-sha256; cv=none; b=Ohc9FTeMEqtGlgzmN5joed+EVvvhxAGr7VttTpZZCI2uQQo0mPZ3i53wxQ3Vz+JymWrq2x dHwN4bnmzU9KMYigmViDc28OOltPnApJYci3vNcjWTJG4rbJJsjDhDy2Lx2tXeBJaxI3ZY rQBBPlzcWw1P9QL2XOLX+dqeQ53sQYYp4y73l5Lu/ccVIqjlZTmpfZEG9IEqoXEtuEwaRN pBMjlTi53IBrs//4R3e54HnS5spKUrVrLPp8T7NPPbJUZeqcRYmt1Gwcu2NfuJr6KLJotr 5MPOuc7uOP2ig/Mt6gSHBaQhW55NXQqbJA+G+XSadvADyJVTNMEYNtZ7pNgflA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UddM1j+QYj4lQqe85lOOMe8+oRAZoK2FJF17PJ0Z8+Q=; b=b7xKhaBGLEg88PZMm2a5mJTx8wuPDC6xVUR/rjSIkYDhqG2Or7RBLm4AYayzpbMt0nMAqZ LqRTf3foB26F49DeVCynvgPkNhKWFCFHyA9WftZjXz/VLXxH5JFXpY25LDiha4ptLc0Q/1 o/kfyosYjNM/Au4gloJv88mwPscgGq4Y8rOcJ2uSSsAg1Pvl6Wx3lPuLyQY0lqsfqaon2z ehhNyW5syxF00KEAiB2H4hd+xHIlJD+s0yrOunUwIN6VBtMVXDENW4QcZkuvXiydtkFoJE 1qJQqvm13i6t32sqAVCjrYTRUhTj/8n+r4FREssHv7jT/rrj8SuOCPk0zsr67A== 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 4WypZF6Y5Zzllf; Tue, 3 Sep 2024 14:55: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 483Et1sK070634; Tue, 3 Sep 2024 14:55:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et1W1070631; Tue, 3 Sep 2024 14:55:01 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:01 GMT Message-Id: <202409031455.483Et1W1070631@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: 1e8b00a1cbc8 - stable/14 - libgeom: Avoid fixed remappings of the devstat device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e8b00a1cbc801d0961482e81f9fc13d32d71e71 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e8b00a1cbc801d0961482e81f9fc13d32d71e71 commit 1e8b00a1cbc801d0961482e81f9fc13d32d71e71 Author: Mark Johnston AuthorDate: 2024-08-19 16:02:26 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:42 +0000 libgeom: Avoid fixed remappings of the devstat device libgeom maintains a quasi-private mapping of /dev/devstat, which might grow over time if new devices appear. When the mapping needs to be expanded, the old mapping is passed as a hint, but this appears to be unnecessary. Simplify and improve things a bit: - stop passing a hint when remapping, - don't creat a mapping in geom_stats_open(), as geom_stats_resync() will create it for us, - check for errors from munmap(). Reviewed by: imp, asomers Tested by: asomers MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46294 (cherry picked from commit d06fe346eccf0919a29d43599548e49c0d6a7a17) --- lib/libgeom/geom_stats.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c index 7ae5c947b7b1..510636eb9a8b 100644 --- a/lib/libgeom/geom_stats.c +++ b/lib/libgeom/geom_stats.c @@ -54,9 +54,12 @@ geom_stats_close(void) { if (statsfd == -1) return; - munmap(statp, npages * pagesize); - statp = NULL; - close (statsfd); + if (statp != NULL) { + if (munmap(statp, npages * pagesize) != 0) + err(1, "munmap"); + statp = NULL; + } + close(statsfd); statsfd = -1; } @@ -73,22 +76,18 @@ geom_stats_resync(void) if (error) err(1, "DIOCGMEDIASIZE(" _PATH_DEV DEVSTAT_DEVICE_NAME ")"); - munmap(statp, npages * pagesize); - p = mmap(statp, mediasize, PROT_READ, MAP_SHARED, statsfd, 0); + if (statp != NULL && munmap(statp, npages * pagesize) != 0) + err(1, "munmap"); + p = mmap(NULL, mediasize, PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) - err(1, "mmap(/dev/devstat):"); - else { - statp = p; - npages = mediasize / pagesize; - } + err(1, "mmap(/dev/devstat)"); + statp = p; + npages = mediasize / pagesize; } int geom_stats_open(void) { - int error; - void *p; - if (statsfd != -1) return (EBUSY); statsfd = open(_PATH_DEV DEVSTAT_DEVICE_NAME, O_RDONLY); @@ -96,15 +95,6 @@ geom_stats_open(void) return (errno); pagesize = getpagesize(); spp = pagesize / sizeof(struct devstat); - p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0); - if (p == MAP_FAILED) { - error = errno; - close(statsfd); - statsfd = -1; - errno = error; - return (error); - } - statp = p; npages = 1; geom_stats_resync(); return (0); From nobody Tue Sep 3 14:55:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZH1TgQz5TMld; Tue, 03 Sep 2024 14:55: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 4WypZH0hNwz4wpm; Tue, 3 Sep 2024 14:55:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bjVY8Fp78RFv0HBmWsPiIQbL32+VclYorvjvh4F3cM=; b=P37VCCi6LSejBZS112up1EYMFnftlEzmeZ9fvpTc7QGTS7iunbBTbFtyR9nt1PI0hoZrFd BpDhsGqOaGET1TBNaLgqHDlwC73kemq6JM/te8FSwHuQOBRShy33/qgEZefzHKeOBbodNG 8Dd3Yd7omU7OMVTuyxqVWCGw84wHlfpFM6vRB2fMGFa69zoRnomfc5g4r6Xa5O215YBj62 GP8QJnTOPea673O8JMK4tZVDwmTGUeL7ALNdavrf8J6uWDcge30erchjou66wqvrHmRDpz 0CkjFfZeHlqr7BA0BoUi0mkeXK19D8uj1oFLLNMnsjyYUlhIyW+mJrqqTVrw9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375303; a=rsa-sha256; cv=none; b=NLEk15adg3pCxKua3XSz3Hx7jakVewouwRtzvp8fVS7V0LKahHeVqaJpGIqAkizL9LhAeZ DYlgYQhdX+9b4o8jC+kjP+t72o879Y3OdEFtLLyCOHPHoOLD/8Uzaq6MX2bUpVQaOXGqs6 I1r+41FzLL4j/ai9T04pPKqjEDQTfMNVkqpIbFIo/GFZYlKSSXBW877RH4FH0MFTeyWlXr 9/1Xm/2mKEG+i9GMVJ8Tz/Bxxc5uMLwDbYqbe1yUndsFdtbx86FQSS4EvqwTxEAPZZg8dW KV8wRTbhO9E8bxb5JN+kIp/Krtr6wdkLWBCGAhiaYzmBVLhlVYXK31iezCXn9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bjVY8Fp78RFv0HBmWsPiIQbL32+VclYorvjvh4F3cM=; b=Unh1wcURZ4+80B4wrC6FmMSWI5Ge1EyVajB/uwCuJdkFKmxm2RRMNsVFAq3E6Lda7VoHjy /BOtJDjFoUDp/+JfRj1NK2XiNyWhAh9XR4Pf5Fzbs3u/PZWL5+yQz9umYU0hkGWLmT8/Wx tQmMUDLyrzANAO1M/kewbe5nv1Q0DTO699RtNY8HSQ39st5hanzQkKFPbp/qi3bUOr8T/I 1sg9YNEuNurx3neJcnTjmQa7n7g8mjnFm3kU8a25lagk+HaiTlkaVmvOEMj6Dc3S9q8LOs rDjTCo+Z9GGCJ3e3FdSHeZLLhxsmA8MzUT8xRM7/g0pO0GeueFuC5h9LesgI0A== 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 4WypZH0Jcxzl7t; Tue, 3 Sep 2024 14:55: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 483Et2W8070685; Tue, 3 Sep 2024 14:55:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et2qc070682; Tue, 3 Sep 2024 14:55:02 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:02 GMT Message-Id: <202409031455.483Et2qc070682@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: e6c6f46dd5ea - stable/14 - pkgbase: Avoid hard-coding the package prefix in generate-ucl.sh List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6c6f46dd5ea100f291b49d9d580283d127d54db Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c6f46dd5ea100f291b49d9d580283d127d54db commit e6c6f46dd5ea100f291b49d9d580283d127d54db Author: Mark Johnston AuthorDate: 2024-08-26 20:46:53 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 pkgbase: Avoid hard-coding the package prefix in generate-ucl.sh MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit b4dd5ff5f4f159a566c64e3348e67c33b80f2bbf) --- release/packages/generate-ucl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index c7147a97a868..ec9cd0149228 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -133,7 +133,7 @@ main() { echo 'deps: {' >> ${uclfile} for dep in ${pkgdeps}; do cat <> ${uclfile} - FreeBSD-${dep}: { + ${PKG_NAME_PREFIX}-${dep}: { origin: "base", version: "${PKG_VERSION}" } From nobody Tue Sep 3 14:55:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZJ43qqz5TMrL; Tue, 03 Sep 2024 14:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WypZJ1gsyz4xF0; Tue, 3 Sep 2024 14:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r9n3FCvIITpjyewOuO3p9IVQqiNcMAV6J8vUdHmAQtg=; b=rCoPTxfBXwAThx5D0qorIVMr32ht1SYD0B6eH+AwbBaj/iL+YyTtE1te7HSB1IYdLVAG3A tEZkVMsBviuMHOT9Kd/J+GIVRro/C3xY/YrVLgMobiZ3QhyNktuE5YzyVnfkRV+VKYD2CK Te6nqQZFnMVk/QnQvAnBiPQ2ARAzhqIZ8BrSfesjTZ42RH/TQ76uWmgplinX8xAE+YNv/L wDeH9ipHt3GgF4FlZEEnAq5YYH9Ju/oqFiCO49UKf2RELCbMkMs4jbWRGnoPHHV0XHOLl4 rJTkSher8t9xkiYQEt4f7w37z7A6bx3HsxfyilLEtujctn8FHIaEcNC0hQTd8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375304; a=rsa-sha256; cv=none; b=iSmgnGDlKKVB7irzDo5yEWwdbCmcydcia14LmRxZ6Fhfz3NkUc+DmfzcQU3/Hcog99klBF IWewLS9G1xBxSiLozn1MBUSRPktmXxxcy8Qb58C1ynD1z7GF6fJ6fIH85P53lR+hP2rXbB rpZeSQ4IiV/PuMeGAy7yQDYXqo7OplqA60mMvdfnMnWy4D1Z0BBw7rdx3s4w0LU73oZhSr MmHtxKnvtmF0OcHT3cYQ2eXHkHvaP8+esCR5mN4YovfUVVNDStLNd0juhZd9OF2cz8jXF0 ZXKNzytWHaIePYut/Lhfvumw0QEvHmV6P3ND2/C7zbRrqyX8UGbWcpCEYLl4SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r9n3FCvIITpjyewOuO3p9IVQqiNcMAV6J8vUdHmAQtg=; b=nmFE4sErdaDRbnImyWZOjtpqNJ4/tLqmXvfaqqVOgetkAZJTlldlhZeY8tG4PrLszMM70V 0FHf+SzUrklWdoaPfkq5VGeTb71DevZGNrxYCWtOtiV1r/TEUIhs8VKK7x2/Rwi3vRA4oi 03me8eY0evkC5m3rVoUPR9TuPxzL8sf5F+HQ/6arRzEawyujm0oXGpjcNVLAbBcTy24KLB sUwIBJQuSWjaomwYGxx3GJNfkLdNZynZkdQmO8sUKbxjM4vENGNmTkChzmO2+NGamqGn0m a8pWvEWBBZFxTKSDOl+D3WbElIjszbCOyeb+kijbt6y/5j8WLLm6BTW/+LKmOg== 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 4WypZJ1JDzzlSf; Tue, 3 Sep 2024 14:55: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 483Et4Ik070726; Tue, 3 Sep 2024 14:55:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et4Ac070723; Tue, 3 Sep 2024 14:55:04 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:04 GMT Message-Id: <202409031455.483Et4Ac070723@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: 20bef7f7c2e2 - stable/14 - socket: Split up soreceive_stream() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 20bef7f7c2e249a073a22677785b1c51a5ce36c2 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20bef7f7c2e249a073a22677785b1c51a5ce36c2 commit 20bef7f7c2e249a073a22677785b1c51a5ce36c2 Author: Mark Johnston AuthorDate: 2024-08-19 14:20:03 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 socket: Split up soreceive_stream() Factor out the bits that run with the sock I/O lock held into a separate function. No functional change intended. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46303 (cherry picked from commit aa141adc039a5418d7b7800094115d861baf91a0) --- sys/kern/uipc_socket.c | 109 ++++++++++++++++++++++++++++--------------------- sys/sys/socketvar.h | 4 ++ 2 files changed, 66 insertions(+), 47 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7801054315ef..8a688e41ee88 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2517,56 +2517,15 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. */ -int -soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, - struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +static int +soreceive_stream_locked(struct socket *so, struct sockbuf *sb, + struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, + struct mbuf **controlp, int flags) { - int len = 0, error = 0, flags, oresid; - struct sockbuf *sb; + int len = 0, error = 0, oresid; struct mbuf *m, *n = NULL; - /* We only do stream sockets. */ - if (so->so_type != SOCK_STREAM) - return (EINVAL); - if (psa != NULL) - *psa = NULL; - if (flagsp != NULL) - flags = *flagsp &~ MSG_EOR; - else - flags = 0; - if (controlp != NULL) - *controlp = NULL; - if (flags & MSG_OOB) - return (soreceive_rcvoob(so, uio, flags)); - if (mp0 != NULL) - *mp0 = NULL; - - sb = &so->so_rcv; - -#ifdef KERN_TLS - /* - * KTLS store TLS records as records with a control message to - * describe the framing. - * - * We check once here before acquiring locks to optimize the - * common case. - */ - if (sb->sb_tls_info != NULL) - return (soreceive_generic(so, psa, uio, mp0, controlp, - flagsp)); -#endif - - /* Prevent other readers from entering the socket. */ - error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); - if (error) - return (error); -#ifdef KERN_TLS - if (__predict_false(sb->sb_tls_info != NULL)) { - SOCK_IO_RECV_UNLOCK(so); - return (soreceive_generic(so, psa, uio, mp0, controlp, - flagsp)); - } -#endif + SOCK_IO_RECV_ASSERT_LOCKED(so); SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ @@ -2729,6 +2688,62 @@ out: SBLASTRECORDCHK(sb); SBLASTMBUFCHK(sb); SOCKBUF_UNLOCK(sb); + return (error); +} + +int +soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, + struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +{ + struct sockbuf *sb; + int error, flags; + + sb = &so->so_rcv; + + /* We only do stream sockets. */ + if (so->so_type != SOCK_STREAM) + return (EINVAL); + if (psa != NULL) + *psa = NULL; + if (flagsp != NULL) + flags = *flagsp & ~MSG_EOR; + else + flags = 0; + if (controlp != NULL) + *controlp = NULL; + if (flags & MSG_OOB) + return (soreceive_rcvoob(so, uio, flags)); + if (mp0 != NULL) + *mp0 = NULL; + +#ifdef KERN_TLS + /* + * KTLS store TLS records as records with a control message to + * describe the framing. + * + * We check once here before acquiring locks to optimize the + * common case. + */ + if (sb->sb_tls_info != NULL) + return (soreceive_generic(so, psa, uio, mp0, controlp, + flagsp)); +#endif + + /* + * Prevent other threads from reading from the socket. This lock may be + * dropped in order to sleep waiting for data to arrive. + */ + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); + if (error) + return (error); +#ifdef KERN_TLS + if (__predict_false(sb->sb_tls_info != NULL)) { + SOCK_IO_RECV_UNLOCK(so); + return (soreceive_generic(so, psa, uio, mp0, controlp, + flagsp)); + } +#endif + error = soreceive_stream_locked(so, sb, psa, uio, mp0, controlp, flags); SOCK_IO_RECV_UNLOCK(so); return (error); } diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 485494b605ec..7d194462acba 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -313,11 +313,15 @@ soeventmtx(struct socket *so, const sb_which which) #define SOCK_IO_SEND_UNLOCK(so) \ soiounlock(&(so)->so_snd_sx) #define SOCK_IO_SEND_OWNED(so) sx_xlocked(&(so)->so_snd_sx) +#define SOCK_IO_SEND_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_snd_sx, SA_XLOCKED) #define SOCK_IO_RECV_LOCK(so, flags) \ soiolock((so), &(so)->so_rcv_sx, (flags)) #define SOCK_IO_RECV_UNLOCK(so) \ soiounlock(&(so)->so_rcv_sx) #define SOCK_IO_RECV_OWNED(so) sx_xlocked(&(so)->so_rcv_sx) +#define SOCK_IO_RECV_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_rcv_sx, SA_XLOCKED) /* do we have to send all at once on a socket? */ #define sosendallatonce(so) \ From nobody Tue Sep 3 14:55:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZK4xdsz5TMnx; Tue, 03 Sep 2024 14:55: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 4WypZK2j19z4x8C; Tue, 3 Sep 2024 14:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uE+pTMTRWV2jmbH9nIW3i5cuch+dbmMwnTmpti1J6aM=; b=RjmiQzWHc003su48XwF8SAqJkzUfO069koHy44RPnxpLfPKf8C8uxLCaekkCjm7YJabB0O DUw0XQ1265QnAE3X6o2fcjJ/H/26hmwcV5Px3QV7SFI40gpC5zo7jhIThBaM7wSxd0vmYM GSycD4abvb9lSUbAmYnWw9ODWwvVXl5/1BCK5tlhYQbt1ckZSklYYeZdFthPPufp6R1Pfl 2HApVClSCs1eOvu4ffzx/WCYxV5avD1MvCy0sYCCO6vlFVbsY2QqIkyxkSSBL8NqHVQxix Kp2Ly2nCqpkDZxU6s/EwBL/7JrmlcsFbn7dOK52WMJa1c45AX1AIQHs+Epq9Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375305; a=rsa-sha256; cv=none; b=U5K8xnI+8cYLfRYJ10AbS1sIzsVWOxJZYmzeZLnrafRKt0ZD3Civ7AWa94LMdZwfA9sH1m XaatadDiDBkmYrzZpYHTF4vOlgJRSKkd7Y+9TUPCqPnhdu2l9mnGa7e+gxd7HkOkq7qti4 94AcowUQmbYVz4+jaflBMGqCHV3sPAX/zlqlIgtgKCIeAwE/9Sj4sZ1+AiO+IdQZ3y0Fhd z8ixzcsQIjRS2flY7SR+HalWVgDxmTPXSs97RWAx0LCf+WR1WkX/f6oVOpGGXq0keZlqWi HX41/2i0MLMxWQACCXKgrba3YAEUnduVSOP3gpQXlwJWbIFIV42VYfkT4KIYsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uE+pTMTRWV2jmbH9nIW3i5cuch+dbmMwnTmpti1J6aM=; b=r63jS7yz2N+8qIXS3aAkFrn4K3EaBwfRKeIzGO/LrkeqeD34Eii6QyKjpU/ChC6V92uYjl JbkoMGEqSUKB6NsXAuzOv7MSOTro8Qg8j+UTY1pGknWvPbq9v2RVqput1sMRqXVZxBOaOq BskDFJ7dNeh4eHsDSbEvlKgAGYJdjSQDPyM895Hy+8V+eSDY7nqWaRKH+OFaV+xy9zbzH3 T8XNcbYFkafvho6EY/1m9maa44d3J7/JzOJRbA7JMK0tdI6MzKWpZpK0wJI4FqxshTH1pL v5ntRkmkW6fN26bdZQ+KyNskoy2LXAIko/O0C/D6yQPzT4RdFQYFLE9AZ/k0BA== 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 4WypZK2Gzjzllg; Tue, 3 Sep 2024 14:55:05 +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 483Et5jt070774; Tue, 3 Sep 2024 14:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et5kp070771; Tue, 3 Sep 2024 14:55:05 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:05 GMT Message-Id: <202409031455.483Et5kp070771@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: 0480918c0904 - stable/14 - socket: Split up soreceive_generic() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0480918c09042ce6a71733a53a562152af035564 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0480918c09042ce6a71733a53a562152af035564 commit 0480918c09042ce6a71733a53a562152af035564 Author: Mark Johnston AuthorDate: 2024-08-19 14:20:19 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 socket: Split up soreceive_generic() Factor out the bits that run with the sock I/O lock held into a separate function. No functional change intended. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46304 (cherry picked from commit 0a68f644dca19670686007071479f919a56ea37f) --- sys/kern/uipc_socket.c | 61 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 8a688e41ee88..99073121d7de 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2016,11 +2016,11 @@ sockbuf_pushsync(struct sockbuf *sb, struct mbuf *nextrecord) * mbuf **mp0 for use in returning the chain. The uio is then used only for * the count in uio_resid. */ -int -soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, - struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +static int +soreceive_generic_locked(struct socket *so, struct sockaddr **psa, + struct uio *uio, struct mbuf **mp, struct mbuf **controlp, int *flagsp) { - struct mbuf *m, **mp; + struct mbuf *m; int flags, error, offset; ssize_t len; struct protosw *pr = so->so_proto; @@ -2029,30 +2029,15 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, ssize_t orig_resid = uio->uio_resid; bool report_real_len = false; - mp = mp0; - if (psa != NULL) - *psa = NULL; - if (controlp != NULL) - *controlp = NULL; + SOCK_IO_RECV_ASSERT_LOCKED(so); + + error = 0; if (flagsp != NULL) { report_real_len = *flagsp & MSG_TRUNC; *flagsp &= ~MSG_TRUNC; flags = *flagsp &~ MSG_EOR; } else flags = 0; - if (flags & MSG_OOB) - return (soreceive_rcvoob(so, uio, flags)); - if (mp != NULL) - *mp = NULL; - if ((pr->pr_flags & PR_WANTRCVD) && (so->so_state & SS_ISCONFIRMING) - && uio->uio_resid) { - VNET_SO_ASSERT(so); - pr->pr_rcvd(so, 0); - } - - error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); - if (error) - return (error); restart: SOCKBUF_LOCK(&so->so_rcv); @@ -2510,6 +2495,38 @@ dontblock: if (flagsp != NULL) *flagsp |= flags; release: + return (error); +} + +int +soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, + struct mbuf **mp, struct mbuf **controlp, int *flagsp) +{ + int error, flags; + + if (psa != NULL) + *psa = NULL; + if (controlp != NULL) + *controlp = NULL; + if (flagsp != NULL) { + flags = *flagsp; + if ((flags & MSG_OOB) != 0) + return (soreceive_rcvoob(so, uio, flags)); + } else { + flags = 0; + } + if (mp != NULL) + *mp = NULL; + if ((so->so_proto->pr_flags & PR_WANTRCVD) && + (so->so_state & SS_ISCONFIRMING) && uio->uio_resid) { + VNET_SO_ASSERT(so); + so->so_proto->pr_rcvd(so, 0); + } + + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); + if (error) + return (error); + error = soreceive_generic_locked(so, psa, uio, mp, controlp, flagsp); SOCK_IO_RECV_UNLOCK(so); return (error); } From nobody Tue Sep 3 14:55:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZL5BXWz5TN97; Tue, 03 Sep 2024 14:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WypZL3dDvz4x1f; Tue, 3 Sep 2024 14:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XsNPNR7hoMW+aE2RFJIjLELnZi1McUygIuBQS9AfsAQ=; b=hGE0D4V/LqPdL5tsUkCpSTn/C2j50PDK8s3/f2tkVtmpt0C5pKUr5nooWr2W2AB9HLg9Ad QdognFSXSesZhYO97oTjrJTLnBGBN0YsRRXZyG75xpAGfdmI16WWrDfrALilk4KSBV2v/A t+t/ZayqBnnlCISXzDOxYRTAZHNjh30K4DqTmr8eJe2R54mTjz703OFziavysJBXnzS7cQ npzlQyka6HIDnZLb46G83GTqIFa4SIe9yw9Xik7StznrQ+dysEL6xzfunGWyLSLVNNWtbj GE6PmIYBiWG4rtUOdXOPD02GNLw9srFqzWNHO24ZWRrtkPbb4j198ikn2iHw8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375306; a=rsa-sha256; cv=none; b=qzr+gW+i/IsT58CMYgiah2z7dcyTcEL7l/ElRUJjkejIUBc/yD2vyaHze8UqrIHxK1Mt7d fYmO+7gmmGJQGqjcI2OiKIyS0f0dzqwqDJCNRjjt9quGUavlRIhbuKTxYSFmJHLhkVplLT 2kwGJa3swkasZRJcB8+7dU0yrznDrR+vx8wqzRrAQv8ccGa711PKMtOfvX3v2Hvvu+raLf YQy2PbgTL2PFq8r9y3Ln6TxnRFKNKY4wV2n+3QEHS6rDH8JFGpjzUNdDt0I1g9E1gyR2AH qPtw826oJs5MAlQ4a2Ne95DAqxiqJDvAWedu/n74Pu+XxHQmMDnLcaxK6fb1Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XsNPNR7hoMW+aE2RFJIjLELnZi1McUygIuBQS9AfsAQ=; b=ld6/tuN8cDalUL41qf3f/lAmoFh1wlHmuHehfCoS/RZYafb5TX6y/Q1Y6DQRdnn9vemOG+ QbrHzsUb/GImNEVHG4IZ0k/9dgHt4zS8FqoJnyiT+TMz7dwE/wyxaI19FJcLWBYsoaV3kc qUhfp5yq+E+OZ4q3J3JkpY1ipJnGBuZDo2SyydRr8zAOXAks0vOj+PeyNYe8c0xA/ZO31N YNj1S7mshwGEAJQ/rYmR/W0P8Db+Qi5hDryRKLuLeNUhH6xq2nr8ycgU+5AGA2x/6/87AQ ZDiAs8ydrhwIWpiKkNYS1Z9JhXOTHoJ2UJrBGqIm7iGFf2y8KRmz3neRWmKmjQ== 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 4WypZL3DYjzllh; Tue, 3 Sep 2024 14:55: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 483Et6av070814; Tue, 3 Sep 2024 14:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et6xp070811; Tue, 3 Sep 2024 14:55:06 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:06 GMT Message-Id: <202409031455.483Et6xp070811@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: 2537245ecd01 - stable/14 - socket: Split up sosend_generic() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2537245ecd0188c0db1fd36565e1175a177637c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2537245ecd0188c0db1fd36565e1175a177637c3 commit 2537245ecd0188c0db1fd36565e1175a177637c3 Author: Mark Johnston AuthorDate: 2024-08-19 14:20:43 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 socket: Split up sosend_generic() Factor out the bits that run with the sock I/O lock held into a separate function. In this implementation, we are doing a bit more work under the I/O lock than before. However, lock contention is only a problem when multiple threads are transmitting on the same socket, which is an unusual case that is not expected to perform well in any case. No functional change intended. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46305 (cherry picked from commit fb901935f257ddcc492fe9efb605797f181c6597) --- sys/kern/uipc_socket.c | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 99073121d7de..dfe75978ac39 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1601,8 +1601,8 @@ out: * counts if EINTR/ERESTART are returned. Data and control buffers are freed * on return. */ -int -sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, +static int +sosend_generic_locked(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { long space; @@ -1618,6 +1618,9 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, tls = NULL; tls_rtype = TLS_RLTYPE_APP; #endif + + SOCK_IO_SEND_ASSERT_LOCKED(so); + if (uio != NULL) resid = uio->uio_resid; else if ((top->m_flags & M_PKTHDR) != 0) @@ -1647,10 +1650,6 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, if (control != NULL) clen = control->m_len; - error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); - if (error) - goto out; - #ifdef KERN_TLS tls_send_flag = 0; tls = ktls_hold(so->so_snd.sb_tls_info); @@ -1673,7 +1672,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, if (resid == 0 && !ktls_permit_empty_frames(tls)) { error = EINVAL; - goto release; + goto out; } } #endif @@ -1684,13 +1683,13 @@ restart: if (so->so_snd.sb_state & SBS_CANTSENDMORE) { SOCKBUF_UNLOCK(&so->so_snd); error = EPIPE; - goto release; + goto out; } if (so->so_error) { error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(&so->so_snd); - goto release; + goto out; } if ((so->so_state & SS_ISCONNECTED) == 0) { /* @@ -1705,7 +1704,7 @@ restart: !(resid == 0 && clen != 0)) { SOCKBUF_UNLOCK(&so->so_snd); error = ENOTCONN; - goto release; + goto out; } } else if (addr == NULL) { SOCKBUF_UNLOCK(&so->so_snd); @@ -1713,7 +1712,7 @@ restart: error = ENOTCONN; else error = EDESTADDRREQ; - goto release; + goto out; } } space = sbspace(&so->so_snd); @@ -1723,7 +1722,7 @@ restart: clen > so->so_snd.sb_hiwat) { SOCKBUF_UNLOCK(&so->so_snd); error = EMSGSIZE; - goto release; + goto out; } if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { @@ -1731,12 +1730,12 @@ restart: (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; - goto release; + goto out; } error = sbwait(so, SO_SND); SOCKBUF_UNLOCK(&so->so_snd); if (error) - goto release; + goto out; goto restart; } SOCKBUF_UNLOCK(&so->so_snd); @@ -1781,7 +1780,7 @@ restart: ((flags & MSG_EOR) ? M_EOR : 0)); if (top == NULL) { error = EFAULT; /* only possible error */ - goto release; + goto out; } space -= resid - uio->uio_resid; resid = uio->uio_resid; @@ -1845,12 +1844,10 @@ restart: control = NULL; top = NULL; if (error) - goto release; + goto out; } while (resid && space > 0); } while (resid); -release: - SOCK_IO_SEND_UNLOCK(so); out: #ifdef KERN_TLS if (tls != NULL) @@ -1863,6 +1860,20 @@ out: return (error); } +int +sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, + struct mbuf *top, struct mbuf *control, int flags, struct thread *td) +{ + int error; + + error = SOCK_IO_SEND_LOCK(so, 0); + if (error) + return (error); + error = sosend_generic_locked(so, addr, uio, top, control, flags, td); + SOCK_IO_SEND_UNLOCK(so); + return (error); +} + /* * Send to a socket from a kernel thread. * From nobody Tue Sep 3 14:55:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZM6Q7sz5TN79; Tue, 03 Sep 2024 14:55: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 4WypZM4NtZz4xJ0; Tue, 3 Sep 2024 14:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+egRtzmR1lmCeDhCU0nY8JPJ0CboUOsInAiZAkJcj/c=; b=m2PJqzBGY/YZcGX1veyWL4A/cPaHHj+LYNVXVUUj7md27kKcCuqcyEV4HE9R7hPmWEMRXo DxNgZo3z+V1nbsJe5a6Pxd72P6hcN1vE1eFUazRqAL8zdHYBIhXrAvy9Sa6Exh1vKAnODR 3j8Ed7rPV3WZeGnTlV+kavZcqqu3YKcp9k90tgptEAIptqGi2Ldz9VEE312hc2Rk1mFZt6 m/R7pyn38UZDPA/SYS6Of+JoV+qOymhke6RSWszcAv2/ZW2kDW4FEkLdFGnMUVl5NFmLHQ F/R+dLt4iOAskyhMXtGTrBiozFapltgMCE0vY5AFqInFEshRJvfk3gdEDzqj2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375307; a=rsa-sha256; cv=none; b=n+dPTXqBQcs7gaS3Xl4Ncv839zWosd30SIkKrDdvEucdrGG8jHAbbIU08UEiFB3j8Q/kj2 cYHTiY0Q/qCJYDJdeggHM4p5jGTfoYY5eppMh/dLJXX4J+ivFMEo780A2STe9pgqw/itvn jWdv/1fw8EQrufwI5hpnjCSaBouZK4xgei76IBpv5E0oIQ+0SNt6WoIt8/zB4xvmam6+1f tsdOcpvOlskyHgEC0nw/ja8iAuvMaXl8Ux2w7F2t0v2oYKWBaLH4EoojlDoDfKyFIpydPO 3DHqaueFipNdIf7nJpBpr9fXJjptpubUag51Pdy0+2sRedlOt8BPUOscWm/9wQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+egRtzmR1lmCeDhCU0nY8JPJ0CboUOsInAiZAkJcj/c=; b=ggcwh7vQ5IiEPeC3NJgXcU5P2TLLrapXOBte6un2TGkZYAy80Q6GVeUC13dGUG195XEq8h D2O0sWcJlehOnGra0Joc/wDaSm2ZiZU5rGYQ7qnE7RqmGpBOcdfQTDT8/OvtuQs0o2brWF AOcCN6IseLbFtb1hbMX0FetlSP518jAdbCqOQht5pERmGf6zy/Lfl4DrNA7XCp1Ogs/4wt toMcsEE0xnSsa1193qeI9z9a/y5TiyhKe4QgBqUTZLkbUa2yvsNGB5oLHOmHZxOmolPMBk DlT4YBwS0qI4tbLfpUj5vspdJyM1wrFa2xfUeeTk+JlUx5HFjTJR+6u3FitEdQ== 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 4WypZM40sczlWS; Tue, 3 Sep 2024 14:55: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 483Et7ps070857; Tue, 3 Sep 2024 14:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et7wN070854; Tue, 3 Sep 2024 14:55:07 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:07 GMT Message-Id: <202409031455.483Et7wN070854@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: 441fc34c6f01 - stable/14 - socket: Microoptimize soreceive_stream_locked() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 441fc34c6f01ffe72278f3ba696a3ec06924743d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=441fc34c6f01ffe72278f3ba696a3ec06924743d commit 441fc34c6f01ffe72278f3ba696a3ec06924743d Author: Mark Johnston AuthorDate: 2024-07-05 18:01:29 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 socket: Microoptimize soreceive_stream_locked() There is no need to hold the sockbuf lock while checking uio_resid. No functional change intended. MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield (cherry picked from commit 6982be38cb7e4254ff4ffbb334cd7e234b5f6cc2) --- sys/kern/uipc_socket.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index dfe75978ac39..adb11e08a7ac 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2555,14 +2555,12 @@ soreceive_stream_locked(struct socket *so, struct sockbuf *sb, SOCK_IO_RECV_ASSERT_LOCKED(so); - SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ - if (uio->uio_resid == 0) { - error = EINVAL; - goto out; - } + if (uio->uio_resid == 0) + return (EINVAL); oresid = uio->uio_resid; + SOCKBUF_LOCK(sb); /* We will never ever get anything unless we are or were connected. */ if (!(so->so_state & (SS_ISCONNECTED|SS_ISDISCONNECTED))) { error = ENOTCONN; From nobody Tue Sep 3 14:55:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZN6nwWz5TN7B; Tue, 03 Sep 2024 14:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WypZN4V34z4x95; Tue, 3 Sep 2024 14:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cxu314/U+lT8zfRQYMMz+Akl5+eMBR0SF+WWHg2ex4Q=; b=oktI83/k0PQ6gbrYNRYdfKpx3jhx0vFjWZ6qRqjrQymldQTNSE7QwMxQgabmBFmaAuUqFK do+V2RFnz70/w0nPv86Cy8xRXcNMqoWaDoMJCVEY00fA/5+5CtS8zvejBm2Xg7NyceiBpj tKHsVzEjOVlrC2KWnmmiPM+VLBAMF5R3xYQwZbkktL3WDD9Mh73k17FKYID477yD9qFn+I HvQYfi+7cYDFBAdebwJhragfkYvqRR/kMXJr/T2NWYgPRl6EnLJdd6m87Mi0IQ1PIx+n5b hyz7P5AQ9GzElVuDMyMipEnEjD5XOqudilALyG10dzpJYas3MHsMUdFa19Bdtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375308; a=rsa-sha256; cv=none; b=o4UU8PoiY75HBsH7O9zZUx55B9EXcXNeN0/znzqg6S/yEyQB4UKTYpJV33s49ZK3ZGIIFq 4KeHY2YDC2vbC/tCL5weS7etL7KZ9vhRYjV0tjXoMqzACva549FUUSNXwnRDxVp/tQz4xg RuBRQ1VBJaBj6Cmsv12cSXhxzvw2ZrgbIJfbBv3qBZArKSUF6jvQRJh9IlSLioJ5p0NydF CRHC3xia3lrEAGcdlTRV/U64izfb3KsvdCLUg8EP+OHs2/opYCBvsu9mvpkahOajJTvEex nDzEdj5+N1CygD4kFVcsP8qc8uVTsW5+ABCbuvfjF3Zb8kHbRuzn+H2EPJ9AFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cxu314/U+lT8zfRQYMMz+Akl5+eMBR0SF+WWHg2ex4Q=; b=ydtjT+WKb4XU+YFNy0Jy+BneAyUquGHgvDHiC2Ze0tfQXtoDpl3MVj2o0sI3Gq8GYWSkRo SqnInte6xRy4n/xe0iqJV0PFBbi7hsDSdtCP/r4mvl+Rjz1D4nFliG6v3ra2GaZsKNh8Os vvQEjAjyhwjNqnd0EKB9ZgK63WS5Mv1Siz+sywg3msFdgPyIyF6OxOKpRL8ms0U/EhWPCE U+srDcwgNy3zR0A4NkUEeVWy5GLFKkG4Z35NGVzEBGhie54BFy90Ny4zsitkJwwM06mf1a VxQtFyk34Jwy/uB3BD8wdsijHIAjwjTnGSfjjF0AvlKrI98wNnCWFoVYgY+oow== 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 4WypZN3YS6zlrC; Tue, 3 Sep 2024 14:55: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 483Et8Xb070968; Tue, 3 Sep 2024 14:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et8ng070965; Tue, 3 Sep 2024 14:55:08 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:08 GMT Message-Id: <202409031455.483Et8ng070965@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: 10f7e124eadf - stable/13 - bhyve: avoid updating fbaddr when vm_mmap_memseg fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10f7e124eadf4a3423f0a3859fc6946017b2229b Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=10f7e124eadf4a3423f0a3859fc6946017b2229b commit 10f7e124eadf4a3423f0a3859fc6946017b2229b Author: Pierre Pronchery AuthorDate: 2024-07-24 20:51:20 +0000 Commit: Ed Maste CommitDate: 2024-09-03 14:54:45 +0000 bhyve: avoid updating fbaddr when vm_mmap_memseg fails In the function pci_fbuf_baraddr the field sc->fbaddr was set with a user-controlled value, even though the call to vm_mmap_memseg failed. No security risk as currently sc->fbaddr is not really used in the source code. Reported by: Synacktiv Reviewed by: emaste Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46109 (cherry picked from commit 85707cfdaddc179af8bd2623091eb1b8c58fed4a) (cherry picked from commit 4a81e501337cf160d56af2d638f080983e520654) --- usr.sbin/bhyve/pci_fbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c index 32ccdabec8b5..61dd8133f8c0 100644 --- a/usr.sbin/bhyve/pci_fbuf.c +++ b/usr.sbin/bhyve/pci_fbuf.c @@ -231,7 +231,8 @@ pci_fbuf_baraddr(struct pci_devinst *pi, int baridx, int enabled, if (vm_mmap_memseg(pi->pi_vmctx, address, VM_FRAMEBUFFER, 0, FB_SIZE, prot) != 0) EPRINTLN("pci_fbuf: mmap_memseg failed"); - sc->fbaddr = address; + else + sc->fbaddr = address; } } From nobody Tue Sep 3 14:55:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZN6fwKz5TMt6; Tue, 03 Sep 2024 14:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WypZN5LcTz4xKx; Tue, 3 Sep 2024 14:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nSnlzcc4T1QUCfsaSbWRi/cNeZ4D8n4SGaEXQ2UZmhQ=; b=V7ecBKzalCZQB0k8ccXiEPJrWhmQRxoRbr7YpvN32NpIMpHIjG2nFcXXEfDeodKNSXrFZ5 m2e5v7jNcCwc1pFuweN4W47U9GQLg4OIfVlrAaYJDOU7QGDhja+zoqGc4u523SX+sT7jhX 7KfDKiegFlax0r1R4+KjEiF7W46+SGn+AGlztJho+dnyvX5fsALeCqQRuHRWCv2Jl6ty5m gr4txlBkplJecOoXvldrog7a7rcjPESuEgf3oavfxGPbdKmcasNnpTqeDwWpSz+p4q8xN6 Xim7kBhPJPnklVflngb41eeq8NDrtin1PGXBh8Kbj0SFnNHHuayk5smQ5BrMrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375308; a=rsa-sha256; cv=none; b=TOvtqhwUNsprqgEn3SI4Ogn8ZP8hGs5OErlwcChsuulDl3WnEGvlFsbcNlntf2dFShqYyA jzPukUb7ak7gRJqO44G8VPQDnvouzdvl450WvBTUWdJ/m35z2VOEv4jQ/ySVUr+QDIvQHs hpxrWKBhiytE+py1a7yN+JRoY0bbZGA0XRxy86qNH814QnPmzFUf47cWDrzvjZOca4FznC 6nPWxODEss8UTBtZAPGCy1sQX4Xq7xJMsmUwfAM0wa/lCvy5viu1EUtCYdoX6/NibmavDi osCB5DGi3CIjbYiFKYl5KgK/1+kEAG4Y+wkS0uVNff8b+TDw82xHnkaJ3j2B7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nSnlzcc4T1QUCfsaSbWRi/cNeZ4D8n4SGaEXQ2UZmhQ=; b=B4oaeJhpKFJD+1911CZLodu0jX4KPgu6wOuPXy+b4xsxC+Ly7g2OxVu2aj+Y1mQ8AAjcJv c0FASA+FIhxOmuGGb+96/1P/4W3HXqzoFktMsLqmyXguIRBZOqqn9Iu/dv8wIfWyZ4BW3I WvG+i2g46wCEGGGKlsdubENx6k82u4duX58O3AJo1kaHW7a6IGUYotD2JjtSiA8TA189a0 ikJBAGi9Ps7qBlZakx2QT2WGSwkCZKaywPKG7mLiLnqq8vpnCxhMwtb+7JD7KnVeL1c2ON etPn0iabexniB9Y4c6Z7B4+FDtVnfLSVcnuyNA9O7f4qSBxCXbILq/k6bbLsxA== 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 4WypZN4qqfzlrD; Tue, 3 Sep 2024 14:55: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 483Et8Zl071010; Tue, 3 Sep 2024 14:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et8eu071007; Tue, 3 Sep 2024 14:55:08 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:08 GMT Message-Id: <202409031455.483Et8eu071007@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: 1c8e1e50f009 - stable/14 - socket: Set lock flags properly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c8e1e50f0097d202f42d0fc3b2080d09ac9ae92 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c8e1e50f0097d202f42d0fc3b2080d09ac9ae92 commit 1c8e1e50f0097d202f42d0fc3b2080d09ac9ae92 Author: Mark Johnston AuthorDate: 2024-08-20 14:52:02 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 socket: Set lock flags properly Fixes: fb901935f257 ("socket: Split up sosend_generic()") Reported by: cy Sponsored by: Klara, Inc. Sponsored by: Stormshield (cherry picked from commit 66aed7e3488aa60195abcf846da5e04aa82fb1bf) --- sys/kern/uipc_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index adb11e08a7ac..cdff5f23de0a 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1866,7 +1866,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, { int error; - error = SOCK_IO_SEND_LOCK(so, 0); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); error = sosend_generic_locked(so, addr, uio, top, control, flags, td); From nobody Tue Sep 3 14:55:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WypZQ1JYmz5TMp2; Tue, 03 Sep 2024 14:55: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 4WypZP6DVmz4xJS; Tue, 3 Sep 2024 14:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sULYSoM2hTBWn6S/W52zC+3Yu/nPXQikvtujPHiOBw=; b=fBVy7PyQplKDitvWi1MOkCZP7DxKMLZa44Tb42EL3RY0eyE06YV4D7U4UAHCO0anpRKiFu fZoHTo/xBWW32Htbu/cPROlGWR1f3xre+WXjEQhi3wGqfrlVSMrOCipTL9AfrZuqA+y2w5 2AoEVENWqMFxqbj/pcK5bbULv4GODKcLwwo3XZS1FS7AYQc0iUb+DO1EB4vTGS2LE54iT3 j7D6qdgni0XI152z4cO7IA6ZpWJAXt//ciLiDQ5wTFD4VkeaFn5fTvrDlDbZaAYTGoKmNl 87cuttrgDzBLwvWYz/Ni0HrIfQqY/pJef9h78sQDuUhHIcp3JZmQvTQlqZ2UcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375309; a=rsa-sha256; cv=none; b=DP3aIlGyiWwqjeqbs89vrrVv8YFfHJLqu1i42zNxnV/eLjqVqm/Oj3A+MmSKJ/4PvR05hT nCk7di6l0tm9OC7B6kepQEvee+egwteU43EZB2W0LzNK2MwwSVgA4HymctNawgH97ZgyVM r6qCARihmlZou4WOAYLntlNdqRYIE5u8ySAJDofeorTfuvtdPNd2YUB894p9GAeiSxA8AL HTd7TtTM4M1xL8xZ1cQhDRtnzIswiSux7rZIdtSxfyF4FrMOGBd1+uIAYINc1+uQkvLlGl PkAGk0jDyvyv9FWXDcdmZYAQFjAnS7RGpT1mcvlenq0J+T0AdXIwYVT448gqVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sULYSoM2hTBWn6S/W52zC+3Yu/nPXQikvtujPHiOBw=; b=EVoCvlnuiNd8icaCbAp8MEBn2bgS+arnCFBvo24xENxswwiGaiYwhm4LvImQb0d+8Po5y4 R5zDRWJ9TuW9C4TBEniOeJW7BGOSvbThMdtosucLQAqw0HWiMGBV3SuHOy80zexFdg94gF 2EJOuvpaZEg1d9X4iVXcIyFhgJ6Q8osa/hl6oYJgfoU7xTdo/LCsKfR5d06M114NnPHB5t 2z7VxumS1IMG0RZrUJy0Bira8JAkSk2En579/ptgWJtsxn5SaA/8qG5Vpb0KusWmtV2Yjo KzkIJMYSylpKco76IgVT51w/MQZBhJfsqmcAPkqAIQrZ6P0+LMf7oZXC7aRElg== 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 4WypZP5pPJzl7v; Tue, 3 Sep 2024 14:55: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 483Et9ww071072; Tue, 3 Sep 2024 14:55:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Et9oq071069; Tue, 3 Sep 2024 14:55:09 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:55:09 GMT Message-Id: <202409031455.483Et9oq071069@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: 00f60781122a - stable/14 - fusefs: Fix warning formatting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00f60781122a12fd4997630c91e0a638e24ae20c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=00f60781122a12fd4997630c91e0a638e24ae20c commit 00f60781122a12fd4997630c91e0a638e24ae20c Author: Mark Johnston AuthorDate: 2024-08-27 20:29:05 +0000 Commit: Mark Johnston CommitDate: 2024-09-03 14:54:43 +0000 fusefs: Fix warning formatting Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46456 (cherry picked from commit 705008fbfdbeff147fe624ae506f3781b5ba10bf) --- sys/fs/fuse/fuse_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 30e3cebfa500..f67bfe0e91c3 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -283,12 +283,12 @@ fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, * dirty writes! That's a server bug. */ if (fuse_libabi_geq(data, 7, 23)) { - msg = "writeback cache incoherent!." + msg = "writeback cache incoherent! " "To prevent data corruption, disable " "the writeback cache according to your " "FUSE server's documentation."; } else { - msg = "writeback cache incoherent!." + msg = "writeback cache incoherent! " "To prevent data corruption, disable " "the writeback cache by setting " "vfs.fusefs.data_cache_mode to 0 or 1."; From nobody Tue Sep 3 16:00:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyqxp2GWkz5TTjj; Tue, 03 Sep 2024 15:57:02 +0000 (UTC) (envelope-from ktullavik@gmail.com) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyqxp0Thcz582m; Tue, 3 Sep 2024 15:57:02 +0000 (UTC) (envelope-from ktullavik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2f50966c478so58613381fa.1; Tue, 03 Sep 2024 08:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725379020; x=1725983820; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7WCmg6UW/ktrXdiLqf4po+Nwl7Ji71RT+IgMyUQqh1E=; b=CEb70b/Lyle4cUq6xGfPsp7sPAjukYlolRhJ/p53lJDjFsmg6941IMf28rTsQj2enZ cZIZa5Xo+YdqgNVYx+zaXuRUgHkptzU31O9Ien9sqnVl8kKQk8y4NRQDK1aSiP246WOl scJk2NtItZwIvP+NWP3icGeOuvjDeSX3rNAxV54L4TucLg6usArnPJNc07qOVy5VZQNY qMLw4TjBO1RvpNXNo8xFchwY0YakRfkpgc6WO5FLD8f4xPoJcU0tC4eTDjD2z9ehg4M0 FCOGeGqKtky34+HuG8WP4kw1A/wgChpirvaKHVJFG862NYY5ab1RKN1juE/jwkbykrWy m6QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725379020; x=1725983820; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7WCmg6UW/ktrXdiLqf4po+Nwl7Ji71RT+IgMyUQqh1E=; b=WxBtO3L8e0A7XUTs8DHSWEb3yMLnN+VOTtcg+A8LQ1+aqr2789b67QQ4RfpvvVw7p3 1/hxFpvpbHFQVZdAJCtUmTa0bXz+Lah9FfCi1Hx42/9w68JVrdltve8uVr0B3+ho+0Bp WPqfH4nXoPaq2+Y5RjifriyoFZFzYsZJreYAp7XQvFv9fyWX61sadMUq5LupmshdUrzH PgSFS0+Ahg722YGV3YWBBfvdFTx7xQ1Icp+MLXgMlvEIcFAc16CyrDtGuem7FhCNrLcN BG6U/V2bwsbOVdpyEhYch7f0SsC5ZEgEDBzctStoY5YiiJmSFuEwvC/i1Ug5qHLM86BH T1rQ== X-Forwarded-Encrypted: i=1; AJvYcCWc7rrvlQBeXt0XymEMX4UR8yKIwDDIGrkqphvsO4jmYuXORy5HbJwzqF4LpLgF2HLt4RWdxpsZKLSS2qv/iyrxacREK7U=@freebsd.org, AJvYcCXWRl4U4af+2Vv6StDSW7r80qwxxZrN20R/Oe6GjQtSZFZhvFZTL8H+E35kL8TYTCke9SrcNRGwRcWlQXxEbLs=@freebsd.org, AJvYcCXbziLgyryajVyhV1ZrW70WsOXrLof3IBNofAXcrQzZ5ocx6eU1FrcJGub1SFScrDvJYn1Rdz6luw6V5duku77zSFJ8@freebsd.org X-Gm-Message-State: AOJu0Yzi3ASQJUN6RdWjSWBMLgXM8Fyx88UlfFR2m03pF5Y2259HdkZ9 5ClIzVpBTJLnLI80EdFgR0/sy0hqiTK2aR9BqwvkM5OZoNFYbNGeIeW7AaBC X-Google-Smtp-Source: AGHT+IFY13FiyLqYhxYAN7inWfuDuG8Vzaw9NQzrAjiXUv7rk2NXWKxBd62LafG2QWERGkH/iqdCsg== X-Received: by 2002:a2e:bea1:0:b0:2f4:f279:36d3 with SMTP id 38308e7fff4ca-2f61e0258f3mr120432411fa.4.1725379019524; Tue, 03 Sep 2024 08:56:59 -0700 (PDT) Received: from [10.0.0.7] ([46.212.160.34]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f615171d68sm22339671fa.84.2024.09.03.08.56.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2024 08:56:58 -0700 (PDT) Message-ID: <981431aa-9586-4e8e-a178-fe88c5f22d32@gmail.com> Date: Tue, 3 Sep 2024 18:00:58 +0200 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ffaf862df662 - main - Mention that SILI makes tcopy(1) slow on modern tape drives Content-Language: en-US To: Poul-Henning Kamp , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202409031045.483AjagV044523@gitrepo.freebsd.org> From: KT Ullavik In-Reply-To: <202409031045.483AjagV044523@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4Wyqxp0Thcz582m > ... for reach read ... Should that be "for each" ? From nobody Tue Sep 3 16:00:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyr2064Xfz5TTS4; Tue, 03 Sep 2024 16:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyr205csLz58kn; Tue, 3 Sep 2024 16:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725379240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CFZmIoCl9tdXvJmEnYByat4+VhFF+C0RA4hJz9d2OwU=; b=JFI+/LYTlzeDW4L5xTjAo5PbAje38WBG2bkeRRKeFvZ5+6EIKzrn0rzIZ8pwGvTh/c677H 8VtKQJq7m+XfHH3h9iYYIvuvufX+S6VM9stIbjOk6FosB58sCdTFuFXVfumD4R9UVtwjYr R9cO7Wsyw27huFQ8pPQhXZnPYNzpIzLSgM48PS6kkd62CtYHgAS/BFln1/ZTDCgNO3NJh7 EyJyEfg4nq9peU/Rp2TxM9SGe0MWRLNHcwEP8w8MzMBZxMyqhs9QbdsvAyudiV8kY/IGy1 KBYDTPsYzNnHv3wyYxIKtgQIZeSgy2/Nf8ND8a5RxEZW7xLUfPj7HlUa41zafQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725379240; a=rsa-sha256; cv=none; b=uVfEav8hrZzosX0BW2m3UsiYKpY0+VoZnnPpLmrIH1ttjUNK4Aco1xbPXY+tD9fG7GlF84 5skitTpr7mJWEC8btIvn6/Ygmc4tEVCgrNM7xTAT/6TByhljomX9ZYzpXbanBv7HpWGOvW y8loGoIyejGq/rXFt9yULQDofe4WzOebtePfwG1dRDID8NXJ7jlauf0XpohQa0GXQjwHOm WMNaJJmdFVKUaIzNW4RVcsb4IArotCLDi2NUFq+wILqgGhCk24NygChw012ZKdNE8OKlAi QywP+ddbRu65Inmte5XxoRybKHHKvGmV9PBrf8i3vlzOBHvpmyVoGDgERsaL2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725379240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CFZmIoCl9tdXvJmEnYByat4+VhFF+C0RA4hJz9d2OwU=; b=gdKq0s7UiIzjzSFgSWfyCiMGtuymds3g4BbqfOrBQsZToVNWTrDLhsXthObIt7UNgnnGza tfivb1qe0gDwiaJXw2yJYuj8Th652Ed5JYfDHc0k//NwxEHfig3N0AKRhMs/D4Gjxb9AG2 37gyKudLVJZOpxIbhnuBfaizUwVrudaL31uEAEy7QUSt+500HOPVQUdlwsjEEqhVFvsL/v ujGUj/VnRzNKKXhSQsQG6O8TRm3Q/DYuptN4SmZCCFWTMt+Ea9rdf4vBfztu04y3hxsriW 5KfDTqHypMpI1lvxzgWg01S8zWz7q9VLfkcWA+aLW1qv4pPwp/79jLqmBn3O5w== 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 4Wyr205DyVznGR; Tue, 3 Sep 2024 16:00: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 483G0eLR083404; Tue, 3 Sep 2024 16:00:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483G0e5Y083401; Tue, 3 Sep 2024 16:00:40 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:00:40 GMT Message-Id: <202409031600.483G0e5Y083401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: 4dabfcb61538 - main - Typo. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dabfcb6153868a03d3afb55a27edf00585790b8 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=4dabfcb6153868a03d3afb55a27edf00585790b8 commit 4dabfcb6153868a03d3afb55a27edf00585790b8 Author: Poul-Henning Kamp AuthorDate: 2024-09-03 16:00:17 +0000 Commit: Poul-Henning Kamp CommitDate: 2024-09-03 16:00:17 +0000 Typo. Spotted by: ktullavik --- usr.bin/tcopy/tcopy.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/tcopy/tcopy.1 b/usr.bin/tcopy/tcopy.1 index f608e0af07e4..3f12a807e41e 100644 --- a/usr.bin/tcopy/tcopy.1 +++ b/usr.bin/tcopy/tcopy.1 @@ -98,7 +98,7 @@ command appeared in .Bl -item .It Modern tape drives may return a SCSI "Incorrect Length Indicator (ILI)" -for reach read with a different block size that what is on the +for each read with a different block size that what is on the tape, and that slows things down a lot. This can be disabled with the .Xr mt 1 From nobody Tue Sep 3 16:00:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyr2B4jQvz5TTYK; Tue, 03 Sep 2024 16:00:50 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyr2B3dlyz59CZ; Tue, 3 Sep 2024 16:00:50 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 9F0028943A; Tue, 03 Sep 2024 16:00:48 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 483G0mgN007888; Tue, 3 Sep 2024 16:00:48 GMT (envelope-from phk) Message-Id: <202409031600.483G0mgN007888@critter.freebsd.dk> To: KT Ullavik cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ffaf862df662 - main - Mention that SILI makes tcopy(1) slow on modern tape drives In-reply-to: <981431aa-9586-4e8e-a178-fe88c5f22d32@gmail.com> From: "Poul-Henning Kamp" References: <202409031045.483AjagV044523@gitrepo.freebsd.org> <981431aa-9586-4e8e-a178-fe88c5f22d32@gmail.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7886.1725379248.1@critter.freebsd.dk> Date: Tue, 03 Sep 2024 16:00:48 +0000 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU] X-Rspamd-Queue-Id: 4Wyr2B3dlyz59CZ -------- KT Ullavik writes: > > ... for reach read ... > > Should that be "for each" ? Fixed, thanks. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From nobody Tue Sep 3 16:29:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyrgp4WQnz5TXJ4; Tue, 03 Sep 2024 16:29: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 4Wyrgp45P5z3y1c; Tue, 3 Sep 2024 16:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725380998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lptwF8PbJIzue1lO2pi8EkubO4VbD8FysTyWXfhl1nE=; b=WtN9kiD7xWVIG+LqdlHdwTELZFt2+dIXsCZJ45dXro3xMVmPioLVg4HVWZMtoIgfmax0Nq Qz17weWxx10ZBXnyvgo7spAvwrkomzF3AOHrzKX1cWqGOeXQz/2VD5ufnpFNqPkorBnlRm mkoM1zjVPdFfnovrC9fYJ315s4MalAuJdUu8klSpPthl0FyvXjF0su9XsrsMZiqc/ks9zI gh4rjDSSsPaF1SE+lToeAiPntN6x5iZKDXYQ/deHkYz2NnX9WqNzr1vZWfHSbkZNYK0yqJ 4McZAkciztuT46AelCa81RqOI5hESBwvP8u9yCVw5m9ccC/mQCLqQt1u8ZGXzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725380998; a=rsa-sha256; cv=none; b=XgtVoN3n9MPdn8RGP9HRt5/cn7sOse6e7ohHi2MW4d4Bv9VpfhJKh3FFg6+FUBOyhnoIa2 Xndh0eTwMUP80gQ1wdkmnO+iyYS7nAcu/jbvhT7+MwYIHCLIiKAFQDxtE8vfkA05QJk3xZ rAjuzF8BPwVC0VFDcabfic+47Voc3QWhQfmKwr6rnEyvi/WRZBJZDK7hwY+XJHWCrSTImc sF+s75KHsNG7eNWg6R3Igf4EtG+XQJuBBMcglBZsIV5hohJLeDlsDdfzfXniFd1MIN3raw xG/VqudPpl+4lveFHM8ceKfu30lpg90P4Dly/6zk74k+1Se2sxITJDXQxpuU+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725380998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lptwF8PbJIzue1lO2pi8EkubO4VbD8FysTyWXfhl1nE=; b=tY+ezpTmyz7/yNEs1DqHzTSB2BBWhodNCZiUSojzGvRhunO9Wuq6nhGlJMC2OLQ70hhbet MjQnwG+5eDMeh4BDTZFqsxf7qr5MMmGheUnn/2gCBJpsRgKmVWz6zK9cusxy2DWVYKD0Zx e2y15NxbrN3S9to3aMRBPEwvyA2lh91q+l9pHoXZXANTzbatyHF/XzdgUIbAW9e3wFDaS0 KVkXO2rrjtKjEsJQk1eNBvdvFF409MpIqt26shdYYn6vnQaKnGwVGWNnJCWg1vCRr+olzW kTnJhoRbk7GEINR4hhCPfz3kuUCmaFETNTm9Nj1bRcEnIy13QSTi2QBUsZJCzg== 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 4Wyrgp3gpQznmR; Tue, 3 Sep 2024 16:29: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 483GTw1W024944; Tue, 3 Sep 2024 16:29:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GTwGF024941; Tue, 3 Sep 2024 16:29:58 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:29:58 GMT Message-Id: <202409031629.483GTwGF024941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: e0fd6004ef0e - stable/14 - vendor/bc: upgrade to version 7.0.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0fd6004ef0edee3d858564271bcea3eb70145d1 Auto-Submitted: auto-generated The branch stable/14 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=e0fd6004ef0edee3d858564271bcea3eb70145d1 commit e0fd6004ef0edee3d858564271bcea3eb70145d1 Author: Stefan Eßer AuthorDate: 2024-08-23 16:45:58 +0000 Commit: Stefan Eßer CommitDate: 2024-09-03 16:28:14 +0000 vendor/bc: upgrade to version 7.0.0 This is a production release to fix three bugs, none of which affects well formed scripts on FreeBSD: The first bug is that bc/dc will exit on macOS when the terminal is resized. The second bug is that an array, which should only be a function parameter, was accepted as part of larger expressions. The third bug is that the value stack for dc was cleared on any error. However, this is not how other dc behave. To bring dc more in line with other implementations, this behavior was changed. This change is why this version is a new major version. (cherry picked from commit 54d20d67e2af28d948ce2df13feb039fa10900fc) MFC after: 3 days (cherry picked from commit 12e0d316644a4f80f5f1f78cf07bd93def43b1ca) --- contrib/bc/Makefile.in | 10 +++- contrib/bc/NEWS.md | 14 +++++ contrib/bc/compile_flags.txt | 1 + contrib/bc/configure.sh | 120 ++++++++++++++++++++++++++++++-------- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/opt.h | 6 +- contrib/bc/include/ossfuzz.h | 79 +++++++++++++++++++++++++ contrib/bc/include/status.h | 25 ++------ contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 2 +- contrib/bc/manuals/dc/A.1 | 7 ++- contrib/bc/manuals/dc/A.1.md | 9 ++- contrib/bc/manuals/dc/E.1 | 7 ++- contrib/bc/manuals/dc/E.1.md | 9 ++- contrib/bc/manuals/dc/EH.1 | 7 ++- contrib/bc/manuals/dc/EH.1.md | 9 ++- contrib/bc/manuals/dc/EHN.1 | 7 ++- contrib/bc/manuals/dc/EHN.1.md | 9 ++- contrib/bc/manuals/dc/EN.1 | 7 ++- contrib/bc/manuals/dc/EN.1.md | 9 ++- contrib/bc/manuals/dc/H.1 | 7 ++- contrib/bc/manuals/dc/H.1.md | 9 ++- contrib/bc/manuals/dc/HN.1 | 7 ++- contrib/bc/manuals/dc/HN.1.md | 9 ++- contrib/bc/manuals/dc/N.1 | 7 ++- contrib/bc/manuals/dc/N.1.md | 9 ++- contrib/bc/scripts/os.c | 59 +++++++++++++++++++ contrib/bc/src/args.c | 4 +- contrib/bc/src/bc.c | 3 +- contrib/bc/src/bc_fuzzer.c | 112 +++++++++++++++++++++++++++++++++++ contrib/bc/src/bc_lex.c | 2 + contrib/bc/src/bc_parse.c | 23 +++++++- contrib/bc/src/data.c | 59 +++++++++++++++++++ contrib/bc/src/dc.c | 3 +- contrib/bc/src/dc_fuzzer.c | 112 +++++++++++++++++++++++++++++++++++ contrib/bc/src/dc_lex.c | 2 + contrib/bc/src/history.c | 2 +- contrib/bc/src/lang.c | 4 +- contrib/bc/src/lex.c | 8 +++ contrib/bc/src/main.c | 21 +++++-- contrib/bc/src/num.c | 4 ++ contrib/bc/src/opt.c | 14 ++--- contrib/bc/src/program.c | 13 +++-- contrib/bc/src/vm.c | 38 ++++++++++-- contrib/bc/tests/bc/errors/37.txt | 37 ++++++++++++ contrib/bc/tests/bc/errors/38.txt | 37 ++++++++++++ contrib/bc/vs/bc.vcxproj | 18 +++--- include/ossfuzz.h | 79 +++++++++++++++++++++++++ 50 files changed, 914 insertions(+), 133 deletions(-) diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 4adb76ddaa17..c63dc242e79a 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -94,6 +94,10 @@ BC = bc DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +BC_FUZZER = $(BIN)/$(BC)_fuzzer_c +BC_FUZZER_C = $(BIN)/$(BC)_fuzzer_C +DC_FUZZER = $(BIN)/$(DC)_fuzzer_c +DC_FUZZER_C = $(BIN)/$(DC)_fuzzer_C BC_TEST_OUTPUTS = tests/bc_outputs BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 @@ -149,8 +153,11 @@ BC_ENABLE_NLS = %%NLS%% BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%% BC_ENABLE_AFL = %%FUZZ%% +BC_ENABLE_OSSFUZZ = %%OSSFUZZ%% BC_ENABLE_MEMCHECK = %%MEMCHECK%% +LIB_FUZZING_ENGINE = %%LIB_FUZZING_ENGINE%% + BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%% BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%% DC_DEFAULT_SIGINT_RESET = %%DC_DEFAULT_SIGINT_RESET%% @@ -210,7 +217,8 @@ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) -CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS9 = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS = $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ) CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 95de7e5182c4..1775fa0b6533 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,19 @@ # News +## 7.0.0 + +This is a production release to fix three bugs. + +The first bug is that `bc`/`dc` will exit on macOS when the terminal is resized. + +The second bug is that an array, which should only be a function parameter, was +accepted as part of larger expressions. + +The third bug is that value stack for `dc` was cleared on any error. However, +this is not how other `dc` behave. To bring `dc` more in line with other +implementations, this behavior was changed. This change is why this version is a +new major version. + ## 6.7.6 This is a production release to fix one bug. diff --git a/contrib/bc/compile_flags.txt b/contrib/bc/compile_flags.txt index 7a08c87f3876..3324798013c6 100644 --- a/contrib/bc/compile_flags.txt +++ b/contrib/bc/compile_flags.txt @@ -13,3 +13,4 @@ -DBC_ENABLE_EXTRA_MATH=1 -DBC_ENABLE_HISTORY=1 -DBC_ENABLE_NLS=1 +-DBC_ENABLE_OSSFUZZ=0 diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index 43bb502ea817..442165d15693 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -68,7 +68,7 @@ usage() { printf ' [--man3dir=MAN3DIR]\n' if [ "$_usage_val" -ne 0 ]; then - exit + exit "$_usage_val" fi printf '\n' @@ -181,6 +181,8 @@ usage() { printf ' Enable a build appropriate for valgrind. For development only.\n' printf ' -z, --enable-fuzz-mode\n' printf ' Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n' + printf ' -Z, --enable-ossfuzz-mode\n' + printf ' Enable fuzzing mode for OSS-Fuzz. THIS IS FOR DEVELOPMENT ONLY.\n' printf ' --prefix PREFIX\n' printf ' The prefix to install to. Overrides "$PREFIX" if it exists.\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' @@ -722,6 +724,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -755,6 +758,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -772,7 +776,8 @@ predefined_build() { dc_default_digit_clamp=0;; GDH) - CFLAGS="-flto -Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories" + CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -789,6 +794,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -806,7 +812,8 @@ predefined_build() { dc_default_digit_clamp=1;; DBG) - CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories" + CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -823,6 +830,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=1 @@ -888,6 +896,7 @@ strip_bin=1 all_locales=0 library=0 fuzz=0 +ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -911,7 +920,7 @@ dc_default_digit_clamp=0 # getopts is a POSIX utility, but it cannot handle long options. Thus, the # handling of long options is done by hand, and that's the reason that short and # long options cannot be mixed. -while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do +while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do case "$opt" in a) library=1 ;; @@ -944,6 +953,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do T) strip_bin=0 ;; v) vg=1 ;; z) fuzz=1 ;; + Z) ossfuzz=1 ;; -) arg="$1" arg="${arg#--}" @@ -1070,6 +1080,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do enable-test-timing) time_tests=1 ;; enable-valgrind) vg=1 ;; enable-fuzz-mode) fuzz=1 ;; + enable-ossfuzz-mode) ossfuzz=1 ;; enable-memcheck) memcheck=1 ;; install-all-locales) all_locales=1 ;; help* | bc-only* | dc-only* | coverage* | debug*) @@ -1320,6 +1331,45 @@ elif [ "$dc_only" -eq 1 ]; then tests="test_dc" +elif [ "$ossfuzz" -eq 1 ]; then + + if [ "$bc_only" -ne 0 ] || [ "$dc_only" -ne 0 ]; then + usage "An OSS-Fuzz build must build both fuzzers." + fi + + bc=1 + dc=1 + + # Expressions *cannot* exit in an OSS-Fuzz build. + bc_default_expr_exit=0 + dc_default_expr_exit=0 + + executables="bc_fuzzer and dc_fuzzer" + + karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" + karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" + + if [ "$library" -eq 0 ]; then + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + else + install_prereqs=" install_library install_bcl_header" + install_man_prereqs=" install_bcl_manpage" + uninstall_prereqs=" uninstall_library uninstall_bcl_header" + uninstall_man_prereqs=" uninstall_bcl_manpage" + tests="test_library" + fi + + second_target_prereqs="src/bc_fuzzer.o $default_target_prereqs" + default_target_prereqs="\$(BC_FUZZER) src/dc_fuzzer.o $default_target_prereqs" + default_target_cmd="\$(CXX) \$(CFLAGS) src/dc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(DC_FUZZER) \&\& ln -sf ./dc_fuzzer_c \$(DC_FUZZER_C)" + second_target_cmd="\$(CXX) \$(CFLAGS) src/bc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(BC_FUZZER) \&\& ln -sf ./bc_fuzzer_c \$(BC_FUZZER_C)" + + default_target="\$(DC_FUZZER) \$(DC_FUZZER_C)" + second_target="\$(BC_FUZZER) \$(BC_FUZZER_C)" + else bc=1 @@ -1349,8 +1399,12 @@ else fi +if [ "$fuzz" -ne 0 ] && [ "$ossfuzz" -ne 0 ]; then + usage "Fuzzing mode and OSS-Fuzz mode are mutually exclusive" +fi + # We need specific stuff for fuzzing. -if [ "$fuzz" -ne 0 ]; then +if [ "$fuzz" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then debug=1 hist=0 nls=0 @@ -1395,7 +1449,6 @@ else COVERAGE_PREREQS="" fi - # Set some defaults. if [ -z "${DESTDIR+set}" ]; then destdir="" @@ -1485,8 +1538,8 @@ if [ "$nls" -ne 0 ]; then flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" flags="$flags -DBC_ENABLE_HISTORY=$hist -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0" - flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0" + flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" ccbase=$(basename "$CC") @@ -1494,14 +1547,14 @@ if [ "$nls" -ne 0 ]; then flags="$flags -Wno-unreachable-code" fi - "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -o "./vm.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -E > /dev/null err="$?" rm -rf "./vm.o" - # If this errors, it is probably because of building on Windows, - # and NLS is not supported on Windows, so disable it. + # If this errors, it is probably because of building on Windows or musl, + # and NLS is not supported on Windows or musl, so disable it. if [ "$err" -ne 0 ]; then printf 'NLS does not work.\n' if [ $force -eq 0 ]; then @@ -1514,7 +1567,7 @@ if [ "$nls" -ne 0 ]; then printf 'NLS works.\n\n' printf 'Testing gencat...\n' - gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null 2>&1 + gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null err="$?" @@ -1587,10 +1640,10 @@ if [ "$hist" -eq 1 ]; then flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0" flags="$flags -DBC_ENABLE_EDITLINE=$editline -DBC_ENABLE_READLINE=$readline" - flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0" + flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -o "./history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -E > /dev/null err="$?" @@ -1660,7 +1713,7 @@ set +e printf 'Testing for FreeBSD...\n' flags="-DBC_TEST_FREEBSD -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1677,7 +1730,7 @@ fi printf 'Testing for macOS...\n' flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1705,7 +1758,7 @@ fi printf 'Testing for OpenBSD...\n' flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1741,7 +1794,7 @@ GEN_DIR="$scriptdir/gen" # These lines set the appropriate targets based on whether `gen/strgen.c` or # `gen/strgen.sh` is used. GEN="strgen" -GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)" +GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -DBC_ENABLE_OSSFUZZ=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)" CLEAN_PREREQS=" clean_gen clean_coverage" if [ -z "${GEN_HOST+set}" ]; then @@ -1754,8 +1807,9 @@ else fi fi +# The fuzzer files are always unneeded because they'll be built separately. manpage_args="" -unneeded="" +unneeded="bc_fuzzer.c dc_fuzzer.c" headers="\$(HEADERS)" # This series of if statements figure out what source files are *not* needed. @@ -1826,6 +1880,14 @@ if [ "$library" -ne 0 ]; then fi +elif [ "$ossfuzz" -ne 0 ]; then + + unneeded="$unneeded library.c main.c" + + PC_PATH="" + pkg_config_install="" + pkg_config_uninstall="" + else unneeded="$unneeded library.c" @@ -1836,9 +1898,10 @@ else fi -# library.c is not needed under normal circumstances. +# library.c, bc_fuzzer.c, and dc_fuzzer.c are not needed under normal +# circumstances. if [ "$unneeded" = "" ]; then - unneeded="library.c" + unneeded="library.c bc_fuzzer.c dc_fuzzer.c" fi # This sets the appropriate manpage for a full build. @@ -1846,7 +1909,7 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi -if [ "$vg" -ne 0 ]; then +if [ "$vg" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then memcheck=1 fi @@ -2011,7 +2074,9 @@ contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") contents=$(replace "$contents" "FUZZ" "$fuzz") +contents=$(replace "$contents" "OSSFUZZ" "$ossfuzz") contents=$(replace "$contents" "MEMCHECK" "$memcheck") +contents=$(replace "$contents" "LIB_FUZZING_ENGINE" "$LIB_FUZZING_ENGINE") contents=$(replace "$contents" "BC_LIB_O" "$bc_lib") contents=$(replace "$contents" "BC_HELP_O" "$bc_help") @@ -2117,6 +2182,15 @@ if [ "$dc" -ne 0 ]; then gen_err_tests dc $dc_test_exec fi +if [ "$ossfuzz" -ne 0 ]; then + + printf 'bc_fuzzer_c: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_c\n' >> Makefile + printf 'bc_fuzzer_C: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_C\n' >> Makefile + printf 'dc_fuzzer_c: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_c\n' >> Makefile + printf 'dc_fuzzer_C: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_C\n' >> Makefile + +fi + # Copy the correct manuals to the expected places. mkdir -p manuals cp -f "$scriptdir/manuals/bc/$manpage_args.1.md" manuals/bc.1.md diff --git a/contrib/bc/include/args.h b/contrib/bc/include/args.h index f1e9f007bddf..8f8f00be4630 100644 --- a/contrib/bc/include/args.h +++ b/contrib/bc/include/args.h @@ -54,7 +54,7 @@ * any. */ void -bc_args(int argc, char* argv[], bool exit_exprs, BcBigDig* scale, +bc_args(int argc, const char* argv[], bool exit_exprs, BcBigDig* scale, BcBigDig* ibase, BcBigDig* obase); #if BC_ENABLED diff --git a/contrib/bc/include/bc.h b/contrib/bc/include/bc.h index b25df09a174e..2213278be1da 100644 --- a/contrib/bc/include/bc.h +++ b/contrib/bc/include/bc.h @@ -51,7 +51,7 @@ * @return A status. */ BcStatus -bc_main(int argc, char* argv[]); +bc_main(int argc, const char* argv[]); // These are references to the help text, the library text, and the "filename" // for the library. diff --git a/contrib/bc/include/dc.h b/contrib/bc/include/dc.h index 1328f1c63b38..63f5ccbd10e3 100644 --- a/contrib/bc/include/dc.h +++ b/contrib/bc/include/dc.h @@ -48,7 +48,7 @@ * @return A status. */ BcStatus -dc_main(int argc, char* argv[]); +dc_main(int argc, const char* argv[]); // A reference to the dc help text. extern const char dc_help[]; diff --git a/contrib/bc/include/opt.h b/contrib/bc/include/opt.h index e60328994d8c..41058cb4e29c 100644 --- a/contrib/bc/include/opt.h +++ b/contrib/bc/include/opt.h @@ -47,7 +47,7 @@ typedef struct BcOpt { /// The array of arguments. - char** argv; + const char** argv; /// The index of the current argument. size_t optind; @@ -59,7 +59,7 @@ typedef struct BcOpt int subopt; /// The option argument. - char* optarg; + const char* optarg; } BcOpt; @@ -103,7 +103,7 @@ typedef struct BcOptLong * @param argv The array of arguments. */ void -bc_opt_init(BcOpt* o, char** argv); +bc_opt_init(BcOpt* o, const char** argv); /** * Parse an option. This returns a value the same way getopt() and getopt_long() diff --git a/contrib/bc/include/ossfuzz.h b/contrib/bc/include/ossfuzz.h new file mode 100644 index 000000000000..5c12a3c9c9fb --- /dev/null +++ b/contrib/bc/include/ossfuzz.h @@ -0,0 +1,79 @@ +/* + * ***************************************************************************** + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018-2024 Gavin D. Howard and contributors. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * ***************************************************************************** + * + * Declarations for the OSS-Fuzz build of bc and dc. + * + */ + +#include +#include + +#ifndef BC_OSSFUZZ_H +#define BC_OSSFUZZ_H + +/// The number of args in fuzzer arguments, including the NULL terminator. +extern const size_t bc_fuzzer_args_len; + +/// The standard arguments for the bc fuzzer with the -c argument. +extern const char* bc_fuzzer_args_c[]; + +/// The standard arguments for the bc fuzzer with the -C argument. +extern const char* bc_fuzzer_args_C[]; + +/// The standard arguments for the dc fuzzer with the -c argument. +extern const char* dc_fuzzer_args_c[]; + +/// The standard arguments for the dc fuzzer with the -C argument. +extern const char* dc_fuzzer_args_C[]; + +/// The data pointer. +extern uint8_t* bc_fuzzer_data; + +/** + * The function that the fuzzer runs. + * @param Data The data. + * @param Size The number of bytes in @a Data. + * @return 0 on success, -1 on error. + * @pre @a Data must not be equal to NULL if @a Size > 0. + */ +int +LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size); + +/** + * The initialization function for the fuzzer. + * @param argc A pointer to the argument count. + * @param argv A pointer to the argument list. + * @return 0 on success, -1 on error. + */ +int +LLVMFuzzerInitialize(int* argc, char*** argv); + +#endif // BC_OSSFUZZ_H diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index f579df8c649b..203f09af628b 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -46,27 +46,6 @@ #include #include -// This is used by configure.sh to test for OpenBSD. -#ifdef BC_TEST_OPENBSD -#ifdef __OpenBSD__ -#error On OpenBSD without _BSD_SOURCE -#endif // __OpenBSD__ -#endif // BC_TEST_OPENBSD - -// This is used by configure.sh to test for FreeBSD. -#ifdef BC_TEST_FREEBSD -#ifdef __FreeBSD__ -#error On FreeBSD with _POSIX_C_SOURCE -#endif // __FreeBSD__ -#endif // BC_TEST_FREEBSD - -// This is used by configure.sh to test for macOS. -#ifdef BC_TEST_APPLE -#ifdef __APPLE__ -#error On macOS without _DARWIN_C_SOURCE -#endif // __APPLE__ -#endif // BC_TEST_APPLE - // Windows has deprecated isatty() and the rest of these. Or doesn't have them. // So these are just fixes for Windows. #ifdef _WIN32 @@ -676,9 +655,13 @@ typedef enum BcMode /// File mode. BC_MODE_FILE, +#if !BC_ENABLE_OSSFUZZ + /// stdin mode. BC_MODE_STDIN, +#endif // !BC_ENABLE_OSSFUZZ + } BcMode; /// Do a longjmp(). This is what to use when activating an "exception", i.e., a diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 586691a6e7ef..897a19530e3f 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.7.6 +#define VERSION 7.0.0 #endif // BC_VERSION_H diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 052c1d14c237..e81206b63871 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -794,7 +794,7 @@ bc_vm_info(const char* const help); * @return A status. */ BcStatus -bc_vm_boot(int argc, char* argv[]); +bc_vm_boot(int argc, const char* argv[]); /** * Initializes some of the BcVm global. This is separate to make things easier diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index 33ecb8e2031e..d59e0fa68a58 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1275,11 +1275,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index 613f98f76814..ad0c59934fd1 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -1130,11 +1130,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/E.1 b/contrib/bc/manuals/dc/E.1 index 91f68dfd7467..a5febe44705f 100644 --- a/contrib/bc/manuals/dc/E.1 +++ b/contrib/bc/manuals/dc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/E.1.md b/contrib/bc/manuals/dc/E.1.md index 3a47f789bd3e..54b877999d0d 100644 --- a/contrib/bc/manuals/dc/E.1.md +++ b/contrib/bc/manuals/dc/E.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EH.1 b/contrib/bc/manuals/dc/EH.1 index e60e6e0d8497..61fbaa4efe92 100644 --- a/contrib/bc/manuals/dc/EH.1 +++ b/contrib/bc/manuals/dc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EH.1.md b/contrib/bc/manuals/dc/EH.1.md index 761b9a89947b..6398477a84dd 100644 --- a/contrib/bc/manuals/dc/EH.1.md +++ b/contrib/bc/manuals/dc/EH.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EHN.1 b/contrib/bc/manuals/dc/EHN.1 index d26d49c5ce3d..974cb3c86791 100644 --- a/contrib/bc/manuals/dc/EHN.1 +++ b/contrib/bc/manuals/dc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EHN.1.md b/contrib/bc/manuals/dc/EHN.1.md index 58ae149bb686..51e30849996e 100644 --- a/contrib/bc/manuals/dc/EHN.1.md +++ b/contrib/bc/manuals/dc/EHN.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EN.1 b/contrib/bc/manuals/dc/EN.1 index 03cb5743602c..5ce8defc91c7 100644 --- a/contrib/bc/manuals/dc/EN.1 +++ b/contrib/bc/manuals/dc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EN.1.md b/contrib/bc/manuals/dc/EN.1.md index 64c945be8857..ab9647a196be 100644 --- a/contrib/bc/manuals/dc/EN.1.md +++ b/contrib/bc/manuals/dc/EN.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/H.1 b/contrib/bc/manuals/dc/H.1 index 36f7458a3316..82c1bbd5c2b9 100644 --- a/contrib/bc/manuals/dc/H.1 +++ b/contrib/bc/manuals/dc/H.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1275,11 +1275,14 @@ handler for, it resets. *** 1274 LINES SKIPPED *** From nobody Tue Sep 3 16:29:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyrgq5vYZz5TXCG; Tue, 03 Sep 2024 16:29: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 4Wyrgq51Krz3yB3; Tue, 3 Sep 2024 16:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725380999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wGsY7aP0QrsEiAhAMfENWpAnfRCFmJ1/bMp6Uk+sBSY=; b=OSdXk/irA9ihSuUc6wpkxmMEB7pJFwzjU7t7f4+bjFDW17VWpLRnz9mqaUC5QhTJ3ubxJb JHb3Fd3ORU7o1gCPH2t2LBuXSDb2aphai+wNwNj/1F56TsdPwbrq0+LSRsl2Got1AXFLAt NCHIa/+Y4Us087BUPFguate+9S9yNb0KVUxXDv/I/yXRsILGRFmM8l3Yk/tax9A1DsjTog rchA8bfG5Fm6P1KBijshGYGJqiesSjeLlKdHR+jO3h3RXHmVyNJr6CJuov6C3+BICyk2N2 NffboGHxg5INrXcKEgELQE7csgH/tcsTgb0SURGhh3idqYkMKbtpxhJzzGimWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725380999; a=rsa-sha256; cv=none; b=wtTenjb9neKGzFyo+pQmfWARBfaLhoFryK/v/Vh/5jw4YtZzTeY0lB3+wk8xoQ3f08WFSh kip1XAFbvLwH/e/C1/yOWMXiyX1rVomF8koL7ksvGThJD7VF6gPuuhPQ59Mf7h7tAD3MZ+ 7a7nXEH/9SQXg+wTAbZIvirS1nxlWY4g0KD9AgBltpoQzF3QZYtTGYxYTpFiPyQXOGxNMA tiIHO+mtz6jGF+nmURJRN6NdmxGTpc02hOuwGDKyxnuv13iF5NlmGwPbyVBp5HgP645jNi 5qe7OCm3cp9lMsKIjlxhX/JfJ8WDTetQkxV5VEsmeShU8DzZcJrlfCGGxyfpsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725380999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wGsY7aP0QrsEiAhAMfENWpAnfRCFmJ1/bMp6Uk+sBSY=; b=xwUFw0aiepHabL6jhtElp6DfkYDtFfqcggzwPSVv2NduZ/16PIcyzlp1Otkf8YzjhtloH5 9HCer5pbL4ftV9+U62WgZEsRDUSOE4lzZllmFTb4klbVu8tJEFnqx5/FhHx+7XxRAPMDsz VCMDcapatjPvifSW8xKzyih7SbRqltMIri3cAgHN5PmjWZv4VCgT7pwH85o7FwvGEJ61FF cfVqwszmCu9GzpMYqBd/zgZboXTidgmPy3nCqZLnIV55zcT0xJG7syVuqQ9JoZ9GraeAC4 qjx0LjA3gI9nG4sDto5DB/YJ3yLyhnQWaNJy+/N8tfzU/yJZ6YgV4CsW5ANCWQ== 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 4Wyrgq4dm0znmS; Tue, 3 Sep 2024 16:29: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 483GTxK3024990; Tue, 3 Sep 2024 16:29:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GTxCf024987; Tue, 3 Sep 2024 16:29:59 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:29:59 GMT Message-Id: <202409031629.483GTxCf024987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 06bb8e1dab00 - stable/14 - contrib/bc: fix build with GCC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 06bb8e1dab004ccb283f7a20fe84aa1326baf6b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=06bb8e1dab004ccb283f7a20fe84aa1326baf6b7 commit 06bb8e1dab004ccb283f7a20fe84aa1326baf6b7 Author: Stefan Eßer AuthorDate: 2024-08-27 07:11:58 +0000 Commit: Stefan Eßer CommitDate: 2024-09-03 16:28:14 +0000 contrib/bc: fix build with GCC Building with GCC failed with the following error message: error: to be safe all intermediate pointers in cast from 'char **' to 'const char **' must be 'const' qualified [-Werror=cast-qual] This was caused by main() being declared with "char *argv[]" as the 3rd parameter, but argv later being passed cast to "const char**": 113 | if (BC_IS_BC) s = bc_main(argc, (const char**) argv); | ^ This is fixed by declaring the 3rd parameter of main() as "const char *argv[]". Reported by: CI MFC after: 3 days (cherry picked from commit ef5752762ba9ec54d5c02023167d24bcdbb45fd7) vendor/bc: upgrade to version 7.0.1 This update fixes building bc on FreeBSD with non-default compilers (GCC-12, GCC-13). GCC warned about casting argv from non-const to const and since warnings are treated as errors, the build failed. (cherry picked from commit 1e19146fc7692f59e8dfc5da7957e938cd0b81b8) (cherry picked from commit 5b0dc991093c82824f6fe566af947f64f5072264) --- contrib/bc/NEWS.md | 6 ++++++ contrib/bc/include/version.h | 2 +- contrib/bc/src/main.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 1775fa0b6533..8156b673ce04 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,11 @@ # News +## 7.0.1 + +This is a production release that fixes a warning using GCC on FreeBSD. + +Other users do ***NOT*** need to upgrade. + ## 7.0.0 This is a production release to fix three bugs. diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 897a19530e3f..4d2f6acfb433 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 7.0.0 +#define VERSION 7.0.1 #endif // BC_VERSION_H diff --git a/contrib/bc/src/main.c b/contrib/bc/src/main.c index e4a1f7399bb4..da4c27156029 100644 --- a/contrib/bc/src/main.c +++ b/contrib/bc/src/main.c @@ -54,7 +54,7 @@ #include int -main(int argc, char* argv[]) +main(int argc, const char* argv[]) { BcStatus s; char* name; From nobody Tue Sep 3 16:34:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyrnF23ynz5TXJd; Tue, 03 Sep 2024 16:34: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 4WyrnF1lXxz417b; Tue, 3 Sep 2024 16:34:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725381281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yuXhPC6MooeYhhviMAcNcYio0RSEKCSTixvohgCx0fg=; b=UHaxkGfsdcS9pc3srEDfpyOnbYUQRiXzwFEMh/WoZWaIr1mQrAzAMIRAvHSuAGADfT3GrP AzIeVkhsJZ49RHW8sQwZr7J71VSttuJRb49xh7x6sJJWaPsZ0OaVK58zh4/0yC4/qpDy3p dwHhd2MIjICHGNtCSIDdTVhwl6C2pVM+YwpkU46aGt2GRKibnMJh4Gve+DhuZggi5H48Sm CO3Xgf0iJkwxmQ8S4Rwhei848jQMUhLAGjkyHYblSFcJHlIy7t5sygWWWS4niJszMIj4eL RQh2ZU7Cy66yWzHAZMzZ+oH1Foj7hGgvU0RL1H5j3ZNtgiPVfORaVeUwz0MEzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725381281; a=rsa-sha256; cv=none; b=ZtNIgS0s5hICts35eYgh9iHgqyJePCVNoX5v+Lxq/pweW7fHBfknTBGUwEfK+ezGZhCG0F cY0lqAV00DJ4A8aipB+9f2o5149RsGjVoZIZKGK7TkaSyx64XH9tL++kaIU7mUJlj91jt4 gwHr8bIbgE4SjZbo6nluqwFC8LkM3NupMKTlQ5ruqA6FbyKfTl4gv++YsdMSK9F50pUaqK i0LjYxDSAKNmFHveM9Dbv0B7/GPt8268CCopSJDG+7054523ukvrsThc86BVbtTPwo64t0 Qpx+yFlKtOUp0gAgfJH5gaPORzqUOJnfsd6LJ5D14YVgJ8f7cecF+s+hZms2Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725381281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yuXhPC6MooeYhhviMAcNcYio0RSEKCSTixvohgCx0fg=; b=rQ5A7EMI+abdAywoQUBJ6RpIUhk1mzD8PW/LIYnqZ2OzcWtEcU+gu0OoqU9zccSeKTck+c HBtrNf4XWocXoH6jygceiAp+AftDCmmXZHngED2yoK6vlJ3VtofTcHexVpDf/B6TKZItYz K1TLgx0mIjbW25208POQLuCHGst6AVRUx3oHvws+pr5X+1wm7y1lQKSJGyUst+1C5HgNJx oCQ8tyKPJp8piblkF7GDPeu1f6j61+gCXqVd5ks6KzC8PsQUrVZwq5kmyfK89iB7XWRrAf OyBHb1eS3K5waqy6Vi54wvvLzK5F3z7s9NLzFPu9UkTH53IMSxMUqzcHOgMnlA== 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 4WyrnF1LYsznnL; Tue, 3 Sep 2024 16:34: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 483GYfNK041002; Tue, 3 Sep 2024 16:34:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GYf8e040999; Tue, 3 Sep 2024 16:34:41 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:34:41 GMT Message-Id: <202409031634.483GYf8e040999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 1d669b3d15bc - stable/13 - vendor/bc: upgrade to version 7.0.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1d669b3d15bcbb38bbec8023a370b7a56e85a26d Auto-Submitted: auto-generated The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=1d669b3d15bcbb38bbec8023a370b7a56e85a26d commit 1d669b3d15bcbb38bbec8023a370b7a56e85a26d Author: Stefan Eßer AuthorDate: 2024-08-23 16:45:58 +0000 Commit: Stefan Eßer CommitDate: 2024-09-03 16:30:44 +0000 vendor/bc: upgrade to version 7.0.0 This is a production release to fix three bugs, none of which affects well formed scripts on FreeBSD: The first bug is that bc/dc will exit on macOS when the terminal is resized. The second bug is that an array, which should only be a function parameter, was accepted as part of larger expressions. The third bug is that the value stack for dc was cleared on any error. However, this is not how other dc behave. To bring dc more in line with other implementations, this behavior was changed. This change is why this version is a new major version. (cherry picked from commit 54d20d67e2af28d948ce2df13feb039fa10900fc) (cherry picked from commit 12e0d316644a4f80f5f1f78cf07bd93def43b1ca) --- contrib/bc/Makefile.in | 10 +++- contrib/bc/NEWS.md | 14 +++++ contrib/bc/compile_flags.txt | 1 + contrib/bc/configure.sh | 120 ++++++++++++++++++++++++++++++-------- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/opt.h | 6 +- contrib/bc/include/ossfuzz.h | 79 +++++++++++++++++++++++++ contrib/bc/include/status.h | 25 ++------ contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 2 +- contrib/bc/manuals/dc/A.1 | 7 ++- contrib/bc/manuals/dc/A.1.md | 9 ++- contrib/bc/manuals/dc/E.1 | 7 ++- contrib/bc/manuals/dc/E.1.md | 9 ++- contrib/bc/manuals/dc/EH.1 | 7 ++- contrib/bc/manuals/dc/EH.1.md | 9 ++- contrib/bc/manuals/dc/EHN.1 | 7 ++- contrib/bc/manuals/dc/EHN.1.md | 9 ++- contrib/bc/manuals/dc/EN.1 | 7 ++- contrib/bc/manuals/dc/EN.1.md | 9 ++- contrib/bc/manuals/dc/H.1 | 7 ++- contrib/bc/manuals/dc/H.1.md | 9 ++- contrib/bc/manuals/dc/HN.1 | 7 ++- contrib/bc/manuals/dc/HN.1.md | 9 ++- contrib/bc/manuals/dc/N.1 | 7 ++- contrib/bc/manuals/dc/N.1.md | 9 ++- contrib/bc/scripts/os.c | 59 +++++++++++++++++++ contrib/bc/src/args.c | 4 +- contrib/bc/src/bc.c | 3 +- contrib/bc/src/bc_fuzzer.c | 112 +++++++++++++++++++++++++++++++++++ contrib/bc/src/bc_lex.c | 2 + contrib/bc/src/bc_parse.c | 23 +++++++- contrib/bc/src/data.c | 59 +++++++++++++++++++ contrib/bc/src/dc.c | 3 +- contrib/bc/src/dc_fuzzer.c | 112 +++++++++++++++++++++++++++++++++++ contrib/bc/src/dc_lex.c | 2 + contrib/bc/src/history.c | 2 +- contrib/bc/src/lang.c | 4 +- contrib/bc/src/lex.c | 8 +++ contrib/bc/src/main.c | 21 +++++-- contrib/bc/src/num.c | 4 ++ contrib/bc/src/opt.c | 14 ++--- contrib/bc/src/program.c | 13 +++-- contrib/bc/src/vm.c | 38 ++++++++++-- contrib/bc/tests/bc/errors/37.txt | 37 ++++++++++++ contrib/bc/tests/bc/errors/38.txt | 37 ++++++++++++ contrib/bc/vs/bc.vcxproj | 18 +++--- include/ossfuzz.h | 79 +++++++++++++++++++++++++ 50 files changed, 914 insertions(+), 133 deletions(-) diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 4adb76ddaa17..c63dc242e79a 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -94,6 +94,10 @@ BC = bc DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +BC_FUZZER = $(BIN)/$(BC)_fuzzer_c +BC_FUZZER_C = $(BIN)/$(BC)_fuzzer_C +DC_FUZZER = $(BIN)/$(DC)_fuzzer_c +DC_FUZZER_C = $(BIN)/$(DC)_fuzzer_C BC_TEST_OUTPUTS = tests/bc_outputs BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 @@ -149,8 +153,11 @@ BC_ENABLE_NLS = %%NLS%% BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%% BC_ENABLE_AFL = %%FUZZ%% +BC_ENABLE_OSSFUZZ = %%OSSFUZZ%% BC_ENABLE_MEMCHECK = %%MEMCHECK%% +LIB_FUZZING_ENGINE = %%LIB_FUZZING_ENGINE%% + BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%% BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%% DC_DEFAULT_SIGINT_RESET = %%DC_DEFAULT_SIGINT_RESET%% @@ -210,7 +217,8 @@ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) -CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS9 = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS = $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ) CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 95de7e5182c4..1775fa0b6533 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,19 @@ # News +## 7.0.0 + +This is a production release to fix three bugs. + +The first bug is that `bc`/`dc` will exit on macOS when the terminal is resized. + +The second bug is that an array, which should only be a function parameter, was +accepted as part of larger expressions. + +The third bug is that value stack for `dc` was cleared on any error. However, +this is not how other `dc` behave. To bring `dc` more in line with other +implementations, this behavior was changed. This change is why this version is a +new major version. + ## 6.7.6 This is a production release to fix one bug. diff --git a/contrib/bc/compile_flags.txt b/contrib/bc/compile_flags.txt index 7a08c87f3876..3324798013c6 100644 --- a/contrib/bc/compile_flags.txt +++ b/contrib/bc/compile_flags.txt @@ -13,3 +13,4 @@ -DBC_ENABLE_EXTRA_MATH=1 -DBC_ENABLE_HISTORY=1 -DBC_ENABLE_NLS=1 +-DBC_ENABLE_OSSFUZZ=0 diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index 43bb502ea817..442165d15693 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -68,7 +68,7 @@ usage() { printf ' [--man3dir=MAN3DIR]\n' if [ "$_usage_val" -ne 0 ]; then - exit + exit "$_usage_val" fi printf '\n' @@ -181,6 +181,8 @@ usage() { printf ' Enable a build appropriate for valgrind. For development only.\n' printf ' -z, --enable-fuzz-mode\n' printf ' Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n' + printf ' -Z, --enable-ossfuzz-mode\n' + printf ' Enable fuzzing mode for OSS-Fuzz. THIS IS FOR DEVELOPMENT ONLY.\n' printf ' --prefix PREFIX\n' printf ' The prefix to install to. Overrides "$PREFIX" if it exists.\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' @@ -722,6 +724,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -755,6 +758,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -772,7 +776,8 @@ predefined_build() { dc_default_digit_clamp=0;; GDH) - CFLAGS="-flto -Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories" + CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -789,6 +794,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -806,7 +812,8 @@ predefined_build() { dc_default_digit_clamp=1;; DBG) - CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories" + CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -823,6 +830,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=1 @@ -888,6 +896,7 @@ strip_bin=1 all_locales=0 library=0 fuzz=0 +ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -911,7 +920,7 @@ dc_default_digit_clamp=0 # getopts is a POSIX utility, but it cannot handle long options. Thus, the # handling of long options is done by hand, and that's the reason that short and # long options cannot be mixed. -while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do +while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do case "$opt" in a) library=1 ;; @@ -944,6 +953,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do T) strip_bin=0 ;; v) vg=1 ;; z) fuzz=1 ;; + Z) ossfuzz=1 ;; -) arg="$1" arg="${arg#--}" @@ -1070,6 +1080,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do enable-test-timing) time_tests=1 ;; enable-valgrind) vg=1 ;; enable-fuzz-mode) fuzz=1 ;; + enable-ossfuzz-mode) ossfuzz=1 ;; enable-memcheck) memcheck=1 ;; install-all-locales) all_locales=1 ;; help* | bc-only* | dc-only* | coverage* | debug*) @@ -1320,6 +1331,45 @@ elif [ "$dc_only" -eq 1 ]; then tests="test_dc" +elif [ "$ossfuzz" -eq 1 ]; then + + if [ "$bc_only" -ne 0 ] || [ "$dc_only" -ne 0 ]; then + usage "An OSS-Fuzz build must build both fuzzers." + fi + + bc=1 + dc=1 + + # Expressions *cannot* exit in an OSS-Fuzz build. + bc_default_expr_exit=0 + dc_default_expr_exit=0 + + executables="bc_fuzzer and dc_fuzzer" + + karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" + karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" + + if [ "$library" -eq 0 ]; then + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + else + install_prereqs=" install_library install_bcl_header" + install_man_prereqs=" install_bcl_manpage" + uninstall_prereqs=" uninstall_library uninstall_bcl_header" + uninstall_man_prereqs=" uninstall_bcl_manpage" + tests="test_library" + fi + + second_target_prereqs="src/bc_fuzzer.o $default_target_prereqs" + default_target_prereqs="\$(BC_FUZZER) src/dc_fuzzer.o $default_target_prereqs" + default_target_cmd="\$(CXX) \$(CFLAGS) src/dc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(DC_FUZZER) \&\& ln -sf ./dc_fuzzer_c \$(DC_FUZZER_C)" + second_target_cmd="\$(CXX) \$(CFLAGS) src/bc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(BC_FUZZER) \&\& ln -sf ./bc_fuzzer_c \$(BC_FUZZER_C)" + + default_target="\$(DC_FUZZER) \$(DC_FUZZER_C)" + second_target="\$(BC_FUZZER) \$(BC_FUZZER_C)" + else bc=1 @@ -1349,8 +1399,12 @@ else fi +if [ "$fuzz" -ne 0 ] && [ "$ossfuzz" -ne 0 ]; then + usage "Fuzzing mode and OSS-Fuzz mode are mutually exclusive" +fi + # We need specific stuff for fuzzing. -if [ "$fuzz" -ne 0 ]; then +if [ "$fuzz" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then debug=1 hist=0 nls=0 @@ -1395,7 +1449,6 @@ else COVERAGE_PREREQS="" fi - # Set some defaults. if [ -z "${DESTDIR+set}" ]; then destdir="" @@ -1485,8 +1538,8 @@ if [ "$nls" -ne 0 ]; then flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" flags="$flags -DBC_ENABLE_HISTORY=$hist -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0" - flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0" + flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" ccbase=$(basename "$CC") @@ -1494,14 +1547,14 @@ if [ "$nls" -ne 0 ]; then flags="$flags -Wno-unreachable-code" fi - "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -o "./vm.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -E > /dev/null err="$?" rm -rf "./vm.o" - # If this errors, it is probably because of building on Windows, - # and NLS is not supported on Windows, so disable it. + # If this errors, it is probably because of building on Windows or musl, + # and NLS is not supported on Windows or musl, so disable it. if [ "$err" -ne 0 ]; then printf 'NLS does not work.\n' if [ $force -eq 0 ]; then @@ -1514,7 +1567,7 @@ if [ "$nls" -ne 0 ]; then printf 'NLS works.\n\n' printf 'Testing gencat...\n' - gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null 2>&1 + gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null err="$?" @@ -1587,10 +1640,10 @@ if [ "$hist" -eq 1 ]; then flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0" flags="$flags -DBC_ENABLE_EDITLINE=$editline -DBC_ENABLE_READLINE=$readline" - flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0" + flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -o "./history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -E > /dev/null err="$?" @@ -1660,7 +1713,7 @@ set +e printf 'Testing for FreeBSD...\n' flags="-DBC_TEST_FREEBSD -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1677,7 +1730,7 @@ fi printf 'Testing for macOS...\n' flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1705,7 +1758,7 @@ fi printf 'Testing for OpenBSD...\n' flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1741,7 +1794,7 @@ GEN_DIR="$scriptdir/gen" # These lines set the appropriate targets based on whether `gen/strgen.c` or # `gen/strgen.sh` is used. GEN="strgen" -GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)" +GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -DBC_ENABLE_OSSFUZZ=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)" CLEAN_PREREQS=" clean_gen clean_coverage" if [ -z "${GEN_HOST+set}" ]; then @@ -1754,8 +1807,9 @@ else fi fi +# The fuzzer files are always unneeded because they'll be built separately. manpage_args="" -unneeded="" +unneeded="bc_fuzzer.c dc_fuzzer.c" headers="\$(HEADERS)" # This series of if statements figure out what source files are *not* needed. @@ -1826,6 +1880,14 @@ if [ "$library" -ne 0 ]; then fi +elif [ "$ossfuzz" -ne 0 ]; then + + unneeded="$unneeded library.c main.c" + + PC_PATH="" + pkg_config_install="" + pkg_config_uninstall="" + else unneeded="$unneeded library.c" @@ -1836,9 +1898,10 @@ else fi -# library.c is not needed under normal circumstances. +# library.c, bc_fuzzer.c, and dc_fuzzer.c are not needed under normal +# circumstances. if [ "$unneeded" = "" ]; then - unneeded="library.c" + unneeded="library.c bc_fuzzer.c dc_fuzzer.c" fi # This sets the appropriate manpage for a full build. @@ -1846,7 +1909,7 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi -if [ "$vg" -ne 0 ]; then +if [ "$vg" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then memcheck=1 fi @@ -2011,7 +2074,9 @@ contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") contents=$(replace "$contents" "FUZZ" "$fuzz") +contents=$(replace "$contents" "OSSFUZZ" "$ossfuzz") contents=$(replace "$contents" "MEMCHECK" "$memcheck") +contents=$(replace "$contents" "LIB_FUZZING_ENGINE" "$LIB_FUZZING_ENGINE") contents=$(replace "$contents" "BC_LIB_O" "$bc_lib") contents=$(replace "$contents" "BC_HELP_O" "$bc_help") @@ -2117,6 +2182,15 @@ if [ "$dc" -ne 0 ]; then gen_err_tests dc $dc_test_exec fi +if [ "$ossfuzz" -ne 0 ]; then + + printf 'bc_fuzzer_c: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_c\n' >> Makefile + printf 'bc_fuzzer_C: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_C\n' >> Makefile + printf 'dc_fuzzer_c: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_c\n' >> Makefile + printf 'dc_fuzzer_C: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_C\n' >> Makefile + +fi + # Copy the correct manuals to the expected places. mkdir -p manuals cp -f "$scriptdir/manuals/bc/$manpage_args.1.md" manuals/bc.1.md diff --git a/contrib/bc/include/args.h b/contrib/bc/include/args.h index f1e9f007bddf..8f8f00be4630 100644 --- a/contrib/bc/include/args.h +++ b/contrib/bc/include/args.h @@ -54,7 +54,7 @@ * any. */ void -bc_args(int argc, char* argv[], bool exit_exprs, BcBigDig* scale, +bc_args(int argc, const char* argv[], bool exit_exprs, BcBigDig* scale, BcBigDig* ibase, BcBigDig* obase); #if BC_ENABLED diff --git a/contrib/bc/include/bc.h b/contrib/bc/include/bc.h index b25df09a174e..2213278be1da 100644 --- a/contrib/bc/include/bc.h +++ b/contrib/bc/include/bc.h @@ -51,7 +51,7 @@ * @return A status. */ BcStatus -bc_main(int argc, char* argv[]); +bc_main(int argc, const char* argv[]); // These are references to the help text, the library text, and the "filename" // for the library. diff --git a/contrib/bc/include/dc.h b/contrib/bc/include/dc.h index 1328f1c63b38..63f5ccbd10e3 100644 --- a/contrib/bc/include/dc.h +++ b/contrib/bc/include/dc.h @@ -48,7 +48,7 @@ * @return A status. */ BcStatus -dc_main(int argc, char* argv[]); +dc_main(int argc, const char* argv[]); // A reference to the dc help text. extern const char dc_help[]; diff --git a/contrib/bc/include/opt.h b/contrib/bc/include/opt.h index e60328994d8c..41058cb4e29c 100644 --- a/contrib/bc/include/opt.h +++ b/contrib/bc/include/opt.h @@ -47,7 +47,7 @@ typedef struct BcOpt { /// The array of arguments. - char** argv; + const char** argv; /// The index of the current argument. size_t optind; @@ -59,7 +59,7 @@ typedef struct BcOpt int subopt; /// The option argument. - char* optarg; + const char* optarg; } BcOpt; @@ -103,7 +103,7 @@ typedef struct BcOptLong * @param argv The array of arguments. */ void -bc_opt_init(BcOpt* o, char** argv); +bc_opt_init(BcOpt* o, const char** argv); /** * Parse an option. This returns a value the same way getopt() and getopt_long() diff --git a/contrib/bc/include/ossfuzz.h b/contrib/bc/include/ossfuzz.h new file mode 100644 index 000000000000..5c12a3c9c9fb --- /dev/null +++ b/contrib/bc/include/ossfuzz.h @@ -0,0 +1,79 @@ +/* + * ***************************************************************************** + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018-2024 Gavin D. Howard and contributors. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * ***************************************************************************** + * + * Declarations for the OSS-Fuzz build of bc and dc. + * + */ + +#include +#include + +#ifndef BC_OSSFUZZ_H +#define BC_OSSFUZZ_H + +/// The number of args in fuzzer arguments, including the NULL terminator. +extern const size_t bc_fuzzer_args_len; + +/// The standard arguments for the bc fuzzer with the -c argument. +extern const char* bc_fuzzer_args_c[]; + +/// The standard arguments for the bc fuzzer with the -C argument. +extern const char* bc_fuzzer_args_C[]; + +/// The standard arguments for the dc fuzzer with the -c argument. +extern const char* dc_fuzzer_args_c[]; + +/// The standard arguments for the dc fuzzer with the -C argument. +extern const char* dc_fuzzer_args_C[]; + +/// The data pointer. +extern uint8_t* bc_fuzzer_data; + +/** + * The function that the fuzzer runs. + * @param Data The data. + * @param Size The number of bytes in @a Data. + * @return 0 on success, -1 on error. + * @pre @a Data must not be equal to NULL if @a Size > 0. + */ +int +LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size); + +/** + * The initialization function for the fuzzer. + * @param argc A pointer to the argument count. + * @param argv A pointer to the argument list. + * @return 0 on success, -1 on error. + */ +int +LLVMFuzzerInitialize(int* argc, char*** argv); + +#endif // BC_OSSFUZZ_H diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index f579df8c649b..203f09af628b 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -46,27 +46,6 @@ #include #include -// This is used by configure.sh to test for OpenBSD. -#ifdef BC_TEST_OPENBSD -#ifdef __OpenBSD__ -#error On OpenBSD without _BSD_SOURCE -#endif // __OpenBSD__ -#endif // BC_TEST_OPENBSD - -// This is used by configure.sh to test for FreeBSD. -#ifdef BC_TEST_FREEBSD -#ifdef __FreeBSD__ -#error On FreeBSD with _POSIX_C_SOURCE -#endif // __FreeBSD__ -#endif // BC_TEST_FREEBSD - -// This is used by configure.sh to test for macOS. -#ifdef BC_TEST_APPLE -#ifdef __APPLE__ -#error On macOS without _DARWIN_C_SOURCE -#endif // __APPLE__ -#endif // BC_TEST_APPLE - // Windows has deprecated isatty() and the rest of these. Or doesn't have them. // So these are just fixes for Windows. #ifdef _WIN32 @@ -676,9 +655,13 @@ typedef enum BcMode /// File mode. BC_MODE_FILE, +#if !BC_ENABLE_OSSFUZZ + /// stdin mode. BC_MODE_STDIN, +#endif // !BC_ENABLE_OSSFUZZ + } BcMode; /// Do a longjmp(). This is what to use when activating an "exception", i.e., a diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 586691a6e7ef..897a19530e3f 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.7.6 +#define VERSION 7.0.0 #endif // BC_VERSION_H diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 052c1d14c237..e81206b63871 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -794,7 +794,7 @@ bc_vm_info(const char* const help); * @return A status. */ BcStatus -bc_vm_boot(int argc, char* argv[]); +bc_vm_boot(int argc, const char* argv[]); /** * Initializes some of the BcVm global. This is separate to make things easier diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index 33ecb8e2031e..d59e0fa68a58 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1275,11 +1275,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index 613f98f76814..ad0c59934fd1 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -1130,11 +1130,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/E.1 b/contrib/bc/manuals/dc/E.1 index 91f68dfd7467..a5febe44705f 100644 --- a/contrib/bc/manuals/dc/E.1 +++ b/contrib/bc/manuals/dc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/E.1.md b/contrib/bc/manuals/dc/E.1.md index 3a47f789bd3e..54b877999d0d 100644 --- a/contrib/bc/manuals/dc/E.1.md +++ b/contrib/bc/manuals/dc/E.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EH.1 b/contrib/bc/manuals/dc/EH.1 index e60e6e0d8497..61fbaa4efe92 100644 --- a/contrib/bc/manuals/dc/EH.1 +++ b/contrib/bc/manuals/dc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EH.1.md b/contrib/bc/manuals/dc/EH.1.md index 761b9a89947b..6398477a84dd 100644 --- a/contrib/bc/manuals/dc/EH.1.md +++ b/contrib/bc/manuals/dc/EH.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EHN.1 b/contrib/bc/manuals/dc/EHN.1 index d26d49c5ce3d..974cb3c86791 100644 --- a/contrib/bc/manuals/dc/EHN.1 +++ b/contrib/bc/manuals/dc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EHN.1.md b/contrib/bc/manuals/dc/EHN.1.md index 58ae149bb686..51e30849996e 100644 --- a/contrib/bc/manuals/dc/EHN.1.md +++ b/contrib/bc/manuals/dc/EHN.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EN.1 b/contrib/bc/manuals/dc/EN.1 index 03cb5743602c..5ce8defc91c7 100644 --- a/contrib/bc/manuals/dc/EN.1 +++ b/contrib/bc/manuals/dc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EN.1.md b/contrib/bc/manuals/dc/EN.1.md index 64c945be8857..ab9647a196be 100644 --- a/contrib/bc/manuals/dc/EN.1.md +++ b/contrib/bc/manuals/dc/EN.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/H.1 b/contrib/bc/manuals/dc/H.1 index 36f7458a3316..82c1bbd5c2b9 100644 --- a/contrib/bc/manuals/dc/H.1 +++ b/contrib/bc/manuals/dc/H.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1275,11 +1275,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the *** 1271 LINES SKIPPED *** From nobody Tue Sep 3 16:34:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyrnG47mGz5TXSl; Tue, 03 Sep 2024 16:34: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 4WyrnG2N0Hz41Gl; Tue, 3 Sep 2024 16:34:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725381282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQv7krdW8H6QCAUBNFwTlCqdCh7iuHZ4UZvGyBWqu5Y=; b=YL1OcT+MKaPvCVBvkTSTpQaAKKl8HwqiokNJ1+420xiKSUJ1sKPcnjjor/1ym3PCtEx7j2 itjCk6Kpu64h0KoDA6g8s8nZbn9n7leejSN7Dx/axGsUQJ+ZIQgJiUCgV40izGcKygED7W ZW1rB7OLPE0Onpdh68WsrC1NYx9kiWjY36/llLtEirsKDd5MugtwsZgyo9/tYYNEq/9UeL mYh6L1kXb9V8jZ0uMwbW3xWguR1ZnBVLEZlFqdqk3AUKROre792385WtSGRbxdm6LXzFtX 6aEhkPh+fCTKXlUSZtbNHrmBOZCoj1b9lFh6gRN86LlQCs9NHYhfZqPZie35pQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725381282; a=rsa-sha256; cv=none; b=inJtzEOg4I2tf28cqp+EPcSBDWeN1Q47tPdp14OyacdGc0kVubvm0bEJ9gb386cKcPknlJ hPU692IQd9Woiv+FCJqbjsMHQpUkagTRj6bzQakGjOR8wNp6aFpwN565/74zM+DOSbz5ak ucUHFd24RPKTnKm9gHKaOW7C8DlXiln4qBZQ6oJBMWWB/EWORN4PYXOGhe+dpfnVH+hbmX Bq5EWZcudsXHwQPEoVgBP9dK9UEmtnylpHYBOhzdoZgRC/8BlC3LV+mvpYhGYW2NIRb5J9 rXqSBKiNP3e4OmMXz2VpjYUBFMKh5uDPYd4PjNYOFB9Tg/qqqn/4zuRW85Jh7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725381282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQv7krdW8H6QCAUBNFwTlCqdCh7iuHZ4UZvGyBWqu5Y=; b=P8tkLY/pd/wlLbD81UGsMkPJbavChvdD+MZeItiOXqrz+Fc+PSH6EStnZS+frxcTrqZakU YgEIhZW2x9Ad4zdrDeT7nmSKt8MwGLQ6afULguMI/JM0bUZGsBqyLzK0JFaGKF0KSsT6cw telrDq4YMzY9OUEvqZzYueTVqNIxvZfZ3JyXXULXTExcimzLPMFEd5vZKW7owsoljU/3IV Oglmq3AlNwkjI6pu664Y8isqW4pcYLDxws/fG0+TFxpdTTIAhzuFBm0wpRCKxLT8R78ewx ZZCt2ApobeTPOyQTZNcJMnxyvYzdNgW7I7q4j0Q5d4gS5AsvhdLysLIffszvRA== 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 4WyrnG1znKznnM; Tue, 3 Sep 2024 16:34: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 483GYghf041047; Tue, 3 Sep 2024 16:34:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GYgRu041044; Tue, 3 Sep 2024 16:34:42 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:34:42 GMT Message-Id: <202409031634.483GYgRu041044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 69b23cb4b029 - stable/13 - contrib/bc: fix build with GCC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 69b23cb4b029d4e1e67a681ec0db76f42ebd6b64 Auto-Submitted: auto-generated The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=69b23cb4b029d4e1e67a681ec0db76f42ebd6b64 commit 69b23cb4b029d4e1e67a681ec0db76f42ebd6b64 Author: Stefan Eßer AuthorDate: 2024-08-27 07:11:58 +0000 Commit: Stefan Eßer CommitDate: 2024-09-03 16:33:48 +0000 contrib/bc: fix build with GCC Building with GCC failed with the following error message: error: to be safe all intermediate pointers in cast from 'char **' to 'const char **' must be 'const' qualified [-Werror=cast-qual] This was caused by main() being declared with "char *argv[]" as the 3rd parameter, but argv later being passed cast to "const char**": 113 | if (BC_IS_BC) s = bc_main(argc, (const char**) argv); | ^ This is fixed by declaring the 3rd parameter of main() as "const char *argv[]". Reported by: CI (cherry picked from commit ef5752762ba9ec54d5c02023167d24bcdbb45fd7) vendor/bc: upgrade to version 7.0.1 This update fixes building bc on FreeBSD with non-default compilers (GCC-12, GCC-13). GCC warned about casting argv from non-const to const and since warnings are treated as errors, the build failed. (cherry picked from commit 1e19146fc7692f59e8dfc5da7957e938cd0b81b8) (cherry picked from commit 5b0dc991093c82824f6fe566af947f64f5072264) --- contrib/bc/NEWS.md | 6 ++++++ contrib/bc/include/version.h | 2 +- contrib/bc/src/main.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 1775fa0b6533..8156b673ce04 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,11 @@ # News +## 7.0.1 + +This is a production release that fixes a warning using GCC on FreeBSD. + +Other users do ***NOT*** need to upgrade. + ## 7.0.0 This is a production release to fix three bugs. diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 897a19530e3f..4d2f6acfb433 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 7.0.0 +#define VERSION 7.0.1 #endif // BC_VERSION_H diff --git a/contrib/bc/src/main.c b/contrib/bc/src/main.c index e4a1f7399bb4..da4c27156029 100644 --- a/contrib/bc/src/main.c +++ b/contrib/bc/src/main.c @@ -54,7 +54,7 @@ #include int -main(int argc, char* argv[]) +main(int argc, const char* argv[]) { BcStatus s; char* name; From nobody Tue Sep 3 16:47:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wys3X0MGXz5TYxP for ; Tue, 03 Sep 2024 16:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wys3W53Drz444g; Tue, 3 Sep 2024 16:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725382023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QyBQpekP10s3YJYDWKn7s5CTgnXV7zdIjxDXnlkdLi4=; b=TUdEMFtN4iekZR1DZrCK2qfVx+fWr6LPY3+YBrTxvbAyuEcV+MLWr6gn2J2pCg5YdM2CFc xLu2+4pYISfYG7HX0g5EjjFxrcaHtS7n2x5K/DwvGu18Zvab05BIeo7FlKyirvP8QogJK3 prQ2VbyLCoSZtzBICAjfMBFEUdvQlDHalnTsZiVnuIfpb+87UdBWguiX4FfCzpP1jWply+ CZPknWUpI16oiELwMFZyzqrH6098STqfqMiv/IN8XmvTjH+fY6NML5KLVluKyRH12MBxEN tYk+VirXnMK7hsZ2ghFHqnEcVL4bPexKCjnm7nvHjgj5toHmwceZbRCd3zmDYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725382023; a=rsa-sha256; cv=none; b=tGbpb/vywtuZIlrTSxPiFxYGcD+zvKJTaJE7msue3b4aXoY33Coh7U1Jd/QaRsWv5gCCHQ 99vuD7h3dVXgizfaxeCfKusm8wzup5M3z6tJMcSUHSY6//AUOnA29FStmlm25W8OeQwSlC qlgwX7hHyKqWk/9Nj1HvpT+HXIoos6C8vKGMIpXCH2CNUJKXIY5NXx7W3HToKysbCqaYye 9gdV6I4pgRN4AxMqaPcobTwcSYATQ7v/wKTw3VniNYOt0ejtHA0W+ajWWTe20qK4C15CvS MPDQEW8hfx3Yn/mFAx45pzWv7Wcz/L7hkUyG2Nbp3nZTfHry5WN2wSxvyYYblA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725382023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QyBQpekP10s3YJYDWKn7s5CTgnXV7zdIjxDXnlkdLi4=; b=d1bfPObYOGiEeBOuGSVDzd+tVvKgb4CM7mhvaCN/vkwrJMonNQOKb5soaNggtz9vtlidev kS5+OtX6EHau2RAZV95NbCB49+XYzE4fbeclgE9u2R4jT0TxNu+9n8xviENRsSak9v7k90 yF0CnDHKxm6y83TVWSVrVG2C20yjF9ufU/i9B3uN6jFBSVyTDsPsq4/EgAdoXv0efUR0UT cxzRenB264h1WURfU5jbsSTYbMVhzhpTtuO4EicI+vQYiJEw4g5oOnJIo94FmIfDdHQRSn ifP4cqi2E7qWOvQrTFc/1IxDnNqQ2Crll3LxVEPSiVzDNDViW6UPUQqlI1xvWQ== 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 4Wys3W4Kq7zpSF; Tue, 3 Sep 2024 16:47: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 483Gl3Fi059166; Tue, 3 Sep 2024 16:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483Gl3Uw059165; Tue, 3 Sep 2024 16:47:03 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:47:03 GMT Message-Id: <202409031647.483Gl3Uw059165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Gordon Tetlow Subject: git: 1070e7dca822..e60dbfd00b00 - vendor/openssl-3.0 - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssl-3.0 X-Git-Reftype: branch X-Git-Commit: e60dbfd00b009d424dfc5446d132872c93dd0aed X-Git-Oldrev: 1070e7dca8223387baf5155524b28f62bfe7da3c X-Git-Newrev: e60dbfd00b009d424dfc5446d132872c93dd0aed Auto-Submitted: auto-generated The branch vendor/openssl-3.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/log/?id=1070e7dca822..e60dbfd00b00 e60dbfd00b00 Avoid type errors in EAI-related name check logic. From nobody Tue Sep 3 16:50:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wys7Q3S5Gz5TYwN; Tue, 03 Sep 2024 16:50: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 4Wys7Q321pz44Gg; Tue, 3 Sep 2024 16:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725382226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6l+Px/umrBM2EgysHp9c+W54aL1HekxcU8lMl1dtjn8=; b=J33aIcKWa2IGYESAipnts/X2x5Iw+QZtqeumpYKXFeh/R+MXvvlMHD9qXvAO3cSHWHWk2s d0EUxTswSCy9nsjajI+pI/OyNwuvalc3no8FSuYjgvAAr+by7ouh8TzCl1gWo1P0yjCbVL dv10nA/PACk93wI0opGfFFR2W0vJW7gU4B4SvQNOI/nR9GX4hOBKUIj1dN3VUBLPpUg9io HSEYsYXqAPXzxNgAOyFbSw0ghTHZr6TagNR1L+xCKD+Jgwz7cqYAoyZ1pq6QGzOyJntKHd LUXEIKpqD55UzYUcEIlPCrGxG6VaXH4M8gnjIr5n+cvsvsll6WQXOWwXTEqOTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725382226; a=rsa-sha256; cv=none; b=HuByJkk1V4yPSh6yaN1N6O+eoFT/8xfaxJIBr5+AinzX9der/Ys2DULbQ72hFdOPveaYcB 638W/ujUd4ZT/hZSJQ6bWnjyzb+aktPDWsINbWFsv7pfosf+sDaQh98PjMvpNjIeAcB6vN TILNKggSzJ982T4Sy6uL8YHMVNSJtc0MwVS+IrprZDFA7muEn8IC0TwXaNXha35uZHMCXd 28qw/6pADiUIa5MazyExzj5ufEMe9kFwQfbaRseDuiDoyN4ZbATQFjhltsiKpEvDEeR52g vJ3mnfC/xwD7YBVr5x4Ntb2o7hInZNVtaCpdMUbc3nPnmU1SonUhhLgTZeUcnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725382226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6l+Px/umrBM2EgysHp9c+W54aL1HekxcU8lMl1dtjn8=; b=XLliGQOn6elhLlYZoMS9pt3W/oX05MFzPdSpP27mylZBlhxxWlcd56CzWbP1GU206gvHXg mliJfMVD0lFr6FKRR2U2YWPxEwsLJ0jRJ12B6hfFKRBdxSN4PNeft1RocZHI8gZwDeeJYe EyYhqGbZITDHiJYWZEFJZDpW1gC/qQIt38bdUnw131FE1R62XqRnfIpsTVbsvLLkDX2pdR BtIigYg2mucqa0o8YCzUYBhelv3gQoGHet7YusNwiplszDgzHK7Ga7iLUGadFCSfsfNrb6 YwVwsJREN9YnmMVfjgC4hf4ZheZ1+cjFwMoQoN3fSLqOLhqosJhLoI+bxnwjOw== 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 4Wys7Q2d9rzpY4; Tue, 3 Sep 2024 16:50: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 483GoQXn068290; Tue, 3 Sep 2024 16:50:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GoL8w068280; Tue, 3 Sep 2024 16:50:21 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:50:21 GMT Message-Id: <202409031650.483GoL8w068280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: fbd465f26340 - main - openssl: Bring over fix for CVE-2024-6119 from vendor/openssl-3.0. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbd465f263400d3bc6c1a5c30857a76738c64396 Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=fbd465f263400d3bc6c1a5c30857a76738c64396 commit fbd465f263400d3bc6c1a5c30857a76738c64396 Merge: 4dabfcb61538 e60dbfd00b00 Author: Gordon Tetlow AuthorDate: 2024-09-03 16:47:46 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-03 16:49:23 +0000 openssl: Bring over fix for CVE-2024-6119 from vendor/openssl-3.0. Merge commit 'e60dbfd00b009d424dfc5446d132872c93dd0aed' crypto/openssl/crypto/x509/v3_utl.c | 78 +++++++++++++++------- crypto/openssl/test/recipes/25-test_eai_data.t | 12 +++- .../test/recipes/25-test_eai_data/kdc-cert.pem | 21 ++++++ .../recipes/25-test_eai_data/kdc-root-cert.pem | 16 +++++ .../openssl/test/recipes/25-test_eai_data/kdc.sh | 41 ++++++++++++ 5 files changed, 142 insertions(+), 26 deletions(-) diff --cc crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem index 000000000000,e8a2c6f55d45..e8a2c6f55d45 mode 000000,100644..100644 --- a/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem diff --cc crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem index 000000000000,a74c96bf3146..a74c96bf3146 mode 000000,100644..100644 --- a/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem diff --cc crypto/openssl/test/recipes/25-test_eai_data/kdc.sh index 000000000000,7a8dbc719fb7..7a8dbc719fb7 mode 000000,100755..100755 --- a/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh From nobody Tue Sep 3 17:09:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WysYF4WJXz5Tbfn; Tue, 03 Sep 2024 17:09: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 4WysYF42Wrz46yc; Tue, 3 Sep 2024 17:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725383361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MjqrciptQ8LsvaVuPme0E+P2beG1tXCXsKBurv0dsig=; b=PVsDsa7aTZkjO0HtpquYRZGTNsKj6EEfYLX8ReKe/sPJt7abEB+G+u+tn2PLv8CHoTrxWv nbzzUkolfI7kLTJKh0LL9434ISc10jiorTx/ni2DihuJbpG9PMgOnHU0kmqkluUxhvgWDu 41KztQaFNDnZ8AIpUVSiFnZbK+3F4/OwwSm7NyqETpvnp/R36vw/LrYsE6CsFoyLShYa5V CDbtYNmISHgtltX9UwVWttkbusazy+0jwRgBXJhL4fQiwnPpywy9qA65/CL9LO4t6MqHd1 wR3ZZuLf985zGWgQCAkFBstDuuWmC7mKf6g1ga4/ENE3UO5BunWjji0UmzfpHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725383361; a=rsa-sha256; cv=none; b=tt/a669F35UI5eJFCW4cY3BxcUt7pPIGLLG7eeKe9WYHJbMvaJrLZzxL5vgAMgWW4DWsK/ nStIUI1GvY1/OodxnkhFbdAARQ5HWo/Aq6lbyeQtCzlZo3EapefP8X0mJa0FbokrEIGIYh ZPu6KWBgAme9l9SoKXj3pY4TdNDJqFApf88SfkKoI8oQDTHckiqfnXSFBk2rc/8KFKJOC6 lL3hkZYgaRr0xJhtZ6V+jtab1qEwg+UKNV+lIknEw/oAGFadG13SLc+0MaxnFLRMiEoOF1 gQF+WIwHintl5ZZxNlq+JxouQNh9IqqYhXrTNXE6Qs8PqDvEVPGXOSbseo/AWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725383361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MjqrciptQ8LsvaVuPme0E+P2beG1tXCXsKBurv0dsig=; b=PYK9ZuH/hzoFPrel2ZUNcRAJ3yH1t9YodCI2C0D/3xM3F/MZJIhc/nLdvr3ifg6ygcrsso dQxf3b+mg0Y5B6BORpYXxcODTqDQhrZPo7nMLBQyzUAboRGLzo827m+Y3+0TLf7InD0h+V LIoUX3HKdLHragI7k59pkjYE5ihgNGCFobUw9S1C9+541DQx2EQZ5THGg05vYm22IMXnbb F7jEwgrczLMfXOOwM4xWhDjuowv396o4MWsIXnvE8a9R7w7tWosofbr9anup1HnVggrNKv WA4af+lwlx3F+x45hj9w0rzYg9s5BJBFW68ArZ/0Pl9tJFWOvKHVd6O25S18gA== 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 4WysYF2zVQzprs; Tue, 3 Sep 2024 17:09: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 483H9LR3093304; Tue, 3 Sep 2024 17:09:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483H9L20093301; Tue, 3 Sep 2024 17:09:21 GMT (envelope-from git) Date: Tue, 3 Sep 2024 17:09:21 GMT Message-Id: <202409031709.483H9L20093301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 5946b0c6cbc7 - stable/14 - openssl: Avoid type errors in EAI-related name check logic. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5946b0c6cbc77e6c5f62f5f7e635c6036e14f4d0 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=5946b0c6cbc77e6c5f62f5f7e635c6036e14f4d0 commit 5946b0c6cbc77e6c5f62f5f7e635c6036e14f4d0 Author: Viktor Dukhovni AuthorDate: 2024-06-19 11:04:11 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-03 17:07:59 +0000 openssl: Avoid type errors in EAI-related name check logic. The incorrectly typed data is read only, used in a compare operation, so neither remote code execution, nor memory content disclosure were possible. However, applications performing certificate name checks were vulnerable to denial of service. The GENERAL_TYPE data type is a union, and we must take care to access the correct member, based on `gen->type`, not all the member fields have the same structure, and a segfault is possible if the wrong member field is read. The code in question was lightly refactored with the intent to make it more obviously correct. Security: CVE-2024-6119 Obtained from: OpenSSL Project (cherry picked from commit 1486960d6cdb052e4fc0109a56a0597b4e902ba1) --- crypto/openssl/crypto/x509/v3_utl.c | 78 +++++++++++++++------- crypto/openssl/test/recipes/25-test_eai_data.t | 12 +++- .../test/recipes/25-test_eai_data/kdc-cert.pem | 21 ++++++ .../recipes/25-test_eai_data/kdc-root-cert.pem | 16 +++++ .../openssl/test/recipes/25-test_eai_data/kdc.sh | 41 ++++++++++++ 5 files changed, 142 insertions(+), 26 deletions(-) diff --git a/crypto/openssl/crypto/x509/v3_utl.c b/crypto/openssl/crypto/x509/v3_utl.c index 6e4ef26ed608..304463d572c6 100644 --- a/crypto/openssl/crypto/x509/v3_utl.c +++ b/crypto/openssl/crypto/x509/v3_utl.c @@ -916,36 +916,64 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, ASN1_STRING *cstr; gen = sk_GENERAL_NAME_value(gens, i); - if ((gen->type == GEN_OTHERNAME) && (check_type == GEN_EMAIL)) { - if (OBJ_obj2nid(gen->d.otherName->type_id) == - NID_id_on_SmtpUTF8Mailbox) { - san_present = 1; - - /* - * If it is not a UTF8String then that is unexpected and we - * treat it as no match - */ - if (gen->d.otherName->value->type == V_ASN1_UTF8STRING) { - cstr = gen->d.otherName->value->value.utf8string; - - /* Positive on success, negative on error! */ - if ((rv = do_check_string(cstr, 0, equal, flags, - chk, chklen, peername)) != 0) - break; - } - } else + switch (gen->type) { + default: + continue; + case GEN_OTHERNAME: + switch (OBJ_obj2nid(gen->d.otherName->type_id)) { + default: continue; - } else { - if ((gen->type != check_type) && (gen->type != GEN_OTHERNAME)) + case NID_id_on_SmtpUTF8Mailbox: + /*- + * https://datatracker.ietf.org/doc/html/rfc8398#section-3 + * + * Due to name constraint compatibility reasons described + * in Section 6, SmtpUTF8Mailbox subjectAltName MUST NOT + * be used unless the local-part of the email address + * contains non-ASCII characters. When the local-part is + * ASCII, rfc822Name subjectAltName MUST be used instead + * of SmtpUTF8Mailbox. This is compatible with legacy + * software that supports only rfc822Name (and not + * SmtpUTF8Mailbox). [...] + * + * SmtpUTF8Mailbox is encoded as UTF8String. + * + * If it is not a UTF8String then that is unexpected, and + * we ignore the invalid SAN (neither set san_present nor + * consider it a candidate for equality). This does mean + * that the subject CN may be considered, as would be the + * case when the malformed SmtpUtf8Mailbox SAN is instead + * simply absent. + * + * When CN-ID matching is not desirable, applications can + * choose to turn it off, doing so is at this time a best + * practice. + */ + if (check_type != GEN_EMAIL + || gen->d.otherName->value->type != V_ASN1_UTF8STRING) + continue; + alt_type = 0; + cstr = gen->d.otherName->value->value.utf8string; + break; + } + break; + case GEN_EMAIL: + if (check_type != GEN_EMAIL) continue; - } - san_present = 1; - if (check_type == GEN_EMAIL) cstr = gen->d.rfc822Name; - else if (check_type == GEN_DNS) + break; + case GEN_DNS: + if (check_type != GEN_DNS) + continue; cstr = gen->d.dNSName; - else + break; + case GEN_IPADD: + if (check_type != GEN_IPADD) + continue; cstr = gen->d.iPAddress; + break; + } + san_present = 1; /* Positive on success, negative on error! */ if ((rv = do_check_string(cstr, alt_type, equal, flags, chk, chklen, peername)) != 0) diff --git a/crypto/openssl/test/recipes/25-test_eai_data.t b/crypto/openssl/test/recipes/25-test_eai_data.t index 522982ddfb80..e18735d89aad 100644 --- a/crypto/openssl/test/recipes/25-test_eai_data.t +++ b/crypto/openssl/test/recipes/25-test_eai_data.t @@ -21,16 +21,18 @@ setup("test_eai_data"); #./util/wrap.pl apps/openssl verify -nameopt utf8 -no_check_time -CAfile test/recipes/25-test_eai_data/utf8_chain.pem test/recipes/25-test_eai_data/ascii_leaf.pem #./util/wrap.pl apps/openssl verify -nameopt utf8 -no_check_time -CAfile test/recipes/25-test_eai_data/ascii_chain.pem test/recipes/25-test_eai_data/utf8_leaf.pem -plan tests => 12; +plan tests => 16; require_ok(srctop_file('test','recipes','tconversion.pl')); my $folder = "test/recipes/25-test_eai_data"; my $ascii_pem = srctop_file($folder, "ascii_leaf.pem"); my $utf8_pem = srctop_file($folder, "utf8_leaf.pem"); +my $kdc_pem = srctop_file($folder, "kdc-cert.pem"); my $ascii_chain_pem = srctop_file($folder, "ascii_chain.pem"); my $utf8_chain_pem = srctop_file($folder, "utf8_chain.pem"); +my $kdc_chain_pem = srctop_file($folder, "kdc-root-cert.pem"); my $out; my $outcnt = 0; @@ -56,10 +58,18 @@ SKIP: { ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $ascii_chain_pem, $ascii_pem]))); ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $utf8_chain_pem, $utf8_pem]))); +ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $kdc_chain_pem, $kdc_pem]))); ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $ascii_chain_pem, $utf8_pem]))); ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $utf8_chain_pem, $ascii_pem]))); +# Check an otherName does not get misparsed as an DNS name, (should trigger ASAN errors if violated). +ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_hostname", 'mx1.example.com', "-CAfile", $kdc_chain_pem, $kdc_pem]))); +# Check an otherName does not get misparsed as an email address, (should trigger ASAN errors if violated). +ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", 'joe@example.com', "-CAfile", $kdc_chain_pem, $kdc_pem]))); +# We expect SmtpUTF8Mailbox to be a UTF8 String, not an IA5String. +ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", 'moe@example.com', "-CAfile", $kdc_chain_pem, $kdc_pem]))); + #Check that we get the expected failure return code with({ exit_checker => sub { return shift == 2; } }, sub { diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem new file mode 100644 index 000000000000..e8a2c6f55d45 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbDCCAlSgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 +MCAXDTI0MDYyMDA2MTQxNVoYDzIxMjQwNjIwMDYxNDE1WjAXMRUwEwYDVQQDDAxU +RVNULkVYQU1QTEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6wfP+ +6go79dkpo/dGLMlPZ7Gw/Q6gUYrCWZWUEgEeRVHCrqOlgUEyA+PcWas/XDPUxXry +BQlJHLvlqamAQn8gs4QPBARFYWKNiTVGyaRkgNA1N5gqyZdrP9UE+ZJmdqxRAAe8 +vvpGZWSgevPhLUiSCFYDiD0Rtji2Hm3rGUrReQFBQDEw2pNGwz9zIaxUs08kQZcx +Yzyiplz5Oau+R/6sAgUwDlrD9xOlUxx/tA/MSDIfkK8qioU11uUZtO5VjkNQy/bT +7zQMmXxWgm2MIgOs1u4YN7YGOtgqHE9v9iPHHfgrkbQDtVDGQsa8AQEhkUDSCtW9 +3VFAKx6dGNXYzFwfAgMBAAGjgcgwgcUwHQYDVR0OBBYEFFR5tZycW19DmtbL4Zqj +te1c2vZLMAkGA1UdIwQCMAAwCQYDVR0TBAIwADCBjQYDVR0RBIGFMIGCoD8GBisG +AQUCAqA1MDOgDhsMVEVTVC5FWEFNUExFoSEwH6ADAgEBoRgwFhsGa3JidGd0GwxU +RVNULkVYQU1QTEWgHQYIKwYBBQUHCAmgERYPbW9lQGV4YW1wbGUuY29tgQ9qb2VA +ZXhhbXBsZS5jb22CD214MS5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA +T0xzVtVpRtaOzIhgzw7XQUdzWD5UEGSJJ1cBCOmKUWwDLTAouCYLFB4TbEE7MMUb +iuMy60bjmVtvfJIXorGUgSadRe5RWJ5DamJWvPA0Q9x7blnEcXqEF+9Td+ypevgU +UYHFmg83OYwxOsFXZ5cRuXMk3WCsDHQIBi6D1L6oDDZ2pfArs5mqm3thQKVlqyl1 +El3XRYEdqAz/5eCOFNfwxF0ALxjxVr/Z50StUZU8I7Zfev6+kHhyrR7dqzYJImv9 +0fTCOBEMjIETDsrA70OxAMu4V16nrWZdJdvzblS2qrt97Omkj+2kiPAJFB76RpwI +oDQ9fKfUOAmUFth2/R/eGA== +-----END CERTIFICATE----- diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem new file mode 100644 index 000000000000..a74c96bf3146 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICnDCCAYQCCQCBswYcrlZSHjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARS +b290MCAXDTI0MDYyMDA2MTQxNVoYDzIxMjQwNjIwMDYxNDE1WjAPMQ0wCwYDVQQD +DARSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqRj8S4kBbIUj +61kZfi6nE35Q38U140+qt4uAiwAhKumfVHlBM0zQ98WFt5zMHIBQwIb3yjc2zj+0 +qzUnQfwm1r/RfcMmBPEti9Ge+aEMSsds2gMXziOFM8wd2aAFPy7UVE0XpEWofsRK +MGi61MKVdPSbGIxBwY9VW38/7D/wf1HtJe7y0xpuecR7GB2XAs+qST59NjuF+7wS +dLM8Hb3TATgeYbXXWsRJgwz+SPzExg5WmLnU+7y4brZ32dHtdSmkRVSgSlaIf7Xj +3Tc6Zi7I+W/JYk7hy1zUexVdWCak4PHcoWrXe0gNNN/t8VfLfMExt5z/HIylXnU7 +pGUyqZlTGQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAHpLF1UCRy7b6Hk0rLokxI +lgwiH9BU9mktigAGASvkbllpt+YbUbWnuYAvpHBGiP1qZtfX2r96UrSJaGO9BEzT +Gp9ThnSjoj4Srul0+s/NArU22irFLmDzbalgevAmm9gMGkdqkiIm/mXbwrPj0ncl +KGicevXryVpvaP62eZ8cc3C4p97frMmXxRX8sTdQpD/gRI7prdEILRSKveqT+AEW +7rFGM5AOevb4U8ddop8A3D/kX0wcCAIBF6jCNk3uEJ57jVcagL04kPnVfdRiedTS +vfq1DRNcD29d1H/9u0fHdSn1/+8Ep3X+afQ3C6//5NvOEaXcIGO4QSwkprQydfv8 +-----END CERTIFICATE----- diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh new file mode 100755 index 000000000000..7a8dbc719fb7 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh @@ -0,0 +1,41 @@ +#! /usr/bin/env bash + +# Create a root CA, signing a leaf cert with a KDC principal otherName SAN, and +# also a non-UTF8 smtpUtf8Mailbox SAN followed by an rfc822Name SAN and a DNS +# name SAN. In the vulnerable EAI code, the KDC principal `otherName` should +# trigger ASAN errors in DNS name checks, while the non-UTF8 `smtpUtf8Mailbox` +# should likewise lead to ASAN issues with email name checks. + +rm -f root-key.pem root-cert.pem +openssl req -nodes -new -newkey rsa:2048 -keyout kdc-root-key.pem \ + -x509 -subj /CN=Root -days 36524 -out kdc-root-cert.pem + +exts=$( + printf "%s\n%s\n%s\n%s = " \ + "subjectKeyIdentifier = hash" \ + "authorityKeyIdentifier = keyid" \ + "basicConstraints = CA:false" \ + "subjectAltName" + printf "%s, " "otherName:1.3.6.1.5.2.2;SEQUENCE:kdc_princ_name" + printf "%s, " "otherName:1.3.6.1.5.5.7.8.9;IA5:moe@example.com" + printf "%s, " "email:joe@example.com" + printf "%s\n" "DNS:mx1.example.com" + printf "[kdc_princ_name]\n" + printf "realm = EXP:0, GeneralString:TEST.EXAMPLE\n" + printf "principal_name = EXP:1, SEQUENCE:kdc_principal_seq\n" + printf "[kdc_principal_seq]\n" + printf "name_type = EXP:0, INTEGER:1\n" + printf "name_string = EXP:1, SEQUENCE:kdc_principal_components\n" + printf "[kdc_principal_components]\n" + printf "princ1 = GeneralString:krbtgt\n" + printf "princ2 = GeneralString:TEST.EXAMPLE\n" + ) + +printf "%s\n" "$exts" + +openssl req -nodes -new -newkey rsa:2048 -keyout kdc-key.pem \ + -subj "/CN=TEST.EXAMPLE" | + openssl x509 -req -out kdc-cert.pem \ + -CA "kdc-root-cert.pem" -CAkey "kdc-root-key.pem" \ + -set_serial 2 -days 36524 \ + -extfile <(printf "%s\n" "$exts") From nobody Tue Sep 3 17:26:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wysx0617Rz5TdJ8; Tue, 03 Sep 2024 17:26:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wysx05NL9z48Tw; Tue, 3 Sep 2024 17:26:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725384388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=POVZ7kWX0uwzzchC/EHySaS9srtySBDfASG0Vjf1nZw=; b=dG5t4s7unSXfSW5HSR5k/hY/YFfKqQKs4INPE5Gil8VlAYWKQxxksOPQCubHW69WTIM5LK 5cynN/DeXgeXZPWlWcDWrIkje1uGgYbvD68a9QnSz2qbqAzU/qBWYc8V56iFf1lCyRUxTa H1UieAQ0/3ll1T9XxnxPFRyBpKbYSaxluZ7Y/Yne6XKtCRwtCEJ7+lPuxUe7srK0t4e9ln NQVlOZ1Q7Rjti5OseZ32o8C7Fd0Yqc2h2fKRRYzrhX4+/v/nvGkEq/dCzaW2INVb7YYt0s oI63JlDAgeJExPEUOJNqnZL4H3hyZ418y8BDxhblW3u3+LHw0/iVKJvY/4YE3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725384388; a=rsa-sha256; cv=none; b=yfRmAAV6HhOVPl45fRq5SAAMtZlw5fDwcm8oNuVw+hQKjwRjV0FFzE+m0en2iNuY+Jx4bq VCctshHkqiADwgi+A1syyuYcYwPHZfQoIhpmzzXRV38bJsBL/MHTnjCPPGcOW+WYHsDCAj okgiSdH0Jlq4Bg5krj1juaiF9svIyTP904Cw+rfTQ8cA2SXCkxhGi518UuNXVQ3ST81QEs Fu+7adwvrilYGdZCT64w0Tik3IDZdOupH/xCCwEq78KOkvgpZKw8jflzQQmCG+fWWW2+Ti K04eccdyjarJLiUJ1NtGoavwRO39683PoUkbw0qLxE1w3Hqs7k2AYM5Ch9Qi1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725384388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=POVZ7kWX0uwzzchC/EHySaS9srtySBDfASG0Vjf1nZw=; b=qXvFx11PB4eikO0Ezn80an2uUKjvmhOCfpMWtCJz++LLaonTRzOajD+w+e8LA1F4nBbOHi awQ6Ji4QXJNBDZo6EZWIREo67CV94XXlZzDe3rkBFmgb8dvkMBw33HGyxwoW20AmM2CaVR fPeQru8RCkq51HG9y+vxWsgb2xXedj0/mgRCKFdqx4tjGzYUw6jv3ryc7pT8tiDYN3eu1j 5JM5X0vKXo3vGR6OlrBIj5LSUqLzk6YoovIBnA3aEw/6LdcPiJRy3XId2TnLbDFjY4Vqr4 OzURY6Wn/8PauBhCEp42wJLlgFgqHakYt3Rg7iFlEEkVamiqK17ilpcXVxGZlA== 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 4Wysx04zXNzqVN; Tue, 3 Sep 2024 17:26:28 +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 483HQSL9027177; Tue, 3 Sep 2024 17:26:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483HQS5l027174; Tue, 3 Sep 2024 17:26:28 GMT (envelope-from git) Date: Tue, 3 Sep 2024 17:26:28 GMT Message-Id: <202409031726.483HQS5l027174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: f8860353d4f4 - main - tcpdump: ppp: Use the buffer stack for the de-escaping buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8860353d4f4c25bacdae5bc1cfb7a95edc9bfe0 Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=f8860353d4f4c25bacdae5bc1cfb7a95edc9bfe0 commit f8860353d4f4c25bacdae5bc1cfb7a95edc9bfe0 Author: Guy Harris AuthorDate: 2024-09-03 17:11:16 +0000 Commit: Joseph Mingrone CommitDate: 2024-09-03 17:24:16 +0000 tcpdump: ppp: Use the buffer stack for the de-escaping buffer This both saves the buffer for freeing later and saves the packet pointer and snapend to be restored when packet processing is complete, even if an exception is thrown with longjmp. This means that the hex/ASCII printing in pretty_print_packet() processes the packet data as captured or read from the savefile, rather than as modified by the PPP printer, so that the bounds checking is correct. That fixes CVE-2024-2397, which was caused by an exception being thrown by the hex/ASCII printer (which should only happen if those routines are called by a packet printer, not if they're called for the -X/-x/-A flag), which jumps back to the setjmp() that surrounds the packet printer. Hilarity^Winfinite looping ensues. Also, restore ndo->ndo_packetp before calling the hex/ASCII printing routine, in case nd_pop_all_packet_info() didn't restore it. Reviewed by: emaste --- contrib/tcpdump/print-ppp.c | 31 +++++++++++++++++-------------- contrib/tcpdump/print.c | 8 ++++++-- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/contrib/tcpdump/print-ppp.c b/contrib/tcpdump/print-ppp.c index aba243ddb6f2..e5ae0646ebae 100644 --- a/contrib/tcpdump/print-ppp.c +++ b/contrib/tcpdump/print-ppp.c @@ -42,6 +42,8 @@ #include #endif +#include + #include "netdissect.h" #include "extract.h" #include "addrtoname.h" @@ -1363,7 +1365,6 @@ ppp_hdlc(netdissect_options *ndo, u_char *b, *t, c; const u_char *s; u_int i, proto; - const void *sb, *se; if (caplen == 0) return; @@ -1371,9 +1372,11 @@ ppp_hdlc(netdissect_options *ndo, if (length == 0) return; - b = (u_char *)nd_malloc(ndo, caplen); - if (b == NULL) - return; + b = (u_char *)malloc(caplen); + if (b == NULL) { + (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, + "%s: malloc", __func__); + } /* * Unescape all the data into a temporary, private, buffer. @@ -1394,13 +1397,15 @@ ppp_hdlc(netdissect_options *ndo, } /* - * Change the end pointer, so bounds checks work. - * Change the pointer to packet data to help debugging. + * Switch to the output buffer for dissection, and save it + * on the buffer stack so it can be freed; our caller must + * pop it when done. */ - sb = ndo->ndo_packetp; - se = ndo->ndo_snapend; - ndo->ndo_packetp = b; - ndo->ndo_snapend = t; + if (!nd_push_buffer(ndo, b, b, (u_int)(t - b))) { + free(b); + (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, + "%s: can't push buffer on buffer stack", __func__); + } length = ND_BYTES_AVAILABLE_AFTER(b); /* now lets guess about the payload codepoint format */ @@ -1442,13 +1447,11 @@ ppp_hdlc(netdissect_options *ndo, } cleanup: - ndo->ndo_packetp = sb; - ndo->ndo_snapend = se; + nd_pop_packet_info(ndo); return; trunc: - ndo->ndo_packetp = sb; - ndo->ndo_snapend = se; + nd_pop_packet_info(ndo); nd_print_trunc(ndo); } diff --git a/contrib/tcpdump/print.c b/contrib/tcpdump/print.c index 41a6b524fbf8..96d34b772f08 100644 --- a/contrib/tcpdump/print.c +++ b/contrib/tcpdump/print.c @@ -434,10 +434,14 @@ pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h, nd_pop_all_packet_info(ndo); /* - * Restore the original snapend, as a printer might have - * changed it. + * Restore the originals snapend and packetp, as a printer + * might have changed them. + * + * XXX - nd_pop_all_packet_info() should have restored the + * original values, but, just in case.... */ ndo->ndo_snapend = sp + h->caplen; + ndo->ndo_packetp = sp; if (ndo->ndo_Xflag) { /* * Print the raw packet data in hex and ASCII. From nobody Tue Sep 3 19:10:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WywF26TLXz5Tp2Y; Tue, 03 Sep 2024 19:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WywF21zv9z4VsZ; Tue, 3 Sep 2024 19:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725390630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CRB1bu7ptmXiu4MU5+JOiplDaIolCp33YePTlL+4wUg=; b=UASkE4AW+CZukbCYntPAsDl6TBmwuNQoOjiZMID198c2Ye1nZ83sjKL4GDlrhzJXMKOn+P oWS65DdNv/LcRi+n+tk2ikx33FM6arU4Z2g/WBR9HGwLkM9hKfQSXYQ/38f3okxlYmZIAJ HtyKjaHnVt8Ekyxjw6GA+qfSEZx2FhvfpbFFnyoRzUCoc5+cHg4k3Zq4p6Vr6GQi5oyUoW hb/oLAPrWtycaemj8HQMg6cwOshBYufTH1hzBsLoTfFkvGm4XsObmlKmHEByXrn61eWf/M EcxIj5x+xonloQCbumjHsvxGQnfjQHkS7uPN99qmK7YtUDn+ZXuAXG/NoXZhpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725390630; a=rsa-sha256; cv=none; b=sp13TrIIc+DKAXi6WrSL2giNWAEjPs+X2iiTMc3s49zNlgHGNorhRJz8CmtSrJiF8lc8zY 5ZcZpHqZcMuFQl1Zjz8HhpQxNhCqEDGV7uQuKTMxKBibEm11454sEKESJrH5JOK2z6lp6C k6e5dT8Dtf6QNL3s2LEjuMTxHHhsCH36VNsgXSf74RanN51AjJSd5nJoCBAemQsqBxMdFS NqL5zhCbFsqDk7TL6ErA+R3tTqu+h9thGPRBgCyEKgIj5NSLziVQh2Xrc8rkul71gUsny4 nFP8EwjeLZfeuPk5OFfpI2v8fHqu1qNLlgczJnpxTK1n/EN7PT5SSfC10PKWzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725390630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CRB1bu7ptmXiu4MU5+JOiplDaIolCp33YePTlL+4wUg=; b=Ix+N+mDIr2dGuAU/FRTPizR76om5wn8gVImndiYuzPI1WZ3Y5Ym65oS4aFLwQZjJBZkDO7 8VKy7KM09gYM7HuvxIvD07FsBjDAtbPcrAeW+p0MxShz5TglVE/xaqXf7uW7UuAXIN538w gMIpdhizHZkEZAotbhGAgpGSx0oOY3laYaU1QYt5CrZAt2rBzlUtrCGJ+LVtDvX1rhNh+g xndykROvVU8iZVrxQB0V/OcGzIECwmXPMrmFsQk53NBW2qinauEVpWBYBPfZghk04uklXK 5xR+eKtHp4Wrs4Ebc01AVXvae0DosJsRhekxrje2fp9ngyeAcL2TsdAAYhnllw== 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 4WywF21C6rzsn5; Tue, 3 Sep 2024 19:10:30 +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 483JAUuD007158; Tue, 3 Sep 2024 19:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483JAU5r007155; Tue, 3 Sep 2024 19:10:30 GMT (envelope-from git) Date: Tue, 3 Sep 2024 19:10:30 GMT Message-Id: <202409031910.483JAU5r007155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1b9cfd6a625d - main - stand: bump arbitrary build date to 2024-01-01 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b9cfd6a625dc82611846cb9a53c1886f7af3758 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1b9cfd6a625dc82611846cb9a53c1886f7af3758 commit 1b9cfd6a625dc82611846cb9a53c1886f7af3758 Author: Ed Maste AuthorDate: 2024-08-12 13:11:09 +0000 Commit: Ed Maste CommitDate: 2024-09-03 19:09:28 +0000 stand: bump arbitrary build date to 2024-01-01 For build reproducibility we set PE headers to an arbitrary timestamp. Nothing in FreeBSD uses this timestamp, but bump it from 2016 to 2024 so that the timestamp does not seem "too old" in case some third party tool is used to inspect EFI boot components. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46527 --- stand/efi/Makefile.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc index 3a13ca24f369..18751f0e4ecc 100644 --- a/stand/efi/Makefile.inc +++ b/stand/efi/Makefile.inc @@ -23,8 +23,8 @@ EFI_TARGET= efi-app-x86_64 EFI_TARGET= binary .endif -# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2024 00:00:00 # for build reproducibility. -SOURCE_DATE_EPOCH?=1451606400 +SOURCE_DATE_EPOCH?=1704067200 .include "../Makefile.inc" From nobody Tue Sep 3 20:12:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wyxct4FWtz52S5K; Tue, 03 Sep 2024 20:12: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 4Wyxct3ZRVz4k4P; Tue, 3 Sep 2024 20:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725394366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sUu37tIC50xJW6Q3dUIztuj+CSLj3pGHTo6uZ0hr7mk=; b=Ay5bIfoN4noKCB4ltA6jvlvrh1QCI+365FTMK++amwXEKvYlj4uubwmcpSBkA1DqOXmPwO R7hGop3PxnW9KroHP4yNVkFXRUcGwLj2TeUmKWn0KIOIU6D0Wkxvl9tZbRWi8G+8aRFd7U GC5615x0VfQS7+Gdm8AZ5m1c+/g9M+3xr2LYtpFb1asHQILTrbcFumkY3OhMddsI5VJ6B7 nCTS307ANHlPCNRqiOA0cRrDZVsC+1hxQ2d2n+2q2+E+NEsQGRmtjml5TqO5efJ2iw2opT bd/2KXf1XBl/Mcu0aGDGGr0Tpa/7HvnyC69f6lfxsRImEo1Jb/xXl6BEiJu7rQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725394366; a=rsa-sha256; cv=none; b=grKkFiSk79IkbwcwS+TRPR/ezIHos+YPGewlpAMFrxb6XitMpFnAJptrSQjhZISyPoOACk 7O1xw69RnNmFouC7ks55Qipb8ek+jx/Dz2vxglkBUOGJrRlQRfe9g6RZzRMh9XSVeOiYdg vklsNmUIFrqMDeq9axqHqs+8Y024YLglMs2f8V1ECCyOO4yDTVO1mcVfGi2FnX6I0BxBi2 6tGtQlu5kdT7Evlh/Ueq3GzYuWyC36CP3yY20qRmbxhoBOoiLgdIRys7FSozW0b4bJOYPL xLGYVSL7ZXpXYlWyybnXiaruk4nRD7vDerlwdcWkNWIPLd3U096Tktgfa4hEmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725394366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sUu37tIC50xJW6Q3dUIztuj+CSLj3pGHTo6uZ0hr7mk=; b=yzz8GA1n13HljTP0D35k4qEHSacpGHH5suMnDSdx1gOO0f87U9SZv/hii2FE/9eRusQRxd O2Kv2UxHPP/ToeQsE2S6fYhuxMz+aMV+sSa1P5W8j6rzWG/22uvvQ4tK48c9uHmWVaW79D maWJzy7H/lbNopLR3XxF0eCy03/BpmPcM8u4MXX6soaj5ty8r2+VQacZ1HyR+vb4zYNboj HV9sdSp8QTpm0Nu0YXAOHCrM61zZ2MEv9JAgb9t+tDuT9MZMJadFL/mhodX1bOreYzC/VQ NjYojaRwW6rRz9lBzwsCWPEb6wDG3hE12UREQGhaSiTjgxK5Qar+bLF3fz8yLQ== 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 4Wyxct3B1zzvrQ; Tue, 3 Sep 2024 20:12: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 483KCkR6015381; Tue, 3 Sep 2024 20:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483KCkjE015378; Tue, 3 Sep 2024 20:12:46 GMT (envelope-from git) Date: Tue, 3 Sep 2024 20:12:46 GMT Message-Id: <202409032012.483KCkjE015378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f5541f9f4734 - main - nvmfd/nvmft: Fix a typo "whiled" -> "while" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5541f9f473430a3e608e07f623294322853d25a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f5541f9f473430a3e608e07f623294322853d25a commit f5541f9f473430a3e608e07f623294322853d25a Author: John Baldwin AuthorDate: 2024-09-03 20:12:04 +0000 Commit: John Baldwin CommitDate: 2024-09-03 20:12:04 +0000 nvmfd/nvmft: Fix a typo "whiled" -> "while" Sponsored by: Chelsio Communications --- sys/dev/nvmf/controller/nvmft_controller.c | 2 +- usr.sbin/nvmfd/controller.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvmf/controller/nvmft_controller.c b/sys/dev/nvmf/controller/nvmft_controller.c index dee4d8c92d3d..3c10fea75c9d 100644 --- a/sys/dev/nvmf/controller/nvmft_controller.c +++ b/sys/dev/nvmf/controller/nvmft_controller.c @@ -954,7 +954,7 @@ nvmft_handle_admin_command(struct nvmft_controller *ctrlr, if (NVMEV(NVME_CC_REG_EN, ctrlr->cc) == 0 && cmd->opc != NVME_OPC_FABRICS_COMMANDS) { nvmft_printf(ctrlr, - "Unsupported admin opcode %#x whiled disabled\n", cmd->opc); + "Unsupported admin opcode %#x while disabled\n", cmd->opc); nvmft_send_generic_error(ctrlr->admin, nc, NVME_SC_COMMAND_SEQUENCE_ERROR); nvmf_free_capsule(nc); diff --git a/usr.sbin/nvmfd/controller.c b/usr.sbin/nvmfd/controller.c index 09baaea74ab4..e9435bce69da 100644 --- a/usr.sbin/nvmfd/controller.c +++ b/usr.sbin/nvmfd/controller.c @@ -192,7 +192,7 @@ controller_handle_admin_commands(struct controller *c, handle_command *cb, */ if (NVMEV(NVME_CC_REG_EN, c->cc) == 0 && cmd->opc != NVME_OPC_FABRICS_COMMANDS) { - warnx("Unsupported admin opcode %#x whiled disabled\n", + warnx("Unsupported admin opcode %#x while disabled\n", cmd->opc); nvmf_send_generic_error(nc, NVME_SC_COMMAND_SEQUENCE_ERROR); From nobody Tue Sep 3 20:15:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyxgV1VYRz52T31; Tue, 03 Sep 2024 20:15: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 4WyxgT61mPz4lf2; Tue, 3 Sep 2024 20:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725394501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Re3Q4GmG0l7ad1unEXbvfi+5EgXgKqG8fdxggzc0bQ=; b=tTtTEAOHspB9XI3FXjY4GF8Y9j1kV4CEqV4FxoX/gQBHuv789x8+VHw3PrRbwF15cYniYT 4YORybamUKQJzE6Nq9vqs4lE+UOg+lJPurXn9+W3FvdFe1FszgCIIjTtaY/QQbVVIRU971 hcYRePsOyAiMBS9BAgMdCAC87klkCqaZiIqhT8sSGfNASSAKz0yrO97KiszZ/DvIt68R9i V34PlNgtwU3dlXpA/40kc3zz937ylOq800j0UH2QsOjHn8Oqv5wB3+8QLFF0gN7ouMGanE oWgRMuj5HlXsZWA5JczQWYhlQR9bR4ADTooUWaQKcVq/uZ6yee/e63mdRUdfaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725394501; a=rsa-sha256; cv=none; b=ujl7zUTffk4gp95Zkgr15Jpo2bSUJNSfAvzZ5Xjgz4b05qOYieWGw7bTr3tXUB9ZbwQflt Hn/b9NnHhAWNyOECgde6jpX2adDIElkcUUZ9WIGCz9aSzCxyt07wajnIYx8hlvgCqPWlrL EhA+rIXIrFRPCIibaBn5bMPKiL7pw0lyJeZ+yao0GK9BlCDtBrxDYcdzl03vehG5u8UhZc LR+xvXMFkz+SaUvFixX/MvpoPJjEpvrhX+ibDjZxPYfWYtXDH+8hgWNqce2iKYMsMcH0X3 lbunkLUmjf6H3VquFaY86DEyFvBWo5HGerrCSdpsL7tpddFmkj0IbHy18cs0Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725394501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Re3Q4GmG0l7ad1unEXbvfi+5EgXgKqG8fdxggzc0bQ=; b=fQSUM+rLWorSPvzUsJl2Nu+vH4dWbk0zUhRrwYTceIzwDKjT043J/sECnsuxxlQxyBtbHw 38uW0WG882Z/u7KqOMLifieQi38rNyd/xamEdObyITzddnXjhLAOrUEc/OHJoYvlnfZDj+ SNxsXwFsAQp1MFpyjVYGGjbYXEx1Lmjmk1yUqmBidNfjMWpLAcMU7KUqclVeQS7cP+8xbG oIeAvLwWSCcx15m7RDCAqPVwefogy02Dfg3ViQUEsJa5vknMMl6T0+G30SYZOLeYAJ/W48 mOtObKQmB9tN3VbTkedceKBZyKyjP33OKQ/axSoXID0V10t1dHAMtkBoK0Nz7Q== 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 4WyxgT5dfXzvrS; Tue, 3 Sep 2024 20:15: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 483KF1Kh015838; Tue, 3 Sep 2024 20:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483KF1B9015835; Tue, 3 Sep 2024 20:15:01 GMT (envelope-from git) Date: Tue, 3 Sep 2024 20:15:01 GMT Message-Id: <202409032015.483KF1B9015835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 18f7683e0d6e - main - loader.efi.8: Remove rogue duplicated lines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18f7683e0d6ee6858865d8b0c2d7e2c14abf0bc4 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=18f7683e0d6ee6858865d8b0c2d7e2c14abf0bc4 commit 18f7683e0d6ee6858865d8b0c2d7e2c14abf0bc4 Author: Jessica Clarke AuthorDate: 2024-09-03 20:14:44 +0000 Commit: Jessica Clarke CommitDate: 2024-09-03 20:14:44 +0000 loader.efi.8: Remove rogue duplicated lines Fixes: 871911a4ab73 ("loader.efi(8): beef up the updating the ESP") MFC after: 1 week --- stand/man/loader.efi.8 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index a0c0df9a9c35..3527d8b66a99 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 20, 2024 +.Dd September 3, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -450,9 +450,6 @@ copy the loader to the default location: # cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI .Ed .Pp -.Bd -literal -offset indent -# umount /boot/efi -.Ed Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent # umount /boot/efi From nobody Tue Sep 3 21:39:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyzYV3wQzz5MTM1; Tue, 03 Sep 2024 21:39: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 4WyzYV3KTKz42lp; Tue, 3 Sep 2024 21:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725399598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TgIxMt9QksmB57pkQxkzlE36/QqAql4Ov9CncPLDCgQ=; b=CpgiH2WXa2vvoaALGmPXiR3KNGWu/ySxrfzOQsZpB7gQ2sjxvtDXIovl1DK356OhVyjILd l+GlcFMljVXIpeJUhFopyS7tMXU47mDnQ4LLe9iEKO+P5vXvzm/X+F5uFjEKFgMtE75mzs edKYGVQsymMwD4iINXAQFv+vvIiywrVEQbeVuKRU533/0lzoXs80FeilDyht4/BmTiE3Lo 2jtykLCVcdZais5jxjgvJDZ+UlOeBJsbmUQyiQFTTXCWFT5RS5LMDAGPWrwEEno9SXo3qF J4FpQ7h69nnPiKRM4owIfHRBPdf/tp44lDGOe15jpIsHEOJIrThg0Al/wmCLEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725399598; a=rsa-sha256; cv=none; b=mobt5tVeIxZ/jIJOL120P+A3e4/3r3D9QVOn92kGMROviKIfeQlPDOTpmWyTcj4LtYVmst 09BnkO3Rp/SHXhk+qk1sFHXQJ8XVxytAhyuCcBrbQNN6bEZFHtKbea4qN5JlbkaVIqjs90 8rDcIguBa25WeI5BLq2pEaMHADnEZGPiCx6iP9HTHRLUuQ7OQrIa7A0m+WOweK02xFV/2c kiAnLivuWqGx74Yv9gEtN7hHm/34G0a0J3mnfkDih09sLO4MFxrO/udh2Z1TgcT2eMh0Gd rJkubU99+Vj853Zje5/npNW5/CnwNqRVXlDq/u6132rg08ZDy/nlu7C7FUyCSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725399598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TgIxMt9QksmB57pkQxkzlE36/QqAql4Ov9CncPLDCgQ=; b=MiU3MzwxMed0Gq3epfo20/v3FP76CVMCgB6nkFVFDAVe0tKIgIthuACkEIiaIfgr73mV/O 8ghzCdDml8ClRfTYoVQMPz0rpwNkUr1F6etzAknV0PZ6RQqo2tLsJzJ4vA+izyN6mfkD75 uqpchzR/QdpjbOlqGLlIzDTVHTlIiVzIQ6snCuysEE7OBYZV8MBWbb873W0wQ/WeZqpta5 rR2xIhIAahuCxeiePX2mmh3+4pQlRARQUtmN4+PG8BWutB/VnFttocl+VmMxsYZzBOzJzJ VSn+RYMrkvJ7ZXTiVDqtQqgqvzkqAPyRRChnod+GbGWpUBj8au846QaupvRJEQ== 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 4WyzYV2lx2zx5B; Tue, 3 Sep 2024 21:39: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 483Ldw93051964; Tue, 3 Sep 2024 21:39:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483LdwRj051961; Tue, 3 Sep 2024 21:39:58 GMT (envelope-from git) Date: Tue, 3 Sep 2024 21:39:58 GMT Message-Id: <202409032139.483LdwRj051961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a84d91d81a6f - main - mmccam: fix mmcsd disk aliases List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a84d91d81a6f3eeb4949c4fb3440e0634f2b953a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a84d91d81a6f3eeb4949c4fb3440e0634f2b953a commit a84d91d81a6f3eeb4949c4fb3440e0634f2b953a Author: Bjoern A. Zeeb AuthorDate: 2024-01-21 19:56:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-03 21:38:24 +0000 mmccam: fix mmcsd disk aliases For EXT_CSD_PART_CONFIG_ACC_BOOT and possibly others with suffixes we fail to create proper disk aliases (symlinks), which shows up as g_dev_taste: make_dev_alias_p() failed (name=mmcsd0, error=17) In this case we ended up with the followng two: /dev/mmcsd0 -> sdda0 /dev/mmcsd1 -> sdda0boot1 Note that (i) it should be mmcsd0boot1 and not mmcsd1 and that (ii) there is no mmcsd0boot0 (failed above as it tried to create a second mmcsd0). Adjust the code (using a highly simplified version--compared to my original approach--suggested by imp) using an extended format string with (sdda/mmcsd) prefix as first argument to create proper names. MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43538 --- sys/cam/mmc/mmc_da.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 597ba0efb47e..fc29a1925c66 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -88,9 +88,11 @@ typedef enum { SDDA_STATE_PART_SWITCH, } sdda_state; -#define SDDA_FMT_BOOT "sdda%dboot" -#define SDDA_FMT_GP "sdda%dgp" -#define SDDA_FMT_RPMB "sdda%drpmb" +/* Purposefully ignore a '%d' argument to snprintf in SDDA_FMT! */ +#define SDDA_FMT "%s" +#define SDDA_FMT_BOOT "%s%dboot" +#define SDDA_FMT_GP "%s%dgp" +#define SDDA_FMT_RPMB "%s%drpmb" #define SDDA_LABEL_ENH "enh" #define SDDA_PART_NAMELEN (16 + 1) @@ -1480,7 +1482,7 @@ finish_hs_tests: sdda_process_mmc_partitions(periph, start_ccb); } else if (mmcp->card_features & CARD_FEATURE_MEMORY) { /* For SD[HC] cards, just add one partition that is the whole card */ - if (sdda_add_part(periph, 0, "sdda", + if (sdda_add_part(periph, 0, SDDA_FMT, periph->unit_number, mmc_get_media_size(periph), sdda_get_read_only(periph, start_ccb)) == false) @@ -1525,7 +1527,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, part->type = type; part->ro = ro; part->sc = sc; - snprintf(part->name, sizeof(part->name), name, periph->unit_number); + snprintf(part->name, sizeof(part->name), name, "sdda", periph->unit_number); /* * Due to the nature of RPMB partition it doesn't make much sense @@ -1592,8 +1594,11 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, part->disk->d_fwsectors = 0; part->disk->d_fwheads = 0; - if (sdda_mmcsd_compat) - disk_add_alias(part->disk, "mmcsd"); + if (sdda_mmcsd_compat) { + char cname[SDDA_PART_NAMELEN]; /* This equals the mmcsd namelen. */ + snprintf(cname, sizeof(cname), name, "mmcsd", periph->unit_number); + disk_add_alias(part->disk, cname); + } /* * Acquire a reference to the periph before we register with GEOM. @@ -1682,7 +1687,7 @@ sdda_process_mmc_partitions(struct cam_periph *periph, union ccb *ccb) * data area in case partitions are supported. */ ro = sdda_get_read_only(periph, ccb); - sdda_add_part(periph, EXT_CSD_PART_CONFIG_ACC_DEFAULT, "sdda", + sdda_add_part(periph, EXT_CSD_PART_CONFIG_ACC_DEFAULT, SDDA_FMT, periph->unit_number, mmc_get_media_size(periph), ro); sc->part_curr = EXT_CSD_PART_CONFIG_ACC_DEFAULT; From nobody Tue Sep 3 23:56:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wz2bP0JjRz5MhQ0; Tue, 03 Sep 2024 23:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wz2bN6pllz4RJj; Tue, 3 Sep 2024 23:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725407809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmzVXJic0kAkteiWyISG5C2SZ9JVxESW+i1tHfooBRw=; b=ZINsdEZtSBtIPoMiBhmvr7WJaJLwYKYzVF4qaIwtC91DAwUN+qbPIrWy/VSUZp7bB795/J fgOPLpu9Phu5EliS8WbCt/ubIY0sofxpYSeFspUz8IfHRN3lDYA8DWQYwLCQHaBwfUwoW4 E1UwuS6E1na9PtcFUukZhUeOZP6Y8I34B+FmES1pJK8t3/7awsK2uO5jDDwtQKur33oTxB En59IA7jCcygn2Pu304AM37/ZSjk1HVmzyQVkMtHC3oVSsmyVDaCdj9FdktfmMQnI68oAp jn3g9MGXq/oYwWYOWEBgPyBdQMlvXY9et0/tOPB8yQ4KGFrVeBD9TVdFQfAu0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725407809; a=rsa-sha256; cv=none; b=uZqkXCSVVxADqJvQ6erI17BbRn8r13pn5LNHQbhoCUjCAU8blo5xtbdRWuqERZVXc3Xp82 /k6d91xwnon7se3TdYrwo4sv5/0ijhfwsIHJLLE27ElhoX7V94VGws17EKIUOFRWBjEQ8t nDJpjnt1YRyKXg7XhtLlx8pXsxlTtP/CC9U8yY/u7PnuEp/IAEsxzKnSAgd9/QMu7gvjZO 0qkPD74BAKzIT7dcQSUix1NyOCw0AStNrQ+DN0f48lJmVXf6n0UUrSu/nWT1TV3II9Z9O9 hTtIdMIlqFNVQYENPd18SjXi5tAIAQ2W+5KmHCmROubzd4byNTm0kOOVvJ94CQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725407809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmzVXJic0kAkteiWyISG5C2SZ9JVxESW+i1tHfooBRw=; b=dF97vjU22BOCYwzJWEq1u0tPF5/0CSXTjHOcHPmhjrhRHfzFabqBdxdmPOlnxLW5kW/yvh 8BOA7AQpXCGpfCYJyobrtpg09bFJD5A9B5Pjfr48RBahFDRrisUJU3PwcFEUvGsCe2RoyM tGABandM+a5BzaENxnUTu/jcsaxVpgiGhmm0euZZhXI+1QlHKZb7G4EAS9rz2YYgor3xTn CpPg11b71ubVvgBt6czRAoYlGdCVVPP9SHh+/zRUwemtNwqukhgF82oknlbuguxzq6U/1Z 97NUSvXVzgICJhYYj674/i6TlxfFuRgQpqvuU5PyrXyiluBLbvX713rCcbOr2Q== 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 4Wz2bN6DjSz11g8; Tue, 3 Sep 2024 23:56: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 483NumX9088373; Tue, 3 Sep 2024 23:56:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483NumSC088370; Tue, 3 Sep 2024 23:56:48 GMT (envelope-from git) Date: Tue, 3 Sep 2024 23:56:48 GMT Message-Id: <202409032356.483NumSC088370@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: 898f6d26deb8 - stable/14 - loader.efi.8: Remove rogue duplicated lines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 898f6d26deb8408252444d48bf210cb90cb993de Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=898f6d26deb8408252444d48bf210cb90cb993de commit 898f6d26deb8408252444d48bf210cb90cb993de Author: Jessica Clarke AuthorDate: 2024-09-03 20:14:44 +0000 Commit: Warner Losh CommitDate: 2024-09-03 23:56:38 +0000 loader.efi.8: Remove rogue duplicated lines Fixes: 871911a4ab73 ("loader.efi(8): beef up the updating the ESP") MFC after: 1 week (cherry picked from commit 18f7683e0d6ee6858865d8b0c2d7e2c14abf0bc4) --- stand/man/loader.efi.8 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index a0c0df9a9c35..3527d8b66a99 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 20, 2024 +.Dd September 3, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -450,9 +450,6 @@ copy the loader to the default location: # cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI .Ed .Pp -.Bd -literal -offset indent -# umount /boot/efi -.Ed Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent # umount /boot/efi From nobody Tue Sep 3 23:57:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wz2bp4Xkdz5MhyD; Tue, 03 Sep 2024 23:57: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 4Wz2bp2xnQz4RQr; Tue, 3 Sep 2024 23:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725407830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXiWL1XVIX4764bnSY3Ju1dmeX1A21WUToNwgEoiyQQ=; b=o03XHtF9/V1+yquM2grnoNm0i9pYyLvANhqj6gYRd16rwxSuz3xnZR04iLvw9EyZwKHdKD SHv10WsTJeCHW+Lxnbh0ckYjQNCFngCeAsng97uMHsfQ8STQt3Hk7ahyYmjN4Rc2mBcvqo YOfP+qvDfplB1UG9HuAk+BB/1f6jOUSM3682wzDaBn8aQ6FvI1lJ+L0Q5YEAHcYmv0M+KA QcUpIQYktVaHirwE6kLbu9ZpB5EqKXzzCzY8j87lb6SL/UOuPpOEhk5WdFEIhfVTcoRc5W jhUP0oUr3YQEaGxnszJkxA7dJ1e/QceldXg4xnhcpE2TMy9jFutApMuJtBay7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725407830; a=rsa-sha256; cv=none; b=aMp4DjS2FLCv6VMAEvMJ5sPy+gmLq+77j46WAtb8SrzRp3kn0CkzS0PNPqjt3q8hSrefvc z+SLHvuuc4nY22en6jqNZ+nPTA0V2u8q0fEfq+qXXMKyr6OovwWGeze8hpzImG4XxuvfxX gxwAG2ppGDZ3WZK+SPEd7a96jZaMkHFzglArOAShJkriv92AWNCACvcGjVF+mrw79KZiz7 RODz45KgRHuCtWmA99VKgywX6PLCUDIOEDbSYJcqdzMsKLxJHqBRvCT54CLBoVAy6Vsp6k 6tST5OmCnjCRyo36LqJbUA7UW6bnRfMF0FW92zkA/VqAacWnWoseeVL0892fCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725407830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXiWL1XVIX4764bnSY3Ju1dmeX1A21WUToNwgEoiyQQ=; b=u5YqA5UVep6OSc9l5vgiw4Ts6tjOMuTXtpe5JnB5GnLtlfFYEwNQW0zTxgtT1/EU+S+3Sy gOVTRVRGT9SMQCwVRJbsCALdUODg0o4lSbOCI3eeaaue8ZwIfVGYI4TFOV4tqo+0tpvk6S ECp9saxDihhYfLrtRbhksnQ6IELM0wgciHF27km4TjJpSsPqObTT2CkTmWpZDk3Xd0yZ8Q ES3MhbGGs8PFhyOG0qffVpW1KbM8mzGLP+cbjkA8XQd/KSVI5ZfztR2N0sViWc0FhsUxk2 TpoLD0lVgfPAGTYkuQ96nmKhcMl4ijTvw88DQK2UIdqB9eF6SCvrcJK72MP0kg== 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 4Wz2bp2XT1z125K; Tue, 3 Sep 2024 23:57: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 483NvATT088566; Tue, 3 Sep 2024 23:57:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483NvAh7088563; Tue, 3 Sep 2024 23:57:10 GMT (envelope-from git) Date: Tue, 3 Sep 2024 23:57:10 GMT Message-Id: <202409032357.483NvAh7088563@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: 8aa8d0aa64ba - stable/13 - loader.efi.8: Remove rogue duplicated lines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8aa8d0aa64babc579a55a7ed27ea6385895901d3 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8aa8d0aa64babc579a55a7ed27ea6385895901d3 commit 8aa8d0aa64babc579a55a7ed27ea6385895901d3 Author: Jessica Clarke AuthorDate: 2024-09-03 20:14:44 +0000 Commit: Warner Losh CommitDate: 2024-09-03 23:57:14 +0000 loader.efi.8: Remove rogue duplicated lines Fixes: 871911a4ab73 ("loader.efi(8): beef up the updating the ESP") MFC after: 1 week (cherry picked from commit 18f7683e0d6ee6858865d8b0c2d7e2c14abf0bc4) --- stand/man/loader.efi.8 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 4dd9f66790f8..2128cc99c2a5 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 20, 2024 +.Dd September 3, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -440,9 +440,6 @@ copy the loader to the default location: # cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI .Ed .Pp -.Bd -literal -offset indent -# umount /boot/efi -.Ed Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent # umount /boot/efi From nobody Wed Sep 4 00:50:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wz3nK4LD5z5Mnfk; Wed, 04 Sep 2024 00:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wz3nK34dxz4Xf6; Wed, 4 Sep 2024 00:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725411029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=opAJ3rmIaP4jncYh9LlRwH56DAHVENwRry+k3P11AC8=; b=xV9WYAk6s9fxyQrn7QWzGqh7acqccmm68OvMo+/OedX4qfT1VsaH74Qukz+wymSg+lZUtt cA50N3AB7E+KRKAfYAlgUVP4gXCLwPzTVG/RAqUPhVxhp+sZtVe8gFZT/1ALBaXaWt2DQ9 VEI3CCm+ldVhY4HZqAYatKfrAUam2PG52+3PTOE1x0Gl6rM+/nNUB5XNU8pe2asCkNwuLm DyGzKsztrWGTVYWg6WNmMw5+ZUnDdIY7JbJ0Xa9pDwfP6QcnSuRlygOK/VUQZK9gRiuueJ nLsajdkLS41j4GHtcs/6Bjxjorq2mwKG/8msM0uOkmY3RPbCCviMB40BDnHBMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725411029; a=rsa-sha256; cv=none; b=b2SX8C/6ga0DhAaR0eQPgDKY/xOusaZ4TBJb4Kd9YKpCb1Z0VgNN8mTY0TnmTiMIdoUNJ1 fQYOt+pbHrWXh79c7saDCNnw9YEMo4RZZmDuhEEDmXz5Hq7bXaUzzEUE75E7QEigM8sarx flrFWPf52YdS3XpPY1VeEZEZoi51mdUpvR6GK9XSlE1faQz8TyS9xNQWfQRR44nL8tGlx5 ff4ycpf2IfLhL6lG1IJoqWgDzrZ/T9WiWNOn9kfXt0/F5CUvKE4vsZWT8Os2X3tv6w0eIC X/NnykScFEatAda95gWlmqYag1AXu7YS6HGM3ENpUytQBieDOkLOhWlKnIqSEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725411029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=opAJ3rmIaP4jncYh9LlRwH56DAHVENwRry+k3P11AC8=; b=QZQ6CZs3IwN0yaU2Ay3/vRdfkFjk66n/J9smdRdH77eytGiIYGUJGLd1j0wl/8nb9YWkvi qlvOCcId7XIFxg0m2hRkiyNCrqgMNANwQUCbQJw0RFtpX/b8v0F/yZpLpT6g7IMBQ/EvS4 FmBHRQaBGyF1NV5F59ZKL4NaPxt5dAqqmYCvIsqqPulJFWg+pWwPmAflhwJsbzk7iIN9xj aTG6iBaBXZIuDIkhbvmiTBcV16xtYCbZs64FYcNO0LpIDls4GlaUYFwcRN4UnM90865rtJ DSu+rbhIkkqsU/7tiHnl6+cIxybcMnBq/OFC6xAEOOJ5hr39WwqTPNziMHgs8Q== 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 4Wz3nK2fy0z12j1; Wed, 4 Sep 2024 00:50:29 +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 4840oTrK081767; Wed, 4 Sep 2024 00:50:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4840oTXl081764; Wed, 4 Sep 2024 00:50:29 GMT (envelope-from git) Date: Wed, 4 Sep 2024 00:50:29 GMT Message-Id: <202409040050.4840oTXl081764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 34f40baca641 - stable/14 - x86: Detect NVMM hypervisor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 34f40baca6413a85e2531d21a616f1b2042c08cd Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=34f40baca6413a85e2531d21a616f1b2042c08cd commit 34f40baca6413a85e2531d21a616f1b2042c08cd Author: Kevin Bowling AuthorDate: 2024-08-28 09:31:35 +0000 Commit: Kevin Bowling CommitDate: 2024-09-04 00:46:48 +0000 x86: Detect NVMM hypervisor (cherry picked from commit f622dc5daecc5c05504cfc605b6f2d66a3bd90e8) --- sys/kern/subr_param.c | 1 + sys/sys/systm.h | 2 +- sys/x86/x86/identcpu.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index b7dbf606f492..c0a4ac747d00 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -158,6 +158,7 @@ static const char *const vm_guest_sysctl_names[] = { [VM_GUEST_BHYVE] = "bhyve", [VM_GUEST_VBOX] = "vbox", [VM_GUEST_PARALLELS] = "parallels", + [VM_GUEST_NVMM] = "nvmm", [VM_LAST] = NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index eb690b1cf4b4..581b981ef9e0 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -81,7 +81,7 @@ extern u_long maxphys; /* max raw I/O transfer size */ */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_GUEST_VBOX, - VM_GUEST_PARALLELS, VM_LAST }; + VM_GUEST_PARALLELS, VM_GUEST_NVMM, VM_LAST }; #endif /* KERNEL */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 7df20053a9d1..36056b85101b 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1361,6 +1361,7 @@ static struct { { "KVMKVMKVM", VM_GUEST_KVM }, /* KVM */ { "bhyve bhyve ", VM_GUEST_BHYVE }, /* bhyve */ { "VBoxVBoxVBox", VM_GUEST_VBOX }, /* VirtualBox */ + { "___ NVMM ___", VM_GUEST_NVMM }, /* NVMM */ }; static void From nobody Wed Sep 4 00:55:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wz3vM5cc2z5Mp6q; Wed, 04 Sep 2024 00:55: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 4Wz3vM56Shz4Yhr; Wed, 4 Sep 2024 00:55:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725411343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U36518dUvQP0GZfrmjIlvQv70jcBRZ/hgZBeTyJ2aGc=; b=U34NJVQOfVvJQawKIiRRxZuMVTp5uJqcDR6otdtzdNTuoo6sWRm80KYxUf2j7V57NtKRIK QymGoqZyC+ekuIK/0MfYBfYgREIeCKC08g+E8lrLj6yzlt+q11oKiAQG9hSjUnW3TOKo/9 6+FYkCEls39kKpImdMdc+WQp08eSs1F3lVDY/OIc3W0qWopY3bR24c5TrpVSYaoErtFWWU OzKgwqBITLtxXn6Ga5BLnhnz6ZLMEKOLxVMjubTR0fa8zzHb2EbpaLk+8D4hA3C0DO/eQk i7xrA+IESDkL3w6HbRFS3txFT8YxSafl39HyDhG3hVFlSakVaSgH6FSltkHp+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725411343; a=rsa-sha256; cv=none; b=kLmEqPOBIKstPhKH0F9fhANyTepG10s2++tw7LbWLBTGh9CmJBjNgwyuTVYbNNW0Z0aprC c/GEUZhvQb9YN+8VNch74AGpcfucQqzYCXFPcHF1w0S6le0avYBfTrnLCFZjCai9SywcpX KYfdiyyQC35qBVfFxDU7r1XgyOpQ7rtxDbwy8904tiYdd/cahw59LCELSsA4fgbD7VA+vY mOr7skDjuwflmctRLMcTQ8bY4qIY7+jSGYo3RkG39MVphTBHj+YYD7tQ23Gtb6cO5PsiVx 7HGSJXEq+kWakuCiGypwHFtRvhJx53rPRq+FjFYf0+7Dj46OENVW1T4nl3eSpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725411343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U36518dUvQP0GZfrmjIlvQv70jcBRZ/hgZBeTyJ2aGc=; b=nRt9EaFO7gbOKZFg1uU6Fqk2i/RWOMj/ybcpXz/tssSm76z4Sb+47RyKSM51nz1YPcVxnH I1kify+b78DrJrea9u4dekCLf8pX9O+OifSI/+LXoMTYOjWDXQzZW5JfQWGVYwyZ/pj4EC CCFQ8o0XOGpgauJabjdGW5UfCpQ0Y47W6HX9bmGmJ61CGZ9rhkM4V5loWLEeyBZvF+BFcD 88biwh0oBg8dmn+62276Zvqyls6WDCSTuhLN2D6MWKDj7dmC9DopmcSUpfezmuGIGFgji8 qoLRBlcPfJtXAKqNfVX8Iaep8xNY1HvrWwZOxhmPLiDLZToOaeYLUrNvVHnfXQ== 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 4Wz3vM4jwQz13WM; Wed, 4 Sep 2024 00:55: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 4840thB1090082; Wed, 4 Sep 2024 00:55:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4840thg5090079; Wed, 4 Sep 2024 00:55:43 GMT (envelope-from git) Date: Wed, 4 Sep 2024 00:55:43 GMT Message-Id: <202409040055.4840thg5090079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 9fe5e83e44d6 - stable/13 - x86: Detect NVMM hypervisor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9fe5e83e44d6f7dde23b60ed6e09626d31e5c46a Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9fe5e83e44d6f7dde23b60ed6e09626d31e5c46a commit 9fe5e83e44d6f7dde23b60ed6e09626d31e5c46a Author: Kevin Bowling AuthorDate: 2024-08-28 09:31:35 +0000 Commit: Kevin Bowling CommitDate: 2024-09-04 00:52:30 +0000 x86: Detect NVMM hypervisor (cherry picked from commit f622dc5daecc5c05504cfc605b6f2d66a3bd90e8) --- sys/kern/subr_param.c | 1 + sys/sys/systm.h | 2 +- sys/x86/x86/identcpu.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index c2672d98ba8d..0ea2279ef2e6 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -162,6 +162,7 @@ static const char *const vm_guest_sysctl_names[] = { [VM_GUEST_BHYVE] = "bhyve", [VM_GUEST_VBOX] = "vbox", [VM_GUEST_PARALLELS] = "parallels", + [VM_GUEST_NVMM] = "nvmm", [VM_LAST] = NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index d073c87af163..ee432fb0d864 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -81,7 +81,7 @@ extern u_long maxphys; /* max raw I/O transfer size */ */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_GUEST_VBOX, - VM_GUEST_PARALLELS, VM_LAST }; + VM_GUEST_PARALLELS, VM_GUEST_NVMM, VM_LAST }; #endif /* KERNEL */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 992dbb421aa4..8a5d74ca5a2d 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1388,6 +1388,7 @@ static struct { { "KVMKVMKVM", VM_GUEST_KVM }, /* KVM */ { "bhyve bhyve ", VM_GUEST_BHYVE }, /* bhyve */ { "VBoxVBoxVBox", VM_GUEST_VBOX }, /* VirtualBox */ + { "___ NVMM ___", VM_GUEST_NVMM }, /* NVMM */ }; static void From nobody Wed Sep 4 05:46:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBML2BwJz5V9J8 for ; Wed, 04 Sep 2024 05:46: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 4WzBML1ZXNz41l8; Wed, 4 Sep 2024 05:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725428814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6b4YjpvF62zrhmoq2V3AvZTtThBRmshp2QfaCHWMG4o=; b=hIC/wNr8a2Ff8yGeBdaWyqmmgdVmxe1hQ2h8BgeOYe9ydbxDtilGwoVUJ2mQCn87JAbeW9 Ss8qdXgaAqiqeOMCIe9A45fkgCWbppQwhorWpXRBJvt4TRrE9fqnp0/Sp5Neq30whlyzWh dw5pcqQrOpJLvprvtC7eTUjheNnN5kqPFFP+f15h3eHMrpzuPHvmh0ZQ/4VTeX0oJtT6NN nieru7VzCn+Kkhs0xGTbw5T/ildKVnas2uQSBDmKtRk7hT2lHSJ4Mq1Y0OoamfBxRjwJCR 6RCGe9XgrKeRGikhGSksaNIUpomXu0tspYu83ukTMDKcEroIlRxrGfdRSchf0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725428814; a=rsa-sha256; cv=none; b=CjVMeebvmfo5mjGS75gFWihW2Jnco78+NEAIvMWzhBxegL2Sc2JhG5rJ4py6QRNcGXHOt6 aYOuXhaSLAIyUv472p3RqKQmvIvr58KnNXdkgUV2Xcd7vupU0v75+5AJTfCIi5WSRYVzoy dowf7FTSI0x4sVzjfaUj9MqkAWFXcLLA5L7y8Lna9PtubLppOSOhknwypixUVd1oZ0kZkm lMnEGj8G5uLybAO2UcfiPJBaVm5idF9Xw4nq8xz00WthpNMk/Citgpvj2NPUjifUJBprQc 32Ao3Rb1BLPl6uMniVhOwPq1ie/aQyt94OxkYFtYGYulhLniqf2TjWpNh8jPSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725428814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6b4YjpvF62zrhmoq2V3AvZTtThBRmshp2QfaCHWMG4o=; b=OWQV9QjXVnlqqEOSW+O6ZDVueOB0nE5OMmisr70yX1AZ8aAjgAn4Xi9RQHinECBvt+9OgN xjw0ywTQTwpmexV7146n1t5xxduOTjufvWjqEqNLEv4MZxF/VZRtsi7kIp0FEMD/t0VxH+ 1m1ysgincvb5Gts/ZvGvFIDapTuCRFd0i98o+ilQwttkThIXSZNphn6HgD6uD//c0LMsFU uG1blegGf+pB8WVH4UVWTxF+XHyquBSRgwIMzCcG0LHiniPoEUVkVI9mXqcalMzsxSH962 mfT/GQX/9DZmrlDBZioisjVJlhmRywoglvRjqVqm6975CU3P1Q7ZTFQGjAi67w== 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 4WzBML0lTDz1Bfq; Wed, 4 Sep 2024 05:46: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 4845kruf081885; Wed, 4 Sep 2024 05:46:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845krIR081884; Wed, 4 Sep 2024 05:46:53 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:46:53 GMT Message-Id: <202409040546.4845krIR081884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Gordon Tetlow Subject: git: e60dbfd00b00..108164cf95d9 - vendor/openssl-3.0 - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssl-3.0 X-Git-Reftype: branch X-Git-Commit: 108164cf95d9594884c2dcccba2691335e6f221b X-Git-Oldrev: e60dbfd00b009d424dfc5446d132872c93dd0aed X-Git-Newrev: 108164cf95d9594884c2dcccba2691335e6f221b Auto-Submitted: auto-generated The branch vendor/openssl-3.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/log/?id=e60dbfd00b00..108164cf95d9 108164cf95d9 openssl: Import OpenSSL 3.0.15. From nobody Wed Sep 4 05:47:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBNZ1zClz5V9Zm for ; Wed, 04 Sep 2024 05:47: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 4WzBNY5YmWz420c; Wed, 4 Sep 2024 05:47:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725428877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vgWhMoNIyH+L9rDCxGXo6UngDQGMrq/VTWOjxz91Zcg=; b=O32XJjOMD5JCyGTIjv002jpovPTgDXAd0u95vnifXC5EeDbi0MrmPzu+Gc9d6Te6QqST79 yUCladlgbRcIjJBtvokkCSQyYsx2ShTuFJPC+qQE7INqmz1EfLK550n7Y3AUSkMlHc6zt6 9J2ndhfZi2l880RAWT3JaQs1fzBcFu5qjlflrfVJCIkF5wK3QTYI+NvqnAMmYhGIk+l6jd P728CLbWab/AZ/DV2i/gObeROsLaMwuENHxga+ZWNDZwX6YMgoEZov8yq2R58CPe+CI3ba /k0CcgwiyTi/n+l8zYj3e9kX4YzJpCQR+RmW6f/dAL6vl+m3K+IxGT6MFDb1gQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725428877; a=rsa-sha256; cv=none; b=RD1sRPGuFHIZBSMTOi0FJck4L01zM2rVl9xzALGfOE8DbtuVz2a42BStD1OTBDE9JDQbgv jGsnfG/DSw735GS7M+W8ELdnR/RxhfVwCf+bTkfzRTCdBQSo4x0L2Fa1bZwWBeAc7Dsodv wvYaJLMdEk7usUbOED5GHGTM1hnkbU8jr07ixrMhJArRVansEGWMcL9HugvyvK+XgAGJhk vn6Y/EsON/biP0vEbS3/RJPTMnyZM9ahnLuYcsc6O4q/Zr9WKDJFUuWQjiVcjzfE4TqrE+ t16HXCdYOk3mP2Aa39fAhZYhDdVBCBex35Mg7vu8URF3TrJXJ/HQ/5XGiFbFCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725428877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vgWhMoNIyH+L9rDCxGXo6UngDQGMrq/VTWOjxz91Zcg=; b=b0G/impmzUnAsWlVSKWolBtBVEiGQFP78SCf1LRjoJTr4BQcXIWFp1bF0dCiJG4lV0ZbQo sgwMxGImTo25pEAjUkCW0c1ybun2vp9+/LskAdslHT7R9tQV7tWue/xQdtKZoMonaqpLio IiFtgIVjEeycoDoWdJq8unCeecMqjebe4zPmvtlnZD3F6lqhcaRIvfkneDydFAI64miPRv 5xlJFtG/cbhY3ZQjp2F2wgJTbJ8ylJYlL0k9KrT0JNhnG53HQU6gKlvlVFufwR9KLShwin FtI/mxtjhcIvtAoWDH2XoaO6Vz9yx/LwIS6W9UhZud2/f5ry0EhdKdz+0nFkBw== 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 4WzBNY59tSz1Bfs; Wed, 4 Sep 2024 05:47: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 4845lveR082125; Wed, 4 Sep 2024 05:47:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845lvrN082124; Wed, 4 Sep 2024 05:47:57 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:47:57 GMT Message-Id: <202409040547.4845lvrN082124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Gordon Tetlow Subject: git: 6790bf9b5a59 - Create tag vendor/openssl/3.0.15 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/tags/vendor/openssl/3.0.15 X-Git-Reftype: annotated tag X-Git-Commit: 6790bf9b5a591fe0442e4ea227f1fb21080fae30 Auto-Submitted: auto-generated The annotated tag vendor/openssl/3.0.15 has been created by gordon: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssl/3.0.15 tag vendor/openssl/3.0.15 Tagger: Gordon Tetlow TaggerDate: 2024-09-04 04:02:33 +0000 Tag OpenSSL 3.0.15 -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEuyjUCzYO7pNq7RVv5fe8y6O93fgFAmbX29wACgkQ5fe8y6O9 3fh6igf/ZfMQQgVOQx4op/MxElHibz511dmUrhSEbOtfKEdgpxW9a2jzVja8COyz ABJUDZGHp/Ja8t756P3z6RPMKrFEf/l6JuPucsy6Nuu8YTw+Qiz1Nf9Dj0N91cuF OL4bKKhj87C1ssTH4jkIvY7r3lwtwh8VZA8luu5+PAiqDy+sxL3FqBO6rv5cKPmj bD5RiZvAgA0j4y3lzryb0FOEn8hEKigQr9lYbBnqiJ1K6vZICqNeZiNdz6Qom6HA 5fC3ok6lM353ckCFvvV8pbb/mKcSvlQgs6ThVejGJIUuHdjVbv7ZV/1xwsa6YXew WJ+crOOL/+GeiuCNlxzu8eEuRShR7Q== =pdcb -----END PGP SIGNATURE----- commit 108164cf95d9594884c2dcccba2691335e6f221b Author: Gordon Tetlow AuthorDate: 2024-09-04 03:56:17 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-04 03:56:17 +0000 openssl: Import OpenSSL 3.0.15. This release incorporates the following bug fixes and mitigations: - Fixed possible denial of service in X.509 name checks ([CVE-2024-6119]) - Fixed possible buffer overread in SSL_select_next_proto() ([CVE-2024-5535]) Release notes can be found at: https://openssl-library.org/news/openssl-3.0-notes/index.html From nobody Wed Sep 4 05:47:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBNZ226Lz5V9Zn for ; Wed, 04 Sep 2024 05:47: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 4WzBNY60Pkz41mn; Wed, 4 Sep 2024 05:47:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725428877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMQFpOr9zxCM+l4qoLzQvKX8w5hsJSS9/TXR+qeQKVw=; b=lVwXVF7HXVR4/JtByv8DFcXIdUMDRsnJLVMsJIUGRgyBWArOOhslEJwWIeA3Nzs+yz/lYb MsVhLyzfx7u0wee+hZjz3dAxWQiklYG0cRr7TIeLMnmDKmGfk8rvJVp9zbJDGvo+RzbUrc oU4kW3yYk3ougx/DISnD+TG9LFOVqtv5Z/WzFlWsorArg7aTY9nBfmVUId7wFqGT1C3JO0 IfxN87OQBAKooDlYiZL3k+UZBLxkGSbuZd1TxxSeND6ULcNsw9uvHZnb5JEyOo8Eg4k+mo azz99OsF94ElGWm3lAhHzJAg4Jm3nvYV4mBy0OahlQNKCW14OqQ8CDwjvJlnKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725428877; a=rsa-sha256; cv=none; b=Sr7m0333OKPUfrgEQgO+aiZauPvSQLeSh3BJGXZjJ2CDJOPphlYTjuDN16eGHMWlLVeqWF Wkw9i5bbwUKQ2kBqpvZ+dfNwfF6f1nKcqJlJJyI3joY/JNhMJWrVV0Az0gih4fVhKClQ0i lzCAQw22PDSx0WwqKlFeQkdh/pMOFkdxFtD6AHhb0DZ8re9UIr0tmZPCRbCCnT/67Z7V36 5jzoSjFjlzCKmwnMtQFwLpPVgIc9pcjWrk3UUyWjJ/sBADxoRKXd8rsP6j39Lzf8dcoMlU Gt0EvygrjHTavdlJ9R85LUzl0p6huSaCk5814t1hSzcZvK63bKzsuJqTLyYuig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725428877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMQFpOr9zxCM+l4qoLzQvKX8w5hsJSS9/TXR+qeQKVw=; b=c42D1LyHGxnpmd8q7QDWXIzECt6+h2/73HYvtuBVPj3OmBAV1OJJm7Y89W3OAd1gku4pCL C3Ny2C2tlem5xlxjp9QdX7wHEEnadCeAPA6sso7qrmnYEzXe0wIjLsRiW25gTJ4LPYBbs2 aoJJ/Wef9FihCsuc7N7v9DYQUbFk7rqgKkCu2CYx0qID6qpPZA184mH3jZZQ9/JzcFei38 G04QB5EUfIshGYS+qqCIhDO4Sm3q+3G84MSi+kLbw8I32Ubx4Thrcw9t3Zgf8nlIz9wSRZ Mq80C8fk/LNdoptzGMqmAxTjQZQ8rFm89eCWGmv4Yd5awWMkif/sMrDPiGCvQg== 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 4WzBNY5cTzz1Btl; Wed, 4 Sep 2024 05:47: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 4845lvf9082144; Wed, 4 Sep 2024 05:47:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845lvfw082143; Wed, 4 Sep 2024 05:47:57 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:47:57 GMT Message-Id: <202409040547.4845lvfw082143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Gordon Tetlow Subject: git: d4aa2df5b240 - Create tag vendor/pam_modules/passwdqc/v2.0.3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/tags/vendor/pam_modules/passwdqc/v2.0.3 X-Git-Reftype: annotated tag X-Git-Commit: d4aa2df5b2406bd3115de03eb871e04200753b35 Auto-Submitted: auto-generated The annotated tag vendor/pam_modules/passwdqc/v2.0.3 has been created by gordon: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/pam_modules/passwdqc/v2.0.3 tag vendor/pam_modules/passwdqc/v2.0.3 Tagger: Gordon Tetlow TaggerDate: 2023-11-03 17:39:23 +0000 https://github.com/openwall/passwdqc v2.0.3 -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEuyjUCzYO7pNq7RVv5fe8y6O93fgFAmVFMG4ACgkQ5fe8y6O9 3fhKxwgAmkjstM82yYsZqQsJcQCmSFnUGRLfRAFmB5hyDsb3SVitBb993iUjtpeT j3Km5ey83D9e0Nolohjcs+rbcJIN/xguMIjXPv86ykxDBkDBAbyVDvJzS7DSK0Oe I5QOMXzi18hT6uOTjy3FD0NEIii7cUXUA0yFZiV+JOIMBxvZ3L+w19Ps5FeHuJ0R hxiAu1STMf2tFISGyEr+gw5C2KHyisY/HeUugJ0+hvl5Uk7Hp+o+x08cBxRb1SCj hiyD1jYsd3WNLQhDv4M5nvJ7pXc914CDpXGXU4qy4nhXKxb9Ze7i+jc+tTSz5dhu yAgJWS6kYJsMXf9/da8rYqa4oRXxNA== =jkmq -----END PGP SIGNATURE----- commit e4fe068d29c902225fa3733db09af214cbfb3c02 Author: Gordon Tetlow AuthorDate: 2023-11-03 17:37:48 +0000 Commit: Gordon Tetlow CommitDate: 2023-11-03 17:37:48 +0000 Vendor import of pam_passwdqc v2.0.3. From nobody Wed Sep 4 05:57:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBbK1Kpbz5V9tx; Wed, 04 Sep 2024 05:57: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 4WzBbK0J6nz43Wl; Wed, 4 Sep 2024 05:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vt0Q3/k+6fxERkkq6n5oFx9+2M14oQf52REWFY5lyCE=; b=oarZBOiVI+RSIx8MqO5AT9tcTnlP4+yctJJnl7BtUFB7rguXTQpOu1t3J/+2dOHiEe0ipL Xd2RJWgxWeISv47mnofXGXoBswQPtfcS8CLUSIjO0plye+Ge+F1ZoCOlHWbnXDexQ+ECVu tfgQ2QrdN5uaX69LeQQQLfCqfBfPF8PcRLhWlMaUsUo72qIzh422TJ2/il9zmvOf9ImVtv JG0h246RnRpZNAx1Jc1cJhPJr4xGMzG4oUKQEdgbjIvE7aNx3cp/osq+U0OpH+VqfQp6a4 D/88ewIa6F1uSXmL9+3lPeOyHCVyLerUrQE/qalC1WBUPzHqGFOTcXIv+X6VMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725429437; a=rsa-sha256; cv=none; b=SJU8BMaVCvSp2Ahvb80hS4KZXAfPZjRownXf3m8bEr7ewGnF3G3JvfkeGa4vKdnTJtLoM5 FZFgE+unWldWUUGGUWYo4Rw4aLSFU/qwzy3Cx05fSDJVkV+tVDKwejBeLKKkub3IJcnF93 kOmFtATqJqNscIf7I4MNqSnhGkYk9qWmNDjEHOGsGFQoTNozkI9IwJ8nH4vIuUD+DlWI70 OLFDH4EnFBJ/EAGVjU0ivEVujrLRa2HmTG14cWQbP0ZTco54Py226CKVqRuO5OWEnVYSou m5SJ4a50pVVTmvviTwON1URUuk0aCUECsBkcOPt/Ydtld7lpx9yjO2KiHkCEEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vt0Q3/k+6fxERkkq6n5oFx9+2M14oQf52REWFY5lyCE=; b=GPF6B2v/8yJBdysb4LyHUYzJRm4nbKKmZSvvvIy8kUPCikcRlaAlc+ZXLIiS3liwoGzG11 VLYG59ikRVn1lrXabLZCW8PiUdTXJ7ncLrFqykcQ/+IK7zqWRyz/inuC5QZAA37Ro7nG1y Gwc2+RyBh6seMph715pg2+yJGk6jRTqroHllMUhn9+NViMUOe+0ESit5FDEP7kXSSHlRpw rlgRhc6MipMs1BEvfZqDXlL5wd24UXqqE8PYr+EO9raMr5vx568TMIpNo7AqKnQ1SXt/xf wLWrzUmv5HT5sLfmW14FgHIlJPLKHFKPEvUibsp6wGGumbSyx+C3T2yDIVvvcw== 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 4WzBbJ6vX8z1C8J; Wed, 4 Sep 2024 05: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 4845vGKV099275; Wed, 4 Sep 2024 05: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 4845vGvZ099272; Wed, 4 Sep 2024 05:57:16 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:57:16 GMT Message-Id: <202409040557.4845vGvZ099272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 81d3df02bcf5 - main - vmimage.subr: Pass $INSTALLOPTS to install* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81d3df02bcf5ed6e41a91fd9fbc3b81cfe809ff3 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=81d3df02bcf5ed6e41a91fd9fbc3b81cfe809ff3 commit 81d3df02bcf5ed6e41a91fd9fbc3b81cfe809ff3 Author: Colin Percival AuthorDate: 2024-08-31 23:38:02 +0000 Commit: Colin Percival CommitDate: 2024-09-04 05:57:06 +0000 vmimage.subr: Pass $INSTALLOPTS to install* This makes it possible for a VM build configuration file to pass options to make installworld/installkernel/distribution, e.g. WITHOUT_DEBUG_FILES=YES in order to produce smaller images. Note that these options are only applied at install time, not at build time (since the same build is installed into many different VM images), so not all src.conf options are usable here. Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46506 --- release/tools/vmimage.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 9a60be57acf3..5d98b8990705 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -52,7 +52,7 @@ vm_install_base() { # Installs the FreeBSD userland/kernel to the virtual machine disk. cd ${WORLDDIR} && \ - make DESTDIR=${DESTDIR} \ + make DESTDIR=${DESTDIR} ${INSTALLOPTS} \ installworld installkernel distribution || \ err "\n\nCannot install the base system to ${DESTDIR}." From nobody Wed Sep 4 05:57:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBbL3qtzz5VBM0; Wed, 04 Sep 2024 05:57: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 4WzBbL19wMz43pd; Wed, 4 Sep 2024 05:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gHq8SYD5jkjeo1ByxmbHXg9mh3aLN+s3p2P/ywe9D4=; b=OVzuOr44f2p/xp/Fmn6cgZyY8SNOQ8OdSbEYCKDCvqThNodou5v896kqGBu+gfrEO0XcuO o5yJtA4DLIxPNEHE7Q8S9B3xhEYwfleyHTL8jFO2M83pMyvrPEFiTlqNuzHl/Wof9VRAOG G+i31ceO238hocQd983I6MDdwlHV1WOGMYxkYlu+Les7gWBINSS/xYITo/SSIINWfpRrHM nCxkkBvEV/njKBLi5445EKgf+AqCEqMk5WfL/Am1vBvxbcfrpTCcHPhEuTtMbeKXIYAaar zJzpj/crIm2IoZtOo0w+0jGWP+kuc3HtJ914yg0EYofz4Nmro4GgLDDzWFTU0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725429438; a=rsa-sha256; cv=none; b=uc7wznWuJxfcft3V74EopKWbMnoMtGUKgJ+X0NJJjzbN6ThhybAumyMmaszwsmP7PonJUQ N3XuWAdFgLhk1e85JROZkL3ymUWMGTCRIDmJY62Ee36WM0EdcxihicUvZU8SgeVGTAgZ4K UlAOlbb4oQubSDFMSkmgqxjahjJvAKF6a9UvDRefJxZxfoupZUNZdv/idtCQD5SjqwzRAF DxRS+dvxl+BoYmjwvdE9WlBM0Qmk6WKVNd4FRn05E/0ZLJTHK/eKzzMPq9zPv3RumYO4TK 5zit8MU1kjiScT5fHQWmijVqsU/rbAnBCPhAsQFIVWWtOjEQxD9zc+1U1u0ClQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gHq8SYD5jkjeo1ByxmbHXg9mh3aLN+s3p2P/ywe9D4=; b=XcU6OLaNJVBIzzj41G4rBmejWhJVQlJJ2diw/Y7pnT2NrhKzn6DWf7UCiOfY8uHqTNXkhe gYCHUAy1rhZVcZt4q6aqVy88OucB5/7EvzzNbKZ8JcIFbApoqVDO3Hot6FukBye/QRk8wj hrT+z+ZAVCnhE435NZlyiqKjaBj9H+mrfjZ0hmS6vRFJ4XpS6GWvE+Uwh9r0EsUJi89GY1 ilMTd8y/RqIKXBm/xDHpITvCdPW38kUeOqOG31FStZ9fPY7rOnV48djy1kBjpgw2rODSsN vIstyfag2TRSLqMEATiyCqhjRs/KEwFtcyZhPHKg0bMObR1qK89Zv9tvLRdvbg== 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 4WzBbL0m86z1C6P; Wed, 4 Sep 2024 05:57: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 4845vIvw099333; Wed, 4 Sep 2024 05:57:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845vIvR099330; Wed, 4 Sep 2024 05:57:18 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:57:18 GMT Message-Id: <202409040557.4845vIvR099330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: f961ddb28d69 - main - EC2: Move network config into a separate function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f961ddb28d6909d4c67e3e0b6b60498bbcbf64cb Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=f961ddb28d6909d4c67e3e0b6b60498bbcbf64cb commit f961ddb28d6909d4c67e3e0b6b60498bbcbf64cb Author: Colin Percival AuthorDate: 2024-08-31 23:46:51 +0000 Commit: Colin Percival CommitDate: 2024-09-04 05:57:06 +0000 EC2: Move network config into a separate function Having the "base" FreeBSD network configuration (aka. what is used when not using cloud-init) in ec2.conf will allow us to reuse it in other AMIs. Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46507 --- release/tools/ec2-base.conf | 26 +++----------------------- release/tools/ec2.conf | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/release/tools/ec2-base.conf b/release/tools/ec2-base.conf index d80035e11ed7..bd2c510cd1a7 100644 --- a/release/tools/ec2-base.conf +++ b/release/tools/ec2-base.conf @@ -22,29 +22,6 @@ vm_extra_pre_umount() { # via EC2 user-data. echo 'firstboot_pkgs_list="devel/py-awscli"' >> ${DESTDIR}/etc/rc.conf - # EC2 instances use DHCP to get their network configuration. IPv6 - # requires accept_rtadv. - echo 'ifconfig_DEFAULT="SYNCDHCP accept_rtadv"' >> ${DESTDIR}/etc/rc.conf - - # The EC2 DHCP server can be trusted to know whether an IP address is - # assigned to us; we don't need to ARP to check if anyone else is using - # the address before we start using it. - echo 'dhclient_arpwait="NO"' >> ${DESTDIR}/etc/rc.conf - - # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold - echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf - - # Provide a script which rtsold can use to launch DHCPv6 - mkdir -p ${DESTDIR}/usr/local/libexec - cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF' -#!/bin/sh - -/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1 -EOF - chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M - # Any EC2 ephemeral disks seen when the system first boots will # be "new" disks; there is no "previous boot" when they might have # been seen and used already. @@ -53,5 +30,8 @@ EOF # Configuration common to all EC2 AMIs ec2_common + # Standard FreeBSD network configuration + ec2_base_networking + return 0 } diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 602216d3c2d4..09cf1ce0017f 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -104,3 +104,30 @@ EOF return 0 } + +ec2_base_networking () { + # EC2 instances use DHCP to get their network configuration. IPv6 + # requires accept_rtadv. + echo 'ifconfig_DEFAULT="SYNCDHCP accept_rtadv"' >> ${DESTDIR}/etc/rc.conf + + # The EC2 DHCP server can be trusted to know whether an IP address is + # assigned to us; we don't need to ARP to check if anyone else is using + # the address before we start using it. + echo 'dhclient_arpwait="NO"' >> ${DESTDIR}/etc/rc.conf + + # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold + echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf + + # Provide a script which rtsold can use to launch DHCPv6 + mkdir -p ${DESTDIR}/usr/local/libexec + cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF' +#!/bin/sh + +/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1 +EOF + chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M + + return 0 +} From nobody Wed Sep 4 05:57:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBbM3ls0z5VBM2; Wed, 04 Sep 2024 05:57: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 4WzBbM201Nz43Rk; Wed, 4 Sep 2024 05:57:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pj16YpnrDkwhhNrTe/xmLNgTx7JapGidX1dl1KGv71w=; b=G003fYVQ0H4YTTUUVHUMUxGUNBw1Hr2QO6JpvLc8bi/m9pp2kQRVlJwDTe+P//5HKQLK5j s34LVvuJqqROn9pvy5ddOw//RGGedQ94M0lGRjhyQgD60BOSHbpwmTPLwFFzoiYvl4R8By lmgfxRtySX6WKJ/3XWes43RyS1QwAa3ntg+9oJ0USNEiv6VaPTO+W1LHobEoTMlDa+SEVQ hewNj2/Kb/+GlQ5LkXvKZFs57wrzCeVhbAi8Kn+if+ImkCDwYHZlgiKkky07HqcqtDyoJU /+PPrO6FS0ygPYECjXv2UnSFGf0tI3SKA06qjUIGFuz4tQAEzWU9Ve8ZL90Zng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725429439; a=rsa-sha256; cv=none; b=EteWEjg7BykXk3XI3nIfXlHjuoZk7xqjh4wughS9Pes82rNrrYcUja5vtHxHdVTlF0uPNA t+59SPyFq7Hu4uCKm8j1YmnfHiYbV1+ctPSugq83M8FjgwiD1eIndHlzeOWtYghstyDMyk 6FKpy0WpZsndkMpkA01l8GHohp6RIzWnHPj2BTFYTqS0uRaZWWI1EIqm/SAr+sgnNs4wT1 dA/JG13G6hSR59IYjo520V1tZvBbuWNfLnawKiHxJtcdY69+DPPG40Xj7X+DWRIHR1uwhq CUmJUtcr/iyiWamyKOie8a9s9eT0IXpp096x13e5aG9EN8NKV2KxaYK0AULLVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pj16YpnrDkwhhNrTe/xmLNgTx7JapGidX1dl1KGv71w=; b=F0OwT30fpFP9a2nrTA6x+WW2pxA9TdXwOur1UFtMhfNn8YgcbEFY//3B6fTwGzq7e1wccF Cq1iLNVaK7Ow4c/H6Mkhv4lnTLf9vYiSu8aYU4ElQ1m/xMLHSAl5lXyED3Ecxhyj/9XHvR BvkInFY6Fwxc9Y1Hk585FG7zyhGM3xuTp4fAvhPTfuh2wvfHSp+NT+7pH3riXd4tSyFCV7 KuIFil1wwyaoPj9SgpKyteqzCfMfoXX07IH3X9kEk0gDeCFWBKUxHD2yIXwMt3xCD01ol1 LStNdEZ+6lkl6V4L8rjYUkzF3JVBrMM800lSe7tvPiPjCBwhmH36le5dyj9T5g== 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 4WzBbM1YBcz1BgY; Wed, 4 Sep 2024 05:57:19 +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 4845vJch099379; Wed, 4 Sep 2024 05:57:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845vJtf099376; Wed, 4 Sep 2024 05:57:19 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:57:19 GMT Message-Id: <202409040557.4845vJtf099376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 40ff0753abb9 - main - EC2: Make amazon-ssm-agent optional List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40ff0753abb9c00b5f1e5df9ea00c9fdded55ac4 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=40ff0753abb9c00b5f1e5df9ea00c9fdded55ac4 commit 40ff0753abb9c00b5f1e5df9ea00c9fdded55ac4 Author: Colin Percival AuthorDate: 2024-08-31 23:50:16 +0000 Commit: Colin Percival CommitDate: 2024-09-04 05:57:06 +0000 EC2: Make amazon-ssm-agent optional Move it from VM_EXTRA_PACKAGES in ec2.conf to VM_EXTRA_PACKAGES in ec2-{base,cloud-init}.conf Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46508 --- release/tools/ec2-base.conf | 4 +++- release/tools/ec2-cloud-init.conf | 4 ++-- release/tools/ec2.conf | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/release/tools/ec2-base.conf b/release/tools/ec2-base.conf index bd2c510cd1a7..3ed20474a4e8 100644 --- a/release/tools/ec2-base.conf +++ b/release/tools/ec2-base.conf @@ -4,11 +4,13 @@ # Packages to install into the image we're creating. In addition to packages # present on all EC2 AMIs, we install: +# * amazon-ssm-agent (not enabled by default, but some users need to use +# it on systems not connected to the internet), # * ec2-scripts, which provides a range of EC2ification startup scripts, # * firstboot-freebsd-update, to install security updates at first boot, # * firstboot-pkgs, to install packages at first boot, and # * isc-dhcp44-client, used for IPv6 network setup. -export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ec2-scripts \ +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} amazon-ssm-agent ec2-scripts \ firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client" # Services to enable in rc.conf(5). diff --git a/release/tools/ec2-cloud-init.conf b/release/tools/ec2-cloud-init.conf index 7682d635b1d6..048202e252f6 100644 --- a/release/tools/ec2-cloud-init.conf +++ b/release/tools/ec2-cloud-init.conf @@ -3,8 +3,8 @@ . ${WORLDDIR}/release/tools/ec2.conf # Packages to install into the image we're creating. In addition to packages -# present on all EC2 AMIs, we install cloud-init. -export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} net/cloud-init" +# present on all EC2 AMIs, we install amazon-ssm-agent and cloud-init. +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} amazon-ssm-agent net/cloud-init" # Services to enable in rc.conf(5). export VM_RC_LIST="${VM_RC_LIST} cloudinit sshd" diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 09cf1ce0017f..2cca5fa713af 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -1,11 +1,9 @@ #!/bin/sh -# Packages which should be installed onto all EC2 AMIs: +# Package which should be installed onto all EC2 AMIs: # * ebsnvme-id, which is very minimal and provides important EBS-specific # functionality, -# * amazon-ssm-agent (not enabled by default, but some users need to use -# it on systems not connected to the internet). -export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ebsnvme-id amazon-ssm-agent" +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ebsnvme-id" # Services which should be enabled by default in rc.conf(5). export VM_RC_LIST="dev_aws_disk ntpd" From nobody Wed Sep 4 05:57:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzBbN5mXFz5VBRf; Wed, 04 Sep 2024 05:57: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 4WzBbN317xz43mf; Wed, 4 Sep 2024 05:57:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBffU+5tT9ofJP2K4qraU3ZcUj6/Xgx1tdOXlSSEYDI=; b=MEoaKwBrIGqSif3isDkJ3diZC6GJ9jADx1ppOlq+jZtpEQLAqLX4nzWWVnziw/Dsx+CaYq qzsDu6CNACzeSRw8KpcoaTpmyrcW5AEJZv/ydc/QR2d0oT2EvrHeq0H4nZNvjtKt3DbPp8 mWQ/0mkLRimZTEWNPb0+l6qDhpCEP9ujAW2W5tLrA83Vo/zmTVkvLIQKKlx1KUv2m8zdX7 ZWreEr0Sghiq8Oh6Pp6WtYI933b1nhl2x4ofc1ADbwIFc+FNhavNyP95B87J5JEHT+BHC5 wvlHE6Xcy3251BovMon2mHqX8qTln8/S/EKvtYUV5GsrXBDxPqAp8VNi0CtrGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725429440; a=rsa-sha256; cv=none; b=a23+bkFSKS61lsLqEk75Gz9wrsAKgo0jDnFj6E1SvJAEipZ9YyHGUHG3H0JspkTNSalN3N mtqn/p7bgy1KaCDxKcbb5hnaU4ikwqutG8lLam8epKWVzNJY3oH37nI68AbAxAjrTwpUrT v2xDlHRWOY8HsWb694c5LMkbO4H9ILNAAVR367m1s09Ne4yr0FgFBMarfNueO9DN2myQ3k SZJoBvzAfGuPVmTcvw0yUb4qhez6EudpCVf8JkoGIBu4Fr3qyHnuLx0f9K0ps+05D1rRgf u4Cxtuph9BvLpRYY7/iHbW97ddBx0dhbwWp3fdEr/Q/OLtNGurZrNNtJuE2n0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBffU+5tT9ofJP2K4qraU3ZcUj6/Xgx1tdOXlSSEYDI=; b=HrA8gfHP8LOM2Qr07GKX+0sWA+3GQH8CAxELz4NXZpWexOF4zI+BwiAWAvwzE0vXSCQPr6 IW/uk5utayCnidxGQgqYYVBO+Lrpc3/Mt9tH0BhThHmoYHoczZR3+UNR7MhJnA6+2l7kXM qpJHP5/1vr7hoOeyXYz9Yse/WxH+CAei5fvT7741zEQw5ylnJh7ehtGQQ99Cc+gN7z3Qgf ZT8elA0/LDfqTkqeTTeePZ6cn0LBT5iGLqk96ZxLOnsxaTLNTP5EAskkWFyI9L7c5Lpy84 KnCblBEyJYqxQ3PY2QiMjQxerROa3d5ZNen6GSORA8LmP7Ei/qm8EheSjDzChQ== 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 4WzBbN2Y2Kz1BRY; Wed, 4 Sep 2024 05:57: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 4845vK3P099421; Wed, 4 Sep 2024 05:57:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845vKdE099418; Wed, 4 Sep 2024 05:57:20 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:57:20 GMT Message-Id: <202409040557.4845vKdE099418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 647299caa06e - main - EC2: Add new "small" AMIs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 647299caa06e38622dc05a4358f9407b62a9bdda Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=647299caa06e38622dc05a4358f9407b62a9bdda commit 647299caa06e38622dc05a4358f9407b62a9bdda Author: Colin Percival AuthorDate: 2024-08-31 23:55:06 +0000 Commit: Colin Percival CommitDate: 2024-09-04 05:57:06 +0000 EC2: Add new "small" AMIs These are the same as the standard "base" images except: * They don't have kernel or world debug symbols, * They don't have FreeBSD tests, * They don't have 32-bit libraries, * They don't have LLDB, * They don't have the Amazon SSM Agent pre-installed, * They don't default to installing the awscli at first boot. This reduces the amount of disk space in use when the EC2 instance finishes booting from ~5 GB to ~1 GB. Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46509 --- release/Makefile.vm | 3 ++- release/tools/ec2-small.conf | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index d8914d305e2f..b4fe6e23ffcd 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -39,9 +39,10 @@ BASIC-CLOUDINIT_FSLIST?= ufs zfs BASIC-CLOUDINIT_DESC?= Images for VM with cloudinit disk config support EC2_FORMAT= raw EC2_FSLIST?= ufs zfs -EC2_FLAVOURS?= BASE CLOUD-INIT +EC2_FLAVOURS?= BASE CLOUD-INIT SMALL EC2-BASE_DESC= Amazon EC2 image EC2-CLOUD-INIT_DESC= Amazon EC2 Cloud-Init image +EC2-SMALL_DESC= Amazon EC2 small image GCE_FORMAT= raw GCE_FSLIST?= ufs zfs GCE_DESC= Google Compute Engine image diff --git a/release/tools/ec2-small.conf b/release/tools/ec2-small.conf new file mode 100644 index 000000000000..858836717f5a --- /dev/null +++ b/release/tools/ec2-small.conf @@ -0,0 +1,44 @@ +#!/bin/sh + +. ${WORLDDIR}/release/tools/ec2.conf + +# Build with a 4.9 GB partition; the growfs rc.d script will expand +# the partition to fill the root disk after the EC2 instance is launched. +# Note that if this is set to G, we will end up with an GB disk +# image since VMSIZE is the size of the filesystem partition, not the disk +# which it resides within. (This overrides the default in ec2.conf.) +export VMSIZE=5000m + +# Flags to installworld/kernel: We don't want debug symbols (kernel or +# userland), 32-bit libraries, tests, or the debugger. +export INSTALLOPTS="WITHOUT_DEBUG_FILES=YES WITHOUT_KERNEL_SYMBOLS=YES \ + WITHOUT_LIB32=YES WITHOUT_TESTS=YES WITHOUT_LLDB=YES" + +# Packages to install into the image we're creating. In addition to packages +# present on all EC2 AMIs, we install: +# * ec2-scripts, which provides a range of EC2ification startup scripts, +# * firstboot-freebsd-update, to install security updates at first boot, +# * firstboot-pkgs, to install packages at first boot, and +# * isc-dhcp44-client, used for IPv6 network setup. +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ec2-scripts \ + firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client" + +# Services to enable in rc.conf(5). +export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \ + ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs \ + growfs sshd" + +vm_extra_pre_umount() { + # Any EC2 ephemeral disks seen when the system first boots will + # be "new" disks; there is no "previous boot" when they might have + # been seen and used already. + touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen + + # Configuration common to all EC2 AMIs + ec2_common + + # Standard FreeBSD network configuration + ec2_base_networking + + return 0 +} From nobody Wed Sep 4 08:50:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGR23hRVz5TRm1; Wed, 04 Sep 2024 08:50: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 4WzGR232B3z4W32; Wed, 4 Sep 2024 08:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KLOqnt29J4PDA2rvndkr0oJkEinZ6jAaRngUKzBHmCc=; b=jUWH32u/HG19hTpZByaZ64G8/M1NdEt2GTLhZo70/5TZP5r7aqu02hCEl1/uO9baoZIUmi 2N6N7q7eSDCVLKXx7syhIbQjKlowECz1DIK0W5C98BSNvhuBMO8ys14WndI6PTQ6Bb+Jj7 6I9YsEhS4DwzwuyWEQFEjBZFqq2fmVNkxaMa7rl8NncOi2YQTNXnkJ/V4zTjILMhDPQhJZ db+fZebMUHvsSeTInQ+kSUPcfjUeicx5iOHt+XVsQ0lnJkQkb5lBQRTTcfva6lVSVCQ32n f1Ynf07tZThHp2zMCJP6/PwBQjYimMLPfiT9rWHzkqLbKdot6nO7ece/25I3TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725439822; a=rsa-sha256; cv=none; b=gKbRnmea8btdlnX5+uIefk2kGT/KJgTQqzwza3gNwIUisG95GFhtscCYh36QHXHTooLtVX IEmLNRqHq4K2RD35LuNNvQQECIH6p5uDbvpxiIY/yKrScfTUYAVTVDT5C26z4ADEO9BDL+ KUE1mg15gW5OBEmggWkw/93tIaaNO1ry6M8WsS89+DNEss5KHwk0Ui0bgxBut7Fod/hGr+ uILJ3whAoM6ko+G97jSAZjxZv8LXOcTxyhwbzslZ5EFOgj0d6Sz1AS+g9Gj7GuDkh80aJw 9TW4MNwK7/1KzLfmbG7WGipi5xqi19z4by1X8eHLo5j2Ur1LuU+lbCMPPvYXOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KLOqnt29J4PDA2rvndkr0oJkEinZ6jAaRngUKzBHmCc=; b=s86t4wPoznRuz1W6UPBYoheO3q/5JH73ezo+Dx43HLU5z5O6caPrOQVWADxmeP1FD0zp04 njSvwrtGffWzWKMF8lT8yMIfQSPz9fhCfI76dFraRzMnApwwBCecZgEjL5+k4GYQthHn3e Mr/4ES7BIH4U5403RcwsVszObIbgAir7F0b43ZXG7Y1VTVXA8dyvwzfh/qxt8OQJEjOfVf yCWhy6HlGvhffHHrDfLpZlRf0CzOGxzM4AWSkpqe1bcywLOmF0wrGpmkgYhGOBXKL7f5GV d9R5EiwDQXY1L7sI5blSeM1GEejYrXYDEtCN+7sE8gNmHNLcnYY0gQSf+/0B+A== 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 4WzGR22dZfzHW4; Wed, 4 Sep 2024 08:50: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 4848oMb7096708; Wed, 4 Sep 2024 08:50:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848oMDu096705; Wed, 4 Sep 2024 08:50:22 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:50:22 GMT Message-Id: <202409040850.4848oMDu096705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 957e389ca77c - main - dev/mlx5: remove some duplicated macros from device.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 957e389ca77c8bceec15a685d01888a41ce73681 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=957e389ca77c8bceec15a685d01888a41ce73681 commit 957e389ca77c8bceec15a685d01888a41ce73681 Author: Konstantin Belousov AuthorDate: 2024-08-30 23:38:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 08:49:38 +0000 dev/mlx5: remove some duplicated macros from device.h Sponsored by: NVidia networking --- sys/dev/mlx5/device.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/dev/mlx5/device.h b/sys/dev/mlx5/device.h index 50995d4f70a7..67c129a0f2b3 100644 --- a/sys/dev/mlx5/device.h +++ b/sys/dev/mlx5/device.h @@ -1123,24 +1123,6 @@ enum mlx5_mcam_feature_groups { #define MLX5_CAP_FLOWTABLE_RDMA_TX_MAX(mdev, cap) \ MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_transmit_rdma.cap) -#define MLX5_CAP_FLOWTABLE_NIC_TX(mdev, cap) \ - MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_transmit.cap) - -#define MLX5_CAP_FLOWTABLE_NIC_TX_MAX(mdev, cap) \ - MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_transmit.cap) - -#define MLX5_CAP_FLOWTABLE_RDMA_RX(mdev, cap) \ - MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive_rdma.cap) - -#define MLX5_CAP_FLOWTABLE_RDMA_RX_MAX(mdev, cap) \ - MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_receive_rdma.cap) - -#define MLX5_CAP_FLOWTABLE_RDMA_TX(mdev, cap) \ - MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_transmit_rdma.cap) - -#define MLX5_CAP_FLOWTABLE_RDMA_TX_MAX(mdev, cap) \ - MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_transmit_rdma.cap) - #define MLX5_CAP_ESW_FLOWTABLE(mdev, cap) \ MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) From nobody Wed Sep 4 08:50:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGR357yHz5TRcs; Wed, 04 Sep 2024 08:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGR34PHtz4W54; Wed, 4 Sep 2024 08:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0NnCJprF2oikLNuoYNyYoIq2klsyXZxswitoI6TDHs=; b=T0DVotO+JHXczrn94Cik/H6+Qz5m9Elp7ZzUgtjN+Os55iKtWsag1MU/vXNpLQ9uLRqbid xJMP/I5wl7rIS5bZpDYyTbcgl30dUSooS8bZJtwalGZGS8QLYMJ8iFe3aWeH1C5Gl9zx+9 CqZJljF6QyA2aAuTx10cpYmp5rwzKf8vT7SlF+ROB89hvtgkrjJNT7s8mZG0cOos8ZFcgA gRMb5QrWvk4gV8NzLxDbfLQMW8IHARibQrxairKznEn341xUYwAL7PsRnWYreqIiNbTZOf dV8HmmdhT0E1fPqCA+JwUsoDhiFVB+tPRTptwrlfNdZUQ54WkxAQ1exKVdSUdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725439823; a=rsa-sha256; cv=none; b=sSmRULZqk05Z1o7fgGqSgXPr4VZq7ZoCp1uCqoNdmr/WNpinzZqjXiv5GfzPhQytkoruF4 GYsNoh4MAfPaIsWpJA8nUMZp23KtJWOTozeZL//pDPQ9509DMbVPLICAWST8hyCDqlRICJ niwguISbqOQs9ZEkx6rDppQ0govDrSiuhv93HbSevfWe6VSua4vhdMoB3khFQeEJhFgqNI OsG5r36hgEJBbKktDhRp4EWlYjp6LIzyh9oAA7Gl71oAqS4JT83FZZZydDMPUf3Q88KQbf p/m8XmbUyC575CSmmgqwRfQ8g04r3h3bgi/5pEkeca8e3VBieejFI2MsHNC/bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h0NnCJprF2oikLNuoYNyYoIq2klsyXZxswitoI6TDHs=; b=MGJCpjNwbqzZM5JXGnm8IPV2+xmaZYXHqhkUXnm3HiKsZ/nfoywphGSgn8GZ0GSirCkD8v tX40HS5YfSBlIQWS4uNYxaiXeOdCDPjoAV8bA2u4O9PiberX5AQQBPLcuH/AkZJ3kFBg3e 0MDHaD+28IqY8v812J9S4T1dH0g8T0blkUIJObpbgqIGYtau4EnS5HLcLRqtFjYey+RlN0 +xEAjKqBPz86NvcgTtaeI8fXqZQPsGOdcTRuiBWi8WZ0VsiSGD6mqovzEI4LmSB/2Y6nzw WKak7yVADa76n4pAcSgVy8KVQu2feaZiNzPY7AsUSz9LXaqBiWwDUhLP4jBrTg== 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 4WzGR33wq2zHSD; Wed, 4 Sep 2024 08:50: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 4848oNfQ096766; Wed, 4 Sep 2024 08:50:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848oN9M096763; Wed, 4 Sep 2024 08:50:23 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:50:23 GMT Message-Id: <202409040850.4848oN9M096763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d02e1a3ffac7 - main - ipsec_accel_output(): do not process packet if interface rejected offload List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d02e1a3ffac76c17ac4d9fd45dd5edd8bc944c82 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d02e1a3ffac76c17ac4d9fd45dd5edd8bc944c82 commit d02e1a3ffac76c17ac4d9fd45dd5edd8bc944c82 Author: Konstantin Belousov AuthorDate: 2024-08-28 10:16:38 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 08:49:38 +0000 ipsec_accel_output(): do not process packet if interface rejected offload Sponsored by: NVidia networking --- sys/netipsec/ipsec_offload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index bbf98ac7a676..7453fb3818a6 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -876,7 +876,8 @@ ipsec_accel_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, } i = ipsec_accel_is_accel_sav_ptr(sav, ifp); - if (i == NULL) + if (i == NULL || (i->flags & (IFP_HS_HANDLED | IFP_HS_REJECTED)) != + IFP_HS_HANDLED) goto out; if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { From nobody Wed Sep 4 08:50:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGR503Qnz5TRmw; Wed, 04 Sep 2024 08:50: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 4WzGR45LkXz4VvT; Wed, 4 Sep 2024 08:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gb7xgrMM1MzsdOAmxTjQoVfA0/IZsbe8eaBkC9Yf4ag=; b=m1jpK2LjzmY7jW6pA0NOkWBNIyo6jdxrcpk/p7T5ou0UqI6+9iNPQvGUuDyY838Q4s/HT3 WSmkpTXrDPZZlQR2B201/jbCCtrYfdS+ZFBt5dHoGlAuM0FH0ECYd0havYEw8Ipzb9hTM+ c3ttYljp9EfGD1l8WiunaosOn+Ug2A9cskasPpHEQkIORSn5MkOYYUG7/4vDL4CNYkSuT4 amgjUc5Alhhr3oiwvE1VA7im/ExgsSygb1CX22m6m0YLZIxDj5yNkD0Y33nJFk3v1Ix3QO OErnoaP749OQsHsniMIik3KHxyl/zcLzULKR7wLTCL0IEJNufeiTFGvIF2WQtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725439824; a=rsa-sha256; cv=none; b=Vin6CuOoDeylx/lF8weJQO9VGYM45vA0bbWwwBEdLhU09sXXO9fV98TRXLNihcrb0rq5Oc X22SsLmpw9jFUBspBWjPBS4fGeZNsv2GVbHDAchhVttBms6iPBX9ooGK24fUPdmWEz45KG wDDb+scYyfLoYgA28q/XZ2v1FOlvdv2QvJCA3ARfxD06Y+gPBsXmZKVUwq7VcC7y758TyK f6lSRSlwl8Oko3MDr3PyD00LraOWZb4rQYwX2GTgQyaHs/RjRXA14Muf9PqESQjxb3qwo+ 1ey6o4g5/Shg6FYYzLGmP+Y88OZlRzQNSKjhZz9tdNzoD/L3+NsXT2pZ9aLwrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gb7xgrMM1MzsdOAmxTjQoVfA0/IZsbe8eaBkC9Yf4ag=; b=uKyB9ZqefiZ6R3BkgZ8u4dDAQLHJAC0OwPfEGpSFunhSiEOkS6IlK0F4ZgQ4HEGr+DQnG5 9o9jFFV4Ikf3gJPHEavsd/ly3Ka6O3ZBckUQliD6sr8KPor/Y14zAMGtPIkwwl1gcWtyrJ ta7dXna0/hrHQx5itpqvFd0p7DA+wU32HGh4B9UM5HQSuJEjhBTRmgjaI6uSU8otaPnylG d54grkD7Y+5h67g+CWgMvVsWZWtAwQ1l5JocSxer3Rif5G5/Q7hWQ/oohzJDLctRxmNAl9 ZJlDbfO40oLkVL7bAKo4dx00GxOklYPTv8nRIvvHmISjiLJzpi2U2gHAb60JPQ== 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 4WzGR44bz5zHbf; Wed, 4 Sep 2024 08:50: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 4848oOe1096814; Wed, 4 Sep 2024 08:50:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848oO2M096811; Wed, 4 Sep 2024 08:50:24 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:50:24 GMT Message-Id: <202409040850.4848oO2M096811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1af77be32760 - main - ipsec_offlad: remove not needed IFP_HS_INPUT/OUTPUT flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1af77be32760a86df242a1ffc3292dc3a7e59e27 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1af77be32760a86df242a1ffc3292dc3a7e59e27 commit 1af77be32760a86df242a1ffc3292dc3a7e59e27 Author: Konstantin Belousov AuthorDate: 2024-09-01 16:20:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 08:49:38 +0000 ipsec_offlad: remove not needed IFP_HS_INPUT/OUTPUT flags Calculate the hdr_ext_size unconditionally, it is kept unused for SAs not handling the input. Sponsored by: NVidia networking --- sys/netipsec/ipsec_offload.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index 7453fb3818a6..5e8755d5f243 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -97,8 +97,6 @@ struct ifp_handle_sav { #define IFP_HS_HANDLED 0x00000001 #define IFP_HS_REJECTED 0x00000002 -#define IFP_HS_INPUT 0x00000004 -#define IFP_HS_OUTPUT 0x00000008 #define IFP_HS_MARKER 0x00000010 static CK_LIST_HEAD(, ifp_handle_sav) ipsec_accel_all_sav_handles; @@ -405,8 +403,7 @@ ipsec_accel_handle_sav(struct secasvar *sav, struct ifnet *ifp, ihs->drv_spi = drv_spi; ihs->ifdata = priv; ihs->flags = flags; - if ((flags & IFP_HS_OUTPUT) != 0) - ihs->hdr_ext_size = esp_hdrsiz(sav); + ihs->hdr_ext_size = esp_hdrsiz(sav); mtx_lock(&ipsec_accel_sav_tmp); CK_LIST_FOREACH(i, &sav->accel_ifps, sav_link) { if (i->ifp == ifp) { From nobody Wed Sep 4 08:50:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGR61vDxz5TRjl; Wed, 04 Sep 2024 08:50: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 4WzGR56PlKz4WDZ; Wed, 4 Sep 2024 08:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RPpz4GI5BDE8t2JTtn1PgWqYKI/SVn0UwGm3YrJ1dso=; b=Pelk0nzvacVeqem5ntQUCtRCicf+kpB3F+/CDr44YzWbs9nWQ/yuswxLeVtIbmBk4UEdJB nwlUcJoQ+InnLVXTpwowAvObLMm/9cANh1UtN1EiqJjVaH6LUXkxUuPstUFoz+KZE2nuXq GKYIZ0tymUsINOPeEZnclqKW4ZrnKPv85DCLNwFBVqTiYxEstwoFvh6cEuTPDjN9RPCEkY z/qyy2uFHoq9oGAgIIn/qI4lnAXgEPEL11VsMDyG6y0j6bskychi/wF0z4K21hsKwSkvNo CsM55Ej6SlA3YY8zOjtgXlTawubxUPAb4H5SAUSJ9/NOpWnIc+DbU+b6rKEWnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725439825; a=rsa-sha256; cv=none; b=Dr5FyNQ0mtMRRnunAERGEVaHkuhlSVFuTBraOQkvpSaMJzSJgQsSrXbvCChQDtASpW/2wY HX2cXIxvtCIC2ILDEoVZYK3+1+ZrncPFT4oKpc6MIWn/lIZPnknYsovZKUnzG5bEJZJc4p 0ky+L/H1ofzCGszXqpfBAo7ikIaBhulC0e83+isX9zemeNMRXe0FR5UVFt6rc40PMjbvkB x7xGlcmkaKi8gG5/BCi5NN7Ioxg/myzkzfnhUG0Q7fyE35xkMODVwUGlBvx5wR3yuZNdj0 mm/OgBDdyJeDvAf2OLx8N5T2cJUsWWPZUOcNGAJowzAFxTTuIAr4sxV5BsRKrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725439825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RPpz4GI5BDE8t2JTtn1PgWqYKI/SVn0UwGm3YrJ1dso=; b=pgQyWIUacedBCSujtn5fQ+82aqb0g/TkVfqD5/kGpUwf/3LRcQBsBkWP29oDcAl8BvhdCq HIPd1qeU3i42lzIJUAuwFcYjeDdH5plp4z+1kygl2mQI/v8vRRYosPg1eVYRtADbQeC8Rq xMTTn8EPiMu1+DjTrPHEXe5RsLz2NO8BHVGiwQxtyF/OUgxW8TluToZkOMWCo0ZUlznq7p rK1rq4TGNlMcgX5C9+NYDQnaeiuJ/MtwOX9UcN/Tzxz+cxDq3R0eo1s4r6gyDmxxZB2vlT 1f0pUfwL68zl1ylG3++bvlxuSG07XYtDbD5TmnzBADAU8az7ApVyi057g7FG/w== 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 4WzGR55SqszHQG; Wed, 4 Sep 2024 08:50: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 4848oPDd096862; Wed, 4 Sep 2024 08:50:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848oPXu096859; Wed, 4 Sep 2024 08:50:25 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:50:25 GMT Message-Id: <202409040850.4848oPXu096859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f76826b892de - main - ipsec offload: use private taskqueue thread List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f76826b892de38ed25e407c9d5e73aec1229f728 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f76826b892de38ed25e407c9d5e73aec1229f728 commit f76826b892de38ed25e407c9d5e73aec1229f728 Author: Konstantin Belousov AuthorDate: 2024-08-30 17:17:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 08:49:38 +0000 ipsec offload: use private taskqueue thread Using global taskqueue_thread XXX with the vnet tasks scheduled during VNET destruction. VNET shutdown needs to wait for all vnet-scoped SAs/SPs to be handled, and doing that from taskqueue_thread task deadlocks because the same thread proceeds the removals. Reviewed by: markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D46494 --- sys/netipsec/ipsec_offload.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index 5e8755d5f243..a06e91ada1a1 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -69,6 +69,7 @@ static struct mtx ipsec_accel_sav_tmp; static struct unrhdr *drv_spi_unr; static struct mtx ipsec_accel_cnt_lock; +static struct taskqueue *ipsec_accel_tq; struct ipsec_accel_install_newkey_tq { struct secasvar *sav; @@ -166,6 +167,11 @@ ipsec_accel_init(void *arg) mtx_init(&ipsec_accel_cnt_lock, "ipascn", MTX_DEF, 0); drv_spi_unr = new_unrhdr(IPSEC_ACCEL_DRV_SPI_MIN, IPSEC_ACCEL_DRV_SPI_MAX, &ipsec_accel_sav_tmp); + ipsec_accel_tq = taskqueue_create("ipsec_offload", M_WAITOK, + taskqueue_thread_enqueue, &ipsec_accel_tq); + (void)taskqueue_start_threads(&ipsec_accel_tq, + 1 /* Must be single-threaded */, PWAIT, + "ipsec_offload"); ipsec_accel_sa_newkey_p = ipsec_accel_sa_newkey_impl; ipsec_accel_forget_sav_p = ipsec_accel_forget_sav_impl; ipsec_accel_spdadd_p = ipsec_accel_spdadd_impl; @@ -207,6 +213,8 @@ ipsec_accel_fini(void *arg) clean_unrhdr(drv_spi_unr); /* avoid panic, should go later */ clear_unrhdr(drv_spi_unr); delete_unrhdr(drv_spi_unr); + taskqueue_drain_all(ipsec_accel_tq); + taskqueue_free(ipsec_accel_tq); mtx_destroy(&ipsec_accel_sav_tmp); mtx_destroy(&ipsec_accel_cnt_lock); } @@ -344,7 +352,7 @@ ipsec_accel_sa_newkey_act(void *context, int pending) /* * If ipsec_accel_forget_sav() raced with us and set * the flag, do its work. Its task cannot execute in - * parallel since taskqueue_thread is single-threaded. + * parallel since ipsec_accel taskqueue is single-threaded. */ if ((sav->accel_flags & SADB_KEY_ACCEL_DEINST) != 0) { tqf = (void *)sav->accel_forget_tq; @@ -385,7 +393,7 @@ ipsec_accel_sa_newkey_impl(struct secasvar *sav) TASK_INIT(&tq->install_task, 0, ipsec_accel_sa_newkey_act, tq); tq->sav = sav; tq->install_vnet = curthread->td_vnet; /* XXXKIB liveness */ - taskqueue_enqueue(taskqueue_thread, &tq->install_task); + taskqueue_enqueue(ipsec_accel_tq, &tq->install_task); } static int @@ -508,7 +516,7 @@ ipsec_accel_forget_sav_impl(struct secasvar *sav) TASK_INIT(&tq->forget_task, 0, ipsec_accel_forget_sav_act, tq); tq->forget_vnet = curthread->td_vnet; tq->sav = sav; - taskqueue_enqueue(taskqueue_thread, &tq->forget_task); + taskqueue_enqueue(ipsec_accel_tq, &tq->forget_task); } static void @@ -696,7 +704,7 @@ ipsec_accel_spdadd_impl(struct secpolicy *sp, struct inpcb *inp) in_pcbref(inp); TASK_INIT(&tq->adddel_task, 0, ipsec_accel_spdadd_act, sp); key_addref(sp); - taskqueue_enqueue(taskqueue_thread, &tq->adddel_task); + taskqueue_enqueue(ipsec_accel_tq, &tq->adddel_task); } static void @@ -751,7 +759,7 @@ ipsec_accel_spddel_impl(struct secpolicy *sp) tq->adddel_vnet = curthread->td_vnet; TASK_INIT(&tq->adddel_task, 0, ipsec_accel_spddel_act, sp); key_addref(sp); - taskqueue_enqueue(taskqueue_thread, &tq->adddel_task); + taskqueue_enqueue(ipsec_accel_tq, &tq->adddel_task); } static void @@ -1124,7 +1132,7 @@ ipsec_accel_sa_lifetime_op_impl(struct secasvar *sav, static void ipsec_accel_sync_imp(void) { - taskqueue_drain_all(taskqueue_thread); + taskqueue_drain_all(ipsec_accel_tq); } static struct mbuf * From nobody Wed Sep 4 08:53:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVd2hXTz5TS95; Wed, 04 Sep 2024 08:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVd0jwFz4Xp6; Wed, 4 Sep 2024 08:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z8oWXdkYQVh/r1AxmUl469VQLYUeovfS0wwxACJLcEc=; b=g5nMJAFoMPnEdQxPH+wTUzwgLLLtMlBkt2ct88II76P2RjnXrid1FK81iiY1AqRCs34oBV NBYDt17CsKJYpcWBXQ7OGhB6ZnzRhLUP7/PfpU1M8hl1tk9aKjyGjuJBeXycWkF94DaW6S 5ZvxLPXPeEsoVmFDhlZHd9ccFg7VgPTMLg+V0cqkpt1vxCecpKUn61ySk48vcn5vAqw5h+ 20XCcygT+PIt3f3K22gyftZo/gPok+txUt3vs9vLBVX5Cgahj83jc+UsIQH7IIJjPZm8+T Y2AKzYyGk5R0S3zYKpbUXSmeUP1QRF3qR6o9xOayAyserGSS1V7UBJVhMBk4Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440009; a=rsa-sha256; cv=none; b=OIIU/BsharN07p/dXWq1YBKN27h+x2JM83AgMUhwNZ6I7ldzN9pfwbX/IFXmSfjfrkpjII wd8bB+gW8cephkLTkQnG1KeIKrOGj69rjUDacJPuIJS7bTnclmnYs2hvCz047yNnsmSDrk C332gkRhnBTYmeNsCYNdb4BpL2J16AMWgScxaF/rrZRFWh2wjCm0yUfACsNWUW5+ej1ryY 6NkzpXXuTW6Z3jb8nkmPv7cMJXjQE39g4hdB3WMkPnbj9mIKBO/siJJm/DxMPwpeCEtdz0 v03FnTc9vZkiQ0nr05RYBaEbLPxuYcgFdrQZ2yafSCisgbcwN92tGZccIhqbTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z8oWXdkYQVh/r1AxmUl469VQLYUeovfS0wwxACJLcEc=; b=JQeXvFn+fNI/OkIYZwGT2XHvTzsM4+AryQSPHyzAgekHMRWsFkyJ8DHtZsxJQP1lruZCuu nzYgyMOJjAf53Y/9UY2dIc3zAbBDHC1zakRYItfTJysap8W3HcS1HnPvmDG0MXxXyG1M6A 8RrIE9vQ1g4CjnlkNa6pfsYU2+AtY8kTaNAbT2gxoiTkkUtG+fM7JNzqGoAE91RbGwubMc 73uqkw262ObQO0YBeB/wvXM/J5MHvxOd8ZEMmljcvvdvhRc8p3Ah6vE9PBY58Ny2T7IGAf YqHwo9b7FfkcQAMh+2N15R+Z+u4sWJ1wkaZTHJ73CRFJCqVw50MzBxuT6mpBoA== 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 4WzGVd0Kw0zJCG; Wed, 4 Sep 2024 08:53:29 +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 4848rSIZ005350; Wed, 4 Sep 2024 08:53:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rSNa005347; Wed, 4 Sep 2024 08:53:28 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:28 GMT Message-Id: <202409040853.4848rSNa005347@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: a626b66c6924 - stable/13 - pfctl tests: fix dependency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a626b66c692410a93078a656caa6b629f13eb3a9 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a626b66c692410a93078a656caa6b629f13eb3a9 commit a626b66c692410a93078a656caa6b629f13eb3a9 Author: Kristof Provost AuthorDate: 2024-07-25 12:06:27 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:53:06 +0000 pfctl tests: fix dependency Ensure that we rebuild the test binary when we add tests (i.e. modify pfctl_test_list.inc). MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 250e074e5f609194e0e4cd0775d99b0a616bfcf3) --- sbin/pfctl/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/pfctl/tests/Makefile b/sbin/pfctl/tests/Makefile index db41a445903f..92b7ad6c57c0 100644 --- a/sbin/pfctl/tests/Makefile +++ b/sbin/pfctl/tests/Makefile @@ -8,4 +8,6 @@ LIBADD+= sbuf SUBDIR+= files WARNS=6 +pfctl_test.o: pfctl_test_list.inc + .include From nobody Wed Sep 4 08:53:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVd6Wt2z5TSG1; Wed, 04 Sep 2024 08:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVd4kWQz4XTc; Wed, 4 Sep 2024 08:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/lcJTB+Mj7Cb3Y5/RbSH0XHf3k78D3KxQkrPjIUrDs=; b=tn5NYzd4UXk3njwgDID+jin6zm5nBHYqwqGXbISLaTAs59ArqXBvc2xu9Dcek/f1lWXv2s 9lZAnKmtgyV846QeW0wkqK/zzlfuNkggM2mLcpoVtyTMxZk2/bMIzDo8gRybV0ZKuWQbTp /B8ukfwSR9vX2ioW7tZyJEiB8JtHvKS7mkqAqZrxkYx9SqGwA3nfzxrLNULruMX59cD+dh ke0UsW9EwcXV7f03vdCTJFf8jlPPkosFYPn8HAyE+EH1J8wxitDh4FUR/Qrhy3xhQ5z9MH UHcXrZhBK7UcIgxW1QHgCwC9+aev8Nq3bktPZsQC5vlBFFS1mWPuxgjSqNyWzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440009; a=rsa-sha256; cv=none; b=TQXsG8EYGMgYiH4IVJFi/AlNtL+CQGKYxlfT2A9ayPH+QWIaxosCD4sK+VYR3MZ5wp1gMp SI+ehIq03PMenPPio8b8yJ+dU+ZxOPHzgSI7wNo3Jg8Lg8IpMnBp7A9FZz9+6p3FSOTcrA 7A5328al/fE5ZHo62xdg16e3ts9csot7jkNf0fyXorZ++8F/ptQ1DyVLNyQI8S1HIpNt1s aLOyv6NTev3OhnjDg8H8jlqcnq3ZF0ZLyJ8rAiXuybru0Guvp4VEADtY0Cur4nZNE5ViS3 kwg850c4Nm4SQL2rmyF3V31yNHdYiiv4kb5+4UL8RzMNSXCBdXlBRqzbgH5RYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/lcJTB+Mj7Cb3Y5/RbSH0XHf3k78D3KxQkrPjIUrDs=; b=Qv3JvlU6vabJGALuDw2iMhOLMSxa18+voB9grIEn1WYuFp0rsqKZlORiofUNyVoRwb7WOM d1GRiAtlkZmXMf5Qtl5Mm6jd23d+H0fcoDIHYtMhf6K4fDnWq3t/XdHJZYxZuiQswaxb4N M8vTKOiPYP3IoWj3TAqbV115Y/pLi2LWFhrM/vu24HdhFvGLmanT7tV+Dpe3b1ZFfAZTpq itj+679F/yeihVU7CkcPMLLQf5xeYgpXNalRFNk81y3CNPp8Zuu1i7UkQuyBgfMgsRnZ0m gaCYTos/bWGnoX9m+kJsElo8YBBqG673ixUxOOvQRV+Hxs7atBGc4kgbdcLixA== 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 4WzGVd4L0QzHnj; Wed, 4 Sep 2024 08:53:29 +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 4848rT14005402; Wed, 4 Sep 2024 08:53:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rTMp005393; Wed, 4 Sep 2024 08:53:29 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:29 GMT Message-Id: <202409040853.4848rTMp005393@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: 0121a4baaca0 - stable/14 - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0121a4baaca09049d130d830aa9179e3cb9c9e88 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0121a4baaca09049d130d830aa9179e3cb9c9e88 commit 0121a4baaca09049d130d830aa9179e3cb9c9e88 Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:38:15 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82) --- sys/net/pfvar.h | 4 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 4e2888b21a39..d33c747efa7e 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2516,8 +2516,8 @@ struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, - struct pf_addr *, u_int16_t, u_int16_t); +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, + struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(const struct pf_state_key *); void pf_rule_to_actions(struct pf_krule *, struct pf_rule_actions *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index fe3ae843f68a..62ee12322e8b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -329,6 +329,9 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, u_int16_t, u_int16_t, int *, struct pfi_kkif *, struct pf_kstate **, int, u_int16_t, u_int16_t, int, struct pf_krule_slist *); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_test_fragment(struct pf_krule **, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); @@ -345,7 +348,7 @@ static int pf_test_state_udp(struct pf_kstate **, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, @@ -399,7 +402,7 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s) \ do { \ @@ -1466,9 +1469,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1476,8 +1536,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -5163,7 +5227,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -6605,9 +6669,9 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6620,25 +6684,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, *state, pd); @@ -6701,7 +6749,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6709,7 +6757,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -7117,7 +7165,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -7172,7 +7220,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -7181,7 +7229,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 4fcad7e578a8..06c82569ad6c 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -633,7 +633,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, return (NULL); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (NULL); *nkp = pf_state_key_clone(*skp); From nobody Wed Sep 4 08:53:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVf6fSvz5TSXX; Wed, 04 Sep 2024 08:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVf5WVmz4Xp8; Wed, 4 Sep 2024 08:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KlnUUJBXgf6ApVczKCmGyn8Js2qB6v0tnqKXgQkU7VA=; b=qOdNZyY7CrrYOLDD2mUDkULAODlEVua+SW4xAuSKbMfaPZ5XYWb+fA8AhYXGJgRjDbcSSN VrJdaTkfWJzq66w/tkdA3Kbe3y0TqJo1YJdWmk0mHTft9WuAzLMpp5thshp4WZZBCJ5gmC goJi9KrEHFa8W2IIdmOniWXXVZwHTl3aUyTHahMGgKxYOB2jRqEdDP1vvC7kYXEgSNNeG5 SsVH6FhRYoDTqiEPCeNnSmX3vMZ7m/os5HqmKfQQHNsPH2pVcmJEcLiAstSMPEUgbnZb1n Vax2slJr5FwTf3RuwENOPY9SxrTf6eersj+q09Qi/Tv4etuTCOPAqTCTv9VAng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440010; a=rsa-sha256; cv=none; b=RS4Vx+0EFRzuOxyTjM+C03NN+/BfU8/GyCn6ihOIyzn4ob+iJ19SOMSqB7n4AeepMjVODP y0Jg7/m1DiaO5UpXHJdyUpkx+h5CMIAUrqG/Njuat7XSUlcDcu+KPe4Rg72PEQSPzUIs3X zgGcsIuSjHUIQrZ7jTiWUpLJ00yHrh3BWpxwRpJhkbxzgEeEeOGPkgXTnQ/xiJSeTpcQYV e1kfiZROLt6fxS8VngrOZQ7A9bJInXXAlMRwKhr51an5ttahQQldzNRPNSrf/2GGlDsf2q 9gzfV4ow4juV0voPYLpSfHnEkKauMAIsCvL5/WT5/mxkdygKqURe4bxNZMIieg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KlnUUJBXgf6ApVczKCmGyn8Js2qB6v0tnqKXgQkU7VA=; b=gu3hmFo5ijI+viV6LbIdv22Om6+YiEV+risW/i7n00N/0uRf/Db88NSYD5ATllutZKTUhP l5YVtAkmy1HSuNl4Wncq7n4zv3iAS1vYoMQM5XvPwMzVOWbXJ+vlz04ndXES3RaelKyMzf CEtd7tQMFCO2Q9jGVoIQQsrXDRsxxC6ynaBOSgiukGw1aBZfX0X1xU0XXQ/ZXROnIudQX8 ZFS/CciCKznA0s18shVDhU3EaA1oXifdSMJqeA1IuXt4pqeB25YZSZXZ8MvnxeoTtsxOgU 60uYUokhCWrz/CJI6gKPJBw4GinIfhafIH1E77Ag6oU03m0nchRuzKKHdqBRPA== 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 4WzGVf578NzHWf; Wed, 4 Sep 2024 08:53:30 +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 4848rUTT005503; Wed, 4 Sep 2024 08:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rUK2005500; Wed, 4 Sep 2024 08:53:30 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:30 GMT Message-Id: <202409040853.4848rUK2005500@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: 4909bd69ddef - stable/14 - pf tests: ensure that neighbour discovery works as expected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4909bd69ddef66b9304acb4998c4d82277a2bfb5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4909bd69ddef66b9304acb4998c4d82277a2bfb5 commit 4909bd69ddef66b9304acb4998c4d82277a2bfb5 Author: Kristof Provost AuthorDate: 2024-08-26 13:02:22 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:38:15 +0000 pf tests: ensure that neighbour discovery works as expected Also check repeated calls. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit d154dc21130b607d7903f276dd6d463b990f33f7) --- tests/sys/netpfil/pf/icmp6.sh | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index b9b60a484afc..eb286e23ef4c 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -149,8 +149,56 @@ ttl_exceeded_cleanup() pft_cleanup } +atf_test_case "repeat" "cleanup" +repeat_head() +{ + atf_set descr 'Ensure that repeated NDs work' + atf_set require.user root + atf_set require.progs ndisc6 +} + +repeat_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block all" \ + "pass quick inet6 proto ipv6-icmp all icmp6-type neighbrsol keep state (if-bound) ridentifier 1000000107" + + jexec alcatraz pfctl -x loud + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv +} + +repeat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "zero_id" atf_add_test_case "ttl_exceeded" + atf_add_test_case "repeat" } From nobody Wed Sep 4 08:53:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVc5tWcz5TS4s; Wed, 04 Sep 2024 08:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVc5PkXz4XmD; Wed, 4 Sep 2024 08:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yGpTJ51JRDqE475dux3Py6l+qx+CiKSsWzB4zR0Wk6A=; b=rQpiy8etRFCyYoQiCNbBYPMqN+bxVgYZW4DYgO7m+Mo/uqS89j4gDB7OazpkY6QwK57rtH peFlPKTOq8SbvE0XHcqo7PkeZflQq6WnH99g4Q5efQrg3SFYZ/JFWq9yoR5xx9R1qx8FYA b0NTpwPbRpW9fFRczgyLBGHP8FgyoAbeBQSA/FYAaDNsnxZ/IZXrP/iTEJqOIRPiSyyKeL MM49PWq8rTZgYvKRTCcqUSbGAhP9K6rn2oQQerulL4gEFmTFUePl2LD3F/iYeEea9G6NUc 1RYqF30RVhhsYsdGLNWRVGPlo9PPKGsF0NN9nhQQSh1mbiUKAVROuQDyRwVHYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440008; a=rsa-sha256; cv=none; b=eVQdFqgURtBYQhIXRcgLd6gzAopRstd7hVsj26PjCKsvLjtrX+4lbSyt/BxpRZLedHoQSR xUel22Yn7dpPMUA1a9rx/xTyJ/wDK8O3p0uSZjWuj15shNkAL6AeI+NEqFzcerZ+8jpL+m MdB6OEr/8JKzB3XNSI8fA0DZ+K43dvZJpXgD54W7O+JKklI+Gx6qSSlo5nwx182eVsRESk lvybg/rgMjhN+qPfefgJyoPYFy/ZVANCC6CZF8ZCK6kS0cKsebjNcl/+Hr/JcpoS9aa+E6 iiXVM95tc3re8Uj0aD6/pE1a7wuLcpjGtSGVeb/4tD3h+rK/llQ2J5Mx7MxkFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yGpTJ51JRDqE475dux3Py6l+qx+CiKSsWzB4zR0Wk6A=; b=j+rpaMLJtwo4Kq6Ib+aTRdFr+JjnpOxUsfpTkAR5NPSmCR9nBhvs2dPzj6+dDHUl172XnU oAQVtxukC+6uDLm5Gf9qpNW3dWB+s5c9M3dG3b6kvz36m+gcxkS8R2vVls4eCi93UXh+z4 ohVUxtoCB1t0vz+4gjmTMrQmssHgq8Lak3zZdTRhqA+jodWmNpH9nLmRnkEEMmHcTGlEUx YgMmYRK41XDzhxJxi6sQDgnw5l9BtPEgDmEaB0hvuiQ1jVf5sOe75xhxnQ6QOmqwu2GQDf giAc44tW9VDQ9NcN3z8fG3ltkHExFveIGJwiSu/uZBVy0FWF5IsS00t+AYEvnQ== 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 4WzGVc51Z6zJCF; Wed, 4 Sep 2024 08:53:28 +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 4848rSBS005231; Wed, 4 Sep 2024 08:53:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rS7o005228; Wed, 4 Sep 2024 08:53:28 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:28 GMT Message-Id: <202409040853.4848rS7o005228@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: cfd744a6635f - stable/14 - pfctl tests: fix dependency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cfd744a6635f2245041fd5980881899ea89cec68 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cfd744a6635f2245041fd5980881899ea89cec68 commit cfd744a6635f2245041fd5980881899ea89cec68 Author: Kristof Provost AuthorDate: 2024-07-25 12:06:27 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:38:14 +0000 pfctl tests: fix dependency Ensure that we rebuild the test binary when we add tests (i.e. modify pfctl_test_list.inc). MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 250e074e5f609194e0e4cd0775d99b0a616bfcf3) --- sbin/pfctl/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/pfctl/tests/Makefile b/sbin/pfctl/tests/Makefile index db41a445903f..92b7ad6c57c0 100644 --- a/sbin/pfctl/tests/Makefile +++ b/sbin/pfctl/tests/Makefile @@ -8,4 +8,6 @@ LIBADD+= sbuf SUBDIR+= files WARNS=6 +pfctl_test.o: pfctl_test_list.inc + .include From nobody Wed Sep 4 08:53:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVf2z62z5TS4w; Wed, 04 Sep 2024 08:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVf1k6qz4Xp7; Wed, 4 Sep 2024 08:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAwyk09HO64CtMzUboPcInfhhoRuQre+MJupbh58ALY=; b=kyqnPdfv1+/xn9UOCeqMOOtkWQr9gf/CEuUm6jjPAc5peiHOoYN6d23DOVK1IRepQDGTHb DYhhnDHQE3Nf3hUScPdnZooRqMGEdw+dfkANN2MGXXzjYkcP7djUId3q0iHfcBpRva4Fhz VPs85iI8+jpGMbcJBnuyRPWUD5pvCYjt/kZZuCGwjG9xz3FG5cRbhSDZamypTMPhqXhesB Mb7dNSunceaacGdFvDsvDNA0/y6XYX6CAxrG70Add01m+tbupQ1OUUpEHKtB8cX3CzbdoW sTtj2AwC+wiUWD70ohLUAhXKWLohpjSQtmoCUCDIAOGcFbGkBAlV95CuPu5qIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440010; a=rsa-sha256; cv=none; b=Y/rD8xs55iz6hUJdhyA9oV0lanF2zcquk2VLA9Kl79gJNpl1Qb/3JQWBiT40Bs0jVs2XVY yyN73SQJLPcNBGjuW4sTUqglNHynnliTe/KZSlfiTHyR1+WUdYhtPNtgT0VAH4vZ1tdmnf hK8gqH0EtBaYY937PDvDCBU7Of6YsQtrBgaR1MkwG2oiuMdMcCmQpyE8PU0PHIPKH3zSYh Z/AlIQ6SAQDbSaovGzqoxb0oHBKaNFaqDIGXqyTWkUnVeX1RI/7iHjKN9gLQcjXOjbdvhw +RS4WpzMaO2+yJsNrJURMbtVquKMstZXr0IUilHTCEbb6dD7eV1mE4R+/4sF9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAwyk09HO64CtMzUboPcInfhhoRuQre+MJupbh58ALY=; b=jlmqM2UlHRb++bsTqnaVTH+/+/f8M+MPv+KgZWXBVoS157tv28uwS63XMP6M0VeILxh9m5 Hlj0yCYTsJyheALZwwmNu/BLvpYJvhx1nFwDI62BvZMgzI1DRZ7hDQTgBum2R/TO4+x7/V 9vTDWtcwduh+wx0THqkbFuU0QdGeUpJj1EZGAkYTUIGGl6XxetUgc0+dyBOYf4vnLH66YA D16mbvOT3O7H1Yw+nczIklR870PJKgkLPoVQ1gMYhNbjVP/njaoM6StCijz5VETMOC2TxI hY/GkEOI1KMUchrbFiJ9w+FgEr3gu9A2m2x6/aH68G6g3EHFuOxX24JhsP/fuQ== 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 4WzGVf1LBtzJDG; Wed, 4 Sep 2024 08:53:30 +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 4848rUtn005449; Wed, 4 Sep 2024 08:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rUgs005446; Wed, 4 Sep 2024 08:53:30 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:30 GMT Message-Id: <202409040853.4848rUgs005446@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: b84344206721 - stable/13 - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b84344206721ed2803d5da68585289d5880efe3f Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b84344206721ed2803d5da68585289d5880efe3f commit b84344206721ed2803d5da68585289d5880efe3f Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:53:06 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82) --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 84 insertions(+), 36 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 5d72dabfe305..e6c2d1f290cf 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2224,7 +2224,7 @@ struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(struct pf_state_key *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f56037c58572..f55ed99153b1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -311,6 +311,9 @@ static int pf_test_fragment(struct pf_krule **, int, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_tcp_track_full(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, struct pf_pdesc *, u_short *, int *); @@ -324,7 +327,7 @@ static int pf_test_state_udp(struct pf_kstate **, int, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, int, @@ -379,7 +382,7 @@ extern int pf_end_threads; extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s, _dir) \ do { \ @@ -1423,9 +1426,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1433,8 +1493,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -4589,7 +4653,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -6013,9 +6077,9 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6028,25 +6092,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, direction, *state, pd); @@ -6109,7 +6157,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6117,7 +6165,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -6525,7 +6573,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -6580,7 +6628,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -6589,7 +6637,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 46d3ea8f508d..2571a0c5312e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -606,7 +606,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction, return (NULL); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (NULL); *nkp = pf_state_key_clone(*skp); From nobody Wed Sep 4 08:53:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVj1WH5z5TSJq; Wed, 04 Sep 2024 08:53: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 4WzGVj0KwMz4XpB; Wed, 4 Sep 2024 08:53:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZlW64CYagpgsKFdfb4iMjfsRZVX2VoJ5ZsL9/elwwuU=; b=nlYzD75Il60RSfuf+n6n7qfM9MiNUGEeHxQqBwM8/0xcS182Z5Da6JSDujoHJi3UtIrXc/ TmEbwaKj6t+XT0nMeIzu9h2vhZ6UfLWbg08rinqEVM5vZa8iNOUuPgicwgyj3NsQwOqjho Uylt4B3xgEe911n/ScOEkRWN9N9SBJ2yI8o3RqwopBFwy4IbLw0AOPEG/W1MkQ4PSpekon W/YnFCGiH2TFuOoFrLT3jnxfaHMAWyH7tbMiOoqnTMh7jaZIwGC+82QFJx7nQzfHuJqjDX znoDkq0QNjNKNAATSJGnirXxIme959tlPvcocSb+YwTyiZyO3neYzWLTTWlIvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440013; a=rsa-sha256; cv=none; b=Ykn30ZScZGzoSNq1f4VuSvqkpjpaeykjhnHyyvf5qVYbIbhGJ3oIYrQw581ngXtXMRycZc IsEcl3vgSXuIotkQKvjIyoN6LL523PhCj0yBPDJoODC4V68Va/7wSoHafP8LPK0pI3/0sH exh1u5dsIryRHyKu0TF5ZmWTQjnYpZbNytcU68wEG4y9dI3a6klIRPFNT4nZmDRGO3BZwu MEmW2eULHdDOYXS+Vu0qHsUnZ1cmHWey80ZxpVsfSSE4NPR2k/fzbwwZf/6PxYFbL1vstq DhP8vPmUo6k5LKLnwRs/qFcloDgD53dfF3foFbVut6VGy7mUyHzm1WAvKiuCnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZlW64CYagpgsKFdfb4iMjfsRZVX2VoJ5ZsL9/elwwuU=; b=ASB4MDbCWg8eSWl5X89NUW9sro84A9ZjvLU794uyOdfzj7a33vYL3k2K3t516zS+0VSV+7 FEgjqHY7b4FpyS63jr3QnHlrUCnXT9Pv/rhSsrPAdfb8jq0IZICgbcaUT051dsXj1vl/sx K/Fau8LchKn5m58OZ0zNN2ZWKvNTM+dgvXYdgiJAvP/XJ5MTyJ5A1FJqlgthfnMd3aqHn1 CtEO/DtUS4UebnuM7g/Ege80JHZwMCtGGs/VfnPR9Slx0f+XI4qH7jCIx9sLt6pdhIsPlA l+Fq13/X/MTLwkcnlpWpiPOUGrVWS6DQygsGHwz9BMmhxPn8/ke98u2ngJZuwg== 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 4WzGVh73h2zHWh; Wed, 4 Sep 2024 08:53: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 4848rWqH005759; Wed, 4 Sep 2024 08:53:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rWa9005756; Wed, 4 Sep 2024 08:53:32 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:32 GMT Message-Id: <202409040853.4848rWa9005756@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: b822e3fab468 - stable/14 - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b822e3fab468ffbe941d0758d960e1aa46069a38 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b822e3fab468ffbe941d0758d960e1aa46069a38 commit b822e3fab468ffbe941d0758d960e1aa46069a38 Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:38:15 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5) --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5d492394eb87..e94856b011bf 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6690,6 +6690,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Wed Sep 4 08:53:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVj5SHSz5TSK4; Wed, 04 Sep 2024 08:53: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 4WzGVj4C1rz4Xv9; Wed, 4 Sep 2024 08:53:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ISdwFuPqTHEOQztJImAu3/bEWH8n1L7HpQna64z6cI=; b=Fo/OuibdB6fP5e+kcQpwMtd3dOs6uGJRcPs/4472JC6UWEoSr3p8wouS5QKy7E0nqTaiuD z21vLB6TMkZ78QTJiDn44GGSErL5uqVN1p3CkVYV0q9ot4L2BSSm/ZS5SuQ7nKVX1C6qsX /GOuyK+ejCozYq9d/HGGNRP7iFK6LeDQN213RJnLbSXeEue1/H1FyX4qyXCir0n3ewb5fj 5XIAeDxa81CF4brp5SGdphxC4D0cQpSvCt8o/beuiUtxMF8ze6s96UokZzRPyQfmDfOqt4 kZSv1AlbWxCKzPxmJ4M4i349sAEgvBt+PwQcO85LkG0su28ICtA2yAT3GpSbMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440013; a=rsa-sha256; cv=none; b=G453zffIlJEbEa24cLQs3IIbg/g/DYUzs3L8tMsN4S3IUGLAuGR5xUzU3MAXHpUEqjCg43 zpeHaGeF8WPNE9yMruagAPnCV/Ee0iI1XpndAczDUpT4+gnasET7qvdutD9lSRpRBbIsz8 6uCStvb6Hvok7/ISsDnjaJ7zjCFEIZQvFww4FG730Bum5wWVv3US9PMHt02DAYcAP31AV9 54ldmlQP1RC04sdv7YhCIZecf+xFZrHb1o5r6zJ6UoPM3urXu2hsinU8Tz3uRVwk2RA0kf uRtfdqN2OZX855eV7/hy6QsT9vh//oY8sB1HfQASHKe3EAx0k894D1Q+oHNOKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ISdwFuPqTHEOQztJImAu3/bEWH8n1L7HpQna64z6cI=; b=ECItWJH+HgTffJEIBMpUmraahjrk0TQxhQvaLx2TKXwakmOv3QacdO/+Ysa0pSCHmMCLUB 1TqGnfU5YF7hsW2+JEGmhCxvIiNHpTh2qxwoGzXNSot8W7cTr9RksZxLbNZy+0OncU73E2 3AgBARIqOuy5/PxzJKVplbmcYCa8WhF3J4OjTaBiECgtXVQ6YF7HRXOT+Xr/kDeWuzG0Nv zrPztpyZg5ORaOhMTGRuLK3WUqsa9gXwxrth8V5C+OXiiZFnpWn03FlytxSB7frQbf6B8/ jWzVvyw8QNH6K0VgJSD181yo4dKQkZH6Yl4J81gzRvK3hJCgIcy5l6MLeGg8fA== 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 4WzGVj3qcCzHrg; Wed, 4 Sep 2024 08:53: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 4848rXN8005827; Wed, 4 Sep 2024 08:53:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rXgT005824; Wed, 4 Sep 2024 08:53:33 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:33 GMT Message-Id: <202409040853.4848rXgT005824@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: b4b8b2fc9bd2 - stable/13 - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4b8b2fc9bd25d10eab0afdbd06a7ef8735b7b6b Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4b8b2fc9bd25d10eab0afdbd06a7ef8735b7b6b commit b4b8b2fc9bd25d10eab0afdbd06a7ef8735b7b6b Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:53:06 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5) --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ef6a2bd7de40..db7d8659baec 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6098,6 +6098,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, direction, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Wed Sep 4 08:53:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVg6vzKz5TS4x; Wed, 04 Sep 2024 08:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVg6N2bz4XRm; Wed, 4 Sep 2024 08:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wyCmOssdMAbTYAq3I8VCL0MIhAJ3a+zvRA+YILVUOb4=; b=cJHdrtIKEKrN/txnRVxIuR0PdPzpF1no2P0mPQ+rSjV3+uB7Yx3bcfFOupBezYY4tMU999 gydqjVNCzgL11L+UKhklNUc6gtFRFrPbojl8kPd3B8MP9/i4HdUQNNmZLz/qcnNL+9TV3f B6aL9zSuJ2NEwY/kBUbjQ0/0CHNafyqVYKRzcHeZuQJ3OsqwvbOx+WhjIIQ75onQ+tZZUg yVI9uJsN4jhPIqPnd3tL33/yCRnggXSMtpxKEgGXVOqZpxWiwxCS7yjOHb7wEV0tdoIIe+ 1rLZXsy4Ny5CdGETDdJ/sdBMoIvCIDFyaM1ZvZ+BjQSlCam6EvEbQ+W7Hzy+cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440011; a=rsa-sha256; cv=none; b=mvz/PfqBsTz02LXGKsh1dXhtvXqzrHpkelE14/TDlfdz1bU4ouqMApNXAZdZBfNCtU9ZyY sTjSk4UstWhlcUgGoMybECrpdYOvTlsNzJW3GwPjrzH3ddBL1zcutBFMuKpQYV6Lt9PWib Vz8U8pbHtVyplQ+Vy4ag9U3JtFREcD4Ie9u4F/h8a8DDo+ddluNErn2Oi6r7nYZkiNooXJ wDE2czYEbYpQHbM+yTVSjOQ/tsMAIpEuJYOkzKxK6LULpOKxZh4hHGbc43I6uVDLW6F2kh H/SxRu2H0LnedgUOTPXBg0/j2kOTwdIMTbtBVEq16AE2pg2rlcRZl+I7yuW5Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wyCmOssdMAbTYAq3I8VCL0MIhAJ3a+zvRA+YILVUOb4=; b=OalL+0w9D0G1nj7WeR0eoeP+HQwfzxIwfAKTzWdEmr/K5DOGDoeW0/hIu/BvZQ5z6YFToj lBeivpxSW99e+hPYdygG4Zo9FxjOSITDw7Tr6XbhwN1givEFg+nvXZ/iytan0G7gauA5KL 1+tVeaimXeheUjRnWMWfpW0x+M/aCygn9z8z7XNSbRXolw29SbLEtC3/evFg8lareukBQo LYp1Vst0WNam1RRfnYzX+vOpuKm2bBV7IGSkZgLVDehMVPtLLyQg/Wfj0DLFV82S8euU+T 1Pe7vwUiZznZymkjLFuJgfGnZvyZWjb/YEvS0JGQRf5QosmV9MhpPKGf6hjAcQ== 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 4WzGVg60LnzHWg; Wed, 4 Sep 2024 08:53:31 +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 4848rVEo005623; Wed, 4 Sep 2024 08:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rVlo005620; Wed, 4 Sep 2024 08:53:31 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:31 GMT Message-Id: <202409040853.4848rVlo005620@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: f40b0e735177 - stable/14 - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f40b0e735177b25ce67fb488a93834168f4c16e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f40b0e735177b25ce67fb488a93834168f4c16e1 commit f40b0e735177b25ce67fb488a93834168f4c16e1 Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:38:15 +0000 pf: try to lookup the icmp state based on a correct packet descriptor MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b8cd169efa6ac0899b4998898129765ae5c685a6) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 62ee12322e8b..5d492394eb87 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7224,11 +7224,11 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Wed Sep 4 08:53:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVh58dlz5TS9B; Wed, 04 Sep 2024 08:53: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 4WzGVh3QVmz4Xrj; Wed, 4 Sep 2024 08:53:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1QQakvTxOFS33r6Gh9ORsLaG1CXnqZQaTExWbFWrXUI=; b=G8czzyPcraY4XQ1qt5FXj5VVxo6Um9l03N2rBfN6HO5gwD1AeCCJWV1ZBrNFys64AHnfgu TX6KS9zGPcc5WOene14DrfQAOJilfllUCsP9V8BodBOm+OVk0B+JfGMHrZCSpvqHlDbUAM CeNCbXXyQVUu1P+3g/uVqELYcMT6tt1F/FunXGIaifYdYYm2wEOA6F8abbpnO+TDvoVwao ip7MFYBrHBJEWacR1OUwJ/mUMG/U3k85XtzgiXBDoxO9mcfA5V99Jg9OK82kuflyeLzRGS 2x73enHtc0b7exI5iennUakmdUMzLfC/+kRvxaZU9vvda2Mn9jXZ45V2TFH1qA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440012; a=rsa-sha256; cv=none; b=XcaZE0QfhpRqxEKT/XMR62cW5OX/QApQd2X7tuGoU70Y6vqHEp/Mzb3qFCXI6TAQNf0T3k dddR1qHtVGyE7O/mzAQaMJ8xlg2U4aR9VDho6XT9dbwVLwuKqwny9u2HaVE/h9d5AQXRt2 7gh22NtSY7n5l7wewBNRBQPL70bzS7mLGMBa1nyCTtoNvkGDgwcmaAKwlCEY/sqAEqKuZq e6KPhCKltRu/fx3JrZUv8OgWNFlV9uzt0B6TF0HLpOpTq1kUpETFBd2aAfV8r149vkMfXA K92VzjBti4LKl5UyaCXsjGE1uRZMKkjS2P1xp9smxHHd65+sViTEECBZxMsSrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1QQakvTxOFS33r6Gh9ORsLaG1CXnqZQaTExWbFWrXUI=; b=bZuG6afFrGhxvE6Gw5GJE7pATi/kEHL7JmjwYUuP99MsV+jnzn6dGt5Db31LIotaCHuu4Z ipu4TNt8kfac9y/+cd3ChZUt1SXGheApr0S4MtDK2FYsRpMEBsfU08YbkxBlKvAlm8vpjG LV0hDjd//pj6Jm4esPQmvOSENn82MAKuWNhdNYUVn7XQuov6dWEkUOSYNcYHTHPqjh6Zh1 ROPqnWfEepL2mbLFf4qIKlgVrBDwecRHl6vmbRSnLi0wGSfcBunYRIPHyccaW3GCxi2tKo wADYBqXA3J0Vm2QmQKn1EIsQRbQaicgx4W3RfTrc+YZH8+S/Mact+Zslw5yuCA== 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 4WzGVh32WCzJCH; Wed, 4 Sep 2024 08:53: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 4848rWcL005689; Wed, 4 Sep 2024 08:53:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rWPo005686; Wed, 4 Sep 2024 08:53:32 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:32 GMT Message-Id: <202409040853.4848rWPo005686@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: fa4b64836183 - stable/13 - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa4b64836183c33631d92dadb073a9e435c5bf6d Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fa4b64836183c33631d92dadb073a9e435c5bf6d commit fa4b64836183c33631d92dadb073a9e435c5bf6d Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:53:06 +0000 pf: try to lookup the icmp state based on a correct packet descriptor MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b8cd169efa6ac0899b4998898129765ae5c685a6) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f55ed99153b1..ef6a2bd7de40 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6632,11 +6632,11 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Wed Sep 4 08:53:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVg58CVz5TRk8; Wed, 04 Sep 2024 08:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzGVg2gRvz4XgW; Wed, 4 Sep 2024 08:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uWEVAXTS1K+ru8nsVnHGE3L7ajpJUlJk/xiyo9qbl4=; b=AYrbzE+KaszFGtrq9clyFNkXAhHlGAtKKwXMXyeMX1IFdEEvQd9Rc/OF4LzaFd/5ghW5AX FODmiqbwCpkyqvGOOd1+lnE/F31DhVAFtylxpk06r24iSOkWvEsUeLaTRkufnM7I/n1TIq n10IwtjAPrmxXCoJnIghnSNBC6Ix1BuQIiKo3e42pd17LWAa3czSEVoHWCOaytgePDDR+s UQjYcyHZFxYk5l/b3JDyu7oquysBUUxl2Cg7yF1b2F9C/CiomCEprc7M/sshshkpjRYd0U 3+gL33srXYMmojr5HlGPyWN4S7O6KdTBP2gCla5Ac/oR9Pwui6NdhtVlDW0GPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440011; a=rsa-sha256; cv=none; b=khBa+obo2SF+vsAUIfHfcvNSrAHMLgjvONrKRRR9Dafm+/Xn1yCLs0KYOyC2rT94G3lfH9 gYQIimJmcD363OVnAmTa1oUdcONybi5b9ihKgXTI0vYBPF9uBzGgMLrMVu5UnyA1slnVMg CkeuZ7EWBfGSYKHenoJdTT6tRjPqoqpCpoF0je8StYtc1xUWSHlgGZxIrtXjTyDp/SrRgm jHeLCH9FEnVOg6pnGjNLfunIhqcnr/+ADDCyJYknVtLkneBHp9oyMlvkX/xztM8C0ruRpf CRqQjK7aXZRMW05l+zmOZyl9gBMTI50R7302xYTG6RpSOLNHHPntyg3y8Dx9mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uWEVAXTS1K+ru8nsVnHGE3L7ajpJUlJk/xiyo9qbl4=; b=mx5ELWSDbvv/JHboJI3TrLMJDah+srCQAYHtTIQLHfJQ2bqYDcAfz9yyK3SFm6PVdog6eL dnNXLyPToH0QQd9tOJEgVc10TS+LEHWTeTYOPifVMBLQOjei0f4RDGPnrLu2Q68yLvDR0F eUQ03WRdo1AyC3/wjjqSdR0fjnQ6rNZhzvkE6Kc2aOT52K7kD/BKp4fdbDVE9/Lv+L9G+p +KC+O0G11QrHEjSsS+rgVK8NVgtX9ymHUcwwPUVMsLTYJUxwS0s2gBrD4MZORX315efe70 i77RyCT+klo8t+hAm+rEVkTuKl17BnfCv94SG5GaB3FGawB2r7LOuSBx3D6JbA== 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 4WzGVg2HNNzJ2l; Wed, 4 Sep 2024 08:53:31 +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 4848rV7J005557; Wed, 4 Sep 2024 08:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rVKY005554; Wed, 4 Sep 2024 08:53:31 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:31 GMT Message-Id: <202409040853.4848rVKY005554@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: 2c76404c79ac - stable/13 - pf tests: ensure that neighbour discovery works as expected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c76404c79ac67d8d3df1d11881dce9c2fa44cca Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2c76404c79ac67d8d3df1d11881dce9c2fa44cca commit 2c76404c79ac67d8d3df1d11881dce9c2fa44cca Author: Kristof Provost AuthorDate: 2024-08-26 13:02:22 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:53:06 +0000 pf tests: ensure that neighbour discovery works as expected Also check repeated calls. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit d154dc21130b607d7903f276dd6d463b990f33f7) --- tests/sys/netpfil/pf/icmp6.sh | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index b9b60a484afc..eb286e23ef4c 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -149,8 +149,56 @@ ttl_exceeded_cleanup() pft_cleanup } +atf_test_case "repeat" "cleanup" +repeat_head() +{ + atf_set descr 'Ensure that repeated NDs work' + atf_set require.user root + atf_set require.progs ndisc6 +} + +repeat_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block all" \ + "pass quick inet6 proto ipv6-icmp all icmp6-type neighbrsol keep state (if-bound) ridentifier 1000000107" + + jexec alcatraz pfctl -x loud + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv +} + +repeat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "zero_id" atf_add_test_case "ttl_exceeded" + atf_add_test_case "repeat" } From nobody Wed Sep 4 08:53:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVk3qNCz5TSK5; Wed, 04 Sep 2024 08:53: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 4WzGVk1LYWz4Xry; Wed, 4 Sep 2024 08:53:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CAWSaO1YShihW36trFHB3EyMyVpOSpsfeVeqT99axxE=; b=pvEAr0nSB128Ao3xoTkWl8ve6mqBijfnAd3zLLe3imJ48CbwzierVnzOdqpL/gIV9HaFW6 WKPFYtUi0R+5Pqy27vR9mIUATs+m/UNNjxiMXDcE9eg2eNC+KVOxEBDcZc0Dpug4HagXgT YR875LgfK1UVAAqFIVNVgGolhFLZsAE/ES6W6tXrODIYC4RCgYJ+6bGxRUroHrO3SJ7AGo QcA+s49T9/n14U5Y37324TL61A+laWlfuEs7yjaH1g3+ghx6lw1i0XKd2tfUZdwdFF6sFO AZ6TUOldWYxHMaa6Agts/F7wYI3+EvImLwXPDCV7j8w9uHtUOlZ3e8CTqMLjeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440014; a=rsa-sha256; cv=none; b=wA0gSuza0zTy9VcxbT/uDnCqmfAn7jxygo3xbH2EMU9aXfBuuCNUeLe9GQnl8zTj2BtB8Y EE+aJspYACWLGpxlO2/pv54ltRi6++521aMA3C7FZb/PliH28bTszz0wGZKb0xqJsvZyZw hCqr8X5NdA3p1fQSTJAPtEeDzRY9L7fh+QideX8V52PyVKJq47grxH5UZxreZGHW9hsTYm 5gF/I7FRCbca2Wg29RlrQ319+YNsMVau0IJCLs4StoZfEgWbs8/otiWUyjxVIOINHtK8aU 094/fNtGLJaN5zMaG2fAqKugcRMBxMLPZmeOYcL4tOneDDoFkZnAgWVQ23tgCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CAWSaO1YShihW36trFHB3EyMyVpOSpsfeVeqT99axxE=; b=YSrfIfFRpEPUr2cVcq2CmtGEIYglag5pqH2JFeFrPker1UeNEXVC20fdqVwhjY3MHFfrPk 3k339lKYFjVZwaYjsVIIV5mB17jP11xgGd+ZsupiQE6M50ldNWJ3gF2pBZN7fw9MSDQ+K+ WPoXeDmn9nEmsnbPbBfJdYqEmvNkLNQ+JYTMP+ZNVldaVK/E6ghaNXcG9Nup4vPOBJHPQP ZP6m6ZAzFWzNTzf+SarA2V/FhgFlln/US9dlY4no/oWjEopcJR46D4lIoIrbi758lockx0 rU2Hd7tNIiWsd1hS9nCI9xUCndO7dBmUjmQnISslV1CBUUkP69RzAsCfgViQfg== 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 4WzGVk0ys4zHnk; Wed, 4 Sep 2024 08:53: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 4848rYOp005871; Wed, 4 Sep 2024 08:53:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rYpA005868; Wed, 4 Sep 2024 08:53:34 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:34 GMT Message-Id: <202409040853.4848rYpA005868@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: 38f74de7184a - stable/14 - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38f74de7184ac3ad7acc48055551aaa9ec9cded9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=38f74de7184ac3ad7acc48055551aaa9ec9cded9 commit 38f74de7184ac3ad7acc48055551aaa9ec9cded9 Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:38:15 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0578fe492284ded4745167060be794032e6e22f0) --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d33c747efa7e..290f339e7d00 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -359,8 +359,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e94856b011bf..e39abc7e7ad2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6704,6 +6704,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6756,15 +6758,16 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -7171,8 +7174,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -7227,16 +7232,17 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Wed Sep 4 08:53:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGVk6fJ5z5TSWL; Wed, 04 Sep 2024 08:53: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 4WzGVk5FBVz4XSD; Wed, 4 Sep 2024 08:53:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3uxULkJCBLo1WOuGZ0+TAukEhFYnPAf7/7JhuE57gzs=; b=MCO4xISXsJ1NhpuJmZV0f4YhyTro14XXuNBTKWl0A/MElm/jsMf2rODij9rAioR3Nv0L5R ecMrsciNNGg3V7isHMt5vhHCgJBiChiaR8lOHfyGqX5bLOkK6qdrKGr1KV8KCUsPpWEVp1 JYo5THjc6eO1E09n0YpFehTb3XVvb8H2JLKbOYibmeNlY7Q7QkUd1QfdhjipdhGejeRyRq 2wuLU+6F+II/TMFv1GivBBUyCKJB+mYPMA0vmw10vf8jL/9G+ZR95Fb1wFlpOan5toGSVe 55lEo9/oompdy1wQu23yO/XuFx41gSXM4HElmhthfTzWvMAcuP7yqQpJqs94ZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725440014; a=rsa-sha256; cv=none; b=qPmAvHyn6NC1gyIYzr6/goZtYx+gRPeZKNLzbAg0RCwAcUZT4i50aeqh/mczhqgBNWoya6 zSTEC+8pIhjXaw56xca/KSiy7WtuBMGr9lDLoOaWjuEEo1i8WCYVKptPW6mscJaz5Fm/fv JcztScTAc5GULUKgzHXCeiGr7pehPU6g54QiFL8p7qwuKcdV0cbBmCHpF0XcuquArebN+4 DMDqJIgD5pGlBhHZNvd/nPE91cjQ+SLFbC4bZtc7Kc6YysbN60yKL1mXUzOAfEBKueG2Im Y/iuSokdFjYh7dtevnVNj6rzoii9yCIYkWyf2i9VRAqon0MtoJAdd1YzMSxrJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725440014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3uxULkJCBLo1WOuGZ0+TAukEhFYnPAf7/7JhuE57gzs=; b=HyGx4LenE4QMq+Ea1ZLH0RHX1m9a/FAnTnatDP95zFm2pVLP0xagy0B0zacbQ37l+BWa3Y rIxtMfh9vPJHATV6ZEXDJctVbAkVsBx7QKUzcjx6FnbfVyTk2KS38OJ26bAVJt1O/uejvw 94DyEIq8OoO3uZmx0BDsZuPkPzERoVWvXhyRtv95iUI65OpE4BgT8pK5mDB6USlpWCS5sH WqKjlHVwJdsUqJ/HAY70VDY3Sky7EQvQX96sJ/e8AbVo7sORDPtXAl9H3mvYRbyOB3J0tq +meadbRq8BzxYpQC3BpZ9hazcVs0z+At87Hdudb7HCp7fSsxUWA3aC5DZuqKIA== 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 4WzGVk4qlvzHrh; Wed, 4 Sep 2024 08:53: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 4848rYPC005913; Wed, 4 Sep 2024 08:53:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4848rYbe005910; Wed, 4 Sep 2024 08:53:34 GMT (envelope-from git) Date: Wed, 4 Sep 2024 08:53:34 GMT Message-Id: <202409040853.4848rYbe005910@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: d6e5f8643d37 - stable/13 - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d6e5f8643d37e925aa51fc8224cfc05aba0813f7 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d6e5f8643d37e925aa51fc8224cfc05aba0813f7 commit d6e5f8643d37e925aa51fc8224cfc05aba0813f7 Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Kristof Provost CommitDate: 2024-09-04 08:53:07 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0578fe492284ded4745167060be794032e6e22f0) --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e6c2d1f290cf..66bdbf43e212 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -330,8 +330,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index db7d8659baec..b95ef59a3250 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6112,6 +6112,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6164,15 +6166,16 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -6579,8 +6582,10 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6635,16 +6640,17 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Wed Sep 4 09:11:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzGvl6sHjz5TTgJ; Wed, 04 Sep 2024 09:11: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 4WzGvl5jVPz4hC3; Wed, 4 Sep 2024 09:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725441107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OAidzEki7BZnHlw4/ysHT08Lh7Smm7sfLy38tD2HPFE=; b=tLiNcO8jg3eefRAh6nGanw3gZ6hRF5z/U7va0Ib8Nq/jqHwFhxUmDo1Ig4xYx+4vKFQjmr oATTKEw5nE7MCz9SGuw/99pOSXasIlGpMhxmRhOW60V4RMW9ZrmXQqdSf5IMcOZc+ALdrx QNYw++lqcQPQRa4UT0vm5GwtrtTn/ANJohUafEtvEa1CTCAGZ/xEoEpGkoCbEpqJu5FDd0 feH8Xk9tHX9qv2B2GHMlTssWBFI+LEWAKNbXVchoFubx5e+Pph2he6C37fzehTBQvOmcwy Z4NFHK1AxsmzUKk7ACoImmMQrGF2luG6e0nMbiH4zbx4A1a/nGiSX224agNvlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725441107; a=rsa-sha256; cv=none; b=CuTgwVz++CfTFGYo41d74LzSnkC2HDvkG9QHM4bZndFoxBz9WUdMRPm4vQYIqcpZUejtig tHvBQJenz2nsJ61MjECoYJlxn5Zqpv5Wo9VRH5QJYO57Nfbg2DaJtVHXUIHgXoKo5qZWZP 0yNmwgM0cqK0SQ3wnYVGLIuTkdlNuo5qTqHPA/L6eXI5Bm8cVk1VUgAs3Gp/JEKCWZl/uG r9khkEKQLafmk2e7Nd8GrytZBhFQ7dmTNKULWEGvSo3VkOnXeYZsDzoCKBsstsSPo3vm/M 8WGgs9hVo4zQ/qXSuc7t0BaC8D5FSdp467f1yUKasmIHyI4UUTiPhf4TWCxJ5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725441107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OAidzEki7BZnHlw4/ysHT08Lh7Smm7sfLy38tD2HPFE=; b=twMbREcexWxnFmJFCE/RFX/6eqh5LJ/0Ixs1a4zzxoAPhs8Yxg+AOV43OzJl4wKt8K3OA9 d/H5MJOTwS+p5rEk7ZORHNIq90Oqd4Xt2f6YYBDwe+xYJCATziDwmUhkqKfz/TinxDpbb8 EAMr62A8sZalrhGBBT5UVYUCmUmbzb9iuhpSYf25sAjWHMmfhGst3vTE3aDqs7Z3wpBfXl hH71x2hHmKCkSu/YoSsYGBicTha0R7ptSWkm5k6F9HsqeZfgG754qmkpKiNTwTLD1rsMVs FTKo3xCteFyhLWAK0Hi074tFUJ+nD+y5pDmCxw9SeAPpAR37ud1uwdPuhtOh0A== 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 4WzGvl0HjPzHcp; Wed, 4 Sep 2024 09:11: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 4849BkKC037196; Wed, 4 Sep 2024 09:11:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4849Bk8d037174; Wed, 4 Sep 2024 09:11:46 GMT (envelope-from git) Date: Wed, 4 Sep 2024 09:11:46 GMT Message-Id: <202409040911.4849Bk8d037174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: e29afe64efd2 - main - riscv: fix csr_swap() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e29afe64efd22b5f503d1f2558c38362b56be812 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=e29afe64efd22b5f503d1f2558c38362b56be812 commit e29afe64efd22b5f503d1f2558c38362b56be812 Author: Ruslan Bukin AuthorDate: 2024-09-04 09:04:11 +0000 Commit: Ruslan Bukin CommitDate: 2024-09-04 09:08:40 +0000 riscv: fix csr_swap() Fix csr_swap() macro so that we don't overwrite the argument (which is not even possible when the argument is an immediate value) Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D46526 --- sys/riscv/include/riscvreg.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/riscv/include/riscvreg.h b/sys/riscv/include/riscvreg.h index 6a59b0132b1b..e1ad09acedc8 100644 --- a/sys/riscv/include/riscvreg.h +++ b/sys/riscv/include/riscvreg.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2024 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -189,13 +189,14 @@ (__builtin_constant_p(val) && ((u_long)(val) < 32)) #define csr_swap(csr, val) \ -({ if (CSR_ZIMM(val)) \ +({ u_long ret; \ + if (CSR_ZIMM(val)) \ __asm __volatile("csrrwi %0, " #csr ", %1" \ - : "=r" (val) : "i" (val)); \ + : "=r" (ret) : "i" (val)); \ else \ __asm __volatile("csrrw %0, " #csr ", %1" \ - : "=r" (val) : "r" (val)); \ - val; \ + : "=r" (ret) : "r" (val)); \ + ret; \ }) #define csr_write(csr, val) \ From nobody Wed Sep 4 12:22:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzM7m1cl8z5TnJD; Wed, 04 Sep 2024 12:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzM7m0tBCz54Yb; Wed, 4 Sep 2024 12:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dSW2dkFEuheKJtGyF58Cw3d32gW4KMjkW38XENeynUw=; b=Kzh6G8V7iJgFC/pLaJHVf//LWECeXNSdVxzJPnMKkWQnx1sZY5GyFlP2su4fJj2gX++SRG 9XwJJV0t7lCh6Bwh+VOJBGua7TBcdU/JxZxnF9r561HUw6P6AF6189niVV6SfbdpVbTDl1 L0S9o98rQo3PwrYvv9Pa+DMlx0y6LnFQWey4smXAPMH/zQsoVF+oGVvjGvqlSnG64K5KBn OzPYE50WqGtik9d0PLrcgH0huj7gk0v6Chl443QDInyt9cq/0XjteB8m8cClMP3FjZh4/j KLOfbJ8EsrbKPt3fBccAj4XoABSyiXXYKktcTRfdEIYtWKUMSeuxms+jSZLwdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452548; a=rsa-sha256; cv=none; b=EM5b8Znox5r+23uDhwXhO1r3V6PaQL4OiUKdbDQLdAB9Y/ia52Sxzxvzzppc5ZW5sbj+rR 2pndAZpSz1A46l0Z6Xs9Ux25cTKUa9zHb0jEIYzFYJHid4JGWIE+RhQkqAMh8FzP7+6gDM iY61r8f59t8X+kaP2AZh+JZ2WzP9TL3zUn6eRkbDo05mtFXJmP205NnQIAioe43FxqxIdc ucddKkKYU/FZgESWXNJWeoZyKL5r20t96ftdV5c2ecFSZ/Xte9+PUiqo7a/DVoGKlqaYQe k2MK6zw7t6tDDWkZgfD2NdosbzGWaXLWBL53gAGGppsAPD10dcSMTPfZQmt3zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dSW2dkFEuheKJtGyF58Cw3d32gW4KMjkW38XENeynUw=; b=Yjd+v/5XMOf2tbYKqBkRLPOwvjoZQN63aPNh0YZSf3rNpK+VAwAdORKClhv/vOsEWPPBFV XaUZD1L8oi5vBzoyhyNIKewS+98PYWfLD4phW9o66Ax9pPtoLSFkl0Lx65dr4N3X8eGizB BEF18bS/RWZQ6DsFWQOJQKeLuh5K/d7x1qiMtirxO1hKtMAlSOZfPrrQUC+WHFUNpYSF4J nnlKPbtwoAXPCp3C/WXzJNDCwFQYaMs2TMHB/hT7VMPYMKXOoKaUG0l1ycDBIEz/7Nhfn8 H79qf0IIcXHxvAKzyl4lhcYfaB8ALuc4H2mEYU9v80V195uxlyggJbvDKmTSNA== 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 4WzM7m0TVrzPgy; Wed, 4 Sep 2024 12:22:28 +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 484CMRtX061629; Wed, 4 Sep 2024 12:22:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484CMRPi061626; Wed, 4 Sep 2024 12:22:27 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:22:27 GMT Message-Id: <202409041222.484CMRPi061626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 36fa90dbde00 - main - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36fa90dbde0060aacb5677d0b113ee168e839071 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=36fa90dbde0060aacb5677d0b113ee168e839071 commit 36fa90dbde0060aacb5677d0b113ee168e839071 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 11:42:49 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 0c76fefeebb6..9560ebc74f83 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -999,7 +999,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1092,7 +1092,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1330,10 +1330,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1360,10 +1360,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1393,7 +1393,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1440,7 +1440,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1507,7 +1507,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 57343f953e94..64078b10973e 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1313,7 +1317,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 12:22:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzM7n3VrGz5TnJF; Wed, 04 Sep 2024 12:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzM7n1sS9z54bY; Wed, 4 Sep 2024 12:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WKtnuSJf1mI++TTGx/9/BXiNYoEZP+F/nvN/LHq2V4g=; b=cDGfLVcaKklQIk4huvzEgmU+N+/NClsVQ89hhcULsltX23wUzF4MpetSEj0O36OnTOHa3V MKCdw2uZgWxI3dWH803EBVKg4Vfb/XlpAwBcQzSu5wEMowns/HfTnuVls0vYPcaDdY2mQb Mij2gz+Ia5ufRYo7EI+eHotX4Uxm9+fEjeIgDArL7VxnoJTU0KMENrlJKVoUwAHrnNyofx U9NI5ana1VOAuvy6X1rqltcExCYZDZ6KxDzhrI1TnXvnEoFq7/NETc26SeFbNxobtcK0Zb cjwf7R2TU/dsEKfhx/gQgt2eu02Oh+1kQnHzOStoZhWjk3UHf/58tQXsxn4/YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452549; a=rsa-sha256; cv=none; b=Zs0ygs4+io8ayvF4ucr2ak7L1Uwm4LGUPXWsFFQ+mDT0AwZaeESMhKPBVlxHB61z3eQLz/ 6QQ/06En1B7odDc168eczJ50nce+IuZ8lGTsJGIlA2yEdoa69Mi0g/y/6ZnY/vBWTv5qg4 ROCTl5HNkF2FYx8szMmTDoFu33/8gdYlPtMY7xrwAXzsD65ZLWjfwM6EJpw/rZlYClX38x inPmpBVF1bT3Xwh3VtYWeDK8iZzuq9LHfDB3xnvu0YJjgYaZdJrjmfuL6I1zmEPC19xUfN q/NS9hhUsH9DjI+MUw+rHcBa6Htdl+OPPaEcAq9WAl+I3PL3lOSipqKHr0T2YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WKtnuSJf1mI++TTGx/9/BXiNYoEZP+F/nvN/LHq2V4g=; b=ZPXBnsuzqhaTTOPTxJHyADwRj3g4UaDXCodpdGcYxBFpi8BqWOe3LXarSqovgvcB91Z+X2 BCsrOrve82MwfYa3hM2a/wqtxbn3fvvlPVf4XBdhfHqmysx2Ey6WlQgIB7Hh7N/j1awQun DHNdEc3bcIQV44RLBVgQ2pI859169FXckpzKIyhPUvpIV4spz+seFO+4L1MiN/1MfWp3JL Ec5NGJrJjXwpALKuAW2x90yziBxmFmxWb9Uer+A1HrUvZhQSoSO8Wo/LIvF+0tHeIJRqej p5BbVwC6WOhyzxDpMHwfVpdiLKNx1LZaUsUODsEvoIHotBUQQ8t4eennbwc30g== 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 4WzM7n1SL2zPDM; Wed, 4 Sep 2024 12:22:29 +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 484CMTBc061677; Wed, 4 Sep 2024 12:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484CMTmU061674; Wed, 4 Sep 2024 12:22:29 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:22:29 GMT Message-Id: <202409041222.484CMTmU061674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 3aaaca1b51ad - main - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=3aaaca1b51ad844ef9e9b3d945217ab3dd189bae commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 11:42:55 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9560ebc74f83..a977d7941aa3 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -988,6 +988,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 12:22:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzM7p3G6Bz5TnL5; Wed, 04 Sep 2024 12:22:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzM7p2Vp4z54bb; Wed, 4 Sep 2024 12:22:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWkK/egcMQKQCVVAxlU9j5K8vMWbL6G/f5hMKYlwejg=; b=PEkwRshCjT8RpWac9daT6614qFyq6bHYRgl1buJrwpZgVsedgcOSVuyiYQGiSLZBvOx+7s +xg7qIwmLgEAPTQajZJ0yZcVXYLpE4UWqK+yvLkxdLTTanRKjq8BH2IX7oCCoq5SVRH6ST F4nMgWKuKVZMLSPkDGglvXvITGaQebMSi5FRo750pGA0sEWs71Zs7pKuh+TJe8/gSE2NqD HDMaTDPZbz4bcJeV6A8Nwpm/xFHoRfUMbVHPr05jNroYWfgE2fx4B7nQMpib5880orm4eg g2Bq2tnpK5Y00bPpwYEB2SNGxs39va7UC48jCla8fBei32k/4PFrD+HN5c9knw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452550; a=rsa-sha256; cv=none; b=lxYMheLTlWKGWHJet/kMAmiT31sQgWVoeGFql1ux5ujogTxeYrdymt8ZYf0070bfKDDzQx LZZzDzWYzsSD/3wZVDZVR3nFe4x+q2os1kJ/N3TFT+MWUZDZUsP5xTRROb8qAaSGfYQ9lw j5J1wW7eyL+vofg1HUhvCP5D+JJo3UkQKfmQAD5PY8ocVgEr/h2NJTmPDWQjnlO99ShtSg 3bZltFZ9YUFpV+ykL6a10NJea/3getuVl8t0Pi3rdvuH51HQVGlKkb5WqGwme2FttL3rN7 hg6D/ZwYpu08G4guRu4IwJN3ciYYN3Fp0UDWml86VjCrZdHNzjADmLRx3imxqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWkK/egcMQKQCVVAxlU9j5K8vMWbL6G/f5hMKYlwejg=; b=hlxVoAuzb1UxZpJGXLd/y36gqlsQz6fF93klhLESSaUv0y5mpQqEwvAuy/RBV6+kabKJ1M LxaHnkV46AEZkoTFu1NhQUkVtmx+GB3pva6nkrSnaiytDgdIew5eJJuZTTy9Ch5c0vL9Em b6ImzD6Yqj/6fdoScOkIICMWmp2HqH0x2sirrLrlBej7tL9tUv3cDHQp732Pv2sRSF6e93 xWcdVBy+ZdE4AH6xa5ihVwtLEoqOsCqr4nPkw9yy/EF6uHuzdxel3vuOTxrvzJj1Q8RTSg AnAQ8qVu/ZMo0VWlTrY/XgZ4SyMhI/cpZr1wSwyr+f9dvDrI3FcSIDIGqU669w== 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 4WzM7p26QKzPdw; Wed, 4 Sep 2024 12:22:30 +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 484CMUgS061744; Wed, 4 Sep 2024 12:22:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484CMUoR061741; Wed, 4 Sep 2024 12:22:30 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:22:30 GMT Message-Id: <202409041222.484CMUoR061741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 2981431e044f - main - libnv: add test to verify null termination of string in array List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2981431e044fae3bc87e6fa891b8230b484dc84b Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=2981431e044fae3bc87e6fa891b8230b484dc84b commit 2981431e044fae3bc87e6fa891b8230b484dc84b Author: Mariusz Zaborski AuthorDate: 2024-08-29 13:44:03 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 11:43:07 +0000 libnv: add test to verify null termination of string in array Differential Revision: https://reviews.freebsd.org/D46138 --- lib/libnv/tests/nv_array_tests.cc | 58 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/lib/libnv/tests/nv_array_tests.cc b/lib/libnv/tests/nv_array_tests.cc index 06d7525c3e1d..9acbaef67eba 100644 --- a/lib/libnv/tests/nv_array_tests.cc +++ b/lib/libnv/tests/nv_array_tests.cc @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2015 Mariusz Zaborski - * All rights reserved. + * Copyright (c) 2015-2024 Mariusz Zaborski * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,6 +26,7 @@ #include #include #include +#include #include #include @@ -1161,6 +1161,58 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__pack) free(packed); } + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_string_array_nonull__pack); +ATF_TEST_CASE_BODY(nvlist_string_array_nonull__pack) +{ + nvlist_t *testnvl, *unpacked; + const char *somestr[3] = { "a", "b", "XXX" }; + uint8_t *packed, *twopages, *dataptr, *secondpage; + size_t packed_size, page_size; + bool found; + + page_size = sysconf(_SC_PAGESIZE); + testnvl = nvlist_create(0); + ATF_REQUIRE(testnvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(testnvl), 0); + nvlist_add_string_array(testnvl, "nvl/string", somestr, + nitems(somestr)); + ATF_REQUIRE_EQ(nvlist_error(testnvl), 0); + + packed = (uint8_t *)nvlist_pack(testnvl, &packed_size); + ATF_REQUIRE(packed != NULL); + + twopages = (uint8_t *)mmap(NULL, page_size * 2, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + ATF_REQUIRE(twopages != MAP_FAILED); + dataptr = &twopages[page_size - packed_size]; + secondpage = &twopages[page_size]; + + memset(twopages, 'A', page_size * 2); + + mprotect(secondpage, page_size, PROT_NONE); + memcpy(dataptr, packed, packed_size); + + found = false; + for (size_t i = 0; i < packed_size - 3; i++) { + if (dataptr[i] == 'X' && dataptr[i + 1] == 'X' && + dataptr[i + 2] == 'X' && dataptr[i + 3] == '\0') { + dataptr[i + 3] = 'X'; + found = true; + break; + } + } + ATF_REQUIRE(found == true); + + unpacked = nvlist_unpack(dataptr, packed_size, 0); + ATF_REQUIRE(unpacked == NULL); + + nvlist_destroy(testnvl); + free(packed); + munmap(twopages, page_size * 2); +} + + ATF_INIT_TEST_CASES(tp) { @@ -1190,5 +1242,7 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, nvlist_descriptor_array__pack) ATF_ADD_TEST_CASE(tp, nvlist_string_array__pack) ATF_ADD_TEST_CASE(tp, nvlist_nvlist_array__pack) + + ATF_ADD_TEST_CASE(tp, nvlist_string_array_nonull__pack) } From nobody Wed Sep 4 12:22:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzM7q4vdFz5TnL9; Wed, 04 Sep 2024 12:22:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzM7q37V0z54w6; Wed, 4 Sep 2024 12:22:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kR3CtAlwSpx44tW0vJnUqCP5Gd9DlWrVFBmN5AtOYYE=; b=XW3ng5zqLhx3GSvDmRYQ+0e2w7fZzK/A0I9PpYkSYq5h/M7nMdSrRl9oDJNvaoI2yC5+O6 J5OCSJOPCU3GfPdeejw47YcihchCVrLCHonMfA6JZG7sy6p855IBZV4icyGciqQSGaQFlW 09nWFktCBaVGevKmsCHIcCYOyetiW0aOo/xta83xhOw6q2zg6d+vUrAoXNqrwPn0Ea7Cr4 FIYk04gqLuKL7DUHepm8V/yScYhi9KfG8WvcWEMr2GPp/N9FktoROc8qFNQsotndVJALQr XYm2eo9uXy6LTv6+ErMQuMUMWw9SsmJ2dB8Pqfv7bqO1rHQxgfLYc4cdLc3DsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452551; a=rsa-sha256; cv=none; b=QyJ434gWpwj+zc8zSx76DdB3VBhBas/ORmxMHlxr+k9MDbvyVo6arg+FP4vTn95gVuw98/ zDfWwIRDOfhUPL0RHaZJsrutx7RDN6dUo0AccHtCm13vdjt/LCI0wHyTRv+S131xKJyUam rYRBqaB0Wy5e/w8HZPYwSHsdAvM3OF3vtmo5kf7hKFV8MQqBvre82iDrv4c6bGc0ICM+HP O/WMTHilN++kHF4PSgPPhMlT7e7csNaI8HAe1x1mBqWagmE6ZsFk5NIMh29QbvfsK74MAj sBSjJFNNnDmkPvdKk6oJZxOvSDrDfl2uwo1mNJMnmKNU8BrxulCNOYLNBhMsVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kR3CtAlwSpx44tW0vJnUqCP5Gd9DlWrVFBmN5AtOYYE=; b=gY/6T6jo4MWZktJ2dii3Zst6WLAK3VyIeLbNk4LemwBAOn9nKy7oJbVrkgrB0fFKMv4HUs tmgylgIpMBoo7pcsLniTqDawqKn6hTEf2E8VOQemlxHueuELsJt5MVrQdnyhKN6k6HteK5 awunujnVxkJVueIwhOLv8V4b2BVV0NrIZ5f7/RGQVhKQ3oqT973geM/NjPCg7ait7ceFur tqEmHkLsVZ4C8cQEBvkQg+AoTGWgjBZNePIyuYzNLDsOzUGQcDvlVO7UIqPGzuq3PAbgbQ hNLjhnxiOdghSgs2nYBSoR1dSbKAluDrm/bwKW/UzBy5Yb9liEiSoxn3vtLDGA== 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 4WzM7q2Q8rzNhQ; Wed, 4 Sep 2024 12:22:31 +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 484CMVaR061802; Wed, 4 Sep 2024 12:22:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484CMVxs061799; Wed, 4 Sep 2024 12:22:31 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:22:31 GMT Message-Id: <202409041222.484CMVxs061799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 241a7ddd7112 - main - libnv: add tests to verify potential overflow issues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 241a7ddd7112982ed41ccdd047c1dad59ee0256e Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=241a7ddd7112982ed41ccdd047c1dad59ee0256e commit 241a7ddd7112982ed41ccdd047c1dad59ee0256e Author: Mariusz Zaborski AuthorDate: 2024-08-29 13:46:01 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 11:43:16 +0000 libnv: add tests to verify potential overflow issues Differential Revision: https://reviews.freebsd.org/D46131 --- lib/libnv/tests/Makefile | 10 ++ lib/libnv/tests/nvlist_send_recv_test.c | 193 ++++++++++++++++++++++++++++++++ sys/contrib/libnv/nv_impl.h | 8 ++ sys/contrib/libnv/nvlist.c | 7 -- 4 files changed, 211 insertions(+), 7 deletions(-) diff --git a/lib/libnv/tests/Makefile b/lib/libnv/tests/Makefile index 2e6563a83077..aea416539c4a 100644 --- a/lib/libnv/tests/Makefile +++ b/lib/libnv/tests/Makefile @@ -1,6 +1,16 @@ +.include + ATF_TESTS_C= \ nvlist_send_recv_test +.PATH: ${SRCTOP}/lib/libnv +SRCS.nvlist_send_recv_test= msgio.c nvlist_send_recv_test.c +CFLAGS.nvlist_send_recv_test+=-I${SRCTOP}/sys/contrib/libnv +CFLAGS.nvlist_send_recv_test+=-I${SRCTOP}/lib/libnv +.if ${MK_ASAN} != "yes" +CFLAGS.nvlist_send_recv_test+=-DNO_ASAN +.endif + ATF_TESTS_CXX= \ cnv_tests \ dnv_tests \ diff --git a/lib/libnv/tests/nvlist_send_recv_test.c b/lib/libnv/tests/nvlist_send_recv_test.c index f060ee2684d5..79297dfe2043 100644 --- a/lib/libnv/tests/nvlist_send_recv_test.c +++ b/lib/libnv/tests/nvlist_send_recv_test.c @@ -43,6 +43,9 @@ #include +#include +#include + #define ALPHABET "abcdefghijklmnopqrstuvwxyz" #define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF) @@ -542,6 +545,192 @@ ATF_TC_BODY(nvlist_send_recv__send_closed_fd__stream, tc) nvlist_send_recv__send_closed_fd(SOCK_STREAM); } +ATF_TC_WITHOUT_HEAD(nvlist_send_recv__overflow_header_size); +ATF_TC_BODY(nvlist_send_recv__overflow_header_size, tc) +{ + nvlist_t *nvl; + void *packed; + size_t packed_size; + struct nvlist_header *header; + int fd, socks[2], status; + pid_t pid; + +#ifdef NO_ASAN + atf_tc_skip("This test requires ASAN"); +#endif + + ATF_REQUIRE_EQ(socketpair(PF_UNIX, SOCK_STREAM, 0, socks), 0); + + pid = fork(); + ATF_REQUIRE(pid >= 0); + + if (pid == 0) { + /* Child. */ + fd = socks[0]; + close(socks[1]); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(nvlist_empty(nvl)); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + ATF_REQUIRE(packed_size >= sizeof(struct nvlist_header)); + + header = (struct nvlist_header *)packed; + header->nvlh_size = SIZE_MAX - sizeof(struct nvlist_header) + 2; + + ATF_REQUIRE_EQ(write(fd, packed, packed_size), + (ssize_t)sizeof(struct nvlist_header)); + + nvlist_destroy(nvl); + free(packed); + + exit(0); + } else { + /* Parent */ + fd = socks[1]; + close(socks[0]); + + errno = 0; + nvl = nvlist_recv(fd, 0); + ATF_REQUIRE(nvl == NULL); + + /* + * Make sure it has failed on EINVAL, and not on + * errors returned by malloc or recv. + */ + ATF_REQUIRE(errno == EINVAL); + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(status == 0); + close(fd); + } +} + +ATF_TC_WITHOUT_HEAD(nvlist_send_recv__invalid_fd_size); +ATF_TC_BODY(nvlist_send_recv__invalid_fd_size, tc) +{ + nvlist_t *nvl; + void *packed; + size_t packed_size; + struct nvlist_header *header; + int fd, socks[2], status; + pid_t pid; + + ATF_REQUIRE_EQ(socketpair(PF_UNIX, SOCK_STREAM, 0, socks), 0); + + pid = fork(); + ATF_REQUIRE(pid >= 0); + + if (pid == 0) { + /* Child. */ + fd = socks[0]; + close(socks[1]); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_add_string(nvl, "nvl/string", "test"); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + ATF_REQUIRE(packed_size >= sizeof(struct nvlist_header)); + + header = (struct nvlist_header *)packed; + header->nvlh_descriptors = 0x20; + + ATF_REQUIRE_EQ(write(fd, packed, packed_size), + (ssize_t)packed_size); + + nvlist_destroy(nvl); + free(packed); + + exit(0); + } else { + /* Parent */ + fd = socks[1]; + close(socks[0]); + + nvl = nvlist_recv(fd, 0); + ATF_REQUIRE(nvl == NULL); + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(status == 0); + } + + close(fd); +} + +ATF_TC_WITHOUT_HEAD(nvlist_send_recv__overflow_fd_size); +ATF_TC_BODY(nvlist_send_recv__overflow_fd_size, tc) +{ + nvlist_t *nvl; + void *packed; + size_t packed_size; + struct nvlist_header *header; + int fd, socks[2], fds[1], status; + pid_t pid; + + ATF_REQUIRE_EQ(socketpair(PF_UNIX, SOCK_STREAM, 0, socks), 0); + + pid = fork(); + ATF_REQUIRE(pid >= 0); + + if (pid == 0) { + /* Child. */ + fd = socks[0]; + close(socks[1]); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_add_string(nvl, "nvl/string", "test"); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + ATF_REQUIRE(packed_size >= sizeof(struct nvlist_header)); + + header = (struct nvlist_header *)packed; + header->nvlh_descriptors = 0x4000000000000002; + + ATF_REQUIRE_EQ(write(fd, packed, packed_size), + (ssize_t)packed_size); + + fds[0] = dup(STDERR_FILENO); + ATF_REQUIRE(fds[0] >= 0); + ATF_REQUIRE_EQ(fd_send(fd, fds, 1), 0); + + nvlist_destroy(nvl); + free(packed); + + close(fds[0]); + close(fd); + + exit(0); + } else { + /* Parent */ + fd = socks[1]; + close(socks[0]); + + nvl = nvlist_recv(fd, 0); + ATF_REQUIRE(nvl == NULL); + + /* Make sure that fd was not parsed by nvlist */ + ATF_REQUIRE(fd_recv(fd, fds, 1) == 0); + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(status == 0); + + close(fds[0]); + close(fd); + } +} + ATF_TP_ADD_TCS(tp) { @@ -552,5 +741,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, nvlist_send_recv__send_many_fds__dgram); ATF_TP_ADD_TC(tp, nvlist_send_recv__send_many_fds__stream); + ATF_TP_ADD_TC(tp, nvlist_send_recv__overflow_header_size); + ATF_TP_ADD_TC(tp, nvlist_send_recv__invalid_fd_size); + ATF_TP_ADD_TC(tp, nvlist_send_recv__overflow_fd_size); + return (atf_no_error()); } diff --git a/sys/contrib/libnv/nv_impl.h b/sys/contrib/libnv/nv_impl.h index e9cd3ffabc3f..4ac57fc7b497 100644 --- a/sys/contrib/libnv/nv_impl.h +++ b/sys/contrib/libnv/nv_impl.h @@ -42,6 +42,14 @@ struct nvpair; typedef struct nvpair nvpair_t; #endif +struct nvlist_header { + uint8_t nvlh_magic; + uint8_t nvlh_version; + uint8_t nvlh_flags; + uint64_t nvlh_descriptors; + uint64_t nvlh_size; +} __packed; + #define NV_TYPE_NVLIST_ARRAY_NEXT 254 #define NV_TYPE_NVLIST_UP 255 diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 64078b10973e..1dc0bb8c1141 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -118,13 +118,6 @@ MALLOC_DEFINE(M_NVLIST, "nvlist", "kernel nvlist"); #define NVLIST_HEADER_MAGIC 0x6c #define NVLIST_HEADER_VERSION 0x00 -struct nvlist_header { - uint8_t nvlh_magic; - uint8_t nvlh_version; - uint8_t nvlh_flags; - uint64_t nvlh_descriptors; - uint64_t nvlh_size; -} __packed; nvlist_t * nvlist_create(int flags) From nobody Wed Sep 4 12:24:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzM9l5tMtz5TnQx; Wed, 04 Sep 2024 12:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzM9l4RcKz55tf; Wed, 4 Sep 2024 12:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l7Rdm/1RxtTws8oaY0IOxCoAd0MOW5oGojFKrG1W3/M=; b=hzsMOxxNj9w2HuAOo94NXegPjCUy6y60ZJE3Zg7zLNtR7eJ7HhBubx3ZKt1scvPsJpGZX8 6k93zfHvv5ZAVAjfHPII94Ko9fsodeEnJtHlNncY3QgSGbMzHkTMJ7vgI8wxXIHVsDaFbH 842CcT7mPENUGXTqsT61PSLV/2xmpbKhhGu/USPL7rhR5xdA9hC22+uog0fsuy/PwBSLHi yMbQDYcruhWQvl2n2jkqVPOro0Pca0mSnTbQAf8Pu+Sv2NXO2JPYssnVBf84OgYqQnjHA+ Fxn6NvY+l2nMez22XS4gUjj9xfqJbVZ1FLzyYaybfcK39TPhsnZ3Qbbq7nUMaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452651; a=rsa-sha256; cv=none; b=O5IHMpzzqxrOGuFsj7owEaq2bp0fQeqVMiOg7A8ktZ19+VXfmuQnBQaMhwb1c2cC/BaO9a uCtPiA8WlA+CLYsw9lgQ6pJdhcZwaAH6djXMf8QtC+7MvCRAiQv4yZvNE5gbKjovlaK1K4 ozvFn/5gHEOpuAI1CnNfyb/AEG2LraYWg1EnyzrYsh5oNc8NVED9RFnQzfVG9htnbD6Ga6 +mQYZ4CqdcBCXReelQ8TN6aD1RYn3Qr4qNNyOrQyAFVp3SC4vpRmioKwwivV4sw4jCH9t8 fvX8YHvZAFw+rQYAhl2ssIuFCwcGc87fcrXOvwB12lFua+jhTFYuL02UJiFghQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l7Rdm/1RxtTws8oaY0IOxCoAd0MOW5oGojFKrG1W3/M=; b=FrY+vWh+CXlNM5KT/Un8A4oUyAzQ7qUkBrV8MLqsQnZAs0f+z0cRIPAlXfa+B/FUjrzqMP 0RHVH+WUJNhGOoC4OvFguQir+OZw0V3i3IMrtqPVbiIsHAwcUG+8hStBCI3W7UfbYtOcCh rKb8M8FZaT/C5dyZ4U7u6oCJ9zdGW8nQOJshvvf0ZbOSwpgNFCt8AXQLeRpsEgA5t/CG+h UIb8vMSlcPqjN9t26yyvL0YomrCKtInJoJD77b0s2OaMKYw2eY4jJ87zyKJELmZlWZRq6f wigkLBqt1HmXmJfyycxvREmdsWcHQYl4TwFXuLrrArlNVlJVX6dTAItyl5D+Zg== 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 4WzM9l1Xl3zPDQ; Wed, 4 Sep 2024 12:24:11 +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 484COBa4062234; Wed, 4 Sep 2024 12:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484COBeR062231; Wed, 4 Sep 2024 12:24:11 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:24:11 GMT Message-Id: <202409041224.484COBeR062231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 2e7f9244ebef - stable/13 - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e7f9244ebefe019ef016a3a5b47c4562850d1c2 Auto-Submitted: auto-generated The branch stable/13 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=2e7f9244ebefe019ef016a3a5b47c4562850d1c2 commit 2e7f9244ebefe019ef016a3a5b47c4562850d1c2 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 12:24:51 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 (cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071) --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9fd233e1f1d1..41d262a18c9b 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -997,7 +997,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1090,7 +1090,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1328,10 +1328,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1358,10 +1358,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1391,7 +1391,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1438,7 +1438,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1505,7 +1505,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 56b818691660..e399d610a7ce 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1302,7 +1306,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 12:24:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzM9m5qhXz5Tnkc; Wed, 04 Sep 2024 12:24: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 4WzM9m3Skwz566B; Wed, 4 Sep 2024 12:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zS9B1s0B6jngtIpTbOq1ktIsexmx5zqdGNojm7k26VE=; b=xXUN/bEWN395vkkzD0bqwSn1q+pArgPxaYH5Q5scZffqvjqmAIxCWvFZeJChJlrMh265JK vbTdb3MItIpXh2lvQSlK4wl8vPJmcgTIgsOtVvGzNOhjd7moaOs0TFOfAurO4XqpLrj1Vc pKw3PYlsm2uV1JmgfbnT8ivtfQkVUff/2PVZwW/M5CMvDdRJfMg1JoXPhV3tHl4CyCBBJQ mrtN4yS40uKEWaMHql3O1xacaiznL5fgA5Q/PbjJbVzUwPzq4LcFIWoQ3OPipMfDxtGBF/ hm8VbShRzXSj6//6pxdg6PcORwRS8LvBprJfjj3Ldejd5VUCzFJOCwHN8wln4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452652; a=rsa-sha256; cv=none; b=P4Fpcl6HM/7PtsCz/uu1rZeFsQLeL0OcnL2tdEXqtri1wKp5//IeQyHoHaUhR739gxp5Wi dlKWywsKTIeZ+EubSb+O5U/GmaNLQfvYZ4RfoAnpSNPYolSr4S4tZdZhQR1ou28gLEsDPX BQE/xPoIByu5qo5V04lHWQMrqSyCHweZAwYy/Cjn8TFAzwZjFUjBHVMF0eLPYf642ogxQu 4JhrfmSVIzqCPiJ+Km+PIgTKfXrvEfXes9my8qMHyR5h+QbfnbmiXSJ/IW8PfItbYC8+4p NXbGGDAWMmkkxm/5sHOTkL1XE/hnkZaNV45xKMUg4lLobeVGEPyfGdeo0E+U+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zS9B1s0B6jngtIpTbOq1ktIsexmx5zqdGNojm7k26VE=; b=acFy2XitYNpaw4s2iUOelOlTpY3tVFeaeC232dRl0tIe11vYnVj11cgzaIdbHd2JAltOwR lteEervDrtgUZeWlQLi2+rHpLFSSjKs9DDxczMUPtYN1qZzeYKtfdl3/49RLXRLZu5kDMK r5BXBhWcn/FI7z9S50GaYCQ/bbNkUcgZPfdb2xzEDJsSSkx2ogJh13egDLKvii7fLYAWuR wmNNN7MKEfGcnFgALhwSy6zPF/MfSD/SeUzv0nz+W3EMKNEPUsDiVtE6cL+daWaUt16jo5 mIMQv2lVXpZah9nDIT8CLhRDdO9pfgnokhwVLDYq/Pys4OutbYysxn5vc1US/g== 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 4WzM9m2RyRzPDS; Wed, 4 Sep 2024 12:24: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 484COCCl062286; Wed, 4 Sep 2024 12:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484COCsl062283; Wed, 4 Sep 2024 12:24:12 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:24:12 GMT Message-Id: <202409041224.484COCsl062283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 03bef9971d73 - stable/13 - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03bef9971d73621e1703a0bad41b598bc2fce9c6 Auto-Submitted: auto-generated The branch stable/13 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=03bef9971d73621e1703a0bad41b598bc2fce9c6 commit 03bef9971d73621e1703a0bad41b598bc2fce9c6 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 12:25:13 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 (cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae) --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 41d262a18c9b..cfe168c38026 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -986,6 +986,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 12:24:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzMBc2ZqBz5TnV4; Wed, 04 Sep 2024 12:24: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 4WzMBb5gS4z56Yh; Wed, 4 Sep 2024 12:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZFJa2JVg0FOBF39ZJ4v/mSG4GxQfTJDEkYneTePtjqg=; b=T42DeGxg/Snwoo7SJBHHb9byDTlDCRTxy2nz/NKmcx0m9WaZu85U90nPcOVKDIpjKrh5RK FfzfCSTAi2HJ8ohpkPd38XQlnG4DgelhSjlwMrofJksDuusvKDJf1s9Q9xty+dIxYTAyOv pO/a6G4OW/0lZuQq8E02z+gAzDrgtuH12KEaji6sIjIkbqH3SRMvJR7T2wU6jOa6XGfv8F omfL2jsUTEEc2gDX1N5iFv+EECsUygBHQoG9i2IzXix8QjOTLPHLzH2XsUlNXTQx7GEKeL 4F9jT7pNxL9M/YLcyZqqYy4ixD9zwlqWo8xBWB6kafObEfZQ+bmhkiAZekoGBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452695; a=rsa-sha256; cv=none; b=CA6sgmZK6LFF5Sg6A4Vq6A6tUgzQDGmnD4jO3ec7AZe5H75tT5NdqSD04oD2kULl6P3S/n XIRs5aUYSSZhIG82EImcUbt75t0SGGF6RAI6u73t+TfGViekCY9xxFaucz0UrIpT7QGOz4 DmRcn22Tg8FTo4K7qxVTWhFMvsfuFA6ZckL5OkY48Ew0KmtzqHjUgOrH3FXdxF0nU8XbUF +RryT+hC1/qs1H7WcEFwYgbNJ01LWxl7SC4PUyjE1zaqj1HcyYHTBha/BtAdOBzX/SzN4R xqB/TE4rYhXtgN6e5QCO7yVVWanh1QtR0S8319ILtDCWWZyqS928vF+PIfom7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZFJa2JVg0FOBF39ZJ4v/mSG4GxQfTJDEkYneTePtjqg=; b=uM5hke8m9qIlNNUPHabRVHycYhkb9XIihlZnTM7XVjylUwpGR4zkyQNSeUx5sWtOS3+n6q PUDiZ55YISEjI157gZmPQT8sH6ZDd1pR1s9FKe8wELFV0OU8z6xBDYuC1/A0ZAGp56Ckwu ETnlWjFiwdL2jZ0KlBswVhkVSyVVpa6tauwBFTWzic/GEuI8fEUx561iC2GqFMMfqQpJ0o tvzXLd/m7YTGjJJK5p3lttOSERfY6u8CqkOa+1nUam9NzNb0LU4x8sbDvlqMEC+aiuBIY2 +2oA24Ff5Tr0aju4pnOiVnIk/8i27CugpL+h8JsEqVWRGwMzvGbuR2IDGEW8lA== 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 4WzMBb52YkzPY4; Wed, 4 Sep 2024 12:24: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 484COtRT062512; Wed, 4 Sep 2024 12:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484COtwj062509; Wed, 4 Sep 2024 12:24:55 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:24:55 GMT Message-Id: <202409041224.484COtwj062509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 371af89975e3 - stable/14 - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 371af89975e3edd1e9f57aa5efba2598b63c0d2d Auto-Submitted: auto-generated The branch stable/14 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=371af89975e3edd1e9f57aa5efba2598b63c0d2d commit 371af89975e3edd1e9f57aa5efba2598b63c0d2d Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 12:26:05 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 (cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071) --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 0c76fefeebb6..9560ebc74f83 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -999,7 +999,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1092,7 +1092,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1330,10 +1330,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1360,10 +1360,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1393,7 +1393,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1440,7 +1440,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1507,7 +1507,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 57343f953e94..64078b10973e 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1313,7 +1317,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 12:24:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzMBd2vscz5TnMQ; Wed, 04 Sep 2024 12:24: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 4WzMBd0ST1z56l2; Wed, 4 Sep 2024 12:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N9AZ5voyh447aUWXQ7gmAjfQ8o+0k0+2gCzDAVvmx9c=; b=rhzaV90h+9E7ryLqyfI9zPq0aIHjJcN1tVe5pfuL01R8+mqtUjTTpGkH9/C+FrKGN82VYa x2Skh2qk3PVssphF+cb59rVeZaKfSTU0PnqPRT+MmWRf9WgiYqur3Q0Q5x0EFPUiH02X31 9M4AiR+Fjiz3Rur0j4+1nKbXUhyh3FlP5bwBJp3zPOj1lj3w/DZrQemAf5dXXyskzXRXNA d8ujxe26ICZwV7C8wskLaHilwLMT7bj2h4rpvbBywNqirtMDMyaHPrucXW3DyjMIgVqyXc oWRRgbIXnaaaDgKGjdEAXnq0lvWs3DF7vIWNv8NN46zFjSyqnbQ97xlnd2oGrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725452697; a=rsa-sha256; cv=none; b=c4zJHBI/CbXslRhxCoSOiP/Jzja6Qb94or7yo7Ef6Llq/FqNH2iNBXliG+YOtw8MSgqJqP RfsBQTAwHV/82M3VDQA58/CNLGcQ2LjR2GvI9BU/bt6kdfAkUoOtveWFDiSmQV9lZyDJ8Z F8jiN0eWPIhVuE2uvn+wdbj39zq/AqbDklSknDCJHaN/gVgXHBsY66is8f/eC0DIoV8xxa cfInjjmm5amAMqJLOM1OMdIwPLi5DK/n0T7ZKpTBd+jnIMgS2S2lqTRS92Lql8aMJ+vkqu 1srDTolXreDoNwxb4NZ/9/5ToBLZaMsyMaqo3S+Lz2V1hrc0W2e0dT1m/08gyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725452697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N9AZ5voyh447aUWXQ7gmAjfQ8o+0k0+2gCzDAVvmx9c=; b=QXQ+Hmf+ykEJpjB2cbjDvQGJ4V1mx66nIfhEB/oiGcm7S4IiWFduTCh2oxbA87QORP6FKg ah9vQZUdfIQHt6h47IgGCv2C+BsYTJvZoUh1ZJVLjGRsYDYQaAuN0ppaxNvY5VEDCtQoD+ iISN3kBPxQMfC6kQ5VczeRdLHLCUelznfJc5YqVs/BBXZeP3VZ9RpxhObgvs43iij2FFfK NCdXw162fRpaI9dmjtKXRseopCg6Sd/zfY7bDaE4Vd+5FVTzKdx2X7KcB2/5zBYtBd+Fr9 DDrYq3nVTvKOSTmAtbimVQBSy8W1rOEsOhP1zgdrKm2ngSrSCOnvyQt2/+YM/A== 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 4WzMBc6MVZzNhS; Wed, 4 Sep 2024 12:24: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 484COubc062560; Wed, 4 Sep 2024 12:24:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484COuhc062557; Wed, 4 Sep 2024 12:24:56 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:24:56 GMT Message-Id: <202409041224.484COuhc062557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 9c2ef102166e - stable/14 - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9c2ef102166eaab4c2531eb0ce6ffb20b82e778a Auto-Submitted: auto-generated The branch stable/14 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=9c2ef102166eaab4c2531eb0ce6ffb20b82e778a commit 9c2ef102166eaab4c2531eb0ce6ffb20b82e778a Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-04 12:26:05 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 (cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae) --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9560ebc74f83..a977d7941aa3 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -988,6 +988,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 12:50:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzMm25HDqz5Tr0Y; Wed, 04 Sep 2024 12:50: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 4WzMm24ZsDz58fD; Wed, 4 Sep 2024 12:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725454226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5O2VTvTlmsFMBThbZySK6u54vWprc38oGaiCIZtfMc=; b=F4jZ3I0XCwUje90ttN+VVwlTn3//SJ6yW297S7aZAeSRi+oONmkKx0CrhWwhKiFrIcM+1q NWXN7LUJnQXD7s6RRS6UrL3ObW2/KM6OGDEgglVVwilPgxmU189+DNvHUvGFJHPkut14VO Fd9Vh8y/XbclBL+X44p0HoAxXCpwCAyNFkS+RQD3RJ5QAj0sqqBXSWY6bi8h5d9DgWmZOw 8ANIJ/IwRqi0T6cxh6Wxr0dxbqoo7+uJgph8OLKfCB3vKOHJ1Pq0df4LuiD+B1CK5PHwHH oQD9lC1uVjXBfLokmWoubEJ2/DQmx6b5Yp3zB6xDMSYHVAOwMNbcGKl130RCfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725454226; a=rsa-sha256; cv=none; b=q2oraKgCOM9kMrHItvF1SyQMWy8JrgavNC4oacZVIgOHmKpPXN7/bkdfFOrnLhi0YuuwUu d4RjZRb8Cb+Nbtp7Oyjn0qkZH+myrjQMFs0y9+bgItbj1OuXWiD53W6cT9qL36EbojLizk 3vJO/GakIQTiLZUxrz72c5FSRDshZE+esj2LKkzpGW8O5IuR36v6t3VSy/LTkZ8LfYiPyR b1uQhv8CqjQud+bnf0xpC1tKvcrqTcmcete2awBKM3xige5KuYD4buLt3olsZdwTDsZdG6 VBVhmpeiCX1MUdmdX1v56LsZDO4hJu82IkBsRKunnFhT20OVxaJ+k1ky0mj5Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725454226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5O2VTvTlmsFMBThbZySK6u54vWprc38oGaiCIZtfMc=; b=jIDOoweuACp/tgBnQw+/3IpPX1ZOqGlu8pU8bBHn9zs6CNXI9W+pkRUojtBw6w9MEddWJU 8UG2WHPIWHPVhwoX5aoJTon5NKyA7nuZhZLtKZJGpGLcKEmtfkZONh5OP3N86nSL0P13lG V4fWT9zaZyFArZDvWs2d43EBOrwM5tS0X/lHS5FKgvBAZ6jLWYxDjNmxv5TiYqv+MnSgU5 aCMyWiqt5vFHwcOifpxr1dRJKHNif/fb0b2p++kArLZXh5BLj4PIrge5NcrbSVkCEGvsSY QupW20E13UZ+mqEFHHNEQ6PzJu1+ZBX74Vp2B5HFjrN44UZ2H0wvl4adOa4/2A== 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 4WzMm24B1xzPj0; Wed, 4 Sep 2024 12:50: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 484CoQMr005232; Wed, 4 Sep 2024 12:50:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484CoQit005229; Wed, 4 Sep 2024 12:50:26 GMT (envelope-from git) Date: Wed, 4 Sep 2024 12:50:26 GMT Message-Id: <202409041250.484CoQit005229@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: b6d6674fecbd - stable/13 - nd6: Fix the routing table subscription List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b6d6674fecbdb9a752a893860938837ef76e8cf7 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b6d6674fecbdb9a752a893860938837ef76e8cf7 commit b6d6674fecbdb9a752a893860938837ef76e8cf7 Author: Mark Johnston AuthorDate: 2024-07-25 14:26:36 +0000 Commit: Mark Johnston CommitDate: 2024-09-04 12:49:50 +0000 nd6: Fix the routing table subscription The nd6 code listens for RTM_DELETE events so that it can mark the corresponding default router as inactive in the case where the default route is deleted. A subsequent RA from the router may then reinstall the default route. Commit fedeb08b6a58e broke this for non-multipath routes, as rib_decompose_notification() only invokes the callback for multipath routes. Restore the old behaviour. Also ensure that we update the router only for RTM_DELETE notifications, lost in commit 2259a03020fe0. Reviewed by: bz Fixes: fedeb08b6a58 ("Introduce scalable route multipath.") Fixes: 2259a03020fe ("Rework part of routing code to reduce difference to D26449.") MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Bell Tower Integration Differential Revision: https://reviews.freebsd.org/D46020 (cherry picked from commit a48df53e4249499be3e8779dd30888a405aa81ae) --- sys/netinet6/nd6.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 39c4b498e938..70fb468176a5 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1595,8 +1595,7 @@ check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata) struct nhop_object *nh; nh = rc->rc_nh_old; - - if ((nh != NULL) && (nh->nh_flags & NHF_DEFAULT)) { + if (rc->rc_cmd == RTM_DELETE && (nh->nh_flags & NHF_DEFAULT) != 0) { dr = defrouter_lookup(&nh->gw6_sa.sin6_addr, nh->nh_ifp); if (dr != NULL) { dr->installed = 0; @@ -1608,9 +1607,10 @@ check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata) void nd6_subscription_cb(struct rib_head *rnh, struct rib_cmd_info *rc, void *arg) { - #ifdef ROUTE_MPATH rib_decompose_notification(rc, check_release_defrouter, NULL); + if (rc->rc_cmd == RTM_DELETE && !NH_IS_NHGRP(rc->rc_nh_old)) + check_release_defrouter(rc, NULL); #else check_release_defrouter(rc, NULL); #endif From nobody Wed Sep 4 13:56:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPDR3R9Gz5TwwV; Wed, 04 Sep 2024 13:56: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 4WzPDR2tLmz45Hs; Wed, 4 Sep 2024 13:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725458199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xdpoFKdAscKqrqktehkoFYobckHzBz8ROd/b/TQ2aiA=; b=qplPFgI57zzWb/OzJ+nZNBX3yUd4Q//KojPVHJMBnG1u243ndAPpdQMv/ZymDhM9Ged7RY GqnfLuTHXYhSlPBbzxoUxc6PIJj2EuZQhxqNpXYAcSIr0uIbaezS/+aI+dTW+T3bzKGVF8 DdyhTQz38yxrZ9ZU9fqX0hxPl42XQtMnP3zq4Rvtq42mOku3S5i3i210zJOG3vsmeeGfdu y8odj2CplfwTf7y9v6+oxXZkxYDC39PXxoExpsMYp32p+0BwirPfp1pmngCsOjmXwRThBR XF9W73v+OP/RkWsPS0/9DvNi0A39Gv4xoZ3hHwSUDr3pZa3SxKKk0eJlZzSOyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725458199; a=rsa-sha256; cv=none; b=DiZ4tQ2XtfIcQUVXFJu0wqbC8E7eiH4xJ3DGMJpV5xTgmxRueioF/++tkfIftyC+rNRmOl xWLEwj5qLde9QnwDI7zxOWvyq5/FQo0c+4TKK3zDO4KTKv5bbzxTIy0/zuhkNv9pKt9IRM SHTeVNDliXj1BmX22H3vAj8SWcL87BASCx8R1V97mPw5U0F6jDdgjLydysKQfQb1rJStfo in1mfS+3wlW58Ms/K1waTe6Hj+NbMQFNfMJ8YJrneJ6BqogZSkKiolq2HLCqgaTNH8qVoA oS6hz5cdr3cMGre49E4e3VcAeBQWOxzAvw92PXkJzlb3L+j98Yn7qinGt7bSdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725458199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xdpoFKdAscKqrqktehkoFYobckHzBz8ROd/b/TQ2aiA=; b=AQ0xxyiex0TIjIWdXC66l/FrDjeOapi0KFkbQfQjU62xcmqJvEiWKaF9OU0mQV7uckEL+T 7ukRqfwLIg2MiFGC5fbDoNpv/WGol4TUnpSupdULrNhGBVg41vor7eK1DKvbNfn33gYhnd jletSfxy0Y5HM17VO6O4yCixmTHAyofdZQSsH5X1gzBmf6NQ9IaCibgPTd0Ke8wZvXPqE0 KpLRyoVtiYAKJRqDKnRYN8Q5Lbt2svdTWfT4WCfIgmooPy/fqUBEz9O/skqm7HIuFW9dqh rJTPiw2g20l2gkeGJndL9XhDnFFPYq8HROHA7u2ZS+SinuJ6grlBRMkSR0R6OQ== 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 4WzPDR2TF3zRZB; Wed, 4 Sep 2024 13:56: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 484DudZp014561; Wed, 4 Sep 2024 13:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484DudX6014558; Wed, 4 Sep 2024 13:56:39 GMT (envelope-from git) Date: Wed, 4 Sep 2024 13:56:39 GMT Message-Id: <202409041356.484DudX6014558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: fcef359272fd - main - uart: Use uintptr_t instead of vm_offset_t for pointer arithmetic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcef359272fdda27eef770a512b15bb40232cbd2 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fcef359272fdda27eef770a512b15bb40232cbd2 commit fcef359272fdda27eef770a512b15bb40232cbd2 Author: John Baldwin AuthorDate: 2024-09-04 13:56:21 +0000 Commit: John Baldwin CommitDate: 2024-09-04 13:56:21 +0000 uart: Use uintptr_t instead of vm_offset_t for pointer arithmetic Reviewed by: imp Obtained from: CheriBSD Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D46490 --- sys/dev/uart/uart_cpu_acpi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c index 53fe459e64a1..7892437e11de 100644 --- a/sys/dev/uart/uart_cpu_acpi.c +++ b/sys/dev/uart/uart_cpu_acpi.c @@ -235,10 +235,10 @@ uart_cpu_acpi_dbg2(struct uart_devinfo *di) error = ENXIO; - dbg2_dev = (ACPI_DBG2_DEVICE *)((vm_offset_t)dbg2 + dbg2->InfoOffset); + dbg2_dev = (ACPI_DBG2_DEVICE *)((uintptr_t)dbg2 + dbg2->InfoOffset); found = false; - while ((vm_offset_t)dbg2_dev + dbg2_dev->Length <= - (vm_offset_t)dbg2 + dbg2->Header.Length) { + while ((uintptr_t)dbg2_dev + dbg2_dev->Length <= + (uintptr_t)dbg2 + dbg2->Header.Length) { if (dbg2_dev->PortType != ACPI_DBG2_SERIAL_PORT) goto next; @@ -252,7 +252,7 @@ uart_cpu_acpi_dbg2(struct uart_devinfo *di) class = cd->cd_class; base_address = (ACPI_GENERIC_ADDRESS *) - ((vm_offset_t)dbg2_dev + dbg2_dev->BaseAddressOffset); + ((uintptr_t)dbg2_dev + dbg2_dev->BaseAddressOffset); error = uart_cpu_acpi_init_devinfo(di, class, base_address); if (error == 0) { @@ -262,7 +262,7 @@ uart_cpu_acpi_dbg2(struct uart_devinfo *di) next: dbg2_dev = (ACPI_DBG2_DEVICE *) - ((vm_offset_t)dbg2_dev + dbg2_dev->Length); + ((uintptr_t)dbg2_dev + dbg2_dev->Length); } if (!found) goto out; From nobody Wed Sep 4 14:12:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPZY4HYDz5Tybm for ; Wed, 04 Sep 2024 14:12: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 4WzPZX5qM3z47Mq; Wed, 4 Sep 2024 14:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725459140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GZzbnNMDQUs/dvlHg1g65B906WHUHHe5pSLZZyxBkBE=; b=ZEd9ZrLKOohmfARQMsZa1FB0HkOBoLqOMC3yQB8UHfA1ApW9bd/hgI6MlS91vEnNnN9NiQ 8bF2TseDeQIaOIx0VoIoj26SR1Yt0qGfd/iD4gghBxkcwMDOPcdd9GQ0GLlpZ8fTUgpvxY z4z0AaEYs1ktu2OPlBE7Km9b6vZqN1T4Pf1aPQiAnupfpEahgcOAeoYVCUCwXher616E8T vR46vVlRgwN1ToMAiR6AoNIZLIs9o617IdkuwlQVoViO6kFX6e6iFNjLY+Wee3lyq8t+qs ND9u5neG9wP3yJNYNY6FfIYQvuuXcERWacqw9wBVGuVFs/BkrgxTwUvu7mp2XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725459140; a=rsa-sha256; cv=none; b=tvcqL9Su4iR+dsMvr5nSj1+ER3JUBJ1HHP5UhIGH6ZUIkxleLpeUH93NAzJOj0pFwByUyg 2l1Fm+TRdYg+qAPztayvEHRJHsJS2E+Xbi+tbXRyh2bxmaeJ4hxLZUaKTnzHi8qncZYq2v jkwanUxxIr566urg0jfrwYL9eGUg4grRUW5tivj7FLyt9ddgd9LiWAPY8NmHAIKFcpRTUH 6CMKrSOJY/eOxT2D0nQsadVQmHmeuzAb4SqT+v+L8fq0CSVxo3uwwH2l1WXz7ekx0OEQxZ nbZiFSYz5eX6RVFeBpsd5U4G2Ff6MecW4p0W470f7sdiypRWRTUVq4eB2PvJiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725459140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GZzbnNMDQUs/dvlHg1g65B906WHUHHe5pSLZZyxBkBE=; b=e12byASZvJKhZua8xj4PbvFUz9/0AH7hRtSIvE4nsKUIb6ENoa5aBZajmTUi2OEffjhuy4 39AsAvvHhFejyz6LugKVQuXhTZFn2DVBDQcEbMx7b2me9IKKzQ9g6lJDhhf0TbZo9A765B WkB9crQNoo2gmzE6r3WQfjWvm6iKJ59828xVid/CxrwmOj+vp5eXNRkGj99YeoY4tkin4i a6YlS5wbt5NkVd1zPyDehZt0Q90IBGS97GvERjwacEs74JBVEI9gkgZR+ysQEWzZchku8s TR13IuZNpiUe/ZCdsXuyPkSuqsxgYSsh9yJEvGfc39qrALHpi4zyO/G6lk7PqQ== 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 4WzPZX5JnszSBQ; Wed, 4 Sep 2024 14:12: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 484ECKBD048605; Wed, 4 Sep 2024 14:12:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ECKq9048604; Wed, 4 Sep 2024 14:12:20 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:12:20 GMT Message-Id: <202409041412.484ECKq9048604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 9dce5a0d872c - Create tag vendor/llvm-project/llvmorg-19.1.0-rc4-0-g0c641568515a List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-19.1.0-rc4-0-g0c641568515a X-Git-Reftype: annotated tag X-Git-Commit: 9dce5a0d872cc9bbf81ae1c8a3500b21f59351b8 Auto-Submitted: auto-generated The annotated tag vendor/llvm-project/llvmorg-19.1.0-rc4-0-g0c641568515a has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-19.1.0-rc4-0-g0c641568515a tag vendor/llvm-project/llvmorg-19.1.0-rc4-0-g0c641568515a Tagger: Dimitry Andric TaggerDate: 2024-09-04 14:11:58 +0000 Tag llvm-project branch release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a. commit 7432c96084d72c631f1e5ddf1cc2e24fd9c92482 Author: Dimitry Andric AuthorDate: 2024-09-04 14:11:41 +0000 Commit: Dimitry Andric CommitDate: 2024-09-04 14:11:41 +0000 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a. From nobody Wed Sep 4 14:12:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPZY4JsKz5Tybn for ; Wed, 04 Sep 2024 14:12: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 4WzPZX5qT6z47KC; Wed, 4 Sep 2024 14:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725459140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r92wQJBsa51rsZsvKY+pqL6Rdb9U7XZLrwTAljMlE0c=; b=x8MckOfJWBjjNetEFkAVzw7B8kjJ1z/XGsB16XchRo3fb4ruydI58OAv9xHKWWanzZeLYK 3QKYXyANOjcfnmYfrPS07s9gVmZHRv5nvsLKCFUX78TSbohiglRkTzzI6j+dJZDOpQbPX5 2PP/PVcRoZiHF3NKZ9LIqbGln+g/bJpzpt3fCo0N84JTQUORU2I+w83vBvl+RtYXn/8/eC Qjp+/nsA07IATrKzZSLDm7qPUAHd1FUJrOzNx/MnDcT5j4vVVGi6btLPTuX3QuKDQu2KQ6 Tl9POem3cAh2hXyKot0DoQWol0WWmEjcwTCCyA0YJnpvY7M3vN/1PC2BnDEYIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725459140; a=rsa-sha256; cv=none; b=uY0cMdHq9ZlgffgYUgvNVs6GHIWXw2tXE8M7oEqsnS+wCFkCHcqVJKLGj5u5gCB4oI0lqJ QsXbzVvZM63Bwq0xjCEX26R5j0GMUtW7SHzQVabJDv3YoiMgkPJiNFPqf1769Iby3DO6s4 +b5JnaZc/tA02rXdM5sMDgYJ9lARw0w5QJ6e6KldByDVe0tC3LrnMeBPWn+T1S2CGtJVzy rSz9hPFMpRinvEuVoGA7kl4oJ99q+Txx7Mp9fuzQscudkd7+/b5uFMEDYd+X+kyn5WUx+O 2RHsUiwUQO/SkEgLrC6rFN7srYwDja5t5argssmpiee+/SQAVEV5/O0P3y98TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725459140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r92wQJBsa51rsZsvKY+pqL6Rdb9U7XZLrwTAljMlE0c=; b=uuldjaah50Z2WqNTm8lpI6uWTEoJKBqYvhyXApfeRAtYweRBUOvVc1HY6sjXZ4absCQLRD mtTIbZWbxfs/GyJw8AXiaca7Po17UNgb2j1zzEOmJzxQztclVPeHMcZmgTQ9LVyisDBGT6 VRP51BF/4+x3Zlg2H3f5jOPbZ7dxfK134ipmMqLtvx8ALO57j4CXNcvkg7hO5JEYQGlHMs BVmsDuMvzkGKjjlXlT9lxVWhgjkSbcQMGdBEUbAM7+azPZfmNwtwx0jHrDra4i8+EmpRvT NmsL77q9qKQ6tMX/nH1vw9474SN75pNVCFPxpPGRAw5KN68/ppvOH47gZLZc2w== 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 4WzPZX4s91zSFY; Wed, 4 Sep 2024 14:12: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 484ECKw8048586; Wed, 4 Sep 2024 14:12:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ECKH4048585; Wed, 4 Sep 2024 14:12:20 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:12:20 GMT Message-Id: <202409041412.484ECKH4048585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: adf62863f35c..7432c96084d7 - vendor/llvm-project/release-19.x - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-19.x X-Git-Reftype: branch X-Git-Commit: 7432c96084d72c631f1e5ddf1cc2e24fd9c92482 X-Git-Oldrev: adf62863f35c84e4c5708f3dc5a1589ce958a238 X-Git-Newrev: 7432c96084d72c631f1e5ddf1cc2e24fd9c92482 Auto-Submitted: auto-generated The branch vendor/llvm-project/release-19.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=adf62863f35c..7432c96084d7 7432c96084d7 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a. From nobody Wed Sep 4 14:28:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPxl6KGTz5V19L; Wed, 04 Sep 2024 14:28: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 4WzPxl5nqBz495H; Wed, 4 Sep 2024 14:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hXxkw4gRhla/i8tkTgFyIhjzWxwgfk8z6NZ+lpRjwc0=; b=rH35IqcM9a5Muqdq0nViOTrxDWGSAZzSa+EUIjU7nKmXjBUcbEFVk7kM5pOde2LHxfevXC Fl+Ab0Pt1cNVZl7FjYUrbFUh7esDnTrBSmmCCewyOwwWrOMrr8nMldLb7AazjPBu8ic8nX b8767e4WocY9vTaOvnJp0lZ87RBWMogoDg/LPqXQBmv40re2hFH6bcJU+4aNqrzSETyp0y N+nKmXJA0ifRxHsAEIhEYx1Eie1n6b5Nty5k3P10pYfrLGHNmi/SXFvn0ewG6zBNxRP7t+ IJMxLe60ut/m4AvDDqlkT0SmoxHfk6voQjumqenlyyZ2BJyfzrSarO2FvA3ixA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725460139; a=rsa-sha256; cv=none; b=BBFR4XkRKUvUb1KniuaHEbEKmSi0CQKOlMg4imue+DxKS8bhY1iqPMrJ+3v++BtP2LjSip Oc112M3L9An1ztohGIrNi64ZtfZ167FxBssOhmPsezva1Hc10q9SU9dYHa1PwXkIomH/sM Rb3ld/9/8J1rPKImft6JGeTrpJlO52TFgODKu0DOZNwhXVZDNjldGa2ew4ceIipS+GUmpJ OiYGAWE8aODrLtj72NvTjZkOqOhwSfbIQmPacQy/DZqY3Ug1IrHM/c7QcGzleCDIjVLVhe J27V6plZL7XlDXt1PHSJk7kGTD7qY8O4sVKnWc92lN3mhHmHUOUhbfegOVb96Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hXxkw4gRhla/i8tkTgFyIhjzWxwgfk8z6NZ+lpRjwc0=; b=SMu3Mfc6NEPIM77IN6J6FRdN9PQ14fsPk8LvDehnxxPJrLBHeIwJ9pM076pV2HkS/aZOZ5 F8L5YK91V35oL4DxXfppEXCG/E9zvak5NS7smmvSl5MzCXUT93lOuhJnONs8OmNyNLnLxk c6yYCZb0qtt69VxGJwYxS/vf8mwilNUwGPSt0ISmP7LKXxYMOKuCNErN9WVruD0qzeKtA3 rHV18iwEBUXLCY4lSeK2689/pJBWz+VDoy9Tr5GufeGapDVxXPyra1O/7Sl1MJ5TMO/f/8 Nf2sWHaMkgPv8iULnjHZqCa6t87nchY7nnSgLevNAt/fpiP4vwl+Vo3KU8Y85A== 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 4WzPxl5KcfzShF; Wed, 4 Sep 2024 14:28: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 484ESxdY065958; Wed, 4 Sep 2024 14:28:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ESx03065955; Wed, 4 Sep 2024 14:28:59 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:28:59 GMT Message-Id: <202409041428.484ESx03065955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b5d3f8252fe8 - main - ggate tests: Use unique ports among tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5d3f8252fe8b74249ed49e87981d190c3ec3d05 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b5d3f8252fe8b74249ed49e87981d190c3ec3d05 commit b5d3f8252fe8b74249ed49e87981d190c3ec3d05 Author: Mark Johnston AuthorDate: 2024-06-15 00:10:42 +0000 Commit: Mark Johnston CommitDate: 2024-09-04 14:28:28 +0000 ggate tests: Use unique ports among tests This helps avoid failures when running tests in parallel. MFC after: 1 week --- tests/sys/geom/class/gate/ggate_test.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/sys/geom/class/gate/ggate_test.sh b/tests/sys/geom/class/gate/ggate_test.sh index 3ca5c3a2531a..4cbc5d80ae89 100644 --- a/tests/sys/geom/class/gate/ggate_test.sh +++ b/tests/sys/geom/class/gate/ggate_test.sh @@ -1,7 +1,5 @@ - PIDFILE=ggated.pid PLAINFILES=plainfiles -PORT=33080 CONF=gg.exports atf_test_case ggatec_trim cleanup @@ -17,13 +15,14 @@ ggatec_trim_body() { load_ggate + port=33080 us=$(alloc_ggate_dev) work=$(alloc_md) atf_check -e ignore -o ignore dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc echo $CONF >> $PLAINFILES echo "localhost RW /dev/$work" > $CONF - atf_check ggated -p $PORT -F $PIDFILE $CONF - atf_check ggatec create -p $PORT -u $us localhost /dev/$work + atf_check ggated -p $port -F $PIDFILE $CONF + atf_check ggatec create -p $port -u $us localhost /dev/$work ggate_dev=/dev/ggate${us} wait_for_ggate_device ${ggate_dev} @@ -55,6 +54,7 @@ ggated_body() load_ggate + port=33081 us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -67,8 +67,8 @@ ggated_body() echo $CONF >> $PLAINFILES echo "127.0.0.1 RW /dev/$work" > $CONF - atf_check ggated -p $PORT -F $PIDFILE $CONF - atf_check ggatec create -p $PORT -u $us 127.0.0.1 /dev/$work + atf_check ggated -p $port -F $PIDFILE $CONF + atf_check ggatec create -p $port -u $us 127.0.0.1 /dev/$work ggate_dev=/dev/ggate${us} From nobody Wed Sep 4 14:29:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPxn0F7kz5V14g; Wed, 04 Sep 2024 14:29: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 4WzPxm6qrnz495J; Wed, 4 Sep 2024 14:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vNRuYNHtnHNx58G7XbH6O2eb0pjiNx5W8pXKRWrOJ2s=; b=KNSKFsqxdo71JKAY+4NpEkz9BuQVJvvpLiJXWPpd5+ArJiY8kxStBwS+e8geAAfvqCVaqi UKW6WW/K3KMCluFCx1EWaBKrSkZqXnIbsKCrj8b3aq8ySIH1nGZa1/+sx8RMWIIjkPBIWA XhEPtMwGUxZCcb2MbM6IWJUL693Mpd46plXnIc0id+TMbbUGpZdX4uxjk89esfgd/X+Hsu mDRSVIvNVGKLmj0xV6Z1DLGABlAGzfM9c4GxzkkQGH2XDqk89fazM3oz8gYuIJlXZLBj7g sYp+fLKBnGDiErjdUyH7r3WDUKIKoNwSX4AlT4RuVM9Jo1aMuHYvyOKPHEiQHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725460141; a=rsa-sha256; cv=none; b=LUAqfZ0nKaszxuFGPWzmWcm0I2ftQrK7TpFqMTvKeRAt9FQm8pZY10FVssmKNK70tb5sGK z3vyr8S89/DHfe85/irfcaEK98LOc8FjEEUgbrrHbNNM/F37TIbsVLOz2yvLQCGIooDrBY EWNo34uwQCfsTpcGAC7B1/4XAxo7G/e7+WNK71wLcjIgKW3ZZZlJNn6QzD6wVAYXCL2xdu NnypjX1KoGGKLaKyD5y3BndE4S5TLf/CiY2zPoecK2NsFnzi1/0RxaG/MIgRxicG+pRVU8 o0gVuLi7ST5eZXgcCGfq8nIUPB8eUSNnOGmMWYOROHisMfF6zVm3T0sRkeDJvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vNRuYNHtnHNx58G7XbH6O2eb0pjiNx5W8pXKRWrOJ2s=; b=BeZ/Ff3dsOG5Ioe17sqINcz3dNLC4tU818OBDG5nYKEYrRl1GkAZGwbVRSYY4YgvHmljxq AozbzMt017ZpE8K6TBT8FC2xh++EQDrTQY7+nkoHmAgg9/9jC5tsSX4zN6pVH2WC2LBd9O MWsA1xRVnxSGG2Mwosu4+lD9NS9yI1Ul2afVfZT5QAEukwMSFAdSAJJHtu9A6d4jp5sKuz /MDT+drD8/VnYI7ZekSB+VRtMs60o7a6PvAs5/OjA12PfsnFxD6K6GoX7VuRgGnS2z4QBY eKrSUnYBJk9oiX75aOtXfOQHmRabLnXEqmxkYPGxJd7hf9rIIEA9NXlxIVlTpw== 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 4WzPxm6HpZzSW6; Wed, 4 Sep 2024 14:29: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 484ET0DY066017; Wed, 4 Sep 2024 14:29:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ET0o8066014; Wed, 4 Sep 2024 14:29:00 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:29:00 GMT Message-Id: <202409041429.484ET0o8066014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 41ece3c036bd - main - capsicum tests: Serialize functional tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41ece3c036bda3d4da321989ee59d0555c10d603 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=41ece3c036bda3d4da321989ee59d0555c10d603 commit 41ece3c036bda3d4da321989ee59d0555c10d603 Author: Mark Johnston AuthorDate: 2024-09-03 14:39:02 +0000 Commit: Mark Johnston CommitDate: 2024-09-04 14:28:28 +0000 capsicum tests: Serialize functional tests The test suite runs the same tests twice, as different users, and these can trample over each other when run in parallel, causing spurious test failures. MFC after: 1 week --- tests/sys/capsicum/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/capsicum/Makefile b/tests/sys/capsicum/Makefile index 6d37cfa08056..fd8dcb29d65c 100644 --- a/tests/sys/capsicum/Makefile +++ b/tests/sys/capsicum/Makefile @@ -13,6 +13,10 @@ CFLAGS+= -I${SRCTOP}/tests GTESTS+= capsicum-test GTESTS_WRAPPER_SH.capsicum-test= functional +# This test script runs the same test suite twice, once as root and once as an +# unprivileged user. Serialize them since some tests access global namespaces, +# e.g., mqueuefs, and can trample on each other. +TEST_METADATA.functional+= is_exclusive="true" SRCS.capsicum-test+= \ capsicum-test-main.cc \ From nobody Wed Sep 4 14:29:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPxp4Q0zz5V0wg; Wed, 04 Sep 2024 14: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 4WzPxp0xRJz49MZ; Wed, 4 Sep 2024 14:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=in1D01hMpY8noWhgkQRbfSpYChoZAFNXr7C6+bQltSs=; b=ZaJCF3MQfPWnp9VubkmPaL72hG4wsEi80SQ/JuegPKoW6WPXCPELQm17T3R8kkr1uyoJfG AzK5lDVOyLkgNgL9vORcgdSriaqEbHTuWDhKP1vTHwzdYUmmR9eqISvAZ3CjxBMeyFIwhp J4jNV7XkxMoq4rGiZ5D9Z76MY+ksLAhNrWHgNE++dmYeyLYAdg5/WulJwtOzbd/HLy52t7 n8VSfYJwx9wOrmfp9z2oQiXC2TnWq/kN37h+OOCOeZDsNfF0eQbcIJcunR6Kr0fnKxfTWw uZgmL1rLHPLa//NuoV9FvFwoEvD3dnhNnFHWHhjURECo8c88JADQGwtubqtC+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725460142; a=rsa-sha256; cv=none; b=rTnAOwNjlTGtjA7v6gC7V86BIo4xfagEPeiXJxz7wFzx/qJmYdv2fhLQmWIpnOjDG14Ouc eW2uWoDc8lR50CXItC3inKj9rvt1AixyyZ7X66d+rX5Tbg+hmTgkGvmQ4KHyIGdkLLYVSu 18gdolpx9tF/FVfZnDKceCESjCTdf+IORyLogS+7PkQepmUk7hrYOz2ZX9movHqUUZmz+v ol9RSVRz76R9zZVcnZCcVA+tmSg65FtNlduXA165dbjzRPckW+3F0MpO4D5CAbtdWZO2WU TkPXVItkGXuTkBbFNoho9wCtMhlWA7nxR0iMjiFMN88Wn8VKJuy0SBIUC3iYUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=in1D01hMpY8noWhgkQRbfSpYChoZAFNXr7C6+bQltSs=; b=fa9JfnNBGX1hRU3l1XRlsQ/VMr0A0FF8Ni2QTLrpxyiHpVgRQonSXsORD2R1xcb4/GAAdT a24lTieRO1oZV6loXZZeimNUlaatSojjfMAMlf7q6oBjIDCJZT6QqnPK73YEGLoha2I+3N L3dLjeaA6Ho+ndkc9xrvhM5hnxcSTfwzzgGRBCNbjhQWFBp9VVfIUzNVVnxDmP8drTqqpE reA9lHf6PK+/bAvpVf3aHqXPda1HKYLOZ5df6p4YZ4eA7MbHUrV9ObQiwrAGgigqUExk46 XSHPN2vOyOQ+wdhVYisRvGspyzKZhNAjArqhEyBa3OyEgxCLvBKn4w7ddCwvlA== 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 4WzPxp0G7fzSW7; Wed, 4 Sep 2024 14:29: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 484ET1jo066053; Wed, 4 Sep 2024 14: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 484ET1KY066050; Wed, 4 Sep 2024 14:29:01 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:29:01 GMT Message-Id: <202409041429.484ET1KY066050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 408c909dc64f - main - ifnet: Remove if_getamcount() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 408c909dc64f77d2696d6fec77a2e0b00255cf96 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=408c909dc64f77d2696d6fec77a2e0b00255cf96 commit 408c909dc64f77d2696d6fec77a2e0b00255cf96 Author: Mark Johnston AuthorDate: 2024-09-04 13:07:11 +0000 Commit: Mark Johnston CommitDate: 2024-09-04 14:28:28 +0000 ifnet: Remove if_getamcount() All uses of this function were incorrect. if_amcount is a reference count which tracks the number of times the network stack internally set IFF_ALLMULTI. (if_pcount is the corresponding counter for IFF_PROMISC.) Remove if_getamcount() and fix up callers to get the number of assigned multicast addresses instead, since that's what they actually want. Sponsored by: Klara, Inc. Reviewed by: zlei, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46523 --- sys/dev/bxe/bxe.c | 2 +- sys/dev/liquidio/lio_ioctl.c | 2 +- sys/net/if.c | 6 ------ sys/net/if_var.h | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 26a87354e5b1..3e7120a42a90 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -12174,7 +12174,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) if (if_getflags(ifp) & IFF_PROMISC) { rx_mode = BXE_RX_MODE_PROMISC; } else if ((if_getflags(ifp) & IFF_ALLMULTI) || - ((if_getamcount(ifp) > BXE_MAX_MULTICAST) && + (if_llmaddr_count(ifp) > BXE_MAX_MULTICAST && CHIP_IS_E1(sc))) { rx_mode = BXE_RX_MODE_ALLMULTI; } else { diff --git a/sys/dev/liquidio/lio_ioctl.c b/sys/dev/liquidio/lio_ioctl.c index 10c88b209051..b2fd54f59580 100644 --- a/sys/dev/liquidio/lio_ioctl.c +++ b/sys/dev/liquidio/lio_ioctl.c @@ -481,7 +481,7 @@ lio_get_new_flags(if_t ifp) * Accept all multicast addresses if there are more than we * can handle */ - if (if_getamcount(ifp) > LIO_MAX_MULTICAST_ADDR) + if (if_llmaddr_count(ifp) > LIO_MAX_MULTICAST_ADDR) f |= LIO_IFFLAG_ALLMULTI; } if (if_getflags(ifp) & IFF_BROADCAST) diff --git a/sys/net/if.c b/sys/net/if.c index c71643a41bc5..4458d710d826 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4780,12 +4780,6 @@ if_getifaddr(const if_t ifp) return (ifp->if_addr); } -int -if_getamcount(const if_t ifp) -{ - return (ifp->if_amcount); -} - int if_setsendqready(if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index e493f8c7951e..cd074e4a8f4e 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -675,7 +675,6 @@ u_int if_lladdr_count(if_t); u_int if_llmaddr_count(if_t); bool if_maddr_empty(if_t); -int if_getamcount(const if_t ifp); struct ifaddr * if_getifaddr(const if_t ifp); typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int); u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg); From nobody Wed Sep 4 14:29:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzPxq4Rnrz5V0yd; Wed, 04 Sep 2024 14:29: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 4WzPxq1gtfz48tG; Wed, 4 Sep 2024 14:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jO2eFrjoAmCrs6oVS/naEdxsIRMIOrg5Tx8xV7uIGfk=; b=UnjXWG0qRmBaKvDNBbkF2YdI9TKnaGaK76DnWhF/ZaxhtOPePi7OzdVqkR6J7JgX8CJFzX v1sLpvCLweXeV9FL6x7XR/o0JbAOCZMd52YxraBdPkenkFuGlNryNorf6SgZnosHJ61oJP ppVNRaMxMkpL9LPkx8jEl/maqp6Lp0mlIfRoH3le9Fp/reNchNSFBzRAWz4N3vNkZcHvd3 Nf9ZpDipIj//0VjFZdQKHWGZME6NkSQHPpDUk9WdGMgxOI6PnDQPxpHG3MZ1OpOi08AALE RVUCd+LljkC8vwwqKZ5ep9gwepGO68kOMj3Tm8eI6SE8rZqzSRy08AMQu4K61A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725460143; a=rsa-sha256; cv=none; b=mLjO6q41v5f5p7VjyfghYRNs25S9Ndp2wt/Qu+gSWeEfL5UbjMHrJMkTds+gyHZ1uO0kGY RaJQR2JQZzqwsixPVUlQGUB0w+RDVKpIV7ndBNgsZ89Nrvmb5f8IjpkTtUIWcKE/KyEtj2 inZLYfmSvdsgnTTTsewmgMITJxegpCFLVFO2WWqOfV9BRCIJCfPTJEtOgPg6s7y0Oj2f9f RDtc26HGynfFIBzvq05Kn7FMKXewJq6oQ/I68xaPMHUzlv9nCtWLWEteH0hfOO2X+yHMgQ i+0UqDcYgab+HetrwTIvlDWgxLY+1oj3ZjyD2syqyz3AOlNbVMl8C+ePW6fxKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jO2eFrjoAmCrs6oVS/naEdxsIRMIOrg5Tx8xV7uIGfk=; b=PLQXDRo/e67Z3bto1lO9EhD7UrbFXNifJcboDEm1wonUEjk9CNpaLTxSY2wAB5KNNneQIE vUmUgzdNAe3DNonQtfWDkyk1qoqkz+OvzNc72iqGz8R4VYakt/6LTBg65dcUyJR2OXw0EL kdQzyHvh0EXiFf8dK3YOr0Fk7935KfSJmRRRNMXkaFl11R6WIgRX5KBMeHz7Oc8ib1X/6z xLZFUQrcpdT22jJjYMxlwjZLouwS/u6B5EYVjr7QwgS4A3lDb+dthWWOtfh3v7KY2nxCgo 5wrYTbqs4j0+1nK5VO4YVoO147DcrapPMPRQy3n0XfilzGrztT+29h+vdmbdiA== 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 4WzPxq0jWLzShG; Wed, 4 Sep 2024 14:29: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 484ET3qL066112; Wed, 4 Sep 2024 14:29:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ET3qf066109; Wed, 4 Sep 2024 14:29:03 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:29:03 GMT Message-Id: <202409041429.484ET3qf066109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 01f43479b592 - main - ipsec: Drain async ipsec_offload work when destroying a vnet List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01f43479b5925d5e1f996a5ae2929aa2d2aab83b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=01f43479b5925d5e1f996a5ae2929aa2d2aab83b commit 01f43479b5925d5e1f996a5ae2929aa2d2aab83b Author: Mark Johnston AuthorDate: 2024-08-30 00:44:45 +0000 Commit: Mark Johnston CommitDate: 2024-09-04 14:28:28 +0000 ipsec: Drain async ipsec_offload work when destroying a vnet Re-apply commit e196b12f4d4d. This was reverted by commit 28294dc92476 because it could trigger a deadlock, but the underlying problem there was fixed in commit f76826b892de. Reported by: KASAN Reviewed by: kib Fixes: ef2a572bf6bd ("ipsec_offload: kernel infrastructure") Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46483 --- sys/netipsec/ipsec_offload.c | 2 +- sys/netipsec/key.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index a06e91ada1a1..19719a8f171b 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -392,7 +392,7 @@ ipsec_accel_sa_newkey_impl(struct secasvar *sav) TASK_INIT(&tq->install_task, 0, ipsec_accel_sa_newkey_act, tq); tq->sav = sav; - tq->install_vnet = curthread->td_vnet; /* XXXKIB liveness */ + tq->install_vnet = curthread->td_vnet; taskqueue_enqueue(ipsec_accel_tq, &tq->install_task); } diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 5a3e5727bc2e..ad1d6164f158 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -8713,6 +8713,9 @@ key_vnet_destroy(void *arg __unused) } SAHTREE_WUNLOCK(); + /* Wait for async work referencing this VNET to finish. */ + ipsec_accel_sync(); + key_freesah_flushed(&sahdrainq); hashdestroy(V_sphashtbl, M_IPSEC_SP, V_sphash_mask); hashdestroy(V_savhashtbl, M_IPSEC_SA, V_savhash_mask); From nobody Wed Sep 4 14:40:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQBV4BpQz5V2B4; Wed, 04 Sep 2024 14:40: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 4WzQBV2XHVz4F9p; Wed, 4 Sep 2024 14:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2FEei6bDjENmGdFsvWXXTZqq+VCWfCJhlEgAqpqKRMQ=; b=D4lNQTt6/cRd3hmlp9laMGH9wbOOKCBCljPv45aFaOSK0m69CMbRhQvUIfBhVYPhmLd9i7 i3ibi057oNQ915druOvQ98Kf7wjICqukqq7qFqnyM11elt3N0mKBKxf27jsBb3Ab8otXaj i1iwKLd39s9qaAdTIWCEi9Xz2by8BeDDgBOoslr5Z54JH5X5zWBjd0aa1VWRYnA/q3Jb10 p1legNf2OnpsVBRlR4fOTDIvCMGkYqpE6/5gKex/Mf2nOAo+30hxbs9T11tBWbWwsCo1dW TqOBOvAb1ZbX2x/X1nCMEDChSsbRXLh26nt6QS8TAEWM9cUvTZwlU5AJEEwYmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725460802; a=rsa-sha256; cv=none; b=u+ltG0Vx5P0us5jJuk4skHQuR9wxRAWzuuD9BW1mCztc2dU9MH/X7p9APFVPrJzMKXV0KX n+nl6BP1MRdgeE2lNM3x+HvNVGidtsTeYrNhZ7IHdKOhotZpdJpYyYk9uKoRCAHhPqLztU s6Ksl+Z8WLuodpIGKkVz75PXD6K3OUIV4sc8mag2A/1izR9PZv2bAq6ip5CxR45cMDyhNN uC8HEJObdrb4qgMojqECpFRv5saIoQkA6dMYb+FSoaRLBl2EQXpoZx4RXEgZnFKu4KuXZQ FugOghSlqNZzQD+f6tvKICI09lum6L3f4pluPpf5SUHFcrs7LY8kG5Ed1GG4lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2FEei6bDjENmGdFsvWXXTZqq+VCWfCJhlEgAqpqKRMQ=; b=UmlhHyGj5mGMTVNent64p+kk6KJwonoMlpVUCeVI2rfUz+/Ay4HAnTZHCcujLl0Fr2isOo 6DBLXhdfnOssZNBu1DClQdwUwqakVq978VpDrlREub3YUrBxXj3eZ4D9pH2NJaXZvMb1+j U/90lOZujD1rFJDdOKeTfJP8dRVpVrUSiPCpvb6YEeSFV7x2cOJ62xJSf8NJGV3ynPqogm AFmrrof4JIp9DGlgdO1jlH38Spz79enI0SafWZKuelRXZYawfWvtRFq73T75RJ2Ry3hTaU lI1EQ4SYRLAQS2pLRZSm5awsjLDWQsAlEiQS/Fu3rCnYeuaVbJXMlcM11BE8jw== 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 4WzQBV2852zSj7; Wed, 4 Sep 2024 14:40: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 484Ee2mp086212; Wed, 4 Sep 2024 14:40:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Ee2qW086208; Wed, 4 Sep 2024 14:40:02 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:40:02 GMT Message-Id: <202409041440.484Ee2qW086208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a06fc21e770a - main - bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a06fc21e770a482c8915411ebc98c870e42dd29b Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a06fc21e770a482c8915411ebc98c870e42dd29b commit a06fc21e770a482c8915411ebc98c870e42dd29b Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:11 +0000 bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler The function tpm_ppi_mem_handler is vulnerable to buffer over-read and over-write, the MMIO handler serves the heap allocated structure tpm_ppi_qemu. The issue is that the structure size is smaller than 0x1000 and the handler does not validate the offset and size (sizeof is 0x15A while the handler allows up to 0x1000 bytes) Reported by: Synacktiv Reviewed by: corvink Security: FreeBSD-SA-24:10.bhyve Security: CVE-2024-41928 Security: HYP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45980 --- usr.sbin/bhyve/tpm_ppi_qemu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c index 239d39184589..01b8493e7273 100644 --- a/usr.sbin/bhyve/tpm_ppi_qemu.c +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c @@ -25,7 +25,7 @@ #include "tpm_ppi.h" #define TPM_PPI_ADDRESS 0xFED45000 -#define TPM_PPI_SIZE 0x1000 +#define TPM_PPI_SIZE 0x400 #define TPM_PPI_FWCFG_FILE "etc/tpm/config" @@ -100,7 +100,7 @@ tpm_ppi_init(void **sc) struct tpm_ppi_fwcfg *fwcfg = NULL; int error; - ppi = calloc(1, sizeof(*ppi)); + ppi = calloc(1, TPM_PPI_SIZE); if (ppi == NULL) { warnx("%s: failed to allocate acpi region for ppi", __func__); error = ENOMEM; From nobody Wed Sep 4 14:40:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQBW3y8Gz5V1y6; Wed, 04 Sep 2024 14:40: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 4WzQBW3Qt5z4F36; Wed, 4 Sep 2024 14:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sHAzqgd2O5wvzTaSbM4XoEa/72bqcRRlCjB7juWowlc=; b=fVS4S1y3VpvMsfYH5pwQ7Or+WCROSmT774PwlCRV0zyOssspA5QJwI2R8blDMxwT9+TGrH UJoV532OMEY0kdCWQ83rGZQVcpCTN5vEYlvo3TMYVtxKs3Cf6jjM+Y/kcPUSIvfZZRxUzT D6+9n/y6z3aD2SpB3iQD1l66HWgBTVQBAyvwslYzJslA2e7RfPxvgoC/DHwZtAqu/EXSTe gK1JX0sNm3mx/hflDFX7MPSarc+dBLe4+3MSjxhB8XrMVWT1REv7HySqHXG+dcRWdaDNsA vzbcO1f5GjTXXI7Bl7fGikn2C2wXk5vqwyTlE0Eoi+Sc9Wa7BxOyyBFBvlrzXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725460803; a=rsa-sha256; cv=none; b=GohmyQ8t+I1AKXOnnkdwOTgpxILBR19S4V4QYsra3nwp5K0fjq3xobbJs74No5VhO5B+Us GKFtYR5tZWqCzUeWMZkvMhPEsOU6hU5SM2n0DuAL8+YZa4b9oHUbAMmyMg7Cq0DDEpg8Wy UvKtUgOL83qVpm6PmyJ97dFdXCqm2otHckYEoaUTfEls+49GxPyddYcs2SYcKcywoVfodz eD6DPXJjtroD06BgPCpn9oGV80ighMNOeoh8NAo3rpQLwmZjwXjk89f0bmXHcBeQx02tHe 2HBtrvY/BjvzKP2QGLthZ9h3FlxlbjZ7E6sKrWCXE30vkX1Mk8Z2DdCALDclVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725460803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sHAzqgd2O5wvzTaSbM4XoEa/72bqcRRlCjB7juWowlc=; b=g+2pKl5TirppaWQiVKZyXtGB5s99fZaabtFxHA+XLnvblqDsMCaDAvom4eAp37y+hdyu51 c/nZ4BwJV3esKS5PnUZwdY1PAMLBPopVI9MBNfgngPbccWIBcELHDYArRpqsaCeswpeM/p sn+ZIKX4/wS02Q6vunrnsTCiFcv+5slr4oUkvsRaEGwLteu3wACuEkJ7YAw5iBF8fa4MGB VDdiJesPGMTzjC+1T5AcUDAFAaUkTWSbt4yyn4t1YPSl9KZ8+j0UgTnIFbKScVnAf3RPVv xlyfWrhNMK/MBQAcJAkQgJr7ADNl/+3G+KcWY8mWT6YmLSDWH27P4RboeT7LgQ== 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 4WzQBW2lGJzSqm; Wed, 4 Sep 2024 14:40: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 484Ee3A0086506; Wed, 4 Sep 2024 14:40:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Ee3Wq086501; Wed, 4 Sep 2024 14:40:03 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:40:03 GMT Message-Id: <202409041440.484Ee3Wq086501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 5c9308a41308 - main - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5c9308a4130858598c76f3ae6e3e3dfb41ccfe68 commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:11 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 8654dd9e7a14..b72c839c807b 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -660,7 +660,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1202,7 +1202,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 14:46:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQKh59gZz5V2bV; Wed, 04 Sep 2024 14:46: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 4WzQKh4LXNz4GVT; Wed, 4 Sep 2024 14:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mH0fUxRWVlUjtZS7wbNKpxxZ8yB2oL+GdsBk2bcdWrI=; b=iEiZ29Ccm5oVDQHnEtXUmDfUDdwWvU/P462EbY67upsOsVWsWsuHMy7EM92oGuzkll08YZ Wgy4YElGNtF8cESx118bIr6aX1fUpbGnAAJhgx6OK5iLP5Rkmm9h67U1aZ/suS6/vUsL76 qty88LklKWOalAYr2QXaDCl7t7//rQ8t17tBDwElc6BCXf1jGVyCgvze0kVLKTdmgGHFB3 EWvuzLsqoHiHZSYWV8oB3QPqD4PVnbKqiqC8WOx8fZr1LKvCbVrn6hMSEfP0w4L6USVQ0P MM62VRjtASSJX/sZVzj4xfg3nFOz1gDYrG93p865gFZdcBmf8EZz6g4kftmgFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461176; a=rsa-sha256; cv=none; b=kfIApIfJKoMvqDPsBRCmcKU3fRdwvEIYPSONIkYr8xZMYAt85UeCt/L7olsXNajbp1fr3T bpKqO/bac9e/e5zC5GoLMc30QsKAfoOAC5bMf18WxGMDtHfXLSCfhkBcB5jEaJV1mxfX3+ umgKpSz4p4nntDLlsSlmIUhcyAKkJB5e95WGXkO/kLnePNuwvy1tHvS4v9x59T8x5YG7rd OoQwHioUrpddpXQJL6uTO03ypwCKx02kwz9URO11onLloA66DirOucIdyAvVT16aA+O75S wpKNw7laH6rFRntdmH19XGasVYr6Hnfm412x2oV3XPP/zHhXnu5Df2fOoxbGXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mH0fUxRWVlUjtZS7wbNKpxxZ8yB2oL+GdsBk2bcdWrI=; b=E7AO/Adw9bhy4uXAJczPOJSoTFLeiTACFtDd7DNPxRKAlov5esRqQRVWNr5nU2L9X/R6Yi uoaPA517smvJvploq+ZfCaHfUdC+lgeXd7fUGQHvj/C38FPMDCBnYt15BFM7Ml88szR8Yv Rh3fkPcjq6bsfteenF6UL12zvFMEYrCMykYMnJ9LYkNgowG/tENWrPJ/2s5N9nuud6YDCO tmfTizWpBilAqw/UssI0EquWAhfNBnIouSoJIVkuiIZnBEj9YLHy9FLHQ+waTQVtIuwPSj +G/DXCcF+MORjXaYHwva1oe+NaYVIa83ncxbAKA7YJ0N1uI5mio4pFvXjzxQeA== 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 4WzQKh3b5CzSln; Wed, 4 Sep 2024 14:46: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 484EkGBi000724; Wed, 4 Sep 2024 14:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484EkGCM000721; Wed, 4 Sep 2024 14:46:16 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:46:16 GMT Message-Id: <202409041446.484EkGCM000721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 670b582db6cb - main - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 670b582db6cb827a8760df942ed8af0020a0b4d0 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=670b582db6cb827a8760df942ed8af0020a0b4d0 commit 670b582db6cb827a8760df942ed8af0020a0b4d0 Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:11 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 82420396aca1..2124903f4ac1 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5625,21 +5625,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index cd7e499c60a6..821aa0aa681b 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -355,6 +355,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 14:46:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQKj5YQFz5V2qc; Wed, 04 Sep 2024 14:46: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 4WzQKj56nKz4GMW; Wed, 4 Sep 2024 14:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMD97kITUYdyZ1ge0Zkq13FoZrh+QxhS+aqsyCQmxqE=; b=otXLGOmQyvReg6w4rcRrHhDJ5+vK49GyE5gBCaW3AE6vrLcdbiHzDXfdHymn3O5jmfIzvI Yg4+WMe+fHtODW+Laiu9dYYESwUym5NRW4Jr2uZEt4z3nmu79hF4qc3UBPd61TCZf2BU5E /HB6f9p3lbjSoZOVaPPYs1Q7As1esFqc2BvHbcCpAnotC2XzmcDvpaCno5ujCQVxLrg2KN +kI6KS9Klc0tvur35X9YLRimudqsuh4kddoP7U6tKYamJJh6GNRWoKx7lkg9TKjS+ggrY4 jQ9DCQallHmYOMo1CmJzELAL8Vgk90xJ68RpUWKq9OVTPcHC4SO2Cz6AkPKWiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461177; a=rsa-sha256; cv=none; b=Xzt5jul4ZiTsVavRq8RJ8b5M8n6am8YafFmJH5vgXUD7MxVZm8KNQ29biGytfLaJP+lCPR b89Jp5JHVrJsGhnOfC8wy0k/3yHvrqb8ETKKoFQ4/1YA+cOGRu3Wj8+NSpFacKBD6G3anN WL9okW27rHrkElj+uIHNy3R1aS3XyES/Wiem59scRg6U2R9DgnsiGQOxSrSp86j60fdXRk ectbwS5n3xU8cUir1Frm2dPpwo7OCBP+1h37mjIWSq3fW7f01IwRL+5JZdy7S2G+V+wjbj fAdiVHuGtG6c8O1IinMA2d1XsBDSQXGTRDd+FGaTcIxAtY/O+yHjbfIkOTiNLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMD97kITUYdyZ1ge0Zkq13FoZrh+QxhS+aqsyCQmxqE=; b=WrPNcSdkvl/LyhXICVqkx18sRcIqFTRytvPdWFbmLqGJj/J1gOiK7Gw4B5RSsbS0TjLKuf 9kwFk5BppvnVb2S2PDvKW5fppdmQLryRP0y5lyj+bEVQtT/o1kOXQo8YDmF+nqvEh7WK2r 9lIHIHlGP4t7lWeBWicSUguU/hiRPwN78zqKXCN2SflskIaz2UyvWDEbUcZHRuynII4o50 nC/aAZTLuxtdz/qor8J1BCX5rFccnfyysg5eJ+dLrg8n2aHe3NuwDfiKQlb6aPDOvo2zen zXHDNfTX5eoYXVXoRe4pO8F3A6gGkqmQctKfX6lw1UTzrhhlV0ablrcVgk5fRw== 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 4WzQKj4gF5zSp9; Wed, 4 Sep 2024 14:46: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 484EkHl1000778; Wed, 4 Sep 2024 14:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484EkH57000775; Wed, 4 Sep 2024 14:46:17 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:46:17 GMT Message-Id: <202409041446.484EkH57000775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ea44766b78d6 - main - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea44766b78d639d3a89afd5302ec6feffaade813 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ea44766b78d639d3a89afd5302ec6feffaade813 commit ea44766b78d639d3a89afd5302ec6feffaade813 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:11 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 2124903f4ac1..e58299951540 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5586,7 +5586,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5627,7 +5627,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 14:46:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQKl14Nyz5V2fj; Wed, 04 Sep 2024 14:46: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 4WzQKk6dFtz4GPp; Wed, 4 Sep 2024 14:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eyKwLtVKOIcP7rPOtN2vZKN8MB05WYszULgBRRTLojY=; b=c/X90jpSj7zPN86r9Wgg+4e/V8C/CH5vvDsIueKrF7lAWMWf2QWO2SwNxRPt9nxx2CF9vg VQSIS3CmJXQNuacZcLv1qcFSmqfQx4MIyzAalqNvk/A6NrQ6LOUWJmim4VjLc220nCDSa5 UsxSHNM9bPqYcT7eFxXvSSn/0ud4vwJPIFp15yB/Bn4711uiIWOPOTMneKTcvuSeGw2oOg 3CFMJKhG2OGVfPkMppt5CRjStoAY1oB2BTwPxeOiUW/ehjlhNHYd1mdQZCl2RVdrqh4Gac 3y7L670grJQaLHqP0+bMP/3slhDotPZ4uk+ovzYN0MwxyXHVsSFJuo8l/RAS/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461178; a=rsa-sha256; cv=none; b=L1IpEo13qZML7/bcNRbtktrp5m8GE6ce33bz7f2ZOD6ndML8kCNXsQRSZRXNNklf+Y9Q6k /gnquwP4yl/h1/9zdQQ0yx7qKG7BqTr7SbGAU955IlP0CwTd+tfRVNrsgXhgy0ylJBXXpF pM7mD3YII/8NRE8UrYcJ4nZXJyfxDVD8pbghUAy1/itDRxLa71gCNFO98CCmME9Tk0Yvwy a4FdbWZ+110qCjYkf8x7Mp2Kp0gVvCUxqC016CPZhrQ7ldv4F8H5McfWyldSTrFLor1CaB IoaIpSHl7RYi9cg/fbmYY9RhiLITzpIuxCxzHFJfC7yaVnDfeFYWdoGqg07RmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eyKwLtVKOIcP7rPOtN2vZKN8MB05WYszULgBRRTLojY=; b=vvR8/ArbrUGwaSaNevqCPMIUL5cO7waIUqXlMwTM3Tb9FaP5ql6EKVHJ18/NNYBFC0Ty+9 l9C9+BVG9q4hVPyTRrtKxzGmQOOgr0Iyz1NeQE/f43D0FxJRAo7LnfIaj+Cg3+7WtfAaq4 xR/dtmgiJFb2xJJkHy6fyIptrB/VkIhDpyhSgTmKkObkwEN4N7I9RHUqWJsFiamoUjVZdr wBNEnFCVZF+dGYd9rXOUOHlqsTnMKio5sUyQ1OAxz6FC0L6TCH0r+mbXizM1ysdqK742xY R4di1D2z6GFxQc0Gc3bYGzGSiQOMIcEosbK48ebLwRm8YKQPKGkU8ov3hGYfNw== 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 4WzQKk5MgkzSk0; Wed, 4 Sep 2024 14:46: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 484EkIt6000823; Wed, 4 Sep 2024 14:46:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484EkIgb000820; Wed, 4 Sep 2024 14:46:18 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:46:18 GMT Message-Id: <202409041446.484EkIgb000820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: af438acbfde3 - main - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af438acbfde3d25dbdc82b2b3d72380f0191e9d9 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=af438acbfde3d25dbdc82b2b3d72380f0191e9d9 commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:12 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index e58299951540..53858edc2a1d 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7470,20 +7470,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 14:46:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQKm27mlz5V2qd; Wed, 04 Sep 2024 14:46: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 4WzQKl74wdz4GbG; Wed, 4 Sep 2024 14:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2t0yLMn7H+uMP+FHA+23fOQfQTdp+TKdLg+tNq8B0qM=; b=K8cePUVexG1WXqbgla5F5Dk0LHyT0vgThNjkgJiDVzyR0eqZqZAeIWCynX+Zznss89sShh nd8SmWVVE5hyaXW//S4/2QwMqYFoF0HRLwYEwRpAQKiPNriW4ay7oRPn3Z6TooWuJE8s40 No2VpvWQA8c5wGESh7DZHZ0SqQXCnT0a0mKPqbAROMakvhhH52XvTKgNyvgCumemH1XdGt 7gdD9BtJwdzBAh39mBTcg+ZWcGzPPo6JrPS5QqR9bZftKjpKFGNV0CSh+OzrvSAoG2+5XK ljvh8IebelHz2YV6FwjwVIvmkrSAVS3RQ9MzL7n5ZEVcjQraz3XygdTagHaZ7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461180; a=rsa-sha256; cv=none; b=X/fblyaqM5J22VJfdoBc4rBZF+wbmty06jv6S3fL/RXovCFwlZcDbrkvig9oE4SRJATFd0 fLfNTNr1GbZQkOpbzqUJrQMI1R+EHUtImHpG+mF41mp6ivP7dwEe51FU8ncwr/3xaE1vka kDm06AfcL1jZfFHLG9ICpFnLagnpm59ekRbT7Kz48HboZTZ0hvwVRQ7Ot+SyLoSF92MuV2 q3dBnL91nnBSdHYxJPc80k/kGuaSo+h8WEfktIMNeUP989gTX69dUTa9XOlygT7FK7UW0S NTNJCVHVs2QmfAjSkRwbG0zGemY5n61e6SiejhSwvGaWfFikmg1BJcm5ewE//A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2t0yLMn7H+uMP+FHA+23fOQfQTdp+TKdLg+tNq8B0qM=; b=fjIhgeHx0BabsYm3JjCe+GeCvOoxX9eRSsM5fdG18QaSqCG7tJYma+YBt3HAvi45k3M94r qyog8++Q4xR/cuPF+rlpvsb8gXJoOHkGr/R5DOrk3OFSDpn/3tlE1dRNRkObYGjTbpmQlS pFMj7nxsDmMwUyKyBqnTVPEtKfOZf+WD+V4UFsGT2ybBw1YHS+ri5VAheVO+LbR27XCQZE pqIG+s83weG1UL3GbI7XE0qZptflM6ovBcmM8o9urt8aIlMAooU0n43EzO/DTKyqHVHIFQ Y9UGozwap5/oCOgUL0qB6M34AA/LTRy9MkaHiazk3OnB8kiJzrtz7O8RkSX1Gw== 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 4WzQKl6jB7zSk1; Wed, 4 Sep 2024 14:46:19 +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 484EkJ4Z000874; Wed, 4 Sep 2024 14:46:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484EkJIo000871; Wed, 4 Sep 2024 14:46:19 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:46:19 GMT Message-Id: <202409041446.484EkJIo000871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 60d717baf214 - main - ctl: add some ATF tests for READ BUFFER List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60d717baf2144cf344ec9b47d715ce837b5d46d4 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=60d717baf2144cf344ec9b47d715ce837b5d46d4 commit 60d717baf2144cf344ec9b47d715ce837b5d46d4 Author: Alan Somers AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:12 +0000 ctl: add some ATF tests for READ BUFFER Reviewed by: Pierre Pronchery Reviewed by: jhb MFC after: 2 weeks Sponsored by: Axcient --- etc/mtree/BSD.tests.dist | 4 + tests/sys/Makefile | 1 + tests/sys/cam/Makefile | 7 ++ tests/sys/cam/ctl/Makefile | 10 ++ tests/sys/cam/ctl/read_buffer.sh | 226 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 248 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index ba03881bcc27..ac53de071c11 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -791,6 +791,10 @@ .. compat32 .. + cam + ctl + .. + .. devrandom .. dtrace diff --git a/tests/sys/Makefile b/tests/sys/Makefile index e64268e5a397..535e627d22cb 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -6,6 +6,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= ${_audit} TESTS_SUBDIRS+= auditpipe +TESTS_SUBDIRS+= cam TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= ${_cddl} # XXX: Currently broken in CI diff --git a/tests/sys/cam/Makefile b/tests/sys/cam/Makefile new file mode 100644 index 000000000000..4cc36604280a --- /dev/null +++ b/tests/sys/cam/Makefile @@ -0,0 +1,7 @@ +.include + +TESTSDIR= ${TESTSBASE}/sys/cam + +TESTS_SUBDIRS+= ctl + +.include diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile new file mode 100644 index 000000000000..0e6f39a1a56f --- /dev/null +++ b/tests/sys/cam/ctl/Makefile @@ -0,0 +1,10 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/cam/ctl + +ATF_TESTS_SH+= read_buffer + +# Must be exclusive because it disables/enables camsim +TEST_METADATA.read_buffer+= is_exclusive="true" + +.include diff --git a/tests/sys/cam/ctl/read_buffer.sh b/tests/sys/cam/ctl/read_buffer.sh new file mode 100644 index 000000000000..4a84eb6b9725 --- /dev/null +++ b/tests/sys/cam/ctl/read_buffer.sh @@ -0,0 +1,226 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Not tested +# * modes other than "Data" and "Desc". We don't support those. +# * Buffer ID other than 0. We don't support those. +# * The Mode Specific field. We don't support it. + +load_modules() { + if ! kldstat -q -m ctl; then + kldload ctl || atf_skip "could not load ctl kernel mod" + fi + if ! ctladm port -o on -p 0; then + atf_skip "could not enable the camsim frontend" + fi +} + +find_da_device() { + SERIAL=$1 + + # Rescan camsim + # XXX camsim doesn't update when creating a new device. Worse, a + # rescan won't look for new devices. So we must disable/re-enable it. + # Worse still, enabling it isn't synchronous, so we need a retry loop + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 + retries=5 + ctladm port -o off -p 0 >/dev/null + ctladm port -o on -p 0 >/dev/null + while true; do + + # Find the corresponding da device + da=`geom disk list | awk -v serial=$SERIAL ' /Geom name:/ { devname=$NF } /ident:/ && $NF ~ serial { print devname; exit } '` + if [ -z "$da" ]; then + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + cat lun-create.txt + geom disk list + atf_fail "Could not find da device" + fi + sleep 0.1 + continue + fi + break + done +} + +# Create a CTL LUN +create_ramdisk() { + atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 + atf_check egrep -q "LUN created successfully" lun-create.txt + SERIAL=`awk '/Serial Number:/ {print $NF}' lun-create.txt` + if [ -z "$SERIAL" ]; then + atf_fail "Could not find serial number" + fi + find_da_device $SERIAL +} + +cleanup() { + if [ -e "lun-create.txt" ]; then + lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + ctladm remove -b ramdisk -l $lun_id > /dev/null + fi +} + +atf_test_case basic cleanup +basic_head() +{ + atf_set "descr" "READ BUFFER can retrieve data previously written by WRITE BUFFER" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +basic_body() +{ + create_ramdisk + + # Write to its buffer + cp /etc/passwd input + len=`wc -c input | cut -wf 2` + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$da + + # And verify + if ! diff -q input output; then + atf_fail "Miscompare!" + fi +} +basic_cleanup() +{ + cleanup +} + +# Read from the Descriptor mode. Along with Data, these are the only two modes +# we support. +atf_test_case desc cleanup +desc_head() +{ + atf_set "descr" "READ BUFFER can retrieve the buffer size via the DESCRIPTOR mode" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer +} +desc_body() +{ + create_ramdisk + + atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$da +} +desc_cleanup() +{ + cleanup +} + +atf_test_case length cleanup +length_head() +{ + atf_set "descr" "READ BUFFER can limit its length with the LENGTH field" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +length_body() +{ + create_ramdisk + + # Write to its buffer + atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 + atf_check -o ignore -e ignore dd if=input bs=2048 count=1 of=expected + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$da + + # And verify + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +length_cleanup() +{ + cleanup +} + +atf_test_case offset cleanup +offset_head() +{ + atf_set "descr" "READ BUFFER accepts the BUFFER OFFSET field" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +offset_body() +{ + create_ramdisk + + # Write to its buffer + atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 + atf_check -o ignore -e ignore dd if=input iseek=2 bs=512 count=1 of=expected + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$da + + # And verify + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +offset_cleanup() +{ + cleanup +} + +atf_test_case uninitialized cleanup +uninitialized_head() +{ + atf_set "descr" "READ BUFFER buffers are zero-initialized" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer +} +uninitialized_body() +{ + create_ramdisk + + # Read an uninitialized buffer + atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$da + + # And verify + atf_check -o ignore -e ignore dd if=/dev/zero bs=262144 count=1 of=expected + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +uninitialized_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case basic + atf_add_test_case desc + atf_add_test_case length + atf_add_test_case offset + atf_add_test_case uninitialized +} From nobody Wed Sep 4 14:48:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQN161XNz5V2wC; Wed, 04 Sep 2024 14:48: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 4WzQN15YMjz4Hpf; Wed, 4 Sep 2024 14:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sDRIeBUmlPJ1EcC1rHUFs1K512DsEzLAE01adXusEfM=; b=n78Fc7ajWcWGhJ/sXW9ABtLjk0U3STQc3u1r+/FQGEdMwhKlCGjFT/u1H/qkzxcsjKd3lD V1tPcFUpW53INLhtx9/bNRQFExNOwK0vIccsm2YF9WfRaGV4rxNIZUDppk/lzYeeiqwp+8 ywkHRAyM2MXLAyJS+Ak6n16YkkOp1qqYiPk31FjJ9w/D5g3lmCDsjSquUNxfnpKiSz0BqW 6RNnGeBvzPOfqxOVZ3afXvShIvpRwnXRUl5sJl91oMY4MiUh1eX63P1iFq4APKLkNDDeXM Fls/5Ok4ssgpNvqwZxJxMOHLTXGuLfFIlLNIgs5QDbJOUYOQ8zSJuk4d2LVHEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461297; a=rsa-sha256; cv=none; b=rTecKuuEhKMpOxmFA5usqFDvkUR0pbX6voThS3upr0tWUjoco0MO2kv0TiEcFfaSvP5KER WzyduwrAc89S+4DsJrnC6s3aTbUFnHDv2QIxLvOyhdtX9B6ROKoKokDX7j3aZG9iYI5aBY 3xwPfAf7atjR3OT8Q5jpwQtQjSpWERutlJBhIFvCCojtIm8pP9LpNWPb+R8SwDN2XSVy0K UWvLQySCD8EgHbECZXPmXgVhsE0YdSb9Iqk7hc0H2eiKXIIP1r9YVSb55KkDBvwdHG/g// 5lw5gfPua2kyuN3kqo+2Vh4EwauXlXM318yHTOA7ABeMJRdZH4s51Rp5wONtRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sDRIeBUmlPJ1EcC1rHUFs1K512DsEzLAE01adXusEfM=; b=XpSrE14mgjomeoZgsVxGueoJ3TPwOwd3HmfHwDsHDE4qyClI0PoHuyp2nUnzYAbxz5DDyX AqWvT0abghvtJCBJ3AAT9CjKTBHZuNRT1kQUbdBetscth+2X/YUELDEUPTCcK8fhbFU4gR av5bO5aXUbmI34LReUNOtuimk6x2qnfUxNGtjrxT/KR3QRgJyBgQHOcS7CGFmj2ic3hsdL qGzMBFt701iomMCP2iz1JH9Z41BFux7GNBDuUyCaMmd9drNiCP4L3PhQjnm1WBtMB2N7ht wY7Y7IOn4zigAJ2TDM088PWo33g+n8WQaryLpXZ+Oo8mPH8trDakhkvLAiHy1w== 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 4WzQN14lC3zSrf; Wed, 4 Sep 2024 14:48: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 484EmHmv001295; Wed, 4 Sep 2024 14:48:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484EmHU0001292; Wed, 4 Sep 2024 14:48:17 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:48:17 GMT Message-Id: <202409041448.484EmHU0001292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: dd83da532c36 - main - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd83da532c36830a0c0aac624903849262ec6f68 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dd83da532c36830a0c0aac624903849262ec6f68 commit dd83da532c36830a0c0aac624903849262ec6f68 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:12 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index e6d5e2de5e88..8d70438ea195 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4293,8 +4293,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4354,7 +4353,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4394,14 +4393,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4494,7 +4490,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 14:49:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQP46gWGz5V2tm; Wed, 04 Sep 2024 14: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 4WzQP46230z4J4X; Wed, 4 Sep 2024 14: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=1725461352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NPyaO5tbYrXe1nDTwk/DYGp0YTF0cls4gmpoeYbHd88=; b=tIZhpKKFyX5+hR/NUZXgLlZi4HB1W13svjuvVHgXxKP0QaGOgGXjfpLCwzftV09NtPd6vF lYvc60elIGqDHUz3iECWI6+gpq1TvCIxZaW6wX4thjxaSI7/y0PeUOVN+O5P99Yb41NcWW OJvnSbiALNsxfu2nyTAVnD7fPio0fpAGU+9veJ4W/RLk3QYFGDuYP/VQF9S5q00NSaczBy /q54iz7SZM4cKY23l4O5l4l6TNob+akse4rNaujdk7ZOGxzG+xk1kXcaxMRlkXUSqZgQ/U 0vDp/y/Q5oMUvnaSNYfkSextgE72SCWu5zrAu23oqXIDuIwLI50YEiZzGFXTMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461352; a=rsa-sha256; cv=none; b=b3bNz8NMrChxPFMPtCayTkoJYtbBgZVrbbYQ3L5bMX3t3t6UiRogGpOSRwvgQN7oITiNQG 2Oqlz96awZL8HIKysFgVveBUE8ktN24iggwMLR9ZguXgNaKLPWUhC8hxhd23GXeJBcE1dH +QiUhYtJMl3+JwfWIaNHnG6wYkBXM/A9xNDgve8DAXAegPjycZT2+paDgA47y00U5o5pwu v39qgxovpi3gHQi8hqHFRCQdZTvyCID/Jfz8VVicK4KwHLy/3iIAEfsZ1Ts4i5CxzUb/MA Fpf41NlHt9KDb41o23cu9BFbu9WNZUPvfHYTojVdvUw0xN8yhlH+nWgLbA/nAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NPyaO5tbYrXe1nDTwk/DYGp0YTF0cls4gmpoeYbHd88=; b=qo6cIxNknJWaY/Moe24LULO0xwg2Ta/mBsz5AZRTU9vzztVYlost890kn7Ga4VNrqMR2BP tOTEYt9nS9G6FIxpySy96KC7oIyOQeqcs+DPIpIk+fDFz22ERAxEOjG47XL5RJLLJjN1Jy Fkipd0PyiB1l6FwypXE5EhlFQYYoZ7HimKl2n+WRCxSQ8YaRqCZ6yXKvtNZZAFXpNjCvKY Cf48CRne3FKTquPUVIGbssCQTa3rK3Bdg6FG/LzrvjnD7EDG4A+N/uYQnJhPf6Rn1GQ/uR shbFqECUjESrzIr6hZK85z1bN1J5/2jGOGv7iWG93ybAuYKWJxZeRAMohcGUwQ== 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 4WzQP45L1rzSrh; Wed, 4 Sep 2024 14: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 484EnC5W001600; Wed, 4 Sep 2024 14: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 484EnCAE001597; Wed, 4 Sep 2024 14:49:12 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:49:12 GMT Message-Id: <202409041449.484EnCAE001597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 62f40433ab47 - main - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62f40433ab47ad4a9694a22a0313d57661502ca1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=62f40433ab47ad4a9694a22a0313d57661502ca1 commit 62f40433ab47ad4a9694a22a0313d57661502ca1 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:12 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 8d70438ea195..37c44f969a27 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4384,39 +4384,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4469,7 +4479,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4486,11 +4495,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 14:53:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQVY6B46z5V3Mk; Wed, 04 Sep 2024 14:53: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 4WzQVY5G2Mz4JnX; Wed, 4 Sep 2024 14:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7bBknuDy3scdf4ek7t1hdbuVM5erK5B5nVbhAAN5NO4=; b=ahVffDAYxdLJpN10paYlEqNYZm0c21idgVuTNv8sMwBi5x8yqCJRD04r0a4b2Xcpmg3rIF hxErXZBHU1nrJDx6vSnDyPf0SGMXnjxD/otePRImN6XQscvdbvIN97XLi53siWJay8WSzY eT2eHv4f21gKIABvW/KFArHpei/PnNeCs2prQnjDkWWz1hsyPRQypQYNVROZVfk3hFyduQ 62QTULc3wzLEsgB5YyPeAL5EvmHXBBpcYXRTBOP6xf5XmIGvPX48Llk96N7tKU7UD2CFZL onUBkhr6Snzy2YnfDfPAVFtu08YqJvcKJkMWgfTXXJWTD3sik4ZHyVCP5u/YNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461637; a=rsa-sha256; cv=none; b=p+2GsrmAs087Vt19+Ihm/Xa4lbPV3kXpL9nyNB3cpnAq/O5er38hWspknNegVoTyNHuDW0 Cy3tfo8tCyszWjGvoNf7GvzQRbmJf3ACrn/0C0gaSlW14ozM8ECFPtzWEsYc6z8LnYFxIa UmCNScks4/dmC8fqGhgpSlAXhu3Mv8be9rlh0CFaFxM2nM+yhSV8/00uhTHX6H2LXolwTh Q81EBDGe3dmu7RRGxm6Z24pySmGRBXOSTP9TDXa7Bx5mKG9kb8CpAK76FkIu25+58q7Wbd en0ZuBORkRkIaX2VnHWtJeSy13RJzjS6s4T086wGS9nFMkVkNikDF4jHBP65Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7bBknuDy3scdf4ek7t1hdbuVM5erK5B5nVbhAAN5NO4=; b=nTO/m431G5wogq1zjbebI48Ho20DRUQs5v585UJZOx9e0IPhYCOmnOoMYXnEBBBpojV8wl AnCihyH1kIsaExjMo+mDAJxTK757V0TqhzQeiyFPxpE+mXA8AEeZ1I6d8BVdCLxmPO+arD xi3xR8jfAEpRcepspCrEgXfGUzqrjxNbsWCK/7udcxau9GNxqYkkEVLGtF8ctrWnBmKGJz qzhJ/cZJS5cKP9S8+JcffF8GmMElS8XZsdcw8qOP5VnMsXWYaLHrSY24grUzCDp3AXV+Dy 8dKhiwTCO5aNx2vB9Gk4FAsR025yNIDMz2nO1c8j7TGZ+yGwXUcFB7XnHKgDjQ== 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 4WzQVY4nk2zTBd; Wed, 4 Sep 2024 14:53: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 484ErvDq017379; Wed, 4 Sep 2024 14:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ErvrB017376; Wed, 4 Sep 2024 14:53:57 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:53:57 GMT Message-Id: <202409041453.484ErvrB017376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c3e6dfe55c0e - main - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3e6dfe55c0e81d0717b0458bc95128384c3ebe8 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c3e6dfe55c0e81d0717b0458bc95128384c3ebe8 commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:12 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 37c44f969a27..a6c160ab6283 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4334,8 +4334,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4355,22 +4364,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4470,11 +4491,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4488,12 +4516,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4564,13 +4600,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 14:53:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzQVb1DdHz5V3Mm; Wed, 04 Sep 2024 14:53: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 4WzQVZ6D35z4JXM; Wed, 4 Sep 2024 14:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jHr+ye4STj+0PBoObvOWkloKIAcz3E7p/VdN5nVWofE=; b=upf8NOvrdeZ+jWBHK6dHsVR81uDC36E6AZhiVfYKNH0w//oyANj2NJVcA1kxr6rBWbV+XL VGVpc5xnfh3SPWDOIpreMUVu1TnhyhRI2vRN6vuToClwLXsEehAIAhweBu25DsgmrzjgnC qHsjOkRQ7qxJDemHg02++sJTSOrvCAPuOZPCPTIxxipKV8EG1WgvuzN/YroJYxg5AjzTvp 0cPvD04++A1j+t31Ys970QPHZlijVBdvzHhMg2VWozE2WUKG8Xx1gDlr4CUklVqP9zClNk AG0DSh45108yODyKvrwKtjSsctVMGeiU9LLj+fECpirg4FPogkWOi3xMu1Q7tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725461638; a=rsa-sha256; cv=none; b=x0AIkQBh+4mRZ3sWG4PjBnsSex1Fhn8pLrOts8yBhAbcobQMRhbwBGl0Ns9FHX6u5ZaIqb aoDLhmdnIs6MRzVwYiWUk+339NYOn7uvd/i4FHdZ/ACF4JDCKPSJzFdKi3UfMEOFFYTG2c A5trfA9QgaLDmuLYn+LNEUGqowKWtcYMxZe7X5DowRc64MvA+9mJHQBzw4h29uCdmJ1MZQ HE10MwgCFi1Dbnz83eJdW7XUkDH8F3VqRiMXLCFvT5Ft/YyRPt9mamnNlhK09xoufU6n14 JWuaRNsTNxgj/u5XYlMw/H98CfpFTLw/qbqWF6F3jtYeQXX9GZQKMTSpndPdzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725461638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jHr+ye4STj+0PBoObvOWkloKIAcz3E7p/VdN5nVWofE=; b=eXN5fsStTJ2riJ0yDcMzOubyvoLYbrwLRS3ppEvFLrBp7OLhH+vj5ibYTbNWDbcMiECfX1 wJGBpqDwevxE+3FiBzEZPBzSjGcI2cI0BLJ1lh4ougktXBXlEoyYM51xORBh+U21J3NBsb 9K+GNOYatB0Ph1nDqaye7WlbiVCm+fmvp0vleg4nMMnTkacER2l4PZiWuFs/MctpmNf9IQ XFOJ89KNdMUpipgUDKoHMPDsEX4Us6+Q59qDw7W6lqpb3/61fKnGz5mcZxcNoggCgxx2Z9 sZd4ZLQSItV6TNVC+UwMCuf5RgV4abxiTHJ6Zz9H4CBaNbkL52vvniBbgUbtWA== 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 4WzQVZ5qT7zTGh; Wed, 4 Sep 2024 14:53: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 484Erw84017433; Wed, 4 Sep 2024 14:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484ErwTx017430; Wed, 4 Sep 2024 14:53:58 GMT (envelope-from git) Date: Wed, 4 Sep 2024 14:53:58 GMT Message-Id: <202409041453.484ErwTx017430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c75a18905e30 - main - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c75a18905e308f69b01f19c3d7d613883a008e79 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c75a18905e308f69b01f19c3d7d613883a008e79 commit c75a18905e308f69b01f19c3d7d613883a008e79 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:38:12 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index a6c160ab6283..705571930d7b 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4360,7 +4360,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4408,7 +4408,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 15:42:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRZY5PBFz5V70d; Wed, 04 Sep 2024 15:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzRZY4xHNz4R6p; Wed, 4 Sep 2024 15:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725464549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bjl77afxF8BFGk4DiBlo6Mxbrrfewfv+C5qAV5LnO9I=; b=KbPGHa4nEv5mMb/z7bzCTS6Y+zdDfkuH22wvkM9bf+ZCd8ReCMVNu448/ewiPunNIXlNCm mt6nNgFefxz9LrVtdohZYBI6Pz036x9zTgq7Y8AinldUs8lANPdokEoz6W863LFsXFKqt1 OWkFRg95iJh3HSiCIhw6QeXyUeQtTsAq0z3Mgw6/T3AeqGuntel8Ywm5YGBs8mnGQF9kcO //rb3fULFMK/ziOJW8CxUVHn0XhZkPzvaRe9QDsv4V5oOF0BjpRvwCcz072L70T/vTTgpy LwPXqXR3rBgW440EdiJPDxmupYs9hR0+PvUDwT+lNfMFDjO1nmT30F/jtNzmIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725464549; a=rsa-sha256; cv=none; b=IipHY1tlb6I3jWUl7KvZyyARiUNH+4A1qBau6unPBu0y4vK4zn0+JN2IMUJ70d4zPlPM1g ZwCCcF51Qb1WjM62qWZrn6U0jgE6ifLNhj8lG7iytx+Y9fOfAZZ7kVSFCvczFtxK9O5bjM 0bsRyQtbGdMNdHjdJteinX25P8J5gQihJ/FsQbLuEoeIPxxv6nLqlJ1iRSJ5HQPXxaiEyV sJzXgrIjrDNbNDcc2dWhl7sZdI63zlXHrATzFT+6dOPyCLGbYrc0q1QVPIW2wnfbZBifbM DOJe7U1FotNy4SDFD1QUUXOFc+oz5gyd7IpU8qaiwQPQPwaADK0uctyX0AgFnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725464549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bjl77afxF8BFGk4DiBlo6Mxbrrfewfv+C5qAV5LnO9I=; b=HSIkkvr3uf4YBQghtBdG4MNFXUIA48UtUCMfWPUaXZ3CM0/5JKllhHPUt/u3WjebJhN159 7pU5i7miLkrIf1e60mXKncZ7scu8G7/bJl9g2Fr1E11Z32gSTBAMdyMWy50UbgjONP1pqe QekUzThgviTB3ts3XqHl0IX4K6ApM6/gjh4TeD6LD0x8MHdkjrXkRjPY4UFtStZMtfCvQG EyVNX1vOZ18y25U3YpoZMy7CBsMUkQQcNGefYArAVAPmhfgpmf+HxQJ6uOV8xIMnFHs2oT /H1Md/jHx1Ew05nE5U2AyaWkLthw6ytaApaaB+HRjI8mcduLy73rxKK2tc/hfQ== 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 4WzRZY4XdhzWMl; Wed, 4 Sep 2024 15:42:29 +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 484FgTbf002461; Wed, 4 Sep 2024 15:42:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484FgT6B002458; Wed, 4 Sep 2024 15:42:29 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:42:29 GMT Message-Id: <202409041542.484FgT6B002458@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: 6ce4821f0859 - stable/14 - bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ce4821f0859eb00e1754917e1471184755b6358 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6ce4821f0859eb00e1754917e1471184755b6358 commit 6ce4821f0859eb00e1754917e1471184755b6358 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:59:23 +0000 bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler The function tpm_ppi_mem_handler is vulnerable to buffer over-read and over-write, the MMIO handler serves the heap allocated structure tpm_ppi_qemu. The issue is that the structure size is smaller than 0x1000 and the handler does not validate the offset and size (sizeof is 0x15A while the handler allows up to 0x1000 bytes) Reported by: Synacktiv Reviewed by: corvink Security: FreeBSD-SA-24:10.bhyve Security: CVE-2024-41928 Security: HYP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45980 (cherry picked from commit a06fc21e770a482c8915411ebc98c870e42dd29b) --- usr.sbin/bhyve/tpm_ppi_qemu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c index da0edf84798f..ddc3fc0045b9 100644 --- a/usr.sbin/bhyve/tpm_ppi_qemu.c +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c @@ -26,7 +26,7 @@ #include "tpm_ppi.h" #define TPM_PPI_ADDRESS 0xFED45000 -#define TPM_PPI_SIZE 0x1000 +#define TPM_PPI_SIZE 0x400 #define TPM_PPI_FWCFG_FILE "etc/tpm/config" @@ -101,7 +101,7 @@ tpm_ppi_init(void **sc) struct tpm_ppi_fwcfg *fwcfg = NULL; int error; - ppi = calloc(1, sizeof(*ppi)); + ppi = calloc(1, TPM_PPI_SIZE); if (ppi == NULL) { warnx("%s: failed to allocate acpi region for ppi", __func__); error = ENOMEM; From nobody Wed Sep 4 15:42:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRZZ662yz5V79v; Wed, 04 Sep 2024 15:42:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzRZZ5bXKz4R4Q; Wed, 4 Sep 2024 15:42:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725464550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QhjcpMkJtMNGBUgHMca6Ri3V0LsihJ+HUJqvouh1ahg=; b=ayB89W+v4qpEMPrgwy+u75KIbBjppXWDPjuKcdA8LT83BwXtcxac79ek2OkglKJvoAXgd6 6QfK0zHJVT5tSE/Ia08Nf+UghIkr96FvS46PVD1pRvJJPANfE8F2L035kS0GaM31K0S8fR +FW1RLVGoIufWp54+mx7gb7cjsKMoR2cDFOLZxr6P5RCU6SplZxDpmFAYCTxQxkdoecC9o heHDLxME/EJYgXp5zEC9ESvtXSe/vDnQo7TUwwE5vPpCDYIGt6xPIRrwPIQkGIDpgcTQ0E AABxL+uzmxBmrArQfcO0vzPaIs1Byl9kpZWAaQvnIhyo9cxuonuRnJ/KIsmbEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725464550; a=rsa-sha256; cv=none; b=AZBt5JeElMlzBw/Sk/LhN7bSjB9O88AL7e0WCIu9paFDZ8+Ok08J+9xTeG/mkXf3bILd+0 KL5o7hHGJ3/Uf2o3b1FRazJpXkgAxRJgJEJggcF3LvTbSEUmAW8n5DccZQ2S52aNU48CX1 uKBoPwLz40yvtbll9aJOdJSJTEP5EQodYXDHpLbEsKYepvMczgYQa9PZRpt+OUD3fUYN78 gjxbtkSBp5nxkB5Z1+VdRYgdSN9Rho1sgftKbUzzlF8Qcxix/faoVTJJ3lyVL18Ma0O7rH i3gdV9P7eQ6QhtQ1YdZKwq0e8XHsS2E+s607QwGJ08kMnQmcId+ywODerdhUXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725464550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QhjcpMkJtMNGBUgHMca6Ri3V0LsihJ+HUJqvouh1ahg=; b=wtgvfbi2+1NfYzhPzdp+uYB7cqPsLyfXlhC17+Qw2J30DfNmOpct74sE8DEF9rM51dDHR8 tNu3/Cm+F+ykCUQurH1NIX2xF89ZeKZctDAEgtCiah6JPyZjWav0aiMoCvH2B1iOhY70tH pmveFRZEXveljXs8J0OjqKzRud2wQRaPyB22KmEm9LaV8Vz5BQYNvoGPlt81rGMGlIprxK 4Rqi1AB5f6m3bDHc48Sd7dBKpcuo4OlXFMORTATz/7EhspimJ9btPYdu02S5uT0djpSAGl 8KFkxKje9HbY3iQxny+9buViOPPnT//Fv5D5I46gxpK66UNfR1HTc0thbkytxA== 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 4WzRZZ5BqHzWMn; Wed, 4 Sep 2024 15:42:30 +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 484FgURV002514; Wed, 4 Sep 2024 15:42:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484FgUOO002511; Wed, 4 Sep 2024 15:42:30 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:42:30 GMT Message-Id: <202409041542.484FgUOO002511@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: 90af1336ed5e - stable/14 - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 90af1336ed5e3c8556147325c4841c68639c4b63 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=90af1336ed5e3c8556147325c4841c68639c4b63 commit 90af1336ed5e3c8556147325c4841c68639c4b63 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:59:35 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 (cherry picked from commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68) --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 99c1d20b3378..791c56a45f0b 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -660,7 +660,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1202,7 +1202,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 15:45:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRfB3rKJz5V7KR; Wed, 04 Sep 2024 15:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzRfB3HVNz4Skq; Wed, 4 Sep 2024 15:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725464738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ugbHlU9xFuCTVLuOPK2N/tPsnqta10PKsAq/BlWbzc=; b=q/ZpDF9kBMyTXaEuG/sCoq4DWB+fVYWMf0ZssFj/jztF5GGX5NxMK1Auo2mq/iui2/RW5l WDXSqsy6DPGZa/JHnFgp+li25D2IDtFllm5qHX/yv+zwxPNA4jnd8jHR3VBrOx3AI8UEtt 3x9UTm+7e4kV929XmnDj82GF220wFOaVNPsSPIM42qdAT7HzLTWeCJd/s2N6lSEI34UBBs 7ygCov0E25Umanjcbj4X685dKfXKJ1TYI46M2W+8TRA56zXf4YI6YiQhxCj0LAPN2vonVW 9Gcguxa33CnR+6pV9YM+Is+kVOYBbybKnGJb2TjZ+PSOvRWpdKAzulntEIy6Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725464738; a=rsa-sha256; cv=none; b=b1ua4QaaCfDk/bIDlnaspKWOQNa91g9hi37QufOoNmjBCCi1QhPW4icrQueMDKfs4tlMQD xFZUT3JI17KPzu3Vky5RuiXSO6xKhcexjfBnDVlyAhF7lxKjOR8Q9VP6sC1fUf8otw1gTP 9RsA6SNS6IJ1pDbud6FyK0vyb6+xbl+YSvreUpL2qqox1TVTvAYuxaouxz86UpyP8Rqpex rkg2KfmuaYPNE0lvE7K0/4VrfULXu4xFot2JvsP7QqYzyvWlWJM9wWiev03HWL4XyuElbp o1w7FPBoSsTQbrzuqwwj7x/Gmjwql+8Tg0KcdLoiXd07GB7NfjXCOhJm1NwK7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725464738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ugbHlU9xFuCTVLuOPK2N/tPsnqta10PKsAq/BlWbzc=; b=H6BzrWzLcEWHEfKnDSX7P0EnRvTwfkKllLBowmTVqe1GomGfuuKm2SPn8Vty6GwYhISp/D H0js3OiuKCprL8pW8viAEr1yVdZbThJzfwy6zv5ckrffdeotVxqIoN+SSnrqWIEXj3iaEM 7gmt+O2Ut3kE/ZZf/NVFU+U4iB7cy41Vv+wVHn3CBPB2ZXk5ifSYBiCwV4e6SnDXjMn5PG 83xdYLtqkwWv+GETsh/+H2RmzG5oXp9gq6gjEZMaofCaY9DVRyfLwNL/aSOt4gqGzc1GGQ kFSFbYQR8zcG8nY2KKOIDUr7cTIuOohpFE5nR/PJRUqdGtGay6iZprtH4c1kZQ== 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 4WzRfB2n5ZzW92; Wed, 4 Sep 2024 15:45: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 484FjcS2003099; Wed, 4 Sep 2024 15:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484FjcQJ003096; Wed, 4 Sep 2024 15:45:38 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:45:38 GMT Message-Id: <202409041545.484FjcQJ003096@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: 5920b7e6eea1 - stable/13 - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5920b7e6eea1e1c46b78656ef75944fc0709e887 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5920b7e6eea1e1c46b78656ef75944fc0709e887 commit 5920b7e6eea1e1c46b78656ef75944fc0709e887 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:44:59 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 (cherry picked from commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68) (cherry picked from commit 90af1336ed5e3c8556147325c4841c68639c4b63) --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 58f2d53eb9b5..93161affd732 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -659,7 +659,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1201,7 +1201,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 15:51:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRmY6SBJz5V7cl; Wed, 04 Sep 2024 15:51: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 4WzRmY1nRnz4TTD; Wed, 4 Sep 2024 15:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vh2KSRgZh+KHEpuCUHyOQEuvLeXWZyuqWb3WhmB98FA=; b=INBpBEo+QcRcWuSxxgNvTQGZJjdQhqNamCPjcy6GnNGWEsEe57yGWkud92tdUdvI3fMmA/ lSzt256rCFtehRfNP+ZWmor1uT9fkcnP7ZGv1Q753aFBmDAE4P5jBJiod8D+LnAxSW1KvR L76oOhMKrX/a2j/KDc/VRA1rqvfnro90ZC50e1zMgbPWRuI2p4flP2137Lbx0yaSof8wM5 yXdi7Y6GNfpQVK9ojopgWHGUVuQoTmRl/VO7IsWqtd6zyZLPvX387rwoejoy5FVGGQUmtw DoL0vKoT+iC/PPdhSlWk9uQ+NDfftU4k+Ns48VricgpgSvcRs1qvknReUIQw/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465069; a=rsa-sha256; cv=none; b=O2eYcjuUJU9PwiMI32UepWnzRsS9NOHqIiZEWsBOgVbkQ8OmUlfZ2NL8Mqoi4CcTKRSR+l p66qZCrJw78DjwHUbboChniy/yfYrVoEFfn+OAd5V4ASeQ3PJOhCwtk3EjGASznfohM32a MW4WYhENakgHwmexpPbW/AoznCwnwV/o0Ao1sgPQH+oaYmZnZSEeMmYqoGTvto+yxPkYAc /LRxf2rlqgMAYY70XLNngmx1rvLK5fEs/Q+PrjAapG++qbhXAsg2tzr+xjwFgWxCaHZbU2 HLX80z/gJT7M1I6dhtEfcfpRYIWc38sTeLYMIomMm6rmJiPhRkcPTDBIojsgcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vh2KSRgZh+KHEpuCUHyOQEuvLeXWZyuqWb3WhmB98FA=; b=d7KsG9EKq7+LJTIRZy8QXYuE3u88IIumkMFZabXt0ACYrhMhzJWE3iXuHgyHXj4lp+bYD6 qMMCymHIM24TfuoiIR+DWmk1U8c5K/EMappOXpepegQKHpWiF4To+66pVr2VyYJqZgSwgm P8sHH9M01GouHOYn3uhH3C5XAJTzm2FYRepiT/ympJFBxzEJMLjy5439z1EhFB2s8T2ivZ TL6kGzn2XxIixDZ56vgM7H3DJC+A/dR6QkSYyoMOyo0EzZQrrDi6Y6PoWbYGrFseNe4bfS S/UBAfwVFxNCSxDVdQhg3f3/WkgzvW51c94Zr4Q9XoyW2Blw8tk7fUyNr0SGbA== 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 4WzRmX6b5kzX2c; Wed, 4 Sep 2024 15:51: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 484Fp8qB015634; Wed, 4 Sep 2024 15:51:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Fp8CN015631; Wed, 4 Sep 2024 15:51:08 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:51:08 GMT Message-Id: <202409041551.484Fp8CN015631@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: e9329a869c81 - stable/14 - ctl: add some ATF tests for READ BUFFER List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9329a869c8137b955b2b3487ac0dadabf540bda Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e9329a869c8137b955b2b3487ac0dadabf540bda commit e9329a869c8137b955b2b3487ac0dadabf540bda Author: Alan Somers AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:00:20 +0000 ctl: add some ATF tests for READ BUFFER Reviewed by: Pierre Pronchery Reviewed by: jhb MFC after: 2 weeks Sponsored by: Axcient (cherry picked from commit 60d717baf2144cf344ec9b47d715ce837b5d46d4) --- etc/mtree/BSD.tests.dist | 4 + tests/sys/Makefile | 1 + tests/sys/cam/Makefile | 7 ++ tests/sys/cam/ctl/Makefile | 10 ++ tests/sys/cam/ctl/read_buffer.sh | 226 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 248 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index c75e2eabab69..9f0f59eb923d 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -763,6 +763,10 @@ .. compat32 .. + cam + ctl + .. + .. devrandom .. dtrace diff --git a/tests/sys/Makefile b/tests/sys/Makefile index a2a133e19803..8fa5844fc47b 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -7,6 +7,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= ${_audit} TESTS_SUBDIRS+= auditpipe +TESTS_SUBDIRS+= cam TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= ${_cddl} # XXX: Currently broken in CI diff --git a/tests/sys/cam/Makefile b/tests/sys/cam/Makefile new file mode 100644 index 000000000000..4cc36604280a --- /dev/null +++ b/tests/sys/cam/Makefile @@ -0,0 +1,7 @@ +.include + +TESTSDIR= ${TESTSBASE}/sys/cam + +TESTS_SUBDIRS+= ctl + +.include diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile new file mode 100644 index 000000000000..0e6f39a1a56f --- /dev/null +++ b/tests/sys/cam/ctl/Makefile @@ -0,0 +1,10 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/cam/ctl + +ATF_TESTS_SH+= read_buffer + +# Must be exclusive because it disables/enables camsim +TEST_METADATA.read_buffer+= is_exclusive="true" + +.include diff --git a/tests/sys/cam/ctl/read_buffer.sh b/tests/sys/cam/ctl/read_buffer.sh new file mode 100644 index 000000000000..4a84eb6b9725 --- /dev/null +++ b/tests/sys/cam/ctl/read_buffer.sh @@ -0,0 +1,226 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Not tested +# * modes other than "Data" and "Desc". We don't support those. +# * Buffer ID other than 0. We don't support those. +# * The Mode Specific field. We don't support it. + +load_modules() { + if ! kldstat -q -m ctl; then + kldload ctl || atf_skip "could not load ctl kernel mod" + fi + if ! ctladm port -o on -p 0; then + atf_skip "could not enable the camsim frontend" + fi +} + +find_da_device() { + SERIAL=$1 + + # Rescan camsim + # XXX camsim doesn't update when creating a new device. Worse, a + # rescan won't look for new devices. So we must disable/re-enable it. + # Worse still, enabling it isn't synchronous, so we need a retry loop + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 + retries=5 + ctladm port -o off -p 0 >/dev/null + ctladm port -o on -p 0 >/dev/null + while true; do + + # Find the corresponding da device + da=`geom disk list | awk -v serial=$SERIAL ' /Geom name:/ { devname=$NF } /ident:/ && $NF ~ serial { print devname; exit } '` + if [ -z "$da" ]; then + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + cat lun-create.txt + geom disk list + atf_fail "Could not find da device" + fi + sleep 0.1 + continue + fi + break + done +} + +# Create a CTL LUN +create_ramdisk() { + atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 + atf_check egrep -q "LUN created successfully" lun-create.txt + SERIAL=`awk '/Serial Number:/ {print $NF}' lun-create.txt` + if [ -z "$SERIAL" ]; then + atf_fail "Could not find serial number" + fi + find_da_device $SERIAL +} + +cleanup() { + if [ -e "lun-create.txt" ]; then + lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + ctladm remove -b ramdisk -l $lun_id > /dev/null + fi +} + +atf_test_case basic cleanup +basic_head() +{ + atf_set "descr" "READ BUFFER can retrieve data previously written by WRITE BUFFER" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +basic_body() +{ + create_ramdisk + + # Write to its buffer + cp /etc/passwd input + len=`wc -c input | cut -wf 2` + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$da + + # And verify + if ! diff -q input output; then + atf_fail "Miscompare!" + fi +} +basic_cleanup() +{ + cleanup +} + +# Read from the Descriptor mode. Along with Data, these are the only two modes +# we support. +atf_test_case desc cleanup +desc_head() +{ + atf_set "descr" "READ BUFFER can retrieve the buffer size via the DESCRIPTOR mode" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer +} +desc_body() +{ + create_ramdisk + + atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$da +} +desc_cleanup() +{ + cleanup +} + +atf_test_case length cleanup +length_head() +{ + atf_set "descr" "READ BUFFER can limit its length with the LENGTH field" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +length_body() +{ + create_ramdisk + + # Write to its buffer + atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 + atf_check -o ignore -e ignore dd if=input bs=2048 count=1 of=expected + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$da + + # And verify + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +length_cleanup() +{ + cleanup +} + +atf_test_case offset cleanup +offset_head() +{ + atf_set "descr" "READ BUFFER accepts the BUFFER OFFSET field" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +offset_body() +{ + create_ramdisk + + # Write to its buffer + atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 + atf_check -o ignore -e ignore dd if=input iseek=2 bs=512 count=1 of=expected + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$da + + # And verify + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +offset_cleanup() +{ + cleanup +} + +atf_test_case uninitialized cleanup +uninitialized_head() +{ + atf_set "descr" "READ BUFFER buffers are zero-initialized" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer +} +uninitialized_body() +{ + create_ramdisk + + # Read an uninitialized buffer + atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$da + + # And verify + atf_check -o ignore -e ignore dd if=/dev/zero bs=262144 count=1 of=expected + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +uninitialized_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case basic + atf_add_test_case desc + atf_add_test_case length + atf_add_test_case offset + atf_add_test_case uninitialized +} From nobody Wed Sep 4 15:51:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRmX3hhWz5V7cZ; Wed, 04 Sep 2024 15:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzRmX00ZKz4TQX; Wed, 4 Sep 2024 15:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CuhWemC+pMPyJFaK21jNGEEBzNov8s36oRM1GCHf7E8=; b=xCat2HeQ0HJ9WqQRaTdjwHjBw80YBc5a6XhCMp1xLDYfPkqvKPmt4OEmVgTGjX2k2ndPtv hn4odyTnp5zXZY4el65lKUkJbJtV9hKz2xYHekzB3I2stBhbG4rqpNRaDXAPvmJXC8mfrO GbzjFI+qE4jp7UHXTijqujVfrLfEzU7aq2CDx4BfYsxOnN15Iu6ncs4Kf/bE1ztmSZ0rki b6jfz3haD8Enp+pC+bBMj8R044+UF+ivVfJeKVfKDmN+VTMqYlYl5lEeRUCOPP2htU2ge7 9rkmKhv4VPgf/+cY1+03+qz4YJOlyEC1C8lAFbxR27lhdwGG6RuogNJswDpx2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465068; a=rsa-sha256; cv=none; b=bSTwyArravFSi8A+TJgNeP4O0fF5f93SyTepu+1S7ORJJYQiCnSY7GPcveG46R5pSDZO9F Npnn3OPrNaIK7dVgGGw0Buf175fM8Vgu/OUhs7rdDhs/kbWuhVtVHPlIz4MbJubEqkpy0q dYTZD9IAmfaOQo7t7q6FPwj6Ss2EwTuoDWHeJgtRNzEazZNUTLq8kttoYM9s19uDf+26nr VK3UbK1XP1RcGtfO0x2/B9uiSBb4WxH7MOyXzsoYlFCYt9XZBwzbz/AIOrqCJabPKgKpLe C2k5lCBesUmhRhWUPG+ovojD9wij7Q8AavO04Gaq/wN6fZg2Jahn6QnN8nDtWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CuhWemC+pMPyJFaK21jNGEEBzNov8s36oRM1GCHf7E8=; b=aztir3/bhMJoGd3FyCTgX0xqbOOqtYntdt2WVFRQ/63ChI0fvK2q/1p69ttpayRMBCnghW CIwvycuMECWCnJw0O3Nd3FtbI6EhIVCtWz1bFVi6JwJ47B7Fd5d+ZIIN41UmGQrXvAAzpI EfTB482ptjjnXpmNy4Ht686EsYs10SJxsnignah5AgB9RML3ILh68g+w7VyOhmzUC5wsSb YEaxQ2LuM8DzHzxpmf1eTAYTtFduPWIuqG7ur1zaEryHeSdphjhbMgEHy3gKbmQZXNFhuT RSOsmvlOBVQNoSmO0HCGPd5NTzchlSa8pCXH2yrjND4qffNjR8SjlqdCWNtuxQ== 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 4WzRmW5bWxzWN4; Wed, 4 Sep 2024 15:51: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 484Fp7sL015581; Wed, 4 Sep 2024 15:51:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Fp7gJ015579; Wed, 4 Sep 2024 15:51:07 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:51:07 GMT Message-Id: <202409041551.484Fp7gJ015579@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: 803e0c2ab29b - stable/14 - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 803e0c2ab29bb6b715c38e82da4930d46590e8e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=803e0c2ab29bb6b715c38e82da4930d46590e8e0 commit 803e0c2ab29bb6b715c38e82da4930d46590e8e0 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:59:53 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 (cherry picked from commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9) --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index b9013e84ef83..0e0d79d15d8f 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7514,20 +7514,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 15:51:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRmX0ry1z5V7cY; Wed, 04 Sep 2024 15:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzRmV5sJkz4TQV; Wed, 4 Sep 2024 15:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNACK404LNDjcAT9jB3e8UJO+/URFuCaG9vIH11uGLs=; b=gKCtCPxbBVJdVw1eDRxiH11FG0wLl4VwfiyXDY2/+22+SKiqwOcM4cphJouLb2+u1FTr/d kyiQPGUHZLikyS8zzNrORRPCuxf+T/aQ9tghvoGooWY41lEENpkomwfXlc855b2yaxp3pz 611hNRUyHgWa1lFkYD6uHKzWWi+MQfrqHfqBAwi6egbCcvPM2M3IlZ5LtGQtQwq43Rpa2/ 8Uyd3Y3f//EZaIqg31vugdIUuDeBXQW3G+NfHwil2CWWYDJXL4gjYMnkLhrzDV7a9jeEKP URHX+eV70J/rlzlVbbnITIKqmDA01/66+1Pbteg8vQVqlASE+O3xf8yYlC3oSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465066; a=rsa-sha256; cv=none; b=Izxu8pJGz2S4L0hgE0Qeymu/jj/nrB12q+5v8Ukkgy9FaWhCIAMkq8wI9J5P4iWT1Q6dRb 84g0omAzC4To14CyXViQsV1rJjCdreT5xHQvFscgQIrDsozSTAXosebsJYfhQw0VRCAqZv Wc3DYkJRZCpGZuMTzjNyqfF20sUd8yxklPmyogyQH76O6ylH3MkkHWvVulfU6DUzVRABD4 35spDWFumG5uOwtNHzdjUoF+aHCB0W7Hh7OBMhVF+HIILA/pczrUjhGTLNmxC7qlIigsWz uHdSly2bfnXkEqzeYvHiDwcLOS2Es5hdJn3YCEZx3BeiUKzqLF9XlSlgp+yjNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNACK404LNDjcAT9jB3e8UJO+/URFuCaG9vIH11uGLs=; b=go6XuS3gbXv1K6+l76KsBOScxU7+yK0nBEl8I2d0xiiLT5vQWzgL+jdb2jAFKfzqFxnrYZ +ktXeOxsUiYwuO3s59GrpXsX7JUWxsmTF+cx0VqX5YhKXvIO9xUqSaS42ytC7Sj22q4ttW 3o7gLiQut2Dw52NtJ+T93rWbJR5DyJxSzR/wplgArMCFftMfjgAG/traz+sJ1mGCbdaFbN qD2vCE1dSRAf+8CQIdg9rzW42u3jttRBciXFmm2kMHYgVhJ3fI8ji+Xk6fA8ZkI4MQ9jlw s1NyyyWSes6UsA/JCjUWka0FhGEdLhpswgtmrJuDG+3a8Qmf4JkB1If8KswOiw== 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 4WzRmV4dXVzWj4; Wed, 4 Sep 2024 15:51: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 484Fp6Ii015536; Wed, 4 Sep 2024 15:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Fp6CT015533; Wed, 4 Sep 2024 15:51:06 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:51:06 GMT Message-Id: <202409041551.484Fp6CT015533@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: cdfdb3b00862 - stable/14 - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cdfdb3b0086268cdc365174ebfb69e66b5dde0b5 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cdfdb3b0086268cdc365174ebfb69e66b5dde0b5 commit cdfdb3b0086268cdc365174ebfb69e66b5dde0b5 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:59:52 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 (cherry picked from commit ea44766b78d639d3a89afd5302ec6feffaade813) --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index b449e05889ec..b9013e84ef83 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5634,7 +5634,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5675,7 +5675,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 15:51:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRmV5q9Sz5V7tD; Wed, 04 Sep 2024 15:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzRmT3gWhz4TYT; Wed, 4 Sep 2024 15:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eoMaVS5m0cfr401kU6BYu7Ri5+fgMSz9zENCzsnBho=; b=dsetOy6ElzJoTb6MuRpQ98fMaZvBvNXRDab7cIaXIz8rmeSUZW8H2EVevfRO3odp2iF1lc bV8idhXVvVdvoARSsMqaM0HycffdVEiYniesoqBP7cB5GUkpS243muETc0smPXUyEc21I0 hZxbXEYthCtT4Q9rQcw/oVlVUGBxmLcRX/irT7yDTmw16OBHv54BXXPBbpbL+fsQYDAZqO sRIgCjnrq/eDqghuJ/z03+BZv7rtdc4VJu8PytiR2gO9CP1pD6sgb/IOUHJMi2ls/bCsTI C1H/qJYnQoQJNZ5aeTyJkkOmgg5vzpn+txsbI/CL4aO3YfS6mQvUZFidp2DpDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465065; a=rsa-sha256; cv=none; b=gbNWWz+OrxtR5f2UylUKwS4eMTdb6psq8+xDkc5zP0f3+L1Oo0BNpwn0cvj4TYPOBF2EL8 aEtPaT/1uQSDEGNV9Tsqym7C8Gq7AgjG/qmoHm7f1XYbppcQj9zo4NW7/KQD57HJFM+umq eB87g50aPy2KwmWil49/ly78y4hfsmfgpBTVjKibVYyArh11GtEWK5cqPiqZVafBiJlrms gRIhThCdjjBCMSfx+eBmFj/HIbgDyCxjNr4MI+ukSYeeDAMFhmv753zPIGIzEptVflfG7k iGU+NLNwIgxZqA0eGp+xq5HsZQj9y//hZ2eck5qVqwaX4vsZs8ziOTuaoE91XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eoMaVS5m0cfr401kU6BYu7Ri5+fgMSz9zENCzsnBho=; b=tWIF77V1uc2iKmigKyJqxbnn7ymNtHdpZVshP2sfP/3iRRMKDpV10bQ4goQlkZKq0/INNl 7BIPaEynmgsurJqqnxD3BbZgRHD7S6i5XnvXtNzORfKTi8QzGKbtrQ+O6470qoUBo0h6Ex 6ycccv4BIOIRtJXabS7jGWOpGsN/5E2tq8z4Gw6n1i2T9xc0zNCb7CuYGW+42qrVPWxZ6c sBxT4WVZkNobSrdSsxv7zSJvRg/JuO/70eLfTbQJTNUTA8uzf86j3LBTTzDLKRaVtbSG9N aDLtIpRY/KTm/3JsKrTAhUxp9c9jmIKFoCH4HIz9FYTL6JFyJgrIGprNBVOvww== 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 4WzRmT3HqTzX2Z; Wed, 4 Sep 2024 15:51:05 +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 484Fp5sw015481; Wed, 4 Sep 2024 15:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Fp5A1015478; Wed, 4 Sep 2024 15:51:05 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:51:05 GMT Message-Id: <202409041551.484Fp5A1015478@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: 29937d7a1a0a - stable/14 - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 29937d7a1a0a3061c6ae12b5b35cc32b03829501 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=29937d7a1a0a3061c6ae12b5b35cc32b03829501 commit 29937d7a1a0a3061c6ae12b5b35cc32b03829501 Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 14:59:52 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 (cherry picked from commit 670b582db6cb827a8760df942ed8af0020a0b4d0) --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 1d5e13ad4671..b449e05889ec 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5673,21 +5673,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 04846f80e913..db8e748ec014 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -411,6 +411,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 15:53:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRqg2YLHz5V8Qm; Wed, 04 Sep 2024 15:53: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 4WzRqg232jz4VNb; Wed, 4 Sep 2024 15:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=higPZzbVejQtBdOSr3YdKVShRxVkHCTNZ0xe/Iqaa2U=; b=jTH380ZTyGWE5lJ2ihGl/tkGZ44oWX0fLt1GDr6jlYcIEM2KlTajlUZwC+b0p80Wj1v9ut ZehsvHcIGCjyBeQGNzhptxndamxyvHth92bkkPwryHw4TsoyKwVdteSG/WVSsgpyHDmf5+ fw6v1MK/ZHSS31Gpt+8lNqSwo46dyaxRWhSR/xLOxb6NU5kNVQU7eh8OefUAZAp1s8h12B Qhf4hqqQjzwEt8r1juHptyoo98SsCe9PyD+QqG3EkLT03WflIdzrRiTxP31smbVAVD6VUq kOBhpU6zkRhrV+W1bvpMNvunT756bxC/3DULOnxeNEUZ/pZeAQw2yj+LfNSpxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465231; a=rsa-sha256; cv=none; b=Q6wdT0mcgUtO6F7L3EMBtofqzM4ZZnD2zddYNroXiF0HRR1sSkM25NaByC3AhXpeh7mC39 GKs8GHcZxfyTKFBQBP50d4110xFlqmyDI4p0HnrMr6z9aidHnJxzSQNe5u8a8M2cX+LmJn 3B8LpXxzNYhNSgihTWCxNuNR5PLhZmz+r5FZxLbzc34CKa6cBkv+XVfStgxY1Z0xoZO5qQ VY4Y0ot+AvibYlQu+E/AnVxx0WV3hEfxTMCJsnPlruCXkZrrk6jOym/89W2MYYs6l3zfLW 1QiObXk6iKm4iHX3HMrKLtTw3eUWNj88/rXDP+y14lbYc1gcMdhG19HxlgXaIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=higPZzbVejQtBdOSr3YdKVShRxVkHCTNZ0xe/Iqaa2U=; b=tHwRsm8Ffzcr60onOc9nIgmyy7NlgdvJsfd85F6muaxYKXRgqKTwcVzIDtwFMihW36PjDy 8gisa43hYvNmyyWrbPfd+EtNnvYorSg9P2TyDu/bBwzyR1DRY+TTO0f8c2m1DFC2Ezcxys 8kcKzZAyPgNCyTajU7uSKE6MIuQN4Z4YxXeZPiZ2vmreuFGogSDYdjy6t8gF+ZMxkzYgNp p+SLu9Mk6drY1yBcFFVi2j+XMTBMESZHs5EMR9CWD5HAEkpvaP5yYCCCz66wlmsmZ25r5r 41WoD5tCkkZWX5CM5IBV2CPtq/yb/FCWDcGxEyBENlTlT2jB/rxbIZky9NMFVA== 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 4WzRqg1fcBzWlG; Wed, 4 Sep 2024 15:53: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 484FrphC019751; Wed, 4 Sep 2024 15:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484FrpwC019748; Wed, 4 Sep 2024 15:53:51 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:53:51 GMT Message-Id: <202409041553.484FrpwC019748@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: 2553c91f731b - stable/13 - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2553c91f731b12558046454cf30eb83f56fb204b Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2553c91f731b12558046454cf30eb83f56fb204b commit 2553c91f731b12558046454cf30eb83f56fb204b Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:52:06 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 (cherry picked from commit 670b582db6cb827a8760df942ed8af0020a0b4d0) (cherry picked from commit 29937d7a1a0a3061c6ae12b5b35cc32b03829501) --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 7a04a668e823..5635246845b9 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5672,21 +5672,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 9a87345015fa..85f4f6137810 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -410,6 +410,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 15:53:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRqh5rV6z5V83Z; Wed, 04 Sep 2024 15:53: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 4WzRqh35Txz4Vnq; Wed, 4 Sep 2024 15:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRRGkfpeGdjhwjHPXD1z209J9bWCOMESmr4TZOTdhyI=; b=radhar+eIwpJbuB6Eg7ac1lpqDJo92iHBbNkz5ILynQxTiMrH8VSWzl6FeOM3HAJ0rNpC0 TTyE/L73vehBFDuRue5jZ7PbC/nFa9yAfH5U1zzWpdMjX8Ofvr3x+hZ1eNlizq1BUfpHcK BZNTvh3q1IU2tXEpnMx6gXq6sD6j3qdXciHOk4l5AzPctbyPMp4h3FC8rU9rntT2X5FPl4 s9i9BO/YYMZu0eEP/0J85Hv4l81pFmMI3T0PPAtpeKzWDLAxpzJU4ufKmdpJP7JxneoaLV 8efoWDlGAWVJIhDv23IUEQhT0dheR9oRENuJz8M314xRdiSGepOf4c5pkF+Gvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465232; a=rsa-sha256; cv=none; b=sMh3/VjqifsACgt+GMQdbB0qRg31A6pCbd4BQM6wv399i8OSCJTUTrycjcV1bOxYuxgTiT 7V/y3zqnz6dDDmuL6cgKGW4UqhHFEesWniuDWwvmujl4/TPjoIAf3ZOY2MGb3C+uFI2J2e 8cUUU2GOpKrs0rk+MiQZ6AdH4/gbk9TWZqJ1JxH/Yu/tAWiyGTmw92ukIvyRiJapa39tnp waeZFcaVh3fL2rss/a2JQGNxjlBTzROihVeDZZkjAK5A/5WpPRgCWc9zqptK8hlrGYvg0G kWJLMDhvbTDqBK7brrzeEV5ngCyh2Ssd6LvbJANOKpJJ6VuFrb0zm/z2p7vDIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRRGkfpeGdjhwjHPXD1z209J9bWCOMESmr4TZOTdhyI=; b=ajovilMO7T7Dn3MY2RyeXJ8QV5tSQvxNLvCqDTs4JLufde+HJMEQ1uSA2aSNfxTGnAjre3 bmBC51mpPZwmRHfNJz/D/MNSoPNKIEaF+WG/U9x9fg+6a9kq2wTccl204ZM5823Cbn8SmA /T693fAi5TS9GsiRFPswK8WZt/6v4jNIAZjwRdjlFmAeNvlNTuw/k6G4QeCPW9QWfEjAi0 b+A5FozYMOHoiU3r3fT5HVePwjFdcVvJPt3ywIq5ifp0VpD2syAEJnY8JnVtJ4q9qoM/nN 5yTHqf9J5cFXy/ovLgqjRmgerUdipamJS3QFAmGASaviaxT4Hcrl6LmS8SnOWg== 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 4WzRqh2hfGzX36; Wed, 4 Sep 2024 15:53: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 484Frqm3019809; Wed, 4 Sep 2024 15:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484FrqCQ019806; Wed, 4 Sep 2024 15:53:52 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:53:52 GMT Message-Id: <202409041553.484FrqCQ019806@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: b13631a59f2a - stable/13 - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b13631a59f2a303418c0f3f298b33f2a51fa59a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b13631a59f2a303418c0f3f298b33f2a51fa59a7 commit b13631a59f2a303418c0f3f298b33f2a51fa59a7 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:52:06 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 (cherry picked from commit ea44766b78d639d3a89afd5302ec6feffaade813) (cherry picked from commit cdfdb3b0086268cdc365174ebfb69e66b5dde0b5) --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 5635246845b9..f9fec62249cb 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5633,7 +5633,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5674,7 +5674,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 15:53:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRqj4s0Tz5V8F6; Wed, 04 Sep 2024 15:53: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 4WzRqj3r7yz4Vd6; Wed, 4 Sep 2024 15:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=or+Xuuh9j2pqTwqxa8TEadc1+RPhiwUY0oOiDebqHBY=; b=ZNT4QIfigkkAZetx5R7snRewB9gjIisLrRUdX89+FoOD++jk5WILjMRGJK/NtTlD89mI7D hNr949o3NwBwYBmQf7xgy8ckjPE6lD4Mlupf96royN4Mqn/CDPJBeLrQa5/OmU5PRTbTP/ yUy4ARo1SA/V3V54pweaoLNdUT4JE6ODRNi7cnzscfpu65ketMBU9ZFVZMpytWckR0axU/ DQ63YyuMr8sxZSgAdVT68bUe3dm4XmiZvs5WhRhxgCJNmwnAZdkdwHnpwjJxh8SCjyUj6A MF1HIouGOoHNafJo55KzbOiPMbOzwydFe/FQwA24qQ5NBkQWwcdyqyN+HM003g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465233; a=rsa-sha256; cv=none; b=GzHRB/vMjBgp2pfB0ZVdrxPmip3tUqokRZx4gNA+RiaZHXv4El8WCrrEUy/OPQ6iDFvEnp 6LP/VHFyQzEB2F58Rjr2ChNKs+3HIjgTNFGhw53LNah8ZObnWP2pCc6dwtZGSLRZ/hfjKA uIT9idQ4EHcov26Sva9eno7IUQNCKiEmDzrtkloyiVoWI4aalbTCHDMCXCCOGc68+mdxlG xCQJALXb5PpoY1s6yt5R/bktpqkFgs+lvte31r2hRN9Ue600x3wwgxJoMXi0OB1HoYZjaD iX2UHMNwnTvdXkqjj2BXfCwXrRLedgezvxUDGVi1PShW9TH0F1KmQmbymIUxHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=or+Xuuh9j2pqTwqxa8TEadc1+RPhiwUY0oOiDebqHBY=; b=ttkX3kP20gmu8MZWYjIg7EPb1Xb+xwN5gEA/gXVVR0GYHmTU2tSJ8ZbZ/9u0uRQgmtS+Ox icpeR49idLZqXoBY15DjJ+tZJRaNY6KT2ubje9tTTqIjNb2La4+shzcSVKIkM0mDh1/4S8 wk1b3QWCKWlbZywAmCvFKLYB14HMy/3/gMdrL8OWYnQDu+0k5tAZksAWtSzU6h52/Sjhzt Xra8IttOofZcJ7d13c2PRB8Y9FJa3hble6RDw12klXFhE2psHnt+eUKHcevHmWw72MsZN1 PDKMREImpeLtruCgN3xpc7RksFh2OXbH/penNK/C+SCQkEjVdsLsbo3qOZBS5A== 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 4WzRqj3RmnzWjK; Wed, 4 Sep 2024 15:53: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 484FrrST019855; Wed, 4 Sep 2024 15:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Frrg4019852; Wed, 4 Sep 2024 15:53:53 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:53:53 GMT Message-Id: <202409041553.484Frrg4019852@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: c8afc072690f - stable/13 - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8afc072690fd7541159cfe76c544797a5b37bce Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c8afc072690fd7541159cfe76c544797a5b37bce commit c8afc072690fd7541159cfe76c544797a5b37bce Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:52:33 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 (cherry picked from commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9) (cherry picked from commit 803e0c2ab29bb6b715c38e82da4930d46590e8e0) --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index f9fec62249cb..b0f34cafac80 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7513,20 +7513,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 15:53:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRql099rz5V83b; Wed, 04 Sep 2024 15:53: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 4WzRqk53T3z4W0C; Wed, 4 Sep 2024 15:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l1Gix6pYLSkaIibAf9OVYBzFvXJtP/PcRkZRRHXJ8us=; b=p1X+iUL0Zzctt2hFMgHUlvwJ0r6CG7E6F3/dUixV/yRX5IZ0alzHEcLSLc2UUBFmLnSLY/ Q8pbkPnqzEUCZ6rPc3mpQT74qaX4M5Ih+oFWfljCqxGgMQHHOvP5nLDAmqVqNuQHZQn9Uk Th+hdWrN659Dzf4I3MnlR7btDSYhZ4BvC1jrMiOpeZDMjLhhX75gPpN0Y/U55qTN142AiK FcuR9s+G0GTnkELZsZO/4wk2nGvE+CkCWvhpKZouV+v/to3JEaSUlH9rJtI+Z1jQFIqu4O w6diFc5he2dSGdwCaF/O+TRCd0b09FU/GyKQMKHWDqcyduPxOgFv5xHVd4SytA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465234; a=rsa-sha256; cv=none; b=glShQJ8HFPYBm5VDH98vf9QMh0bHNu35EpVs+EoWqdAFrt0sSdk0dC4xQC56qE+cxsph+z zbKbHqCQtJZ1PIlbWq2BbF0hJtJT6YTCj69EL9Xaed1xXax30VhCuNdSyV695A0xF+b+on ICeeg3MbgBa/vz6PRvWoippRvyv7Z7E6WmXYrjANP7SJ5q0co4mHHIXGr+J68G/ow1vqSm KDnZEgDXfYPgKstHeK4I3fv75rIfzKlrSddDo9fVJvVWiUuAmnZJMkZwgwEGfy959DMl/d vL2zNXPFtIJs4XI+2RO9yunei8R3an9dtL2TxnDz3Q138F2zh+uXSpZTJbmQAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l1Gix6pYLSkaIibAf9OVYBzFvXJtP/PcRkZRRHXJ8us=; b=umGdhmsq33UkK9uUwDJ8DVSytdnnHa/z8BSPnVpxpyoGcj5oUtbIxdhqipIyoGM9tmG5Fc WHx3WXcLxv18H5X2KTeV+Bbs6F+ZI9FGe1kCUB1DF7nVxCdSZ7Rin19DyR2uMj1bkSsG7o 0ba9mlQ6Qcz+JQ4b/154gryUE45FYdHsG7ERIDPIoVpupnCv44ZhyZ4lKlBgRBW78DZk5M 799pkfx551HJihKwkypTOyag6Htbd3vzP0BV7rgRRARTnPna0L4L9gjLfgpT5mnOPErqc4 kROBiBwazwski3ZMoC8PTPAyY/1ZYiyS1Mnakmv+3E44V+EzNmq5EDvzqQgFdw== 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 4WzRqk4Sr0zX18; Wed, 4 Sep 2024 15:53: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 484Frsen019906; Wed, 4 Sep 2024 15:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484FrsbQ019903; Wed, 4 Sep 2024 15:53:54 GMT (envelope-from git) Date: Wed, 4 Sep 2024 15:53:54 GMT Message-Id: <202409041553.484FrsbQ019903@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: 62935fd269f3 - stable/13 - ctl: add some ATF tests for READ BUFFER List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 62935fd269f343b85100cc25b0695c0dd548b9c3 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=62935fd269f343b85100cc25b0695c0dd548b9c3 commit 62935fd269f343b85100cc25b0695c0dd548b9c3 Author: Alan Somers AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:52:50 +0000 ctl: add some ATF tests for READ BUFFER Reviewed by: Pierre Pronchery Reviewed by: jhb MFC after: 2 weeks Sponsored by: Axcient (cherry picked from commit 60d717baf2144cf344ec9b47d715ce837b5d46d4) (cherry picked from commit e9329a869c8137b955b2b3487ac0dadabf540bda) --- etc/mtree/BSD.tests.dist | 4 + tests/sys/Makefile | 1 + tests/sys/cam/Makefile | 7 ++ tests/sys/cam/ctl/Makefile | 10 ++ tests/sys/cam/ctl/read_buffer.sh | 226 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 248 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 91e02c4ae7e5..f4b70e543d7b 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -749,6 +749,10 @@ .. .. .. + cam + ctl + .. + .. devrandom .. dtrace diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 3a4cbc13e5b9..802119d35411 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -7,6 +7,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= ${_audit} TESTS_SUBDIRS+= auditpipe +TESTS_SUBDIRS+= cam TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= ${_cddl} TESTS_SUBDIRS+= devrandom diff --git a/tests/sys/cam/Makefile b/tests/sys/cam/Makefile new file mode 100644 index 000000000000..4cc36604280a --- /dev/null +++ b/tests/sys/cam/Makefile @@ -0,0 +1,7 @@ +.include + +TESTSDIR= ${TESTSBASE}/sys/cam + +TESTS_SUBDIRS+= ctl + +.include diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile new file mode 100644 index 000000000000..0e6f39a1a56f --- /dev/null +++ b/tests/sys/cam/ctl/Makefile @@ -0,0 +1,10 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/cam/ctl + +ATF_TESTS_SH+= read_buffer + +# Must be exclusive because it disables/enables camsim +TEST_METADATA.read_buffer+= is_exclusive="true" + +.include diff --git a/tests/sys/cam/ctl/read_buffer.sh b/tests/sys/cam/ctl/read_buffer.sh new file mode 100644 index 000000000000..4a84eb6b9725 --- /dev/null +++ b/tests/sys/cam/ctl/read_buffer.sh @@ -0,0 +1,226 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Not tested +# * modes other than "Data" and "Desc". We don't support those. +# * Buffer ID other than 0. We don't support those. +# * The Mode Specific field. We don't support it. + +load_modules() { + if ! kldstat -q -m ctl; then + kldload ctl || atf_skip "could not load ctl kernel mod" + fi + if ! ctladm port -o on -p 0; then + atf_skip "could not enable the camsim frontend" + fi +} + +find_da_device() { + SERIAL=$1 + + # Rescan camsim + # XXX camsim doesn't update when creating a new device. Worse, a + # rescan won't look for new devices. So we must disable/re-enable it. + # Worse still, enabling it isn't synchronous, so we need a retry loop + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 + retries=5 + ctladm port -o off -p 0 >/dev/null + ctladm port -o on -p 0 >/dev/null + while true; do + + # Find the corresponding da device + da=`geom disk list | awk -v serial=$SERIAL ' /Geom name:/ { devname=$NF } /ident:/ && $NF ~ serial { print devname; exit } '` + if [ -z "$da" ]; then + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + cat lun-create.txt + geom disk list + atf_fail "Could not find da device" + fi + sleep 0.1 + continue + fi + break + done +} + +# Create a CTL LUN +create_ramdisk() { + atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 + atf_check egrep -q "LUN created successfully" lun-create.txt + SERIAL=`awk '/Serial Number:/ {print $NF}' lun-create.txt` + if [ -z "$SERIAL" ]; then + atf_fail "Could not find serial number" + fi + find_da_device $SERIAL +} + +cleanup() { + if [ -e "lun-create.txt" ]; then + lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + ctladm remove -b ramdisk -l $lun_id > /dev/null + fi +} + +atf_test_case basic cleanup +basic_head() +{ + atf_set "descr" "READ BUFFER can retrieve data previously written by WRITE BUFFER" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +basic_body() +{ + create_ramdisk + + # Write to its buffer + cp /etc/passwd input + len=`wc -c input | cut -wf 2` + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$da + + # And verify + if ! diff -q input output; then + atf_fail "Miscompare!" + fi +} +basic_cleanup() +{ + cleanup +} + +# Read from the Descriptor mode. Along with Data, these are the only two modes +# we support. +atf_test_case desc cleanup +desc_head() +{ + atf_set "descr" "READ BUFFER can retrieve the buffer size via the DESCRIPTOR mode" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer +} +desc_body() +{ + create_ramdisk + + atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$da +} +desc_cleanup() +{ + cleanup +} + +atf_test_case length cleanup +length_head() +{ + atf_set "descr" "READ BUFFER can limit its length with the LENGTH field" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +length_body() +{ + create_ramdisk + + # Write to its buffer + atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 + atf_check -o ignore -e ignore dd if=input bs=2048 count=1 of=expected + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$da + + # And verify + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +length_cleanup() +{ + cleanup +} + +atf_test_case offset cleanup +offset_head() +{ + atf_set "descr" "READ BUFFER accepts the BUFFER OFFSET field" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer sg_write_buffer +} +offset_body() +{ + create_ramdisk + + # Write to its buffer + atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 + atf_check -o ignore -e ignore dd if=input iseek=2 bs=512 count=1 of=expected + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + + # Read it back + atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$da + + # And verify + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +offset_cleanup() +{ + cleanup +} + +atf_test_case uninitialized cleanup +uninitialized_head() +{ + atf_set "descr" "READ BUFFER buffers are zero-initialized" + atf_set "require.user" "root" + atf_set "require.progs" sg_read_buffer +} +uninitialized_body() +{ + create_ramdisk + + # Read an uninitialized buffer + atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$da + + # And verify + atf_check -o ignore -e ignore dd if=/dev/zero bs=262144 count=1 of=expected + if ! diff -q expected output; then + atf_fail "Miscompare!" + fi +} +uninitialized_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case basic + atf_add_test_case desc + atf_add_test_case length + atf_add_test_case offset + atf_add_test_case uninitialized +} From nobody Wed Sep 4 16:00:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRzq6LNXz5V8T0; Wed, 04 Sep 2024 16:00: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 4WzRzq5D3Yz4Xy6; Wed, 4 Sep 2024 16:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DFd+l51sUtpcBxafgKxjRd7ggo2B1i8lqOZ2+d5fJr4=; b=lSURc4O/AF6GZenLh9FABxeYjnGP5MU+3an3Wx1mINxSjlOo8CtXOnySgN/9rr/dlcYhAh j+tIYCS3K0mX5lQuhU/4GjqgFxHg99hV099L7mX5CMi7VdISByy7VpvKV7CMi2RdAkFCui CJAsGlzuvZ9fOO6qIOqlKRLxo/9OlhdEwJo3+6TkbzlEk81nL58vBzKsFYIckTyx+DsR9w 2jh4Wd2U9hoi3FP11zl8RA2yA26r4LPpptW7MHL/p15Nt6ODvTL4G0A8aALGkh3x3JASMT EiQhaQcZT1e/xVGr+HDbgzoHgC4MMARaVct5TpZBk0CD3FFlvU/YCjA0vPSrbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465655; a=rsa-sha256; cv=none; b=l1d6sdYGHbbWvitePuTeGWfm2lxtT0t6qLRx0FRSDNE5bzWC4gU8sjkCukgqPh3d9KCsdu EENxXzwmwKdlaZodOPNz0+tJ90k79fbso2F0n/MKVPLjOD5h1sR6wfan5qPrOF24afol6U 4xPVEX3t1HrtKFk5S2WM4xoFjEOY1JTaRhR4Nn7/6AfLb3RS1nUEdzeY12OKjdwUfR2JcR j1GIM70JTZ5YF+oZEQgCp8o7vfDAc6oDPVALhInGdcUGJ+LdFenvf06KN584hJj63I1/0J T6slJe/bGLKHbV8m4+U2CJ0Bsyp0k0SQqLi+qIYfDHxurEDPMIFmV/pgx9PdJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DFd+l51sUtpcBxafgKxjRd7ggo2B1i8lqOZ2+d5fJr4=; b=FH44qjHc/SCozRmUjTv0+wurulgorWLQ8T0wjiFPnC+jIkzTNiKwkSjB+gWsNWYQjIVcy+ zL0Y8BYCgTR8Oy3g7hxG5OoFK3QgJCOcPyMRa0Ef9lb8uAEafwlT6vzbAF4Gy5jurOXyHU +Hq+OGrbBoWlTuqP9ftOKvEWIdgwjKg2c+kQt2Ff8QcxB2CXzP84V5PwFnt2QICwWc34fg QVesjNeZVmM0q/VZbb5cOXKrBH35xyY5WGSldMlJv+q8Op0NkbnSWxZTcXtO597NhDso2c VQwT88ffS+kqjc9bjI7CpkVVPHLn5gFAiQZw8qEfIXGwMAnaaA+R7dgbaHI2PA== 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 4WzRzq4khqzXH9; Wed, 4 Sep 2024 16:00: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 484G0tVG031765; Wed, 4 Sep 2024 16:00:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G0tfm031762; Wed, 4 Sep 2024 16:00:55 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:00:55 GMT Message-Id: <202409041600.484G0tfm031762@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: 2d4511bb81ed - stable/14 - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2d4511bb81ed70d84ba6ed2ffb54e6a138653a63 commit 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:00:46 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit dd83da532c36830a0c0aac624903849262ec6f68) --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 092fcade9d19..cecb4a021cfb 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4292,8 +4292,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4353,7 +4352,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4393,14 +4392,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4493,7 +4489,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 16:00:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRzs186Tz5V8T1; Wed, 04 Sep 2024 16:00: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 4WzRzr6SHKz4Y1p; Wed, 4 Sep 2024 16:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cucw7B6WaTkmXw9UvdKELfcgNDYWvAF+f8MMoqbprGY=; b=quUwN64L16trLEEqPGkm6EbT2yuxE8SLqo7HWApoB0Uboo6q15xmMp+QrqETvXBBaM2ayF ZWNjKGsuboqYchxde64fdIbgOspThqIG+AktK1yICg1vM5yRMpzPHd32w7Go6+qbW7PbFJ nG0N8GpyR1Vp49+vBXtR6wwuXeHj6/cZaAdDQXJVgQviT7a2yjD2l7xmC3ehPnSYNzcagT 7l3U+WiJihJr2xOfDNyKTnrbNjyQHUyuAU31cdTqlpNcb0KJBe1Yq7JcWFjCH9Y8XJwEsx sVJj/AaSFALLqcfTH0p+SaScoZq605oPTLPMTH+0RFf6+SIe5iExBJrBHyQ3lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465656; a=rsa-sha256; cv=none; b=yEdjgQ2niAKuqetGDtUAXkKfrdf3qBcOHfzNzxSSOBEwALQARarYKqmjCBtzWqx140I0cb NycHmUZEOdTw096h40y8EGS/P0OIepOV9MG/603DMdiCWze+R6utKc+fNxhBMPze5hYEoL jIjtxy7avSOZcbyeflQMQkDFGlHw5U9OLtV5GEkH1t3/nvAUZwJCJ7t5sEghdF3gGYOAT/ CQ+W3lvXsxmI6qp34PuV3V+l1hzIAhC8tKCr+e0sF/iU3L9ynebVwqfrAGYG6zyN5EOW+q MAGAyy2eDdBPaN7Md8nzmnXJCHODd+kAcDcXIZlEKVgoL+mmNJNfJ0ZQK6IjdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cucw7B6WaTkmXw9UvdKELfcgNDYWvAF+f8MMoqbprGY=; b=iFMn1MOovjWDn2jecmd7pYTEdqDw8TUUoFyJ9lKZ3zEv1ajyK8+LCNcw4ZD+Xsm+bJBvjE qL4tySslQYFIAx9i5rpDcrvhi/p0eRZIULVLnlOxIJkt/fjz+aKqKwiz6B1tv0CKbba6T7 YzzQCwJgIdxxrj56tFYlsgrr0j6vUqOhbljbo9/xuHN05da0/IA0vfmwGR+n8JNrqbAJ7D zYcsjLOh1eZEHND5039y19T/Yr5zKOoz4xt0RXW/wmts8FyCoLVQuHPb0+0N0YUPxVzHBy OIUss/UQujafbqyGEasyfxIW4xbS8+R5ZKzecC04xs2fJIExlIxvwfcnVfW9Ng== 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 4WzRzr5ns6zXHC; Wed, 4 Sep 2024 16:00: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 484G0u9s031829; Wed, 4 Sep 2024 16:00:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G0u8M031825; Wed, 4 Sep 2024 16:00:56 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:00:56 GMT Message-Id: <202409041600.484G0u8M031825@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: be7dc4613909 - stable/14 - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed commit be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:00:46 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit 62f40433ab47ad4a9694a22a0313d57661502ca1) --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index cecb4a021cfb..35fc87994c80 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4383,39 +4383,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4468,7 +4478,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4485,11 +4494,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 16:00:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRzt1V5fz5V8Mj; Wed, 04 Sep 2024 16:00: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 4WzRzt03mQz4Y1v; Wed, 4 Sep 2024 16:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MqnLlBG48uhohiQjAIB/OgcL6h+8SgHe++4RAk+UoQo=; b=d8M9SR8m6AX0QKsEQ2XF6sW2w66T4P3YXUnFT/Xbbp6N5ReyZoyC6f86Ow3WGDW8jdxlGF InEZkO9OHas4BNHrhNSMOIkb4GM04HZohjFAPCxloOcxBhxswZX50snmDveuW9k1zLfu6z qEEr7rTCu6lDiKOG8ka1vVnXOnfxZ4L3GpDVsAzi0ScfcTSqDiZ/Sb9gm7unuPmEus7YLa Pm6cX6ccJoGjdDhg5mFYfnFUox7z6fWtyn5DLH2KgfRJ58PhjBZQgJW/ndjpuZUsz8So2I 2QWrPbkBTaVfR2iJ+ILIIieEyBEjjuSE2FiYNfesHUJZT9sn1ezpUphtKWDc/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465658; a=rsa-sha256; cv=none; b=rP3jNSX4OSGq2KfMXb/QzdxIbuZCbfm9tX2wNijmzcwsaunr1FBsbnIvzL6vG+fGm2UqUC KMel4Y3zK2lyKcJwvWA3x55jHBZKH1LcNPO7FGiyDsWaWp8Mpc4eAmwqh2DTezpBz2DVeL 4ClY3PTfD4XQdm+VQMLDv5Rp9NoeZIkWcr/ZsfPXOpb+bpE+pSk1pWWi/zxVhkkZYx3pcy uFkJeNQGxQw5KnHVgIsY1MvBI3Ua/KSzsqvtikarRTqTfhdFjeNdEUhWMClexmZOMy7tl/ VeXRxmBCPesP5nns/Ea5ZER0ZYyuKD/5P8NRy1UffSupfULk+66R74kbQ0zGAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MqnLlBG48uhohiQjAIB/OgcL6h+8SgHe++4RAk+UoQo=; b=ZforOvYJ4RaRtHgkYgYB2ic2Q8k74gKnKj7TP0N5noe1kpoYB9qEXzXWCF+/bOMU6yzOaS 7zJPZvFtuEgLz/2ex5qaQKgZkheewVQRCGpyXEalN/m5YEM4odGGsjhFJ+lnLUV1kHi+eG P8p+htz3hIABIgo96JI3bLs6YEnqcsWaWUEiGHYTQf6JCflMY7FvkPcy1g87hLIoRhrLPJ DxCN9ouh9HHSvWGT81i6ZR/87sp7YXic2nIyyi4QY7kjLONRW5O5VUt9fp49fzjwCbgHqZ KPIsqRj9lrl3xYNF4onUxnNnf0IXTbyxEp9FTEJo2r5PKlZKzGbYsCe8NcTDJw== 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 4WzRzs6nxCzWlh; Wed, 4 Sep 2024 16:00: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 484G0vsn031882; Wed, 4 Sep 2024 16:00:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G0vsp031879; Wed, 4 Sep 2024 16:00:57 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:00:57 GMT Message-Id: <202409041600.484G0vsp031879@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: b20ae1608720 - stable/14 - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b20ae160872071fc20e5dde27051792177057fa5 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b20ae160872071fc20e5dde27051792177057fa5 commit b20ae160872071fc20e5dde27051792177057fa5 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:00:56 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8) --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 35fc87994c80..9a6df7ae20ff 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4333,8 +4333,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4354,22 +4363,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4469,11 +4490,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4487,12 +4515,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4563,13 +4599,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 16:00:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzRzv35ntz5V8Mp; Wed, 04 Sep 2024 16:00: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 4WzRzv1Crvz4YBx; Wed, 4 Sep 2024 16:00:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=koM6xc/BcANmrUFf+pDVs0lfSHwDim3YuBYtgrqwwag=; b=pbSDOb1Cd6gDdS3F+nkrOWTKY4z/D4tEOa9iHD0IpjftIwqK3cKStmMaJNJnGVJNPsJBpZ kAuCCMmMUCpI40W4vsDF8tYmENYNguu3u3oc+j0lNGLPlnHLUfe5QTydY1fekpPy6BYzYW 8IAeG5km/Zx4zZsuQqEy94SGo4ocB4TNppuGwINBHEIlpQdpnhgD6fPqqgOZfiByS93vbp pJc2+7WJc4qyFliT/StY9Ov6VbMRsJI2xLCDSWA0Aw/OsR7zsPAfCTAcQYe2u94HdhawaF lTJfcrRvzE+BSiFHoDv3a4nPxViqQV2AUY5E0JQT6o1pcvLsUNu7r9m0DbybdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465659; a=rsa-sha256; cv=none; b=eHkdFStQ4eShHBhcAUdBVIV0pJyrJuQAj6x3RKqg3XhdSxEZIkTgmVWgLDicFYsX0reiBc wCncDN5jVlfFeMU2PJfMKR8x8EWRZklk3UMvUUUGCYssLLra1YXkGQFkgbVCsg1lxPzT5c G0HO7/WJkpHoD8icqDRdxKW2+BitU3qv5mkDLbfEzg9m9yKz1ykQjjD5qcGI3BV8VwthmH ik/Q/JBHnnyl1C59riEA9zsVBvvP7NXxyIYh2DPqLuN6qU037aR8+aUlVpmXekPzlrXnvu eGbRMTkYAqzITbVdZ/p2YJZ1pBMyZ5ymSW5et2aceIaVsaKcoDcBA8+d2wwjNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=koM6xc/BcANmrUFf+pDVs0lfSHwDim3YuBYtgrqwwag=; b=PDIufuWj4GEkj867cgTeVe0WnWjjqqNmmxHMnc/yKIgXRt9PgVSRxLFR9lED2aZBKYtp2X DEylv4XXTtupBI1w/siw3hpm9p/+ohGQ+uF+RMXAuuL8g/ZXPIZcDjNF/ziVTcFLE0O7vX zwsBIIrJZW6NYOpoqCK5yhmRQDfQztUHdjl2ztkSCufgChVCiE4u+aw83qZP6F8uAygv8p egaw7Vtb6JylIfCC5LsNWZUt38hr/jbib6oeEGLwKUZYVXZJY0k53pw6+mWS5mT9yZV6P4 96Dnes7oNyak2h0ezOumPQMQeBYwApR6OKwnJFcK/kyWgj5OV8kpoqJ0xi6mOA== 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 4WzRzv0NmxzX1L; Wed, 4 Sep 2024 16:00: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 484G0wam031936; Wed, 4 Sep 2024 16:00:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G0wMT031933; Wed, 4 Sep 2024 16:00:58 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:00:58 GMT Message-Id: <202409041600.484G0wMT031933@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: 4938f554469b - stable/14 - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4938f554469bc81783998143968ec3eba2a43def Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4938f554469bc81783998143968ec3eba2a43def commit 4938f554469bc81783998143968ec3eba2a43def Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 15:00:56 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c75a18905e308f69b01f19c3d7d613883a008e79) --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 9a6df7ae20ff..2d54850da9c3 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4359,7 +4359,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4407,7 +4407,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 16:05:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzS4n6Wynz5V9Gs; Wed, 04 Sep 2024 16:05: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 4WzS4n5YqJz4bkY; Wed, 4 Sep 2024 16:05:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWq+VLG6wGrlYBVBPQutF9eS5eOuxXHSsDRIx17A6QI=; b=iMRJ0QaXCZGFuOLA4fHa57we1aFVsNs2XIa24Zc/L1tRHhy1HuNw2vrHjI2LUCFEyh+Jr+ 54A60jHo+4T8rCRdTTaJf6N6gayVaGdz+cGnFF8S8thE3UyzV6WfyxwOLudQJjUVr76TRq 2Alb/0/r3e82WYDtsNY+Sbg++HfrBKrLwEqGZB9VjFZEMSqj4+THYbch+rUqn5EnySOGcN eBt+DqUcZoxfKIHrOAypIwDRYwmEsJyVyHq3kt0jCnLUGwqAcCXo1Z45Aa0L1aBVv0Y1NB cnx3ymGJfsnK4PigNpbujhGHobt+iSwJvZcV9aZTsujCzhhvHmoPYIqDmXAhCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465913; a=rsa-sha256; cv=none; b=NVGNzxC7HfaG2TAsCpEEDHFhYThEn2e2qxY9G086nQv+hyXdR/Hxf6CAqT2+CWLmrsIUE8 rpm1MN+WfvIcUE2wtwRtCJdLMIb2WLXsEfHSWw2MLRXO/Z+iFPPHAnTEoT4YEHftD2SsmY jNvreVW3ZJbSFsetx9N4JNMqw6H4vSey7KmJQnMytxG0grzj3d9MSAmwPElXPzpRFq3G2y wGM1J0eWRdb/2Ul4O8dANVHDowQ4zAOKqUjBFVfs6ap2hD7Ew/frSEflWaIJrzaNT5iP+7 KK1yCXXZUYQp6p5y+i2g2eBbnESvuCFAhQ09RRzGucy7MqlMg6Ug7iHc9tAKVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWq+VLG6wGrlYBVBPQutF9eS5eOuxXHSsDRIx17A6QI=; b=kRJJNY1rjwaRjdyCFw5WEnEMWNgFTEvN4wGf5B5/ZYLYkUuRkalKf0aWsJFjWnQkCbmwC9 4pZ2NFB0hwen+48LsvfzW8kIoSldklb1U34nNO/Uk+R9E36S42doOXtmij8NfjyWAJgYBV ObQnBM/uolFka4orRw7APy2WhuuI4/bETqc6GugS6OWYoduFdwmZDVHJOfsEpY4gpkfkTX VAD40PrYrJkNn7STCewm5h68rst44n1iKEt0ETKpMccJutLdgVA6UL4O0kvL55P5+D8PFs xJgqVeWW/pcoFQ5BbCAq10Vaqq0a3dQBFfSC6jrgViV8wX6u48LXS+yXDxdNzw== 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 4WzS4n59HDzXFM; Wed, 4 Sep 2024 16:05: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 484G5Djj039452; Wed, 4 Sep 2024 16:05:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G5Dec039449; Wed, 4 Sep 2024 16:05:13 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:05:13 GMT Message-Id: <202409041605.484G5Dec039449@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: 5f49630fef5f - stable/13 - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f49630fef5fd2358e8bc96d1b5a343d8225d5b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5f49630fef5fd2358e8bc96d1b5a343d8225d5b5 commit 5f49630fef5fd2358e8bc96d1b5a343d8225d5b5 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 16:02:34 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit dd83da532c36830a0c0aac624903849262ec6f68) (cherry picked from commit 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63) --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index d8587c51e6fd..757e3c869683 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4293,8 +4293,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4354,7 +4353,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4394,14 +4393,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4494,7 +4490,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 16:05:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzS4q11yRz5V9My; Wed, 04 Sep 2024 16:05: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 4WzS4p6fDKz4brV; Wed, 4 Sep 2024 16:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jw568edBJ9/926I0L4RREQZAEjUOGJr3ejQOGnlOqHM=; b=PVfTlrVbLFKQBWfGFZTU6xZKfvbB2VmUlEYo/pk6/bdlzeh3u5U2YLGP0yroosaHG9zWxo azE/kATpy0hbLybHTwyIRFt0Pz9pJMJ/Nif2BCL/bi7dOwstjrbusKyFsh9tHtqBHt8Icu RgM21IecozXslTpr2wmbzPktCKwdIzjkWVMQuS18grlRMJ2Y08UFI0bBOJRu3Od+wu/BEx vuZZ8RzgExZymsR3SDA/rHk98ePFdWmU/2L64V1URxNF4LY/Xe2R9lyEsatHZ5JIasozD5 RQmce9lCN6N+8AvCERaTi8R4jGf/U5AO5u7TSIgZceCwC6Ud125fDP8pO+2Q+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465914; a=rsa-sha256; cv=none; b=e9tAo6HhPmsdciGF/cmYzHg9hvgn3Q6dRSG3IiEzrOSK/ypQaEURqXyl1XISA57ABGAMmS yZIxkmMqfj06Lx7mJsVg5SxWweBv2o1t10uBmq4RcHSt0yCyrueoPd7fYiLzTwMWUIF2aS c6pV/6j4GjjNkUHIlglg3uFtyRqbbUloF7UGPiS4SbEP3P8gp/H1upzwKDl1Kj+SFpeFcl VKkm1QqPi6cugbI+Bzeiv1ysiTG2sD8TL7OvNvg4pvrdMH/3U5qKsleH70388n3OuNwfoX pwBGuX6hHCVzvJovxOqteXCpPpRgxWqbO1YE95nsGXYF6Fnd4G2OyBfwvtaQwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jw568edBJ9/926I0L4RREQZAEjUOGJr3ejQOGnlOqHM=; b=uvaq5ankJXc/CuHv5o5WhFYXwdLjGGqHZ9oBPHdlyPQ+us5QxpXBXW5paOlOt7LalDOijp 38pFwPG0+ydQgY352/cQA/UCybhQVLFStCxlR5CUerihdkoHBPLhdXQY9j0qZEhwMpgKZa hFEYikj7ABmjnH5AlHh0BI9YTfjFcRtbntSKzyOlwMN7HueJoyLrDHclRg+73Qe69Op4dB iW3e9SRa29WxO9R8Wem4fHSprgqQ2HvYln6ELjP1zTC8h4fmGLbdq2yAqziTS8UGXPyh3L fzLD+Zn4I/k/FMZz5AevfG13A1slPHOePH0SRvLJ7UcntB6LvxkRHwnzkWEQ7g== 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 4WzS4p6CgQzX1j; Wed, 4 Sep 2024 16:05: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 484G5E4T039520; Wed, 4 Sep 2024 16:05:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G5EtW039517; Wed, 4 Sep 2024 16:05:14 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:05:14 GMT Message-Id: <202409041605.484G5EtW039517@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: 40615bcae9e7 - stable/13 - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40615bcae9e7f41ca857c773e804db9bd7269581 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=40615bcae9e7f41ca857c773e804db9bd7269581 commit 40615bcae9e7f41ca857c773e804db9bd7269581 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 16:02:34 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit 62f40433ab47ad4a9694a22a0313d57661502ca1) (cherry picked from commit be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed) --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 757e3c869683..aac2e505d844 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4384,39 +4384,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4469,7 +4479,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4486,11 +4495,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 16:05:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzS4s4MVSz5V9N2; Wed, 04 Sep 2024 16:05: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 4WzS4s2Q10z4bkf; Wed, 4 Sep 2024 16:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aagOR/76C/ZivaWiCKtVGvVpWqxVb5TxmcNGfB0bxVM=; b=A6pxIR+WU3N/IR8QGBJDWuJE40lYI3+LEdOdeF8I3GzyX7cYJJ/8c7n15afkg6yZHe/FHl Nq6VVaIiC4qMLrP7vTi9wI7ov8t5QRAX5L/Zgu+cgjwBtMP6zN+aW8aocriuyk87fdZyVH nYmri32JgssXxn44qXsAaPyLRPS24DB+AeevkkWlw1sIzpZ5D7T2GEvFRMyTw/cE30jwhb hW6JHM9JGnhcktXl6dkr1KDjQK+I6ac4bVWHoACRdCikvQDo0gaSWgbNc5SqTH3iYnxHyd ABzYEHWrRNfCPbTj4LMrt80Th0An7oPrHadB852m4Fs4R1dLd7zUD+Ps9q9HEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465917; a=rsa-sha256; cv=none; b=WtSXBLIKAq/aex7Ee1Bh6V92z6VMo1uFvNRxg0g8qhmra/HBDDescoo4CK6OMLf52Is/PH jR+O0Li0HHq4LASn6A3wQc2MxhO5NBP+vsHM6DTwxJ4HNfmQxCno4rWh2Ugm5vMio1Dtyw pRKZmohEtNuWFO8wLLQhKqfvfSoCYKhoDoR0ODSr4MMybhurNnPagp5Rhh9yzExvAn9Fou e0xIIwCQ6ysP20omJnVkDxue/zvRD1oZkIZruw0cb2XgYc6n7L/DvS2kusraNyFop8wEpk b2UVk6iTb48aLWKp3Z6i8z0qWHPrwWoxpGljWYCa5qMONZzCjL/pGrwETfy18g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aagOR/76C/ZivaWiCKtVGvVpWqxVb5TxmcNGfB0bxVM=; b=q7pguaFTB6dXc0RPNVCv7KXgd2L/vl4vzkCNYk8P7pznU0U4pgghc7w4NogICBBqusyBQr EnMdmv3yWlAP7PijETXphGldnHM6iVzD0JHo9X+UqgbBaPPe7GpVA7embcgbYwWoS0DyPO 0zZoFTx3Qx8fnsu7K2ZoBgj2f5GW8cCR2l7GrmlewzltqszT/3b++lZVo8iCEexHhnyE2s eSx3ziw1bb0OOO4CeOxDxqnqKxqaaIXrMYwoIfNeASpjVEjKDAipnJSNEsExbYLM3EELWR QJ/dCak/vhZyTnBqLDIaRjaKKYbSBv30zbV7tihHlcpghTJ0poNSXhQqvEXpPg== 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 4WzS4s190bzWm4; Wed, 4 Sep 2024 16:05: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 484G5HMS039626; Wed, 4 Sep 2024 16:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G5H3R039623; Wed, 4 Sep 2024 16:05:17 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:05:17 GMT Message-Id: <202409041605.484G5H3R039623@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: a73a70472c47 - stable/13 - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a73a70472c47877d57d090ef77ae503fe75e9f41 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a73a70472c47877d57d090ef77ae503fe75e9f41 commit a73a70472c47877d57d090ef77ae503fe75e9f41 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 16:02:43 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c75a18905e308f69b01f19c3d7d613883a008e79) (cherry picked from commit 4938f554469bc81783998143968ec3eba2a43def) --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 5d83842f8ed2..23087cf4269e 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4360,7 +4360,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4408,7 +4408,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 16:05:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzS4r2gpLz5V9QH; Wed, 04 Sep 2024 16:05: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 4WzS4r0hjRz4bb0; Wed, 4 Sep 2024 16:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CFwkfNJx/mmsMlfd4+vqyBJhh+3ZRwqnGn7bygydTlQ=; b=PGK0bTbFjJo26vENiAMd9IH/GTd6Wh1+hm2iZh5W+ip+e+qVIHgLztOePKBQ4F4Wsgbupe NQi/JSlCReEOaZphmZFcUqFHR62ZWwMcFjW9DWba2VtiYl3DQNEDCZpo16PmcTEBwz8EIA 02u+3ZuYxNQwk0+QHlY0m+AZqPTIM3sKgbqcHJi4Rj6C49fqi4QUWQs7VhI742+kiUpDe4 kphG1d1thpwEkxATi9XXXYkrOQdKuRg6UKTyrrvDnwP/gGOxybEvd8omJQbbuF4oLMWAHq hYZslerI1LnKMMHkk1qsZzGt3n2fxC74fa7uAuf3N9C4P1HXm+TY59oqgBi/gA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725465916; a=rsa-sha256; cv=none; b=ZpOISv3GBXiRlq8yHYFriXGEW6a/FZKhhCJr/JD+LCudgBiq0DK/r0JUVrAxYLueJhFDOw dU75eKusFSZN24dS7+FtnPWKjcRj7lWZ6vFrQL/o6hyFwswiF0Pd5ailJ0HtmmFHwBhkPy aXcGOX4uMft7H5jVJz+8B/wg/u0qmCOe5UtmlnsEkPnKb43CM+jwg9yUuAjBfk3QDySTaO 0IoyGsd6PniG/jii75c2ivcCeBLjwGrGjksmMk6Tsnqe/NmjonUn2FXzigZ9zzpnB1WqIA KHj16Fnkjl0gAPSItpbdf0KclPhGO+9njAtP5JT9ESe17Loo+8Jzwr06KtcXbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725465916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CFwkfNJx/mmsMlfd4+vqyBJhh+3ZRwqnGn7bygydTlQ=; b=GQ+2o/3G4jj5LzNcZB0BTkhoKrHkmt3UxwP6El9iLSKZgvIXfBJPrH12N29XYKhtqv8Cgh 1UU6a0fILiZIJvHme6cVq1uPtgRoPhLlngSRjFVsCvSixiskoMcb2h/ADjBHuJC9q2JBBd NEAWj+5ZGwosnRL6w2txG6j+6VvQuNPr2YVFcf7J5Cnv4COLEJaFv1LPGegQ7BSIJcObj7 lHCe+fTkDbzKjUfj4EmqekeqdCNGdBriyUwXXuqDsO31CSD+8t3xX14QfSVCIhwhfP03OK yoPSe/2NGtDOUg/Yj6dYRsAvb7F3kRlJrp9CyDPkrs6NA3OG3pTXBbcQdIxBtA== 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 4WzS4r07MLzXHj; Wed, 4 Sep 2024 16:05: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 484G5FSl039566; Wed, 4 Sep 2024 16:05:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G5F8B039563; Wed, 4 Sep 2024 16:05:15 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:05:15 GMT Message-Id: <202409041605.484G5F8B039563@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: 8cf43dcd3db6 - stable/13 - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8cf43dcd3db6f02f8dc3f0aa23965db107190789 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8cf43dcd3db6f02f8dc3f0aa23965db107190789 commit 8cf43dcd3db6f02f8dc3f0aa23965db107190789 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 16:02:34 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8) (cherry picked from commit b20ae160872071fc20e5dde27051792177057fa5) --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index aac2e505d844..5d83842f8ed2 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4334,8 +4334,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4355,22 +4364,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4470,11 +4491,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4488,12 +4516,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4564,13 +4600,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 16:08:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzS8M0xmSz5V9VS; Wed, 04 Sep 2024 16:08: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 4WzS8L6zNLz4ctq; Wed, 4 Sep 2024 16:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725466099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kNIBCDRWwnIHp31x3Z92MxzGtdNXWZ65fWlXodoJW78=; b=G2DyGMjugfIlRXgaFQ3PkhOVeBwvVUjsSH7LbcHqfhfY5cP2cWgZYDkybIQC3yIn6yf+An AafBb3STbH1LYhUKGSbNRav8gfYwm/9x66yklG9MTZlj6dSDrfK4Jx3LbmLmArZ7TSu3AA J0y2WZxJJgPdD1WfsS6DZbF1ZGMvH7e6HSwUl7YqGwU02eDe14QCUeu0VjNaOWgjuCzR9E 3H/XAwDjchmi3xsKzv3yRlKgmj6iq9DbvCzhjuSJUxFUbs42PXm4vH1bFmPIQmQWZhdlWe sEqyKEm+758CqQE5RqwcWNjZDxOUYjuSmoc6lk/nmYeYmEj6TP+XuQZLrTS+yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725466099; a=rsa-sha256; cv=none; b=kEU3xA7orFHpoXKICDDW9A/q+Cy2CRQbrrhr8beUkGcKS1q5ev6B4BfKLjt90CQfBPyNk1 IqqvFyyj+DAI24MllriWHbsVUQu9dW5epGc9frTXxHEOQpmDFpo8SFhRpGJjZsl9mspGHy ULTuxHobP7fGaMCDlL/dGWYd7eL0eqb3Kd6lMX28IXJmJpdT9olkeekGjdmYD4k+JqEkXT Q3iMEEAW5Y0xS0KCrv/VI9p2FW8oQ9dvIMMhnF3b4hvtrq+b23v4XR9jXRNBVbVuH2S6gK 0Vp1BVQSBZ9fX8ouNJik0pg5uI7fCBv7BfkRXhsn7Y7kcWnbvTjWVOSUNem0yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725466099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kNIBCDRWwnIHp31x3Z92MxzGtdNXWZ65fWlXodoJW78=; b=gzfD27McO0ZUcwDBbAANdFw+IOvgouB/RcCLNn73R9dAUerOCcyVcn0fqyppyfy2CrzJ/C TGROhYNKM8S24RKrtVjqQwBJK9OJZFlQqnlMNDxscnGg6cViWDt1H7vW96bEWdxcrVLZcF 3d/rUfPRl4YOy0wmaSfY7cwX+Ot1Ys6pBFLdhLf7srt1blRjz/bX5saEmGsMq4PX69HWH6 zjB1asxx5p1/PKXn6kUROtZWh8N8tPOhRUXHkpLB7PY1B6Ke9m5TG8FLy9SrsgeX6DDCtJ 9+C+l88ifLxPM2dTSNSFzGUeXgSeBnMMbbvqTS9a31PYicsxiucc2ynxV1JA+Q== 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 4WzS8L6Zs5zWm9; Wed, 4 Sep 2024 16:08: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 484G8Ifo040203; Wed, 4 Sep 2024 16:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484G8IW6040200; Wed, 4 Sep 2024 16:08:18 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:08:18 GMT Message-Id: <202409041608.484G8IW6040200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 881886673a34 - stable/13 - MFC: ng_ksocket: fix accept(2) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 881886673a3423926c8b5f0955c4b966317f8ae8 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=881886673a3423926c8b5f0955c4b966317f8ae8 commit 881886673a3423926c8b5f0955c4b966317f8ae8 Author: Gleb Smirnoff AuthorDate: 2023-11-17 17:24:30 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-04 16:07:52 +0000 MFC: ng_ksocket: fix accept(2) - Provide listen upcall and set it on NGM_KSOCKET_LISTEN - Mask EWOULDBLOCK on NGM_KSOCKET_ACCEPT Reviewed by: afedorov Differential Revision: https://reviews.freebsd.org/D42637 PR: 272319 PR: 275106 Fixes: 779f106aa169256b7010a1d8f963ff656b881e92 (cherry picked from commit 43f7e21668105cc5a3c66eae5ecef0203c2df62f) --- sys/netgraph/ng_ksocket.c | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 027aaae4e607..6e12415e449a 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -152,6 +152,10 @@ static const struct ng_ksocket_alias ng_ksocket_protos[] = { /* Helper functions */ static int ng_ksocket_accept(priv_p); +static int ng_ksocket_listen_upcall(struct socket *so, void *arg, + int waitflag); +static void ng_ksocket_listen_upcall2(node_p node, hook_p hook, + void *arg1, int arg2); static int ng_ksocket_incoming(struct socket *so, void *arg, int waitflag); static int ng_ksocket_parse(const struct ng_ksocket_alias *aliases, const char *s, int family); @@ -696,6 +700,12 @@ ng_ksocket_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Listen */ so->so_state |= SS_NBIO; error = solisten(so, *((int32_t *)msg->data), td); + if (error == 0) { + SOLISTEN_LOCK(so); + solisten_upcall_set(so, + ng_ksocket_listen_upcall, priv); + SOLISTEN_UNLOCK(so); + } break; } @@ -716,11 +726,15 @@ ng_ksocket_rcvmsg(node_p node, item_p item, hook_p lasthook) /* * If a connection is already complete, take it. * Otherwise let the upcall function deal with - * the connection when it comes in. + * the connection when it comes in. Don't return + * EWOULDBLOCK, per ng_ksocket(4) documentation. */ error = ng_ksocket_accept(priv); - if (error != 0 && error != EWOULDBLOCK) + if (error == EWOULDBLOCK) + error = 0; + if (error != 0) ERROUT(error); + priv->response_token = msg->header.token; raddr = priv->response_addr = NGI_RETADDR(item); break; @@ -1058,10 +1072,6 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int arg2) } } - /* Check whether a pending accept operation has completed */ - if (priv->flags & KSF_ACCEPTING) - (void )ng_ksocket_accept(priv); - /* * If we don't have a hook, we must handle data events later. When * the hook gets created and is connected, this upcall function @@ -1244,6 +1254,25 @@ out: return (0); } +static int +ng_ksocket_listen_upcall(struct socket *so, void *arg, int waitflag) +{ + priv_p priv = arg; + int wait = ((waitflag & M_WAITOK) ? NG_WAITOK : 0) | NG_QUEUE; + + ng_send_fn1(priv->node, NULL, &ng_ksocket_listen_upcall2, priv, 0, + wait); + return (SU_OK); +} + +static void +ng_ksocket_listen_upcall2(node_p node, hook_p hook, void *arg1, int arg2) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + + (void )ng_ksocket_accept(priv); +} + /* * Parse out either an integer value or an alias. */ From nobody Wed Sep 4 16:21:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzSRB1sW5z5VBbN; Wed, 04 Sep 2024 16:21: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 4WzSRB1M2Fz4gwW; Wed, 4 Sep 2024 16:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725466870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6frMuXMM5woKoR0rAm3z92jqFhIW6aYK017//Ego9oQ=; b=MoMU5Lq576KplmrxYJKkVZAzxNW9VL6SGa1zx5m6U+mYY9sJi3KckE/gd1rA8z39v1jRHk lQMRfl9xO32KJYYja9EanIBOHtTf5DUdEGA5LmzIiM+xqv7poNek95W+zuPvKYFBc+kUYS m1hl7Qhjd7emdcyjkwHxVpgGby5kDJyKxgHhP2i5atr+aggFS8IB33MUcliFC6nEckSD99 zhZjpH3rl8pG86Ru8RkyFw1Wcb5F1KDHpn3bggyr1CpnetD90NwnvBZQFDuGG62hppKWWD F/wmUMJi9yZyBhGLZ5E1dHnGUhxjSqe73Fzja3jK6W+73UM7NWMNMq9NCqIuqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725466870; a=rsa-sha256; cv=none; b=uPIXeEsB5QxosdKypXS4zV2ZMXZileenEx9SvL9Q8moxQL9o2n7HgjorwHsXysHMrtJJiP tjI60skNSFlGtNGeeFjQT3Y01roP1Otoo8/ZYpZ3iCQGla82XROItFz84Z3qCtfHgfzio+ ddncR4URnLO7etyKAawlMIgZiPo82fiyQb1sQ+9tYLortX2kNBAOPXRxLqu5hEv893NsQ7 g3yk126TYffrqv5AXV3SxkEpMMiu9i3tDNVNgvSPxPyxeK3kTuEwfhIWixmAptVngQY/mX lp2JIGO/GyTQyEutxHxndbiaPGyyiuzxT+W78vIWI7QIIZ8KPdQI+ooxVqkjMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725466870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6frMuXMM5woKoR0rAm3z92jqFhIW6aYK017//Ego9oQ=; b=Nx2fZE3cpq19YampjKleVy7K0TItZna4Nc9Ha9uHL1Gb5z9ZMHq/QDojWtUHn0G4Qiw7Ov 5O50RD8LiFjnX2CXDDDcjuh2fDP/bxhwV8TLpWkYAznpymL/hVmL9F+CBNsoMWTNu1TwEq g1SjBh9/3tTDDM30MOyBuF6b2oSxcVhgENfsDriuMGt2naSEp7bHTYOjlps6n0ZF6nCKf7 6/5Bg8Oq1rPZ0ervWmfSQstx5I5sgrJ4T8wRyqC2Gq9AMsMH5ZlMIir4oPkzAzghTgbDQh eit+Ize95xUDwiRbo5VV6ldgNNq0wK/2RPqJ0KlxfKlbwgKkX7mdntT1Y5F78g== 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 4WzSRB0xygzX79; Wed, 4 Sep 2024 16:21: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 484GLATc066092; Wed, 4 Sep 2024 16:21:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484GLAH4066089; Wed, 4 Sep 2024 16:21:10 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:21:10 GMT Message-Id: <202409041621.484GLAH4066089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 5d0ad5fffbb3 - stable/13 - MFC: ng_ksocket: fix upcall clearing on node shutdown List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d0ad5fffbb3b5a71405a47b9b74d7920f9428fd Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=5d0ad5fffbb3b5a71405a47b9b74d7920f9428fd commit 5d0ad5fffbb3b5a71405a47b9b74d7920f9428fd Author: Gleb Smirnoff AuthorDate: 2023-11-17 17:23:58 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-04 16:20:18 +0000 MFC: ng_ksocket: fix upcall clearing on node shutdown Note: imho, the proper solution would be to guarantee that upcalls won't ever be called after soclose(), but this isn't the case, yet. This change at least makes the node work the way it always worked. Reviewed by: afedorov Differential Revision: https://reviews.freebsd.org/D42636 PR: 272319 PR: 275106 Fixes: 779f106aa169256b7010a1d8f963ff656b881e92 (cherry picked from commit efad7cbfdc06e92bcc589a6c0cae2f3bea0d5cb9) --- sys/netgraph/ng_ksocket.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 6e12415e449a..1acd9f78efbf 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -944,17 +944,24 @@ static int ng_ksocket_shutdown(node_p node) { const priv_p priv = NG_NODE_PRIVATE(node); + struct socket *so = priv->so; priv_p embryo; /* Close our socket (if any) */ if (priv->so != NULL) { - SOCKBUF_LOCK(&priv->so->so_rcv); - soupcall_clear(priv->so, SO_RCV); - SOCKBUF_UNLOCK(&priv->so->so_rcv); - SOCKBUF_LOCK(&priv->so->so_snd); - soupcall_clear(priv->so, SO_SND); - SOCKBUF_UNLOCK(&priv->so->so_snd); - soclose(priv->so); + if (SOLISTENING(so)) { + SOLISTEN_LOCK(so); + solisten_upcall_set(so, NULL, NULL); + SOLISTEN_UNLOCK(so); + } else { + SOCK_RECVBUF_LOCK(so); + soupcall_clear(so, SO_RCV); + SOCK_RECVBUF_UNLOCK(so); + SOCK_SENDBUF_LOCK(so); + soupcall_clear(so, SO_SND); + SOCK_SENDBUF_UNLOCK(so); + } + soclose(so); priv->so = NULL; } From nobody Wed Sep 4 16:35:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzSlX3tCpz5VCkT; Wed, 04 Sep 2024 16:35: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 4WzSlX3Lblz4jKr; Wed, 4 Sep 2024 16:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725467720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rT0fo+7HXisVijoc3JJBzHlYX48alk/qrC4+1QkqQDM=; b=uOKYKBlSJU7mSMazSaoaerC9+N+O4wGU6s1qcxfj39++kOad4KfZaGDVjM2pdiRs9I5Dl6 wD9Tt0UaU/aam0V+rZqBAA3Zb3648K3XCkNg+mD9tIHOAj0pkXRgQA3qJwvDwCvw6qh8Ut enJVC1QTovAc7xVpCIC32KjGMUctCXCZUwJQUoyUpUcqudt8WLERJZk2zBX6vBwv9npSoh YqD1XhW5yKpv1Gek1J5hnFvWDKOHzf+UIKCQPkigjLEtZpQHR9RLB72AFVf829X08LRMdl iYeafdy3n+NbRu65MfkmnGQnB9i+B+4/WDLl2YgqLQ7Vv+nSYxuvkdHRhUAVnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725467720; a=rsa-sha256; cv=none; b=lvly6DmogeDxHS0sspzxbH5ItQ+4bn/X0VthgAwtjs4XCuQT8vMrBJJ50N3DAQlSWrJE9G 92p9plJbvEM66K55pFTDJvUsEgQlXL04MztDyJau0yer48hlBzag7UX4aeRMUQIDTblEKL MywlrFgrPPpHECmi7a2aK8XqpF+G9yGtfPwp/jqoQfQ0IGhRMmq7XgE4IBwBlYKkWYHOML w1ubZo/uRzQMEPZb2FDn3G65ZAQZmpPIu0HVH8AoLqJpsdpAnowx7rXwIJLlMMzZ0G6ZmV JUSdlFEIgzbm+jvMjf77nlKd5tq4C8Hf6gx/LlqjjKGvA62bJ9A0rxCxP3I2rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725467720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rT0fo+7HXisVijoc3JJBzHlYX48alk/qrC4+1QkqQDM=; b=NYYlOeL2xtXSCYMO9t0gwCnL+vQPLv0B4WQwLGTMcbQYXtgElXsFPwoc9MddACatSAjwbY gZqgkBRuBZwxf0Uh0ESZumLgJzexlHlGHxnLB3Pp0aYzWaqW+xZrnK4TMwKjMnTdbf1CX2 I0UXzXWB+obU1bwMK/d6bhzniOoRzVoljd10ZT89S381saUO+dDCPHiyTDiUPdN3aWJYrG jO/OK18M4imCl8Sm3IrrGW4H5D/eJTDOzQ31Y1ITElZ4iy1kO0oHF1eJDIDg/9TOsyc9V5 XCwimkiZccLYh1JAy/vCVb08Sjr3jWkZolgRsafYM9GXsUeHTxZNYjW4ZG+/cw== 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 4WzSlX2ycHzY2G; Wed, 4 Sep 2024 16:35: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 484GZKhE089599; Wed, 4 Sep 2024 16:35:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484GZKEe089596; Wed, 4 Sep 2024 16:35:20 GMT (envelope-from git) Date: Wed, 4 Sep 2024 16:35:20 GMT Message-Id: <202409041635.484GZKEe089596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 1ec3289e481e - stable/13 - ng_ksocket(4): unbreak after previous commit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ec3289e481ed004f2820abf9a7d56460459d0f4 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=1ec3289e481ed004f2820abf9a7d56460459d0f4 commit 1ec3289e481ed004f2820abf9a7d56460459d0f4 Author: Eugene Grosbein AuthorDate: 2024-09-04 16:32:32 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-04 16:32:32 +0000 ng_ksocket(4): unbreak after previous commit Fix locking. This is direct commit to stable/13 due to different code base. PR: 272319, 275106 Fixes: 5d0ad5fffbb3b5a71405a47b9b74d7920f9428fd --- sys/netgraph/ng_ksocket.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 1acd9f78efbf..49ea3b1cd1f5 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -954,12 +954,12 @@ ng_ksocket_shutdown(node_p node) solisten_upcall_set(so, NULL, NULL); SOLISTEN_UNLOCK(so); } else { - SOCK_RECVBUF_LOCK(so); - soupcall_clear(so, SO_RCV); - SOCK_RECVBUF_UNLOCK(so); - SOCK_SENDBUF_LOCK(so); - soupcall_clear(so, SO_SND); - SOCK_SENDBUF_UNLOCK(so); + SOCKBUF_LOCK(&priv->so->so_rcv); + soupcall_clear(priv->so, SO_RCV); + SOCKBUF_UNLOCK(&priv->so->so_rcv); + SOCKBUF_LOCK(&priv->so->so_snd); + soupcall_clear(priv->so, SO_SND); + SOCKBUF_UNLOCK(&priv->so->so_snd); } soclose(so); priv->so = NULL; From nobody Wed Sep 4 17:32:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzV1p4rVYz5VJ98; Wed, 04 Sep 2024 17:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzV1p4KSrz4rK4; Wed, 4 Sep 2024 17:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725471166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xh1A6B9fhI9rvOGbTZV/BNkUlhvLrdy3mYztaO5efZk=; b=LGe+W+KbncQNPn31lfy7ItI4H2FQ5SQAFnQp0T9nNYVHgsT+PBor/G0SFXKYbDnjg+t0Lw Jn7R+pdA2FkrnZFianzeDmakV9kMk+EsUwLwVZR7xf/enkjWhLE2oBOyuJV52V3bFVq2C6 +wn+/APsoeuV/VsCn9huLHKy1OZUi6f1BJaaHC7Unl6bBCjx2t21TSxo1doFIKJni/9VnM wkpAH5Jsy/LJbiwA3/tah6tJDmRrdr6CpyEj+CKQmuO5mc3eAQBFTwMiBTYTwKcfmcyQiW qw40qwvFuoFABg9ckSDc7BHGu/JKwEeC2O3bqPptiQd0sbaAts3Y6v1rgBSioA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725471166; a=rsa-sha256; cv=none; b=bnFWpS+yZvvFk8vwJtU2gguYlmGtd4ktMe0UxIXLGAQnGEtuysnRUi16b9yx2kKNoE76WE eMrpdw0kaGGTOsvUxEWAoW9k4CG9b8mptWSErr2GCIH+hRgEE+YiyzUKPgboEXvD+cdeeX gKaorgLwjSAlaghHnXh5UQEllLSn0vqyF/VXA7KnUvAdy3pD2rFGsnI3KDhwUC9I7x1dQC CSteCwerKmSHU1L9zAEZH5drMudFu6L0U23uaKEKeDBEhOTb0OLlNXMuHwKoQvvoatKtgw rJg4dvAt3vDEobWuYlz8c8WFDROMX3mT5Ig6tLJC1XNIREorWZ1gV7SQ+fl1Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725471166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xh1A6B9fhI9rvOGbTZV/BNkUlhvLrdy3mYztaO5efZk=; b=rb8Y6fLjHOM4TgeOWnvLVxY0IsneQ69miPfYk2lKNIAkE8Jyh1l5ZNrHTtVqF94Y559EmB UbO9dpDyP+ftPb21Vr5UKJgvslm98/a8P7InScWVEkN9XjQubBftclg0JC9W/360KoQ1sL lPH6rirzL9/wPdOhStzqUy3kfQa9t8Uz+eC91rktBRL57SCbMDkJlcUq3gU0krc0EUrQvY ATteKDLzI/KEFUeY0onukUIsQMXxhvy+TBudxJz+VF+IdH+WMHGDoyO+Z4YIah4dThLEK/ 2cKuqzJqCb1uWvt608x5P/C5BDXJZ2INUUFx211fuV6MgSzkxuW4UVgl6s20UQ== 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 4WzV1p3wfgzYyn; Wed, 4 Sep 2024 17:32: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 484HWkGL091489; Wed, 4 Sep 2024 17:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484HWkpu091486; Wed, 4 Sep 2024 17:32:46 GMT (envelope-from git) Date: Wed, 4 Sep 2024 17:32:46 GMT Message-Id: <202409041732.484HWkpu091486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a8ddd1926a34 - main - date: Fix a few nits. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8ddd1926a34fc20970d9ceaad71b31fc414b1c5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a8ddd1926a34fc20970d9ceaad71b31fc414b1c5 commit a8ddd1926a34fc20970d9ceaad71b31fc414b1c5 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-04 17:32:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-04 17:32:23 +0000 date: Fix a few nits. * Don't use `asprintf()` when `strdup()` can do the job just as well. * Fix a couple of typos in a comment. Fixes: eeb04a736cb9 MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46533 --- bin/date/date.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/date/date.c b/bin/date/date.c index 3ce9ee3235fb..01797084c0d6 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -382,8 +382,8 @@ strftime_ns(char * __restrict s, size_t maxsize, const char * __restrict format, bool seen_percent; seen_percent = false; - if (asprintf(&newformat, "%s", format) < 0) - err(1, "asprintf"); + if ((newformat = strdup(format)) == NULL) + err(1, "strdup"); tok = newformat; for (tok = newformat; *tok != '\0'; tok++) { switch (*tok) { @@ -405,9 +405,9 @@ strftime_ns(char * __restrict s, size_t maxsize, const char * __restrict format, suffix = tok + 1; /* * Construct a new format string from the - * prefix (i.e., the part of the old fromat + * prefix (i.e., the part of the old format * from its beginning to the currently handled - * "%N" conversion specification, the + * "%N" conversion specification), the * nanoseconds, and the suffix (i.e., the part * of the old format from the next token to the * end). From nobody Wed Sep 4 19:13:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzXFf2n3Xz5VCFs; Wed, 04 Sep 2024 19:13: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 4WzXFf0R8pz42jN; Wed, 4 Sep 2024 19:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725477190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYwj3bBksLCSLBcIZyfSyudCS/UMSKbCiu45It6uNPU=; b=MndEM5M06CoNZUsEC4M2ROCuBaJC/hQr7+KObeDSZtZLrnpwTSSBGOuLQGsPJWJVjbqc9Q Nr6a9BrJ16pM4QaEA+5WmWPLiwVp611Q3QPuXpVoPuC19qD3tjzZe+WhoIn3FfkkR9N1HQ slqSkSgfr17aW5vtayq7iHBtkW3z0DfwVx8p2lN7nDyms2oNFMA7VZrHkQ+FicVrZk4RH+ Aaod4lhMTf5MddT5ZC3fnYw7w5ROwZ8G1KpQMsBq+BlPjlT0vX/jvs9vDhAoDc3Yg4niXI /TtqPg2P2NewcBWEOLDucalbiOkbpDlIDpP2QmioBzisg9jviFjqg/nu5GTW+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725477190; a=rsa-sha256; cv=none; b=sG1LuUszjOAcTZKJwkIUI5HlFnfL+9cVaKRdlDgJ2HInOaxS1McCbrWU1EXzZi98tonlyA X8J/p9QAlxhIvcWOtcYR/GKOLKXPnoAHoxTUQFiZebNyiXRzK0dMDJAwc0hXIyqmZhn7sy 9hRuwYrLEtPdmJ9HOSRsHg4yzcRTD9JZV+x7Xv6J04uzhSSaXyulhKpkER9dJNoPHg+Gi+ OehKx0Vf8Ke6/jCkvAuPgp+mI7OL5O/5jlFxNTjU2udY0G32cvApNEZUMkHZxosK0uJPmg jfsfIzC/RNCvuuPXo00RWRjMeZ0tix7ym5qth3v7gMKtfXKeZZQhgnqz+UgoKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725477190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYwj3bBksLCSLBcIZyfSyudCS/UMSKbCiu45It6uNPU=; b=T5YuATZfVV4NyEpNUozvpifKhTvrDY5bwhMYtQTYIbWFPaGy/vN5/s+baR0iArakLE0m2i J3RkntOFoSwRMKEN/S2WNaYcC6XaPOXTdfemFfNWIUT05a6CQkE9t7mRJWRSPe8gdaWCNg MBOd9XcHTZtMUhawY6PPQT5cS1TL5Bagm3r5G0DGp9qKTIBbRvKm+zRV2SaT5VoFzwCmvv KpOGHL78blWM85oHqhNgHqxuQGJXXKhtye7HmVb2VEDg/USqdp4Jkat5bqwNlTU1/DWCoE Ag/P0NBgpCrqdwl6veS6/HQZNOw3XY1ZgYOtN11ZSPSQriiNhOSNH99MpZtAzQ== 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 4WzXFd6kc9zcY3; Wed, 4 Sep 2024 19:13: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 484JD94K061200; Wed, 4 Sep 2024 19:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JD9wM061197; Wed, 4 Sep 2024 19:13:09 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:13:09 GMT Message-Id: <202409041913.484JD9wM061197@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: a8d0ba483332 - releng/13.4 - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: a8d0ba483332378e3ecfbd093f2c9a09ec966ae5 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a8d0ba483332378e3ecfbd093f2c9a09ec966ae5 commit a8d0ba483332378e3ecfbd093f2c9a09ec966ae5 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:10:18 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 (cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071) (cherry picked from commit 2e7f9244ebefe019ef016a3a5b47c4562850d1c2) Approved by: so Approved by: re (cperciva) --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9fd233e1f1d1..41d262a18c9b 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -997,7 +997,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1090,7 +1090,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1328,10 +1328,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1358,10 +1358,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1391,7 +1391,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1438,7 +1438,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1505,7 +1505,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 56b818691660..e399d610a7ce 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1302,7 +1306,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 19:13:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzXFg1hxMz5VCWt; Wed, 04 Sep 2024 19:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzXFg14Gyz42kj; Wed, 4 Sep 2024 19:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725477191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8TCoMRT9T9P6/qzYnUED0FczEWdzSsvt32D4SQqPM6E=; b=rhBw0gDDWGzzU4zAdmvJbWg3CQLDPtcsLli8bk9EeZGqc5NLzyS+EwgvkwXhCYkP951xNQ zTiaGlSS3Ikk5hHAniNcJtlcCXgUd3/QjuOQ+He6F1L4vlNDe9JuvVwaIeq/tksu0G12aj YB7iZjNMKNlxNwtJzD3jiX9dIPNDkzeVfQtnFgBIJn35AXv6W4ndKb9R+hVZMHnZtN0VF+ 5O8B1Ouz77bfrOhmQnBLYOOmkqCWVmlp9VB/xLPGKetJi8tE9EWN9oyRmNf5mmbbEjVvUq xBQN10QqSAGR0MZRVMAa8woGCA7EFo7dNct9M0L5bnNeN8fhD6kdWn/USpaYzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725477191; a=rsa-sha256; cv=none; b=KwGqSe1KCY3MlAYgNHhTSYtSZ7ekyKIL/AG73288/TxUPsRbmXPOYfiCNfNGlx2D1jpRES CpCozqZ5IosT2S9VAMTCAAP6MY7+8tDffapOon5YZhD9JF+QPslvVGoER0zKSh1IKcKdx0 yyBsRUauJidG7x3Ra4PiuoTkaaneQu1b7o1AwPZvLUN5jeNUrC2nfT8ZaD6jHk0PHdhvH+ PBlWLZM5HsgZeViNTnkn0nP6yRQCx5g9zwqvSGyXG7e6i8ZafaXA1WeJXwFuG2UuTLubWP FIpPuos44cBdEzIjxll5M4Mkxmtw9FQwQ1OgcysW+vHxW83fMoCKXgJgLnCewg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725477191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8TCoMRT9T9P6/qzYnUED0FczEWdzSsvt32D4SQqPM6E=; b=JtZkmbg6TtXSTNX6BduTHwzziHgRTDEv4wPIY54psP2LV3pSc3BUfNJ08akAa+yqL47VyK SehegjzMawlleQkkGx1qfzhMf8wcbOz7NQa+v4pa3mGOdCIdxn2rIu8VK1ZIbCOP7Km0L9 KSwmT03WD7zdC9r8McSoVRBgWblq/eyA3esY0TrjiI82SH1QGKr47PtLsyf0bkBjo3DIen O+UGiSDvB1cgXm5jSkI6H4DY8Wohi9CBlsAm8877MBkR/XNgSFH9Y0zEx/y3KLFx/0D0Ri IXoBN7bApZMZWQzmJm4O+uY7D8uukD8+ewXKRbxseRPi+vEhjAZpai0Os1A55g== 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 4WzXFg0cZRzcTr; Wed, 4 Sep 2024 19:13:11 +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 484JDAQl061248; Wed, 4 Sep 2024 19:13:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JDAvL061245; Wed, 4 Sep 2024 19:13:10 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:13:10 GMT Message-Id: <202409041913.484JDAvL061245@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: 3aa9be7e3334 - releng/13.4 - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 3aa9be7e33344c0cc3f50062bac4926cdb49d36d Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3aa9be7e33344c0cc3f50062bac4926cdb49d36d commit 3aa9be7e33344c0cc3f50062bac4926cdb49d36d Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:10:30 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 (cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae) (cherry picked from commit 03bef9971d73621e1703a0bad41b598bc2fce9c6) Approved by: so Approved by: re (cperciva) --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 41d262a18c9b..cfe168c38026 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -986,6 +986,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 19:53:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzY8h0qSFz5VGSX; Wed, 04 Sep 2024 19:53: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 4WzY8h0CRYz47rq; Wed, 4 Sep 2024 19:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RALGbj6gZTd64GwIuwsjvOhQuu4N3uw+VFGGvWGiCDY=; b=KjHq0oOH5IzK3eBwnzTWRvyFEjsubwsKKI+pUKZgAcsvIysqaqhpytnhEaTmEjAH9QUbtJ hZBrk7z85ue/8WwqPWiJBvj6bVZthmuxrn0dVWluZ5vc8spsICOGpR0aaaANILXVgsZLnt 2M6fAfniREGPxHeAvPR6tGKY7FWRXVIp+zwqgQYTUV/typdoTLfYpX1LRXXXQvcQ+LnFgc LqXhQEZtohAtMcTKUxKKXW4lqrFPz+j5j7ClJOaMUZrEfc0mW4AH6YsFhAUCnCVj8n/5Dz oqpUQcOXoNFUEMSKcI2qUT4ZJaIK5tuvuufmqkX/dJiSJmGL2qrnDXV5sjMwkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479636; a=rsa-sha256; cv=none; b=n545i7JWZhOfXJhaTKQljpQW2s2SR2K0WsZCf8quyiQIo/bgSY6O2x37SXJwGuhKTJiFOa o4EO/DSKSgM1ZJS7ybeaZGWfVKACa9KJa0RIvPJ8UYrA0ZcGhjaBgU0NBbkfcFdAH84ABF jp/vpS9Y7WjMGk25ml9j/cHf2cBOHsR05yAhCeQmMIPBbM7yVI3TCBRnQb+qbnYWfNL3Lr bqbaDwgCUYmipOx5mUPUPtSwXQvrUD0S5MJu8teuZajnhAOKJyf8PB9s/Lkz6lut+NKXLh eclBIBP5yfzAOPN0d8Ve9rOIKVpyrqzozjvkKZUKpd4GuKfeI83LzbItqYoPOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RALGbj6gZTd64GwIuwsjvOhQuu4N3uw+VFGGvWGiCDY=; b=uYk+dx/hjmdYuTWx1LGKJSyLnBrFZEZ7EMfujsmXnA8CjFqTQuI/GM+9uOwZf1QbOqQ96A eMdBtWvp6WDADihFptA2Z4XknHZH1zaYXmbb0qs+GOwDhu08+K1eAVjYaW8lffkBvo6gbB AC3CNZ2Exi3tuctRv7J1nGztgGmr1x4yZZ1X5bCY4FRcX630pdjMw6Ez4d84LiewdZF83R wnu4lXR41eLA7MR0sCzBbvKi0JSlFtJN5JOKdZyL9OWPYVEVEivEGh6hHdYvoU3NyeRi5M z5UDSE4krlQrMc/UglX4kjgoXXdfAFsDN2NMLCGePOGfeJlMbbxzo6NjNtUHvg== 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 4WzY8g6wQ3zd8Y; Wed, 4 Sep 2024 19:53: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 484Jrtej028811; Wed, 4 Sep 2024 19:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Jrt5E028808; Wed, 4 Sep 2024 19:53:55 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:53:55 GMT Message-Id: <202409041953.484Jrt5E028808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 77eb877714d6 - main - grep: Fix various bugs in recursive tree handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77eb877714d69ee0279d70eb3331920fba90db95 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=77eb877714d69ee0279d70eb3331920fba90db95 commit 77eb877714d69ee0279d70eb3331920fba90db95 Author: John Baldwin AuthorDate: 2024-09-04 19:53:17 +0000 Commit: John Baldwin CommitDate: 2024-09-04 19:53:17 +0000 grep: Fix various bugs in recursive tree handling The -OpS options were effectively ignored due to a collection of bugs in the use of fts(3): - fts_open(3) requires one of FTS_PHYSICAL or FTS_LOGICAL to be specified, but in the -O case, only FTS_COMFOLLOW was given. Fix this to use FTS_COMFOLLOW | FTS_PHYSICAL. - The switch on the entry type returned by fts_read() did not check for symbolic links, so symbolic links fell into the default case and were always passed to procfile() even when -p was given. Fix this by adding cases in the switch statement to explicitly ignore FTS_SL. - FTS_NOSTAT was passed to fts_open(), so fts_open() couldn't detect symbolic links when FTS_PHYSICAL was passed, instead both regular files and symbolic links were returned as FTS_NSOK entries. Fix by only using FTS_NOSTAT with FTS_LOGICAL. While here, fix a few other nits: - Treat FTS_NS as an error like FTS_DNR and FTS_ERR. - Just ignore FTS_DP. The logic to skip descending into skipped directories is only relevant when a directory is first visited, not after the directory has been visited. - Use warnc instead of warnx + strerror. PR: 280676 Reviewed by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46255 --- usr.bin/grep/util.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 936abc41b3ef..4e1c44b442f2 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -136,16 +136,16 @@ grep_tree(char **argv) /* This switch effectively initializes 'fts_flags' */ switch(linkbehave) { case LINK_EXPLICIT: - fts_flags = FTS_COMFOLLOW; + fts_flags = FTS_COMFOLLOW | FTS_PHYSICAL; break; case LINK_SKIP: fts_flags = FTS_PHYSICAL; break; default: - fts_flags = FTS_LOGICAL; + fts_flags = FTS_LOGICAL | FTS_NOSTAT; } - fts_flags |= FTS_NOSTAT | FTS_NOCHDIR; + fts_flags |= FTS_NOCHDIR; fts = fts_open((argv[0] == NULL) ? __DECONST(char * const *, wd) : argv, fts_flags, NULL); @@ -154,15 +154,13 @@ grep_tree(char **argv) while (errno = 0, (p = fts_read(fts)) != NULL) { switch (p->fts_info) { case FTS_DNR: - /* FALLTHROUGH */ case FTS_ERR: + case FTS_NS: file_err = true; if(!sflag) - warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); + warnc(p->fts_errno, "%s", p->fts_path); break; case FTS_D: - /* FALLTHROUGH */ - case FTS_DP: if (dexclude || dinclude) if (!dir_matching(p->fts_name) || !dir_matching(p->fts_path)) @@ -173,6 +171,17 @@ grep_tree(char **argv) warnx("warning: %s: recursive directory loop", p->fts_path); break; + case FTS_DP: + break; + case FTS_SL: + /* + * Skip symlinks for LINK_EXPLICIT and + * LINK_SKIP. Note that due to FTS_COMFOLLOW, + * symlinks on the command line are followed + * for LINK_EXPLICIT and not reported as + * symlinks. + */ + break; default: /* Check for file exclusion/inclusion */ ok = true; From nobody Wed Sep 4 19:53:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzY8j1jhNz5VGn1; Wed, 04 Sep 2024 19:53: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 4WzY8j19g7z47wj; Wed, 4 Sep 2024 19:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zor90OcuWJX0NMDqyagalpYc8a/eJ3kfaD3XOvDRaJA=; b=XJO+PTHHq5HcLrdfm2i1w2UUbU2fYW5vx6nJ9J51hm6pVuQoupb2xyu74zz6N4TF19LK6W JgQgga8ZTnsFeuLqVbPAdynciFNJViW1JBn3plMhJ86xSutOqmZ112f86i6eoTAvbwfjmd 7lSws08phwrU2B//WwsLjSjDwO3d/W7gXHxzHzSC9733zuNGIL3tR38kSxxFQgUTuEpGbQ G7GOQ/CHEsYNTg41bo2Tyq6M29A/hSAlffeXOyZU6+oLzxNczBuucqwNi4XbVZ0orq9Jzh SqKHeJFZA4hK+UbMNwhPYGpj5PBH2klDyUmDERo8IJQfLNrJt1+bWNXCqSZxnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479637; a=rsa-sha256; cv=none; b=X/IKFBCoKg1TrsFZNLg/UdaogTuIwyAHbIHDD6SNsgfJmYsaVQd5wPYM1M9zQVU3c5qsF1 V+c4UOICWcW86DMHDeucV/A0PA7ZuCzZIJ1DusCxC4uqbklODXpabIdPx+O3NGa/yeVowl Fd2EYpExEiQu7bsVtIkiWBn6jaIQcMRw4EsWL3G/5RVQ83ugxHTqC1THPxz6BOz/zWT8lo WpGiV0uU6H+vn7sml08/OMSvVOZ9XtRg8FzS9cELyZlOiJ8egkVN+KSxn5knFN46Idh3ZN dFhoM6ZGD1KGhEEmAspnrc9wRrWEeHeWoi85a8zld5rrKOuzWCGBCSZ/xjubsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zor90OcuWJX0NMDqyagalpYc8a/eJ3kfaD3XOvDRaJA=; b=TXVODpwrS4RR0F/WzWpyzMSmHpRDHE7iTwojzOE2QdwDxQE7NWmpoABwiQZyWuAjIJJLpV grTNypMLGiyRqhJeNVDfcLpHGkETlfSdIFY08Wyzgrkt/3Hke5LmqvrCQ1GwATB0p+u4dy z/HyjEJWNW6Ch/NPPkLqK3So8pufOVD8HmHDpIBAapPbeP+CNFs5j/9wGtZECVFdlusYLH 2qiGCrlQkw8wPuQ3mQ16f6DcqCdu2q5soAxz5pY8Xsk7TyPCOWyCk7wsHpGPy2GPyTuhZ3 QJH8k7kVmSliG5Fs2dcVH0T9QGYzw9vRGzqEH+1o1ot22lA6JyRZsYWFBIDqog== 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 4WzY8j0n78zf2n; Wed, 4 Sep 2024 19:53: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 484JrvHd028861; Wed, 4 Sep 2024 19:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JrvPY028856; Wed, 4 Sep 2024 19:53:57 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:53:57 GMT Message-Id: <202409041953.484JrvPY028856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: fc12c191c087 - main - grep: Default to -p instead of -S. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc12c191c087b63e1204fee210ba76082ea40b96 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fc12c191c087b63e1204fee210ba76082ea40b96 commit fc12c191c087b63e1204fee210ba76082ea40b96 Author: John Baldwin AuthorDate: 2024-09-04 19:53:22 +0000 Commit: John Baldwin CommitDate: 2024-09-04 19:53:22 +0000 grep: Default to -p instead of -S. This matches the documented behavior in the manpage as well as the default behavior on macOS. PR: 280676 Reported by: RadosÅ‚aw Piliszek Reviewed by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46256 --- usr.bin/grep/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 9f960f74dbb6..feaf17d7c1e1 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -112,7 +112,7 @@ int binbehave = BINFILE_BIN; /* -aIU: handling of binary files */ int filebehave = FILE_STDIO; int devbehave = DEV_READ; /* -D: handling of devices */ int dirbehave = DIR_READ; /* -dRr: handling of directories */ -int linkbehave = LINK_READ; /* -OpS: handling of symlinks */ +int linkbehave = LINK_SKIP; /* -OpS: handling of symlinks */ bool dexclude, dinclude; /* --exclude-dir and --include-dir */ bool fexclude, finclude; /* --exclude and --include */ From nobody Wed Sep 4 19:58:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFq0y3jz5VHGf; Wed, 04 Sep 2024 19:58:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYFq0FQFz49Cf; Wed, 4 Sep 2024 19:58:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljX3bqREJ5F87nLWcC07zBL/hrrEQnibWWa0e+jgeKM=; b=TEB4/YQS+MAiIw4zW3qoG/KwUO5dbNh++45cBCv8nqZTMM1JNKeMeZt9enpoYKx2EXXvYY wtXV2DNVuTqZjr5ofb77OldOhBsJUny4aDSssqwVbQcsCaJE6aqMe1oPdCJ7O6fot9ysuW szzx2bmzfsDRUfQYNFB9RUhlT7She/KEsRL8vMFQkvNS/stqPtDGkT0+Bm4Sv63YUjmb3z 1zuC/3unt7KvTOs1yMyCYrOUTSqykOJ6TLrMNx35r2K0/QkiwfBSlOuNRX6svLx39+qStx OJBvw/Em8R9iUxLYVOjZQKoK5i3IwLEefjSvze/41wlmG3vdfUzytxUlDKcIaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479903; a=rsa-sha256; cv=none; b=Iywm+wHMQTdfV5aJMHQuidEzpej+gCxITWE3ftsyiBlP6O6vKdAYaHYzNOuhAgQpV0Bunt sIcUR6vo+LSAJgaiaszuwi5f4K2yMSC0aefoju9ONB983OE0/S1SmK3zBrZZPODz17BoM8 /Vbfl3coaGOQaMHIixcXYlH+CefIiPHFo7HyIWIIi4wtkTFtrYs9EteM9D+w/29en+3G4Z yX6sm2rOD+F+2cuVEDCRQHHhPBpd5KNqQYhYSyFUuHclA7fQXqGU1hejH7t4J+SeukmuHq 3q7Tz0EWBJj0QwEaQAVUKMcszVI5RcE3G/+yZbp0biEn5xQ42PU9vEsNgXnbeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljX3bqREJ5F87nLWcC07zBL/hrrEQnibWWa0e+jgeKM=; b=QfKkgsQ1ujg8ZKkXkshIOXgiE7Z8d0b0fdQCotcDWGaKeWN79LX1wWgvl/WyGKJg4S11l5 cqZ6K8UC9/TDqtXmregxEr8JL5YaXDjxnvN9EYYcKqCzct0idLrhWvP6w0xLc3RGkDWSak IC0/IBOVBIpOwoKfDiihrCeK9Ham86PRTruKUdRbr584gggPOMAK4nB4GIpX6jdq8szWow 02csEBIu9YUomhFmowBv/W+JB3SbyA1IS0V8U/qNaMw7zQ1aPzBZ+jXbhNwvmTiF12fxNU 3lBNwpqvt/DbShhMOvq6arpmpViB1bBUkjtMZ6TKHOfLwmqVO1qi66XYxHV72A== 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 4WzYFp6yNjzdL3; Wed, 4 Sep 2024 19:58: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 484JwMeX029935; Wed, 4 Sep 2024 19:58:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwMHt029932; Wed, 4 Sep 2024 19:58:22 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:22 GMT Message-Id: <202409041958.484JwMHt029932@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: 29fbeb5c59c7 - releng/13.4 - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 29fbeb5c59c7cadd6bb3b9a1dda3441689ad5eb6 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=29fbeb5c59c7cadd6bb3b9a1dda3441689ad5eb6 commit 29fbeb5c59c7cadd6bb3b9a1dda3441689ad5eb6 Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:13:45 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 (cherry picked from commit 670b582db6cb827a8760df942ed8af0020a0b4d0) (cherry picked from commit 29937d7a1a0a3061c6ae12b5b35cc32b03829501) (cherry picked from commit 2553c91f731b12558046454cf30eb83f56fb204b) Approved by: so Approved by: re (cperciva) --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 7a04a668e823..5635246845b9 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5672,21 +5672,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 9a87345015fa..85f4f6137810 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -410,6 +410,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 19:58:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFr1tjCz5VHF6; Wed, 04 Sep 2024 19:58: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 4WzYFr1HcZz49Tm; Wed, 4 Sep 2024 19:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BHQ5xyZMsxroWYqXAtd9bme7wz3qQ4M1GNq0IdgeETQ=; b=DOaYVRkyCQvgbCDs/bx23DP0WwFSiBhkeyQD2DJOlqCSdnYa4HgKSdLDNnstE62kCq5HMY 7dRU3QBSp251WhcimAdF8gQHwqueXV5/28BZxCpTWL3Fkhd8FbjU+A2oOlqpRbDuCi8W1l eIfm2RrrBB/yGB7UvsTV3sLA/V0rrjrhr+B/ZF9+9Wxcpu6gB7h3uNA4AEiPH2Z0djQFpp KmywAUa8BQ/StVKbwqsHbHx0creBVGimjTBGCgBzeJ1ezGRrMx3FgnmbCd9FzBSQiop9pf Ms7HAa+9IFCwq2IF9sb6eaBA15rBx4IJlbbdoi07A2nzBSKTvIgahGI+DZeDaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479904; a=rsa-sha256; cv=none; b=KvWDeK5fzwFuaxWZ72/Fhx3k/TZ8kpv+I8blGg5XNJHOmQ2fGchAMzSP9dEuKx47HuM3R3 3v7FIbhPN8DqL2UQB7/ikiIf6KBH/DzeoGWyonV6zAVefnbh1Y8OAHhF0LlWSQtR+lRvh3 hj9fLZA2afB1itQWgJ9IE54d7tppgxYkrPokcnXbIknChzchLbO5+BvVVPQ8bwZax4JwgS MjKN5hwLZjhK5YaVdw1DjGVUNVgIhBNhKy5oiHNtHeI6yixqxfHTwPd9shVGFPyU9djaCd +S6G9IH9whvwrTd2je/5YMZfYPST0iCjcOsiVo6Wg0nUx3tLTTrYPIICeFu1/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BHQ5xyZMsxroWYqXAtd9bme7wz3qQ4M1GNq0IdgeETQ=; b=qrcL/N3+nRMZ93ZRjCBprpeiOvJICEuDUOZKVjk1yC/KccOsHUN+A4vtjjc7R36F685le6 37D7pb/HAdOiVnm/YZYlPEIt+02XIiiukfxodAWQdXmijMw6XTIwnP8ansMe18gY8Brgl6 7HZHSHfCD54zKhxiziAYbu2VG2So7FV3eFKxS/yb80SMU7WYzMNXNVn73VYiLha9HqSX6I Rz6ptASX4D9mZEhx3RLuajVc9Qhmr4UT74ljRmhlox3roNosZnP3FOiIV7u7CyCqw9yLQr P6mTCz6oSlwk5ux3CVxNJsdEH2THeva6pXDr9+3WJoFbdvQpNzR1QOBOImlb6A== 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 4WzYFr0tdZzf0V; Wed, 4 Sep 2024 19:58: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 484JwOf1029993; Wed, 4 Sep 2024 19:58:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwOda029990; Wed, 4 Sep 2024 19:58:24 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:24 GMT Message-Id: <202409041958.484JwOda029990@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: 98e8cb3d94ce - releng/13.4 - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 98e8cb3d94ce4a41e5bb290f257f790d9e090bb3 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=98e8cb3d94ce4a41e5bb290f257f790d9e090bb3 commit 98e8cb3d94ce4a41e5bb290f257f790d9e090bb3 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:14:14 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 (cherry picked from commit ea44766b78d639d3a89afd5302ec6feffaade813) (cherry picked from commit cdfdb3b0086268cdc365174ebfb69e66b5dde0b5) (cherry picked from commit b13631a59f2a303418c0f3f298b33f2a51fa59a7) Approved by: so Approved by: re (cperciva) --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 5635246845b9..f9fec62249cb 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5633,7 +5633,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5674,7 +5674,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 19:58:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFs3tFwz5VHKC; Wed, 04 Sep 2024 19:58: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 4WzYFs1q8Lz49V2; Wed, 4 Sep 2024 19:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FC7dnVFVX++2h1OBflhHeBd6JDrh+bwp0g4YJjTz/iU=; b=UPzNPbHwFAKy37OPpglBKsSSTnB8bB96BPmfPhxNIHO9xxX6Iihk2RfSgGvV28fFrUexf/ /wznhGYTBmUJ5PC4Nnm0gACxasLCaiwvRAz+h97iPXR6jm5h09hOjiZI3INoj2pLR/SEbo 0i6ysO5Xc5JZZqkbWsSth6CY5F6iaIHZuT1/sIbRrQgFZKqawV7VQQukwccz9+RkxsPjC9 uUz0JgVETsvpHNchO4BpQFiL2USMMyz64TatkmFZ4B2LwSmvSAW93rblxXXL0Szmye/sDC 0CSeV1lSeUMdGYZJW6lC8vDldBscjYUsy27lRGqpF0pIh37iWc5J8c+Eh6AEpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479905; a=rsa-sha256; cv=none; b=oYGgdlvwBcwStuJpAlrYmrjNDHNHG1XwVeJ6FXc1Dn+/5Dd7M1pLEKr+SiyfhbQ7aqAJbz HNmxS2PY/IOtwtsREdNYkqsjOyoyaChmvXRTiyaYmY+kmVn+ikQ1a/aTRO26p6fC2NCob1 UeMk44QT5VimDmG1BUNEdhCx/tfQH3BkDfzvvKw3G3FbY3FBL8Tubwr9930Vge4fWvnBvT McmK63DI+n5P5NdxAzEnGMvPaRRevhT/h/ZRqyB8s3zN2co+ujvbYgINA9m8rz61IZmPB6 fj8teNpse5dd1zPBU3nBdMKDuxorNSyDQVVTHrzdo0FzNET2ndw0Fg/95e9kpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FC7dnVFVX++2h1OBflhHeBd6JDrh+bwp0g4YJjTz/iU=; b=XfXfiKtpSz8VSYzOi3XyUiDDARvrZMAUtcePe0yIGfHXdbGWps7y0AMoeKdkNiby0p4b6g vtWDdY2vCP7xS07V+YE1y9jcvLmk7BL/nn3cJhHopqYdc/oDOm7QuPeBeb6KMhPsnzjNYt 4asi/lUF20/IPdiQmBSZqdy3HYY4COe0PgPxckO9M9901BPV7lSEQp4DBohGEB0X/IWMXv QBXCtpnwuOj48RBkXBQKDG5hY62hJP8CWq03Mu11vfMGRtVatN4WFolehv+vierYSqq7Pi gWxg0PNLBZcPw0baUHAVovfIHDXx2vhxGcfPSDYtZO8gDOnMx4aExg0JRckIEQ== 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 4WzYFs1P8vzf5H; Wed, 4 Sep 2024 19:58: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 484JwPLU030043; Wed, 4 Sep 2024 19:58:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwP6C030040; Wed, 4 Sep 2024 19:58:25 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:25 GMT Message-Id: <202409041958.484JwP6C030040@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: 004298792002 - releng/13.4 - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 00429879200207bf2d9a3fbabda3bd7d388cc891 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=00429879200207bf2d9a3fbabda3bd7d388cc891 commit 00429879200207bf2d9a3fbabda3bd7d388cc891 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:14:25 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 (cherry picked from commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9) (cherry picked from commit 803e0c2ab29bb6b715c38e82da4930d46590e8e0) (cherry picked from commit c8afc072690fd7541159cfe76c544797a5b37bce) Approved by: so Approved by: re (cperciva) --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index f9fec62249cb..b0f34cafac80 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7513,20 +7513,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 19:58:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFt408rz5VHMd; Wed, 04 Sep 2024 19:58: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 4WzYFt3BpJz49Wb; Wed, 4 Sep 2024 19:58:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uzx4tLJk+Z58gx1+3HeblBYSzRjrUgtqfabIh2viwHY=; b=MtPrUjQxQb0Or0v+/NC0HBz9lz8blNQncth8hHWZehBZmtRQRlyTIZYbcL0OKZiDFUtB9J vuM7p5QBsFEzLgFXgkNxjoSv39jhxs72JTeJsav8oaImT6JOiOtdIf+picLTLRCSJYAivX VblqOp07R1Ro/wzdkhhkFSO9wZkyuLmk8G5R/gijoK9N1Iqu/cYA++pATW4ckOK7g8UxmH TQ3uMB18WMpUNW3JQbHhSwhIHQfVDNCXaGPLFDPNUtRmFchdjFun2/W/JWbFYhuhKLkz0U OIxN23SbJVOx+qUbTiKvty+a3vbYaj/Xb85YaMeGPAZdHm0j+nwVLfSLZnW8jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479906; a=rsa-sha256; cv=none; b=Ra8ovySopXRF7vSWeiXEZkdzGQGG4DZ5aptFVoXjGiSyIzk6nhPxsoNnyYpaanG+V4gSdd 6UL18msmp0pQJUBHwJ++qOv3guRkFhYdoUBABv/z2CkbpRnCwxlauG8CRItHNrYn1k2Hol FQqoN7G0ZmIriPH38CGEAhGlMS0TKL1xloY/bEFPZ1TBN1NrYl/0XRM8SIcRTj8X7xG423 vn6ZBlSZtwCoW7bTZ3xVU99Axa0T7KQrns8aGOh8O6Ihf0RoAFIUkIdkBGzeJDD0LquAH6 wBPYDyX77tykfl69lYwbWOmUdpzzMTiNI3kwcxp3C98Lqfcv//LLEYBrHHSjSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uzx4tLJk+Z58gx1+3HeblBYSzRjrUgtqfabIh2viwHY=; b=ntvevI0tuuOSOoHY4kYt/XgJLLix79YFM96cTptvK+3jK02ofx1Wfnyb1outkhyUQZ/c/S QaFMToqhBTycAb6QkZjBcQ7aMC1cRSJm8uGwjurEMADxETRq02IHHIjoIwwzSeri/6HALK yRGhIkIvYJKkKMUOsP1OhjKyahghlZWRhV7CCqVhokaDgqLv29DtoZUdw07H071QrX3ase 4bTys6YEJ6ewmLlK/WrFC602U8aFWKcWHSRxRl7Mjo2keDuEvqqfOX8QfsJcJeUTLuzbYb nqTCUnmJXm4HA9VtySRTlzHQOBWUTpmzBiitqPPdlx76G9/9zU40DLMmB+Xl6g== 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 4WzYFt2hLkzf2v; Wed, 4 Sep 2024 19:58: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 484JwQuS030094; Wed, 4 Sep 2024 19:58:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwQHv030091; Wed, 4 Sep 2024 19:58:26 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:26 GMT Message-Id: <202409041958.484JwQHv030091@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: b3f0e555781c - releng/13.4 - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: b3f0e555781cd9bc94ba4194a5bd82b6d347e3ec Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b3f0e555781cd9bc94ba4194a5bd82b6d347e3ec commit b3f0e555781cd9bc94ba4194a5bd82b6d347e3ec Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:14:35 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 (cherry picked from commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68) (cherry picked from commit 90af1336ed5e3c8556147325c4841c68639c4b63) (cherry picked from commit 5920b7e6eea1e1c46b78656ef75944fc0709e887) Approved by: so Approved by: re (cperciva) --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 58f2d53eb9b5..93161affd732 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -659,7 +659,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1201,7 +1201,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 19:58:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFv5B4Pz5VHFD; Wed, 04 Sep 2024 19:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYFv4L7cz49jD; Wed, 4 Sep 2024 19:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8PVWQHhwpRBdi1t0GJyrG0dYULZPuwAx6AMMwL5N96M=; b=hmP1KPIQCLccoZuPkn1a9jtTs6/8csXqHodUkPpObSlQSvSYk+b9i83VX0AkVKLWskrEQD y0O6GxOWZw1hv9YRYsYFi8unPDoQ5Uqw+dmOccu07ew93xUOpVk8w+1LO92iVba6h7UpBY gMHipDe6f1za4E/vncTz8tw84JilQg4bnTDe8dFMfqYIVO1H5u4kG6QLTLKM3kbNbN4YHu 4gfgGn5Mw2/lMU5aqgW3S5qADBI5ODkc/CEFYZwhIi7bPBCHndg/9kLtxOUK2B3jvLW1Mq Y/GAE9cYXh09N/R66MeY/QCdKW1zmtmBpbZEZay4kCjhK+dCl1TCUTd/5czXjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479907; a=rsa-sha256; cv=none; b=VDMDh9TpZXh01Mnl6kRVij8fNHuBjxZ2wA5qZyNRBJtqpWzq6g5k94lKiqE36cQ/udx0gn GjA4eGI7X7IKr9vMBaFiOlwmHI7CmJseHsV318fQALNWbFm7KbgdlYfJSZL7Rgy9KeobuG H6mHo2ps+m9p/HylDO1a+BB+NTd7UnVV6kHJi7zl8qgQn7AYT3sl2p9WwOTFNire+BycXk s6HfyAaIUfaISk8pXfG9xO6SUM04floPrLuxsJuc2/3v+mXBp75A88InOR9S/yw3fwBPf1 fgt9ePzinN55VDtwADYXa6KEKvQW9skzO5O3y/vySAxwXxNd7QGlfxvMTg0pbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8PVWQHhwpRBdi1t0GJyrG0dYULZPuwAx6AMMwL5N96M=; b=stOBk1Fw83kyq/khTLmRe4bGMUOTzwsTH0qocNmV5UaEs8l+DiT0qGnpWUUS7pVKsy/QRg sQtIczO7GNSrxOkOy0iyAnXlY/ZHAm6XQx07DfHACuKn6fCqlsqevoHgYr+0aez6hI3SVl 8lL+4NXWDpK+b5T6hqeqLLYs2jJreXh29b1PzUviusgBkICcJXjzYoxV68gQsWHi5OREps hPZSi35IKTQeXGNROcTlMBxGbERNDgfOakYFovIoIfdxIt3cms1TwBp78arqO7IP+NVmtr a9lZUWyTqa0ahq1jkeAXgUKtvwZATV1lxsVlTli3KKWbwAYMINvdNLpADqZgjw== 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 4WzYFv3hBVzdL4; Wed, 4 Sep 2024 19:58:27 +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 484JwR3m030143; Wed, 4 Sep 2024 19:58:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwRD8030140; Wed, 4 Sep 2024 19:58:27 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:27 GMT Message-Id: <202409041958.484JwRD8030140@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: a667c04946e2 - releng/13.4 - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: a667c04946e283031e1f51ab95f0240d238aa9f8 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a667c04946e283031e1f51ab95f0240d238aa9f8 commit a667c04946e283031e1f51ab95f0240d238aa9f8 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:14:46 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit dd83da532c36830a0c0aac624903849262ec6f68) (cherry picked from commit 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63) (cherry picked from commit 5f49630fef5fd2358e8bc96d1b5a343d8225d5b5) Approved by: so Approved by: re (cperciva) --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index d8587c51e6fd..757e3c869683 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4293,8 +4293,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4354,7 +4353,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4394,14 +4393,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4494,7 +4490,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 19:58:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFw5L7Jz5VHC5; Wed, 04 Sep 2024 19:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYFw4gs4z49jR; Wed, 4 Sep 2024 19:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ybnkLtyE5DHu2n8P/EOhq/A+/9Z3KNbCAR07ZU5Ilw0=; b=jzRw6BsAlLvRg/yUNWHkhdFm9aEQkxzJhUjtH6J6oJ5EkzBIvt6Lo0EFc2egkWEomQOnjr jlt39TS45J0jTgZcY1hWAG0DfHcQcIVDDMSL5SCA6S9fso7uVBC7laOD6yBsyvDv6shh9s ZwPEZqkg4Rsku7KUv4KMzQKqfmQwuuf9QczJR4w4ENaJSwgsV29nDcgACA966QvnVOFmVT Q/d5eYSJKp9BWoyV7pE4A6Y87VH/lhEkd6J9qXcoGzWf5t/rqyWU1v4fRB1bxA1xKzv2TS 0hYFCmpvs2cL+FZ0qc+a30rzeRZaNaT9H/bflxxOPzMToj/qGovOoqdkHS0Jqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479908; a=rsa-sha256; cv=none; b=JtRaPM2/a+tAid/GgoKgVZorKfRM7kY14e/yVCQ7viu35CsUyzyqrK6eqrAkmDtaeYW+Dl qEJWuuxdvsxC1XvC21WnVOzIsL+LEuckbU0tt/kGna53jpkXvfAjXMKv1Wl83kKNVOiNKT PCpmt0ol+T93zj1AUhfflq4aIUMv5VE5BW2SGP0UxBQFjkwMnhiz0KnpGhMChcZEU3wXYl UnLhGKWvD3BOK6YJoL3QtBhD6tH7Hco3y7SmzMSCTeeig+jVutyq00jy2Lm1mJTl98IMbi tNh2iUonMiiEEmZ3jzLEqwW4d8NNs+KEW5+Ldl3nz6508b6z6BgcEaiWHXPvQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ybnkLtyE5DHu2n8P/EOhq/A+/9Z3KNbCAR07ZU5Ilw0=; b=xB5Sxn8KryPNcOWO0PaM3jYRwU50N7FfsurvUIXNv1HVQKW1z+o3RzyDGSMNoUA46cZ5tz lcGXkPRIevzynRaLmPG8gwkueaalYJiVdei3+EvbpzXkiye9F0/qdbDLusSLOqRh0DaPVw F3Jcg7Az4whwRY4AEYVZfzCZz7YkfHDkIZnq2RoyuM0vhXJTOM27FKc6CzGsfhSxzCEKCV yyaa19dfo5zAB1KdFtuFLI60ThxVrTnfbMlX4/8Sval/2pmZVrS4b2pgxUKpPGayIU5dXt 6Zo/fGqc30GuUjW2joP+jJU0pngMAPWWFg/u/TUPnjd8W4BOet4iFhma+FFEeg== 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 4WzYFw4HyxzdjR; Wed, 4 Sep 2024 19:58:28 +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 484JwSQC030212; Wed, 4 Sep 2024 19:58:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwS9a030209; Wed, 4 Sep 2024 19:58:28 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:28 GMT Message-Id: <202409041958.484JwS9a030209@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: abb0a18b690c - releng/13.4 - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: abb0a18b690c3361346c3c3a57485e2acce3421d Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=abb0a18b690c3361346c3c3a57485e2acce3421d commit abb0a18b690c3361346c3c3a57485e2acce3421d Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:14:57 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit 62f40433ab47ad4a9694a22a0313d57661502ca1) (cherry picked from commit be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed) (cherry picked from commit 40615bcae9e7f41ca857c773e804db9bd7269581) Approved by: so Approved by: re (cperciva) --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 757e3c869683..aac2e505d844 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4384,39 +4384,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4469,7 +4479,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4486,11 +4495,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 19:58:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFy0VNPz5VHFQ; Wed, 04 Sep 2024 19:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYFx5d5sz49cn; Wed, 4 Sep 2024 19:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PoIXiD/IVXo7vJU+BfERz0WnSpLXzHzsEZy3rE99O0=; b=a/eDNyVTfJ7CX+qMylpP6NAfEYLNPRh5J0pDVkqbtHTg7FD8NM1esT203UZ//JvCkPGP6o zxqQJWonFpzRJtvckHjkuAXpDQlXzyMpdj3IbTscAZcuHxmd7R7tSug0Nnj8C37bR+/ASJ 04SrpmXNtlDobsDnw2Xq69Kos4psD0ZBpGhDXDhIjhsxJDLUwi5T9MUxIva93UhTBTjqR5 Y3OwemAG2DIAP2g2WUtmTF7fGGML9S6uYzNhHAlAcbjzMvNZ8Zo7qw4tPmh/+VhgOz5eIH dCzcV3Q7M/H+Q+X+39jQyySaIJca5UhazY50yuCLdMsp438eWvUhO4MGYRjHxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479909; a=rsa-sha256; cv=none; b=xhRmynVItberxHzFT9vIH+6Lo0Yg38JZFb02awXyuPDt9Flusp7E+JqywdvDIetq195z/t xIlVU13IDGvjjMR2oHVtwtjyEAulqSLRA8kJ9Q0PjaNj3f+w5bXI3bBlDavrU6DDxfWI5U JyI9hFS1RviYPBeATw7On4RXpO4qq/a1fC6hJ22iIBGj70m0oPzAvdkbCBFBK6Mp0F53EE bqyJR8TmEi6Dac5ptkrRMa7tPyd7hW8tD5EDxEiBb5UJi2oNLUjN1396c5sk/FOQTDu0sR gbTjUUtBzILskT4oK6U5zmR/w/RUkWqzKM6ntORZm0dNCxH8reYXZAhmACaV5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PoIXiD/IVXo7vJU+BfERz0WnSpLXzHzsEZy3rE99O0=; b=EWdFF3mVvIjzfYtlueD0do1pD+USbZ9ggIR7TBOuV94Zc57HHuMdr9uvgpbMddB3YouxaZ jk53dZmQ2LbPGdV5IxSXQiykxGIuZcTWR3jdvw7xPkj7b28QnEoO7VUjq7j9Lh9thQIXCd gE3e6a/qsZRuosi04SzXiqzjrKJSeyBtMOFOkoXFNS71pqKH4XUWQTnmOgHpe9qFxrenY2 H7+Tgs+9OS/jxjqgzURuQiXgVgU0S0cSGV9yUNSxbi8JV2gGbVoYhKLGRdgIOJdIWjkk5c Kt19uAfejBgqIAcDlSNCYt7wbJW+Sk77cnJaoxrwcfbyFjgKyoV3FXuUtWjU9Q== 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 4WzYFx5FXTzdtr; Wed, 4 Sep 2024 19:58:29 +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 484JwTg2030264; Wed, 4 Sep 2024 19:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwTlD030261; Wed, 4 Sep 2024 19:58:29 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:29 GMT Message-Id: <202409041958.484JwTlD030261@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: 6000de096612 - releng/13.4 - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 6000de09661282f70dc5af1bef88bbe4fe3beffa Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6000de09661282f70dc5af1bef88bbe4fe3beffa commit 6000de09661282f70dc5af1bef88bbe4fe3beffa Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:16:30 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8) (cherry picked from commit b20ae160872071fc20e5dde27051792177057fa5) (cherry picked from commit 8cf43dcd3db6f02f8dc3f0aa23965db107190789) Approved by: so Approved by: re (cperciva) --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index aac2e505d844..5d83842f8ed2 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4334,8 +4334,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4355,22 +4364,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4470,11 +4491,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4488,12 +4516,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4564,13 +4600,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 19:58:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYFz0mfYz5VHCD; Wed, 04 Sep 2024 19:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYFy6sVFz49jt; Wed, 4 Sep 2024 19:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qL0N96SEHROw8mnF+5YONZGT1lR5btgDbwSySaU2Vl4=; b=vytYJU5jLGS6JGzywfXiOY/gBjYK7AlFxUYL1tkqy2Hev+vmZD163mlAz2/m3CSDa0B0XN AaVMGqIEUHz/VyeFcv4YTqDDdxmNtVXxSDEdRcMHHx1UZLAAQJSqDVurwXm/DJe53YAXw6 QA4SRxnyE6YqaP6WentJTrWeNPVJ3PoClKXLHCGxGZtJrhFTtwSTOfba33ahuA9eIXZDCD /gv4DSNWIW8r7Dg5CWpzdAOKsd7A4Uq+m4pVHDPajLojQT5vMt1bUOSZ2LooEljvLkA954 IFrlZokdQMmkjizN3u8y1YCakznwq7qdNE+a/B4kkzNIJlVDCySc94PpYARtag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479911; a=rsa-sha256; cv=none; b=nMpzPLBqjMCfUiEQzCpNo1wzzdje7lTmPoI+1y65i423qMxyM+qeT7JXk++ceLJySlj7Do Xs6Uc9JwqcvVRgkqUzj0CCuUpY2NVMhmjHRdwhwJmQF9jfgCokEsvUNPm2UjTU7p+zSiW/ u3718TohAQManfjGbAn05CL9MGKeAWuwRtjMSYr04eNwBvE4j4q0UUC7qcyay4nylwVl/7 i5rNs3U8fFP54K8Zw9aN4eK7B4QhtGNUxobljPhI5BflndaCDzQ6uFxeYWQPRSVtRtjfAI qFjU4vtc8Bzv9/866g/RqQtwe6TDrvMn3j4AGB/tvrSA2+fcVAYyFvMcTK8Z7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qL0N96SEHROw8mnF+5YONZGT1lR5btgDbwSySaU2Vl4=; b=UJJxSsL2XlVGAETTbEUcL/78XmLakjlB8ZK+4f9HxDJmbC3ZQtB23+tQYhwT+GdAKkQ3z5 LcZhzW7zfgKVxa6griYbdbzQ4/EFS38BWQB1mCwMxs8vowXEcOaCXad4LsP53F9OfBXsuz lrZHqXKM0tgTU9PjggeB/HifUz/OIJA+ZDSgHEPW/yPh2S0TgmsAvludsGORHn5jNG4QD8 zzc1lAkA97zPLEGW07AysY9P18mAPe+f6+q8DjzrXteILLXfDLU+3oiKG2MYD4oF0PHS5w J/7ACkkei7XZ6e6p/pavSILnclZRkbTNJYHRplieXDkdpzZbg+lRYk6lX9BYnQ== 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 4WzYFy6GbnzdL5; Wed, 4 Sep 2024 19:58:30 +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 484JwURq030327; Wed, 4 Sep 2024 19:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwUxC030324; Wed, 4 Sep 2024 19:58:30 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:30 GMT Message-Id: <202409041958.484JwUxC030324@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: 7739dab97433 - releng/13.4 - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 7739dab974336ed87304cae9240e1c4b963d5280 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7739dab974336ed87304cae9240e1c4b963d5280 commit 7739dab974336ed87304cae9240e1c4b963d5280 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:16:40 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c75a18905e308f69b01f19c3d7d613883a008e79) (cherry picked from commit 4938f554469bc81783998143968ec3eba2a43def) (cherry picked from commit a73a70472c47877d57d090ef77ae503fe75e9f41) Approved by: so Approved by: re (cperciva) --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 5d83842f8ed2..23087cf4269e 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4360,7 +4360,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4408,7 +4408,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 19:58:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYG024d0z5VHMl; Wed, 04 Sep 2024 19:58: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 4WzYG00mTwz49d5; Wed, 4 Sep 2024 19:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vwpHFZnkFDU04Y/QFCdcYVirgesG5kqyD1rtdHSxdzU=; b=FRmrqJ5NDddCW62bQeXnwaiiaeOZgJ2Ks5PAW6JmT8fodZ14Ev1VXECdE4G68ONdJAP75t FXz7X6k81m3L0uxpxoCOjf7T7Ys8SZFG2zjn1m0eVY4QaE9gUKuK8rOOJQg1SN1ln8HaSL a9mqDOPuF+3e0jD9rdpwkLIQcavmDPfhWX0ntckODTo48mv+oy9MWF60bt2A4OHiM6AuOd rzzY8z+RhffxMyIbSDdrUipwa/OeS+YPBpLS58rd7kb2ySd/Ym9RU/uQ0eUtoIn7TTSg9P E8KhErlojRpOd3dY0z1KZisiyGi1I0dcalxsy+PpMOxF7F6xFzfjns300QwEyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725479912; a=rsa-sha256; cv=none; b=kUTJeLHXGVuiCXOmGvt95fNdwZ+ImcCX3+H93zrtS1/dtVB3hPX918FhBpc2FXR4Npouut wjgHI8TfloS/HlqFK5XPU364+pLR22gq26+8aKnOusmRgFJfdsKgaA78J7MwGcdQTagBKw 2IU4zhJsj1F89BJNMj9NyGWKb3rH5zltRNPxI0lJaxxalZnYBiupr5fGRxKxTTT7IUS5Su 3nkFM2EnHg4yak3nySqJKpe9T9+k+xaMyX926FxQ98mu5U/FCJEc2OXGZsxHjL4qSxoaIe pJhSyyu+8mpkJA4jzEh/95QE+VMED70W+MB+9Mk9StNu+SX55LKHaGifXsEKcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725479912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vwpHFZnkFDU04Y/QFCdcYVirgesG5kqyD1rtdHSxdzU=; b=pR4ZnuiPbnaWkMAUoYypAEskIP8JjHJNk191nVmMY923GQmhzMfdaKF5558/5EFQ5lPdLB 8RbOndT4UYcEpgXd25A7Gb3WjApAbq547iksVKhBbL64Y/fnu8i+NA9ZbZ9btd0UyvXuZr VcKfJ++cqAeCk/b7tZxnJ7Ku7QYbK5KxiVj0BEMbn5pZ8Wre/zYKBG/+vCVV4wTbf3fgtd Z/JJAZNsdq3RM13DkZyiMWnWiLTB5hHDNLkT4Ehmq8AI1orvWy4gFzf+pGhJD/ZCFsSt5P aeUR+bSzuYTprM/GQWLT/W7AFQZu09hOV496eF0KPFuZB8MSfCXv2ps6Sn+4hg== 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 4WzYFz70nBzf2w; Wed, 4 Sep 2024 19:58:31 +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 484JwVLu030372; Wed, 4 Sep 2024 19:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484JwVsi030369; Wed, 4 Sep 2024 19:58:31 GMT (envelope-from git) Date: Wed, 4 Sep 2024 19:58:31 GMT Message-Id: <202409041958.484JwVsi030369@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: 21576f63961e - releng/13.4 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 21576f63961eb1402417cf1a3f1f16874bab8466 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=21576f63961eb1402417cf1a3f1f16874bab8466 commit 21576f63961eb1402417cf1a3f1f16874bab8466 Author: Ed Maste AuthorDate: 2024-09-04 19:32:29 +0000 Commit: Ed Maste CommitDate: 2024-09-04 19:32:58 +0000 Add UPDATING entries and bump revision SA-24:09.libnv SA-24:11.ctl SA-24:12.bhyve SA-24:14.umtx Approved by: so Approved by: re (cperciva) --- UPDATING | 14 ++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 974b0dbd30c2..d9e322e4a1a1 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,20 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240904: + 13.4-RC2-p1 SA-24:09.libnv + SA-24:11.ctl + SA-24:12.bhyve + SA-24:14.umtx + + Multiple vulnerabilities in libnv [SA-24:09.libnv] + + Multiple issues in ctl(4) CAM Target Layer [SA-24:11.ctl] + + bhyve(8) privileged guest escape via USB controller [SA-24:12.bhyve] + + umtx Kernel panic or Use-After-Free [SA-24:14.umtx] + 20240218: MFC of 713db49d06de changed 'struct ieee80211vap' internals in net80211. Given we do not have enough spares and the struct is allocated by diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 4bb01ad3de32..9df266dcfb6c 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="RC2" +BRANCH="RC2-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Sep 4 20:29:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYxt3K9Gz5VKQp; Wed, 04 Sep 2024 20:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYxt2Ltnz4JDk; Wed, 4 Sep 2024 20:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMqRvsh9gO1gD8TXjAz8HWSLaKfkRhcDJpPriYpQBQA=; b=fch8LT6JaR3PtexVPk/HoxJW15uQVzZpPri5PPQ9wSm/1YuKIu4tyOwvefqbhMOijhcd8W ml2t1eNCPi17Z6+dNssyQZzpekvg/qy2OjDKSvI39aBqbxhYsJig3CJqAyp/yjrzdwMfYC MHVn0wu/Ivp9jtlRVwZ9zB6EqZtoxeMHcfrSzTnTLyuxP6vli77H0TUmWnNpcKdLvuyOly HH6v+ZzBo+V1xPwV0bxNZZgDUb9BZgn3CdnEh8ZOE/sIiXU8tVmUhg/ROtXjQ2OjaJEUqQ wUYvGzJ6aCnc3nAT3Sl8lFiz9V4GZuOuwaXXvV39BIvSnUh2qTS1wcKGKLk96w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481778; a=rsa-sha256; cv=none; b=QFG/jiauZH+ThLPbR7Ow3RnLozlh8PAzCW+UZ5yB8s8A2CRA1FIZAjhqkzuuW4ekyBRNnD kY3O6ICDFFTH0W3qPnyHfIvASYPMezp8tdJn/IXUNdjHBn6/Y79l8uCKzQNdthCB+KlcO4 7bsXIcuoDS8lu43npLm24bd0wSDOBRC/+U157CAXeDSL7D/tu1IzMmtfGRYMNzhzgrAQHz qBLTtPJbkuDuw64Fh+6vNDbk5vCRA3cGXuUtVypUgd9uQDOv3hAutUfiPBqDOsUAsyjMCE IiKz7ud4zmuzpL+wJPEzRKINlFcGEAOMMpdm1zcSfL0ym+ry8RD1GDAdA/MtzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMqRvsh9gO1gD8TXjAz8HWSLaKfkRhcDJpPriYpQBQA=; b=pAhVthcK7VudvkA7ZvSIfl8Y8LP8ueM0V8Hkw4NbNfHmN7NZSWcY6y6P0M9mnPiX9vu3Nf BzyxzXheljv9d8eapsBnlYmraVKM+c9N+e2ndPIuh/uS7OpDA+se90TQiMTZOxze8e0P0M dcoH0aMm3N26s0PHzK3Ut5SA8sGArIECATdZUMaOUxaaux0g8EN9FITo2Kg23kJTLkXh+y aEMNiMPas9U8Cfmn9n0KUnzEHBxObseRQxo9cw0I6/7u1em7e/TrPAGu6wELQxrJ9wuRY5 mol/cgztt+gsZqwru1FHwdTI8/btgZI3btpVwnVKJDvnygCwwcsxiP9YB3/cGw== 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 4WzYxt1xxSzfkN; Wed, 4 Sep 2024 20:29: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 484KTcdR082400; Wed, 4 Sep 2024 20:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTcHs082397; Wed, 4 Sep 2024 20:29:38 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:38 GMT Message-Id: <202409042029.484KTcHs082397@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: eab94c0fbb78 - releng/13.3 - calendar: don't setlogin(2) in the -a user handlers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: eab94c0fbb782f1d849981d0dde2106ec9bc8df3 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=eab94c0fbb782f1d849981d0dde2106ec9bc8df3 commit eab94c0fbb782f1d849981d0dde2106ec9bc8df3 Author: Kyle Evans AuthorDate: 2024-08-05 18:43:56 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:28:41 +0000 calendar: don't setlogin(2) in the -a user handlers As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a` will now fork off a new process for each user and do all of its own processing in the user's own context. As a side-effect, calendar(1) started calling setlogin(2) in each of the forked processes and inadvertently hijacked the login name for the session it was running under, which was typically not a fresh session but rather that of whatever cron/periodic run spawned it. Thus, daily and security e-mails started coming from completely arbitrary user. We could create a new session, but it appears that nothing calendar(1) does really needs the login name to be clobbered; opt to just avoid the setlogin(2) call entirely rather than incur the overhead of a new session for each process. PR: 280418 Reviewed by: des, olce Fixes: e67975d331 ("Fix 'calendar -a' in several ways.") (cherry picked from commit 6cb8b61efe8899ee9194563108d0ae90c1eb89e3) (cherry picked from commit 3a9010c98b3d9676307fac20d42cdd3cfd4bc46d) Approved by: so --- usr.bin/calendar/calendar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index 476c0495d218..2e3baee7d57f 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -224,7 +224,7 @@ main(int argc, char *argv[]) lc = login_getpwclass(pw); if (setusercontext(lc, pw, pw->pw_uid, - LOGIN_SETALL) != 0) + LOGIN_SETALL & ~LOGIN_SETLOGIN) != 0) errx(1, "setusercontext"); setenv("HOME", pw->pw_dir, 1); cal(); From nobody Wed Sep 4 20:29:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYxv4XMHz5VKSr; Wed, 04 Sep 2024 20:29: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 4WzYxv3LWZz4JGp; Wed, 4 Sep 2024 20:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UJg7eGWoGwWveLOvNzBsqCPgNhC6e6w3ebCoibCfo8g=; b=YPypkKGj8bDNL/7C+a+1AHlqZlePBnCsXUIlay2z75apt6epdRn9BR28nJjlHRtXQCq3/p L9QBcdN0EFFiuXn9G1XAew0x34znbrpXK0zeiQB4mBE9Du7MhaHvPj74tLQBXgBThaoK4y 0IzZx7+KXoHUEHvAnq3nswmDUBcjja4j8g+35k9k1mLiWn5yCCidD4y6dJR3p9TO1bhFmq Atk6pRBtrEjY6XswzpPjrec7SeOtLRfnWPT1kgb0osA7nCJAqGpULuwLW3lcDviXvNacDu YnjhX+eQihzh8LEF8lTqhNviAQp6uIw62q4RS+bV5bA0HQgOuB5NygyBsKQz5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481779; a=rsa-sha256; cv=none; b=smgL+P3yLi9Romovxc0cEVFG+FJpyxJbQ6/tK6WdiKp2lJxJ02zoM54x95J3xjO5uxEbNU asctWR5y+EZSc6FjbS2I7mTGcTqH7D9ApkyVbycbYmWjtJbKCdOmHsrmnC9KFzOgsF+n08 KQRFQMXX5E+5J1zwXPjruqRg+zdIaXxSX1XUAc5J+OCVq2rHjekqTAjdIe+ckpmjhy8Jw7 FSNRbamuGBB2tIhpdiS1nzFTZ9L6B98FWrI5zeUQ2l416MWweSixJSpgPgvCqZwH0slBKT u1XVO4vgoNpCSL8AUsa2UUrNeZeiT2PpG4KtZrmuZLVIw+9QB1WbC8P0n2eWcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UJg7eGWoGwWveLOvNzBsqCPgNhC6e6w3ebCoibCfo8g=; b=dN6kdu2W3p9xxATnXvnMG3z7st6QVn5xh61g+0cWLx/L+kkFjFeHfgJu+qArcOHczPNGCK 09RnatljY/MuxtYRr/2FKdNDxXZcxnpkHYAEEhDheCrvwr1bEGRi14Kso7OAKP5qKa+ypH PaAMXo87NCODnE1OdD+dZhBdQ3svJLh2Pp0mKe4xGfqwrZQGjIrOt73rrLcpAjmLFPPRTu Qmr00VRnivWs1iTA800PvRzRKOVVptdWvpqU0mcwd9trlsqIQLj1egEyVla0aPdLPq/RZi Etc47M/JkApRptmg8Xh2h/AJyaVzYuP00O/zzfuEm/Mbc2nF70GiyBpM9PIkIQ== 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 4WzYxv2ygkzf6Y; Wed, 4 Sep 2024 20:29: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 484KTdf9082448; Wed, 4 Sep 2024 20:29:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTdps082445; Wed, 4 Sep 2024 20:29:39 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:39 GMT Message-Id: <202409042029.484KTdps082445@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: fd4ee5b9eabf - releng/13.3 - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: fd4ee5b9eabf1843a0b67dca583696b91bd7fb13 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fd4ee5b9eabf1843a0b67dca583696b91bd7fb13 commit fd4ee5b9eabf1843a0b67dca583696b91bd7fb13 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:28:50 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 (cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071) (cherry picked from commit 2e7f9244ebefe019ef016a3a5b47c4562850d1c2) Approved by: so --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9fd233e1f1d1..41d262a18c9b 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -997,7 +997,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1090,7 +1090,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1328,10 +1328,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1358,10 +1358,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1391,7 +1391,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1438,7 +1438,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1505,7 +1505,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 56b818691660..e399d610a7ce 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1302,7 +1306,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 20:29:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYxw74GBz5VKdZ; Wed, 04 Sep 2024 20:29: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 4WzYxw4Lkqz4JBc; Wed, 4 Sep 2024 20:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NaJd1zk0s3JNTZm6uhacXAjaSfEsIqo+LAaHNp8leHM=; b=fP+GbJcx5JPr/c85h7gLFBkLek0lomup+91/4FGHU3vOGiJLVqMfrG3kmLln1oS8mrzueC QTi5fiCrYcvq8oXV98JRymyjEorB1KYw6p8m/JquoOoGHwJ3xuh0C/3Y99E3mII8HEYyur GOlbkYuwLYId5TZGowfzxX7IhvxbgQkxNfLxTib27ySdk5ckUwA+QADILZ/hvPxoEyTotc ky0KBD4L8mcIm1i3wA/kUZo6SRDK/0DYRy0EmhlJ1Tv6v1QEGkuhM6J4eHKBPiizoJ03yS 4MSWDmWQ1cI/HBgVsvV+pCO9jTlWNBswf5r6gAEy85UU+kxAx+g3i19Uvz6kUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481780; a=rsa-sha256; cv=none; b=LnwwDXdW6iQT3+mY8QPn9mNmYNb33svXttACAfDWAAM0FbnZwKhv1ImREAcRcTw9cEDWlC 3XTzRyPUP++jK9jWS4rJl+h/v1S+SHkpeFrHxWTm38lBV2CBCvcfOa5DCnvdk8h9AlqVkE 3IDbXKKX04dFzE1jUzVU8+mvlTcOHA/GVaOYLKSJLLLLXYUfvtCLqvJg7K04h37p8tec4d uOXxChudUDpldzuCJDxVy5CnpGGv9dskIDqknThUFbUbpfcwnTjgJRc57+R2AiqoGZATtE PQeDoMTcbiEj1fWHJ01BVu/vB5cqGa2zXnRZi9snzfejfkciofTJ49MNxNCUdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NaJd1zk0s3JNTZm6uhacXAjaSfEsIqo+LAaHNp8leHM=; b=puJmhdvrRx44vaqRP7knPqLkabDGLgL5UewLhbejlTx/01IAXrJa4XoLSXICv491sMgv5I B6AC0mIVaDd8FYsm4WnieJvdAzxhENKBbYDpIGnGwsewPRGdRLXX5RRuit5+quMWNObbJN xUQ1nGccorx3DzNUyryh4BWhBYRmKpr/KX8pFYcX6Jhnbr9whSe4s9qNxQRsuLftKXy5Qn OC/4scBzR1vRVOTuv5P5M6ivj01dxh9adYJU9XfBTG2RKUJtnGychqFiDHY/z82SsvqmX1 t/7RhJ04xpMED6SN1kP+ozAvCMcXwWbTbKcKVhLElTyV59GsVTBhomkrGNHcdg== 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 4WzYxw3wZtzdyF; Wed, 4 Sep 2024 20:29: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 484KTeEu082502; Wed, 4 Sep 2024 20:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTe7k082499; Wed, 4 Sep 2024 20:29:40 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:40 GMT Message-Id: <202409042029.484KTe7k082499@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: 33b4e2361c82 - releng/13.3 - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 33b4e2361c82b269d42c0d787e8900d1bde5de71 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=33b4e2361c82b269d42c0d787e8900d1bde5de71 commit 33b4e2361c82b269d42c0d787e8900d1bde5de71 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:28:56 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 (cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae) (cherry picked from commit 03bef9971d73621e1703a0bad41b598bc2fce9c6) Approved by: so --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 41d262a18c9b..cfe168c38026 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -986,6 +986,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 20:29:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYxx5zjlz5VKh8; Wed, 04 Sep 2024 20:29: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 4WzYxx5D2Nz4JBp; Wed, 4 Sep 2024 20:29:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JF+yT6yoUgXuFCoBzPsENUCbScEs/YOqe0RggTfVLnU=; b=VkESUIzWXXtcaBL3JgxjfFXz1qYlLib441bufx7kfMOYopv/Ik0sqSrPHkPMSVrWovNP6x 4Qrq4u0sjBBlkcuQNnXhEQT6LcINXLdYBcwrblttw7eCBQKnB+JTkbjZuGbIRx4O1VXCMz EZ+tE4fDROb1+GIUztRJepUEO2lIpewF3kNIOTEAxPRw2zhFCdZg4sMriBX4aF6UCqpuCk r6+zvi2VoHHcyFsVl0TVasu67Qdr0yowFdBv+iXG2ku3O9anlUBvpMjfyZ2hdFKxULVpV5 81YjjllpOQpz0cAkyqtzhklN3vQXyvoGDMpYm3XQMzbEx40Abc7Yg9ocL2RgmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481781; a=rsa-sha256; cv=none; b=oDRc/7n1ujUYfxKMlOpPte8dd0xRARNwxOpVR3RXs3IyxAPcH40v9+PXXaTBvFrNBZiCPU mqW5pQQN+P+8U+iX5BUZtPb9II0hDUf9OvwT4LvGDgA4U9bUqkehGvjyfAesGrM3Q6XINP /us4tW4Wy3jRU9kkIA5OKNWHRbJ7jnG0DKFxA8A+9xbfb0QbF2l+j2cbxEo0pjf93U5ZYK ej6csy5ARXl6HyKOm1VNTDu64AtrwmPCRjva48Cw7cux7qrxEdIbPKtiU+81Nmu+jEtR55 QZdoDt+UmKFjiHOb1bjBvZZkOLp4gV5v3bgIX3r9vjgkkxf98vBHqTGumF1EwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JF+yT6yoUgXuFCoBzPsENUCbScEs/YOqe0RggTfVLnU=; b=gJXFi5sKfN8+l0xUGeFyV892qHUH6J9jVlXVe7MptMsORCyjbeRMFftSjlB/hIHyr/y0yo QXKexqxg3EItyYMdeDmAtOdx8x35nchY+G9/2GsfULTyNECu9nCpof4D+GZ3T8uaf72NK4 ZFcEXHyhPen3Ne7fiPX+l7W5vsUXuks0aHO/N5NROUeGVDMAWc7LBLRA8CwrrB2XSvizfB JJzAYaCEXKPCOrgpK/5h0PUvPZdC8vvzM6gy9I8kYwVmjW0TXqNZepmM7MNWYnlMMCnaP0 QJDVOzAw+E4kMvcNiLJt7w9lnxCsW9J5uXhRkaragC6WC8VSaIoO9Ce6o3IlGA== 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 4WzYxx4nzrzfkP; Wed, 4 Sep 2024 20:29: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 484KTffv082545; Wed, 4 Sep 2024 20:29:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTfc1082542; Wed, 4 Sep 2024 20:29:41 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:41 GMT Message-Id: <202409042029.484KTfc1082542@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: 352775ac8ba4 - releng/13.3 - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 352775ac8ba4bd9d476a832dceead3667704699b Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=352775ac8ba4bd9d476a832dceead3667704699b commit 352775ac8ba4bd9d476a832dceead3667704699b Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:01 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 (cherry picked from commit 670b582db6cb827a8760df942ed8af0020a0b4d0) (cherry picked from commit 29937d7a1a0a3061c6ae12b5b35cc32b03829501) (cherry picked from commit 2553c91f731b12558046454cf30eb83f56fb204b) Approved by: so --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a31bbd3c8342..92eb658b2d2d 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5672,21 +5672,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 9a87345015fa..85f4f6137810 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -410,6 +410,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 20:29:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYxz0M1sz5VKkQ; Wed, 04 Sep 2024 20:29: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 4WzYxy6ccTz4JMh; Wed, 4 Sep 2024 20:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JEeh8BfvAjspiBnMmHAjzI5IFOzMtADERljdwQcCeOo=; b=iTKA61h+fOuTv9iVSK5x9ufUNgc5IRc+VAiHh7IqxK2ZdlnAWOWiVt6kmN80DxYrEbcdWl oNkHjz68Z8U4TCzqSLcVBemwb49Ujh7nMQhYxTVvX/cqOptMp1x8hk2A883t0nApckf2mC zZowAplD3q+7mH79KfQ8ePwwfUMKoYPxDhnVfvKsnoR0/jWSx7rySxhH6ICv5byzj+kH49 DVcNEP9ILRcEQXf0UiXJ82NzXm7XZmIQdhbBYYgDCFXi0ZRyaTdaZNdfq67tVVIRtAAHBY zEyfN2c3EiqgV31ZJdp0btrZiPexdZpbo39JiCOxGYB72HCzeDgLGZUdskZdPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481782; a=rsa-sha256; cv=none; b=gPJPucvggyEKpE+6P/O8F4VQ7HXhBte2odZGYdm9HDKebJTjkIVISXnV88tW9OGDBBWHX1 0zrL1hUtjkxG0Zm+g22wzgxMk2fV5w+MDZ9i77yg6MxM4V+TbhxbOgxo7GRcl2kYLW9Sd4 JuQvlOxG/IiDcqIyGQBXdZUMkTHAuqG+CL6Ay51dokEZnLGfVvj0iojvIco+jFYw/QbWrf JLNyF4Ou8tk8nIBW2I3LH9D2qc3WK1dWhVxd9Ae36DxsymrP5o/vQHIEKZn7Frqk80D0Br W7mIamHAfMCOROPbgaoanCFOBTOZxo2nBtjmfMpOL6Q1TBrFU0Saz7i02p9cfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JEeh8BfvAjspiBnMmHAjzI5IFOzMtADERljdwQcCeOo=; b=aICJrjYbgnQKGR969O0efZh76OIA6wf2ZqIjWOHZFwbYatwHHXwLJEYgAo2ZqvlbISpKDG V4CpLjpbgJ4p40uO3TJcS3QkL4tJKQahh+4hsfJ4WuFy/WfHn1VooifRoba7aEwphFrE0t 0dyZlo6bfEnV26503Xsd6bCJ9gPEgA0/c5dGGPO0JD3gtaZiHO0XRWuAIfTMRlug5VAiLp ujDju45NLhR4VuC0wb+Z9JQxOr21UOlkZ3YcFeUohteKKfo/nD0HMWEJ0qx0UYHbSXs4RH 1a9jKEIrDSPxkQ5JbNcG7H5CIApNg+hu+BWq7OXJq71b8VK0IaxPhBxnUdESrg== 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 4WzYxy5w29zfgk; Wed, 4 Sep 2024 20:29: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 484KTgqi082596; Wed, 4 Sep 2024 20:29:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTg3j082593; Wed, 4 Sep 2024 20:29:42 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:42 GMT Message-Id: <202409042029.484KTg3j082593@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: 4752a984dc07 - releng/13.3 - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 4752a984dc07e2e4a1dfdf4579dc249b04716b73 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4752a984dc07e2e4a1dfdf4579dc249b04716b73 commit 4752a984dc07e2e4a1dfdf4579dc249b04716b73 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:07 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 (cherry picked from commit ea44766b78d639d3a89afd5302ec6feffaade813) (cherry picked from commit cdfdb3b0086268cdc365174ebfb69e66b5dde0b5) (cherry picked from commit b13631a59f2a303418c0f3f298b33f2a51fa59a7) Approved by: so --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 92eb658b2d2d..6fbe6bc5a484 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5633,7 +5633,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5674,7 +5674,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 20:29:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy01svbz5VKmk; Wed, 04 Sep 2024 20:29: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 4WzYy0050pz4JN1; Wed, 4 Sep 2024 20:29:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=spL0jfSXwuLInZO2wiAJZlkrrKUZYkvwV1G/M8b1ElQ=; b=YoyZePkU2EdhHwmIjAoXf4qpimknWa95OsQ4uYh2U/WoSxRMj+iUOYV59iUTw2QLL61Gym vliNlllqWaXhak5eA3/mhY9kbA1wO9oS4IQxThf59AQuqttORA0UNj7IYVHXUxrWRvfQ/L LGXjmBzEFxJjKZpB25hP7Pgu0ugE4TuR+3eYN/1T1TIFysEQifyvhuxVGxvhvyvYgT/0+X H+QNpHlSA3fn1l9fhzKa5DDptNiz3AFeyFqkAOyn7eh+o/JHLfB3rtRghH3aB59kajHUpc 91EqGbBLNUhowG/iN77xLDNd8GNvdEzc3TvMqL6wC0hYKdtUVwSeboWLLoaD/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481784; a=rsa-sha256; cv=none; b=srHNHGeV+5Ia33moQ3j8SJwWruuW5dCiq6+hqFb6igGrsRkZkSuTMB9gNpa15iEGLiVR3q lQzcaChikdtg1G3hnlNM09cXbapGmoj7WRy6bX65LWGOPXnAd3aeu4f+FYqHhaZ//9qKqk 6zAAsFL1nmnedoNaVLsQw91KrQVXKGCdc/eyfKb/W6JaoZsLH+r36M6jEU902ENOINJnEz NNmU/kFxyLwOfwfK1Nm5sQPLKsb85ic0hlNUiBLzIzH/PaFEBt8XF2Jj4SjGqyfBwuIOgq eeEtii32dR+p2Wyxkvz1wDZmrkWfnz5TkGwdAjLmvtHa1YoZ6DNi4fxQYRBPxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=spL0jfSXwuLInZO2wiAJZlkrrKUZYkvwV1G/M8b1ElQ=; b=EgIlgJdsuOrkVaCTZpMTFzCUH6sEetOXah2eM37EDx9WiPsWjaGJ8YACveqaDaOeD4O/Vt tXPn6ah4q8AhsvcnE2UhlTU+cCGc2vI1yfQXIGCvClNYRtvcf28qCkaEIuGJkhNA92YrGw zolOGzLPhGZCUMdhx4EUsr7BggEtMCWBjOc1YLluomB9hW5pUDtOXoxa823nm186uH3buZ 1jEh1cNYGZnxFcD9fc5J3099l4LMmrQnFlj+zKPRv9vRhtteH1zoztxuCNHPpchmbjweF+ uB2RBqJRNOEf2JUJEIfIjiSChSIya6MPYneF/9tIvmqvvf5BQlNZi6FZwe/mfw== 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 4WzYxz6k3tzfgl; Wed, 4 Sep 2024 20:29: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 484KTh6P082641; Wed, 4 Sep 2024 20:29:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KThhD082638; Wed, 4 Sep 2024 20:29:43 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:43 GMT Message-Id: <202409042029.484KThhD082638@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: f368a02e1013 - releng/13.3 - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: f368a02e1013b0d669f77d5a606ef76468b903a1 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f368a02e1013b0d669f77d5a606ef76468b903a1 commit f368a02e1013b0d669f77d5a606ef76468b903a1 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:13 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 (cherry picked from commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9) (cherry picked from commit 803e0c2ab29bb6b715c38e82da4930d46590e8e0) (cherry picked from commit c8afc072690fd7541159cfe76c544797a5b37bce) Approved by: so --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 6fbe6bc5a484..5d4dbd295f20 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7513,20 +7513,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 20:29:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy13tJNz5VKkT; Wed, 04 Sep 2024 20:29: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 4WzYy11KSrz4JFV; Wed, 4 Sep 2024 20:29:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/mXvWT1D28j9UyIsDl+c9UPT3OLfHmh+a97C2iKcTRA=; b=FghvKspi07TdKImuWN1+I0ELzmrJz0moDWiU3YOtAhpIGn6Y8xz9YHgOLES8bXVPdyd8uw 0j5RvkGVNF+cWazInbsulQuXkkIWaTms+Htq6bmEtfhkMV2uealE2Iy4Hx2U309ZfY+yCy ujLoVRLTd7fPAIDkgV0qlaHHlzLNFGxkomdup1GIXFngMEbTRKVnp+0HgZJ5DZkuXQ4FIY eksu2hdmlu7hmFt8CV5kTCFN29OizqtXYQ3FJKKbtK2h/laq1+GYf13/bkHLkIb2CewC9w 1bdD5MsmPuhQcUhCpVAfrQU2QDXLnJXTdpSaV4BnGpDmzEJHuKyWTH3uz8LrYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481785; a=rsa-sha256; cv=none; b=sBGYyTDzfCq7gSlwwi3kHLPdUE+LeGs75vn2OPWIemXIXZMh29jWO5/mnoorbVtfVKjawf NhFTOuS2/MOuKGTScvequPZTLp4mimTFBg6LBG/MpPS2t2lH8PhC5CzqIZxJWepHkBayyA leWVHE5RJTnXWn4/dUJ+++uiwX2KZKlkQKQqYobFRWZviPzgRi4YRe8Vg8toF3FrDUQGWF uzknQNacpm3tEybHRLw74CqW18hgEYvWtBHGXOxJT6oMN8zLi6QNRgmPYwy80+vPCJgpeN 16j+UhmhPrQ24qP7mU8IMgwsm/Xn6k8QLn0vYZMlgtzq8rS6S6d9GQ9CGqXfOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/mXvWT1D28j9UyIsDl+c9UPT3OLfHmh+a97C2iKcTRA=; b=C9QRcqOuF455E2x82Hv+/s4GerXMYs3jK68iAHZicpNqhses8nAUUXPmv9KncdMZE9xDOs FJfTd+u6Nrjkd8XFT3jgRgJ3rBjQOu4Tfkdui5IzRh1L029EfiqbRuX7h8MDGJ1niUN1vp wAsp3VlJMnj1184yc2oK6mH1ivHWrhlYduVNpUcRM2XxBQv8ll1TMM1Q5m6rx7U2Wep1yd fJWRws/YobZbwdCFUbJ2Xe3FAbY/MnsvflYRGi0lXKYOP2EKiVSOSFdsevp1Uapy69cKmV J0QrMAwIy2JIwaA9kcOboPj+cjWngOwnMYOOBXmITRfzPFpJMSmtuARq9hglVQ== 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 4WzYy10vyzzfgm; Wed, 4 Sep 2024 20:29: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 484KTjkb082689; Wed, 4 Sep 2024 20:29:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTjJb082686; Wed, 4 Sep 2024 20:29:45 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:45 GMT Message-Id: <202409042029.484KTjJb082686@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: 639494a3c1e6 - releng/13.3 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 639494a3c1e6d4e9341ecd551573e403bfc8c6d4 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=639494a3c1e6d4e9341ecd551573e403bfc8c6d4 commit 639494a3c1e6d4e9341ecd551573e403bfc8c6d4 Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:19 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) (cherry picked from commit 51768dc31df6379aa4a1447a15f054508d16b4b1) Approved by: so --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 5d4dbd295f20..b0f34cafac80 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9341,14 +9341,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Wed Sep 4 20:29:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy24vVxz5VKZ9; Wed, 04 Sep 2024 20:29: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 4WzYy21xDpz4JLV; Wed, 4 Sep 2024 20:29:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WkToUt0t76w1eqLpMfpf7sPzG/Dm8hwgI9EImfeO5/0=; b=MbfnP0vZAxvA+AJvoBFPhgEXv1LIFN2Zp1nVZzXfbh4+MRIvGlnKVzVVHXEF5vj/0zjyu4 uYjrG9TXiMJcEFYllnAjPSD7xNORjDVPXzA9UAGlIl085TOvw+wAYAjC5I2JHP91AwDsQB gFan7u2oOKjMv8nPsPZ/uAyn4qSRuIlOT6jhLF2F/bvb2WixGMxD1JwwsRFl8KKLYJjmtI vhyCpIomfD/8NWzpVgwSkiwXG0tQXOfYNOHNhYATCC6BAelQ3JuDhvMkJ6NmvHfj10HOr1 h7Wj73mIoXKmTuIEGiR40D8KUjIb6mqYTroPTpjIwao2Qr9xpDLuhnXPEppShA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481786; a=rsa-sha256; cv=none; b=YOsOdcPplXwwwmaVagfJ0T9pD4HodwY6MfoLxKKZJyvLG2Guc3Qnx1X4VH8l/ZhAo9p6aO 30Mxlfep0DETTH89bpR3I4XkWDILwfkzEPqPpcvPoeOucpS48f1bq0CrLRmubWaV2A40LH qrQbZhO/H5oAmBnqO1NcBoTMxR9U9zlI/2dI+iLZNyTMcGCEdSo89gg8NOEjiNjpN4mQj7 +KRooRFEuMMQ3q7HkdBmRoeBSqWtsaucQvx6BtPLJYx3BlU8ErqwM8+TJsRivyREqRgQPj apyLrtdwmsROuVQQ+DW2R47LzGkDfA75ZGnEXBpqkhqF73WVBaNncIJ0sgbNjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WkToUt0t76w1eqLpMfpf7sPzG/Dm8hwgI9EImfeO5/0=; b=s4pHBciLBRKd12jIWTQ5V6CdSi9+Cas+46W6s65Ei4OtEG7ZXmZnp67gBNyQaASLvz6+nE Wah3r1xTfvOHdK1/+Vnl7f4gMkJxnXvf8m1Ms/4hVwTL1P3vp/9AUgW44ebJhQO2EKSj5S 88MhZV1wPf/nSx3WBVnm4LTa/haLegwkZoSzVGLK4R+NYUoAZVS7rqwykYBOMVQMeXiEvD IprAMhdAIpnKNimIhZfdGouhDcD6C5wBneAsR5wtuBiKWBNv2ZknMSAMDRYZJiW1vyGq2A BZGh/oMMAtJ8PS10I0do+22G1NA7cBeuZ92VLLdZWIjCyIyiJePNQJSHSHXOnw== 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 4WzYy21VypzdyG; Wed, 4 Sep 2024 20:29: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 484KTkLb082744; Wed, 4 Sep 2024 20:29:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTk8U082741; Wed, 4 Sep 2024 20:29:46 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:46 GMT Message-Id: <202409042029.484KTk8U082741@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: 5d6576f4f000 - releng/13.3 - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 5d6576f4f000104802c018a77ca119357f9bcc6b Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5d6576f4f000104802c018a77ca119357f9bcc6b commit 5d6576f4f000104802c018a77ca119357f9bcc6b Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:24 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 (cherry picked from commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68) (cherry picked from commit 90af1336ed5e3c8556147325c4841c68639c4b63) (cherry picked from commit 5920b7e6eea1e1c46b78656ef75944fc0709e887) Approved by: so --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 58f2d53eb9b5..93161affd732 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -659,7 +659,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1201,7 +1201,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 20:29:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy34nJvz5VKmr; Wed, 04 Sep 2024 20:29: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 4WzYy333Qlz4JQn; Wed, 4 Sep 2024 20:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KRWtDEiPH52NeRINSEEUeu1Ve0NpTvlsH2EFntNyK58=; b=qsoRuk/9rN0I3XFwfKWMcCuHJecpZ/Wu1TPMPzklf709hWmWZBelI6f66MDI1LYErMvGyg nD/ql5FclfsUhb9FMQvpsE0P4uyQmz+V3OqrFp3S4Bue4emWBc6nMwFfAQXy04a3gcjVaF OWlfbccI3zXESU8FULHhc6/EvpcW9sRL0Oin3HILTO4Y2Ij3Indiw8DWLk5DwNLIx6IzxF 6aZPJnfRGTz1JpXAahhmvM5eJ1QR9W+9zk7iE0sILISTEsBgU5CR/474uVHZQreIl91O75 8eJ8KZApjMry/PsKvt/J917gXQRFJyPrHROLGrCD+no/WPX0iIAG8nglXnruTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481787; a=rsa-sha256; cv=none; b=DzbJRIC7J4DoqQVKw/sPweV09bIEmrNaVHD2UIY8xzlgILsPimf/oRubMa9Eb8j9Ron1qR PDlWsfxT/Jb+g0pxSsfAZ55ybu3nXfq1x36K47Xrm64dODkUshHasnVfxjATqP9GTpINqw kUXCiyGsoW4dzeCWjh9BLfC1naet5PDy8R93UwfFM5dRe83iGKkdNRqqHtfQRaUKf4sAEs h5F+VWi4fAEq8lMTx+SW0w4iI2Iq7dJiT3ZgANLFfGKNQsQmmtxn0JhGq4QY6ApnKtkrLO p7zUjTwH67L1VzhAHUFKRe2/FkyfI/dAMY0zuMxYgoHSLIM6ai4BhTUKhqPGTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KRWtDEiPH52NeRINSEEUeu1Ve0NpTvlsH2EFntNyK58=; b=q+df4Rvd6J1J2464FXfMd8OaKZ+PUpj2C0kpIkkhAq2VUvcSsowHi1K2M9p6ZG/K8CTgFi E63QIIeu6ZKXAEMi3Xtmbnjuqa+izM188kyP0f1aRapFKto6KBOstMLGdi2s4Dt4mWldNn //otWoN4Un+RrHxRMNlLSrUX6PhSR39O5d2l8Z8MQZ7HzULp6j74n12Hyuaj/ssC5RArBo R0t5S2IYtJBtdbb5feSXQGEnuZndxctyWm0rkannrsc5rwropy8NLWzi5Hf+MFSMjmc9Ec vNVfeMnB8Ow4Mf8kTzebh8E+zUkP3Zf+zbcy4vJr7LJivu8bi+vPJErjmC8Bdg== 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 4WzYy32KxKzfBB; Wed, 4 Sep 2024 20:29: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 484KTlBU082794; Wed, 4 Sep 2024 20:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTlEl082791; Wed, 4 Sep 2024 20:29:47 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:47 GMT Message-Id: <202409042029.484KTlEl082791@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: 4c07dbe5b0de - releng/13.3 - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 4c07dbe5b0dedbd193953c313320dc65532770c6 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4c07dbe5b0dedbd193953c313320dc65532770c6 commit 4c07dbe5b0dedbd193953c313320dc65532770c6 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:29 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit dd83da532c36830a0c0aac624903849262ec6f68) (cherry picked from commit 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63) (cherry picked from commit 5f49630fef5fd2358e8bc96d1b5a343d8225d5b5) Approved by: so --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 94050beee7dd..0ab5d16503ad 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4289,8 +4289,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4350,7 +4349,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4390,14 +4389,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4490,7 +4486,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 20:29:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy45NKWz5VKcS; Wed, 04 Sep 2024 20:29: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 4WzYy43Y3Nz4JZ9; Wed, 4 Sep 2024 20:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzmQIheVXA372VflWuFQ5yoXlhu97nAXE4uGdSV+2C0=; b=iyWwsOjuB9CrHlHCJJPwfaQDaB7gie9GBVn42XGCNI42gpsskT6DuoU8BFoPOL2TTUzRWp 8wkvetTvio1Mg2R69LUld4yH8bdEg0OpAiCP908R3kvIe7ZoZn9XrwutgtoTvBchkUCwVY Hc0e3H1+u1UMyLB4JOatsXJAtp44PHQXa7JHdZUm67Cfdt6p5U3UHEtessWKVikQH/Nsgg O+2OXLBtPCTfcYeEacZrO/wpOUK7LExx5j9pp3T+B2PpGZV8R0aXE/unB9sqNPzw/IC0Rj DMZRjOBEQHsEQ6MDc/LcYUUtqGaL/Z0aSshQumA+9ExGoEff2LxbH46jNDpnrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481788; a=rsa-sha256; cv=none; b=lF6NvsT1/fO+lcBqw74+XCI9CXNt4u0vvYE3zK6IJfmzikSYjdJUrf7qCxL4XcsBgjir3Z uHL3R2+gNSI1Jl0zpqd/EAfdVWrvAbChRvMNzwohb28rr0fZXPWqSn2Nax+5/n+sPcy/8a XCLy/tDGuHKGu8vRJf0lnyGnRAjKqGm8r1tv1VNj7zDdeOWbhGTS3qzSqxEKy5HWsoeybO VQIplM1qwxdVGnfnhBrmRw+1swGtk38zpRz0WqdDfpbl0L0kTr439+a+Lte71I6ZHz3BVH ZY9LRCK2ATF4NSU7qD5nI76srJwtvuRIFOMJmK1ltjCCzsVvk+6yGAkMoYCSyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzmQIheVXA372VflWuFQ5yoXlhu97nAXE4uGdSV+2C0=; b=lzMRi/SXu6LjOV7qdT/GzXIFKlBw+BlLvhw1tAXHYS6ORW0OXPdY8kVSOa6aTgyN0pvZ+6 iz0xVJDrn8wzvgd55df+Lab9P835l8En+HUvixHCBgJThdU3v1WTuQtRZJ4NAWg2+V9+64 8NeSSD4YR1t8a4fHuGygSVqnd1czUhVDRCRIdKOhT0OI6fejbMyK2OdoFTyylUs2rYs0gu Z1TOcUKxDiPcBrPM5yjiwSubDvSlpGnySfdwNXXcmxRuc3tg0sXGTj2LYcwBPp7fTk699z c+t7Dbn6Ijuz/kLFcA7mLwuy2QQI+itTpQEP/fomP/cIyMc6nTLNa9ckakpANQ== 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 4WzYy439Z0zdyH; Wed, 4 Sep 2024 20:29: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 484KTmxq082859; Wed, 4 Sep 2024 20:29:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTm2i082856; Wed, 4 Sep 2024 20:29:48 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:48 GMT Message-Id: <202409042029.484KTm2i082856@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: 01a7233a398a - releng/13.3 - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 01a7233a398a599827c25c84d1ce5ae4fe05e764 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=01a7233a398a599827c25c84d1ce5ae4fe05e764 commit 01a7233a398a599827c25c84d1ce5ae4fe05e764 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:29 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit 62f40433ab47ad4a9694a22a0313d57661502ca1) (cherry picked from commit be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed) (cherry picked from commit 40615bcae9e7f41ca857c773e804db9bd7269581) Approved by: so --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 0ab5d16503ad..7f13dd80080a 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4380,39 +4380,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4465,7 +4475,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4482,11 +4491,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 20:29:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy5682pz5VKcT; Wed, 04 Sep 2024 20:29:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYy54j0nz4JZQ; Wed, 4 Sep 2024 20:29:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KklAbJcYelKzN4WCYTtDnIkVDctr1lt8/uiGKWxeFZc=; b=pABwo2+wD5C1SihShvTr02hBz6MlMTuGrOHeCNL5jUNJyLeJuoH1HZnLO78S+yr/2krBHZ N0fovl6mC7acVkXHCFNr0dfUkKiS1mZAQMf0FZq3zF9bg2DzyYswYd++PcfRKPC+f3DQmQ gRtYsKxzq8LbfVl3r04ZmTy4Xei9qD25JkDUr2FByf2cradu97kbKtPfDwCzW556cEWdnW XDLAUqQruN4h2Z2rpQpysJ+Ft2YzPxFG36c538Mi+0J7mVThEEeUSyH0ie5rbrFOdKSh+E wmKypjbR0VXHcetJEb8RnVLziIZVwbXlupM0Px07kg88rABVCrrAV9FNgOEnLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481789; a=rsa-sha256; cv=none; b=nY5/5dWCO1/NjolhsKqYWQoQYUH7SsVHeQOVbfNkmbeQhwQh6PbV5Ea2rod7nwzUP8+S3+ gwwMYEttbe3zYwosZUKS10dNfqRogFsPHlRnlQSq7tbnaossSqB9ZMwq4m/Hi4txHh7JXn GacfgOA9yaOE/QQOnzxG607a6TS1oowOHpEIbipNNVrct224bRY4bzXT4qlXyDmtKr4ag/ eJYr2yil5pO8fLbUfOffMsPS3CIiw6CT+d/bI6o30C0GWyqnYG/PaHZOjmKenKgQh0LTlS 6F4eCgBmNkz+ECXQLsFjUom5qHxo26AruT8MQdQtUYztdVJOJZKK2xUnC1p2DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KklAbJcYelKzN4WCYTtDnIkVDctr1lt8/uiGKWxeFZc=; b=jY0eR1JFEXeXvaJYElyj9cD73FIyNm/A9I8SKo7rJ8Szmtff0JNC6n8bXSXJzCcA5f2+u2 YO7GkImjH9l4XAI+pKv/qspjjunJQQjeTIdwFXZuX7UfdvXcH9UpzJkRf0Yk+JmyT6yH7j 4xmOttnSLTA/11ju9j8AUzMcuEIMq1ddYYILyWvXUF5HDhzn0H8gDWRcKYem4CZpluSE8m pTNazqREyB7vxUEMqa7mtpDIr0fF35zZl7kLc9xlh49GJOWnSCUKAOcA2Adn2Ji3DkHQpn 3K/PE+dVnuGBpLJCLMvLrW0CddTEIBxkUPHPyF6s5ICmb7hKoxHaBEXSIju0XQ== 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 4WzYy54KRkzfkQ; Wed, 4 Sep 2024 20:29:49 +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 484KTn2N082904; Wed, 4 Sep 2024 20:29:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTnZw082901; Wed, 4 Sep 2024 20:29:49 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:49 GMT Message-Id: <202409042029.484KTnZw082901@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: aba74e58f757 - releng/13.3 - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: aba74e58f757b3cdfd63cc1d0e4b877c0355e9a2 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=aba74e58f757b3cdfd63cc1d0e4b877c0355e9a2 commit aba74e58f757b3cdfd63cc1d0e4b877c0355e9a2 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:29 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8) (cherry picked from commit b20ae160872071fc20e5dde27051792177057fa5) (cherry picked from commit 8cf43dcd3db6f02f8dc3f0aa23965db107190789) Approved by: so --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 7f13dd80080a..47fb595f433f 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4330,8 +4330,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4351,22 +4360,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4466,11 +4487,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4484,12 +4512,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4560,13 +4596,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 20:29:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy81kQSz5VKqJ; Wed, 04 Sep 2024 20:29: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 4WzYy76sHXz4JXG; Wed, 4 Sep 2024 20:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2vIxlcMNu8uAGF8T9T1qHEBLCEHMSp4ajh/ZIN3niA=; b=lHweWjb4qiGljxnDC/ZSan8sFHk5qYrry9RueuUvKKI+7KZ1/AF9HpSLad1exCe5k6Q04o 0lrI0pEzA8GrG2QtsN2D3qpBMxnOPv+i4IXdrUTFLgQa/Fd0DOiHpd16QGTfPH71YmLgOI 5VUK+rqYb6QVnFSGHOkN7BzT8GsRFWJv4x1HsX/43o9rxbEaljDYgChyIdOGlQHm2PiC3P SdLHP7cYvfFxNQbynr72oa+SVsv46/BBDtQqzjmK7eZL+XZRew4vQirZC5uQPglZhBNpRk DEF2CjjQpYxKKElGhbq+z5vaRsB89lpXPjh0R0Eql+x7hgSn0SZlsmWOhwDDUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481792; a=rsa-sha256; cv=none; b=X1mkZmKjq+GtriQQg5853HY4DUR+VS3W8yWAexbuiSIHgzTyd5cNew2iEyAF0U9QLYGGHP tHOdjR+R2k87BeJGeJNnsxun23IvhrpuJq0NkQegiOmEvqvtdx/OvK6TiNVkFgeIMOtd2/ 1Cm0u4qJ5PHHaTdu3l2yV7/ATE84WlTuPdJgKLe+jMhhUmRLUPnHEJaoFnSuIVnl3oYPJx 0trksV7GqdhD7B5yDPiShlMh7kNOZMDQxe89ETJ04jdC5xl0nHUZMGX9YEt/hLR6XlpzTz 2D/38680wc1pwb6yBawBnghto6ModoezNSz6LcB8ZcDUHVhFDZENvDivk+q8nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2vIxlcMNu8uAGF8T9T1qHEBLCEHMSp4ajh/ZIN3niA=; b=XiGwDrSWHOpMHMwrWhD54cQjrdmhzjVvU/5uI9uoxI/X4k/LjUIpu9g8CgF6IXxriADm4Y Sy3p64HRG8ceDTtxnVTNS0FcsrrGRgYN9bVkckhNQBMopvJJ8oyIyGWaqp6V71BfguJqfy vsio6meCFsmtWvCuLnsz9Y6d+XbmuJ0jzRWvTZF5X5/N6HvQdAD8+XDCSJRwFfpsqb9DFC Y41vytcQ1pDHkTlBTw+N21JUUlalr64j5b3flJcbEJppZaSbup7r+KAwf+onaJLHR5PZdm /34YYXfQKMG8wFbAXSJolex3+DTDA19ZvZ2jJRZ55XUApHuVitkUdA9t81f5Dg== 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 4WzYy76TCkzfkR; Wed, 4 Sep 2024 20:29: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 484KTprL083005; Wed, 4 Sep 2024 20:29:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTp8b083002; Wed, 4 Sep 2024 20:29:51 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:51 GMT Message-Id: <202409042029.484KTp8b083002@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: 811a30c55a20 - releng/13.3 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 811a30c55a20b5e0f68b806a2b2ee4e05044e735 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=811a30c55a20b5e0f68b806a2b2ee4e05044e735 commit 811a30c55a20b5e0f68b806a2b2ee4e05044e735 Author: Ed Maste AuthorDate: 2024-09-04 19:32:29 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:29 +0000 Add UPDATING entries and bump revision EN-24:15.calendar SA-24:09.libnv SA-24:11.ctl SA-24:12.bhyve SA-24:14.umtx Approved by: so --- UPDATING | 17 +++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 8ec49065a2e0..d062be76c45c 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,23 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240904: + 13.3-RELEASE-p6 EN-24:15.calendar + SA-24:09.libnv + SA-24:11.ctl + SA-24:12.bhyve + SA-24:14.umtx + + cron(8) / periodic(8) session login [EN-24:15.calendar] + + Multiple vulnerabilities in libnv [SA-24:09.libnv] + + Multiple issues in ctl(4) CAM Target Layer [SA-24:11.ctl] + + bhyve(8) privileged guest escape via USB controller [SA-24:12.bhyve] + + umtx Kernel panic or Use-After-Free [SA-24:14.umtx] + 20240806: 13.3-RELEASE-p5 SA-24:05.pf SA-24:06.ktrace diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index a1f0f7b0d08e..e5e1d3897a35 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.3" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Sep 4 20:29:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzYy70rWXz5VKmx; Wed, 04 Sep 2024 20:29: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 4WzYy65tKPz4JRn; Wed, 4 Sep 2024 20:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1gy6MgbdYOtvyAzXq7wgq1oCdlfZFmEzgZPTrkwHQM0=; b=xn0RfK2bQKqDcVs/SIsm7aweozPsoSBzKw2NF0XFNoZA+aJFEgdUpMZz2sy9Dtb1b4hYbU tdToSsoDH+GpaBb1E9UveO1XOvZkrKnKmj3ADon79x2O4dW3Mf8BKceCjKs3U2LU6wVMS1 ekB4+u+3Zw8dBikFOoLZasmQ0I5Pv4GH0KaPwf1joJstJ81NHlB6FID4Pr0bkqzI3WEU9Y VRQvoNlLMDogxNjBlh2HcQ5ygtD9xNCOJO84hjLh9RTyhh+WosgFZA3nSoq7PJvDV7f1X4 C3LyNT+mb+o5fLUFJR8GSGQEptXGOVw1g+Ia3xG+yuMpINzOynd1Ixj2GZ8GBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481790; a=rsa-sha256; cv=none; b=aasgtfScbzOO/sAqS7Qz5fRKp/4eu6ydi7d2/Q0QVM87QbKaEVlRXfW6cbeU81thcxjzPu Fea+TP+JONa7RuIHiT35kmBh2tJsk22G/cG0TEAzxRcOpsM/3Gg8rn5yRA1+Jqe+HFknIG XFJiGG6ZAro6Kyu2H8+cFEEBIi1U44dCKAhpwRKku4yyBdAWhUNI4+BrmqRNnkP6z4K0sv +c72IYaeP4tFc1jz7LQ+cQVW/Fj7Ub8xHppi304LTOv30EISQYXV50TylQfw8hNFlJZ2WS DOFVTP6FixF7HSmbgJS5YQnnRrLH3gC6EF+rJlOHqceT2Iafg4ayeJgQW/cH+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1gy6MgbdYOtvyAzXq7wgq1oCdlfZFmEzgZPTrkwHQM0=; b=Whjvz35ANSNCpSb1V1JYexkfL/Mgg6yOCFNxJtJD7uwNae/e0xr85GWrojctSEPK6k5pZ0 Yt7U9ZrguTLRmodINcaAhTzCa5icgUXbzLgKJUsRV4w9ndF73ZpqgEkPqtBShaFlTnb4vm ZRjnFtZY+PsQQFGZlnr4LnbItmw3jbKeGSPwkdK6rzVrZH3r3v0AwVrjQgMsv9ZHHKHtZs sVexGqpphGQTvdjAmfU23R2MtWwKoxlUj6XrIFXypYpbkWV2QS1Qg/t+XMtJTdCCx9CKgh VGLmBXdJaFwMkwPth+H5J0LVzu4Bq8DqQnANhVVvOcdCZR+K9chgdRKUNlxobw== 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 4WzYy65Rt9zfmr; Wed, 4 Sep 2024 20:29:50 +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 484KToF1082958; Wed, 4 Sep 2024 20:29:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KTofa082955; Wed, 4 Sep 2024 20:29:50 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:29:50 GMT Message-Id: <202409042029.484KTofa082955@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: 8fd0fa88b5a6 - releng/13.3 - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 8fd0fa88b5a63464165f813df83d371f89853d1b Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8fd0fa88b5a63464165f813df83d371f89853d1b commit 8fd0fa88b5a63464165f813df83d371f89853d1b Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:29:29 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c75a18905e308f69b01f19c3d7d613883a008e79) (cherry picked from commit 4938f554469bc81783998143968ec3eba2a43def) (cherry picked from commit a73a70472c47877d57d090ef77ae503fe75e9f41) Approved by: so --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 47fb595f433f..29931499fcbe 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4356,7 +4356,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4404,7 +4404,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 20:54:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVB2FzYz5VMPL; Wed, 04 Sep 2024 20:54: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 4WzZVB1hD9z4Pfd; Wed, 4 Sep 2024 20:54:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wARvEDljJE1zPyuHknOy+xon+1GoFRVCKVmS4Pm1CbU=; b=b/i2c9VTCLgufsiszWSqqGDDCazxQlTqiz9ALubjyW/4uO8V9aALiOQc/1hPi0NVe5wh8j kEkJOT8o/Zub66M/o+tcB1fhgiANT1b+Zn3yVEgROK3w6ltyK2nw4x5+NZmK9yjrpD2IMC twU6waws9PTu2q/wyORWHngrbgBrLPZazd9Z6l3vaAjOXgtiKs69VUSGh4qPJS3xzlr2cn gvYsRm1Tt1LtIj3YQlF6XujJD3y5zRraMynZotmLdqSyWna3EZlQOFWhD3zT7Ts/670NJ0 ogzpHVvExhvQ+nFDf4R4RxeS1my0J/C11XyDHNbejP5QgfrbjgLMFQQMh3wBVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483250; a=rsa-sha256; cv=none; b=h8Ng/o7QLGvdfpUv3hvgy/7Y+NsejRckf2B9/RmA3Djw7fhsfbXSBDSnYFhHWSpuSLYMRZ l0pvuV3EUxuScuciiTDH3QC0pfvqqwUPz8i5WMLDBN6JbB1V01oKzimMahGiyOwe7EiU1G A5G6zql620QF8mgA71r1CvfnfBRBVKysWcpLLO+QM5cs8wo839HjqmhLhBB1ihHlCAh679 B2LjIzOdDdUYmq/LhzrzaoJQwZjq7v7M6qHNlovaqkwsj+fvEWDOqfVxHoIwC/NLPD2xHO YUC40KwpcOQWB7EreUBU+i7B2KQNBs4VEzz3GZ5VPQS2G9DnbEYqC0fwakQTRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wARvEDljJE1zPyuHknOy+xon+1GoFRVCKVmS4Pm1CbU=; b=I80eBaFfZ4h+Zwn1TVdKcdtfv+3/lTVk3hQaoeylPV0oPuzncnSdiu/n0TG7N6Sr6NTWWU LznjBDjj0boYV9Apr4//s+M2HrcqHnKEzK4FtqRqZzcTmrjHTaNs/E0aWCCXk8VfWCxZjo evU/PBNKoot/wARZxH4lOCJnTlJVJKYBsNdi4f6d/7k10ORFE4ZyGECS2+Xb47PAlwUrrw Bo+AY1JHcaqqdZtkpXGcIOPsiy2D7KY0k/ZeFLV1BHGKzR0swFDtUkt9MgYPUhkutD87kb i/4FAHy8a5lYEDGAcS+UuFq9wyoo9VkyNtXb3FWRAw8WiiB0NWM0sizx6Wa9xQ== 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 4WzZVB1HLszfvV; Wed, 4 Sep 2024 20:54: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 484KsA4p033591; Wed, 4 Sep 2024 20:54:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsAUE033588; Wed, 4 Sep 2024 20:54:10 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:10 GMT Message-Id: <202409042054.484KsAUE033588@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: d94dbaa516e0 - releng/14.0 - calendar: don't setlogin(2) in the -a user handlers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: d94dbaa516e0c7fb05a52f1c76020165482b7bf0 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d94dbaa516e0c7fb05a52f1c76020165482b7bf0 commit d94dbaa516e0c7fb05a52f1c76020165482b7bf0 Author: Kyle Evans AuthorDate: 2024-08-05 18:43:56 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:31:04 +0000 calendar: don't setlogin(2) in the -a user handlers As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a` will now fork off a new process for each user and do all of its own processing in the user's own context. As a side-effect, calendar(1) started calling setlogin(2) in each of the forked processes and inadvertently hijacked the login name for the session it was running under, which was typically not a fresh session but rather that of whatever cron/periodic run spawned it. Thus, daily and security e-mails started coming from completely arbitrary user. We could create a new session, but it appears that nothing calendar(1) does really needs the login name to be clobbered; opt to just avoid the setlogin(2) call entirely rather than incur the overhead of a new session for each process. PR: 280418 Reviewed by: des, olce Fixes: e67975d331 ("Fix 'calendar -a' in several ways.") (cherry picked from commit 6cb8b61efe8899ee9194563108d0ae90c1eb89e3) (cherry picked from commit 33708452aaabca205d81eceb83e0813e5882815c) Approved by: so --- usr.bin/calendar/calendar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index 476c0495d218..2e3baee7d57f 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -224,7 +224,7 @@ main(int argc, char *argv[]) lc = login_getpwclass(pw); if (setusercontext(lc, pw, pw->pw_uid, - LOGIN_SETALL) != 0) + LOGIN_SETALL & ~LOGIN_SETLOGIN) != 0) errx(1, "setusercontext"); setenv("HOME", pw->pw_dir, 1); cal(); From nobody Wed Sep 4 20:54:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVC399vz5VMTb; Wed, 04 Sep 2024 20:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZVC2Q1bz4Q43; Wed, 4 Sep 2024 20:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bHhRH92mwxLnMjZF0vU5WRuNRGgqwzhbJosDZxfYXcY=; b=rbSWRNhspj5ZR/eTILmVpuB6KrxDfdpjrVBLgQThWcrpsmq67/EQ7ozv+ap8NRnGQ6V5jW 6XLbCoOZySn9QBCvOepjyCKy3U7nyepjbOZGyZYltRI4GFjZbkFQBSIl0FNnSt9paHwy96 czmJM56GiQHWhzU5OArOlkqIgbSZxZhgRg8Zey+4v1QTlqtI0PPN1Rb6ujRprY/L3Urm0K kjvn0rqKcVJb1oaDJT48fD5ebJKGB1WDTid1hEeUln28sMzrF2nipUfNU+9yM+qeUr5qyv +NVImo3G/zlEb+JAcdLyJFeAF9+KWZW7YzEuL/EgG4xKpfaF2NI0gScQeXQycw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483251; a=rsa-sha256; cv=none; b=kgw/3gIBZulxmAeUOaSSSGG3jWVS4/R8cnFaxUFi2zj0SFSGJ3X09ubtDzhQeRORk6pvfV iEDhoctxTBY0qTTWoogDpLug5NNFKS9LaYOxx78PH3km4UfIrjxrx5VNrVmEs6JAZYl0Ji wgqscXh8Tyv/vCSyzHHzehtBk6XucxSYT4ZVyGllpXHKVhWdgueMcc0JoYZ9YfFUhHaJOJ mqWWgzYX3AuQMOVvPSb+YS6hLt7xUQ4Z2VXq418rOAFOewwrcBIM18VJhxFm+0EHX4obcO iw/XRBuFXT0XxNXadfbr6Z5xznUdeHEGDwNqhhKWSQd5/KZdID03lJPpuZQ5/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bHhRH92mwxLnMjZF0vU5WRuNRGgqwzhbJosDZxfYXcY=; b=Sk+CbMdcNtKWISDq0NrZR0ifTTdjiig/7KRtKBp5DWIoQJsQFZGwJgn3mPTYCXWgiB71IV zfKw48tCc1TAj7OdKNAMJ9FsIlMOiXvC+i/R8rBhYyuREIPR/8ZfmN/me2v3kv8zl7MMKM h4jqlM/PC7HVhxwzp5PvhHWj6HUHNsjmNGpeUC9qGXBFWL5Der61FwBIhDvna/d1m43JSM FOtHQYQHqnyHozDhP3LjALm3oH3drJJEQ2/Yp04vWzemBDQXSgR9DpAjpHSxorfz9pZzzt Yhb/E4RI6Rc8OplEW5v8PEBHK5a9Cg71RJnY2TQoi+rt+535+Al90p4cw5zfrA== 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 4WzZVC1zzSzgKV; Wed, 4 Sep 2024 20:54:11 +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 484KsBJn033639; Wed, 4 Sep 2024 20:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsBjs033636; Wed, 4 Sep 2024 20:54:11 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:11 GMT Message-Id: <202409042054.484KsBjs033636@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: 69d50af527c0 - releng/14.0 - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 69d50af527c0c38f7094c64aaae9b85060364f61 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=69d50af527c0c38f7094c64aaae9b85060364f61 commit 69d50af527c0c38f7094c64aaae9b85060364f61 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:48:02 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 (cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071) (cherry picked from commit 371af89975e3edd1e9f57aa5efba2598b63c0d2d) Approved by: so --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 0c76fefeebb6..9560ebc74f83 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -999,7 +999,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1092,7 +1092,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1330,10 +1330,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1360,10 +1360,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1393,7 +1393,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1440,7 +1440,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1507,7 +1507,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 57343f953e94..64078b10973e 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1313,7 +1317,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 20:54:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVD5Yy0z5VMrj; Wed, 04 Sep 2024 20:54: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 4WzZVD3hhbz4PYj; Wed, 4 Sep 2024 20:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FbMFWPhh8gMk2ulyv10v8MTXLkfw80DoQ1yzCM5lNJc=; b=ensWsPoFRMeT77RwRQ39q2xNLZeTJxe1rvwK0yaCdV+1+QeJcKAdEeCnxPSOE3m0oY2QLY PcGnjxKovJkoHkyVcj8UAncytJYbMTh8jEhVj/oQjvnFk0vNIwtE1toD37MTPEqU0J4K7m 0CMiuT+Z8F6izP6A6pLD7JcPrHwLtpwMcZBZ1KtzVFx6BaOBMSq7q3dKdsuuxFPqxo89sE aLcCyJWdX7W/WxQ+sxkuts/pPGuqv3dj3YXkr6ak6sEoqsX+WYLVIauWvSla7i+5z6o3/i TyxsVz9bS1WT8MJVmavOx3ks2SB3tvErSabgjp9NDm8AyCKr7N2ERyJ3y/wGkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483252; a=rsa-sha256; cv=none; b=uNVzEeU7MU4QtMneOfgCkjmJmUzhlH7uzgVtSu2qKiAlw01y7Mdd5naO+n41kt7oHbwvI5 6SzkvoeNXx2UP2X6nqhDwSZbuWo31ZxmLydTxV49cEs6IuIAEwm444pKUNSZ4R+mm/kuJu h2SGhj9a80sG+J+xrO5CZsxgfptS8XXXVHeJ8URMjhLB5LMIZCWFu69LZw03eWuETo6ebu X/NDlKE6EQmYCKBW53CrOIasSJytdbTiDdVrwxAbm8t3SjcFjMXGgtLcUPwtYlMwU+jSGk tXfj4599kV9M/U+v/2Enl2ZoilZXNSlID0xQiRf+1kSv9Oi//pIZumMTtT+xMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FbMFWPhh8gMk2ulyv10v8MTXLkfw80DoQ1yzCM5lNJc=; b=o15PGSb7c9D1FglqsaXLpaSLRn/A8xDTTPU5GXUvKJeviQ2+mMFd5Cn16B9DyjL++Ax9CU jnPmGSXKPv94vWx+gjuxwSZX1QSGJmv5BmXHL47ArMazTr+XLJojxAL/YN4DtegfpAoQmm v6/1vffasUPil50NYoHafprLM9YOoYTE2+sWZuW3usDled5uJPv2KrM9wyYfVbsTd9NlwW uVbgwn1phZ1VpjbfugCzxXqxDcq5941HlEzgLIh8DQCTFyrPFMhX0HZQV0iI/gT7lv91vn Lr4A3Avw8UU6URDocybWOr7kxASCAu3QMPhty6EtY33dnihYfrxX0ubuCBoebw== 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 4WzZVD3JjFzfjG; Wed, 4 Sep 2024 20:54: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 484KsCrk033687; Wed, 4 Sep 2024 20:54:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsC5H033684; Wed, 4 Sep 2024 20:54:12 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:12 GMT Message-Id: <202409042054.484KsC5H033684@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: b219ce1c5a93 - releng/14.0 - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: b219ce1c5a9349f3925daf994904d4891ad8bf9e Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b219ce1c5a9349f3925daf994904d4891ad8bf9e commit b219ce1c5a9349f3925daf994904d4891ad8bf9e Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:48:29 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 (cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae) (cherry picked from commit 9c2ef102166eaab4c2531eb0ce6ffb20b82e778a) Approved by: so --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9560ebc74f83..a977d7941aa3 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -988,6 +988,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 20:54:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVG0B2Xz5VMSY; Wed, 04 Sep 2024 20:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZVF4lKcz4Q4d; Wed, 4 Sep 2024 20:54:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483253; h=from:from:reply-to:subject:subject: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/FncMrYdMkt8K88/v157wKV5hsLu57iZ+I0b83RcnQ=; b=ClmYmNIsHKiGsnNT2JceCOIlIxFzm3w5uMHJg/JzgdoEHXfzyUT8rcMHaw2ABczUzBeEgo pYIiX4ny2ktm/WnL7GJ3t6EYLyymqv8u7ZpqzrxM1DfZgpHDdau2PMGrppIWxGc6wTHcLz NU1ulYtQ7g5XKLX/yT5kXiYcMEfn+corz8MmjjVkU7Lku3BjjMeOBlYkFKW81GOAu1ohlO 4Qs2FSGuwuvQlhMhOYRKoCsVM6rjNcGbTWgnDiVm/hSrU5PqL2c8p7D/b4mEYg2/TaB+dq ztkv0jVcXpyVJF9i0c6r3QusbsbQvfokcklFX9zSn1zrZYQZsUSbW83fEhpqfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483253; a=rsa-sha256; cv=none; b=LqM0qPP57IOnChMlCpzM4uF42omGpv8r1721p1iPjkHdyBEx3kxzlHL/J+icJ9PzTAfuDr M6QrWARvwJDSHzkorX997BROJoGO+bIUs1UJjn/X1Q4IK56Kd1ju8qF9i4Gt1m1FYGYV5F lrK79gEee5KtCFWfGRDFA8dtX1L1A5L+bMlxPQegvF+T2npHl8RQ9hOk6ceOv/AW7Niek1 z91YnfahlCcGPyf/TGA2johU8jfBrVDkeOQgi524yWYm73QfY2FrmojFVuCr2EhCkBCgfT uayRC6zZgeXwENr1GAJ0Lhi6NlUh4hDON5SYEgTgA0GMFJJWyGfQbcJA/hSnKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483253; h=from:from:reply-to:subject:subject: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/FncMrYdMkt8K88/v157wKV5hsLu57iZ+I0b83RcnQ=; b=CV0/lXIwJxzuWmqdSkh3IRz3h5y8RQE4eW8bN6D6CDzxMmrPm6tm0ol2qi4p5ylmRCeiTq pB19toiU+HwdAsdljVSPb6MseEueXz4rQhG2BiVYUHGTOTrNNhSWt96XIuhfC/sGO9WLYA rxD0VUkAeLcwTwHKsPzO3hhxPlWbEjrPxGPQ8FIYwCEOChOuoBSxps1zWqvmVyebkbgVRW UXhfcd0ZtqUB+yBJUIbd+AZMP76SNCIiIoV70p3s7SmOpUZ534m/a0Lo189ECg7paNWun4 60gckG3wRbgXfqgEIwGrnasSrTa/XJZt1rgbXHkuUsCARZKi2UoVVyJun8cxLw== 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 4WzZVF4KLdzgMq; Wed, 4 Sep 2024 20:54: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 484KsDcP033735; Wed, 4 Sep 2024 20:54:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsDFC033732; Wed, 4 Sep 2024 20:54:13 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:13 GMT Message-Id: <202409042054.484KsDFC033732@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: 429f200688ca - releng/14.0 - bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 429f200688ca621250bca2dae3602d8153858f08 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=429f200688ca621250bca2dae3602d8153858f08 commit 429f200688ca621250bca2dae3602d8153858f08 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:53:58 +0000 bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler The function tpm_ppi_mem_handler is vulnerable to buffer over-read and over-write, the MMIO handler serves the heap allocated structure tpm_ppi_qemu. The issue is that the structure size is smaller than 0x1000 and the handler does not validate the offset and size (sizeof is 0x15A while the handler allows up to 0x1000 bytes) Reported by: Synacktiv Reviewed by: corvink Security: FreeBSD-SA-24:10.bhyve Security: CVE-2024-41928 Security: HYP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45980 (cherry picked from commit a06fc21e770a482c8915411ebc98c870e42dd29b) (cherry picked from commit 6ce4821f0859eb00e1754917e1471184755b6358) Approved by: so --- usr.sbin/bhyve/tpm_ppi_qemu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c index 8bea45ea3208..11a306077108 100644 --- a/usr.sbin/bhyve/tpm_ppi_qemu.c +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c @@ -26,7 +26,7 @@ #include "tpm_ppi.h" #define TPM_PPI_ADDRESS 0xFED45000 -#define TPM_PPI_SIZE 0x1000 +#define TPM_PPI_SIZE 0x400 #define TPM_PPI_FWCFG_FILE "etc/tpm/config" @@ -101,7 +101,7 @@ tpm_ppi_init(void **sc) struct tpm_ppi_fwcfg *fwcfg = NULL; int error; - ppi = calloc(1, sizeof(*ppi)); + ppi = calloc(1, TPM_PPI_SIZE); if (ppi == NULL) { warnx("%s: failed to allocate acpi region for ppi", __func__); error = ENOMEM; From nobody Wed Sep 4 20:54:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVG6rBKz5VMX5; Wed, 04 Sep 2024 20:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZVG5mGmz4QDB; Wed, 4 Sep 2024 20:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7cE7jIQWUCXO6H+A3s80+xfxHfKEe/rm1o2dz2jwmQ=; b=OIOl1KTJ051MCOwPlTVTt5711tvYo2FEXsolwd1oWgAvBvDh344+3CtIy9K4eOJykgSGzs WWs8JfqI2gEh+FIZkDaK/Y2+LQibL/Wr6GV82v5XEygt/e7rVPBDor8bnQ/4Xc+2D70thJ KCCi7xs3Lg2dWqGWhBnK56u51ri+4eYkNshaZll+V/cxf8e4IfecHtnZnic1csE6o13ltn DVnjxIX3xnoTg+L+A8S7QB5b9OHP/eekfC0hkZBj4k2UNS2FdRsxsLAkaj+xAzaGvPrFCO 0s0GXAn2PkWLxitqT00dOEWeAYeZW+GNIuNc+pakEvM8F+CIeQjsRyW3HDrN+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483254; a=rsa-sha256; cv=none; b=IYq9HhXDjENCdvF4YBoLm1dILr/BmI9+8IpW/2wcOYFWEaFAW87wKLaHbv1Iw59jKvcFPU qg0kujxt+IsuaOw02u4XyJ5Vnlu41I2FGqtTd6vciShsEktC4Ofz2ooxE/ZT7IcCunRc0s cFi86f5LMKqwQaaCjb2Lel8mfB4KKRQaC/4DT08NUxuj02A1GCS6j7FuVHL5Hedrg2qCvf mWo1NnJOx9pYvRdD0P7FdRkviecGooq2sNjIoRLO3TJMP3ejIPEraH1VKWgLMRaE5c/0cC PXW8iB8JtiX2cagrQWAcUo4k6twS1oYGThiPZCzaqlzQSGEhbr6OER6LUsCSUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7cE7jIQWUCXO6H+A3s80+xfxHfKEe/rm1o2dz2jwmQ=; b=htW0m1Lr+uUgmN6KcKzIpmvvSqkVMaNgTyidj3FcxnkFaTC7A6UscnyqPLhtX/C9MvUmxc Oh68dCyEp7zO4GUXtlxhU1bZ6lq+ulB1FWATyWTQa38J2/yb29XLkkTzA08qzUHlis/xCF mN7jmVo2Xoktq4YEgEIvMIiNARXHIBKVQ4liYfV9I3YGNeCCN1v0ptvT8CZh39lZC5/M0b f5BZib9DRIoVeM7EtX849Mm+prr8yzuE4fMVOYS/EUnhusGa1MEM2J8KOeMJbQwumdDIb+ 08GB8UR4psWQZCdJGLLODaVptG8E/geYxDljMfAmPL014FUKoO/VepQLmjA6cA== 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 4WzZVG5NMCzgDK; Wed, 4 Sep 2024 20:54: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 484KsELV033783; Wed, 4 Sep 2024 20:54:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsEdF033780; Wed, 4 Sep 2024 20:54:14 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:14 GMT Message-Id: <202409042054.484KsEdF033780@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: 0a271608b328 - releng/14.0 - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 0a271608b328aa554bf9bea1a1108825cad89eec Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0a271608b328aa554bf9bea1a1108825cad89eec commit 0a271608b328aa554bf9bea1a1108825cad89eec Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:02 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 (cherry picked from commit 670b582db6cb827a8760df942ed8af0020a0b4d0) (cherry picked from commit 29937d7a1a0a3061c6ae12b5b35cc32b03829501) Approved by: so --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 6faecb0da0a4..004e86900342 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5673,21 +5673,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 9a87345015fa..85f4f6137810 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -410,6 +410,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 20:54:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVJ17Lmz5VMX7; Wed, 04 Sep 2024 20:54: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 4WzZVH6BHkz4Q53; Wed, 4 Sep 2024 20:54:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y/XwN6+0MODEiUwqBsFd24/63fttvDz0lV0SnP8RLLE=; b=f+mHP8Vm+xPTyeozdKfkJqb8BnE/CcMrHqQ0R9a+jVVEzswgDhsRVm9vPg0CTLGFewT05n 4+yjPi6aVQA5xOZ6YofJdjVTCnPL6CA1h+bUSqIh9C4rBHqkJt/xsYJTDGyf9AoK34pL2l B07wnZzedx7DtH6wcJnO06qC2q1jgl8fG1Lq6UX6TmRE3+CnC54VjZ5hY3Xw1pnxEvCVD2 Duu783vQBcj6pHvjPiDt+w4GMFn4oaRKXzIMmzPa1rF6jTJ6H/va0rOp2XnTNu1Txqd+iu jNUXQvY2IXdoC/djZz6/XGkIeCkhB93YZFjjh4Mnz8HWuzxBwrV/IwBM9bOAFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483255; a=rsa-sha256; cv=none; b=pBWaz6GdTRSOHE696uRzCE7wUDaz0B5V3YIiPeec4C/MQhHeJ1BM0+7zBbQHaCJONs2s3H hjx9JNYfOKxv3bouUDS11NAXZ7waJZk3/wNYkfqaE0VIqTgxuGPi36NC+WGjwZOZ7Kcrio YSRJbWArGfPGRR2HT08o5iafhVvwcSV7LGSPfXz3VzuEoYk8XWGuKex+bJaUOeEV0LKlnB /teaCbc2hvgP95pQwAjDBEbwNd33/0dXV6xZ92s1oX5Wra2BLmwwv4VpM+ZFREc52TLNie Tfrx81ZaGOjavsABLJhdR020Uq5nrnc8sycBqqvMLYWmq2GQhO9GZOax7bbAVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y/XwN6+0MODEiUwqBsFd24/63fttvDz0lV0SnP8RLLE=; b=bjYlOf+e2nt7+lCRd2qrCG9u2+D0GD14KNVKsdKv6JXdC3deI5SWwEh9aN/1s4oVG4Lkd9 PO/AN0hcOHtOEfyXT32ZZGYBAN7NZ+/xaIfkuOVTY/N9oOBpaggncb4e/flDEhn4X7SwOE c+6gJNG84wvKxmf5+/PEi8QLYSkTz7UcjINqFBH9e7KEKxnUjorVKn1dR6wTx/T5bVc7dJ uup7XWz5T6+3phcZLbGHVZqiwKYQtUthQS/V16s8KiWxqdNRS9a99xH78Zd/y3oYMp+rvO CqN6VbG0mHfu4Lzb7122dCrneFVgL4e7n4e9uxKsYVHxkkOTNwRJBtaS5KqePA== 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 4WzZVH5prBzgYB; Wed, 4 Sep 2024 20:54: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 484KsF8n033835; Wed, 4 Sep 2024 20:54:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsFKi033832; Wed, 4 Sep 2024 20:54:15 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:15 GMT Message-Id: <202409042054.484KsFKi033832@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: f7aa7c38318c - releng/14.0 - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: f7aa7c38318c700cc6915b4a48941a6b9a0807c0 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f7aa7c38318c700cc6915b4a48941a6b9a0807c0 commit f7aa7c38318c700cc6915b4a48941a6b9a0807c0 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:02 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 (cherry picked from commit ea44766b78d639d3a89afd5302ec6feffaade813) (cherry picked from commit cdfdb3b0086268cdc365174ebfb69e66b5dde0b5) Approved by: so --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 004e86900342..f48fc203b90d 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5634,7 +5634,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5675,7 +5675,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 20:54:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVK1rpZz5VMsG; Wed, 04 Sep 2024 20:54: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 4WzZVK0cTPz4Q5X; Wed, 4 Sep 2024 20:54:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VgsABGMfzIlRaotesFlPasoGAsfntzG69egjUcpYIzg=; b=ClN8TDq5bfDI74ltlz5XUH4gAhljXYQnxJYD+JwAVs9v9QqUN+0GrAEcCf7qCM6recZ0gY GcH7BgVC9dbfmlMAj1GsmIs4CEaVOf6w3wBbLyo8bSW5rdImvhPYaP7Gd/F9LkGeyQNVG9 XIrxPr4Ki/FR++9TqiDF+hLEEH/h8y96EzUAISt6yelQOsvSRp2Q4CZc843s3WPV+gyUeK JOJejZIpTipgGfNSFnI6LmPeoLZsW+83iCwI5NYBmcKlXMEvror8FS0EQnJd2fmZVg8TDL 77GvxNRT3JlmLzdgGddpz8eDDjwb1/sfJHr5alWloAqj1lE+BSprkXt7bUB4UA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483257; a=rsa-sha256; cv=none; b=jfsUyzOqGYYf0hv5njfYOKCb07/iz5j1HV1b3canmF+jNRL7tNUYYkHuMvNLcHgTi5jB+z tDtcN0WRIypchiqRtJbpOwjkaL9hbL/V9CSkWF8VBD/6MqfkkP2pcVcGNSeHcCO00bESlX CWn+nvgFpsTGUfj5OKT+2H885acJ4Cr1XmEly74VX9qo3E5uxqc3E9QQA5JqoB0oXfNmWW QlreOR+uH0x3Sk6Vr0w9RlZz9SXRBwQ95t4l6YyANZFFfMCyRtJe7sOO3jYwbzCTIgjd2B Q3mqMxnO+lythZtMP2yxd+D0ODhAc62GvoByo0fyDhzycdzD7r0zmJi2NiGFaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VgsABGMfzIlRaotesFlPasoGAsfntzG69egjUcpYIzg=; b=Xz8raQYp9YUZYB3JSOU/5/VhYfNCKRXJOmITgEJfAD/4A2VUBrA+l8/PSoHzLbymWG+KhQ rlpmvuGuoF5jFaq9MPA/aVjOaS/GZKdWXW+rdfRZGfcRTNiZmBqaa98P79hQoXNWFVsPP2 RlNLkHiP70nyW4vjc1ISVtzUOxHefQGu+1kYPRJDMyiGG2SonuaJ3d2QDp0PKegKLS9WLr dyBn/1wgXbyit6QwwEopbjg2jxovqtefsGD5kGYoclOuzDBg1u79bdgqtIIapYaQLRaW+0 W93nvld6/dpEu7dG6QP/D+FilYEGwAHNJuHNB2PVwkYxqEdPi8TkghMYJMGhzA== 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 4WzZVK07GVzgH1; Wed, 4 Sep 2024 20:54: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 484KsG2C033880; Wed, 4 Sep 2024 20:54:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsGwQ033877; Wed, 4 Sep 2024 20:54:16 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:16 GMT Message-Id: <202409042054.484KsGwQ033877@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: 9a77f052cab7 - releng/14.0 - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 9a77f052cab78165b39e6c6c392381991167e21c Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9a77f052cab78165b39e6c6c392381991167e21c commit 9a77f052cab78165b39e6c6c392381991167e21c Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:02 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 (cherry picked from commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9) (cherry picked from commit 803e0c2ab29bb6b715c38e82da4930d46590e8e0) Approved by: so --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index f48fc203b90d..5f5987e515c0 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7514,20 +7514,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 20:54:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVL4Fzkz5VMSf; Wed, 04 Sep 2024 20:54: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 4WzZVL1jhzz4QJx; Wed, 4 Sep 2024 20:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5jZsOch6SNlIMqrgTPr30XJl2L3WSyk+yz7OZXLLogM=; b=nXOjAEkzDCjH4mTiYdfacxqh8eSpEka1B0tzWdbwMBza54Uc/vwev72Y7MrKec8vH53hoa 4qLP/CrfCQYcJ84RpU6sEzZ1XQ7hdlwsOuQTUy5DXvz8kJmCgLEr+L7BsUm+9gHdJP46wl ERfaimO/hyVrOWPfh2zYun2fx/TJvQnv9CHTFPDt9xS0mKT7buESbVuE/s5xbCQcdS0+So zOxHIOpOSny0N4qiicS9wuh6ZFXYgR0/rBosUtuLxjs6hZxISRwb7KH/cXkoAsnrFrTsw7 V41qXjNfpP1kbkl+it+UPRNTT1CEIqWhqzsjUPV1mdIFC3tWd1xjt0Vpbl2cRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483258; a=rsa-sha256; cv=none; b=i7BVAd4z1IcUCLA+J8sB+rYWtBEfxADamlIDmDgZWF6A2KnWUt/F5ejWlovPPeMhquFV7R OAO0cpNj/gm0WRAG2j9qt5ZykTHYDHVozcqpHDeAPd2xXQucCswxKtpAOM8+eP5Y27QQkq K+cgHEhVUH8uoAlZe/ZP8hcf22Eg5VKcu/P+pBYWgWaE7neajhlqJkW7Qq32yZITH9M965 PINVOu6bCXF6OQp5XdrlRF1DGJrXnnKLL/qfN9SNRqQpBmDNW2U3HjxMJ9JqrC6VR55ABY eU8N5NF5i1lPccQz0nfzcGcXlC4X8nyo/yAZktDdw6wV2IvNlrhOWrxVjy3GSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5jZsOch6SNlIMqrgTPr30XJl2L3WSyk+yz7OZXLLogM=; b=yZ82GM16Bz6ld8HjjH9nVf2zu1qZ464lelYRrD+eOZrQ/yt+VSmZLwywvJFHNCdLTXJDQX /uFNSyrb5zNj3ffC2pWHjD/a67Jgb6iFFnsq8sRlVz0CYWfnhdL8J1rXzM4jmn24Q7+2rL p3ZfrlGZxSYV28vASMvLM4FVhNmdUnghQ+fW7G4VM0bQjns76HWc8jkXZQOOvmM9wiS/rP OpvvGpxFEt8MFBirQ/wbDqNX/TgHfJm4rEQdM6SCHzEYkqwVmaN3WY9H0ZfSRz1lno4iRT 2YYY7I66T6hfrZ0DrBgGOWn5+NgEDZs3bLSMubUTyxf7P06ATMoFBiBNDqaqsw== 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 4WzZVL1Cz6zgYC; Wed, 4 Sep 2024 20:54: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 484KsIo0033929; Wed, 4 Sep 2024 20:54:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsILt033926; Wed, 4 Sep 2024 20:54:18 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:18 GMT Message-Id: <202409042054.484KsILt033926@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: 4c60b8289d0e - releng/14.0 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 4c60b8289d0eaa4eb080ad96a7089635a691eee5 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4c60b8289d0eaa4eb080ad96a7089635a691eee5 commit 4c60b8289d0eaa4eb080ad96a7089635a691eee5 Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:02 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) Approved by: so --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 5f5987e515c0..4706b424880f 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9342,14 +9342,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Wed Sep 4 20:54:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVM4w8Cz5VMtp; Wed, 04 Sep 2024 20:54: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 4WzZVM2LSjz4QHB; Wed, 4 Sep 2024 20:54:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ocLGRFrQZssRbMgHx1wOodltFUvNxmKmDGcdavFjaXk=; b=WXnZFqdXO36uI71znzlAbIx74RLoGOyrkIAo0LSzEiPteJjKVWDtd/l7/IwRstGd2ppvjT iBdU5JbJ24zrxeWhiGdsO3YmXpEW1PvYli+uBvc6cPkx7k9kVgx9t4KcCgHaKu56oBJbsK vUYCJWjJqV1MIQtQ4Nkyb9pB01rqptNfdKajV4MzknQDDfNwB90svI9h5xwOW7iO9Q3rzT oLEhweHpM46iJcDs7mAN/BgMVjdDeR6Hokmev3UZMuaDmUjEKCtbC5uGaVghcLgR6PWO2A WhzKItRdD4nJZW4SmV3mFjwPuKtBecJ8F6u8RHr3z2G9rB5MITgqEJ5BT36Tgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483259; a=rsa-sha256; cv=none; b=ZdRaMpxjheRo/KC9AitT5enJKxtYVqclslbyxoIzJrjfQL2Z2o+VyJD431tRK3oigAusZB ucCAnydW2mdLAAdWxYD+dwNy9gsRhaF+nG7TWecU3HDzKnqFVdDfa8yDByOm/W/c+uc9Om WvAil+rwXKDkOKH3g+cRAN0mfSfRHvK2Ow0+Ze+8DKN8CImRkzy4lQ3qQmQ6hYm4dPOJLv QO/mZ2ll0iC/bnIxTfAIaCCosPEO7O/Xh/rv0RxEylHnC4WDO/+iBnrxSsAjOYTiaYTl2h 2+/lAiOpOWhJrUIAFx49j2eNdxuMzny1gjbC8nOUNvQkfO4pkRDUgALRmWHQww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ocLGRFrQZssRbMgHx1wOodltFUvNxmKmDGcdavFjaXk=; b=CYfr/DM9gp3QoW15ZWo8Et3nLEF4ObQC6NDMAXqHzS40gkq+lQo9XEfwQjKUn5GSRPxkD4 d8bSTXACrpkM3mRVOSQ83Xpp456pGPARU0SqiD6/bX3sfD/bxeeeKcIkQRF/ekqzwmpvEq PlcptvwRArPj38Ls3d3cVDTu7bU1rh7se8pRzczkGypeHCZb9U3optXeYGNtptymgQEKXT 0lLA6VN0vqDenODj/njF3tOXUq/agcFcy4Til8bpJlAFSPXFV5d8XyoX+DPnGDzqBHXyZO v2MFtUNQmCdQXfogKAJuam/dGPqnVtXcetavvnA4R88djPJzkoaneUJnbddCUw== 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 4WzZVM1xj4zfjH; Wed, 4 Sep 2024 20:54:19 +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 484KsJY8033980; Wed, 4 Sep 2024 20:54:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsJiO033977; Wed, 4 Sep 2024 20:54:19 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:19 GMT Message-Id: <202409042054.484KsJiO033977@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: 1d01a6c11210 - releng/14.0 - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 1d01a6c112104449c75b4da564e080021554030d Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1d01a6c112104449c75b4da564e080021554030d commit 1d01a6c112104449c75b4da564e080021554030d Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 (cherry picked from commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68) (cherry picked from commit 90af1336ed5e3c8556147325c4841c68639c4b63) Approved by: so --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 2d37cb0f08fc..3550dc1872ae 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -660,7 +660,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1202,7 +1202,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 20:54:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVN4ZQBz5VMXB; Wed, 04 Sep 2024 20:54: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 4WzZVN2xXLz4Q6N; Wed, 4 Sep 2024 20:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuAGFyRWa5FgdFOYRuBfD5UgHrDni+rQW0QCLhZeoAc=; b=JdyaMGDR6RWl9GAIdzsyglm7Qevuu5ugrRqZtoj+H1iYkT664CxhyVvmjBqvrpXjNx1jDY V6kY1Lh0R6eCKbh5yGloeURAWUGAV2c/p5RzgdPbB7d+GEXv7vrnWLiMZTHfblbyFdsImU TkSyE9ZoDaherrRuCt1pcetlC49inA1BYuWJDSJ1oD4LAhKJt29UDTmIs6FIQQbKBNEHrU H0L65AML8FnCFzFKz2EiDJYIMIHDtzX0CIzbccw97miE7O5aLZTZHf+LNG1qjjGmzFzw1w FaK4MYq9ojTB6n32ITGoCYiblPvHm15wArFrGcwTrCVOZoRdY4K6h+Pl5uN2iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483260; a=rsa-sha256; cv=none; b=duf+5WxG+3p0z+1N/X/dJVLd+Pt0/3ATPopY6R8LqGwPBWGUQ/P6X9Vm3LjNoDsemBsfqB fFaKlF09fhRv39yUmFsFd8QX0gZkSjcGvvtc9mAD21t5xh48TRshY0TPW8Dbcu6TWABV66 H9I2CY/Za+fkRvjJHTthzyNWfaWqo33xN3x7Tgz7lc4QqMeE6TDmAh9mnAmglJ5gBotYns WOV0qME9o7K9MErWIeecW6T3rE/5Bn41V905gGgxHkqzWC2c0d2ZXdALpEUFkeJSKW1kro mx35LSdum6PO350scBD05iTXa6olUbCNUqr879YT5FU7Y2PTcudODbQ1eImxjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuAGFyRWa5FgdFOYRuBfD5UgHrDni+rQW0QCLhZeoAc=; b=GTbx9uhsmSnUO8+nVaHLwOrTH2Vn18vvDZ31397JRwFUDWwyG6WK0tuxIqIw7K1liH+KEW 3irf9Sl+4hbrGuVk7qlzCZMi4uT6u/vJrZS+R6ZWO9xKabJgcX5W7pS04DHr3gafnoAmbg Z0dPBNvUwHx0Awf2xn+gNw65+uSn4gAjOcj8HLmWw8R6WtNBpYlzqFdWY1h0LD3o8LnBOl hNXPz9HBk7XitS66keo8F0rcXPGJFb9Ruxd0Ruv7SyZeKxcyoRmyQlkIxrD8aYf/n016FB fH71UXTOxzxbXrD3Bl487hIU7kz5mLIfCkcwDU9OjD4sAy7goh1x12G1++fjXQ== 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 4WzZVN2YN0zgYx; Wed, 4 Sep 2024 20:54: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 484KsKTD034035; Wed, 4 Sep 2024 20:54:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsKmr034032; Wed, 4 Sep 2024 20:54:20 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:20 GMT Message-Id: <202409042054.484KsKmr034032@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: abd3a7939117 - releng/14.0 - openssl: Avoid type errors in EAI-related name check logic. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: abd3a79391175d473c86476b10ae4f97f948f525 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=abd3a79391175d473c86476b10ae4f97f948f525 commit abd3a79391175d473c86476b10ae4f97f948f525 Author: Viktor Dukhovni AuthorDate: 2024-06-19 11:04:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 openssl: Avoid type errors in EAI-related name check logic. The incorrectly typed data is read only, used in a compare operation, so neither remote code execution, nor memory content disclosure were possible. However, applications performing certificate name checks were vulnerable to denial of service. The GENERAL_TYPE data type is a union, and we must take care to access the correct member, based on `gen->type`, not all the member fields have the same structure, and a segfault is possible if the wrong member field is read. The code in question was lightly refactored with the intent to make it more obviously correct. Security: CVE-2024-6119 Obtained from: OpenSSL Project (cherry picked from commit 1486960d6cdb052e4fc0109a56a0597b4e902ba1) (cherry picked from commit 5946b0c6cbc77e6c5f62f5f7e635c6036e14f4d0) Approved by: so --- crypto/openssl/crypto/x509/v3_utl.c | 78 +++++++++++++++------- .../test/recipes/25-test_eai_data/kdc-cert.pem | 21 ++++++ .../recipes/25-test_eai_data/kdc-root-cert.pem | 16 +++++ .../openssl/test/recipes/25-test_eai_data/kdc.sh | 41 ++++++++++++ 4 files changed, 131 insertions(+), 25 deletions(-) diff --git a/crypto/openssl/crypto/x509/v3_utl.c b/crypto/openssl/crypto/x509/v3_utl.c index 6e4ef26ed608..304463d572c6 100644 --- a/crypto/openssl/crypto/x509/v3_utl.c +++ b/crypto/openssl/crypto/x509/v3_utl.c @@ -916,36 +916,64 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, ASN1_STRING *cstr; gen = sk_GENERAL_NAME_value(gens, i); - if ((gen->type == GEN_OTHERNAME) && (check_type == GEN_EMAIL)) { - if (OBJ_obj2nid(gen->d.otherName->type_id) == - NID_id_on_SmtpUTF8Mailbox) { - san_present = 1; - - /* - * If it is not a UTF8String then that is unexpected and we - * treat it as no match - */ - if (gen->d.otherName->value->type == V_ASN1_UTF8STRING) { - cstr = gen->d.otherName->value->value.utf8string; - - /* Positive on success, negative on error! */ - if ((rv = do_check_string(cstr, 0, equal, flags, - chk, chklen, peername)) != 0) - break; - } - } else + switch (gen->type) { + default: + continue; + case GEN_OTHERNAME: + switch (OBJ_obj2nid(gen->d.otherName->type_id)) { + default: continue; - } else { - if ((gen->type != check_type) && (gen->type != GEN_OTHERNAME)) + case NID_id_on_SmtpUTF8Mailbox: + /*- + * https://datatracker.ietf.org/doc/html/rfc8398#section-3 + * + * Due to name constraint compatibility reasons described + * in Section 6, SmtpUTF8Mailbox subjectAltName MUST NOT + * be used unless the local-part of the email address + * contains non-ASCII characters. When the local-part is + * ASCII, rfc822Name subjectAltName MUST be used instead + * of SmtpUTF8Mailbox. This is compatible with legacy + * software that supports only rfc822Name (and not + * SmtpUTF8Mailbox). [...] + * + * SmtpUTF8Mailbox is encoded as UTF8String. + * + * If it is not a UTF8String then that is unexpected, and + * we ignore the invalid SAN (neither set san_present nor + * consider it a candidate for equality). This does mean + * that the subject CN may be considered, as would be the + * case when the malformed SmtpUtf8Mailbox SAN is instead + * simply absent. + * + * When CN-ID matching is not desirable, applications can + * choose to turn it off, doing so is at this time a best + * practice. + */ + if (check_type != GEN_EMAIL + || gen->d.otherName->value->type != V_ASN1_UTF8STRING) + continue; + alt_type = 0; + cstr = gen->d.otherName->value->value.utf8string; + break; + } + break; + case GEN_EMAIL: + if (check_type != GEN_EMAIL) continue; - } - san_present = 1; - if (check_type == GEN_EMAIL) cstr = gen->d.rfc822Name; - else if (check_type == GEN_DNS) + break; + case GEN_DNS: + if (check_type != GEN_DNS) + continue; cstr = gen->d.dNSName; - else + break; + case GEN_IPADD: + if (check_type != GEN_IPADD) + continue; cstr = gen->d.iPAddress; + break; + } + san_present = 1; /* Positive on success, negative on error! */ if ((rv = do_check_string(cstr, alt_type, equal, flags, chk, chklen, peername)) != 0) diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem new file mode 100644 index 000000000000..e8a2c6f55d45 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbDCCAlSgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 +MCAXDTI0MDYyMDA2MTQxNVoYDzIxMjQwNjIwMDYxNDE1WjAXMRUwEwYDVQQDDAxU +RVNULkVYQU1QTEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6wfP+ +6go79dkpo/dGLMlPZ7Gw/Q6gUYrCWZWUEgEeRVHCrqOlgUEyA+PcWas/XDPUxXry +BQlJHLvlqamAQn8gs4QPBARFYWKNiTVGyaRkgNA1N5gqyZdrP9UE+ZJmdqxRAAe8 +vvpGZWSgevPhLUiSCFYDiD0Rtji2Hm3rGUrReQFBQDEw2pNGwz9zIaxUs08kQZcx +Yzyiplz5Oau+R/6sAgUwDlrD9xOlUxx/tA/MSDIfkK8qioU11uUZtO5VjkNQy/bT +7zQMmXxWgm2MIgOs1u4YN7YGOtgqHE9v9iPHHfgrkbQDtVDGQsa8AQEhkUDSCtW9 +3VFAKx6dGNXYzFwfAgMBAAGjgcgwgcUwHQYDVR0OBBYEFFR5tZycW19DmtbL4Zqj +te1c2vZLMAkGA1UdIwQCMAAwCQYDVR0TBAIwADCBjQYDVR0RBIGFMIGCoD8GBisG +AQUCAqA1MDOgDhsMVEVTVC5FWEFNUExFoSEwH6ADAgEBoRgwFhsGa3JidGd0GwxU +RVNULkVYQU1QTEWgHQYIKwYBBQUHCAmgERYPbW9lQGV4YW1wbGUuY29tgQ9qb2VA +ZXhhbXBsZS5jb22CD214MS5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA +T0xzVtVpRtaOzIhgzw7XQUdzWD5UEGSJJ1cBCOmKUWwDLTAouCYLFB4TbEE7MMUb +iuMy60bjmVtvfJIXorGUgSadRe5RWJ5DamJWvPA0Q9x7blnEcXqEF+9Td+ypevgU +UYHFmg83OYwxOsFXZ5cRuXMk3WCsDHQIBi6D1L6oDDZ2pfArs5mqm3thQKVlqyl1 +El3XRYEdqAz/5eCOFNfwxF0ALxjxVr/Z50StUZU8I7Zfev6+kHhyrR7dqzYJImv9 +0fTCOBEMjIETDsrA70OxAMu4V16nrWZdJdvzblS2qrt97Omkj+2kiPAJFB76RpwI +oDQ9fKfUOAmUFth2/R/eGA== +-----END CERTIFICATE----- diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem new file mode 100644 index 000000000000..a74c96bf3146 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICnDCCAYQCCQCBswYcrlZSHjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARS +b290MCAXDTI0MDYyMDA2MTQxNVoYDzIxMjQwNjIwMDYxNDE1WjAPMQ0wCwYDVQQD +DARSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqRj8S4kBbIUj +61kZfi6nE35Q38U140+qt4uAiwAhKumfVHlBM0zQ98WFt5zMHIBQwIb3yjc2zj+0 +qzUnQfwm1r/RfcMmBPEti9Ge+aEMSsds2gMXziOFM8wd2aAFPy7UVE0XpEWofsRK +MGi61MKVdPSbGIxBwY9VW38/7D/wf1HtJe7y0xpuecR7GB2XAs+qST59NjuF+7wS +dLM8Hb3TATgeYbXXWsRJgwz+SPzExg5WmLnU+7y4brZ32dHtdSmkRVSgSlaIf7Xj +3Tc6Zi7I+W/JYk7hy1zUexVdWCak4PHcoWrXe0gNNN/t8VfLfMExt5z/HIylXnU7 +pGUyqZlTGQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAHpLF1UCRy7b6Hk0rLokxI +lgwiH9BU9mktigAGASvkbllpt+YbUbWnuYAvpHBGiP1qZtfX2r96UrSJaGO9BEzT +Gp9ThnSjoj4Srul0+s/NArU22irFLmDzbalgevAmm9gMGkdqkiIm/mXbwrPj0ncl +KGicevXryVpvaP62eZ8cc3C4p97frMmXxRX8sTdQpD/gRI7prdEILRSKveqT+AEW +7rFGM5AOevb4U8ddop8A3D/kX0wcCAIBF6jCNk3uEJ57jVcagL04kPnVfdRiedTS +vfq1DRNcD29d1H/9u0fHdSn1/+8Ep3X+afQ3C6//5NvOEaXcIGO4QSwkprQydfv8 +-----END CERTIFICATE----- diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh new file mode 100755 index 000000000000..7a8dbc719fb7 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh @@ -0,0 +1,41 @@ +#! /usr/bin/env bash + +# Create a root CA, signing a leaf cert with a KDC principal otherName SAN, and +# also a non-UTF8 smtpUtf8Mailbox SAN followed by an rfc822Name SAN and a DNS +# name SAN. In the vulnerable EAI code, the KDC principal `otherName` should +# trigger ASAN errors in DNS name checks, while the non-UTF8 `smtpUtf8Mailbox` +# should likewise lead to ASAN issues with email name checks. + +rm -f root-key.pem root-cert.pem +openssl req -nodes -new -newkey rsa:2048 -keyout kdc-root-key.pem \ + -x509 -subj /CN=Root -days 36524 -out kdc-root-cert.pem + +exts=$( + printf "%s\n%s\n%s\n%s = " \ + "subjectKeyIdentifier = hash" \ + "authorityKeyIdentifier = keyid" \ + "basicConstraints = CA:false" \ + "subjectAltName" + printf "%s, " "otherName:1.3.6.1.5.2.2;SEQUENCE:kdc_princ_name" + printf "%s, " "otherName:1.3.6.1.5.5.7.8.9;IA5:moe@example.com" + printf "%s, " "email:joe@example.com" + printf "%s\n" "DNS:mx1.example.com" + printf "[kdc_princ_name]\n" + printf "realm = EXP:0, GeneralString:TEST.EXAMPLE\n" + printf "principal_name = EXP:1, SEQUENCE:kdc_principal_seq\n" + printf "[kdc_principal_seq]\n" + printf "name_type = EXP:0, INTEGER:1\n" + printf "name_string = EXP:1, SEQUENCE:kdc_principal_components\n" + printf "[kdc_principal_components]\n" + printf "princ1 = GeneralString:krbtgt\n" + printf "princ2 = GeneralString:TEST.EXAMPLE\n" + ) + +printf "%s\n" "$exts" + +openssl req -nodes -new -newkey rsa:2048 -keyout kdc-key.pem \ + -subj "/CN=TEST.EXAMPLE" | + openssl x509 -req -out kdc-cert.pem \ + -CA "kdc-root-cert.pem" -CAkey "kdc-root-key.pem" \ + -set_serial 2 -days 36524 \ + -extfile <(printf "%s\n" "$exts") From nobody Wed Sep 4 20:54:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVP6VYbz5VMtv; Wed, 04 Sep 2024 20:54: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 4WzZVP4PnDz4Q6S; Wed, 4 Sep 2024 20:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAMkL9nCMXF8AqqKNPnqKXRaDLg6YfjDu4Gdo5dTwKU=; b=ALa+yY84J+suKYmbLUvLGN8kciFrtuwkfxdOgK9MfdfM/L29lwFzyMHc8EvyarSjuQtjIo Nk2a1AhkW1RzVPTo1h63wBI0Y0/M75/xAwh4aRtVoR/mZV0ZyQ2EH0hxsCuoiabfZxqdiL clINlpmoi6LIzC0Wi2WmQ1uC0+FO8rnEIOvwoo/I+UEVCpSpESmfPMOLu8Lgm0Q6gIKPzT M7+oykIZcyMxfqCG2ajCmmQQ14CRM2CVuSwKKSFxzXZT17bxCYBeh8KShV5K33yTGYd3FG 3Keqwq7j+mdDDqP+j5n2PrdkVytcwTB3VCzrzDhIilWZnpZnajJlvWx2sgdBPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483261; a=rsa-sha256; cv=none; b=wiK04D+8dK7h+qVAtr3WqF/2KVQEA+Q6SHj1P/PK4zTuQREGgiZ8d1uqjgTi4jKHLQlQhd Un+CN+5BBjpF7pPzTZdQILTgmUR+3koBKagPha7y+Uvt2D27EtalVEUyeyFmQgg2sqLohj HasNttZaFLh6JDQ9qj91vEhkyF6L05rfoQBiwaWyBbc+NC/vbXMneQ99708rFpYiSRSQIr 3zfQjPfASkeBWWODD329cmrROlJpwFXBHgGUBkFsNPNkQjOnvZN1t3qgGty2FO40ThZrTR EJ0h5faRkZcaIUqXtzGCpCKfHumG3UCIl9EIdai85Rq2YsEskjvxe2JO118FdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAMkL9nCMXF8AqqKNPnqKXRaDLg6YfjDu4Gdo5dTwKU=; b=BGt9K7tx4pf5YEUlcac0Fd16ZNuNxInRt5nx+51hu0HT4XrLoFwY0culB94B+5vlEnGH/Y mS+PH52k51aG4SxT4pm9gTEBpgTa1SKoAASwf33PzmTRMhIx/G3CVMM18/F+X1GPbUfumu 70kU/u0ChTqL6ZgIbJJrXQp5nU6Gy1AcP2ZLj8ooIGjhqE4XtzQJXcAnPjYJcyWwVtrGC7 hgVx0XGgINfniBp3au6HtEv4047zrmfVu7pYMBjVLwRYqNxPLldblA/k8P364X0r4ST+34 3owrlWcrWWiUs8Lr40LHIbcMFUJHHcdrTlgHwdXSBTrT/7xfFAZitwWsM5Q2xw== 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 4WzZVP3znCzgMr; Wed, 4 Sep 2024 20:54: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 484KsLom034088; Wed, 4 Sep 2024 20:54:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsLpv034085; Wed, 4 Sep 2024 20:54:21 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:21 GMT Message-Id: <202409042054.484KsLpv034085@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: d868c5df69a8 - releng/14.0 - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: d868c5df69a8cbf6ea3cf3ed4ce2b200eafc92c5 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d868c5df69a8cbf6ea3cf3ed4ce2b200eafc92c5 commit d868c5df69a8cbf6ea3cf3ed4ce2b200eafc92c5 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit dd83da532c36830a0c0aac624903849262ec6f68) (cherry picked from commit 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63) Approved by: so --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index ff9505b8e31d..afc3f705e231 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4271,8 +4271,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4332,7 +4331,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4372,14 +4371,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4472,7 +4468,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 20:54:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVR1lX7z5VMxP; Wed, 04 Sep 2024 20:54:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZVQ5fN0z4QHw; Wed, 4 Sep 2024 20:54:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I5tL08npTbZXefjy1vUW9hi6mevY9RDV8WaLS6SsFsk=; b=nkJgHvVOl5mY1KAy55hC1P942RbDQP8cAsMBsgXNSkSfh/UTmDByQKMzrwhCsG2uqOOl9a GXI3V/sIrW0flmzZ4Tn0IQckBeE0FSDg8OGHyt/JUTqesStFYU0nrMqSjIeXD5BcwC9FFy T1SNJaGpgqJMcHX8cvyok1R+8qe3ZDsj2/Idm5qR2vxt6BLKiRSXrYY0KE+AQGpAQ9O/9y xhXFVnMnk7KqoO015ymx5RNVeLCiMoFOQM6+f1TUfpGjI1HVsUK6tyk9iMotqs1kLM+fja PT306dGnyxULt4+9likZ8wm/ENwNGJo6jKTX81eUPBpi1oARB+SqQA8kVHVEWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483262; a=rsa-sha256; cv=none; b=Lu7E02RELbiW0f/InQg/DtQctnQ12PRXAT5bh/WtvXOPRQlKzcA7sbW5M/vEvte3o7kdTG 7HxJY8g976SonZoTnXitvbOWTGoS+bnZQC9CeHMERQpImqLVy/2lSbykygMhRYZ+NyrSMa xDYUpHJ3PIRZBL1fsdqv2/vVNLC1b0rBtm4vI5kIBf733UlXtREOsXKcztfNYAvyVmJ36j AcfqdaG/Thl5b3kkVQOEkWWjkqX01JIclUBzSHeiu4mFBA4CyVbKQh74zJWEdRXig+8lN/ 1nppgsN48ZSrS95DKfdp/glRITMqSAh2sTmECUtg1RI4pRfUju/9TczBoIbQJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I5tL08npTbZXefjy1vUW9hi6mevY9RDV8WaLS6SsFsk=; b=mZV0flj7KcoNEyWV5YheHz/JnvlV05BDZDzz+DYBCGgDbt59OWrip51bp3EX9OnMEZFJ1+ KbVoNFKphjNnZiWL2qLDTAsKTzL5mfLQy1Ix09jAmaH9vbWckm0KF1XDUvb2UYAsnebgQk +r3k+47VyrbxnmYGVhZeeTSOQSsJ/lwfz6s8YxS1i2M22Oc1BS2TXPN5K8eJtS9J9h4CWb e3M/OjoMH+oopC8OZ9fAwWcme6p21g5tPqJUdBqV77+Z1JUB73HVWR4UBl+u1zOCTEAvEl II44qSA8dXmDvfbMG2LYzbXQl3ZurKQ1vgqYYiGWzuomnXUv6MHIFBHDRAZTRQ== 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 4WzZVQ5DmkzgYy; Wed, 4 Sep 2024 20:54: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 484KsMG5034151; Wed, 4 Sep 2024 20:54:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsMi8034148; Wed, 4 Sep 2024 20:54:22 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:22 GMT Message-Id: <202409042054.484KsMi8034148@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: 6d2923e03221 - releng/14.0 - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 6d2923e0322179fa3d12b879f2ec8943f92d2ed6 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6d2923e0322179fa3d12b879f2ec8943f92d2ed6 commit 6d2923e0322179fa3d12b879f2ec8943f92d2ed6 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit 62f40433ab47ad4a9694a22a0313d57661502ca1) (cherry picked from commit be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed) Approved by: so --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index afc3f705e231..4f8d13a40d31 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4362,39 +4362,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4447,7 +4457,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4464,11 +4473,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 20:54:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVS3MJlz5VMTx; Wed, 04 Sep 2024 20:54: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 4WzZVR6pSVz4QJ7; Wed, 4 Sep 2024 20:54:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PU49EhfTd5LWkhhgMIvHznq2HEn35Pfoj86ZJV2WORY=; b=u8D3OgT5bcHukQppb1xHlecZtUYFOhtLWbAY3dTTUX0TEp05ZBbg789zwbiopQkhKpNfXG tchshcSBtF1BGAQNC+0Z2/v1e3ow8wqfVLj5tQulVMsMxxVobyf1YfdwE08po09QrzIEME kiRsRTvTv73Xj8QdBoZjZy+wM05dmZurst9w+9H0JNG/T7TKlbvRPdfxFAOwYHJWR+Cxf+ fvCWH0hn06cL4mHfP09GZKtTtmks0ln+0nWokgrQQQnxjR6bk+NAaHtWFn+5LR0qAb3+QG xM7SPEGAeYdG0G4gyboKx42Lphkrz+safFF+uqlq4Xa4CAHIXCh8bPvEOwTsaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483264; a=rsa-sha256; cv=none; b=g3UToJKfv5Xe7laS4Zr4QaVlB5GGgq7gYA9s3YgLOet+4s5ybkm2djhgImkj4JjtHzVHAH 9u3yhr42ytYTiM7QOrbsGW/hfIuGbtTiiKYOA4dj2L36pB5yFnTIqX5P89lTRYOSoySYvG Zm68EtaEqAXph8D02GM6TNYLYHh1V8PyWqYL3nOiVESV1iI//VdTG57Y2xbswz+w4mGt05 GCKqrJ0ASJxgwly/b5RFrgzKwOiONJq5lXMsVpILtkfI/RCAHNHgbRc3KeE5NSUruid7P2 mtS0/gOyEDlD7Z/9bxyQ4I6ZyF07BQxbAy5YN4xb/BDJvd+LWwmMDg9hRoLLmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PU49EhfTd5LWkhhgMIvHznq2HEn35Pfoj86ZJV2WORY=; b=x1A/YCv9enhEFPnnHyrxIk85W/4DLsS4zf72HzhsYyt3fBehTXOmLXXqcuR7VrB5gFHCOr MTFUatJJb4fNtDNigTgXfqgG9/QDOnmMRaNsNsgnZs3qx9fG+IhWyqd99w5C+h2EMvJiB0 ptSu/fyc+KlhQwUg9AabsSkGc5i0Dabp9HpA7JcbDNKjuqSu6SWq+fyDm9T+rjNktau30Z DORsbn6Jx3HAp9dQIScaYE6vx8HkYsR2GPCKQgGeYnvG2/qpbSoPBs34lxRmmof5C98loW ulZmhUunHFgQ0YSfLreni3DA6YdbAo+MJ380AjJxQBR9Pocq7EcssGMrtBHTsQ== 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 4WzZVR6Q7qzgDL; Wed, 4 Sep 2024 20:54: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 484KsN7n034196; Wed, 4 Sep 2024 20:54:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsNGW034193; Wed, 4 Sep 2024 20:54:23 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:23 GMT Message-Id: <202409042054.484KsNGW034193@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: 39a2b8b01b48 - releng/14.0 - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 39a2b8b01b485ecf08faf72a7b74384cb78b24aa Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=39a2b8b01b485ecf08faf72a7b74384cb78b24aa commit 39a2b8b01b485ecf08faf72a7b74384cb78b24aa Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8) (cherry picked from commit b20ae160872071fc20e5dde27051792177057fa5) Approved by: so --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 4f8d13a40d31..d7171a9694f7 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4312,8 +4312,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4333,22 +4342,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4448,11 +4469,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4466,12 +4494,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4542,13 +4578,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 20:54:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVT2Wssz5VMvQ; Wed, 04 Sep 2024 20:54: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 4WzZVT0tlqz4QWC; Wed, 4 Sep 2024 20:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=waAnXi0PaRPgaSh0j8+htqIDwyIeHtcXoA+oXYc0j04=; b=oXC5qDA+T3UTsewxXiE3/3iMp8bUa+c8/Z94yEJvtA/v9InX7wth8hjgLTRO53qRwykkSB 4MNqXMfx6QHYP9UVxQZnT4by9z6Ic1lXHcQN5Hr1zMmAxOuhudyGIEjQBeYaFltOGOY4zq gMsYD0pGUpftY8eYMoRCszAhCE1+0MOzzCE9GDrC7Yj2L8M/7A8w9mQhjjJCVtcaVdsnps DQF0UfxvCd+LUkRMetDgzANiQ0rhIQADqb+rEqIWy5GPSTRLuZVaAUab9gVU9aOas1ln2l R0VtxV+r5TBRtkV5z+K9a4zuRa3j1SupmOVltznx40dRYx2h9G754uaZ/dZdQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483265; a=rsa-sha256; cv=none; b=VF0imE4yfyav8j7TWBYmRB6TG7fnmN7YESZVcsT5lJbZZZRKG3bNcEej9PcEMY6GMnVRKD iAdVPQh5PH5gwpkeCdFpoTRnLsUkeZaI00FUGV8bfoF187CGgHLSsiGpa9QzO4UtKtRHBM 9DQ2RchqRGVNS5qq0M4KNlI/1WGATC8rzNbmj/4OUJFnrH5PqiqeQtSzHuxQN3cWSG+zWN MSin2PYnJ9MLzyOpdAjweb8q7b1Vts53oM++jIlXdhivsuHfpKxH30hMPtTW9S+Vn/gqDc ReZIPIPuFsF1FOsp6ApMkP1cJdz6qlHTv6aLYp7uvb7mhFNxoKyncoe1fMIHPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=waAnXi0PaRPgaSh0j8+htqIDwyIeHtcXoA+oXYc0j04=; b=AEbiK9+pbU4i4kOfXNXnrBg+f6TVIxwvt9VrXQtZdvr9h1cpzKAhHGLONqd1ZiAQZlcDF2 YX5pIsSPMm6FkjKilESJlEIvQh9n5SvZyJje2sH2yUB1pJwjdI99UBYMicXfXVgBxPN4aO n2kvfDXqR1eR/azopU5gn1E12X0WyqW/JQU2NNrXrIT3yCfbEMe+SudYwi+PVXKvJe0zM/ EMc9KrcdE9ylnVUTT5PI5LseGnTSrymyQmD0bLQP90tktUHBLMKf2A74oS5SaGNuPN83qz 07aWzjNgBfk6gF2A2Wt8rdYZsQB1gtp79gb/Y+BV8XQxh4QOTwC8bTgnd7biaA== 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 4WzZVT0SfyzgH2; Wed, 4 Sep 2024 20:54: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 484KsOvE034250; Wed, 4 Sep 2024 20:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsOVZ034247; Wed, 4 Sep 2024 20:54:24 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:24 GMT Message-Id: <202409042054.484KsOVZ034247@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: 37823ca38148 - releng/14.0 - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 37823ca38148a4b53b373eb0e3a39242ccc4b06d Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=37823ca38148a4b53b373eb0e3a39242ccc4b06d commit 37823ca38148a4b53b373eb0e3a39242ccc4b06d Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c75a18905e308f69b01f19c3d7d613883a008e79) (cherry picked from commit 4938f554469bc81783998143968ec3eba2a43def) Approved by: so --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index d7171a9694f7..d6209c5dd505 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4338,7 +4338,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4386,7 +4386,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 20:54:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZVV47ZZz5VMT3; Wed, 04 Sep 2024 20:54: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 4WzZVV21f1z4QYh; Wed, 4 Sep 2024 20:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xT7FZMLIyuJD7W+hqyvm9UOQvPp2tfO5LUB7llwiZIU=; b=vvulUHh1gxHKfau+5tlKxn17RLsgCcm2b04uTcIQktIxZ1n0krdhhGybS8UHx2nhUBp6gw vc2hOGAVrQ+T9vRWjaQ9OK4wA4S+B/UVNaymmH2oO10wVH78Yox9B5Acl9NKv5ZQZ+uOds hbvske1HfNPCb53r7SKDxyhoM9M9liCqG0I+cJLGnT0pAztIxIcPqtai4FQWh65DWyJIBY jHaPIDsHTSh0ckY+BbnWJlOaUYYdHPNSGZlmNZTwNXosT2XP0kSzl/d33RiyWt3Vkz4QPM ScLEku3nGPZjHZIhBT8kzmKz4eLwGf+MSIUf2jehTbl+0uUizP/B2iUeqXemRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725483266; a=rsa-sha256; cv=none; b=iUsHOd1wBFpVjX4D1q+k4MVIxUf6MibCdVkI2eTO6v/jKyU1OTqUfWI3BcV30bBSMggiG2 9ZCWkJxRc9KmlzDjjSRhPb2ogn7CrdTLZ4+rdcZnjD9JDNGxv4/AQcdMtdvUTGUlvpjsyS xjiXH6bfpCC2HQCU4zsk1HKaS3WydD3cCiTVEh7Tsj/09/uf8SnzBxJn2b9A6nDcqmbZUR J7VaWOAP4ZuNScSJfSxLn/rFDZAyHJzggSPOD9sRmxioI8awKNDjfmAteLU1PmwISn68Ps V+7yfDVaNd3UkxI/wndB9KWtZBCacLiIZ7RehOE2wt+BryRTCKBGQMtQjkeUXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725483266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xT7FZMLIyuJD7W+hqyvm9UOQvPp2tfO5LUB7llwiZIU=; b=GmHRRy0Yubo04Y5YSzr47cS6UtVZDN86qthE21/9/9O/R291PVFC6T2+Hjn6IlrCoNrBV5 PM4EzbMtp7yMEeyXUSnpG923vPiwDIjYfH1N7PZDUSslLiULj2vm/nhMz4AtTqJTkbbvKS f4Y3dQdr8tooSqXwlmkjerzdEdYiRpfPGolSW3RjVBi8GkoZO30ghe8wLKNkB/69H/fb+R wmP0+VpfqrjNEK1Xi4CRtJ/EqT/OckomQDrH6TEG674CBqGPYGBGdbYVXg1daz8IxAvOGh MV/LXM7w2JQKOHhMJnWhxTReRzgf+AOOliS9hvRMsWlvC5aDF4Y+1+aGRo7sdQ== 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 4WzZVV1dbhzgZ0; Wed, 4 Sep 2024 20:54: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 484KsQmY034302; Wed, 4 Sep 2024 20:54:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484KsQkr034299; Wed, 4 Sep 2024 20:54:26 GMT (envelope-from git) Date: Wed, 4 Sep 2024 20:54:26 GMT Message-Id: <202409042054.484KsQkr034299@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: f96bae43f0c1 - releng/14.0 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: f96bae43f0c12418864bebbe271c4c3f036649c3 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f96bae43f0c12418864bebbe271c4c3f036649c3 commit f96bae43f0c12418864bebbe271c4c3f036649c3 Author: Ed Maste AuthorDate: 2024-09-04 20:26:46 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:54:03 +0000 Add UPDATING entries and bump revision EN-24:15.calendar SA-24:09.libnv SA-24:10.bhyve SA-24:11.ctl SA-24:12.bhyve SA-24:13.openssl SA-24:14.umtx Approved by: so --- UPDATING | 22 ++++++++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index dda09f1d5226..89961db5fabb 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,28 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240904: + 14.2-RELEASE-p10 EN-24:15.calendar + SA-24:09.libnv + SA-24:10.bhyve + SA-24:11.ctl + SA-24:12.bhyve + SA-24:13.openssl + SA-24:14.umtx + + cron(8) / periodic(8) session login [EN-24:15.calendar] + + Multiple vulnerabilities in libnv [SA-24:09.libnv] + + bhyve(8) privileged guest escape via TPM device passthrough [SA-24:10.bhyve] + Multiple issues in ctl(4) CAM Target Layer [SA-24:11.ctl] + + bhyve(8) privileged guest escape via USB controller [SA-24:12.bhyve] + + Possible DoS in X.509 name checks in OpenSSL [SA-24:13.openssl] + + umtx Kernel panic or Use-After-Free [SA-24:14.umtx] + 20240807: 14.0-RELEASE-p9 EN-24:14.ifconfig SA-24:05.pf diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b13f7b741ea6..3fde4ce763f6 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.0" -BRANCH="RELEASE-p9" +BRANCH="RELEASE-p10" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Sep 4 21:07:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnV6j2sz5VNs3; Wed, 04 Sep 2024 21:07: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 4WzZnV64zfz4Vbk; Wed, 4 Sep 2024 21:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyGJGuv9IUF74/GXje7DlCCAu7RD+L7YnGTcmxHI1TE=; b=B4DPny5mZ8p0vEScoMfYvqDD9p1vwAMid8w31/u2CC+Ks0ywbOuwMmYEkLyn81W3aBXaKY kyVWwvMVh+d0r0Dli7ceMifrIXhNJ4uanox/SyVvGOKSsuYx8I6ndgPviJf9GUc5xNQpls OWZaFYE3EupjDduSvcBXniltV/yrRwJWjF53+KKyFpCBJ8W3vIqdfHveqXrF+EYlr7Nqgs KxrtoGvg1QhoYEPJ/KqDgiM90r842KVgEJ4eLg7QjYd5Lp5yezdCgcu/378p9Ye6189lA4 haqqV1/kNl5spEBfNay6crBlE6eCDtf4ZTGgKzZXPTAwGp4i//nRJNziZQv3Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484046; a=rsa-sha256; cv=none; b=FhA46vIg1kLmCFT8M371Vmsh3ICvz8lpHg7bA3rtypQhmV5OFgts7MwrNqdpUzCUzFgr1W YlIOD1n1thmP0twaaNjfnKVqpvTiOFkF8yft4dSdVXhPtFgvIDItG3QFEYWc7kt3dUPRJ9 3pHy5r4e1r93uY62/MQNLtXc0ukwKkAvObtjOCsH5530apoSIGWKGL7difFtv/z/Hm6O6/ G0oBlThm8+jqK91ucpOSpdsvvY7q3NER+ZfMNg/0qS1pjmKPGpcR2SaQI4epJSdclcKiuy 3RzgfvB9ov4v5nytCUQqJIzdXkNMwDzmalIcZesgTq6v2fFjB02Mlrk7+8hWdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyGJGuv9IUF74/GXje7DlCCAu7RD+L7YnGTcmxHI1TE=; b=FBO61gGYdcLHGmWA41dh6GcOY+JheIPKBqPmxXzRQ+fhCsGJUx6Lr3Zr3rPd2ubNWsR3Wc zlgkxZLWEDCRl0A+eBwjp2TmWs2BPVSrqHCbvPbaPBNINZ8SmICiF/BZ76nbRHGir9Jwtv AJR0BScg/PxFtha1C1Tn6NwiJeimH7wYqBnASK/gnIqfpdE1aP5Z8pH8tdxRua4WocpwTZ vuyN2kKyiNKlyM+bLghOH/MhQpJq74osUQyUBmKBrmSU/EP+aHXGrjn9vmo/3S1KVw2Snk /m8A19WadVn0+hfm2lvjapyGOR2R+0vO27NRXOlvLMdrcMyBexMEBQgVtwpyKg== 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 4WzZnV5ZCFzgg2; Wed, 4 Sep 2024 21:07: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 484L7QRe053043; Wed, 4 Sep 2024 21:07:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7QcK053040; Wed, 4 Sep 2024 21:07:26 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:26 GMT Message-Id: <202409042107.484L7QcK053040@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: 5fd7301afa97 - releng/14.1 - libnv: allocate buffer in a safe way List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 5fd7301afa975f9ba20051d83b838d90f3aa792b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5fd7301afa975f9ba20051d83b838d90f3aa792b commit 5fd7301afa975f9ba20051d83b838d90f3aa792b Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:10:25 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:06 +0000 libnv: allocate buffer in a safe way Ensure that the calculation of size of array doesn't overflow. Security: FreeBSD-24:09.libnv Security: CVE-2024-45287 Security: CAP-02 Reported by: Synacktiv Reported by: Taylor R Campbell (NetBSD) Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46131 (cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071) (cherry picked from commit 371af89975e3edd1e9f57aa5efba2598b63c0d2d) Approved by: so --- sys/contrib/libnv/bsd_nvpair.c | 18 +++++++++--------- sys/contrib/libnv/nvlist.c | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 0c76fefeebb6..9560ebc74f83 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -999,7 +999,7 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(sizeof(*value) * nvp->nvp_nitems); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1092,7 +1092,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_t *nvp, return (NULL); } - value = nv_malloc(nvp->nvp_nitems * sizeof(*value)); + value = nv_calloc(nvp->nvp_nitems, sizeof(*value)); if (value == NULL) return (NULL); @@ -1330,10 +1330,10 @@ nvpair_create_bool_array(const char *name, const bool *value, size_t nitems) return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_BOOL_ARRAY, (uint64_t)(uintptr_t)data, @@ -1360,10 +1360,10 @@ nvpair_create_number_array(const char *name, const uint64_t *value, return (NULL); } - size = sizeof(value[0]) * nitems; - data = nv_malloc(size); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); + size = sizeof(value[0]) * nitems; memcpy(data, value, size); nvp = nvpair_allocv(name, NV_TYPE_NUMBER_ARRAY, @@ -1393,7 +1393,7 @@ nvpair_create_string_array(const char *name, const char * const *value, nvp = NULL; datasize = 0; - data = nv_malloc(sizeof(value[0]) * nitems); + data = nv_calloc(nitems, sizeof(value[0])); if (data == NULL) return (NULL); @@ -1440,7 +1440,7 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value, return (NULL); } - nvls = nv_malloc(sizeof(value[0]) * nitems); + nvls = nv_calloc(nitems, sizeof(value[0])); if (nvls == NULL) return (NULL); @@ -1507,7 +1507,7 @@ nvpair_create_descriptor_array(const char *name, const int *value, nvp = NULL; - fds = nv_malloc(sizeof(value[0]) * nitems); + fds = nv_calloc(nitems, sizeof(value[0])); if (fds == NULL) return (NULL); for (ii = 0; ii < nitems; ii++) { diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 57343f953e94..64078b10973e 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -758,7 +758,7 @@ nvlist_descriptors(const nvlist_t *nvl, size_t *nitemsp) int *fds; nitems = nvlist_ndescriptors(nvl); - fds = nv_malloc(sizeof(fds[0]) * (nitems + 1)); + fds = nv_calloc(nitems + 1, sizeof(fds[0])); if (fds == NULL) return (NULL); if (nitems > 0) @@ -1029,6 +1029,10 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + ERRNO_SET(EINVAL); + return (false); + } if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) { ERRNO_SET(EINVAL); return (false); @@ -1313,7 +1317,7 @@ nvlist_recv(int sock, int flags) goto out; if (nfds > 0) { - fds = nv_malloc(nfds * sizeof(fds[0])); + fds = nv_calloc(nfds, sizeof(fds[0])); if (fds == NULL) goto out; if (fd_recv(sock, fds, nfds) == -1) From nobody Wed Sep 4 21:07:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnX1dNQz5VP0H; Wed, 04 Sep 2024 21:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZnW6vjqz4VfB; Wed, 4 Sep 2024 21:07:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tf/J/z4vdOj9cpE98pjkX41FKtlXIbTrreBUC31KgZM=; b=eRbOHJUsOHiqAMvqwsOLcsgcI6NpwEak8OYPJ4SpPZ2rtg6Fml0UHb2X/RN3UoqKoC69Ub QNcCy/5HInNevyV4KIadXcK8cumXEbGuN0ltNRIewtunImIyk2WDOONb7Akouu+RIB/kjs e8VkF+GDXsF9hj9ftXp2k4icWySMnInLzc3QOM2SpJScgYc7sqxtzO2u7XA+u6fUFSz79S tf/Nnd04tKXR4snOmCQwCsUd8fTozp5V+4udarFaZ4P+MfgcGfdaKKYvZesdTynEyZGY+4 eKON4m8LtIyFvfpH+nNyaxL+5LrlVdeqO6qVQY5jHStqL7IiNJF5Qk59gg49yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484048; a=rsa-sha256; cv=none; b=Sh6fqAe4wqdOAOipeQYvYtfV53k6FWs0JuoTbtWurm2mxQXHJBPZTDwQOukngzVkM6gx2Y NFbf51wtA6xKBfgwDmn0nzHAI/xZ4pz99D0BSJajnCNbFaHFqhlpeTpCsTfvg4N5IO01e2 gjqw9WdasGJ7nCOJESZ7Y+Z/SXGzkvgUKOUS6XJ0hFDAjnyJAhIXkrfx7FrcmnlqQBJOnq PY+YtOfBY0uQU4qtD4ZRCdUU9kZg7+6IbJvvNokPDApaJiBw1qfq6E7fcpulfyz1Wh5Ei2 UWcMZkyIZyALDniDqBqN63EhmMZnLZOEZrjfUKXWJ4BGLyOslrlWrK/TJlc0FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tf/J/z4vdOj9cpE98pjkX41FKtlXIbTrreBUC31KgZM=; b=cr6CDLrXt1ZLXDRpRIwcoW85dlk0tv53WnDkvk0O2O4sZWXsilGGQkf3SMOiCBWOjVOl6h vK/JKqbUtRHGDu4MtTLebk9168T/weuaeR61tG69qjn8Yusi4fvZed2ZcWApS6J5bOKkbT a8vQdRax6+s7/0BC0Jp5ikrutjCYE0YYwzXIAtiiPE/N1r9dDkhy6dYw6LOyf1bdJnuiTZ cnKPJBtix4GiFATRaKGNhHAIgV4j0z5hBdcp1EOPK5qJmYIaloDgwpjf5NjfTipHHoSaFV wHEx0OukCc3LCpgyJoLpsKGcpM2LKksE/9pof1P7iytQjHYsZB+ATRxwgyLXHw== 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 4WzZnW6Wm7zgcR; Wed, 4 Sep 2024 21:07:27 +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 484L7Rmt053098; Wed, 4 Sep 2024 21:07:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7RVV053095; Wed, 4 Sep 2024 21:07:27 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:27 GMT Message-Id: <202409042107.484L7RVV053095@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: d87f821959fb - releng/14.1 - libnv: verify that string is null terminated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: d87f821959fb59f902a2064afa37a70180385377 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d87f821959fb59f902a2064afa37a70180385377 commit d87f821959fb59f902a2064afa37a70180385377 Author: Mariusz Zaborski AuthorDate: 2024-08-26 18:20:24 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:46 +0000 libnv: verify that string is null terminated During unpacking, we ensure that we do not read beyond the declared size. However, unpack uses a function that copies null-terminated strings. Prior to this commit, if the last string was not null-terminated, it could result in copying data into a buffer smaller than the allocated size. Security: FreeBSD-24:09.libnv Security: CVE-2024-45288 Security: CAP-03 Reported by: Synacktiv Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46138 (cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae) (cherry picked from commit 9c2ef102166eaab4c2531eb0ce6ffb20b82e778a) Approved by: so --- sys/contrib/libnv/bsd_nvpair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 9560ebc74f83..a977d7941aa3 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -988,6 +988,10 @@ nvpair_unpack_string_array(bool isbe __unused, nvpair_t *nvp, for (ii = 0; ii < nvp->nvp_nitems; ii++) { len = strnlen(tmp, size - 1) + 1; size -= len; + if (tmp[len - 1] != '\0') { + ERRNO_SET(EINVAL); + return (NULL); + } if (size < 0) { ERRNO_SET(EINVAL); return (NULL); From nobody Wed Sep 4 21:07:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnY1T33z5VNjG; Wed, 04 Sep 2024 21:07:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZnY13Z8z4VYQ; Wed, 4 Sep 2024 21:07:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D1GLF4pTsGytpK6NM+Pats8q7OaZf5ZWPPqrqfRyPHs=; b=Fw3V0cSZxV1xVvtsFmwFsq6SaZpwkJJIytlaWk+xeI+FhRrQKON9mZhPmEyoVObYbsAaKL 8j0tjnEo+wEeN5GZ1g1piCninwxQ/AKCO3EEgTGpcHSOo1F5u0to2Tg7s8d0KuOutCytMv R6qQKYTzvinor5briU99PIiQKrSkDqRKEI9Nq1lXBoQPMJgfvCCzSLslu5LCBhpR18LLSY jFVu6h0he0gZl7R9dK/FLstP0T0Z7rHtRjPAhACxf/DbwyCu9QzhMjNjlPMG/z3u39iJ6j SFBDGNGkNYAXiIgHa4S3oFONIKjkJ/rzzYk7UhCsh3nzQBCu+E0XT4pWZwab7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484049; a=rsa-sha256; cv=none; b=x+b/jm28m/pw8a65QkdjdY5im0WjpyeCm0AD3gJTCk4xzM+xeoU9DNdCWl3G7HjSuK5wpV CqoOUv7sJrd9cvRreOzQEUF2xArdtrCRawMkRy5M4hTHCShudQPunnY+ipv4a6VjhQ+5C1 noTeeL1UZ8Q+pCl1+PHKwyWMLahdPk99p3eqtviu93bN3fWB4zy5l4999HMc90x5sOd7Ck EVM581AGO9EJYeCpsQWDPdOzJoR5IWXQ9JuKsq3Db5QsrS5HetsvE57L0mtM8GrWDRDJac rguv74Igyn82+SWfVdntYFzochIRuDYKUBuAjNH7EMYpSQyGjKhQtlF/cqIuYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D1GLF4pTsGytpK6NM+Pats8q7OaZf5ZWPPqrqfRyPHs=; b=urDWdCQLLdrryYUCCOGuR12u969ggQ9r3lBfday2czhSpe1ijBRT3c7YGfO4gYLgdQ/qOk iZtR02s2NmkEnsAllk+WS5HRKzkwDxboS9L01HBWkUr6TZEopuJjijrhAF5SGl2YHFPDdT KeHgE1O1Lm2jOfsrxTH4ofhf2bX5ZgU4M658epwh6E1Jvc1Lvs63u0dG78UqlcsrsD99IC VGdnv6M4Zbebq9XhxF03ZWSjMNT1l+xhXdr+qqZwdT2/0U0wwkLViVhq7n00h9V0pB8WFW xrB/Umvovh5DhPdMSszktc6nw9PqLD+IlrkSX/ioQ2uNVhuDw7Q76yasma/OCA== 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 4WzZnY05QvzgZb; Wed, 4 Sep 2024 21:07:29 +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 484L7StO053146; Wed, 4 Sep 2024 21:07:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7SDC053143; Wed, 4 Sep 2024 21:07:28 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:28 GMT Message-Id: <202409042107.484L7SDC053143@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: eab723be7542 - releng/14.1 - bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: eab723be754290be0501f8d287afd812c6e80a03 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=eab723be754290be0501f8d287afd812c6e80a03 commit eab723be754290be0501f8d287afd812c6e80a03 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 bhyve: fix Out-Of-Bounds read/write heap in tpm_ppi_mem_handler The function tpm_ppi_mem_handler is vulnerable to buffer over-read and over-write, the MMIO handler serves the heap allocated structure tpm_ppi_qemu. The issue is that the structure size is smaller than 0x1000 and the handler does not validate the offset and size (sizeof is 0x15A while the handler allows up to 0x1000 bytes) Reported by: Synacktiv Reviewed by: corvink Security: FreeBSD-SA-24:10.bhyve Security: CVE-2024-41928 Security: HYP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45980 (cherry picked from commit a06fc21e770a482c8915411ebc98c870e42dd29b) (cherry picked from commit 6ce4821f0859eb00e1754917e1471184755b6358) Approved by: so --- usr.sbin/bhyve/tpm_ppi_qemu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c index 8bea45ea3208..11a306077108 100644 --- a/usr.sbin/bhyve/tpm_ppi_qemu.c +++ b/usr.sbin/bhyve/tpm_ppi_qemu.c @@ -26,7 +26,7 @@ #include "tpm_ppi.h" #define TPM_PPI_ADDRESS 0xFED45000 -#define TPM_PPI_SIZE 0x1000 +#define TPM_PPI_SIZE 0x400 #define TPM_PPI_FWCFG_FILE "etc/tpm/config" @@ -101,7 +101,7 @@ tpm_ppi_init(void **sc) struct tpm_ppi_fwcfg *fwcfg = NULL; int error; - ppi = calloc(1, sizeof(*ppi)); + ppi = calloc(1, TPM_PPI_SIZE); if (ppi == NULL) { warnx("%s: failed to allocate acpi region for ppi", __func__); error = ENOMEM; From nobody Wed Sep 4 21:07:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnZ3BkYz5VP0M; Wed, 04 Sep 2024 21:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZnZ272Mz4Vc3; Wed, 4 Sep 2024 21:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6a2S5HMQiQ0Ed6/nZcZI2s5UsjSt3CGvxxIPauUDDc=; b=WhqY1+mYGiaVm537RXpgyn2GXK1iaCyOoUAdXSoygrISf8HJsbnAoD/DUupylygUlwull/ uMjXHd6aWC20SiQattHGde56bZc2etkWjCiqkFB/tnlTOhB3S6ALXXqPTvlgVQzEA0Xg/H w2DX/UPBkqWtRMAk903IrllfuF0C2oqFl2y6sW4S5UbkFaaHU7R5l8H58/J/zBGRfTEDZk WPNZUZWwo2e4Rsv5djTEwEvPjCsjpvSlw/518sO0vo0BDHOacL+d0SCCjD7rYmlF4K/tlM KA8w9jIif+qBfkdnvHgnkyAlIkDjzVegtIzz6dRiR+nDDtoZfbbD02HYQsNYHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484050; a=rsa-sha256; cv=none; b=A2F6L6SDQKIKbdfmlMV5n1doMkxASrsTXEMdW1MOtU1g+/eRTP49luEyamMKjghnnYWcx3 CYKiP3+hctfYiqKmonnaODNGFYBbhhyyltyHmVZwRzJxDZP+crcn2wiHktaziGTf1/Ukol DcRXsXU+VbX4MB0AdOUNHJxe1IxslU+6lmORDhrhkV0NCJ8+WLUtKC6yyPi3ADwFIwmqLt 4+KSIZWwcCB01QjTWFY0oDWoVCDbrlLM/F1pXEDl4xWH0gssFfaBNZaijzQJfHaKruJTwJ rYkLGVGncJFJoRaGvW9YCWrs5oIFlCGNWIcx3nAR5smdUHG2VioFBYZRHoAZ+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6a2S5HMQiQ0Ed6/nZcZI2s5UsjSt3CGvxxIPauUDDc=; b=sE50lcE0Tdo1EoOcDFjNoN650w+CHzL2JvjjkQIVWdx+P399/OaVH3y+2/etLJkfoozhzy AELGGVcsgDL8XAoypo0nIfezZJD2uplt6wJ6X/cC6c5u4qP7paSktb1+Whc+j9lnESAOvE DQVlVa6SGIihZ3NPmX1jbdbUAB3+W+6i3Xxi/bIa/o07r1zOTG1+BFEEyvSwKcd1ePGT0i jj+4Gzd1Ezvh7XQv42i8kubBUgIczA1/sfuD9rsNAZRC177SdZUElhYQIfHgYP9tuGZHyq mViXBMfQ91mJZ2BkjagpPR/y6CcrBt67GkLKGpA4UZVp+gBh1CT6pIN8uAzJ2Q== 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 4WzZnZ17lBzgcS; Wed, 4 Sep 2024 21:07:30 +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 484L7Umt053188; Wed, 4 Sep 2024 21:07:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7U57053185; Wed, 4 Sep 2024 21:07:30 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:30 GMT Message-Id: <202409042107.484L7U57053185@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: 31d839d66e8a - releng/14.1 - ctl: fix Use-After-Free in ctl_write_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 31d839d66e8a10693e791696ea4bfd93ec1feb34 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=31d839d66e8a10693e791696ea4bfd93ec1feb34 commit 31d839d66e8a10693e791696ea4bfd93ec1feb34 Author: Alan Somers AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 ctl: fix Use-After-Free in ctl_write_buffer The virtio_scsi device allows a guest VM to directly send SCSI commands to the kernel driver exposed on /dev/cam/ctl. This setup makes the vulnerability directly accessible from VMs through the pci_virtio_scsi bhyve device. The function ctl_write_buffer sets the CTL_FLAG_ALLOCATED flag, causing the kern_data_ptr to be freed when the command finishes processing. However, the buffer is still stored in lun->write_buffer, leading to a Use-After-Free vulnerability. Since the buffer needs to persist indefinitely, so it can be accessed by READ BUFFER, do not set CTL_FLAG_ALLOCATED. Reported by: Synacktiv Reviewed by: Pierre Pronchery Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-45063 Security: HYP-03 Sponsored by: Axcient Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46424 (cherry picked from commit 670b582db6cb827a8760df942ed8af0020a0b4d0) (cherry picked from commit 29937d7a1a0a3061c6ae12b5b35cc32b03829501) Approved by: so --- sys/cam/ctl/ctl.c | 19 +++++++++++-------- sys/cam/ctl/ctl_private.h | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a315c5ef7df3..7fb38c794a4c 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5673,21 +5673,24 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } + /* - * If we've got a kernel request that hasn't been malloced yet, - * malloc it and tell the caller the data buffer is here. + * If this kernel request hasn't started yet, initialize the data + * buffer to the correct region of the LUN's write buffer. Note that + * this doesn't set CTL_FLAG_ALLOCATED since this points into a + * persistent buffer belonging to the LUN rather than a buffer + * dedicated to this request. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - if (lun->write_buffer == NULL) { - lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); - } + if (ctsio->kern_data_ptr == NULL) { ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 04846f80e913..db8e748ec014 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -411,6 +411,14 @@ struct ctl_lun { uint8_t pr_res_type; int prevent_count; uint32_t *prevent; + + /* + * The READ_BUFFER and WRITE_BUFFER commands permit access to a logical + * data buffer associated with a LUN. Accesses to the data buffer do + * not affect data stored on the storage medium. To support this, + * allocate a buffer on first use that persists until the LUN is + * destroyed. + */ uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; From nobody Wed Sep 4 21:07:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnb4qRtz5VNmF; Wed, 04 Sep 2024 21:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZnb3C8lz4VYb; Wed, 4 Sep 2024 21:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XkVfKFNPhV5PVlkqBPgMFDVtV4ZaT2J9S6DR70ncv7g=; b=yLxoVGGB5qoMnv0CSjxho7DHDevDhrreEHuET+IR/dAGuw3H88H3KK32CRa4wWIXs/KSKy s3M2Ov4RxUgZoDfutOLMNdYSSpn8PyPkRpL/SRCv4I4ma7qFKv6l8f7FQBtL8Zn+oUc9v/ LouyfjbDocVnJsImJqchFhuBch1qvmwooFVa4SCYzkrOV1+Yb0deuvBS/zHFN3T0+HH7oy YLCuQPGHrSCSvnbtGYQsUwbyVZrm5bQxnKoKOtCkKPvx0RWi+FpovSpv1oXxOxuXuR2Wqu gMcLNB5XBFC+8AnLUFNlbVWF1ro6Rw315OpjHidcsR5a+p4QJsN70z9RmNmyKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484051; a=rsa-sha256; cv=none; b=wn27fqeN14zA4i8QLh/rtVHEkHeTWmbd1oOgFT/uve9xX6rDJDTybhmv/Bb0BvI+dfIFdm 7i/EnAyF4wouqvq487EVKQwU0ZvkOvjM/H4+t9exhmCd2LHXwmMgqMoUkndlTkQbtcud9r mv1x0vm5/9l9FiIO03eyWl8tHAO4q6e/C8NMweUlttcJDCqlRDYpXXLvkvwjwUJO3rTFNx bT0BEJaX4HbgFONPFDv6sbAr2WtBaahlNlf0yNnVK7IE2UtVexkxSn/z+2R7eJXm3ze9EH xxP6ONEETASAYOyoK5KZHO0OElxNbYlqpP98PZJC3ktHb7p8gJkTdZI4hbkBFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XkVfKFNPhV5PVlkqBPgMFDVtV4ZaT2J9S6DR70ncv7g=; b=eclOFkzcYFRaI9iEqMsLLeXOKxJ/AAi6Xt+nNf3FNtP4yLyeDPRV+d3MhDNSP6vRaQmK4Z Gi9WpeBWFfNFkc/KgWmUPKM893r7VJUcgOISEOcNOT8EHllQW/fJv3JEgccQzhtouFSuY7 k1nbf8m+8nsg3B33dwGAK0XbVcjd/FgBmF6I9YmnhEKN5sRj1O+9cY4I1S/ka3D77d+wjD vV3TtmRaJ0BZlBUX1qXgUXxAP8YLWK2TCegbLAHG1szV8luoaxWgJObXQK+0c3X8zEh2uX XfoHha4uTcKfUstVwR9zvhDtFvoPIhGFEJlXSeybbfixmJkO3vWF2dRzt93e/w== 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 4WzZnb1sh4zgcT; Wed, 4 Sep 2024 21:07:31 +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 484L7VlA053242; Wed, 4 Sep 2024 21:07:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7VVE053239; Wed, 4 Sep 2024 21:07:31 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:31 GMT Message-Id: <202409042107.484L7VVE053239@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: 235b93d39d71 - releng/14.1 - ctl: fix memory disclosure in read/write buffer commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 235b93d39d71860983b15ce8ad63f0a939cd1be9 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=235b93d39d71860983b15ce8ad63f0a939cd1be9 commit 235b93d39d71860983b15ce8ad63f0a939cd1be9 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 ctl: fix memory disclosure in read/write buffer commands The functions ctl_write_buffer() and ctl_read_buffer() are vulnerable to a kernel memory disclosure caused by an uninitialized kernel allocation. If one of these functions is called for the first time for a given LUN, a kernel allocation is performed without the M_ZERO flag. Then a call to ctl_read_buffer() returns the content of this allocation, which may contain kernel data. Reported by: Synacktiv Reviewed by: asomers Reviewed by: jhb Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-8178 Security: HYP-05 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45952 (cherry picked from commit ea44766b78d639d3a89afd5302ec6feffaade813) (cherry picked from commit cdfdb3b0086268cdc365174ebfb69e66b5dde0b5) Approved by: so --- sys/cam/ctl/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 7fb38c794a4c..9752ca93d36c 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5634,7 +5634,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio) } else { if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; } @@ -5675,7 +5675,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) if (lun->write_buffer == NULL) { lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Wed Sep 4 21:07:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnd0wM3z5VP0P; Wed, 04 Sep 2024 21:07: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 4WzZnc4KpWz4VlC; Wed, 4 Sep 2024 21:07:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gdwvn2/VaSNchUIeWbMja+/6yhEzaAHckRocFMwur9E=; b=v0mUSFkYigvCHgUB+6WZ2RG+09iwfz42VSZfqpHNQVTArxBS4wlM8Khi8kaA/iv6tLSgDu ACojsY0Luwk6IYAx8LVYCryrZLes47wU4P4GUD+QEdkzzNOISRjXhHuEtTYx2Z1DrLHP8K HFeqi4/DsiOEGr7dKmn25yE1A63skINYmM49wf4Aagir1J+B3UR4EoI+ofMST1oRiHlRdG We+dSnomeVB4cCtOdvczu/UzpsBKSzhAL6STtDxble4BkTyIEe1k7NLWApfwg1gg3+xwj6 nulQaUdEqEsICJTGzkziOOrWtctCRMoKqLaH8FsyzWC2qaE/yKPQETQnmVq6JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484052; a=rsa-sha256; cv=none; b=NUposMYSWmGvmyIOkJOne9V9UjMmO3JBCsi/Ao9l05LquxlJ/uSxJ95uZeu8vRDuJEVU27 x4QXCbVohyT4oillDnGPRPzYmGrxFQNFAY0CLrTwyEx4rPJrMMsiU0pPpeR42YG3+qwQm/ zkO31wkJeT61lN9H7442rBFbL60rrWrXQhdUVehrfkOQftz6r0EFrBufY3MdMNmShVbpSd 4Dew7pYT7tQSlUoJ574xT0/m4BS1ZtK2wfHTpr4xCXZiT1GSy3eR/diGPrA0IPHV1r2oAu s9i65OB7Nhp/7XunT0mpUybEu9bWOooYIqRpW2DG1ohhbg74wGoNCeQOh4Q8Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gdwvn2/VaSNchUIeWbMja+/6yhEzaAHckRocFMwur9E=; b=JJUbZ7IdCY4PGMpgtFoseRbu7xrWV2mj8sBcAqubzxl2KpVfS7+YakIYDm4hzu3/gAZcoH fPLi2VAzDiJh8xvWvC6PFb+KtKgm+OPUYPbJlXpLEJlvjrqSK7tXw7W+/cQf09RFHY/6Vu tIPlER7kVjOvb7lqtcLnUfzQXYMyDR1vfC8TxxyzFC1wAwKMSyehXu9Hb7jt2VbwdupHF8 QOxrzD6lZxG+EwXrNG7cXAtYvooj3k0wtnBJnPHVHdCUjPtUWZsT45Xl3FM87jiD54Uo/h NuosIDU4jVuYEzb4J/HETTbGsh9r1YSBHf5SX93NkIbLv1/dGhuoG7E/hArVYA== 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 4WzZnc2hLqzgcV; Wed, 4 Sep 2024 21:07: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 484L7WLj053288; Wed, 4 Sep 2024 21:07:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7W1F053285; Wed, 4 Sep 2024 21:07:32 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:32 GMT Message-Id: <202409042107.484L7W1F053285@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: 1c872882803a - releng/14.1 - ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 1c872882803ad215e2c4bf867885d70e40f6f7f5 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c872882803ad215e2c4bf867885d70e40f6f7f5 commit 1c872882803ad215e2c4bf867885d70e40f6f7f5 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 ctl: fix Out-Of-Bounds access in ctl_report_supported_opcodes This vulnerability is directly accessible to a guest VM through the pci_virtio_scsi bhyve device. In the function ctl_report_supported_opcodes() accessible from the VM, the option RSO_OPTIONS_OC_ASA does not check the requested service_action value before accessing &ctl_cmd_table[]. Reported by: Synacktiv Reviewed by: asomers Security: FreeBSD-SA-24:11.ctl Security: CVE-2024-42416 Security: HYP-06 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46027 (cherry picked from commit af438acbfde3d25dbdc82b2b3d72380f0191e9d9) (cherry picked from commit 803e0c2ab29bb6b715c38e82da4930d46590e8e0) Approved by: so --- sys/cam/ctl/ctl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 9752ca93d36c..ede6b7d88b94 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -7514,20 +7514,19 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) case RSO_OPTIONS_OC_SA: if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || service_action >= 32) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 1, - /*bit*/ 2); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto invalid; } - /* FALLTHROUGH */ + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; case RSO_OPTIONS_OC_ASA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 && + service_action >= 32) { + goto invalid; + } total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; break; default: +invalid: ctl_set_invalid_field(/*ctsio*/ ctsio, /*sks_valid*/ 1, /*command*/ 1, From nobody Wed Sep 4 21:07:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnd6njCz5VNmL; Wed, 04 Sep 2024 21:07: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 4WzZnd4DQYz4VgG; Wed, 4 Sep 2024 21:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBhSwltYQSeZtIphC+u8w4VrIbecW2yxITjl37HD0m8=; b=KW4TPC4mbVD+K6UQzXwJAbCBfY7EkkyJ096tgkWHSqfa1xi+QGdekCp8DKyBRn783UwNQD PWdrdGTe8iNHIvpyI+TDf6klV8UdNLpeEEpNuzmbln6U0SVHYsJOzASDn5Lx+Iqm2R8DIJ Zivxd5r6UDm5IgiiTadYP9KfOcJvGeLbiGWvOHUymiT+GMopSc2N+Vg0mPyAYhabGtovCB lVbyBkNhp1Qjf4WOz1nsVjS3P7rKDrrHb68+YbaULY6DlS57qNOepAVatICvtODqghp2kC yvfSS/qx9xdwA+iyW6a6zUiRtoQ/MDyGOvKlqOZWvAWIrh08xYeyscu71dordg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484053; a=rsa-sha256; cv=none; b=uCrKjRquWVMgnr5tiHAYoJNBZkw3V3tA7kBJA9q6wLN0qzIlvJJxYSKQpgzJAoFUZKulkF 2OmXcWxEEp37fOF1hcK65C+6a9Tm6Ebchfo4MjTkQfIXOTcLeqYrLCKsM1mXAL2kgAoSh1 YADEjHZXEWM34tob1PkxwGL6WPnQ9vp71KSluzoHHqjFi9EuHGYHZsIe1aV0p4LfcuLmvE kjs+0J0DoHiZT/ys7QBBfKMcpTzurNdXg6dAb9u/QC9iADGkBBLuXmrkw3Uc0U8zy4FJ8W a/cX4m7tBmwk8i4pL32CVVFkXu0GESjoTQ9osjJ91+t0nLIkcnYCt3wr0V/7sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBhSwltYQSeZtIphC+u8w4VrIbecW2yxITjl37HD0m8=; b=c11/yLIFe7w3H+3r4/AdkIB8fKp9iPCZb7kyVHHzJfww0y/0hGTC1mXQcnedzRflW2lXka uvXdjAdyim9mi/hKdTZBOqTR7PVK9ibA/v1pZVgnhnE6GzxVAdU/RVwbkfDraphLlGK6bm U8Jq92yHjqXdvQcwscplXANujSKp8+NOI2LpMNfhc7NyIMKtpvq8aklLwm9uw7A5zIiyO8 QfEHboOTp17kqOBDR44PmkVPLd4Ks+/2UTWZxlA9516MshjZ8xk6wFG+O3m040GFa4+vQh RIiprNh29cC6F2dbW/ODpX38TaqED2IenioteULSpiNnCuU2p5uWMcO8ve/gBQ== 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 4WzZnd3qz9zgg3; Wed, 4 Sep 2024 21:07: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 484L7XpB053342; Wed, 4 Sep 2024 21:07:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7Xd9053339; Wed, 4 Sep 2024 21:07:33 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:33 GMT Message-Id: <202409042107.484L7Xd9053339@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: d30ffde0806e - releng/14.1 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: d30ffde0806e8738b6548d2a890a9eb7d06c18fb Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d30ffde0806e8738b6548d2a890a9eb7d06c18fb commit d30ffde0806e8738b6548d2a890a9eb7d06c18fb Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) Approved by: so --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index ede6b7d88b94..0e0d79d15d8f 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9342,14 +9342,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Wed Sep 4 21:07:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnf6tymz5VNvd; Wed, 04 Sep 2024 21:07: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 4WzZnf5VY5z4Vlh; Wed, 4 Sep 2024 21:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QCtgKR5H2k8U5AB6Pc1Z7lqQG7ZWRWNH/K4pKLcEz2c=; b=mcNL2BbC0LnAiHqyiyQhLdvsvBS2JmVHZXKAkjhDYbPvyKm3FZ3BpzSt3vMIeWkUnIkhbx FLr4WiVfplvblVK0jpwE2BLi+wVL4F5WuM54hXnvzca+KhrEUyKzQrS+QBeSSjnIPc7XYH W50l7i08eqBai4jyNpeip2e2LB2/JKIx0qfsFzEK+eilAOxslLWOCMEOGAjFedozO6wvBQ Nfqo5xHhP8+Sr+oIg0XmRXeuHWwtWejtk5tDvq4gKG6p3/ItBr8auBtDg31ZEsi1bfSn6T RUh2Z2aPpdLdBlbPpiQMlX/XXovsOXSFs0SWXpA/2nwRx6E22r3QGBkdvSkzWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484054; a=rsa-sha256; cv=none; b=Kv80Qtzhh3fVs6xpGthsOQbnVZ52M2VoWm6yjL5MqLbnvt9Dc4eTgzAmUf9CR9oLoIR+Jh pSS4Y/o3zwZZ9Ws/PVHT3v29SowJZxNFcJ4h2LnEruThWrbT6NMVbvDtdr9eBdSWf4O9U3 Zs5/m1itLQ2pL+OvfXqUMRmGZ3I9G7n/Khs+u1jLsDmL+n6GyN9+kXkFKYdo87oNK/XRge OsB/X6dr7+kaWUGJjTEvENAMV3Tp13PGqTpcv3oT/Uw8q+dsTdM04+TIlqoV+GpQg2K/j8 Xo3zqbc2uMxr2qyWaUdc6+SX9uq9hlmmxV9ag7TiTKj18oox3RKTv/RRE9yoqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QCtgKR5H2k8U5AB6Pc1Z7lqQG7ZWRWNH/K4pKLcEz2c=; b=cicVbeY1gkgy1YvV11YuXXX4dfRbueui1dRjZYfp7c/cY+2VBqXQGwLTTD+cnn56t3kByi sRCKwEijlWTVuyiHvYywUKXSib/8XRrgfhgc6+e+sxlv4Pq1LA4Yyt/SX7ljC5WZMywbhG uT5Fo/W8fZXtbbhoaUOAAo1uNsTgIu2rfgSJCJUKNW6mJ1/ohxFR3AtcSN/TUfcSXOoyNG cLUMndiY7aLHBrQ71s0LiOMK7pk0uQzb5hGZwLXxkv0BmCTf5OBb91JW4USz0CGxRJKS0C pqIZkT78Y4rDvdeaCbGooBTxlBnz7Mff5eJP0jW1CrBR9BykzfkyA8fdMq75ug== 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 4WzZnf4rHHzgq0; Wed, 4 Sep 2024 21:07: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 484L7Yqm053398; Wed, 4 Sep 2024 21:07:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7Yxb053395; Wed, 4 Sep 2024 21:07:34 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:34 GMT Message-Id: <202409042107.484L7Yxb053395@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: bb245c142075 - releng/14.1 - bhyve: fix off by one error in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: bb245c1420753a68f9a17c1ee78ab84ddaf30b61 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bb245c1420753a68f9a17c1ee78ab84ddaf30b61 commit bb245c1420753a68f9a17c1ee78ab84ddaf30b61 Author: Pierre Pronchery AuthorDate: 2024-09-04 14:38:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 bhyve: fix off by one error in pci_xhci The function pci_xhci_find_stream validates that the streamid is valid but the bound check accepts up to ep_MaxPStreams included. The bug results in an out-of-bounds write on the heap with controlled data. Reported by: Synacktiv Reviewed by: jhb Security: FreeBSD-SA-24:12.bhyve Security: CVE-2024-32668 Security: HYP-04 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45994 (cherry picked from commit 5c9308a4130858598c76f3ae6e3e3dfb41ccfe68) (cherry picked from commit 90af1336ed5e3c8556147325c4841c68639c4b63) Approved by: so --- usr.sbin/bhyve/pci_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 99c1d20b3378..791c56a45f0b 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -660,7 +660,7 @@ pci_xhci_init_ep(struct pci_xhci_dev_emu *dev, int epid) devep = &dev->eps[epid]; pstreams = XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0); if (pstreams > 0) { - DPRINTF(("init_ep %d with pstreams %d", epid, pstreams)); + DPRINTF(("init_ep %d with pstreams %u", epid, pstreams)); assert(devep->ep_sctx_trbs == NULL); devep->ep_sctx = XHCI_GADDR(dev->xsc, ep_ctx->qwEpCtx2 & @@ -1202,7 +1202,7 @@ pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep, } /* only support primary stream */ - if (streamid > devep->ep_MaxPStreams) + if (streamid >= devep->ep_MaxPStreams) return (XHCI_TRB_ERROR_STREAM_TYPE); sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + From nobody Wed Sep 4 21:07:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnh1v99z5VNmR; Wed, 04 Sep 2024 21:07: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 4WzZng6wRrz4Vnt; Wed, 4 Sep 2024 21:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCI3yqPdSE94pKfIABNSqfVIzr3qHjvjDVPKauIfVcE=; b=cx4Q985PSiSzGyBROECoC/8EHLGdcPOnXZikFvYeceMqWGBwG8X4v1NXixd4shBTBrH5EC eFa8CeVdS9gBFAcqfKATthDLtYLHqlN0EeqqQA/1lrb7s7J7oo5x1eO3guZFbCf3ns/iXv 523ev0hKMG+p+Udn+cd42zi9oZZkIXnGNRqukmACuCEFH8RWKt5Jtwwj2etcc5mfmYxX3D axthIGgW7IOMOb2Zslb7dwlwouhclh3A/MlxkaF6zHIAGMtbKD/M5dzSmt3GSHwuq0DhOr tfZb02ud9aE5CbuXggLkDLIeSnclFtwZNPWCNtihl8lip5Eh+MlokR6OFz6iEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484056; a=rsa-sha256; cv=none; b=Blt5KflHLHkdb32pKtIuiMFqJYf0JT+Yp1eHi1R/Hhcpa0Z+tsyZKpF5RaEPyejxGpMxD+ hIDLdx4g/yYN/kOKUoxY6J1f57Xjj6TWwwyggPpGp7fWSVa7NAwuhsoUhNfpIVD2r21c8q /YJfj72q5Fyl4ZH4d0RGD9H5tAkihRclVi86y1jjo4ERUHZtTyku4WY6ZL3pKruznDbgmO R1+YAHiFdjoX3tAh0tZZ3qqtgZ9Up96I4Hew7QhzOO0zclL/ovmkZC/yV+00vLI42Xq2tQ 5Gz5UuOQlQJkWh6nWaQH5YOyw/6ihMXrn04odMjG2XQ1tO/jbki3KJdpLTrAAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCI3yqPdSE94pKfIABNSqfVIzr3qHjvjDVPKauIfVcE=; b=i57B6b/64eHuL0Ed+9rAVip5KEjfgNv/IjP03Wb+nhti5yVRJ7DXfYWKbIGHaG4w1rv2hB hg0TJgYNaZ4guY5gdKmQaVh6cgB6FD0i8Y3dFUDWX0JblXSH6qU6x1CUVwfogMBXZI3bAb LBFpMqordIBDIDIk1gVLFCW8s5RXymKaqAH3uxArC7V6fPmUUF4Bte/dvVXsorbr02iLLX sBgG4ZruU1MAwSNeehQomfSExYYLQebZVY3ujhNu/64P596DyB/rzqfHxN9es5IreZs9tp a1B4DJQCZsXIk51phD6Nv55BL34wp8megjNG2zAJklOqtiV/jArlikCwMvhw6Q== 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 4WzZng60l4zgg4; Wed, 4 Sep 2024 21:07: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 484L7ZiY053456; Wed, 4 Sep 2024 21:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7ZYG053453; Wed, 4 Sep 2024 21:07:35 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:35 GMT Message-Id: <202409042107.484L7ZYG053453@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: 9a5a7c90d5e5 - releng/14.1 - openssl: Avoid type errors in EAI-related name check logic. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 9a5a7c90d5e5971fe2b9c9265e9279a6f173a8f3 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9a5a7c90d5e5971fe2b9c9265e9279a6f173a8f3 commit 9a5a7c90d5e5971fe2b9c9265e9279a6f173a8f3 Author: Viktor Dukhovni AuthorDate: 2024-06-19 11:04:11 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 openssl: Avoid type errors in EAI-related name check logic. The incorrectly typed data is read only, used in a compare operation, so neither remote code execution, nor memory content disclosure were possible. However, applications performing certificate name checks were vulnerable to denial of service. The GENERAL_TYPE data type is a union, and we must take care to access the correct member, based on `gen->type`, not all the member fields have the same structure, and a segfault is possible if the wrong member field is read. The code in question was lightly refactored with the intent to make it more obviously correct. Security: CVE-2024-6119 Obtained from: OpenSSL Project (cherry picked from commit 1486960d6cdb052e4fc0109a56a0597b4e902ba1) (cherry picked from commit 5946b0c6cbc77e6c5f62f5f7e635c6036e14f4d0) Approved by: so --- crypto/openssl/crypto/x509/v3_utl.c | 78 +++++++++++++++------- crypto/openssl/test/recipes/25-test_eai_data.t | 12 +++- .../test/recipes/25-test_eai_data/kdc-cert.pem | 21 ++++++ .../recipes/25-test_eai_data/kdc-root-cert.pem | 16 +++++ .../openssl/test/recipes/25-test_eai_data/kdc.sh | 41 ++++++++++++ 5 files changed, 142 insertions(+), 26 deletions(-) diff --git a/crypto/openssl/crypto/x509/v3_utl.c b/crypto/openssl/crypto/x509/v3_utl.c index 6e4ef26ed608..304463d572c6 100644 --- a/crypto/openssl/crypto/x509/v3_utl.c +++ b/crypto/openssl/crypto/x509/v3_utl.c @@ -916,36 +916,64 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, ASN1_STRING *cstr; gen = sk_GENERAL_NAME_value(gens, i); - if ((gen->type == GEN_OTHERNAME) && (check_type == GEN_EMAIL)) { - if (OBJ_obj2nid(gen->d.otherName->type_id) == - NID_id_on_SmtpUTF8Mailbox) { - san_present = 1; - - /* - * If it is not a UTF8String then that is unexpected and we - * treat it as no match - */ - if (gen->d.otherName->value->type == V_ASN1_UTF8STRING) { - cstr = gen->d.otherName->value->value.utf8string; - - /* Positive on success, negative on error! */ - if ((rv = do_check_string(cstr, 0, equal, flags, - chk, chklen, peername)) != 0) - break; - } - } else + switch (gen->type) { + default: + continue; + case GEN_OTHERNAME: + switch (OBJ_obj2nid(gen->d.otherName->type_id)) { + default: continue; - } else { - if ((gen->type != check_type) && (gen->type != GEN_OTHERNAME)) + case NID_id_on_SmtpUTF8Mailbox: + /*- + * https://datatracker.ietf.org/doc/html/rfc8398#section-3 + * + * Due to name constraint compatibility reasons described + * in Section 6, SmtpUTF8Mailbox subjectAltName MUST NOT + * be used unless the local-part of the email address + * contains non-ASCII characters. When the local-part is + * ASCII, rfc822Name subjectAltName MUST be used instead + * of SmtpUTF8Mailbox. This is compatible with legacy + * software that supports only rfc822Name (and not + * SmtpUTF8Mailbox). [...] + * + * SmtpUTF8Mailbox is encoded as UTF8String. + * + * If it is not a UTF8String then that is unexpected, and + * we ignore the invalid SAN (neither set san_present nor + * consider it a candidate for equality). This does mean + * that the subject CN may be considered, as would be the + * case when the malformed SmtpUtf8Mailbox SAN is instead + * simply absent. + * + * When CN-ID matching is not desirable, applications can + * choose to turn it off, doing so is at this time a best + * practice. + */ + if (check_type != GEN_EMAIL + || gen->d.otherName->value->type != V_ASN1_UTF8STRING) + continue; + alt_type = 0; + cstr = gen->d.otherName->value->value.utf8string; + break; + } + break; + case GEN_EMAIL: + if (check_type != GEN_EMAIL) continue; - } - san_present = 1; - if (check_type == GEN_EMAIL) cstr = gen->d.rfc822Name; - else if (check_type == GEN_DNS) + break; + case GEN_DNS: + if (check_type != GEN_DNS) + continue; cstr = gen->d.dNSName; - else + break; + case GEN_IPADD: + if (check_type != GEN_IPADD) + continue; cstr = gen->d.iPAddress; + break; + } + san_present = 1; /* Positive on success, negative on error! */ if ((rv = do_check_string(cstr, alt_type, equal, flags, chk, chklen, peername)) != 0) diff --git a/crypto/openssl/test/recipes/25-test_eai_data.t b/crypto/openssl/test/recipes/25-test_eai_data.t index 522982ddfb80..e18735d89aad 100644 --- a/crypto/openssl/test/recipes/25-test_eai_data.t +++ b/crypto/openssl/test/recipes/25-test_eai_data.t @@ -21,16 +21,18 @@ setup("test_eai_data"); #./util/wrap.pl apps/openssl verify -nameopt utf8 -no_check_time -CAfile test/recipes/25-test_eai_data/utf8_chain.pem test/recipes/25-test_eai_data/ascii_leaf.pem #./util/wrap.pl apps/openssl verify -nameopt utf8 -no_check_time -CAfile test/recipes/25-test_eai_data/ascii_chain.pem test/recipes/25-test_eai_data/utf8_leaf.pem -plan tests => 12; +plan tests => 16; require_ok(srctop_file('test','recipes','tconversion.pl')); my $folder = "test/recipes/25-test_eai_data"; my $ascii_pem = srctop_file($folder, "ascii_leaf.pem"); my $utf8_pem = srctop_file($folder, "utf8_leaf.pem"); +my $kdc_pem = srctop_file($folder, "kdc-cert.pem"); my $ascii_chain_pem = srctop_file($folder, "ascii_chain.pem"); my $utf8_chain_pem = srctop_file($folder, "utf8_chain.pem"); +my $kdc_chain_pem = srctop_file($folder, "kdc-root-cert.pem"); my $out; my $outcnt = 0; @@ -56,10 +58,18 @@ SKIP: { ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $ascii_chain_pem, $ascii_pem]))); ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $utf8_chain_pem, $utf8_pem]))); +ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $kdc_chain_pem, $kdc_pem]))); ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $ascii_chain_pem, $utf8_pem]))); ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $utf8_chain_pem, $ascii_pem]))); +# Check an otherName does not get misparsed as an DNS name, (should trigger ASAN errors if violated). +ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_hostname", 'mx1.example.com', "-CAfile", $kdc_chain_pem, $kdc_pem]))); +# Check an otherName does not get misparsed as an email address, (should trigger ASAN errors if violated). +ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", 'joe@example.com', "-CAfile", $kdc_chain_pem, $kdc_pem]))); +# We expect SmtpUTF8Mailbox to be a UTF8 String, not an IA5String. +ok(!run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", 'moe@example.com', "-CAfile", $kdc_chain_pem, $kdc_pem]))); + #Check that we get the expected failure return code with({ exit_checker => sub { return shift == 2; } }, sub { diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem new file mode 100644 index 000000000000..e8a2c6f55d45 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbDCCAlSgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 +MCAXDTI0MDYyMDA2MTQxNVoYDzIxMjQwNjIwMDYxNDE1WjAXMRUwEwYDVQQDDAxU +RVNULkVYQU1QTEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6wfP+ +6go79dkpo/dGLMlPZ7Gw/Q6gUYrCWZWUEgEeRVHCrqOlgUEyA+PcWas/XDPUxXry +BQlJHLvlqamAQn8gs4QPBARFYWKNiTVGyaRkgNA1N5gqyZdrP9UE+ZJmdqxRAAe8 +vvpGZWSgevPhLUiSCFYDiD0Rtji2Hm3rGUrReQFBQDEw2pNGwz9zIaxUs08kQZcx +Yzyiplz5Oau+R/6sAgUwDlrD9xOlUxx/tA/MSDIfkK8qioU11uUZtO5VjkNQy/bT +7zQMmXxWgm2MIgOs1u4YN7YGOtgqHE9v9iPHHfgrkbQDtVDGQsa8AQEhkUDSCtW9 +3VFAKx6dGNXYzFwfAgMBAAGjgcgwgcUwHQYDVR0OBBYEFFR5tZycW19DmtbL4Zqj +te1c2vZLMAkGA1UdIwQCMAAwCQYDVR0TBAIwADCBjQYDVR0RBIGFMIGCoD8GBisG +AQUCAqA1MDOgDhsMVEVTVC5FWEFNUExFoSEwH6ADAgEBoRgwFhsGa3JidGd0GwxU +RVNULkVYQU1QTEWgHQYIKwYBBQUHCAmgERYPbW9lQGV4YW1wbGUuY29tgQ9qb2VA +ZXhhbXBsZS5jb22CD214MS5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA +T0xzVtVpRtaOzIhgzw7XQUdzWD5UEGSJJ1cBCOmKUWwDLTAouCYLFB4TbEE7MMUb +iuMy60bjmVtvfJIXorGUgSadRe5RWJ5DamJWvPA0Q9x7blnEcXqEF+9Td+ypevgU +UYHFmg83OYwxOsFXZ5cRuXMk3WCsDHQIBi6D1L6oDDZ2pfArs5mqm3thQKVlqyl1 +El3XRYEdqAz/5eCOFNfwxF0ALxjxVr/Z50StUZU8I7Zfev6+kHhyrR7dqzYJImv9 +0fTCOBEMjIETDsrA70OxAMu4V16nrWZdJdvzblS2qrt97Omkj+2kiPAJFB76RpwI +oDQ9fKfUOAmUFth2/R/eGA== +-----END CERTIFICATE----- diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem new file mode 100644 index 000000000000..a74c96bf3146 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc-root-cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICnDCCAYQCCQCBswYcrlZSHjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARS +b290MCAXDTI0MDYyMDA2MTQxNVoYDzIxMjQwNjIwMDYxNDE1WjAPMQ0wCwYDVQQD +DARSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqRj8S4kBbIUj +61kZfi6nE35Q38U140+qt4uAiwAhKumfVHlBM0zQ98WFt5zMHIBQwIb3yjc2zj+0 +qzUnQfwm1r/RfcMmBPEti9Ge+aEMSsds2gMXziOFM8wd2aAFPy7UVE0XpEWofsRK +MGi61MKVdPSbGIxBwY9VW38/7D/wf1HtJe7y0xpuecR7GB2XAs+qST59NjuF+7wS +dLM8Hb3TATgeYbXXWsRJgwz+SPzExg5WmLnU+7y4brZ32dHtdSmkRVSgSlaIf7Xj +3Tc6Zi7I+W/JYk7hy1zUexVdWCak4PHcoWrXe0gNNN/t8VfLfMExt5z/HIylXnU7 +pGUyqZlTGQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAHpLF1UCRy7b6Hk0rLokxI +lgwiH9BU9mktigAGASvkbllpt+YbUbWnuYAvpHBGiP1qZtfX2r96UrSJaGO9BEzT +Gp9ThnSjoj4Srul0+s/NArU22irFLmDzbalgevAmm9gMGkdqkiIm/mXbwrPj0ncl +KGicevXryVpvaP62eZ8cc3C4p97frMmXxRX8sTdQpD/gRI7prdEILRSKveqT+AEW +7rFGM5AOevb4U8ddop8A3D/kX0wcCAIBF6jCNk3uEJ57jVcagL04kPnVfdRiedTS +vfq1DRNcD29d1H/9u0fHdSn1/+8Ep3X+afQ3C6//5NvOEaXcIGO4QSwkprQydfv8 +-----END CERTIFICATE----- diff --git a/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh new file mode 100755 index 000000000000..7a8dbc719fb7 --- /dev/null +++ b/crypto/openssl/test/recipes/25-test_eai_data/kdc.sh @@ -0,0 +1,41 @@ +#! /usr/bin/env bash + +# Create a root CA, signing a leaf cert with a KDC principal otherName SAN, and +# also a non-UTF8 smtpUtf8Mailbox SAN followed by an rfc822Name SAN and a DNS +# name SAN. In the vulnerable EAI code, the KDC principal `otherName` should +# trigger ASAN errors in DNS name checks, while the non-UTF8 `smtpUtf8Mailbox` +# should likewise lead to ASAN issues with email name checks. + +rm -f root-key.pem root-cert.pem +openssl req -nodes -new -newkey rsa:2048 -keyout kdc-root-key.pem \ + -x509 -subj /CN=Root -days 36524 -out kdc-root-cert.pem + +exts=$( + printf "%s\n%s\n%s\n%s = " \ + "subjectKeyIdentifier = hash" \ + "authorityKeyIdentifier = keyid" \ + "basicConstraints = CA:false" \ + "subjectAltName" + printf "%s, " "otherName:1.3.6.1.5.2.2;SEQUENCE:kdc_princ_name" + printf "%s, " "otherName:1.3.6.1.5.5.7.8.9;IA5:moe@example.com" + printf "%s, " "email:joe@example.com" + printf "%s\n" "DNS:mx1.example.com" + printf "[kdc_princ_name]\n" + printf "realm = EXP:0, GeneralString:TEST.EXAMPLE\n" + printf "principal_name = EXP:1, SEQUENCE:kdc_principal_seq\n" + printf "[kdc_principal_seq]\n" + printf "name_type = EXP:0, INTEGER:1\n" + printf "name_string = EXP:1, SEQUENCE:kdc_principal_components\n" + printf "[kdc_principal_components]\n" + printf "princ1 = GeneralString:krbtgt\n" + printf "princ2 = GeneralString:TEST.EXAMPLE\n" + ) + +printf "%s\n" "$exts" + +openssl req -nodes -new -newkey rsa:2048 -keyout kdc-key.pem \ + -subj "/CN=TEST.EXAMPLE" | + openssl x509 -req -out kdc-cert.pem \ + -CA "kdc-root-cert.pem" -CAkey "kdc-root-key.pem" \ + -set_serial 2 -days 36524 \ + -extfile <(printf "%s\n" "$exts") From nobody Wed Sep 4 21:07:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnj2Qzvz5VNx4; Wed, 04 Sep 2024 21:07: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 4WzZnj0gY1z4VpC; Wed, 4 Sep 2024 21:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bt3Z1yFH9eEvqWDva9eDExCAgG6mnmPT9voUeMbaG/0=; b=Yt9SgucYj+RZn6DOHE+ULwa+ILKRotuujseXATzp5NrsQVNLCYHnR3+IZpNtCEFu1jEEPf W7dcShLVYxJXv2ZaWIHPlv/EtagNYxyrvGI+58an45WEh9MHRP02oyATlCqx7gkci26b97 UfRuyJrqXocMAN1erzSbvr6kQm4FPu1/HOVabhvVsZgvCvODHMaa7fbNhkAxwjR40uZmjq Zc5woBr6UmZyLd62WVjJu7Z3DT1Tqe6gh1S4Mu82IA7brS4Yb98W+7gyG88cfuHtsHtDVq AeCl/7sZPhEzEYrPBDhwiOsyWgZ/cRYVlHRvBFsvfO0Ajs8nZZh01uem9WhsYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484057; a=rsa-sha256; cv=none; b=Fz56ZglKBwV3n3Z9Czll1sEyLRZzlkqWI0x9y+OmsRpadwG3n+ligsiUVc4LVDR04IJPqn n0LNUJHFsUVm7I7n99bjEZw5hjfuJSsIGvqawAW/gh/k88VlEVl3egmnuNZ08bdR5vjjUB Cm9TRTtq/totty36JEYUL0wlp02iGPh8qPRAMxqjOg3/nDWR8Z3efOvPetMV7oIo9TqpjE HyPkEW5KcAPc0dqRc3x7zZHeVGi6l70woa7+jiw+rh8vhj+5D6XP+IYuyg6kc2MBP8B8Ne GLqIycQ0dyYGG2ZZBm7D7VnbXfBQd72nnwZKhn+iRy6+FtpaJEoMOacQJrVgvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bt3Z1yFH9eEvqWDva9eDExCAgG6mnmPT9voUeMbaG/0=; b=L2pRVdTX5nXYSjty+o7Fp9rWBO7vBGGklpPXnfhLHrYPgvQhhJCCqvlv7J+1DGyUzVQgEn r86yNxOxFkPnkiGyIKQTjeL3FEvbZ3CXeEZEKG9BtluEu8AYF4I3U8eNPYbh7wI45uFEEq m/4nqKtWwLsGt0zJ4Rl+xMBzLfn0G47DiqwpP99qOc4ZTfAvVw4G6gyBJcm96N0h2Xt172 Iwn7BUmdqf9TbBD8DDM0Hg3Ecd0BjoIbePMPrMqQcIjRPXIxQ0PC24nTn+NrsDv8aEWmY2 o+2G8SP9FlHutcNFLsYpuO92EEDCInkmqJJ9rMygpGCTH6RtZbc3HFkt/8S9Ag== 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 4WzZnj01Rrzgq1; Wed, 4 Sep 2024 21:07: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 484L7ah7053504; Wed, 4 Sep 2024 21:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7aLu053501; Wed, 4 Sep 2024 21:07:36 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:36 GMT Message-Id: <202409042107.484L7aLu053501@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: 2e27b82531e4 - releng/14.1 - umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 2e27b82531e43c1de2ce0b2a62860f437eb3a3ae Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2e27b82531e43c1de2ce0b2a62860f437eb3a3ae commit 2e27b82531e43c1de2ce0b2a62860f437eb3a3ae Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 umtx: shm: Collapse USHMF_REG_LINKED and USHMF_OBJ_LINKED flags ...into the only USHMF_LINKED, as they are always set or unset together. This is both to stop giving the impression that they can be set/unset independently, which they can't with the current code, and to make it clearer that an upcoming reference counting fix is correct. Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit dd83da532c36830a0c0aac624903849262ec6f68) (cherry picked from commit 2d4511bb81ed70d84ba6ed2ffb54e6a138653a63) Approved by: so --- sys/kern/kern_umtx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 092fcade9d19..cecb4a021cfb 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4292,8 +4292,7 @@ __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap, #define USHM_OBJ_UMTX(o) \ ((struct umtx_shm_obj_list *)(&(o)->umtx_data)) -#define USHMF_REG_LINKED 0x0001 -#define USHMF_OBJ_LINKED 0x0002 +#define USHMF_LINKED 0x0001 struct umtx_shm_reg { TAILQ_ENTRY(umtx_shm_reg) ushm_reg_link; LIST_ENTRY(umtx_shm_reg) ushm_obj_link; @@ -4353,7 +4352,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); KASSERT(reg->ushm_refcnt > 0, ("reg %p refcnt 0 onlist", reg)); - KASSERT((reg->ushm_flags & USHMF_REG_LINKED) != 0, + KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); reg->ushm_refcnt++; return (reg); @@ -4393,14 +4392,11 @@ umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) reg->ushm_refcnt--; res = reg->ushm_refcnt == 0; if (res || force) { - if ((reg->ushm_flags & USHMF_REG_LINKED) != 0) { + if ((reg->ushm_flags & USHMF_LINKED) != 0) { TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, ushm_reg_link); - reg->ushm_flags &= ~USHMF_REG_LINKED; - } - if ((reg->ushm_flags & USHMF_OBJ_LINKED) != 0) { LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_OBJ_LINKED; + reg->ushm_flags &= ~USHMF_LINKED; } } return (res); @@ -4493,7 +4489,7 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); - reg->ushm_flags = USHMF_REG_LINKED | USHMF_OBJ_LINKED; + reg->ushm_flags = USHMF_LINKED; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 21:07:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnk4LHyz5VNsP; Wed, 04 Sep 2024 21:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZnk1Ky0z4W04; Wed, 4 Sep 2024 21:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyQ0YREDYlex7BEv/6sdQvIDpGqojsSUiFDszv4r9vI=; b=f1krf0Ofm8Q+GVSJoUD6OycYICK5FfqJEfRdwRdkLwutYf8Fs0GcycTnbsF53BiWLnp/Zu s+Q9ke/SxKhn8pXAI5EQh/EyGduj+Whg7Q2jpgjjfL0KRf6aYHPnOEu0A5g0YBRyNCdvLH KWhQNq7XttS96m355fw+arr6+IFIxLytn+FIilp+RYMFqjmyDRfum3x0Xhd389qUAqiEVx V9JzKyjV5ge3WkKrArMALRnth4F31y0GMC5AImW90A2Nmk5qJSLoJBjYhtBNbnyGhU1gK1 tfH4Qgkjshrk0Ffmxuqg25BPHf2ZEXhtALGp0fHhQicjKVaTpnw4lelDaU1Ihg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484058; a=rsa-sha256; cv=none; b=IO4HRPIlNxZ7TsnYrbWtB0fjV45TBoADWC/9ZN5TKWIRN+N+iJGx9g7PUXiLlAW4AAxkfC tCtq9PfWafW2+x1Pg9IkZhGptqUwJ/pLULoHO8k5JKzcuywdplOfKXMwYkR0UIkgE/0Ddf qOteI3aPcgRE++dD6xBnR9WqFEy3jiHh5HOH4OtPlBAear1Dt2lVMSQOj8v+ejhF6EPwfA YeUaFzHRloBF7MAds2t/F2jl4Jf+oe0Q3Egj17EkWy12+EHQI7Wrp/KVhvIpR5fl515rf5 tS17FzM2pZXLVZyA09sufbDUY4wclH4bjHZRuwl7M3VBN4L16uXmkgFk2P3alw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyQ0YREDYlex7BEv/6sdQvIDpGqojsSUiFDszv4r9vI=; b=Ub34qvNemPbbuCvURLUBpAXN/DBfbjjCzCKJHdMc0XRF+DDdVLvyien+9bel1JXvtdW8fY gFQTz1iXtc6n1UJbykOUzMAEWWg0YeSEOolKUxlFH+iU4D3GTZezSccfxpLEcC4CB3YfSE mXMQ75BFlZGwGspVMlmuRtwz6mrVW+89F12HSOun0MdBzG92CDpg44zqzXFrZZrGRT0tSy 7lI8NCIkQQzU9YnEMNTA7qYgkUr7kfjYpm2EnaJFLJkNev7XT1nXWxghZ04ndUFM8wXRyc Z42vkhGoq63XyBMNLiYEmKgPnAoWPzwtu5kXV2V/lRVo16AK6gzwy23msU3Dpg== 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 4WzZnk0vkjzgNX; Wed, 4 Sep 2024 21:07: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 484L7cOb053567; Wed, 4 Sep 2024 21:07:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7cPg053564; Wed, 4 Sep 2024 21:07:38 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:38 GMT Message-Id: <202409042107.484L7cPg053564@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: 094bd6281f72 - releng/14.1 - umtx: shm: Fix use-after-free due to multiple drops of the registry reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 094bd6281f729e51c009586136634fafa501a398 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=094bd6281f729e51c009586136634fafa501a398 commit 094bd6281f729e51c009586136634fafa501a398 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:54 +0000 umtx: shm: Fix use-after-free due to multiple drops of the registry reference umtx_shm_unref_reg_locked() would unconditionally drop the "registry" reference, tied to USHMF_LINKED. This is not a problem for caller umtx_shm_object_terminated(), which operates under the 'umtx_shm_lock' lock end-to-end, but it is for indirect caller umtx_shm(), which drops the lock between umtx_shm_find_reg() and the call to umtx_shm_unref_reg(true) that deregisters the umtx shared region (from 'umtx_shm_registry'; umtx_shm_find_reg() only finds registered shared mutexes). Thus, two concurrent user-space callers of _umtx_op() with UMTX_OP_SHM and flags UMTX_SHM_DESTROY, both progressing past umtx_shm_find_reg() but before umtx_shm_unref_reg(true), would then decrease twice the reference count for the single reference standing for the shared mutex's registration. Reported by: Synacktiv Reviewed by: kib Approved by: emaste (mentor) Security: FreeBSD-SA-24:14.umtx Security: CVE-2024-43102 Security: CAP-01 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit 62f40433ab47ad4a9694a22a0313d57661502ca1) (cherry picked from commit be7dc4613909e528e8b4ea8aaa3ae3aa62bec1ed) Approved by: so --- sys/kern/kern_umtx.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index cecb4a021cfb..35fc87994c80 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4383,39 +4383,49 @@ umtx_shm_free_reg(struct umtx_shm_reg *reg) } static bool -umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { - bool res; - mtx_assert(&umtx_shm_lock, MA_OWNED); KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); - reg->ushm_refcnt--; - res = reg->ushm_refcnt == 0; - if (res || force) { - if ((reg->ushm_flags & USHMF_LINKED) != 0) { - TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], - reg, ushm_reg_link); - LIST_REMOVE(reg, ushm_obj_link); - reg->ushm_flags &= ~USHMF_LINKED; - } + + if (linked_ref) { + if ((reg->ushm_flags & USHMF_LINKED) == 0) + /* + * The reference tied to USHMF_LINKED has already been + * released concurrently. + */ + return (false); + + TAILQ_REMOVE(&umtx_shm_registry[reg->ushm_key.hash], reg, + ushm_reg_link); + LIST_REMOVE(reg, ushm_obj_link); + reg->ushm_flags &= ~USHMF_LINKED; } - return (res); + + reg->ushm_refcnt--; + return (reg->ushm_refcnt == 0); } static void -umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool force) +umtx_shm_unref_reg(struct umtx_shm_reg *reg, bool linked_ref) { vm_object_t object; bool dofree; - if (force) { + if (linked_ref) { + /* + * Note: This may be executed multiple times on the same + * shared-memory VM object in presence of concurrent callers + * because 'umtx_shm_lock' is not held all along in umtx_shm() + * and here. + */ object = reg->ushm_obj->shm_object; VM_OBJECT_WLOCK(object); vm_object_set_flag(object, OBJ_UMTXDEAD); VM_OBJECT_WUNLOCK(object); } mtx_lock(&umtx_shm_lock); - dofree = umtx_shm_unref_reg_locked(reg, force); + dofree = umtx_shm_unref_reg_locked(reg, linked_ref); mtx_unlock(&umtx_shm_lock); if (dofree) umtx_shm_free_reg(reg); @@ -4468,7 +4478,6 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); - reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); @@ -4485,11 +4494,17 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, *res = reg1; return (0); } - reg->ushm_refcnt++; TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, ushm_obj_link); reg->ushm_flags = USHMF_LINKED; + /* + * This is one reference for the registry and the list of shared + * mutexes referenced by the VM object containing the lock pointer, and + * another for the caller, which it will free after use. So, one of + * these is tied to the presence of USHMF_LINKED. + */ + reg->ushm_refcnt = 2; mtx_unlock(&umtx_shm_lock); *res = reg; return (0); From nobody Wed Sep 4 21:07:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnl5H1bz5VNmZ; Wed, 04 Sep 2024 21:07: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 4WzZnl2ZTHz4Vmj; Wed, 4 Sep 2024 21:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G3GYeRoximt+45mZqHSe53o9E8uNCetwfRMcYpVW0hw=; b=domQVAiKftPGlYF911q1GsTcnbwwGPs/EsZeodGJDB4EMUH3GsczcpKR7+NMjTBMWjeSYJ xYi1Ih70LTDg6XSLcffop2WuQetDYZyZRIe34vphzfoam90Tiv+wieN6MmDkupNIoONVOv ncapeFGnv5TLbCFMUXuT+oR5bRKCF58ExL1/ZpZC2SUPvNYRMS01sQWT0Sz0VSA/mfUB76 7bo5CLZUg8rEOljy1vrbtqfkkPmXrF+Wfr59SBAHtecpOjqmWXXp4qnIBfxAL/40l9wXO9 JQOGFd2tJ/b1SoPMmBP5XJsROWPuz5BQf52TJgdPZrW27TQ7PZeo+45tOOhdZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484059; a=rsa-sha256; cv=none; b=dfBQkRKU1SSuHUwvnAJysdsQOnjWZO0cFa9JWr0kiFSbzYyzfegIkH3Y3m+U8DpryOAvop s8lm3sb/KNOuJq5q/VDYyB2T4iKSQ1A+MZ3ExV/dejtm2R8p7q9yPMio1ANSEZbYw2XCpH 8cjVjPr6GZOsX2clFOMJOTb+36vzu9Vzg6hdVqb5QeMVL4Y7Epk6iOA5OCY06oIrv9FxD0 lbPDd6y7zcD9xfpHQyqOPa9nCy0HR7LWOhp/kngpuWcug5RSBRZZ59o+8+shxTWyokAGzJ iFbxmjd3fPSmk5clYDpm4VR2SeJojEZH40MWJczCxgph2aqUjSRwI3PcGT+tnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G3GYeRoximt+45mZqHSe53o9E8uNCetwfRMcYpVW0hw=; b=to9poBY+y5yW+yl1nfKfISxw4iO0CAlQuEZs/S+QGizDsBl+lzB1D998k61HOE+uK5oJTK hZV3lnn3xVo+oZ7VX9W3tYshfz2kXXt/I9Tbj4CxqPirtd9i7X/pt8CXNz8iyOVEiAiTfp v99KzuysnZApeMomQ18qSdYKCNa3z8EPm8YMWajRWjDAzgchrqW3nw+wJM6qcWG0vhSanq ERxUxM1AqP7EZo2qocOeNgMcAx5LdZnADvnY48N/MbOkcV0XwkEeAoBkX9H0lYrVK3YzdU F9mN8Vmts4rB2dxC1I8E1Ww6zswbsrFbSHsfJB+G4SavSzVkaeaz2nulUtbVIQ== 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 4WzZnl1w7Tzgg5; Wed, 4 Sep 2024 21:07: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 484L7dZH053621; Wed, 4 Sep 2024 21:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7drB053618; Wed, 4 Sep 2024 21:07:39 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:39 GMT Message-Id: <202409042107.484L7drB053618@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: a89b6e8cc7da - releng/14.1 - umtx: shm: Prevent reference counting overflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: a89b6e8cc7daba9e0cbbc3d85682644cd3fea6d5 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a89b6e8cc7daba9e0cbbc3d85682644cd3fea6d5 commit a89b6e8cc7daba9e0cbbc3d85682644cd3fea6d5 Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:55 +0000 umtx: shm: Prevent reference counting overflow This hardens against provoked use-after-free occurences should there be reference counting leaks in the future (which is currently not the case). At the deepest level, umtx_shm_find_reg_unlocked() now returns EOVERFLOW when it cannot grant an additional reference to the registry object, and so will umtx_shm_find_reg(). umtx_shm_create_reg() will fail if calling umtx_shm_find_reg() returns EOVERFLOW (meaning a SHM object for the passed key already exists, but we can't acquire another reference on it), avoiding the creation of a duplicate registry entry for a given key (this wouldn't pose problem for the rest of the code in its current form, but is expressly avoided for intelligibility and hardening purposes). Since umtx_shm_find_reg*(), and consequently the whole _umtx_op() system call, can only return EOVERFLOW on such a bug manifesting, we don't document that return value. Reviewed by: kib, emaste Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c3e6dfe55c0e81d0717b0458bc95128384c3ebe8) (cherry picked from commit b20ae160872071fc20e5dde27051792177057fa5) Approved by: so --- sys/kern/kern_umtx.c | 76 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 35fc87994c80..9a6df7ae20ff 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4333,8 +4333,17 @@ umtx_shm_reg_delfree_tq(void *context __unused, int pending __unused) static struct task umtx_shm_reg_delfree_task = TASK_INITIALIZER(0, umtx_shm_reg_delfree_tq, NULL); -static struct umtx_shm_reg * -umtx_shm_find_reg_locked(const struct umtx_key *key) +/* + * Returns 0 if a SHM with the passed key is found in the registry, in which + * case it is returned through 'oreg'. Otherwise, returns an error among ESRCH + * (no corresponding SHM; ESRCH was chosen for compatibility, ENOENT would have + * been preferable) or EOVERFLOW (there is a corresponding SHM, but reference + * count would overflow, so can't return it), in which case '*oreg' is left + * unchanged. + */ +static int +umtx_shm_find_reg_locked(const struct umtx_key *key, + struct umtx_shm_reg **const oreg) { struct umtx_shm_reg *reg; struct umtx_shm_reg_head *reg_head; @@ -4354,22 +4363,34 @@ umtx_shm_find_reg_locked(const struct umtx_key *key) ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); + /* + * Don't let overflow happen, just deny a new reference + * (this is additional protection against some reference + * count leak, which is known not to be the case at the + * time of this writing). + */ + if (__predict_false(reg->ushm_refcnt == UINT_MAX)) + return (EOVERFLOW); reg->ushm_refcnt++; - return (reg); + *oreg = reg; + return (0); } } - return (NULL); + return (ESRCH); } -static struct umtx_shm_reg * -umtx_shm_find_reg(const struct umtx_key *key) +/* + * Calls umtx_shm_find_reg_unlocked() under the 'umtx_shm_lock'. + */ +static int +umtx_shm_find_reg(const struct umtx_key *key, struct umtx_shm_reg **const oreg) { - struct umtx_shm_reg *reg; + int error; mtx_lock(&umtx_shm_lock); - reg = umtx_shm_find_reg_locked(key); + error = umtx_shm_find_reg_locked(key, oreg); mtx_unlock(&umtx_shm_lock); - return (reg); + return (error); } static void @@ -4469,11 +4490,18 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct ucred *cred; int error; - reg = umtx_shm_find_reg(key); - if (reg != NULL) { - *res = reg; - return (0); + error = umtx_shm_find_reg(key, res); + if (error != ESRCH) { + /* + * Either no error occured, and '*res' was filled, or EOVERFLOW + * was returned, indicating a reference count limit, and we + * won't create a duplicate registration. In both cases, we are + * done. + */ + return (error); } + /* No entry, we will create one. */ + cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); @@ -4487,12 +4515,20 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, return (error); } mtx_lock(&umtx_shm_lock); - reg1 = umtx_shm_find_reg_locked(key); - if (reg1 != NULL) { + /* Re-lookup as 'umtx_shm_lock' has been temporarily released. */ + error = umtx_shm_find_reg_locked(key, ®1); + switch (error) { + case 0: mtx_unlock(&umtx_shm_lock); umtx_shm_free_reg(reg); *res = reg1; return (0); + case ESRCH: + break; + default: + mtx_unlock(&umtx_shm_lock); + umtx_shm_free_reg(reg); + return (error); } TAILQ_INSERT_TAIL(&umtx_shm_registry[key->hash], reg, ushm_reg_link); LIST_INSERT_HEAD(USHM_OBJ_UMTX(key->info.shared.object), reg, @@ -4563,13 +4599,9 @@ umtx_shm(struct thread *td, void *addr, u_int flags) if (error != 0) return (error); KASSERT(key.shared == 1, ("non-shared key")); - if ((flags & UMTX_SHM_CREAT) != 0) { - error = umtx_shm_create_reg(td, &key, ®); - } else { - reg = umtx_shm_find_reg(&key); - if (reg == NULL) - error = ESRCH; - } + error = (flags & UMTX_SHM_CREAT) != 0 ? + umtx_shm_create_reg(td, &key, ®) : + umtx_shm_find_reg(&key, ®); umtx_key_release(&key); if (error != 0) return (error); From nobody Wed Sep 4 21:07:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnn2Dt1z5VNxG; Wed, 04 Sep 2024 21:07: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 4WzZnm3KgNz4W2p; Wed, 4 Sep 2024 21:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=70tU5WCmHNxDm2qmMlxTIaL+4UgDShmoLMh4BEbpp/o=; b=IoN1mxM/bovH7fdU7rtX+z3js0sNKqAp8YJxaLQ1UiPZCNlRz6qWOTwRaXg6zfdu8VhQLU 2G6pSs9js7TQVc2YlgORHAGbfehfNlrLtN3vzzJeF2iY5ElSiYUftoiSFx1Auno9Ud6P1U S3hU2lEbugdzsjIGQDr3Fh2bSDVBG+FVBSCxIOK+jEY5YbQi6L3nBh+kmZJKTQcUABwN1O qnv5kGpSGkumFsfyOrnPhgwbFDYCXQ2MMVHPz1w3yrh5EH/8IAxZyffZG0C6tAA6e0Ehr2 bAvRV6Wt+MAsiB+MK2uUJmy9H6xAWzgG1CHnz4MaBRtDQBQ1FZnNqiHi1FngGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484060; a=rsa-sha256; cv=none; b=j8HY/k6iYeXgbelA9oyy0X6mKRVAVUvxserqNGnKPipeb3YHpo0MgN/4l3O8haKBqhYD0a Pte+fTdzP9ibIZrShexFh6x4yji358HszadR0d3S3VF03+WOHiyn66aC76DNymMhVkWiSC bNWS9tXB9DhmmZ0k5RpVOJnNU2LWUrTFOz4PW+0iXam7P7CNv7lWygZUTrGTxyEW4VEgw5 0+sdWFoT8WQf+7+tkbBA1Ex9il24GeyictJBcqVbWyopVNp2C3scR7T8+s3M7bJSBJsJaO mlYErfyn2+hIdmNFsc/oR8QvKmnE1sv2mv6xt3cbJ2514/bhWW5fQ+YpqUwMRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=70tU5WCmHNxDm2qmMlxTIaL+4UgDShmoLMh4BEbpp/o=; b=PnS2C6p362YSEw3uIs0qWnFVDZDxaP97e/gCgqHHKBPO82e1JwEqTKy9gwx0OIuKG6yYnu tFC/nkegxh+qUUIJtvWIoaqkj0JwNwUeIBfoEqqyjEtrufxTX+rn4Y1oi1iE4z7EivBXyu T7QdWNFwWYEjXK/M4u1z2YM/5BsioFTTAC2On5bi6vICMNvTeIKAqBtSWcWcqmRurkZmI2 xeuOh7UN1j0aC8OA47MWLNJLDftDO/1OYQ3FBzAhArTO5EbeF8YLA+1AXK/feE338zTxBi A3S/qDqYXTMX6P0xWTWjm9TWuRpXKynZaABA9BwAgUISm1lpASy9P/3Cq4G1Eg== 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 4WzZnm2yBczgHy; Wed, 4 Sep 2024 21:07: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 484L7e2u053675; Wed, 4 Sep 2024 21:07:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7eXe053672; Wed, 4 Sep 2024 21:07:40 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:40 GMT Message-Id: <202409042107.484L7eXe053672@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: f4a2dbb81603 - releng/14.1 - umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: f4a2dbb8160346509ed96f6d79eb042d4e1ad1cd Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f4a2dbb8160346509ed96f6d79eb042d4e1ad1cd commit f4a2dbb8160346509ed96f6d79eb042d4e1ad1cd Author: Olivier Certner AuthorDate: 2024-09-04 14:38:12 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:55 +0000 umtx: shm: 'ushm_refcnt > 0' => 'ushm_refcnt != 0' 'ushm_refcnt' is unsigned. Don't leave the impression it isn't. No functional change (intended). Reviewed by: kib Approved by: emaste (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46126 (cherry picked from commit c75a18905e308f69b01f19c3d7d613883a008e79) (cherry picked from commit 4938f554469bc81783998143968ec3eba2a43def) Approved by: so --- sys/kern/kern_umtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 9a6df7ae20ff..2d54850da9c3 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4359,7 +4359,7 @@ umtx_shm_find_reg_locked(const struct umtx_key *key, reg->ushm_key.info.shared.offset == key->info.shared.offset) { KASSERT(reg->ushm_key.type == TYPE_SHM, ("TYPE_USHM")); - KASSERT(reg->ushm_refcnt > 0, + KASSERT(reg->ushm_refcnt != 0, ("reg %p refcnt 0 onlist", reg)); KASSERT((reg->ushm_flags & USHMF_LINKED) != 0, ("reg %p not linked", reg)); @@ -4407,7 +4407,7 @@ static bool umtx_shm_unref_reg_locked(struct umtx_shm_reg *reg, bool linked_ref) { mtx_assert(&umtx_shm_lock, MA_OWNED); - KASSERT(reg->ushm_refcnt > 0, ("ushm_reg %p refcnt 0", reg)); + KASSERT(reg->ushm_refcnt != 0, ("ushm_reg %p refcnt 0", reg)); if (linked_ref) { if ((reg->ushm_flags & USHMF_LINKED) == 0) From nobody Wed Sep 4 21:07:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZnn6Y0Qz5VNjR; Wed, 04 Sep 2024 21:07: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 4WzZnn4fJfz4VsN; Wed, 4 Sep 2024 21:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wn1Nhib7PdAt2jwA6vbkMLucnrcnbBTSYFIv1VYAkDE=; b=AJFtYiLtypt+DiwMoEMEFWfnSmayAGphJH9O5Ru4GRIRwW6KbsxHm7+hTlHWgRdagdkGB6 ryfKUWz+PiBB+KU4xvVxu7YJIN1o65ytqtCrCllkwpU9SmaWJORvp6FL3RsidkQ2iBRXzp QRgIcwk9K+qLZFx0/ZN75JYtaTQ5sN1+2j1W4cNIvjka9VtKN6Jr8TEmJkEJHCsBrP3K2Z Hg0O+sF+TnmiWVW1X4aZgq+lqykmzKEpackGC+T2Lff4SnD+abr/EX/78HMvyB1wtveNoE bu13kdmdg6VulCd4W3NecDQKSIJ1dzT43A0Nw+M1ySdbzINs7/XttAikesYQOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484061; a=rsa-sha256; cv=none; b=JXozAY/8JPprxvz3UmWksK7G7IcSXNxL65moWXS2cFeCVhlzMRKNKGlkf1r1xNXWfreuRF 9ySSODBxqXYJnrDVeX4XdFKoOXIclOUKk8L49nhUjTALaq8NidYm6SvJVCniqiB5XhksKn ShrnskUhghvLOPBX/EhXUfkCya4e5rWSRSd7/iyWnybmnFWrQJbLtcVPCwhLk5LaEpJvQM GKeXfTesIb1DZNA9RdLExFhRYMDWdkfeKS+atY9q1LZXCkZRhEZoK6z/qYwq3kbakRYr6U 4pTVTMiqoXXvM++qgIJ46h3uw00tOw0vBm+MYF4r94holhLmQpp/H9K9NWlAhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wn1Nhib7PdAt2jwA6vbkMLucnrcnbBTSYFIv1VYAkDE=; b=KSXffGflQVA00EJ1Mug8AFnxMEYosO2U5y0eea1FmKMYOCcjvzLj2JC+U870tgB1cgagSz Ew6SGfm2dt6D5ma+gqCDYY53OTxQ3In4n2ioRwbzo91cJo4H/+14xaHanDC0kkXuvZDd+l pymWJGFQAjExJFfk1Tv71H8xvcsE2KMGX4uKHxgemoAUU8H6N4qzfk11uXeywRcWTizdcX CJ6l2uwgpxufIvbhIC74L1dE7gCYYuNNZ1YI35G6GhOU2dXvwT1vROkLesXiQzco3shJt6 qhWWPjvPdaf3NWZPsiM0caTRvH3EjsAJo1kriuPnHyjuYbRiGGDxy/jEtQFuBg== 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 4WzZnn3yfvzgDt; Wed, 4 Sep 2024 21:07: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 484L7f4F053721; Wed, 4 Sep 2024 21:07:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484L7fn6053718; Wed, 4 Sep 2024 21:07:41 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:07:41 GMT Message-Id: <202409042107.484L7fn6053718@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: 57d27c4dc3fe - releng/14.1 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 57d27c4dc3fe4cb2b5762995a22ae72f980a5b62 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=57d27c4dc3fe4cb2b5762995a22ae72f980a5b62 commit 57d27c4dc3fe4cb2b5762995a22ae72f980a5b62 Author: Ed Maste AuthorDate: 2024-09-04 20:08:59 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:46:55 +0000 Add UPDATING entries and bump revision EN-24:15.calendar SA-24:09.libnv SA-24:10.bhyve SA-24:11.ctl SA-24:12.bhyve SA-24:13.openssl SA-24:14.umtx Approved by: so --- UPDATING | 22 ++++++++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index abdee5182989..37ff6f2d53e1 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,28 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240904: + 14.1-RELEASE-p4 EN-24:15.calendar + SA-24:09.libnv + SA-24:10.bhyve + SA-24:11.ctl + SA-24:12.bhyve + SA-24:13.openssl + SA-24:14.umtx + + cron(8) / periodic(8) session login [EN-24:15.calendar] + + Multiple vulnerabilities in libnv [SA-24:09.libnv] + + bhyve(8) privileged guest escape via TPM device passthrough [SA-24:10.bhyve] + Multiple issues in ctl(4) CAM Target Layer [SA-24:11.ctl] + + bhyve(8) privileged guest escape via USB controller [SA-24:12.bhyve] + + Possible DoS in X.509 name checks in OpenSSL [SA-24:13.openssl] + + umtx Kernel panic or Use-After-Free [SA-24:14.umtx] + 20240807: 14.1-RELEASE-p3 EN-24:14.ifconfig SA-24:05.pf diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index ce03fb4fb9fa..fec4520f5fb7 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Sep 4 21:34:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzbNb4Z3fz5VQxd; Wed, 04 Sep 2024 21:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzbNb43gNz4dWv; Wed, 4 Sep 2024 21:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725485663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LxKT3txxE8c2oinjX9cQu+9QEqd6cwaXUhryMjhIwd8=; b=vzSWibPAcrWCdmevwOrR/a1fCiorCZXZwdc3LcRGYE6wDSqnF7sM92gwF6y6nra6ob+lVK kfhBwUzWEeKq3k0jad/Y8c7If5aT1TLM7b+wYsUSK1Q8j7q+BA1zMBc/bEAJblNYYPKKrC DWlp7aaNnzbKe2eg8M3g8wHMbcqFS9laxGs3U3TNOF2WV6PYL6aPHDcui/6DVJ82gmBlX2 hvrG52Fikxza951YW6BBplJ2GRkmOptHuhlZGaIXKIv19NMowJ8VgVPGWUYvs/fsJTOLu3 BPHncA9/QawRyZYt0kKqIK62onhr61QrVSOf6eEQ20o/OR5WJvtEByzlDSa82g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725485663; a=rsa-sha256; cv=none; b=hG5TwvblidwrhI+THuw94NsDxx9UBR97favqn1dl48fqSdQ6mQyAQx+wYVR8F+mrTprnzR m7G6husB2yKhPA8vVodLZ5MhxJg33jpDz8fmVUsZGTHCEJRPIPDs+c6i7y6lBYdaSooyKU THVm6JpSssjujZ7Jbzz0+dne601SKtY5b8Aa1Yi0CMrMNV0ZsO0uw5stvHMO50bwD65WdI R3hZUqUl8uHlXrgA1RclCMIwjvG6BgDV6H4fX4yxwSSbASRh0u1x16BYeDmS63Jaiek8H+ dUJiwuK1j1SZu3R5hJqc7uTja2g8NO33/KTIS90pT/3Rm4GBcXhOj+CChLxF3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725485663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LxKT3txxE8c2oinjX9cQu+9QEqd6cwaXUhryMjhIwd8=; b=Or0CdZeycFBaN2B44F8ysuht3hLvmzzPbrDN3JqhnPoM7AboSbJ2yYLfn2dZfH8Ik9dLpH fXH6Yr4wLZ/Vf4ImVc5+6INxmJ8y/2y5rRFvJI6U6LLp0iO77hO/BKaF3H1/jEwXMGVEfA syyU56C9gtSJ5lIpIBEYEQUTaIDvYOQCKhVjLgn+aS7ynwDDFJqbNobSF1VV+hZb6UdxkU 8f5t3gLGqhQXEU0IiXcg9vVnUlxm+b6pxE5Wwwad3aOx5dX0HwEtcfe2mgg6LCUdzc1BJ7 KM6PiqdBkFTdTBad9pfiQ/G/jHdiO/ferGOoNnfs2SUwX5XFuwU3MYc6QCjQcw== 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 4WzbNb3fdyzh4p; Wed, 4 Sep 2024 21:34: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 484LYNKs003680; Wed, 4 Sep 2024 21:34:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LYNrq003677; Wed, 4 Sep 2024 21:34:23 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:34:23 GMT Message-Id: <202409042134.484LYNrq003677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 86d01789bf41 - releng/14.1 - calendar: don't setlogin(2) in the -a user handlers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 86d01789bf412b216b11021c44b60f93f6af8955 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=86d01789bf412b216b11021c44b60f93f6af8955 commit 86d01789bf412b216b11021c44b60f93f6af8955 Author: Kyle Evans AuthorDate: 2024-08-05 18:43:56 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-04 21:31:57 +0000 calendar: don't setlogin(2) in the -a user handlers As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a` will now fork off a new process for each user and do all of its own processing in the user's own context. As a side-effect, calendar(1) started calling setlogin(2) in each of the forked processes and inadvertently hijacked the login name for the session it was running under, which was typically not a fresh session but rather that of whatever cron/periodic run spawned it. Thus, daily and security e-mails started coming from completely arbitrary user. We could create a new session, but it appears that nothing calendar(1) does really needs the login name to be clobbered; opt to just avoid the setlogin(2) call entirely rather than incur the overhead of a new session for each process. PR: 280418 Reviewed by: des, olce Fixes: e67975d331 ("Fix 'calendar -a' in several ways.") (cherry picked from commit 6cb8b61efe8899ee9194563108d0ae90c1eb89e3) (cherry picked from commit 33708452aaabca205d81eceb83e0813e5882815c) Approved by: so --- usr.bin/calendar/calendar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index 476c0495d218..2e3baee7d57f 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -224,7 +224,7 @@ main(int argc, char *argv[]) lc = login_getpwclass(pw); if (setusercontext(lc, pw, pw->pw_uid, - LOGIN_SETALL) != 0) + LOGIN_SETALL & ~LOGIN_SETLOGIN) != 0) errx(1, "setusercontext"); setenv("HOME", pw->pw_dir, 1); cal(); From nobody Wed Sep 4 21:50:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblL0z9sz5VRyv; Wed, 04 Sep 2024 21:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzblL0Qbpz4gs1; Wed, 4 Sep 2024 21:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t0Nj/MP5tohjVt3tT3AhCk71rud/RrHsEQX09n7dvmg=; b=eyg1BznvBeJjNprhaQo0Ou7ea4CfRsDTlgAkFzV2r7E1eQiFO88VJaB+LTzkNfU0ad98Wg UWRi4OobkSGHekVFlci7ojUmpY7AKz7SNzSYHnEt3IMDvEUBWYbU+Rz6fnLyjNFKd53FVb Z+W485MOaoMsCN1IAcygR6rhaAepnFFuhO10J17I2dSGlmB+EGNMH8bB72nA1YMVZ62ddk gb6K1oL0/6/FRAwwWcd/MNK/sYThYEayoVrQu2Z1MXGanBaeOhPR5RRyP42sKsElgtBjeb uITaOK3RlHizeUc5N5FO1SVAP+GR3sul+WceXqzMj3L0MC37GcMVtUUgHY6f/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486638; a=rsa-sha256; cv=none; b=UVC25F9SJE060mZtMvnZvVMCHejhzDDO8bh8VATcWPevq9cAZvExv0UM0hc2Gno+f4Myf4 e80WkpI1vKtMCP3JtQe4+taESoL4RANCT6IpRDF9JmundiHvO/LVhWqlr6oG6KpVArheGP lLFfhIBikDCuCbuf2/uAI33KLO4C1SsgbRbYn9RDXZv7Stycmm+3jOs+7uA5H172JDH95y czj3jv3AAYUQbNi/k1shqGsKOK3xOCL+EdLZgm6+YEnCjfUWili0110R0OdHxlqLaUedWs /t/yqJu8y2DdSs8mPFOU9vWpIRs2okwc2MDtWxfC1Z3canduHqzI0lKNhTDEMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t0Nj/MP5tohjVt3tT3AhCk71rud/RrHsEQX09n7dvmg=; b=ugnFj4dNcMW7ZJwar7xSpmx7rL3K8Eq0hpk0EMoHT5UfxTr1GK0mwUlmdNUCtiU61Uno5I 5KFDIif+g2AdGF9vHAWDOUYoWYgvOTiU2iUJDv/reHYhP951JDTTH5a4nYiUeSgJBB3/f/ 5vKxJdyLFoVAKw4HHo57cNgAuB6tApAOadAQRGnE3BCloRvw06I2Wq50reppatPsW5c5Hd E8nU0M1H2KyGudWVq3TyjhR4WU+OIh8aP8fo59Ne5mPGAz4VMuA71v9ebLad8ZPaynlRuo NE2aGeAb7gJYkzh1r7Z4riqgcPcCeQZTBmkyqfQb5ImEukB9uuD/UZLNg7uGfg== 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 4WzblL01zPzhN7; Wed, 4 Sep 2024 21:50: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 484LobPr031387; Wed, 4 Sep 2024 21:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LobGE031384; Wed, 4 Sep 2024 21:50:37 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:37 GMT Message-Id: <202409042150.484LobGE031384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c47229ae6676 - main - Intel DMAR: improve X2X macros to fix failures in certain syntax contexts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c47229ae66764fec85477e89d4f3861ac29abf48 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c47229ae66764fec85477e89d4f3861ac29abf48 commit c47229ae66764fec85477e89d4f3861ac29abf48 Author: Konstantin Belousov AuthorDate: 2024-06-06 00:52:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 Intel DMAR: improve X2X macros to fix failures in certain syntax contexts Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_dmar.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index b7f0300e16f0..9eb87bcfdc35 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -87,15 +87,15 @@ struct dmar_ctx { #define DMAR_DOMAIN_UNLOCK(dom) mtx_unlock(&(dom)->iodom.lock) #define DMAR_DOMAIN_ASSERT_LOCKED(dom) mtx_assert(&(dom)->iodom.lock, MA_OWNED) -#define DMAR2IOMMU(dmar) &((dmar)->iommu) +#define DMAR2IOMMU(dmar) (&((dmar)->iommu)) #define IOMMU2DMAR(dmar) \ __containerof((dmar), struct dmar_unit, iommu) -#define DOM2IODOM(domain) &((domain)->iodom) +#define DOM2IODOM(domain) (&((domain)->iodom)) #define IODOM2DOM(domain) \ __containerof((domain), struct dmar_domain, iodom) -#define CTX2IOCTX(ctx) &((ctx)->context) +#define CTX2IOCTX(ctx) (&((ctx)->context)) #define IOCTX2CTX(ctx) \ __containerof((ctx), struct dmar_ctx, context) From nobody Wed Sep 4 21:50:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblM2ZqNz5VRmG; Wed, 04 Sep 2024 21:50: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 4WzblM1Ngzz4gts; Wed, 4 Sep 2024 21:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Vpfvu93QbeNVrzQepgLS6K2rwgAfDZ+qfIHwAg1w9c=; b=BJnDHsfnw0ZjaZFtN+LIaLb2IfUQAlDDMUDxv3rcejKY9z+Ii8gZfx9BUHaIBaVg8FJfRE TnoQgnsThP7yU9D5hipF9P0ag+Pk0qnBVz1Hzv6Q6KwHihM1jNUpJXVpTJZFSVU1Pk3Usu NKE9rTFSiHrESUvmpVUZP6zyQHRZ/IsHXx/keNG7KCBdowITPTKLzpofdZJrEJAZjFPz8Y oAKPsz6f6RrNMyBj8ytj7JLGmoVYGkTPl5NA2Yea1H0MpIMwslNRXvIEEAoc+SpEesiIKG 2gpXnyJKvMBC3F6EJsu97WUpBlSK9Oenf2Uiu2e/aK1HYkaz6GnRV8eg0Qxkdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486639; a=rsa-sha256; cv=none; b=OrgHHVGAHDsm7yiXMIOhhMckWjWsV2FsQPzg9SBhSMUovnzwZEHryVTrq9iaBJuqkmikUX Hvc6QAsCBOXKRql+MW9nEb7mzih4SW+sF70fEGMj0ImwgV6TeyC1jVzJh008j8zk/VqHvA IcQiB3AYyEfuiXVQp7BT+CoPBOn4zzZcXxgC+A2FK0Y9dy+rxz3ZRC20mEh91nb1cSKFW4 Ih9H1IPk43OnF9HXV04EfrnIU99p3ayWxbG2giXkzDTIFLdTEvSYQzCVVs/1DcjBnQ/AtO GtPHtICfwB60Gx0ULtH945RxPu3VCdJ1GvuJGXb9p+tA8RmnSo/oDu5dj6u/6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Vpfvu93QbeNVrzQepgLS6K2rwgAfDZ+qfIHwAg1w9c=; b=mkLrJTMTFMczcrw32lrkmRGM/fRtFCgVDBemon5PywEMJLNs1jQmrd5IriGh7riKV1ueYz zOVWe8OYrZC/IDE2TCcxcMzfHduiwUkmm4YtpRzaSwaQ11VGXiphJyApnHU+T5xMil6Zh7 nTuStk01H1+W4uUxwFFFNw25w3PgznMbVrjz2bUeZKblcrzPgrqum+tJMY0epEaJGsK/C8 3M9sg/t1ryow+GD3/E8ywsVrb811w0t3VDsNppOLrwPJPfDj8cwCGJkXuQ683vhUk3ezTw bGVaZEqy/1v64rC/MM/c2Ew4fbGVpBY7IZVXmOzzDReSo/cwqzaRuQj6YAhXxQ== 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 4WzblM1182zhN8; Wed, 4 Sep 2024 21:50: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 484LodEg031438; Wed, 4 Sep 2024 21:50:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LodTe031435; Wed, 4 Sep 2024 21:50:39 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:39 GMT Message-Id: <202409042150.484LodTe031435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0fcbf4944cb9 - main - DMAR: use DMAR2IOMMU() for DMAR_LOCK() and related macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0fcbf4944cb9865c6db0154c2f479fdd05b115c1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0fcbf4944cb9865c6db0154c2f479fdd05b115c1 commit 0fcbf4944cb9865c6db0154c2f479fdd05b115c1 Author: Konstantin Belousov AuthorDate: 2024-06-06 00:39:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 DMAR: use DMAR2IOMMU() for DMAR_LOCK() and related macros Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_dmar.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 9eb87bcfdc35..4ae005238074 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -205,9 +205,9 @@ struct dmar_unit { struct taskqueue *qi_taskqueue; }; -#define DMAR_LOCK(dmar) mtx_lock(&(dmar)->iommu.lock) -#define DMAR_UNLOCK(dmar) mtx_unlock(&(dmar)->iommu.lock) -#define DMAR_ASSERT_LOCKED(dmar) mtx_assert(&(dmar)->iommu.lock, MA_OWNED) +#define DMAR_LOCK(dmar) mtx_lock(&DMAR2IOMMU(dmar)->lock) +#define DMAR_UNLOCK(dmar) mtx_unlock(&DMAR2IOMMU(dmar)->lock) +#define DMAR_ASSERT_LOCKED(dmar) mtx_assert(&DMAR2IOMMU(dmar)->lock, MA_OWNED) #define DMAR_FAULT_LOCK(dmar) mtx_lock_spin(&(dmar)->fault_lock) #define DMAR_FAULT_UNLOCK(dmar) mtx_unlock_spin(&(dmar)->fault_lock) From nobody Wed Sep 4 21:50:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblN5Bqxz5VRrX; Wed, 04 Sep 2024 21:50: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 4WzblN2Zvtz4gkB; Wed, 4 Sep 2024 21:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EtVYRU7tV250Qp//VmJf+P0mkGk02yeQibNlcC9FqY=; b=X4iIG7a5EmVrOLzh1ubZYeicALYKUtFMq9BCQBQDbXCbdxfLKWbo6vJt0xY8NDILJc5hld 1n1/Fy5+RipcqbPGrRXmkbdddYOeoHCeEOq0yh4zuOoRdto7EuiVTpDjuRugC35kkg1CWp CyQROk7yXIlZW55yGksXxmMIJKEpTQrAe4VyL4qDsgsIsoMqrM5xUR7GCvkcHdfXy3jtsw m3kyU2vrC7z3vLqnCEWd/cEdjtfy3ELdoBjXo76/9SNdQi8J6KqI3PbGT61hLgsJC2mpjM KSsZKTnXF1BgXXk2gAjs1SCugyQ7S5zHGCp43H4nHoI9wFtqmT4C2pPQFrN3CQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486640; a=rsa-sha256; cv=none; b=BZL2vkILh05SlVY4daSjHu+JQ5hZUI8ViNcjHtztolHBU0dK861mQdfYFqjCJLud2JyHT0 iYzlzpEKm5BhANxd9hedG6QlmOUBSNBpTIPAglki4IDPbqsQVlmtOwTB3B4DNP+htNDdgC Vo1tajj4TA+yjXcLrbTCubP+fT0GL7SDRDsEYxQhpYvqIUMbSF1qEcM8Tgu+OZKH4ZsXVl VDRdSLHqTKPx2TW0z/ca7kKAMGDZZpuLT/Z2ww5jRE84tBmXXyXpAVjcsWcl0AVLifDItj ao79wQQOKgzKxfJx2VJhSbExaxYjiWTF8ij+ZVxTHgTu/zO06B8c2VQxEDUG6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EtVYRU7tV250Qp//VmJf+P0mkGk02yeQibNlcC9FqY=; b=H9RoTI8+ApuZmKAay1/CGIFlChbkb5hBrpHh417XHbjd2yNtxeCweBKJRDhRMBSi1BWTS1 hoIyoaxg9y4ixsY8qiBQ/gNlKYWPHdl2ZD+cjeCpYQACDRn5f0/2bfBv9AyFnL0KoeKRdB Ioe0YYRoS0LYkDloIes0vaPN96Q5Fj2Uj0zpl73i8kqNX3WP9+5JwSwnXCjLWT3rwLi+lA qACwQyaEprnjVoQ3XQWUYjcbyJm6rh/fCQjAO8lulPWB2OiR1LgRlRVHv0S2XNjsxT303w rmB/r+iIlIHsPeqPYcDzhgEYj/ifO2t26JcbWaNy+2gudgQG93vLIwcuYf9syw== 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 4WzblN24qmzhFQ; Wed, 4 Sep 2024 21:50: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 484Loehl031496; Wed, 4 Sep 2024 21:50:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LoeAq031493; Wed, 4 Sep 2024 21:50:40 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:40 GMT Message-Id: <202409042150.484LoeAq031493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65b133e5d292686fe20f11dd39b53812226a8684 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=65b133e5d292686fe20f11dd39b53812226a8684 commit 65b133e5d292686fe20f11dd39b53812226a8684 Author: Konstantin Belousov AuthorDate: 2024-05-29 14:38:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 x86: allow to have more than one kind of IOMMU Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 22 +++++------ sys/x86/iommu/intel_dmar.h | 18 ++++++++- sys/x86/iommu/intel_drv.c | 30 ++++++++++++-- sys/x86/iommu/intel_intrmap.c | 10 ++--- sys/x86/iommu/iommu_utils.c | 91 ++++++++++++++++++++++++++++++++++++++++++- sys/x86/iommu/x86_iommu.h | 25 +++++++++++- 6 files changed, 173 insertions(+), 23 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index baee0109e5a9..a3ff35dc527e 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -75,6 +75,9 @@ static void dmar_unref_domain_locked(struct dmar_unit *dmar, struct dmar_domain *domain); static void dmar_domain_destroy(struct dmar_domain *domain); +static void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); +static void dmar_free_ctx(struct dmar_ctx *ctx); + static void dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus) { @@ -745,7 +748,7 @@ dmar_unref_domain_locked(struct dmar_unit *dmar, struct dmar_domain *domain) dmar_domain_destroy(domain); } -void +static void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx) { struct sf_buf *sf; @@ -819,7 +822,7 @@ dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx) TD_PINNED_ASSERT; } -void +static void dmar_free_ctx(struct dmar_ctx *ctx) { struct dmar_unit *dmar; @@ -867,7 +870,7 @@ dmar_domain_free_entry(struct iommu_map_entry *entry, bool free) * the entry's dmamap_link field. */ void -iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, +dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, bool cansleep) { struct dmar_domain *domain; @@ -909,7 +912,7 @@ dmar_domain_unload_emit_wait(struct dmar_domain *domain, } void -iommu_domain_unload(struct iommu_domain *iodom, +dmar_domain_unload(struct iommu_domain *iodom, struct iommu_map_entries_tailq *entries, bool cansleep) { struct dmar_domain *domain; @@ -947,37 +950,34 @@ iommu_domain_unload(struct iommu_domain *iodom, } struct iommu_ctx * -iommu_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, +dmar_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init) { struct dmar_unit *dmar; struct dmar_ctx *ret; dmar = IOMMU2DMAR(iommu); - ret = dmar_get_ctx_for_dev(dmar, dev, rid, id_mapped, rmrr_init); - return (CTX2IOCTX(ret)); } void -iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *context) +dmar_free_ctx_locked_method(struct iommu_unit *iommu, + struct iommu_ctx *context) { struct dmar_unit *dmar; struct dmar_ctx *ctx; dmar = IOMMU2DMAR(iommu); ctx = IOCTX2CTX(context); - dmar_free_ctx_locked(dmar, ctx); } void -iommu_free_ctx(struct iommu_ctx *context) +dmar_free_ctx_method(struct iommu_ctx *context) { struct dmar_ctx *ctx; ctx = IOCTX2CTX(context); - dmar_free_ctx(ctx); } diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 4ae005238074..0ede955e12b9 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -293,10 +293,17 @@ struct dmar_ctx *dmar_get_ctx_for_devpath(struct dmar_unit *dmar, uint16_t rid, int dev_domain, int dev_busno, const void *dev_path, int dev_path_len, bool id_mapped, bool rmrr_init); int dmar_move_ctx_to_domain(struct dmar_domain *domain, struct dmar_ctx *ctx); -void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); -void dmar_free_ctx(struct dmar_ctx *ctx); +void dmar_free_ctx_locked_method(struct iommu_unit *dmar, + struct iommu_ctx *ctx); +void dmar_free_ctx_method(struct iommu_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); +struct iommu_ctx *dmar_get_ctx(struct iommu_unit *iommu, device_t dev, + uint16_t rid, bool id_mapped, bool rmrr_init); void dmar_domain_free_entry(struct iommu_map_entry *entry, bool free); +void dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, + bool cansleep); +void dmar_domain_unload(struct iommu_domain *iodom, + struct iommu_map_entries_tailq *entries, bool cansleep); void dmar_dev_parse_rmrr(struct dmar_domain *domain, int dev_domain, int dev_busno, const void *dev_path, int dev_path_len, @@ -308,6 +315,13 @@ void dmar_quirks_pre_use(struct iommu_unit *dmar); int dmar_init_irt(struct dmar_unit *unit); void dmar_fini_irt(struct dmar_unit *unit); +int dmar_alloc_msi_intr(device_t src, u_int *cookies, u_int count); +int dmar_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, + uint64_t *addr, uint32_t *data); +int dmar_unmap_msi_intr(device_t src, u_int cookie); +int dmar_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, + bool activehi, int irq, u_int *cookie, uint32_t *hi, uint32_t *lo); +int dmar_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie); extern int haw; extern int dmar_batch_coalesce; diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 636534173715..79350358cced 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -64,6 +64,8 @@ #include #include #include +#include +#include #include #include #include @@ -1357,12 +1359,34 @@ DB_SHOW_ALL_COMMAND(dmars, db_show_all_dmars) } #endif -struct iommu_unit * -iommu_find(device_t dev, bool verbose) +static struct iommu_unit * +dmar_find_method(device_t dev, bool verbose) { struct dmar_unit *dmar; dmar = dmar_find(dev, verbose); - return (&dmar->iommu); } + +static struct x86_iommu dmar_x86_iommu = { + .domain_unload_entry = dmar_domain_unload_entry, + .domain_unload = dmar_domain_unload, + .get_ctx = dmar_get_ctx, + .free_ctx_locked = dmar_free_ctx_locked_method, + .free_ctx = dmar_free_ctx_method, + .find = dmar_find_method, + .alloc_msi_intr = dmar_alloc_msi_intr, + .map_msi_intr = dmar_map_msi_intr, + .unmap_msi_intr = dmar_unmap_msi_intr, + .map_ioapic_intr = dmar_map_ioapic_intr, + .unmap_ioapic_intr = dmar_unmap_ioapic_intr, +}; + +static void +x86_iommu_set_intel(void *arg __unused) +{ + if (cpu_vendor_id == CPU_VENDOR_INTEL) + set_x86_iommu(&dmar_x86_iommu); +} + +SYSINIT(x86_iommu, SI_SUB_TUNABLES, SI_ORDER_ANY, x86_iommu_set_intel, NULL); diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c index 22fd51bc8be9..a6979a9d2501 100644 --- a/sys/x86/iommu/intel_intrmap.c +++ b/sys/x86/iommu/intel_intrmap.c @@ -65,7 +65,7 @@ static void dmar_ir_program_irte(struct dmar_unit *unit, u_int idx, static int dmar_ir_free_irte(struct dmar_unit *unit, u_int cookie); int -iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) +dmar_alloc_msi_intr(device_t src, u_int *cookies, u_int count) { struct dmar_unit *unit; vmem_addr_t vmem_res; @@ -93,7 +93,7 @@ iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) } int -iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, +dmar_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, uint64_t *addr, uint32_t *data) { struct dmar_unit *unit; @@ -139,7 +139,7 @@ iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, } int -iommu_unmap_msi_intr(device_t src, u_int cookie) +dmar_unmap_msi_intr(device_t src, u_int cookie) { struct dmar_unit *unit; @@ -150,7 +150,7 @@ iommu_unmap_msi_intr(device_t src, u_int cookie) } int -iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, +dmar_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, uint32_t *lo) { struct dmar_unit *unit; @@ -213,7 +213,7 @@ iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, } int -iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) +dmar_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) { struct dmar_unit *unit; u_int idx; diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index ffea1cc1a190..ea2c0358e072 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2013, 2014 The FreeBSD Foundation + * Copyright (c) 2013, 2014, 2024 The FreeBSD Foundation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -50,6 +50,7 @@ #include #include #include +#include vm_page_t iommu_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags) @@ -162,3 +163,91 @@ SYSCTL_NODE(_hw_iommu, OID_AUTO, dmar, CTLFLAG_RD | CTLFLAG_MPSAFE, SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &iommu_tbl_pagecnt, 0, "Count of pages used for DMAR pagetables"); + +static struct x86_iommu *x86_iommu; + +void +set_x86_iommu(struct x86_iommu *x) +{ + MPASS(x86_iommu == NULL); + x86_iommu = x; +} + +struct x86_iommu * +get_x86_iommu(void) +{ + return (x86_iommu); +} + +void +iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, + bool cansleep) +{ + x86_iommu->domain_unload_entry(entry, free, cansleep); +} + +void +iommu_domain_unload(struct iommu_domain *iodom, + struct iommu_map_entries_tailq *entries, bool cansleep) +{ + x86_iommu->domain_unload(iodom, entries, cansleep); +} + +struct iommu_ctx * +iommu_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, + bool id_mapped, bool rmrr_init) +{ + return (x86_iommu->get_ctx(iommu, dev, rid, id_mapped, rmrr_init)); +} + +void +iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *context) +{ + x86_iommu->free_ctx_locked(iommu, context); +} + +void +iommu_free_ctx(struct iommu_ctx *context) +{ + x86_iommu->free_ctx(context); +} + +struct iommu_unit * +iommu_find(device_t dev, bool verbose) +{ + return (x86_iommu->find(dev, verbose)); +} + +int +iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) +{ + return (x86_iommu->alloc_msi_intr(src, cookies, count)); +} + +int +iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, + uint64_t *addr, uint32_t *data) +{ + return (x86_iommu->map_msi_intr(src, cpu, vector, cookie, + addr, data)); +} + +int +iommu_unmap_msi_intr(device_t src, u_int cookie) +{ + return (x86_iommu->unmap_msi_intr(src, cookie)); +} + +int +iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, + bool activehi, int irq, u_int *cookie, uint32_t *hi, uint32_t *lo) +{ + return (x86_iommu->map_ioapic_intr(ioapic_id, cpu, vector, edge, + activehi, irq, cookie, hi, lo)); +} + +int +iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) +{ + return (x86_iommu->unmap_ioapic_intr(ioapic_id, cookie)); +} diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index 3789586f1eaf..8c908964acd0 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2013-2015 The FreeBSD Foundation + * Copyright (c) 2013-2015, 2024 The FreeBSD Foundation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -59,4 +59,27 @@ extern int iommu_tbl_pagecnt; SYSCTL_DECL(_hw_iommu); SYSCTL_DECL(_hw_iommu_dmar); +struct x86_iommu { + void (*domain_unload_entry)(struct iommu_map_entry *entry, bool free, + bool cansleep); + void (*domain_unload)(struct iommu_domain *iodom, + struct iommu_map_entries_tailq *entries, bool cansleep); + struct iommu_ctx *(*get_ctx)(struct iommu_unit *iommu, + device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init); + void (*free_ctx_locked)(struct iommu_unit *iommu, + struct iommu_ctx *context); + void (*free_ctx)(struct iommu_ctx *context); + struct iommu_unit *(*find)(device_t dev, bool verbose); + int (*alloc_msi_intr)(device_t src, u_int *cookies, u_int count); + int (*map_msi_intr)(device_t src, u_int cpu, u_int vector, + u_int cookie, uint64_t *addr, uint32_t *data); + int (*unmap_msi_intr)(device_t src, u_int cookie); + int (*map_ioapic_intr)(u_int ioapic_id, u_int cpu, u_int vector, + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, + uint32_t *lo); + int (*unmap_ioapic_intr)(u_int ioapic_id, u_int *cookie); +}; +void set_x86_iommu(struct x86_iommu *); +struct x86_iommu *get_x86_iommu(void); + #endif From nobody Wed Sep 4 21:50:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblP5lXFz5VRyy; Wed, 04 Sep 2024 21:50: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 4WzblP34gcz4gxP; Wed, 4 Sep 2024 21:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T0BLWscLdWpZB1MG8p1Y8v9u4O7AL0IaDOKBRZ5v2j8=; b=Hh9f/Zo7pA+EPcaeGgM9M12LyurdestDCKNINEZKFxb0KEB3xGmtxYwY+CLbsRrNOnYMKi VYk0vvPPlyIWn45wJW0+Qxii2TjnLvsQv8xN6IWy/kNzTdq2NsyYrtpFVgq7xdYN7yZ6la 0qGiwBSW4OBmmU46sDx7YjfZgjf0acDboU2pokycGk0I87PPvcRnFt3KXaez17chyqiY64 BS+R5VnwlSLwJNjpJWZYo5jHlHjLeAxV8t9+VuAIEEdr91to/4qDq+obUT6RMFuDXdKM66 zfYOGvtF4mV41/50W97IaFJJeVAXhovQ4tVB+HWdVhwaidF5zd5YsHJOGgfpXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486641; a=rsa-sha256; cv=none; b=r4JbZRU3qgnyXS6LVZeNaWXi3P5rhbzy6ThHSyG9bzu9L1q13F9M+ydisdJOdKHIFBOtn2 gI3xHkS5A+VjBmLFc6ZCN6fCEgO+loUYwuimyOwgtVTRZ1DFMeDQgKwv2148DJK+2F5VIj 0MRGD7OhphTLEdPUNd+0nlDYZeCfW2vHJUmpbOZ5ORKkhNAfRs7zfA/dJZjirzdI3hkGSj wYtux+8I4FNdTEV113OnjRsw4Vyi1+Z2f3oUWEbRuoG4V8BIEN0nJzJ+TYz5VfKnf0rDAM yY+s2f3Lnxd4HKZhZKFxJ+sbbQMTAPyl9soUFb8LpkvptFW6xN04GNI1aFleaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T0BLWscLdWpZB1MG8p1Y8v9u4O7AL0IaDOKBRZ5v2j8=; b=exShKROvMl6cbTztxxNGLDooQNki20aFq5XwRP8feE8dqhrsCoxBsoADb3UoC9dL1P1UAO Z5bBnu4CNAVpZUwI2l8yvkW9D1o2pJ746da6mLUGZ/1T75pQDEGryA5pB2Tatnv60PHWwU xzd9PN78i+kH1geVpkwfDxw9HxXs9EDwVUQOgPJ38s3+JxPk4R8/yHMK4M6dhU2v9aKcjR w+qkMHwl2PQnO02mDhe0VrbNXkkItvYvAKEhab21J/kpzQTMHLEFcrLfYaQk5IAuq2Rxcb i3G4vBf1ynfnKi/VOpQitNtmv/dD/5nRyqcdtNYbmkLxMQeKcL+ZbnC9BkqPLg== 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 4WzblP2WpdzhYN; Wed, 4 Sep 2024 21:50: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 484LofhZ031562; Wed, 4 Sep 2024 21:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LofIi031559; Wed, 4 Sep 2024 21:50:41 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:41 GMT Message-Id: <202409042150.484LofIi031559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ad794e6d7d02 - main - x86 iommu: move DMAR-independent parts of the qi code into common List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad794e6d7d02a11b01e721859e096efeb258a4d4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ad794e6d7d02a11b01e721859e096efeb258a4d4 commit ad794e6d7d02a11b01e721859e096efeb258a4d4 Author: Konstantin Belousov AuthorDate: 2024-06-06 01:16:36 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 x86 iommu: move DMAR-independent parts of the qi code into common Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 7 +- sys/x86/iommu/intel_dmar.h | 42 +----- sys/x86/iommu/intel_drv.c | 26 ++-- sys/x86/iommu/intel_qi.c | 330 ++++++++++++-------------------------------- sys/x86/iommu/iommu_utils.c | 234 ++++++++++++++++++++++++++++++- sys/x86/iommu/x86_iommu.h | 72 ++++++++++ 6 files changed, 413 insertions(+), 298 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index a3ff35dc527e..03ef196c4cb0 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -887,10 +887,11 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, if (unit->qi_enabled) { if (free) { DMAR_LOCK(unit); - dmar_qi_invalidate_locked(domain, entry, true); + iommu_qi_invalidate_locked(&domain->iodom, entry, + true); DMAR_UNLOCK(unit); } else { - dmar_qi_invalidate_sync(domain, entry->start, + iommu_qi_invalidate_sync(&domain->iodom, entry->start, entry->end - entry->start, cansleep); dmar_domain_free_entry(entry, false); } @@ -943,7 +944,7 @@ dmar_domain_unload(struct iommu_domain *iodom, DMAR_LOCK(unit); while ((entry = TAILQ_FIRST(entries)) != NULL) { TAILQ_REMOVE(entries, entry, dmamap_link); - dmar_qi_invalidate_locked(domain, entry, + iommu_qi_invalidate_locked(&domain->iodom, entry, dmar_domain_unload_emit_wait(domain, entry)); } DMAR_UNLOCK(unit); diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 0ede955e12b9..8a815d5cfca6 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -123,6 +123,7 @@ struct dmar_msi_data { struct dmar_unit { struct iommu_unit iommu; + struct x86_unit_common x86c; uint16_t segment; uint64_t base; @@ -155,17 +156,6 @@ struct dmar_unit { /* QI */ int qi_enabled; - char *inv_queue; - vm_size_t inv_queue_size; - uint32_t inv_queue_avail; - uint32_t inv_queue_tail; - volatile uint32_t inv_waitd_seq_hw; /* hw writes there on wait - descr completion */ - uint64_t inv_waitd_seq_hw_phys; - uint32_t inv_waitd_seq; /* next sequence number to use for wait descr */ - u_int inv_waitd_gen; /* seq number generation AKA seq overflows */ - u_int inv_seq_waiters; /* count of waiters for seq */ - u_int inv_queue_full; /* informational counter */ /* IR */ int ir_enabled; @@ -173,36 +163,6 @@ struct dmar_unit { dmar_irte_t *irt; u_int irte_cnt; vmem_t *irtids; - - /* - * Delayed freeing of map entries queue processing: - * - * tlb_flush_head and tlb_flush_tail are used to implement a FIFO - * queue that supports concurrent dequeues and enqueues. However, - * there can only be a single dequeuer (accessing tlb_flush_head) and - * a single enqueuer (accessing tlb_flush_tail) at a time. Since the - * unit's qi_task is the only dequeuer, it can access tlb_flush_head - * without any locking. In contrast, there may be multiple enqueuers, - * so the enqueuers acquire the iommu unit lock to serialize their - * accesses to tlb_flush_tail. - * - * In this FIFO queue implementation, the key to enabling concurrent - * dequeues and enqueues is that the dequeuer never needs to access - * tlb_flush_tail and the enqueuer never needs to access - * tlb_flush_head. In particular, tlb_flush_head and tlb_flush_tail - * are never NULL, so neither a dequeuer nor an enqueuer ever needs to - * update both. Instead, tlb_flush_head always points to a "zombie" - * struct, which previously held the last dequeued item. Thus, the - * zombie's next field actually points to the struct holding the first - * item in the queue. When an item is dequeued, the current zombie is - * finally freed, and the struct that held the just dequeued item - * becomes the new zombie. When the queue is empty, tlb_flush_tail - * also points to the zombie. - */ - struct iommu_map_entry *tlb_flush_head; - struct iommu_map_entry *tlb_flush_tail; - struct task qi_task; - struct taskqueue *qi_taskqueue; }; #define DMAR_LOCK(dmar) mtx_lock(&DMAR2IOMMU(dmar)->lock) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 79350358cced..9fa1b3f98dc6 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -1303,19 +1303,19 @@ dmar_print_one(int idx, bool show_domains, bool show_mappings) "size 0x%jx\n" " head 0x%x tail 0x%x avail 0x%x status 0x%x ctrl 0x%x\n" " hw compl 0x%x@%p/phys@%jx next seq 0x%x gen 0x%x\n", - (uintmax_t)unit->inv_queue, + (uintmax_t)unit->x86c.inv_queue, (uintmax_t)dmar_read8(unit, DMAR_IQA_REG), - (uintmax_t)unit->inv_queue_size, + (uintmax_t)unit->x86c.inv_queue_size, dmar_read4(unit, DMAR_IQH_REG), dmar_read4(unit, DMAR_IQT_REG), - unit->inv_queue_avail, + unit->x86c.inv_queue_avail, dmar_read4(unit, DMAR_ICS_REG), dmar_read4(unit, DMAR_IECTL_REG), - unit->inv_waitd_seq_hw, - &unit->inv_waitd_seq_hw, - (uintmax_t)unit->inv_waitd_seq_hw_phys, - unit->inv_waitd_seq, - unit->inv_waitd_gen); + unit->x86c.inv_waitd_seq_hw, + &unit->x86c.inv_waitd_seq_hw, + (uintmax_t)unit->x86c.inv_waitd_seq_hw_phys, + unit->x86c.inv_waitd_seq, + unit->x86c.inv_waitd_gen); } else { db_printf("qi is disabled\n"); } @@ -1368,7 +1368,17 @@ dmar_find_method(device_t dev, bool verbose) return (&dmar->iommu); } +static struct x86_unit_common * +dmar_get_x86_common(struct iommu_unit *unit) +{ + struct dmar_unit *dmar; + + dmar = IOMMU2DMAR(unit); + return (&dmar->x86c); +} + static struct x86_iommu dmar_x86_iommu = { + .get_x86_common = dmar_get_x86_common, .domain_unload_entry = dmar_domain_unload_entry, .domain_unload = dmar_domain_unload, .get_ctx = dmar_get_ctx, diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c index 590cbac9bcbd..a94fbb54e7f7 100644 --- a/sys/x86/iommu/intel_qi.c +++ b/sys/x86/iommu/intel_qi.c @@ -58,17 +58,6 @@ #include #include -static bool -dmar_qi_seq_processed(const struct dmar_unit *unit, - const struct iommu_qi_genseq *pseq) -{ - u_int gen; - - gen = unit->inv_waitd_gen; - return (pseq->gen < gen || - (pseq->gen == gen && pseq->seq <= unit->inv_waitd_seq_hw)); -} - static int dmar_enable_qi(struct dmar_unit *unit) { @@ -96,32 +85,36 @@ dmar_disable_qi(struct dmar_unit *unit) } static void -dmar_qi_advance_tail(struct dmar_unit *unit) +dmar_qi_advance_tail(struct iommu_unit *iommu) { + struct dmar_unit *unit; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); - dmar_write4(unit, DMAR_IQT_REG, unit->inv_queue_tail); + dmar_write4(unit, DMAR_IQT_REG, unit->x86c.inv_queue_tail); } static void -dmar_qi_ensure(struct dmar_unit *unit, int descr_count) +dmar_qi_ensure(struct iommu_unit *iommu, int descr_count) { + struct dmar_unit *unit; uint32_t head; int bytes; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); bytes = descr_count << DMAR_IQ_DESCR_SZ_SHIFT; for (;;) { - if (bytes <= unit->inv_queue_avail) + if (bytes <= unit->x86c.inv_queue_avail) break; /* refill */ head = dmar_read4(unit, DMAR_IQH_REG); head &= DMAR_IQH_MASK; - unit->inv_queue_avail = head - unit->inv_queue_tail - + unit->x86c.inv_queue_avail = head - unit->x86c.inv_queue_tail - DMAR_IQ_DESCR_SZ; - if (head <= unit->inv_queue_tail) - unit->inv_queue_avail += unit->inv_queue_size; - if (bytes <= unit->inv_queue_avail) + if (head <= unit->x86c.inv_queue_tail) + unit->x86c.inv_queue_avail += unit->x86c.inv_queue_size; + if (bytes <= unit->x86c.inv_queue_avail) break; /* @@ -134,11 +127,11 @@ dmar_qi_ensure(struct dmar_unit *unit, int descr_count) * See dmar_qi_invalidate_locked() for a discussion * about data race prevention. */ - dmar_qi_advance_tail(unit); - unit->inv_queue_full++; + dmar_qi_advance_tail(DMAR2IOMMU(unit)); + unit->x86c.inv_queue_full++; cpu_spinwait(); } - unit->inv_queue_avail -= bytes; + unit->x86c.inv_queue_avail -= bytes; } static void @@ -146,162 +139,60 @@ dmar_qi_emit(struct dmar_unit *unit, uint64_t data1, uint64_t data2) { DMAR_ASSERT_LOCKED(unit); - *(volatile uint64_t *)(unit->inv_queue + unit->inv_queue_tail) = data1; - unit->inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; - KASSERT(unit->inv_queue_tail <= unit->inv_queue_size, - ("tail overflow 0x%x 0x%jx", unit->inv_queue_tail, - (uintmax_t)unit->inv_queue_size)); - unit->inv_queue_tail &= unit->inv_queue_size - 1; - *(volatile uint64_t *)(unit->inv_queue + unit->inv_queue_tail) = data2; - unit->inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; - KASSERT(unit->inv_queue_tail <= unit->inv_queue_size, - ("tail overflow 0x%x 0x%jx", unit->inv_queue_tail, - (uintmax_t)unit->inv_queue_size)); - unit->inv_queue_tail &= unit->inv_queue_size - 1; + *(volatile uint64_t *)(unit->x86c.inv_queue + + unit->x86c.inv_queue_tail) = data1; + unit->x86c.inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; + KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, + ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail, + (uintmax_t)unit->x86c.inv_queue_size)); + unit->x86c.inv_queue_tail &= unit->x86c.inv_queue_size - 1; + *(volatile uint64_t *)(unit->x86c.inv_queue + + unit->x86c.inv_queue_tail) = data2; + unit->x86c.inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; + KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, + ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail, + (uintmax_t)unit->x86c.inv_queue_size)); + unit->x86c.inv_queue_tail &= unit->x86c.inv_queue_size - 1; } static void -dmar_qi_emit_wait_descr(struct dmar_unit *unit, uint32_t seq, bool intr, +dmar_qi_emit_wait_descr(struct iommu_unit *iommu, uint32_t seq, bool intr, bool memw, bool fence) { + struct dmar_unit *unit; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); dmar_qi_emit(unit, DMAR_IQ_DESCR_WAIT_ID | (intr ? DMAR_IQ_DESCR_WAIT_IF : 0) | (memw ? DMAR_IQ_DESCR_WAIT_SW : 0) | (fence ? DMAR_IQ_DESCR_WAIT_FN : 0) | (memw ? DMAR_IQ_DESCR_WAIT_SD(seq) : 0), - memw ? unit->inv_waitd_seq_hw_phys : 0); -} - -static void -dmar_qi_emit_wait_seq(struct dmar_unit *unit, struct iommu_qi_genseq *pseq, - bool emit_wait) -{ - struct iommu_qi_genseq gsec; - uint32_t seq; - - KASSERT(pseq != NULL, ("wait descriptor with no place for seq")); - DMAR_ASSERT_LOCKED(unit); - if (unit->inv_waitd_seq == 0xffffffff) { - gsec.gen = unit->inv_waitd_gen; - gsec.seq = unit->inv_waitd_seq; - dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_descr(unit, gsec.seq, false, true, false); - dmar_qi_advance_tail(unit); - while (!dmar_qi_seq_processed(unit, &gsec)) - cpu_spinwait(); - unit->inv_waitd_gen++; - unit->inv_waitd_seq = 1; - } - seq = unit->inv_waitd_seq++; - pseq->gen = unit->inv_waitd_gen; - pseq->seq = seq; - if (emit_wait) { - dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_descr(unit, seq, true, true, false); - } + memw ? unit->x86c.inv_waitd_seq_hw_phys : 0); } -/* - * To avoid missed wakeups, callers must increment the unit's waiters count - * before advancing the tail past the wait descriptor. - */ static void -dmar_qi_wait_for_seq(struct dmar_unit *unit, const struct iommu_qi_genseq *gseq, - bool nowait) -{ - - DMAR_ASSERT_LOCKED(unit); - KASSERT(unit->inv_seq_waiters > 0, ("%s: no waiters", __func__)); - while (!dmar_qi_seq_processed(unit, gseq)) { - if (cold || nowait) { - cpu_spinwait(); - } else { - msleep(&unit->inv_seq_waiters, &unit->iommu.lock, 0, - "dmarse", hz); - } - } - unit->inv_seq_waiters--; -} - -static void -dmar_qi_invalidate_emit(struct dmar_domain *domain, iommu_gaddr_t base, +dmar_qi_invalidate_emit(struct iommu_domain *idomain, iommu_gaddr_t base, iommu_gaddr_t size, struct iommu_qi_genseq *pseq, bool emit_wait) { struct dmar_unit *unit; + struct dmar_domain *domain; iommu_gaddr_t isize; int am; + domain = __containerof(idomain, struct dmar_domain, iodom); unit = domain->dmar; DMAR_ASSERT_LOCKED(unit); for (; size > 0; base += isize, size -= isize) { am = calc_am(unit, base, size, &isize); - dmar_qi_ensure(unit, 1); + dmar_qi_ensure(DMAR2IOMMU(unit), 1); dmar_qi_emit(unit, DMAR_IQ_DESCR_IOTLB_INV | DMAR_IQ_DESCR_IOTLB_PAGE | DMAR_IQ_DESCR_IOTLB_DW | DMAR_IQ_DESCR_IOTLB_DR | DMAR_IQ_DESCR_IOTLB_DID(domain->domain), base | am); } - dmar_qi_emit_wait_seq(unit, pseq, emit_wait); -} - -/* - * The caller must not be using the entry's dmamap_link field. - */ -void -dmar_qi_invalidate_locked(struct dmar_domain *domain, - struct iommu_map_entry *entry, bool emit_wait) -{ - struct dmar_unit *unit; - - unit = domain->dmar; - DMAR_ASSERT_LOCKED(unit); - dmar_qi_invalidate_emit(domain, entry->start, entry->end - - entry->start, &entry->gseq, emit_wait); - - /* - * To avoid a data race in dmar_qi_task(), the entry's gseq must be - * initialized before the entry is added to the TLB flush list, and the - * entry must be added to that list before the tail is advanced. More - * precisely, the tail must not be advanced past the wait descriptor - * that will generate the interrupt that schedules dmar_qi_task() for - * execution before the entry is added to the list. While an earlier - * call to dmar_qi_ensure() might have advanced the tail, it will not - * advance it past the wait descriptor. - * - * See the definition of struct dmar_unit for more information on - * synchronization. - */ - entry->tlb_flush_next = NULL; - atomic_store_rel_ptr((uintptr_t *)&unit->tlb_flush_tail->tlb_flush_next, - (uintptr_t)entry); - unit->tlb_flush_tail = entry; - - dmar_qi_advance_tail(unit); -} - -void -dmar_qi_invalidate_sync(struct dmar_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, bool cansleep) -{ - struct dmar_unit *unit; - struct iommu_qi_genseq gseq; - - unit = domain->dmar; - DMAR_LOCK(unit); - dmar_qi_invalidate_emit(domain, base, size, &gseq, true); - - /* - * To avoid a missed wakeup in dmar_qi_task(), the unit's waiters count - * must be incremented before the tail is advanced. - */ - unit->inv_seq_waiters++; - - dmar_qi_advance_tail(unit); - dmar_qi_wait_for_seq(unit, &gseq, !cansleep); - DMAR_UNLOCK(unit); + iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), pseq, emit_wait); } void @@ -310,13 +201,13 @@ dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit) struct iommu_qi_genseq gseq; DMAR_ASSERT_LOCKED(unit); - dmar_qi_ensure(unit, 2); + dmar_qi_ensure(DMAR2IOMMU(unit), 2); dmar_qi_emit(unit, DMAR_IQ_DESCR_CTX_INV | DMAR_IQ_DESCR_CTX_GLOB, 0); - dmar_qi_emit_wait_seq(unit, &gseq, true); + iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); /* See dmar_qi_invalidate_sync(). */ - unit->inv_seq_waiters++; - dmar_qi_advance_tail(unit); - dmar_qi_wait_for_seq(unit, &gseq, false); + unit->x86c.inv_seq_waiters++; + dmar_qi_advance_tail(DMAR2IOMMU(unit)); + iommu_qi_wait_for_seq(DMAR2IOMMU(unit), &gseq, false); } void @@ -325,14 +216,14 @@ dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit) struct iommu_qi_genseq gseq; DMAR_ASSERT_LOCKED(unit); - dmar_qi_ensure(unit, 2); + dmar_qi_ensure(DMAR2IOMMU(unit), 2); dmar_qi_emit(unit, DMAR_IQ_DESCR_IOTLB_INV | DMAR_IQ_DESCR_IOTLB_GLOB | DMAR_IQ_DESCR_IOTLB_DW | DMAR_IQ_DESCR_IOTLB_DR, 0); - dmar_qi_emit_wait_seq(unit, &gseq, true); + iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); /* See dmar_qi_invalidate_sync(). */ - unit->inv_seq_waiters++; - dmar_qi_advance_tail(unit); - dmar_qi_wait_for_seq(unit, &gseq, false); + unit->x86c.inv_seq_waiters++; + dmar_qi_advance_tail(DMAR2IOMMU(unit)); + iommu_qi_wait_for_seq(DMAR2IOMMU(unit), &gseq, false); } void @@ -341,13 +232,13 @@ dmar_qi_invalidate_iec_glob(struct dmar_unit *unit) struct iommu_qi_genseq gseq; DMAR_ASSERT_LOCKED(unit); - dmar_qi_ensure(unit, 2); + dmar_qi_ensure(DMAR2IOMMU(unit), 2); dmar_qi_emit(unit, DMAR_IQ_DESCR_IEC_INV, 0); - dmar_qi_emit_wait_seq(unit, &gseq, true); + iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); /* See dmar_qi_invalidate_sync(). */ - unit->inv_seq_waiters++; - dmar_qi_advance_tail(unit); - dmar_qi_wait_for_seq(unit, &gseq, false); + unit->x86c.inv_seq_waiters++; + dmar_qi_advance_tail(DMAR2IOMMU(unit)); + iommu_qi_wait_for_seq(DMAR2IOMMU(unit), &gseq, false); } void @@ -363,21 +254,21 @@ dmar_qi_invalidate_iec(struct dmar_unit *unit, u_int start, u_int cnt) for (; cnt > 0; cnt -= c, start += c) { l = ffs(start | cnt) - 1; c = 1 << l; - dmar_qi_ensure(unit, 1); + dmar_qi_ensure(DMAR2IOMMU(unit), 1); dmar_qi_emit(unit, DMAR_IQ_DESCR_IEC_INV | DMAR_IQ_DESCR_IEC_IDX | DMAR_IQ_DESCR_IEC_IIDX(start) | DMAR_IQ_DESCR_IEC_IM(l), 0); } - dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_seq(unit, &gseq, true); + dmar_qi_ensure(DMAR2IOMMU(unit), 1); + iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); /* - * Since dmar_qi_wait_for_seq() will not sleep, this increment's + * Since iommu_qi_wait_for_seq() will not sleep, this increment's * placement relative to advancing the tail doesn't matter. */ - unit->inv_seq_waiters++; + unit->x86c.inv_seq_waiters++; - dmar_qi_advance_tail(unit); + dmar_qi_advance_tail(DMAR2IOMMU(unit)); /* * The caller of the function, in particular, @@ -394,7 +285,7 @@ dmar_qi_invalidate_iec(struct dmar_unit *unit, u_int start, u_int cnt) * queue is processed, which includes requests possibly issued * before our request. */ - dmar_qi_wait_for_seq(unit, &gseq, true); + iommu_qi_wait_for_seq(DMAR2IOMMU(unit), &gseq, true); } int @@ -405,38 +296,18 @@ dmar_qi_intr(void *arg) unit = arg; KASSERT(unit->qi_enabled, ("dmar%d: QI is not enabled", unit->iommu.unit)); - taskqueue_enqueue(unit->qi_taskqueue, &unit->qi_task); + taskqueue_enqueue(unit->x86c.qi_taskqueue, &unit->x86c.qi_task); return (FILTER_HANDLED); } -static void -dmar_qi_drain_tlb_flush(struct dmar_unit *unit) -{ - struct iommu_map_entry *entry, *head; - - for (head = unit->tlb_flush_head;; head = entry) { - entry = (struct iommu_map_entry *) - atomic_load_acq_ptr((uintptr_t *)&head->tlb_flush_next); - if (entry == NULL || - !dmar_qi_seq_processed(unit, &entry->gseq)) - break; - unit->tlb_flush_head = entry; - iommu_gas_free_entry(head); - if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) - iommu_gas_free_region(entry); - else - iommu_gas_free_space(entry); - } -} - static void dmar_qi_task(void *arg, int pending __unused) { struct dmar_unit *unit; uint32_t ics; - unit = arg; - dmar_qi_drain_tlb_flush(unit); + unit = IOMMU2DMAR(arg); + iommu_qi_drain_tlb_flush(DMAR2IOMMU(unit)); /* * Request an interrupt on the completion of the next invalidation @@ -453,16 +324,16 @@ dmar_qi_task(void *arg, int pending __unused) * Otherwise, such entries will linger until a later entry * that requests an interrupt is processed. */ - dmar_qi_drain_tlb_flush(unit); + iommu_qi_drain_tlb_flush(DMAR2IOMMU(unit)); } - if (unit->inv_seq_waiters > 0) { + if (unit->x86c.inv_seq_waiters > 0) { /* * Acquire the DMAR lock so that wakeup() is called only after * the waiter is sleeping. */ DMAR_LOCK(unit); - wakeup(&unit->inv_seq_waiters); + wakeup(&unit->x86c.inv_seq_waiters); DMAR_UNLOCK(unit); } } @@ -472,7 +343,7 @@ dmar_init_qi(struct dmar_unit *unit) { uint64_t iqa; uint32_t ics; - int qi_sz; + u_int qi_sz; if (!DMAR_HAS_QI(unit) || (unit->hw_cap & DMAR_CAP_CM) != 0) return (0); @@ -481,34 +352,19 @@ dmar_init_qi(struct dmar_unit *unit) if (!unit->qi_enabled) return (0); - unit->tlb_flush_head = unit->tlb_flush_tail = - iommu_gas_alloc_entry(NULL, 0); - TASK_INIT(&unit->qi_task, 0, dmar_qi_task, unit); - unit->qi_taskqueue = taskqueue_create_fast("dmarqf", M_WAITOK, - taskqueue_thread_enqueue, &unit->qi_taskqueue); - taskqueue_start_threads(&unit->qi_taskqueue, 1, PI_AV, - "dmar%d qi taskq", unit->iommu.unit); - - unit->inv_waitd_gen = 0; - unit->inv_waitd_seq = 1; - - qi_sz = DMAR_IQA_QS_DEF; - TUNABLE_INT_FETCH("hw.dmar.qi_size", &qi_sz); - if (qi_sz > DMAR_IQA_QS_MAX) - qi_sz = DMAR_IQA_QS_MAX; - unit->inv_queue_size = (1ULL << qi_sz) * PAGE_SIZE; - /* Reserve one descriptor to prevent wraparound. */ - unit->inv_queue_avail = unit->inv_queue_size - DMAR_IQ_DESCR_SZ; - - /* The invalidation queue reads by DMARs are always coherent. */ - unit->inv_queue = kmem_alloc_contig(unit->inv_queue_size, M_WAITOK | - M_ZERO, 0, iommu_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - unit->inv_waitd_seq_hw_phys = pmap_kextract( - (vm_offset_t)&unit->inv_waitd_seq_hw); + unit->x86c.qi_buf_maxsz = DMAR_IQA_QS_MAX; + unit->x86c.qi_cmd_sz = DMAR_IQ_DESCR_SZ; + iommu_qi_common_init(DMAR2IOMMU(unit), dmar_qi_task); + get_x86_iommu()->qi_ensure = dmar_qi_ensure; + get_x86_iommu()->qi_emit_wait_descr = dmar_qi_emit_wait_descr; + get_x86_iommu()->qi_advance_tail = dmar_qi_advance_tail; + get_x86_iommu()->qi_invalidate_emit = dmar_qi_invalidate_emit; + + qi_sz = ilog2(unit->x86c.inv_queue_size / PAGE_SIZE); DMAR_LOCK(unit); dmar_write8(unit, DMAR_IQT_REG, 0); - iqa = pmap_kextract((uintptr_t)unit->inv_queue); + iqa = pmap_kextract((uintptr_t)unit->x86c.inv_queue); iqa |= qi_sz; dmar_write8(unit, DMAR_IQA_REG, iqa); dmar_enable_qi(unit); @@ -523,35 +379,19 @@ dmar_init_qi(struct dmar_unit *unit) return (0); } +static void +dmar_fini_qi_helper(struct iommu_unit *iommu) +{ + dmar_disable_qi_intr(IOMMU2DMAR(iommu)); + dmar_disable_qi(IOMMU2DMAR(iommu)); +} + void dmar_fini_qi(struct dmar_unit *unit) { - struct iommu_qi_genseq gseq; - if (!unit->qi_enabled) return; - taskqueue_drain(unit->qi_taskqueue, &unit->qi_task); - taskqueue_free(unit->qi_taskqueue); - unit->qi_taskqueue = NULL; - - DMAR_LOCK(unit); - /* quisce */ - dmar_qi_ensure(unit, 1); - dmar_qi_emit_wait_seq(unit, &gseq, true); - /* See dmar_qi_invalidate_sync_locked(). */ - unit->inv_seq_waiters++; - dmar_qi_advance_tail(unit); - dmar_qi_wait_for_seq(unit, &gseq, false); - /* only after the quisce, disable queue */ - dmar_disable_qi_intr(unit); - dmar_disable_qi(unit); - KASSERT(unit->inv_seq_waiters == 0, - ("dmar%d: waiters on disabled queue", unit->iommu.unit)); - DMAR_UNLOCK(unit); - - kmem_free(unit->inv_queue, unit->inv_queue_size); - unit->inv_queue = NULL; - unit->inv_queue_size = 0; + iommu_qi_common_fini(DMAR2IOMMU(unit), dmar_fini_qi_helper); unit->qi_enabled = 0; } diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index ea2c0358e072..571e5a2e65cd 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -29,7 +29,9 @@ */ #include +#include #include +#include #include #include #include @@ -40,8 +42,11 @@ #include #include #include -#include +#include +#include +#include #include +#include #include #include #include @@ -251,3 +256,230 @@ iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) { return (x86_iommu->unmap_ioapic_intr(ioapic_id, cookie)); } + +#define IOMMU2X86C(iommu) (x86_iommu->get_x86_common(iommu)) + +static bool +iommu_qi_seq_processed(struct iommu_unit *unit, + const struct iommu_qi_genseq *pseq) +{ + struct x86_unit_common *x86c; + u_int gen; + + x86c = IOMMU2X86C(unit); + gen = x86c->inv_waitd_gen; + return (pseq->gen < gen || + (pseq->gen == gen && pseq->seq <= x86c->inv_waitd_seq_hw)); +} + +void +iommu_qi_emit_wait_seq(struct iommu_unit *unit, struct iommu_qi_genseq *pseq, + bool emit_wait) +{ + struct x86_unit_common *x86c; + struct iommu_qi_genseq gsec; + uint32_t seq; + + KASSERT(pseq != NULL, ("wait descriptor with no place for seq")); + IOMMU_ASSERT_LOCKED(unit); + x86c = IOMMU2X86C(unit); + + if (x86c->inv_waitd_seq == 0xffffffff) { + gsec.gen = x86c->inv_waitd_gen; + gsec.seq = x86c->inv_waitd_seq; + x86_iommu->qi_ensure(unit, 1); + x86_iommu->qi_emit_wait_descr(unit, gsec.seq, false, + true, false); + x86_iommu->qi_advance_tail(unit); + while (!iommu_qi_seq_processed(unit, &gsec)) + cpu_spinwait(); + x86c->inv_waitd_gen++; + x86c->inv_waitd_seq = 1; + } + seq = x86c->inv_waitd_seq++; + pseq->gen = x86c->inv_waitd_gen; + pseq->seq = seq; + if (emit_wait) { + x86_iommu->qi_ensure(unit, 1); + x86_iommu->qi_emit_wait_descr(unit, seq, true, true, false); + } +} + +/* + * To avoid missed wakeups, callers must increment the unit's waiters count + * before advancing the tail past the wait descriptor. + */ +void +iommu_qi_wait_for_seq(struct iommu_unit *unit, const struct iommu_qi_genseq * + gseq, bool nowait) +{ + struct x86_unit_common *x86c; + + IOMMU_ASSERT_LOCKED(unit); + x86c = IOMMU2X86C(unit); + + KASSERT(x86c->inv_seq_waiters > 0, ("%s: no waiters", __func__)); + while (!iommu_qi_seq_processed(unit, gseq)) { + if (cold || nowait) { + cpu_spinwait(); + } else { + msleep(&x86c->inv_seq_waiters, &unit->lock, 0, + "dmarse", hz); + } + } + x86c->inv_seq_waiters--; +} + +/* + * The caller must not be using the entry's dmamap_link field. + */ +void +iommu_qi_invalidate_locked(struct iommu_domain *domain, + struct iommu_map_entry *entry, bool emit_wait) +{ + struct iommu_unit *unit; + struct x86_unit_common *x86c; + + unit = domain->iommu; + x86c = IOMMU2X86C(unit); + IOMMU_ASSERT_LOCKED(unit); + + x86_iommu->qi_invalidate_emit(domain, entry->start, entry->end - + entry->start, &entry->gseq, emit_wait); + + /* + * To avoid a data race in dmar_qi_task(), the entry's gseq must be + * initialized before the entry is added to the TLB flush list, and the + * entry must be added to that list before the tail is advanced. More + * precisely, the tail must not be advanced past the wait descriptor + * that will generate the interrupt that schedules dmar_qi_task() for + * execution before the entry is added to the list. While an earlier + * call to dmar_qi_ensure() might have advanced the tail, it will not + * advance it past the wait descriptor. + * + * See the definition of struct dmar_unit for more information on + * synchronization. + */ + entry->tlb_flush_next = NULL; + atomic_store_rel_ptr((uintptr_t *)&x86c->tlb_flush_tail-> + tlb_flush_next, (uintptr_t)entry); + x86c->tlb_flush_tail = entry; + + x86_iommu->qi_advance_tail(unit); +} + +void +iommu_qi_invalidate_sync(struct iommu_domain *domain, iommu_gaddr_t base, + iommu_gaddr_t size, bool cansleep) +{ + struct iommu_unit *unit; + struct iommu_qi_genseq gseq; + + unit = domain->iommu; + IOMMU_LOCK(unit); + x86_iommu->qi_invalidate_emit(domain, base, size, &gseq, true); + + /* + * To avoid a missed wakeup in iommu_qi_task(), the unit's + * waiters count must be incremented before the tail is + * advanced. + */ + IOMMU2X86C(unit)->inv_seq_waiters++; + + x86_iommu->qi_advance_tail(unit); + iommu_qi_wait_for_seq(unit, &gseq, !cansleep); + IOMMU_UNLOCK(unit); +} + +void +iommu_qi_drain_tlb_flush(struct iommu_unit *unit) +{ + struct x86_unit_common *x86c; + struct iommu_map_entry *entry, *head; + + x86c = IOMMU2X86C(unit); + for (head = x86c->tlb_flush_head;; head = entry) { + entry = (struct iommu_map_entry *) + atomic_load_acq_ptr((uintptr_t *)&head->tlb_flush_next); + if (entry == NULL || + !iommu_qi_seq_processed(unit, &entry->gseq)) + break; + x86c->tlb_flush_head = entry; + iommu_gas_free_entry(head); + if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) + iommu_gas_free_region(entry); + else + iommu_gas_free_space(entry); + } +} + +void +iommu_qi_common_init(struct iommu_unit *unit, task_fn_t qi_task) +{ + struct x86_unit_common *x86c; + u_int qi_sz; + + x86c = IOMMU2X86C(unit); + + x86c->tlb_flush_head = x86c->tlb_flush_tail = + iommu_gas_alloc_entry(NULL, 0); + TASK_INIT(&x86c->qi_task, 0, qi_task, unit); + x86c->qi_taskqueue = taskqueue_create_fast("iommuqf", M_WAITOK, + taskqueue_thread_enqueue, &x86c->qi_taskqueue); + taskqueue_start_threads(&x86c->qi_taskqueue, 1, PI_AV, + "iommu%d qi taskq", unit->unit); + + x86c->inv_waitd_gen = 0; + x86c->inv_waitd_seq = 1; + + qi_sz = 3; + TUNABLE_INT_FETCH("hw.iommu.qi_size", &qi_sz); + if (qi_sz > x86c->qi_buf_maxsz) + qi_sz = x86c->qi_buf_maxsz; + x86c->inv_queue_size = (1ULL << qi_sz) * PAGE_SIZE; + /* Reserve one descriptor to prevent wraparound. */ + x86c->inv_queue_avail = x86c->inv_queue_size - + x86c->qi_cmd_sz; + + /* + * The invalidation queue reads by DMARs/AMDIOMMUs are always + * coherent. + */ + x86c->inv_queue = kmem_alloc_contig(x86c->inv_queue_size, + M_WAITOK | M_ZERO, 0, iommu_high, PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + x86c->inv_waitd_seq_hw_phys = pmap_kextract( + (vm_offset_t)&x86c->inv_waitd_seq_hw); +} + +void +iommu_qi_common_fini(struct iommu_unit *unit, void (*disable_qi)( + struct iommu_unit *)) +{ + struct x86_unit_common *x86c; + struct iommu_qi_genseq gseq; + + x86c = IOMMU2X86C(unit); + + taskqueue_drain(x86c->qi_taskqueue, &x86c->qi_task); + taskqueue_free(x86c->qi_taskqueue); + x86c->qi_taskqueue = NULL; + + IOMMU_LOCK(unit); + /* quisce */ + x86_iommu->qi_ensure(unit, 1); + iommu_qi_emit_wait_seq(unit, &gseq, true); + /* See iommu_qi_invalidate_locked(). */ + x86c->inv_seq_waiters++; + x86_iommu->qi_advance_tail(unit); + iommu_qi_wait_for_seq(unit, &gseq, false); + /* only after the quisce, disable queue */ + disable_qi(unit); + KASSERT(x86c->inv_seq_waiters == 0, + ("iommu%d: waiters on disabled queue", unit->unit)); + IOMMU_UNLOCK(unit); + + kmem_free(x86c->inv_queue, x86c->inv_queue_size); + x86c->inv_queue = NULL; + x86c->inv_queue_size = 0; +} diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index 8c908964acd0..eb1bbafbeb77 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -59,7 +59,18 @@ extern int iommu_tbl_pagecnt; SYSCTL_DECL(_hw_iommu); SYSCTL_DECL(_hw_iommu_dmar); +struct x86_unit_common; + struct x86_iommu { + struct x86_unit_common *(*get_x86_common)(struct + iommu_unit *iommu); + void (*qi_ensure)(struct iommu_unit *unit, int descr_count); + void (*qi_emit_wait_descr)(struct iommu_unit *unit, uint32_t seq, + bool, bool, bool); + void (*qi_advance_tail)(struct iommu_unit *unit); + void (*qi_invalidate_emit)(struct iommu_domain *idomain, + iommu_gaddr_t base, iommu_gaddr_t size, struct iommu_qi_genseq * + pseq, bool emit_wait); void (*domain_unload_entry)(struct iommu_map_entry *entry, bool free, bool cansleep); void (*domain_unload)(struct iommu_domain *iodom, @@ -82,4 +93,65 @@ struct x86_iommu { void set_x86_iommu(struct x86_iommu *); struct x86_iommu *get_x86_iommu(void); +struct x86_unit_common { + uint32_t qi_buf_maxsz; + uint32_t qi_cmd_sz; + + char *inv_queue; + vm_size_t inv_queue_size; + uint32_t inv_queue_avail; + uint32_t inv_queue_tail; + volatile uint32_t inv_waitd_seq_hw; /* hw writes there on wait + descr completion */ *** 52 LINES SKIPPED *** From nobody Wed Sep 4 21:50:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblQ6bMhz5VS2d; Wed, 04 Sep 2024 21:50: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 4WzblQ3wfTz4gkg; Wed, 4 Sep 2024 21:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iAz0O1Fcn+Nxso0hOeCrilHLxlKXPAyEzD1arNyyb6o=; b=iVKeqt1WoTzrrvGUq3ojZr3wQ7qYxh4FGcI8D8jVbN2YB4BxD3Bnx+9+Pg+aWHV0+uWSJQ eGimNy7Z5Be9kEmB6CxoivV315VTpFlpxymeGYE7n3bui+sV+Bf6yFmvwkQeawR0f8ueZi ZSnmG43BVOQ99iBHrBl+iae+GEOGB6y/S8VbdJGM3vRm9hUs5L8gaxp2H6T4xGKGFoY2zG KVl75WyFef+uCH/du6Laz8W67zQ+2N9sqz50Cidb37eP/Z8MQVrprJTM0AEwZF1WEDZZVv dBOBQEJnp4GXvNj+V23rzdZuGIh9TP8aZU/aaKHou0/wbpFL7NUmRPRQTG2d0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486642; a=rsa-sha256; cv=none; b=g8NXvz8vKPL77leVx63EHOUVttCxHFyjqBnUp1J5LGE+e22sa38nUPx2/EVvgwvNYYCS8s lNtoX0m3WOawRyFL/JvHj7frh5jf/Lr3JoPkfkNj8KEnY5bkM0dI115pubrP53sa4w4uoL pY+CSenXV9pCFvFpNnCZyZ4o+vE7lN1/V3/CzRCvNfhZnQ5Qpro+sTgR2XKjVUWqZ/uFLI tUP4oCWCac7x/ttZX/p5VRRiKHntOjyKcAWAx9Z4k0/PR511jxI/+WtUD1j+QdcvluwRne N4/aKeYMAI+/FdTwZn3b+tChpbx3owMFvOXh/WfTI9ZD0XwgnxZ3UQ4KEAGLpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iAz0O1Fcn+Nxso0hOeCrilHLxlKXPAyEzD1arNyyb6o=; b=iIERrrL3kDMs6/jgESxl7bHHdfiDzZ43CcCqOWaEIOnsnYK5tfX7WJdpAxUUyJLmXe5OC0 5dORpMsz8LpjsZsrwvMw3RRuP2ykuUll1EEgcfp2qOwXHjoedwLq98p20qrD9q+danbkgR qL8Pa7Mh82E8ECyOmPUv52/xjxzFh85P898guf5OVXF5ahtHIJfOWRQOyHrzIx5oDt8CN8 jK9eb4/mL6daDEoyoiSkH4+bKRvJjPFgVjE9pAgmxJlzSv5zNc6heKltYfCjkpaNxpddt7 9zjpoEJaQgVidsS7eXstlbz2Vyedj6Rn22tjk1zCN+53FCVg+sX6gpfVg3ANmA== 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 4WzblQ3XsDzhL1; Wed, 4 Sep 2024 21:50: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 484LogAC031605; Wed, 4 Sep 2024 21:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Log8b031602; Wed, 4 Sep 2024 21:50:42 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:42 GMT Message-Id: <202409042150.484Log8b031602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f776a2b84972 - main - dmar_qi_XXX_invalidate_glob(): reduce code duplication List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f776a2b849726e7b86735b2930be64f5a2edf731 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f776a2b849726e7b86735b2930be64f5a2edf731 commit f776a2b849726e7b86735b2930be64f5a2edf731 Author: Konstantin Belousov AuthorDate: 2024-06-09 17:24:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 dmar_qi_XXX_invalidate_glob(): reduce code duplication Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_qi.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c index a94fbb54e7f7..b474d695552f 100644 --- a/sys/x86/iommu/intel_qi.c +++ b/sys/x86/iommu/intel_qi.c @@ -195,14 +195,14 @@ dmar_qi_invalidate_emit(struct iommu_domain *idomain, iommu_gaddr_t base, iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), pseq, emit_wait); } -void -dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit) +static void +dmar_qi_invalidate_glob_impl(struct dmar_unit *unit, uint64_t data1) { struct iommu_qi_genseq gseq; DMAR_ASSERT_LOCKED(unit); dmar_qi_ensure(DMAR2IOMMU(unit), 2); - dmar_qi_emit(unit, DMAR_IQ_DESCR_CTX_INV | DMAR_IQ_DESCR_CTX_GLOB, 0); + dmar_qi_emit(unit, data1, 0); iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); /* See dmar_qi_invalidate_sync(). */ unit->x86c.inv_seq_waiters++; @@ -211,34 +211,24 @@ dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit) } void -dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit) +dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit) { - struct iommu_qi_genseq gseq; + dmar_qi_invalidate_glob_impl(unit, DMAR_IQ_DESCR_CTX_INV | + DMAR_IQ_DESCR_CTX_GLOB); +} - DMAR_ASSERT_LOCKED(unit); - dmar_qi_ensure(DMAR2IOMMU(unit), 2); - dmar_qi_emit(unit, DMAR_IQ_DESCR_IOTLB_INV | DMAR_IQ_DESCR_IOTLB_GLOB | - DMAR_IQ_DESCR_IOTLB_DW | DMAR_IQ_DESCR_IOTLB_DR, 0); - iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); - /* See dmar_qi_invalidate_sync(). */ - unit->x86c.inv_seq_waiters++; - dmar_qi_advance_tail(DMAR2IOMMU(unit)); - iommu_qi_wait_for_seq(DMAR2IOMMU(unit), &gseq, false); +void +dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit) +{ + dmar_qi_invalidate_glob_impl(unit, DMAR_IQ_DESCR_IOTLB_INV | + DMAR_IQ_DESCR_IOTLB_GLOB | DMAR_IQ_DESCR_IOTLB_DW | + DMAR_IQ_DESCR_IOTLB_DR); } void dmar_qi_invalidate_iec_glob(struct dmar_unit *unit) { - struct iommu_qi_genseq gseq; - - DMAR_ASSERT_LOCKED(unit); - dmar_qi_ensure(DMAR2IOMMU(unit), 2); - dmar_qi_emit(unit, DMAR_IQ_DESCR_IEC_INV, 0); - iommu_qi_emit_wait_seq(DMAR2IOMMU(unit), &gseq, true); - /* See dmar_qi_invalidate_sync(). */ - unit->x86c.inv_seq_waiters++; - dmar_qi_advance_tail(DMAR2IOMMU(unit)); - iommu_qi_wait_for_seq(DMAR2IOMMU(unit), &gseq, false); + dmar_qi_invalidate_glob_impl(unit, DMAR_IQ_DESCR_IEC_INV); } void From nobody Wed Sep 4 21:50:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblS0y3fz5VRtg; Wed, 04 Sep 2024 21:50: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 4WzblR4w5Jz4hBh; Wed, 4 Sep 2024 21:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XD+qUjkXG6sF/mmqGpvtk4iA9FQ3+W/YXWO7gRB4Dng=; b=RkfyMjXU1Dwd/a9KiprOyMzPB23YegmDGFJyCatrpdVEWoq0YpbwxHnI/pCDKP2ew2xLEi bq2HEX48rAsSCmKOpWu2Z7Eg1RoZe1bxUgNxaeXBU6QNXYKFvWM0wOhJKqLo01mH3Q5sj/ qOq28lbCwMl0zW19HN4EHA3q439tPaTbOU6qsFDY17WnOZiAce4/PnGX2INiNrCLdj1x8L IxshnerDW+Yp+vNrel3+QlZdvpwNtHXJ59sKeEr/jnJLTcPgSbaqMDSpldHoontzHVno+k 2EMQAKnv2vN+mJMwq0rMgt2hjhfkqupe62q/J5bZlsaRpBPp2LtCQ88oTwVeqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486643; a=rsa-sha256; cv=none; b=aDxXmyvNl+QoZgl4pLA6C6ncRwJrKs6ULpB+NwRruR2z5BOWs0M7KcX1bdRFQhJGtgyeKD zr+cb0ngMFDStLY8yfaKdhuZbolv4b77Uz5mSNfoiE3mmZmecLryBdIZEVeQleda7jUDAB cK0E7pnvyeiT2p4L+Gs1eoIQ3N5W+SLO20PngS7IhcTH5Zhbl8YCZ8tdWgmhx66GFT6QbI tuKT0NR36/wZ2yXOLlkH2G2cPGj99Z0fzHDvSg/+5VbmlPEoDmZgqJBs8Vl+MhzcPB+zNr nhToV+dLwU+6PyEYd+j7iQOsRZqC+u1xRMOOUo1lQB/lVEf5eDcWJPl1QgpbSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XD+qUjkXG6sF/mmqGpvtk4iA9FQ3+W/YXWO7gRB4Dng=; b=rxhsmvHbaL7gPTd1BHN4B65QA0qmxjSSyXf+y4rrg/wDaZjJrmEZMq7Z5UcmZAxrPLEcsi H7cVktiaGJ29ZmHT5SxvsibA6XV9HbB2H9X4mwoGuViLurfup0IUvP479gG8SJpBARx6F3 KN+0U+1sod64ID5Y6UR9/EkJtawOx45syshpj33n5xX/XRrbma5ZgDrWShNM92icztpyAZ 8NoLBtkNOwsnKOMWsbWdvUYxGDg6Rl/33x8Ih9IkPSJd6RZ+/QGA103HFG49ciqgC9OqLj ovkhyzG3WQt6ZsaDMEBayeX031HHiR3M26Bz2b9/TUkbdywo3dBB2RyFIJGvGA== 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 4WzblR4WW2zhL2; Wed, 4 Sep 2024 21:50: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 484LohvJ031647; Wed, 4 Sep 2024 21:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Lohms031644; Wed, 4 Sep 2024 21:50:43 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:43 GMT Message-Id: <202409042150.484Lohms031644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b563be66998d - main - dmar_qi_emit(): use atomic_store_64() when available List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b563be66998ddd9dbc83364c8b515398d984c140 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b563be66998ddd9dbc83364c8b515398d984c140 commit b563be66998ddd9dbc83364c8b515398d984c140 Author: Konstantin Belousov AuthorDate: 2024-06-06 03:21:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 dmar_qi_emit(): use atomic_store_64() when available Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_qi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c index b474d695552f..8b5cfe3c0205 100644 --- a/sys/x86/iommu/intel_qi.c +++ b/sys/x86/iommu/intel_qi.c @@ -139,15 +139,25 @@ dmar_qi_emit(struct dmar_unit *unit, uint64_t data1, uint64_t data2) { DMAR_ASSERT_LOCKED(unit); +#ifdef __LP64__ + atomic_store_64((uint64_t *)(unit->x86c.inv_queue + + unit->x86c.inv_queue_tail), data1); +#else *(volatile uint64_t *)(unit->x86c.inv_queue + unit->x86c.inv_queue_tail) = data1; +#endif unit->x86c.inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail, (uintmax_t)unit->x86c.inv_queue_size)); unit->x86c.inv_queue_tail &= unit->x86c.inv_queue_size - 1; +#ifdef __LP64__ + atomic_store_64((uint64_t *)(unit->x86c.inv_queue + + unit->x86c.inv_queue_tail), data2); +#else *(volatile uint64_t *)(unit->x86c.inv_queue + unit->x86c.inv_queue_tail) = data2; +#endif unit->x86c.inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail, From nobody Wed Sep 4 21:50:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblT2zMMz5VS4r; Wed, 04 Sep 2024 21:50: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 4WzblS6Gndz4gyJ; Wed, 4 Sep 2024 21:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z82VXpWdrQf7LWqHIYs1kgCeRixhBg7CeAm9piSpc9M=; b=Xhxs0TR4TyFIY3VaPtlSMvUUeKOL8j6JzIqlwfwtNpEtD/C7laAqiY74IAAykx3NsdyW+B 9BT7dTQyyqISkHkMTut7TZbE1C0onHl6t+hBB3dvnK6Q3uY+3hKbVe3hp2+cQqw5nuZtZa nNZ0n44Pf0qiSW8Wm0fpNYrTGIet/sO4AhFyzli0YIz4gjARgVbuJHvapWLasokPz0ErZA 4MvArry7gmKb604lexvS/js+kgLzj3woZyEBNiyW34Ktb3X5SYpSJHfOxl668eCbRELLud Sj4PrWPpWU8Ipg1+dOFLJre+n33zetqKnVRKMkeVK9G1hL41pZBGYRagt2bCpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486644; a=rsa-sha256; cv=none; b=G71vrO2m9oUAZjuYGpSb6pzt3ekNleRJ96iJYiEtvKdNCKpuRKqshQJSi4RFkj631SU3BN +pHYXxJyqsSoV44afiB7IMGMlk6nrolM7DasO6fSez8CDwA+FzajFZdhx9bScgn+QSm/lZ Wjcm/fT9Pty21vHVTz1Dw+rOTcuZWADFc/BZDNzKW9GXciHtqHvxI4SIuEVgdNiOhYCUZU nmkRUG5DKh77B9GbbeGTRL0HMmGv5tz9KuBhgFS8otIPiNQ2DyUn95Ovqs/tocG8qprEs8 Ji1x32zzn6GyxKH+KwXUI9jNmdZ/L4Mj8tu/9TA/uYlWbVZaWw2tTv9WlaLHTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z82VXpWdrQf7LWqHIYs1kgCeRixhBg7CeAm9piSpc9M=; b=NBBrf3tJiSDDkRSnv4H/81ZlvIzz1pYA3mVirQfsKMZ/0mwnFFN50TNTu2C4f6jswIeGcz X550WOr6SiHP9FnmBvdHvjTOWi2H/f67kvVrOJnSRvYD8AaeEz5j1r22vqLaHe6Z29XVCh 1baGM507Jo9SANaTeB2NyCZr2FTJEfzyLh5kBDzSOpGwCc0g3P8WEfaoOVOCwbSG+DkAjJ sl/1DLUowmv7wFHyhXXcEHOW8EC91CwcSjT13m+C/06YEYSZsDIuUbPV7Rs95EQ5UNovuZ RoZFLY6WtortY2AI8BRtCa9GvxXNphJxWC4Pyku7U4yQjYi98voe8OTAiU4khg== 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 4WzblS5WMvzhL4; Wed, 4 Sep 2024 21:50: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 484LoiIM031689; Wed, 4 Sep 2024 21:50:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LoixC031686; Wed, 4 Sep 2024 21:50:44 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:44 GMT Message-Id: <202409042150.484LoixC031686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 23145534154c - main - DMAR: rename domain_{alloc,free}_pgtbl to domain_domain_$1_pgtbl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23145534154c279e3e8cbcd17d155f7ee67d8aa9 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23145534154c279e3e8cbcd17d155f7ee67d8aa9 commit 23145534154c279e3e8cbcd17d155f7ee67d8aa9 Author: Konstantin Belousov AuthorDate: 2024-06-30 03:52:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 DMAR: rename domain_{alloc,free}_pgtbl to domain_domain_$1_pgtbl Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 4 ++-- sys/x86/iommu/intel_dmar.h | 4 ++-- sys/x86/iommu/intel_idpgtbl.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 03ef196c4cb0..e39d2a136d8a 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -423,7 +423,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapped) } domain->iodom.flags |= IOMMU_DOMAIN_IDMAP; } else { - error = domain_alloc_pgtbl(domain); + error = dmar_domain_alloc_pgtbl(domain); if (error != 0) goto fail; /* Disable local apic region access */ @@ -509,7 +509,7 @@ dmar_domain_destroy(struct dmar_domain *domain) if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) { if (domain->pgtbl_obj != NULL) DMAR_DOMAIN_PGLOCK(domain); - domain_free_pgtbl(domain); + dmar_domain_free_pgtbl(domain); } iommu_domain_fini(iodom); dmar = DOM2DMAR(domain); diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 8a815d5cfca6..7b4a7900fa25 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -240,8 +240,8 @@ vm_object_t domain_get_idmap_pgtbl(struct dmar_domain *domain, void put_idmap_pgtbl(vm_object_t obj); void domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size); -int domain_alloc_pgtbl(struct dmar_domain *domain); -void domain_free_pgtbl(struct dmar_domain *domain); +int dmar_domain_alloc_pgtbl(struct dmar_domain *domain); +void dmar_domain_free_pgtbl(struct dmar_domain *domain); extern const struct iommu_domain_map_ops dmar_domain_map_ops; int dmar_dev_depth(device_t child); diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index de38a6fece94..eb6a51216dfd 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -696,7 +696,7 @@ domain_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, } int -domain_alloc_pgtbl(struct dmar_domain *domain) +dmar_domain_alloc_pgtbl(struct dmar_domain *domain) { vm_page_t m; @@ -718,7 +718,7 @@ domain_alloc_pgtbl(struct dmar_domain *domain) } void -domain_free_pgtbl(struct dmar_domain *domain) +dmar_domain_free_pgtbl(struct dmar_domain *domain) { vm_object_t obj; vm_page_t m; From nobody Wed Sep 4 21:50:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblW1xXCz5VS2n; Wed, 04 Sep 2024 21:50: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 4WzblW0LQQz4hMC; Wed, 4 Sep 2024 21:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ey1l8oc3p6ue872YSjN+wZzxMxUTSnKVFgfbHcUR2pQ=; b=lQLusofXEoW/2qXHw/+sdRITPHK+28HAPwUW3muEHZeJ680D+HnSDokZ7U8xTYy0Vn3CDZ edyuZZiQv7bQdejCoC5w33Uz6yae7IcOI3Zo+1SPyLMCOAGM0ezE2MmSH0QOJFvo+6WddV Sq8QlUWylOPrasj3OelVCIkLSIeqNIJg6wLuv4Wo+XUNue8+TJ6+Y68Q29871KQmmSZUjF 7pluc6zVZ9a/6F2xdVLFc+87N5kJWkMk9U+KLfbEdE2UUg95tRWS5djEkATRkbRfsFS/Tm 0OhDBVCnLvrZUheXSYDN7Y/6z42HqSF1VQSjYjDpEcSp9r1mJBZ+U+k1oP63Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486647; a=rsa-sha256; cv=none; b=rxvmUfuFPB5/WnzA77gzyz9jIWalCBH3pHP8HwqLp0MNKJIHWH26ZQaB1TNrSWpzFzmJns cUDgpXlH1SNfrH0J1Wotwjk3az58YFA35Q/PNSDvX4D3M8yQdqxPvkhw37ewej1YLWTH+d yep5XVy7nLKFolqsx+O8DZ/O5QMYFHYFEYqAnh/9K1QojYwds9AcGFeFbp6u6oULqw/c8l pPu0iXqd9Do+DY7uu37hGZox6ZAfIYrYyZC43mEQTDTvTqjTasLFi7VHze60hRygdORYhz vSyiDpLryFh8DSg9CT/UXWPbe3okFTtLLXfxI52v/donZ2OXf6b39TzD1rU3jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ey1l8oc3p6ue872YSjN+wZzxMxUTSnKVFgfbHcUR2pQ=; b=NSYMeDG98+UsWxPiusrL4tNoQdAtK23qMwWq9BpHx6OK/QL7G8IX5LxN4gcH4E5Suf0OqW iy5t3Iy+stIEuBs/CDaJD9zd02CK0J8KaFd1ojrQwuNXL49GnIUjLqASF8rY7ylCj/uu53 eH/IYEmLPFIiGAUAndQek6fgEo0WsvJdcJXR/eyfGMWoa5pHcd3q524NcqRK07MkNa6WAY eoKltb+on0Pg335KW2Lmu5PtT+bhA/8W0RdwCc7QiZhyu6mEQCl59Sa+oBp461k1yyBLis vbjGvSBMPf+WH9ba/oiRFr6nSxlVbsPpWyFnKgcIg0sGCsGHeWNybCOzZCwS7Q== 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 4WzblV73M1zhmd; Wed, 4 Sep 2024 21:50: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 484LokW6031814; Wed, 4 Sep 2024 21:50:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LokCu031811; Wed, 4 Sep 2024 21:50:46 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:46 GMT Message-Id: <202409042150.484LokCu031811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5967352a923e - main - x86 iommu: move DMAR-independent parts of the interrupt setup code into common List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5967352a923efe6676bdf794d6b73f7354719a43 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5967352a923efe6676bdf794d6b73f7354719a43 commit 5967352a923efe6676bdf794d6b73f7354719a43 Author: Konstantin Belousov AuthorDate: 2024-06-09 19:36:10 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 x86 iommu: move DMAR-independent parts of the interrupt setup code into common Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_dmar.h | 24 ++----- sys/x86/iommu/intel_drv.c | 151 ++++++++++++-------------------------------- sys/x86/iommu/intel_fault.c | 16 +++-- sys/x86/iommu/intel_qi.c | 14 ++-- sys/x86/iommu/iommu_utils.c | 105 ++++++++++++++++++++++++++++++ sys/x86/iommu/x86_iommu.h | 23 +++++++ 6 files changed, 193 insertions(+), 140 deletions(-) diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 7b4a7900fa25..0242e0cb954f 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -103,20 +103,6 @@ struct dmar_ctx { #define CTX2DMAR(ctx) (CTX2DOM(ctx)->dmar) #define DOM2DMAR(domain) ((domain)->dmar) -struct dmar_msi_data { - int irq; - int irq_rid; - struct resource *irq_res; - void *intr_handle; - int (*handler)(void *); - int msi_data_reg; - int msi_addr_reg; - int msi_uaddr_reg; - void (*enable_intr)(struct dmar_unit *); - void (*disable_intr)(struct dmar_unit *); - const char *name; -}; - #define DMAR_INTR_FAULT 0 #define DMAR_INTR_QI 1 #define DMAR_INTR_TOTAL 2 @@ -131,8 +117,6 @@ struct dmar_unit { int reg_rid; struct resource *regs; - struct dmar_msi_data intrs[DMAR_INTR_TOTAL]; - /* Hardware registers cache */ uint32_t hw_ver; uint64_t hw_cap; @@ -216,14 +200,14 @@ uint64_t dmar_get_timeout(void); void dmar_update_timeout(uint64_t newval); int dmar_fault_intr(void *arg); -void dmar_enable_fault_intr(struct dmar_unit *unit); -void dmar_disable_fault_intr(struct dmar_unit *unit); +void dmar_enable_fault_intr(struct iommu_unit *unit); +void dmar_disable_fault_intr(struct iommu_unit *unit); int dmar_init_fault_log(struct dmar_unit *unit); void dmar_fini_fault_log(struct dmar_unit *unit); int dmar_qi_intr(void *arg); -void dmar_enable_qi_intr(struct dmar_unit *unit); -void dmar_disable_qi_intr(struct dmar_unit *unit); +void dmar_enable_qi_intr(struct iommu_unit *unit); +void dmar_disable_qi_intr(struct iommu_unit *unit); int dmar_init_qi(struct dmar_unit *unit); void dmar_fini_qi(struct dmar_unit *unit); void dmar_qi_invalidate_locked(struct dmar_domain *domain, diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 66d99748888f..2439ef9e4ef5 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -230,22 +230,6 @@ dmar_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } -static void -dmar_release_intr(device_t dev, struct dmar_unit *unit, int idx) -{ - struct dmar_msi_data *dmd; - - dmd = &unit->intrs[idx]; - if (dmd->irq == -1) - return; - bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); - bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); - bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); - PCIB_RELEASE_MSIX(device_get_parent(device_get_parent(dev)), - dev, dmd->irq); - dmd->irq = -1; -} - static void dmar_release_resources(device_t dev, struct dmar_unit *unit) { @@ -256,7 +240,7 @@ dmar_release_resources(device_t dev, struct dmar_unit *unit) dmar_fini_qi(unit); dmar_fini_fault_log(unit); for (i = 0; i < DMAR_INTR_TOTAL; i++) - dmar_release_intr(dev, unit, i); + iommu_release_intr(DMAR2IOMMU(unit), i); if (unit->regs != NULL) { bus_deactivate_resource(dev, SYS_RES_MEMORY, unit->reg_rid, unit->regs); @@ -274,84 +258,19 @@ dmar_release_resources(device_t dev, struct dmar_unit *unit) } } -static int -dmar_alloc_irq(device_t dev, struct dmar_unit *unit, int idx) -{ - device_t pcib; - struct dmar_msi_data *dmd; - uint64_t msi_addr; - uint32_t msi_data; - int error; - - dmd = &unit->intrs[idx]; - pcib = device_get_parent(device_get_parent(dev)); /* Really not pcib */ - error = PCIB_ALLOC_MSIX(pcib, dev, &dmd->irq); - if (error != 0) { - device_printf(dev, "cannot allocate %s interrupt, %d\n", - dmd->name, error); - goto err1; - } - error = bus_set_resource(dev, SYS_RES_IRQ, dmd->irq_rid, - dmd->irq, 1); - if (error != 0) { - device_printf(dev, "cannot set %s interrupt resource, %d\n", - dmd->name, error); - goto err2; - } - dmd->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &dmd->irq_rid, RF_ACTIVE); - if (dmd->irq_res == NULL) { - device_printf(dev, - "cannot allocate resource for %s interrupt\n", dmd->name); - error = ENXIO; - goto err3; - } - error = bus_setup_intr(dev, dmd->irq_res, INTR_TYPE_MISC, - dmd->handler, NULL, unit, &dmd->intr_handle); - if (error != 0) { - device_printf(dev, "cannot setup %s interrupt, %d\n", - dmd->name, error); - goto err4; - } - bus_describe_intr(dev, dmd->irq_res, dmd->intr_handle, "%s", dmd->name); - error = PCIB_MAP_MSI(pcib, dev, dmd->irq, &msi_addr, &msi_data); - if (error != 0) { - device_printf(dev, "cannot map %s interrupt, %d\n", - dmd->name, error); - goto err5; - } - dmar_write4(unit, dmd->msi_data_reg, msi_data); - dmar_write4(unit, dmd->msi_addr_reg, msi_addr); - /* Only for xAPIC mode */ - dmar_write4(unit, dmd->msi_uaddr_reg, msi_addr >> 32); - return (0); - -err5: - bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); -err4: - bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); -err3: - bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); -err2: - PCIB_RELEASE_MSIX(pcib, dev, dmd->irq); - dmd->irq = -1; -err1: - return (error); -} - #ifdef DEV_APIC static int dmar_remap_intr(device_t dev, device_t child, u_int irq) { struct dmar_unit *unit; - struct dmar_msi_data *dmd; + struct iommu_msi_data *dmd; uint64_t msi_addr; uint32_t msi_data; int i, error; unit = device_get_softc(dev); for (i = 0; i < DMAR_INTR_TOTAL; i++) { - dmd = &unit->intrs[i]; + dmd = &unit->x86c.intrs[i]; if (irq == dmd->irq) { error = PCIB_MAP_MSI(device_get_parent( device_get_parent(dev)), @@ -359,11 +278,14 @@ dmar_remap_intr(device_t dev, device_t child, u_int irq) if (error != 0) return (error); DMAR_LOCK(unit); - (dmd->disable_intr)(unit); - dmar_write4(unit, dmd->msi_data_reg, msi_data); - dmar_write4(unit, dmd->msi_addr_reg, msi_addr); - dmar_write4(unit, dmd->msi_uaddr_reg, msi_addr >> 32); - (dmd->enable_intr)(unit); + dmd->msi_data = msi_data; + dmd->msi_addr = msi_addr; + (dmd->disable_intr)(DMAR2IOMMU(unit)); + dmar_write4(unit, dmd->msi_data_reg, dmd->msi_data); + dmar_write4(unit, dmd->msi_addr_reg, dmd->msi_addr); + dmar_write4(unit, dmd->msi_uaddr_reg, + dmd->msi_addr >> 32); + (dmd->enable_intr)(DMAR2IOMMU(unit)); DMAR_UNLOCK(unit); return (0); } @@ -407,6 +329,7 @@ dmar_attach(device_t dev) { struct dmar_unit *unit; ACPI_DMAR_HARDWARE_UNIT *dmaru; + struct iommu_msi_data *dmd; uint64_t timeout; int disable_pmr; int i, error; @@ -439,37 +362,47 @@ dmar_attach(device_t dev) dmar_update_timeout(timeout); for (i = 0; i < DMAR_INTR_TOTAL; i++) - unit->intrs[i].irq = -1; - - unit->intrs[DMAR_INTR_FAULT].name = "fault"; - unit->intrs[DMAR_INTR_FAULT].irq_rid = DMAR_FAULT_IRQ_RID; - unit->intrs[DMAR_INTR_FAULT].handler = dmar_fault_intr; - unit->intrs[DMAR_INTR_FAULT].msi_data_reg = DMAR_FEDATA_REG; - unit->intrs[DMAR_INTR_FAULT].msi_addr_reg = DMAR_FEADDR_REG; - unit->intrs[DMAR_INTR_FAULT].msi_uaddr_reg = DMAR_FEUADDR_REG; - unit->intrs[DMAR_INTR_FAULT].enable_intr = dmar_enable_fault_intr; - unit->intrs[DMAR_INTR_FAULT].disable_intr = dmar_disable_fault_intr; - error = dmar_alloc_irq(dev, unit, DMAR_INTR_FAULT); + unit->x86c.intrs[i].irq = -1; + + dmd = &unit->x86c.intrs[DMAR_INTR_FAULT]; + dmd->name = "fault"; + dmd->irq_rid = DMAR_FAULT_IRQ_RID; + dmd->handler = dmar_fault_intr; + dmd->msi_data_reg = DMAR_FEDATA_REG; + dmd->msi_addr_reg = DMAR_FEADDR_REG; + dmd->msi_uaddr_reg = DMAR_FEUADDR_REG; + dmd->enable_intr = dmar_enable_fault_intr; + dmd->disable_intr = dmar_disable_fault_intr; + error = iommu_alloc_irq(DMAR2IOMMU(unit), DMAR_INTR_FAULT); if (error != 0) { dmar_release_resources(dev, unit); dmar_devs[unit->iommu.unit] = NULL; return (error); } + dmar_write4(unit, dmd->msi_data_reg, dmd->msi_data); + dmar_write4(unit, dmd->msi_addr_reg, dmd->msi_addr); + dmar_write4(unit, dmd->msi_uaddr_reg, dmd->msi_addr >> 32); + if (DMAR_HAS_QI(unit)) { - unit->intrs[DMAR_INTR_QI].name = "qi"; - unit->intrs[DMAR_INTR_QI].irq_rid = DMAR_QI_IRQ_RID; - unit->intrs[DMAR_INTR_QI].handler = dmar_qi_intr; - unit->intrs[DMAR_INTR_QI].msi_data_reg = DMAR_IEDATA_REG; - unit->intrs[DMAR_INTR_QI].msi_addr_reg = DMAR_IEADDR_REG; - unit->intrs[DMAR_INTR_QI].msi_uaddr_reg = DMAR_IEUADDR_REG; - unit->intrs[DMAR_INTR_QI].enable_intr = dmar_enable_qi_intr; - unit->intrs[DMAR_INTR_QI].disable_intr = dmar_disable_qi_intr; - error = dmar_alloc_irq(dev, unit, DMAR_INTR_QI); + dmd = &unit->x86c.intrs[DMAR_INTR_QI]; + dmd->name = "qi"; + dmd->irq_rid = DMAR_QI_IRQ_RID; + dmd->handler = dmar_qi_intr; + dmd->msi_data_reg = DMAR_IEDATA_REG; + dmd->msi_addr_reg = DMAR_IEADDR_REG; + dmd->msi_uaddr_reg = DMAR_IEUADDR_REG; + dmd->enable_intr = dmar_enable_qi_intr; + dmd->disable_intr = dmar_disable_qi_intr; + error = iommu_alloc_irq(DMAR2IOMMU(unit), DMAR_INTR_QI); if (error != 0) { dmar_release_resources(dev, unit); dmar_devs[unit->iommu.unit] = NULL; return (error); } + + dmar_write4(unit, dmd->msi_data_reg, dmd->msi_data); + dmar_write4(unit, dmd->msi_addr_reg, dmd->msi_addr); + dmar_write4(unit, dmd->msi_uaddr_reg, dmd->msi_addr >> 32); } mtx_init(&unit->iommu.lock, "dmarhw", NULL, MTX_DEF); diff --git a/sys/x86/iommu/intel_fault.c b/sys/x86/iommu/intel_fault.c index 59b482720cf1..1064165ea5d7 100644 --- a/sys/x86/iommu/intel_fault.c +++ b/sys/x86/iommu/intel_fault.c @@ -127,7 +127,7 @@ dmar_fault_intr(void *arg) int fri, frir, faultp; bool enqueue; - unit = arg; + unit = IOMMU2DMAR((struct iommu_unit *)arg); enqueue = false; fsts = dmar_read4(unit, DMAR_FSTS_REG); dmar_fault_intr_clear(unit, fsts); @@ -276,9 +276,9 @@ dmar_init_fault_log(struct dmar_unit *unit) "dmar%d fault taskq", unit->iommu.unit); DMAR_LOCK(unit); - dmar_disable_fault_intr(unit); + dmar_disable_fault_intr(&unit->iommu); dmar_clear_faults(unit); - dmar_enable_fault_intr(unit); + dmar_enable_fault_intr(&unit->iommu); DMAR_UNLOCK(unit); return (0); @@ -292,7 +292,7 @@ dmar_fini_fault_log(struct dmar_unit *unit) return; DMAR_LOCK(unit); - dmar_disable_fault_intr(unit); + dmar_disable_fault_intr(&unit->iommu); DMAR_UNLOCK(unit); taskqueue_drain(unit->fault_taskqueue, &unit->fault_task); @@ -306,10 +306,12 @@ dmar_fini_fault_log(struct dmar_unit *unit) } void -dmar_enable_fault_intr(struct dmar_unit *unit) +dmar_enable_fault_intr(struct iommu_unit *iommu) { + struct dmar_unit *unit; uint32_t fectl; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); fectl = dmar_read4(unit, DMAR_FECTL_REG); fectl &= ~DMAR_FECTL_IM; @@ -317,10 +319,12 @@ dmar_enable_fault_intr(struct dmar_unit *unit) } void -dmar_disable_fault_intr(struct dmar_unit *unit) +dmar_disable_fault_intr(struct iommu_unit *iommu) { + struct dmar_unit *unit; uint32_t fectl; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); fectl = dmar_read4(unit, DMAR_FECTL_REG); dmar_write4(unit, DMAR_FECTL_REG, fectl | DMAR_FECTL_IM); diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c index 8b5cfe3c0205..c11946ad9447 100644 --- a/sys/x86/iommu/intel_qi.c +++ b/sys/x86/iommu/intel_qi.c @@ -293,7 +293,7 @@ dmar_qi_intr(void *arg) { struct dmar_unit *unit; - unit = arg; + unit = IOMMU2DMAR((struct iommu_unit *)arg); KASSERT(unit->qi_enabled, ("dmar%d: QI is not enabled", unit->iommu.unit)); taskqueue_enqueue(unit->x86c.qi_taskqueue, &unit->x86c.qi_task); @@ -373,7 +373,7 @@ dmar_init_qi(struct dmar_unit *unit) ics = DMAR_ICS_IWC; dmar_write4(unit, DMAR_ICS_REG, ics); } - dmar_enable_qi_intr(unit); + dmar_enable_qi_intr(DMAR2IOMMU(unit)); DMAR_UNLOCK(unit); return (0); @@ -382,7 +382,7 @@ dmar_init_qi(struct dmar_unit *unit) static void dmar_fini_qi_helper(struct iommu_unit *iommu) { - dmar_disable_qi_intr(IOMMU2DMAR(iommu)); + dmar_disable_qi_intr(iommu); dmar_disable_qi(IOMMU2DMAR(iommu)); } @@ -396,10 +396,12 @@ dmar_fini_qi(struct dmar_unit *unit) } void -dmar_enable_qi_intr(struct dmar_unit *unit) +dmar_enable_qi_intr(struct iommu_unit *iommu) { + struct dmar_unit *unit; uint32_t iectl; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); KASSERT(DMAR_HAS_QI(unit), ("dmar%d: QI is not supported", unit->iommu.unit)); @@ -409,10 +411,12 @@ dmar_enable_qi_intr(struct dmar_unit *unit) } void -dmar_disable_qi_intr(struct dmar_unit *unit) +dmar_disable_qi_intr(struct iommu_unit *iommu) { + struct dmar_unit *unit; uint32_t iectl; + unit = IOMMU2DMAR(iommu); DMAR_ASSERT_LOCKED(unit); KASSERT(DMAR_HAS_QI(unit), ("dmar%d: QI is not supported", unit->iommu.unit)); diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 571e5a2e65cd..04d42799310e 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -28,7 +28,15 @@ * SUCH DAMAGE. */ +#include "opt_acpi.h" +#if defined(__amd64__) +#define DEV_APIC +#else +#include "opt_apic.h" +#endif + #include +#include #include #include #include @@ -38,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +66,12 @@ #include #include #include +#ifdef DEV_APIC +#include "pcib_if.h" +#include +#include +#include +#endif vm_page_t iommu_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags) @@ -483,3 +499,92 @@ iommu_qi_common_fini(struct iommu_unit *unit, void (*disable_qi)( x86c->inv_queue = NULL; x86c->inv_queue_size = 0; } + +int +iommu_alloc_irq(struct iommu_unit *unit, int idx) +{ + device_t dev, pcib; + struct iommu_msi_data *dmd; + uint64_t msi_addr; + uint32_t msi_data; + int error; + + MPASS(idx >= 0 || idx < IOMMU_MAX_MSI); + + dev = unit->dev; + dmd = &IOMMU2X86C(unit)->intrs[idx]; + pcib = device_get_parent(device_get_parent(dev)); /* Really not pcib */ + error = PCIB_ALLOC_MSIX(pcib, dev, &dmd->irq); + if (error != 0) { + device_printf(dev, "cannot allocate %s interrupt, %d\n", + dmd->name, error); + goto err1; + } + error = bus_set_resource(dev, SYS_RES_IRQ, dmd->irq_rid, + dmd->irq, 1); + if (error != 0) { + device_printf(dev, "cannot set %s interrupt resource, %d\n", + dmd->name, error); + goto err2; + } + dmd->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &dmd->irq_rid, RF_ACTIVE); + if (dmd->irq_res == NULL) { + device_printf(dev, + "cannot allocate resource for %s interrupt\n", dmd->name); + error = ENXIO; + goto err3; + } + error = bus_setup_intr(dev, dmd->irq_res, INTR_TYPE_MISC, + dmd->handler, NULL, unit, &dmd->intr_handle); + if (error != 0) { + device_printf(dev, "cannot setup %s interrupt, %d\n", + dmd->name, error); + goto err4; + } + bus_describe_intr(dev, dmd->irq_res, dmd->intr_handle, "%s", dmd->name); + error = PCIB_MAP_MSI(pcib, dev, dmd->irq, &msi_addr, &msi_data); + if (error != 0) { + device_printf(dev, "cannot map %s interrupt, %d\n", + dmd->name, error); + goto err5; + } + + dmd->msi_data = msi_data; + dmd->msi_addr = msi_addr; + + return (0); + +err5: + bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); +err4: + bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); +err3: + bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); +err2: + PCIB_RELEASE_MSIX(pcib, dev, dmd->irq); + dmd->irq = -1; +err1: + return (error); +} + +void +iommu_release_intr(struct iommu_unit *unit, int idx) +{ + device_t dev; + struct iommu_msi_data *dmd; + + MPASS(idx >= 0 || idx < IOMMU_MAX_MSI); + + dmd = &IOMMU2X86C(unit)->intrs[idx]; + if (dmd->handler == NULL || dmd->irq == -1) + return; + dev = unit->dev; + + bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); + bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); + bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); + PCIB_RELEASE_MSIX(device_get_parent(device_get_parent(dev)), + dev, dmd->irq); + dmd->irq = -1; +} diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index 966a13c19b6e..d6e3ea56bd2c 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -93,6 +93,24 @@ struct x86_iommu { void set_x86_iommu(struct x86_iommu *); struct x86_iommu *get_x86_iommu(void); +struct iommu_msi_data { + int irq; + int irq_rid; + struct resource *irq_res; + void *intr_handle; + int (*handler)(void *); + int msi_data_reg; + int msi_addr_reg; + int msi_uaddr_reg; + uint64_t msi_addr; + uint32_t msi_data; + void (*enable_intr)(struct iommu_unit *); + void (*disable_intr)(struct iommu_unit *); + const char *name; +}; + +#define IOMMU_MAX_MSI 3 + struct x86_unit_common { uint32_t qi_buf_maxsz; uint32_t qi_cmd_sz; @@ -145,6 +163,8 @@ struct x86_unit_common { struct iommu_map_entry *tlb_flush_tail; struct task qi_task; struct taskqueue *qi_taskqueue; + + struct iommu_msi_data intrs[IOMMU_MAX_MSI]; }; void iommu_qi_emit_wait_seq(struct iommu_unit *unit, struct iommu_qi_genseq * @@ -160,4 +180,7 @@ void iommu_qi_common_init(struct iommu_unit *unit, task_fn_t taskfunc); void iommu_qi_common_fini(struct iommu_unit *unit, void (*disable_qi)( struct iommu_unit *)); +int iommu_alloc_irq(struct iommu_unit *unit, int idx); +void iommu_release_intr(struct iommu_unit *unit, int idx); + #endif From nobody Wed Sep 4 21:50:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblV20R1z5VRth; Wed, 04 Sep 2024 21:50: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 4WzblT6yghz4gwF; Wed, 4 Sep 2024 21:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MzT9JLiWgwVVlERcOtrJ40uZAUX2Nm5vz86Eu35pbuQ=; b=QXTY10KuZaUZAsp3eQ5mQnf0LLPmT32Rvf61zPiLhZlaRZh2iV+Yl2ptNwJxoo1ezOl9KL ft2rVqdnybKGUr7eFLInoaCKNJGD/vZe/tiCCcy8jN4DOhie6f3nFbyiTcylOu/AAdJlJL MqDoIdb/v5D2Nl5bHX+F8X7nhytugvDFElJCGnuQ2MXrDZdIHYu/EUcVWDaDRA6b+vbt1Z VSqkN8vuvexu6tlgmz6ujYa4W1IVKev2WNsxHeoB1wEeuRuLeO7RECysBwkkazyKU/jUFK wQEFndXmpvkLt9hJxhC0FnoOZI6NeMgkk60dzLtl1uZWov+VJ/N2EKQ6J4lsiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486646; a=rsa-sha256; cv=none; b=IoEj1r/WNxbdhMtF+hs5qkGV06pQSfI7ehtjtvP6JpMaUNd1M3NeT3i7r+sKODULUhbAsG UE8odMS0iqPUjdwPnVbl++Qd8YrK0P5zk6FxTqTJmcnmLq7E6jPvxlsOagI/jvy0dnUrXZ twNneHaqNrPSciDw7B871lVGkKPZslFmo0KHNKFze6qJP5huZx5ScatU8np2+wgQIYO8W4 4mJcLtDqKTOECv0z0IRdA++jC10C2AkCoHpYtLQifSCfZogm2yHFEXsTf1F9tOgDr7ml5D dCXbcSULAA2pBVNUndNs9/c3S4yEZXZT0tyqY2o10ZuCcKHmybtYy9yE4i+Yxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MzT9JLiWgwVVlERcOtrJ40uZAUX2Nm5vz86Eu35pbuQ=; b=uaL2GP3NjbyE2gONYDYPzR7tbHNPoTK/WEivBVWTWQtQ5GGFzguS7gIY8RU4wKeGZLdC0b 2B3t9hIDQiwgmtZ95nPZVvBE7BarsF2o8FHAOaI+MB5Wh35WT1YVjHiaAvnrOH7wR8Gf6T C36OFei5OH8BFgWvVxfl9ExzJ8K9r6SPgLhhqeBwsjHixHa53It/Ta9zL+sLx7Qezb1v2V dqeRblQOuyskWn8uJA0jh16jhcSwfkN+lDbN3LdjVmguvLPXSP7A9CLH4vGwaQVPvoxOMW L4GYHmQ+z7WJfWu+nRVVDWOxQUe7Tw9/pJaQLr0TiuaGNa7Pk2HBKUQd+jjucQ== 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 4WzblT6Yz5zh2r; Wed, 4 Sep 2024 21:50: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 484Loj5a031749; Wed, 4 Sep 2024 21:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LojXZ031746; Wed, 4 Sep 2024 21:50:45 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:45 GMT Message-Id: <202409042150.484LojXZ031746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fc8da73b93be - main - x86 iommu x86_unit_common: expand hw completion write-out area to 8 bytes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc8da73b93be3f5cc50f7607dbcfc1edb911de65 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fc8da73b93be3f5cc50f7607dbcfc1edb911de65 commit fc8da73b93be3f5cc50f7607dbcfc1edb911de65 Author: Konstantin Belousov AuthorDate: 2024-06-09 14:08:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:18 +0000 x86 iommu x86_unit_common: expand hw completion write-out area to 8 bytes in preparation to share it with AMD IOMMU. AMD writes out 8 bytes. We use 32-bit completion sequence numbers, and CPUs are little-endian. So the expansion is acceptable on Intel. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_drv.c | 4 ++-- sys/x86/iommu/x86_iommu.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 9fa1b3f98dc6..66d99748888f 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -1302,7 +1302,7 @@ dmar_print_one(int idx, bool show_domains, bool show_mappings) db_printf("qi is enabled: queue @0x%jx (IQA 0x%jx) " "size 0x%jx\n" " head 0x%x tail 0x%x avail 0x%x status 0x%x ctrl 0x%x\n" - " hw compl 0x%x@%p/phys@%jx next seq 0x%x gen 0x%x\n", + " hw compl 0x%jx@%p/phys@%jx next seq 0x%x gen 0x%x\n", (uintmax_t)unit->x86c.inv_queue, (uintmax_t)dmar_read8(unit, DMAR_IQA_REG), (uintmax_t)unit->x86c.inv_queue_size, @@ -1311,7 +1311,7 @@ dmar_print_one(int idx, bool show_domains, bool show_mappings) unit->x86c.inv_queue_avail, dmar_read4(unit, DMAR_ICS_REG), dmar_read4(unit, DMAR_IECTL_REG), - unit->x86c.inv_waitd_seq_hw, + (uintmax_t)unit->x86c.inv_waitd_seq_hw, &unit->x86c.inv_waitd_seq_hw, (uintmax_t)unit->x86c.inv_waitd_seq_hw_phys, unit->x86c.inv_waitd_seq, diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index eb1bbafbeb77..966a13c19b6e 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -101,8 +101,14 @@ struct x86_unit_common { vm_size_t inv_queue_size; uint32_t inv_queue_avail; uint32_t inv_queue_tail; - volatile uint32_t inv_waitd_seq_hw; /* hw writes there on wait - descr completion */ + + /* + * Hw writes there on completion of wait descriptor + * processing. Intel writes 4 bytes, while AMD does the + * 8-bytes write. Due to little-endian, and use of 4-byte + * sequence numbers, the difference does not matter for us. + */ + volatile uint64_t inv_waitd_seq_hw; uint64_t inv_waitd_seq_hw_phys; uint32_t inv_waitd_seq; /* next sequence number to use for wait descr */ From nobody Wed Sep 4 21:50:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblX2qlvz5VS4w; Wed, 04 Sep 2024 21:50: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 4WzblX17rbz4hQy; Wed, 4 Sep 2024 21:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Chra9jl4EA/8VYddGt6Ag1COTiIt6Jbc6xgmocofp1E=; b=AB2Gvx0NtCS3xmMNCyP/uQNKsjp/8292CzLIc+YWuXgfSG7tVEw11fBvID7/ReckhUPXZ/ 3IbrnIWYgHFLH6jmsvS2rKdYH64JljoeWI9Ow1RhQP9S+38JUe5BCtMEqrfq3sJi0Akq5z eXwyA5cO1VHoqiMsBoIiv16zDR1ZRKgSU+yKF6m4oKFf0bpyTYhxKlKE/hMGtHJJb4gjao q4w8hRv5ICXdsP05m9fM4lbCxE+aPWzV4aHNyTvc5vvJjYfaVC4ZUIOHlOJeXtMG5SanZr WjHMP0PpsC0lWqbybgvWzUvlLmBqBexYWCin/nmhC3HFjQeRG8e8KX1bwLpDAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486648; a=rsa-sha256; cv=none; b=IQfrX3WnI08vdkutsCYC52PTXvPEfsURNxPg21eG6MshJAfBKwWTUGjl+KxBLoKut2wciq JEHikFSnCtrCt53eKBhh36V4Qe1Ah8UPYWoV9q5C9FKUYcG2mrXBrHgT2Q/woRbjv7rxZ9 T6tOBkfUfZHebiPQVT91ihRvltFfTBihJuB587paBZz/52xBe2qNUT8rXpmfS5dn65mBxW /sjRWyzvDz/+UsqOPuEV3y2koipaDpC73+Eru9OQHQUS3VZmmIQVJTQmnubcVJoeZxHg03 JM6SEbA6KDJ0ntu9hZx8aMPRfaPy4/nTOo9xiN5MYrOXqDCovn7XU2FS19w1Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Chra9jl4EA/8VYddGt6Ag1COTiIt6Jbc6xgmocofp1E=; b=eKJyrOm7OjSv9vBAT9W/8pzONzUJfaE72qn/AAG5K/+1lq0l+taUdvklHZdGC9m91QZYvj wqUN+oimbmZoEAcnQK9L7Q6yBRj88MybH2ZsS/+kNX8m9OS0B2AHrQ9yWUNTvQoGqV8Pim EbJR8pOatlxsMXvP9hc7N6tfoTsAUYsmApZRGkRebwiGjAoNok0mcD/pKkdQl6tBb1vOeP uYMcv/TXx7g+icQaZUhNsMFK1hzK1kpMwY1S19bJDY7L4h+ivEw/Fbbel8aLGok/iDw4RN tdRaUT/hpNmzzxQ8bd64lWsPEEbcE9rwV8sTxNvmrEbvv3Pq57qX9mORbn+RjA== 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 4WzblX0mCSzhmf; Wed, 4 Sep 2024 21:50: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 484LompP032725; Wed, 4 Sep 2024 21:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LomsT032722; Wed, 4 Sep 2024 21:50:48 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:48 GMT Message-Id: <202409042150.484LomsT032722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ff54674b0950 - main - x86 iommu: move device_tag_init() to utils List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff54674b09501f4302e675bb2d3e34a752a63405 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff54674b09501f4302e675bb2d3e34a752a63405 commit ff54674b09501f4302e675bb2d3e34a752a63405 Author: Konstantin Belousov AuthorDate: 2024-06-30 01:16:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 x86 iommu: move device_tag_init() to utils Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 21 +-------------------- sys/x86/iommu/iommu_utils.c | 17 +++++++++++++++++ sys/x86/iommu/x86_iommu.h | 2 ++ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index e39d2a136d8a..12dd0f0a5259 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -124,25 +124,6 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, struct sf_buf **sfp) return (ctxp); } -static void -device_tag_init(struct dmar_ctx *ctx, device_t dev) -{ - struct dmar_domain *domain; - bus_addr_t maxaddr; - - domain = CTX2DOM(ctx); - maxaddr = MIN(domain->iodom.end, BUS_SPACE_MAXADDR); - ctx->context.tag->common.impl = &bus_dma_iommu_impl; - ctx->context.tag->common.boundary = 0; - ctx->context.tag->common.lowaddr = maxaddr; - ctx->context.tag->common.highaddr = maxaddr; - ctx->context.tag->common.maxsize = maxaddr; - ctx->context.tag->common.nsegments = BUS_SPACE_UNRESTRICTED; - ctx->context.tag->common.maxsegsz = maxaddr; - ctx->context.tag->ctx = CTX2IOCTX(ctx); - ctx->context.tag->owner = dev; -} - static void ctx_id_entry_init_one(dmar_ctx_entry_t *ctxp, struct dmar_domain *domain, vm_page_t ctx_root) @@ -586,7 +567,7 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t dev, uint16_t rid, ctx = ctx1; dmar_ctx_link(ctx); ctx->context.tag->owner = dev; - device_tag_init(ctx, dev); + iommu_device_tag_init(CTX2IOCTX(ctx), dev); /* * This is the first activated context for the diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 04d42799310e..20ca7890ce65 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -588,3 +588,20 @@ iommu_release_intr(struct iommu_unit *unit, int idx) dev, dmd->irq); dmd->irq = -1; } + +void +iommu_device_tag_init(struct iommu_ctx *ctx, device_t dev) +{ + bus_addr_t maxaddr; + + maxaddr = MIN(ctx->domain->end, BUS_SPACE_MAXADDR); + ctx->tag->common.impl = &bus_dma_iommu_impl; + ctx->tag->common.boundary = 0; + ctx->tag->common.lowaddr = maxaddr; + ctx->tag->common.highaddr = maxaddr; + ctx->tag->common.maxsize = maxaddr; + ctx->tag->common.nsegments = BUS_SPACE_UNRESTRICTED; + ctx->tag->common.maxsegsz = maxaddr; + ctx->tag->ctx = ctx; + ctx->tag->owner = dev; +} diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index d6e3ea56bd2c..5f56a2db74b5 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -183,4 +183,6 @@ void iommu_qi_common_fini(struct iommu_unit *unit, void (*disable_qi)( int iommu_alloc_irq(struct iommu_unit *unit, int idx); void iommu_release_intr(struct iommu_unit *unit, int idx); +void iommu_device_tag_init(struct iommu_ctx *ctx, device_t dev); + #endif From nobody Wed Sep 4 21:50:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblY3fs3z5VRmT; Wed, 04 Sep 2024 21:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzblY26Dtz4hFS; Wed, 4 Sep 2024 21:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmRimT17N0Nb0TznJREFkc5z3XOgBd+zyykcZuCfBew=; b=YQeGWRbKgV7acXxIRTeuLg9aeX95t1XTvmfmH76iGeHhSOAQi53MSK4lMWDmLFjyPdW5qj 3S0V8ZJ+TZEXTTfLzKhmTlwYHN1/2VbPt+KpEdNsI9v8oWuZLfQOvKOVQoMKJQFw60yQdx tdXGWnExQH1Ht9plF2PgqLcxC5gAN6sBPlLcije3GO4tVnzEhb1tW0Bp0cNxuo5frQTm+k S/iyVdkd64Dv/ak+87PKgyTnRghEPwLaoltvVqZK149ZtKGo/S6hUOFPhgH1y/qwGwcJx3 BCu38Ol18KemkvyEgLCY8r/r97igSWjaKIXkgCc1nc2MUm3m/K4sziOfhe0SHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486649; a=rsa-sha256; cv=none; b=as/AI1wJQiyCINfch216LM+0m+Co57ENJpUuhQU/lbfdiiz90iRoMM7DVtAXadW8Cq45Ys Dw97y1gMAgr/yB2NagzQXK8ZddeuQ44e8P/pm34NF/9h5KWa+EYaPlAGFZAQZKEbLijDty o4Ga4311naOWTxjrjeltjWWsLkzws8FCV3teBIzwEaJ9r9V03ix24bsaCy3SU3CxAqIIom dawEwkkwr53OcxwDN2luCgOebWSjWumcay3TG/TC6yMmymNaVyF9y9A71IqFcvG4b8TmAR iPInaDlm5EgDxPzxQi1iyYgp7gaA0EuFZL0YCAg5i3c29oSxj3tI1GyzGuTSVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmRimT17N0Nb0TznJREFkc5z3XOgBd+zyykcZuCfBew=; b=HTXBvT0luHMpNw1n4u1RSgOfiXyF097SMwcoCz8KPSBasxB34UA72MMXftWXt1AUuYIk8K PTVN6BD6OxIuW37zFqzsNHiwaxQvcoQfG1WR6BYoW5He9xrQtmqZRJSkfXzE+6wAhtR/zD RVFD71CRJ6UaSRQXG5EMjsSj3Xf2dxspHIhgk6K4DcyM2ggVfv/w4Zln+B53+bnCM7cSvM rhzZll2HOlUtLc2JUzcj0pQIYEKSJhMtTXVRolMMMuoh+snF7wuPDDWhWYxLyfLgWgmG0o i+I6lryVqaYIhwtbBbGaT77xOgR2OJ5CxFb8TGM55nH0mNTRM71ko+YXZmEtpA== 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 4WzblY1k1fzhL7; Wed, 4 Sep 2024 21:50:49 +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 484LonDD032844; Wed, 4 Sep 2024 21:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Lonvj032841; Wed, 4 Sep 2024 21:50:49 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:49 GMT Message-Id: <202409042150.484Lonvj032841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b3042e3a7c6f - main - x86 dmar: generalize dmar_domain_free_entry() into iommu_domain_free_entry() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3042e3a7c6ffee3867d52b192c6a9f4f49faf4b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b3042e3a7c6ffee3867d52b192c6a9f4f49faf4b commit b3042e3a7c6ffee3867d52b192c6a9f4f49faf4b Author: Konstantin Belousov AuthorDate: 2024-07-07 03:22:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 x86 dmar: generalize dmar_domain_free_entry() into iommu_domain_free_entry() Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 19 +++---------------- sys/x86/iommu/intel_dmar.h | 1 - sys/x86/iommu/iommu_utils.c | 14 ++++++++++++++ sys/x86/iommu/x86_iommu.h | 2 ++ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 12dd0f0a5259..9167bfd13589 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -833,19 +833,6 @@ dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid) return (NULL); } -void -dmar_domain_free_entry(struct iommu_map_entry *entry, bool free) -{ - if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) - iommu_gas_free_region(entry); - else - iommu_gas_free_space(entry); - if (free) - iommu_gas_free_entry(entry); - else - entry->flags = 0; -} - /* * If the given value for "free" is true, then the caller must not be using * the entry's dmamap_link field. @@ -874,12 +861,12 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, } else { iommu_qi_invalidate_sync(&domain->iodom, entry->start, entry->end - entry->start, cansleep); - dmar_domain_free_entry(entry, false); + iommu_domain_free_entry(entry, false); } } else { domain_flush_iotlb_sync(domain, entry->start, entry->end - entry->start); - dmar_domain_free_entry(entry, free); + iommu_domain_free_entry(entry, free); } } @@ -915,7 +902,7 @@ dmar_domain_unload(struct iommu_domain *iodom, domain_flush_iotlb_sync(domain, entry->start, entry->end - entry->start); TAILQ_REMOVE(entries, entry, dmamap_link); - dmar_domain_free_entry(entry, true); + iommu_domain_free_entry(entry, true); } } if (TAILQ_EMPTY(entries)) diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 0242e0cb954f..edb152f42fe7 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -243,7 +243,6 @@ void dmar_free_ctx_method(struct iommu_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); struct iommu_ctx *dmar_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init); -void dmar_domain_free_entry(struct iommu_map_entry *entry, bool free); void dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, bool cansleep); void dmar_domain_unload(struct iommu_domain *iodom, diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 20ca7890ce65..9c6cae5ff51f 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -605,3 +605,17 @@ iommu_device_tag_init(struct iommu_ctx *ctx, device_t dev) ctx->tag->ctx = ctx; ctx->tag->owner = dev; } + +void +iommu_domain_free_entry(struct iommu_map_entry *entry, bool free) +{ + if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) + iommu_gas_free_region(entry); + else + iommu_gas_free_space(entry); + if (free) + iommu_gas_free_entry(entry); + else + entry->flags = 0; +} + diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index 5f56a2db74b5..9e3a82283729 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -167,6 +167,8 @@ struct x86_unit_common { struct iommu_msi_data intrs[IOMMU_MAX_MSI]; }; +void iommu_domain_free_entry(struct iommu_map_entry *entry, bool free); + void iommu_qi_emit_wait_seq(struct iommu_unit *unit, struct iommu_qi_genseq * pseq, bool emit_wait); void iommu_qi_wait_for_seq(struct iommu_unit *unit, const struct From nobody Wed Sep 4 21:50:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzblZ4s69z5VS0F; Wed, 04 Sep 2024 21:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzblZ3YKBz4hZT; Wed, 4 Sep 2024 21:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UgGW4tOUdY/QMoE+wEIy8/2pbu3pAaSni/GrFL8n0fk=; b=u3X2KjpeNlFwa5jVeOZzqqG1uSxRs6JIZLTZs26jQVOY3Hg0WR0mMg7/wFPV1kw+llr7y1 7B3GoEoY6F7WucROR6eP4BY8FRvCbmxLWLqpLk//XyzeHYUC9R384m/cyAX4aG43P2mCFd hFnyrtwl1duaQCUcyUe9rzB3BFX0C9nT65lNaPsLLAeSwFE+dxz8FW4z7VxWn08WCGwH5b eALaopSsbgotLuNgDE8p66MPvcLI+fLWAmq0v+14X2yEmIRT+ssud2flCt2hgZ43z7Z/c4 lDgEfAQRbiIjfA67FRQGZ5RLN7NHibqNlwUobx25iwnLvSWbbfFvKbFXYApdmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486650; a=rsa-sha256; cv=none; b=A31epf40hTtb+eOEbTW+kWAZEZY6G/xRpAh7PBSeO6tC0LAwkOBr15qLBKKgza57uVxSA2 SKEf2I0N2lrrfWf5wSWMtEvbSVC21Gmpmv5DRXpcaK9yhDDY2cO9fYZjHbZmxE7wymIziO CqPSRnE9SKWH2cccpe5llTDr3M2voVIsoAGi/Idw0ZtCQ4VI7nsaf2QsslFzHZvM1JyDm7 fTxV6V9oURsGY5TE2zMRV8zVDpaQ75tti1OhXvctSJZatPi7Cq6b2xUNtskxuiCi4/Tqpk 44ropUKo2Eu7lItkksfYUHciWBYPiVO95R56rkShxt4/qlYjKVgKfHJ3sZWGUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UgGW4tOUdY/QMoE+wEIy8/2pbu3pAaSni/GrFL8n0fk=; b=MzLCoAIt6FePoXgEv30meQQLnjPCb3mk0jzxNNC61/+LD5BZdqsUxCY6hjp/tuiPt0qsOc CX9Csnm2XuP3dTWaLCTtvlGNVqiwyVUoA0E/eRtX9pyNTyFEy4YM8SJPasC26+T00fFwzi hZV8AQX+pGsUlWUokmk/jSIPFKo5Mfcnsgrg65gUjn+JxtbLjodnZWllD/MpBUgucbwoOB 7F1HXf4t4H4nE71/qTtXMeUUgYz8c6WyFyLytoeFg2bEiN06k14Z4txtWLnmefENzb8RFU O/rKNtxCvnVWCnwScD2Qm+lWebwleI+sR1EkrHMmDKkpmokN33znA4uu64VNpQ== 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 4WzblZ36kDzhmh; Wed, 4 Sep 2024 21:50:50 +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 484LooNH032902; Wed, 4 Sep 2024 21:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Loo9b032899; Wed, 4 Sep 2024 21:50:50 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:50 GMT Message-Id: <202409042150.484Loo9b032899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 29e227047065 - main - x86 iommu: move page level related functions to common utils List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29e227047065c6b1d08fdb72a21f33560637332b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=29e227047065c6b1d08fdb72a21f33560637332b commit 29e227047065c6b1d08fdb72a21f33560637332b Author: Konstantin Belousov AuthorDate: 2024-07-19 23:47:48 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 x86 iommu: move page level related functions to common utils Also improve pglvl_page_size() to handle level 6. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_dmar.h | 2 -- sys/x86/iommu/intel_idpgtbl.c | 38 ++--------------------- sys/x86/iommu/intel_utils.c | 37 ---------------------- sys/x86/iommu/iommu_utils.c | 71 +++++++++++++++++++++++++++++++++++++++++++ sys/x86/iommu/x86_iommu.h | 5 +++ 5 files changed, 78 insertions(+), 75 deletions(-) diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index edb152f42fe7..c1e6c8f06f64 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -175,9 +175,7 @@ bool dmar_pglvl_supported(struct dmar_unit *unit, int pglvl); int domain_set_agaw(struct dmar_domain *domain, int mgaw); int dmar_maxaddr2mgaw(struct dmar_unit *unit, iommu_gaddr_t maxaddr, bool allow_less); -vm_pindex_t pglvl_max_pages(int pglvl); int domain_is_sp_lvl(struct dmar_domain *domain, int lvl); -iommu_gaddr_t pglvl_page_size(int total_pglvl, int lvl); iommu_gaddr_t domain_page_size(struct dmar_domain *domain, int lvl); int calc_am(struct dmar_unit *unit, iommu_gaddr_t base, iommu_gaddr_t size, iommu_gaddr_t *isizep); diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index eb6a51216dfd..53851622340b 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -316,40 +316,6 @@ put_idmap_pgtbl(vm_object_t obj) * address. Support superpages. */ -/* - * Index of the pte for the guest address base in the page table at - * the level lvl. - */ -static int -domain_pgtbl_pte_off(struct dmar_domain *domain, iommu_gaddr_t base, int lvl) -{ - - base >>= IOMMU_PAGE_SHIFT + (domain->pglvl - lvl - 1) * - IOMMU_NPTEPGSHIFT; - return (base & IOMMU_PTEMASK); -} - -/* - * Returns the page index of the page table page in the page table - * object, which maps the given address base at the page table level - * lvl. - */ -static vm_pindex_t -domain_pgtbl_get_pindex(struct dmar_domain *domain, iommu_gaddr_t base, int lvl) -{ - vm_pindex_t idx, pidx; - int i; - - KASSERT(lvl >= 0 && lvl < domain->pglvl, - ("wrong lvl %p %d", domain, lvl)); - - for (pidx = idx = 0, i = 0; i < lvl; i++, pidx = idx) { - idx = domain_pgtbl_pte_off(domain, base, i) + - pidx * IOMMU_NPTEPG + 1; - } - return (idx); -} - static iommu_pte_t * domain_pgtbl_map_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, int flags, vm_pindex_t *idxp, struct sf_buf **sf) @@ -362,7 +328,7 @@ domain_pgtbl_map_pte(struct dmar_domain *domain, iommu_gaddr_t base, int lvl, DMAR_DOMAIN_ASSERT_PGLOCKED(domain); KASSERT((flags & IOMMU_PGF_OBJL) != 0, ("lost PGF_OBJL")); - idx = domain_pgtbl_get_pindex(domain, base, lvl); + idx = pglvl_pgtbl_get_pindex(domain->pglvl, base, lvl); if (*sf != NULL && idx == *idxp) { pte = (iommu_pte_t *)sf_buf_kva(*sf); } else { @@ -414,7 +380,7 @@ retry: goto retry; } } - pte += domain_pgtbl_pte_off(domain, base, lvl); + pte += pglvl_pgtbl_pte_off(domain->pglvl, base, lvl); return (pte); } diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index a96f65fddfc5..141452b3393d 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -172,23 +172,6 @@ dmar_maxaddr2mgaw(struct dmar_unit *unit, iommu_gaddr_t maxaddr, bool allow_less return (-1); } -/* - * Calculate the total amount of page table pages needed to map the - * whole bus address space on the context with the selected agaw. - */ -vm_pindex_t -pglvl_max_pages(int pglvl) -{ - vm_pindex_t res; - int i; - - for (res = 0, i = pglvl; i > 0; i--) { - res *= IOMMU_NPTEPG; - res++; - } - return (res); -} - /* * Return true if the page table level lvl supports the superpage for * the context ctx. @@ -209,26 +192,6 @@ domain_is_sp_lvl(struct dmar_domain *domain, int lvl) return (alvl < nitems(sagaw_sp) && (sagaw_sp[alvl] & cap_sps) != 0); } -iommu_gaddr_t -pglvl_page_size(int total_pglvl, int lvl) -{ - int rlvl; - static const iommu_gaddr_t pg_sz[] = { - (iommu_gaddr_t)IOMMU_PAGE_SIZE, - (iommu_gaddr_t)IOMMU_PAGE_SIZE << IOMMU_NPTEPGSHIFT, - (iommu_gaddr_t)IOMMU_PAGE_SIZE << (2 * IOMMU_NPTEPGSHIFT), - (iommu_gaddr_t)IOMMU_PAGE_SIZE << (3 * IOMMU_NPTEPGSHIFT), - (iommu_gaddr_t)IOMMU_PAGE_SIZE << (4 * IOMMU_NPTEPGSHIFT), - (iommu_gaddr_t)IOMMU_PAGE_SIZE << (5 * IOMMU_NPTEPGSHIFT), - }; - - KASSERT(lvl >= 0 && lvl < total_pglvl, - ("total %d lvl %d", total_pglvl, lvl)); - rlvl = total_pglvl - lvl - 1; - KASSERT(rlvl < nitems(pg_sz), ("sizeof pg_sz lvl %d", lvl)); - return (pg_sz[rlvl]); -} - iommu_gaddr_t domain_page_size(struct dmar_domain *domain, int lvl) { diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 9c6cae5ff51f..645c7e15740a 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -619,3 +619,74 @@ iommu_domain_free_entry(struct iommu_map_entry *entry, bool free) entry->flags = 0; } +/* + * Index of the pte for the guest address base in the page table at + * the level lvl. + */ +int +pglvl_pgtbl_pte_off(int pglvl, iommu_gaddr_t base, int lvl) +{ + + base >>= IOMMU_PAGE_SHIFT + (pglvl - lvl - 1) * + IOMMU_NPTEPGSHIFT; + return (base & IOMMU_PTEMASK); +} + +/* + * Returns the page index of the page table page in the page table + * object, which maps the given address base at the page table level + * lvl. + */ +vm_pindex_t +pglvl_pgtbl_get_pindex(int pglvl, iommu_gaddr_t base, int lvl) +{ + vm_pindex_t idx, pidx; + int i; + + KASSERT(lvl >= 0 && lvl < pglvl, + ("wrong lvl %d %d", pglvl, lvl)); + + for (pidx = idx = 0, i = 0; i < lvl; i++, pidx = idx) { + idx = pglvl_pgtbl_pte_off(pglvl, base, i) + + pidx * IOMMU_NPTEPG + 1; + } + return (idx); +} + +/* + * Calculate the total amount of page table pages needed to map the + * whole bus address space on the context with the selected agaw. + */ +vm_pindex_t +pglvl_max_pages(int pglvl) +{ + vm_pindex_t res; + int i; + + for (res = 0, i = pglvl; i > 0; i--) { + res *= IOMMU_NPTEPG; + res++; + } + return (res); +} + +iommu_gaddr_t +pglvl_page_size(int total_pglvl, int lvl) +{ + int rlvl; + static const iommu_gaddr_t pg_sz[] = { + (iommu_gaddr_t)IOMMU_PAGE_SIZE, + (iommu_gaddr_t)IOMMU_PAGE_SIZE << IOMMU_NPTEPGSHIFT, + (iommu_gaddr_t)IOMMU_PAGE_SIZE << (2 * IOMMU_NPTEPGSHIFT), + (iommu_gaddr_t)IOMMU_PAGE_SIZE << (3 * IOMMU_NPTEPGSHIFT), + (iommu_gaddr_t)IOMMU_PAGE_SIZE << (4 * IOMMU_NPTEPGSHIFT), + (iommu_gaddr_t)IOMMU_PAGE_SIZE << (5 * IOMMU_NPTEPGSHIFT), + (iommu_gaddr_t)IOMMU_PAGE_SIZE << (6 * IOMMU_NPTEPGSHIFT), + }; + + KASSERT(lvl >= 0 && lvl < total_pglvl, + ("total %d lvl %d", total_pglvl, lvl)); + rlvl = total_pglvl - lvl - 1; + KASSERT(rlvl < nitems(pg_sz), ("sizeof pg_sz lvl %d", lvl)); + return (pg_sz[rlvl]); +} diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index 9e3a82283729..b2caed550e35 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -187,4 +187,9 @@ void iommu_release_intr(struct iommu_unit *unit, int idx); void iommu_device_tag_init(struct iommu_ctx *ctx, device_t dev); +int pglvl_pgtbl_pte_off(int pglvl, iommu_gaddr_t base, int lvl); +vm_pindex_t pglvl_pgtbl_get_pindex(int pglvl, iommu_gaddr_t base, int lvl); +vm_pindex_t pglvl_max_pages(int pglvl); +iommu_gaddr_t pglvl_page_size(int total_pglvl, int lvl); + #endif From nobody Wed Sep 4 21:50:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzblc2zmTz5VS2x; Wed, 04 Sep 2024 21: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 4Wzblb4C3Rz4hG0; Wed, 4 Sep 2024 21:50:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gaV5e+KyT02wuuILXDr8XO8B0AogGbQjE0L4a9aB+h0=; b=d+X0gL6rcbnWMQ7kt2fdXkNiRU1lJ1HrXm3lblfSwnndOPSFqHR9E5hHpap8zKtU28q3tF TFLKtVi13zojvGq2qoUBBV3SpumSuhL15NrAnczx35G0FSTbCZL1NeMm2NxmOkaoug9sfL xkBgLPCZzIRXtAnVxqNCemwh1qcb9+BlKLdJ1plaazrgPN76tog6u+xXv41ryQeJv6baIp gUfabxZy3PllIvKL9AvF+4AV5ykjlsqpO4U3gzJ8SRMtlroKMO3O0oKKmJC7Pg9EEWMJ9F mjqN75TAOL/h4VAx8j4ZWXeDlC+1aa81zzmPrM4dL0C70qGFIAwcasaM2Aagtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486651; a=rsa-sha256; cv=none; b=j+BdkXYWgpaJvZTvxDRunJrV54cqkOJBNN0bjA0GvHvg1GG/UPW2NIiOUwDD/fJlEfdhIL /SuJLlQyUAb6wWxQtjP3d81v/2DnXp8iKdJcE1pwL6og0b2r0/bngvzkwueg+DhVTbEMi0 dytRIi/K9OAnmG/ZyuPZRT6r183LRYH1zKElfrMi/rg15Ou9zBqllUvJto/vhBzkOuIDyf 7Lcez+0Nkol7yuVwFlHj51Du6mfoVzP80fqP3I0z40GvtzdrD7r9Ztdb0bha5IGEg2FagE pifzz32E5uR+09QVbNdrE5vj8Cc7xSMeOgMl/VsYunOMpo8vMPdDruohV0L7CQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gaV5e+KyT02wuuILXDr8XO8B0AogGbQjE0L4a9aB+h0=; b=msZ0Y6HWPiTAONyQ7w4kWvlxxxrYQtFwrGDrDxzfTSzPFSWgYcNioz6R/xZ+58b3xEfbrJ 0RLXnaTjpNKxzRSqPYPypai3JUHdOR3bTc+IfsoMRhmAfiv6SQuqC1xgPOYANDCDgbBd35 1QsPhwRyCzxmmB6tNwMBxA+DkeAPfoToOObrFPWuBReFyCb5RQh3vUi+qHWts8ny0jNit8 oAaLBqA3qUyKc8s8unqPkXwOmScEQu3FM9uJCujss9HFXBRX9dcVDp5goW3ymiAI+75u7b 44hdNWpFf9zZSQOC4DnfnVZ56eSvT4bjCBCXeYzTtayjH4fCet8CuYjDZOyKnQ== 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 4Wzblb3pv4zhFT; Wed, 4 Sep 2024 21:50: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 484LopiD032951; Wed, 4 Sep 2024 21:50:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484Lop2q032948; Wed, 4 Sep 2024 21:50:51 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:51 GMT Message-Id: <202409042150.484Lop2q032948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0386b2451592 - main - DMAR: move hw.iommu.dmar.{tbl_pagecnt,batch_coalesce} sysctls up one level List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0386b2451592ec04e4cff826b698f978a45ab3e4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0386b2451592ec04e4cff826b698f978a45ab3e4 commit 0386b2451592ec04e4cff826b698f978a45ab3e4 Author: Konstantin Belousov AuthorDate: 2024-08-23 21:10:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 DMAR: move hw.iommu.dmar.{tbl_pagecnt,batch_coalesce} sysctls up one level Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_ctx.c | 2 +- sys/x86/iommu/intel_dmar.h | 3 ++- sys/x86/iommu/intel_utils.c | 4 ---- sys/x86/iommu/iommu_utils.c | 9 +++++++-- sys/x86/iommu/x86_iommu.h | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 9167bfd13589..5047acd283e9 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -877,7 +877,7 @@ dmar_domain_unload_emit_wait(struct dmar_domain *domain, if (TAILQ_NEXT(entry, dmamap_link) == NULL) return (true); - return (domain->batch_no++ % dmar_batch_coalesce == 0); + return (domain->batch_no++ % iommu_qi_batch_coalesce == 0); } void diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index c1e6c8f06f64..188e40dec36c 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -166,6 +166,8 @@ struct dmar_unit { #define DMAR_BARRIER_RMRR 0 #define DMAR_BARRIER_USEQ 1 +SYSCTL_DECL(_hw_iommu_dmar); + struct dmar_unit *dmar_find(device_t dev, bool verbose); struct dmar_unit *dmar_find_hpet(device_t dev, uint16_t *rid); struct dmar_unit *dmar_find_ioapic(u_int apic_id, uint16_t *rid); @@ -265,7 +267,6 @@ int dmar_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, int dmar_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie); extern int haw; -extern int dmar_batch_coalesce; extern int dmar_rmrr_enable; static inline uint32_t diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index 141452b3393d..287b5fe9376a 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -507,7 +507,6 @@ dmar_barrier_exit(struct dmar_unit *dmar, u_int barrier_id) DMAR_UNLOCK(dmar); } -int dmar_batch_coalesce = 100; struct timespec dmar_hw_timeout = { .tv_sec = 0, .tv_nsec = 1000000 @@ -546,9 +545,6 @@ dmar_timeout_sysctl(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, - &dmar_batch_coalesce, 0, - "Number of qi batches between interrupt"); SYSCTL_PROC(_hw_iommu_dmar, OID_AUTO, timeout, CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, dmar_timeout_sysctl, "QU", diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 645c7e15740a..5d22c6584ab7 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -181,9 +181,14 @@ int iommu_tbl_pagecnt; SYSCTL_NODE(_hw_iommu, OID_AUTO, dmar, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); -SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, +SYSCTL_INT(_hw_iommu, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &iommu_tbl_pagecnt, 0, - "Count of pages used for DMAR pagetables"); + "Count of pages used for IOMMU pagetables"); + +int iommu_qi_batch_coalesce = 100; +SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, + &iommu_qi_batch_coalesce, 0, + "Number of qi batches between interrupt"); static struct x86_iommu *x86_iommu; diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index b2caed550e35..210ce82c8f6d 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -55,9 +55,9 @@ void iommu_unmap_pgtbl(struct sf_buf *sf); extern iommu_haddr_t iommu_high; extern int iommu_tbl_pagecnt; +extern int iommu_qi_batch_coalesce; SYSCTL_DECL(_hw_iommu); -SYSCTL_DECL(_hw_iommu_dmar); struct x86_unit_common; From nobody Wed Sep 4 21:50:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzblc61R1z5VS58; Wed, 04 Sep 2024 21: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 4Wzblc5CzJz4hdF; Wed, 4 Sep 2024 21: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=1725486652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHpk0ZLz17KJTY0iJnNBsmjCQUgmJ3I0qkBK2naxi6Y=; b=arj/k1QYKs0vZ2tIr/rmPNxgiEVNBgg8WS43toPuSpNPUPxQbUTNiD3FNVvmNONO7KzqOF LRj5esQNhFeLzh25xXxV3a/dFXGdB7rMWc8nCFxEcjzQNfm3sZnNbv9kNOL/MPbGm7SLSs RU6pJmEcLxnuLX8lxNf9PKt1bVR6P6eybzOa+Q4wiAal021uqBrre5ckrVI7F6+tw3f192 cfMJ/MF0OHsStXznVEKUzuhffm9V55D4AqPt8mUJbWVUQvHXqVh1oGTQuHos3exbfRedrK ki4rKNOKiwsW4Vji0S9oVJQUUdLAdZhuH5N2sYx2jrShsZ6Gj1bY6OqN/cPmZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486652; a=rsa-sha256; cv=none; b=vKw9M0DQpbUIoRxD6xXnXvb8hy9keZndZtFLgtL+gd0GAco3oSTUQkDPDV+B+GBvlmICO6 45BUU/cT/+OyipyLFSzdFnbURGC+ebjqukS9VxOmWvkH/ZJQeXJykAt+fziaIsbPirXEdu 0nfC/RWpebFmc7HLR3ZaU7/cjxhcwO4QrY2KWooetsgcFiWJ4gFycuUozGAVLmLSEWlsXm x9TA2stp4aHea3CDbj6zAfVzpm3hbzyaIlmrOdwSvIlTTHOfyDs8JR240f86WeNOS6wJaN 51dtRWEg1fmcy7S/qbPbMr8fVbjFHjyQ1UlOsoVZEfrWWbnKoE9Y6tILjmvJoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHpk0ZLz17KJTY0iJnNBsmjCQUgmJ3I0qkBK2naxi6Y=; b=jxIMO/2jTXNB5evguhOO0Yk6m5dy1wMzpeIOcpNiZDmNOYAnV/gOVRWmEIZMc458cuKPBG EA/GQgCOkurhLw3ds8FObV8ipGlt8zDlz2xw3WpKeECQ9v29kDBDCVh6bTahTStW4hu7LP GGnxatSkK7d351vyxOcXyhUzXk+PuSx+RfS8UE0uJA9u8ughmfWvHYLbwCZyYFLbOJOGf6 Km42KuOIdrf1sedImMW9rXGN3BMoAuCWprQs8anDvuaGohr05pPpZ1sTMuRmRP60dH3jsN Z2ZrYvKJpcX/RrL7MGRd8SFaLO5z+oPz1onf0H8byiOn1hAKc/SFsuLPS7SGpA== 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 4Wzblc4rGJzh5n; Wed, 4 Sep 2024 21: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 484Loqhd033002; Wed, 4 Sep 2024 21: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 484LoqsG032999; Wed, 4 Sep 2024 21:50:52 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:52 GMT Message-Id: <202409042150.484LoqsG032999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 22bf8cf32f35 - main - DMAR: provide hw.iommu.ir alias for the hw.dmar.ir tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22bf8cf32f355705eb40cfbd7892492ac8140c50 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=22bf8cf32f355705eb40cfbd7892492ac8140c50 commit 22bf8cf32f355705eb40cfbd7892492ac8140c50 Author: Konstantin Belousov AuthorDate: 2024-08-23 21:12:15 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 DMAR: provide hw.iommu.ir alias for the hw.dmar.ir tunable Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_intrmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c index a6979a9d2501..ec3cd35e4f4e 100644 --- a/sys/x86/iommu/intel_intrmap.c +++ b/sys/x86/iommu/intel_intrmap.c @@ -323,6 +323,7 @@ dmar_init_irt(struct dmar_unit *unit) return (0); unit->ir_enabled = 1; TUNABLE_INT_FETCH("hw.dmar.ir", &unit->ir_enabled); + TUNABLE_INT_FETCH("hw.iommu.ir", &unit->ir_enabled); if (!unit->ir_enabled) return (0); if (!unit->qi_enabled) { From nobody Wed Sep 4 21:50:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzblf0rSQz5VS0R; Wed, 04 Sep 2024 21:50: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 4Wzbld60f3z4hdb; Wed, 4 Sep 2024 21:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wgjRc5w1urqs/hyAo6vC0UXLYdh7sxZ3tMC6ou+rzPo=; b=nX9kGZs1xyx7oiDTT1N3n1lOFCZWgnZHvobyk9FAuYbkryiE7XPmTZRkg6MOTksoAi6y17 PCYq/UqTQ6e+FruC3b3u79pKJflu8BAOMEys3C+cF28sau1pdGpud8gE5UkhdwiLi3YGbJ aTdlpqrWVaxNgsRH/Y/VZRlfcz4+FOn6JNl+tyKXdXgeu1bwhwLnvhbqkdvJhAuloztas6 X70zy6lfzqJYuz02pLDduWMdc4flmlAtoDtOcqMo/zSXYFfj9+JpYTAmm+vfBg1c/jYSy5 LVoBpw8aF62sRkpTwymE+dxqUPnQBUhcN1l9fHL9VzN4rLCN7KmVlFo4GLcmww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486653; a=rsa-sha256; cv=none; b=r/FRSxcJF137JHsCtaYNHr4B987M+5sqsqZBd+X7ZYDKF59jUKohabVh1dnAE2/fSmFS3H WrxmXeieQwFwZ8fhFiA8J6KxAGkQqA5e/6Ic7CMBkSsio/V3yf6ioRfyE5T2YYoVI+NXz4 Vz9kQZipGLEcaW1BBBBV3MaqSm1kihbVLrwgorzQxokR6MAe7l0CqBHVk5oMkMU5uiKDe3 DrHCfU0XXC0RD/iTRu4DJSWGa/Cuz40ZZVNf2KNyD/6dkgPGnEK28iN6QRvyOxga+xTSwZ oarKp2gOJfIUVdPK9ekJ3r9ImlW1F4esSK9SzBvU5hKhXVm0Yd0SjqMx1RJwhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wgjRc5w1urqs/hyAo6vC0UXLYdh7sxZ3tMC6ou+rzPo=; b=S3sxMUINg5F0AdxUnksESraOfqDRffWAYL5wS2BIszN8wbPaHRPdEkJicV9lJLxYL8Z/Ef q5xwoPX9WcFqjSFieXKE9SDjjUxTxC+9ZHIRo9A/whoZBJbMYtEyeNzyKj7D4GZ0CaBm8A ZNgkEKav+8yK69rOfGD3Zy+0s/arwmRwfE+axa9o3LjlGoiGxf/7J5bFJtWC9sKUVQe/kR YmDYy0qU6JRGqjz+nSmuWG9KFLL/uz6akr4q4LUXuXHSUZzi3X0cUgkfoX1L5ZKcjyBUQU aXorP39JtWQTY6EchzmbyC3lbZmwSMsOyyLkAvZSmSjt6wWJ0oetXPKTANvbKw== 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 4Wzbld5byyzhFV; Wed, 4 Sep 2024 21:50: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 484Lor6P033056; Wed, 4 Sep 2024 21:50:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LorVp033053; Wed, 4 Sep 2024 21:50:53 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:53 GMT Message-Id: <202409042150.484LorVp033053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ba33e74c7d48 - main - busdma_iommu: indirect dmar-specific method calls in iommu_get_dev_ctx() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba33e74c7d48479784896807eb8a1c2e1012d163 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ba33e74c7d48479784896807eb8a1c2e1012d163 commit ba33e74c7d48479784896807eb8a1c2e1012d163 Author: Konstantin Belousov AuthorDate: 2024-07-27 16:28:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 busdma_iommu: indirect dmar-specific method calls in iommu_get_dev_ctx() Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/arm64/iommu/iommu.c | 5 +++++ sys/dev/iommu/busdma_iommu.c | 6 +----- sys/dev/iommu/iommu.h | 1 + sys/x86/iommu/intel_drv.c | 8 ++++++++ sys/x86/iommu/iommu_utils.c | 6 ++++++ sys/x86/iommu/x86_iommu.h | 1 + 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/arm64/iommu/iommu.c b/sys/arm64/iommu/iommu.c index b765763e3a60..af0edfee70d8 100644 --- a/sys/arm64/iommu/iommu.c +++ b/sys/arm64/iommu/iommu.c @@ -501,6 +501,11 @@ iommu_find(device_t dev, bool verbose) return (NULL); } +void +iommu_unit_pre_instantiate_ctx(struct iommu_unit *unit) +{ +} + void iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, bool cansleep __unused) diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index 3d554249ba3f..bddb466547d1 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -278,11 +278,7 @@ iommu_get_dev_ctx(device_t dev) if (!unit->dma_enabled) return (NULL); -#if defined(__amd64__) || defined(__i386__) - dmar_quirks_pre_use(unit); - dmar_instantiate_rmrr_ctxs(unit); -#endif - + iommu_unit_pre_instantiate_ctx(unit); return (iommu_instantiate_ctx(unit, dev, false)); } diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index 157f4c62423f..9845b09e8732 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -158,6 +158,7 @@ void iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, void iommu_domain_unload(struct iommu_domain *domain, struct iommu_map_entries_tailq *entries, bool cansleep); +void iommu_unit_pre_instantiate_ctx(struct iommu_unit *iommu); struct iommu_ctx *iommu_instantiate_ctx(struct iommu_unit *iommu, device_t dev, bool rmrr); device_t iommu_get_requester(device_t dev, uint16_t *rid); diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 2439ef9e4ef5..05fb49538add 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -1310,8 +1310,16 @@ dmar_get_x86_common(struct iommu_unit *unit) return (&dmar->x86c); } +static void +dmar_unit_pre_instantiate_ctx(struct iommu_unit *unit) +{ + dmar_quirks_pre_use(unit); + dmar_instantiate_rmrr_ctxs(unit); +} + static struct x86_iommu dmar_x86_iommu = { .get_x86_common = dmar_get_x86_common, + .unit_pre_instantiate_ctx = dmar_unit_pre_instantiate_ctx, .domain_unload_entry = dmar_domain_unload_entry, .domain_unload = dmar_domain_unload, .get_ctx = dmar_get_ctx, diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 5d22c6584ab7..2c647fd21c67 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -278,6 +278,12 @@ iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) return (x86_iommu->unmap_ioapic_intr(ioapic_id, cookie)); } +void +iommu_unit_pre_instantiate_ctx(struct iommu_unit *unit) +{ + x86_iommu->unit_pre_instantiate_ctx(unit); +} + #define IOMMU2X86C(iommu) (x86_iommu->get_x86_common(iommu)) static bool diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index 210ce82c8f6d..a1ed5c71c513 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -64,6 +64,7 @@ struct x86_unit_common; struct x86_iommu { struct x86_unit_common *(*get_x86_common)(struct iommu_unit *iommu); + void (*unit_pre_instantiate_ctx)(struct iommu_unit *iommu); void (*qi_ensure)(struct iommu_unit *unit, int descr_count); void (*qi_emit_wait_descr)(struct iommu_unit *unit, uint32_t seq, bool, bool, bool); From nobody Wed Sep 4 21:50:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzblg1Y2Kz5VRrw; Wed, 04 Sep 2024 21:50: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 4Wzblf70p2z4hYB; Wed, 4 Sep 2024 21:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jzYVvrZL3q01UIj6LbHw5f1eEDLqo0MkyGk2kliMS9w=; b=FSjSFHuSHCwEBv5+IhElscy4NK183yhldcUaHZ8UwAo+QX/ydkYs5+h3EXGzn2JBecfgdn wWXL1XPOdG7yMk74PnfI09dylIRxaEWuFSkxoWd0xX/3aacgrDa5RJEfk8YeNqDq/fz/VM Mnh9uysMey3iAvsiiQogqLqM3M4/iYIwcJ09j5Rynf6wdw/GInaDON15odqI/2iwXRlEhE IRsNe8m4kkJO/gp4rGQTtErZAJQ6dzfh1cDY5sxAi3m9bSy6A5/xQC11eEiFLxIHMrM86v 1+CQF9in8MfCUIiMjHCZTrsdlHBmwbVMHuNnO5kYsyXgcHH61ywGMgrv6v9V+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486655; a=rsa-sha256; cv=none; b=jChl/gSKNHZ5avhYKOf7YBhLvQcdd6ILaACK568gk1kw94boVXrIm6D/bFm6y2Ghffg5GS bof21HwN2aVBZ3D8t++SqFhqSpkl/AuVSugl3QGY32M6oLt9ErH+JP+uN1feq3bDNtmDgR GOEfG8nvSSGXtzaM4fkd+SAl5P1NLVJi9pLm60pJRDzvgModQUxlFvT7PGi5oqVBoyEHQI PWZD+9I1vMzqNCqWKJ0hU30S6rpHRUfrYSTfiML1tbR2GKLL5BAjfT9jze8GkDhzrvCnhw y7nGYTCEQ/ob4pPI/gkDfP1vjnPwFTaASUgJ+UzX0w4O9sqwgGrZ5wQFDFf9sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jzYVvrZL3q01UIj6LbHw5f1eEDLqo0MkyGk2kliMS9w=; b=SBre3MkXUMJiU2i0OjGwXsIRTVTaTXFQ7vjFuVptDdchi/8ZlTROzlD4AeuzcGylorP1Wg SeHA1N6ZjiXqBSypBLYYZcia7e1TQ5EFIkeJkVhoKpGjiYBsie+CkHPb79aFICgTT6uLF/ Ktxgp/v2Pow/7H67rMoKrOZucn9mc6INYHHMVuABWQFcVRK+/Wt5wMNH3O9alYfKJLh1Ml zx8jutED3jiPoCmy2Qlf6AzTzHi4evWy+BO4Rz0wfxSWpnVBZpPCIjLxVswyJEwUXtw2va 9Ibl8gKX4sRhdNuESvw9gKL2Yj1KR1Pjq1nXaA4RN3a6/u6K6h5WY/fBS5/+ww== 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 4Wzblf6cd7zhL9; Wed, 4 Sep 2024 21:50: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 484Lossg033107; Wed, 4 Sep 2024 21:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LosDN033104; Wed, 4 Sep 2024 21:50:54 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:54 GMT Message-Id: <202409042150.484LosDN033104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 09fc33d1d75f - main - dmar: avoid excessive indirection in KASSERT() in domain_map_buf() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09fc33d1d75f93ed04fc6b18e7fe2911b7e770e0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=09fc33d1d75f93ed04fc6b18e7fe2911b7e770e0 commit 09fc33d1d75f93ed04fc6b18e7fe2911b7e770e0 Author: Konstantin Belousov AuthorDate: 2024-07-20 00:15:22 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 dmar: avoid excessive indirection in KASSERT() in domain_map_buf() Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_idpgtbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index 53851622340b..fbc0e9e97b64 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -478,7 +478,7 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, domain = IODOM2DOM(iodom); unit = domain->dmar; - KASSERT((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) == 0, + KASSERT((iodom->flags & IOMMU_DOMAIN_IDMAP) == 0, ("modifying idmap pagetable domain %p", domain)); KASSERT((base & IOMMU_PAGE_MASK) == 0, ("non-aligned base %p %jx %jx", domain, (uintmax_t)base, From nobody Wed Sep 4 21:50:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzblj3gwVz5VS33; Wed, 04 Sep 2024 21:50: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 4Wzblj23lxz4hZ1; Wed, 4 Sep 2024 21:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjU95wAT60uxAurfGdrh9JfntffLlxofRr2qJlAvaI4=; b=tC5YEBZ4uSRrWJCUUzX9rQqoUXKg7055RkDVNYENtd5hC7BC/z1VPnHShDyDjI78clm9Jv L9m8iuMpODkkibFB/9VntVyPAi/t4p0Atyt1l9GITNhLiAl0odFjKm6/aIWjYGQgH7t5XW OjqAwg57VeUBu/xkszYGA6AkNEQvTnTBUw2rWebLGq1W/4KkUF/Qbmqz6FgVkSRCdw49bU VfcSqsqsQTo0GOqEZzHgv7tCuCvyHgfZLG6Iixfj9QaXObYtyGAwyd1xjW+YBnESuqYEwT D2odMDyeSzhUol8qlpm8d/24k1uLQAKWsfrCmDeRGW5BDLjDLqdFwOXbFKx31A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486657; a=rsa-sha256; cv=none; b=MCmBiwmFfbBlrpMAY89XKMlKAdzZ/OsXpAh6nJlSQfl0YF2B5PRYg2ODffUuTJVvyEuY6T nhd8ErFcuRoa75kDAjEZDoXjxuP5kLif/JCvLgTtRX/SW3Ai/3Qb6t7lMX6enQ4l8DtF8I M/6qtanTFaZngXOJ98VAS1znilosebXTDOhxM9bnozgN8skOc7ZKax8EoUExPE8LfOa6GC 93ID16egTF5gv2BPa5t113PdMjlZQH4TZwd2Tn5jBgU6ftlkpbWB+sQ74YsRirDuT+jBjR tS4GxZZngwO6RmYVQaLkXIbytTkPbsKYDPIf1hcv0Ae0KClPCNmzQGbF9Uob1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjU95wAT60uxAurfGdrh9JfntffLlxofRr2qJlAvaI4=; b=nJOzdDp+H5lKyJFcVFD3y+dd/cNYMxRA6G92Xucueumar4ObnYOEOMjvK8hLeu4vLY50CS EUxo9PNMQhY6X6XAv/J25zHhxDbTbADx3UzE0ylzM4X3Wki5imBOkIUlOkim6Vma7Vf/q7 qSXwSSHsiEyKrBtRSwDuWuEfprY8GzqD+ND2yoQhGHNqBIe/YaRLIXmVLMFhKdHObnkcz4 oLIVmtQLinzPwTnN0MRP4h8yLm5HW/65HWuG7tL0w27Xruf/C/W/Zm0SyejEJZbN8CQaHW 0DFN2ZsE7O9EnTtIE8trFqF4lEJ3fMx/g4tlWnyZ29b/1NuIz8hZuiqzIOAu2w== 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 4Wzblj1VSgzhND; Wed, 4 Sep 2024 21:50: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 484LovtD033210; Wed, 4 Sep 2024 21:50:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LovNe033207; Wed, 4 Sep 2024 21:50:57 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:57 GMT Message-Id: <202409042150.484LovNe033207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e8fc8eb8b8f5 - main - msi_release(): consistently unlock msi_lock around iommu_unmap_msi_intr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8fc8eb8b8f55072379f65f5f058b81870031b7d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e8fc8eb8b8f55072379f65f5f058b81870031b7d commit e8fc8eb8b8f55072379f65f5f058b81870031b7d Author: Konstantin Belousov AuthorDate: 2024-08-27 02:28:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:20 +0000 msi_release(): consistently unlock msi_lock around iommu_unmap_msi_intr() Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/x86/msi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c index 177bd7868ec4..c8e7db9469ed 100644 --- a/sys/x86/x86/msi.c +++ b/sys/x86/x86/msi.c @@ -555,7 +555,9 @@ msi_release(int *irqs, int count) KASSERT(msi->msi_first == first, ("message not in group")); KASSERT(msi->msi_dev == first->msi_dev, ("owner mismatch")); #ifdef IOMMU + mtx_unlock(&msi_lock); iommu_unmap_msi_intr(first->msi_dev, msi->msi_remap_cookie); + mtx_lock(&msi_lock); #endif msi->msi_first = NULL; msi->msi_dev = NULL; From nobody Wed Sep 4 21:50:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzblh41yhz5VS5L; Wed, 04 Sep 2024 21:50: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 4Wzblh1KxNz4hH4; Wed, 4 Sep 2024 21:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jU4UkNvf6WD1I9tKBSQ2HatqkU4nc2C3pFwI8QyDli8=; b=Cw3s9zuQEih7tJ87mUe0iG2gtYizQeYVTmO/IDMpQ/UiqgGj5DU/ckEg1lws5F6qX7UR0v 9lXvmSih03gULQw+/v5Qr3sFt4d7v+HIMmqLaoWSFkApuzs3M8KkN53I3OjiHnU/qnwlZ8 16cFdW7gPIGPe+xNPWMu62WSuNwlIBmRTdP2MPesxbV/bJSinwBE1D9cnaPPaDvA2TauXn zx4Q0EdRfeaBNHQ2sVQhwB9hLTC5zhVDk+MWhGkYmrByFUtpO3HeR0SrSFLZ6LKDG7hJgL pgspCuyTKlp9rlJNLETMpCQw+yPjWJMx1rdIYc+WaeQmxFol4djtST8nU5UYJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486656; a=rsa-sha256; cv=none; b=Cb2ViJwhIbahT8/4Yfir8/ha6RQ0Hrr6l1zfpRkkgHIstt8lq/sFfr/wBHurlcMMYcPHbO Yy//6AczdWr3FjZT60FLDWSNMLdmlw4n1yLhHESlR1S5fsd8jp11R+q/UcSlZ92/FYt1MP qhfmMIreo6+mP4QvJ8/ww0RhY7QTGlk7ljpV1BlhZI1TI0Tib/7lfe0k5LpAup7S8L0vMw MEbzC0K8lYqFtRWs5XKt9j+TzXhG8SsUdS3/eRMB1MpY7u37rnjoCElFhCl/yTV7e36soE feJyyukdLFjkGWUA1mEQiq21doaj+eViyhhTH6wLjpOciA5ZyUA0SZ8Jr2MD4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jU4UkNvf6WD1I9tKBSQ2HatqkU4nc2C3pFwI8QyDli8=; b=hMfKLGu1wrDuwZgUGNE5eEwwSwSrrhdqGl7Bg2B3hSRvLFuR02Ww07i94MIyeju1zCGvAW OQgmowhxXoVnrS1evxtS90ahCFFF/ZkTDRfrcStZrnIEZYgFKH4yDlVBt3mv9bHG5wdCET yyqc0zXpYNQgkh4LV76ue7a/S+XEfXKB0qVLDYhphgl3pqsQaMNOkDXuM5XWAYdnF92xEw 1Maub1L1t15nfFwZtGDrvkmHJvt0sKHAIHjtCtTy2zvWUL2VmUeCrpN7w/7h7i2bvdGqh1 5M7sz/5P657H+ODVYwg7i5ImuOlLSaZoUWLl+sV/jZrN0c1HeBFWwlQKxz44ng== 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 4Wzblh0lTTzhbt; Wed, 4 Sep 2024 21:50: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 484Lot4m033160; Wed, 4 Sep 2024 21:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LotVO033157; Wed, 4 Sep 2024 21:50:55 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:50:55 GMT Message-Id: <202409042150.484LotVO033157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5681ddfd9f80 - main - msi_alloc(): do not leak msi_lock in error case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5681ddfd9f80c3aa25f900a1bcaa69b36a4e9e27 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5681ddfd9f80c3aa25f900a1bcaa69b36a4e9e27 commit 5681ddfd9f80c3aa25f900a1bcaa69b36a4e9e27 Author: Konstantin Belousov AuthorDate: 2024-08-27 02:28:10 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:50:19 +0000 msi_alloc(): do not leak msi_lock in error case Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/x86/msi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c index 888635cba3f4..177bd7868ec4 100644 --- a/sys/x86/x86/msi.c +++ b/sys/x86/x86/msi.c @@ -480,6 +480,7 @@ again: if (error != 0) { for (i = 0; i < count; i++) apic_free_vector(cpu, vector + i, irqs[i]); + mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (error); } From nobody Wed Sep 4 21:54:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzbqh364bz5VS8v; Wed, 04 Sep 2024 21:54: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 4Wzbqh2cK0z4pJT; Wed, 4 Sep 2024 21:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oczVATngUMO4KVIOIiW4nFO6ayKwi9TTeKTuld8IVWs=; b=don3lI+w+O59ibQ/jgBjs6b1HJifyS8iaQeZHg7R0syq33MNmwy82ODF8OdmL5BlTDZYvm oe45I0aXs1Q21A/Xg0d2+5Erj1ItQ7M9AkSsxGICpWsgJYA8S3xlm7ZLVtUBZ0d846RslT 1d2pKHMgm7FrpCe3CKkGO9zRpvf8titjZBlIy+QE6eUQD2zDznUAGQevwfU+0t4W0b60qH ZJkw6jRNRoft3EN4N5E3yQq2pSwwrKleB/VCOs8iqZzkVmTQ5BzUzyPBgaadQoApV27BAC twrnaivoQEEDQf3H6cOHnUfF3Vojs8BASS+S3mdBnTEwZwSjTWQ2bjXcs6WYzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725486864; a=rsa-sha256; cv=none; b=JS14lqPSyIz3f0uPZF2dYl+FWO5A+BNtGubr6kEj/KvW73t4rSaC34rsvV5FR2P/jydoDZ 1FfmCc2asgVPBga3oVF4z4uzXpfOD40RweeELYPvvao2b8Yv++VH3MWbxD3Inm538UimsT hQeHpw3BO2bqut3w0IFZVZp7/WjaFR5wV0DJ9oypH2l8YZ79/HjG0pEFI3PuVc+MCQMYNV xop93vN3ag3LtCsyrmgs8j3/UziH068N21X1xlPJjCRAwMrOadUCTayPkYSFieH4TJaIeo ZGUjP2AHKfBFQpQ9j6XQpP5zdMRSueThzirXa1fVWuk5oZo1072MyYQSV754+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725486864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oczVATngUMO4KVIOIiW4nFO6ayKwi9TTeKTuld8IVWs=; b=s1fe2rpqqNXxFxTxfPnsGlxG1feWAXvLzlPx4XWkvtyCnLwpV3ZNCKvQzyD3flUM2X9mOK w2RSS/+n16Fz32jF79Opkl44DKbuzTvSGD+flFyhX3NlhtmgWXJ7YD8AgTfzbAq+l51Poq cNeQfUSqKU221TXk7/k1ZrDba7GKWHkX9cMoEQXnEylX/HAdwSAg5ibP06Hb6OeqPI2Tf5 DtOUWzXneGGhv9rYeNRZniPOXK6wq6p3epEj7pDSUHzyVXx1VoR6qB8QVbHujZOe26cm+P Hzqrr0lW2nNdAMyD5VyeHNEfqaKFpqi2f0fNEaAEbBBgxaS7ZUrIEWTLkUC4jA== 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 4Wzbqh2C8nzj0r; Wed, 4 Sep 2024 21:54: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 484LsO4N039179; Wed, 4 Sep 2024 21:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LsO6t039176; Wed, 4 Sep 2024 21:54:24 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:54:24 GMT Message-Id: <202409042154.484LsO6t039176@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: 1d75ce83560a - releng/13.4 - loader.efi.8: Remove rogue duplicated lines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 1d75ce83560a17b7286aff3d0ac220c0799ca2ac Auto-Submitted: auto-generated The branch releng/13.4 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1d75ce83560a17b7286aff3d0ac220c0799ca2ac commit 1d75ce83560a17b7286aff3d0ac220c0799ca2ac Author: Jessica Clarke AuthorDate: 2024-09-03 20:14:44 +0000 Commit: Warner Losh CommitDate: 2024-09-04 21:54:04 +0000 loader.efi.8: Remove rogue duplicated lines Fixes: 871911a4ab73 ("loader.efi(8): beef up the updating the ESP") MFC after: 1 week (cherry picked from commit 18f7683e0d6ee6858865d8b0c2d7e2c14abf0bc4) (cherry picked from commit 8aa8d0aa64babc579a55a7ed27ea6385895901d3) Approved-by: re (cperciva) --- stand/man/loader.efi.8 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 4dd9f66790f8..2128cc99c2a5 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 20, 2024 +.Dd September 3, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -440,9 +440,6 @@ copy the loader to the default location: # cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI .Ed .Pp -.Bd -literal -offset indent -# umount /boot/efi -.Ed Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent # umount /boot/efi From nobody Wed Sep 4 21:59:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzbxM4CKVz5VSln; Wed, 04 Sep 2024 21:59: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 4WzbxM3VNJz4pkY; Wed, 4 Sep 2024 21:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725487159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QO8iWm7DFK5IvXdnZ/qJhhI2fC27XWL+N454fN2lGt8=; b=QPOySiOlplODyVnsX6sQClpdkh1JAGXjVb6o3SUCuoNFLm9HLhGb/Hi6FL26JgGRxnDYgx agJARcFgL7ymT8irUB9sod2JyWHKSrSVGCw9VyWKL1oM/mxZRRtAYlpG9INWyTvscCAI5D psmJDle5TBZ/N25j1WQgUBttrdLoCYc6xZLWVXevF44uw4wA2ZUIoEB5F3t8V87jPHa1PH 6FLZZKHYID0ZsBmajP5mgv/U/dgdpcULhHBSSf+oJdMYVB6K+IOdy9H9FCRYrMpH7OsDmT Cuix6Q8kbTpcNkbPsyD9e6aRGdSzqoVuejNwtdJMw7JYDcgMtOjUWGaZapQ92g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725487159; a=rsa-sha256; cv=none; b=PlY1ctVQJo3grkfNQyXRH+y9sxWBM6rxSfZOehtTR9WJk29RNHdYwt2EExPKy90mXlARDx jOg5R7Mto5jwl0lq4vyPVyKf22NPiyXmCLoom7cmQa+DWcQZ7Qig3Kc1s4X0PZfnZbVsmI +KobvppfT9MOUCs9abE6gLdSG9uSZ2D9TUCZIm+7JxD+xs6v73rCoK37souYFm8D4rtA3J ywnP+sXpRH/k+j43kklCco90cSusd5TZT4p1/FmcCjg2vX4L7uii4Is8q2Flqn2xpoqzhr P2IHaC4DKWTz4UucCrtz4qM2/c+ADWxKC97x/sEAKjOuMgDatLa9g5lluyuj7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725487159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QO8iWm7DFK5IvXdnZ/qJhhI2fC27XWL+N454fN2lGt8=; b=n8WLhdy/fFOYA/3y1efrvuCusEHgM/+VCKEupW+p9OfmvPp+YqlAUPcl8LeuCju+awy05C R77g7HxoKIuAQbP0u+xVdAxMHZBZDZj93yDUZEV9zPdInAWIjLaRNHC/yhZqOUq8jsUhKR itdLoaUDg0rXU01MF6w/SOvtMQdVxsCmm9PvHnB5hWR/8nTftlUhoSRp7g2vNrna/zzyU8 llXBJ5QpZQRSvIVSfn7AYb2b5LfdCVsWxyqpmwHYIhKo3GwbhXrfHO7P6SR6W1S3P149Cs kDKf1SArEQhx6+TF9qHlCuW5YARn+eySCdEJb1uG0xb71D5upYQBoX90m4S7iA== 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 4WzbxM2z86zhYy; Wed, 4 Sep 2024 21:59:19 +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 484LxJ5X039972; Wed, 4 Sep 2024 21:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LxJrf039969; Wed, 4 Sep 2024 21:59:19 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:59:19 GMT Message-Id: <202409042159.484LxJrf039969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e28ee29d2d13 - main - vfs_default.c: trim whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e28ee29d2d13dc24cd3d5e19fa1fe6bef0085d41 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e28ee29d2d13dc24cd3d5e19fa1fe6bef0085d41 commit e28ee29d2d13dc24cd3d5e19fa1fe6bef0085d41 Author: Konstantin Belousov AuthorDate: 2024-09-03 03:42:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-04 21:58:51 +0000 vfs_default.c: trim whitespace Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/vfs_default.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 1393f2fce9f3..d612642a6bc9 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -113,10 +113,10 @@ struct vop_vector default_vnodeops = { .vop_fsync = VOP_NULL, .vop_stat = vop_stdstat, .vop_fdatasync = vop_stdfdatasync, - .vop_getlowvnode = vop_stdgetlowvnode, + .vop_getlowvnode = vop_stdgetlowvnode, .vop_getpages = vop_stdgetpages, .vop_getpages_async = vop_stdgetpages_async, - .vop_getwritemount = vop_stdgetwritemount, + .vop_getwritemount = vop_stdgetwritemount, .vop_inactive = VOP_NULL, .vop_need_inactive = vop_stdneed_inactive, .vop_ioctl = vop_stdioctl, @@ -1087,7 +1087,7 @@ vop_stdadvise(struct vop_advise_args *ap) /* * Round to block boundaries (and later possibly further to - * page boundaries). Applications cannot reasonably be aware + * page boundaries). Applications cannot reasonably be aware * of the boundaries, and the rounding must be to expand at * both extremities to cover enough. It still doesn't cover * read-ahead. For partial blocks, this gives unnecessary From nobody Wed Sep 4 23:48:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzfMF6y4vz5Vvhv; Wed, 04 Sep 2024 23:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzfMF1zrGz4T4L; Wed, 4 Sep 2024 23:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725493705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CtxQQgOfGUOckMkgBRa7flsvI1/hJYByMw7OY4McECo=; b=EQ8XsU9SDK8aLk1l8SZp1DeqRV5r2+6nFUKhivitapXGxK0ppNLXiquMDawJZnZf9m6+y5 /PGlXjVFym0LJetGHTeQ7b5a+2zpa4UwLfcAHQ5gDYoitIkNFoNvmWpsCQz9VmEFKIJBE6 Rt5VeI2bdnwWgyzEuUyzz0QRY4lz+pQxjbbj3RRAWKOrd+ITOc643T+I03TI3Ra1rRW482 XnMdt1pl+mHhVN3fG9cl6UvOV9etHJuAc4t+As6slGAnPY3TsZNhaIEUMWpNVcvdbwEA6q X1c4DNNgHkhWTzD6Bwz75wXOMMpl6niz6fJMtXgZV1SriCFPemT/JOs3gSoIQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725493705; a=rsa-sha256; cv=none; b=PlsQtp76TcoVeoODqk/1gbHQHCB1na6+t7OSU+D1X8yzH3eEiTHIHB2E7TnQ+99BTqL30v KHcDg+wFh4Z2K2+W8Dm9cGNO3E1iXO90tH26aFLhZACLrxr2tSY+uHAeUPOcJ62UWtCeJy q4FMSFir1K5VtZwCMo6pfR+VVgVSMvgm/8J+1ij0pcI/yuxyjBOO4Y9u+SgqkQyu6O2tLI Gwf9CWFZjgD4RdLclZkgd7PQTXvuJMlxP7ZkBNjP229jlfMJCvw2NtrciJFmp0Aglg6UEy fIBVvWDYvK9a3qqqAl/XPcvGWOZvYLPNcTqzo1ny16tAikWYISC55cQBUVjkHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725493705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CtxQQgOfGUOckMkgBRa7flsvI1/hJYByMw7OY4McECo=; b=XeJaKAHQF8MAbHbB2UduPm5a5gjX0wH/F0+PG8aKp50Fv+Xac4kv8M7LnDAExzCouBzPZf HPT12yxPIaYOwVcQRoJb2vXDsvyVxJjSHYYCllHmmRt0h+lzhIWgR6k5h24PU0tZyln8MH GbFKtCkxrD0pSjcjwvvBHmhsJLQJqA89Q2Dw5iTUrnrlpEvYFlTa22zy0Tu3QEGyXLnp2V ETzlwLVn28pw9GFvgkQeq//fUvpogLUnKupkpzxod/EnoXYwa+tsz8N9aUTYKX3RLFZtmW a4OP/sm0//UpIKh+c5tH19s4/MsvYrIxyEu0V/oW7cnn3EdxAX9lGS1Mp2+Lhg== 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 4WzfMF1JwXzlff; Wed, 4 Sep 2024 23:48: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 484NmPgC025913; Wed, 4 Sep 2024 23:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484NmPA7025910; Wed, 4 Sep 2024 23:48:25 GMT (envelope-from git) Date: Wed, 4 Sep 2024 23:48:25 GMT Message-Id: <202409042348.484NmPA7025910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 66fc442421f8 - main - vmm: Remove an incorrect credential check in vmmdev_open() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66fc442421f868b01bee4e299d7e3a4c4df37d21 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=66fc442421f868b01bee4e299d7e3a4c4df37d21 commit 66fc442421f868b01bee4e299d7e3a4c4df37d21 Author: Mark Johnston AuthorDate: 2024-09-04 20:05:33 +0000 Commit: Mark Johnston CommitDate: 2024-09-04 22:54:25 +0000 vmm: Remove an incorrect credential check in vmmdev_open() Checking pointer equality here is too strict and can lead to incorrect errors, as credentials are frequently copied to avoid reference counting overhead. The check is new with commit 4008758105a6 and was added with the goal of allowing non-root users to create VMs in mind. Just remove it for now. Reported by: Alonso Cárdenas Márquez Reviewed by: jhb Fixes: 4008758105a6 ("vmm: Validate credentials when opening a vmmdev") Differential Revision: https://reviews.freebsd.org/D46535 --- sys/dev/vmm/vmm_dev.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index ea2aaace832c..353b58dd8a2c 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -331,12 +331,6 @@ vmmdev_open(struct cdev *dev, int flags, int fmt, struct thread *td) sc = vmmdev_lookup2(dev); KASSERT(sc != NULL, ("%s: device not found", __func__)); - /* - * A user can only access VMs that they themselves have created. - */ - if (td->td_ucred != sc->ucred) - return (EPERM); - /* * A jail without vmm access shouldn't be able to access vmm device * files at all, but check here just to be thorough. From nobody Wed Sep 4 23:52:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzfRW3V3Cz5VwfM; Wed, 04 Sep 2024 23:52:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzfRW0ChDz4bS7; Wed, 4 Sep 2024 23:52:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id lqO4sRl1n9TOUlznCscCV0; Wed, 04 Sep 2024 23:52:06 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id lznAsOGII2M9qlznBs1Tqz; Wed, 04 Sep 2024 23:52:06 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=66d8f2a6 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=0_lmrure0TmMD5iX:21 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=L5vLIMzQ0kdiWkzAmtAA:9 a=CjuIK1q_8ugA:10 a=RVmHIydaz68A:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 483D4CC; Wed, 04 Sep 2024 16:52:04 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 1FCD9C5; Wed, 04 Sep 2024 16:52:04 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU In-reply-to: <202409042150.484LoeAq031493@gitrepo.freebsd.org> References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> Comments: In-reply-to Konstantin Belousov message dated "Wed, 04 Sep 2024 21:50:40 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Sep 2024 16:52:04 -0700 Message-Id: <20240904235204.1FCD9C5@slippy.cwsent.com> X-CMAE-Envelope: MS4xfLid89UMQwnY/zRAXa3Od2w2/bZd0pDcYdTLJp4aroWC/gWmRDIIpU92nffrNu4ajKYLvbUkmMoAapVYhp3Sp5DUwyo5+EGVHIEOtFckVuFxNdfLFRVe ktjExF4OktgA18R1bkBewf3j/rB4rmN7mavapOUX3j0vWn/sxBeSfmIN1hD/aqV3EHOwna2N+VF+kI9vgBKvtxL9nyH3sJnhCRm1OTAKZkhsmnvnBnVFvb+E LoY4ZVeFwHM74gZ8dLu/O44uMRER9WoNsNiMNmE11lKdDhxPi6zL0Dwtgz0SU8NS9NTrLkne5OpYgMb1ANLgtwJj3Y4DgLxGoFtPTasD/OY= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4WzfRW0ChDz4bS7 In message <202409042150.484LoeAq031493@gitrepo.freebsd.org>, Konstantin Belous ov writes: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=65b133e5d292686fe20f11dd39b53812 > 226a8684 > > commit 65b133e5d292686fe20f11dd39b53812226a8684 > Author: Konstantin Belousov > AuthorDate: 2024-05-29 14:38:14 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-09-04 21:50:18 +0000 > > x86: allow to have more than one kind of IOMMU > > Sponsored by: Advanced Micro Devices (AMD) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > --- > sys/x86/iommu/intel_ctx.c | 22 +++++------ > sys/x86/iommu/intel_dmar.h | 18 ++++++++- > sys/x86/iommu/intel_drv.c | 30 ++++++++++++-- > sys/x86/iommu/intel_intrmap.c | 10 ++--- > sys/x86/iommu/iommu_utils.c | 91 +++++++++++++++++++++++++++++++++++++++++ > +- > sys/x86/iommu/x86_iommu.h | 25 +++++++++++- > 6 files changed, 173 insertions(+), 23 deletions(-) > > diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c > index baee0109e5a9..a3ff35dc527e 100644 > --- a/sys/x86/iommu/intel_ctx.c > +++ b/sys/x86/iommu/intel_ctx.c > @@ -75,6 +75,9 @@ static void dmar_unref_domain_locked(struct dmar_unit *dmar > , > struct dmar_domain *domain); > static void dmar_domain_destroy(struct dmar_domain *domain); > > +static void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ct > x); > +static void dmar_free_ctx(struct dmar_ctx *ctx); > + > static void > dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus) > { > @@ -745,7 +748,7 @@ dmar_unref_domain_locked(struct dmar_unit *dmar, struct d > mar_domain *domain) > dmar_domain_destroy(domain); > } > > -void > +static void > dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx) > { > struct sf_buf *sf; > @@ -819,7 +822,7 @@ dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ > ctx *ctx) > TD_PINNED_ASSERT; > } > > -void > +static void > dmar_free_ctx(struct dmar_ctx *ctx) > { > struct dmar_unit *dmar; > @@ -867,7 +870,7 @@ dmar_domain_free_entry(struct iommu_map_entry *entry, boo > l free) > * the entry's dmamap_link field. > */ > void > -iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, > +dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, > bool cansleep) > { > struct dmar_domain *domain; > @@ -909,7 +912,7 @@ dmar_domain_unload_emit_wait(struct dmar_domain *domain, > } > > void > -iommu_domain_unload(struct iommu_domain *iodom, > +dmar_domain_unload(struct iommu_domain *iodom, > struct iommu_map_entries_tailq *entries, bool cansleep) > { > struct dmar_domain *domain; > @@ -947,37 +950,34 @@ iommu_domain_unload(struct iommu_domain *iodom, > } > > struct iommu_ctx * > -iommu_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, > +dmar_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, > bool id_mapped, bool rmrr_init) > { > struct dmar_unit *dmar; > struct dmar_ctx *ret; > > dmar = IOMMU2DMAR(iommu); > - > ret = dmar_get_ctx_for_dev(dmar, dev, rid, id_mapped, rmrr_init); > - > return (CTX2IOCTX(ret)); > } > > void > -iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *context) > +dmar_free_ctx_locked_method(struct iommu_unit *iommu, > + struct iommu_ctx *context) > { > struct dmar_unit *dmar; > struct dmar_ctx *ctx; > > dmar = IOMMU2DMAR(iommu); > ctx = IOCTX2CTX(context); > - > dmar_free_ctx_locked(dmar, ctx); > } > > void > -iommu_free_ctx(struct iommu_ctx *context) > +dmar_free_ctx_method(struct iommu_ctx *context) > { > struct dmar_ctx *ctx; > > ctx = IOCTX2CTX(context); > - > dmar_free_ctx(ctx); > } > diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h > index 4ae005238074..0ede955e12b9 100644 > --- a/sys/x86/iommu/intel_dmar.h > +++ b/sys/x86/iommu/intel_dmar.h > @@ -293,10 +293,17 @@ struct dmar_ctx *dmar_get_ctx_for_devpath(struct dmar_u > nit *dmar, uint16_t rid, > int dev_domain, int dev_busno, const void *dev_path, int dev_path_len, > bool id_mapped, bool rmrr_init); > int dmar_move_ctx_to_domain(struct dmar_domain *domain, struct dmar_ctx *ctx > ); > -void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); > -void dmar_free_ctx(struct dmar_ctx *ctx); > +void dmar_free_ctx_locked_method(struct iommu_unit *dmar, > + struct iommu_ctx *ctx); > +void dmar_free_ctx_method(struct iommu_ctx *ctx); > struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); > +struct iommu_ctx *dmar_get_ctx(struct iommu_unit *iommu, device_t dev, > + uint16_t rid, bool id_mapped, bool rmrr_init); > void dmar_domain_free_entry(struct iommu_map_entry *entry, bool free); > +void dmar_domain_unload_entry(struct iommu_map_entry *entry, bool free, > + bool cansleep); > +void dmar_domain_unload(struct iommu_domain *iodom, > + struct iommu_map_entries_tailq *entries, bool cansleep); > > void dmar_dev_parse_rmrr(struct dmar_domain *domain, int dev_domain, > int dev_busno, const void *dev_path, int dev_path_len, > @@ -308,6 +315,13 @@ void dmar_quirks_pre_use(struct iommu_unit *dmar); > > int dmar_init_irt(struct dmar_unit *unit); > void dmar_fini_irt(struct dmar_unit *unit); > +int dmar_alloc_msi_intr(device_t src, u_int *cookies, u_int count); > +int dmar_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, > + uint64_t *addr, uint32_t *data); > +int dmar_unmap_msi_intr(device_t src, u_int cookie); > +int dmar_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge > , > + bool activehi, int irq, u_int *cookie, uint32_t *hi, uint32_t *lo); > +int dmar_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie); > > extern int haw; > extern int dmar_batch_coalesce; > diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c > index 636534173715..79350358cced 100644 > --- a/sys/x86/iommu/intel_drv.c > +++ b/sys/x86/iommu/intel_drv.c > @@ -64,6 +64,8 @@ > #include > #include > #include > +#include > +#include > #include > #include > #include > @@ -1357,12 +1359,34 @@ DB_SHOW_ALL_COMMAND(dmars, db_show_all_dmars) > } > #endif > > -struct iommu_unit * > -iommu_find(device_t dev, bool verbose) > +static struct iommu_unit * > +dmar_find_method(device_t dev, bool verbose) > { > struct dmar_unit *dmar; > > dmar = dmar_find(dev, verbose); > - > return (&dmar->iommu); > } > + > +static struct x86_iommu dmar_x86_iommu = { > + .domain_unload_entry = dmar_domain_unload_entry, > + .domain_unload = dmar_domain_unload, > + .get_ctx = dmar_get_ctx, > + .free_ctx_locked = dmar_free_ctx_locked_method, > + .free_ctx = dmar_free_ctx_method, > + .find = dmar_find_method, > + .alloc_msi_intr = dmar_alloc_msi_intr, > + .map_msi_intr = dmar_map_msi_intr, > + .unmap_msi_intr = dmar_unmap_msi_intr, > + .map_ioapic_intr = dmar_map_ioapic_intr, > + .unmap_ioapic_intr = dmar_unmap_ioapic_intr, > +}; > + > +static void > +x86_iommu_set_intel(void *arg __unused) > +{ > + if (cpu_vendor_id == CPU_VENDOR_INTEL) > + set_x86_iommu(&dmar_x86_iommu); > +} > + > +SYSINIT(x86_iommu, SI_SUB_TUNABLES, SI_ORDER_ANY, x86_iommu_set_intel, NULL) > ; > diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c > index 22fd51bc8be9..a6979a9d2501 100644 > --- a/sys/x86/iommu/intel_intrmap.c > +++ b/sys/x86/iommu/intel_intrmap.c > @@ -65,7 +65,7 @@ static void dmar_ir_program_irte(struct dmar_unit *unit, u_ > int idx, > static int dmar_ir_free_irte(struct dmar_unit *unit, u_int cookie); > > int > -iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > +dmar_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > { > struct dmar_unit *unit; > vmem_addr_t vmem_res; > @@ -93,7 +93,7 @@ iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int co > unt) > } > > int > -iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, > +dmar_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, > uint64_t *addr, uint32_t *data) > { > struct dmar_unit *unit; > @@ -139,7 +139,7 @@ iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, > u_int cookie, > } > > int > -iommu_unmap_msi_intr(device_t src, u_int cookie) > +dmar_unmap_msi_intr(device_t src, u_int cookie) > { > struct dmar_unit *unit; > > @@ -150,7 +150,7 @@ iommu_unmap_msi_intr(device_t src, u_int cookie) > } > > int > -iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, > +dmar_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, > bool activehi, int irq, u_int *cookie, uint32_t *hi, uint32_t *lo) > { > struct dmar_unit *unit; > @@ -213,7 +213,7 @@ iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int v > ector, bool edge, > } > > int > -iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > +dmar_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > { > struct dmar_unit *unit; > u_int idx; > diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c > index ffea1cc1a190..ea2c0358e072 100644 > --- a/sys/x86/iommu/iommu_utils.c > +++ b/sys/x86/iommu/iommu_utils.c > @@ -1,7 +1,7 @@ > /*- > * SPDX-License-Identifier: BSD-2-Clause > * > - * Copyright (c) 2013, 2014 The FreeBSD Foundation > + * Copyright (c) 2013, 2014, 2024 The FreeBSD Foundation > * > * This software was developed by Konstantin Belousov > * under sponsorship from the FreeBSD Foundation. > @@ -50,6 +50,7 @@ > #include > #include > #include > +#include > > vm_page_t > iommu_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags) > @@ -162,3 +163,91 @@ SYSCTL_NODE(_hw_iommu, OID_AUTO, dmar, CTLFLAG_RD | CTLF > LAG_MPSAFE, > SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, > &iommu_tbl_pagecnt, 0, > "Count of pages used for DMAR pagetables"); > + > +static struct x86_iommu *x86_iommu; > + > +void > +set_x86_iommu(struct x86_iommu *x) > +{ > + MPASS(x86_iommu == NULL); > + x86_iommu = x; > +} > + > +struct x86_iommu * > +get_x86_iommu(void) > +{ > + return (x86_iommu); > +} > + > +void > +iommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, > + bool cansleep) > +{ > + x86_iommu->domain_unload_entry(entry, free, cansleep); > +} > + > +void > +iommu_domain_unload(struct iommu_domain *iodom, > + struct iommu_map_entries_tailq *entries, bool cansleep) > +{ > + x86_iommu->domain_unload(iodom, entries, cansleep); > +} > + > +struct iommu_ctx * > +iommu_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, > + bool id_mapped, bool rmrr_init) > +{ > + return (x86_iommu->get_ctx(iommu, dev, rid, id_mapped, rmrr_init)); > +} > + > +void > +iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *context) > +{ > + x86_iommu->free_ctx_locked(iommu, context); > +} > + > +void > +iommu_free_ctx(struct iommu_ctx *context) > +{ > + x86_iommu->free_ctx(context); > +} > + > +struct iommu_unit * > +iommu_find(device_t dev, bool verbose) > +{ > + return (x86_iommu->find(dev, verbose)); > +} > + > +int > +iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > +{ > + return (x86_iommu->alloc_msi_intr(src, cookies, count)); > +} > + > +int > +iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, u_int cookie, > + uint64_t *addr, uint32_t *data) > +{ > + return (x86_iommu->map_msi_intr(src, cpu, vector, cookie, > + addr, data)); > +} > + > +int > +iommu_unmap_msi_intr(device_t src, u_int cookie) > +{ > + return (x86_iommu->unmap_msi_intr(src, cookie)); > +} > + > +int > +iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, > + bool activehi, int irq, u_int *cookie, uint32_t *hi, uint32_t *lo) > +{ > + return (x86_iommu->map_ioapic_intr(ioapic_id, cpu, vector, edge, > + activehi, irq, cookie, hi, lo)); > +} > + > +int > +iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > +{ > + return (x86_iommu->unmap_ioapic_intr(ioapic_id, cookie)); > +} > diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h > index 3789586f1eaf..8c908964acd0 100644 > --- a/sys/x86/iommu/x86_iommu.h > +++ b/sys/x86/iommu/x86_iommu.h > @@ -1,7 +1,7 @@ > /*- > * SPDX-License-Identifier: BSD-2-Clause > * > - * Copyright (c) 2013-2015 The FreeBSD Foundation > + * Copyright (c) 2013-2015, 2024 The FreeBSD Foundation > * > * This software was developed by Konstantin Belousov > * under sponsorship from the FreeBSD Foundation. > @@ -59,4 +59,27 @@ extern int iommu_tbl_pagecnt; > SYSCTL_DECL(_hw_iommu); > SYSCTL_DECL(_hw_iommu_dmar); > > +struct x86_iommu { > + void (*domain_unload_entry)(struct iommu_map_entry *entry, bool free, > + bool cansleep); > + void (*domain_unload)(struct iommu_domain *iodom, > + struct iommu_map_entries_tailq *entries, bool cansleep); > + struct iommu_ctx *(*get_ctx)(struct iommu_unit *iommu, > + device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init); > + void (*free_ctx_locked)(struct iommu_unit *iommu, > + struct iommu_ctx *context); > + void (*free_ctx)(struct iommu_ctx *context); > + struct iommu_unit *(*find)(device_t dev, bool verbose); > + int (*alloc_msi_intr)(device_t src, u_int *cookies, u_int count); > + int (*map_msi_intr)(device_t src, u_int cpu, u_int vector, > + u_int cookie, uint64_t *addr, uint32_t *data); > + int (*unmap_msi_intr)(device_t src, u_int cookie); > + int (*map_ioapic_intr)(u_int ioapic_id, u_int cpu, u_int vector, > + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, > + uint32_t *lo); > + int (*unmap_ioapic_intr)(u_int ioapic_id, u_int *cookie); > +}; > +void set_x86_iommu(struct x86_iommu *); > +struct x86_iommu *get_x86_iommu(void); > + > #endif > I suspect this commit but could be one of the others that caused this panic during intialization. From a serial console log: Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel] in 10 seconds... ^MBooting [/boot/kernel/kernel] in 9 seconds... ^MBooting [/boot/kernel/kernel]... ^M \^HGDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb ---<>--- Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #60 komquats-n272059-e28ee29d2d13: Wed Sep 4 15:07:36 PDT 2024 root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) VT(vga): text 80x25 CPU: AMD Processor model unknown (3000.06-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x37ff SVM: NP,NRIP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 8145883136 (7768 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (20230628/tbfadt-748) Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using default 32 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using default 16 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using default 32 (20230628/tbfadt-850) ioapic0: MADT APIC ID 4 != hw id 0 kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x78 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80a2c48b stack pointer = 0x28:0xffffffff81f05e90 frame pointer = 0x28:0xffffffff81f05e90 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = resume, IOPL = 0 current process = 0 (swapper) rdi: 0000000000000004 rsi: 0000000000000000 rdx: 0000000000000000 rcx: 0000000000000001 r8: 0000000000000001 r9: 00000000ffffffff rax: 0000000000000000 rbx: fffff800fec00000 rbp: ffffffff81f05e90 r10: 0000000000000000 r11: 00000000fff5cfdf r12: 0000000000000010 r13: fffff800033aa8ec r14: fffff800033aa8e4 r15: 0000000000000000 trap number = 12 panic: page fault cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f05b80 vpanic() at vpanic+0x13f/frame 0xffffffff81f05cb0 panic() at panic+0x43/frame 0xffffffff81f05d10 trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f05d70 trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f05dc0 calltrap() at calltrap+0x8/frame 0xffffffff81f05dc0 --- trap 0xc, rip = 0xffffffff80a2c48b, rsp = 0xffffffff81f05e90, rbp = 0xffffffff81f05e90 --- iommu_map_ioapic_intr() at iommu_map_ioapic_intr+0xb/frame 0xffffffff81f05e90 ioapic_create() at ioapic_create+0x460/frame 0xffffffff81f05f20 madt_parse_apics() at madt_parse_apics+0x51/frame 0xffffffff81f05f40 acpi_walk_subtables() at acpi_walk_subtables+0x31/frame 0xffffffff81f05f70 madt_setup_io() at madt_setup_io+0x62/frame 0xffffffff81f05f90 apic_setup_io() at apic_setup_io+0x24/frame 0xffffffff81f05fa0 mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f05ff0 Uptime: 1s Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. Rebooting... -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Sep 5 00:37:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzgSS0zkjz5W7CZ; Thu, 05 Sep 2024 00:38:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzgSR5sRfz4LnQ; Thu, 5 Sep 2024 00:37:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 4850bnSj032440; Thu, 5 Sep 2024 03:37:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 4850bnSj032440 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 4850bnTr032439; Thu, 5 Sep 2024 03:37:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Sep 2024 03:37:49 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU Message-ID: References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> <20240904235204.1FCD9C5@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240904235204.1FCD9C5@slippy.cwsent.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4WzgSR5sRfz4LnQ On Wed, Sep 04, 2024 at 04:52:04PM -0700, Cy Schubert wrote: > I suspect this commit but could be one of the others that caused this panic > during intialization. From a serial console log: > > Hit [Enter] to boot immediately, or any other key for command prompt. > Booting [/boot/kernel/kernel] in 10 seconds... ^MBooting > [/boot/kernel/kernel] in 9 seconds... ^MBooting [/boot/kernel/kernel]... > ^M > \^HGDB: no debug ports present > KDB: debugger backends: ddb > KDB: current backend: ddb > ---<>--- > Copyright (c) 1992-2024 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 15.0-CURRENT #60 komquats-n272059-e28ee29d2d13: Wed Sep 4 15:07:36 > PDT 2024 > root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git > llvmorg-18.1.6-0-g1118c2e05e67) > VT(vga): text 80x25 > CPU: AMD Processor model unknown (3000.06-MHz K8-class CPU) > Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 > Features=0x178bfbff CA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > Features2=0x802009 > AMD Features=0xee500800 Now!> > AMD Features2=0x37ff IBS,SKINIT,WDT> > SVM: NP,NRIP,NAsids=64 > TSC: P-state invariant > real memory = 8589934592 (8192 MB) > avail memory = 8145883136 (7768 MB) > Event timer "LAPIC" quality 100 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) > random: unblocking device. > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: > 32/8 (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: > 16/8 (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 > (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 > (20230628/tbfadt-748) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using > default 32 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using > default 16 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using > default 32 (20230628/tbfadt-850) > ioapic0: MADT APIC ID 4 != hw id 0 > kernel trap 12 with interrupts disabled > > > Fatal trap 12: page fault while in kernel mode > cpuid = 0; apic id = 00 > fault virtual address = 0x78 > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff80a2c48b > stack pointer = 0x28:0xffffffff81f05e90 > frame pointer = 0x28:0xffffffff81f05e90 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = resume, IOPL = 0 > current process = 0 (swapper) > rdi: 0000000000000004 rsi: 0000000000000000 rdx: 0000000000000000 > rcx: 0000000000000001 r8: 0000000000000001 r9: 00000000ffffffff > rax: 0000000000000000 rbx: fffff800fec00000 rbp: ffffffff81f05e90 > r10: 0000000000000000 r11: 00000000fff5cfdf r12: 0000000000000010 > r13: fffff800033aa8ec r14: fffff800033aa8e4 r15: 0000000000000000 > trap number = 12 > panic: page fault > cpuid = 0 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xffffffff81f05b80 > vpanic() at vpanic+0x13f/frame 0xffffffff81f05cb0 > panic() at panic+0x43/frame 0xffffffff81f05d10 > trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f05d70 > trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f05dc0 > calltrap() at calltrap+0x8/frame 0xffffffff81f05dc0 > --- trap 0xc, rip = 0xffffffff80a2c48b, rsp = 0xffffffff81f05e90, rbp = > 0xffffffff81f05e90 --- > iommu_map_ioapic_intr() at iommu_map_ioapic_intr+0xb/frame > 0xffffffff81f05e90 > ioapic_create() at ioapic_create+0x460/frame 0xffffffff81f05f20 > madt_parse_apics() at madt_parse_apics+0x51/frame 0xffffffff81f05f40 > acpi_walk_subtables() at acpi_walk_subtables+0x31/frame 0xffffffff81f05f70 > madt_setup_io() at madt_setup_io+0x62/frame 0xffffffff81f05f90 > apic_setup_io() at apic_setup_io+0x24/frame 0xffffffff81f05fa0 > mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f05ff0 > Uptime: 1s > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > Rebooting... Try this commit 27647f0593a0e7c1cdacb8531dd944aa568dbdb5 Author: Konstantin Belousov Date: Thu Sep 5 03:33:34 2024 +0300 x86: always provide dummy x86_iommu virtual methods to make configurations where vendor-specific IOMMU not yet implemented but IOMMU is enabled in config, work when calling into MSI/IOAPIC interrupt remapping. Reported by: cy Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 2c647fd21c67..ebfcb94c7e97 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -190,12 +190,53 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &iommu_qi_batch_coalesce, 0, "Number of qi batches between interrupt"); -static struct x86_iommu *x86_iommu; +static int +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, + u_int cookie, uint64_t *addr, uint32_t *data) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) +{ + return (0); +} + +static int +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, + uint32_t *lo) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) +{ + return (0); +} + +static struct x86_iommu x86_no_iommu = { + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, + .map_msi_intr = x86_no_iommu_map_msi_intr, + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, +}; + +static struct x86_iommu *x86_iommu = &x86_no_iommu; void set_x86_iommu(struct x86_iommu *x) { - MPASS(x86_iommu == NULL); + MPASS(x86_iommu == &x86_no_iommu); x86_iommu = x; } From nobody Thu Sep 5 00:38:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzgTC2GwZz5W7wV; Thu, 05 Sep 2024 00:38: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 4WzgTB3pmKz4MHH; Thu, 5 Sep 2024 00:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725496718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBmPLErXm0TcCt1emjg5+Gd0HOWtjb+JxYC04mevT9c=; b=OI6CrkN4ZVfj5hc4TqucrPSF2gpqMhS8hFkJ7EzWfBunSsC6AX2LN9wxEdobW/JqjFQls5 V1EN7+ASZAdVJO5R841YMovM/AZ8sduLwXqUOoFcNLGF+Iuqkc/zKxuiSUd4exXSDa0uG3 KQ274r+NLrM3FD6F4ksBzwJJ5nogBlLxddQrCGMQlnqMAvHc2ncYRXawn36NCu9V05FD21 it4Sfn82I64IpxkN3bro2K92P200olJNHccOffAiuTtYkGDcxIMc7nZ6GFDtbbruNJI7cn ww9kcdwUV788BA7UqzeNRanrFWIgERp0rFUDr3UwRX4Cyn+RS27ayIhKH7IZ/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725496718; a=rsa-sha256; cv=none; b=qyj8EjOTJTB+K8RTtNvBJZ8KblAB499L1AX74f7xaTr1DG+Nvazqat34jB8t1hJvWM494w J7nBIzoYJVAVJUVpmIyH2LFtRN0d+aWa+lANOjVVN6waPBAGr7X1rtome7Ws5O9MUkHLdV SZ55sKt1q93YQMPvhQqKEWuIwJOpMJ5HmQrOo3zT5d5i8TQuNvOwvn5CoQYdLd9LQuun/L Q8Ycs/YSEXVyn7VVuMJPAdojKUFH9HCGBCX8840PAR0Vrv2zmXO07PI7gyxXOVwUMrn4d+ BWwUl3u6vLyfnMXYnKbkJNQ+botRddlRSNSkMcxC5eLTIkhumFwrK7O3mHTlmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725496718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBmPLErXm0TcCt1emjg5+Gd0HOWtjb+JxYC04mevT9c=; b=FfUCD4Cevl1Us9LMbMlUAwyOWHJKZn+AmCXh0O9bzQuVpfoMfiSdOWCyHwrxIQQm7NKymS L0DXdRI11aXIBR2Olsomr+HwH7CochflLqMTtyRLAHJZB6a4jz+HJA6lR+Fx9enODQv1Kp kTF5VTu59c9w2HgFQ68VZGYrSKZE1Ojocx5bDscSlJzqhSN6iS6v8g3GPrcCUjFgSQgNE3 IVpmQtUw9CmpCcNkDBV9+HE4GvQlNanbro88PtFTIE00xSjWZVO5UcsmICtpRPpLIhtkQb DHikWIJiIwPmUn/c/xAyL3vbDXqI3NDi9b5OS74b9Fgk3dF/Hck1/L9fxNcV7Q== 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 4WzgTB1w0TzmQd; Thu, 5 Sep 2024 00:38: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 4850cc68010424; Thu, 5 Sep 2024 00:38:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4850cc49010422; Thu, 5 Sep 2024 00:38:38 GMT (envelope-from git) Date: Thu, 5 Sep 2024 00:38:38 GMT Message-Id: <202409050038.4850cc49010422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: dc450b388bba - main - vmm: Remove more of vmmdev_open() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc450b388bba182d0b3ce2f1a04c20acda7ff922 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dc450b388bba182d0b3ce2f1a04c20acda7ff922 commit dc450b388bba182d0b3ce2f1a04c20acda7ff922 Author: Mark Johnston AuthorDate: 2024-09-05 00:36:27 +0000 Commit: Mark Johnston CommitDate: 2024-09-05 00:36:27 +0000 vmm: Remove more of vmmdev_open() The softc pointer is now unused, just remove it. Reported by: se Fixes: 66fc442421f8 ("vmm: Remove an incorrect credential check in vmmdev_open()") --- sys/dev/vmm/vmm_dev.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 353b58dd8a2c..a43d642b3925 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -325,12 +325,8 @@ vm_set_register_set(struct vcpu *vcpu, unsigned int count, int *regnum, static int vmmdev_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct vmmdev_softc *sc; int error; - sc = vmmdev_lookup2(dev); - KASSERT(sc != NULL, ("%s: device not found", __func__)); - /* * A jail without vmm access shouldn't be able to access vmm device * files at all, but check here just to be thorough. From nobody Thu Sep 5 00:40:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzgWb1WNBz5W7yC; Thu, 05 Sep 2024 00:40: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 4WzgWb10PCz4Mcs; Thu, 5 Sep 2024 00:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725496843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVTKeMHujsrXi5xauHjhiCQNq+LCXRcjs+9qryJ0yqs=; b=RifMRM5Iwhr+Kffo4SQmJEpaYQaMxc2HKy2gwFhfMqf4exo+NXJaF4WCnq6wsKdzEHiLtV kbX3pO0lzoINCmTYn4UI300cIio2gS/WqimlRQR64jORFWFIYP0Q+T7kWcSfcqLZCUPOFi Xasc/ac2F9SM8LX1R4dqTByvf6SKMuTeaGouPhYR/HnHW9vm1mrI3mP+BMhcoAZYIKOe5n H+3UCdpkRV0QijMj1wFdQRb/rFSIdwSO3yv9rFxO+ijkpISKzJaXxJQNeJ6CT0IBwpjaez 8ZiYym72SweePVk4WCc3+EBXT3SM7rjiSglh4Fbr1J3mUtojklHk9wVdXG2OGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725496843; a=rsa-sha256; cv=none; b=eD2ik1QQJk+ZbWBpROTmV8EF8+GE9iMYW95oQCEGkK5m5l1KXAyjGTHoW7nH4WKdyiuP2x TkEiAwL9+iZPz0kk3VaFgEB+UxJjW5cWN5GEslLfGj2bcXRTlwzokS24ByTfmLNOmSrAyK fOtOeOKW1bP9q7uPRvsL4kzVbHegJvEF3e8hC+uYm/K1i30hXD/WS0pLTPQP7HFVURTcSM lj0PaGjSxoOm+l7sPGyPmGxQQvyQVE44fYh+X+iviBjFzIq2SJyxeOs+ld4wTZrCugYThr fmshcjMvB4F0z3sZwU01sIf7DadwnevttOaFF6Y+PG8KMgeLS8T/nnxY7T/mFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725496843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVTKeMHujsrXi5xauHjhiCQNq+LCXRcjs+9qryJ0yqs=; b=WmBfpUWYChi6hzxfph2X9pY3cVR89ZOw4e/0ZjY8lhrs1NX29M6N4+vINh6Sd40agXXbqR w0BszPN+VflhloT++e0SzeqBR2JOCzJoRSDwnWmvKFVUCdOF5auPCWYEJeSi/w0coAg6Yy mUeBjDdTO+uipKfawmUv4M1M260/dKpGi+qBUOenyfnib12jUlYeVKYZONZTPPqbmMk8uW cSYSS+dmMv0BH3WZp0zdXyh3HqAMJ/9JV5R4APOG/iQQG5lh8Ec9vdaDBHCtS60bmVWi0H 3mEMdUWwk+1i6XgOt647yTA/JfaUuReM8ZQnuPhlhk/Yh1IQOsjyjBOt9upBHg== 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 4WzgWb0V1nzmbj; Thu, 5 Sep 2024 00:40: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 4850egZa019402; Thu, 5 Sep 2024 00:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4850egxl019399; Thu, 5 Sep 2024 00:40:42 GMT (envelope-from git) Date: Thu, 5 Sep 2024 00:40:42 GMT Message-Id: <202409050040.4850egxl019399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 79eba754bec3 - main - vop_stdadvise(): restore correct handling of length == 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79eba754bec39d88a6494318a2176d19743cf993 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=79eba754bec39d88a6494318a2176d19743cf993 commit 79eba754bec39d88a6494318a2176d19743cf993 Author: Konstantin Belousov AuthorDate: 2024-09-03 04:20:40 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-05 00:40:14 +0000 vop_stdadvise(): restore correct handling of length == 0 Switch to unsigned arithmetic to handle overflow not relying on -fwrap, and specially treat the case of length == 0 from posix_fadvise() which passes OFF_MAX as the end to VOP. There, roundup() overflows and -fwrap causes bend and endn become negative. Using uintmax_t gives the place for roundup() to not wrap. Also remove locals with single use, and move calculations out from under bo lock. Reported by: tmunro Reviewed by: markj, tmunro Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46518 --- sys/kern/vfs_default.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index d612642a6bc9..f5722851d729 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -1063,8 +1063,8 @@ vop_stdadvise(struct vop_advise_args *ap) { struct vnode *vp; struct bufobj *bo; + uintmax_t bstart, bend; daddr_t startn, endn; - off_t bstart, bend, start, end; int bsize, error; vp = ap->a_vp; @@ -1096,7 +1096,8 @@ vop_stdadvise(struct vop_advise_args *ap) */ bsize = vp->v_bufobj.bo_bsize; bstart = rounddown(ap->a_start, bsize); - bend = roundup(ap->a_end, bsize); + bend = ap->a_end; + bend = roundup(bend, bsize); /* * Deactivate pages in the specified range from the backing VM @@ -1105,18 +1106,17 @@ vop_stdadvise(struct vop_advise_args *ap) * below. */ if (vp->v_object != NULL) { - start = trunc_page(bstart); - end = round_page(bend); VM_OBJECT_RLOCK(vp->v_object); - vm_object_page_noreuse(vp->v_object, OFF_TO_IDX(start), - OFF_TO_IDX(end)); + vm_object_page_noreuse(vp->v_object, + OFF_TO_IDX(trunc_page(bstart)), + OFF_TO_IDX(round_page(bend))); VM_OBJECT_RUNLOCK(vp->v_object); } bo = &vp->v_bufobj; - BO_RLOCK(bo); startn = bstart / bsize; endn = bend / bsize; + BO_RLOCK(bo); error = bnoreuselist(&bo->bo_clean, bo, startn, endn); if (error == 0) error = bnoreuselist(&bo->bo_dirty, bo, startn, endn); From nobody Thu Sep 5 01:06:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzh4r4jSFz5WDry; Thu, 05 Sep 2024 01:06:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzh4r2jhYz4QV4; Thu, 5 Sep 2024 01:06:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id lr9rsRnry9TOUm0wlscMEa; Thu, 05 Sep 2024 01:06:03 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id m0wjsjtRbKHV8m0wksnd6p; Thu, 05 Sep 2024 01:06:03 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=66d903fb a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=0_lmrure0TmMD5iX:21 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=NEAV23lmAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=3UDjUPUtPk4n7ud1VCEA:9 a=3wAIKV35zABP6r1R:21 a=CjuIK1q_8ugA:10 a=RVmHIydaz68A:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id ECD831BF; Wed, 04 Sep 2024 18:06:00 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B9D292A; Wed, 04 Sep 2024 18:06:00 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU In-reply-to: References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> <20240904235204.1FCD9C5@slippy.cwsent.com> Comments: In-reply-to Konstantin Belousov message dated "Thu, 05 Sep 2024 03:37:49 +0300." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Sep 2024 18:06:00 -0700 Message-Id: <20240905010600.B9D292A@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEedAPJ4rlBR0HCGKt7KW4oa+UB7mTgGDx9bV88pfODuURbZyq3oeo9eja4m+tSLRWCo9m6rw6dFX5oMJHbX+O2Frw6ymV4CSHIea/bPFQz1/KBBDMCc nKNP9fJtkt7UD4qxmDmvj45604kMlti4xERbUUPEJ6bC0C6+sij6tVC2CpawgzbKWy50BxkOCAIhZ8jEKUtbESPK4LVUUz8463tlCLkJvLSGwkt0pRBNnz0e 2IjGAsr4enftN0B8Q7v0fPuBgaQkrQs2Eq/J41RO2hbhIU6oZIi/81jMlBTHg4Ume3DyeIEODWNgsLDjvGS+qBrEFY4a+15p1wTI5LHgCjg= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Wzh4r2jhYz4QV4 In message , Konstantin Belousov writes: > On Wed, Sep 04, 2024 at 04:52:04PM -0700, Cy Schubert wrote: > > I suspect this commit but could be one of the others that caused this panic > > > during intialization. From a serial console log: > > > > Hit [Enter] to boot immediately, or any other key for command prompt. > > Booting [/boot/kernel/kernel] in 10 seconds... ^MBooting > > [/boot/kernel/kernel] in 9 seconds... ^MBooting [/boot/kernel/kernel]... > > > ^M > > \^HGDB: no debug ports present > > KDB: debugger backends: ddb > > KDB: current backend: ddb > > ---<>--- > > Copyright (c) 1992-2024 The FreeBSD Project. > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > The Regents of the University of California. All rights reserved. > > FreeBSD is a registered trademark of The FreeBSD Foundation. > > FreeBSD 15.0-CURRENT #60 komquats-n272059-e28ee29d2d13: Wed Sep 4 15:07:36 > > > PDT 2024 > > root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > > FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git > > llvmorg-18.1.6-0-g1118c2e05e67) > > VT(vga): text 80x25 > > CPU: AMD Processor model unknown (3000.06-MHz K8-class CPU) > > Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 > > Features=0x178bfbff M > > CA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > > Features2=0x802009 > > AMD Features=0xee500800 D > > Now!> > > AMD Features2=0x37ff , > > IBS,SKINIT,WDT> > > SVM: NP,NRIP,NAsids=64 > > TSC: P-state invariant > > real memory = 8589934592 (8192 MB) > > avail memory = 8145883136 (7768 MB) > > Event timer "LAPIC" quality 100 > > ACPI APIC Table: > > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > > FreeBSD/SMP: 1 package(s) x 4 core(s) > > random: unblocking device. > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: > > 32/8 (20230628/tbfadt-748) > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: > > 16/8 (20230628/tbfadt-748) > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 > > (20230628/tbfadt-748) > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 > > (20230628/tbfadt-748) > > Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using > > default 32 (20230628/tbfadt-850) > > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using > > > default 16 (20230628/tbfadt-850) > > Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using > > default 32 (20230628/tbfadt-850) > > ioapic0: MADT APIC ID 4 != hw id 0 > > kernel trap 12 with interrupts disabled > > > > > > Fatal trap 12: page fault while in kernel mode > > cpuid = 0; apic id = 00 > > fault virtual address = 0x78 > > fault code = supervisor read data, page not present > > instruction pointer = 0x20:0xffffffff80a2c48b > > stack pointer = 0x28:0xffffffff81f05e90 > > frame pointer = 0x28:0xffffffff81f05e90 > > code segment = base 0x0, limit 0xfffff, type 0x1b > > = DPL 0, pres 1, long 1, def32 0, gran 1 > > processor eflags = resume, IOPL = 0 > > current process = 0 (swapper) > > rdi: 0000000000000004 rsi: 0000000000000000 rdx: 0000000000000000 > > rcx: 0000000000000001 r8: 0000000000000001 r9: 00000000ffffffff > > rax: 0000000000000000 rbx: fffff800fec00000 rbp: ffffffff81f05e90 > > r10: 0000000000000000 r11: 00000000fff5cfdf r12: 0000000000000010 > > r13: fffff800033aa8ec r14: fffff800033aa8e4 r15: 0000000000000000 > > trap number = 12 > > panic: page fault > > cpuid = 0 > > time = 1 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xffffffff81f05b80 > > vpanic() at vpanic+0x13f/frame 0xffffffff81f05cb0 > > panic() at panic+0x43/frame 0xffffffff81f05d10 > > trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f05d70 > > trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f05dc0 > > calltrap() at calltrap+0x8/frame 0xffffffff81f05dc0 > > --- trap 0xc, rip = 0xffffffff80a2c48b, rsp = 0xffffffff81f05e90, rbp = > > 0xffffffff81f05e90 --- > > iommu_map_ioapic_intr() at iommu_map_ioapic_intr+0xb/frame > > 0xffffffff81f05e90 > > ioapic_create() at ioapic_create+0x460/frame 0xffffffff81f05f20 > > madt_parse_apics() at madt_parse_apics+0x51/frame 0xffffffff81f05f40 > > acpi_walk_subtables() at acpi_walk_subtables+0x31/frame 0xffffffff81f05f70 > > madt_setup_io() at madt_setup_io+0x62/frame 0xffffffff81f05f90 > > apic_setup_io() at apic_setup_io+0x24/frame 0xffffffff81f05fa0 > > mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f05ff0 > > Uptime: 1s > > Automatic reboot in 15 seconds - press a key on the console to abort > > --> Press a key on the console to reboot, > > --> or switch off the system now. > > Rebooting... > > Try this > > commit 27647f0593a0e7c1cdacb8531dd944aa568dbdb5 > Author: Konstantin Belousov > Date: Thu Sep 5 03:33:34 2024 +0300 > > x86: always provide dummy x86_iommu virtual methods > > to make configurations where vendor-specific IOMMU not yet implemented > but IOMMU is enabled in config, work when calling into MSI/IOAPIC > interrupt remapping. > > Reported by: cy > Sponsored by: Advanced Micro Devices (AMD) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c > index 2c647fd21c67..ebfcb94c7e97 100644 > --- a/sys/x86/iommu/iommu_utils.c > +++ b/sys/x86/iommu/iommu_utils.c > @@ -190,12 +190,53 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG > _RWTUN, > &iommu_qi_batch_coalesce, 0, > "Number of qi batches between interrupt"); > > -static struct x86_iommu *x86_iommu; > +static int > +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > +{ > + return (EOPNOTSUPP); > +} > + > +static int > +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, > + u_int cookie, uint64_t *addr, uint32_t *data) > +{ > + return (EOPNOTSUPP); > +} > + > +static int > +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) > +{ > + return (0); > +} > + > +static int > +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, > + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, > + uint32_t *lo) > +{ > + return (EOPNOTSUPP); > +} > + > +static int > +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > +{ > + return (0); > +} > + > +static struct x86_iommu x86_no_iommu = { > + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, > + .map_msi_intr = x86_no_iommu_map_msi_intr, > + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, > + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, > + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, > +}; > + > +static struct x86_iommu *x86_iommu = &x86_no_iommu; > > void > set_x86_iommu(struct x86_iommu *x) > { > - MPASS(x86_iommu == NULL); > + MPASS(x86_iommu == &x86_no_iommu); > x86_iommu = x; > } > It still panics, differently though. ---<>--- Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 PDT 2024 root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) VT(vga): text 80x25 CPU: AMD Processor model unknown (3000.00-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x37ff SVM: NP,NRIP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 8145883136 (7768 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (20230628/tbfadt-748) Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using default 32 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using default 16 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using default 32 (20230628/tbfadt-850) ioapic0: MADT APIC ID 4 != hw id 0 ioapic0 irqs 0-23 Launching APs: 1 3 2 random: entropy device external interface vtvga0: aesni0: No AES or SHA support. acpi0: ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - \_PR_.CPU0 (20230628/dspkginit-605) acpi0: Power Button (fixed) cpu0: on acpi0 attimer0: port 0x40-0x43 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0 device_attach: hpet0 attach returned 12 atrtc0: port 0x70-0x73 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: port 0xcc00-0xccff mem 0xf0000000-0xf7ffffff,0xfdbf0000-0xfdbfffff,0xfda00000-0xfdafffff irq 18 at device 5.0 on pci1 vgapci0: Boot video device pcib2: at device 7.0 on pci0 pci2: on pcib2 re0: port 0xdc00-0xdcff mem 0xfdfff000-0xfdffffff irq 19 at device 0.0 on pci2 re0: Using 1 MSI message re0: Chip rev. 0x38000000 re0: MAC rev. 0x00000000 Fatal trap 12: page fault while in kernel mode cpuid = 2; apic id = 02 fault virtual address = 0x0 fault code = supervisor read instruction, page not present instruction pointer = 0x20:0x0 stack pointer = 0x28:0xffffffff81f058c8 frame pointer = 0x28:0xffffffff81f058e0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (swapper) rdi: fffff800057d4d00 rsi: 0000000000000000 rdx: 000000000000004a rcx: fffff80005704000 r8: 00000015bf17440a r9: ffffffff810f5ce0 rax: 0000000000000000 rbx: fffff800057d4d00 rbp: ffffffff81f058e0 r10: ffffffff81f05860 r11: fffffffffffffff5 r12: 0000000038000000 r13: ffffffffffffffff r14: fffff800057d4e00 r15: 0000000000000100 trap number = 12 panic: page fault cpuid = 2 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f055b0 vpanic() at vpanic+0x13f/frame 0xffffffff81f056e0 panic() at panic+0x43/frame 0xffffffff81f05740 trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f057a0 trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f057f0 calltrap() at calltrap+0x8/frame 0xffffffff81f057f0 --- trap 0xc, rip = 0, rsp = 0xffffffff81f058c8, rbp = 0xffffffff81f058e0 --- ??() at 0/frame 0xffffffff81f058e0 acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f05900 re_attach() at re_attach+0x100b/frame 0xffffffff81f05990 device_attach() at device_attach+0x3ac/frame 0xffffffff81f059e0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05a10 pci_attach() at pci_attach+0xc7/frame 0xffffffff81f05a40 acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f05a80 device_attach() at device_attach+0x3ac/frame 0xffffffff81f05ad0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05b00 acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0x95/frame 0xffffffff81f05b30 device_attach() at device_attach+0x3ac/frame 0xffffffff81f05b80 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05bb0 pci_attach() at pci_attach+0xc7/frame 0xffffffff81f05be0 acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f05c20 device_attach() at device_attach+0x3ac/frame 0xffffffff81f05c70 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05ca0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f05d00 device_attach() at device_attach+0x3ac/frame 0xffffffff81f05d50 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05d80 acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f05de0 acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f05e70 device_attach() at device_attach+0x3ac/frame 0xffffffff81f05ec0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05ef0 device_attach() at device_attach+0x3ac/frame 0xffffffff81f05f40 bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f05f70 root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f05f90 configure() at configure+0x9/frame 0xffffffff81f05fa0 mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f05ff0 Uptime: 1s Automatic reboot in 15 seconds - press a key on the console to abort Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 2 -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Sep 5 01:30:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzhct6Hkbz5WK2F; Thu, 05 Sep 2024 01:30:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzhct25Ddz4Vls; Thu, 5 Sep 2024 01:30:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id lr9rscHMOMArNm1KHs9cpD; Thu, 05 Sep 2024 01:30:21 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id m1KGsjyyPKHV8m1KGsnexc; Thu, 05 Sep 2024 01:30:21 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=66d909ad a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=0_lmrure0TmMD5iX:21 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=VxmjJ2MpAAAA:8 a=NEAV23lmAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=IS9ZRXeZG70pK1hyvhsA:9 a=i7m8eXiX1cS3P9We:21 a=CjuIK1q_8ugA:10 a=RVmHIydaz68A:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 8502E23E; Wed, 04 Sep 2024 18:30:19 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 6B7C7287; Wed, 04 Sep 2024 18:30:19 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU In-reply-to: <20240905010600.B9D292A@slippy.cwsent.com> References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> <20240904235204.1FCD9C5@slippy.cwsent.com> <20240905010600.B9D292A@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Wed, 04 Sep 2024 18:06:00 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Sep 2024 18:30:19 -0700 Message-Id: <20240905013019.6B7C7287@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEiQsyeMT+2dN/BgFd8qCRohfPR68akRL9PxsyZt5ipxi20DVQk3zVatAMbKtBBf2mGj/fQA1VMWGn9z0n+Pu9NcZb1JurCO9cvl5jcdMcire/2oWAno 3ca9ggfPiQJ04nTkrmJQ5PdywEfi9oMrngT9oRDRsCSG2GSunNOTZW/0gL8hPePA3ovyWEdSaSm+pFbqTa1kXD/arWUe8Pa4n9/lNgUVjmItuObMuwmmxBTE yOU61F+kshhPI8CFN19kKBoMwuoklmlwPhgDX6vpMbx7JTJPKRWhHZYsB78HarpsrWCwzYGl8A+FFcqJXz+14tLRZR5uN9SKsw4uGcSni/c= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Wzhct25Ddz4Vls In message <20240905010600.B9D292A@slippy.cwsent.com>, Cy Schubert writes: > In message , Konstantin Belousov writes: > > On Wed, Sep 04, 2024 at 04:52:04PM -0700, Cy Schubert wrote: > > > I suspect this commit but could be one of the others that caused this pan > ic > > > > > during intialization. From a serial console log: > > > > > > Hit [Enter] to boot immediately, or any other key for command prompt. > > > Booting [/boot/kernel/kernel] in 10 seconds... ^MBooting > > > [/boot/kernel/kernel] in 9 seconds... ^MBooting [/boot/kernel/kernel]... > > > > > > ^M > > > \^HGDB: no debug ports present > > > KDB: debugger backends: ddb > > > KDB: current backend: ddb > > > ---<>--- > > > Copyright (c) 1992-2024 The FreeBSD Project. > > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > > The Regents of the University of California. All rights reserved. > > > FreeBSD is a registered trademark of The FreeBSD Foundation. > > > FreeBSD 15.0-CURRENT #60 komquats-n272059-e28ee29d2d13: Wed Sep 4 15:07: > 36 > > > > > PDT 2024 > > > root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > > > FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git > > > llvmorg-18.1.6-0-g1118c2e05e67) > > > VT(vga): text 80x25 > > > CPU: AMD Processor model unknown (3000.06-MHz K8-class CPU) > > > Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 > > > Features=0x178bfbff E, > > M > > > CA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > > > Features2=0x802009 > > > AMD Features=0xee500800 ,3 > > D > > > Now!> > > > AMD Features2=0x37ff VW > > , > > > IBS,SKINIT,WDT> > > > SVM: NP,NRIP,NAsids=64 > > > TSC: P-state invariant > > > real memory = 8589934592 (8192 MB) > > > avail memory = 8145883136 (7768 MB) > > > Event timer "LAPIC" quality 100 > > > ACPI APIC Table: > > > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > > > FreeBSD/SMP: 1 package(s) x 4 core(s) > > > random: unblocking device. > > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: > > > 32/8 (20230628/tbfadt-748) > > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: > > > > 16/8 (20230628/tbfadt-748) > > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/ > 8 > > > (20230628/tbfadt-748) > > > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 > > > (20230628/tbfadt-748) > > > Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using > > > > default 32 (20230628/tbfadt-850) > > > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, usi > ng > > > > > default 16 (20230628/tbfadt-850) > > > Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using > > > default 32 (20230628/tbfadt-850) > > > ioapic0: MADT APIC ID 4 != hw id 0 > > > kernel trap 12 with interrupts disabled > > > > > > > > > Fatal trap 12: page fault while in kernel mode > > > cpuid = 0; apic id = 00 > > > fault virtual address = 0x78 > > > fault code = supervisor read data, page not present > > > instruction pointer = 0x20:0xffffffff80a2c48b > > > stack pointer = 0x28:0xffffffff81f05e90 > > > frame pointer = 0x28:0xffffffff81f05e90 > > > code segment = base 0x0, limit 0xfffff, type 0x1b > > > = DPL 0, pres 1, long 1, def32 0, gran 1 > > > processor eflags = resume, IOPL = 0 > > > current process = 0 (swapper) > > > rdi: 0000000000000004 rsi: 0000000000000000 rdx: 0000000000000000 > > > rcx: 0000000000000001 r8: 0000000000000001 r9: 00000000ffffffff > > > rax: 0000000000000000 rbx: fffff800fec00000 rbp: ffffffff81f05e90 > > > r10: 0000000000000000 r11: 00000000fff5cfdf r12: 0000000000000010 > > > r13: fffff800033aa8ec r14: fffff800033aa8e4 r15: 0000000000000000 > > > trap number = 12 > > > panic: page fault > > > cpuid = 0 > > > time = 1 > > > KDB: stack backtrace: > > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > > 0xffffffff81f05b80 > > > vpanic() at vpanic+0x13f/frame 0xffffffff81f05cb0 > > > panic() at panic+0x43/frame 0xffffffff81f05d10 > > > trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f05d70 > > > trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f05dc0 > > > calltrap() at calltrap+0x8/frame 0xffffffff81f05dc0 > > > --- trap 0xc, rip = 0xffffffff80a2c48b, rsp = 0xffffffff81f05e90, rbp = > > > 0xffffffff81f05e90 --- > > > iommu_map_ioapic_intr() at iommu_map_ioapic_intr+0xb/frame > > > 0xffffffff81f05e90 > > > ioapic_create() at ioapic_create+0x460/frame 0xffffffff81f05f20 > > > madt_parse_apics() at madt_parse_apics+0x51/frame 0xffffffff81f05f40 > > > acpi_walk_subtables() at acpi_walk_subtables+0x31/frame 0xffffffff81f05f7 > 0 > > > madt_setup_io() at madt_setup_io+0x62/frame 0xffffffff81f05f90 > > > apic_setup_io() at apic_setup_io+0x24/frame 0xffffffff81f05fa0 > > > mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f05ff0 > > > Uptime: 1s > > > Automatic reboot in 15 seconds - press a key on the console to abort > > > --> Press a key on the console to reboot, > > > --> or switch off the system now. > > > Rebooting... > > > > Try this > > > > commit 27647f0593a0e7c1cdacb8531dd944aa568dbdb5 > > Author: Konstantin Belousov > > Date: Thu Sep 5 03:33:34 2024 +0300 > > > > x86: always provide dummy x86_iommu virtual methods > > > > to make configurations where vendor-specific IOMMU not yet implemented > > but IOMMU is enabled in config, work when calling into MSI/IOAPIC > > interrupt remapping. > > > > Reported by: cy > > Sponsored by: Advanced Micro Devices (AMD) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > > > diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c > > index 2c647fd21c67..ebfcb94c7e97 100644 > > --- a/sys/x86/iommu/iommu_utils.c > > +++ b/sys/x86/iommu/iommu_utils.c > > @@ -190,12 +190,53 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFL > AG > > _RWTUN, > > &iommu_qi_batch_coalesce, 0, > > "Number of qi batches between interrupt"); > > > > -static struct x86_iommu *x86_iommu; > > +static int > > +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > > +{ > > + return (EOPNOTSUPP); > > +} > > + > > +static int > > +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, > > + u_int cookie, uint64_t *addr, uint32_t *data) > > +{ > > + return (EOPNOTSUPP); > > +} > > + > > +static int > > +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) > > +{ > > + return (0); > > +} > > + > > +static int > > +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, > > + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, > > + uint32_t *lo) > > +{ > > + return (EOPNOTSUPP); > > +} > > + > > +static int > > +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > > +{ > > + return (0); > > +} > > + > > +static struct x86_iommu x86_no_iommu = { > > + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, > > + .map_msi_intr = x86_no_iommu_map_msi_intr, > > + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, > > + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, > > + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, > > +}; > > + > > +static struct x86_iommu *x86_iommu = &x86_no_iommu; > > > > void > > set_x86_iommu(struct x86_iommu *x) > > { > > - MPASS(x86_iommu == NULL); > > + MPASS(x86_iommu == &x86_no_iommu); > > x86_iommu = x; > > } > > > > It still panics, differently though. > > ---<>--- > Copyright (c) 1992-2024 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 P > DT 2024 > root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmor > g-18.1.6-0-g1118c2e05e67) > VT(vga): text 80x25 > CPU: AMD Processor model unknown (3000.00-MHz K8-class CPU) > Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 > Features=0x178bfbff A,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > Features2=0x802009 > AMD Features=0xee500800 ow!> > AMD Features2=0x37ff BS,SKINIT,WDT> > SVM: NP,NRIP,NAsids=64 > TSC: P-state invariant > real memory = 8589934592 (8192 MB) > avail memory = 8145883136 (7768 MB) > Event timer "LAPIC" quality 100 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) > random: unblocking device. > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 > (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/ > 8 (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (2 > 0230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (2023 > 0628/tbfadt-748) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using def > ault 32 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using d > efault 16 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using defau > lt 32 (20230628/tbfadt-850) > ioapic0: MADT APIC ID 4 != hw id 0 > ioapic0 irqs 0-23 > Launching APs: 1 3 2 > random: entropy device external interface > vtvga0: > aesni0: No AES or SHA support. > acpi0: > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > \_PR_.CPU0 (20230628/dspkginit-605) > acpi0: Power Button (fixed) > cpu0: on acpi0 > attimer0: port 0x40-0x43 on acpi0 > Timecounter "i8254" frequency 1193182 Hz quality 0 > Event timer "i8254" frequency 1193182 Hz quality 100 > hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on ac > pi0 > device_attach: hpet0 attach returned 12 > atrtc0: port 0x70-0x73 on acpi0 > atrtc0: registered as a time-of-day clock, resolution 1.000000s > Event timer "RTC" frequency 32768 Hz quality 0 > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 > acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 > acpi_button0: on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > pcib1: at device 1.0 on pci0 > pci1: on pcib1 > vgapci0: port 0xcc00-0xccff mem 0xf0000000-0xf7fffff > f,0xfdbf0000-0xfdbfffff,0xfda00000-0xfdafffff irq 18 at device 5.0 on pci1 > vgapci0: Boot video device > pcib2: at device 7.0 on pci0 > pci2: on pcib2 > re0: port 0xdc00- > 0xdcff mem 0xfdfff000-0xfdffffff irq 19 at device 0.0 on pci2 > re0: Using 1 MSI message > re0: Chip rev. 0x38000000 > re0: MAC rev. 0x00000000 > > > Fatal trap 12: page fault while in kernel mode > cpuid = 2; apic id = 02 > fault virtual address = 0x0 > fault code = supervisor read instruction, page not present > instruction pointer = 0x20:0x0 > stack pointer = 0x28:0xffffffff81f058c8 > frame pointer = 0x28:0xffffffff81f058e0 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 0 (swapper) > rdi: fffff800057d4d00 rsi: 0000000000000000 rdx: 000000000000004a > rcx: fffff80005704000 r8: 00000015bf17440a r9: ffffffff810f5ce0 > rax: 0000000000000000 rbx: fffff800057d4d00 rbp: ffffffff81f058e0 > r10: ffffffff81f05860 r11: fffffffffffffff5 r12: 0000000038000000 > r13: ffffffffffffffff r14: fffff800057d4e00 r15: 0000000000000100 > trap number = 12 > panic: page fault > cpuid = 2 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f055b > 0 > vpanic() at vpanic+0x13f/frame 0xffffffff81f056e0 > panic() at panic+0x43/frame 0xffffffff81f05740 > trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f057a0 > trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f057f0 > calltrap() at calltrap+0x8/frame 0xffffffff81f057f0 > --- trap 0xc, rip = 0, rsp = 0xffffffff81f058c8, rbp = 0xffffffff81f058e0 --- > ??() at 0/frame 0xffffffff81f058e0 > acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f05900 > re_attach() at re_attach+0x100b/frame 0xffffffff81f05990 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f059e0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05a10 > pci_attach() at pci_attach+0xc7/frame 0xffffffff81f05a40 > acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f05a80 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f05ad0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05b00 > acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0x95/frame 0xffffffff81f05b30 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f05b80 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05bb0 > pci_attach() at pci_attach+0xc7/frame 0xffffffff81f05be0 > acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f05c20 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f05c70 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05ca0 > acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f05d > 00 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f05d50 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05d80 > acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f05de0 > acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f05e70 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f05ec0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f05ef0 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f05f40 > bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f05f70 > root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f05f90 > configure() at configure+0x9/frame 0xffffffff81f05fa0 > mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f05ff0 > Uptime: 1s > Automatic reboot in 15 seconds - press a key on the console to abort > Rebooting... > cpu_reset: Restarting BSP > cpu_reset_proxy: Stopped CPU 2 > > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 The other machine with the problem suffers a different but similar panic. ---<>--- Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 PDT 2024 root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) VT(vga): text 80x25 CPU: AMD Phenom(tm) II X4 945 Processor (3014.08-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x37ff SVM: NP,NRIP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 8264790016 (7881 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe1Block: 128/8 (20230628/tbfadt-748) Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using default 32 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using default 16 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using default 32 (20230628/tbfadt-850) ioapic0: MADT APIC ID 4 != hw id 0 ioapic0 irqs 0-23 Launching APs: 2 1 3 random: entropy device external interface kbd1 at kbdmux0 vtvga0: aesni0: No AES or SHA support. acpi0: ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - \_PR_.CPU0 (20230628/dspkginit-605) acpi0: Power Button (fixed) cpu0: on acpi0 attimer0: port 0x40-0x43 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfefff000-0xfefff3ff irq 0,8 on acpi0 Timecounter "HPET" frequency 25000000 Hz quality 950 atrtc0: port 0x70-0x73 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: at device 0.0 (no driver attached) isab0: at device 1.0 on pci0 isa0: on isab0 ohci0: mem 0xfe02f000-0xfe02ffff irq 21 at device 2.0 on pci0 Fatal trap 12: page fault while in kernel mode cpuid = 2; apic id = 02 fault virtual address = 0x0 fault code = supervisor read instruction, page not present instruction pointer = 0x20:0x0 stack pointer = 0x28:0xffffffff81f2caa8 frame pointer = 0x28:0xffffffff81f2cac0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (swapper) rdi: fffff80003437500 rsi: 0000000000000000 rdx: ffffffff80e54eb8 rcx: ffffffff80e54eb8 r8: 000000124472ef7c r9: ffffffff810f5ce0 rax: 0000000000000000 rbx: fffff80003437500 rbp: ffffffff81f2cac0 r10: ffffffff81f2c9f0 r11: fffffffffffffff5 r12: fffffe00113fc320 r13: fffff8000341b0a0 r14: fffff80003437800 r15: fffff80003437800 trap number = 12 panic: page fault cpuid = 2 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f2c790 vpanic() at vpanic+0x13f/frame 0xffffffff81f2c8c0 panic() at panic+0x43/frame 0xffffffff81f2c920 trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f2c980 trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f2c9d0 calltrap() at calltrap+0x8/frame 0xffffffff81f2c9d0 --- trap 0xc, rip = 0, rsp = 0xffffffff81f2caa8, rbp = 0xffffffff81f2cac0 --- ??() at 0/frame 0xffffffff81f2cac0 acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f2cae0 ohci_pci_attach() at ohci_pci_attach+0x4f/frame 0xffffffff81f2cb30 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cb80 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cbb0 pci_attach() at pci_attach+0xc7/frame 0xffffffff81f2cbe0 acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f2cc20 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cc70 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cca0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f2cd00 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cd50 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cd80 acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f2cde0 acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f2ce70 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cec0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cef0 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cf40 bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f2cf70 root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f2cf90 configure() at configure+0x9/frame 0xffffffff81f2cfa0 mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f2cff0 Uptime: 1s Automatic reboot in 15 seconds - press a key on the console to abort acpi0: reset failed - timeout Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 2 -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Sep 5 01:32:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzhg26CwKz5WKn5; Thu, 05 Sep 2024 01:32:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzhg24Nwxz4Wrs; Thu, 5 Sep 2024 01:32:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 4851W2vT034174; Thu, 5 Sep 2024 04:32:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 4851W2vT034174 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 4851W2s4034173; Thu, 5 Sep 2024 04:32:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Sep 2024 04:32:02 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU Message-ID: References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> <20240904235204.1FCD9C5@slippy.cwsent.com> <20240905010600.B9D292A@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240905010600.B9D292A@slippy.cwsent.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4Wzhg24Nwxz4Wrs On Wed, Sep 04, 2024 at 06:06:00PM -0700, Cy Schubert wrote: > ??() at 0/frame 0xffffffff81f058e0 > acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f05900 One more method is needed. Updated patch is below. commit 99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13 Author: Konstantin Belousov Date: Thu Sep 5 03:33:34 2024 +0300 x86: always provide dummy x86_iommu virtual methods to make configurations where vendor-specific IOMMU not yet implemented but IOMMU is enabled in config, work when calling into MSI/IOAPIC interrupt remapping. Reported by: cy Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 2c647fd21c67..2011c632f770 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -190,12 +190,60 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &iommu_qi_batch_coalesce, 0, "Number of qi batches between interrupt"); -static struct x86_iommu *x86_iommu; +static struct iommu_unit * +x86_no_iommu_find(device_t dev, bool verbose) +{ + return (NULL); +} + +static int +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, + u_int cookie, uint64_t *addr, uint32_t *data) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) +{ + return (0); +} + +static int +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, + uint32_t *lo) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) +{ + return (0); +} + +static struct x86_iommu x86_no_iommu = { + .find = x86_no_iommu_find, + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, + .map_msi_intr = x86_no_iommu_map_msi_intr, + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, +}; + +static struct x86_iommu *x86_iommu = &x86_no_iommu; void set_x86_iommu(struct x86_iommu *x) { - MPASS(x86_iommu == NULL); + MPASS(x86_iommu == &x86_no_iommu); x86_iommu = x; } From nobody Thu Sep 5 02:06:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzjQ53Lntz5WRDt; Thu, 05 Sep 2024 02:06:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzjQ51Hmsz4c2v; Thu, 5 Sep 2024 02:06:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id lrFvscHkKMArNm1sqs9geU; Thu, 05 Sep 2024 02:06:04 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id m1sosrvO3E0IVm1spsnJUW; Thu, 05 Sep 2024 02:06:04 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=cI9DsUeN c=1 sm=1 tr=0 ts=66d9120c a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=0_lmrure0TmMD5iX:21 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=AHSZ7YSsU9PHovtevYAA:9 a=DeRpVz0td-2OLLQ0:21 a=CjuIK1q_8ugA:10 a=RVmHIydaz68A:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 5048F353; Wed, 04 Sep 2024 19:06:02 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 4AF2711D; Wed, 04 Sep 2024 19:06:02 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU In-reply-to: References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> <20240904235204.1FCD9C5@slippy.cwsent.com> <20240905010600.B9D292A@slippy.cwsent.com> Comments: In-reply-to Konstantin Belousov message dated "Thu, 05 Sep 2024 04:32:02 +0300." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Sep 2024 19:06:02 -0700 Message-Id: <20240905020602.4AF2711D@slippy.cwsent.com> X-CMAE-Envelope: MS4xfMKEB/SQyJw2UMXbEVyCrjwM6/ZuKjEqZKV6e+Uz9uWAPZ1eCX9hbq6IA8XqDzG1o7s2LOstPbl6gXTgUJqkvZKu7w7nNnXNK8DzHH9hCq1TtB6fcPWs zd51+RHgITqRIW238+aYU8pxcOUWxUn5mqrvfa8+9/l0c1CQPj/2Ru52P/te+IP26r52WOPqLpOWdvrUk4nWyAQ1pZSmcwXs1t96LX3UPwxPiUsPgECFZfQQ kfZaBhoFEzouAyjFmw1i+TaI8GFhsArkn1FwGkkJOmaNIf90CaaoBf0fx8m+BKTFOILe49J87j0rXd0XF2jbFnovXdyliTpPJR7Con1Wdms= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4WzjQ51Hmsz4c2v Both machines still panic. First machine panics on ohci(4) attach while the second at re(4) attach in acpi_pci_get_dma_tag(). First machine: Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 PDT 2024 root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) VT(vga): text 80x25 CPU: AMD Phenom(tm) II X4 945 Processor (3013.95-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x37ff SVM: NP,NRIP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 8264794112 (7881 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe1Block: 128/8 (20230628/tbfadt-748) Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using default 32 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using default 16 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using default 32 (20230628/tbfadt-850) ioapic0: MADT APIC ID 4 != hw id 0 ioapic0 irqs 0-23 Launching APs: 1 2 3 random: entropy device external interface kbd1 at kbdmux0 vtvga0: aesni0: No AES or SHA support. acpi0: ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - \_PR_.CPU0 (20230628/dspkginit-605) acpi0: Power Button (fixed) cpu0: on acpi0 attimer0: port 0x40-0x43 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfefff000-0xfefff3ff irq 0,8 on acpi0 Timecounter "HPET" frequency 25000000 Hz quality 950 atrtc0: port 0x70-0x73 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: at device 0.0 (no driver attached) isab0: at device 1.0 on pci0 isa0: on isab0 ohci0: mem 0xfe02f000-0xfe02ffff irq 21 at device 2.0 on pci0 Fatal trap 12: page fault while in kernel mode cpuid = 2; apic id = 02 fault virtual address = 0x0 fault code = supervisor read instruction, page not present instruction pointer = 0x20:0x0 stack pointer = 0x28:0xffffffff81f2caa8 frame pointer = 0x28:0xffffffff81f2cac0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (swapper) rdi: fffff80005808500 rsi: 0000000000000000 rdx: ffffffff80e54eb8 rcx: ffffffff80e54eb8 r8: 0000001473a90040 r9: ffffffff810f5ce0 rax: 0000000000000000 rbx: fffff80005808500 rbp: ffffffff81f2cac0 r10: ffffffff81f2c9f0 r11: fffffffffffffff5 r12: fffffe00113fc320 r13: fffff800057ec0a0 r14: fffff80005808800 r15: fffff80005808800 trap number = 12 panic: page fault cpuid = 2 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f2c790 vpanic() at vpanic+0x13f/frame 0xffffffff81f2c8c0 panic() at panic+0x43/frame 0xffffffff81f2c920 trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f2c980 trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f2c9d0 calltrap() at calltrap+0x8/frame 0xffffffff81f2c9d0 --- trap 0xc, rip = 0, rsp = 0xffffffff81f2caa8, rbp = 0xffffffff81f2cac0 --- ??() at 0/frame 0xffffffff81f2cac0 acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f2cae0 ohci_pci_attach() at ohci_pci_attach+0x4f/frame 0xffffffff81f2cb30 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cb80 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cbb0 pci_attach() at pci_attach+0xc7/frame 0xffffffff81f2cbe0 acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f2cc20 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cc70 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cca0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f2cd00 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cd50 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cd80 acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f2cde0 acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f2ce70 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cec0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cef0 device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cf40 bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f2cf70 root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f2cf90 configure() at configure+0x9/frame 0xffffffff81f2cfa0 mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f2cff0 Uptime: 1s Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. acpi0: reset failed - timeout Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 2 Second machine: Copyright (c) 1992-2024 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 PDT 2024 root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67) VT(vga): text 80x25 CPU: AMD Processor model unknown (3000.02-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x37ff SVM: NP,NRIP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 8145883136 (7768 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (20230628/tbfadt-748) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (20230628/tbfadt-748) Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using default 32 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using default 16 (20230628/tbfadt-850) Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using default 32 (20230628/tbfadt-850) ioapic0: MADT APIC ID 4 != hw id 0 ioapic0 irqs 0-23 Launching APs: 1 3 2 random: entropy device external interface vtvga0: aesni0: No AES or SHA support. acpi0: ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20230628/dspkginit-605) ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - \_PR_.CPU0 (20230628/dspkginit-605) acpi0: Power Button (fixed) cpu0: on acpi0 attimer0: port 0x40-0x43 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0 device_attach: hpet0 attach returned 12 atrtc0: port 0x70-0x73 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: port 0xcc00-0xccff mem 0xf0000000-0xf7ffffff,0xfdbf0000-0xfdbfffff,0xfda00000-0xfdafffff irq 18 at device 5.0 on pci1 vgapci0: Boot video device pcib2: at device 7.0 on pci0 pci2: on pcib2 re0: port 0xdc00-0xdcff mem 0xfdfff000-0xfdffffff irq 19 at device 0.0 on pci2 re0: Using 1 MSI message re0: Chip rev. 0x38000000 re0: MAC rev. 0x00000000 Fatal trap 12: page fault while in kernel mode cpuid = 2; apic id = 02 fault virtual address = 0x0 fault code = supervisor read instruction, page not present instruction pointer = 0x20:0x0 stack pointer = 0x28:0xffffffff81f088c8 frame pointer = 0x28:0xffffffff81f088e0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (swapper) rdi: fffff800057d4d00 rsi: 0000000000000000 rdx: 000000000000004a rcx: fffff80005704000 r8: 0000001670cdcfc6 r9: ffffffff810f5ce0 rax: 0000000000000000 rbx: fffff800057d4d00 rbp: ffffffff81f088e0 r10: ffffffff81f08860 r11: fffffffffffffff5 r12: 0000000038000000 r13: ffffffffffffffff r14: fffff800057d4e00 r15: 0000000000000100 trap number = 12 panic: page fault cpuid = 2 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f085b0 vpanic() at vpanic+0x13f/frame 0xffffffff81f086e0 panic() at panic+0x43/frame 0xffffffff81f08740 trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f087a0 trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f087f0 calltrap() at calltrap+0x8/frame 0xffffffff81f087f0 --- trap 0xc, rip = 0, rsp = 0xffffffff81f088c8, rbp = 0xffffffff81f088e0 --- ??() at 0/frame 0xffffffff81f088e0 acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f08900 re_attach() at re_attach+0x100b/frame 0xffffffff81f08990 device_attach() at device_attach+0x3ac/frame 0xffffffff81f089e0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08a10 pci_attach() at pci_attach+0xc7/frame 0xffffffff81f08a40 acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f08a80 device_attach() at device_attach+0x3ac/frame 0xffffffff81f08ad0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08b00 acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0x95/frame 0xffffffff81f08b30 device_attach() at device_attach+0x3ac/frame 0xffffffff81f08b80 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08bb0 pci_attach() at pci_attach+0xc7/frame 0xffffffff81f08be0 acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f08c20 device_attach() at device_attach+0x3ac/frame 0xffffffff81f08c70 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08ca0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f08d00 device_attach() at device_attach+0x3ac/frame 0xffffffff81f08d50 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08d80 acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f08de0 acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f08e70 device_attach() at device_attach+0x3ac/frame 0xffffffff81f08ec0 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08ef0 device_attach() at device_attach+0x3ac/frame 0xffffffff81f08f40 bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f08f70 root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f08f90 configure() at configure+0x9/frame 0xffffffff81f08fa0 mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f08ff0 Uptime: 1s Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 2 -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message , Konstantin Belousov writes: > On Wed, Sep 04, 2024 at 06:06:00PM -0700, Cy Schubert wrote: > > ??() at 0/frame 0xffffffff81f058e0 > > acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f0590 > 0 > > One more method is needed. Updated patch is below. > > commit 99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13 > Author: Konstantin Belousov > Date: Thu Sep 5 03:33:34 2024 +0300 > > x86: always provide dummy x86_iommu virtual methods > > to make configurations where vendor-specific IOMMU not yet implemented > but IOMMU is enabled in config, work when calling into MSI/IOAPIC > interrupt remapping. > > Reported by: cy > Sponsored by: Advanced Micro Devices (AMD) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c > index 2c647fd21c67..2011c632f770 100644 > --- a/sys/x86/iommu/iommu_utils.c > +++ b/sys/x86/iommu/iommu_utils.c > @@ -190,12 +190,60 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG > _RWTUN, > &iommu_qi_batch_coalesce, 0, > "Number of qi batches between interrupt"); > > -static struct x86_iommu *x86_iommu; > +static struct iommu_unit * > +x86_no_iommu_find(device_t dev, bool verbose) > +{ > + return (NULL); > +} > + > +static int > +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > +{ > + return (EOPNOTSUPP); > +} > + > +static int > +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, > + u_int cookie, uint64_t *addr, uint32_t *data) > +{ > + return (EOPNOTSUPP); > +} > + > +static int > +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) > +{ > + return (0); > +} > + > +static int > +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, > + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, > + uint32_t *lo) > +{ > + return (EOPNOTSUPP); > +} > + > +static int > +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > +{ > + return (0); > +} > + > +static struct x86_iommu x86_no_iommu = { > + .find = x86_no_iommu_find, > + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, > + .map_msi_intr = x86_no_iommu_map_msi_intr, > + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, > + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, > + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, > +}; > + > +static struct x86_iommu *x86_iommu = &x86_no_iommu; > > void > set_x86_iommu(struct x86_iommu *x) > { > - MPASS(x86_iommu == NULL); > + MPASS(x86_iommu == &x86_no_iommu); > x86_iommu = x; > } > From nobody Thu Sep 5 02:38:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzk7H2TgSz5WXW7; Thu, 05 Sep 2024 02:38:19 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzk7G6Mz5z4hg8; Thu, 5 Sep 2024 02:38:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id lxDhsSDWZ9TOUm2O2scVtE; Thu, 05 Sep 2024 02:38:18 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id m2O0sjRBOGvSVm2O1sHHEt; Thu, 05 Sep 2024 02:38:18 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=FpSm/Hrq c=1 sm=1 tr=0 ts=66d9199a a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=0_lmrure0TmMD5iX:21 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=NEAV23lmAAAA:8 a=eWv-Ina5K8jpqD3U3YMA:9 a=yqttXw7gEnsO1n-h:21 a=CjuIK1q_8ugA:10 a=RVmHIydaz68A:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 28B55423; Wed, 04 Sep 2024 19:38:16 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 22B72121; Wed, 04 Sep 2024 19:38:16 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65b133e5d292 - main - x86: allow to have more than one kind of IOMMU In-reply-to: <20240905020602.4AF2711D@slippy.cwsent.com> References: <202409042150.484LoeAq031493@gitrepo.freebsd.org> <20240904235204.1FCD9C5@slippy.cwsent.com> <20240905010600.B9D292A@slippy.cwsent.com> <20240905020602.4AF2711D@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Wed, 04 Sep 2024 19:06:02 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Sep 2024 19:38:16 -0700 Message-Id: <20240905023816.22B72121@slippy.cwsent.com> X-CMAE-Envelope: MS4xfNYoC/XrClBEpq2EX4wvr/Y7n0RMHBi+Gd1c0U8p+5XCCq9Q6H9Eq50VUM0+Zb15d0ScNhcwv931PBl6zPkP7s41QRWibgxzpPfxsTqWltrx+QYkzpoa vAWFcp+BA9I/IaWkijAO3sjfeeCu1ixtmkaTouYGpBtKppZOV+IEgBtl4qzCnyNLGJcwcKDdLUtIBn15ovFUEvXPzK4zzCkhD1pWiTaamyY5Vc8J7yhOlMLs ZDahLmiHZ119QEKZKxtnXizbM6ATwRCKEkDAz/nq+uA2qyJ3qNgd8G86FQD5IgKz39H41x/lbbtXLzq4XrDOHTOhYYMTIO12q8OA07JPVFY= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Wzk7G6Mz5z4hg8 Looks like we have success. I removed /usr/obj/sys and rebuilt the kernel from scratch. How did I arrive at this? Both backtraces included: ??() at 0/frame 0xffffffff81f088e0 acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f08900 "??()" had to be line 447 in acpi_pci.c: tag = iommu_get_dma_tag(bus, child); Some more background: Originally the buildworld/buildkernel was performed on my main build server (cwsys). The initial build and subsequent builds were performed on that machine. During my latter tests I was building the kernel on my laptop (slippy). Both builds exhibited the same problem, ruling out some local-only "thing" on that machine only. The problem affected my AMD machines however my laptop, Intel i7, had no such problems. I will deploy this on all my machines downstairs. The risk being that I may send out an email retracting all this if it fails to boot a second time. But I'm willing to take that risk (looking stupid) to avoid you spending more time at this. I will test this on my i5 laptop tomorrow morning. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <20240905020602.4AF2711D@slippy.cwsent.com>, Cy Schubert writes: > Both machines still panic. > > First machine panics on ohci(4) attach while the second at re(4) attach in > acpi_pci_get_dma_tag(). > > First machine: > > Copyright (c) 1992-2024 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 P > DT 2024 > root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmor > g-18.1.6-0-g1118c2e05e67) > VT(vga): text 80x25 > CPU: AMD Phenom(tm) II X4 945 Processor (3013.95-MHz K8-class CPU) > Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 > Features=0x178bfbff A,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > Features2=0x802009 > AMD Features=0xee500800 ow!> > AMD Features2=0x37ff BS,SKINIT,WDT> > SVM: NP,NRIP,NAsids=64 > TSC: P-state invariant > real memory = 8589934592 (8192 MB) > avail memory = 8264794112 (7881 MB) > Event timer "LAPIC" quality 100 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) > random: unblocking device. > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 > (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/ > 8 (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (2 > 0230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (2023 > 0628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe1Block: 128/8 (202 > 30628/tbfadt-748) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using def > ault 32 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using d > efault 16 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using defau > lt 32 (20230628/tbfadt-850) > ioapic0: MADT APIC ID 4 != hw id 0 > ioapic0 irqs 0-23 > Launching APs: 1 2 3 > random: entropy device external interface > kbd1 at kbdmux0 > vtvga0: > aesni0: No AES or SHA support. > acpi0: > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > \_PR_.CPU0 (20230628/dspkginit-605) > acpi0: Power Button (fixed) > cpu0: on acpi0 > attimer0: port 0x40-0x43 on acpi0 > Timecounter "i8254" frequency 1193182 Hz quality 0 > Event timer "i8254" frequency 1193182 Hz quality 100 > hpet0: iomem 0xfefff000-0xfefff3ff irq 0,8 on ac > pi0 > Timecounter "HPET" frequency 25000000 Hz quality 950 > atrtc0: port 0x70-0x73 on acpi0 > atrtc0: registered as a time-of-day clock, resolution 1.000000s > Event timer "RTC" frequency 32768 Hz quality 0 > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 > acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 > acpi_button0: on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > pci0: at device 0.0 (no driver attached) > isab0: at device 1.0 on pci0 > isa0: on isab0 > ohci0: mem 0xfe02f000-0xfe02ffff irq 21 > at device 2.0 on pci0 > > > Fatal trap 12: page fault while in kernel mode > cpuid = 2; apic id = 02 > fault virtual address = 0x0 > fault code = supervisor read instruction, page not present > instruction pointer = 0x20:0x0 > stack pointer = 0x28:0xffffffff81f2caa8 > frame pointer = 0x28:0xffffffff81f2cac0 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 0 (swapper) > rdi: fffff80005808500 rsi: 0000000000000000 rdx: ffffffff80e54eb8 > rcx: ffffffff80e54eb8 r8: 0000001473a90040 r9: ffffffff810f5ce0 > rax: 0000000000000000 rbx: fffff80005808500 rbp: ffffffff81f2cac0 > r10: ffffffff81f2c9f0 r11: fffffffffffffff5 r12: fffffe00113fc320 > r13: fffff800057ec0a0 r14: fffff80005808800 r15: fffff80005808800 > trap number = 12 > panic: page fault > cpuid = 2 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f2c79 > 0 > vpanic() at vpanic+0x13f/frame 0xffffffff81f2c8c0 > panic() at panic+0x43/frame 0xffffffff81f2c920 > trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f2c980 > trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f2c9d0 > calltrap() at calltrap+0x8/frame 0xffffffff81f2c9d0 > --- trap 0xc, rip = 0, rsp = 0xffffffff81f2caa8, rbp = 0xffffffff81f2cac0 --- > ??() at 0/frame 0xffffffff81f2cac0 > acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f2cae0 > ohci_pci_attach() at ohci_pci_attach+0x4f/frame 0xffffffff81f2cb30 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cb80 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cbb0 > pci_attach() at pci_attach+0xc7/frame 0xffffffff81f2cbe0 > acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f2cc20 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cc70 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cca0 > acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f2cd > 00 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cd50 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cd80 > acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f2cde0 > acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f2ce70 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cec0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f2cef0 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f2cf40 > bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f2cf70 > root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f2cf90 > configure() at configure+0x9/frame 0xffffffff81f2cfa0 > mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f2cff0 > Uptime: 1s > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > acpi0: reset failed - timeout > Rebooting... > cpu_reset: Restarting BSP > cpu_reset_proxy: Stopped CPU 2 > > > Second machine: > > Copyright (c) 1992-2024 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 15.0-CURRENT #61 komquats-n272062-79eba754bec3: Wed Sep 4 17:46:55 P > DT 2024 > root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmor > g-18.1.6-0-g1118c2e05e67) > VT(vga): text 80x25 > CPU: AMD Processor model unknown (3000.02-MHz K8-class CPU) > Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 > Features=0x178bfbff A,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > Features2=0x802009 > AMD Features=0xee500800 ow!> > AMD Features2=0x37ff BS,SKINIT,WDT> > SVM: NP,NRIP,NAsids=64 > TSC: P-state invariant > real memory = 8589934592 (8192 MB) > avail memory = 8145883136 (7768 MB) > Event timer "LAPIC" quality 100 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) > random: unblocking device. > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 > (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/ > 8 (20230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/PmTimerBlock: 32/8 (2 > 0230628/tbfadt-748) > Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/8 (2023 > 0628/tbfadt-748) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aEventBlock: 8, using def > ault 32 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 8, using d > efault 16 (20230628/tbfadt-850) > Firmware Warning (ACPI): Invalid length for FADT/PmTimerBlock: 8, using defau > lt 32 (20230628/tbfadt-850) > ioapic0: MADT APIC ID 4 != hw id 0 > ioapic0 irqs 0-23 > Launching APs: 1 3 2 > random: entropy device external interface > vtvga0: > aesni0: No AES or SHA support. > acpi0: > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKA (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKB (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKC (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > LNKD (20230628/dspkginit-605) > ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - > \_PR_.CPU0 (20230628/dspkginit-605) > acpi0: Power Button (fixed) > cpu0: on acpi0 > attimer0: port 0x40-0x43 on acpi0 > Timecounter "i8254" frequency 1193182 Hz quality 0 > Event timer "i8254" frequency 1193182 Hz quality 100 > hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on ac > pi0 > device_attach: hpet0 attach returned 12 > atrtc0: port 0x70-0x73 on acpi0 > atrtc0: registered as a time-of-day clock, resolution 1.000000s > Event timer "RTC" frequency 32768 Hz quality 0 > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 > acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 > acpi_button0: on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > pcib1: at device 1.0 on pci0 > pci1: on pcib1 > vgapci0: port 0xcc00-0xccff mem 0xf0000000-0xf7fffff > f,0xfdbf0000-0xfdbfffff,0xfda00000-0xfdafffff irq 18 at device 5.0 on pci1 > vgapci0: Boot video device > pcib2: at device 7.0 on pci0 > pci2: on pcib2 > re0: port 0xdc00- > 0xdcff mem 0xfdfff000-0xfdffffff irq 19 at device 0.0 on pci2 > re0: Using 1 MSI message > re0: Chip rev. 0x38000000 > re0: MAC rev. 0x00000000 > > > Fatal trap 12: page fault while in kernel mode > cpuid = 2; apic id = 02 > fault virtual address = 0x0 > fault code = supervisor read instruction, page not present > instruction pointer = 0x20:0x0 > stack pointer = 0x28:0xffffffff81f088c8 > frame pointer = 0x28:0xffffffff81f088e0 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 0 (swapper) > rdi: fffff800057d4d00 rsi: 0000000000000000 rdx: 000000000000004a > rcx: fffff80005704000 r8: 0000001670cdcfc6 r9: ffffffff810f5ce0 > rax: 0000000000000000 rbx: fffff800057d4d00 rbp: ffffffff81f088e0 > r10: ffffffff81f08860 r11: fffffffffffffff5 r12: 0000000038000000 > r13: ffffffffffffffff r14: fffff800057d4e00 r15: 0000000000000100 > trap number = 12 > panic: page fault > cpuid = 2 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff81f085b > 0 > vpanic() at vpanic+0x13f/frame 0xffffffff81f086e0 > panic() at panic+0x43/frame 0xffffffff81f08740 > trap_fatal() at trap_fatal+0x40b/frame 0xffffffff81f087a0 > trap_pfault() at trap_pfault+0x46/frame 0xffffffff81f087f0 > calltrap() at calltrap+0x8/frame 0xffffffff81f087f0 > --- trap 0xc, rip = 0, rsp = 0xffffffff81f088c8, rbp = 0xffffffff81f088e0 --- > ??() at 0/frame 0xffffffff81f088e0 > acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f08900 > re_attach() at re_attach+0x100b/frame 0xffffffff81f08990 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f089e0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08a10 > pci_attach() at pci_attach+0xc7/frame 0xffffffff81f08a40 > acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f08a80 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f08ad0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08b00 > acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0x95/frame 0xffffffff81f08b30 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f08b80 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08bb0 > pci_attach() at pci_attach+0xc7/frame 0xffffffff81f08be0 > acpi_pci_attach() at acpi_pci_attach+0x15/frame 0xffffffff81f08c20 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f08c70 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08ca0 > acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x424/frame 0xffffffff81f08d > 00 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f08d50 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08d80 > acpi_probe_children() at acpi_probe_children+0x6f/frame 0xffffffff81f08de0 > acpi_attach() at acpi_attach+0x9dc/frame 0xffffffff81f08e70 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f08ec0 > bus_generic_attach() at bus_generic_attach+0x4b/frame 0xffffffff81f08ef0 > device_attach() at device_attach+0x3ac/frame 0xffffffff81f08f40 > bus_generic_new_pass() at bus_generic_new_pass+0x127/frame 0xffffffff81f08f70 > root_bus_configure() at root_bus_configure+0x26/frame 0xffffffff81f08f90 > configure() at configure+0x9/frame 0xffffffff81f08fa0 > mi_startup() at mi_startup+0x1c8/frame 0xffffffff81f08ff0 > Uptime: 1s > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > Rebooting... > cpu_reset: Restarting BSP > cpu_reset_proxy: Stopped CPU 2 > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > > In message , Konstantin Belousov writes: > > On Wed, Sep 04, 2024 at 06:06:00PM -0700, Cy Schubert wrote: > > > ??() at 0/frame 0xffffffff81f058e0 > > > acpi_pci_get_dma_tag() at acpi_pci_get_dma_tag+0x34/frame 0xffffffff81f05 > 90 > > 0 > > > > One more method is needed. Updated patch is below. > > > > commit 99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13 > > Author: Konstantin Belousov > > Date: Thu Sep 5 03:33:34 2024 +0300 > > > > x86: always provide dummy x86_iommu virtual methods > > > > to make configurations where vendor-specific IOMMU not yet implemented > > but IOMMU is enabled in config, work when calling into MSI/IOAPIC > > interrupt remapping. > > > > Reported by: cy > > Sponsored by: Advanced Micro Devices (AMD) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > > > diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c > > index 2c647fd21c67..2011c632f770 100644 > > --- a/sys/x86/iommu/iommu_utils.c > > +++ b/sys/x86/iommu/iommu_utils.c > > @@ -190,12 +190,60 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFL > AG > > _RWTUN, > > &iommu_qi_batch_coalesce, 0, > > "Number of qi batches between interrupt"); > > > > -static struct x86_iommu *x86_iommu; > > +static struct iommu_unit * > > +x86_no_iommu_find(device_t dev, bool verbose) > > +{ > > + return (NULL); > > +} > > + > > +static int > > +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) > > +{ > > + return (EOPNOTSUPP); > > +} > > + > > +static int > > +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, > > + u_int cookie, uint64_t *addr, uint32_t *data) > > +{ > > + return (EOPNOTSUPP); > > +} > > + > > +static int > > +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) > > +{ > > + return (0); > > +} > > + > > +static int > > +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, > > + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, > > + uint32_t *lo) > > +{ > > + return (EOPNOTSUPP); > > +} > > + > > +static int > > +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) > > +{ > > + return (0); > > +} > > + > > +static struct x86_iommu x86_no_iommu = { > > + .find = x86_no_iommu_find, > > + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, > > + .map_msi_intr = x86_no_iommu_map_msi_intr, > > + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, > > + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, > > + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, > > +}; > > + > > +static struct x86_iommu *x86_iommu = &x86_no_iommu; > > > > void > > set_x86_iommu(struct x86_iommu *x) > > { > > - MPASS(x86_iommu == NULL); > > + MPASS(x86_iommu == &x86_no_iommu); > > x86_iommu = x; > > } > > From nobody Thu Sep 5 02:43:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzkFL0xr0z5WYLx; Thu, 05 Sep 2024 02:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzkFL0QxNz4jsw; Thu, 5 Sep 2024 02:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725504214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX7CkyZIvy25bHCuhEoi1Qswjyng+AYMWEQHhzkgiGg=; b=pvtsvaZjRp640A/Kmkvjrv2ys0wvfwZuEtXpSNGboD05U0Asw4iO/HeMZJzq6caqvm3Y3N awt+c+DnJMAap2ZcBxlltSnkv+hWicuBZmxcpoM/ZHCHlkDJR447+A5D7yOzt7x8Id/S9Z aqg4J4gBwyY4rj3WMMpFrUf1YYoWqH1c7fVODjUGN6W1Dx/p114LNbVMs7pe/ZQIRNnlhh JpP9L1IocrGEIGIwI8bpBKi9s1KWq7pl1P7KpIeWMOFs9uSmM9LFFIhSdIclz8eXMhKL3j UPtuj4E1B1bj/Ccx/RLEDw0o2CSun59Etv966d2j5fM54OLlzDP7uK3RdmyD7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725504214; a=rsa-sha256; cv=none; b=qD6AaarwKpTTkPMVa8hgR18OwXbtoBGoReV0jB0iTuhL0so9/NyzbRJv3R0q1Yxi4VgmQt iC9TWog/7EGGd/mhIWcrGXDbTDHO6eb0VGExmsAzN9+AKFBgK7AdNifYXbxStMB3x/5bQd LwGP/riiRSfaGAjjFVG1kU3+bcqH/Q1DdnAcIBw5QT0WfzXB63MlkCtWrMwQAEuqSIHkRx DyGeUWXn8KL0xP0F8Uqv9ezPasEglLltgfZmBa5mO6T9oLHJ/WzyAk6ZRUdICKVkFbLOAI ts7R2vVBBWMy9zK7JRf2X7QtQvS3ygIKDwQkHVEraaEAp0HB+HqcIUQagXywSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725504214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX7CkyZIvy25bHCuhEoi1Qswjyng+AYMWEQHhzkgiGg=; b=SkkO9ZA/JCLa/dBGWURkTdq2Nv9KtGUW49bpGG8vwqIza45KMwF9e0Ni7X72ZJzl3yoCzC oS/6qraG2fdldx5NOjWDo+2UYSAkDvYBGOrR2prlgGIVsTXqKfK3PT8BrDWACROKsX7w48 ludcXV6RR3ZcqeS95WmjI6FfBFiCiE9PI8xv9/b3kET5KEatVTo7SEC9vugFeDFZaUynaA 8NnrlzUb5m6P6UMYEJA0e0Q3e1tagRZIhw+Ghm/aBMBwqInifFjlkUzZJ4OBWv/nN9Xshm BrhHn5inej4MPgrIE1VKlC+jvD0aLfatFq65QXg11rvhVYF2AtsL5TpdZmsf0Q== 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 4WzkFL02LWzqyR; Thu, 5 Sep 2024 02:43: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 4852hXiA029242; Thu, 5 Sep 2024 02:43:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4852hXOP029239; Thu, 5 Sep 2024 02:43:33 GMT (envelope-from git) Date: Thu, 5 Sep 2024 02:43:33 GMT Message-Id: <202409050243.4852hXOP029239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 99e3d96fc1a2 - main - x86: always provide dummy x86_iommu virtual methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13 commit 99e3d96fc1a2b1d5cac5a635608ec3044ec4fa13 Author: Konstantin Belousov AuthorDate: 2024-09-05 00:33:34 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-05 01:30:29 +0000 x86: always provide dummy x86_iommu virtual methods to make configurations where vendor-specific IOMMU not yet implemented but IOMMU is enabled in config, work when calling into MSI/IOAPIC interrupt remapping. Reported by: cy Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/iommu_utils.c | 52 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 2c647fd21c67..2011c632f770 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -190,12 +190,60 @@ SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &iommu_qi_batch_coalesce, 0, "Number of qi batches between interrupt"); -static struct x86_iommu *x86_iommu; +static struct iommu_unit * +x86_no_iommu_find(device_t dev, bool verbose) +{ + return (NULL); +} + +static int +x86_no_iommu_alloc_msi_intr(device_t src, u_int *cookies, u_int count) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_map_msi_intr(device_t src, u_int cpu, u_int vector, + u_int cookie, uint64_t *addr, uint32_t *data) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_msi_intr(device_t src, u_int cookie) +{ + return (0); +} + +static int +x86_no_iommu_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, + bool edge, bool activehi, int irq, u_int *cookie, uint32_t *hi, + uint32_t *lo) +{ + return (EOPNOTSUPP); +} + +static int +x86_no_iommu_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie) +{ + return (0); +} + +static struct x86_iommu x86_no_iommu = { + .find = x86_no_iommu_find, + .alloc_msi_intr = x86_no_iommu_alloc_msi_intr, + .map_msi_intr = x86_no_iommu_map_msi_intr, + .unmap_msi_intr = x86_no_iommu_unmap_msi_intr, + .map_ioapic_intr = x86_no_iommu_map_ioapic_intr, + .unmap_ioapic_intr = x86_no_iommu_unmap_ioapic_intr, +}; + +static struct x86_iommu *x86_iommu = &x86_no_iommu; void set_x86_iommu(struct x86_iommu *x) { - MPASS(x86_iommu == NULL); + MPASS(x86_iommu == &x86_no_iommu); x86_iommu = x; } From nobody Thu Sep 5 05:16:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wznf4295Cz5V5gc; Thu, 05 Sep 2024 05:16: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 4Wznf418hhz55cm; Thu, 5 Sep 2024 05:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725513404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ffcKx3Dhzc0EHBPDd2GV8rGjVz3Ob+mt5NoUBNoGDRY=; b=m4/2glEvCT9DliI5zx86lapBLvxkQNptWQyFqqnvpIxHS3ahPClEtf8DVgEIwbqsXw0d9S S7g+cqtOexQqKJXa2xYxmFIifwIPc8eoXR1FQtLxXhJxITuKQMrS9LfBWUG5sbNQ31HmKK fyhXBsqeH4xSufKRWEm5E2+3D1UAUx3hFatTuyI6U9Zmy9H/HgE0nuhcvtT/he39Xc5k9R jeGyDDbiZ9NxlexXJevH5ECiuwg+qyOjmtm3FQMkavd5K6aegDS/EItaS+R+ZUpWoGrLV+ oIReU8au1TI+ftbuXC+usz5zr6EKnBY1fj4/HSFIf+muFEmqOEcfP76VLAOIdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725513404; a=rsa-sha256; cv=none; b=dBPgp4UtUZPQwKWsuU5xDOuh9OTNgBQ5WRVkiBfxBz5/cMoZBuxcyBDOAGaSfcmkB6gRar KrQHuKP0SwVNdXt/IJ4mag4zIjj2BFcyuOi7YeA6xghixA+Qoc/2Ws/E4RIDEyVkvSgWsg oMdnnfU2gvwdl5pE9mJto/F7I1bxAVa5JEYuaWKdsqZ6/C61Tv8RgLBdEMEowXKq1JOvEO r43n+lRFrsHQii+gtBHfVmd/OAsgPufY11T01y1PUeIjuN/e3gTJGJPrIvdP7N6vaTUomc RpWMsC/BUEOe4LdPm4aK0jTbKXZjskaCBqSNLXVm8x3MhoQwsKgimDWEwJ1waQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725513404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ffcKx3Dhzc0EHBPDd2GV8rGjVz3Ob+mt5NoUBNoGDRY=; b=OtFphtbR83S636DaS2sBlrrwa6MfxtEDLuxgNZ/nCG7glmDoUDEGYHQi6I6DS7uD+uRxu8 IQYxXPaIbo9qvMFbKphsFWT8YK3XLhmM/FeQrxB1ski2k7ioFmL8ZfiJiXDDzjx/CJd849 FZMX4O50UTgKt9EZAlPxaHxNITLfsNQmMkDOM2uvKLOBnayHUs5UsLEXalXKqlcErxxvLN 82+28HiRijpAHB+wOE2/SckI5EwWsiEhrQDKt9ACbin9Z6+4xZ8qv96O1VJKvxuB4dCOcv 7+l3J3QVbKLzSnM0cPTFgrHu8QCKzfPSFdBPoV54gybAzQnYhwMOcWQZc98+qg== 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 4Wznf40W3tzvW3; Thu, 5 Sep 2024 05:16: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 4855Ghkj085176; Thu, 5 Sep 2024 05:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4855GhXb085173; Thu, 5 Sep 2024 05:16:43 GMT (envelope-from git) Date: Thu, 5 Sep 2024 05:16:43 GMT Message-Id: <202409050516.4855GhXb085173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 7aeec281b8b2 - main - cxgbe(4): Always report link-down on an abrupt stop. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7aeec281b8b2620d7d88c9abdfadd7e20a485b9c Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=7aeec281b8b2620d7d88c9abdfadd7e20a485b9c commit 7aeec281b8b2620d7d88c9abdfadd7e20a485b9c Author: Navdeep Parhar AuthorDate: 2024-09-05 02:28:09 +0000 Commit: Navdeep Parhar CommitDate: 2024-09-05 04:54:30 +0000 cxgbe(4): Always report link-down on an abrupt stop. This fixes a regression in 5241b210a4e1 where the driver stopped reporting link down after a fatal error unless t4_reset_on_fatal_err was also set. Fixes: 5241b210a4e1 cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 0606f383b879..540edbb568c0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1920,6 +1920,9 @@ t4_detach_common(device_t dev) static inline int stop_adapter(struct adapter *sc) { + struct port_info *pi; + int i; + if (atomic_testandset_int(&sc->error_flags, ilog2(ADAP_STOPPED))) { CH_ALERT(sc, "%s from %p, flags 0x%08x,0x%08x, EALREADY\n", __func__, curthread, sc->flags, sc->error_flags); @@ -1927,7 +1930,24 @@ stop_adapter(struct adapter *sc) } CH_ALERT(sc, "%s from %p, flags 0x%08x,0x%08x\n", __func__, curthread, sc->flags, sc->error_flags); - return (t4_shutdown_adapter(sc)); + t4_shutdown_adapter(sc); + for_each_port(sc, i) { + pi = sc->port[i]; + PORT_LOCK(pi); + if (pi->up_vis > 0 && pi->link_cfg.link_ok) { + /* + * t4_shutdown_adapter has already shut down all the + * PHYs but it also disables interrupts and DMA so there + * won't be a link interrupt. Update the state manually + * if the link was up previously and inform the kernel. + */ + pi->link_cfg.link_ok = false; + t4_os_link_changed(pi); + } + PORT_UNLOCK(pi); + } + + return (0); } static inline int @@ -2020,20 +2040,6 @@ stop_lld(struct adapter *sc) for_each_port(sc, i) { pi = sc->port[i]; pi->vxlan_tcam_entry = false; - - PORT_LOCK(pi); - if (pi->up_vis > 0) { - /* - * t4_shutdown_adapter has already shut down all the - * PHYs but it also disables interrupts and DMA so there - * won't be a link interrupt. So we update the state - * manually and inform the kernel. - */ - pi->link_cfg.link_ok = false; - t4_os_link_changed(pi); - } - PORT_UNLOCK(pi); - for_each_vi(pi, j, vi) { vi->xact_addr_filt = -1; mtx_lock(&vi->tick_mtx); From nobody Thu Sep 5 07:20:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzrNZ0dWlz5VTfZ; Thu, 05 Sep 2024 07:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzrNZ06cWz4T6F; Thu, 5 Sep 2024 07:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725520814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EsrOXW1018mGniqb/b+6T6oDxgklDPPbm5StCFwClRg=; b=wnzSV4eYZWfgwubXcxvugwrOnTYZtPK/Wor2V3NNJgZrlwBM7pXcVlAyZ/oZv9Vzxn4dWc Z43muTdGrjJe/T1NBz9B1hb0pEg4IXk6KsobKBgz92i2UfoSGn8U5Dw03fzIG5OvoG93Ri Rg93kTMXY2X4bSAMJ50a/ozwu5PMiJwXdnsoDYU1BmH7tE4oPgzyJhIAku0HerJTS95VOA pCdjn2tofGvhCHANdZVm9Yya3yQJmWGLeceD4W372sICmcgzcwSRYsED52ZCcArlr5ko7f knnQ/kUUhJeCrV1qwaCNDWOxmj1uXs0XfGnysuAQdiT5xU7xCj+G22HSSGeAQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725520814; a=rsa-sha256; cv=none; b=lr33buMPxf2Gqah53iLxbEqxm1M5zq6X0L9yOHP1JeQ14gbzVoYnPEl5g0AmgimzbORHMk w/nmjFZk34mvWFwc32b1LbD85yT8hLoKEVJOYRO3KBzWhNgHWovlt4V1nuIA3ymIiiWQqU VaXlkfpsNQWm7VenLAp1LK8/p4qYWD2FEKeSc3yJdTaBYxPgAMW1+yMdg85s1Cokcf8/zl ZsJae79UJ0bZSEzceZaEHW0dVynTiWdwI2E0aq+yHA3PGLyifx2lweCRCz09Wy7a9kAanw QuGNaRkvDl+9rXurTobmY0OXzeqfKXRTHYJVOx1Adb9xNP9I6ZmJSow16QO2lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725520814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EsrOXW1018mGniqb/b+6T6oDxgklDPPbm5StCFwClRg=; b=yhIAaL6c91e/eMjVZPc3JQ6JFin1Wg4GCLSfnot5SOLLwduXBrQEk+fgunShwQxGnOVvn8 IAHDrIN1DIZjpfPqdrFZN4vm9VYpeR2K1itreslAyQQzdpG357U3Hr50Kdxwy5e6am75Xv 7dBh4E4F3ctMRoLkL71jsHm/foC0LmBpjOzWQqMpA1O7hqPAOZXJRXEUUs1UGrTjR8Jav7 hOQzqio7+Jw1k6y+65kbwyLfWRJNZxaRAadlCB7/VuXQkoDh/rIGBYfYCDhhaZVQYUT8Cd XhGJyqjg0nXE/aEWEcAtBJuR4k8eNJEeSOCmEvzITzktrQ1TqZCNle+u0/xGiw== 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 4WzrNY6X3BzyY7; Thu, 5 Sep 2024 07:20: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 4857KD7j010487; Thu, 5 Sep 2024 07:20:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4857KDFU010483; Thu, 5 Sep 2024 07:20:13 GMT (envelope-from git) Date: Thu, 5 Sep 2024 07:20:13 GMT Message-Id: <202409050720.4857KDFU010483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ef438f7706be - main - tcp: improve consistency of syncache_respond() failure handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef438f7706be48f1cf7fd4c8a60329e1619cfe30 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ef438f7706be48f1cf7fd4c8a60329e1619cfe30 commit ef438f7706be48f1cf7fd4c8a60329e1619cfe30 Author: Michael Tuexen AuthorDate: 2024-09-05 01:33:13 +0000 Commit: Michael Tuexen CommitDate: 2024-09-05 01:33:13 +0000 tcp: improve consistency of syncache_respond() failure handling When the initial sending of the SYN ACK segment using syncache_respond() fails, it is handled as a permanent error. To improve consistency, apply this policy in all cases, where syncache_respond() is called. These include * timer based retransmissions of the SYN ACK * retransmitting a SYN ACK in response to a SYN retransmission * sending of challenge ACKs in response to received RST segments In these cases, fall back to SYN cookies, if enabled. While there, also improve consistency of the TCP stats counters. Reviewed by: cc, glebius (earlier version) MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46428 --- sys/netinet/tcp_syncache.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 33a6a66b7138..d0a7690256f4 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -527,10 +527,16 @@ syncache_timer(void *xsch) } NET_EPOCH_ENTER(et); - syncache_respond(sc, NULL, TH_SYN|TH_ACK); + if (syncache_respond(sc, NULL, TH_SYN|TH_ACK) == 0) { + syncache_timeout(sc, sch, 0); + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + TCPSTAT_INC(tcps_sc_retransmitted); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); + } NET_EPOCH_EXIT(et); - TCPSTAT_INC(tcps_sc_retransmitted); - syncache_timeout(sc, sch, 0); } if (!TAILQ_EMPTY(&(sch)->sch_bucket)) callout_reset(&(sch)->sch_timer, (sch)->sch_nextc - tick, @@ -688,7 +694,13 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - syncache_respond(sc, m, TH_ACK); + if (syncache_respond(sc, m, TH_ACK) == 0) { + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); + } } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -1549,6 +1561,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); } SCH_UNLOCK(sch); goto donenoprobe; From nobody Thu Sep 5 07:35:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzrkJ4gRNz5VWty; Thu, 05 Sep 2024 07:35: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 4WzrkJ49zMz4Xvh; Thu, 5 Sep 2024 07:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CqqowLm9pwsAfbcrPA9V02EjEX8EJMblM7GXaOsvTHs=; b=lMwcmr/8A7V41CZFYMpdONpM47mERXcAHKJbXioXgRFuyCMysqqTUL0F551dyOCepWnsEv fpLWEvfRriGnxYgBPA578zOQY/oKB7IB5FnfbJQAJF3uPNnlBI8Ns5/zNwkhw29G2MXcl6 EE1kXleqLETi9FDOflBgNJwAaL4yN+UX+1ZlZJnnDfh0jDLzNGSfMNkq/2PpZmkXjuSuKZ J3t08ec40y/3ghzUn9EfeffxF98YgJzcpRmXX7jIjeaWbHA7h872ypTqGqbme4PWUmZfBy BNyADZq/kmxpUesLruPr/CvbEPwZAINxpgE9YZNF2CGX61KpJ3fx8Pg76YtNNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725521736; a=rsa-sha256; cv=none; b=fkpNQNSs0R6eKhTmpDBwEMbNNE3eiUe1/Ou2JsytMepwREdkocFkwJx04EgIM/JR4eC1t5 59KLx8G8MnLFfKBH+4bvtiQgzmwBQPfWoDbbNvONxe4LAcxkCmQEXPr8xaSL6tIjc++MJN QSISqdwka7d2ePjO3dkCpIslmfZZF8Kal3dTMEc8tEKmUGZNM3WFkTwuQnXROtrxy6dXQn tJqi4Vs2au2dQFC7vy3J/LY/zwNJu5FhKTd+UlhRfCTOxZ+HzNk6CxluWYDeU/UT7rhd/I /d0I8nbFpkmSfAU+q+D6VIL6jiWD8Dsss5m2TAIdc5igWSx0On3Ijym3si/9Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CqqowLm9pwsAfbcrPA9V02EjEX8EJMblM7GXaOsvTHs=; b=N+ixGQ2JMfMVmszpSClkorDV8q3Q2pdMsS9WjUsjlPyKzLjsHTGcEPK0ugQfgWmlRHtkzr paPB7qWSPbz87/dkPztr+8fIRaERcZrdMYuZ5HmAoIW36SfKkGAlyw8gYBD8qdcrQzQpQz IZhEPVCkOIEOqvX9WMqcuM7J6xwE3Xw7bFIkYHiF4UIRWYZQoIfvhSkWV1WEE7JA11adoY tO/tQ+Mm1Pr1uZiXGFAnltLdADdW/npZlWdNL2uvV67rO4j6DYl76fnG1oPl+qSKHmbKrL /xl6QuSFq3/Udx/uziW+trAW/7dlu387YQKPt3Clg4MCnVaIh/IyKjfJpz5TWQ== 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 4WzrkJ3kybz10WD; Thu, 5 Sep 2024 07:35: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 4857ZaCH037040; Thu, 5 Sep 2024 07:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4857Zasm037037; Thu, 5 Sep 2024 07:35:36 GMT (envelope-from git) Date: Thu, 5 Sep 2024 07:35:36 GMT Message-Id: <202409050735.4857Zasm037037@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: d3ee2188686d - releng/13.4 - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: d3ee2188686dce00083ba382c1a773d4e293b242 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d3ee2188686dce00083ba382c1a773d4e293b242 commit d3ee2188686dce00083ba382c1a773d4e293b242 Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-05 07:34:26 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82) (cherry picked from commit b84344206721ed2803d5da68585289d5880efe3f) Approved-by: re (cperciva) --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 84 insertions(+), 36 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 5d72dabfe305..e6c2d1f290cf 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2224,7 +2224,7 @@ struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(struct pf_state_key *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index dfef2d132e85..64f731d4ae53 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -311,6 +311,9 @@ static int pf_test_fragment(struct pf_krule **, int, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_tcp_track_full(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, struct pf_pdesc *, u_short *, int *); @@ -324,7 +327,7 @@ static int pf_test_state_udp(struct pf_kstate **, int, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, int, @@ -379,7 +382,7 @@ extern int pf_end_threads; extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s, _dir) \ do { \ @@ -1423,9 +1426,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1433,8 +1493,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -4589,7 +4653,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -6004,9 +6068,9 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6019,25 +6083,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, direction, *state, pd); @@ -6100,7 +6148,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6108,7 +6156,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -6516,7 +6564,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -6571,7 +6619,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -6580,7 +6628,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 46d3ea8f508d..2571a0c5312e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -606,7 +606,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction, return (NULL); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (NULL); *nkp = pf_state_key_clone(*skp); From nobody Thu Sep 5 07:35:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzrkK4cgLz5VX4P; Thu, 05 Sep 2024 07:35: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 4WzrkK3FKsz4Y12; Thu, 5 Sep 2024 07:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XaqIKGhPK8velwWfRXib9njR9E6Oc1QvIjJo9hIbQC0=; b=UAqQ6wE+kmGC1Q2p48c8JyDHiCXUyxQ8lD0oqd2Mt81uVq9VQM4/k2uv4I0cBuK2uA4Nu4 k0rnWRTTbBz6mX3IYByU/jGVlEThI8LMm2RLK/st7FtEYr1VyzG/0X0clV1pTLbzHu5Jpx uA8/MV0nNeZmTocASRsMfFVrENa2Ohx4UXmxTek+Kwa3U0/oiZe2oZSQVgairfRIyE3mo+ iSrQrEycD3lTuilrlGCmupErepXIU1ANfs2DFatxWXWiBhHLjNCEvnljH/RdooTh1ZPW+n Mt4xxLCsrOCoTxYwYlhHi38RrgKDLgPZ97O7fJB4AYzbDUPQe5CL7qYc79YGOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725521737; a=rsa-sha256; cv=none; b=gP+GcP5dooZnbL6HcUBYYnKtc33leDm3aXWhjClcv88SejkmCjpWg+PnpPxE3Wqcs5/GI5 cgc4E7VQaqYwXzKn+61l1xgQq/MYS9CDGr+94FC6ES324bATq4UqGmMzhiK/yMgJMlA6Pa 4EJy4iipgyawPAE3nWLi+dtBFjhXcLuC8ijl3Wi7XMi7cqncrDmHIvlCFY2I2k/pkBnj+y xgeiLLt98NUa5oKe3i3aha3P7TyzFSvDR4otCogs545T7hdlchEG0m2W6H7YK5strRtiVo WrxUBkcCTf+RvkBJB4VLq0aOyV23+IGMkxfL1rBxZBZ3VJnqsvFUOo6NYJB5KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XaqIKGhPK8velwWfRXib9njR9E6Oc1QvIjJo9hIbQC0=; b=yt/PGM4+F5ekC9b36HodJdY5072/fIPLgblN8GSW3qpssBX20Xh8F0Z7medbngt5OMm6Ev Yr1/wxbXrYuEJTAxzeJ88xfxwn30pC/K7HpoyDxLc6ST9s6eFh/0RCUGIe5HitPNaL+NJ1 bnHpApNfUFNNLZKFt4uRN+lgIKMdzp3WQDEjGr2itU2WNAHiASK5QZzW0Toi3kjGkMPse7 HqhWL92/r6W5gqFN+twldH8ahMXA5JiJEy02D4UxNvB/Hy7oRTANG5uNgJNxSscmiUmF7m TDT6BxiMxunEawO2jRdsz71DAPXVHHn4ooU/wXIr9b9knGgD6yS3FFpEwWYPWg== 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 4WzrkK2rl0z105D; Thu, 5 Sep 2024 07:35: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 4857Zbcm037111; Thu, 5 Sep 2024 07:35:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4857ZbAe037108; Thu, 5 Sep 2024 07:35:37 GMT (envelope-from git) Date: Thu, 5 Sep 2024 07:35:37 GMT Message-Id: <202409050735.4857ZbAe037108@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: 183076d24478 - releng/13.4 - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 183076d24478091246cd5928e31d57d21e417c0f Auto-Submitted: auto-generated The branch releng/13.4 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=183076d24478091246cd5928e31d57d21e417c0f commit 183076d24478091246cd5928e31d57d21e417c0f Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Kristof Provost CommitDate: 2024-09-05 07:34:52 +0000 pf: try to lookup the icmp state based on a correct packet descriptor MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b8cd169efa6ac0899b4998898129765ae5c685a6) (cherry picked from commit fa4b64836183c33631d92dadb073a9e435c5bf6d) Approved-by: re (cperciva) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 64f731d4ae53..0991cd39f332 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6623,11 +6623,11 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Thu Sep 5 07:35:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzrkL6cYTz5VX2H; Thu, 05 Sep 2024 07:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzrkL4K00z4Xl2; Thu, 5 Sep 2024 07:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UlSMKpJWQLU6/qlCs7d/S++IwP1gT3vOL7atOlUo7hw=; b=QH4BvqWjlCAfE7qdYhtVBb9UlLHd8hdzyg51WmYe6t5uZqQFl1pni9KRoHhGLnYAB1iS1k ZKB0zP9PO9LJM6RAsnFhFkDqANly5iAIgPLQSHY2M1mrp6ShxlpQ/KIEPhPjEAKUDBYwsa XMIJzvt9pOzRYQJ18K7IpdbvJoZT+hz+FxoiKuLp1a38A8OKZrqpeEEo1yN+DpLTd494mQ E0lNdB5IIaEE2GU4CCP2mhhKTyUPjD1pOKYN2fQdjPZsWMNrMz7a9kxHP1/j2IMU7WcEqk WMflZx0cIYpjkHE1Q3Nx08LqmUc3ewz4jLzIaOXTFa7xmLtRiDw51X0VhIK7Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725521738; a=rsa-sha256; cv=none; b=LEpnBwLwHwkWoMBPUUEAJhh5qFV+G3zqrz9TDQQtEHf6hiDRljq+K8dWx0XNwR7aZ4FTXz L0nb5F9BdqJYzUCAF4vUhfVvddezFtd0HLDlOV5zntWoOzRUZi1YtLCzF0AkJ0eHY/yUXV OM9E0H/tK+bfx/HMm/PNnNPugjj6uDAXbyNuIgJNP7HPyTnd9NNeUPym3g7+iSldMnEpSL sMGJA06wiI82H9LPpQ7vfnJOLlqXjHdYBau7ULccOI5++EXhnNNa1UBoi4GIp6wRRNQUht 9IaB/qa/cx8a14nhN+0Vv22Gv7gBaXBYwZPXcx6xX+3p8ukqaCo4ix3JuJylkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UlSMKpJWQLU6/qlCs7d/S++IwP1gT3vOL7atOlUo7hw=; b=Keog1rdUTCvRfIw+m3o8DxfAB+pS4cH0Kt/j6U61JBALki+BnmMw+E2VTB6v3P7AUtwMGQ I9Aa5IkXfVXSMK69528oeoM0dZf6O99Ip0sW0T8T4J6ixMAQNZeegFBf3BhpVkZaynOO98 /PtVo4KjUQETSoGv7CtJJ+5p8x7/LTuSuUYrC50G21qwrPlnWVNdpM5gTzR0kUHViytFN9 l6hksh/7cZsq/Qx3bw4JakH7xeWH9KzaJoD6pwHbIFb2ysU9TeQ6tvLDUFZ13EMRJpEjOc 9swUpffSZbOvqk9QEMyTQ3dMJO6HazjYNjEAta5HiSk3BR8NY6L3B/VG9wwPrg== 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 4WzrkL3vJWz105F; Thu, 5 Sep 2024 07:35: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 4857Zc6I037181; Thu, 5 Sep 2024 07:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4857ZcFN037178; Thu, 5 Sep 2024 07:35:38 GMT (envelope-from git) Date: Thu, 5 Sep 2024 07:35:38 GMT Message-Id: <202409050735.4857ZcFN037178@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: 13bf8945c9b6 - releng/13.4 - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 13bf8945c9b61aae587529a10646c589835f0c41 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=13bf8945c9b61aae587529a10646c589835f0c41 commit 13bf8945c9b61aae587529a10646c589835f0c41 Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Kristof Provost CommitDate: 2024-09-05 07:35:03 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5) (cherry picked from commit b4b8b2fc9bd25d10eab0afdbd06a7ef8735b7b6b) Approved-by: re (cperciva) --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0991cd39f332..9c1aa4d0a77a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6089,6 +6089,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, direction, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Thu Sep 5 07:35:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzrkN1p8Sz5VWxg; Thu, 05 Sep 2024 07:35: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 4WzrkM5K9jz4XsX; Thu, 5 Sep 2024 07:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=amof0GNTiKxqVD0W6TdA1UcSO1aoE35VCu6MBD+rS/I=; b=Fa9yuq1hNUX75JIKWjVeNMD4XGnkYkAkNHLcdZdbSXgVrcoZ+VibevMTYxCr4XGyQuyBZb hqF6U+pUX4upRHKZzhpEGGYNpm/Zag3YcAg6comtE5nIpjDoUO2rCCpVMAoMPbk/5d4dny GK+gGSwI1s8b+xWLwnz5IVfYw+Y2sBNDCnuOofV2GBteoWjhH5glgSH4NK5T8Btq9fCBhP +MQab1HbRrogwpwZK9te5dGnkXQpGILyw5l3q5CO8qzQ6ynDr2Df2+fc7HNAROU/de+4zb Rf7NLK5dZzjQGGV/y9kelwRA30SEJ2p2R8iCw+HvRjSUYxAx8NopgyVdkYJOjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725521739; a=rsa-sha256; cv=none; b=Nw5xZG8F79Hbmhz90Us+TFms+Pi0oQP2zIEownBQLxAQZE5Oq43w5Iw672X8RZ/tKIZ1Rb QcjihJZ2Tktlvw9Iqt0D7oYwVZu2FKmaScdU+X804J0H3BFhgz/dgI7slGcBkQOnvrQ/Vy 4ntjzDvVFcnG76FW0O47IwxP0Lh0c3OxkZ6nK+2TKx0pRqqbR/L63gwwGQShxQ10txB9QU VHYbdHhJbs9BfG31/5IFsvpSQNWHUCFZHek7OBtgyRGaO8Vl89KyYidHiBuyxFA4xXdZpq z9SlBt6STJsr0FvgboeEOY6AhM1gkwrrwoNU6IcPnTFoEwACxkaey0SIPPFrsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725521739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=amof0GNTiKxqVD0W6TdA1UcSO1aoE35VCu6MBD+rS/I=; b=N9lK4SUWpBZxPUALp6pQDyy1mhBklMDidlkNeYN/rz5H7POC92th1djldDIfaFJ1B/NyzQ 5KR1LUZEY25Zqx53+gquKEok09atora5KPZ33Y7Zxdc+wuWXn4VXtT1KBPBN/+FKnDRPqR Nck99DMmwABO/SjOBloLrkTe2d+GHb0rRf4odq3M1HJ8zZaqS4rmgfXoxkslfM60sLRRz+ mtC//V+KVRWXAwSD6CNZPKhRukuafxirQ261ikLqVI1ABJ7nLukTqORJdY6g6aT2GeDVo/ eqTqHk89+jTnX51nCEQpbE3ykf2HVVfEbLALJn8mefMlUytCwKzwnyTxnXWdkw== 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 4WzrkM4wyjzyvc; Thu, 5 Sep 2024 07:35: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 4857ZdOW037224; Thu, 5 Sep 2024 07:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4857ZdUv037221; Thu, 5 Sep 2024 07:35:39 GMT (envelope-from git) Date: Thu, 5 Sep 2024 07:35:39 GMT Message-Id: <202409050735.4857ZdUv037221@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: e893ec49afb2 - releng/13.4 - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: e893ec49afb2caf05a2c28df4434905fa4213537 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e893ec49afb2caf05a2c28df4434905fa4213537 commit e893ec49afb2caf05a2c28df4434905fa4213537 Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Kristof Provost CommitDate: 2024-09-05 07:35:12 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0578fe492284ded4745167060be794032e6e22f0) (cherry picked from commit d6e5f8643d37e925aa51fc8224cfc05aba0813f7) Approved-by: re (cperciva) --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e6c2d1f290cf..66bdbf43e212 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -330,8 +330,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9c1aa4d0a77a..ccd6b54f7b37 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6103,6 +6103,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6155,15 +6157,16 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -6570,8 +6573,10 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6626,16 +6631,17 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Thu Sep 5 09:00:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WztcC00pnz5W14f; Thu, 05 Sep 2024 09:00: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 4WztcB6H7dz4mCT; Thu, 5 Sep 2024 09:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725526826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NdaKvAnh4nhXyHQ0whdz5mlbc5WxY0iIjifkPVgcC9U=; b=Fq0kIyq6HxmLfIZ05Rcz5I1FKiaDDlY404HZkBWUAebRi/XkgVZeHJyycFRk+Gc1QSo3F6 5rU9dKAhI6YSqKuedjisurShuIwt3cKa0i/QGQAMf6/ZGBfDCLeGCVQ28N4dizkEQ4D1yH hCgL76pPs1sTjqgrC5MwWaP6MjAcR4C+1HGAW7wOpZezHI0cydEsrB1WWaYb0rvU7TNtvE hv+my1NMIyU4YL2z+A55KEkUqb9O6pm0UQVaybhorhAkEyk1tIHXbSpUrNseRCK2/jkcFk w7twulRzjnuHzeZceV1Nm0lMgln3mMIQsVOyb6i431Xy0sqhLyeNfSjBSIR1Og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725526826; a=rsa-sha256; cv=none; b=pjtIn+xb+uRGPZSYnzjkyq/6A0izARbgHSAY0VQWtK3QEK04yDAXhyPcwfqaly4AKUdAi1 UPgdz30f89EVFbpVhhkGd1eje6EQ4slZDx+7zhrIQaa2sDPTNOs6A3aO3NS4cFF19B1OLa GKJrFTKhP4YHFwhGh1y9GOWsrbu6BaPS8uCeRILaaxUJCaqBCjT+La9Q5tA5jOETD1F7Fl SEAuB6PLHBn+IkX2zUw01evbNfKaW9OdMY5ouNHw3i2G3+EXmHNbylGfzEwcTPjnR7Vr6t y6J+To9YPkvQwenV6HXr4PXVFWMQeUKfUCLi4I79xV9v6Q3OxKCvzdegJYw1sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725526826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NdaKvAnh4nhXyHQ0whdz5mlbc5WxY0iIjifkPVgcC9U=; b=mx/QUfQmsTopr5HvyVvX9Poo6juZ7Q+jub9+y6fFZqrua5+8TOEUjX0aecvtBjQoaQNVJQ H4/A7uxgyyeFLsWneQBXtlwRKrzXKv/wnYo1lgLMFGQyxXt1JTxXQypqf31XLjpYfl3VdE bed9IU+X/VuUcF3m7a2f/6E2eXUqw5pIOBfhHhIaQcAOmGoaRaclmuMSec0nBfL3bgO0JV 9ngnVhs2gPU8rHwOEt1l2O7IUSxxMKA9j3cg3rUrEwBNiHUWuVxkC+cL2LvqrP4m0YRRpc RmMbCFVqQdA3ABth3MVS9dd7DW74y3+XTLtI1H5CTkVhZ7VdTyQQdB7bmNj6og== 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 4WztcB5nn8z12JZ; Thu, 5 Sep 2024 09:00: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 48590Q69083371; Thu, 5 Sep 2024 09:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48590QEk083368; Thu, 5 Sep 2024 09:00:26 GMT (envelope-from git) Date: Thu, 5 Sep 2024 09:00:26 GMT Message-Id: <202409050900.48590QEk083368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a9ac25d65f64 - main - pf.4: document missing sysctls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9ac25d65f640a0a06a96e20c60bb34111db8ef6 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9ac25d65f640a0a06a96e20c60bb34111db8ef6 commit a9ac25d65f640a0a06a96e20c60bb34111db8ef6 Author: Kristof Provost AuthorDate: 2024-09-02 13:34:50 +0000 Commit: Kristof Provost CommitDate: 2024-09-05 07:38:11 +0000 pf.4: document missing sysctls Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46510 --- share/man/man4/pf.4 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 645f31e6e395..9bfc75cb490d 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 20, 2023 +.Dd September 2, 2024 .Dt PF 4 .Os .Sh NAME @@ -80,17 +80,26 @@ The following tunables are available. .Bl -tag -width indent .It Va net.pf.states_hashsize -Size of hash tables that store states. +Size of hash table that stores states. Should be power of 2. Default value is 131072. .It Va net.pf.source_nodes_hashsize -Size of hash table that store source nodes. +Size of hash table that stores source nodes. Should be power of 2. Default value is 32768. +.It Va net.pf.rule_tag_hashsize +Size of the hash table that stores tags. .It Va net.pf.default_to_drop This value overrides .Cd "options PF_DEFAULT_TO_DROP" from kernel configuration file. +.It Va net.pf.filter_local +This tells +.Nm +to also filter on the loopback output hook. +This is typically used to allow redirect rules to adjust the source address. +.It net.pf.request_maxcount +The maximum number of items in a single ioctl call. .El .Pp Read only From nobody Thu Sep 5 09:00:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WztcD0x1Jz5W16k; Thu, 05 Sep 2024 09:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WztcD0QgNz4mT0; Thu, 5 Sep 2024 09:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725526828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vpweC052vZ3IzGv78oaNaW3AfrQqhpt/j9Rvax+rnaI=; b=NKYGcSpTOSoktDm9kkIsS9hTuPatKuuP9dfH7Q2VI7IXqCBJujD4fM2tfIaBknoVQJgtg6 APT3Xe+WfbzGUeQ2rmkej7j2lZp66hj2mqeC4RIJK2Rb8UXb1KPQsNGQCriPN0D8BDyHUW EKW1k8YPkobaIA/9IYeRt/Zosmm5teXRdORWRhvz1g75YD74OGvTxJzkUrHqkMPToBXuyS B0g644ZYtW25wXnmUUrTslgnsC8qg+UlaLpdbCXWAzmpFA1vD7hhVRzL9ASAmBY2WgbtGh Acd0e2GftduzS6jfE4szbe+0t66Gxz3FhT3GDWGAuR4GFvG/nIK0K+4Fv75zmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725526828; a=rsa-sha256; cv=none; b=a6p68+O9BvSTewVMVTjPI2Z2odSBEQXa9yIBHSZ393guBvisBQNsdmUel27RrBtZuIsLoh CDgds2ne1Akt/hU2MNol9Yqa4P6HepM2KwxYHxrfYY/XFaOJYyPxGQtIueq3ho6RgBuci8 TkxnGe+1dJA6MT0h4qAfhslS0JLCKO4QWGIweaFao9bhOEhLS4daQS9mrAx0u+OV95vM7n YVjDbDBo3cGMXiOW42RMrS8cQ3rqlAbLGGaXHDO4QjT4XGjuYKz5R2XyzWX7kvr7qQcTBe 7jctBQ4O/3Oa7nAEHcdolVyeWcHrPxgZYaOAtb76cQCPv6LqoqAynZ2qbdJZ1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725526828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vpweC052vZ3IzGv78oaNaW3AfrQqhpt/j9Rvax+rnaI=; b=Py7NIfKqe/Gdg93+t+S6J7SYDTqZDRRZo2Zq+/Nb/7aHpuQWGwDgGbrTBUnEw+k0+2c3eZ zj0ymnHf9LSDyMM4GFK32erD5o881AD71z2URq1huvC3IchiNsmLxqgTaXl68DFFdYh4Yq TY09mgkiXf9iLAo3tvArntL0ory9+3KM0OTT3fE3qX0al9NzszPTjwkMxP+P3ctpNNhYHV FwxQDfEWKtPdhe9I+qXwrVF3EyvOBFxU6UCWUv0aHMjuq2Of7RSre42GYapdVr7bw/fxmz iZ5ZtosX4ki10PlUZS0elIcXLtb49SOXJd9eXQy02JYckejeBuSe8DYUnxLtSA== 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 4WztcC6RV9z12Wq; Thu, 5 Sep 2024 09:00:27 +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 48590RQJ083423; Thu, 5 Sep 2024 09:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48590RHp083420; Thu, 5 Sep 2024 09:00:27 GMT (envelope-from git) Date: Thu, 5 Sep 2024 09:00:27 GMT Message-Id: <202409050900.48590RHp083420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5644e2c6d47c - main - if_ovpn: ensure it's safe to modify the mbuf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5644e2c6d47c6113a61ab7fc0776b7227677656a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5644e2c6d47c6113a61ab7fc0776b7227677656a commit 5644e2c6d47c6113a61ab7fc0776b7227677656a Author: Kristof Provost AuthorDate: 2024-09-04 12:54:23 +0000 Commit: Kristof Provost CommitDate: 2024-09-05 08:59:31 +0000 if_ovpn: ensure it's safe to modify the mbuf PR: 280036 Reviewed by: ae MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46529 --- sys/net/if_ovpn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index f6f640a65f61..ee097cfa24b3 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2115,6 +2115,12 @@ ovpn_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, sc = ifp->if_softc; + m = m_unshare(m, M_NOWAIT); + if (m == NULL) { + OVPN_COUNTER_ADD(sc, lost_data_pkts_out, 1); + return (ENOBUFS); + } + OVPN_RLOCK(sc); SDT_PROBE1(if_ovpn, tx, transmit, start, m); @@ -2233,6 +2239,12 @@ ovpn_udp_input(struct mbuf *m, int off, struct inpcb *inp, M_ASSERTPKTHDR(m); + m = m_unshare(m, M_NOWAIT); + if (m == NULL) { + OVPN_COUNTER_ADD(sc, nomem_data_pkts_in, 1); + return (true); + } + OVPN_COUNTER_ADD(sc, transport_bytes_received, m->m_pkthdr.len - off); ohdrlen = sizeof(*ohdr) - sizeof(ohdr->auth_tag); From nobody Thu Sep 5 12:27:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzzCX4QP0z5Vwgd; Thu, 05 Sep 2024 12: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 4WzzCX3tpwz4GZ0; Thu, 5 Sep 2024 12: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=1725539272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rn31P7Onb0EusefCQcM9UG33qkdK8UCrvePUQTrc8Aw=; b=OC9gx72lcUEhODOV8mttOf9t3iqCYXHBd0Wnx08KnMK4Yux39m3hAHFmtJdSAIf46m0/fM HSqbqUbdNmyhH4Igm7W4ShE38ClId6sNfe7qpn2q9GSSzJSBGaSnfBDgq86sbROhbI06qg yudciCvIGbNFV8v/kgbvKZpV7sxOEK8B10tzMkA0fLNlbjEDxv0svlJ0BVww2d3X0Xbw+s b7P52mUx02F4zarylcZXFCqsFVc84GBUbhgluJIZAFrhkSvs3FnWSPXx4eizzXO7h7oKtP L0dDs78ebI32sBMMvDyg5Z8qrJfr983/OSVsgcRSvnN8i17XDenBfZxRZej8gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725539272; a=rsa-sha256; cv=none; b=pSya5kzKM9FNx87uftLi5FR6mv9Rou9SNQxgA/exPJGHdEfuZF0slQ41KADoXuUWnCLOX+ td3axM++joOgq2v1quqcJPDQZbRYjb7bW1aTxJj2CxM1rhyhLZQaOx2+197v+C1rgYraMa ezB9ggBl0SPLbbqlokGpza56QB7MCW8QEntwZ5E8yjk+WiW7AVx2+eVBp64+hDvUttFYYQ w9Cg61w3JmNM6Sb2nnDt0kZ6BZIAur/1tpfevDUD6VTIS7aflgpbgqQiX54UUaKkbTVxyn /41RlZrZnjrpbVTDuZcEBt+PfHHzOb9Y2sFDrAbwiMUW496iGYJk5DkVQCTZRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725539272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rn31P7Onb0EusefCQcM9UG33qkdK8UCrvePUQTrc8Aw=; b=tqZAOmCmcF+YqWTSU7FKkbyy7iCsSryZ4NsFq07GptDLQP+1Wvw+cR9myI+f/Kgbh2d19Z IgdEVvN1/XzGkplNDtdNgemLRy5uFeqHhxx5kQxQxVw4jl8Q5R/CjiYYqaHmjVRWC0LC8i 9d8+TKUGazG90RLmVYI0e+khuw+Kex2dH4kawfaDcT2Mz1ciec8+tBzIBw4VYGLnAIdG4w BHVlp2zyTvyhnAPA7ZC1WLLFQx8XIv3QpZ0+3X8Pn1wOT1ujibgo0usLVH8nJd2tuS/2V4 AUA+EputmRW8LPiKwhlKARWq6DkcgoPxhQWg8wh1idCKSut+76XJDzEQsCtNsQ== 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 4WzzCX32Zpz17S5; Thu, 5 Sep 2024 12: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 485CRqBK029335; Thu, 5 Sep 2024 12: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 485CRq8R029332; Thu, 5 Sep 2024 12:27:52 GMT (envelope-from git) Date: Thu, 5 Sep 2024 12:27:52 GMT Message-Id: <202409051227.485CRq8R029332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7be11454edd4 - main - arm64: Add the tcr_el2 ds field List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7be11454edd4eca6cbd299cb5b486294f912ffbd Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7be11454edd4eca6cbd299cb5b486294f912ffbd commit 7be11454edd4eca6cbd299cb5b486294f912ffbd Author: Andrew Turner AuthorDate: 2024-09-05 12:11:42 +0000 Commit: Andrew Turner CommitDate: 2024-09-05 12:12:16 +0000 arm64: Add the tcr_el2 ds field This will be used to support FEAT_LPA2 to allow more than 48 bits of physical address space. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46392 --- sys/arm64/include/armreg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index a04afd57585c..b4adc3d2c254 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2444,6 +2444,8 @@ #define TCR_EL1_CRm 0 #define TCR_EL1_op2 2 /* Bits 63:59 are reserved */ +#define TCR_DS_SHIFT 59 +#define TCR_DS (UL(1) << TCR_DS_SHIFT) #define TCR_TCMA1_SHIFT 58 #define TCR_TCMA1 (UL(1) << TCR_TCMA1_SHIFT) #define TCR_TCMA0_SHIFT 57 From nobody Thu Sep 5 12:27:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzzCY6GGjz5Vwky; Thu, 05 Sep 2024 12: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 4WzzCY4RR3z4GlM; Thu, 5 Sep 2024 12: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=1725539273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwdbf14aEeqbNaxfdMC+szoFPI0Vj8w1pxNMC6kb4Fo=; b=AmjHv+X+68T5Jn1V3GUWW+js2oXJZfjmUyeoJmdLCStF4wueZfnXdFa2zvRP6QEaUuNEfn tz5hnX/Bkh+xAr+iN1oS8x3RgHX93Cbh56EiDDon5avNjPPGEl0fYse3ftt0KxL8uagzV7 B83lAxY8Irx3DRMuyLenEf0EZDtzVKP718jfU2dTllwVQ5un+/dAo1Ra6YDHMGsxnQcYM2 bNK7+mJ2PkOzBO/3gnUVrUm66PcUmre3K/Tx/wKuvCAAgca8L7+auLShXJjdLx7Cda73jp KdNMziCIQgWkgxfWpNPJyVkRnDCcf2+8QUTL8iU0CONEJEzMWRXyKkdHyoQ/oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725539273; a=rsa-sha256; cv=none; b=c0cYwEEOgG4Fx1/FafSnHgUUOeP/YlInSMqqMTgclX9JHsi6w38NhjuKHOXvWbWQp0gwEu Yse5x0sfHwF2dLO5VelZqAwG7Tnx+aEX5hWA6hWtkwxK0Oo9Op86AVVszVVXTUs+a5Kl5J xVleOiDl1y9X3PeHlTZeu4mhvT2QVAUeI9yEFVGjaUGbdhiW0/Oad5UyQ0nj945MU1KQxJ 1H4rPX8XA76qh/32PeKmTdZiFNhvb+189lXpoRLKVQ8o//qHsGihZQVAIkDZXbD9a/Hv+N +LM0SANG73w2nQcrJ/xCGZ95SSdVzR7xIXZ06kLZ1haazbkbFM+6bp5rLFsXUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725539273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwdbf14aEeqbNaxfdMC+szoFPI0Vj8w1pxNMC6kb4Fo=; b=LIDU6FWCJ5JHzbJlF+kZmo+tTeVhS5hMwryn0q3UD68K9XiOUy8nfzeUnpKA7c0M7R20WD LSPN4StZbzhpbGeRBfC5kxTKN43EKu5nNGAFkxOwL50tVHYJJuRSCe6frsoC4EIUZhYwms If4Z9neFqNox78A8OpB5FRjUq4ds2HVyIMVNCyCWK7P9BXL3+dnvh3O2+8ZrSV6/K00I3V IM/VmsqXJUE/XoB59H6j+6+aCr9SttvyMaBc/+UVPqzoJ1iw5x2gbzJuLKN5oTo5hPIja0 DY38drTyQigKc7gUYrBZDBlnpDg60jkyWAId3rBSo1lTUvZpbzKh03iTxJEuTg== 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 4WzzCY3wHcz178X; Thu, 5 Sep 2024 12: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 485CRra8029377; Thu, 5 Sep 2024 12:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485CRrUU029374; Thu, 5 Sep 2024 12:27:53 GMT (envelope-from git) Date: Thu, 5 Sep 2024 12:27:53 GMT Message-Id: <202409051227.485CRrUU029374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3a3aa2cc0756 - main - arm64: Remove TCR_CACHE_ATTRS and TCR_SMP_ATTRS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a3aa2cc07563e288950affbda6b743487e9d49d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3a3aa2cc07563e288950affbda6b743487e9d49d commit 3a3aa2cc07563e288950affbda6b743487e9d49d Author: Andrew Turner AuthorDate: 2024-09-05 12:11:48 +0000 Commit: Andrew Turner CommitDate: 2024-09-05 12:12:16 +0000 arm64: Remove TCR_CACHE_ATTRS and TCR_SMP_ATTRS These are only used in one place so expand them there. While here always set TCR_SH0_IS and TCR_SH1_IS. There is no advantage to not set them in a UP kernel. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46393 --- sys/arm64/arm64/locore.S | 5 +++-- sys/arm64/include/armreg.h | 8 -------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index ae1a005fd68f..daf8a936eda2 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -945,8 +945,9 @@ tcr: #error Unsupported page size #endif - .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_TG | \ - TCR_CACHE_ATTRS | TCR_SMP_ATTRS) + .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_TG | \ + TCR_SH1_IS | TCR_ORGN1_WBWA | TCR_IRGN1_WBWA | \ + TCR_SH0_IS | TCR_ORGN0_WBWA | TCR_IRGN0_WBWA) sctlr_set: /* Bits to set */ .quad (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_UCI | SCTLR_SPAN | \ diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index b4adc3d2c254..54600d63891e 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2543,14 +2543,6 @@ #define TCR_T0SZ(x) ((x) << TCR_T0SZ_SHIFT) #define TCR_TxSZ(x) (TCR_T1SZ(x) | TCR_T0SZ(x)) -#define TCR_CACHE_ATTRS ((TCR_IRGN0_WBWA | TCR_IRGN1_WBWA) |\ - (TCR_ORGN0_WBWA | TCR_ORGN1_WBWA)) -#ifdef SMP -#define TCR_SMP_ATTRS (TCR_SH0_IS | TCR_SH1_IS) -#else -#define TCR_SMP_ATTRS 0 -#endif - /* TCR_EL12 */ #define TCR_EL12_REG MRS_REG_ALT_NAME(TCR_EL12) #define TCR_EL12_op0 3 From nobody Thu Sep 5 12:27:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzzCc0lKMz5VwWX; Thu, 05 Sep 2024 12:27: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 4WzzCZ4z7wz4Ghq; Thu, 5 Sep 2024 12:27:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725539274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YJOzXPgF0wzgJDEq6CYGdUwehMFHjhbMomFp4inJj54=; b=OwkDySrHf4giyjR9BMb5G8o7dJZUKkbSRFPgcvJEymP/3QHDlQ9+NK37dh/yKjdFjfCa/v q3paKZ6/CKXDh9UPd/rgwsCQC0ARBS3iDMxbMm7habH5rfu2uNtxdBaP8pUCBTR0VelbML gY1DPmdcDfDSEHKvN4U8DIvRXzhsPWjr4OsLlJJHzg095jk85j9UlE4Hb+EEpM19MJZcAi rFsCrvHf7JFDKWiW1D+w8tXXWQX47Es+TxMXIQYLbOdEHD65jdT8FfZTNUDX5GEc1DSooT Cnnpt3iiWtQoVjIIseUqSpfoKGLTLKUb8NqlvIhDmHcjn362WAQIy1gF8lWR/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725539274; a=rsa-sha256; cv=none; b=TZPvuIyRCbCQ8xkjjCQZ2jF7jlvjB6kfePJk6KXfd6HIgDakioXVFUKWl0tK0m57jhH43G ZvAjoJBaH7KzVCBR4L32GSZr1ITzt2hULg7cXGDxhTNwHCGPGC/HyMSVikfLyubQJBdpwi muaOq8uudJr9bwW+imrlkE+YHpMhfPg7krUSTp9Cx6q5+9Dmkz9LfFbGyI9S008US26Rq4 PgyIivO3mmQJkab9Et3kUa8+ArFH3C2j1F85KqtTKWEfTzMPuue18z3sqn0cOPkge39yna apW6TIeDQsh8k/HpC953hX8T6KzsCDd8xH11OvEWuscUi+z3G3EgTo4EIrDX/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725539274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YJOzXPgF0wzgJDEq6CYGdUwehMFHjhbMomFp4inJj54=; b=fl7oyN+vE81d88wKoYzQP/aOPhI9gd150TdkptyHXRctWHJLKpmdb8nI1x1shYywLe12tk erL27PTyL5KYIexJHqeSVPwwnhVUFrHJI9WZoeWvDqLeowzO2XYqGFcviZguFnYGf9cW9L j4L42QxWSLYYQ3apzL6Wu8lxLybttUMVqzM0ouzU6VeYM/kWkhPynrO0jpd/PXVF5Eo6dX tWO9pS3mKJwmSrSVrMxBk1ICvfc2dUY9+P+40Z0Y5rONmBkn7RVrcxaB7Dcq8yd+d69500 dpu4Z1Qx0vn051gcYzA68XoMnn+5TPyo/N0VZkikoLUgL83zGlpVTl56aZMtww== 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 4WzzCZ4RHzz17fW; Thu, 5 Sep 2024 12:27: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 485CRsVh029419; Thu, 5 Sep 2024 12:27:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485CRsbF029416; Thu, 5 Sep 2024 12:27:54 GMT (envelope-from git) Date: Thu, 5 Sep 2024 12:27:54 GMT Message-Id: <202409051227.485CRsbF029416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e2990a9ee479 - main - arm64: Remove ATTR_DEFAULT from pte.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2990a9ee479b7d31bceb75310c0f290cdfb8504 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e2990a9ee479b7d31bceb75310c0f290cdfb8504 commit e2990a9ee479b7d31bceb75310c0f290cdfb8504 Author: Andrew Turner AuthorDate: 2024-09-05 12:11:55 +0000 Commit: Andrew Turner CommitDate: 2024-09-05 12:12:17 +0000 arm64: Remove ATTR_DEFAULT from pte.h ATTR_SH(ATTR_SH_IS) will soon be dynamic as the field is moved out of the page tables in FEAT_LPA2. When this happens ATTR_DEFAULT will just be ATTR_AF. Rather than keeping ATTR_DEFAULT with one attribute remove it. Reviewed by: alc, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46466 --- sys/arm64/arm64/efirt_machdep.c | 2 +- sys/arm64/arm64/locore.S | 4 +-- sys/arm64/arm64/minidump_machdep.c | 6 ++--- sys/arm64/arm64/pmap.c | 53 ++++++++++++++++++++------------------ sys/arm64/include/pte.h | 2 -- sys/arm64/iommu/iommu_pmap.c | 2 +- sys/arm64/vmm/vmm_mmu.c | 2 +- 7 files changed, 36 insertions(+), 35 deletions(-) diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c index 0c46d2e6dcc6..7c1d12b0b9b4 100644 --- a/sys/arm64/arm64/efirt_machdep.c +++ b/sys/arm64/arm64/efirt_machdep.c @@ -214,7 +214,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) p->md_phys, mode, p->md_pages); } - l3_attr = ATTR_DEFAULT | ATTR_S1_IDX(mode) | + l3_attr = ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_IDX(mode) | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_nG | L3_PAGE; if (mode == VM_MEMATTR_DEVICE || p->md_attr & EFI_MD_ATTR_XP) l3_attr |= ATTR_S1_XN; diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index daf8a936eda2..e37ea5aa3b48 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -747,7 +747,7 @@ LENTRY(build_l2_block_pagetable) /* Build the L2 block entry */ orr x12, x7, #L2_BLOCK - orr x12, x12, #(ATTR_DEFAULT) + orr x12, x12, #(ATTR_AF | ATTR_SH(ATTR_SH_IS)) orr x12, x12, #(ATTR_S1_UXN) #ifdef __ARM_FEATURE_BTI_DEFAULT orr x12, x12, #(ATTR_S1_GP) @@ -823,7 +823,7 @@ LENTRY(build_l3_page_pagetable) /* Build the L3 page entry */ orr x12, x7, #L3_PAGE - orr x12, x12, #(ATTR_DEFAULT) + orr x12, x12, #(ATTR_AF | ATTR_SH(ATTR_SH_IS)) orr x12, x12, #(ATTR_S1_UXN) #ifdef __ARM_FEATURE_BTI_DEFAULT orr x12, x12, #(ATTR_S1_GP) diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index 8ee626953aef..ac0a2c2dc96e 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -310,8 +310,8 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) for (i = 0; i < Ln_ENTRIES; i++) { for (j = 0; j < Ln_ENTRIES; j++) { tmpbuffer[j] = (pa + i * L2_SIZE + - j * PAGE_SIZE) | ATTR_DEFAULT | - L3_PAGE; + j * PAGE_SIZE) | ATTR_AF | + ATTR_SH(ATTR_SH_IS) | L3_PAGE; } error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); @@ -330,7 +330,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) /* Generate fake l3 entries based upon the l1 entry */ for (i = 0; i < Ln_ENTRIES; i++) { tmpbuffer[i] = (pa + i * PAGE_SIZE) | - ATTR_DEFAULT | L3_PAGE; + ATTR_AF | ATTR_SH(ATTR_SH_IS) | L3_PAGE; } error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); if (error) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 224ecbdc4577..5f09f4cbcf1b 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -185,8 +185,8 @@ #else #define ATTR_KERN_GP 0 #endif -#define PMAP_SAN_PTE_BITS (ATTR_DEFAULT | ATTR_S1_XN | ATTR_KERN_GP | \ - ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | ATTR_S1_AP(ATTR_S1_AP_RW)) +#define PMAP_SAN_PTE_BITS (ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_XN | \ + ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | ATTR_S1_AP(ATTR_S1_AP_RW)) struct pmap_large_md_page { struct rwlock pv_lock; @@ -1150,7 +1150,7 @@ pmap_bootstrap_l2_block(struct pmap_bootstrap_state *state, int i) MPASS((state->pa & L2_OFFSET) == 0); MPASS(state->l2[l2_slot] == 0); pmap_store(&state->l2[l2_slot], PHYS_TO_PTE(state->pa) | - ATTR_DEFAULT | ATTR_S1_XN | ATTR_KERN_GP | + ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | contig | L2_BLOCK); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); @@ -1200,7 +1200,7 @@ pmap_bootstrap_l3_page(struct pmap_bootstrap_state *state, int i) MPASS((state->pa & L3_OFFSET) == 0); MPASS(state->l3[l3_slot] == 0); pmap_store(&state->l3[l3_slot], PHYS_TO_PTE(state->pa) | - ATTR_DEFAULT | ATTR_S1_XN | ATTR_KERN_GP | + ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | contig | L3_PAGE); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); @@ -1242,7 +1242,8 @@ pmap_bootstrap_dmap(void) MPASS((bs_state.pa & L1_OFFSET) == 0); pmap_store( &bs_state.l1[pmap_l1_index(bs_state.va)], - PHYS_TO_PTE(bs_state.pa) | ATTR_DEFAULT | + PHYS_TO_PTE(bs_state.pa) | ATTR_AF | + ATTR_SH(ATTR_SH_IS) | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | ATTR_S1_XN | ATTR_KERN_GP | L1_BLOCK); } @@ -2111,8 +2112,8 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) KASSERT((size & PAGE_MASK) == 0, ("pmap_kenter: Mapping is not page-sized")); - attr = ATTR_DEFAULT | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | - ATTR_KERN_GP | ATTR_S1_IDX(mode); + attr = ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_AP(ATTR_S1_AP_RW) | + ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(mode); old_l3e = 0; va = sva; while (size != 0) { @@ -2326,7 +2327,8 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) ("pmap_qenter: Invalid level %d", lvl)); m = ma[i]; - attr = ATTR_DEFAULT | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | + attr = ATTR_AF | ATTR_SH(ATTR_SH_IS) | + ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(m->md.pv_memattr) | L3_PAGE; pte = pmap_l2_to_l3(pde, va); old_l3e |= pmap_load_store(pte, VM_PAGE_TO_PTE(m) | attr); @@ -5122,7 +5124,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, if ((m->oflags & VPO_UNMANAGED) == 0) VM_PAGE_OBJECT_BUSY_ASSERT(m); pa = VM_PAGE_TO_PHYS(m); - new_l3 = (pt_entry_t)(PHYS_TO_PTE(pa) | ATTR_DEFAULT | L3_PAGE); + new_l3 = (pt_entry_t)(PHYS_TO_PTE(pa) | ATTR_AF | ATTR_SH(ATTR_SH_IS) | + L3_PAGE); new_l3 |= pmap_pte_memattr(pmap, m->md.pv_memattr); new_l3 |= pmap_pte_prot(pmap, prot); if ((flags & PMAP_ENTER_WIRED) != 0) @@ -5465,13 +5468,13 @@ pmap_enter_l2_rx(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); - new_l2 = (pd_entry_t)(VM_PAGE_TO_PTE(m) | ATTR_DEFAULT | + new_l2 = (pd_entry_t)(VM_PAGE_TO_PTE(m) | ATTR_SH(ATTR_SH_IS) | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | L2_BLOCK); - if ((m->oflags & VPO_UNMANAGED) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) new_l2 |= ATTR_SW_MANAGED; - new_l2 &= ~ATTR_AF; - } + else + new_l2 |= ATTR_AF; if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == VM_MEMATTR_DEVICE) new_l2 |= ATTR_S1_XN; @@ -5694,13 +5697,13 @@ pmap_enter_l3c_rx(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t *ml3p, KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); - l3e = VM_PAGE_TO_PTE(m) | ATTR_DEFAULT | + l3e = VM_PAGE_TO_PTE(m) | ATTR_SH(ATTR_SH_IS) | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | ATTR_CONTIGUOUS | L3_PAGE; - if ((m->oflags & VPO_UNMANAGED) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) l3e |= ATTR_SW_MANAGED; - l3e &= ~ATTR_AF; - } + else + l3e |= ATTR_AF; if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == VM_MEMATTR_DEVICE) l3e |= ATTR_S1_XN; @@ -6091,8 +6094,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, pmap_resident_count_inc(pmap, 1); pa = VM_PAGE_TO_PHYS(m); - l3_val = PHYS_TO_PTE(pa) | ATTR_DEFAULT | ATTR_S1_IDX(m->md.pv_memattr) | - ATTR_S1_AP(ATTR_S1_AP_RO) | L3_PAGE; + l3_val = PHYS_TO_PTE(pa) | ATTR_SH(ATTR_SH_IS) | + ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | L3_PAGE; l3_val |= pmap_pte_bti(pmap, va); if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == VM_MEMATTR_DEVICE) @@ -6107,10 +6110,10 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, /* * Now validate mapping with RO protection */ - if ((m->oflags & VPO_UNMANAGED) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) l3_val |= ATTR_SW_MANAGED; - l3_val &= ~ATTR_AF; - } + else + l3_val |= ATTR_AF; /* Sync icache before the mapping is stored to PTE */ if ((prot & VM_PROT_EXECUTE) && pmap != kernel_pmap && @@ -7741,9 +7744,9 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) /* Insert L2_BLOCK */ l2 = pmap_l1_to_l2(pde, va); old_l2e |= pmap_load_store(l2, - PHYS_TO_PTE(pa) | ATTR_DEFAULT | ATTR_S1_XN | - ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | - L2_BLOCK); + PHYS_TO_PTE(pa) | ATTR_AF | ATTR_SH(ATTR_SH_IS) | + ATTR_S1_XN | ATTR_KERN_GP | + ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); va += L2_SIZE; pa += L2_SIZE; diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index 1f36655a45e2..02eba21448ba 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -111,8 +111,6 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define ATTR_S2_MEMATTR_WT 0xa #define ATTR_S2_MEMATTR_WB 0xf -#define ATTR_DEFAULT (ATTR_AF | ATTR_SH(ATTR_SH_IS)) - #define ATTR_DESCR_MASK 3 #define ATTR_DESCR_VALID 1 #define ATTR_DESCR_TYPE_MASK 2 diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index 8a0ea641e231..dc5c09239c04 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -708,7 +708,7 @@ smmu_pmap_enter(struct smmu_pmap *pmap, vm_offset_t va, vm_paddr_t pa, KASSERT(va < VM_MAXUSER_ADDRESS, ("wrong address space")); va = trunc_page(va); - new_l3 = (pt_entry_t)(pa | ATTR_DEFAULT | + new_l3 = (pt_entry_t)(pa | ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_IDX(VM_MEMATTR_DEVICE) | IOMMU_L3_PAGE); if ((prot & VM_PROT_WRITE) == 0) new_l3 |= ATTR_S1_AP(ATTR_S1_AP_RO); diff --git a/sys/arm64/vmm/vmm_mmu.c b/sys/arm64/vmm/vmm_mmu.c index 1f2d248a743b..42537254e27b 100644 --- a/sys/arm64/vmm/vmm_mmu.c +++ b/sys/arm64/vmm/vmm_mmu.c @@ -294,7 +294,7 @@ vmmpmap_enter(vm_offset_t va, vm_size_t size, vm_paddr_t pa, vm_prot_t prot) KASSERT((size & PAGE_MASK) == 0, ("%s: Mapping is not page-sized", __func__)); - l3e = ATTR_DEFAULT | L3_PAGE; + l3e = ATTR_AF | ATTR_SH(ATTR_SH_IS) | L3_PAGE; /* This bit is res1 at EL2 */ l3e |= ATTR_S1_AP(ATTR_S1_AP_USER); /* Only normal memory is used at EL2 */ From nobody Thu Sep 5 12:27:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzzCd39XRz5Vwj2; Thu, 05 Sep 2024 12:27: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 4WzzCb6nlGz4GZF; Thu, 5 Sep 2024 12:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725539276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9m2ToMS1x66uBGHnJYSmQSMWqTIp2RxB8F7gbrwt78=; b=f/dluPwuJ+Wj7G3TUaK3zIKFm9Zbv0TcFZQeSyzdOWxmj+SvPc5gYhiv2UNM9SbGGPSP7j ypnuWAwDFyLS6FooYlHaaoFbu3ExFzlPRgUNqTp2bbPh742efH95jWYZOseBYL8545JyCZ S9L1lQIVWgM1WXmsy/8pW5aQnLiQLr9k6LuZ/My+2rccugHbRcyTFh/0E9BdHWJUowLjjg jbsRvrvYVT/sSC0GBOCuQDOMK2mZe4N/bR5/6QFnl8ciJwqy/GBRPZuqjeItdHXkaN/M6t OEtHeHELBtAM5ThCu4zNIBFoiTXDGwXfqoWHOMZDjl+pHAS9xKP0e6T6RofvlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725539276; a=rsa-sha256; cv=none; b=KvsJ4gz/dX2QCf5bgII9uRLppjo4O/y4Zk6YklvLGxCbD6ZKG1sRJt4tJ2COx44nREdFx0 +zbYS+txVpHjElwHGK70q3tQ9Ou9Tc/L9zHZ6oZZXx9K9ffUoWjyVu/5QFmValXBaqGBMz cJc5cMrsVu1hE2bXQ9Gl6Fg0xLa1Q7Sh0Y5OZbvYZeheIP6pgxt/O9u3exUeK7uFZMhyVh yk5dPVTBMK7VdiI4higDOK/fVI9WQJV8ad9URNK1NOjNreT0RNT78JzKmGsN8uYQQULSPa LDb8Q38XmBxgkwnjHaw8npFVSzKM09JFjvPZapse9uJYyaLyAYq7SNUwdB2mDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725539276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9m2ToMS1x66uBGHnJYSmQSMWqTIp2RxB8F7gbrwt78=; b=ulFCuGaxUdmEvw53SThBnS+YpRQusni9Wd3eUoX3gEgkYm/7rvyXSvUCeoNi7wG/k3smsK tmeP6VjXFQnqDZr6Dh9ZoOd00hM1oce0MTz9etA1lUqTkPGRYpfUJIBnWcpVtOirJuotgE CY/Dw7c8u8k7yNW1cFWTiKJDg/PsgGrseWsST63vSaQN9lNjS6Ale/N/PWc8CpyjSDYOv2 S6/ZBXAWUom2phtY+6xhYZ2/rygLn3CxGIikk/691cR0/VLBTpARw/BvDHQBk+Mzq33tac TO8fKVCo+YC49uszYJnJKRlOw9b7Jz/GHuLIWB5jfGKt/u052ZKuFlzJ65iVzg== 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 4WzzCb5dRzz17fX; Thu, 5 Sep 2024 12:27: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 485CRtUc029462; Thu, 5 Sep 2024 12:27:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485CRtXH029459; Thu, 5 Sep 2024 12:27:55 GMT (envelope-from git) Date: Thu, 5 Sep 2024 12:27:55 GMT Message-Id: <202409051227.485CRtXH029459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d52c31904218 - main - arm64: Make shareability attributes dynamic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d52c31904218c79424435b69b9ec4098885d800f Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d52c31904218c79424435b69b9ec4098885d800f commit d52c31904218c79424435b69b9ec4098885d800f Author: Andrew Turner AuthorDate: 2024-09-05 12:12:04 +0000 Commit: Andrew Turner CommitDate: 2024-09-05 12:12:17 +0000 arm64: Make shareability attributes dynamic When LPA2 is enabled the shareability attribute in the page table are replaces with output address bits. To support a larger physical address space make this attribute dynamic so we only set it when appropriate. Reviewed by: alc, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46394 --- sys/arm64/arm64/efirt_machdep.c | 2 +- sys/arm64/arm64/locore.S | 44 ++++++++++++++++++++++++++++++++++++-- sys/arm64/arm64/minidump_machdep.c | 4 ++-- sys/arm64/arm64/pmap.c | 24 +++++++++++---------- sys/arm64/include/hypervisor.h | 2 ++ sys/arm64/include/pmap.h | 2 ++ sys/arm64/vmm/vmm_arm64.c | 8 +++++++ 7 files changed, 70 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c index 7c1d12b0b9b4..47e0a209d8b1 100644 --- a/sys/arm64/arm64/efirt_machdep.c +++ b/sys/arm64/arm64/efirt_machdep.c @@ -214,7 +214,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) p->md_phys, mode, p->md_pages); } - l3_attr = ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_IDX(mode) | + l3_attr = ATTR_AF | pmap_sh_attr | ATTR_S1_IDX(mode) | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_nG | L3_PAGE; if (mode == VM_MEMATTR_DEVICE || p->md_attr & EFI_MD_ATTR_XP) l3_attr |= ATTR_S1_XN; diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index e37ea5aa3b48..7c60a2c5bf0a 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -86,6 +86,7 @@ ENTRY(_start) * x27 = TTBR0 table * x26 = Kernel L1 table * x24 = TTBR1 table + * x22 = PTE shareability attributes */ /* Enable the mmu */ @@ -135,6 +136,10 @@ virtdone: str x27, [x0, #BP_KERN_TTBR0] str x23, [x0, #BP_BOOT_EL] + /* Set this before it's used in kasan_init_early */ + adrp x1, pmap_sh_attr + str x22, [x1, :lo12:pmap_sh_attr] + #ifdef KASAN /* Save bootparams */ mov x19, x0 @@ -476,6 +481,30 @@ LENTRY(create_pagetables) cmp x6, x27 b.lo 1b + /* + * Find the shareability attribute we should use. If FEAT_LPA2 is + * enabled then the shareability field is moved from the page table + * to tcr_el1 and the bits in the page table are reused by the + * address field. + */ +#if PAGE_SIZE == PAGE_SIZE_4K +#define LPA2_MASK ID_AA64MMFR0_TGran4_MASK +#define LPA2_VAL ID_AA64MMFR0_TGran4_LPA2 +#elif PAGE_SIZE == PAGE_SIZE_16K +#define LPA2_MASK ID_AA64MMFR0_TGran16_MASK +#define LPA2_VAL ID_AA64MMFR0_TGran16_LPA2 +#else +#error Unsupported page size +#endif + mrs x6, id_aa64mmfr0_el1 + mov x7, LPA2_VAL + and x6, x6, LPA2_MASK + cmp x6, x7 + ldr x22, =(ATTR_SH(ATTR_SH_IS)) + csel x22, xzr, x22, eq +#undef LPA2_MASK +#undef LPA2_VAL + /* * Build the TTBR1 maps. */ @@ -747,11 +776,13 @@ LENTRY(build_l2_block_pagetable) /* Build the L2 block entry */ orr x12, x7, #L2_BLOCK - orr x12, x12, #(ATTR_AF | ATTR_SH(ATTR_SH_IS)) + orr x12, x12, #(ATTR_AF) orr x12, x12, #(ATTR_S1_UXN) #ifdef __ARM_FEATURE_BTI_DEFAULT orr x12, x12, #(ATTR_S1_GP) #endif + /* Set the shareability attribute */ + orr x12, x12, x22 /* Only use the output address bits */ lsr x9, x9, #L2_SHIFT @@ -823,11 +854,13 @@ LENTRY(build_l3_page_pagetable) /* Build the L3 page entry */ orr x12, x7, #L3_PAGE - orr x12, x12, #(ATTR_AF | ATTR_SH(ATTR_SH_IS)) + orr x12, x12, #(ATTR_AF) orr x12, x12, #(ATTR_S1_UXN) #ifdef __ARM_FEATURE_BTI_DEFAULT orr x12, x12, #(ATTR_S1_GP) #endif + /* Set the shareability attribute */ + orr x12, x12, x22 /* Only use the output address bits */ lsr x9, x9, #L3_SHIFT @@ -886,6 +919,13 @@ LENTRY(start_mmu) * to 1 only if the ASIDBits field equals 0b0010. */ ldr x2, tcr + + /* If x22 contains a non-zero value then LPA2 is not implemented */ + cbnz x22, .Lno_lpa2 + ldr x3, =(TCR_DS) + orr x2, x2, x3 +.Lno_lpa2: + mrs x3, id_aa64mmfr0_el1 /* Copy the bottom 3 bits from id_aa64mmfr0_el1 into TCR.IPS */ diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index ac0a2c2dc96e..749c96545506 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -311,7 +311,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) for (j = 0; j < Ln_ENTRIES; j++) { tmpbuffer[j] = (pa + i * L2_SIZE + j * PAGE_SIZE) | ATTR_AF | - ATTR_SH(ATTR_SH_IS) | L3_PAGE; + pmap_sh_attr | L3_PAGE; } error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); @@ -330,7 +330,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) /* Generate fake l3 entries based upon the l1 entry */ for (i = 0; i < Ln_ENTRIES; i++) { tmpbuffer[i] = (pa + i * PAGE_SIZE) | - ATTR_AF | ATTR_SH(ATTR_SH_IS) | L3_PAGE; + ATTR_AF | pmap_sh_attr | L3_PAGE; } error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); if (error) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 5f09f4cbcf1b..dc02e732568f 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -185,7 +185,7 @@ #else #define ATTR_KERN_GP 0 #endif -#define PMAP_SAN_PTE_BITS (ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_XN | \ +#define PMAP_SAN_PTE_BITS (ATTR_AF | ATTR_S1_XN | pmap_sh_attr | \ ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | ATTR_S1_AP(ATTR_S1_AP_RW)) struct pmap_large_md_page { @@ -355,6 +355,8 @@ static u_int physmap_idx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "VM/pmap parameters"); +pt_entry_t pmap_sh_attr __read_mostly = ATTR_SH(ATTR_SH_IS); + #if PAGE_SIZE == PAGE_SIZE_4K #define L1_BLOCKS_SUPPORTED 1 #else @@ -1150,7 +1152,7 @@ pmap_bootstrap_l2_block(struct pmap_bootstrap_state *state, int i) MPASS((state->pa & L2_OFFSET) == 0); MPASS(state->l2[l2_slot] == 0); pmap_store(&state->l2[l2_slot], PHYS_TO_PTE(state->pa) | - ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_XN | ATTR_KERN_GP | + ATTR_AF | pmap_sh_attr | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | contig | L2_BLOCK); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); @@ -1200,7 +1202,7 @@ pmap_bootstrap_l3_page(struct pmap_bootstrap_state *state, int i) MPASS((state->pa & L3_OFFSET) == 0); MPASS(state->l3[l3_slot] == 0); pmap_store(&state->l3[l3_slot], PHYS_TO_PTE(state->pa) | - ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_XN | ATTR_KERN_GP | + ATTR_AF | pmap_sh_attr | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | contig | L3_PAGE); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); @@ -1243,7 +1245,7 @@ pmap_bootstrap_dmap(void) pmap_store( &bs_state.l1[pmap_l1_index(bs_state.va)], PHYS_TO_PTE(bs_state.pa) | ATTR_AF | - ATTR_SH(ATTR_SH_IS) | + pmap_sh_attr | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | ATTR_S1_XN | ATTR_KERN_GP | L1_BLOCK); } @@ -2112,7 +2114,7 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) KASSERT((size & PAGE_MASK) == 0, ("pmap_kenter: Mapping is not page-sized")); - attr = ATTR_AF | ATTR_SH(ATTR_SH_IS) | ATTR_S1_AP(ATTR_S1_AP_RW) | + attr = ATTR_AF | pmap_sh_attr | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(mode); old_l3e = 0; va = sva; @@ -2327,7 +2329,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) ("pmap_qenter: Invalid level %d", lvl)); m = ma[i]; - attr = ATTR_AF | ATTR_SH(ATTR_SH_IS) | + attr = ATTR_AF | pmap_sh_attr | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(m->md.pv_memattr) | L3_PAGE; pte = pmap_l2_to_l3(pde, va); @@ -5124,7 +5126,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, if ((m->oflags & VPO_UNMANAGED) == 0) VM_PAGE_OBJECT_BUSY_ASSERT(m); pa = VM_PAGE_TO_PHYS(m); - new_l3 = (pt_entry_t)(PHYS_TO_PTE(pa) | ATTR_AF | ATTR_SH(ATTR_SH_IS) | + new_l3 = (pt_entry_t)(PHYS_TO_PTE(pa) | ATTR_AF | pmap_sh_attr | L3_PAGE); new_l3 |= pmap_pte_memattr(pmap, m->md.pv_memattr); new_l3 |= pmap_pte_prot(pmap, prot); @@ -5468,7 +5470,7 @@ pmap_enter_l2_rx(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); - new_l2 = (pd_entry_t)(VM_PAGE_TO_PTE(m) | ATTR_SH(ATTR_SH_IS) | + new_l2 = (pd_entry_t)(VM_PAGE_TO_PTE(m) | pmap_sh_attr | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | L2_BLOCK); if ((m->oflags & VPO_UNMANAGED) == 0) @@ -5697,7 +5699,7 @@ pmap_enter_l3c_rx(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t *ml3p, KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); - l3e = VM_PAGE_TO_PTE(m) | ATTR_SH(ATTR_SH_IS) | + l3e = VM_PAGE_TO_PTE(m) | pmap_sh_attr | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | ATTR_CONTIGUOUS | L3_PAGE; if ((m->oflags & VPO_UNMANAGED) == 0) @@ -6094,7 +6096,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, pmap_resident_count_inc(pmap, 1); pa = VM_PAGE_TO_PHYS(m); - l3_val = PHYS_TO_PTE(pa) | ATTR_SH(ATTR_SH_IS) | + l3_val = PHYS_TO_PTE(pa) | pmap_sh_attr | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | L3_PAGE; l3_val |= pmap_pte_bti(pmap, va); if ((prot & VM_PROT_EXECUTE) == 0 || @@ -7744,7 +7746,7 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) /* Insert L2_BLOCK */ l2 = pmap_l1_to_l2(pde, va); old_l2e |= pmap_load_store(l2, - PHYS_TO_PTE(pa) | ATTR_AF | ATTR_SH(ATTR_SH_IS) | + PHYS_TO_PTE(pa) | ATTR_AF | pmap_sh_attr | ATTR_S1_XN | ATTR_KERN_GP | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 4c501e2722a9..1a27a8dd919b 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -241,6 +241,8 @@ #define VTCR_EL2_PS_42BIT (0x3UL << VTCR_EL2_PS_SHIFT) #define VTCR_EL2_PS_44BIT (0x4UL << VTCR_EL2_PS_SHIFT) #define VTCR_EL2_PS_48BIT (0x5UL << VTCR_EL2_PS_SHIFT) +#define VTCR_EL2_DS_SHIFT 32 +#define VTCR_EL2_DS (0x1UL << VTCR_EL2_DS_SHIFT) /* VTTBR_EL2 - Virtualization Translation Table Base Register */ #define VTTBR_VMID_MASK 0xffff000000000000 diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index d604f705e596..c9552ebc326a 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -127,6 +127,8 @@ extern struct pmap kernel_pmap_store; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +extern pt_entry_t pmap_sh_attr; + /* * Macros to test if a mapping is mappable with an L1 Section mapping * or an L2 Large Page mapping. diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index 164ff65cfe2c..80d985241c69 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -396,6 +396,14 @@ vmmops_modinit(int ipinum) #ifdef SMP el2_regs.vtcr_el2 |= VTCR_EL2_SH0_IS; #endif + /* + * If FEAT_LPA2 is enabled in the host then we need to enable it here + * so the page tables created by pmap.c are correct. The meaning of + * the shareability field changes to become address bits when this + * is set. + */ + if ((READ_SPECIALREG(tcr_el1) & TCR_DS) != 0) + el2_regs.vtcr_el2 |= VTCR_EL2_DS; smp_rendezvous(NULL, arm_setup_vectors, NULL, &el2_regs); From nobody Thu Sep 5 12:48:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzzfr5GGfz5Vyhr; Thu, 05 Sep 2024 12:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzzfr4lfCz4K86; Thu, 5 Sep 2024 12:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725540484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gqGzRd5O0D7w8PHoaPcMzfzfqSL0ubY5fb7o4eIRrsg=; b=SXrWmnhJRoRbCOi8jc0+cCOrSwrb/KaaSI2ZjvQGXLgJQDXbGoyjzqNL2dmomXTN6gI8P3 6KcTFaUPf2/J4/35vT2idUpUz43aMdTEzZlqcW1VHydn0HORdzSz1UXjz0phBhLqNWguZs D0IMpFGjIMCR4S//ALRfBo7V9xN2Il4pp0wUsaMHEMnQcEyJsA9Y1RRadm5aD3iZPfReDm e91deJNKLpQwx3T03MI+SzIRCj1+IcAZ3/tfZvB2si5/niPqE5qdyM7Nhq6FZn61tREg14 v7iao+x6CmOG9zCaBUTTHXVYstIo5j7Iw++ckSYd35rpHyFBfmBaXLFHwyQltA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725540484; a=rsa-sha256; cv=none; b=FlP8UFVMZEjOuikCS+JYxX4tCaKUfnem7A8B/BxzhQ554BTTbmR1fZrukMW1l9XHSfDmcN VN/o9fXKlUWcEPlepmohsTdYaG8qoNwMgufRFxYqtB6Bo70WkGHwl8HTTaqpibx4/TZ86X 1nUiH6mwAEI0GSJ9oBSV7IBRFSPOwgnUInsAGJwg/oAq98JVn/+3yG/4xJuuD91a/Z347E +bOskW/NEjUpUmzdXxNV+Bh7o5dLvByrISIl20aw7wC4SxjZhQYV+1UZzNrJSIxsS8kldn XtwZKmu/gqbopbfIfzkLcziRQ7CPNH5vNhN52GQFahMPJcX20H4xnzRqEiS8UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725540484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gqGzRd5O0D7w8PHoaPcMzfzfqSL0ubY5fb7o4eIRrsg=; b=Ca82Z1/ASeSN5fkwzlSL0WF8bUG3TTmptKKEXpMEVjSqYXjfjxQLceWAxflqpW8BjTTf6H ZJdCGdn3APo9Z0gYxBQM7Xs5OpQ4DuPz/0B8qUfpaJE3YCVBwj1/yVW4k0Aa13ir01ijzL 0Zk+WvB47zu0glolZ3Br1mK+giQgUN3dqasK/Web261+gnNpFY1SJLG5lyhVDqN7vCxIN1 VZ6hSE0I2lI/Y3xPgv1UZhtD8qYdvOn+wjigPlHojjQGTiyj3kZk2HmvNCyE/hqgEs27uK bHn4kI0qBU42u+/clNa55fI0SNaIkSy3WVP/D1nqXqVg0NaX1ERhrZNPUxeGvg== 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 4Wzzfr4Lw2z17RZ; Thu, 5 Sep 2024 12:48: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 485Cm4M1063075; Thu, 5 Sep 2024 12:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485Cm4kx063072; Thu, 5 Sep 2024 12:48:04 GMT (envelope-from git) Date: Thu, 5 Sep 2024 12:48:04 GMT Message-Id: <202409051248.485Cm4kx063072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f5c7feee7129 - main - LinuxKPI: add general module_driver(), use it for module_pci_driver() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5c7feee7129dc88a2e5dc3ce0a075cb5e4f534a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f5c7feee7129dc88a2e5dc3ce0a075cb5e4f534a commit f5c7feee7129dc88a2e5dc3ce0a075cb5e4f534a Author: Bjoern A. Zeeb AuthorDate: 2024-08-28 14:21:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-05 12:46:21 +0000 LinuxKPI: add general module_driver(), use it for module_pci_driver() Factor out module_pci_driver() from 366d68f283793 into a general module_driver() so other bus attachments can also use the same kind of macro without duplicating all the lines. Redefine module_pci_driver() using the new general macro. No functional changes intended. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D46467 --- .../linuxkpi/common/include/linux/device/driver.h | 33 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/pci.h | 21 ++------------ 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/device/driver.h b/sys/compat/linuxkpi/common/include/linux/device/driver.h new file mode 100644 index 000000000000..03b510c9c8b7 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/device/driver.h @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Bjoern A. Zeeb + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. + */ + +#ifndef LINUXKPI_LINUX_DEVICE_DRIVER_H +#define LINUXKPI_LINUX_DEVICE_DRIVER_H + +#include +#include + +#define module_driver(_drv, _regf, _unregf) \ +static inline int \ +__CONCAT(__CONCAT(_, _drv), _init)(void) \ +{ \ + return (_regf(&(_drv))); \ +} \ + \ +static inline void \ +__CONCAT(__CONCAT(_, _drv), _exit)(void) \ +{ \ + _unregf(&(_drv)); \ +} \ + \ +module_init(__CONCAT(__CONCAT(_, _drv), _init)); \ +module_exit(__CONCAT(__CONCAT(_, _drv), _exit)) + +#endif /* LINUXKPI_LINUX_DEVICE_DRIVER_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 9457599d31d3..36b970154ad2 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -36,6 +36,7 @@ #define CONFIG_PCI_MSI #include +#include #include #include @@ -274,24 +275,8 @@ extern spinlock_t pci_lock; #define __devexit_p(x) x -#define module_pci_driver(_driver) \ - \ -static inline int \ -_pci_init(void) \ -{ \ - \ - return (linux_pci_register_driver(&_driver)); \ -} \ - \ -static inline void \ -_pci_exit(void) \ -{ \ - \ - linux_pci_unregister_driver(&_driver); \ -} \ - \ -module_init(_pci_init); \ -module_exit(_pci_exit) +#define module_pci_driver(_drv) \ + module_driver(_drv, linux_pci_register_driver, linux_pci_unregister_driver) struct msi_msg { uint32_t data; From nobody Thu Sep 5 13:46:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X00xz0Cnyz5W4rb; Thu, 05 Sep 2024 13:46: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 4X00xy6cDXz4R6R; Thu, 5 Sep 2024 13:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725543974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ap+mCZw7exj5xekXuDnY64HJSm22CdV9MKkUPnzqOLM=; b=ssKES+txhCaWx6iR2tI4b2RR4nSr8q7rQNHZ8fXG42qieS1nzkvsw5Gkg6uIIlK2UwSzg9 2zreskfi0ewD3Irh7mHsyqiFpRiVlP71h6xcUa3q0knhJ0Eiuhdiou00yFxukSgyc+gwKE aefh6RDU/YOT4v/c5rLyfZGgiyYeCzvLf7Umc+25R80RYVCUnIk2wK8sUMDFzKoGe79AZI sLzRgjxfojG6q72rrwGeJRa5u8VVRwQvRGJfc9QjshbUhRv61A9lYM/eIzigVpDsaalKND oK1sI/lXCWsKZ56OPV+2P3y3E43F4Vn/OOV045OOhrxmbloeC1NjGVGaCkJTuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725543974; a=rsa-sha256; cv=none; b=yaKf+MAKWdJvNC+4rN9ELOrWYhb7GJH4+Y3m/Sd7yyrEit2NCTOdtMZklU3xG6e/9fWG0j MyJJIaNNLTYYY6OLrn+dQSqo5K89nVV0aMoDtuIjk4HN0W7z4EvtGnaoIklNw2HcVkEiCP w/saKZ6QIMgY/su1Bjd8mlIIK0Z+O/Gk3qv0c2xYMIcisiX94DJb8Lc+AaxAgRjhc+u2PD JupfT4y/ohme404M5ARtIuCfh3wi7t7C+0gH+N/WbwVM83ApE1lJBIdUvaAjbkvPttwaUN rSuvnMcWxkifTRJ+9CgD6hronJ4mCNjMBLxC5wT/Yhmjut2YR4zZWbg/5QoITg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725543974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ap+mCZw7exj5xekXuDnY64HJSm22CdV9MKkUPnzqOLM=; b=f/umcDeTiLSGK8R8ldLWIDpvq5ejFg5qye+bF0Ovk3KuoDxN8sNAx1nLjtXy0UxLOznAkQ Xnxl35snrvVx63BufRY/QXpGVXwSbo8I+4OvExjAHfkFYr/xXTe2jicb68QG8q2BBYMOQu TiluoAiCtpypZkR9CqiETP02oizXK6Ud289+GKVL76n1t1fiVkjkdnPhzBv/9VtF8vWLKm c3aNq1jsibZJtKIHN2wOAB7G3rtAmYOsQAl5mYXwFmEz93c3rD+eX+Yb8iCf9EoAfNH3CH DY7E3NNnCo9XIQnPblq2ZuYr4xXZbdk12dq1j7CJNXsumWQwBpz6RMS8oyHGXA== 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 4X00xy5xhNz18vh; Thu, 5 Sep 2024 13:46: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 485DkELN065135; Thu, 5 Sep 2024 13:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485DkES4065132; Thu, 5 Sep 2024 13:46:14 GMT (envelope-from git) Date: Thu, 5 Sep 2024 13:46:14 GMT Message-Id: <202409051346.485DkES4065132@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: 1e999a3ae1ac - stable/14 - atomic: Avoid casting the return value of atomic_load_ptr to void HEAD branches config description git-daemon-export-ok gl-conf hooks info objects packed-refs refs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e999a3ae1aceaaf84add14461243afe8ff45e39 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e999a3ae1aceaaf84add14461243afe8ff45e39 commit 1e999a3ae1aceaaf84add14461243afe8ff45e39 Author: Mark Johnston AuthorDate: 2024-08-28 18:51:06 +0000 Commit: Mark Johnston CommitDate: 2024-09-05 13:44:00 +0000 atomic: Avoid casting the return value of atomic_load_ptr to void * Otherwise a cast is needed to load a uintptr_t value. Fixes: e1f4d623779d ("rangelocks: remove unneeded cast of the atomic_load_ptr() result") MFC after: 1 week (cherry picked from commit c7a7e997d25d0b33769252d002b16839c864c83d) --- sys/sys/atomic_san.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index eb6913296a45..ef81b4b7c51e 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -266,7 +266,8 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); #define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr) #define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr) #define atomic_load_ptr(x) \ - ((void *)ATOMIC_SAN(load_ptr)(__DECONST(volatile uintptr_t *, (x)))) + ((__typeof(*x))ATOMIC_SAN(load_ptr)( \ + __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) From nobody Thu Sep 5 13:46:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X00y00FVVz5W4rj; Thu, 05 Sep 2024 13:46: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 4X00xz6lj0z4R1x; Thu, 5 Sep 2024 13:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725543975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sIxx/FS5bJvca0vo3RvWHGmxYmMScEN77eS9Hoe7k8Q=; b=lpBSIG3MJXQjcOeTq8fTQm80JaRYAt4wHu+NHZnOarwan0T47SZxBvrixWXtjPWNWsaGIq FaHKc675Y4Un2XMesLEXLW7Ul0UaPYVZT+ZhP1/MqESmo4wZ8/fRdC1RWsDrCaRUu71uaR C8bkQ5Ztkk2VEzD7L1kIh6z2E9a3mWo0gFYv2f7X6ZHHDU9XFMSlN6WJvKzcZtBaSE5UVh DbKkC+NlWr1OrA7vFkmjsSR24XM/06Vg/yRcp3VluuRB3I+ExkLfWCjMIl92OwNWcNqp9D vhFWiLgLwCIvHM6CrOTrMRZM0YjxeyUMxEK7xc40lvqdoK3bfYvNXLsWrYXZSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725543975; a=rsa-sha256; cv=none; b=dSK4Dw7FIqrl8hYqmfscbJ9b0s8AHaQvn7qQuR/tMX+00z7NZAXpeX/j6UhBn8rZp1RI7n 79g8zHsimoKjxNY8uzY2BblbVzVGMLsMR3RvANDpsMWxOjabycpjajnRmJuyrw5SW192gy dkwG+xnDVKGJAMzJHwN4erVrMfAbe+XNzlk7J+8MTCi5JMtJ5bFh46+lm2Uv+G6UaG6y8s hcO4PF7nHGMD22zau9zCms9rlbxEuBwQ0kgG6Quq1Lhrx1GlZslpmdG47BZ3c5KPURvLod wyMuWY2x0PMTFTjTwHjdwElfrpdJhSRevrJ89G+jSjYZe1yEfK5MUFJu4AEt+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725543975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sIxx/FS5bJvca0vo3RvWHGmxYmMScEN77eS9Hoe7k8Q=; b=jbABcuizHsYEp2AOTXFCgpgxR3ZB7bzQ03sQWgp9VU5e3R27vevxsR1MutJodmqCtmvoQ8 T4rTSVx+YabUOfg8CElYnSWj2EltpnJCbCd3G2Psk7DJUT7678Kzu/bhwLL/npAMUR/IIg ejwl2lGBuX9Lm8hUTzoQNUHuXx3+c2sebCJg7wG+OwsilNZ+X6U8bNO2IuKItO4FMkDo8B Bz4DQ9qG9FwOg4iJRgVGB5xC28DONScv+HBGXn89182IVNsil/bhZhZ1t+VPLy03soA2pT Fqcl5u3dlA0GiKiQlQMwYW56qBo8nNTRyOzbuoU/lEJrJMJhXYQ4ou3AO1or4g== 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 4X00xz6Ldcz18vj; Thu, 5 Sep 2024 13:46: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 485DkFx5065195; Thu, 5 Sep 2024 13:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485DkFdc065192; Thu, 5 Sep 2024 13:46:15 GMT (envelope-from git) Date: Thu, 5 Sep 2024 13:46:15 GMT Message-Id: <202409051346.485DkFdc065192@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: f3e22a08ca69 - stable/14 - atomic: Fix the cast in the atomic_load_consume() interceptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3e22a08ca690bf3a80688641b9705aa2e1cb15c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f3e22a08ca690bf3a80688641b9705aa2e1cb15c commit f3e22a08ca690bf3a80688641b9705aa2e1cb15c Author: Mark Johnston AuthorDate: 2024-08-28 19:25:11 +0000 Commit: Mark Johnston CommitDate: 2024-09-05 13:44:00 +0000 atomic: Fix the cast in the atomic_load_consume() interceptor As in commit c7a7e997d25d0, we should permit loading from a pointer to uintptr_t. Note that the other atomic_*_ptr() interfaces currently require casting regardless, only those defined in atomic_common.h try to be generic. Reported by: jrtc27 MFC after: 1 week (cherry picked from commit cb91dc50950ffdfd49337e844e231b69b8b5c634) --- sys/sys/atomic_san.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index ef81b4b7c51e..e22324b87623 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -270,7 +270,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ - ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) + ((__typeof(*x))atomic_load_acq_ptr((volatile uintptr_t *)(x))) #define atomic_readandclear_ptr ATOMIC_SAN(readandclear_ptr) #define atomic_set_ptr ATOMIC_SAN(set_ptr) #define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr) From nobody Thu Sep 5 13:46:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X00y15Kxxz5W51t; Thu, 05 Sep 2024 13:46: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 4X00y115MGz4QtT; Thu, 5 Sep 2024 13:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725543977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6XLeeXBboPqbcPa1sSueVGhPTJqXy8V0D46mrHUxSo=; b=Ykt5WCjM3uqLQ3g4/buheXaXLJwYYnhECXWc4GtIaCiKKPx2eXVpnmcuPvpbuAmmT2o+gY SB4JOvMA9pP/tj5bCTtbA6YmJy/vCidgMPV0hk6+UZ66vF77Y7BvzN6a8CWZsUQWOs2j4b VIKElLwoogXwxpB2yfSdMCIRDnfRJPu7QoP5f9V5YZdHl9TzoswlqlURbq7knAhk1IuJzc OmkIiZ6J2Rn3t723iNfC6z34z5PI+6+Uc0K1LI1NaIQlG7UmYshxO9eb5+iy9oPAVY21vO LwzOjl5ymcL1JU9Y2s/iGBHgJcK5qYYCUDPxAweqNb7186a4NHzRpfg0rqnABg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725543977; a=rsa-sha256; cv=none; b=oRB6hzp0zXhWTKDXO95And1ae875I3sy+VOZGCFYc01NQ+vDU+6SYHGGyUgnF1gqLGcH5N eVW0njjI0SuIF9wGIQcC69HEd3+5dq++QiVEeJFCACBvlQlaPcO5QS+TdxJPKT19T7XaZx CQQ7C8yPt/CmCoPHcorzLY2TgHMJQKSGNDQDgMk1nQnlJrA2VaEMOa8X2VnRmVxa6H4Gs0 YwY2HQruKQi4ItMFhbmLK/DB0S4HVaZhAOT8vyjPXwPvo2gunqH64TZZ0S/h+z5X1bRJ5n xctXW5dm27xAlkPIqCHa/4Fr96Pzems9vq4wGM7vnuwhkK1ExvW8pIzXOsRnfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725543977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6XLeeXBboPqbcPa1sSueVGhPTJqXy8V0D46mrHUxSo=; b=kmZ32DNJUC2GTYdypKt37Ao263pYfs24UnAwzox4mayJM7mg2se8Nq9VGIVGFgC+e4kUgh xdnUdqwek7UAij75yD3vGB0ba2nKjDfIWq0sbiB5HNPzu891bARHOVurixb6dndC1izx4k lnFpfJN0Rfp26dicrjCJ7hFej9Ru0K1tJIIvnSHh6Aak91M/eFM9QfwY7ETacpM2xRB0f/ n/MYadVwtD6rKga2sPaNJtb06LhCK+PQ1r3syTS07sduIQZJbIlaYLMp1Y1kKzjvaXH5Dw +Bm8HHVl0Uxf27xsCD0FZQSpPupbu6GeSIFeMJdyWtWPUgDz6CYTqwWJVXhf2w== 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 4X00y10CWXz18WK; Thu, 5 Sep 2024 13:46: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 485DkG8L065240; Thu, 5 Sep 2024 13:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485DkGZB065237; Thu, 5 Sep 2024 13:46:16 GMT (envelope-from git) Date: Thu, 5 Sep 2024 13:46:16 GMT Message-Id: <202409051346.485DkGZB065237@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: 57e0d4b9a609 - stable/14 - agp: Set the driver-specific field correctly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57e0d4b9a609cc2fe267489a3fe46857035ed3ae Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=57e0d4b9a609cc2fe267489a3fe46857035ed3ae commit 57e0d4b9a609cc2fe267489a3fe46857035ed3ae Author: Mark Johnston AuthorDate: 2024-08-29 13:12:19 +0000 Commit: Mark Johnston CommitDate: 2024-09-05 13:44:03 +0000 agp: Set the driver-specific field correctly PR: 281035 Reviewed by: mhorne MFC after: 1 week Fixes: 437ea82ce7fc ("agp: Handle multiple devices more gracefully") (cherry picked from commit 12500c14281dc62ddeac4c5e1e6eabd1e380f11c) --- sys/dev/agp/agp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index f7eb906fc57c..8db1e13f08de 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -254,7 +254,7 @@ agp_generic_attach(device_t dev) mdargs.mda_uid = UID_ROOT; mdargs.mda_gid = GID_WHEEL; mdargs.mda_mode = 0600; - mdargs.mda_si_drv1 = sc; + mdargs.mda_si_drv1 = dev; mdargs.mda_si_drv2 = NULL; unit = device_get_unit(dev); From nobody Thu Sep 5 13:52:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X015S59Csz5W5W6; Thu, 05 Sep 2024 13:52:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X015S3DMSz4RxP; Thu, 5 Sep 2024 13:52:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-4568fe680a3so4560391cf.0; Thu, 05 Sep 2024 06:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725544363; x=1726149163; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=5bGZGb3RXiGbV05JoZAS8d6zNmB36tSHn18H6zLiLQI=; b=MVlTm3lq73WvnysmXNVQBKYJx6XTWV+7DmVhntoNLBgflWwMWgXwXliUIwwWRLdW7X tSTn0d6LC4zt/8OQJVCHqOvBkOEABA+sVxt1m9A9Sdpn3HdSxV+EPV3RoWsgisfw9i/k iwpuePzwyXQltB/7v63Adke65QScI078F65J4umV3aFVhYQfFpU5MUkk1L1wANHhRRYe W4837/b1wwdbmGafulE77pNY790D/UeEVbTDS7zJhKx6RFx29sYCwY837XWwwrMBL6bd ppXSOLNXd2XTJG9okpa92HAAdGcSYNlKkaHOh2EKr1GKSrUsjO1Z+f0ldvi57xD9yECz gs7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725544363; x=1726149163; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5bGZGb3RXiGbV05JoZAS8d6zNmB36tSHn18H6zLiLQI=; b=Y16jbff3X1lGojSzBZ94hIBww35sBHmKDv0kl86A73qANS24K3nh1Pdy1RKAk+DHmZ kIR7gdhuGOAFVwYXjYPzEBSE+P2l7zMMMglXsbldYSWU95AgL+kjKHkxyRRvPk1RhVkm SxH1joyb7P/CG+Vf/h+cMeAERnPD1+u+ITzVU7g97xUlTHOLK/AzTCtXHkQsi2kQna7P Qfp/GXysgB7Tm7Q/4s+mqcB+dOlB5UOogvw5x4nETtZsxyVRdjCulSLr0xyGVCHujloK HwHT2qY2T1vlkRWeFpvexmCqKlNYEAGgwc9NhdLkyr2bF2+GbMIGdhsGe1x5Hs00etT3 Gw5w== X-Forwarded-Encrypted: i=1; AJvYcCWUM5tL5juRSbSOXLtI/q3rdwiVcqYSZ14yzSIWsKGqQUrZBqURO13SnoNrTqIQopRIN/OAEzFqkeYf61R/Ucluux/i@freebsd.org, AJvYcCXXnv/ioQOVejbRS8zcMZzS8OipMcavQpafyjnHsM6FPKT1kT7YQXK6s+xVIBNo089JFcLx9sIYw0yxEjzC6B73+0AdU7A=@freebsd.org X-Gm-Message-State: AOJu0YyIxECNSClefVbteHc5nyyNzBNxiIo+wFwrGDEdJ7jEY4LnjLqU jpHww1JCVa10o03ftP+M4SgvN6mcXjdRDHHkxQPUS21UchsJ2uXJMHJecw== X-Google-Smtp-Source: AGHT+IHotTQe97zQ/ZPfltjQI7ImY1seepUSm1ABLTByQnCzaGtpFl/Duony74ss6KAEj8QuKmkBkg== X-Received: by 2002:a05:622a:6103:b0:457:cb51:2cd4 with SMTP id d75a77b69052e-457e2f51ff2mr102026961cf.45.1725544362502; Thu, 05 Sep 2024 06:52:42 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45801b31e67sm7262511cf.21.2024.09.05.06.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 06:52:41 -0700 (PDT) Date: Thu, 5 Sep 2024 09:52:39 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fc12c191c087 - main - grep: Default to -p instead of -S. Message-ID: References: <202409041953.484JrvPY028856@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202409041953.484JrvPY028856@gitrepo.freebsd.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X015S3DMSz4RxP On Wed, Sep 04, 2024 at 07:53:57PM +0000, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=fc12c191c087b63e1204fee210ba76082ea40b96 > > commit fc12c191c087b63e1204fee210ba76082ea40b96 > Author: John Baldwin > AuthorDate: 2024-09-04 19:53:22 +0000 > Commit: John Baldwin > CommitDate: 2024-09-04 19:53:22 +0000 > > grep: Default to -p instead of -S. > > This matches the documented behavior in the manpage as well as the > default behavior on macOS. Should this get a RELNOTES entry? > > PR: 280676 > Reported by: RadosÅ‚aw Piliszek > Reviewed by: kevans > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D46256 > --- > usr.bin/grep/grep.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c > index 9f960f74dbb6..feaf17d7c1e1 100644 > --- a/usr.bin/grep/grep.c > +++ b/usr.bin/grep/grep.c > @@ -112,7 +112,7 @@ int binbehave = BINFILE_BIN; /* -aIU: handling of binary files */ > int filebehave = FILE_STDIO; > int devbehave = DEV_READ; /* -D: handling of devices */ > int dirbehave = DIR_READ; /* -dRr: handling of directories */ > -int linkbehave = LINK_READ; /* -OpS: handling of symlinks */ > +int linkbehave = LINK_SKIP; /* -OpS: handling of symlinks */ > > bool dexclude, dinclude; /* --exclude-dir and --include-dir */ > bool fexclude, finclude; /* --exclude and --include */ From nobody Thu Sep 5 13:55:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X018P21gWz5W5k1; Thu, 05 Sep 2024 13:55: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 4X018P0Gx3z4SV8; Thu, 5 Sep 2024 13:55:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725544517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ls/DmXVd3+Z4YxWmEUaKZrWE4jUNNZV7G94lEEBTKeA=; b=QhBUAF+aEYWxXAzv+v+WLd0s5V1CVRPnONoCNZ7xorrX89RDJYokOZ45C0rids/M++MloV mS7jupeHCT8UOnf5qXn0mlNMWkO+QZB2IQ1kGvrtVFJelH6/SzpXfRPVzOrrs8LPQAE/fE 9Val5Xn0pdS5Q9OLbPOBY1+Y8ue1EsE3/yrWlp1COfffQeR/EIKurXppLDtkIPxHritLgn 0+VmJoPAexesELlgUScQuWSI0084ZDwupVWqJ+D6eF+6ROmDuv6u1dHMnFh9YGKOo/q7xL haEHeyMZeUM8KwWaDTBBKpl6qk8x6fREtN8aZ4MhQumCh8a8Pw/REBDAxy7DkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725544517; a=rsa-sha256; cv=none; b=PxauKwk0ERmlhbRmWXHP3LmRz/4sS5Va/eTK8q8CStPpl1nupOUUfOiEZ7N4wPJxU5yrEN e8K4QCpA6xNpvFL1OOXrwimFolPO/sSAXrr6cGTLVBHN6r7Xf5Dzhxhvmjvk8zOHxjIG0I odydibC1TasIirRKkQc7dg5Ln6wqYCAOG5JqPxs6Cupb94Szt0hD4/RUCmsmV2OuBpwonY fsj8CcSAdKugu9v1fLzaLrC3dZw2x4BoW7gLSuTrldc1+KbvN3lpo45OuqG2JALeSizpj3 rrdKIWeKQaKtMOH07hGkzc3dynGaU/3ms/x3+/OudflwD48ICGlXMwSIYbaYTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725544517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ls/DmXVd3+Z4YxWmEUaKZrWE4jUNNZV7G94lEEBTKeA=; b=oG4aTXxFHfAGfXcCI0lvvCb9fFxlIwjcmnmF1wOymL09GxMi1toUbW5pNn7SebPxJjSsFT +aZtuL7jJEVSb0zsZgraI9TLVMuD0xFIw486BFrydmXXhT/WZJApZo32hPpHUr41ttSawa 9z3uG7aTp6/hYbSRf6cBfT3mzl5WhXD+Ec9mu3UXLucNav2dW6kIcY8XaC+MwidQNiNLEh N9xYl8Iw26Igj/C25qF3AohXcBm1FyldLdaSMdIkN+MNHuY85/TOA7Nw9ElYe1Jcuirp5C LoLQtnaF4rR/iARb3aVu2vAnfprSY/H5PgSUtnVbD9DZXyQne01UsMh0UoVyzg== 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 4X018N70Btz19cl; Thu, 5 Sep 2024 13:55: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 485DtGfD081558; Thu, 5 Sep 2024 13:55:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485DtGuQ081555; Thu, 5 Sep 2024 13:55:16 GMT (envelope-from git) Date: Thu, 5 Sep 2024 13:55:16 GMT Message-Id: <202409051355.485DtGuQ081555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: d8fffc3704a0 - main - imx_gpio: Add gpio compat string for imx8 SOCs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8fffc3704a0d7f4ea5b866f689e58480ddebaa1 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=d8fffc3704a0d7f4ea5b866f689e58480ddebaa1 commit d8fffc3704a0d7f4ea5b866f689e58480ddebaa1 Author: Tom Jones AuthorDate: 2024-09-04 15:32:56 +0000 Commit: Tom Jones CommitDate: 2024-09-05 13:51:37 +0000 imx_gpio: Add gpio compat string for imx8 SOCs Several imx8* device trees have a compatible gpio controller which identifies as working with the soc and imx35-gpio. Add a compat string for the commonly included 'imx35-gpio', rather than adding each to the table. From a grep of our dts mirror this includes the following arm64 SOCs: - imx8dxl - imx8mm - imx8mn - imx8mp - imx8mq - imx8qm - imx8qxp Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46532 --- sys/arm/freescale/imx/imx_gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/freescale/imx/imx_gpio.c b/sys/arm/freescale/imx/imx_gpio.c index c5e92992a36b..7610d28af90e 100644 --- a/sys/arm/freescale/imx/imx_gpio.c +++ b/sys/arm/freescale/imx/imx_gpio.c @@ -134,6 +134,7 @@ static struct ofw_compat_data compat_data[] = { {"fsl,imx6q-gpio", 1}, {"fsl,imx53-gpio", 1}, {"fsl,imx51-gpio", 1}, + {"fsl,imx35-gpio", 1}, {NULL, 0} }; From nobody Thu Sep 5 14:05:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X01NQ6JFKz5W6SG; Thu, 05 Sep 2024 14:05: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 4X01NQ5cNcz4Tfc; Thu, 5 Sep 2024 14:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725545142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=827YhUn5LPJSOgfoPSPDPjoYPxOR6KfhVUD1/nyHcbA=; b=YGBRRZI25QSezk9SYcUswaiRbBrwQ0aJvoTKJolESlhKWiOOL4pHBH0SjqUYO3YnxfoS8j UteJpyECW9NaUMSCPM8E9WivcOuAEnwDWg9MduJGRDg2wWwrC8O3JtGEG/rIJ4gzeWGpoX EblHgYALJXwC7XQx9c+OkrLi1b/lQWTSMTaze3Dp9L+az6Ed3+P0rBJ7ck6bS1fccZnRX8 PncNlcG+6zo3QxWUWuLdJiYjINfF5oclVjXCESqtg5wpj1c/asfmEgQp+HV/pXF53ra2MC ldMFmaQRpwrGoGE3fDzx7gCZz9Wnnj4cAx1IxskmWk/RlRijaVmcyGOGSgkTwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725545142; a=rsa-sha256; cv=none; b=Ilp9BqMhoNSz8YEZRdMEMAbFtDR4IfC2KYz9HeZ2STi8sPrdUZzg9FCk7j1hue9DH/PogT T/cF9ajpcmGmG2IKqfVtwF7WyNv9VwW8SWlA4GGjcGJ+rj3Q9N7XBM/COyCip4C/b4q9Fw DDRKK8nboyDMPDQJhkiQbI2XH2m3DZtK14ZZu60x0RjgLWVwftupKhSiyNzonsLXAseE4F DCsJru0WeM1g7gYfCpLqztB6KsQwqVwVq0BeoBGLtPEwekc+HL1f/EcMuJXCq69TTQaSf0 v7kDX6ayyQh9d0alXmSeA0kGUFgP0H+FzORRsKF6O0mox7RoTZkdFRV30lq8Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725545142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=827YhUn5LPJSOgfoPSPDPjoYPxOR6KfhVUD1/nyHcbA=; b=j3LoAhKixvzFNt4vzOWlBvpU1YknolWUwqGwj1CRthd0H/lQgY+ZliSRi+SwrGSZyVbG6c hOqDmFjplv0zsDyQz5ILWDiZlsM1W7xXej3m8gxFFqcY2LEFzM2luhSnaCW6Wl2arX31b4 1ltf1b9Dl0htWAheMO73T9P+zhQcYZe71EfY/U8gCz6HjLIfuL803gTWh9II5WXCQVwC+s rFf8LWo50OuS71zZhh9Mogfu0CKb6ExreDdCX10ht6G/DaZ1Xsi1jc8ib6fhmCEdttf30z P3kKsj3wPb4gvGjT3aUhExzi5sLW3ZcX0/8ugJm+M8iPWheNFMnejDRSXXRIYQ== 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 4X01NQ58dFz1B8q; Thu, 5 Sep 2024 14:05: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 485E5gXA099351; Thu, 5 Sep 2024 14:05:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485E5g0F099348; Thu, 5 Sep 2024 14:05:42 GMT (envelope-from git) Date: Thu, 5 Sep 2024 14:05:42 GMT Message-Id: <202409051405.485E5g0F099348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Pietro Cerutti Subject: git: ab7a79806e31 - stable/14 - libfetch: don't include fragments in HTTP requests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gahr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ab7a79806e3103accb1ba2d89ba51e977704a2e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by gahr: URL: https://cgit.FreeBSD.org/src/commit/?id=ab7a79806e3103accb1ba2d89ba51e977704a2e3 commit ab7a79806e3103accb1ba2d89ba51e977704a2e3 Author: Pietro Cerutti AuthorDate: 2024-08-21 12:35:27 +0000 Commit: Pietro Cerutti CommitDate: 2024-09-05 14:05:15 +0000 libfetch: don't include fragments in HTTP requests Fragments are reserved for client-side processing, see https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1 Also, some servers don't like to receive HTTP requests with fragments. ``` $ fetch 'https://dropbox.com/a/b' fetch: https://dropbox.com/a/b: Not Found $ fetch 'https://dropbox.com/a/b#' fetch: https://dropbox.com/a/b#: Bad Request ``` This is a real-world scenario, where some download link from dropbox (eventually) redirects to an URL with a fragment: ``` $ fetch -v 'https://www.dropbox.com/sh//?dl=1' 2>&1 | grep requesting requesting https://www.dropbox.com/sh//?dl=1 requesting https://www.dropbox.com/scl/fo//?rlkey=&dl=1 requesting https://.dl.dropboxusercontent.com/zip_download_get/# ``` See how the last redirect ends with a `#`. Currently, libfetch includes the ending fragment and makes it impossible to download the file. Differential Revision: https://reviews.freebsd.org/D46318 MFC after: 2 weeks (cherry picked from commit 1af7d5f389536a2f391153513d95d92ffdf360e4) --- lib/libfetch/fetch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 8cb3536a46c5..6e14a62ca596 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -448,7 +448,10 @@ nohost: goto ouch; } u->doc = doc; - while (*p != '\0') { + /* fragments are reserved for client-side processing, see + * https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1 + */ + while (*p != '\0' && *p != '#') { if (!isspace((unsigned char)*p)) { *doc++ = *p++; } else { From nobody Thu Sep 5 14:50:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X02NH3X1gz5WB1j; Thu, 05 Sep 2024 14:50: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 4X02NH1N6mz4c9l; Thu, 5 Sep 2024 14:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725547839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/tSjF8iixQZBgi8ayJcP/gRVWpyuYvGQP9AWDeaJjY=; b=QwxpSTVgQKDeMqmhQBgrM5fCVSV6tKtfqQSTHABmlGmXluEUefq+ooz8RNmRzSED5g47yy wXAY0HEST8vM4/i9BReC5NKZO6Cst51eJm/HIjLrxp8gcTajPEOJ2ugfLn9uzoST4PHEwk u1eDbiCLVOhnFK7z35riN6x4GeimZRu1ivbkP/pB69TQsJSal5BJlqBsdEIYdQv9aWc4X/ LDM7MjZZoSrabUg2WrvckBVH4YdhCWcUf4aWVNVwyJqMeJqbkLEVoTaYlRpa36I27hGKyh COrpbFCVo88wgpmSU1+UtKRfY+89v4fiqVMlvHnRX4QqPSzSpuwfo06zG/BSFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725547839; a=rsa-sha256; cv=none; b=eq7TSRTy3qhNLOLMY51B4TUdvcgFKUKIZ5o4jZo7BMY4Rf6GpcyIkduIAzzDZZxS1LWvlF z1J1O+wisQo/bwIukUvRw/IR57zBeVjPJcyEim5egct2Qy/xCzA4sERVCXQR3aZ+PyH2pP pb45o+zW8JNofU/beu4tTueD4Ev/gnuxDEE7S54rUdRo0RyRlcH6kkyDlRRB9goi/3GNyu UvZ3/Uh4vYwzS3ocOR7WtuWocTtvX1X6d64Yu04PRoGPdQGenO+ErREW43lI4IK/f4jQZ3 9R9xwzB+qRIuduelCpNnQiev7BkjyVKTBWlNlygJpcacaYsvOkYtlbM4swl78A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725547839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/tSjF8iixQZBgi8ayJcP/gRVWpyuYvGQP9AWDeaJjY=; b=V8H/bzZqSe/e04S+dFk9NxsJBLC5QdZtkfzVz7vDzXRsJdl2/UUuuN9NfLWGZ5valpNtyY UeuycqntpApEKEnz7ftvmu+mqYR/vP6ohI3fAVoJsJLe1Jv7NJwtf+gbj7fKCvd3YWPl+u jSZw69U4Awmx6YS16ZQ3lDZxkCYMjVCZF/yYqZQ0cRl7TJIOs6p7LcZVhQlApsnh8GxSta YZqs7CBxeafrhTY5oxsGhtiHPNdSjBm0U9fdaDfaE+9qPzdgujNGTbdiWBKllnml1h2bXB vCNbloOZNsWySnRwCCoE9pTI9MKqNALuF4q2n4rIr6xxwzd+gBUBSac1N8voRQ== 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 4X02NG6vtbz1C5Y; Thu, 5 Sep 2024 14:50: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 485Eocbi076452; Thu, 5 Sep 2024 14:50:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485Eocuw076449; Thu, 5 Sep 2024 14:50:38 GMT (envelope-from git) Date: Thu, 5 Sep 2024 14:50:38 GMT Message-Id: <202409051450.485Eocuw076449@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: 82fd9219755d - stable/14 - sys: Mark ACL conversion routines as __result_use_check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 82fd9219755dac73e51289493e1f024b32bbb2cd Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=82fd9219755dac73e51289493e1f024b32bbb2cd commit 82fd9219755dac73e51289493e1f024b32bbb2cd Author: Pierre Pronchery AuthorDate: 2024-08-09 17:37:38 +0000 Commit: Ed Maste CommitDate: 2024-09-05 14:50:09 +0000 sys: Mark ACL conversion routines as __result_use_check Both acl_copy_oldacl_into_acl() and acl_copy_acl_into_oldacl() may fail in some circumstances (e.g., acl.acl_cnt exceeding the capacity of OLDACL_MAX_ENTRIES). This change marks both routines with __result_use_check, enforcing check for errors by the caller. Suggested by: markj Reviewed by: markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46254 (cherry picked from commit ef9fc9609a1ff53047577aa7cf51246fc04c954b) --- sys/sys/acl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/acl.h b/sys/sys/acl.h index f679808dceca..b0d76404fffa 100644 --- a/sys/sys/acl.h +++ b/sys/sys/acl.h @@ -307,9 +307,9 @@ void acl_nfs4_compute_inherited_acl( const struct acl *parent_aclp, struct acl *child_aclp, mode_t mode, int file_owner_id, int is_directory); -int acl_copy_oldacl_into_acl(const struct oldacl *source, +int __result_use_check acl_copy_oldacl_into_acl(const struct oldacl *source, struct acl *dest); -int acl_copy_acl_into_oldacl(const struct acl *source, +int __result_use_check acl_copy_acl_into_oldacl(const struct acl *source, struct oldacl *dest); /* From nobody Thu Sep 5 15:12:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X02s92vrhz5WD3q; Thu, 05 Sep 2024 15:12: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 4X02s92Rydz4g3R; Thu, 5 Sep 2024 15:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725549133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w/B7D1QXAJXsRZTxsoNGl+t8dZbrmFgtXXIocxvFGas=; b=DmNafO5/oYC09WkdZQsCZHgosJb2UkItPUcaXBP0y+2ClJFkhimEnr19ocA4OJttUBWX+k /fxY8DH6UzqTXsT2Im6uykDdHcl5Fs2zxSRSqtURNzRwhmOddb87T2PZhMRVwYYG/zU9wJ nKXWBLMp0KOOeuSVuokvDH6gstH+fX0jTPz9ZtV+FbR6TyZLCcY3wY4zATlAIuS/GkF0Sh seUzc3ViSdGiKeTSUGhezU+qoRPiNm2XJfyAvVKeTXlXN13PGBDf2F9HG6ZChvDrbjOK8l I7MOr8C+hJ/dflKyCfpcA8sJHurEEYYaRm9dQu+NSwv8NHWEcCPeySo/WtEduA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725549133; a=rsa-sha256; cv=none; b=oPz9sFnzYK9TveVttcQv8c2BZZkxygEk9HOJelEN2+oi3Wggxbcd+t2LnfosF7rLCepyHF 98dtt/7SFVeGymWOafqmT4FyzTAwZH56OyWZrXvghLyr6D/SSoSEdHyXirT+jdq3iE+fQc 6ltPC2pieIf+BSCMK9P5W/QIhoJBy9kjtbTFrw/LKtei+GesBxpD5D6nBTD94WBXlJyeRa vsI5EZarBXzKRrhIDyNjHXkQY0SP8Qz6wSXt1djE3FTKxZf6U78pqebXMnG8b09pAoqFz2 ASZZVGntGfx/0QFp5bmh3L3VOnKyt7Vo3WTyRbVSGeBC0OGa8CEPmXWtVY0OlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725549133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w/B7D1QXAJXsRZTxsoNGl+t8dZbrmFgtXXIocxvFGas=; b=XTMvySf7YjiMxLJrdCtg5/A6iKgSes6eoeIk4J+MadQVXnCvj0IZcrsYUpJcSWVydf2PtJ V0P5K/xhOiBgVEd7DXxsqvoZAUQe/ww5eysfBnShjNRDW0AT0q/aW4oyhYqB5HP1VLjFIE m4xliJT9Xr+8aH7PlmFxBLBLIZnq60jLR/1AsRI6z9wGt4k2vQ9jSXI30ZAL0J7ZXPSuh6 vT+h3mdVIEO9nsleHcdz+QKPgsfHPEWYywJK0QBcu14bI1XBUVIlFY4pKIjBMILA3cWtK8 i6LGZzjCleQziqVihR3qw9POEbXWLD9M/EZryFxhR0oteFl5xlSlzoLqo4kXpQ== 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 4X02s923HMz1C7p; Thu, 5 Sep 2024 15:12: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 485FCDWN015588; Thu, 5 Sep 2024 15:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485FCDEA015578; Thu, 5 Sep 2024 15:12:13 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:12:13 GMT Message-Id: <202409051512.485FCDEA015578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: fe1755fa6bb4 - main - ctl: add tests for START STOP UNIT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe1755fa6bb4039c1e00f5226c473a024685005b Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=fe1755fa6bb4039c1e00f5226c473a024685005b commit fe1755fa6bb4039c1e00f5226c473a024685005b Author: Alan Somers AuthorDate: 2024-08-23 20:51:32 +0000 Commit: Alan Somers CommitDate: 2024-09-05 15:09:41 +0000 ctl: add tests for START STOP UNIT MFC after: 2 weeks Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 --- tests/sys/cam/ctl/Makefile | 5 +- tests/sys/cam/ctl/ctl.subr | 94 ++++++++++++++++++++++ tests/sys/cam/ctl/read_buffer.sh | 72 +++-------------- tests/sys/cam/ctl/start_stop_unit.sh | 150 +++++++++++++++++++++++++++++++++++ 4 files changed, 257 insertions(+), 64 deletions(-) diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile index 0e6f39a1a56f..1b857bb0c291 100644 --- a/tests/sys/cam/ctl/Makefile +++ b/tests/sys/cam/ctl/Makefile @@ -2,9 +2,12 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/cam/ctl +${PACKAGE}FILES+= ctl.subr + ATF_TESTS_SH+= read_buffer +ATF_TESTS_SH+= start_stop_unit # Must be exclusive because it disables/enables camsim -TEST_METADATA.read_buffer+= is_exclusive="true" +TEST_METADATA+= is_exclusive="true" .include diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr new file mode 100644 index 000000000000..18991e0fa144 --- /dev/null +++ b/tests/sys/cam/ctl/ctl.subr @@ -0,0 +1,94 @@ +# vim: filetype=sh + +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +load_modules() { + if ! kldstat -q -m ctl; then + kldload ctl || atf_skip "could not load ctl kernel mod" + fi + if ! ctladm port -o on -p 0; then + atf_skip "could not enable the camsim frontend" + fi +} + +find_device() { + LUN=$1 + + # Rescan camsim + # XXX camsim doesn't update when creating a new device. Worse, a + # rescan won't look for new devices. So we must disable/re-enable it. + # Worse still, enabling it isn't synchronous, so we need a retry loop + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 + retries=5 + ctladm port -o off -p 0 >/dev/null + 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:[()]::'` + if [ -z "$dev" -o ! -c /dev/$dev ]; then + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + cat lun-create.txt + camcontrol devlist + atf_fail "Could not find GEOM device" + fi + sleep 0.1 + continue + fi + break + done + # Ensure that it's actually ready. camcontrol may report the disk's + # ident before it's actually ready to receive commands. Maybe that's + # because all of the GEOM providers must probe it? + while true; do + dd if=/dev/$dev bs=4096 count=1 of=/dev/null >/dev/null 2>/dev/null && break + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + atf_fail "Device never became ready" + fi + sleep 0.1 + done +} + +# Create a CTL LUN +create_ramdisk() { + EXTRA_ARGS=$* + + atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 $EXTRA_ARGS + atf_check egrep -q "LUN created successfully" lun-create.txt + LUN=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + if [ -z "$LUN" ]; then + atf_fail "Could not find LUN id" + fi + find_device $LUN +} + +cleanup() { + if [ -e "lun-create.txt" ]; then + lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + ctladm remove -b ramdisk -l $lun_id > /dev/null + fi +} diff --git a/tests/sys/cam/ctl/read_buffer.sh b/tests/sys/cam/ctl/read_buffer.sh index 4a84eb6b9725..e54b0dadc134 100644 --- a/tests/sys/cam/ctl/read_buffer.sh +++ b/tests/sys/cam/ctl/read_buffer.sh @@ -28,61 +28,7 @@ # * Buffer ID other than 0. We don't support those. # * The Mode Specific field. We don't support it. -load_modules() { - if ! kldstat -q -m ctl; then - kldload ctl || atf_skip "could not load ctl kernel mod" - fi - if ! ctladm port -o on -p 0; then - atf_skip "could not enable the camsim frontend" - fi -} - -find_da_device() { - SERIAL=$1 - - # Rescan camsim - # XXX camsim doesn't update when creating a new device. Worse, a - # rescan won't look for new devices. So we must disable/re-enable it. - # Worse still, enabling it isn't synchronous, so we need a retry loop - # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 - retries=5 - ctladm port -o off -p 0 >/dev/null - ctladm port -o on -p 0 >/dev/null - while true; do - - # Find the corresponding da device - da=`geom disk list | awk -v serial=$SERIAL ' /Geom name:/ { devname=$NF } /ident:/ && $NF ~ serial { print devname; exit } '` - if [ -z "$da" ]; then - retries=$(( $retries - 1 )) - if [ $retries -eq 0 ]; then - cat lun-create.txt - geom disk list - atf_fail "Could not find da device" - fi - sleep 0.1 - continue - fi - break - done -} - -# Create a CTL LUN -create_ramdisk() { - atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 - atf_check egrep -q "LUN created successfully" lun-create.txt - SERIAL=`awk '/Serial Number:/ {print $NF}' lun-create.txt` - if [ -z "$SERIAL" ]; then - atf_fail "Could not find serial number" - fi - find_da_device $SERIAL -} - -cleanup() { - if [ -e "lun-create.txt" ]; then - lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` - ctladm remove -b ramdisk -l $lun_id > /dev/null - fi -} +. $(atf_get_srcdir)/ctl.subr atf_test_case basic cleanup basic_head() @@ -98,10 +44,10 @@ basic_body() # Write to its buffer cp /etc/passwd input len=`wc -c input | cut -wf 2` - atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$dev # Read it back - atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$dev # And verify if ! diff -q input output; then @@ -126,7 +72,7 @@ desc_body() { create_ramdisk - atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$da + atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$dev } desc_cleanup() { @@ -147,10 +93,10 @@ length_body() # Write to its buffer atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 atf_check -o ignore -e ignore dd if=input bs=2048 count=1 of=expected - atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$dev # Read it back - atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$dev # And verify if ! diff -q expected output; then @@ -176,10 +122,10 @@ offset_body() # Write to its buffer atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 atf_check -o ignore -e ignore dd if=input iseek=2 bs=512 count=1 of=expected - atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$dev # Read it back - atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$dev # And verify if ! diff -q expected output; then @@ -203,7 +149,7 @@ uninitialized_body() create_ramdisk # Read an uninitialized buffer - atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$dev # And verify atf_check -o ignore -e ignore dd if=/dev/zero bs=262144 count=1 of=expected diff --git a/tests/sys/cam/ctl/start_stop_unit.sh b/tests/sys/cam/ctl/start_stop_unit.sh new file mode 100644 index 000000000000..163011c8f574 --- /dev/null +++ b/tests/sys/cam/ctl/start_stop_unit.sh @@ -0,0 +1,150 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. $(atf_get_srcdir)/ctl.subr + +# TODO: +# * format layer +# * IMM bit +# * LOEJ +# * noflush +# * power conditions + +# Not Tested +# * Power Condition Modifier (not implemented in CTL) + +atf_test_case eject cleanup +eject_head() +{ + atf_set "descr" "START STOP UNIT can eject a CDROM device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +eject_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + # Verify that the device is online + # Too bad I don't know of any other way to check that it's stopped but + # by using sg_readcap. + atf_check -o ignore -e not-match:"Device not ready" sg_readcap /dev/$dev + + # eject the device + atf_check sg_start --eject /dev/$dev + + # Ejected, it should now return ENXIO + atf_check -s exit:1 -o ignore -e match:"Device not configured" dd if=/dev/$dev bs=4096 count=1 of=/dev/null +} +eject_cleanup() +{ + cleanup +} + +atf_test_case load cleanup +load_head() +{ + atf_set "descr" "START STOP UNIT can load a CDROM device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +load_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + # eject the device + atf_check sg_start --eject /dev/$dev + + # Verify that it's offline it should now return ENXIO + atf_check -s exit:1 -o ignore -e match:"Device not configured" dd if=/dev/$dev bs=4096 count=1 of=/dev/null + + # Load it again + atf_check sg_start --load /dev/$dev + + atf_check -o ignore -e ignore dd if=/dev/$dev bs=4096 count=1 of=/dev/null + atf_check -o ignore -e not-match:"Device not ready" sg_readcap /dev/$dev +} +load_cleanup() +{ + cleanup +} + +atf_test_case start cleanup +start_head() +{ + atf_set "descr" "START STOP UNIT can start a device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +start_body() +{ + create_ramdisk + + # stop the device + atf_check sg_start --stop /dev/$dev + + # And start it again + atf_check sg_start /dev/$dev + + # Now sg_readcap should succeed. Too bad I don't know of any other way + # to check that it's stopped. + atf_check -o ignore -e not-match:"Device not ready" sg_readcap /dev/$dev +} +start_cleanup() +{ + cleanup +} + +atf_test_case stop cleanup +stop_head() +{ + atf_set "descr" "START STOP UNIT can stop a device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +stop_body() +{ + create_ramdisk + + # Stop the device + atf_check sg_start --stop /dev/$dev + + # Now sg_readcap should fail. Too bad I don't know of any other way to + # check that it's stopped. + atf_check -s exit:2 -e match:"Device not ready" sg_readcap /dev/$dev +} +stop_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case eject + atf_add_test_case load + atf_add_test_case start + atf_add_test_case stop +} From nobody Thu Sep 5 15:12:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X02sB47GBz5WCvq; Thu, 05 Sep 2024 15:12:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X02sB36GLz4gGF; Thu, 5 Sep 2024 15:12:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725549134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rawcZ0RxdRkJwhCptafO1Sro+9yzImmQpxnt9HULBY0=; b=mKwjQVEFD+MAPp4g8AQRUO9fgjhNhFR2DUVNptQbxSk8Qjsx1ciVps48lreAvvMKuZQRPU ndt5S/V6QsHTfl01KtWwVjeHmYI7vg2B+3UgsrZF6T5WRf4HQkZHeFCoIxuMLn1rjyA5I0 A/kL/ECXMFKGQx+wjigHGiPxWJ/lrU62x1MBrFaQSJVMD+SWqat2zj1/lRGB+xLb1syCok rm9kuHn/eYWud3+vJ1ItiTnbhpqk1MoyxTM6EvGZSGUd5pOAFoeMvHHLVf8lIyVwgzzHXV ItzK9ez9rzELfnjwLr+xYsSptA1S52Im9qgiwnYugLBPaJLPUCAwzW+xEziLzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725549134; a=rsa-sha256; cv=none; b=AC19CNnXpNcB8YRryS1278IEJJ7X0oJGC2OWPELKegdytzhDJz1/uJ5hux0ld8vAQXF2UC mvQWAcPL2cMyZz28OR3KOnfLbKKPGBAWgnhC8pH7E2YTSs+unP9SNEHgkO6e6s5u8pLDVZ HDz3Eka7N5gLhrjNz2t3M5O4eEnL4jDXyTtKijJKkNAavz+O0zeJiDBSZvwwyJr0QhWc8l le3xYwR8itZ+lVzaObaE2qbHVt2BrpFDd3Q2u4PyHPapDadAOKMzAev8DTfsVmo5mPxarh R28KncfTea5lrN0KeBes+s5ALHxDS8AG0AoA/91+LWNkcFVk9AHrDdB7sB/Z5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725549134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rawcZ0RxdRkJwhCptafO1Sro+9yzImmQpxnt9HULBY0=; b=FHAdusw6adtNrkw0T7XZau4FXnL4B8ODAsBNu5HOOVfPYnsazQ+xva1fk/yY0j2zQ+1bSx ZWigzC0jwf/N9xgWMulJnprUUz38VJbI1gYFSDzKgaQHf6/TmD8FHoiDe75NzNKIRUKqun r6ImEN0SR0E5wea/5Pu+5KJnLFvUkAJJK1LQzHbDDTK4UZgCzucFUhNzweZ2gTXa56iRIM xW2y4lK9LEUedn13taszL0k76uXNf6guqjzE+LMGtxn8z3kAi4hzDWFEAO/N0zrWMZZLRy DuO4oHmtau/0yH7I6RGKl3bfTAMIbvcg19/7FLNR6yBpeynjPfg0nUwZN7XgIw== 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 4X02sB2kFLz1CqM; Thu, 5 Sep 2024 15:12: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 485FCEDR016928; Thu, 5 Sep 2024 15:12:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485FCEIG016925; Thu, 5 Sep 2024 15:12:14 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:12:14 GMT Message-Id: <202409051512.485FCEIG016925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: e234a72bb8c0 - main - ctl: add tests for PREVENT ALLOW MEDIUM REMOVAL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e234a72bb8c0e8e25ea8a879582e85bb2e09f096 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e234a72bb8c0e8e25ea8a879582e85bb2e09f096 commit e234a72bb8c0e8e25ea8a879582e85bb2e09f096 Author: Alan Somers AuthorDate: 2024-08-26 20:01:44 +0000 Commit: Alan Somers CommitDate: 2024-09-05 15:10:09 +0000 ctl: add tests for PREVENT ALLOW MEDIUM REMOVAL MFC after: 2 weeks Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 --- tests/sys/cam/ctl/Makefile | 1 + tests/sys/cam/ctl/prevent.sh | 161 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile index 1b857bb0c291..1333397af464 100644 --- a/tests/sys/cam/ctl/Makefile +++ b/tests/sys/cam/ctl/Makefile @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/cam/ctl ${PACKAGE}FILES+= ctl.subr +ATF_TESTS_SH+= prevent ATF_TESTS_SH+= read_buffer ATF_TESTS_SH+= start_stop_unit diff --git a/tests/sys/cam/ctl/prevent.sh b/tests/sys/cam/ctl/prevent.sh new file mode 100644 index 000000000000..a5a187dad8ff --- /dev/null +++ b/tests/sys/cam/ctl/prevent.sh @@ -0,0 +1,161 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. $(atf_get_srcdir)/ctl.subr + +# TODO +# * multiple initiators may block removal + +# Not Tested +# * persistent removal (not implemented in CTL) + +atf_test_case allow cleanup +allow_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL will prevent a CD from being ejected" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +allow_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --prevent 1 /dev/$dev + + # Now sg_start --eject should fail + atf_check -s exit:5 -e match:"Illegal request" sg_start --eject /dev/$dev + + atf_check sg_prevent --allow /dev/$dev + + # Now sg_start --eject should work again + atf_check -s exit:0 sg_start --eject /dev/$dev +} +allow_cleanup() +{ + cleanup +} + +atf_test_case allow_idempotent cleanup +allow_idempotent_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL is idempotent when run from the same initiator" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +allow_idempotent_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --allow /dev/$dev + atf_check sg_prevent --allow /dev/$dev + atf_check sg_prevent --prevent 1 /dev/$dev + + # Even though we ran --allow twice, a single --prevent command should + # suffice to prevent ejecting. Multiple ALLOW/PREVENT commands from + # the same initiator don't have any additional effect. + atf_check -s exit:5 -e match:"Illegal request" sg_start --eject /dev/$dev +} +allow_idempotent_cleanup() +{ + cleanup +} + +atf_test_case nonremovable cleanup +nonremovable_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL may not be used on non-removable media" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent +} +nonremovable_body() +{ + # Create a HDD, not a CD, device + create_ramdisk -t 0 + + atf_check -s exit:9 -e match:"Invalid opcode" sg_prevent /dev/$dev +} +nonremovable_cleanup() +{ + cleanup +} + +atf_test_case prevent cleanup +prevent_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL will prevent a CD from being ejected" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +prevent_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --prevent 1 /dev/$dev + + # Now sg_start --eject should fail + atf_check -s exit:5 -e match:"Illegal request" sg_start --eject /dev/$dev +} +prevent_cleanup() +{ + cleanup +} + +atf_test_case prevent_idempotent cleanup +prevent_idempotent_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL is idempotent when run from the same initiator" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +prevent_idempotent_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --prevent 1 /dev/$dev + atf_check sg_prevent --prevent 1 /dev/$dev + atf_check sg_prevent --allow /dev/$dev + + # Even though we ran prevent idempotent and allow only once, eject + # should be allowed. Multiple PREVENT commands from the same initiator + # don't have any additional effect. + atf_check sg_start --eject /dev/$dev +} +prevent_idempotent_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case allow + atf_add_test_case allow_idempotent + atf_add_test_case nonremovable + atf_add_test_case prevent + atf_add_test_case prevent_idempotent +} From nobody Thu Sep 5 15:12:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X02sD1McKz5WD3s; Thu, 05 Sep 2024 15:12: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 4X02sC4kTWz4g3Y; Thu, 5 Sep 2024 15:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725549135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g19peTucLeZgXPLIytfRqlyUG0X2DSOnXBvbLGSALG4=; b=XK3izgEVfwSTCLhlqZcl3O9wO5ADqM7lW7aNwVQ4nYjRHWS4ZbDPiPjrKvrPKPdeKeBgiE RFFB7p8DMuuw4SFp4q+wVAYmz9ZtOjcdFwIVAWHUGuz/Zuv5+EaWxQVu37qLViS9qBUStM 6vx5JjkW9g2LtKdoLo69tmiQ64GvcLqvmGKh3+c6i+66tHy1iEZZfDqXrLIqaPjnz+p3ZV IRpXWqpxODMmNvdnCdOSgAE4w7UUgxnUfewP4fFpqWKuWilPyGBTJ9uvAkbScmImDAYqfl evH0Qazr97oI3UIh9H66p2cD0yCKJfkKosH9mUEv34VnxbuRWSGBwDv1McQgmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725549135; a=rsa-sha256; cv=none; b=M8w2b49suafs606oYRoOLrNxfMqKZvoDZyfQJgcpA2FWjFkQxV9aJ1pYHtBADd6j2KCtQe 5Ku6pY2yXOsuEabOPhgk4Ed7uxGnTu6j5UjqEwf9sObGgw42FxF4J9mNaYq6Vl20xw3AFC 6QN+UTJaal7vwmRPEW0nRDTTAzK2JyOwZSgZPFDaWhxzLdbHwT+3d5PolbXJkxb90hWHHI XgGwTFacs1QFCjPLXmpyNdpPNx4oaTZL3vzflpO31YZzNJc2OYycHItUdrN8pS8PnaHNxF PnScETy3ZN5ZX/MFnAwVfo71FqWqNyL/X+lmtPBGdzaZaVtLdmDP+Bg1I8zBVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725549135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g19peTucLeZgXPLIytfRqlyUG0X2DSOnXBvbLGSALG4=; b=Vn0xp5nb+93yncLvT83H07EPi44/rpqEK0Vk7LYR1J1kGAWr6lJA0rtUl4eAajeSdzBNFy 8716cTo5POCUAXzPOzOSkBVDW4Cue78mzHelgbk9iH67wQLqbcB2aldYx+g3H0fGL+acTT VdnHXNFtLrjGeepjDoDK0Mrw91YwhZRQbYVpUrSOr+ehZ8yd9jSP6xstDhzw3iLCf/wfNL pG6IWXPerkrLFYjmHyCp8ajtsLpriXknbnDCh7BBBODhfDfrN6XNfhDO/aDfX2SoP9lkZe O/lBKKpQ1x9NSkTwrvAYNZxKU9uvcyaG78HgazWFGi/Hoiu5ktBag/TeNxuXQQ== 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 4X02sC3qCQz1C7q; Thu, 5 Sep 2024 15:12: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 485FCFHK016985; Thu, 5 Sep 2024 15:12:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485FCF7k016982; Thu, 5 Sep 2024 15:12:15 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:12:15 GMT Message-Id: <202409051512.485FCF7k016982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 0f2b2276abc3 - main - ctl: fix uninitialized data used by PREVENT ALLOW MEDIUM REMOVAL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f2b2276abc305905e7d88619a7abca26b0dd7eb Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0f2b2276abc305905e7d88619a7abca26b0dd7eb commit 0f2b2276abc305905e7d88619a7abca26b0dd7eb Author: Alan Somers AuthorDate: 2024-08-26 20:44:24 +0000 Commit: Alan Somers CommitDate: 2024-09-05 15:10:14 +0000 ctl: fix uninitialized data used by PREVENT ALLOW MEDIUM REMOVAL Zero-initialize the bitmap of preventers. Otherwise, the START STOP UNIT command may not have the intended effect. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 --- sys/cam/ctl/ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 53858edc2a1d..1505e0886f57 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -4630,7 +4630,7 @@ fail: ctl_tpc_lun_init(lun); if (lun->flags & CTL_LUN_REMOVABLE) { lun->prevent = malloc((CTL_MAX_INITIATORS + 31) / 32 * 4, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Thu Sep 5 15:35:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X03Mk537gz5WFdx; Thu, 05 Sep 2024 15:35:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X03Mk4B9rz4jPg; Thu, 5 Sep 2024 15:35:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725550514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oALFUeF5rTmHsUpvnwMnkihbPJj8us5yHk/uTsYBxI=; b=JjDRXoTImsEm+NDe/3UZBvGXTLHcK2dEIqWbYULEayNqhthbAfh8IVu3ny/orDt5Z9DEg1 aCoFp7JR0p1IOBtM71u5nlQlADjTmfhDMmHDqR4gG8q1QIjh57JKoYGJeR0RZlQw9ZydpZ FLXXznZrI/oBXVdYLuADlf0Vz8DM9ToWdlKxT/Lh4hncIYvOm3yRFj9YbfxPpekQMSMt6Q DVubiTWbe30fSxazuj+RVpPQN5UyoWnl9x2psBTWYDDYlug+Tlt+orYJCXxoMGnLrYqzZa 48+P6H/x5XrLwcsAA1CVf/WxNJ49ntl9q5iSEoei1bezD0KvjrFuU+0CbVu0fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725550514; a=rsa-sha256; cv=none; b=nRTKvjIXHk/1X9i2J5MnQd8W7TtE+YhCjAFAO0M5v3j8b1852P2lHPVH2qq7r/hHmeTOK1 1DaucGIE/Zy31KAsnc6ZIOg5/otNxOdPXQBXr5UyeEaQ4EYhGpYr4U4VqVymdacm/TrqY8 p4m1eC1bEA8UYs0QhXaWVK760G9zhzaLLiKEDpXZuxzN1tRzKrv7/6fAEc2uPdWqSpgoNu G9+mtEAGNP09zn4+rs2edzNQtfM+MBzjCZSeDH4aThPJc8RrSfRm1LUjELvTFKFrZhD/+M D7aq8wXc2PQNrtmPip5PxAQ9CJMhPlNDyCtYS8ZqE7Diz75vLo2hZDcexZMnaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725550514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oALFUeF5rTmHsUpvnwMnkihbPJj8us5yHk/uTsYBxI=; b=CZf3d3OkAzxot21fg4K1WYCsf8STRJ5XU0d2npSbvw1Ld5Cx8jJLNbU19C4ys5JSZsuBbH /Nep3XzWaCH/ff/FxAfqFDbf9iBcI0a6vvrA0lA/PTeV2x7PA0Yus1GJF+dOXWPcUgueiZ VouXO+Zh0N9Ho/02idQL5MkdyholvVUSJNF+5HgvbegGnm7CsSGFdjk3iYsq5EKydrGPp1 4irDOpRdrbJrRvdwMjmEBUuUMIvLgwfUPFrFVgIXI+5xYiXp4Wczwqao7U9roRO94xla1d XZzn7B9b11yF/TtXF/xosT2iorVH/GyQ7JG0/XN20/NEfIdTozH2+gqr0xII+w== 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 4X03Mk3gNyzDb9; Thu, 5 Sep 2024 15:35: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 485FZEhO052529; Thu, 5 Sep 2024 15:35:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485FZE3I052526; Thu, 5 Sep 2024 15:35:14 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:35:14 GMT Message-Id: <202409051535.485FZE3I052526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 5203dcce2527 - main - neta: improve TCP LRO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5203dcce2527fd235648e2b855a13f62247eb2de Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5203dcce2527fd235648e2b855a13f62247eb2de commit 5203dcce2527fd235648e2b855a13f62247eb2de Author: Michael Tuexen AuthorDate: 2024-09-05 15:31:31 +0000 Commit: Michael Tuexen CommitDate: 2024-09-05 15:31:31 +0000 neta: improve TCP LRO Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46433 --- sys/dev/neta/if_mvneta.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index e663306509a0..bc57b10b6d8e 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -3000,8 +3000,6 @@ mvneta_rx_queue(struct mvneta_softc *sc, int q, int npkt) struct mvneta_rx_desc *r; struct mvneta_buf *rxbuf; struct mbuf *m; - struct lro_ctrl *lro; - struct lro_entry *queued; void *pktbuf; int i, pktlen, processed, ndma; @@ -3115,11 +3113,7 @@ rx_lro: /* * Flush any outstanding LRO work */ - lro = &rx->lro; - while (__predict_false((queued = LIST_FIRST(&lro->lro_active)) != NULL)) { - LIST_REMOVE(LIST_FIRST((&lro->lro_active)), next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(&rx->lro); } STATIC void From nobody Thu Sep 5 15:39:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X03SM2PlYz5WFrd; Thu, 05 Sep 2024 15:39: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 4X03SM1WSsz4k81; Thu, 5 Sep 2024 15:39:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725550755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84d6Nze3Uc0ZTF1ri9IpLdTeQ95PyiLmnd2SVsHGVgY=; b=PO4fhEZXK1wk1Azc5jzpW7Aw5kVtXL31o7q+GpldLFtsgKiObahVoTZS1WG1axOmFJpcad SPP6aAAS7Zb3H6Hl5MAXCqC0MYTj6jXelMaY+4MeRwRbMTMLhD7qaa07pX3aMJsix8ZA3q rIm9msjtM5VGGirW/fc8px+XsCJWvE6hRJ2Wvwrm93o/ugaTi0MjslpIcx45+14V6FmNi0 29s87K8WKQDWTBr1JuBKo2C5SjhHZKqGbFTtYnuaxq73otlOII+Zzkr4S76iwBYzrAvdvp syTbgNRtJJDnrQc09je1/oVgtHp/jG/HIdhvnXkz7gSu9O+D5UocapDk9tsppw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725550755; a=rsa-sha256; cv=none; b=AUGRN70NcZi2Hamfl8c0n2vpFgmL6IMPuXA34kt0WpGFtX/ZuS0u+UB7VRflt4KLwT1xdh 0WSS+YmjvOC1dPr6z6+jcxPbo9eTZDPE+1nIW24Ai31zn6DpQC/Y2Tub0VrIx2CdGrzvqw 2ZrvpUHzz+VZCV8pnrRdkQbQ0qAa+o2wCux0Uj5o/S3XVQyBLDmHqiIv2MFS8MuQdOUNTt phpnt7C/o5FN5Zwq22tviOfQ/THsaJ3WOlMX1PVfiIn4D/yk5rnFWhHL2AV6Dp2vLoyV+m eoGjzW3qUkrbfkbTY5uYhaQW+IZbLtTDaVY7VwAVXjNlyujzy9T7PQZjB9G0fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725550755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84d6Nze3Uc0ZTF1ri9IpLdTeQ95PyiLmnd2SVsHGVgY=; b=V/4GG9oC/xJ1chkc7har3VpnjSUE69eJwCyaHHGY8wx6oJXVJ+Xcf+ZAEGKwdjR2r7WMld 7tk9ufkxbqpGKH/ZqoT/kGZPdkelyTkkeeEzK7HAqGuapOHyjTFLL2MlPFzaZ5MQHlQ1LU UK30KjcActlTHfElY+TLfXWQZQU2/1tIA1PHNvRo+RZy7lVWeje1+qtgY3ZidbkJF8NPZ5 mMD9hI5QRRVl2kYjnA7uwhkvC+yZhdvzoTPKARj6CoivTuLSrh5chT7qV7aZ0hpV3zoNEb nmiXqCbvGdcPGsrVYOqOzOMNg6vadSt5m92mjJrIBelU6X+6if13NYbwgeuhtA== 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 4X03SM0nKBzF1B; Thu, 5 Sep 2024 15:39: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 485FdFBV053309; Thu, 5 Sep 2024 15:39:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485FdEMI053306; Thu, 5 Sep 2024 15:39:14 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:39:14 GMT Message-Id: <202409051539.485FdEMI053306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0b45d36510d8 - main - al_eth: improve TCP LRO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b45d36510d8c629fcc49805bc64e5893f4ba63c Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0b45d36510d8c629fcc49805bc64e5893f4ba63c commit 0b45d36510d8c629fcc49805bc64e5893f4ba63c Author: Michael Tuexen AuthorDate: 2024-09-05 15:35:40 +0000 Commit: Michael Tuexen CommitDate: 2024-09-05 15:35:40 +0000 al_eth: improve TCP LRO Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46434 --- sys/dev/al_eth/al_eth.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c index e12c8dfcc281..f4fec7c6aa94 100644 --- a/sys/dev/al_eth/al_eth.c +++ b/sys/dev/al_eth/al_eth.c @@ -1580,7 +1580,6 @@ al_eth_rx_recv_work(void *arg, int pending) { struct al_eth_ring *rx_ring = arg; struct mbuf *mbuf; - struct lro_entry *queued; unsigned int qid = rx_ring->ring_id; struct al_eth_pkt *hal_pkt = &rx_ring->hal_pkt; uint16_t next_to_clean = rx_ring->next_to_clean; @@ -1671,10 +1670,7 @@ al_eth_rx_recv_work(void *arg, int pending) "%s: not filling rx queue %d\n", __func__, qid); } - while (((queued = LIST_FIRST(&rx_ring->lro.lro_active)) != NULL)) { - LIST_REMOVE(queued, next); - tcp_lro_flush(&rx_ring->lro, queued); - } + tcp_lro_flush_all(&rx_ring->lro); if (napi != 0) { rx_ring->enqueue_is_running = 0; From nobody Thu Sep 5 15:48:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X03fV0z0Gz5WGlr; Thu, 05 Sep 2024 15:48: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 4X03fV0Snhz4l8t; Thu, 5 Sep 2024 15:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725551282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jxaRg/QawSlK6U+ZZTQmFhbhOZKhdTMSXODXJO24ffM=; b=pL7RCe/1FWbj4wHm74+fUTxdecgooIdzskUMTvdsLbsApyJzqtSyJVfKdbeNFJ0Fl0z675 5Vk94Qf8HBykr1XAzqoaWYs3Livln6zck4hZsbGG0Vi7K8kns/VA9nEiT8Qp3BO5w3kx2L jOKDl4zj1TOEdBAbG63OXZu5WDc1e16+iWmknbUFEWwEUvHtVHSE1dkJLM6tsmiH6DFi1Y xpifhdUSywsDYr0tQdpH+TduVik78R/SP+5bZA5OBrGOHAnEWka8kO4lltwE7ACDNvh9zc Lv08JaJB5uW0JVJvwWuCCN/pg9OnwEZw3YDgbB6SRE/uCQKK61d/r5/fYl0CVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725551282; a=rsa-sha256; cv=none; b=C6rL+Ih/Xbv9RZvyQSIMX+qPVXZ1OwqNZIgvrXELePKwaIIE8fJI9fyRzJhhy2hNdxRsPJ N9m2FFpbOrZTRv+5eh0uqTnmMIxR20hbiLDIpc8rLm+MKgR/DCTaO+hS1RV/CFKRe//qOf R3l7hCTvOIJOmoKgcHzhccl6NTEF5VwK5CO3yl7EBcOgxTmnHRF0wNRTXWdhjxQwnf+6uy CgWNjd0+aLRkdrLHYbwAcJm0yDM/y3X9YhaTUYDaoarSD7ELGbwaEz7TxmeH///O87Vk62 c5hE7zWR3NCGa2SBsNM3VvJnkDpiQvsCvisIIhTQ84UAWUI8IZOYQmqcAwHnKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725551282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jxaRg/QawSlK6U+ZZTQmFhbhOZKhdTMSXODXJO24ffM=; b=wADPvMFJ9hTtyIdkiFm63pL6maK47VrOgCvzqHGu1ZgBbwJalp6HArXny5d53f6AwK2v/v +ieneC2EAA8zWllbTtjhVNivzbpn9f6/E7o/SdOcijhackK4+1QNvB8H7wRwk5li2VIg3f YkFmefw7Gd9yB+xV4E3RNOGuRuRxS9ej47f+oslDcZPantKOweDl1GClL/1KOosb/GAZi5 FV5OCczE9+0dVf+Qpqjl1hI77PKh4eUjcZDeQgUUseMGzfdOfozcElmkEsXC1yh5FYGYLK yNZmfLpeRPe5v9y7NKhOfTRVfMBOAP544kgr37FdWLdUK6AUFzguZkW0t2AYLQ== 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 4X03fV00SwzFDQ; Thu, 5 Sep 2024 15:48: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 485Fm10n069758; Thu, 5 Sep 2024 15:48:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485Fm1CP069755; Thu, 5 Sep 2024 15:48:01 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:48:01 GMT Message-Id: <202409051548.485Fm1CP069755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e06cf0fc5dd6 - main - tcp: make tcp_lro_flush() static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e06cf0fc5dd626c34acdef308b696b4995371a4b Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e06cf0fc5dd626c34acdef308b696b4995371a4b commit e06cf0fc5dd626c34acdef308b696b4995371a4b Author: Michael Tuexen AuthorDate: 2024-09-05 15:44:33 +0000 Commit: Michael Tuexen CommitDate: 2024-09-05 15:44:33 +0000 tcp: make tcp_lro_flush() static tcp_lro_flush() is not used anymore outside of tcp_lro.c. Therefore make it static. Reviewed by: rscheff, glebius, Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46435 --- sys/netinet/tcp_lro.c | 3 ++- sys/netinet/tcp_lro.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 906e01257a04..10afed17bf3b 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -83,6 +83,7 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO control structures"); static void tcp_lro_rx_done(struct lro_ctrl *lc); static int tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, bool use_hash); +static void tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP LRO"); @@ -1104,7 +1105,7 @@ again: } } -void +static void tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) { diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index b4b5e3f811e4..a94eca665eb5 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -216,7 +216,6 @@ int tcp_lro_init(struct lro_ctrl *); int tcp_lro_init_args(struct lro_ctrl *, struct ifnet *, unsigned, unsigned); void tcp_lro_free(struct lro_ctrl *); void tcp_lro_flush_inactive(struct lro_ctrl *, const struct timeval *); -void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); void tcp_lro_flush_all(struct lro_ctrl *); extern int (*tcp_lro_flush_tcphpts)(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); From nobody Thu Sep 5 15:54:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X03nm4m4sz5WHLl; Thu, 05 Sep 2024 15:54: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 4X03nm42Dqz4lfc; Thu, 5 Sep 2024 15:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725551660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtectqnxSLV6xlyiDOS3NL7IoJgYI1Sh0oKA2Yo9RW4=; b=SW8nlZX7zdMfqxLhvBESCSXnnQKOW6BEKK1GHmpv4hs7ULHLY1X7NGqnREiiS9hdFc1t/0 ZgXy4oQHoHnGYTv7wmf3MR9RFzwZN9L2//hLfBVxPM9TPA3iw5965FdxOL21v2vZbwlpdz 79Lc4BmSiJMAK88qlfIinU2XsiCb8wrBWMDpWeIu4RxkKbOVwgsWZHuqjRRowsiHThXrnZ uYiBVVHqoDE27LGJftgNGzL7ktzC0ZKIZrIt+5znYxfLkMGg4jOFzdqcjUoHM9NQ8f4zRm cPTHruDxZJwf5/AOUnkq7V+A1j1MROpNsYdg7S1Bsyuhl8eb7LDjlX76pnpTew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725551660; a=rsa-sha256; cv=none; b=Sjyg9Y3Xm3JbDO5UYXfV+So4nr2gR0KIQlOagkNbCJHa0Ia+4p9oJmiv8NPlqNhlsUaYc4 PIhTp2R76+jr0n3kPkuf+HrvUs8nnXf5BVN7za79VPnK+bxICujLJUqLpKoaW3cqHwKj0u ah8LEBOAOMNgSnbfg6MHPVpkl3a/nVNaw9Aih3YIiqmRqH088fv9GkuW/6tbR4KmdK0T6c 19sfA6KIjOJk+Tr0c6qadPKKcPg2sk9aNK9tNcpEzqcgZcqu4fcbIs6in3FGdy+aOxKa1H fwe7xZ9LonLY7r94eiqs6TqEpHNgg9FcHyv5ce50GgiYqlo0n02Vy2MBoBVhNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725551660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtectqnxSLV6xlyiDOS3NL7IoJgYI1Sh0oKA2Yo9RW4=; b=fclU3WHrNGKIGjw7UtupNi2TdvFfUA9xUYrfjqVVz9jsHfarUcD0IOjXV7UAHZdg4nMqJu eE0UBcDy5i5nu2nJI0HK95fEkHXwADGtwOWmmAUYK9LYZNrOkI9HmkAxWc58Gq5SmZKW64 hYH/lp/hHMOV90lq61WVPMbUT3qHehECO6FJ32u3C69J0MQXILkJTg3bmCj0GhlDeDVOXr UdsnGdMsRM7UCOudZXVrUHVgr+WsMNc/i2CmXRv5M47UcvRhy0jhTRRqV7G9UoRe7SbXXy CHOcMzEIi6ZOhHWRX0iMIxCxxrS+cXAcqKnnf1rXh098OTHSatKnRlWDPnkPZw== 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 4X03nm3dfvzFYn; Thu, 5 Sep 2024 15:54: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 485FsKlf085698; Thu, 5 Sep 2024 15:54:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485FsKvx085695; Thu, 5 Sep 2024 15:54:20 GMT (envelope-from git) Date: Thu, 5 Sep 2024 15:54:20 GMT Message-Id: <202409051554.485FsKvx085695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1726db7af6b3 - main - flua: Add wrappers for sys/utsname.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1726db7af6b3738eb04d962b351d7f4017e1fc77 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1726db7af6b3738eb04d962b351d7f4017e1fc77 commit 1726db7af6b3738eb04d962b351d7f4017e1fc77 Author: Mark Johnston AuthorDate: 2024-09-05 15:16:29 +0000 Commit: Mark Johnston CommitDate: 2024-09-05 15:53:52 +0000 flua: Add wrappers for sys/utsname.h This allows one to invoke uname from lua scripts. Reviewed by: bapt, kevans, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D42017 --- libexec/flua/linit_flua.c | 1 + libexec/flua/modules/lposix.c | 47 ++++++++++++++++++++++++++++++++++++++++++- libexec/flua/modules/lposix.h | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 4d4d69920e94..1b7d83016cfe 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -59,6 +59,7 @@ static const luaL_Reg loadedlibs[] = { /* FreeBSD Extensions */ {"lfs", luaopen_lfs}, {"posix.sys.stat", luaopen_posix_sys_stat}, + {"posix.sys.utsname", luaopen_posix_sys_utsname}, {"posix.unistd", luaopen_posix_unistd}, {"ucl", luaopen_ucl}, {"fbsd", luaopen_fbsd}, diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c index 5b6e80a0309f..fa3fd5f8e589 100644 --- a/libexec/flua/modules/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -24,8 +24,8 @@ * */ -#include #include +#include #include #include @@ -130,12 +130,50 @@ lua_getpid(lua_State *L) return 1; } +static int +lua_uname(lua_State *L) +{ + struct utsname name; + int error, n; + + n = lua_gettop(L); + luaL_argcheck(L, n == 0, 1, "too many arguments"); + + error = uname(&name); + if (error != 0) { + error = errno; + lua_pushnil(L); + lua_pushstring(L, strerror(error)); + lua_pushinteger(L, error); + return (3); + } + + lua_newtable(L); +#define setkv(f) do { \ + lua_pushstring(L, name.f); \ + lua_setfield(L, -2, #f); \ +} while (0) + setkv(sysname); + setkv(nodename); + setkv(release); + setkv(version); + setkv(machine); +#undef setkv + + return (1); +} + #define REG_SIMPLE(n) { #n, lua_ ## n } static const struct luaL_Reg sys_statlib[] = { REG_SIMPLE(chmod), { NULL, NULL }, }; +static const struct luaL_Reg sys_utsnamelib[] = { + REG_SIMPLE(uname), + { NULL, NULL }, +}; + static const struct luaL_Reg unistdlib[] = { REG_SIMPLE(getpid), REG_SIMPLE(chown), @@ -150,6 +188,13 @@ luaopen_posix_sys_stat(lua_State *L) return 1; } +int +luaopen_posix_sys_utsname(lua_State *L) +{ + luaL_newlib(L, sys_utsnamelib); + return 1; +} + int luaopen_posix_unistd(lua_State *L) { diff --git a/libexec/flua/modules/lposix.h b/libexec/flua/modules/lposix.h index 6085bf045d79..e37caaae9d04 100644 --- a/libexec/flua/modules/lposix.h +++ b/libexec/flua/modules/lposix.h @@ -8,4 +8,5 @@ #include int luaopen_posix_sys_stat(lua_State *L); +int luaopen_posix_sys_utsname(lua_State *L); int luaopen_posix_unistd(lua_State *L); From nobody Thu Sep 5 16:20:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X04MP2xTWz5WKgn; Thu, 05 Sep 2024 16:20: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 4X04MP2LLcz4qsL; Thu, 5 Sep 2024 16:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725553201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0i/wyElIkSRJi6fan8caZHx/EXJhgRpbS7WgxOsAyFU=; b=fCzcnB3VVrwxXOATjlIuPWF6tCgvVnbp2FOvAjQA2TssYLg9fZt+uI3j+P+aG2wEnrgCJO K6DtckiJnsPwWpOP98+bdnNb8pjVbUxz12cnJ6hZOSwDmLWq/nEsdHdb1/oxVL9YHEFM3B dB4IcWZIRqJp7R00v8cPKjsLOaN4rRUUFxjZRNxoMYSUL5xcQ8ib6B/27fWGUODKY9RyVN IBonjyDRalVJXACd+rAVvETc+cfa7t//cXrvAZHZWrtwBUal3NCiVwio5xIqWlsPePxy4W fJDkYg+hy7qgllsUkP/dSG8cSz18CPxIS3G+nhJwUzHi2GPYA+V/KUZ6hn1b1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725553201; a=rsa-sha256; cv=none; b=drrAgMhF1l1eQhOPJTxP2hGRt3zKeYLpb31h6qzRKM5XVBg9RM35ZcJlzXhetinC6kJVzo ZFvS/kjrEfMG3lXRXqZBoPRhCwJvt7ZH6/a9evwgp/ueE1UvkdyWdeQbxLpi2bowQOGJJA 4j2a33IIFDz6cFQKoI0fZvOybsPw3NTGLu0RHKS52kllp+gE0AElbCRJZBytiXKGSL42wq WSaJ0Zq6gfR4YuGvSJSJcsNmnbLdlrRE/pjK4FBvtsIDBVnzv0QIIOxje2oCYQQg6oAfYw 11PB2b/CzyZ5NGmYUQCrb0lKmIRF9QPh7pku9U8vCrNVGYC7UwWfDfYFSgYRgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725553201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0i/wyElIkSRJi6fan8caZHx/EXJhgRpbS7WgxOsAyFU=; b=Hhg+JOf59G8FjahSunj5e05PkLXjBi/JEjzoGTWxYotsbmefw6XZqm2/MFLauPByavLCb7 RCsr8MlAPZBOVTqjqvmRyEoozAhIkqSr/+F3t3cEIQVVtYdqBBq16oCjrleZaEsPMqdH8Y W06Gb1FIxZ62mx0Z5WiRJxSMf/8XkSCDG/sKd3Rh7tI0Ew9D8r+/X8ECvsmvpw7J92xv7X U5WEsSIu+BF2/+Tqm+eEVQCo4KYLVLOE2dUQqHtYWJJUYXXBbBUIp+mfc5ReeidUMIBCnk q+XE8O8ayVG5fcPg8+N8KRle1IYXBppPe6vElsyv4SpZRDj961PTjC0/h602Wg== 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 4X04MP1QCWzFvS; Thu, 5 Sep 2024 16:20: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 485GK1Yi023809; Thu, 5 Sep 2024 16:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485GK1rL023806; Thu, 5 Sep 2024 16:20:01 GMT (envelope-from git) Date: Thu, 5 Sep 2024 16:20:01 GMT Message-Id: <202409051620.485GK1rL023806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 6aede562b438 - main - vm_phys: hide alloc_freelist_pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aede562b438ad9be7197f04307d8bc58d43e6ee Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6aede562b438ad9be7197f04307d8bc58d43e6ee commit 6aede562b438ad9be7197f04307d8bc58d43e6ee Author: Doug Moore AuthorDate: 2024-09-05 16:17:53 +0000 Commit: Doug Moore CommitDate: 2024-09-05 16:17:53 +0000 vm_phys: hide alloc_freelist_pages Make vm_phys_alloc_freelist_pages static. There are no longer any callers outside of vm_phys.c. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D46539 --- sys/vm/vm_phys.c | 42 +++++++++++++++++++++--------------------- sys/vm/vm_phys.h | 2 -- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 59ab7d13c55d..cf1ed5818b2f 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -903,26 +903,6 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) return (i); } -/* - * Allocate a contiguous, power of two-sized set of physical pages - * from the free lists. - * - * The free page queues must be locked. - */ -vm_page_t -vm_phys_alloc_pages(int domain, int pool, int order) -{ - vm_page_t m; - int freelist; - - for (freelist = 0; freelist < VM_NFREELIST; freelist++) { - m = vm_phys_alloc_freelist_pages(domain, freelist, pool, order); - if (m != NULL) - return (m); - } - return (NULL); -} - /* * Allocate a contiguous, power of two-sized set of physical pages from the * specified free list. The free list must be specified using one of the @@ -930,7 +910,7 @@ vm_phys_alloc_pages(int domain, int pool, int order) * * The free page queues must be locked. */ -vm_page_t +static vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) { struct vm_freelist *alt, *fl; @@ -987,6 +967,26 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) return (NULL); } +/* + * Allocate a contiguous, power of two-sized set of physical pages + * from the free lists. + * + * The free page queues must be locked. + */ +vm_page_t +vm_phys_alloc_pages(int domain, int pool, int order) +{ + vm_page_t m; + int freelist; + + for (freelist = 0; freelist < VM_NFREELIST; freelist++) { + m = vm_phys_alloc_freelist_pages(domain, freelist, pool, order); + if (m != NULL) + return (m); + } + return (NULL); +} + /* * Find the vm_page corresponding to the given physical address, which must lie * within the given physical memory segment. diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index bd086fd5571f..43d94a9420f2 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -61,8 +61,6 @@ extern int *mem_locality; void vm_phys_add_seg(vm_paddr_t start, vm_paddr_t end); vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); -vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, - int order); int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); From nobody Thu Sep 5 17:25:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X05qD4fBgz5WRxj; Thu, 05 Sep 2024 17:25: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 4X05qD46W1z47qx; Thu, 5 Sep 2024 17:25:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725557144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YfTeFl+n+VPinEe5jJj6qd+hpGS9fPiGlxS8+tvd/8=; b=hrPtB3eC8JA2xx/HT161S44jkzPxP5B6OJR1AsS9XX1s3PLVfSqSodLugPdwBKQJMeSaeh /UOs3NYzbS8IeMAQCOMu3syEmUgaBSGF0VKwEo1i1lHcjHwSLlMwkIBdKj1St/k1P5fPge WzfWRk5Ta6rgaiUIWzjyL8PpDybjO4z+o+w7REyyK7vC8aNfHXm+gHKVxecS/Rl+8SkpyX pXKKj46PMgyIHj+sHZ5wLkoKiWWFzZ7tup8G0MH44R5enGzTnnROZfSV4KVY95ddLJak7k eoq6Vd4qbZHaYuR4KFl/ga8+wF7QlIQTWVEQD2574lOpN9jVB7koSvMmWWw8Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725557144; a=rsa-sha256; cv=none; b=E2ZPuUXU3Abc7uDLhfAdk/eYVZhk0O5nAyDLzurQD6r0v8kLzM6U3+uHHDUBP2fhm/eyst uYP1U/P+QyDnB/ir4evctKhsXhKfa7Gi/6dcvCgahBQm++ZLfhXPOw/ph4kcGZmC00+Hvu +1gjBtdUgZox6aSsbpMJ/21pesoq6aFS/u3ihV0b5bpK1JoWUi3Uo+cK/7yOxMVmnw2n9d jEB2FThVKZmG9Thz6OEzKL908HsTlO/Mwx8hgU/vlxgu4xO/79E8Q0QFobX5gZXYJ3Ssmr Yjj6WvR7UEwySmkAWmI44iPATg9sqj/DwW/ysaQo1f0Q0d+QLL6Ig39wOkWpVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725557144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YfTeFl+n+VPinEe5jJj6qd+hpGS9fPiGlxS8+tvd/8=; b=ZtSdSDm9Xe9Dx7rTQb582ykD9Sxv0ChAAdYrajib0XgNtWA0rQDRbat03NpfajDVxDyMbR 8USsNFt2NjUCgzhI4BFgGCEjlcDsMfIcbMNys85vH1xrjSjSR49ks6x29zVMeMz0VALGhm Vfjc3D2+uXDcXP7sjqAVL3ihIvSP3/8GXjnufMzZKAVvK8bGQrnWyZNomhKbmjdoifa+ws z2FF/ZuzLeby3wHBe4nzYglUM1jd6vj0Mte9aG/enZnUkYF25kz7C92A545pH+cu2rbov7 wHzVwwUN5PuUbFnMqhlM/m+L6lHp0yredcw619MRR9duHD13PoOoPxEJkThTJw== 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 4X05qD3bC3zH4p; Thu, 5 Sep 2024 17:25: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 485HPiAZ040328; Thu, 5 Sep 2024 17:25:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485HPi2c040325; Thu, 5 Sep 2024 17:25:44 GMT (envelope-from git) Date: Thu, 5 Sep 2024 17:25:44 GMT Message-Id: <202409051725.485HPi2c040325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 7b86593f0f6c - main - sdhci: Match quirk_set/quirk_clear sysctls to type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b86593f0f6cbfba2883058c6c9d2389f1c581aa Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=7b86593f0f6cbfba2883058c6c9d2389f1c581aa commit 7b86593f0f6cbfba2883058c6c9d2389f1c581aa Author: Justin Hibbits AuthorDate: 2024-09-05 17:20:14 +0000 Commit: Justin Hibbits CommitDate: 2024-09-05 17:25:16 +0000 sdhci: Match quirk_set/quirk_clear sysctls to type These quirk fields are u_int, so match the sysctl type to the actual types, and use SYSCTL_UINT. This provides room for setting bit 31 quirk as needed. Sponsored by: Juniper Networks, Inc. MFC after: 1 week --- sys/dev/sdhci/sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 2403f60d613c..c747f54cb32c 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -72,10 +72,10 @@ static int sdhci_debug = 0; SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_debug, 0, "Debug level"); u_int sdhci_quirk_clear = 0; -SYSCTL_INT(_hw_sdhci, OID_AUTO, quirk_clear, CTLFLAG_RWTUN, &sdhci_quirk_clear, +SYSCTL_UINT(_hw_sdhci, OID_AUTO, quirk_clear, CTLFLAG_RWTUN, &sdhci_quirk_clear, 0, "Mask of quirks to clear"); u_int sdhci_quirk_set = 0; -SYSCTL_INT(_hw_sdhci, OID_AUTO, quirk_set, CTLFLAG_RWTUN, &sdhci_quirk_set, 0, +SYSCTL_UINT(_hw_sdhci, OID_AUTO, quirk_set, CTLFLAG_RWTUN, &sdhci_quirk_set, 0, "Mask of quirks to set"); #define RD1(slot, off) SDHCI_READ_1((slot)->bus, (slot), (off)) From nobody Thu Sep 5 17:28:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X05t65zRDz5WS7Y; Thu, 05 Sep 2024 17:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X05t659bQz482H; Thu, 5 Sep 2024 17:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725557294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T4MVSlebqEkwDe4TLpolHWuw91LbroBrBXouKmDTbVU=; b=sMsx09Nx5DoqUFsqm2ZmwfcyzGxAVFLY0w6lnYDbxrC9LgCdw8LVGNCsSmOTii8+26sHpF /bK5aThczM36D3v4XIAZHby2bUM2r0JZDtVfVjhqKPhSWNqsBHCWiqyEJiICsujah+TwbR 275Qon/+FEH/EWCnD9OLQyvVR9+YRqdIQI7UriyFUeqwh9SVOv3H2aaVv7YV5wvR7lAX4j xg7BJYaKcBH2SAQVE12+SDlYuHN4oZX55UZs5FqyMVWwg7705PiEx+3rlbiPIAjYm9TMay yBxohQRuyQo917WlsqN2cAWZl0Yq+CiOzAGIyTpZOerr9dQJ05x0GYWQI9H3og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725557294; a=rsa-sha256; cv=none; b=xYcQutQ1CS82bCuXBDvvkEdcOpR0iZ2EmsBImlHJNr4GGSPfGiv4QN0kV8IC590WTzeFQ8 I4hpRRjFCOeN59tyRI7pGzHlstPQyxeweHwBXb1OSgVLNGmDN56V8y6InApSD83NT0ZQkZ AyS7yvMLrhseJLICMWOGVkxfpgeIH6iuk+ZWTcabGbFmYjPmUjOxfan74XGEUW9PjjZ7yC e9Wm/kDaiwpuJQlVfksbeMpAGFyI+QqcUA5347d1+T9lSY4MVzPmR4CB6ougW2w+8j+UdM nmEO+qLihdJbEIquto7EDC/BPBnB5AACKTLtTJdVpVcESdxYAi/vZgb/OM4Qjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725557294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T4MVSlebqEkwDe4TLpolHWuw91LbroBrBXouKmDTbVU=; b=NmjReWFAK/TP8QKqJGD0uNC44e0c6l+NQe92BzzSzmU8zAuTkIN4yrKWZQTekRMWuSZggi iWp2br8DeiavzXtyqo89e1/Vi5PSInoRiVnVYuFFQjfVlshFaSwf/k5KXEGl54IrQ5saCM mJaqnfuYg+Xl17X9wc4yUjD5MPGj8DtFISzE2cZu5IsAcraBTfDrnZxeSmFPL0ydjV88Oe tGYp/viu/dk0rejVA5BUBaJOZr5D1jxukXlhTtcUQYwrmhKaJuYBumNU3kEDhbmgrZaphg IHdxz8lmnury14QG6PbJWXULRcWeMOUakOs9vTtINRcOURD5hKaq4ZzE4r581Q== 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 4X05t64nKrzHdR; Thu, 5 Sep 2024 17:28: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 485HSE5O040819; Thu, 5 Sep 2024 17:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485HSE1R040816; Thu, 5 Sep 2024 17:28:14 GMT (envelope-from git) Date: Thu, 5 Sep 2024 17:28:14 GMT Message-Id: <202409051728.485HSE1R040816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d59a76183470 - main - spa_prop_get: require caller to supply output nvlist List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d59a76183470685bdf0b88013d2baad1f04f030f Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d59a76183470685bdf0b88013d2baad1f04f030f commit d59a76183470685bdf0b88013d2baad1f04f030f Author: Rob Norris AuthorDate: 2024-09-04 02:09:43 +0000 Commit: Gleb Smirnoff CommitDate: 2024-09-05 17:27:35 +0000 spa_prop_get: require caller to supply output nvlist All callers to spa_prop_get() and spa_prop_get_nvlist() supplied their own preallocated nvlist (except ztest), so we can remove the option to have them allocate one if none is supplied. This sidesteps a bug in spa_prop_get(), where the error var wasn't initialised, which could lead to the provided nvlist being freed at the end. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris (cherry picked from commit 366d6fecf6bb3c59668b0f3b89f2a610595f3d2f) --- sys/contrib/openzfs/cmd/ztest.c | 5 +- sys/contrib/openzfs/include/sys/spa.h | 4 +- sys/contrib/openzfs/module/zfs/spa.c | 100 +++++++++++++---------------- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 10 +-- 4 files changed, 53 insertions(+), 66 deletions(-) diff --git a/sys/contrib/openzfs/cmd/ztest.c b/sys/contrib/openzfs/cmd/ztest.c index 6a9264ddcc4c..eb68c27b1dc1 100644 --- a/sys/contrib/openzfs/cmd/ztest.c +++ b/sys/contrib/openzfs/cmd/ztest.c @@ -6211,13 +6211,14 @@ void ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id) { (void) zd, (void) id; - nvlist_t *props = NULL; (void) pthread_rwlock_rdlock(&ztest_name_lock); (void) ztest_spa_prop_set_uint64(ZPOOL_PROP_AUTOTRIM, ztest_random(2)); - VERIFY0(spa_prop_get(ztest_spa, &props)); + nvlist_t *props = fnvlist_alloc(); + + VERIFY0(spa_prop_get(ztest_spa, props)); if (ztest_opts.zo_verbose >= 6) dump_nvlist(props, 4); diff --git a/sys/contrib/openzfs/include/sys/spa.h b/sys/contrib/openzfs/include/sys/spa.h index 3998f5a6de73..0fa3149e6c6f 100644 --- a/sys/contrib/openzfs/include/sys/spa.h +++ b/sys/contrib/openzfs/include/sys/spa.h @@ -1196,9 +1196,9 @@ extern void spa_boot_init(void); /* properties */ extern int spa_prop_set(spa_t *spa, nvlist_t *nvp); -extern int spa_prop_get(spa_t *spa, nvlist_t **nvp); +extern int spa_prop_get(spa_t *spa, nvlist_t *nvp); extern int spa_prop_get_nvlist(spa_t *spa, char **props, - unsigned int n_props, nvlist_t **outnvl); + unsigned int n_props, nvlist_t *outnvl); extern void spa_prop_clear_bootfs(spa_t *spa, uint64_t obj, dmu_tx_t *tx); extern void spa_configfile_set(spa_t *, nvlist_t *, boolean_t); diff --git a/sys/contrib/openzfs/module/zfs/spa.c b/sys/contrib/openzfs/module/zfs/spa.c index cafc7196c354..7a3dd29769ca 100644 --- a/sys/contrib/openzfs/module/zfs/spa.c +++ b/sys/contrib/openzfs/module/zfs/spa.c @@ -366,21 +366,15 @@ spa_prop_add(spa_t *spa, const char *propname, nvlist_t *outnvl) int spa_prop_get_nvlist(spa_t *spa, char **props, unsigned int n_props, - nvlist_t **outnvl) + nvlist_t *outnvl) { int err = 0; if (props == NULL) return (0); - if (*outnvl == NULL) { - err = nvlist_alloc(outnvl, NV_UNIQUE_NAME, KM_SLEEP); - if (err) - return (err); - } - for (unsigned int i = 0; i < n_props && err == 0; i++) { - err = spa_prop_add(spa, props[i], *outnvl); + err = spa_prop_add(spa, props[i], outnvl); } return (err); @@ -406,7 +400,7 @@ spa_prop_add_user(nvlist_t *nvl, const char *propname, char *strval, * Get property values from the spa configuration. */ static void -spa_prop_get_config(spa_t *spa, nvlist_t **nvp) +spa_prop_get_config(spa_t *spa, nvlist_t *nv) { vdev_t *rvd = spa->spa_root_vdev; dsl_pool_t *pool = spa->spa_dsl_pool; @@ -428,48 +422,48 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) size += metaslab_class_get_space(spa_dedup_class(spa)); size += metaslab_class_get_space(spa_embedded_log_class(spa)); - spa_prop_add_list(*nvp, ZPOOL_PROP_NAME, spa_name(spa), 0, src); - spa_prop_add_list(*nvp, ZPOOL_PROP_SIZE, NULL, size, src); - spa_prop_add_list(*nvp, ZPOOL_PROP_ALLOCATED, NULL, alloc, src); - spa_prop_add_list(*nvp, ZPOOL_PROP_FREE, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_NAME, spa_name(spa), 0, src); + spa_prop_add_list(nv, ZPOOL_PROP_SIZE, NULL, size, src); + spa_prop_add_list(nv, ZPOOL_PROP_ALLOCATED, NULL, alloc, src); + spa_prop_add_list(nv, ZPOOL_PROP_FREE, NULL, size - alloc, src); - spa_prop_add_list(*nvp, ZPOOL_PROP_CHECKPOINT, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_CHECKPOINT, NULL, spa->spa_checkpoint_info.sci_dspace, src); - spa_prop_add_list(*nvp, ZPOOL_PROP_FRAGMENTATION, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_FRAGMENTATION, NULL, metaslab_class_fragmentation(mc), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_EXPANDSZ, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_EXPANDSZ, NULL, metaslab_class_expandable_space(mc), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_READONLY, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_READONLY, NULL, (spa_mode(spa) == SPA_MODE_READ), src); cap = (size == 0) ? 0 : (alloc * 100 / size); - spa_prop_add_list(*nvp, ZPOOL_PROP_CAPACITY, NULL, cap, src); + spa_prop_add_list(nv, ZPOOL_PROP_CAPACITY, NULL, cap, src); - spa_prop_add_list(*nvp, ZPOOL_PROP_DEDUPRATIO, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_DEDUPRATIO, NULL, ddt_get_pool_dedup_ratio(spa), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_BCLONEUSED, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_BCLONEUSED, NULL, brt_get_used(spa), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_BCLONESAVED, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_BCLONESAVED, NULL, brt_get_saved(spa), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_BCLONERATIO, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_BCLONERATIO, NULL, brt_get_ratio(spa), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_DEDUP_TABLE_SIZE, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_DEDUP_TABLE_SIZE, NULL, ddt_get_ddt_dsize(spa), src); - spa_prop_add_list(*nvp, ZPOOL_PROP_HEALTH, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_HEALTH, NULL, rvd->vdev_state, src); version = spa_version(spa); if (version == zpool_prop_default_numeric(ZPOOL_PROP_VERSION)) { - spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_VERSION, NULL, version, ZPROP_SRC_DEFAULT); } else { - spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_VERSION, NULL, version, ZPROP_SRC_LOCAL); } - spa_prop_add_list(*nvp, ZPOOL_PROP_LOAD_GUID, + spa_prop_add_list(nv, ZPOOL_PROP_LOAD_GUID, NULL, spa_load_guid(spa), src); } @@ -479,62 +473,62 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) * when opening pools before this version freedir will be NULL. */ if (pool->dp_free_dir != NULL) { - spa_prop_add_list(*nvp, ZPOOL_PROP_FREEING, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_FREEING, NULL, dsl_dir_phys(pool->dp_free_dir)->dd_used_bytes, src); } else { - spa_prop_add_list(*nvp, ZPOOL_PROP_FREEING, + spa_prop_add_list(nv, ZPOOL_PROP_FREEING, NULL, 0, src); } if (pool->dp_leak_dir != NULL) { - spa_prop_add_list(*nvp, ZPOOL_PROP_LEAKED, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_LEAKED, NULL, dsl_dir_phys(pool->dp_leak_dir)->dd_used_bytes, src); } else { - spa_prop_add_list(*nvp, ZPOOL_PROP_LEAKED, + spa_prop_add_list(nv, ZPOOL_PROP_LEAKED, NULL, 0, src); } } - spa_prop_add_list(*nvp, ZPOOL_PROP_GUID, NULL, spa_guid(spa), src); + spa_prop_add_list(nv, ZPOOL_PROP_GUID, NULL, spa_guid(spa), src); if (spa->spa_comment != NULL) { - spa_prop_add_list(*nvp, ZPOOL_PROP_COMMENT, spa->spa_comment, + spa_prop_add_list(nv, ZPOOL_PROP_COMMENT, spa->spa_comment, 0, ZPROP_SRC_LOCAL); } if (spa->spa_compatibility != NULL) { - spa_prop_add_list(*nvp, ZPOOL_PROP_COMPATIBILITY, + spa_prop_add_list(nv, ZPOOL_PROP_COMPATIBILITY, spa->spa_compatibility, 0, ZPROP_SRC_LOCAL); } if (spa->spa_root != NULL) - spa_prop_add_list(*nvp, ZPOOL_PROP_ALTROOT, spa->spa_root, + spa_prop_add_list(nv, ZPOOL_PROP_ALTROOT, spa->spa_root, 0, ZPROP_SRC_LOCAL); if (spa_feature_is_enabled(spa, SPA_FEATURE_LARGE_BLOCKS)) { - spa_prop_add_list(*nvp, ZPOOL_PROP_MAXBLOCKSIZE, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_MAXBLOCKSIZE, NULL, MIN(zfs_max_recordsize, SPA_MAXBLOCKSIZE), ZPROP_SRC_NONE); } else { - spa_prop_add_list(*nvp, ZPOOL_PROP_MAXBLOCKSIZE, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_MAXBLOCKSIZE, NULL, SPA_OLD_MAXBLOCKSIZE, ZPROP_SRC_NONE); } if (spa_feature_is_enabled(spa, SPA_FEATURE_LARGE_DNODE)) { - spa_prop_add_list(*nvp, ZPOOL_PROP_MAXDNODESIZE, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_MAXDNODESIZE, NULL, DNODE_MAX_SIZE, ZPROP_SRC_NONE); } else { - spa_prop_add_list(*nvp, ZPOOL_PROP_MAXDNODESIZE, NULL, + spa_prop_add_list(nv, ZPOOL_PROP_MAXDNODESIZE, NULL, DNODE_MIN_SIZE, ZPROP_SRC_NONE); } if ((dp = list_head(&spa->spa_config_list)) != NULL) { if (dp->scd_path == NULL) { - spa_prop_add_list(*nvp, ZPOOL_PROP_CACHEFILE, + spa_prop_add_list(nv, ZPOOL_PROP_CACHEFILE, "none", 0, ZPROP_SRC_LOCAL); } else if (strcmp(dp->scd_path, spa_config_path) != 0) { - spa_prop_add_list(*nvp, ZPOOL_PROP_CACHEFILE, + spa_prop_add_list(nv, ZPOOL_PROP_CACHEFILE, dp->scd_path, 0, ZPROP_SRC_LOCAL); } } @@ -544,19 +538,13 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) * Get zpool property values. */ int -spa_prop_get(spa_t *spa, nvlist_t **nvp) +spa_prop_get(spa_t *spa, nvlist_t *nv) { objset_t *mos = spa->spa_meta_objset; zap_cursor_t zc; zap_attribute_t za; dsl_pool_t *dp; - int err; - - if (*nvp == NULL) { - err = nvlist_alloc(nvp, NV_UNIQUE_NAME, KM_SLEEP); - if (err) - return (err); - } + int err = 0; dp = spa_get_dsl(spa); dsl_pool_config_enter(dp, FTAG); @@ -565,7 +553,7 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp) /* * Get properties from the spa config. */ - spa_prop_get_config(spa, nvp); + spa_prop_get_config(spa, nv); /* If no pool property object, no more prop to get. */ if (mos == NULL || spa->spa_pool_props_object == 0) @@ -610,7 +598,7 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp) intval = za.za_first_integer; } - spa_prop_add_list(*nvp, prop, strval, intval, src); + spa_prop_add_list(nv, prop, strval, intval, src); if (strval != NULL) kmem_free(strval, ZFS_MAX_DATASET_NAME_LEN); @@ -627,10 +615,10 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp) break; } if (prop != ZPOOL_PROP_INVAL) { - spa_prop_add_list(*nvp, prop, strval, 0, src); + spa_prop_add_list(nv, prop, strval, 0, src); } else { src = ZPROP_SRC_LOCAL; - spa_prop_add_user(*nvp, za.za_name, strval, + spa_prop_add_user(nv, za.za_name, strval, src); } kmem_free(strval, za.za_num_integers); @@ -644,11 +632,9 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp) out: mutex_exit(&spa->spa_props_lock); dsl_pool_config_exit(dp, FTAG); - if (err && err != ENOENT) { - nvlist_free(*nvp); - *nvp = NULL; + + if (err && err != ENOENT) return (err); - } return (0); } diff --git a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c index 897335dd4e4f..3e2fb73b11ed 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c +++ b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c @@ -3022,7 +3022,6 @@ static const zfs_ioc_key_t zfs_keys_get_props[] = { static int zfs_ioc_pool_get_props(const char *pool, nvlist_t *innvl, nvlist_t *outnvl) { - nvlist_t *nvp = outnvl; spa_t *spa; char **props = NULL; unsigned int n_props = 0; @@ -3041,16 +3040,17 @@ zfs_ioc_pool_get_props(const char *pool, nvlist_t *innvl, nvlist_t *outnvl) */ mutex_enter(&spa_namespace_lock); if ((spa = spa_lookup(pool)) != NULL) { - error = spa_prop_get(spa, &nvp); + error = spa_prop_get(spa, outnvl); if (error == 0 && props != NULL) error = spa_prop_get_nvlist(spa, props, n_props, - &nvp); + outnvl); } mutex_exit(&spa_namespace_lock); } else { - error = spa_prop_get(spa, &nvp); + error = spa_prop_get(spa, outnvl); if (error == 0 && props != NULL) - error = spa_prop_get_nvlist(spa, props, n_props, &nvp); + error = spa_prop_get_nvlist(spa, props, n_props, + outnvl); spa_close(spa, FTAG); } From nobody Thu Sep 5 17:44:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X06Dh36zRz5WTKK; Thu, 05 Sep 2024 17:44:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X06Dg0Hp7z4B8b; Thu, 5 Sep 2024 17:44:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=quarantine) header.from=cschubert.com; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id mBW8sdGhfMArNmGWosBEn6; Thu, 05 Sep 2024 17:44:18 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id mGWmsRfSg2M9qmGWns2hAg; Thu, 05 Sep 2024 17:44:18 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=66d9edf2 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=IkcTkHD0fZMA:10 a=EaEq8P2WXUwA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=qj0R9Y0jjNCr4ecJS1cA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 3DE4D249; Thu, 05 Sep 2024 10:44:16 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 247B0293; Thu, 05 Sep 2024 10:44:16 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Stefan =?utf-8?Q?E=C3=9Fer?= cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 12e0d316644a - main - vendor/bc: upgrade to version 7.0.0 In-reply-to: <202408261628.47QGSD1E072637@gitrepo.freebsd.org> References: <202408261628.47QGSD1E072637@gitrepo.freebsd.org> Comments: In-reply-to Stefan =?utf-8?Q?E=C3=9Fer?= message dated "Mon, 26 Aug 2024 16:28:13 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: Thu, 05 Sep 2024 10:44:16 -0700 Message-Id: <20240905174416.247B0293@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCZdruvzL/g9gwHGYxG1yRBR4wE7kLRcFcRJIAul+1EBsmaooV6D73dJ6uJuBtbJGlUP4sVeqo+FbcNVf+fIhQDGXFc2H4vp3kiLilySzczXbqvE3dVd X5GqSkBkfuVWodYQmg3DQv9rfNP5QiTMwPM6Wnh3WRbO/5lvKpzZOnpjzLRMcdllJ08x1dg7BijUEVUivTM5bekcD7qiyZBIizxhOdQrnXA+PUwugtyBdCxv 1PAWTC2OfF/kXO/zvTrNAmrBvc8AnG2Fpg+oK37IHy/1Cpyx1lJ+iNUhjUv/hoSTtgFzxkL3qanjMEI/HndqYcZDvlV4lZedbN+lEur5JoE= X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.55 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.955]; DMARC_POLICY_ALLOW(-0.50)[cschubert.com,quarantine]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RWL_MAILSPIKE_VERYGOOD(-0.20)[3.97.99.33:from]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; REPLYTO_EQ_FROM(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Queue-Id: 4X06Dg0Hp7z4B8b In message <202408261628.47QGSD1E072637@gitrepo.freebsd.org>, Stefan =?utf-8?Q? E=C3=9Fer?= writes: > The branch main has been updated by se: > > URL: https://cgit.FreeBSD.org/src/commit/?id=12e0d316644a4f80f5f1f78cf07bd93d > ef43b1ca > > commit 12e0d316644a4f80f5f1f78cf07bd93def43b1ca > Author: Stefan Eßer > AuthorDate: 2024-08-23 16:45:58 +0000 > Commit: Stefan Eßer > CommitDate: 2024-08-26 16:27:29 +0000 > > vendor/bc: upgrade to version 7.0.0 > > This is a production release to fix three bugs, none of which > affects well formed scripts on FreeBSD: > > The first bug is that bc/dc will exit on macOS when the terminal > is resized. > > The second bug is that an array, which should only be a function > parameter, was accepted as part of larger expressions. > > The third bug is that the value stack for dc was cleared on any error. > However, this is not how other dc behave. To bring dc more in line > with other implementations, this behavior was changed. This change is > why this version is a new major version. > > (cherry picked from commit 54d20d67e2af28d948ce2df13feb039fa10900fc) > > MFC after: 3 days This commit introduced a regression. Prior to this one could exit bc using the EOF character defined by stty(1), default ^D. Now one needs to enter the word quit instead of ^D. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Sep 5 19:55:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X097v2tJKz5TmSK; Thu, 05 Sep 2024 19:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X097v2M6jz4bf5; Thu, 5 Sep 2024 19:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725566123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pdlmA1ne06i3nv5jaFYfac3M+ZgwAzU9Y3MXtVXIwhM=; b=C+daY4UG0IFJb3TZVF/JOiIHs22I7DXdZ8XzHmw7K/Stuz6HN/O4CszK82wgxvulNSZaW/ 5OPjsSUPk1zyQ58PwgKvg531sFmYR1wDeRM9b38ixnYVFqzulA8SlD09FiJuZjYJwfF4b7 1L1ko8rEZeHoTEfQXJA3mhg+49K7NkdJbJt7BCp6BVAeZYejt3h0MeiLAWZUNStY6HxhLB 8DhBNOxWW2l2NkMjWfYJOKXK+yvTrXTdlD6lRtrO1/QhOrsErs2Z/AdY032qeCEj9UgZYJ YuvYJnwiEX8Si1HxLyeI+mK0bwn9QLZ5jGd1PV+zx6mMXMk4g0Tlnc7Bc8dl9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725566123; a=rsa-sha256; cv=none; b=HQPHb5kQTq4j0ZqVS0TQrrmOCN49rkQkgLIw6h3SGs0Ejirm4xvsAxM2ajc10J+BRNVbl6 6wlm4LGMdcyFWwj3o00sRikxdKZHIXVN8dxyfmlF6wGLGmgO4WwgDWYlvRQqjoRhBlW94X c/ovHSTb7RvijiKeylB4+88Re2nhBtGELSkdyXj4/mNTwq36flGIJMf5QJ6nQ8NBlrws9+ /WNbPX3PxN1/emC48zYZ1FHpoNZf/I3jNsNlqzmLyG2YsjEK8Qj7DgHM037woZ8fqxkSyg Q9dUCvOMJhAWuIjn6pdq3IosT/fBiY7fK1eX+R7mVqyXkdIDx0gDW7O80hASww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725566123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pdlmA1ne06i3nv5jaFYfac3M+ZgwAzU9Y3MXtVXIwhM=; b=MFfOvrmODClG8WsLPryCuMnLljNn+G6HrrSWDZEQBVtjszdvZ1KjdMJF5g2So5femhjBBI 56Ay7H1qw6Vszifwzpo/nCEfay1vZ5N8Sm4cqCkxTNM1B83tstiXhQf0SOvq8UKUHEBUew GOdFTYVvgybTnddx7/aBTvRgL0hhX7XfWxg1Hi3N61T7ctKIw5dvFcYsvZtGaY9g6bugBn bVZF7P/Y12xNpLrR/eOEcr18qMcztR0mBEHbdG0Ms05Wy9zkr3xUucwnAb7FpODd8Z/uEt g0RLEOs6xuQ4rI5I5zmhfKQv/QalMlNgEhTCoac3NucGmIC67XiAuMykmwOSjw== 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 4X097v1yr1zMMd; Thu, 5 Sep 2024 19:55: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 485JtNGH095826; Thu, 5 Sep 2024 19:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485JtNL1095823; Thu, 5 Sep 2024 19:55:23 GMT (envelope-from git) Date: Thu, 5 Sep 2024 19:55:23 GMT Message-Id: <202409051955.485JtNL1095823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ed4d2a54fc7a - main - rc: network.subr update consitency with older change (v6/v4 order) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed4d2a54fc7a0397c2042f496f176305ca03ebdd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ed4d2a54fc7a0397c2042f496f176305ca03ebdd commit ed4d2a54fc7a0397c2042f496f176305ca03ebdd Author: Bjoern A. Zeeb AuthorDate: 2024-09-04 19:03:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-05 19:53:57 +0000 rc: network.subr update consitency with older change (v6/v4 order) As of 1b5be7204eaeeaf58eefdebe5b308f90792c693b we setup parts of IPv6 before IPv4 if configured. For consistency change a case in ifn_start() calling ipv6_up() before ipv4_up() and reverse in ifn_stop(). MFC after: 10 days Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D33426 --- libexec/rc/network.subr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr index 257643f48ba5..931fbec19a60 100644 --- a/libexec/rc/network.subr +++ b/libexec/rc/network.subr @@ -46,8 +46,8 @@ ifn_start() ifscript_up ${ifn} && cfg=0 ifconfig_up ${ifn} && cfg=0 if ! noafif $ifn; then - afexists inet && ipv4_up ${ifn} && cfg=0 afexists inet6 && ipv6_up ${ifn} && cfg=0 + afexists inet && ipv4_up ${ifn} && cfg=0 fi childif_create ${ifn} && cfg=0 @@ -67,8 +67,8 @@ ifn_stop() [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" if ! noafif $ifn; then - afexists inet6 && ipv6_down ${ifn} && cfg=0 afexists inet && ipv4_down ${ifn} && cfg=0 + afexists inet6 && ipv6_down ${ifn} && cfg=0 fi ifconfig_down ${ifn} && cfg=0 ifscript_down ${ifn} && cfg=0 From nobody Thu Sep 5 20:11:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X09Vm37Npz5Tp9S; Thu, 05 Sep 2024 20:11: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 4X09Vm2fthz4gDS; Thu, 5 Sep 2024 20:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725567104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ML5Nv+WTEhfoCOVQaqVkElyMlUF5MwaVqb/AHBzJpDs=; b=psBzTkO5pY7UDVzE1ZbgD4cxebT48oP/4w3mffg6A3Lu5XLyKIeurLOTCaJ2zV8Sz8Ha0/ 6iU45rFzMDAF8AsKjes+uCPFRUTd6UX1yl+ZZRovJqi0Lmn/u9nlMBbuO0rcKDQHFQWGvb 9sNX7CRxRJscucpXjKVgfkK4m4dF0fCABC5+3LMvjZUed246+Ij4aDqWryD/lbCok7Ebij xKQE5MZ7kppsPw/aohwr7gcYohF7HpA+7E4UoLlDHo4xTJ4ZXKzkT15XsDAgbX3lRyrNdL qMyjFppr7B/6AsTDApJc187khSROSn4mDwYo82FCsvve2xZba3PR0rLp+2tsPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725567104; a=rsa-sha256; cv=none; b=LVzQyvjrSPpFsPxwIrM7DRRgUpl3OMYdDQURLGgQKv0/AXQWrtabvOms3ayzfanmoxueWh dfjQfQVTfVOZw3VPqrY4p4XplEPsTXPn/TyGfuLf7w4j0O0Rqnz7DALgN3lWXHb7Z6eGzK n/qRVwZ/PnsrBMArQKIPCPmJHpdowaF1KrBIMTBKvfkLQNlr5AkaIHkAolMLOCabQ6mug0 OlvonCP9eswVPH4uMVAra7pdFG5z5CLtM9i5rjsjAQmxQl3f8DH4pGMHLUO73zIkdHak0l /oXc1i2OJ+4WRedLYs+f8VN8vSh0gzmMlxcalpAaycQQ6tAyyrdTBbgM3NAqOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725567104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ML5Nv+WTEhfoCOVQaqVkElyMlUF5MwaVqb/AHBzJpDs=; b=RDZOPZrLfiK+8voNpJmI2XPcbm6kqIsVdFfMtQLK2FjIjPfZjpoLpAzfnZZpMv4FvCbpWj Skq28cbxRn/9xRPYCdMcJVD6BC+CFsn1vtXcDJagTRp19Dfvg6HG3tEd3Z18UGeTnTN/Ml WVMIuHYKnwzPKG+zGdfIq6WiHLE0EBn0A1KDBqUvzt6q8rZrMk4sGy1xuDs73zICQhwGGq LDeelMamMLqjek+LnBvxfYAwCJs3/2M3Sv5taiwGmyrGi9QyK3OMEhoMLJj5FrCYcO3Rb8 WSWjQis+u4azVnRb9caLbKHlf8mbc4dGo7WXhGNhjbhikXk8Swv1ggPTvpKk5g== 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 4X09Vm2FM2zMSW; Thu, 5 Sep 2024 20:11: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 485KBiAg024976; Thu, 5 Sep 2024 20:11:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485KBixx024974; Thu, 5 Sep 2024 20:11:44 GMT (envelope-from git) Date: Thu, 5 Sep 2024 20:11:44 GMT Message-Id: <202409052011.485KBixx024974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 157802238b5a - main - Add UPDATING note about running make delete-old after libc++ 18 upgrade List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 157802238b5aa7722aff40317fe6d05f5c975d71 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=157802238b5aa7722aff40317fe6d05f5c975d71 commit 157802238b5aa7722aff40317fe6d05f5c975d71 Author: Dimitry Andric AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric CommitDate: 2024-09-05 19:58:51 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days --- UPDATING | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPDATING b/UPDATING index cffafdb5d247..1aae85df0a70 100644 --- a/UPDATING +++ b/UPDATING @@ -55,6 +55,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: own packages. If you use pkgbase, you should install the relevant packages: FreeBSD-cron, FreeBSD-lp, or FreeBSD-ntp. +20240406: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 18.1.6. It is important that you run `make delete-old` + as described in the COMMON ITEMS section, otherwise several libc++ + headers that are obsolete and need to be removed can cause compilation + errors in C++ programs. + 20240205: For dynamically linked programs, system calls are now made from libsys rather than libc. No change in linkage is required as From nobody Thu Sep 5 21:15:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0Bvt5MZkz5Tyb3; Thu, 05 Sep 2024 21:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0Bvt4Xjmz41bB; Thu, 5 Sep 2024 21:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725570906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JhUfbwJqU46HzAAGsarMpzE+gkIdstL5nPEJJwz33/g=; b=iKRxhx2PvL1ljq6cOfSy3ih+66/TkHAZNV+6yueMWEU9yIFG0/zM7wq6SfSLrw4LAtaJlA 0h6Bf7HVxVY00754K3UZh7wmY+AnsLEkPsFSMBWvZ07Py+h7d31DXabCTJuaG3ny/JVsGk vvhVy6p9p15TFEUySosP7/mgViA2L8ZF8aE3iAfCpGjpq/NkUw8lJO19qJ5CRr25dJ9IZV e4vjFD1Yn9Nikl2FAo/K4a56GnmyEXuALbyNHhOkvJfl1mUYmsHiq6ApuasIpoibP6I0ZC HluqvupW/8IHBjBcJa4CaA/rmUAJO8M8FElRTzTg9XlmgxqYq+4VgazEVwX46w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725570906; a=rsa-sha256; cv=none; b=xBYj/CMlf8Xmt3uKIPaR2XCSlG0jlPgZd84dmftHGR/NoCjS/4AYatA2O4TfWXzuWLFx8T DCxaHOd02l07TNayDGXNsljT7Qp9xpz2kuWNuofSXqgJX+3huRhQipJcPWF6c438u+8+Jq Vhxq7jd1p+zEJW9mojuJBpCYQKACesYP2mUpEJLcYbPcLp5i9NYX2Wgb5nHKeS5KWJ9pIV mcr+RuHsdvrHCW3jefd33eWUTXcvPK43qqQQLSeQ//xhNamGoFqiZsBYaqUMWe7hT3bP6p a2VV58HYyQfTgfA0A5D5b7HM2jv4FeISjuvoLYCnAxIpTuCcJGD7zKGgNuxQzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725570906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JhUfbwJqU46HzAAGsarMpzE+gkIdstL5nPEJJwz33/g=; b=GTmlxKn/z7uRATehE2PEJMMrp128fjhZ/KQBL2G+OMF4aXytLEhM7AytK+y6YwvVL4LVSJ Bb7QHNyBOskFl6bduveav7gZjXQKQUIGS1LGCvhtSaMjh47mNXRAOP1J/Af2fl1C3kSfTt 0404rG7A/Ig18oKODeLTv/rYWbR4jz+KRsriJm8I1lfUCwTKeohMVJ3Q6n83Cca2C3QhZd axqz2NMc/MgE88jk7w7js8ZTC/wmJ3RAPTfqjDvVXyWJPtBK45f6NDjRflNa2SU/a5VjmF DwdMFSIJSWFVCNrYtMNZvwtWSEn3/l7tYLx5oBkwJF5M/mJJVK9PK01h2YNSjg== 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 4X0Bvt48tjzPTX; Thu, 5 Sep 2024 21:15: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 485LF6cs032535; Thu, 5 Sep 2024 21:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 485LF6cE032532; Thu, 5 Sep 2024 21:15:06 GMT (envelope-from git) Date: Thu, 5 Sep 2024 21:15:06 GMT Message-Id: <202409052115.485LF6cE032532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: bedfac1f026f - main - nvmf_tcp: Fully honor kern.nvmf.tcp.max_transmit_data for C2H_DATA PDUs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bedfac1f026fa8e2e6572ca380d89d74a01d5def Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bedfac1f026fa8e2e6572ca380d89d74a01d5def commit bedfac1f026fa8e2e6572ca380d89d74a01d5def Author: John Baldwin AuthorDate: 2024-09-05 21:14:36 +0000 Commit: John Baldwin CommitDate: 2024-09-05 21:14:36 +0000 nvmf_tcp: Fully honor kern.nvmf.tcp.max_transmit_data for C2H_DATA PDUs The previous version of tcp_send_controller_data avoided sending a chain of multiple mbufs that exceeded the limit, but if an individual mbuf was larger than the limit it was sent as a single, over-sized PDU. Fix by using m_split() to split individual mbufs larger than the limit. Note that this is not a protocol error, per se, as there is no limit on C2H_DATA PDU lengths (unlike the MAXH2CDATA parameter). This fix just honors the administrative limit more faithfully. This case is also very unlikely with the default limit of 256k. Sponsored by: Chelsio Communications --- sys/dev/nvmf/nvmf_tcp.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/sys/dev/nvmf/nvmf_tcp.c b/sys/dev/nvmf/nvmf_tcp.c index 67d239b63faf..22275aaa835b 100644 --- a/sys/dev/nvmf/nvmf_tcp.c +++ b/sys/dev/nvmf/nvmf_tcp.c @@ -1784,7 +1784,6 @@ tcp_send_controller_data(struct nvmf_capsule *nc, uint32_t data_offset, { struct nvmf_tcp_qpair *qp = TQP(nc->nc_qpair); struct nvme_sgl_descriptor *sgl; - struct mbuf *n, *p; uint32_t data_len; bool last_pdu, last_xfer; @@ -1813,21 +1812,29 @@ tcp_send_controller_data(struct nvmf_capsule *nc, uint32_t data_offset, /* Queue one more C2H_DATA PDUs containing the data from 'm'. */ while (m != NULL) { + struct mbuf *n; uint32_t todo; - todo = m->m_len; - p = m; - n = p->m_next; - while (n != NULL) { - if (todo + n->m_len > qp->max_tx_data) { - p->m_next = NULL; - break; - } - todo += n->m_len; - p = n; + if (m->m_len > qp->max_tx_data) { + n = m_split(m, qp->max_tx_data, M_WAITOK); + todo = m->m_len; + } else { + struct mbuf *p; + + todo = m->m_len; + p = m; n = p->m_next; + while (n != NULL) { + if (todo + n->m_len > qp->max_tx_data) { + p->m_next = NULL; + break; + } + todo += n->m_len; + p = n; + n = p->m_next; + } + MPASS(m_length(m, NULL) == todo); } - MPASS(m_length(m, NULL) == todo); last_pdu = (n == NULL && last_xfer); tcp_send_c2h_pdu(qp, nc->nc_sqe.cid, data_offset, m, todo, From nobody Fri Sep 6 01:33:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0JfY6JNWz5V7q5 for ; Fri, 06 Sep 2024 01:33: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 4X0JfY5TwDz4hb6; Fri, 6 Sep 2024 01:33:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725586437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tgR/+XjIuT5ZcsJQ/2IVIYbCel6oPmWTMt7qwkGPZNE=; b=HrSsrWkLNgjcSqnFPtf+/621e2+5Ympp3S93UKGo7Zyw5Pc4mibI5B5/ETkCTKES5V4npj c/6AjiL/5hq1sX4zXATTKVYyHqNIL9L1qjtqhWGEhkbcJX2oAg9C86oe9bMNsuaMQJT6sq LA4QKOrIBuSokl8C5KPQ9vxwXylTvIwGWmuSSPBaccCnhG1EXnEIoOZoSCkHG6u3T/XklL Xlo/+KptibJ+tNhbZxbPOH/zyO4yG0QFgoFEs1atmY9mmyxWRjWkLF7fNaElihpxcYWDEH /y9cAFoBDxeGZ/6530SDF96tyXRCVFP/373534W8UpzaziwU1uh/yp+SaFroDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725586437; a=rsa-sha256; cv=none; b=CNCFv+OXHL1SEUS3fI5g27uwrG0LAjcV1iLFaalqdZppjpddTFsSbqJg5eCfXf8xDOp7JN 9Cs1nswT2Sd82kh/mpcI5CimKPeeYKJFDF27J0DsmwNOwPVu5TeuWk2mybzzVLnSvmTjri ceV3yMr/DpAyTLprmwOP/aJk0xN4P+JYqDNp7ctewgksJLWLCa3e9tzeteluIbutQJirAv IrQaXnoLyrk9jXpwmBX2FeCNbxBgHG93iN6vEc/kv/TjI2duXsuidcqDtcdaQwYv8ZzrHh 3zj6WkoJetY6WvZybjzz3HnCFIxZjAhb3gRbBMxwOp/VD6F9Lp6+4DDAr7+G2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725586437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tgR/+XjIuT5ZcsJQ/2IVIYbCel6oPmWTMt7qwkGPZNE=; b=bbr+oAJA39OOf+6YPcBy0iVmlyJGhULDRD4hEoZxAw8QJNhDoRygb+rc+E1lGB7fC4uERL 7O1526hXwtRRoPSUSwcnP0zO/5sYkzEFeA+y1slm2AwwDuYk9/D8bnYdbeQAtkO6gsK6og 5NnHR+NX2w23KRHhiChxGcbFkocLNsdr+U8M1FkQWnkBvtE21TDK4YXwoVv+pLHTNC/UCa S1nybb4B5gTccarM3kPXoawR+/GOvXvv2dwtBdAJ+8W3XnVAavzNR7XXsuOE7Nhe129pCT 6K72946lU9dv6QKLCPgSQ7E1ADkJO1J5a/59AjS98Qvn788UYEonFwQhzHaw+w== 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 4X0JfY4mvrzXs1; Fri, 6 Sep 2024 01:33: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 4861XvlB073030; Fri, 6 Sep 2024 01:33:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4861Xvbx073029; Fri, 6 Sep 2024 01:33:57 GMT (envelope-from git) Date: Fri, 6 Sep 2024 01:33:57 GMT Message-Id: <202409060133.4861Xvbx073029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Philip Paeps Subject: git: 76e31da7ab27..62ad5eff8053 - vendor/tzdata - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/vendor/tzdata X-Git-Reftype: branch X-Git-Commit: 62ad5eff805323c79d60cd902863fa8c29b863a8 X-Git-Oldrev: 76e31da7ab276bcd66122762d712fb99590f4d3a X-Git-Newrev: 62ad5eff805323c79d60cd902863fa8c29b863a8 Auto-Submitted: auto-generated The branch vendor/tzdata has been updated by philip: URL: https://cgit.FreeBSD.org/src/log/?id=76e31da7ab27..62ad5eff8053 62ad5eff8053 Import tzdata 2024b From nobody Fri Sep 6 01:33:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0JfY6JZKz5V7gJ for ; Fri, 06 Sep 2024 01:33: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 4X0JfY5cmrz4hk1; Fri, 6 Sep 2024 01:33:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725586437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=af0vexVfaI4Ah0oc0yRCBdWjFXssxsSODZaTC5mOY2M=; b=WuZ3PeQ3QQIZ/oyp039sUhxaoUBfyLciE2v3PAfM6XbmQ73kEGPSjXSpe/3NiwYRKrAgi+ BPAYxG6sgU9W7Hn2H6MIEpkknade0RM7DXQD/PQwkyX9Wy5MyImBWHObLVybeLcjcNdIkA UbWIKhr6cTwfAqNPDzqU/Fl7OwQvHCD7Zitu9VdFrmSuN2aSDyi0YGVDZ0jyisWMgGN0mq BSVIVzTA4RPH803jLYt88BIqvxu499aA/bAzv5/ICc+JkF3zM3BaUPV7vgd1Lk/Z0+2zXh 3V1VjeX4hqZXWOcO26MT4dfeHLxBpxSNZ+iv8c5groNRPSd7M3HCcbhRtZPHrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725586437; a=rsa-sha256; cv=none; b=J6NvnqrkpTsMjqCqJQAarVA43kswyPctTST8lvn50rmlfL92KPrckGTTi81ZUNENKK4bng q5WkETT+u2pYFEja2swdlN2GV9e8DA1g1GThZCNJe05aDcVNka4JhSEZKXcuKb9yVa0M13 hUV81puBy5wopidTerSnKr6IbmC/lGheF0DL89gwXymb8dgs6H6yia/a3lJcgq4IiSsqZ5 8RdByMHwwK2Xnv+lCYM8ll6TbTE0ENR4XSyU7xjYSqfwGDTZst1GFAHHP/Os3O0Nyt2hQP PWKp39VvVZNzi6y9meRu9g4C8wVCm4q7CgLIaT5dBKNcCNF0pfooOUhkIrWzRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725586437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=af0vexVfaI4Ah0oc0yRCBdWjFXssxsSODZaTC5mOY2M=; b=lynrgeh1+PfYmbOrGfpY2eCRUYk6K2AU500Lzu+qpxEZoVVbLDYg5Rvtc2y0edlsWSrRpo 4eCi3v08h1ezlZFxrVQ2sBhk9aHJwZPMTbrV4p9s69qnzvF45oVvza4Pnb4BOx5gjT5gGc r4Bdo/LuOklvtQE16c149jHXE4oPHRcxD6n07tYI4o+YFGoTRI4Mk1dmTPyBoeuM3r9XWn Q85bJwTxj3LoUkU57NiZyIIkv4Fyz+v9ljGVOTIsw8WI4BiYKuBKWrzjHJiAzKZcToprKe UviSfmqp7qNV4PFNr2TbLMx46N61vZwMbhsCkXcK5Oj8fplhdcxLk1BZGsxWyw== 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 4X0JfY5DdRzXs2; Fri, 6 Sep 2024 01:33: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 4861XvvI073049; Fri, 6 Sep 2024 01:33:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4861XvTr073048; Fri, 6 Sep 2024 01:33:57 GMT (envelope-from git) Date: Fri, 6 Sep 2024 01:33:57 GMT Message-Id: <202409060133.4861XvTr073048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Philip Paeps Subject: git: 764b2bace54e - Create tag vendor/tzdata/tzdata2024b List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/vendor/tzdata/tzdata2024b X-Git-Reftype: annotated tag X-Git-Commit: 764b2bace54e21fb05405f534bcea26d61e2aca9 Auto-Submitted: auto-generated The annotated tag vendor/tzdata/tzdata2024b has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/tzdata/tzdata2024b tag vendor/tzdata/tzdata2024b Tagger: Philip Paeps TaggerDate: 2024-09-06 01:33:05 +0000 Tag import of tzdata 2024b commit 62ad5eff805323c79d60cd902863fa8c29b863a8 Author: Philip Paeps AuthorDate: 2024-09-06 01:33:05 +0000 Commit: Philip Paeps CommitDate: 2024-09-06 01:33:05 +0000 Import tzdata 2024b From nobody Fri Sep 6 01:41:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0JqG4L6tz5V8wL; Fri, 06 Sep 2024 01:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0JqF0dhYz4l1Y; Fri, 6 Sep 2024 01:41:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725586889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tprwn/dGl4NkAZXCBy5kmuRWVXX2/ZwWzc+uC0VfAeY=; b=kSa75Cynrkwv9qRMsBMr6SspMia4fHTIOr7945StkFAB2fsmUUE8DTHO8kzvFundWyxdIx JUIiKwgXPCr45mjwvRCGKnPHbEnW9qDVJeEidss1C2MRYOZ4ZalD6qOT57ATjCAiCmGR+e m4EigLQJ9LO88B5nCaixCJEe51474MmrqXxO7EQpEDhwu49hjLKm1jaD3d3ytorbHXHIpz iOA1HHJGEiuTY8d9oVaCAAjwxfbub4CMq5Wz+euK2UEUtjb/bt3qfMW6qFBoOsRnLTfw6o zwY6DGz20u5G60xI5ISSjcWhkCt+olxVDy6e49zM+BrsbeFmKYuMjn6Vqstbrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725586889; a=rsa-sha256; cv=none; b=n2GGShdqRZiXVqQ2LHyNEnQxysWh/MltXDnLUXrAswyp5sYQR+KK6oJLd72w6sJBLtwJkw TS1OrBMvCxPzcjQMUPE3c+akz2sCCG6Pf8YyHEGj23sXBZomOM4etf54y3UqUDk/JjD88L OfrChtfCXMAIrluTcmJjSotKu1J8NJ2e7NO/AVkthaDDq2q8fW34om5DvGY9rC172aJK4L Dl9wPj6qS4LG11ayy2ucVwn80jT4AhFxbC72anrAHyL3YHqvK05LGRVusNcAKdXvQlqUol 4ar1Ae3W8aXpKvh2NDGB7sxFVyZwN+1puS8tym1n9D7FFDcg+kAgUbLczZSg/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725586889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tprwn/dGl4NkAZXCBy5kmuRWVXX2/ZwWzc+uC0VfAeY=; b=skbZVlc+ol/skI2+4OAELXUpTS+iqCJHquJ5qTUhGwcklc1L28dndQerjGQ1mQ6+ij6QQC FaIU7MncLISC9erHTbEkNtebY826le3Hr6IjIPbRSDGwfd9nXXgGoyhClW/3S3FVg2OTpv 0tB7iY1NmbaTVwKMDQhJrDwDHLqYosHMDYgEasGyt6vCgjJFd+b2oGUjy2837/P8GzFpk4 AX5zFKHUd0GAmAsP//qxWodkG+Y7e4ag9s3bn4X1SzGV2aH5FPShHmlbOS56LEosgiacH4 JqkEIqAw5lo+9CH+0WRblfPzjwrjQl0/U4CGO2WDmdeMiHu8TRpOIOtEX1zfRA== 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 4X0JqF0CvFzYLZ; Fri, 6 Sep 2024 01:41:29 +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 4861fSAX083551; Fri, 6 Sep 2024 01:41:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4861fQXD083537; Fri, 6 Sep 2024 01:41:26 GMT (envelope-from git) Date: Fri, 6 Sep 2024 01:41:26 GMT Message-Id: <202409060141.4861fQXD083537@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: e273650f2c53 - main - contrib/tzdata: import tzdata 2024b List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e273650f2c538034b45f78e670a89cbf333ab6db Auto-Submitted: auto-generated The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=e273650f2c538034b45f78e670a89cbf333ab6db commit e273650f2c538034b45f78e670a89cbf333ab6db Merge: bedfac1f026f 62ad5eff8053 Author: Philip Paeps AuthorDate: 2024-09-06 01:37:36 +0000 Commit: Philip Paeps CommitDate: 2024-09-06 01:37:36 +0000 contrib/tzdata: import tzdata 2024b Changes: https://github.com/eggert/tz/blob/2024b/NEWS MFC after: 3 days contrib/tzdata/CONTRIBUTING | 18 +- contrib/tzdata/Makefile | 412 +++++++++++----------- contrib/tzdata/NEWS | 124 ++++++- contrib/tzdata/africa | 73 ++-- contrib/tzdata/antarctica | 58 ++-- contrib/tzdata/asia | 442 ++++++++++++------------ contrib/tzdata/australasia | 130 +++---- contrib/tzdata/backward | 15 +- contrib/tzdata/backzone | 35 +- contrib/tzdata/checknow.awk | 4 +- contrib/tzdata/etcetera | 54 +-- contrib/tzdata/europe | 713 ++++++++++++++++++++++++--------------- contrib/tzdata/leap-seconds.list | 30 +- contrib/tzdata/leapseconds | 8 +- contrib/tzdata/northamerica | 145 +++++--- contrib/tzdata/southamerica | 486 +++++++++++++------------- contrib/tzdata/theory.html | 214 ++++++++---- contrib/tzdata/version | 2 +- contrib/tzdata/ziguard.awk | 32 +- contrib/tzdata/zone.tab | 3 +- contrib/tzdata/zone1970.tab | 3 +- contrib/tzdata/zonenow.tab | 8 +- 22 files changed, 1768 insertions(+), 1241 deletions(-) diff --cc contrib/tzdata/Makefile index d48354c72df4,000000000000..0087b4596515 mode 100644,000000..100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@@ -1,1361 -1,0 +1,1381 @@@ +# Make and install tzdb code and data. +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. +# Request POSIX conformance; this must be the first non-comment line. +.POSIX: - # On older platforms you may need to scrounge for a POSIX-conforming 'make'. - # For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or - # /usr/xpg4/bin/make, not /usr/ccs/bin/make. ++# On older platforms you may need to scrounge for POSIX conformance. ++# For example, on Solaris 10 (2005) with Sun Studio 12 aka Sun C 5.9 (2007), ++# use 'PATH=/usr/xpg4/bin:$PATH make CC=c99'. + +# To affect how this Makefile works, you can run a shell script like this: +# +# #!/bin/sh - # make CC='gcc -std=gnu11' "$@" ++# make CC='gcc -std=gnu23' "$@" +# - # This example script is appropriate for a pre-2017 GNU/Linux system - # where a non-default setting is needed to support this package's use of C99. ++# This example script is appropriate for a circa 2024 GNU/Linux system ++# where a non-default setting enables this package's optional use of C23. +# +# Alternatively, you can simply edit this Makefile to tailor the following +# macro definitions. + +############################################################################### +# Start of macros that one plausibly might want to tailor. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# DATAFORM selects the data format. +# Available formats represent essentially the same data, albeit +# possibly with minor discrepancies that users are not likely to notice. +# To get new features and the best data right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +# Rearguard users might also want "ZFLAGS = -b fat"; see below. +DATAFORM= main + +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= Factory + - # The POSIXRULES macro controls interpretation of POSIX-2017.1-like TZ ++# The POSIXRULES macro controls interpretation of POSIX-like TZ +# settings like TZ='EET-2EEST' that lack DST transition rules. +# If POSIXRULES is '-', no template is installed; this is the default. +# Any other value for POSIXRULES is obsolete and should not be relied on, as: +# * It does not work correctly in popular implementations such as GNU/Linux. +# * It does not work even in tzcode, except for historical timestamps +# that precede the last explicit transition in the POSIXRULES file. +# Hence it typically does not work for current and future timestamps. +# If, despite the above, you want a template for handling these settings, +# you can change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. + +POSIXRULES= - + +# Also see TZDEFRULESTRING below, which takes effect only +# if POSIXRULES is '-' or if the template file cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local timezone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" timezone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) - TIME_T_ALTERNATIVES_HEAD = int_least64_t - TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t ++TIME_T_ALTERNATIVES_HEAD = int_least64_t.ck ++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.) +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and was modified in tzdb 2021b to generate version 4 TZif files. +# EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to pre-2020a zic implementations and so that TZif files +# built by newer zic implementations can be read by pre-2021b libraries. +EXPIRES_LINE= 0 + +# To install data in text form that has all the information of the TZif data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', +# but only for entries listed in the backward-compatibility file zone.tab, use +# PACKRATDATA= backzone +# PACKRATLIST= zone.tab +# If you want all the 'backzone' data, use +# PACKRATDATA= backzone +# PACKRATLIST= +# To omit this data, use +# PACKRATDATA= +# PACKRATLIST= + +PACKRATDATA= +PACKRATLIST= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. +LDLIBS= + +# Add the following to an uncommented "CFLAGS=" line as needed +# to override defaults specified in the source code or by the system. +# "-DFOO" is equivalent to "-DFOO=1". +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r ++# on POSIX platforms predating POSIX.1-2024 +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE__GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares - # ctime_r and asctime_r incompatibly with the POSIX standard ++# ctime_r and asctime_r incompatibly with POSIX.1-2017 and earlier +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H=0 if does not work*+ +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SETENV=0 if your system lacks the setenv function +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work*+ +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if does not work* +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -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 +# -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'. +# Even with -DPORT_TO_C89, the code needs at least one C99 +# 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 - # -DSUPPORT_C89 if the tzcode library should support C89 callers+ - # However, this might trigger latent bugs in C99-or-later callers. ++# -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. ++# -DSUPPORT_POSIX2008 if the library should support older POSIX callers+ ++# However, this might cause problems in POSIX.1-2024-or-later callers. +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified - # DST transitions for POSIX.1-2017-style TZ strings lacking them, ++# DST transitions for proleptic format TZ strings lacking them, +# in the usual case where POSIXRULES is '-'. If not specified, +# TZDEFRULESTRING defaults to US rules for future DST transitions. +# 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) +# -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 +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably older ones that +# ignore or otherwise mishandle 64-bit data in TZif files; +# however, fat TZif files may trigger bugs in newer TZif readers. +# Slim TZif files are more efficient, and are the default. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# -g to generate symbolic debugging info +# -Idir to include from directory 'dir' +# -O0 to disable optimization; other -O options to enable more optimization +# -Uname to remove any definition of the macro 'name' +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# +# * Options marked "*" can be omitted if your compiler is C23 compatible. +# * Options marked "+" are obsolescent and are planned to be removed - # once the code assumes C99 or later, say in the year 2029. ++# once the code assumes C99 or later (say in the year 2029) ++# and POSIX.1-2024 or later (say in the year 2034). +# +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. - GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ ++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 \ + -Wdeclaration-after-statement -Wdouble-promotion \ - -Wduplicated-branches -Wduplicated-cond \ ++ -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ - -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ ++ -Wmissing-declarations -Wmissing-prototypes \ ++ -Wmissing-variable-declarations -Wnested-externs \ + -Wnull-dereference \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ + -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ - -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ ++ -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ + -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ - -Wno-type-limits ++ -Wno-format-nonliteral -Wno-sign-compare +# +# 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), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. - # Although these two fields are not required by POSIX.1-2017, - # POSIX 202x/D4 requires them and they are widely available - # on GNU/Linux and BSD systems. ++# Although POSIX.1-2024 requires these fields and they are widely available ++# on GNU/Linux and BSD systems, some older systems lack them. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" - # # to the "CFLAGS=" line. "tzname" is required by POSIX.1-1988 and later. ++# # to the "CFLAGS=" line. Although "tzname" is required by POSIX.1-1988 ++# # and later, its contents are unspecified if you use a geographical TZ ++# # and the variable is planned to be removed in a future POSIX edition. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 # do not support +# # -DUSG_COMPAT=1 # support, and variables are defined by system library +# # -DUSG_COMPAT=2 # support and define variables +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix - # # Systems Group code and are required by POSIX.1-2008 and later (with XSI). ++# # Systems Group code and are required by POSIX.1-2008 and later (with XSI), ++# # although their contents are unspecified if you use a geographical TZ ++# # and the variables are planned to be removed in a future edition of POSIX. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE=0 # do not support +# # -DALTZONE=1 # support "altzone", which is defined by system library +# # -DALTZONE=2 # support and define "altzone" +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# # If not defined, the code attempts to guess ALTZONE from other macros. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the following +# functions to be added to the time conversion library. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone. +# "timelocal" is nearly equivalent to "mktime". +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined to nonzero the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the timezone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and POSIX conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. +# +# POSIX says CFLAGS defaults to "-O 1". +# Uncomment the following line and edit its contents as needed. + +#CFLAGS= -O 1 + + +# The name of a POSIX-like library archiver, its flags, C compiler, +# linker flags, and 'make' utility. Ordinarily the defaults suffice. - # The commented-out values are the defaults specified by POSIX.1-202x/D4. ++# The commented-out values are the defaults specified by POSIX.1-2024. +#AR = ar +#ARFLAGS = -rv +#CC = c17 +#LDFLAGS = +#MAKE = make + - # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in - # submake command lines. The default is no leap seconds. - - LEAPSECONDS= - +# Where to fetch leap-seconds.list from. +leaplist_URI = \ + https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list +# The file is generated by the IERS Earth Orientation Centre, in Paris. +leaplist_TZ = Europe/Paris + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +# To shrink the size of installed TZif files, +# append "-r @N" to omit data before N-seconds-after-the-Epoch. +# To grow the files and work around bugs in older applications, +# possibly at the expense of introducing bugs in newer ones, +# append "-b fat"; see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. +ZFLAGS= + +# How to use zic to install TZif files. + - ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) ++ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' + +# The name of a POSIX-compliant 'awk' on your system. +# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. +# Also, it is better (though not essential) if 'awk' supports UTF-8, +# and unfortunately mawk and busybox awk do not support UTF-8. +# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. +AWK= awk + +# The full path name of a POSIX-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# Name of curl , used for HTML validation +# and to fetch leap-seconds.list from upstream. ++# Set CURL=: to disable use of the Internet. +CURL= curl + +# Name of GNU Privacy Guard , used to sign distributions. +GPG= gpg + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# These non-alphabetic, non-ASCII printable characters are Latin-1, +# and so are likely displayable even in editors like XEmacs 21 +# that have limited display capabilities. +UNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷ +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1) + +# Put this in a bracket expression to match spaces. +s = [:space:] + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. - GNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \ ++GNUTARFLAGS= --format=pax --pax-option=delete=atime,delete=ctime \ + --numeric-owner --owner=0 --group=0 \ + --mode=go+u,go-w --sort=name - TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ - then echo $(GNUTARFLAGS); \ - else :; \ - fi` ++SETUP_TAR= \ ++ export LC_ALL=C && \ ++ if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; then \ ++ TAR='tar $(GNUTARFLAGS)'; \ ++ else \ ++ TAR=tar; \ ++ fi + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. - DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ - || echo ' -F^TZ=') ++SETUP_DIFF_TZS = \ ++ if diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1; then \ ++ DIFF_TZS='diff -u -F^TZ='; \ ++ else \ ++ DIFF_TZS='diff -u'; \ ++ fi + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +# POSIX prohibits defining or using SHELL. However, csh users on systems +# that use the user shell for Makefile commands may need to define SHELL. +#SHELL= /bin/sh + +# End of macros that one plausibly might want to tailor. +############################################################################### + + +TZCOBJS= zic.o - TZDOBJS= zdump.o localtime.o asctime.o strftime.o - DATEOBJS= date.o localtime.o strftime.o asctime.o ++TZDOBJS= zdump.o localtime.o strftime.o ++DATEOBJS= date.o localtime.o strftime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README SECURITY theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html - CHECK_WEB_PAGES=check_theory.html check_tz-art.html \ - check_tz-how-to.html check_tz-link.html ++CHECK_WEB_PAGES=theory.ck tz-art.ck tz-how-to.ck tz-link.ck +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone.tab zone1970.tab zonenow.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ + $(PACKRATDATA) $(PACKRATLIST) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) +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 +TZDATA_DIST = $(COMMON) $(DATA) $(MISC) +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checknow.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + private.h southamerica strftime.c theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zonenow.tab + +all: tzselect zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) \ - `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ - ` $(POSIXRULES) \ ++ -p $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +# Calculate version number from git, if available. +# Otherwise, use $(VERSION) unless it is "unknown" and there is already +# a 'version' file, in which case reuse the existing 'version' contents +# and append "-dirty" if the contents do not already end in "-dirty". +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ - V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ - --abbrev=7 --dirty` || \ - if test '$(VERSION)' = unknown && V=`cat $@`; then \ - case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ ++ V=$$(git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ ++ --abbrev=7 --dirty) || \ ++ if test '$(VERSION)' = unknown && read -r V <$@; then \ ++ V=$${V%-dirty}-dirty; \ + else \ + V='$(VERSION)'; \ + fi; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) \ - -v DATAFORM=`expr $@ : '\(.*\).zi'` \ ++ -v DATAFORM=$(@:.zi=) \ + -v PACKRATDATA='$(PACKRATDATA)' \ + -v PACKRATLIST='$(PACKRATLIST)' \ + -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk - version=`sed 1q version` && \ ++ read -r version $@.out + mv $@.out $@ + +tzdir.h: + printf '%s\n' >$@.out \ + '#ifndef TZDEFAULT' \ + '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ + '#endif' \ + '#ifndef TZDIR' \ + '# define TZDIR "$(TZDIR)" /* TZif directory */' \ + '#endif' + mv $@.out $@ + +version.h: version - VERSION=`cat version` && printf '%s\n' \ ++ read -r VERSION $@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +leapseconds: $(LEAP_DEPS) + $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ + -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Awk script to extract a Git-style author from leap-seconds.list comments. +EXTRACT_AUTHOR = \ + author_line { sub(/^.[[:space:]]*/, ""); \ + sub(/:[[:space:]]*/, " <"); \ + printf "%s>\n", $$0; \ + success = 1; \ + exit \ + } \ + /Questions or comments to:/ { author_line = 1 } \ + END { exit !success } + +# Fetch leap-seconds.list from upstream. +fetch-leap-seconds.list: + $(CURL) -OR $(leaplist_URI) + +# Fetch leap-seconds.list from upstream and commit it to the local repository. +commit-leap-seconds.list: fetch-leap-seconds.list + author=$$($(AWK) '$(EXTRACT_AUTHOR)' leap-seconds.list) && \ + date=$$(TZ=$(leaplist_TZ) stat -c%y leap-seconds.list) && \ + git commit --author="$$author" --date="$$date" -m'make $@' \ + leap-seconds.list + - # Arguments to pass to submakes of install_data. ++# Arguments to pass to submakes. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ - LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + PACKRATLIST='$(PACKRATLIST)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + ZIC='$(ZIC)' + +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi + - # 'make install_data' installs one set of TZif files. - install_data: $(INSTALL_DATA_DEPS) - $(ZIC_INSTALL) tzdata.zi - +posix_only: $(INSTALL_DATA_DEPS) - $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data ++ $(ZIC_INSTALL) tzdata.zi + +right_only: $(INSTALL_DATA_DEPS) - $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ - install_data ++ $(ZIC_INSTALL) -L leapseconds tzdata.zi + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump - ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ - >$@ ++ ./zdump -i $(TZS_CUTOFF_FLAG) "$$PWD/$(@:.zd=)" >$@ + +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out - wd=`pwd` && \ - x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ ++ x=$$($(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ - | LC_ALL=C sort -t . -k 2,2` && \ ++ | LC_ALL=C sort -t . -k 2,2) && \ + set x $$x && \ + shift && \ + ZDS=$$* && \ - $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ ++ $(MAKE) TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir + mv $@.out $@ + - # If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the ++# If $(TZS) exists but 'make tzs.ck' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + touch $@ + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version - VERSION=`cat version` && sed \ ++ read -r VERSION $@.out + chmod +x $@.out + mv $@.out $@ + - check: check_back check_mild - check_mild: check_character_set check_white_space check_links \ - check_name_lengths check_now \ - check_slashed_abbrs check_sorted \ - check_tables check_web check_ziguard check_zishrink check_tzs ++check: check_mild back.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 \ ++ tables.ck ziguard.ck tzs.ck + +# True if UTF8_LOCALE does not work; +# otherwise, false but with LC_ALL set to $(UTF8_LOCALE). *** 638 LINES SKIPPED *** From nobody Fri Sep 6 02:05:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0KLY67Wjz5VCLx for ; Fri, 06 Sep 2024 02:05: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 4X0KLY5XdKz4n20; Fri, 6 Sep 2024 02:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725588309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fpyZ9oQgoYTx1yL+pDBo3JZZLL7+DQ7CQMtu6UElCw8=; b=iQ8ALMRGqvpDfn6ay5nQ0G4clxGQP02qEp0kVgfolKl4aHrpKw+Y2Q77VOsPmih5gb8NAB EaCMPHTosqIYU3sIOuNjBwwSALuYk4t5SaYsgnnixS02AuOG4yPZamVJMd5u7BQzZZEGWF BpWpcpRJ/bhpj1owAEC4gf2pokHTM9b1p2ThR9EBkQ501LNWUdrKWNnZzpbdnf9AeuEcvH 9B5kVfH1apksnd6oyyKDVj2IJ6ZrNMA8d1a+XuiHaJsZ1lsyVmuupfmOeja6rLVv3XK0uM bp8cl0evcOzf1Crb+1t/gbAKLKHCOxSrXYsU1GtDOlswdVet4WaSwYN4Z378Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725588309; a=rsa-sha256; cv=none; b=Ye1ePQeHguSbMyq/qaYSTWrN8Jcrt1mOYquolqjbzrSehKZPv1wAG181d0hGdLmazkxQlF zbKgwC1x+K2xddrEz5ncjR0KXyX0m0SauWAOYO6hpd59xMpGbY+W9aGzVRSMuwtmcIWEjr G+RihK3HQUSpWsoOmXmthFhtThODhNJGieNOyHgQt5Cnyh0yQKjqUcCfml68oYH7MWtH2I rKMFByzD5xZ+9/Wr84xDi0lGNh0sNso8Tzv+CIEKwXop540fPjYwWAU3TGhdXyUn1rEcU9 Q6H8wjLXC0cmIUBDfHQ7ZtDM59NwbfNxbLrH32fqRmZCC9cE1KTyWN1N5Gb7kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725588309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fpyZ9oQgoYTx1yL+pDBo3JZZLL7+DQ7CQMtu6UElCw8=; b=DdSNodWQHbSws9DNwRUxG0q2yKarz3ZmQqfCHPBI1cvgkAqhmfLu4Og91EZ7P2+xum3oTs KUAtFwLDIA3d1XhHd+6sYGlWSTFqrpx85XUZC/x/kz19BStptburYCpZ3duzWqNy/nfUcd MiiD/0LWu9/beAtO6D1vubCC5rd5FCd6C7a0N60bl48CxIgGJ2onh/KqYRIbLfM9sQF9V2 BowkU1vLxxz03xfoRjNihTemw4jX/Ne9ClnjltIaJLpUoGsWikgT/fUj3EP44rnG18IZZN tpixeKRbDtX8U8Rav4PIbdxOjTTK5LH5EI9BQA29PcJXUC8XDdoCp9QCkxWLxw== 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 4X0KLY4z5XzYrL; Fri, 6 Sep 2024 02:05: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 486259iC025123; Fri, 6 Sep 2024 02:05:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486259ZN025122; Fri, 6 Sep 2024 02:05:09 GMT (envelope-from git) Date: Fri, 6 Sep 2024 02:05:09 GMT Message-Id: <202409060205.486259ZN025122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Joseph Mingrone Subject: git: a149465a1077 - Create tag vendor/libpcap/1.10.5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/tags/vendor/libpcap/1.10.5 X-Git-Reftype: annotated tag X-Git-Commit: a149465a1077449c50f69ee841628417361d1e63 Auto-Submitted: auto-generated The annotated tag vendor/libpcap/1.10.5 has been created by jrm: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/libpcap/1.10.5 tag vendor/libpcap/1.10.5 Tagger: Joseph Mingrone TaggerDate: 2024-09-05 19:46:55 +0000 Tag libpcap 1.10.5. commit 025be3f592b920ff0a3e602e5aa8b60a34e5e617 Author: Joseph Mingrone AuthorDate: 2024-09-05 19:46:35 +0000 Commit: Joseph Mingrone CommitDate: 2024-09-05 19:46:35 +0000 Import libpcap 1.10.5 From nobody Fri Sep 6 02:05:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0KLY67nxz5VC76 for ; Fri, 06 Sep 2024 02:05: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 4X0KLY5SV8z4n1y; Fri, 6 Sep 2024 02:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725588309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PZqexCou2U6UyAFnOoL6mYv9idnNCBjf3Ob3DMFTLPQ=; b=AeqdnnSU8RGAnf8KbfNgdkF2jnY6h9jk6H0kB0rL+fMDslOzVY4aluA9LhlVzYqO8oaWkf KvFJ4Z0Ty8M9y+t0GJ3J2dnm/zJi4HpgeHwI92G7qGR8aFMsv5bW7h2Qz74OK+Stk3VBtv CyoTzjg9pjuXG+ZjKns4sC/nPqxmQayCHCpfM3zoo2vpZSTcFKYgt1j6tch7+dZDn/j5Ce wycjbJw4+TyL5ikdOVQuHbkRPbFRaqvSmZmySgOlbMuSW5oVCaRtplCddvEqYtTjEYbl7h oMnZ/cVDwvZe8trHODtlRIk3L5O/kjku9+0cz6nuMObbEM/44icqeE989JncnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725588309; a=rsa-sha256; cv=none; b=lPcAzn4TgFdzzaE02qd5eYr2Q3oQjckADJaF+ofQeFrctmwNeMaArUF5cab2amzvDkXcv3 WbLLvj3WbCl+qA/O82eTIJgB70Ss0yRcr76jNsAzrVVpFHMqeVwd1tLfK1XpKYihkX9NAV Gz4CsJDvwom+CIjdce6A+ldUOTmwARpsNZARtL1vWCf0ohetfhfvlmZKodtgPS9cffVill bNJ2C1HLwx2l4UaBtYkU6iTLz8z0Nfvp9W1QsfjWOFgDrSA4zZQLAXPkqxskal65NfEehd HM+kKXxu15ecMuNQQ9Xz2CqoUKkv4cwkIgPCX1zYY68AugRkPu6au6SKIXHO3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725588309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PZqexCou2U6UyAFnOoL6mYv9idnNCBjf3Ob3DMFTLPQ=; b=GLWumbb7aT9d5DSCe45zRKnsB2KjaPM80uRoqEmf7++EbRuRsm2eXx2+d9sOIQyn4diJrY Yy8Wny/h66qSZ8r4TluEIErDNc9Z7PwfFI9+yy6SAvczRjNN7ZCJ9BV6dXioSei386FwKT SO0mfHShy1qcqiKmSE4O9nLsMehErmJQNJkFBt0fiZXDcmNl8AGELN7imCkFwXlm+bplm/ JdhEiqMmrvQFD0P4Uct5UsW+2weRLDAFJMLj9gslRWQWz49uKFi+LbgmpmRewNUpizwpDv 2zbR+cZLQ/fbMxGs02oVBPS4UWBXiPZ9781FLAlI35/+FnTYjkiXbjcCWjgp5g== 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 4X0KLY4fBszYQk; Fri, 6 Sep 2024 02:05: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 486259Zb025104; Fri, 6 Sep 2024 02:05:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486259j2025103; Fri, 6 Sep 2024 02:05:09 GMT (envelope-from git) Date: Fri, 6 Sep 2024 02:05:09 GMT Message-Id: <202409060205.486259j2025103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Joseph Mingrone Subject: git: 6b96668d5b49..025be3f592b9 - vendor/libpcap - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/libpcap X-Git-Reftype: branch X-Git-Commit: 025be3f592b920ff0a3e602e5aa8b60a34e5e617 X-Git-Oldrev: 6b96668d5b49eea57b7551349eca70928cc199ce X-Git-Newrev: 025be3f592b920ff0a3e602e5aa8b60a34e5e617 Auto-Submitted: auto-generated The branch vendor/libpcap has been updated by jrm: URL: https://cgit.FreeBSD.org/src/log/?id=6b96668d5b49..025be3f592b9 025be3f592b9 Import libpcap 1.10.5 From nobody Fri Sep 6 02:09:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0KRZ5NvDz5VCkZ; Fri, 06 Sep 2024 02:09:30 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0KRZ3S7Mz4nf8; Fri, 6 Sep 2024 02:09:30 +0000 (UTC) (envelope-from philip@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725588570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DJMdQ/lTJ77rjilac5zERlZECiXvk4zAG8NU/l4Abl0=; b=g+WV7YIzVErlSyWHanLylkiLdoCPpnX2zdDvi7aLdMnY4N9v9215V9S2MHxrrzd34tfQnX StIB1dMsZLN6oqPPMp0uIauTZ4XTDZ++7HUzJwRrwOWCsZ3qVY/jCAXxFSRHv4pSomOSAY frrd+vZ39ZCbt/x37BK3JEyhGKYDRFLzgN1jyoMKB2P6c5YXtVzCoJMCLkZs8qaPhmtAOG XzHONkUQrPBA7OVVA6qMWtaI270FzizKrhzYIJEJh4yN7vu4dMR1dl++ffkWWtr+cHULFh c4oyskmRb++sZ8E/WcvwZRyFcrziU8VQUz3hcGbCJvalvhIBtS+2H8p8El0agw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725588570; a=rsa-sha256; cv=none; b=YvgC6BfODdwIIyL4+EnIteTzL41JK0bI3rDWVbB8bMaMubmvWwLWv47VMJvB2D7X5Lbt8w 7MNN4e1Ed1aKbDu8pXKX1yHs1PhDdMB4I/T1zCxFffWrXW/Rg760OgF6iHKqHWgGrpALEi tHkowluPPRixSjPV+Lkvu/FhtRmPCWhwFoNvIC31dxPDS+o0c2ytol1PdFPWqkm4R7BJZJ kkZ861JD0Gr+/KExNPm7Mo1MDQH7uGmIvnVGQo4eCwJ0Ouj1KGCpJ1m7Bj7ZsmGppDS3i9 7B/uWDfM0DuwE7N2cMOkHyv3kWlGOeiRZEWK0HD6a+0eU13KmDuZ3bZt1WgrUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725588570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DJMdQ/lTJ77rjilac5zERlZECiXvk4zAG8NU/l4Abl0=; b=YCcUgf5riIgOEOn++quVopjYWd9ZiFryEhh7Jj3s9iJEfKQCAuFErEj1utqRa0A1+shDN3 Odb4/BSY4kUjFa+6xLu2vRLAielrLgG9cgNhNWdqXDX/fuQ77iy1BKPA5+8D1k1LSAa7wh AP3IkOVUPVNO0ERKNHC/rtfgqAgbWp7q8wKixZIFZ4a25rbB/wMr2xaE0wz+i6QMGiF/+t y+HEZTwr9LmG4Nsa4UYuwS2nzYKRlq4rVfX5BMstsCtyF1ZHjGjp7Dbol3F1oIX3yacsve u8AN00LyOyL5cobDbSyFq9h5tF7mc7RGG5TYavU0D1CDWe2VUnb+VPBJU4s4lg== Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com [103.168.172.200]) (using TLSv1.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) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X0KRZ2YyXz1NrJ; Fri, 6 Sep 2024 02:09:30 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfauth.phl.internal (Postfix) with ESMTP id B01BD120006E; Thu, 5 Sep 2024 22:09:29 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Thu, 05 Sep 2024 22:09:29 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeitddgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuff fokfgjfhggtgesthdtmhdtredttdenucfhrhhomheprfhhihhlihhpucfrrggvphhsuceo phhhihhlihhpsehfrhgvvggsshgurdhorhhgqeenucggtffrrghtthgvrhhnpeevvdeihe etgeehvdeivdejteejgeejgfehffekgfdvveeugeevkefhjeegffetgeenucffohhmrghi nhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhhihhlihhpodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqdduudeiiedviedvgeekqddvfeehudektddtkedqphhhihhlihhppeepfhhrvggvsg hsugdrohhrghesthhrohhusghlvgdrihhspdhnsggprhgtphhtthhopeefpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehsrhgtqdgtohhmmhhithhtvghrshesfhhrvggvsg hsugdrohhrghdprhgtphhtthhopeguvghvqdgtohhmmhhithhsqdhsrhgtqdgrlhhlsehf rhgvvggsshgurdhorhhgpdhrtghpthhtohepuggvvhdqtghomhhmihhtshdqshhrtgdqmh grihhnsehfrhgvvggsshgurdhorhhg X-ME-Proxy: Feedback-ID: ia691475d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Sep 2024 22:09:28 -0400 (EDT) From: Philip Paeps To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e273650f2c53 - main - contrib/tzdata: import tzdata 2024b Date: Fri, 06 Sep 2024 10:09:25 +0800 X-Mailer: MailMate (1.14r6059) Message-ID: <4C1DCB9A-5437-4EB7-83EE-E444C8120E6C@freebsd.org> In-Reply-To: <202409060141.4861fQXD083537@gitrepo.freebsd.org> References: <202409060141.4861fQXD083537@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; format=flowed On 2024-09-06 09:41:26 (+0800), Philip Paeps wrote: > commit e273650f2c538034b45f78e670a89cbf333ab6db > Merge: bedfac1f026f 62ad5eff8053 > Author: Philip Paeps > AuthorDate: 2024-09-06 01:37:36 +0000 > Commit: Philip Paeps > CommitDate: 2024-09-06 01:37:36 +0000 > > contrib/tzdata: import tzdata 2024b > > Changes: https://github.com/eggert/tz/blob/2024b/NEWS > > MFC after: 3 days Since this upstream release only changes historical timestamps (before April 2008), I won't ask the security-officer team to issue an erratum for this update. I will merge the changes to the stable/X branches as usual, and include them in the merge to releng/X branches for a future update. (This will probably not be far off.) Philip From nobody Fri Sep 6 02:10:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0KSn56NVz5VCFk for ; Fri, 06 Sep 2024 02:10:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0KSm6fnXz4p1R for ; Fri, 6 Sep 2024 02:10:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=UfXjPdEA; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::d41 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org Received: by mail-io1-xd41.google.com with SMTP id ca18e2360f4ac-82a29c11e1cso65266739f.0 for ; Thu, 05 Sep 2024 19:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1725588632; x=1726193432; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mQOGOXPPnu9CpMkFeX/a21EcF6mX7LWE4UKf2/BIVqY=; b=UfXjPdEAzzSBy5opNNUcFJh4nYzGzk9nERtUcFV0TnP5aDeSMWTtbQj/iylQwFF3DD Jfmhace44dZMVxk5Ay4fBgDem0m8WYtkKrJzB+RZY9i7dZgV+zFoCE5bAYbMTBXYDsXm L/zjN0gAOR4F5vJTdy9owgwt6w89fe3SwPh699e87pIXMgOP1SHTLJz637a8HP2ejdL7 m6rLZDysSLDs16OEtHQFCbfO1aeLY/SiF8v/JCgkDFmUvPBC7VEg2iJ5AaWLon4nad2X 2BCWgdKRWGDW/4yl6bdz7WTup5RmtR/VAIdNLvHnYYHJjc0/lA66f/e0B1T1Z0aldD3t 6/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725588632; x=1726193432; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mQOGOXPPnu9CpMkFeX/a21EcF6mX7LWE4UKf2/BIVqY=; b=kOmjkaKsU2w3hLU3/Sv4+PV5z7vPuRY6ZHQc8lJwUQgIZMXvvQXHNKZTunj2Oqi4+d HCWunNakIss7f07HVca3UBdDhcnMJsOwEXTnfXWcovQXiYIplGFfCaSmCfi+pXGlVmGT bYpcEY97L/BpOuvsZYaddIPS2IAy45JhwNY+vE/r/JkaVNTdQYIYQ1cYsTH6vTWNeGWf Twt30EOJOo4UFBxI/zbx+9eIBovTbV3BCEjFK5aDEoSKnXOYfAjLSM1Y2PGaWsEevbeC ITlyrZaCUP3ApS1wxfxmdxrwuIPg4pvlcnWUSR1flMUtocZMMeHEOlMsRTni1/QHH0gq lZsg== X-Forwarded-Encrypted: i=1; AJvYcCWP0Iquff/wDUb0ces4erNX8CEISyxg1BBbGMFoVu1yMKI+CJSK9lCcLHh6SAzwir+yQZDm+hQAu68U09PZlR6eiaOF@freebsd.org X-Gm-Message-State: AOJu0YwYq7gmiviu5iyP5FV2Zq3m8CTXOoAuAKyajW6kop2kRhVb24Ew E4VLuDJL/7zIVkq4i+e+lC3HJWU3E/1e16oZj6eTGgWoRymOVMblwQoKsFk7c8duMdqK3o71NEP sO/s4fg== X-Google-Smtp-Source: AGHT+IGs2oS8XhhuB9VIdKlYHAdEaoQ8yrpYPMRuHRnRn0Z8atXS6OkZlh7SWF7pCrw7NfXudJGIYQ== X-Received: by 2002:a05:6e02:1541:b0:39b:25dc:7bd6 with SMTP id e9e14a558f8ab-3a04f073206mr11966665ab.4.1725588631639; Thu, 05 Sep 2024 19:10:31 -0700 (PDT) Received: from mutt-hbsd (174-24-73-190.clsp.qwest.net. [174.24.73.190]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-39f6b33d6c9sm18768765ab.2.2024.09.05.19.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 19:10:31 -0700 (PDT) Date: Fri, 6 Sep 2024 02:10:30 +0000 From: Shawn Webb To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e962b37bf0ff - main - bhyve: Do not enable PCI BAR decoding if a boot ROM is present Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g5khyvupkahmttj3" Content-Disposition: inline In-Reply-To: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.08 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.979]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d41:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[hardenedbsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; DKIM_TRACE(0.00)[hardenedbsd.org:+] X-Rspamd-Queue-Id: 4X0KSm6fnXz4p1R --g5khyvupkahmttj3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Mark, This commit seems to force me to now pass "-o pci.enable_bars=3Dtrue" to all my VMs on amd64. I wonder if that might be a POLA violation. I didn't realize that I needed to set that until I bisected the src tree, looking for the commit that broke bhyve for me. Is changing the default here really worth it for amd64? If so, I'm thinking this should be in both RELNOTES and UPDATING. I now have to propigate re-enabling this across my entire infrastructure. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc On Mon, Aug 19, 2024 at 01:59:10PM UTC, Mark Johnston wrote: > The branch main has been updated by markj: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3De962b37bf0ffe7f30f5b025b46= ea49ba01c71f2f >=20 > commit e962b37bf0ffe7f30f5b025b46ea49ba01c71f2f > Author: Mark Johnston > AuthorDate: 2024-08-19 13:56:06 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-19 13:56:06 +0000 >=20 > bhyve: Do not enable PCI BAR decoding if a boot ROM is present > =20 > Let the boot ROM handle BAR initialization. This fixes a problem whe= re > u-boot's BAR remapping conflicts with some limitations in bhyve. See > https://lists.freebsd.org/archives/freebsd-virtualization/2024-April/= 002103.html > for a description of what goes wrong. > =20 > The old behaviour can be restored by setting the pci.enable_bars > configuration variable. > =20 > Reviewed by: corvink, jhb > Sponsored by: Innovate UK > Differential Revision: https://reviews.freebsd.org/D45049 > --- > usr.sbin/bhyve/bhyve_config.5 | 3 +++ > usr.sbin/bhyve/pci_emul.c | 27 ++++++++++++++++++++++++--- > 2 files changed, 27 insertions(+), 3 deletions(-) >=20 > diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 > index ebbb206cca9f..25185e2ef1b4 100644 > --- a/usr.sbin/bhyve/bhyve_config.5 > +++ b/usr.sbin/bhyve/bhyve_config.5 > @@ -157,6 +157,9 @@ Specify the keyboard layout name with the file name in > This value only works when loaded with UEFI mode for VNC, and > used a VNC client that don't support QEMU Extended Key Event > Message (e.g. TightVNC). > +.It Va pci.enable_bars Ta bool Ta Ta > +Enable and map PCI BARs before executing any guest code. > +This setting is false by default when using a boot ROM and true otherwis= e. > .It Va tpm.path Ta string Ta Ta > Path to the host TPM device. > This is typically /dev/tpm0. > diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c > index 00e9138d3910..e066d6766f3c 100644 > --- a/usr.sbin/bhyve/pci_emul.c > +++ b/usr.sbin/bhyve/pci_emul.c > @@ -48,6 +48,7 @@ > =20 > #include "acpi.h" > #include "bhyverun.h" > +#include "bootrom.h" > #include "config.h" > #include "debug.h" > #ifdef __amd64__ > @@ -853,6 +854,14 @@ pci_emul_alloc_bar(struct pci_devinst *pdi, int idx,= enum pcibar_type type, > TAILQ_INSERT_BEFORE(bar, new_bar, chain); > } > =20 > + /* > + * Enable PCI BARs only if we don't have a boot ROM, i.e., bhyveload was > + * used to load the initial guest image. Otherwise, we rely on the boot > + * ROM to handle this. > + */ > + if (!get_config_bool_default("pci.enable_bars", !bootrom_boot())) > + return (0); > + > /* > * pci_passthru devices synchronize their physical and virtual command > * register on init. For that reason, the virtual cmd reg should be > @@ -966,8 +975,19 @@ pci_emul_assign_bar(struct pci_devinst *const pdi, c= onst int idx, > pci_set_cfgdata32(pdi, PCIR_BAR(idx + 1), bar >> 32); > } > =20 > - if (type !=3D PCIBAR_ROM) { > - register_bar(pdi, idx); > + switch (type) { > + case PCIBAR_IO: > + if (porten(pdi)) > + register_bar(pdi, idx); > + break; > + case PCIBAR_MEM32: > + case PCIBAR_MEM64: > + case PCIBAR_MEMHI64: > + if (memen(pdi)) > + register_bar(pdi, idx); > + break; > + default: > + break; > } > =20 > return (0); > @@ -1140,7 +1160,8 @@ pci_emul_init(struct vmctx *ctx, struct pci_devemu = *pde, int bus, int slot, > pci_set_cfgdata8(pdi, PCIR_INTLINE, 255); > pci_set_cfgdata8(pdi, PCIR_INTPIN, 0); > =20 > - pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN); > + if (!get_config_bool_default("pci.enable_bars", !bootrom_boot())) > + pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN); > =20 > err =3D (*pde->pe_init)(pdi, fi->fi_config); > if (err =3D=3D 0) >=20 --g5khyvupkahmttj3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmbaZIgACgkQ/y5nonf4 4fqYDQ//eMyzfZ4TVp20Zm7/sUsJh6YKTROAvwI0Lzt7H70FavlXkkUF1+L1qqTQ J9xpLPlN8ee+24b7DcQh4Aad+JGSB0rc46fhDSlBx2RMkceiL+fvbVtPSNdSRfF6 qrpoShG0PKqR9hwINK8lqrRTT/SyF6g4AKh1n+mt9jEtJ9thj8QP53mLEYqiKukH /Kg+grYL0QsmYJYI2LCPJBXSXFF+5IyOtmt6QVn+W2v0WTQr0OBtHIeKZNKv0/02 CJGjRRx0I5yt1aAXNGZJXwzICLbqeucuxf3+jaCo900fsIqSQK4QbVRufTkWcFvp t0r2Piwi9TjaoOZpo61mdbN1k+2YXyQkXiKfVh6Os7Y4afBLLJb8v10d3EobqYXp 4B5atNWnAmbpB9TRaPM2LKsJyTzcDKSRFk2DHxM4Z0j0Jhr96K1U0DffuEL+Dokt v5nHXSNDltnXQo9+iP4FIThJJEIStxXf20LoCZcwPOvg+llthwSMhLIOhwn9e+75 A77V3cV7/bNbu/0a47kwLNoyLMkBepTXkbBIME71EFYhO6StP5t+zLHWXbV3T0eM X/ZcQspiOs5KYcOSP/XV0BJkgebqhokIioNI4MFothxP4Pqxc9xZPtBu98nnkt7v ZBeGucp42vo1eyp2AEUrJVimI3P4vk6JVkLUJIs9rDQr5OxL+4M= =CpdA -----END PGP SIGNATURE----- --g5khyvupkahmttj3-- From nobody Fri Sep 6 02:39:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0L5j1dp6z5VHVK for ; Fri, 06 Sep 2024 02:39: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 4X0L5j0kYKz4tQx; Fri, 6 Sep 2024 02:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725590345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+6S39HePKfEuMfu6vbydhfohbgHhv+CXi3lkC71fkQE=; b=GTjbSApdOsKvviaCm7VO8iG3Gxh6lBzdLhjfQHPem9yNs3h9o4qFvoqkDJl5WzkZeWXoad EXxMSkWW1TUbzT1hGvDmuNGv4LlOLI+vz5rZNDFfaviA+nL/5Nsh8J1IW2LfoHWBShxdB6 u4Tc4vYnys8eMDwYJm2rC4qmAHZ5LQKYW//aJBBgRTm0mcTia4bCw/OumZGRXRlH3ic6kA nvsorbhG1BFoNohhf8JpjN/ctqRUooma7xNQLE/y3soLLY4wK6/BXXKKCzBOM5c8yRU3Xe hPwgIsvr93atd7hDEhSvTO1CcMwbM4YUndagMiwi+njL2jDI7PoOVOUk0y2PZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725590345; a=rsa-sha256; cv=none; b=OvK4609jv4xCEoiTTyODLZeRDDf1fuvyQuILm0uMKEKvV7E9MWAjgRBvqtxL8OvwKWRbTM RZsny3IBVO99r2+2IUvQEwoZILDw4yTNJofx9UckAcop1w4LAkjtu4Uyo4JLGkXsZP/uaf eqyra1pbIWPocKbSLob2hxl4NXAEDBW5i3+H1FNxSrbCT6q2qGy+S/LE7nrgYZes7d3nQr DZA8XVgFnpyun3cnfyf9w4nTThtchG3YsUwmdioUT4fcBpoNwjjF4dgZcRNG0x276gOBx7 lXvvPIJ5UUVTpYy5fZt3qEbKdYz6DRZK0HLroayu3wVO0qdG9PCKzGCz6N5Icw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725590345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+6S39HePKfEuMfu6vbydhfohbgHhv+CXi3lkC71fkQE=; b=owSno+8uUJDiBahrJ8YZmZNpEosD9YhloQNh9cJqNka3YHdKBmYM/8vfan0FPnfm3DPnq2 qXXBEaZv5IDv1rwlSgQV9TYOGTxBfmVixzvr/nuDLw8lx/zOQ8AOx5SLAD6NB+J4PJ++JV pG7OTZT0YK2m58+nG4OltoNYo6XjSQX3hMcUM8XaUA0JarZDHK0iJTaK4pyIitBkHhcVax jMp8epnjW5yEEqpOYTMwzYFZb7UNdzf8ZHXdvgvQ+37WCXRiqIkfI++L3Bw0OCa98WYHuZ Tq1l6ToMu1iW5JL6PmtotQFNEEO0T4ns9EWf3MkPi5hRhHbyyClet7cCDqo8QA== 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 4X0L5j02DnzZYn; Fri, 6 Sep 2024 02:39:05 +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 4862d4Th074989; Fri, 6 Sep 2024 02:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4862d48I074988; Fri, 6 Sep 2024 02:39:04 GMT (envelope-from git) Date: Fri, 6 Sep 2024 02:39:04 GMT Message-Id: <202409060239.4862d48I074988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Joseph Mingrone Subject: git: 51a183021fce..75d9de99aec2 - vendor/tcpdump - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/tcpdump X-Git-Reftype: branch X-Git-Commit: 75d9de99aec2d9f3bdc495c91bbd6d7a2392e2a3 X-Git-Oldrev: 51a183021fce3928d24b11c319d2787f5a15ae87 X-Git-Newrev: 75d9de99aec2d9f3bdc495c91bbd6d7a2392e2a3 Auto-Submitted: auto-generated The branch vendor/tcpdump has been updated by jrm: URL: https://cgit.FreeBSD.org/src/log/?id=51a183021fce..75d9de99aec2 75d9de99aec2 Import tcpdump 4.99.5 From nobody Fri Sep 6 06:39:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0RR64sS0z5W6rx; Fri, 06 Sep 2024 06:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0RR62tXPz4CvZ; Fri, 6 Sep 2024 06:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725604770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s413//Sfpft24gDnGfGf3itqlCIPrtwCEkVYMjS6ZAs=; b=bbkwsih6tTtflv1Pkvns1izc+ou2wKnLOAaTN2RNLOOSqstNyKoLbLUGdJP3ytIUSnBG9a q6Dk1jnnOqYLGHBYDtVBORTu11CzP+N+CYXp6HVPafnF7ANxflWU0vHp+duQBQoBDZkDU1 SX+ZUBrAVzQPJa/zcHWwzu534dpzZJeLwNBiGXZXTEATk1rnxM0U6qqPLx5Z3Jva1tfBtv wID3hcHrDq7eCynO/L5Nn9kmA1ukd/man6AFZaGoIvlCianEZTI6ZmFdFy/s5dTZU7ATtM 1xUKpOHbxakPAYKbUTOk5r0VVhFQeHsBpzvrtgalm6QZvr9P7TuVd+fHBqTamA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725604770; a=rsa-sha256; cv=none; b=hnOxkyCkI3KJdAFjWkQataQxYSxUGNBQqp2GhGVlhL28ij0g0kOoz2hFDzVAL4sPWlI4mr ElGtAGC09rv2XHMMpSduYdHCXMdf+VZIF5fMDeye/FUPqKD6PK5XaLHmkRvD6YQ8E44c7f Q0lYXEdIGSzmINeDkQiWOR8jg+r+CkhYQy0xl2rPH1zPMNSRdWJN21ZVv7klkKi+XHWjgN LfWCiGPid76Jj8h981yHxtoB8b3MdKVXrLHNz0pNakrOwmCSh9XTIX4jT2l10JEOuDEmlK ZNPmydQq8C9LyuqenSFtxCjHRAkmn8dQiXZQO/QQyuRfhWcX19dnSC6U/dh5kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725604770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s413//Sfpft24gDnGfGf3itqlCIPrtwCEkVYMjS6ZAs=; b=gm3x7uJt2MKYR6NCungncyUkJANEh1FQ1btdF93Zm7TJMuPLoBm1WlF/d3gc/URRuU5rz1 YWcPsEkm5/yUhOxgdyRGDu6pjp2vjIqfLugeDQZwkrauFwee+6gttzHVE3BIIqFUuTb6ip sLYapFpFyEADDP5nKPh6yLvxLx0KdfVCq1gTr+tH2ir8LPm+3RJ3fSfzTbJ4PO/l6dhG0R S/ZZgCQf+bhXcn6T0icZ7bm7BpLSIXvz3W4zigI/WvIoAb13zgUqVC4uWvsmldfBeZerzn 4+19C/+sdCczAIyNmuG40rMn5T1qpexKaFjuNlZwuBdFeJK9cmxmh3/KsdR2NA== 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 4X0RR62MN5zgsw; Fri, 6 Sep 2024 06:39:30 +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 4866dU6H082749; Fri, 6 Sep 2024 06:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4866dUCP082746; Fri, 6 Sep 2024 06:39:30 GMT (envelope-from git) Date: Fri, 6 Sep 2024 06:39:30 GMT Message-Id: <202409060639.4866dUCP082746@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: 087b246271b6 - releng/13.4 - 13.4: Update to RC3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 087b246271b6caafb7ae88ff7f7f36d5c66ec33c Auto-Submitted: auto-generated The branch releng/13.4 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=087b246271b6caafb7ae88ff7f7f36d5c66ec33c commit 087b246271b6caafb7ae88ff7f7f36d5c66ec33c Author: Colin Percival AuthorDate: 2024-09-06 06:39:08 +0000 Commit: Colin Percival CommitDate: 2024-09-06 06:39:08 +0000 13.4: Update to RC3 Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9df266dcfb6c..862c89a779f1 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="RC2-p1" +BRANCH="RC3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Sep 6 07:17:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0SH90YgGz5WC0J; Fri, 06 Sep 2024 07:17: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 4X0SH904Jxz4KYk; Fri, 6 Sep 2024 07:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725607061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=euIRwqxLb1sq3IYquP8Ss7+nHFVbX5IuP6IjBpS6x8Q=; b=T2QuJyHYyv8IhDP9+AC5IOelB3lHlEb27OQ3IK7UVjnhyhyUnceYQeA1qDU3j+XpM1x3Mx xMA2f0KvX85wDIUcAVfriDQD0/6PewFB3LUNP98TlNVU/0UaieTPzLyxfWynY9IM0z2shk ikW5EQcPLJt0E6ibVBVyvhQNIwB+3ryMQ9FXW7al60EYZyRsKaIdSVIFYsIG6ulc6Vu2NC 12LHotuVL9pT3gcvPAM0CBAZYj03vcnBWoZV0bPjtdnmFPsQyud74hzaXq30QG/i27Q5rc A3eTJjswwjUyogwzP3eMRdY0MDMaEOFw3bTaj3Ghea6IumhuXNomLkhIf1PLrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725607061; a=rsa-sha256; cv=none; b=kugGIF8lQd/m6setUZigQ94njk8+MRLp0ees5MRhKJ7PCbrjA3dP+Mh0XBP+XcwkAp82U3 mDhCeT6n4iAXEkdNMIuTf+rpaIW6nZ+8vUAcTtL0pKc+/o3eRxxJ71bl8GKDDzgjZkxPOd VzcEL5RK39LxrH3ke9iJLO4kN2w+qr/d/DYPYskYZBkg8Dpkgcjb71pNa28ZK4dO/AULQV +6XBghhyJvLqiXhSmQVxGHwhlmqbZO8bRqsrlKknF/chaYW6zgr9jOwZ5jVyCnliuDoUzc VcZiIgU+MHjD2JFkQeqLPaCX7TZGtYmA+SIfaY0MH5aZPo8xHBdrkvcaC8V9TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725607061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=euIRwqxLb1sq3IYquP8Ss7+nHFVbX5IuP6IjBpS6x8Q=; b=nZVYLQfbnJ4TZt7V8FyoX9G3bwPdzTo3ZM+6NUwDqHW7kxCEEBeYD8vrdIWHVLHpiYypaj brJsYMerzirD88BrleAR766osXop2ux1DFNglR2KnNO/iNTu2wHuUcyfDE8aWrhJVmJsaF YeXxifXBdEO8XXfVyCN45IeGwTIblR5Wj8R6tzFYrTe2A+l1OoEOa8Mzp5g4xvUUb1nydX ZqqUu/8XHAqcXUsMCzaLwdHgBjSBWOdm/9UYEU1YZ979IevXW7OP56KqMB7Jyv873ZAZSA dlIGechLInJzcVVSoraXXJroDssab0Ug+KgQckgWKd4i4cPmFFj+hnZd8hP8og== 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 4X0SH86NXfzhBy; Fri, 6 Sep 2024 07:17: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 4867HeUs050415; Fri, 6 Sep 2024 07:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4867HemL050412; Fri, 6 Sep 2024 07:17:40 GMT (envelope-from git) Date: Fri, 6 Sep 2024 07:17:40 GMT Message-Id: <202409060717.4867HemL050412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 674cbf38f6d0 - main - cxgbe/t4_tom: Add synq entry to the list before calling send_synack. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 674cbf38f6d0a0b307e52c4265da9f077606b035 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=674cbf38f6d0a0b307e52c4265da9f077606b035 commit 674cbf38f6d0a0b307e52c4265da9f077606b035 Author: Navdeep Parhar AuthorDate: 2024-09-06 06:21:59 +0000 Commit: Navdeep Parhar CommitDate: 2024-09-06 06:21:59 +0000 cxgbe/t4_tom: Add synq entry to the list before calling send_synack. This fixes a panic where the peer's ack to the synack arrives on a different queue and do_pass_establish tries to remove the synqe from synqe_list before it has been added by do_pass_accept_req. Reported by: Sony Arpita Das @ Chelsio Fixes: 283333c0e329 cxgbe/t4_tom: Track all synq entries in a per-adapter list. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_listen.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index f91d193c0fed..8a39218a55ba 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -1494,18 +1494,20 @@ found: synqe->tid = tid; synqe->syn = m; m = NULL; + mtx_lock(&td->toep_list_lock); + TAILQ_INSERT_TAIL(&td->synqe_list, synqe, link); + mtx_unlock(&td->toep_list_lock); if (send_synack(sc, synqe, opt0, opt2, tid) != 0) { remove_tid(sc, tid, ntids); m = synqe->syn; synqe->syn = NULL; + mtx_lock(&td->toep_list_lock); + TAILQ_REMOVE(&td->synqe_list, synqe, link); + mtx_unlock(&td->toep_list_lock); NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); } - - mtx_lock(&td->toep_list_lock); - TAILQ_INSERT_TAIL(&td->synqe_list, synqe, link); - mtx_unlock(&td->toep_list_lock); CTR6(KTR_CXGBE, "%s: stid %u, tid %u, synqe %p, opt0 %#016lx, opt2 %#08x", __func__, stid, tid, synqe, be64toh(opt0), be32toh(opt2)); From nobody Fri Sep 6 12:19:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0Zz91gh6z5Tthw; Fri, 06 Sep 2024 12:19:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0Zz86zfsz457R; Fri, 6 Sep 2024 12:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QY5/Wv6xyqpc2LQI478GuevJYrjyZrCfkYyRFfnayyo=; b=sTwVErUJzGNADgRdwWfP8MYktA712AuwjjRZaIcIoOWoyewn1HIXyJeQ5lPRuDFqct1bBp OJpO0z8iWVUrGU7qywt5qhyIe9BE1xfuE2dUeuI/FIvhASxG2wdnH3r7+UNjZCd2M4zVpP 66jIITBa5nkDc7zBz2k6gRpd2Xa2C5WTRiKCwAn0o5W1nQwDRytLOle5Tno2dv3zLmkm6S ZHFM+vXuX7p6aqtjq9ZjVuqTgALCQlMyVNTIOFfz7r/2XjA50hSLGLys7Bkj1KnRpsOPAR U11xuCZWY0nlKQcOipLL6uilEG3w60Wxp/wq41CH2uDTchDz0mLTj2Setd5T3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725625157; a=rsa-sha256; cv=none; b=KbGXBIAfB+RS63opaI4RCBr0jDzVdSToXb5Ya+FW9HiIH2QEqVufFjqnSm3F5r9NLyqIJe rAbnzz+PWBnliPynqgElwwgvwU08DOUEMdW/6XZxZXHxaBwDS3qBstfi6iGZHragz5XpNG SRF8c+1w9KxIC+6hDdv3n+rCqsfth+FHKRfispYg9zOhx2kjnMiFuotN/1OiMneIw6r/XB TIeruUJoLrn8raFBcmOTSN1wuoXu2yUwZeVxd9StMu+qPNmaufJ/caebsTM8+YE89gDNQU SO3PIG7VzPBlSz4ZzOd3uQmgNBQMpYIvgLmpQhwarfKSJMMYSeKT4I+6cVrXJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QY5/Wv6xyqpc2LQI478GuevJYrjyZrCfkYyRFfnayyo=; b=i2411QNPu/Wa6MdORWLuVS6G+uWez65/CyqxcZfvRK1enkbACpInWV2NV65IgbGGSzvvfA jgYLNJlE+pNllNopkEMvxTj07OFA/dIIMNEGc/ckVyr2Op4VcPOTT73FQdsiPFkg+/ZLzw JaPabgX4BcxqjzY4MhYn7w8zeT4lgNVL74wS1W9v6z1ipzDO1FjCoMCaT2SU5arZuXNYic n4N/f3Vm8vBK6AhNTxy9P02w4cr5bMuuQzshFJ27830KxNpsfI5maHA4mWegBBa0UgO5hz ZnVzN4/dc8Mpg3cRJSqKtQdMJyNQD3nNKt3Igqzi6OPQl+n3y2tUPb3TKKG9Ag== 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 4X0Zz86ZsMzrXW; Fri, 6 Sep 2024 12:19: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 486CJG2K062228; Fri, 6 Sep 2024 12:19:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CJGnX062225; Fri, 6 Sep 2024 12:19:16 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:19:16 GMT Message-Id: <202409061219.486CJGnX062225@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: 7da246dc4ffe - stable/14 - beep: show error upon failure to open sound device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7da246dc4ffeba38ad723a1cb72a19511292c840 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7da246dc4ffeba38ad723a1cb72a19511292c840 commit 7da246dc4ffeba38ad723a1cb72a19511292c840 Author: Ed Maste AuthorDate: 2024-09-03 14:21:46 +0000 Commit: Ed Maste CommitDate: 2024-09-05 14:50:09 +0000 beep: show error upon failure to open sound device If beep cannot open /dev/dsp provide more information to aid the user in diagnosing a problem. Reviewed by: christos Sponsored by: The FreeBSD Foundation (cherry picked from commit 83325e7b738ce87d88553585b135b0e7d15997a6) --- usr.bin/beep/beep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 151236b4825b..2696bacfacf4 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -202,7 +202,7 @@ main(int argc, char **argv) f = open(oss_dev, O_WRONLY); if (f < 0) - errx(1, "Failed to open '%s'", oss_dev); + err(1, "Failed to open '%s'", oss_dev); c = 1; /* mono */ if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0) From nobody Fri Sep 6 12:19:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0ZzB1PfXz5Ttng; Fri, 06 Sep 2024 12:19: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 4X0ZzB0LjLz45LC; Fri, 6 Sep 2024 12:19:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YIFKPcNZRKdcKTXSxV2RiE7fYe4pIz6mdc/05jw/wYQ=; b=qX6do3Q05ffCOb7TDJjHyRYRQgLbztEVDeJAoukqQFXvIR3HAy0Y2tCS3zncaB+cyqVu00 9CXSk7jK3SsTNZ1pegemutVbBN40Q7b8sCxDMoSO9M47/jHxUP2m/qjy0dVg/EYP3sI3Z+ 477twmrVNwq5wPqvCG0i4R7Pt34mRb/egCrLczOlrZjHOW52qn/XbsELkSGqJxmgu8hXQ7 uXljPcluqT0OgdfmYw4XuAGVrKLjqhJHBrrlsnppBX1zY9i/Cx5HN+xpvp/KwCQfJwVYIY hkMTFylUl/YmTA1c3NJuJx0v9aAYR+BPEEz/zM+0wRaVc12OrOe3x2xdq3yrow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725625158; a=rsa-sha256; cv=none; b=nCW/DUjh+YKyT5udnbFnrc58TK8AVGxJyxWl7oFiHqiLfTqRsYYD8dwp4CPhDBgsmlX7Io OpKbbPPKnEd97tQqm7bUhKV8754LdjcmG27a4wBZR1QFVZa0pQMkIuGHPx0qyXylpi8RXr 8og+21kUGlztuzxQ4uyaN12C6YDYiky6qA+hR7f+g40AWrzhWQ8w/DTFm1jdPvk+U1pzTA yBorRtOhOJbn70EsBISZai4E3wvx7EDvicRIK4xCrbkVMAGbVg0nEF1TaYa8LdlxBh52WP QWJpYcE2xnYq6ajR9sH/4DK2FQRHuSkhYygmR876T5b8eOOHYCj440Xzki3ZnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YIFKPcNZRKdcKTXSxV2RiE7fYe4pIz6mdc/05jw/wYQ=; b=Fgzl4pBSZnWl0JzxBXf8JeA2K3mQ2xd+IvOHguqelIsRS10+9gx2k+otYjo2S/imNlkqJv ut56BI54wYTDg9FjQo33EDU8yQWqIC2MNg1H8fV4WqWyHNnC4YWpMpAb5KeQCJdk31bO6k AE/r6dl3wZtVtC4gSAY4gWE/xyagwX7hOQDHB3PnTWxUpJjnL6CSaUzpiL/5J50H8TIhLX 3LDpRtsfpo66DU8Gckp80qyAPi80DJo0snBtW2FMnR7xNpr/HmbjDhhfz8c6JwRnPwW9VB 3Nj4tuZAJsaOTyQmKnOIlRczHODTvS4NBeqvEHAviqyUROvBeseNmSv53TvXcg== 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 4X0Zz974GHzrXX; Fri, 6 Sep 2024 12:19: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 486CJHE9062280; Fri, 6 Sep 2024 12:19:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CJHvJ062277; Fri, 6 Sep 2024 12:19:17 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:19:17 GMT Message-Id: <202409061219.486CJHvJ062277@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: e998c9f1bb39 - stable/14 - bsd.symver.mk: pass $CFLAGS to $CPP invocation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e998c9f1bb39301a3408a47004ee6747698a9c8d Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e998c9f1bb39301a3408a47004ee6747698a9c8d commit e998c9f1bb39301a3408a47004ee6747698a9c8d Author: Ed Maste AuthorDate: 2024-05-24 16:15:17 +0000 Commit: Ed Maste CommitDate: 2024-09-05 14:50:10 +0000 bsd.symver.mk: pass $CFLAGS to $CPP invocation This allows us to support symbols optionally available based on configuration, not just on compiler built-in #defines. Reviewed by: brooks, jrtc27 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45346 (cherry picked from commit aa0bc761d245d2ea1e4b7a0343715cc76859d5da) --- share/mk/bsd.symver.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.symver.mk b/share/mk/bsd.symver.mk index a1c6e62fba76..d0b63206d8fe 100644 --- a/share/mk/bsd.symver.mk +++ b/share/mk/bsd.symver.mk @@ -44,7 +44,7 @@ _vgen= ${path}/${VERSION_GEN} # Run the symbol maps through the C preprocessor before passing # them to the symbol version generator. ${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS} - cat ${SYMBOL_MAPS} | ${CPP} - - \ + cat ${SYMBOL_MAPS} | ${CPP} ${CFLAGS} - - \ | awk -v vfile=${VERSION_DEF} -f ${_vgen} > ${.TARGET} .endif # !empty(VERSION_DEF) && !empty(SYMBOL_MAPS) .endif # !target(____) From nobody Fri Sep 6 12:19:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0ZzC3k8bz5TtqH; Fri, 06 Sep 2024 12:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0ZzC1PxKz45GL; Fri, 6 Sep 2024 12:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyp0oPvnBP1pU2SP+ibosV9Lh5r8bn2HkVzhB5mivIY=; b=OBMdykn8TtuZPdR3QJEFHubMXoU+4A+2hgUqcCsw70vV8v5HUZ2R1TWWRJz8I+xUK4Yhsd mhld0MCOig6/6kA9ZDrc4+/YC/sDINX/hXU3nW9fNTiC9sjv7NLn0ECig1jjz/lJDLad+1 AsBOOOjaA7OlRnuY1uBz4NIeO9243ftV7xmmeBL4Qas1UDL9X8oSjaI1ZZ8aE3s1oGuynq 0Yo0+xpOygVUFzUkzlniRBvBSGbO1xNN9VMs1Y32UGxQUEQ0pC50yPIuwIgJXmxQBIDxZY 8szTMZbYXYscK1bAp+NxLKRVmYUfFUUFj4CLazCq2BXOiF4xPCXQTVlcNDGIuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725625159; a=rsa-sha256; cv=none; b=w2M/FMCffyFvvSfe47eaGSqyV7JLrqtLoSTFc4JJdc1yN241IQelJvJ8n0ru9QHfo9JHSd fDzP7Y4DlGCf2A2kbGCD41j0X3cEjWEJ1t83EJySr+zHLC2YQuj+jtmwKsXniaOPg2oEsm 76GFA0zBFHxCnHsWRdm+sPYkzrzZ/exHL3HB+y1GKecRn9tD5qNZr1vJfvJ45SF4/+hTK3 bxMSVBIci02QHp1tI3olle/gGqiP7LI+R/n9ElmJ6XIZHjKj7TOGzhxSWrxS/CzRNv87sZ x46r9kYPkfG5yPiDkM3PoyvfAtsfhzEXNYhVbI8zgXFuG+yahUdFC6jFlPLPcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyp0oPvnBP1pU2SP+ibosV9Lh5r8bn2HkVzhB5mivIY=; b=hRFGf8tQyPNg7JGf0Sf0qrqTJL9VLBUYGbF2NrbQBcXq37IIyydqJNK9IYmADVJS5ci+FK ok1kxMgKyvAFCCW53K/ebNjV3XJAMbdJDPTOYLeOBWuuZA0cQm3lS2G8J7MI8CopjdCaiv 7gVO9Lp4p8wq/UdQ6utDAJHyI+8D4gp9/XxIxAamz2cNeflnlFOYyxrqfmeVwHbRhREh3m tcC8kY5frBKGqCVQKssa6VwsSkRWnkLbT59QBjVuMMsb6j/ZFggKU1Rb1pJLDdyQ0uI/dR DQLpMYdw4gu46+EWezHqVQguuOA8uqtEcoYINCzADAZs43vSuccjW9VNjhNyGQ== 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 4X0ZzC0kHDzrdP; Fri, 6 Sep 2024 12:19:19 +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 486CJJZS062328; Fri, 6 Sep 2024 12:19:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CJIM4062325; Fri, 6 Sep 2024 12:19:18 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:19:18 GMT Message-Id: <202409061219.486CJIM4062325@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: 14a2be2b3db1 - stable/14 - stand: bump arbitrary build date to 2024-01-01 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14a2be2b3db17cbd86a584d5a3378baa7e966bd0 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=14a2be2b3db17cbd86a584d5a3378baa7e966bd0 commit 14a2be2b3db17cbd86a584d5a3378baa7e966bd0 Author: Ed Maste AuthorDate: 2024-08-12 13:11:09 +0000 Commit: Ed Maste CommitDate: 2024-09-05 15:02:36 +0000 stand: bump arbitrary build date to 2024-01-01 For build reproducibility we set PE headers to an arbitrary timestamp. Nothing in FreeBSD uses this timestamp, but bump it from 2016 to 2024 so that the timestamp does not seem "too old" in case some third party tool is used to inspect EFI boot components. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46527 (cherry picked from commit 1b9cfd6a625dc82611846cb9a53c1886f7af3758) --- stand/efi/Makefile.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc index a27eb5d97484..d4600a4d60e7 100644 --- a/stand/efi/Makefile.inc +++ b/stand/efi/Makefile.inc @@ -24,8 +24,8 @@ EFI_TARGET= efi-app-x86_64 EFI_TARGET= binary .endif -# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2024 00:00:00 # for build reproducibility. -SOURCE_DATE_EPOCH?=1451606400 +SOURCE_DATE_EPOCH?=1704067200 .include "../Makefile.inc" From nobody Fri Sep 6 12:20:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0b0P71qXz5Ttl5; Fri, 06 Sep 2024 12:20: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 4X0b0P4xJHz45xv; Fri, 6 Sep 2024 12:20:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8YLCxVZBhOo6lfeb9UyI+YdMI5VHDHAgbIcQo70FMfc=; b=nzJVsYNHUlYQH3iiVmbiNp4sda0yZkjLFlVUS/EFZhB51bLyQ8/r+jsOKgf4QwvVPNKylo 9QQd+DpJsnSJkCsQ915j0Q6J/rMeO+lpHcxlAwlYZf7QV1yqxo/l5pYB0wz9p/EdBa22VM n8pMtjzEc5VKvlkWq5RV7jLSrhSGOhRk0r3rmso/f78ZVVFSgNVSxHxgc9pIUN/tN9ijBL U69P/6sgLdh9/127zPdGSQMxVE6ODAio1f4yb4z5cfHI4GJAgRMi2ZUk3RSGQWxfNEfrdu RUBltB0UyBhu+6lzvnnoMFo8d5MYakMpQrS8KlFKS31rrvuF3pSRvwN41yTRMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725625221; a=rsa-sha256; cv=none; b=cY+VlZJTBfxl4u1ZxwFCzu1E66E/t+xPtmFdFXqW1gX5K580eEmjrbzCI1oc/H8iqS7ULq jA+CyQJPDDGGsieYjGdqTNOQrOxGD2PnraaK6l15oHD+Cm3hmfsTj0EI78rlddLZQZGdn9 uTWzoh/8oQdDyTGiDgH7NsnmVonFtvMaANDUPpYx8o1Ta9bEEiPyYndt4WqzA8VypVea+G Rpg0Evyi7OuA5vWFzBa1oRtwD2xvQTvdg8p1v9RFkZA2ax8n7EmjdC4tqFzTX9FTAC7t5u /liQXgo/QNIT3PztZQKGN7iMcPreH1Oog3UIEpOCanKYSm4hAGcoYuKkWP345w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8YLCxVZBhOo6lfeb9UyI+YdMI5VHDHAgbIcQo70FMfc=; b=SRTgQA7u0fdoV6QJRWWyq2mKMwckwJivF0yiR6FVIHyt/G358vdJ9tY2vIA0yzVMK/guDV 3hA5LfbYkbzoj7Y/KMerm7+ttOWkIZe/eFiXwGYBzjTQmjPe+F8xgQpDUT68nE9++zKk+3 8S7ZAjCQENeD6v/m3tB5T36qExBFezkhV48i/CzeAmUF2/Yh2DK+h2ZnyZLyGZ/9Wz0Avl wCGQ1lvj46TZ03RCd1wDLIu+4KhTf8pJURZ53TYs5fqLucrLDbVxOdKOFcu7N7wv3+OsaE tgeuInh83b0dv9G39+0SZv6RlmDIlbm5GF9/IKqP61juYWrBtiJGY9SsbIDtug== 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 4X0b0P4XdKzrsJ; Fri, 6 Sep 2024 12:20: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 486CKLAm071197; Fri, 6 Sep 2024 12:20:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CKLg6071194; Fri, 6 Sep 2024 12:20:21 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:20:21 GMT Message-Id: <202409061220.486CKLg6071194@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: e7b4f6e0c064 - stable/13 - beep: show error upon failure to open sound device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7b4f6e0c0640f08acc3d0157a117e58cbf3bf22 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e7b4f6e0c0640f08acc3d0157a117e58cbf3bf22 commit e7b4f6e0c0640f08acc3d0157a117e58cbf3bf22 Author: Ed Maste AuthorDate: 2024-09-03 14:21:46 +0000 Commit: Ed Maste CommitDate: 2024-09-06 12:20:06 +0000 beep: show error upon failure to open sound device If beep cannot open /dev/dsp provide more information to aid the user in diagnosing a problem. Reviewed by: christos Sponsored by: The FreeBSD Foundation (cherry picked from commit 83325e7b738ce87d88553585b135b0e7d15997a6) (cherry picked from commit 7da246dc4ffeba38ad723a1cb72a19511292c840) --- usr.bin/beep/beep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 151236b4825b..2696bacfacf4 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -202,7 +202,7 @@ main(int argc, char **argv) f = open(oss_dev, O_WRONLY); if (f < 0) - errx(1, "Failed to open '%s'", oss_dev); + err(1, "Failed to open '%s'", oss_dev); c = 1; /* mono */ if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0) From nobody Fri Sep 6 12:23:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0b4Q0LX0z5Tv8w for ; Fri, 06 Sep 2024 12:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0b4P6vKsz46ZR; Fri, 6 Sep 2024 12:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WYsytcm65awGCNwDdTtmY1iu5dvEODS7y84IOm67PwA=; b=B4ooNhBk/KKFQHhvm8aQ384loOt8voa4zI8OuWa0eOwWxzxzuTG/HTJUNSXmD1uQFL7C5A iNhz7fMBmNsGY07fR80FrQWqA4fZAulUFIDJh59mpqL6eM+VFarangB+JHUyFTKNsDFmwt xUkkpUmNASHqljBXCOUr8yPRMS99QFQVkNBlzLXxpvM1WkF2Ci/REPcTGpPXoex7iKK/FH qthuhUSslI+BeE4YM/DGcAw/gNbK8Vh2IdtkGT8yjqvsoVcAT8PdhNDcn+bzMcYg7tuIK6 BiJHquxqPyyCN/00jwyZZl4DVdGwBE3akTA6K8rJN2GI1jZbG7WsgXf48OW8zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725625430; a=rsa-sha256; cv=none; b=ulgb8f8bLgIRnifqdscfz2CKbLzefRA5hZKt3n+cZfbZId8V0NjGhJd8o8OI3QqTFhDvgD 3Rsoau0qwpsNfoLuS45UC5QzAMt1v8jV02hsT+8dgOQUOM60YXfzZU9wn+YaYowelobU7k 5v8bSKPithMJ0p3j9Vbk56XNWYTBJtB04P3c9kT9/4HxHDCTmHTBXDYIWd7VGQb45BykA9 5+JX85njNW90NjF9bxxaWnThpOwwfB8CmDmA0pce4yYQlNihQ5LkQnSjBGoouPIAUsUSsl lSfqKB7WStaBtpn3LL5m7p3rVM0u3AFvGxqV+ylp4z1cmjNXyEGE4P5nNPi6Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WYsytcm65awGCNwDdTtmY1iu5dvEODS7y84IOm67PwA=; b=Lv24yG+bhWovdaQFFblsl4rsJ5czkSuMk7RN7QJ3qU6Rx4RKlJReDBCF/oX6fJhr4So4QD XEy3PjnE6hbk5dJU0B8xi4qldtWGSerGfPPKcJXckFfrqJf306x8OFBv6pv/MtVFgIDrv9 1ity4qA84eYlu65Gf0/mfDleOZa9Xl7NSBgxWAvB1l650YxpIX29goPDP3wcSKwoeAWNR4 5iY4pX9qeUYYQGP23mbShXOg/3N6mL2sq5SL4NwBmDHaKQsL9ARwGfwxHJK2mN/UZavxBk ETlIiQbgOhfWFD5C9usnAVaAtsJO3ezVMJJkIvAGuRRtd/wcoPVQqZmfMo8RhQ== 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 4X0b4P6VTYzrYT; Fri, 6 Sep 2024 12:23:49 +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 486CNnJs078540; Fri, 6 Sep 2024 12:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CNnh9078539; Fri, 6 Sep 2024 12:23:49 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:23:49 GMT Message-Id: <202409061223.486CNnh9078539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 36a998abb0d1 - Create tag vendor/tzcode/tzcode2024b List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/tags/vendor/tzcode/tzcode2024b X-Git-Reftype: annotated tag X-Git-Commit: 36a998abb0d1367aebd86a645a438e326bdc111e Auto-Submitted: auto-generated The annotated tag vendor/tzcode/tzcode2024b has been created by des: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/tzcode/tzcode2024b tag vendor/tzcode/tzcode2024b Tagger: Dag-Erling Smørgrav TaggerDate: 2024-09-06 12:23:30 +0000 Release 2024b - 2024-09-04 12:27:47 -0700 commit e66ca70de4daf76472887efffa74a91e32b98382 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-06 12:22:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-06 12:22:49 +0000 Import tzcode 2024b From nobody Fri Sep 6 12:24:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0b4d4trrz5Ttxt for ; Fri, 06 Sep 2024 12:24: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 4X0b4d23Knz46bt; Fri, 6 Sep 2024 12:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v2iHGuv+Sg662XuGSPNcUEht82pz2o27STtdx7+47u0=; b=tFTmbami3Zw+NzpSz6gGKa1S/pJt4DakrImNFFsWfCyNc+isQQ2j97HkCJXCqv2arh8fMy aoEhua2IVGmxP/NJkwSMPjW/laSfFXs7Jpw/QcJ+3TGZ7gErTHI8zLg+//NSUtVxtOJrm5 3jVB7vJuNcsL/dN0X85ad/j0QK35zmMu755P3PsKZSjYomB1evtz7sChrK9I1VODV6B8/A Os0vBw2tGfvG3o9C1FMWlxhgVzhDfiNFlQMPy1+cbcI9bLQKzZ23cBkUJu449Lz7RkVUoP R+52bpaMc2cxoPjJ17FpRkm7EgisocCJreT+CjqTmbSWwRLmxtao8rtPY/L0zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725625441; a=rsa-sha256; cv=none; b=hG3mMwaH84SgVdeDZSu+IFUTQRAXFH+iWF7yeMzXjbamTNVeKwRkYuvOYe6Ihn2jmkCW/w AuJX0cJ2sMV7l+vYx47NbGx0UhKyZIzjiUO2vuKOnre0M3xH4Z3IDITPgLSG/Y8C0DaL7G qkm691W8YU4Xv8c/m8J9oGxW1OQG1Zc8kXPkTVByEpOaxtKrGJq20hjCO2e134Tml29OxU abbsJgocBWjV3s4R9DNIFqOJTnxH0yPMgnubAhY7us+YpOWhX4yc03w6Z0s6ZIIj58QXuK faz5sognzcMJ4kbcliqtuTvJ1Q4ItS7IsUbimiL06eESipRZZ9h357ptRWHhNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725625441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v2iHGuv+Sg662XuGSPNcUEht82pz2o27STtdx7+47u0=; b=Km9iienRY3FJ4YDxchuqR3uv/P6EiAK7nlsYUshVxv+60vhrmyhJstNhZurMwkqABLweA6 SYycb7ZTmNvZoyBgtYnWdZljf2FtvFsURpuoBaBD2eP0C29XlTxyoHLDT7PQQAk0267gi1 VXddjOtZV/+47EEtsa56vGCHItqUj4zpTNLLYFc5M5sz8/T/v7PNkJVyP8EFtFazQnLHCE VCb2nCdlFCicxWbEcsSc0jhsTJt6R767hH4QBLHvGHmdX2GOGOIFYLQtQ8Shbm0RxAuFi8 iEwZRUNyNWQJVyKqgyvahZxmt9gnQYZmOjJ0CT2XEQFSUmsQYCYEWMSsFtRYeg== 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 4X0b4d1PJHzrvw; Fri, 6 Sep 2024 12:24: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 486CO1Oq078672; Fri, 6 Sep 2024 12:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CO1A8078671; Fri, 6 Sep 2024 12:24:01 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:24:01 GMT Message-Id: <202409061224.486CO1A8078671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 378c74faf328..e66ca70de4da - vendor/tzcode - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/vendor/tzcode X-Git-Reftype: branch X-Git-Commit: e66ca70de4daf76472887efffa74a91e32b98382 X-Git-Oldrev: 378c74faf328dd07970e24ddaa2858531ff6cd08 X-Git-Newrev: e66ca70de4daf76472887efffa74a91e32b98382 Auto-Submitted: auto-generated The branch vendor/tzcode has been updated by des: URL: https://cgit.FreeBSD.org/src/log/?id=378c74faf328..e66ca70de4da e66ca70de4da Import tzcode 2024b From nobody Fri Sep 6 12:48:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0bcz3mWzz5Txpd; Fri, 06 Sep 2024 12:48: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 4X0bcz294Lz49Cv; Fri, 6 Sep 2024 12:48:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725626915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sK2URFIkOHXsi8flcX1dTapbRpmNZG1hp1ARZOi0siA=; b=MH+fhIA3FTUEgRRez8K26YOQiJtLey7SUgSfxLf7MFIDHEpjAThNQyQi541xLTp94Br24R jFayE103W1q+Z7yaqnOCuhh/SHsfejzKmMP10AmgFmh7ArbcaK+O4c5Uilps8v8HW6zxuQ hYrk1r73F+hi9IFc84yX5Lst/nYNBPgr290GwdT8hmJ77d0/AuMlE8dO7HdCeOi5afq3Bo br4CMXeRNvqQwRwQGE/60MitMFWtKq/Dd2UWbNoGwCNHsSIf/DoOOBkxNYarbwV/13g+nR dXqvRhXqSecpviczGeMUDFVPlGRjE5trDX5X9Qhk68WM5Dqf7DgsRubtUO4R7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725626915; a=rsa-sha256; cv=none; b=jzNjoFvWxtUDyIabFZzC1mhA6Dy5JIpGZGOzvAGktFktpGcOgNmlDkv+qRaKttNWjLiNhO Kz64etpU8OYCgOixHdZT/yLatzfWNDcsPN5BsDrKQTJMHCvPwSp+AWdzWHBvkKywjMH2Ot 2GER5cYK0pf8Asz2LxU4KyrbNBrtabPGp6pnfYRUAYsLDBXgwdp80YEz65Oqpg/N5JqyXB 8Lz3XJSDZ1zEHEzXPvG2x+iJBwilQ0Br6oFJ1zWyeow2rouhRVOaMyLc3plDuzKWDA+1Ef BNGhnZF0oOA4MC9IfDVMjHFL/cdVLw6y4ByfTxUQ3qvy2bXoaR3l4wq4D8OALA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725626915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sK2URFIkOHXsi8flcX1dTapbRpmNZG1hp1ARZOi0siA=; b=I3yuoy7N9iedIDzhXZFZG+D1POG68ecPttjDi6ln4Tk8IE03qp+WzT4W/J41nwTfrVlfLP zIQGLIQE3vd6JK1AbFYZH+nDI/xgOPfT0F4BaMFr03p0/6RwRyBNBF2cxQEjaZBI+1av0j Eppyc83BtH/TrIuxeaBXK24BKbpRVGf/yPDxwAOVX3Hrtt1SXKbgVJb/eB54vBslFXnDei 5XKLS80PngKx8QFVsBb/5oPlKRJ/TLI663i8y9HcsAHvGzW6JvUzogpH1tnpb3nuTzESnl i706FmwYt+HWXla/8dWv7YrhyNTul3FuhDJHBVXFiSdaPfCwRKivXxKsWs+hpA== 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 4X0bcz185nzs7F; Fri, 6 Sep 2024 12:48: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 486CmZNr013538; Fri, 6 Sep 2024 12:48:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486CmZ7g013534; Fri, 6 Sep 2024 12:48:35 GMT (envelope-from git) Date: Fri, 6 Sep 2024 12:48:35 GMT Message-Id: <202409061248.486CmZ7g013534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 390dc369efaa - main - pf: Add support for endpoint independent NAT bindings for UDP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 390dc369efaaeca2802baf168ddbd7a40e3afcc8 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=390dc369efaaeca2802baf168ddbd7a40e3afcc8 commit 390dc369efaaeca2802baf168ddbd7a40e3afcc8 Author: Tom Jones AuthorDate: 2024-09-06 11:59:09 +0000 Commit: Tom Jones CommitDate: 2024-09-06 12:48:04 +0000 pf: Add support for endpoint independent NAT bindings for UDP With Endpoint Independent NAT bindings for UDP flows from a NATed source address are always mapped to the same ip:port pair on the NAT router. This allows a client to connect to multiple external servers while appearing as the same host and enables NAT traversal without requiring the client to use a middlebox traversal protocol such as STUN or TURN. Introduce the 'endpoint-independent' option to NAT rules to allow configuration of endpoint independent without effecting existing deployments. This change satisfies REQ 1 and 3 of RFC 4787 also known as 'full cone' NAT. Using Endpoint Independent NAT changes NAT exhaustion behaviour it does not introduce any additional security considerations compared to other forms of NAT. PR: 219803 Co-authored-by: Damjan Jovanovic Co-authored-by: Naman Sood Reviewed-by: kp Sponsored-by: Tailscale Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11137 --- sbin/pfctl/parse.y | 12 ++- sbin/pfctl/pfctl_parser.c | 2 + sbin/pfctl/tests/files/pf1021.in | 1 + sbin/pfctl/tests/files/pf1021.ok | 1 + share/man/man4/pf.4 | 6 +- share/man/man5/pf.conf.5 | 12 ++- sys/net/pfvar.h | 49 +++++++++- sys/netpfil/pf/pf.c | 195 ++++++++++++++++++++++++++++++++++++++- sys/netpfil/pf/pf.h | 1 + sys/netpfil/pf/pf_lb.c | 104 +++++++++++++++++---- tests/sys/netpfil/pf/nat.sh | 134 +++++++++++++++++++++++++++ 11 files changed, 489 insertions(+), 28 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 724ffefcd7d9..f54f24a14a7c 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -326,6 +326,7 @@ static struct pool_opts { int marker; #define POM_TYPE 0x01 #define POM_STICKYADDRESS 0x02 +#define POM_ENDPI 0x04 u_int8_t opts; int type; int staticport; @@ -512,7 +513,7 @@ int parseport(char *, struct range *r, int); %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL %token DNPIPE DNQUEUE RIDENTIFIER %token LOAD RULESET_OPTIMIZATION PRIO -%token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE +%token STICKYADDRESS ENDPI MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS %token DIVERTTO DIVERTREPLY BRIDGE_TO @@ -4593,6 +4594,14 @@ pool_opt : BITMASK { pool_opts.marker |= POM_STICKYADDRESS; pool_opts.opts |= PF_POOL_STICKYADDR; } + | ENDPI { + if (pool_opts.marker & POM_ENDPI) { + yyerror("endpoint-independent cannot be redefined"); + YYERROR; + } + pool_opts.marker |= POM_ENDPI; + pool_opts.opts |= PF_POOL_ENDPI; + } | MAPEPORTSET number '/' number '/' number { if (pool_opts.mape.offset) { yyerror("map-e-portset cannot be redefined"); @@ -6299,6 +6308,7 @@ lookup(char *s) { "dnqueue", DNQUEUE}, { "drop", DROP}, { "dup-to", DUPTO}, + { "endpoint-independent", ENDPI}, { "ether", ETHER}, { "fail-policy", FAILPOLICY}, { "fairq", FAIRQ}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index e71b7b160495..a9416534626b 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -488,6 +488,8 @@ print_pool(struct pfctl_pool *pool, u_int16_t p1, u_int16_t p2, } if (pool->opts & PF_POOL_STICKYADDR) printf(" sticky-address"); + if (pool->opts & PF_POOL_ENDPI) + printf(" endpoint-independent"); if (id == PF_NAT && p1 == 0 && p2 == 0) printf(" static-port"); if (pool->mape.offset > 0) diff --git a/sbin/pfctl/tests/files/pf1021.in b/sbin/pfctl/tests/files/pf1021.in new file mode 100644 index 000000000000..841b024157c6 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1021.in @@ -0,0 +1 @@ +nat on vtnet1 inet from ! (vtnet1) to any -> (vtnet1) endpoint-independent diff --git a/sbin/pfctl/tests/files/pf1021.ok b/sbin/pfctl/tests/files/pf1021.ok new file mode 100644 index 000000000000..3b5b84e2e11b --- /dev/null +++ b/sbin/pfctl/tests/files/pf1021.ok @@ -0,0 +1 @@ +nat on vtnet1 inet from ! (vtnet1) to any -> (vtnet1) round-robin endpoint-independent diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 9bfc75cb490d..3855d07faead 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 2, 2024 +.Dd September 6, 2024 .Dt PF 4 .Os .Sh NAME @@ -89,6 +89,10 @@ Should be power of 2. Default value is 32768. .It Va net.pf.rule_tag_hashsize Size of the hash table that stores tags. +.It Va net.pf.udpendpoint_hashsize +Size of hash table that store UDP endpoint mappings. +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" diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index f04b0799741e..5aa936d509ed 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 24, 2024 +.Dd September 4, 2024 .Dt PF.CONF 5 .Os .Sh NAME @@ -2278,6 +2278,16 @@ from modifying the source port on TCP and UDP packets. With .Ar nat rules, the +.It Ar endpoint-independent +With +.Ar nat +rules, the +.Ar endpoint-independent +option caues +.Xr pf 4 +to always map connections from a UDP source address and port to the same +NAT address and port. +This feature implements "full-cone" NAT behavior. .Ar map-e-portset option enables the source port translation of MAP-E (RFC 7597) Customer Edge. In order to make the host act as a MAP-E Customer Edge, setting up a tunneling diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 7b3c1c49696a..c123da37d2cb 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -940,6 +940,29 @@ struct pf_state_peer { u_int8_t pad[1]; }; +/* Keep synced with struct pf_udp_endpoint. */ +struct pf_udp_endpoint_cmp { + struct pf_addr addr; + uint16_t port; + sa_family_t af; + uint8_t pad[1]; +}; + +struct pf_udp_endpoint { + struct pf_addr addr; + uint16_t port; + sa_family_t af; + uint8_t pad[1]; + + struct pf_udp_mapping *mapping; + LIST_ENTRY(pf_udp_endpoint) entry; +}; + +struct pf_udp_mapping { + struct pf_udp_endpoint endpoints[2]; + u_int refs; +}; + /* Keep synced with struct pf_state_key. */ struct pf_state_key_cmp { struct pf_addr addr[2]; @@ -1069,6 +1092,7 @@ struct pf_kstate { union pf_krule_ptr nat_rule; struct pf_addr rt_addr; struct pf_state_key *key[2]; /* addresses stack and wire */ + struct pf_udp_mapping *udp_mapping; struct pfi_kkif *kif; struct pfi_kkif *orig_kif; /* The real kif, even if we're a floating state (i.e. if == V_pfi_all). */ struct pfi_kkif *rt_kif; @@ -2124,17 +2148,28 @@ struct pf_idhash { struct mtx lock; }; +struct pf_udpendpointhash { + LIST_HEAD(, pf_udp_endpoint) endpoints; + /* refcont is synchronized on the source endpoint's row lock */ + struct mtx lock; +}; + extern u_long pf_ioctl_maxcount; VNET_DECLARE(u_long, pf_hashmask); #define V_pf_hashmask VNET(pf_hashmask) VNET_DECLARE(u_long, pf_srchashmask); #define V_pf_srchashmask VNET(pf_srchashmask) +VNET_DECLARE(u_long, pf_udpendpointhashmask); +#define V_pf_udpendpointhashmask VNET(pf_udpendpointhashmask) #define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) +#define PF_UDPENDHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); VNET_DECLARE(struct pf_idhash *, pf_idhash); +VNET_DECLARE(struct pf_udpendpointhash *, pf_udpendpointhash); #define V_pf_keyhash VNET(pf_keyhash) #define V_pf_idhash VNET(pf_idhash) +#define V_pf_udpendpointhash VNET(pf_udpendpointhash) VNET_DECLARE(struct pf_srchash *, pf_srchash); #define V_pf_srchash VNET(pf_srchash) @@ -2209,6 +2244,8 @@ VNET_DECLARE(uma_zone_t, pf_state_z); #define V_pf_state_z VNET(pf_state_z) VNET_DECLARE(uma_zone_t, pf_state_key_z); #define V_pf_state_key_z VNET(pf_state_key_z) +VNET_DECLARE(uma_zone_t, pf_udp_mapping_z); +#define V_pf_udp_mapping_z VNET(pf_udp_mapping_z) VNET_DECLARE(uma_zone_t, pf_state_scrub_z); #define V_pf_state_scrub_z VNET(pf_state_scrub_z) @@ -2281,6 +2318,15 @@ extern struct pf_kstate *pf_find_state_all( extern bool pf_find_state_all_exists( const struct pf_state_key_cmp *, u_int); +extern struct pf_udp_mapping *pf_udp_mapping_find(struct pf_udp_endpoint_cmp + *endpoint); +extern struct pf_udp_mapping *pf_udp_mapping_create(sa_family_t af, + struct pf_addr *src_addr, uint16_t src_port, + struct pf_addr *nat_addr, uint16_t nat_port); +extern int pf_udp_mapping_insert(struct pf_udp_mapping + *mapping); +extern void pf_udp_mapping_release(struct pf_udp_mapping + *mapping); extern struct pf_ksrc_node *pf_find_src_node(struct pf_addr *, struct pf_krule *, sa_family_t, struct pf_srchash **, bool); @@ -2574,7 +2620,8 @@ u_short pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_state_key **, struct pf_state_key **, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *, - struct pf_krule **); + struct pf_krule **, + struct pf_udp_mapping **udp_mapping); struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f7fe75184efd..70220dda935e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -283,6 +283,7 @@ VNET_DEFINE_STATIC(uma_zone_t, pf_sources_z); uma_zone_t pf_mtag_z; VNET_DEFINE(uma_zone_t, pf_state_z); VNET_DEFINE(uma_zone_t, pf_state_key_z); +VNET_DEFINE(uma_zone_t, pf_udp_mapping_z); VNET_DEFINE(struct unrhdr64, pf_stateid); @@ -330,7 +331,7 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, struct pf_state_key *, struct mbuf *, int, u_int16_t, u_int16_t, int *, struct pfi_kkif *, struct pf_kstate **, int, u_int16_t, u_int16_t, - int, struct pf_krule_slist *); + int, struct pf_krule_slist *, struct pf_udp_mapping *); static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, int, struct pf_state_key_cmp *, int, struct pf_addr *, int, struct pf_addr *, int); @@ -493,22 +494,29 @@ MALLOC_DEFINE(M_PF_RULE_ITEM, "pf_krule_item", "pf(4) rule items"); VNET_DEFINE(struct pf_keyhash *, pf_keyhash); VNET_DEFINE(struct pf_idhash *, pf_idhash); VNET_DEFINE(struct pf_srchash *, pf_srchash); +VNET_DEFINE(struct pf_udpendpointhash *, pf_udpendpointhash); +VNET_DEFINE(struct pf_udpendpointmapping *, pf_udpendpointmapping); SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "pf(4)"); VNET_DEFINE(u_long, pf_hashmask); VNET_DEFINE(u_long, pf_srchashmask); +VNET_DEFINE(u_long, pf_udpendpointhashmask); VNET_DEFINE_STATIC(u_long, pf_hashsize); #define V_pf_hashsize VNET(pf_hashsize) VNET_DEFINE_STATIC(u_long, pf_srchashsize); #define V_pf_srchashsize VNET(pf_srchashsize) +VNET_DEFINE_STATIC(u_long, pf_udpendpointhashsize); +#define V_pf_udpendpointhashsize VNET(pf_udpendpointhashsize) u_long pf_ioctl_maxcount = 65535; SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(pf_hashsize), 0, "Size of pf(4) states hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(pf_srchashsize), 0, "Size of pf(4) source nodes hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, udpendpoint_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_udpendpointhashsize), 0, "Size of pf(4) endpoint hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); @@ -699,6 +707,17 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) return (h & V_pf_srchashmask); } +static inline uint32_t +pf_hashudpendpoint(struct pf_udp_endpoint *endpoint) +{ + uint32_t h; + + h = murmur3_32_hash32((uint32_t *)endpoint, + sizeof(struct pf_udp_endpoint_cmp)/sizeof(uint32_t), + V_pf_hashseed); + return (h & V_pf_udpendpointhashmask); +} + #ifdef ALTQ static int pf_state_hash(struct pf_kstate *s) @@ -1086,12 +1105,15 @@ pf_initialize(void) struct pf_keyhash *kh; struct pf_idhash *ih; struct pf_srchash *sh; + struct pf_udpendpointhash *uh; u_int i; if (V_pf_hashsize == 0 || !powerof2(V_pf_hashsize)) V_pf_hashsize = PF_HASHSIZ; if (V_pf_srchashsize == 0 || !powerof2(V_pf_srchashsize)) V_pf_srchashsize = PF_SRCHASHSIZ; + if (V_pf_udpendpointhashsize == 0 || !powerof2(V_pf_udpendpointhashsize)) + V_pf_udpendpointhashsize = PF_UDPENDHASHSIZ; V_pf_hashseed = arc4random(); @@ -1154,6 +1176,30 @@ pf_initialize(void) for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); + + /* UDP endpoint mappings. */ + V_pf_udp_mapping_z = uma_zcreate("pf UDP mappings", + sizeof(struct pf_udp_mapping), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + V_pf_udpendpointhash = mallocarray(V_pf_udpendpointhashsize, + sizeof(struct pf_udpendpointhash), M_PFHASH, M_NOWAIT | M_ZERO); + if (V_pf_udpendpointhash == NULL) { + printf("pf: Unable to allocate memory for " + "udpendpoint_hashsize %lu.\n", V_pf_udpendpointhashsize); + + V_pf_udpendpointhashsize = PF_UDPENDHASHSIZ; + V_pf_udpendpointhash = mallocarray(V_pf_udpendpointhashsize, + sizeof(struct pf_udpendpointhash), M_PFHASH, M_WAITOK | M_ZERO); + } + + V_pf_udpendpointhashmask = V_pf_udpendpointhashsize - 1; + for (i = 0, uh = V_pf_udpendpointhash; + i <= V_pf_udpendpointhashmask; + i++, uh++) { + mtx_init(&uh->lock, "pf_udpendpointhash", NULL, + MTX_DEF | MTX_DUPOK); + } + /* ALTQ */ TAILQ_INIT(&V_pf_altqs[0]); TAILQ_INIT(&V_pf_altqs[1]); @@ -1187,10 +1233,12 @@ pf_cleanup(void) struct pf_keyhash *kh; struct pf_idhash *ih; struct pf_srchash *sh; + struct pf_udpendpointhash *uh; struct pf_send_entry *pfse, *next; u_int i; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; + i <= V_pf_hashmask; i++, kh++, ih++) { KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty", __func__)); @@ -1209,6 +1257,15 @@ pf_cleanup(void) } free(V_pf_srchash, M_PFHASH); + for (i = 0, uh = V_pf_udpendpointhash; + i <= V_pf_udpendpointhashmask; + i++, uh++) { + KASSERT(LIST_EMPTY(&uh->endpoints), + ("%s: udp endpoint hash not empty", __func__)); + mtx_destroy(&uh->lock); + } + free(V_pf_udpendpointhash, M_PFHASH); + STAILQ_FOREACH_SAFE(pfse, &V_pf_sendqueue, pfse_next, next) { m_freem(pfse->pfse_m); free(pfse, M_PFTEMP); @@ -1218,6 +1275,7 @@ pf_cleanup(void) uma_zdestroy(V_pf_sources_z); uma_zdestroy(V_pf_state_z); uma_zdestroy(V_pf_state_key_z); + uma_zdestroy(V_pf_udp_mapping_z); } static int @@ -1807,6 +1865,123 @@ pf_find_state_all_exists(const struct pf_state_key_cmp *key, u_int dir) return (false); } +struct pf_udp_mapping * +pf_udp_mapping_create(sa_family_t af, struct pf_addr *src_addr, uint16_t src_port, + struct pf_addr *nat_addr, uint16_t nat_port) +{ + struct pf_udp_mapping *mapping; + + mapping = uma_zalloc(V_pf_udp_mapping_z, M_NOWAIT | M_ZERO); + if (mapping == NULL) + return (NULL); + PF_ACPY(&mapping->endpoints[0].addr, src_addr, af); + mapping->endpoints[0].port = src_port; + mapping->endpoints[0].af = af; + mapping->endpoints[0].mapping = mapping; + PF_ACPY(&mapping->endpoints[1].addr, nat_addr, af); + mapping->endpoints[1].port = nat_port; + mapping->endpoints[1].af = af; + mapping->endpoints[1].mapping = mapping; + refcount_init(&mapping->refs, 1); + return (mapping); +} + +int +pf_udp_mapping_insert(struct pf_udp_mapping *mapping) +{ + struct pf_udpendpointhash *h0, *h1; + struct pf_udp_endpoint *endpoint; + int ret = EEXIST; + + h0 = &V_pf_udpendpointhash[pf_hashudpendpoint(&mapping->endpoints[0])]; + h1 = &V_pf_udpendpointhash[pf_hashudpendpoint(&mapping->endpoints[1])]; + if (h0 == h1) { + PF_HASHROW_LOCK(h0); + } else if (h0 < h1) { + PF_HASHROW_LOCK(h0); + PF_HASHROW_LOCK(h1); + } else { + PF_HASHROW_LOCK(h1); + PF_HASHROW_LOCK(h0); + } + + LIST_FOREACH(endpoint, &h0->endpoints, entry) { + if (bcmp(endpoint, &mapping->endpoints[0], + sizeof(struct pf_udp_endpoint_cmp)) == 0) + break; + } + if (endpoint != NULL) + goto cleanup; + LIST_FOREACH(endpoint, &h1->endpoints, entry) { + if (bcmp(endpoint, &mapping->endpoints[1], + sizeof(struct pf_udp_endpoint_cmp)) == 0) + break; + } + if (endpoint != NULL) + goto cleanup; + LIST_INSERT_HEAD(&h0->endpoints, &mapping->endpoints[0], entry); + LIST_INSERT_HEAD(&h1->endpoints, &mapping->endpoints[1], entry); + ret = 0; + +cleanup: + if (h0 != h1) { + PF_HASHROW_UNLOCK(h0); + PF_HASHROW_UNLOCK(h1); + } else { + PF_HASHROW_UNLOCK(h0); + } + return (ret); +} + +void +pf_udp_mapping_release(struct pf_udp_mapping *mapping) +{ + /* refcount is synchronized on the source endpoint's row lock */ + struct pf_udpendpointhash *h0, *h1; + + if (mapping == NULL) + return; + + h0 = &V_pf_udpendpointhash[pf_hashudpendpoint(&mapping->endpoints[0])]; + PF_HASHROW_LOCK(h0); + if (refcount_release(&mapping->refs)) { + LIST_REMOVE(&mapping->endpoints[0], entry); + PF_HASHROW_UNLOCK(h0); + h1 = &V_pf_udpendpointhash[pf_hashudpendpoint(&mapping->endpoints[1])]; + PF_HASHROW_LOCK(h1); + LIST_REMOVE(&mapping->endpoints[1], entry); + PF_HASHROW_UNLOCK(h1); + + uma_zfree(V_pf_udp_mapping_z, mapping); + } else { + PF_HASHROW_UNLOCK(h0); + } +} + + +struct pf_udp_mapping * +pf_udp_mapping_find(struct pf_udp_endpoint_cmp *key) +{ + struct pf_udpendpointhash *uh; + struct pf_udp_endpoint *endpoint; + + uh = &V_pf_udpendpointhash[pf_hashudpendpoint((struct pf_udp_endpoint*)key)]; + + PF_HASHROW_LOCK(uh); + LIST_FOREACH(endpoint, &uh->endpoints, entry) { + if (bcmp(endpoint, key, sizeof(struct pf_udp_endpoint_cmp)) == 0 && + bcmp(endpoint, &endpoint->mapping->endpoints[0], + sizeof(struct pf_udp_endpoint_cmp)) == 0) + break; + } + if (endpoint == NULL) { + PF_HASHROW_UNLOCK(uh); + return (NULL); + } + refcount_acquire(&endpoint->mapping->refs); + PF_HASHROW_UNLOCK(uh); + return (endpoint->mapping); +} /* END state table stuff */ static void @@ -2423,6 +2598,9 @@ pf_unlink_state(struct pf_kstate *s) PF_HASHROW_UNLOCK(ih); pf_detach_state(s); + + pf_udp_mapping_release(s->udp_mapping); + /* pf_state_insert() initialises refs to 2 */ return (pf_release_staten(s, 2)); } @@ -4686,6 +4864,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; struct pf_kanchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; + struct pf_udp_mapping *udp_mapping = NULL; PF_RULES_RASSERT(); @@ -4760,7 +4939,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, /* check packet for BINAT/NAT/RDR */ transerror = pf_get_translation(pd, m, off, kif, &nsn, &sk, - &nk, saddr, daddr, sport, dport, anchor_stack, &nr); + &nk, saddr, daddr, sport, dport, anchor_stack, &nr, &udp_mapping); switch (transerror) { default: /* A translation error occurred. */ @@ -5058,8 +5237,9 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, int action; action = pf_create_state(r, nr, a, pd, nsn, nk, sk, m, off, sport, dport, &rewrite, kif, sm, tag, bproto_sum, bip_sum, - hdrlen, &match_rules); + hdrlen, &match_rules, udp_mapping); if (action != PF_PASS) { + pf_udp_mapping_release(udp_mapping); if (action == PF_DROP && (r->rule_flag & PFRULE_RETURN)) pf_return(r, nr, pd, sk, off, m, th, kif, @@ -5075,6 +5255,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, uma_zfree(V_pf_state_key_z, sk); uma_zfree(V_pf_state_key_z, nk); + pf_udp_mapping_release(udp_mapping); } /* copy back packet headers if we performed NAT operations */ @@ -5102,6 +5283,8 @@ cleanup: uma_zfree(V_pf_state_key_z, sk); uma_zfree(V_pf_state_key_z, nk); + pf_udp_mapping_release(udp_mapping); + return (PF_DROP); } @@ -5111,7 +5294,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, struct pf_state_key *sk, struct mbuf *m, int off, u_int16_t sport, u_int16_t dport, int *rewrite, struct pfi_kkif *kif, struct pf_kstate **sm, int tag, u_int16_t bproto_sum, u_int16_t bip_sum, int hdrlen, - struct pf_krule_slist *match_rules) + struct pf_krule_slist *match_rules, struct pf_udp_mapping *udp_mapping) { struct pf_kstate *s = NULL; struct pf_ksrc_node *sn = NULL; @@ -5328,6 +5511,8 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, return (PF_SYNPROXY_DROP); } + s->udp_mapping = udp_mapping; + return (PF_PASS); csfailed: diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index d5ab4f03a96d..6370164cb291 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -129,6 +129,7 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, PF_ADDR_RANGE }; #define PF_POOL_TYPEMASK 0x0f #define PF_POOL_STICKYADDR 0x20 +#define PF_POOL_ENDPI 0x40 #define PF_WSCALE_FLAG 0x80 #define PF_WSCALE_MASK 0x0f diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 6b0b95e9ce01..cdd68aaf5dab 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -62,7 +62,8 @@ static struct pf_krule *pf_match_translation(struct pf_pdesc *, struct mbuf *, uint16_t, int, struct pf_kanchor_stackframe *); static int pf_get_sport(sa_family_t, uint8_t, struct pf_krule *, struct pf_addr *, uint16_t, struct pf_addr *, uint16_t, struct pf_addr *, - uint16_t *, uint16_t, uint16_t, struct pf_ksrc_node **); + uint16_t *, uint16_t, uint16_t, struct pf_ksrc_node **, + struct pf_udp_mapping **); #define mix(a,b,c) \ do { \ @@ -216,14 +217,47 @@ static int pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, struct pf_addr *saddr, uint16_t sport, struct pf_addr *daddr, uint16_t dport, struct pf_addr *naddr, uint16_t *nport, uint16_t low, - uint16_t high, struct pf_ksrc_node **sn) + uint16_t high, struct pf_ksrc_node **sn, + struct pf_udp_mapping **udp_mapping) { struct pf_state_key_cmp key; struct pf_addr init_addr; + struct pf_srchash *sh = NULL; bzero(&init_addr, sizeof(init_addr)); + + MPASS(*udp_mapping == NULL); + + /* + * If we are UDP and have an existing mapping we can get source port + * from the mapping. In this case we have to look up the src_node as + * pf_map_addr would. + */ + if (proto == IPPROTO_UDP && (r->rpool.opts & PF_POOL_ENDPI)) { + struct pf_udp_endpoint_cmp udp_source; + + bzero(&udp_source, sizeof(udp_source)); + udp_source.af = af; + PF_ACPY(&udp_source.addr, saddr, af); + udp_source.port = sport; + *udp_mapping = pf_udp_mapping_find(&udp_source); + if (*udp_mapping) { + PF_ACPY(naddr, &(*udp_mapping)->endpoints[1].addr, af); + *nport = (*udp_mapping)->endpoints[1].port; + /* Try to find a src_node as per pf_map_addr(). */ + if (*sn == NULL && r->rpool.opts & PF_POOL_STICKYADDR && + (r->rpool.opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) + *sn = pf_find_src_node(saddr, r, af, &sh, 0); + return (0); + } else { + *udp_mapping = pf_udp_mapping_create(af, saddr, sport, &init_addr, 0); + if (*udp_mapping == NULL) + return (1); + } + } + if (pf_map_addr(af, r, saddr, naddr, NULL, &init_addr, sn)) - return (1); + goto failed; if (proto == IPPROTO_ICMP) { if (*nport == htons(ICMP_ECHO)) { @@ -250,6 +284,8 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, do { PF_ACPY(&key.addr[1], naddr, key.af); + if (*udp_mapping) + PF_ACPY(&(*udp_mapping)->endpoints[1].addr, naddr, af); /* * port search; start random, step; @@ -277,8 +313,16 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, } else if (low == high) { key.port[1] = htons(low); if (!pf_find_state_all_exists(&key, PF_IN)) { - *nport = htons(low); - return (0); + if (*udp_mapping != NULL) { + (*udp_mapping)->endpoints[1].port = htons(low); + if (pf_udp_mapping_insert(*udp_mapping) == 0) { + *nport = htons(low); + return (0); + } + } else { + *nport = htons(low); + return (0); + } } } else { uint32_t tmp; @@ -293,18 +337,35 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, cut = arc4random() % (1 + high - low) + low; /* low <= cut <= high */ for (tmp = cut; tmp <= high && tmp <= 0xffff; ++tmp) { - key.port[1] = htons(tmp); - if (!pf_find_state_all_exists(&key, PF_IN)) { - *nport = htons(tmp); - return (0); + if (*udp_mapping != NULL) { + (*udp_mapping)->endpoints[1].port = htons(tmp); + if (pf_udp_mapping_insert(*udp_mapping) == 0) { + *nport = htons(tmp); + return (0); + } + } else { + key.port[1] = htons(tmp); + if (!pf_find_state_all_exists(&key, PF_IN)) { + *nport = htons(tmp); + return (0); + } } } tmp = cut; for (tmp -= 1; tmp >= low && tmp <= 0xffff; --tmp) { - key.port[1] = htons(tmp); - if (!pf_find_state_all_exists(&key, PF_IN)) { - *nport = htons(tmp); - return (0); + if (proto == IPPROTO_UDP && + (r->rpool.opts & PF_POOL_ENDPI)) { + (*udp_mapping)->endpoints[1].port = htons(tmp); + if (pf_udp_mapping_insert(*udp_mapping) == 0) { + *nport = htons(tmp); + return (0); + } + } else { + key.port[1] = htons(tmp); + if (!pf_find_state_all_exists(&key, PF_IN)) { + *nport = htons(tmp); + return (0); + } } } } @@ -326,6 +387,10 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, return (1); } } while (! PF_AEQ(&init_addr, naddr, af) ); + +failed: + uma_zfree(V_pf_udp_mapping_z, *udp_mapping); + *udp_mapping = NULL; return (1); /* none available */ } @@ -333,7 +398,7 @@ static int pf_get_mape_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, struct pf_addr *saddr, uint16_t sport, struct pf_addr *daddr, uint16_t dport, struct pf_addr *naddr, uint16_t *nport, - struct pf_ksrc_node **sn) + struct pf_ksrc_node **sn, struct pf_udp_mapping **udp_mapping) { uint16_t psmask, low, highmask; uint16_t i, ahigh, cut; @@ -353,13 +418,13 @@ pf_get_mape_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, for (i = cut; i <= ahigh; i++) { low = (i << ashift) | psmask; if (!pf_get_sport(af, proto, r, saddr, sport, daddr, dport, - naddr, nport, low, low | highmask, sn)) + naddr, nport, low, low | highmask, sn, udp_mapping)) return (0); } for (i = cut - 1; i > 0; i--) { low = (i << ashift) | psmask; if (!pf_get_sport(af, proto, r, saddr, sport, daddr, dport, - naddr, nport, low, low | highmask, sn)) + naddr, nport, low, low | highmask, sn, udp_mapping)) return (0); } return (1); @@ -597,7 +662,8 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, struct pf_state_key **skp, struct pf_state_key **nkp, struct pf_addr *saddr, struct pf_addr *daddr, uint16_t sport, uint16_t dport, struct pf_kanchor_stackframe *anchor_stack, - struct pf_krule **rp) + struct pf_krule **rp, + struct pf_udp_mapping **udp_mapping) { struct pf_krule *r = NULL; struct pf_addr *naddr; @@ -661,7 +727,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, } if (r->rpool.mape.offset > 0) { if (pf_get_mape_sport(pd->af, pd->proto, r, saddr, - sport, daddr, dport, naddr, nportp, sn)) { + sport, daddr, dport, naddr, nportp, sn, udp_mapping)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: MAP-E port allocation (%u/%u/%u)" " failed\n", @@ -672,7 +738,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, goto notrans; } } else if (pf_get_sport(pd->af, pd->proto, r, saddr, sport, - daddr, dport, naddr, nportp, low, high, sn)) { + daddr, dport, naddr, nportp, low, high, sn, udp_mapping)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation (%u-%u) failed\n", r->rpool.proxy_port[0], r->rpool.proxy_port[1])); diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index 513abfa5e040..aaa49805c772 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -112,6 +112,139 @@ nested_anchor_body() } +atf_test_case "endpoint_independent" "cleanup" +endpoint_independent_head() +{ + atf_set descr 'Test that a client behind NAT gets the same external IP:port for different servers' + atf_set require.user root +} + +endpoint_independent_body() +{ + pft_init + filter="udp and dst port 1234" # only capture udp pings + + epair_client=$(vnet_mkepair) + epair_nat=$(vnet_mkepair) + epair_server1=$(vnet_mkepair) + epair_server2=$(vnet_mkepair) + bridge=$(vnet_mkbridge) + + vnet_mkjail nat ${epair_client}b ${epair_nat}a + vnet_mkjail client ${epair_client}a + vnet_mkjail server1 ${epair_server1}a + vnet_mkjail server2 ${epair_server2}a + + ifconfig ${epair_server1}b up + ifconfig ${epair_server2}b up + ifconfig ${epair_nat}b up + ifconfig ${bridge} \ + addm ${epair_server1}b \ + addm ${epair_server2}b \ + addm ${epair_nat}b \ + up + + jexec nat ifconfig ${epair_client}b 192.0.2.1/24 up + jexec nat ifconfig ${epair_nat}a 198.51.100.42/24 up + jexec nat sysctl net.inet.ip.forwarding=1 + + jexec client ifconfig ${epair_client}a 192.0.2.2/24 up + jexec client route add default 192.0.2.1 + + jexec server1 ifconfig ${epair_server1}a 198.51.100.32/24 up + jexec server2 ifconfig ${epair_server2}a 198.51.100.22/24 up + + # Enable pf! + jexec nat pfctl -e + + # validate non-endpoint independent nat rule behaviour + pft_set_rules nat \ + "nat on ${epair_nat}a inet from ! (${epair_nat}a) to any -> (${epair_nat}a)" + + jexec server1 tcpdump -i ${epair_server1}a -w ${PWD}/server1.pcap \ + --immediate-mode $filter & + server1tcppid="$!" + jexec server2 tcpdump -i ${epair_server2}a -w ${PWD}/server2.pcap \ + --immediate-mode $filter & + server2tcppid="$!" + + # send out multiple packets + for i in $(seq 1 10); do + echo "ping" | jexec client nc -u 198.51.100.32 1234 -p 4242 -w 0 + echo "ping" | jexec client nc -u 198.51.100.22 1234 -p 4242 -w 0 + done + + kill $server1tcppid + kill $server2tcppid + + tuple_server1=$(tcpdump -r ${PWD}/server1.pcap | awk '{addr=$3} END {print addr}') + tuple_server2=$(tcpdump -r ${PWD}/server2.pcap | awk '{addr=$3} END {print addr}') + + if [ -z $tuple_server1 ] + then + atf_fail "server1 did not receive connection from client (default)" + fi + + if [ -z $tuple_server2 ] + then + atf_fail "server2 did not receive connection from client (default)" + fi + + if [ "$tuple_server1" = "$tuple_server2" ] + then + echo "server1 tcpdump: $tuple_server1" + echo "server2 tcpdump: $tuple_server2" + atf_fail "Received same IP:port on server1 and server2 (default)" + fi + + # validate endpoint independent nat rule behaviour + pft_set_rules nat \ + "nat on ${epair_nat}a inet from ! (${epair_nat}a) to any -> (${epair_nat}a) endpoint-independent" + + jexec server1 tcpdump -i ${epair_server1}a -w ${PWD}/server1.pcap \ + --immediate-mode $filter & + server1tcppid="$!" + jexec server2 tcpdump -i ${epair_server2}a -w ${PWD}/server2.pcap \ + --immediate-mode $filter & + server2tcppid="$!" + + # send out multiple packets, sometimes one fails to go through + for i in $(seq 1 10); do + echo "ping" | jexec client nc -u 198.51.100.32 1234 -p 4242 -w 0 + echo "ping" | jexec client nc -u 198.51.100.22 1234 -p 4242 -w 0 + done + + kill $server1tcppid + kill $server2tcppid + + tuple_server1=$(tcpdump -r ${PWD}/server1.pcap | awk '{addr=$3} END {print addr}') + tuple_server2=$(tcpdump -r ${PWD}/server2.pcap | awk '{addr=$3} END {print addr}') + + if [ -z $tuple_server1 ] + then + atf_fail "server1 did not receive connection from client (endpoint-independent)" + fi + + if [ -z $tuple_server2 ] + then + atf_fail "server2 did not receive connection from client (endpoint-independent)" + fi + + if [ ! "$tuple_server1" = "$tuple_server2" ] + then + echo "server1 tcpdump: $tuple_server1" + echo "server2 tcpdump: $tuple_server2" + atf_fail "Received different IP:port on server1 than server2 (endpoint-independent)" + fi +} + +endpoint_independent_cleanup() +{ + pft_cleanup + rm -f server1.out + rm -f server2.out +} + nested_anchor_cleanup() *** 8 LINES SKIPPED *** From nobody Fri Sep 6 13:10:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0c5z1C8Zz5V1mk; Fri, 06 Sep 2024 13:10: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 4X0c5y6JJRz4DdG; Fri, 6 Sep 2024 13:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725628214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MAznI8AUkiihIE9xKEynlulGfyIigZBVQjlew8p+seo=; b=gDL1SjW+D6ABR491US7zPPGbEZkxbzFHLByQgJ1vKWa4FahtPxFrkBffetDTidmdHWY4sk hF/CAsJPxPDbHi08r+S3jW6/Keo9EL7HYVPVQ2h/9ilqbIYpQah1V8+w15KpnWcsc7ku9R nRzJ5e3/YPGSGA5j4bdVYmou7/AC9RS0bz/QwaaV0I3qBN9X/mlGHttGLOgyDVZlQf66mH q65Km25lQe5X0WeOdDgdCW09D108OohtI0LQC7Q+FqLlbOXR113UVXdsvN9yOZH3Puqh5c Xo8bsRUE20hNTBqqdz58X9kGP6ajl9jiS+758GnItruTC9FhUMSh5QcW0MY2Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725628214; a=rsa-sha256; cv=none; b=hMnjzGzS2nzO1ZTip57iRucCLNxshNJ5OH9W2dTKKdB1nHVrMUuKBW8BvRX/BANnoDF/NK KMNgRW7KsV1nd09HAkxqMUw2fRZeulRD19ZqegNiW6tclLsCpL6Jb2sijkkj4RZJMydBkn 5GlHhcxvLEr7B4gopViDLPqLLyqvdCqnH3L6vuSBkukv4dHm2x7VbOT3FFTKWGpekyBR56 R7Er9Z39Ypj6vnsOAhMBEheZA1twGgVdC/5O6N4KHPd0JCOaaL1jT0YSH+CfsBmDoXFzIx 2KN35d9A7FnONsnAO+rlI+ai7SwQaxo1rNdgGIsaIyRk0xgI7uiRPAs+gbbbIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725628214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MAznI8AUkiihIE9xKEynlulGfyIigZBVQjlew8p+seo=; b=Lcghg3/bWHUsl/P1vEf+4ryYXK7LdTtK3XNqjqUp1j+enDkzbDtFFQebvqiz3tp5vTc9Ay h9wgcvX9jKSX8NxWuKmROfVTksHFfb0PsobI20vpC646AdH7C/5aWX18ZCe2zu6iy7UzxA 7TYAXbiQ+c/c9rwbdQm9B3CghTraxpraJ4MKXEKP9je2BL+0AeXgJ35G9WQwqoCeqI05K7 HXOnOtNKrD4qq/a9/LLu15IRO1w8bNUtBTT/3VO9V2w8bC+PAM6NDK8iBvbSIxLpMNkdaW OLHv54A6FfaLSH2l5YrnL61M8nvW01ti5l2QpF9XZq8dY3AabkiDOB0Lk//lwA== 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 4X0c5y4VHWzsvF; Fri, 6 Sep 2024 13:10: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 486DAEFM054830; Fri, 6 Sep 2024 13:10:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486DAEVI054821; Fri, 6 Sep 2024 13:10:14 GMT (envelope-from git) Date: Fri, 6 Sep 2024 13:10:14 GMT Message-Id: <202409061310.486DAEVI054821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: e1b1984abb8b - main - pfctl: Add endpoint-independent test to the list of tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1b1984abb8b673d43082660a5ae740741f85df6 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=e1b1984abb8b673d43082660a5ae740741f85df6 commit e1b1984abb8b673d43082660a5ae740741f85df6 Author: Tom Jones AuthorDate: 2024-09-06 13:06:57 +0000 Commit: Tom Jones CommitDate: 2024-09-06 13:09:12 +0000 pfctl: Add endpoint-independent test to the list of tests Reviewed by: kp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46563 --- sbin/pfctl/tests/pfctl_test_list.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 5d1717200759..1fd31de6ccc4 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -129,3 +129,4 @@ PFCTL_TEST(1017, "Ethernet rule with ridentifier and several labels") PFCTL_TEST(1018, "Test dynamic address mask") PFCTL_TEST(1019, "Test pflow option") PFCTL_TEST(1020, "Test hashmark and semicolon comment") +PFCTL_TEST(1021, "Endpoint-independent") From nobody Fri Sep 6 13:37:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0cjk4fwGz5V5JD; Fri, 06 Sep 2024 13:37:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0cjk3qd1z4LZq; Fri, 6 Sep 2024 13:37:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725629866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WWZLIk1g7myBak7I+MFgeirzlFapyisQo35LipsvT/c=; b=ACgy+kA2rCz7jcfRxVz2FJuJaBEFTkRlBx+M2MUpQ6OxFjd+zJMMw+SFUVTL+fUxEtsdhe XQw7CvVKCrKHGvyXqIxhAs5wTJ6TIZUJSdzRypBfyigOHrJylkf/TUQ1HBhaSZcwuW93ex 0Z9b/zQjRjRULhaHYyD7XLXFqv0xkXPlWP1Rpra/PPz04jIBHnj8MJ0NclX4M/opkbSZC2 8Shh/M+r+Rd7JmrRGAfXKJ405ZZNpnk+gJrOB8pT8TcI21bDpV5cbDB2jpd2JStuDA2efF 4apw6a8Hst16Dnqy6Rqdsm3pAN7Zi+LJIfdthEatMn6uiy51LoG6lt4kfdPnWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725629866; a=rsa-sha256; cv=none; b=v6Y8N3JArTxkfx7ZkKPzJpwdwHyy/uXMg56Jw2j7fVjKyy0pZXr4/U1H94LOkzSlPqEwr0 cG9aie55+f/w+SZtM2Gh6crUdNVS77JuBbBF1HZapFKs9atEiAoYCblJqSBN3SLyhP5e3X KFQRHeB/AFLnuRkcN/V0pgn0+3R8j8wJYFGAOfZLGUK3b5W+DrvguEAhSN+qZUnprS9sB3 ZH2F7homJNFLs3ZHyQ0J6ZJLOuv8zCv1Kb5kKmtKihwVX7BQFK5Rn2A26lz+SeztqlKAdd g9wlYM6xepxF+ZYm6BG3zvZx3qNGroo00e8Uu4vsuLZRRQsxFViuu/3LjcHGaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725629866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WWZLIk1g7myBak7I+MFgeirzlFapyisQo35LipsvT/c=; b=CnWP6twhVyDBh32bkOStTRzITl4leiOVNtjigbZyOv7A4dR/zHgfGBZvj0mgG1sPTc4YI+ EkQADodDviZJQD/17wTf2doido8Sk4ZXfVLGZDOhaHCACGUzg2GTJ3WS6mSPusYGSeadvW fyfJAUWTx4iHHyBFZupVA/RFk5e+4lHion7KQ4fhEdGfcIalB5NMplTgSTSvChiRomC6xU 476oyS+l3dj0AtWHx7HTez2ErWzLllfFKKHNgPesPur/kruLaXoThDCglgyBoxJf8qY0WK 8hbMmkXPk645fV4sSjV1bzq1C9hIInQNBbhM8K/iJgPTmGCZQ5vzXD17ucsyDg== Received: from [IPV6:2601:5c0:4200:b830:e193:7c94:7b53:48b7] (unknown [IPv6:2601:5c0:4200:b830:e193:7c94:7b53:48b7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X0cjk1hN6zPrW; Fri, 6 Sep 2024 13:37:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <7213e551-6be2-44b1-a8b6-55645c593c12@FreeBSD.org> Date: Fri, 6 Sep 2024 09:37:45 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: e962b37bf0ff - main - bhyve: Do not enable PCI BAR decoding if a boot ROM is present Content-Language: en-US To: Shawn Webb , Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/5/24 22:10, Shawn Webb wrote: > Hey Mark, > > This commit seems to force me to now pass "-o pci.enable_bars=true" to > all my VMs on amd64. I wonder if that might be a POLA violation. I > didn't realize that I needed to set that until I bisected the src > tree, looking for the commit that broke bhyve for me. > > Is changing the default here really worth it for amd64? If so, I'm > thinking this should be in both RELNOTES and UPDATING. I now have to > propigate re-enabling this across my entire infrastructure. > > Thanks, That should only be true if you are using an older UEFI firmware that did not program BARs. Are you seeing this on stock FreeBSD, and which version of the UEFI ROM are you using? -- John Baldwin From nobody Fri Sep 6 15:12:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0fqP1QL5z5VJ1Q; Fri, 06 Sep 2024 15:12:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0fqN2wCgz4hrc; Fri, 6 Sep 2024 15:12:48 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-7a8130906faso142766985a.0; Fri, 06 Sep 2024 08:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725635567; x=1726240367; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=DXkjWK+M3EPZbadBK2bxnwETRVFmR4n4/ybsGNia/5c=; b=jkL1kcP31y3+jZWWz2C54bNAsh2Bm+ttHpIFPoMzu9a2o9NTCbxv0wMti1hacxyj6J Ha5NexAPa5DpN4m7Md7Ll0rZ/Ffu/UPTuBypgD5SMemQKJVd5VCxeR/L1hwCkJaxsTkB 41idb7GExH78xY6QiJ5/cgodBDgTSJfVhGLwcyE5OILW8rshhr1KizikcybjjqHsw5X6 /DQXKaMXX2UK5h+bg9LhvGNx+BLlls7cm6BbL4Wt5E889rnm266PCM7xxC1+llacGgFm asnKiaJmLKtLlrtBJZZfQxE4jDACe3zjYPRTVpDpKdBuh/eA4GesgU9wWN+CG1eJZAmS Cp8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725635567; x=1726240367; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DXkjWK+M3EPZbadBK2bxnwETRVFmR4n4/ybsGNia/5c=; b=dIEsG1pX85vkoXxS+JQcZme1fReEERaFsOB3d5+eD+KW1QXHKlin/iYEJ3FcS/VoEC IZtCh20WjAPmDhXNZBgzhQQf0cA2kz+HC0c5We57VpxSIlPOFXeggRK6rprOcviu7yER Q6LyqSW0vwdpQnGZSQCt63rkgDwUyFcwTF75kwo7yQHfz6jEpqQa6R02j7KDWaOKgoAa 5Opng9psf2zyX9aEirCCvm2dA3nAOPQGgxEdQD2weK0PRB/gCxGtrVcIs3Niq/aCArZg jOclGD3tpGKoJjoDV9LAAt/0uYV9clSve9Hjqn+7Jpgh0sh/VbuvCf1Tf88diPnZvi+B yymg== X-Forwarded-Encrypted: i=1; AJvYcCUQXwEmSCI9tySz0TYy9nkHuau4Ucz1mbbPYAf4+7VIUF51lR0vdXs/RqP0+iRS45Sndpq1yIyW1NcxKGPitSo=@freebsd.org, AJvYcCVtkYR/rcShsiLpAVR+Rlx09nI+NcrHIbd2XQ8IHH+U44yTDMPDSH0HhbRoTy0fnGubMsT03J6pfSb3Ax05/S8OraXN@freebsd.org, AJvYcCX1M71ituJoTskp2Iedhp/3k49Jqirlss1+U8tRppEna6vL1MO0OG1wTv2EIYKYZvgVvoue3CIIIN7Oz++YDMUs1Vwb8Ho=@freebsd.org X-Gm-Message-State: AOJu0YyiluLvT4Lv5iwFp3bvAijY2OqTFMA5z/97fEzBnGId6+NLLcYI 2DQ2HiB/PANWDzIiARunkgHolJXsoukqGGe9Uormj5WDDllGDnVR6hIvEg== X-Google-Smtp-Source: AGHT+IHgv4pTqWtjeao71Zi5QF90DaQqSyetH0r+P5UFTqYWHhRZwsdo/0qzWbJb2wbfQ8A5tEZacw== X-Received: by 2002:a05:6214:2b9d:b0:6c5:de4:3edb with SMTP id 6a1803df08f44-6c5284f61c9mr31357606d6.29.1725635566509; Fri, 06 Sep 2024 08:12:46 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5202de4b2sm17372836d6.58.2024.09.06.08.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 08:12:45 -0700 (PDT) Date: Fri, 6 Sep 2024 11:12:43 -0400 From: Mark Johnston To: John Baldwin Cc: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e962b37bf0ff - main - bhyve: Do not enable PCI BAR decoding if a boot ROM is present Message-ID: References: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> <7213e551-6be2-44b1-a8b6-55645c593c12@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7213e551-6be2-44b1-a8b6-55645c593c12@FreeBSD.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X0fqN2wCgz4hrc On Fri, Sep 06, 2024 at 09:37:45AM -0400, John Baldwin wrote: > On 9/5/24 22:10, Shawn Webb wrote: > > Hey Mark, > > > > This commit seems to force me to now pass "-o pci.enable_bars=true" to > > all my VMs on amd64. I wonder if that might be a POLA violation. I > > didn't realize that I needed to set that until I bisected the src > > tree, looking for the commit that broke bhyve for me. > > > > Is changing the default here really worth it for amd64? If so, I'm > > thinking this should be in both RELNOTES and UPDATING. I now have to > > propigate re-enabling this across my entire infrastructure. > > > > Thanks, > > That should only be true if you are using an older UEFI firmware that did > not program BARs. Are you seeing this on stock FreeBSD, and which version > of the UEFI ROM are you using? Indeed, it'd be nice to see which bootcode and guest you're using. I had tested bhyveload, edk2-bhyve and grub2-bhyve with this change without problems, and wasn't planning to MFC. My hope was that this wouldn't have any user-visible impact on amd64, but if that's not the case, the default for pci.enable_bars may have to be flipped on amd64. From nobody Fri Sep 6 15:25:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0g5V1VHHz5VKTY; Fri, 06 Sep 2024 15:25: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 4X0g5V12vVz4kB5; Fri, 6 Sep 2024 15:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725636302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r4UkmLsLKzRT6KDH3fGop08kF/rPq+007PNEtrX/SEk=; b=PVRHjgF1A3YQ68V3gk/I5fU1wIQOWDrfYvnyD4kWZZ590wvjNjjjbPK6Qs6zFHF8DBHV7g ZC5GL7o3pp0pcqsqAEktL1cFGKPWKE5CKOA31tn94F9520qVhnHcUfewoXcdNwDdro/8G4 9IjvkF4gYBUxqpj04xx5i4tMrjODXOOvdQnWxpnShMUAVb0muKo+XmjUTFoDoHY7VAgVD4 fsLIE2BjOqg29yQNMYcOW9ZM7bZergDrrHpwTrWDsA7Pld8CbxTrPcrKiFNI/ZBrmbdpwO cLMQxLtlubHob7+EG4an466HxTN30gofS6efxuGOu6L9b/sFmJZjcaBDjcRkBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725636302; a=rsa-sha256; cv=none; b=WDpygHKLNGlvSpKEpFQ6d4s1lKXgUFT/y/eQqsKtlC3JV65BO2JmHEoDWAE1g2KYLSznAw EEHZN9gZsmTWgqt7gIFjc27OryRjECo7+iQs01Ml6RBP9uCuwA+2RjicGoGt9nmqjmJ1KC pAufMi61wCkXmUGuhaslAoLWfrA8PsxILr7XwUdphPvIfgLjYJlNYxwPxEXJWruhpZSBdk H1u3jU3YFR9ehB0CFvBBsMRl6G3ne4XBqQgoUUUPjl6WvwZ6A6Jjylu1rfwViMeT1N5EmA 4Wp9ubc+GFOYEvKQ7YVpb7Yuv0sFOJug+0EFlZaMW5ptr9+AO9c1QwtXX7Kl5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725636302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r4UkmLsLKzRT6KDH3fGop08kF/rPq+007PNEtrX/SEk=; b=h4ud5HLZ+w4DrV0NdvSOaK6/dhKXo+2I47qeXRg17kj2NvajFTRrP/LkoK96QMyEMPx/94 kquvwdiHuKJsvuiye2tUcvnAQNn0LnB7hbHYVLaG+FfRfHUieOq0G1cO3ZiM0Ntth49gcc w0D6ZHM0kdRTXSatVYh53tlSRwRsmKAcqcJMU93eH2QvOzEpAmvyldZklP7b0ZMocesRj9 T3Yl9/ofNbiPLSWIzW4ITGLhwj87YcgQ8Y3OuLMFCU52NGfP4xaa43ZM/MZh+zF9jWBMuo b/NaGo2QQz4Ac6hJaxhn6oWThmYdnEY+W7RX9fxTUQWpfZgZaVfdL/B3Er1Fkg== 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 4X0g5V0LH2zxCk; Fri, 6 Sep 2024 15:25: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 486FP1X0085931; Fri, 6 Sep 2024 15:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486FP1jZ085928; Fri, 6 Sep 2024 15:25:01 GMT (envelope-from git) Date: Fri, 6 Sep 2024 15:25:01 GMT Message-Id: <202409061525.486FP1jZ085928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: bb2d016afb00 - main - flua: make the ucl module a dynamic module List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb2d016afb009920f4bb2400c15a86e557b2d55a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=bb2d016afb009920f4bb2400c15a86e557b2d55a commit bb2d016afb009920f4bb2400c15a86e557b2d55a Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:13:08 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-06 15:21:29 +0000 flua: make the ucl module a dynamic module Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46569 --- lib/flua/Makefile | 1 + lib/flua/libucl/Makefile | 17 +++++++++++++++++ libexec/flua/Makefile | 8 +------- libexec/flua/linit_flua.c | 2 -- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/flua/Makefile b/lib/flua/Makefile index 769736039f7e..168d05f54674 100644 --- a/lib/flua/Makefile +++ b/lib/flua/Makefile @@ -1,4 +1,5 @@ SUBDIR+= libhash SUBDIR+= libjail +SUBDIR+= libucl .include diff --git a/lib/flua/libucl/Makefile b/lib/flua/libucl/Makefile new file mode 100644 index 000000000000..7d2681b85fcb --- /dev/null +++ b/lib/flua/libucl/Makefile @@ -0,0 +1,17 @@ +SHLIB_NAME= ucl.so +SHLIBDIR= ${LIBDIR}/flua + +WARNS= 2 + +UCLSRC?= ${SRCTOP}/contrib/libucl +.PATH: ${UCLSRC}/lua +SRCS+= lua_ucl.c +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua \ + -I${UCLSRC}/include \ + -I${UCLSRC}/src \ + -I${UCLSRC}/uthash +LIBADD+= ucl + +.include diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile index e324ca993711..c8206b94769d 100644 --- a/libexec/flua/Makefile +++ b/libexec/flua/Makefile @@ -4,7 +4,7 @@ LUASRC?= ${SRCTOP}/contrib/lua/src .PATH: ${LUASRC} PROG= flua -WARNS?= 2 +WARNS?= 3 MAN= # No manpage; this is internal. CWARNFLAGS.gcc+= -Wno-format-nonliteral @@ -31,10 +31,4 @@ LIBADD+= edit LDFLAGS+= -Wl,-E .endif -UCLSRC?= ${SRCTOP}/contrib/libucl -.PATH: ${UCLSRC}/lua -SRCS+= lua_ucl.c -CFLAGS+= -I${UCLSRC}/include -I${UCLSRC}/src -I${UCLSRC}/uthash -LIBADD+= ucl - .include diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 1b7d83016cfe..4635970d1fd7 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -36,7 +36,6 @@ #include "lfs.h" #include "lposix.h" #include "lfbsd.h" -#include "lua_ucl.h" /* ** these libs are loaded by lua.c and are readily available to any Lua @@ -61,7 +60,6 @@ static const luaL_Reg loadedlibs[] = { {"posix.sys.stat", luaopen_posix_sys_stat}, {"posix.sys.utsname", luaopen_posix_sys_utsname}, {"posix.unistd", luaopen_posix_unistd}, - {"ucl", luaopen_ucl}, {"fbsd", luaopen_fbsd}, {NULL, NULL} }; From nobody Fri Sep 6 15:29:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0gBM0X7Sz5VKvH; Fri, 06 Sep 2024 15:29: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 4X0gBL6nRpz4kr9; Fri, 6 Sep 2024 15:29:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725636555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9UQBAlxnkRka7XcsBQcA/yG9dpuB9LyGzO59cx7WFDM=; b=e1HLaInIdEQMCxK2SBM3MpK/ogwce77Y7MBdWpwdaEJpPdR9gr9MK0NQ+qeYeWz2P0LyuH QB8DwfuIBvPail0WltIHJChwpwPAcBiQ0+fqgq8/Q6s7JD1T72Q42f+bMfsAGNfZDvgaCl kLns5qEKN4HOOqWzKDo8tRai7YHR53s579MZS0SMZ7/atn6XT2jXITiwHmFPVtsUQuZj0u CJ7kKQT69nTf6ZJOWnxhM7cmorMGoUFQpiNwF8o6Hz+n7l97kyV6zc2vcU9apH8qTwvxYo xPcbH2DUQG9J7pKhFVXEpuVxopFfGw6Qvp4cKCX+iNmiSJyKF9mMGbTqiXwTmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725636555; a=rsa-sha256; cv=none; b=TFUA0DrRt4CSacPU6NQbPRHN4LhfD6OpNYwVuFQkkgxKJAvMYRwA+PF4pIVXEybXRTFUYB k2iLhTI8dLg09bWxgsgCglzCUs02wW1BtQ/4hqUJQ0B/NWNl2rvMIIJcJ1s1SO5T2PFPA5 xRkp0QSZUGiLaLe1GiBAu7ABdCAHyM7McyeUpRAGLMcJKoP1c6nYwc6GjUZ17MWutZ4cHz JjgNvWDSpRIwx6GyxAILRxJwEX5HkmCz7T8TEThOqH1NiapWHuKf9qEwa2tjwco0j9tlJP R5Syi/4fRHvk446wA6o4jM3ZbqiA6yXrcKb1GTNMdX2IQ6Dlnze8VgQCjftOgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725636555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9UQBAlxnkRka7XcsBQcA/yG9dpuB9LyGzO59cx7WFDM=; b=SCoK49O5fcl6++nlFYKbHNeKot8O3+WyBpIaxu498Q+m96Zkoy42Hcfli1sfdiv4TAp4xd o8MSMxfCm5D9rqYvYcd72e6s2lTnLDpS4tb6eOKz+4UQfdho0B1oe+z6n3ilzbgwRDhCBI mvT1v3WGRejY9Wh24hulCGWpjw+acnT7mUYuVTxl2KUyOubz5N02yb1Echqm6zoOcXm4nu j14mwSFMTGxPZL7ScuYQ3lD4fuR9NnUw80pndfFez702CFQNH30ZUxR0olMqoZrKUqfVmz bI+Lwh+KJbDgZviyzUGsS3Qef2K4MUEKmrMisAj/ijJRA6JiavC/dPg3yT57RQ== 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 4X0gBL6MJnzxM4; Fri, 6 Sep 2024 15:29: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 486FTEon086696; Fri, 6 Sep 2024 15:29:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486FTEOa086693; Fri, 6 Sep 2024 15:29:14 GMT (envelope-from git) Date: Fri, 6 Sep 2024 15:29:14 GMT Message-Id: <202409061529.486FTEOa086693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: de1d7d7b87cf - main - flua: add freebsd module implementing kldload/kldunload List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de1d7d7b87cfa31a1d6c7bcf1acd27de8139cab3 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=de1d7d7b87cfa31a1d6c7bcf1acd27de8139cab3 commit de1d7d7b87cfa31a1d6c7bcf1acd27de8139cab3 Author: Baptiste Daroussin AuthorDate: 2024-09-06 09:00:50 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-06 15:25:54 +0000 flua: add freebsd module implementing kldload/kldunload Reviewed by: markj, imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D46558 --- etc/mtree/BSD.usr.dist | 4 + lib/flua/libfreebsd/Makefile | 3 + lib/flua/libfreebsd/sys/Makefile | 4 + lib/flua/libfreebsd/sys/linker/Makefile | 12 +++ .../libfreebsd/sys/linker/freebsd.sys.linker.3lua | 67 +++++++++++++ .../libfreebsd/sys/linker/lua_freebsd_sys_linker.c | 104 +++++++++++++++++++++ 6 files changed, 194 insertions(+) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 13541aac1dd4..60d458f5d336 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -74,6 +74,10 @@ engines-3 .. flua + freebsd + sys + .. + .. .. i18n .. diff --git a/lib/flua/libfreebsd/Makefile b/lib/flua/libfreebsd/Makefile new file mode 100644 index 000000000000..6ed0451055ff --- /dev/null +++ b/lib/flua/libfreebsd/Makefile @@ -0,0 +1,3 @@ +SUBDIR+= sys + +.include diff --git a/lib/flua/libfreebsd/sys/Makefile b/lib/flua/libfreebsd/sys/Makefile new file mode 100644 index 000000000000..9f38294536f2 --- /dev/null +++ b/lib/flua/libfreebsd/sys/Makefile @@ -0,0 +1,4 @@ +SUBDIR+= linker + +.include + diff --git a/lib/flua/libfreebsd/sys/linker/Makefile b/lib/flua/libfreebsd/sys/linker/Makefile new file mode 100644 index 000000000000..318cc5078b33 --- /dev/null +++ b/lib/flua/libfreebsd/sys/linker/Makefile @@ -0,0 +1,12 @@ +SHLIB_NAME= linker.so +SHLIBDIR= ${LIBDIR}/flua/freebsd/sys + +SRCS+= lua_freebsd_sys_linker.c + +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua \ + +MAN= freebsd.sys.linker.3lua + +.include diff --git a/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua b/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua new file mode 100644 index 000000000000..0ab8f185388a --- /dev/null +++ b/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua @@ -0,0 +1,67 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024, Baptiste Daroussin +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 6, 2024 +.Dt FREEBSD.SYS.LINKER 3lua +.Os +.Sh NAME +.Nm freebsd.sys.linker +.Nd Lua binding to +.Fx 's +Linker functions +.Sh SYNOPSIS +.Bd -literal +local linker = require('freebsd.sys.linker') +.Ed +.Pp +.Bl -tag -width XXXX -compact +.It Dv fileid, err, errno = linker.kldload(name) +.It Dv ok, err, errno = linker.kldunload(fileid|name) +.El +.Sh DESCRIPTION +The +.Nm +module is a binding to the +.Fx 's +linker functions. +List of functions: +.Bl -tag -width XXXX +.It Dv fileid, err = freebsd.sys.linker.kldload(name) +Load the kernel module named +.Fa name +and return the identifier +.Pq fileid +as an interger. +.It Dv ok, err, errno = freebsd.sys.linker.kldunload(fileid|name) +Unload the kernel module identifier either by +.Fa name +as a string, or +.Fa fileid +as an integer. +.El +.Sh SEE ALSO +.Xr kldload 2 , +.Xr kldunload 2 diff --git a/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c b/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c new file mode 100644 index 000000000000..a2dc3b487525 --- /dev/null +++ b/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c @@ -0,0 +1,104 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024, Baptiste Daroussin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include + +#include +#include +#include + +#include +#include +#include + +int luaopen_freebsd_sys_linker(lua_State *L); + +static int +lua_kldload(lua_State *L) +{ + const char *name; + int ret; + + name = luaL_checkstring(L, 1); + ret = kldload(name); + if (ret == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + lua_pushinteger(L, ret); + return (1); +} + +static int +lua_kldunload(lua_State *L) +{ + const char *name; + int ret, fileid; + + if (lua_isinteger(L, 1)) { + fileid = lua_tointeger(L, 1); + } else { + name = luaL_checkstring(L, 1); + fileid = kldfind(name); + } + if (fileid == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + ret = kldunload(fileid); + lua_pushinteger(L, ret); + if (ret == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + lua_pushinteger(L, 0); + return (1); +} + +#define REG_SIMPLE(n) { #n, lua_ ## n } +static const struct luaL_Reg freebsd_sys_linker[] = { + REG_SIMPLE(kldload), + REG_SIMPLE(kldunload), + { NULL, NULL }, +}; +#undef REG_SIMPLE + +int +luaopen_freebsd_sys_linker(lua_State *L) +{ + luaL_newlib(L, freebsd_sys_linker); + + return (1); +} From nobody Fri Sep 6 15:38:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0gPY3Ssnz5VLn0; Fri, 06 Sep 2024 15:38: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 4X0gPY2lcrz4m0q; Fri, 6 Sep 2024 15:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725637137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xu00gblXCUssUxS/6Ur4hr1qgzZImfzVuYMy+kAAvV4=; b=eGzT0aiojy+aApzgVJnIHI2AEBSZw2oiFYu7+MDkSVyNqMLbRjk/obHvFugho3IrErdOx9 RBH6jWvyRs33GfkeG/7/g1L/oNAe4hO0VvYqk1UpOTE66nfsef06xMfsjPX0RDOIaHq6Nr lctaaQoY/GqAxWTEcnFLG4VMPjjkEAGXF1V++q2Qcec3gl26A2thPZ63oVYFya3FblXGAI k6gsUYxYkQUQWYW6ks8fhkbKmNt+MCCdX7vzbO2KIVkSzjRXzi4WZclqpznGKbKvrL34ds lQn5RpZe6/ClqKCXlDU4Qa0qfYlG7kKSfRsdK4eTlGE99c0f6idRZceqBNYBMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725637137; a=rsa-sha256; cv=none; b=lUtcPCWYBlumwbbWMLcKVkd3EU0KgMZlNN0rHgp3bboaDnW4K4PanjWHJwIYiIVHhwd0iS SUMmuKG/BzXfnLBHwIF3nI4RYd0w7hBZAnltAyDjrMLq/n3RbYfBlvRP+k+G/fl/vTGDJ+ sAxCMPGDery9tczrDuG+qF7/5xSnohQ6bJwz40TQXeg8lAtrMKrlk0hhLTnNektqXX2COh rsw47NCVMDIt8NYYO/y4ZcAAgbYpee4/Jx5+ooaIWlFUGW7qPTCKBks3CmrwnCgmL0zOHt IY5kn9RRNGwuWax8YaHplITrJ9iZdnrWzcmDpbXuRll9H050rRe5hBENBVCwrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725637137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xu00gblXCUssUxS/6Ur4hr1qgzZImfzVuYMy+kAAvV4=; b=qE+OcLM3gsnLMt41/4YB22FO/6RpQjS/QyG9mvx860nL6zqZ3aeB2aoSdrUKS4lWywPqCh zkv4Duugv4u3Lu2pC3pSb9SvwYfWRFjs4vy2aa36tmHMWc6HPNeDfAL+bCWvbIvPpJZ4Tg pwpp94l3uUbuxZV+CzvMYI5Xe56HxlEbJyh1nLZSKuIFwNvqaIDwpdZhjJY+u0zKhFXTDE dE6fV8lkoHr9UWJIY8h6KLoedbAXlsfLeLgmHpJdvxGvrzYKCv6psYNrIl0j3Wdjvchwrz fxCuIs8WuT0FqYVgwZ2FzEyN/EO/lZy5I04vgW7JSHxtuKZXEwEraMGvNFD6kg== 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 4X0gPY2Ds3zxXL; Fri, 6 Sep 2024 15:38: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 486FcvKD003441; Fri, 6 Sep 2024 15:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486FcvBn003438; Fri, 6 Sep 2024 15:38:57 GMT (envelope-from git) Date: Fri, 6 Sep 2024 15:38:57 GMT Message-Id: <202409061538.486FcvBn003438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 705583b76f3f - main - freebsd.sys.linker: rename source file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 705583b76f3fba9e8c3cf77142e8ac84de721ac1 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=705583b76f3fba9e8c3cf77142e8ac84de721ac1 commit 705583b76f3fba9e8c3cf77142e8ac84de721ac1 Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:35:28 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-06 15:35:28 +0000 freebsd.sys.linker: rename source file Suggested by: markj --- lib/flua/libfreebsd/sys/linker/Makefile | 2 +- lib/flua/libfreebsd/sys/linker/{lua_freebsd_sys_linker.c => linker.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flua/libfreebsd/sys/linker/Makefile b/lib/flua/libfreebsd/sys/linker/Makefile index 318cc5078b33..572b5949d2a1 100644 --- a/lib/flua/libfreebsd/sys/linker/Makefile +++ b/lib/flua/libfreebsd/sys/linker/Makefile @@ -1,7 +1,7 @@ SHLIB_NAME= linker.so SHLIBDIR= ${LIBDIR}/flua/freebsd/sys -SRCS+= lua_freebsd_sys_linker.c +SRCS+= linker.c CFLAGS+= \ -I${SRCTOP}/contrib/lua/src \ diff --git a/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c b/lib/flua/libfreebsd/sys/linker/linker.c similarity index 100% rename from lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c rename to lib/flua/libfreebsd/sys/linker/linker.c From nobody Fri Sep 6 15:52:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0gjV5HqKz5VNFR; Fri, 06 Sep 2024 15:52: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 4X0gjV4DlMz4pP4; Fri, 6 Sep 2024 15:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725637966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BY+nnV/ZXyhyH15cKmXW6pKnUoHDTvWzxyOZ/kgBX40=; b=yxYqHJk9dphKDcyegJCrbyADfCg7PPfPccOWILVvIG5r8HK3FyhQ5OGNVXo3235eaA5c/H L1IWKbL+T+VpF9P7F+ZAsL6sr/QXFC0ADWcUL0PQSlhbHFGMb2Moc4hBC/ca8kHqGecSkq 1W6u/TlgtZeLV5/gDS2wfSoDyprYSEJns9PVCU/l21UfXyPKBy6i9NPMznkXKl45gOAHnB xgf9LgSEIBn06FLWQYpbYzXkJdei+zN8ufiZs/STLehdeRI6DUvm0WofNroY2u/s64S49c 37nLnQQ5C0XIawfsIv3xCb/87qVsaXu3ejQqv+FtWiagkZ9RDV0N3IIWBcSuXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725637966; a=rsa-sha256; cv=none; b=Ik4KNHR2ynz7bCb2B82zAPKVA/fyXkmLhZqk0V0N76DmmSdEKDK7MNPc6SWPknuAV61FmW +ssOKcgMWtcrM4l+dvRogG1MLhRS9A/0jpALJ/TP8cr+DR6P1oxQux1BCHcfUNtXu3ubIS Tb5OPgeIc4Adr2W6eqw2YvMWoqqz5Xcn4kka0z4u3NiRa47UbCexIPgIS5IpoNKb2UFoai ug6LiMAxn9cjgM+PsPQ5jpXD9LbqS+7Znb5URxagofmp3N+XEt1RMqg1cSHuz9KK4YOHfF 7mkbtJ7B7yFz1TUWuSlVr6j+2/0XBmOHylHoPzKH62QkqzdOHh4rX0H+wsOqKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725637966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BY+nnV/ZXyhyH15cKmXW6pKnUoHDTvWzxyOZ/kgBX40=; b=tEu20qeqtQrwKNqbEoxyd+WefEcQuz7UyVeKT1zxqCq4xSEkNx3Qx6K5LaccQLcI+misYJ XyH6SiTXtEcZx/gF6OT5ONm3KvXMzyi9Ya13KO9azuAoDbL+RZELJtoLzYwVLeTvW4+ONB AWiWtmQJCOF4ll15vtjfx8TSe7GAqk30lvVbyYlbBxjVTXmL5W3otq4FLNhq6ykrch7J+d suKl5ieR6Hz2mN5Oxyt6v3EhgjDrfu8Hm5sa5UiwPzkZYDSKp1J3D5O40DYWzzL1Fln8vg 1ZJbYUJGJ5h74LcSxxUnfELLAbVrbucoGNxyrzfGlljyt7MsyOqUWnrgMW63sw== 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 4X0gjV3VmjzyH5; Fri, 6 Sep 2024 15:52: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 486Fqks4036065; Fri, 6 Sep 2024 15:52:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486FqkVv036062; Fri, 6 Sep 2024 15:52:46 GMT (envelope-from git) Date: Fri, 6 Sep 2024 15:52:46 GMT Message-Id: <202409061552.486FqkVv036062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: df1323e023a4 - main - lua_ucl: make sure flua gets build after libucl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df1323e023a40dea43e65b2460ff35126b5c62e8 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=df1323e023a40dea43e65b2460ff35126b5c62e8 commit df1323e023a40dea43e65b2460ff35126b5c62e8 Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:49:16 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-06 15:50:04 +0000 lua_ucl: make sure flua gets build after libucl --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index ee5419ae0f93..8860bfeb1770 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -152,7 +152,7 @@ SUBDIR_DEPEND_nss_tacplus= libtacplus .if !defined(COMPAT_LIBCOMPAT) SUBDIR+= flua -SUBDIR_DEPEND_flua= libjail +SUBDIR_DEPEND_flua= libjail libucl .endif # NB: keep these sorted by MK_* knobs From nobody Fri Sep 6 15:55:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0gmG2Nxgz5VNkB; Fri, 06 Sep 2024 15:55: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 4X0gmG1qf5z4qjk; Fri, 6 Sep 2024 15:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725638110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UfPZEy6rVdhVcO9JXmzup/pcci0ILuh+W5R6sCBer2M=; b=FGENEOjRA4I0DPZuNiKEZMr7MpCOba2jJ0eF38Urcq51jMmsDKvWJcfcSb+RLNbXtRjFFf PDFmSm7AnNulf+ubCl7mvy79GAgJnbrWc0885+fxTEXIk8dp0Qj15fhKJ7cmUsk++B/Cdx QtqjcFn38Aj1+0ns1TBE/yLUSP64eHLzGVCE9EAJtX+ovFbNmSAsLvr2CRMHAnbcxELZ0Q O9oBRGFekou6iyOHi7PrzxJcw4+weNTjHQkGt8jZElpGi9xjdHwAVC9fjLc5NnOEdxnWxG PQdmShkGzP0eOfzv68mSScDCkhrkReLopoLiOoeSW+H+PstmD9BDOMtkV4sLqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725638110; a=rsa-sha256; cv=none; b=oYYvI3ME3qOF2UG+9/XFWwMxOc65ps3YlnvL2Sc4FuAOZORP4nCHgcS6FuLs6yLs/W6aqk EXjhiZlpKw0jLmiJrQ83s/ySDj4EgzeBHm1m9/R3xPdJMFKRBH2fernH/qb4zxCsPeFbRy w68k3rn9EKSKj7pQTh/RtGtkUdR4E8nD66KTOpBFvv/+nNEs2UYZ2PVftVSTu8gnIcycmq UTdgqaC+4Kb26DZTWIxtoRAXnVQdtHhBcACYqrkDlVAuFWu1I4kGjuYcDj/aL9lSicfhVS VrXRHcKr4aw+QtiKz4XPlzEN4ZuPqqB5Tx9zI0S35hT9Wamc659kGaxrIZRpaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725638110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UfPZEy6rVdhVcO9JXmzup/pcci0ILuh+W5R6sCBer2M=; b=kEdmtArgM8k3ehTQPS51EY5ffyKz5QtN9cUJpGTBTp0kEmkMYuzllQ9QXmttm/zE4Xp5Ro myRS2X9XR0mBwSBuZuLNBdGtQTlO0YKg7OnEeFIdW4B+81q97pqycblG7g7ZMitRVHOjhR HQupJOgcHXS0CJk1rmgaD9kMCx6VVgBevms4+zuRBs+izVGCDyW/3rYm/BbnYRzI9oN2IV Bb4Ht8Po7aKvCIC5Gx0AISBLcp3p4IDhqia0S1/YsUYyU+YGvB7gzl5YEFDGUzoeoCjaLZ K8xVlW/ey+h8eJcxxMQUbU57F1S97P79NA+k53JUoHVB8+6KsuB9HRZ4jsJyuQ== 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 4X0gmG1RmMzy8l; Fri, 6 Sep 2024 15:55: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 486FtABr036597; Fri, 6 Sep 2024 15:55:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486FtA4v036594; Fri, 6 Sep 2024 15:55:10 GMT (envelope-from git) Date: Fri, 6 Sep 2024 15:55:10 GMT Message-Id: <202409061555.486FtA4v036594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 39667ed7adc0 - main - flua: hook libfreebsd to the build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39667ed7adc055879fffb5107ab3ecf1b26ac1bc Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=39667ed7adc055879fffb5107ab3ecf1b26ac1bc commit 39667ed7adc055879fffb5107ab3ecf1b26ac1bc Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:52:08 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-06 15:52:08 +0000 flua: hook libfreebsd to the build --- lib/flua/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/flua/Makefile b/lib/flua/Makefile index 168d05f54674..d88e76f61062 100644 --- a/lib/flua/Makefile +++ b/lib/flua/Makefile @@ -1,3 +1,4 @@ +SUBDIR+= libfreebsd SUBDIR+= libhash SUBDIR+= libjail SUBDIR+= libucl From nobody Fri Sep 6 16:30:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0hXd4DjPz5VSNj for ; Fri, 06 Sep 2024 16:30:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0hXd2XG9z3wsS for ; Fri, 6 Sep 2024 16:30:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd42.google.com with SMTP id ca18e2360f4ac-82521c46feaso92529539f.2 for ; Fri, 06 Sep 2024 09:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1725640208; x=1726245008; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BWBtd0RahNgfAz/bSoLOjQwlQejn87nqo7fg107rpGU=; b=IjbG0li671CQbCfoC9yGQJWgx2KzhwzeWVzfxqg3v1ka0cN5HYl9q23Bl/GJP6HAiA y9efSds/0M9vrT5uWk7orgEl/hclgzVH8jOe7mmZ16l6plCMyaQ3r3YHNf0Vnd9PQetO jkMqUcu1RlXLCGl2U9UDGDGeL0j1/5aNXJJ+zkPxRQTSepU8rWW8l35jUSskSWUc8svl wErDN5bCarkafgJYc7hB5hO0cSwGTwbCGHeWwEd64vu12q9iV1s7Vl0TAI1CZ6aYNLrR BB1e9rwXVWTVG1ExIs5qpWElkyMKYM4OkIqTLXKeWamZX/5fdJomXTtHCgjq5BtVYLbR PgdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725640208; x=1726245008; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BWBtd0RahNgfAz/bSoLOjQwlQejn87nqo7fg107rpGU=; b=OPb+zRBNwSnRSASJxhubqcN8fXyuPcZsCnaz6iscts1csjCnovR5i+hUJQTIeBjVMj zELMQ/f+GNjOjGy+7ZdtJgbQ5MuT6/amGYodK+bZuClN6PuKAd6XIXRMN8ZQhOqyIUgq HRcm4IMSQiz5uoZIztXi76PLGC/t7LMUe+sPGKrowVkpm9PeTGVg4+fEyISVnjwmO93B cMA7FPShRNCyh5Y6ArwxtFp6r2Q4ZxQhMr1tRbrBdEyakO2Li11PVZN2Xqnvvgyp2nsu aqgE1/4ir+xNAP904NrTR8rf/MHwAm5Cw0LKUjbDCq9DJi5Buu5klclCp06M5/sewgEd D3aw== X-Forwarded-Encrypted: i=1; AJvYcCVJ5AcBMcMF31ocSeO/yOoCtt0btwIz46Qd6QkNiRNY1ZiXUfHngRPW9teos7XRRO5VYDbyvjZFxR5WTA+XQ6dmGRvn@freebsd.org X-Gm-Message-State: AOJu0YzalfyHxzOunauR0qUY1EvENrGGfSnPBMxRUzBKDwPxYiLkMaF8 JRPEW5bQYZvJ7LTiyVWDllffZ1jyXiHFahSyd1yPaT+e9UxB+Ng0yddJ+NCWQLk= X-Google-Smtp-Source: AGHT+IFezbs3C/3jwdpOIhp6k7q/zqx9s7ighlaunKm6QGmCgiZS2LLaHZhkPlpMZBRoeVqAf5xk9w== X-Received: by 2002:a05:6e02:1aaa:b0:376:40b7:b6f3 with SMTP id e9e14a558f8ab-3a04f069b27mr42344065ab.2.1725640208272; Fri, 06 Sep 2024 09:30:08 -0700 (PDT) Received: from mutt-hbsd (174-24-73-190.clsp.qwest.net. [174.24.73.190]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d08060c2e9sm601194173.22.2024.09.06.09.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 09:30:07 -0700 (PDT) Date: Fri, 6 Sep 2024 16:30:07 +0000 From: Shawn Webb To: John Baldwin Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e962b37bf0ff - main - bhyve: Do not enable PCI BAR decoding if a boot ROM is present Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> <7213e551-6be2-44b1-a8b6-55645c593c12@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="356w62jdouopvffy" Content-Disposition: inline In-Reply-To: <7213e551-6be2-44b1-a8b6-55645c593c12@FreeBSD.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X0hXd2XG9z3wsS --356w62jdouopvffy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 06, 2024 at 09:37:45AM UTC, John Baldwin wrote: > On 9/5/24 22:10, Shawn Webb wrote: > > Hey Mark, > >=20 > > This commit seems to force me to now pass "-o pci.enable_bars=3Dtrue" to > > all my VMs on amd64. I wonder if that might be a POLA violation. I > > didn't realize that I needed to set that until I bisected the src > > tree, looking for the commit that broke bhyve for me. > >=20 > > Is changing the default here really worth it for amd64? If so, I'm > > thinking this should be in both RELNOTES and UPDATING. I now have to > > propigate re-enabling this across my entire infrastructure. > >=20 > > Thanks, >=20 > That should only be true if you are using an older UEFI firmware that did > not program BARs. Are you seeing this on stock FreeBSD, and which version > of the UEFI ROM are you using? Ah, thanks for the hint, John! My UEFI edk2 bhyve package is years out of date. I guess I need to pay more attention to what `pkg upgrade` does NOT upgrade: hbsd-laptop-02[shawn]:/home/shawn $ pkg info | grep bhyve uefi-edk2-bhyve-g20210226_1,2 UEFI EDK2 firmware for bhyve uefi-edk2-bhyve-devel-g20190424_1 UEFI-EDK2 firmware for bhyve hbsd-laptop-02[shawn]:/home/shawn $ pkg search bhyve edk2-bhyve-g202308_5 EDK2 Firmware for bhyve I'm building some packages on my laptop right now. Once that finishes, I'll go ahead and upgrade to the new package, retest, and report. If this is indeed the problem (I suspect it is), I apologize for the noise. Thanks, though, for the hint and the help. :-) --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --356w62jdouopvffy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmbbLggACgkQ/y5nonf4 4foWixAApQ9bRIsO7C4qJN+yNDVB+abdJBefIB32wQezNwydBHM7/rw1157gnNg2 grXWYfv6SivyXhQw9ldGkWV+EKtV7XbIyxWOevxfZXTOBds15umE/wL0i+7ixq22 hJzA7V+U8eMsA4YGWUE5ZjOsZ7hPaMX5no7Zz5vm+kB2M487MPCLjrPvElynov+w IHJ93L6diqtzSixRynSHJkfLPH45l+kklfAG9ovVrPtfjkHMJrg/7bki5b58LPU5 JudSO/MJM2/0MDwwc74QbkkOzWFuGaB2i/RcZe/VKBsXMs5t+nkmU4taxhpF+Yxz VoIx8yc8m1p1ZKrfDONtA5SpPHhqf7iSEwd/RvoOZAD1TKYp02BBLg1tPK9mSCBq /9OI9Oa1ZYRFRB+Ln1pfut4vRUm+s+SynoZ4pb4o8eEn+TbGJq4dF/sOCbi2lwwZ edxFajIm/i1xcdHjFL2VqRqcALZFNzGdYBP8y+c1JQyYgFs+r3RNVStgd6XcqhOW 3KkazuDvxkuD/lfcAW7UVVdoqy5MEoTRCicF8LgRxCtT87QOx4yC9cS3dBue9Boq LDqJkeKx6Y9gVRLtwwAKzcdNzS0fk9VAWjilqZBYn0hqHBK+92+mNL3T/S3NX2AZ S+cgY4dljZ8i4Ake8YWXbpl9A6FdNLNY5xySObvz7V0r/CWgeMA= =llO/ -----END PGP SIGNATURE----- --356w62jdouopvffy-- From nobody Fri Sep 6 17:19:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0jf54c0rz5VXhW; Fri, 06 Sep 2024 17:19: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 4X0jf52Nhlz47Qg; Fri, 6 Sep 2024 17:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725643197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Q4JkzE8jPR5YdS/CwpVPgF2n9vfiQMKBGVY6y7zCVk=; b=VH26Ksbpj6u5ZzwkV7j0PWsl6AGUWoZi4iZAKsa/EafhLeru6GrZwbTqAhpTPSJ4gRl70b fuPFLZwNHUAx/NGWh+wvdCbqv4pIH7eAU6vUnv9kb2gtyqdqhcq9iiV0dTgOrC0qs/3q6h EuEEUuhrmfGa7gqIdZkgtYj3CrhGqVJmO8lRYyNOFubFpNLazCLpxugS6rub1jxPkMR+lC D6QNhrmQYrBMw9eVVCz6gQeVTfau71KsAsdQu73uE8MJdXJddZgSQlhkLfe17hJA/mVZ88 oqJP0qHlxFTR+PrFCC87CwNouhrxZI2Os5IqQ/Np8u91X/qCUoN8YmGDzNT4uA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725643197; a=rsa-sha256; cv=none; b=VwvruKOhWyJy1k/kO+j2eOsoJIaoQxaCb+l8NRK9cL5e9ZRawRPVOfv/nEOUjLO52qdnra dWk7bgTcjmwRadpzd4lWAWKcekgW0bAd3jsugEZ6nqJch7PhnO2Gj2BM+9Qk7BmfN5WUcS 09m6MbNbIlmsLBM8hgGfpGWJmvzZGrwUsEQLDd12oyljNagkbCh7gmn6Sm+mpfZ2CjLd29 H4u4khJ5DhWqJHvK4sE8ORwuzghwnaLuxgUmBhuLnro67Hfwk9oWVPQQ/0njIwIvBEzwNu hjsm4QFt3qovjPjlE3O2Ag+3MjDAAk4B7dj+pZP8y1nnC4cIRdSiQwB0KAdbUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725643197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Q4JkzE8jPR5YdS/CwpVPgF2n9vfiQMKBGVY6y7zCVk=; b=iSK6RXE0yE+3DXPVzgdS2Lpj0AGOfMvht4ddiAkbCU9VY2LG+gaMWi8RhLxbpMTv8D6EyF NEhFjEAK0uGpe+QvGJ98HISGYkt3AHhArj3u1WDyy5AKtPtJyg5FckN9YMrFk+tJuF6cDs Qq1GFkJ6UNVYmdukJf3gmwmH6/6oAeEdhBaanTYm60u1B45zxJuzdUFzj9do0QqMzEKktF 8z6NbNnxDUp/an18lKm/RW0BFnRGHjCL17HVK7K45n6ugz+XDlblFEHAVDJvziU4hZ//5O wiICBtRGmVM6UFjf9jSlVPQkjwusDjp8hlaDR3+Ab3G4ohFeWocrIPojaIwTPQ== 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 4X0jf46mHcz10d2; Fri, 6 Sep 2024 17:19: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 486HJuHf074902; Fri, 6 Sep 2024 17:19:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486HJudP074899; Fri, 6 Sep 2024 17:19:56 GMT (envelope-from git) Date: Fri, 6 Sep 2024 17:19:56 GMT Message-Id: <202409061719.486HJudP074899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 58f194223ab8 - main - ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58f194223ab8578269772a6874a8444e5e03afaf Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=58f194223ab8578269772a6874a8444e5e03afaf commit 58f194223ab8578269772a6874a8444e5e03afaf Author: Mark Johnston AuthorDate: 2024-09-06 16:55:42 +0000 Commit: Mark Johnston CommitDate: 2024-09-06 16:58:44 +0000 ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl() IFF_ALLMULTI has an associated activation counter and so needs special treatment, like IFF_PROMISC. Introduce IFF_PALLMULTI, akin to IFF_PPROMISC, which indicates that userspace requested allmulti mode, and handle it specially in ifhwioctl(). Reviewed by: zlei, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46524 --- sys/net/if.c | 16 ++++++++++++++-- sys/net/if.h | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 4458d710d826..ebad5c5d16e5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2611,7 +2611,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) (ifp->if_flags & IFF_UP) == 0) { do_ifup = 1; } - /* See if permanently promiscuous mode bit is about to flip */ + + /* + * See if the promiscuous mode or allmulti bits are about to + * flip. They require special handling because in-kernel + * consumers may indepdently toggle them. + */ if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) { if (new_flags & IFF_PPROMISC) ifp->if_flags |= IFF_PROMISC; @@ -2622,6 +2627,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) ((new_flags & IFF_PPROMISC) ? "enabled" : "disabled")); } + if ((ifp->if_flags ^ new_flags) & IFF_PALLMULTI) { + if (new_flags & IFF_PALLMULTI) + ifp->if_flags |= IFF_ALLMULTI; + else if (ifp->if_amcount == 0) + ifp->if_flags &= ~IFF_ALLMULTI; + } ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) | (new_flags &~ IFF_CANTCHANGE); if (ifp->if_ioctl) { @@ -3383,7 +3394,8 @@ int if_allmulti(struct ifnet *ifp, int onswitch) { - return (if_setflag(ifp, IFF_ALLMULTI, 0, &ifp->if_amcount, onswitch)); + return (if_setflag(ifp, IFF_ALLMULTI, IFF_PALLMULTI, &ifp->if_amcount, + onswitch)); } struct ifmultiaddr * diff --git a/sys/net/if.h b/sys/net/if.h index 5c4b0637b25a..d54190f6ccf8 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -160,7 +160,7 @@ struct if_data { #define IFF_STICKYARP 0x100000 /* (n) sticky ARP */ #define IFF_DYING 0x200000 /* (n) interface is winding down */ #define IFF_RENAMING 0x400000 /* (n) interface is being renamed */ -#define IFF_SPARE 0x800000 +#define IFF_PALLMULTI 0x800000 /* (n) user-requested allmulti mode */ #define IFF_NETLINK_1 0x1000000 /* (n) used by netlink */ /* From nobody Fri Sep 6 17:19:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0jf63kSHz5VXq7; Fri, 06 Sep 2024 17:19: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 4X0jf6152Zz47Nj; Fri, 6 Sep 2024 17:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725643198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=faAjTBP6sTgkJrD9H3SuPsEZkGu2RdJJPC1HBqiWuMQ=; b=QeQdTeFj1zrJ9dSILkYPKB9gW6a2Vw0ckPr5tsTqDLXJtKL/itBPbQmC0aGdbgz4BKVt+W sVZSaMt16p8lwUNAY7xOYPw8oVhNVrUEFeWPLLPiBiNgP9BBCRoP1RqIgV6WK+czJ+gYcK 1Kj/YkUuFQJ8ru0rTaWAqhIrcPkyhsrHXLSkgsP5FOaeNxBr+9FJFRJCVv5OLT/Kp02LYu lEu1aTyS5xFwHdPFdaiMkLqgkEFb03lcSruDk2bQOkH+CeDriKUnBxpqILOCxc1WcW51dI j/JlrZqsVzML/SQblIE1lBCN8Zwl/7X/mj/dPqcjVp1sm02TtYPtTUdrN8L9Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725643198; a=rsa-sha256; cv=none; b=VKDTXLIL3fb1N1mcgJeMb+1P6W4n1xPHWFU7V5jQLNj2Tun/35RauUHcwpTNlexPoYH3uK 29WcBCZ4WT3gsilwoUQKrNQSoIK6oGqd4II6/GsT7RVWPtmpSnBxdBUaSBher/DXD5m8ZG ZQDPirUyq1HaBlsC6caz7SZ13ba89ZZjpfwgyKjpADvAkdfiqI+9NTjr4L+8Y/L0GcfBT4 oIR6L41oQ0BNu/G5PtxNFIQu0uYMkCFX/MYEr4IIpdOne4XyojdbBw9ieFDucRRpLj5lZf jzrPzSZGX7EZWruYVliUPabbY6kRTe2tZ5uO8xGDTt7FvOrWgZLgzLW6C2uh/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725643198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=faAjTBP6sTgkJrD9H3SuPsEZkGu2RdJJPC1HBqiWuMQ=; b=V93VRVxnQByn8iKscxDKgyu4v3MyY8/6QL9Fv9IgciqAhjZnRANm2E1Vjc0pSaQjjaICIt 58++9dLdwub8Sd8z3IGsa1Cv04z2pidVURC5Cp+c8HMWB+FIKkxkM3q+PiN4qSFBMjjLVW xwLCrJ2LNHMaM0qlEb2deDA2GqkTuCxd9tovYcdC5EfUva8mpt10EamYqxYe2hEVTfi9kY SdMKLJHXP1agrdxJAgWspZoY8lpNACkTMwo/leRwI8Q+aFj8C61YZ5PP6V9vPz3hdQbnFA og9ISQN9plt3AKpNuWpKwn5WP5X0EgqZtohiFUagrUOudlg+g3jpzBpsHfmZ5w== 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 4X0jf60NKfz11J0; Fri, 6 Sep 2024 17:19: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 486HJvfr074944; Fri, 6 Sep 2024 17:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486HJvJ2074941; Fri, 6 Sep 2024 17:19:57 GMT (envelope-from git) Date: Fri, 6 Sep 2024 17:19:57 GMT Message-Id: <202409061719.486HJvJ2074941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 00c9a6806c9c - main - ifconfig: Add an allmulti verb List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00c9a6806c9cf3357b62f6708e5acd1ffd166613 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=00c9a6806c9cf3357b62f6708e5acd1ffd166613 commit 00c9a6806c9cf3357b62f6708e5acd1ffd166613 Author: Mark Johnston AuthorDate: 2024-09-06 16:56:58 +0000 Commit: Mark Johnston CommitDate: 2024-09-06 16:58:44 +0000 ifconfig: Add an allmulti verb Similar to "promisc", this allows the IFF_ALLMULTI flag to be toggled from userspace if it happens to be useful to disable multicast packet filtering. One use-case is when implementing IPv6 neighbour discovery over netmap. Reviewed by: zlei, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46525 --- sbin/ifconfig/ifconfig.8 | 4 ++++ sbin/ifconfig/ifconfig.c | 2 ++ sbin/ifconfig/ifconfig_netlink.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index c9861ccc6481..dfea59dfd229 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -502,6 +502,10 @@ Enable driver dependent debugging code; usually, this turns on extra console error logging. .It Fl debug Disable driver dependent debugging code. +.It Cm allmulti +Enable promiscuous mode for multicast packets. +.It Fl allmulti +Disable promiscuous mode for multicast packets. .It Cm promisc Put interface into permanently promiscuous mode. .It Fl promisc diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e6ed9015b34b..a0680d09e54c 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -2078,6 +2078,8 @@ static struct cmd basic_cmds[] = { DEF_CMD_ARG("descr", setifdescr), DEF_CMD("-description", 0, unsetifdescr), DEF_CMD("-descr", 0, unsetifdescr), + DEF_CMD("allmulti", IFF_PALLMULTI, setifflags), + DEF_CMD("-allmulti", IFF_PALLMULTI, clearifflags), DEF_CMD("promisc", IFF_PPROMISC, setifflags), DEF_CMD("-promisc", IFF_PPROMISC, clearifflags), DEF_CMD("add", IFF_UP, notealias), diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 729d4ca56545..5a986e840d7f 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -77,7 +77,7 @@ static const char *IFFBITS[] = { "STICKYARP", /* 20:0x100000 IFF_STICKYARP*/ "DYING", /* 21:0x200000 IFF_DYING*/ "RENAMING", /* 22:0x400000 IFF_RENAMING*/ - "NOGROUP", /* 23:0x800000 IFF_NOGROUP*/ + "PALLMULTI", /* 23:0x800000 IFF_PALLMULTI*/ "LOWER_UP", /* 24:0x1000000 IFF_NETLINK_1*/ }; From nobody Fri Sep 6 18:05:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0kfR2d86z5VNKb; Fri, 06 Sep 2024 18:05: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 4X0kfR1q9Vz4KFN; Fri, 6 Sep 2024 18:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725645919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kgoXlyZJxZN4oCUaviBbFO4E3JjI+ewWxKfeG/makM8=; b=IwcTSjwlLMiLRWAdMH9SVWk5IsK+6FeYdsCVrEzifIXbhTXQigD5oTL3yo/MB/95UKIlkA JTEPglp3s05cY/Y8RMo73W5XQ7TCLyjPkYh2HMaC5+pX5BkUYaUR6mzCYflaAL2xgVjxJy 6QY9RlP7SBPfVChcsCRB9ztdzyzneCzliTFAdjQtKzKwaey33B8BgSvx7nGBYMiSBTQd3q bfg64ifp26P5vEdwGK+slLWgH+LjI1N+3bSmRZAaL3KOjMeIxJWMRMRzgCOJETJXeEk7F/ DFg1pwo7QYEuABaU2q7ZU8/RS83Wl3+Y/meQCNZoPPpS3Os7dItltR3faPVdyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725645919; a=rsa-sha256; cv=none; b=glxo9lgK/VRquO0HgK625sbj+4QNmdlmVk3bskU0aOVJ0Ldds3DJd6iB6clP5Ex+vQoZdB mugU9qEAJ9j2TutrMEc6Eionq/k267wXGBXfWcaF9YI5UGt4G7YkWcdS6PIMe6O+CDAa49 NwWvA5VRTZlhNdkCleA9oqVSLm1paDhA9COjV9FT0gipUIp7L9Rp6/57FiBa4kRpEYjkOV qzSL04WLbOGt5bXmLScJrRjeJT+DIEzkWMnJqSm9bnsJkEvPYT4u+wURrPG0nEJox1b1pK k8E0JlFBKW8xPv+7owrO7nX2qwSeDpFun5BOBrp5EYZUSTodl3ar6nKfwCj6AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725645919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kgoXlyZJxZN4oCUaviBbFO4E3JjI+ewWxKfeG/makM8=; b=cPqAJqYjxkzUlNt2JxYULBi8ySA0GCXChevfLdFzOE6aeQGnXS8V6ZQDNAFmkU3H8rC9vJ LitJBd5TZ+CUB17SQo/bBYPdvivZUtBJ6fInJDxWCDFBru0NF/MRrwqSAXm7naApQ3Fj9t /1ZmyGMnlj9myaShNQ3JptwFAtrlfZreq1B5vRf2xct0ka9zKOoLa8/bvlcqfZf+D7p14q QdF44DKRk16r7OIXOkUWtqh/zn2p7SeZi0AYpsP1KTSM2zfZAzaf/Lt43ZTXi8ftt7Aqy+ oGQXHXxOY61OomnvOM+k7pvIDmCOxXjVT1DZfsPufQpTljcBae8OqsqWIKBZkQ== 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 4X0kfR1QhGz12Xb; Fri, 6 Sep 2024 18:05:19 +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 486I5Jqa059698; Fri, 6 Sep 2024 18:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486I5J8Z059695; Fri, 6 Sep 2024 18:05:19 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:05:19 GMT Message-Id: <202409061805.486I5J8Z059695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mikhail Pchelin Subject: git: f5a58c2da239 - main - linux80211: fix default deflink.rx_nss List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: misha X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5a58c2da23930ee4870f2eb54788f4669b9aa33 Auto-Submitted: auto-generated The branch main has been updated by misha: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a58c2da23930ee4870f2eb54788f4669b9aa33 commit f5a58c2da23930ee4870f2eb54788f4669b9aa33 Author: Mikhail Pchelin AuthorDate: 2024-09-06 18:04:52 +0000 Commit: Mikhail Pchelin CommitDate: 2024-09-06 18:04:52 +0000 linux80211: fix default deflink.rx_nss Native Linux implementation sets this as a maximum between 1 and ht/vht/eht rx SS'es, FreeBSD does the same, but uses 0 as a minimum, which leads setting it to 0 if we're not in ht/vht case. This 0 was breaking rtw89 driver, when it was trying to determine SS number by subtracting 1 from rx_nss and passing the value to the hardware. After this patch rtw89 association and simple ping work reliably, but more work is needed to make the driver robust with heavy traffic (iperf3) and being long idle. Reviewed by: bz Approved by: bz Sponsored by: Future Crew LLC Differential Revision: https://reviews.freebsd.org/D46528 --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index a2791d20a727..ae765cda5781 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -347,7 +347,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.smps_mode = IEEE80211_SMPS_OFF; sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; - sta->deflink.rx_nss = 0; + sta->deflink.rx_nss = 1; ht_rx_nss = 0; #if defined(LKPI_80211_HT) From nobody Fri Sep 6 18:35:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lJs6y9Rz5VRmP; Fri, 06 Sep 2024 18:35: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 4X0lJs6TJ5z4VNp; Fri, 6 Sep 2024 18:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gjrs7eVHjCS3uj1Dtj7JSB/gZPLMwA3K1TShi/Cg7JA=; b=WTIDHy2txV5ZCP+h9g+PGTrXLxkVOBRuWTIPW/8PG3o9TurjgCLDmcdlwW8w3RRwzgpEnd NeNqdFuIWHSOTORij/EMlrOUWiuSo2RnMKTbUo5DSs27KNH8HHnYWzzUHsasfEqSG5win7 t8mkJ8hiyMeTf87mSdYsUC/ygdiikdEt4AowIiE1HmX/6jcKoeySexjdNqX7owt5DnHzTj lZe8lSIo5j4THTGG+nu0+cfDbjINVOYh/yRfJy4AEmL0vswGya4+Uibb54b4RwEVNQBTMV ZyEXXV6kZBSl4hZtx3Gr03VORh13r1Eh25ApWDrAzwMl6frs30j3kLGdR8Zehg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647709; a=rsa-sha256; cv=none; b=S+p9475X3VVMCDIK4aArD05asIM+pr93SLLJXJEAm2/jim9rix8Rkx8TctiVOVNMWFbWR7 y9BaMUc13HkZ4zf96Wx3qi6bVFfD/brwoAl9Wn6ckajQNwXgNHakI1E2ULYEp2bcR+7lX5 j8L+5ezGgx8fRx1j1veta1I2MwGtp9MA+nu7mqtikCzxmL92PPggrbjzm85icJwVL0HngE ur2XUizKClO6RPP8VWPFKpM7cnjiGuSdcSikzlF7P5DJwHIz2/FXOm5ILp2/Lpc8lz6vhM 0rjPlNaVk6Uyl3OLBnEzEfmTB7yWkkbC/F6n7ALg8xAbpFdrEgl6AiLUcYKPGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gjrs7eVHjCS3uj1Dtj7JSB/gZPLMwA3K1TShi/Cg7JA=; b=fQGE1OFYBbOFaI0lkHmUW4r5b8KTcXpQxfll+IE4nSkdChiaOl4jFIBTyFov6LAi3pu0/r ZxnvlervTz/oipZnF7o2l2ZasOuh0lgMSoaD7Zhx9+bR7dLbv4TqJkBltWGbU1D4ONSlcH E/5jLHiAaJxzn09qJPNOqGIGCSw8RnPt2Sgw8gg6CKQ99jMsOUxJGs7OUCCNM9Y0dRLyKB 6xoZS06r7LP2ZCtPQzMo/TCpWGFv4LrXryiL3eojbf7S2hZlGbiH/8Ku8Mhqjzf8aUotu4 2RtzzQQmupkyn4Gv/t1WCvLstRunAl/wmByBVzMUmXmfS0OazzkggtfZHKrgiw== 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 4X0lJs62nTz137t; Fri, 6 Sep 2024 18:35: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 486IZ9m4010544; Fri, 6 Sep 2024 18:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZ9Fd010541; Fri, 6 Sep 2024 18:35:09 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:09 GMT Message-Id: <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad Author: Sebastian Huber AuthorDate: 2024-06-14 07:30:28 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:30 +0000 kvprintf(): Fix '+' conversion handling For example, printf("%+i", 1) prints "+1". However, kvprintf() did print just "1" for this example. According to PRINTF(3): A sign must always be placed before a number produced by a signed conversion. For "%+r" radix conversions, keep the "+" handling as it is, since this is a non-standard conversion. For "%+p" pointer conversions, continue to ignore the sign modifier to be in line with libc. This change allows to support the ' conversion modifier in the future. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1310 --- sys/kern/subr_prf.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 4dc989e2d1f1..8ecabdec18d5 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -660,9 +660,9 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis char *d; const char *p, *percent, *q; u_char *up; - int ch, n; + int ch, n, sign; uintmax_t num; - int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; + int base, lflag, qflag, tmp, width, ladjust, sharpflag, dot; int cflag, hflag, jflag, tflag, zflag; int bconv, dwidth, upper; char padc; @@ -690,7 +690,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis PCHAR(ch); } percent = fmt - 1; - qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; + qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; sign = 0; dot = 0; bconv = 0; dwidth = 0; upper = 0; cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; reswitch: switch (ch = (u_char)*fmt++) { @@ -701,7 +701,7 @@ reswitch: switch (ch = (u_char)*fmt++) { sharpflag = 1; goto reswitch; case '+': - sign = 1; + sign = '+'; goto reswitch; case '-': ladjust = 1; @@ -771,7 +771,6 @@ reswitch: switch (ch = (u_char)*fmt++) { case 'd': case 'i': base = 10; - sign = 1; goto handle_sign; case 'h': if (hflag) { @@ -824,8 +823,10 @@ reswitch: switch (ch = (u_char)*fmt++) { goto reswitch; case 'r': base = radix; - if (sign) + if (sign) { + sign = 0; goto handle_sign; + } goto handle_nosign; case 's': p = va_arg(ap, char *); @@ -862,13 +863,11 @@ reswitch: switch (ch = (u_char)*fmt++) { goto handle_nosign; case 'y': base = 16; - sign = 1; goto handle_sign; case 'z': zflag = 1; goto reswitch; handle_nosign: - sign = 0; if (jflag) num = va_arg(ap, uintmax_t); else if (qflag) @@ -907,11 +906,11 @@ handle_sign: num = (signed char)va_arg(ap, int); else num = va_arg(ap, int); -number: - if (sign && (intmax_t)num < 0) { - neg = 1; + if ((intmax_t)num < 0) { + sign = '-'; num = -(intmax_t)num; } +number: p = ksprintn(nbuf, num, base, &n, upper); tmp = 0; if (sharpflag && num != 0) { @@ -920,7 +919,7 @@ number: else if (base == 16) tmp += 2; } - if (neg) + if (sign) tmp++; if (!ladjust && padc == '0') @@ -930,8 +929,8 @@ number: if (!ladjust) while (width-- > 0) PCHAR(' '); - if (neg) - PCHAR('-'); + if (sign) + PCHAR(sign); if (sharpflag && num != 0) { if (base == 8) { PCHAR('0'); From nobody Fri Sep 6 18:35:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lJv0xGwz5VSCH; Fri, 06 Sep 2024 18:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lJv0D89z4VWD; Fri, 6 Sep 2024 18:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iARwZMnzN5Wnsy+XbehcUFod9Ctt/VZqdAUIHY/Nf+U=; b=SsT7aGYYk1lnJGNokoIVdki7VXvLfbSvd+LhECo8TYjNi1Hxxps39nvRHOh3EaLilsTD/y qSCamx1k92ZEeJWNGglvh0E92lxzTStD43Rw0acckUhRtJ+XRtsbPH1cK1/6thKKOPRBd/ LhLeoBXXJ4tpIPalucBB1FYAioCoI1QjLsPWfiYodh8qLF4Ia+4dJ8UHbP5NsCV00nojtI 8SUzMlNlOYk2VNsmPtuwX2Ac2dq6/G3AKTx6IgkMlbnvzjlGLAGHC3YIqJuii5YG3j0p3u FBL5IcOVRsH3vrVQfWLGZgwnvr6+pe+WD4+IhV4ucif6U9hjxS6w7SjhfxSBFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647711; a=rsa-sha256; cv=none; b=jZOj7J7v2A8D5N5uFr1qD1Dura77yXlR7qMrMRVvs1K6EKG6dBlZ3mB4H8weNzbOrzSYqM JVv6Qb3TlJ4+IuvnRQ58Ysv+iV8WHonFzSpNIvhVecLI6muroia49R5DqiA/BlRSwwhctj F1v2+Ar0LpTrXmCwGhpDYwtMAH3SoiQkRXVKu0Hvv3/xY4vPTb2Vt78687lKFAy7Nola+j TXR/OqlkdcrF5GPCZfI/nIPlUTLAjhgc5t9XyBFVBzMblpLEALuAZvKgOrx8NDTB2Vr18j rSS3IYmFMrXzEfffyF/Fq1KzlPXi8ctFdctfsfjzKcrJm+MMsAxukcKNBW1rHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iARwZMnzN5Wnsy+XbehcUFod9Ctt/VZqdAUIHY/Nf+U=; b=t/JCASKwgSjSzEt6LQCUAG1sQST75qICZFeCCnPc4QHja6QngYw1EZmMC23FMsZ/Ca55vr KkoP2VmbcFppjdxlw0fbiGt2kNdVui8/KHbSRXZ2IWN//IHKLUV0bpVeQeAw6IluFPhLgp 6q27m6zcYei7Wl0nkLw71NdWRHtF4fNydLA+fsVls7wRUSS5NLoRFuN2DflQVsk3sDwWOO HK5/qcD6PuLKs6DxTWmV4cOu/hpyLXptC/kVBczwCH4BkDpl/uL6Gnlm51pLbpir9dKr+z pE+QBjR9Ud4HIgKdctOpTlhW79VU0WvPbfc9e3NX7zG5TytnvSPm+ZiNeCzl0w== 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 4X0lJt6xXtz12r3; Fri, 6 Sep 2024 18:35: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 486IZAdd010585; Fri, 6 Sep 2024 18:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZAKU010582; Fri, 6 Sep 2024 18:35:10 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:10 GMT Message-Id: <202409061835.486IZAKU010582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e152944f1a16 - main - usb: increase USB_PORT_RESET_RECOVERY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e152944f1a16a4ff33b4e20b813ce4a54b884b90 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e152944f1a16a4ff33b4e20b813ce4a54b884b90 commit e152944f1a16a4ff33b4e20b813ce4a54b884b90 Author: Ahmad Khalifa AuthorDate: 2024-07-16 17:38:12 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:30 +0000 usb: increase USB_PORT_RESET_RECOVERY 10ms seems to be too strict for some configurations, so increase to 20ms. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1327 --- sys/dev/usb/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 3d00cda27d18..a6c3c8030c73 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -114,7 +114,7 @@ MALLOC_DECLARE(M_USBDEV); /* Allow for marginal and non-conforming devices. */ #define USB_PORT_RESET_DELAY 50 /* ms */ #define USB_PORT_ROOT_RESET_DELAY 200 /* ms */ -#define USB_PORT_RESET_RECOVERY 10 /* ms */ +#define USB_PORT_RESET_RECOVERY 20 /* ms */ #define USB_PORT_POWERUP_DELAY 300 /* ms */ #define USB_PORT_RESUME_DELAY (20*2) /* ms */ #define USB_SET_ADDRESS_SETTLE 10 /* ms */ From nobody Fri Sep 6 18:35:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lJw45TCz5VRmR; Fri, 06 Sep 2024 18:35: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 4X0lJw1TL2z4Vkd; Fri, 6 Sep 2024 18:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8eZ9Re560QEK2MPuQnt13omPKvywCuSUoLRvKgfg54s=; b=DXWE1GiMyqlrJe1o1lHJEgZj3Li+f4TvmBR0q1Lfj/Np1RJ+mnr4flDXPFjZbNrrK2R0+Y mk3Id7Plv+9cJiE9OcNZeeebO07UFgCCkBK5GA259PQOJSUaQ1MgcMyeBEmO18WJM5dcN/ 4+wBEQyUVmccW3uDJmcOOofDOa0kV0nacNuXlQTMo6rYgm5JNsKdJ15ZL9iWgL55dl4vtc Vk/JH1QxgSD8irjHKQveYH27ebBTi02fMVVVjq9RoPdHH3cjvTtTSAXhKstHpujN/y/Jq1 c+OOx71hg0cZqklePEtsp9apazPUkNo2By6ScofVcy145cAwLjAtPtEhdZoz5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647712; a=rsa-sha256; cv=none; b=OSarWXVLXlrV7ybLjCqb041HsL9oLrU/JKECeCA3G7UDUKfSfLyIS3TZL7tBgctYZQGkgp W5ixTE2ADfQsxNVFvuqSIVIw5DgBJDLpKmk6T41lqsGBiyk0aoUVJsPOUUj19fNAACHoU6 aJI7ZkqUmJgzB0sMYw/bEHY6ZE76XVBYPbuPG6YKcSWfDsQL1QwEhz4B0DsNQQpT1TAXSN bd+NHCvxQ+TBmm7SYO6eSLGhXVd8Cmt5ubm36eZN094Qq3F05wfpPHuLLPcaN7k6mnQG22 jipAH7BLYPnEVaOoaVqERKssb9JJ0Ngw743cGHFfUeKH5Iy7glfesttnQCZV9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8eZ9Re560QEK2MPuQnt13omPKvywCuSUoLRvKgfg54s=; b=LqIP1eAqc2kY6BWU1+EwyDrT7Z/Wyx8cSXXcExL6YhnFmVBMvGGC2yOv+dpPQ764dRqnsj mIWSnLU9oCHUpxx1es/1zRMbVSB077QWkUPkbLC00U+VBZpiBndMHZlyqhGGwZxc1oXt2X VncDZyhgO2fY0HGnetj6E8Ig6ByieE6TcNih3f27UJe0yEPMWlwcX8UajgRB4/+YCDwH5b XjJNF7qEuLfMcm092+eHHFiBj0BbNtf5CmecYFBj9pvQtQJ1YzvDBxoy7TRY4Vn5tqh5UR MTwK5K51iCNQ1r07GUuSstktDt6E2Gwi6HjUhixlha5qmMaq1jF3e/PA5dNj3A== 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 4X0lJw0pfcz12r4; Fri, 6 Sep 2024 18:35: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 486IZCjX010633; Fri, 6 Sep 2024 18:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZCNw010630; Fri, 6 Sep 2024 18:35:12 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:12 GMT Message-Id: <202409061835.486IZCNw010630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 71978fa41f2b - main - du: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71978fa41f2be0ecce7cb10d30242d29d4ccd844 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=71978fa41f2be0ecce7cb10d30242d29d4ccd844 commit 71978fa41f2be0ecce7cb10d30242d29d4ccd844 Author: Bram AuthorDate: 2024-07-24 20:01:56 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:30 +0000 du: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/du/du.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 96ad7c037dfd..185a5cbe4465 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -55,6 +55,8 @@ #define UNITS_2 1 #define UNITS_SI 2 +#define DU_XO_VERSION "1" + static SLIST_HEAD(ignhead, ignentry) ignores; struct ignentry { char *mask; @@ -259,6 +261,8 @@ main(int argc, char *argv[]) if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL) err(1, "fts_open"); + + xo_set_version(DU_XO_VERSION); xo_open_container("disk-usage-information"); xo_open_list("paths"); while (errno = 0, (p = fts_read(fts)) != NULL) { From nobody Fri Sep 6 18:35:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lJx3rBfz5VRmS; Fri, 06 Sep 2024 18:35: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 4X0lJx1qtKz4Vqj; Fri, 6 Sep 2024 18:35:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2hT/nz80Wjv0/nlyBSyPVXf5bpdyGRtYM9ZBgWkNfMQ=; b=RSbrKgkbJnpVEiZRxyBWErnqVr8EKppudsKnbetFadKdzraDV87rY/o5R5yCAYFvm33aKS kid88a+bHEeVLchsORDqU24cw8G6OIE+/DZcxGeFQV/Hg/aSQ7EygqImMYy8Ka4jatoaZh 7fTIGbkL2OmQ1vvEdLGut0aht0zC1oOU8KxOsChp/I2BjBqbkDo7sNbbCsN2pwTR7NlEfg DvOfdnRr4nqy0sELRwJ5TmroIZqbAIc9l9F7hJ07zXjiIEZ47fk/evg4hsZC2aa5crycuO 98WXxi7oaEwbrDh42cmrBqKIDlQOBhxReEIn4pN9t9Su/Ie/3Dx04vl1Jh9IyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647713; a=rsa-sha256; cv=none; b=EsojDGV2jcCRaESBOhu98YFS+05LybOsmx2Rkd1OK1NBhSxKm+oEU4NmwMSK3LVv1+Akgw rpoK6XSUeFOEyzxaS96YQJPC41pFrMt8B1/tKkxHRts8qByH1CNbvdXjRpPdba4R7mIA/E NLDt6T07kR8HrLq1dxcU8yvKyQBYjroiUnExKwM10xnl9+tTM4twfTGCkGhzfEEIOfjCYy 6mJp75j/0Y0BUG++wdlgT5i4+NchvuYk3MUexNgYuKk6UE2hSRzcXfOlGTNjmtDXTnUzbS ygrqDZWnIgdJd4TCh9RK1KOFjdqe0JM1d3gi/S3XTVfkP4LAGx17/kkki19vvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2hT/nz80Wjv0/nlyBSyPVXf5bpdyGRtYM9ZBgWkNfMQ=; b=wz7+zB10if7suXBnGTyiPurdGV/TG0Y1mTmYrZiN4N3G4ANd1hmfyJ+fvAOL9ovO49Lxy+ iqGtYz/NQ/tLa1RA+G4Ttsmc3zZVYVQ4JUl/cd39Uhfz+dWw2USl1A5XjRsWseMqeSEybB 9NPfVw7/UktqDCKBHFFem3srxrKeFLnOO8xDBVOZr62mxOt5nUCbI6aY4qSh+gN2jBdAkt ayMqUx4dMpMlx06tVGt+NTA/X9uzV+vxHQDqeXm4t3prCBlSLznL/PXZxXVYjf5fdXnbBS +obs3G9WfSMxdRa2kHVNfe0GGy5490u7Spn9LRDtz+UxDokvOJjxBmZ/ZtzHLw== 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 4X0lJx1RN2z13HL; Fri, 6 Sep 2024 18:35: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 486IZDGe010695; Fri, 6 Sep 2024 18:35:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZDBO010692; Fri, 6 Sep 2024 18:35:13 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:13 GMT Message-Id: <202409061835.486IZDBO010692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a0d6f89e692a - main - lastlogin: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0d6f89e692a683fc7f558e9eb8a27d30069e949 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a0d6f89e692a683fc7f558e9eb8a27d30069e949 commit a0d6f89e692a683fc7f558e9eb8a27d30069e949 Author: Bram AuthorDate: 2024-07-26 19:34:08 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:30 +0000 lastlogin: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.sbin/lastlogin/lastlogin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/lastlogin/lastlogin.c b/usr.sbin/lastlogin/lastlogin.c index a1dcde3f60bf..3a71693f7576 100644 --- a/usr.sbin/lastlogin/lastlogin.c +++ b/usr.sbin/lastlogin/lastlogin.c @@ -48,6 +48,8 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $"); #include +#define LASTLOGIN_XO_VERSION "1" + int main(int, char **); static void output(struct utmpx *); static void usage(void); @@ -103,6 +105,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + xo_set_version(LASTLOGIN_XO_VERSION); xo_open_container("lastlogin-information"); xo_open_list("lastlogin"); From nobody Fri Sep 6 18:35:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lJz68Hqz5VRkw; Fri, 06 Sep 2024 18:35: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 4X0lJz3rP4z4VX7; Fri, 6 Sep 2024 18:35:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnqZTyz7S/7U/o/WJB0+S01/lD1YfA2nrqpQYq+jYeY=; b=BnaerrmxVo/6WQkRtZFxXiUUZVwujPjHc341BzX5Y2dUuTpzEFQpcMU0cR1zN2RtgSTMFC 79s7bFFl4ciz9dmO9xEM1z73ENJwu2+AHb0z64+I+x3KGID1D/2PsnAHKxL/zEGk3xfcMc UW3lIRfq5hDlf3JmrWMg6Sf4xsODJYSW8I8gdVeJaQ+fyB5yUZmmmUu1fM66j6Rr9SrY42 mV1oAz3oMZTgWVi5JO5rV7XlTQeKuljivDrEHyVJ7bQzvku3h/0qxFV+AkI3oSyqCCip36 YqxmcItX5BtjxQwZfdR5abPEWH4DweVd9wGHhnJLjof1OHlrsykEelcHKkEiIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647715; a=rsa-sha256; cv=none; b=axLpL4Uv8fc+6H0+/Zsi9s3+6ibEZn0lKRPWWCy9B/Q7VXesnY/G9h8iJ/HJAKtNrvfFyG dPDOGa1G1+bG5hEeT1Xp2SXSNW5mbbxaOi7hMVUentiqgl9lN8Rx1vxtjgb0TyA0oW3bO3 WVku5NK+VP/1WMe+6w95ESJUbMbbhRbuPMuD3M65cjW4yf+KvGKAR92/StlLu7OfONMPtp EO12AbFxabpyL06lLEUBVYXn11/nIthNADtzbWajaxd0apx3GzjMKceMelN11hNK1BGoBg +pZc00agGkJnfSTajzqBGPTIAbLwPg2OZ8X3ZCiSoQduyUFjUj/yFtE7JUnJSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnqZTyz7S/7U/o/WJB0+S01/lD1YfA2nrqpQYq+jYeY=; b=N8h4R30+k6uRRa/QsNLWI7d96y3sJ4nvOj90Uuzlc62bW2dliKDM2XallAsKGPLn3s4s46 QS+RVUdRMpBCLlN+slstDovlXiAQPjkSY9435ghYT08Of3uWhyaLwzs/ZbpPJ6ffr7hsh4 bh3WpCQmDPS6kTkZa6Yoo+tFfSSsNPV7ifndzfoDj+OZG7a3l3FuZFYobSzwu1JvYagXXq dVcP0lwiel1hMzYElh2zesCnsjXI4hR0DXf7zozYBE28ARDUN1j8HFqe79FrabzKHEMc6j GVWT/Uo/dHuWZhLDHk9rNAFromA7ywKSQ+G91pu75hFPBuVYX/W9RVFEIjC6kw== 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 4X0lJz3PMvz137v; Fri, 6 Sep 2024 18:35: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 486IZFGt010923; Fri, 6 Sep 2024 18:35:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZF3L010920; Fri, 6 Sep 2024 18:35:15 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:15 GMT Message-Id: <202409061835.486IZF3L010920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5321a3547912 - main - w: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5321a3547912acbeea7eaea8ec3ed85f07537469 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5321a3547912acbeea7eaea8ec3ed85f07537469 commit 5321a3547912acbeea7eaea8ec3ed85f07537469 Author: Bram AuthorDate: 2024-07-26 19:35:57 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 w: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/w/w.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 8bce6d8427e6..47899d0b38e0 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -108,6 +108,8 @@ static struct entry { #define debugproc(p) *(&((struct kinfo_proc *)p)->ki_udata) +#define W_XO_VERSION "1" + #define W_DISPUSERSIZE 10 #define W_DISPLINESIZE 8 #define W_MAXHOSTSIZE 40 @@ -317,6 +319,7 @@ main(int argc, char *argv[]) if (fromwidth > W_MAXHOSTSIZE) fromwidth = W_MAXHOSTSIZE; + xo_set_version(W_XO_VERSION); xo_open_container("uptime-information"); if (header || wcmd == 0) { From nobody Fri Sep 6 18:35:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lJy5GzHz5VS0s; Fri, 06 Sep 2024 18:35:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lJy3XNYz4VX0; Fri, 6 Sep 2024 18:35:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmEHBlRzKFfLMZ9fQmPKo4pErqpJRzcRPUg1R+OdmzE=; b=CiQiaskEY3urPuXrXBFjjPSQEz+45odnyvhdWx2526rv6xzdSQX/2d7wN7kRjCQ6roy1VK bwTgBsAmGK9S2jKzVRqq2W4IlNlv4kDrlw3U8NKY55NBdCiJnZa8WNfdvKeIOheiZP9uqc K+cH6P1S7/UE9EJ+BOqZ4SIH/4ddCwlJ0bn19QV22Dt33WSEcgZXPdQAU0eESeJNBmvATa RPHoptzUMXl5hmQc6oBZBOKqY4sr+KOv3BXLCWzH4etVzBufNi4gY/ourxFnV9hfkK7qlg q5W4QAJl+fBeKmH+e3g6AnZgseLql1yrflGwvYaARZEZeGwcQ1rO8JDVh3y3JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647714; a=rsa-sha256; cv=none; b=HDG+v/qbDYT+zO1n3jywAP1SNcq0Vg/Hf/qfEPXirXEZS7x9jKreMkbk2bE4J0GZwGg8Dq taPy1t/UOQ3MkDLLI/XorejrOn5/agC9Q11zL5DkpDxacfc2+FO/+wt0AAGBtAqc2QW93A WiA/92mAyMkCPjMlq7/ndlhKP1jZu1sLoUZ5S1KX5enROLHCF3l7FhweKS0oMoydvp4/0q vmwKDDvInLgO6njipAUUUIejsDiHtBU1I69daYA4BWPFUzJX3wkXOFcanHedAtbDJIQZX+ 3NLTemeJlLuAGie0+DZ2+r94+Gd5S2t91QeoK1WXa8lCoEL71MXBUGmCNE8l5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmEHBlRzKFfLMZ9fQmPKo4pErqpJRzcRPUg1R+OdmzE=; b=r4ecFUbgXtxIsFEoL8j0uWhTcojzFXwSA5omyYd9dAPpBtpP+/zej9wMcw0MF6jAgFZTZ2 IJ0nKXlsWtbWiplplf9sQ532qoUDxnZejdyJ34M/xjdJS1W8qNvUYXc9Nvhy/SsyZWtOUE a2q4kSKKVVr9cPq5G40DNwc5/Qe2EMghLXHvhLqCXaeMLyOvYhpG4WNgKvpP2Sw0YPPwE+ A1HwWmlQAwr2N87cDIddClSnwBnVlBwwqUXeAwiDB1bbnTP2jql3k9gFX0DAt6f8VWW+fk t2Qx9qWlu5x+kpud93IFQ2w5XXjKlSzgV7D1tkyGqM4oVxTeXIIhOQ8k0NnbIQ== 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 4X0lJy2QNLz12r5; Fri, 6 Sep 2024 18:35: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 486IZECu010845; Fri, 6 Sep 2024 18:35:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZEEB010842; Fri, 6 Sep 2024 18:35:14 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:14 GMT Message-Id: <202409061835.486IZEEB010842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 31ac8806885f - main - iscsictl: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31ac8806885f22d6b3a3948a8f660ba0cf24e9cf Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=31ac8806885f22d6b3a3948a8f660ba0cf24e9cf commit 31ac8806885f22d6b3a3948a8f660ba0cf24e9cf Author: Bram AuthorDate: 2024-07-26 19:35:06 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:30 +0000 iscsictl: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/iscsictl/iscsictl.c | 1 + usr.bin/iscsictl/iscsictl.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c index d95cb9a1c096..b75ff889a9a6 100644 --- a/usr.bin/iscsictl/iscsictl.c +++ b/usr.bin/iscsictl/iscsictl.c @@ -746,6 +746,7 @@ main(int argc, char **argv) if (argc < 0) exit(1); + xo_set_version(ISCSICTL_XO_VERSION); xo_open_container("iscsictl"); while ((ch = getopt(argc, argv, "AMRLac:d:e:i:n:p:rt:u:s:vw:")) != -1) { diff --git a/usr.bin/iscsictl/iscsictl.h b/usr.bin/iscsictl/iscsictl.h index 2ac17890bb57..3bc69e4877a9 100644 --- a/usr.bin/iscsictl/iscsictl.h +++ b/usr.bin/iscsictl/iscsictl.h @@ -38,6 +38,8 @@ #define DEFAULT_CONFIG_PATH "/etc/iscsi.conf" #define DEFAULT_IQN "iqn.1994-09.org.freebsd:" +#define ISCSICTL_XO_VERSION "1" + #define MAX_NAME_LEN 223 #define AUTH_METHOD_UNSPECIFIED 0 From nobody Fri Sep 6 18:35:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK10HF9z5VS22; Fri, 06 Sep 2024 18:35: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 4X0lK04lwXz4VjG; Fri, 6 Sep 2024 18:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e46m44dI77VChtm/w4W8dxUYl05lagZY2zakz3r7dY8=; b=kxI88RTZtvmN0fO6TnnEAkAbZ3/7gimOBoNLryIoNh8g5QArSNir7z0qK1XosqSDwEXDVs /qk7PFoumq+gLHFx/dFQQ0mBPVBczGXsaSggKFNJ14IFamiWqUEujC0iCAIkgF9zidOaFr oxMn6lzgJrjWtuEP9KF8h6M4HeDZzTf1dnZrfe/ACjkvBZMc4WI3iEko1M20WNlIkdtrja XbOE3CF+50Sy3riU7oDu821m48rR9BACseUrsu3gwf4gxx6YvJV7T3momD0zKqiOcJgrqq R6nq77QdfG/qzIhYiG1mg1oAbKW8WR9IFUQxP5f5dcrMLMR15PyUo0KG4TnAwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647716; a=rsa-sha256; cv=none; b=qjIx34AEV7Ll4wH0QidXcU5YjnvzkFKOgAa8JU7rKF4ehVNVFvlT4IbNqbceYE/xoEVYsZ SWxoF2vxSs4Epwp7FtnzIEr9codZS7LOBFn0jp9Nn76ZiLzlxmE5cigJGFEbjQQdyv+B2G U6KJVVR9GffDQ8FDwMWfDxxOIQ/w4F1sJUPbOKUEk96/LWiuy3fooUqEIys6LAtVJ9gThY q5i116xGYsvDBCz8Vvnlag5Fl1V4kpqoJmeTtCrKFfRa7FPn0SiF51OuTq7QDBsYeyRmJf uRAtSTB/9Z4gbCcLBR27ksyjVmcIZgz0V0Zvd77wBpHmcbcFtiBPjkRvHPRKsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e46m44dI77VChtm/w4W8dxUYl05lagZY2zakz3r7dY8=; b=m0i6ClJUsaHJtHgNLbGVbCbFjU9Y/wCasNNAMzU1OvrIfvdEvQS/w7JwxeQInebphpCjO8 Afp85t7HEqfeX/p19XghsGSjHNPlHlGxYUCcr6drTYSXY6xqY7Eie0KL/YPwhYBEJklguY qPVGQF7jgDwFEafBrVhZn3E1RcZFAyVHSVq39+DvCLs0antmq+4wTcwNBxCImIocS1wp4D u4aR7SXKfDqlXVE2oK/rpRTbIiRzsuI+6ezFgpum3opupc4XbLauxF3wd+QtcQenqcn/69 Z7Iz/dRnlq6NA6ae8HrgwSaPEmPpSSds/M1e+GFY1uQK5CENw0MKXPPG9AI5yQ== 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 4X0lK04N9yz137w; Fri, 6 Sep 2024 18:35: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 486IZGq4010978; Fri, 6 Sep 2024 18:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZG5i010975; Fri, 6 Sep 2024 18:35:16 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:16 GMT Message-Id: <202409061835.486IZG5i010975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6e6da538988a - main - wc: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e6da538988a5edb5cc7437f8a8647a350800724 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6e6da538988a5edb5cc7437f8a8647a350800724 commit 6e6da538988a5edb5cc7437f8a8647a350800724 Author: Bram AuthorDate: 2024-07-26 19:36:18 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 wc: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/wc/wc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index 4e8a2d8a8b59..7b83412f3c42 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -51,6 +51,8 @@ #include #include +#define WC_XO_VERSION "1" + static const char *stdin_filename = "stdin"; static fileargs_t *fa; @@ -132,6 +134,8 @@ main(int argc, char *argv[]) doline = doword = dochar = true; stderr_handle = xo_create_to_file(stderr, XO_STYLE_TEXT, 0); + + xo_set_version(WC_XO_VERSION); xo_open_container("wc"); xo_open_list("file"); From nobody Fri Sep 6 18:35:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK21Dywz5VSFg; Fri, 06 Sep 2024 18:35: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 4X0lK15zssz4VgT; Fri, 6 Sep 2024 18:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SOBHlEICIGX7ZBLm8jYs/Od6NLI5PrWwAXGW4o2lTas=; b=NknyjbkZ6iS85gDCXkeyRnzSg6VTJOFzEIvI1ze+ygvMCAPPowBtzK6aSxRAc8/YQgwE6F LniiQZ3L8ZiMHADDw1oCtFYV0WTVi2rrHd90SsKwCkDNKcpWW2um/aGB/f2urlGiRQkT6L d0m7Vpwk0Gw7xHrWNIaLcFKYbgY/Ss6vYZ6iYQwmVfiVv6aQaqRPoUna4F04vdnLfxyHbI zDWRx4LXOvb/IlhZtuHL5rup8HUSpyheLp9h1x0odl5IUpCBzlt5nb3s1614F+ouDh3Hqi TrWxEZskG5too0wtK8FOKuqngiG2A1rhpKsXQ7WTf93Xow5xdOE/ZESZJUDNgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647717; a=rsa-sha256; cv=none; b=maGWZ7mFawe2TjaIGQ2R1wi+GVJoZ+6eIBYBheTys4W1QnDc3vhHxbvDSh5InpLEMU9Q6M 6g93wYR7jBPHj5r7118uMKwifN1xdHMh0m+N5NHNRNqYiJKRXZF6BIsO2McYvoliZHDDLj Rgl+TrMsaMX9Y+eSkb9QMAXjIe68qLGSdRZlrSc6CY0W8tPv8g1jMibET6GJLo3uric6Hf kn4xb5ty/juu+eYfz8nf9/I8alUswnf6bCy0JMg9Txw+avVAJVhJS3V+B1aYQDYDrqzJbw WsyI3WjSQltOyhhc2YeeL1i4APwZaQSdk/HyQetbwSqg1lhUDj9e7vSSSUUm8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SOBHlEICIGX7ZBLm8jYs/Od6NLI5PrWwAXGW4o2lTas=; b=Hteai65kzM9Ca+NIiB7xids/i55iSOWvf4gxTGbDzwW5KhTJRLV1lnENAupbMuNXxdskPN ZOGt2HGZXAE4qgud1iUhlBHqCHloUQ3xhRZPkB3RH9rIlo7RPUwKUDuLJEJVJvoP1n9dt4 +oOao22bZN40jst07wvndqxydr7faEVaTKyfVxEuVRcnRFw1gXlhGSML693bsdr5DoBUd+ C4/SwtJMhAXvSSSeQsnD/Vq+ty0S5bKoiSrgo57iX1TmDioeRXdknfbs9BY32jzdqely4U gL4OfwUPcbO9apiMzdbDbG5CrvTmuzl8ljwQJ5nCH84jgametMsUrKiexkw65g== 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 4X0lK1527Tz12nQ; Fri, 6 Sep 2024 18:35: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 486IZHNb011031; Fri, 6 Sep 2024 18:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZHac011028; Fri, 6 Sep 2024 18:35:17 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:17 GMT Message-Id: <202409061835.486IZHac011028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5c4f64bded0e - main - netstat: Add version information to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c4f64bded0eb9453dc84bcce9a74f64adf57739 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4f64bded0eb9453dc84bcce9a74f64adf57739 commit 5c4f64bded0eb9453dc84bcce9a74f64adf57739 Author: Bram AuthorDate: 2024-08-27 06:17:33 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 netstat: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/netstat/main.c | 7 +++++++ usr.bin/netstat/netstat.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 2ed6eca4626e..6d19851b61fc 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -510,6 +510,7 @@ main(int argc, char *argv[]) #endif if (iflag && !sflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); intpr(NULL, af); xo_close_container("statistics"); xo_finish(); @@ -517,6 +518,7 @@ main(int argc, char *argv[]) } if (rflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (sflag) { if (live) { kresolve_list(nl); @@ -530,6 +532,7 @@ main(int argc, char *argv[]) } if (oflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); nhops_print(fib, af); xo_close_container("statistics"); xo_finish(); @@ -537,6 +540,7 @@ main(int argc, char *argv[]) } if (Oflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); nhgrp_print(fib, af); xo_close_container("statistics"); xo_finish(); @@ -547,6 +551,7 @@ main(int argc, char *argv[]) if (gflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (sflag) { if (af == AF_INET || af == AF_UNSPEC) mrt_stats(); @@ -569,6 +574,7 @@ main(int argc, char *argv[]) if (tp) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); printproto(tp, tp->pr_name, &first); if (!first) xo_close_list("socket"); @@ -578,6 +584,7 @@ main(int argc, char *argv[]) } xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (af == AF_INET || af == AF_UNSPEC) for (tp = protox; tp->pr_name; tp++) printproto(tp, tp->pr_name, &first); diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index c41862d9fbdd..7ebfc5180f44 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -31,6 +31,8 @@ #include +#define NETSTAT_XO_VERSION "1" + #define satosin(sa) ((struct sockaddr_in *)(sa)) #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) From nobody Fri Sep 6 18:35:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK30TR3z5VRmh; Fri, 06 Sep 2024 18:35: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 4X0lK26xGWz4VtN; Fri, 6 Sep 2024 18:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lsn9bbPD0oCqJTB0ofW7wkRPVzauP33nxy2MDzS+hL4=; b=EAEVOt4SGWQyMEVJzGfOb5UOOiEBIYDYT1YyYhj0/FWrJgKeLjSVGgcqpu68xI1p+mRl3b n1M4QuRMajgy3gqRqD0tLZfyvIEAd8KYuGyzHZ3vksVw4KTeaAyeAyou1QnpE17MuM8QI+ eW9BQ1styhzy+dgcMBZQ1A+bm50vHV1vJAF7u2l4p+Mg4CItaKv4zjygaNZWNkNViLgPw6 2M0w/B6Cb9eQoTpX8KPBeK3aKMBJ2yS9waMuriwWj8WWaXhe3LNdty9o1MqY2guvCXpcTJ y+s5MHZ3wSgMXqYPTT633gvPqZ6+VD4sFhBP4mfBWpwPBniuJ8QWjOcjC8QTwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647719; a=rsa-sha256; cv=none; b=O1ESOhyfNFxam5JkTR7IaVd6vzI0Jt5simtdCwnMnSTdiAtxq2UjOid1M/ZzTxMLBgI93D ncz0V4K5JIgd2uC9trGUnLqky14J9REyoITqc5OS/EnNUmvu/oD+AK/gyrUwc6qoc6w3hV 3qa2NJI48qnrcwkbiOZ1kx29kdyfhiCkE4FWPVKbPxXc9DywSpUuJ6sJOrFHqcrSezy26v vF2peW3wdyG9PVJ3LBOksm0aJf3ybpPrrmrN3txCQlNESExAsP0taR3UnWwldj3EsGuRsZ GHDwRJaPaR1xRfoO0METjoRgmGscHPLxvffoifGYL+By9oNp9CecJiWLX5orIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lsn9bbPD0oCqJTB0ofW7wkRPVzauP33nxy2MDzS+hL4=; b=VPoXPZA65Tj5J/Q/vsbA835JCqfpE01hSuhAwYEE+iz8pVe02qYC3zNij+eoXyYyDx9uit dzfSskjqe1HqBlM0eF/n/hcx+bDAl23uTOSMkeWwLl4crg0uZI29McUi/E7FEi+SmwlhUn VhVuqP94vjuky+SmeRWNk1RTFPYS29ygkHgnAU3qJA/5Lvnr02hcOQwerT4NcR6D79SYGY +wzI9E4y83IYFnYzigxLfglU3LINI280/sLoIpFcnJEhZE2lDCM0IEwsqYtkZYfdsv1HVw uTP7hpNWrL53UmDDVbm0Tt2AmbiUiq8X2bKsE4rrI/TfX4gssC3HWjwQ1odK7w== 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 4X0lK25ybtz12c0; Fri, 6 Sep 2024 18:35: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 486IZIft011076; Fri, 6 Sep 2024 18:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZItI011073; Fri, 6 Sep 2024 18:35:18 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:18 GMT Message-Id: <202409061835.486IZItI011073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1f882a583483 - main - adduser.8: update log location + spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f882a5834836b43d4689efeefbc3109fc169363 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1f882a5834836b43d4689efeefbc3109fc169363 commit 1f882a5834836b43d4689efeefbc3109fc169363 Author: Alexander Ziaee AuthorDate: 2024-08-01 12:33:22 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 adduser.8: update log location + spdx Closes: 280538 Fixes: cf8a18 (back out logging to /var/log/adduser) MFC after: 3 days Reported by: Herbert Baerschneider Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1354 --- usr.sbin/adduser/adduser.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/adduser/adduser.8 b/usr.sbin/adduser/adduser.8 index ed67e21f9430..8ba623fedd9d 100644 --- a/usr.sbin/adduser/adduser.8 +++ b/usr.sbin/adduser/adduser.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1995-1996 Wolfram Schneider . Berlin. .\" All rights reserved. .\" Copyright (c) 2002-2004 Michael Telahun Makonnen @@ -427,7 +430,7 @@ message file for .Nm .It Pa /usr/share/skel skeletal login directory -.It Pa /var/log/adduser +.It Pa /var/log/userlog logfile for .Nm .El From nobody Fri Sep 6 18:35:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK42GDwz5VS17; Fri, 06 Sep 2024 18:35: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 4X0lK40GT2z4Vtc; Fri, 6 Sep 2024 18:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IM6bPNUA0CodHAFR9gBi4RPZ8aWaZMa19Keuva0amsA=; b=ZrXVWKdHldKdPaxq4+AMqve+ws4K+HXzFg7BS24T67tSxconXWpOxCQwOlNw3jJnjcIUuY kGv/iHQmFYGNpDN/zmvsD36JFFoPJaPi48Q/h1MKfTQ467DzIs4dtYMkRXD5zi3/b3VyGz Sv6jpgFPLFRx63L0JQjx195Q3GyptqULc37cKdvnWHmzS7kYFJsbFLiEFnlk+m+RqW+TFV ZfWoLd+fHy131T8VDnL3K1Vh12EVEygO0bTYGwEoM6WrjJA3FyU/Tlzo+VxFAHDD2OfkBI cYlSYe3pWfNwaO4yeUuRUjljsk8l6Q0XhW+M1rQ6YDkEQ/gIhWWMX0NPJtwJ0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647720; a=rsa-sha256; cv=none; b=Q4B1wrJMQr5m7e2b3og6gg+G8YfO1PM61v4Zy2ZOcNfcxEwP2hXeAtMHMVlZvIjYfwr0Ta 3qN0ALvk/xZBsfRpxcYmv6rxyT3n5k54WJplNZwAafyP9s1FvjUQLgm+a+RyycAkcBgqN3 GPUh8T1vA33d89HjGl9u6D3wSQoJ5El2DpwDsJa1Bd/zHa4FmqHGEzlkmJO0c9j123mb03 89Mhn7pYCqL9ZBji2x2kkbXslQAMW8BfJ/L50yK8lhzzwEruqCtzsOQr+9WnjcDYWVsxIT hAvQdhMMbWaHoYWePVTeza3TjV29VIA4ZorPhlCnr4R/vjnVuT/ouiUldmbyaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IM6bPNUA0CodHAFR9gBi4RPZ8aWaZMa19Keuva0amsA=; b=kzg00IGzQ1lOYTFzfOM9qHOHPHL+PZjyvw2HrQrlL5WcDEWaoghpL/W9ptlqDZCsKFjMky AACa9RZaA51jHkLX2rtD9dEn3VeO2OMPoCk3Eat3UC8hhSngmlgzP4yXRKR0N1bAR0wmws XLfLwqAFbs1yLZYQuSzavVw9o/SEgvLnwcuUjH9qQkhV5Ra6yWNSaN8jrggreLbTE6G92k Qslg4nXyrXtwZ0J621VUnifHYDTetFZfFykUVYJLK84Y6vV6vV0cpgOf1162AG7LJt8pn0 T6OreOYquGO3YGAEKQ9l3TDwhNgF/Ku5xj1N/aU7ocmLKPopfWga4baQDgzElg== 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 4X0lK36zTGz12r6; Fri, 6 Sep 2024 18:35:19 +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 486IZJQI011130; Fri, 6 Sep 2024 18:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZJxv011127; Fri, 6 Sep 2024 18:35:19 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:19 GMT Message-Id: <202409061835.486IZJxv011127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5d889e60c15c - main - amd64: move the right parenthesis to the right place List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d889e60c15ce7856cb9a9bc258dab8aaeb94efe Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d889e60c15ce7856cb9a9bc258dab8aaeb94efe commit 5d889e60c15ce7856cb9a9bc258dab8aaeb94efe Author: Wuyang Chung AuthorDate: 2024-08-02 06:44:38 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 amd64: move the right parenthesis to the right place Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1356 --- sys/amd64/amd64/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 025c3c365de5..f4b3b9702e00 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1382,7 +1382,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) */ for (x = 0; x < NGDT; x++) { if (x != GPROC0_SEL && x != (GPROC0_SEL + 1) && - x != GUSERLDT_SEL && x != (GUSERLDT_SEL) + 1) + x != GUSERLDT_SEL && x != (GUSERLDT_SEL + 1)) ssdtosd(&gdt_segs[x], &gdt[x]); } gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&pc->pc_common_tss; From nobody Fri Sep 6 18:35:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK52N4pz5VS2B; Fri, 06 Sep 2024 18:35: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 4X0lK51YT4z4Vx7; Fri, 6 Sep 2024 18:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pYWR3CZOF+QBCyYylU+XkdfOXhnl2+m5oLwRG+w4RIA=; b=Mw7E8knGM470+NZ7jP/+IKupT+C6x+35vQ5FDaFrFD2ihq6FrkUs2MtyOk1Nm4aW1Z7I0h 5OKCb/NlJdcjoJaSrFW7eF/7V/xjEfJz3wfFpLoEWPVdJ5nZkZ8fQ6eWnSUCLeEXXVrdnl NOidfwzHf05jW+R6MVg3OkMbZrux3VENFAWyL8eXCmjRBNMpreBbbEGFTDKMiWrB5TANyE OIMSG3SfSDAaHTb1vAlzUmNqHQbehbEMJ2H+yxaOvhvarSuLjMR1pdzx8VOWpGW20+EI2y udglLHYtU5VzzqywncOZZLCfWr4qt8mztSPJbu1TrAZ2m8Yxg0IutoGM3s+2Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647721; a=rsa-sha256; cv=none; b=w5bKwFBFMzOM+bgqekXSxXbXVKngxer+iHSwaLBx4Uyhs1S1EF0ZvmmEsOOgoNpWJYSQ8u C8f/IdoGFJ1Yka88yxkfLPz//CTKhGqzamzFyUlDUM39l9Gsw3zwa8dsA6NIquI8ncGHa5 g/AHnHwfeJtTK/WS0EORHZiN/8NbdGfLP3CSaVAS9GrNgdGLzoaN5YjamzLaFZQ97Y0nXC NbJh9kYTdUwUupNjSFax7A0M89GYiceUYzhqk8W94XgoYTOFevdxM4h8iYqVqxTYDdKOsD T+xQAJlM8W4i6poPOgWU5fQsmXlj/I35w3phGqNcMnDkJ/qROvxZH6C+9NeLuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pYWR3CZOF+QBCyYylU+XkdfOXhnl2+m5oLwRG+w4RIA=; b=ia4CWyPrviZEr0tfdH4fP0O9zj0cJJsw6LTEFk56qveGG8EhZSY8lVRtRgQblG5vHITcrD HqfmomKuCatmF/CYIZou1chqyWAsGDAQPLyMjBop4KBzhDZ9wGgiih6+mp8WFaxkUw4wZG 8TzZh2CRaH0pAP8KwVPXyrM6J9/EwKYDjIHa44vb6jNIdcgKTSsebDZkHNb+Xs0UNeyvy7 2dNNNVpjuZC7cyhmjVRuyV7c0Px18BpjuprKJD4Bnf1Lr4ti+oDApxH2LYOh8iw98t5kJI fuwrRvD/DV2iBqfMqiRyq8ONqbowdggTpQerUVjdyQfkiK1KDwUKmFlNogcicg== 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 4X0lK510Nbz12Z5; Fri, 6 Sep 2024 18:35: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 486IZLKQ011193; Fri, 6 Sep 2024 18:35:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZLRw011190; Fri, 6 Sep 2024 18:35:21 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:21 GMT Message-Id: <202409061835.486IZLRw011190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7b984d5043f2 - main - wsp: Allow the trackpad to be used after a partially unreleased click. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b984d5043f2cab8ba05082366e48116e0d495a2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b984d5043f2cab8ba05082366e48116e0d495a2 commit 7b984d5043f2cab8ba05082366e48116e0d495a2 Author: Joshua Rogers AuthorDate: 2024-05-27 15:46:29 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 wsp: Allow the trackpad to be used after a partially unreleased click. This provides functionality for a click which is partially unreleased and then allows the user to continue moving the mousepad as if were not invoked as a full click Signed-off-by: Joshua Rogers Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365 --- share/man/man4/wsp.4 | 5 +++++ sys/dev/usb/input/wsp.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 39660a53ee9a..bcbbc1b8bb5d 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -65,6 +65,11 @@ Pointer sensitivity can be controlled using the sysctl tunable Tap to left-click can be controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_clicks , set to 0 to disable single tap clicks or 1 to enable them (default). +Movement on the trackpad following a partially-released click can be +controlled using the sysctl tunable +.Nm hw.usb.wsp.enable_single_tap_movement , +set to 0 to disable the movement on the trackpad until a full release +or 1 to allow the continued movement (default). Z-Axis sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.z_factor . Z-Axis inversion can be controlled using the sysctl tunable diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index f1931c9e03c0..4527278295ca 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -99,6 +99,7 @@ static struct wsp_tuning { int pressure_tap_threshold; int scr_hor_threshold; int enable_single_tap_clicks; + int enable_single_tap_movement; } wsp_tuning = { @@ -110,6 +111,7 @@ static struct wsp_tuning { .pressure_tap_threshold = 120, .scr_hor_threshold = 20, .enable_single_tap_clicks = 1, + .enable_single_tap_movement = 1, }; static void @@ -123,6 +125,7 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); WSP_CLAMP(ptun->scr_hor_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); + WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); } SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, @@ -141,6 +144,9 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN, &wsp_tuning.enable_single_tap_clicks, 0, "enable single tap clicks"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_movement, CTLFLAG_RWTUN, + &wsp_tuning.enable_single_tap_movement, 0, "enable single tap movement"); + /* * Some tables, structures, definitions and constant values for the @@ -1149,8 +1155,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = sc->pos_x[0] - sc->pre_pos_x; dy = sc->pos_y[0] - sc->pre_pos_y; - /* Ignore movement during button is releasing */ - if (sc->ibtn != 0 && sc->sc_status.button == 0) + /* Optionally ignore movement during button is releasing */ + if (tun.enable_single_tap_movement != 1 && sc->ibtn != 0 && sc->sc_status.button == 0) dx = dy = 0; /* Ignore movement if ntouch changed */ From nobody Fri Sep 6 18:35:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK71Tvpz5VS2C; Fri, 06 Sep 2024 18:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lK62tqxz4Vsn; Fri, 6 Sep 2024 18:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HiI/DEk/tzzaRFm9KmAj849PtcDmzTa5GdB5Zu6Jz84=; b=dHqsjYTTU9lTjq0yu4honNwOZtrZbbZNV6Os2xkK1kcmZSkMOJvh8O+GUSphUKIYDOXU4Y pMHd5hEsV0+wCWu/ZlLef+n5MAhPiklDji/MfmRX59VqllKihopXjUaXUYStmKqAxmZSaP g6XXjQykHMRGKDtNC1CUy1LAsCzKjM6Cf2vpTHHgD9j9N5lJSZ669SuizdPZ3RbLySsWku ZWFnZQ1CiSIsIZN12oDsaoWbFJXL4KE/hySZ1eeAY53aIrswqvoP1/hy79Xzlod1TVaFdJ wuaxyzgqzMSAyLqHsNO1GgL9jrtS41e4KXEnfqiE27/bmQJ0SLzTZHn1U1LXGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647722; a=rsa-sha256; cv=none; b=EN+KmzIr2nPHji2Di1COaBQGnH8ADyusUQHJSvScFl5CzgGvxPz7WOatSHGO+jOVcWbe6u k8J2Mm2LJKO6U5Qt2sCbLUjd17jBGMnDohOC0zUURWNrS70EKC+Ui8HG8CemYq59pTf0UW NHIJzyq2i0KF1LV0dxfuuTIHGwYVUYpwkP5CaP8g6nDdPmmx55o/B9i2QFe/IIE4ZOLyDh sCtWCQ1+oY75FVA3wLEy7MSKu8PuEakaGMH7iZi4YVahdOG/YE0azmARkHOsEfELC2cdMV AZ+qTBX8c+n7uEdhPpeHTpxecAeqAyAQi0b7zZkmNB0PKSm4sUZD5fPZuU05Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HiI/DEk/tzzaRFm9KmAj849PtcDmzTa5GdB5Zu6Jz84=; b=V4lKsE8ezA5wM0DPY67zOciTzB1ffFVx0XXZWhgr59lJzKNvxiwIDu/JVcgoK4y+miH0/z zxtQqBLH38LBNYoL28tazDr3xYleGRiAs+QQEN0bJ2EFRvyTdQrybhvBndFnhvrXsWTUnN RES/BipIUD/dRfjfpna9aGzKd+jp4biNOkkMqPepvC4v2pfGXK81hP8UtzoHFHYiE/6XMJ b0nbSx6Zrc+4PcutOHtU9E1oB8GF5qTQ9r2I0RIjDqmMR0PGFAoqr7vcql8f3CTcwWyU8n SVRZBsFdZ9mbRVPj6uT+BHH6XcszQ832uOtR0drTVYe/VESsfR5sDGvmeEVemg== 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 4X0lK621jLz12nR; Fri, 6 Sep 2024 18:35: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 486IZMc3011254; Fri, 6 Sep 2024 18:35:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZM4U011251; Fri, 6 Sep 2024 18:35:22 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:22 GMT Message-Id: <202409061835.486IZM4U011251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 62cf43dda897 - main - wsp: Improve multi-finger touchpad usage and allow more configurations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62cf43dda897f33bb80a20630f34bfe204cb97ee Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=62cf43dda897f33bb80a20630f34bfe204cb97ee commit 62cf43dda897f33bb80a20630f34bfe204cb97ee Author: Joshua Rogers AuthorDate: 2024-05-28 00:20:19 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 wsp: Improve multi-finger touchpad usage and allow more configurations This patch allows scrolling with multiple fingers simultaneously, in line with how wsp trackpads function on MacOS. Two new tunables are added: hw.usb.wsp.max_finger_area and hw.usb.wsp.max_double_tap_distance. max_finger_area defines the maximum size which the driver registered an object on trackpad as a finger. Previously, this value was hardcoded as 1200, which was too low to register thumb-clicks. max_double_tap_distance defines the maximum distance between two fingers which will register as a double-click. Signed-off-by: Joshua Rogers Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365 --- share/man/man4/wsp.4 | 6 ++++ sys/dev/usb/input/wsp.c | 85 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 62 insertions(+), 29 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index bcbbc1b8bb5d..83a4421fa2ff 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -70,6 +70,12 @@ controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_movement , set to 0 to disable the movement on the trackpad until a full release or 1 to allow the continued movement (default). +.Nm hw.usb.wsp.max_finger_area +defines the maximum area on the trackpad which is registered as a +finger (lower for greater palm detection). +.Nm hw.usb.wsp.max_double_tap_distance +defines the maximum distance between two finger clicks or taps which may +register as a double-click. Z-Axis sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.z_factor . Z-Axis inversion can be controlled using the sysctl tunable diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 4527278295ca..708a26498361 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -98,6 +98,8 @@ static struct wsp_tuning { int pressure_untouch_threshold; int pressure_tap_threshold; int scr_hor_threshold; + int max_finger_area; + int max_double_tap_distance; int enable_single_tap_clicks; int enable_single_tap_movement; } @@ -110,6 +112,8 @@ static struct wsp_tuning { .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, .scr_hor_threshold = 20, + .max_finger_area = 1900, + .max_double_tap_distance = 2500, .enable_single_tap_clicks = 1, .enable_single_tap_movement = 1, }; @@ -123,6 +127,8 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); + WSP_CLAMP(ptun->max_finger_area, 1, 2400); + WSP_CLAMP(ptun->max_double_tap_distance, 1, 16384); WSP_CLAMP(ptun->scr_hor_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); @@ -140,6 +146,10 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_untouch_threshold, 0, "untouch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_tap_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_area, CTLFLAG_RWTUN, + &wsp_tuning.max_finger_area, 0, "maximum finger area"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_double_tap_distance, CTLFLAG_RWTUN, + &wsp_tuning.max_double_tap_distance, 0, "maximum double-finger click distance"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN, @@ -573,13 +583,13 @@ struct wsp_softc { struct tp_finger *index[MAX_FINGERS]; /* finger index data */ int16_t pos_x[MAX_FINGERS]; /* position array */ int16_t pos_y[MAX_FINGERS]; /* position array */ + int16_t pre_pos_x[MAX_FINGERS]; /* previous position array */ + int16_t pre_pos_y[MAX_FINGERS]; /* previous position array */ u_int sc_touch; /* touch status */ #define WSP_UNTOUCH 0x00 #define WSP_FIRST_TOUCH 0x01 #define WSP_SECOND_TOUCH 0x02 #define WSP_TOUCHING 0x04 - int16_t pre_pos_x; /* previous position array */ - int16_t pre_pos_y; /* previous position array */ int dx_sum; /* x axis cumulative movement */ int dy_sum; /* y axis cumulative movement */ int dz_sum; /* z axis cumulative movement */ @@ -596,7 +606,6 @@ struct wsp_softc { #define WSP_TAP_THRESHOLD 3 #define WSP_TAP_MAX_COUNT 20 int distance; /* the distance of 2 fingers */ -#define MAX_DISTANCE 2500 /* the max allowed distance */ uint8_t ibtn; /* button status in tapping */ uint8_t ntaps; /* finger status in tapping */ uint8_t scr_mode; /* scroll status in movement */ @@ -1040,13 +1049,35 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) sc->sc_status.obutton = sc->sc_status.button; sc->sc_status.button = 0; + if (ntouch == 2) { + sc->distance = max(sc->distance, max( + abs(sc->pos_x[0] - sc->pos_x[1]), + abs(sc->pos_y[0] - sc->pos_y[1]))); + } + if (ibt != 0) { - if ((params->tp->caps & HAS_INTEGRATED_BUTTON) && ntouch == 2) - sc->sc_status.button |= MOUSE_BUTTON3DOWN; - else if ((params->tp->caps & HAS_INTEGRATED_BUTTON) && ntouch == 3) - sc->sc_status.button |= MOUSE_BUTTON2DOWN; - else + if (params->tp->caps & HAS_INTEGRATED_BUTTON) { + switch (ntouch) { + case 1: + sc->sc_status.button |= MOUSE_BUTTON1DOWN; + break; + case 2: + if (sc->distance < tun.max_double_tap_distance && abs(sc->dx_sum) < 5 && + abs(sc->dy_sum) < 5) + sc->sc_status.button |= MOUSE_BUTTON3DOWN; + else + sc->sc_status.button |= MOUSE_BUTTON1DOWN; + break; + case 3: + sc->sc_status.button |= MOUSE_BUTTON2DOWN; + break; + default: + break; + } + } else { sc->sc_status.button |= MOUSE_BUTTON1DOWN; + } + sc->ibtn = 1; } sc->intr_count++; @@ -1055,7 +1086,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) switch (ntouch) { case 1: if (sc->index[0]->touch_major > tun.pressure_tap_threshold && - sc->index[0]->tool_major <= 1200) + sc->index[0]->tool_major <= tun.max_finger_area) sc->ntaps = 1; break; case 2: @@ -1073,11 +1104,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) break; } } - if (ntouch == 2) { - sc->distance = max(sc->distance, max( - abs(sc->pos_x[0] - sc->pos_x[1]), - abs(sc->pos_y[0] - sc->pos_y[1]))); - } + if (sc->index[0]->touch_major < tun.pressure_untouch_threshold && sc->sc_status.button == 0) { sc->sc_touch = WSP_UNTOUCH; @@ -1098,7 +1125,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) case 2: DPRINTFN(WSP_LLEVEL_INFO, "sum_x=%5d, sum_y=%5d\n", sc->dx_sum, sc->dy_sum); - if (sc->distance < MAX_DISTANCE && abs(sc->dx_sum) < 5 && + if (sc->distance < tun.max_double_tap_distance && abs(sc->dx_sum) < 5 && abs(sc->dy_sum) < 5) { wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON3DOWN); DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); @@ -1144,16 +1171,16 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) } else if (sc->index[0]->touch_major >= tun.pressure_touch_threshold && sc->sc_touch == WSP_FIRST_TOUCH) { /* ignore second touch */ sc->sc_touch = WSP_SECOND_TOUCH; - DPRINTFN(WSP_LLEVEL_INFO, "Fist pre_x=%5d, pre_y=%5d\n", - sc->pre_pos_x, sc->pre_pos_y); + DPRINTFN(WSP_LLEVEL_INFO, "First pre_x[0]=%5d, pre_y[0]=%5d\n", + sc->pre_pos_x[0], sc->pre_pos_y[0]); } else { if (sc->sc_touch == WSP_SECOND_TOUCH) sc->sc_touch = WSP_TOUCHING; if (ntouch != 0 && sc->index[0]->touch_major >= tun.pressure_touch_threshold) { - dx = sc->pos_x[0] - sc->pre_pos_x; - dy = sc->pos_y[0] - sc->pre_pos_y; + dx = sc->pos_x[0] - sc->pre_pos_x[0]; + dy = sc->pos_y[0] - sc->pre_pos_y[0]; /* Optionally ignore movement during button is releasing */ if (tun.enable_single_tap_movement != 1 && sc->ibtn != 0 && sc->sc_status.button == 0) @@ -1163,8 +1190,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (sc->o_ntouch != ntouch) dx = dy = 0; - /* Ignore unexpeted movement when typing */ - if (ntouch == 1 && sc->index[0]->tool_major > 1200) + /* Ignore unexpected movement when typing (palm detection) */ + if (ntouch == 1 && sc->index[0]->tool_major > tun.max_finger_area) dx = dy = 0; if (sc->ibtn != 0 && ntouch == 1 && @@ -1173,8 +1200,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (ntouch == 2 && sc->sc_status.button != 0) { - dx = sc->pos_x[sc->finger] - sc->pre_pos_x; - dy = sc->pos_y[sc->finger] - sc->pre_pos_y; + dx = sc->pos_x[sc->finger] - sc->pre_pos_x[sc->finger]; + dy = sc->pos_y[sc->finger] - sc->pre_pos_y[sc->finger]; /* * Ignore movement of switch finger or @@ -1237,8 +1264,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (sc->dz_count == 0) dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); if (sc->scr_mode == WSP_SCR_HOR || - abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || - abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) + abs(sc->pos_x[0] - sc->pos_x[1]) > tun.max_finger_area || + abs(sc->pos_y[0] - sc->pos_y[1]) > tun.max_finger_area) dz = 0; } if (ntouch == 3) @@ -1262,12 +1289,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) sc->rdz = 0; } } - sc->pre_pos_x = sc->pos_x[0]; - sc->pre_pos_y = sc->pos_y[0]; + sc->pre_pos_x[0] = sc->pos_x[0]; + sc->pre_pos_y[0] = sc->pos_y[0]; if (ntouch == 2 && sc->sc_status.button != 0) { - sc->pre_pos_x = sc->pos_x[sc->finger]; - sc->pre_pos_y = sc->pos_y[sc->finger]; + sc->pre_pos_x[sc->finger] = sc->pos_x[sc->finger]; + sc->pre_pos_y[sc->finger] = sc->pos_y[sc->finger]; } sc->o_ntouch = ntouch; From nobody Fri Sep 6 18:35:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK75py1z5VSCl; Fri, 06 Sep 2024 18:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lK73CfWz4W2x; Fri, 6 Sep 2024 18:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4GPeLNGwVptWUwbYD6083l/cCxlc+rBLkggcn1CNGPo=; b=l5UNIyvMFQKs+Fo6IPv5x7giqlxE+mWyXT1WKQm6MLWCOjjgyOE68sFtjucFw5Rc92AaM+ BUDaoL0aIVIWbkAGLANlBdaBsv+lxmkTZa7PUbueIgS/c7SuLTnypzyvJ7RHN7SdkO7s5v ERBiPGQAP5F/QRsv84A0mIgBi6537WqOxkdrp+0/v6EhPz2hIK6CXmygDA5PpJEsGGeym4 60BHrK30Zq4CTrwrOtdzG7f3dT4p6wHcJ9Gta+t7nDfHCKBnEy78OgD3tTEck/hodqsmCb /ds23wjJ7iGeXfwjaxfqsyP9ZdFh/NWEgtlxFImipRXWZ+S7LRiBxDc8UPuMPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647723; a=rsa-sha256; cv=none; b=mkKE8tykvgpPwE0ejL4QVOJKdKbG1vT0Uk2uFEFGvakd2Tn95Ws+JdaauSCs++VSngRbmd XZMXt6HAUduRMIFPSbZQXkHCFt/+KWh4xL+X7dtb4G7N43ChxrgzjvPTl9ZnaUN+V7xU9V eVXXEbB+6yfimGnhxJjiNfTLANLngU6KsxfDWy3u3vi6jQukfuixYFDMFULmd2XxomfewJ ReeVym1AtoTyUWhi7iyEbga3CWxkZ7XdD9dV9ndiUC+DErgKIKuFDAbKvLZrqc8qN+UBYx jl4odbR/qC8DZks/MsSeDhYpCTX89xeG6HL3Z2Oll4f5u519xiB60s89ncVkAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4GPeLNGwVptWUwbYD6083l/cCxlc+rBLkggcn1CNGPo=; b=ggVC8A6EbUxZNpioYCZMOVZmyzyaq3Ed1d3et3qUV2EBxmBU4oiD1uNks03nSyM7/Dyj3H CirX3Eb3+AWVDoAY2hWunu+Jbkkv2EnH+PaerLNj0Kg2jzOcVt6CxSiLDld3uhtePr54Op gaHoF+M5Y06wcOB1x2Fo+mmTa6ymDx4+YRssS9CahABddd+Lw8HNf6Xa1TBwVlp4XWzEFK wwbVrjMHK3o/w4bRPdUoafPVvXXP8Vx7k6PzvILFB+eNuftY7ygcYhx9NSatnvbv5bfIvU FYjgCHeb9/84MaaVCl346bJ0uEsnw9TBFTG/KC1PryLgCP4oFsatWMzmSuEIvg== 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 4X0lK72qTdz135G; Fri, 6 Sep 2024 18:35: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 486IZNSZ011306; Fri, 6 Sep 2024 18:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZNPj011303; Fri, 6 Sep 2024 18:35:23 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:23 GMT Message-Id: <202409061835.486IZNPj011303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8aef1cd698f1 - main - wsp: Use already-calculated distance of fingers for comparison. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8aef1cd698f177986ee4f51ff6f63ea7b0b35098 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8aef1cd698f177986ee4f51ff6f63ea7b0b35098 commit 8aef1cd698f177986ee4f51ff6f63ea7b0b35098 Author: Joshua Rogers AuthorDate: 2024-06-10 19:03:24 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:31 +0000 wsp: Use already-calculated distance of fingers for comparison. Also correctly use tun.max_double_tap_distance for maximum distance of fingers for vertical scrolling. Signed-off-by: Joshua Rogers Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365 --- sys/dev/usb/input/wsp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 708a26498361..a8d6c14c7421 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -1263,9 +1263,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (sc->dz_count == 0) dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); - if (sc->scr_mode == WSP_SCR_HOR || - abs(sc->pos_x[0] - sc->pos_x[1]) > tun.max_finger_area || - abs(sc->pos_y[0] - sc->pos_y[1]) > tun.max_finger_area) + if (sc->scr_mode == WSP_SCR_HOR || sc->distance > tun.max_double_tap_distance) dz = 0; } if (ntouch == 3) From nobody Fri Sep 6 18:35:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lK90MC8z5VS9J; Fri, 06 Sep 2024 18:35: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 4X0lK85PHyz4W5G; Fri, 6 Sep 2024 18:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3INDcxAhBPilMelporugNULPgDuXzoMg91h08zK7KPo=; b=Ph7qGthFdU5LdbXEgOqenVM2f9+smtqVSE7gVETYO4AzJVSsYcxBOhjGfjoSb5yT77/I7u 1s310HlcjJCcBSqidKPwipI9I+OmtbwUosvA7kQkApR9vdcRRUx2YCedKUBl6zwRU97e5l i2GywUGOrZbN2bOKOzRsNNWdBWweW+07PmkXF4V03NI/ks0rsHLElNdqoxwm5QkHBD26x8 CNzvcA53WuFWmmSZhd9+yPXCxHp394PegVUeMhFKr75kP+7I4gXXhRhUaRtfx4fxrHDC2T 4y4X2YROOLKmpFc/9idl9VyxRWx6MX6RjoZw4efPOYB5Ugz0LZYxiCQvWkc9DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647724; a=rsa-sha256; cv=none; b=B022UJpJlOyI40vvwUs7Sp/+E/ryC/EktOi97a9YH38pobwBULiUYkEYLEb5ePjOHXHaRE op5BiRi3PIbNnwQ9dG+KanYD61YTHhRICZIjW8cmHP5/0F4UmSrz42VPvnZXaMiacQR2rC YDt0ISAN1PUsMvgbkrKMpamel6is9RUMXek4S+J9OoamMDYSI/imX3ejKjaC3rt909g2dM NwpBx9z14XJjxj1GoUNfzD2WoQ26gofFzkJCl3Fu0+zjxCxtD3rM3p5YSBIKlGYjhchiQ6 7G3YMVBwzqVKOcUvg2iqvoxtoRyMvOYnzD8HbdEVIFKq3zHyzJLTff7bYYG6ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3INDcxAhBPilMelporugNULPgDuXzoMg91h08zK7KPo=; b=hu5y6y2pM2VXo9NHVwKfQkAsdXPG0Fccjnr6KMSNXVfmZQj2dc3pInD/g7sizO+meiVZG6 xraU/FJzbJ7xOIbhB2rc891s9hCP4ZAI16dRohDpzMCQ26tSrH2uTF07xIYsdZqpSs/bSO C5dFUKLRuBSyN5mfI1mhDAYf6Z0TGPXJPuVPmDinhpE+uj8ifufVMAEo3omGDJ52PrLeQ8 DPHgrPqdxPqJd/83bQU44nz0mo4OWvMnlGfEMk9FYjNuG1pXnkp/rJBFyPAy0VXI6yUTXC CVdaC89PY2d07hDZ/ccEsLKoB1HOXBiByD9D3Csc2rEB2Kdqz2UdZFMQLwEEiw== 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 4X0lK83wgwz135H; Fri, 6 Sep 2024 18:35: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 486IZO4g011354; Fri, 6 Sep 2024 18:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZOrs011351; Fri, 6 Sep 2024 18:35:24 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:24 GMT Message-Id: <202409061835.486IZOrs011351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 66145c3829c1 - main - ntptime: Use time_t for tv_sec related variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66145c3829c1753f3b5fa303c4e36bba172be553 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=66145c3829c1753f3b5fa303c4e36bba172be553 commit 66145c3829c1753f3b5fa303c4e36bba172be553 Author: Sebastian Huber AuthorDate: 2024-08-09 02:57:47 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 ntptime: Use time_t for tv_sec related variables The struct timespec tv_sec member is of type time_t. Make sure that all variables related to this member are of the type time_t. This is important for targets where long is a 32-bit type and time_t a 64-bit type. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1373 --- sys/kern/kern_ntptime.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index d2a2761ed683..65746021028b 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -193,7 +193,7 @@ static l_fp pps_freq; /* scaled frequency offset (ns/s) */ static long pps_fcount; /* frequency accumulator */ static long pps_jitter; /* nominal jitter (ns) */ static long pps_stabil; /* nominal stability (scaled ns/s) */ -static long pps_lastsec; /* time at last calibration (s) */ +static time_t pps_lastsec; /* time at last calibration (s) */ static int pps_valid; /* signal watchdog counter */ static int pps_shift = PPS_FAVG; /* interval duration (s) (shift) */ static int pps_shiftmax = PPS_FAVGDEF; /* max interval duration (s) (shift) */ @@ -742,7 +742,8 @@ hardupdate(long offset /* clock offset (ns) */) void hardpps(struct timespec *tsp, long delta_nsec) { - long u_sec, u_nsec, v_nsec; /* temps */ + long u_nsec, v_nsec; /* temps */ + time_t u_sec; l_fp ftemp; NTP_LOCK(); From nobody Fri Sep 6 18:35:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKB0MNyz5VRl9; Fri, 06 Sep 2024 18:35: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 4X0lK956zFz4W1K; Fri, 6 Sep 2024 18:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQ40fETIRKpXz5pjVe7X0T0gPkKyHWhAmYvo6krzGU0=; b=EA08MzuMsMdmo8TOM0ztoDtz8FOXs1cEMeB9q2XpbAK8gOZYZ5+I4v43OOmba8zXYIICke Qjch3yD0PbT448S5t7Y9ln2Vuc6Y/arrH5cHI4wZ2f6s79eCpc93STL6xo3TtKbhWYlWFc N94knbKqovH7M8O1/j3owB+t504C8AFIywobC5Uhly0zUhOd1H7iO2iVK3Jfa4jICgAScm fBUwGNle2cKlHd6t4eYGm8pqWX/j1rarG0M34U7vNMlmZ5C2jHb1Ju4pGoEpwKtgr5jTBN 52gm0TV1n68kNO+W4n+phUwJ7oyBerSK3V9QivZ+JffQx644w0X9Qe7CcfadJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647725; a=rsa-sha256; cv=none; b=CSzrkI1vNF6E4HzIrBF1wDEel6XzMTxX5K3C2ToVEsEZwkcF06Z6osTSbpHu+ASpTFuAq5 XXFP7bYI6PR01XfaZA54zLGkd7zo4vNbr8nHFzHa5uw7z+BCJ6UNuDthC+guhsVq+8tVfr voEcRAa/debvivMkDO4OW5aZiWYNBwuU9tNhP0Gm+covWQ21g3m+vPTeKyxkypb2RzW00P pgFLmVw8LtP8L1MXaCj8gfy6vd2iCTsoaVkD9qvxqUOtXvoYWwUTqxeA1aghjSX2neJ5Cz s2jdKJvqgHPptEY5GgMdexQ2f4mtvHsFA+IuvHCC0iO7ZPFFfnTQZPkil94s4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQ40fETIRKpXz5pjVe7X0T0gPkKyHWhAmYvo6krzGU0=; b=c4N3QaMeyqcD2D7FU2YHvEyVdPv5oYnvKvqaYueKxZcqkatgvaike2+BHqhrC7/X0ASj5A 0DMQ29CX9fJ0q0zhAKP7sNOeuXWNgE9N+e/7u4UQgRlP0/z3pNODa4HfAPoCZ1tr2zHnVY f+z94rn32wmp/j3qamiWJqJWdWA2UFyPQDkAdKO6GSsCQ5sU5vXbCA6ZiUaiIIrJGIPGVs FcUQf7JmtU+zL4PjWn1Ipy9YIEnvYbcIzlpbGupR8OzM9DIFMWgepyyezX5pgOS/5DhPf4 168QM5HXwYFWvoew5yJlYxV2AoOwRm3nOILYP0sOE9u6vHfMgt3v/x0dDkM9wQ== 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 4X0lK94k1tz12Z6; Fri, 6 Sep 2024 18:35: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 486IZPti011396; Fri, 6 Sep 2024 18:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZPaw011393; Fri, 6 Sep 2024 18:35:25 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:25 GMT Message-Id: <202409061835.486IZPaw011393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 327205407372 - main - ip6addrctl.8: Reference RFC 6724 instead List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3272054073720172ebae9c2c5c75e656f72a6df1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3272054073720172ebae9c2c5c75e656f72a6df1 commit 3272054073720172ebae9c2c5c75e656f72a6df1 Author: Jose Luis Duran AuthorDate: 2024-08-10 17:46:23 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 ip6addrctl.8: Reference RFC 6724 instead Commit e695500d3cb945e62b4591cb68792601ed5c4b46 updated the policy table to match RFC 6724, which obsoletes RFC 3484. Add a reference to RFC 6724, and mark it up as a technical report (%R). MFC after: 3 days Signed-off-by: Jose Luis Duran Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 --- usr.sbin/ip6addrctl/ip6addrctl.8 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.8 b/usr.sbin/ip6addrctl/ip6addrctl.8 index f50da59aa2bb..cf8f1db4a8bd 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.8 +++ b/usr.sbin/ip6addrctl/ip6addrctl.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 25, 2001 +.Dd August 10, 2024 .Dt IP6ADDRCTL 8 .Os .\" @@ -107,9 +107,12 @@ comments and are ignored. .\" .Sh SEE ALSO .Rs +.%A "Dave Thaler" .%A "Richard Draves" -.%T "Default Address Selection for IPv6" -.%N RFC 3484 +.%A "Arifumi Matsumoto" +.%A "Tim Chown" +.%T "Default Address Selection for Internet Protocol Version 6 (IPv6)" +.%R RFC 6724 .Re .\" .Sh HISTORY From nobody Fri Sep 6 18:35:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKC07kTz5VSN0; Fri, 06 Sep 2024 18:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lKB671Fz4VvT; Fri, 6 Sep 2024 18:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OuRDQMOjF53ZS0JM99NMaQ/yxUGWG48RT7DO5Q1aoEc=; b=Dz2uFMaz/G6VpqfQMidwVJp14fQSW8JtsDrLfiV4qewQICzcy/qiBlhplxSRKHzshyogzT g5jp5XNhnowZloJ7YrMX5mPbeVWl5/ymWAUXSx53kqo/7f6Q5gHHP2Ro5pnlEWiPmAChQn PDwFNltaoTULxEXYTRYxM+HgTdNTenhMeGAdnUk9AbgCQaYwWJwiMviDiL+Or7b/RWAUc0 Dry+2GOI/BTwfNddJj9jM+6HeVohrr6dm6H6JMJonwJY9Bm6rr+jIZWwK2peFmUKasB2Oc ctViQNzCvR/swgJpcDACshDQqmORPvlfpxfkNJvVJiMXvk1SsomwA24i6PZIFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647726; a=rsa-sha256; cv=none; b=gsKg1+KsOhzMtqRcy4OMLKUDWHNyKszdhitMP0lKTR5DivmXFw0n5ZWf2TpQCeScI6wkl1 a+Lkau+IZJASDrWDUu6IjnjceBHnR3PBiJbQq/y7haE/ZvpkxA3TDQ2lDXpMkNMruiAstm p3kfv5zDUhn8lzkU3xcNRRFP69xQHB5C5fZW0yHegusyrP2Paulb0Ermreo436vAGOpDP1 P0W7aU5CDnzACt4sho1IHZ4945C8E4m7ppwqyE7LwFAPVgWUqwFbwKSJQcv8rigOwFsCNZ K8eaM8l/re5VRb+An/32oeZM82s4rxQRKeJUA32OedC78VeyWhDMq18SNnSNUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OuRDQMOjF53ZS0JM99NMaQ/yxUGWG48RT7DO5Q1aoEc=; b=DjVN4TThhOOkG+awAaSLMUA3Be08F2e1ALWDiSz0rs6sW6panxB3wvl2ghoDVtBuxvMtP8 pAQrN8mEU5FYWeKMKb1ht48BPQ5OxiUEQkRLCS9DuR9DXn6cXFPk53I8uWI8+oVwNSx2xs wV7Svr+7R+0yODyaUGToS2CRMfz+EmqyP6/fYR/5frNWGLx+kENPBGe7AAEn7i+11hsMzJ G6Isl3t9GU8r4jEqToPmAdZ7hiOcSPM6Jb0IwA6GqvwRrr3P6FSSfw40HARwyBHdROUqcW v706y7dzZRp33uwg4pXtko7qyZFdMAC3JmdHF2RKOAzG0dDsvSwDbtjcjGVT1Q== 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 4X0lKB5lBHz12nS; Fri, 6 Sep 2024 18:35: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 486IZQAT011441; Fri, 6 Sep 2024 18:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZQSM011438; Fri, 6 Sep 2024 18:35:26 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:26 GMT Message-Id: <202409061835.486IZQSM011438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6bfbfc8f4fdc - main - ip6addrctl: Update the sample configuration file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6bfbfc8f4fdc6ccd200541ef738a90d1be3c1ab7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6bfbfc8f4fdc6ccd200541ef738a90d1be3c1ab7 commit 6bfbfc8f4fdc6ccd200541ef738a90d1be3c1ab7 Author: Jose Luis Duran AuthorDate: 2024-08-11 03:06:12 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 ip6addrctl: Update the sample configuration file Update the sample ip6addrctl.conf.sample file to match the default policy, currently based on RFC 6724. MFC after: 3 days Signed-off-by: Jose Luis Duran Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 --- usr.sbin/ip6addrctl/ip6addrctl.conf.sample | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.conf.sample b/usr.sbin/ip6addrctl/ip6addrctl.conf.sample index edcf77553f14..59c1f3db47e0 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.conf.sample +++ b/usr.sbin/ip6addrctl/ip6addrctl.conf.sample @@ -1,11 +1,15 @@ -# default policy table based on RFC 3484. +# default policy table based on RFC 6724. # usage: ip6addrctl install path_to_this_file # # #Format: #Prefix Precedence Label -::1/128 50 0 -::/0 40 1 -2002::/16 30 2 -::/96 20 3 -::ffff:0:0/96 10 4 +::1/128 50 0 +::/0 40 1 +::ffff:0:0/96 35 4 +2002::/16 30 2 +2001::/32 5 5 +fc00::/7 3 13 +::/96 1 3 +fec0::/10 1 11 +3ffe::/16 1 12 From nobody Fri Sep 6 18:35:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKF2Rjgz5VSG4; Fri, 06 Sep 2024 18:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lKF10hGz4WK4; Fri, 6 Sep 2024 18:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9hlYznCwqeGiKqUQ8Z0xvQHyaNgLbye0aaAdzmrTqfY=; b=oe5ea/mJ7GIjQOrcNxQDpzwrqmG6y12QyuT88ZVK6eNKJpvRUM4Wohtv//qdybjqOQWZoI ePP+yQZY5IiKcIReGWM5daMycVNRGVg62vWlljRdMZLcKAOSZBXwnR0p58MODu1c6bwgnt OFT5mALtHTMl6OcpeDYsjQf+iSGk8iQhySfNPFF0bzyPz8JH2+GEVtTR4WHO/3cHHf9ZTG sozaWTXm9mxa0TL1iH5TmLG+2d6/XDqwimgZPke66tsbqvKL4jEFDAzN99XlzqzAUbIOSC JFdIp3knvrUqVlWh+MZjk8g9kOGBNzxYvdMwO6zfmKT5fx8QkjR5ZEP2I4VorA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647729; a=rsa-sha256; cv=none; b=XKT/aIZLoD/P8Ju7YeG82taY3yrUe+i4kAitdF0Z7EpmbvPQybDVJNyr9kUC+G3y/0s1uD QL6yhzgtRLofK4NVpNw4cq0POKJ4QYFKG5W7vLxDnjCcPYNCNWdnDWXxVyOROK2ZHwTwu4 pyxf/ButO/HeZAABxcbFhxPmaNwQKsfIflTSvDnDM8KfFanG6cUDATrwxHAV1X1vY0damj +xrIv2wy1/B9aXQUz0RR+7+2Jr84c8cdKump/HTxK3kopgjKQI7kxXVWs7+eLhVM3oXMfu 7XbeoS47vApmt4Vckw9lOQC9oClptzUUryxPn39Zug8eIckdNvwULUWeJwJgLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9hlYznCwqeGiKqUQ8Z0xvQHyaNgLbye0aaAdzmrTqfY=; b=FhKtFRARcZnrlNwo6goKzCUinDqCRgKojl+Kc+qPGtZH5Z9pwEGpwrvuie/Y7Filf5CUpd ndmsaAPS+ClSM3fd/Ky2U5mb0M4KckL18UlJefZ3Cct1eifr26QT6e0Eii5yLs4jWPe/5H wNvZ6uQHbbZFZF+pkbgyRx90mMp41eLxyAKY/35G6qUtNpe3b2KRp8YquaXDZNpCv+ORnr a20KCXjNiES0dhfbtUrBExu4C5VQ4B+zafmBsvQbgGI+tL+1nEdduyAwRZc7LqQBmf/0Qm l6+Q2s+EMoht+Wmm31wy6PLITe5kA6REwi6Fod7wlnCA/jMOrPzkuqzVeXmV3g== 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 4X0lKF0chsz12c1; Fri, 6 Sep 2024 18:35:29 +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 486IZSYj011519; Fri, 6 Sep 2024 18:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZSvc011516; Fri, 6 Sep 2024 18:35:28 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:28 GMT Message-Id: <202409061835.486IZSvc011516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7b9c9f8004b1 - main - cross-build: fix fake_sysctl/tzsetup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b9c9f8004b17cda071537c9b2fdd259eec27d2a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b9c9f8004b17cda071537c9b2fdd259eec27d2a commit 7b9c9f8004b17cda071537c9b2fdd259eec27d2a Author: Val Packett AuthorDate: 2024-08-11 02:11:25 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 cross-build: fix fake_sysctl/tzsetup The error was always returned, even after handling the sysctl, breaking installworld under Linux. Sponsored by: https://www.patreon.com/valpackett Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1376 --- tools/build/cross-build/fake_sysctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/cross-build/fake_sysctl.c b/tools/build/cross-build/fake_sysctl.c index 4f1b271f3858..c4e40ebb9e72 100644 --- a/tools/build/cross-build/fake_sysctl.c +++ b/tools/build/cross-build/fake_sysctl.c @@ -53,6 +53,7 @@ __freebsd_sysctlbyname(const char *name, void *oldp, size_t *oldlenp, errx(EX_USAGE, "kern.vm_guest is read-only"); strlcpy(oldp, "none", *oldlenp); *oldlenp = strlen("none"); + return (0); } errx(EX_USAGE, "fatal: unknown sysctl %s\n", name); } From nobody Fri Sep 6 18:35:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKG3GBTz5VSKv; Fri, 06 Sep 2024 18:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lKG29GPz4W4L; Fri, 6 Sep 2024 18:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QXDhzmn1INb0PwDGYXl0e20PaTI2yGdFF14e6nSjtAY=; b=Su2lL/g8KMo07m/Pw2EZBOOwhS8M2gZxQ9hHcZdd6uNb3z9DDCN4Vt2ovPNN94vGdG07Ed D4CqrJiXoss/4ZrRAw5rVGVAadi5WrgCP74oDwH7F7IwgiBpmA1jxCkTrxZj6J09zYKdRm wppudV7YosCzw8JRlVrf3L4+gl4jd7qFJ1sQJHvRnYoOVu9ZSyGAdAUCVPq86FUeXSyq7K ZOVE/Hlt8tSVxV5Ogz2JVYC0l2sFlqb5u0uiMrcVOE3PFTOJgGRftdFyfJjhQLKNRbUnvm /RVinSWAjz4ggVz+FI/t7gnd1MElsjbRGSKcubhdBFVgGIYfv6K1J3q/7lXtOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647730; a=rsa-sha256; cv=none; b=gz4eLHuNICRxIW0mNkye6AZOM1RQ9nScwEqno0vP8Bx6uhjpl90jDvsAenrR7QRUen0nLf XHBeKrI2a/HtPWZMsW/6vedSGfrb8kJ7cClaHIgnoQ4FeWY42IvF6BLfpHFZ6mMUyI657b pHLy3Qp3rcGrAWn7LIom6O30Aaj/3iW+PRAOwQRLTItOKKPwK3N7VBWbp6CrzvVdezfEZI /w6Ul9mc5z92wzACmVIx2LzggtqsN5bOjwZATqCtP/Lzl/x6zC+l/8YxNmvKQFuvMjiPnC QVHyn0Ak/eNlE/Zx9wd04jO5gBBX/7xWSfG0XvDaK/3nN4EWTEl7yqXCeliaQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QXDhzmn1INb0PwDGYXl0e20PaTI2yGdFF14e6nSjtAY=; b=iXFHy+Hd3pDDpyza2gSQh16OopMup1sGqTCwZhCx5QD80v9mlGG0clmYR0PKM4bB7tAGVH iP57W+2PfOoERzvaBBMLUYF7ZXmZaU+nLFyEH0C1xVKkr5YeoH/cpgP5juPZEAOfqBIEzq kgkeSLfFsWV6F0Pk6aEJYJh1qBN2hMV5CMT56TFmCs+PxuODew9AOXUwOEnXIlHUyd862B zcewrM6qsslIHPf4BBCTxK5bVQznUkTbzXWu51jFZctTQzMwHMN/4tn23XkYUMpB/CT/f4 MayPXMEIsyOH0Do5RaC3hAXZs6nnMz5B9qI9nq6wkPwXOLFbKvBGiy9I2DVAYg== 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 4X0lKG1mMCz137x; Fri, 6 Sep 2024 18:35:30 +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 486IZU9s011570; Fri, 6 Sep 2024 18:35:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZU4l011567; Fri, 6 Sep 2024 18:35:30 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:30 GMT Message-Id: <202409061835.486IZU4l011567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7e3b6b249f54 - main - diskless.8: show in `apropos pxe` + tag SPDX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e3b6b249f54f5b22eae14dfa48ef7891bc4eac1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7e3b6b249f54f5b22eae14dfa48ef7891bc4eac1 commit 7e3b6b249f54f5b22eae14dfa48ef7891bc4eac1 Author: Alexander Ziaee AuthorDate: 2024-08-12 03:07:42 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 diskless.8: show in `apropos pxe` + tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1378 --- share/man/man8/diskless.8 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man8/diskless.8 b/share/man/man8/diskless.8 index 8839e27e11ba..cc49854ae850 100644 --- a/share/man/man8/diskless.8 +++ b/share/man/man8/diskless.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt .\" Updated by Luigi Rizzo, Robert Watson .\" All rights reserved. @@ -24,12 +27,12 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 3, 2020 +.Dd August 11, 2024 .Dt DISKLESS 8 .Os .Sh NAME .Nm diskless -.Nd booting a system over the network +.Nd booting a system over the network with PXE .Sh DESCRIPTION The ability to boot a machine over the network is useful for .Em diskless From nobody Fri Sep 6 18:35:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKH6F8Nz5VRlV; Fri, 06 Sep 2024 18:35:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lKH4Dzlz4W9w; Fri, 6 Sep 2024 18:35:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZhGV2I8tVu8QLdHBzSpBP3+rq1YR+hIrx7buhitt8OE=; b=TYkCcWQPYOYQJfaWJbtCfyvhb7z5PD9I+Wxsie0VEkbV0kMHA3GuXevB+PJIQOLcRS4iZO vBPvPSvvsLERavny1TQgxqZjokZGOiHm6oIdzp1UfIPzI3VM+tSDo5y0R8FWqc+kHdleJt IVYkhV9sZQWhrmG9xPVoNjlmaPVuhf84SUkc61mchrv9a/o6NjiJmC3SSclvcDhPkWhd/k Di+u8nUDh7COAZ6ytm5Yt4DLzClwfG2AkgpKHKUsSnefeR+R2dSE/QMxhsb1wmbzvTc7za FFtt4R8BN/S7Txi8g+cp1pihv2jHRqF9usugIBXVk9rx1enkHcOdzS0l+H+XyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647731; a=rsa-sha256; cv=none; b=e+3i6EfNgEJuftysmKnPbLhH6tDh6fkcrZkguQyS5LktIS/2bw2iPCtdKQyRTHAEq4Ydsa 6tVnNWuW3ofoQWVkcIeWwcQACiIxjRVzJzfH/WIW0sHFGQz0hOkuwZlNc04TbRoG/7mqy4 acFbUh063lnhE+YvO/idXSDXUksrsJET73wJTiCQV1sQ8Syh/hMW0ph9IKPi9cId6Vtj25 GzigZ9oN/dBrqwmP6favf1lntVpvoYpv0WG2lENSIxtSb8INUVCTihbg9zEGqf4TLMX/Xc kaQlPd0V2bN/TuOMr7KtaMLihTwDN1uBClGntGkd3t3oBN+KAfrCe54XlqrvGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZhGV2I8tVu8QLdHBzSpBP3+rq1YR+hIrx7buhitt8OE=; b=jzPxBooiJLMrCeHvwWQSY1r4BpJITG4B0G4Oh1xWZy6WwRv3rh9Bl7TMAJZZPEuGveUXhx abrhztW72Cg7oz+Egl7b+lw+OYJMtUpR6jKmIpXrgLQc3/Jtf6w23TaeCCFEOEvN36PR6c AWrCUmfyuHQT2jPZ3WPgN+MxCpGdLe8CIr/MqxmbGICz1Vfi+A4aiabDnFQ0VkondhqFd5 bREhTsCfrnRzwnCCn1KffIPhGv+Rc/7tR0ru7OuzCz8qWMUdDEEw/5/yg2zJ8aWA76JP// AZupfuv13jt/5YCvxHyON+EEVy+nHiERcJmNKEu+AE+NxGviMr5t9NCPmujAvg== 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 4X0lKH2qXhz12nT; Fri, 6 Sep 2024 18:35:31 +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 486IZVFe011612; Fri, 6 Sep 2024 18:35:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZVav011609; Fri, 6 Sep 2024 18:35:31 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:31 GMT Message-Id: <202409061835.486IZVav011609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0d8effbd6e45 - main - growfs.8: align and alphabetize options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d8effbd6e45643154c90942f210b7f7a6ecc61d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0d8effbd6e45643154c90942f210b7f7a6ecc61d commit 0d8effbd6e45643154c90942f210b7f7a6ecc61d Author: Alexander Ziaee AuthorDate: 2024-08-12 09:39:03 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:32 +0000 growfs.8: align and alphabetize options MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1379 --- sbin/growfs/growfs.8 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8 index 9a6076017c74..9b619613f30e 100644 --- a/sbin/growfs/growfs.8 +++ b/sbin/growfs/growfs.8 @@ -61,16 +61,11 @@ The .Nm utility extends the size of the file system on the specified special file. The following options are available: -.Bl -tag -width indent +.Bl -tag -width "-s size" .It Fl N .Dq Test mode . Causes the new file system parameters to be printed out without actually enlarging the file system. -.It Fl y -Causes -.Nm -to assume yes -as the answer to all operator questions. .It Fl s Ar size Determines the .Ar size @@ -87,6 +82,11 @@ This value defaults to the size of the raw partition specified in (in other words, .Nm will enlarge the file system to the size of the entire partition). +.It Fl y +Causes +.Nm +to assume yes +as the answer to all operator questions. .El .Sh EXIT STATUS Exit status is 0 on success, and >= 1 on errors. From nobody Fri Sep 6 18:35:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKJ6KDqz5VS9j; Fri, 06 Sep 2024 18:35: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 4X0lKJ4Zqvz4WGw; Fri, 6 Sep 2024 18:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OtycRkr5Ewd5Rx4AKKdR5yo/+K7k+aW7tUpB4Jf91KY=; b=TeTFJdWFozcqbeR7otnMv2Tclpgm2ttrjovVASJSWvxVBxvUwxJcrU+2mEbu4YRfbEgulZ lr1QJuvpJJb/cA+O+PcWtFqLYStIkzS/DAb34Y93+dBokmzwUaEXVJuXQr5QuQeYYjWpgT SLJnzsi31/16rtE/qmBhyiMgyOrea3QEGNLUFPvz4ARTf/yRC5cEDOM7a37z8q8qu94GEt 8a23GCQvwdROpf5In+XvvNlNb/G6JHzhw+es9P3o3Hhh7EFDFV96vAk1v4fyzqrQK/qA1F 1hJp5Bt8tV8JwqNZM4qJmmpuGvI7S05SewWO7jBnJ8G2FbwJ8NM3i+wjl2a8MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647732; a=rsa-sha256; cv=none; b=coOK1gRTs2JooKdSwBO43U+QUJpDvrNkjUHeUJ7e2poo1zqka2AIoNaWcYQXrDhK7gux53 RaaKd0/3tXd1x0+1hS3mW2aWWw2yj9edWolCyVXx6bpMmY+CRT98C6E/xSLJMLF0Ided/N q4JSpCL86nVULMJMV0T+eH9Ac5w4+GO/h9Fp+PeC3Om4nyFse0nSUT0xnbyp1Goiea73Zf jh0ctSKp4eUpL7+VT21CU8aX3Yc3jOXZfUgh2KV/hwin5RUb3sVvedUXo7xZc9GfDS6ifp DFQqYj0SKbM5pweNuq7ziptmsJyuyIcpWMoycM6MyMPskoEJ3xrx2X8gvN1D9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OtycRkr5Ewd5Rx4AKKdR5yo/+K7k+aW7tUpB4Jf91KY=; b=yv+rtNUhUwd9mtBoKR0n+MhwkMCqt3RxMAkt3v6jaL2OMWt8IKbggoTJ23HJVe1KvmgmXp HNa9fZ+QOp8ZLgIuREZcNcte+ksNPcKjkdVPjyr5pCAw+RbE6IiOb45qAfWzjjvtxSaOSM qXVSrlCKczLV6EVmCV5e0DfrxwFn5HgRu5uKjtUxmJkrMAXNv2jTsmbzLzPQxiFA335wBD dnfQMxAVXNu7SUX3L4xe6O7oMrepDx0r0X2cJeZCKA+UVBY0cq1CibRCde6LCGJj8fu2dX WhX3dNgjGg1r2YvtkZ3fIsVfD/ye3au94tu2mDKbHe6cu7NZNuV/tf5noVsBSQ== 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 4X0lKJ3tHDz12KN; Fri, 6 Sep 2024 18:35: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 486IZWWd011657; Fri, 6 Sep 2024 18:35:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZWkZ011654; Fri, 6 Sep 2024 18:35:32 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:32 GMT Message-Id: <202409061835.486IZWkZ011654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a5770eb54f7d - main - geom.8: minor cleanup (markup, spdx, gsched) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5770eb54f7d13717098b5c34cc2dd51d2772021 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a5770eb54f7d13717098b5c34cc2dd51d2772021 commit a5770eb54f7d13717098b5c34cc2dd51d2772021 Author: Alexander Ziaee AuthorDate: 2024-08-12 09:59:21 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:33 +0000 geom.8: minor cleanup (markup, spdx, gsched) Fixes: 86c06f (Remove GEOM_SCHED class and gsched) MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1380 --- sbin/geom/core/geom.8 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sbin/geom/core/geom.8 b/sbin/geom/core/geom.8 index 124ea0f2be11..7f0f0b2911b3 100644 --- a/sbin/geom/core/geom.8 +++ b/sbin/geom/core/geom.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" @@ -27,7 +30,7 @@ .Os .Sh NAME .Nm geom -.Nd "universal control utility for GEOM classes" +.Nd universal control utility for GEOM classes .Sh SYNOPSIS .Nm .Ar class @@ -66,7 +69,7 @@ which can be used for existing .Nm unaware classes. Here is the list of standard commands: -.Bl -tag -width ".Cm status" +.Bl -tag -width indent .It Cm help List all available commands for the given class. .It Cm list @@ -74,7 +77,7 @@ Print detailed information (within the given class) about all geoms (if no additional arguments were specified) or the given geoms. This command is only available if the given class exists in the kernel. Additional options include: -.Bl -tag -width ".Fl a" +.Bl -tag -width "-a" .It Fl a Print information for geoms without providers. .El @@ -84,9 +87,11 @@ Print general information (within the given class) about all geoms This command is only available if the given class exists in the kernel. .Pp Additional options include: -.Bl -tag -width ".Fl s" +.Bl -tag -width "-s" .It Fl a -When used with -g, print status for geoms without providers. +When used with +.Fl g , +print status for geoms without providers. .It Fl g Report statuses for geoms instead of providers. .It Fl s @@ -107,7 +112,7 @@ kernel module. .El .Pp Additional options include: -.Bl -tag -width ".Cm status" +.Bl -tag -width indent .It Fl p Ar provider-name Print detailed information about the geom which provides .Ar provider-name . @@ -170,7 +175,7 @@ VIRSTOR .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev GEOM_LIBRARY_PATH" +.Bl -tag -width "GEOM_LIBRARY_PATH" .It Ev GEOM_LIBRARY_PATH Specifies the path where shared libraries are stored instead of .Pa /lib/geom/ . @@ -213,7 +218,6 @@ geom md unload .Xr gnop 8 , .Xr gpart 8 , .Xr graid3 8 , -.Xr gsched 8 , .Xr gshsec 8 , .Xr gstripe 8 , .Xr gunion 8 , From nobody Fri Sep 6 18:35:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKL0jJqz5VSQN; Fri, 06 Sep 2024 18:35: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 4X0lKK5FQSz4WTs; Fri, 6 Sep 2024 18:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r6fh95SYuXEnlm3t7X91CCcwCSfGVuqxj56okX4s+40=; b=UoyCTJMKWT3IW8nWTifRcMUWxtGaWDlTMRNJUuQLE1N+Ocy57dNoY+G3Cdfp8UyjVvHKd/ m9/T+l4wv31HTGXnmJyibpX6/+OgiEXjliDTg/lmb2Ux+RGw+vSWHVj8wIpaIRIRr840lx 599905zD/hjNoUQjl4Kxusllw4vuRtY53AbXViBAKjkMbVl3D24g+9nypNaEG5BwtXQUDY j/oAkD3nLrSDCqfTGn1/IYkkBT6b0Eq9Gc8HDrvuoqttRr9hZM/Ik+L+4rupRGohm6PvjE LjdGCs7VVjXJUHJ729cQMnENetje8Gpc+MUR5UNqAMTdS5CdBe2+duiAo0PJXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647733; a=rsa-sha256; cv=none; b=sW0xMoexW5VcpkZAcU/lvRTNpcG8FbihrmEuFKBrgd8TFDZcmPSKEBvTosinISOhD4zKqZ GGHDfyvKBZynpefYXhTiepqQ15IDvRxkJgFLkps/NQiO1Yc7NrF0y1ffH8vcPm5bJaYRL+ DFm+sSUQaKQ0SDlZqSWwDstHRWcUmRWjySgdIXA6/iuU776gpuy4uahBSvxq+MwMMLoGY6 m4yLoiL4BNOuQSmUcUf2zDs329c2F7lzCui87iTsxx1wZzfzze7NPGHw/9PogmJ8pAhErh ZWFF2ahxyXcYX4nzkQFzopbNm4bYO7bvH3aYF4ircdgvr/3GlhyrGPpN4FG0sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r6fh95SYuXEnlm3t7X91CCcwCSfGVuqxj56okX4s+40=; b=Mf+hXl0fUYdIaza/p3x/KCVJRQeT9Vletx6X+eIy35i4PGqT1K1TjsqM57eldtkFMeTvjD LYZdUQqWY/FZldjSea0kOAXcXKua4ugP2oVhtyvLRRVEtyiiPYQJ+yXVKZ4hU1D66QSpIw oE3S+HGo51B9Ct5yxjfefetyfb7VT9cE9zXXGaVPwsk+LzbFwwGjvkaZebHSO1RqWQw6/g a7WYHs4u2g3KUq+h2BBpYd2qRoymcSZtTuIhoAgsOs7l57jkrTlBEtQPL1yxet60mO0M9Y lcNzrrOz7LBm4BzBYtLCOn6hsUjp0UO0v11/orEDr1iGrkPmz7MZS99zXebVXw== 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 4X0lKK4qs9z13HP; Fri, 6 Sep 2024 18:35: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 486IZXk1011704; Fri, 6 Sep 2024 18:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZXxE011701; Fri, 6 Sep 2024 18:35:33 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:33 GMT Message-Id: <202409061835.486IZXxE011701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: fe830c3bdbb8 - main - UPDATING: increase visibility of footnotes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe830c3bdbb80545711d49b5bd6fd4ec28ed9f8e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fe830c3bdbb80545711d49b5bd6fd4ec28ed9f8e commit fe830c3bdbb80545711d49b5bd6fd4ec28ed9f8e Author: Alexander Ziaee AuthorDate: 2024-08-14 01:33:07 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:33 +0000 UPDATING: increase visibility of footnotes MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1382 --- UPDATING | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/UPDATING b/UPDATING index 1aae85df0a70..01fbf9a30946 100644 --- a/UPDATING +++ b/UPDATING @@ -2022,6 +2022,8 @@ COMMON ITEMS: make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE + If you are running kernel modules from ports, see FOOTNOTE [1]. + To test a kernel once --------------------- If you just want to boot a kernel once (because you are not sure @@ -2038,8 +2040,7 @@ COMMON ITEMS: make buildworld make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installkernel KERNCONF=YOUR_KERNEL_HERE - [1] + make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] etcupdate -p [5] make installworld @@ -2057,7 +2058,7 @@ COMMON ITEMS: make buildworld - make buildkernel KERNCONF=YOUR_KERNEL_HERE + make buildkernel KERNCONF=YOUR_KERNEL_HERE [1] make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC @@ -2076,8 +2077,7 @@ COMMON ITEMS: make buildworld [9] make buildkernel KERNCONF=YOUR_KERNEL_HERE [8] - make installkernel KERNCONF=YOUR_KERNEL_HERE - [1] + make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] etcupdate -p [5] make installworld @@ -2097,8 +2097,10 @@ COMMON ITEMS: messages there. If in doubt, please track -stable which has much fewer pitfalls. - [1] If you have third party modules, such as vmware, you should disable - them at this point so they don't crash your system on +FOOTNOTES: + + [1] If you have third party modules, such as drm-kmod or vmware, you + should disable them at this point so they don't crash your system on reboot. Alternatively, you should rebuild all the modules you have in your system and install them as well. If you are running -current, you should seriously consider placing all sources to all the modules for From nobody Fri Sep 6 18:35:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKM0RJBz5VS1Z; Fri, 06 Sep 2024 18:35: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 4X0lKL5lyrz4WdJ; Fri, 6 Sep 2024 18:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=peGKyR7dXjHFMGInwctc8TBeXunaQNfs9COqCUA/cAI=; b=qxDWBv6Qt7rR/Sp1Gb11UxHe+fQEdAN5m6q8kr1ujFm6BzqrrJahfoILlXClKp7W1mcpzL imqlE8WxlwdsJsPFEY1Z2FN+alnbqG8b18UV2QeiRKDPAQzbthkX4gixCs/khOefCi43/g qOMI2bQT2lz77DB36zfi6m1OfQKK5vAyKjb4+VLOPRzApKm9XO+FUy0O9OxcKqqiTdqO2t vDTRRcUTZGhJTEB0ZpeSl5Rm5r56u4P76J0QSVRrj169Z8rz0GYCS5BNEaoRY8XQVmciBF 9wnajSS3Jomf05bZf5nylGukTv0yKDkA+9QI4xeRnHpeMyWFaETn6Yez3YkoVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647734; a=rsa-sha256; cv=none; b=DMH1BL9q1JblzFVXnPSxcMR2UHf6vPzVrIlSJRJiselzCpUR5CZdtN+NkajcBP2rKfo70d J75ft8nb5b/+E3unR9z7jn9CVoKa2j0tPMJ1/6d7ixi78MRAPYAKqV/jFLp9xOhoHFGyhr hO2SGikn63iOEtxDs5UYii799+kbu4kXlth0KD7x4NnAvt0o+0VazUO3aZ/895aQehNNvx Xra0QLx2Y8ZYpOAM+Wh6CL9iuhdZre7ahqpXahB8cNVSQCxjg9rrR4XljdGXJch/Nr9y9d PBY2wpLa26gZGSQFJ+gTbTqLhxKsxfjmRHQXLpeG4I5omaM3zaGpsKHh5ycdBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=peGKyR7dXjHFMGInwctc8TBeXunaQNfs9COqCUA/cAI=; b=pk7TIo6IlkaO3YwbVppeXAojSNorNIivMBKB0U/+chcJFCpXAQiepTfZwzchjdTvlG0vKY UsLKsUcbp4WHrx0re5e/9VV6hLerU3qu78iMmA3B1Ijb15g0S56holOeutz8UOA0AGz5ew 8TyJON09ZAmWIWPRptF4cwrVTUggNuENGkZ2lW0Tnc8pxHmeR0+dLD9wM5qRgvVttYJHNs ioCuqoNP+xygjcnVK4fj/14Q/jGt5JjlXKDfojDRhjHHYE0apAMgRmBjih6IQ8AUxmotzQ hjMWf8pTlbKFFOGwS+MjY4Aa0EmBh4YD235+5rtmIH6zXC+A+27Y3koWuQErVg== 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 4X0lKL5LsKz12nV; Fri, 6 Sep 2024 18:35: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 486IZYEi011752; Fri, 6 Sep 2024 18:35:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZYf3011749; Fri, 6 Sep 2024 18:35:34 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:34 GMT Message-Id: <202409061835.486IZYf3011749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4c72525953fd - main - ure.4: description consistencies + tag spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c72525953fdf618a3fc0a45f3ef3f071dcc0c52 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4c72525953fdf618a3fc0a45f3ef3f071dcc0c52 commit 4c72525953fdf618a3fc0a45f3ef3f071dcc0c52 Author: Alexander Ziaee AuthorDate: 2024-08-14 06:50:18 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:33 +0000 ure.4: description consistencies + tag spdx + consistent document description languague with other USB-BaseT drivers + mention newly added adapters from 6ea4d9 + attempt to mention rgephy(4) phys feed into ure interfaces Fixes: 6ea4d9 (Move RTL8156 from cdce(4) to ure(4)) MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1384 --- share/man/man4/ure.4 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/share/man/man4/ure.4 b/share/man/man4/ure.4 index 942764109dd8..f5452fa8463b 100644 --- a/share/man/man4/ure.4 +++ b/share/man/man4/ure.4 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2015-2016 Kevin Lo .\" All rights reserved. @@ -23,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 3, 2024 +.Dd September 3, 2024 .Dt URE 4 .Os .Sh NAME .Nm ure -.Nd "RealTek RTL8152/RTL8153/RTL8153B/RTL8156/RTL8156B USB to Ethernet controller driver" +.Nd RealTek RTL8152/RTL8153/RTL8156 USB Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,15 +54,20 @@ if_ure_load="YES" The .Nm driver provides support for USB Ethernet adapters based on the RealTek -RealTek RTL8152 and RTL8153 USB Ethernet controllers. +RTL8152, RTL8153/RTL8153B, and RTL8156/RTL8156B USB Ethernet controllers, +as well as USB Ethernet PHYs provided by +.Xr rgephy 4 . .Pp -NICs based on the RTL8152 are capable of 10 and 100Mbps speeds. -NICs based on the RTL8153 are capable of 10, 100 and 1000Mbps operation. +NICs based on the RTL8152 are capable of 10 and 100Mbps. +NICs based on the RTL8153 or provided by +.Xr rgephy 4 +are capable of 10, 100, and 1000Mbps. +NICs based on the RTL8156 are capable of 10, 100, 1000, and 2500Mbps operation. .Pp The .Nm driver supports the following media types: -.Bl -tag -width ".Cm 10baseT/UTP" +.Bl -tag -width "10baseT/UTP" .It Cm autoselect Enable auto selection of the media type and options. The user can manually override @@ -86,7 +93,7 @@ or .Cm half-duplex modes. .It Cm 1000baseTX -Set 1000baseTX operation over twisted pair. +Set 1000baseTX (Gigabit Ethernet) operation over twisted pair. The RealTek gigE chips support 1000Mbps in .Cm full-duplex mode only. @@ -99,12 +106,12 @@ mode only. .Pp The .Nm -driver supports the following media options: -.Bl -tag -width ".Cm full-duplex" +driver supports the following media options for 10/100 operation: +.Bl -tag -width "full-duplex" .It Cm full-duplex -Force full duplex operation. +Force full-duplex operation. .It Cm half-duplex -Force half duplex operation. +Force half-duplex operation. .El .Pp For more information on configuring this device, see From nobody Fri Sep 6 18:35:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKN1Fwlz5VSQR; Fri, 06 Sep 2024 18:35: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 4X0lKM6kdlz4WXW; Fri, 6 Sep 2024 18:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fW4DfKaS8N28A+eRgZwzoJ8F3LrsIWDh7gg4Qrl4Bm0=; b=hY6eJW8QE0oFx09kRTl5zMU/ChiP1gHKwerqmneZSV3xYaK/d+7NF+vDbjZssCROkvldr7 WnckfvqYlY4eZ1UQQdoMDW0WCouhFiAkTEqOwM2X4SYA0wDFHPEvXqewzuM74W0f4x9mAn ELmubz2n4ZaibBaOcrGAQGqQfqr3HxaI1f98vt3wcGRhj8EL5CcY18wfHMgg1pJx28HxIz 1bt2GJFY8u8b+sZauTYwXx/5xLC8ZqBIK7rojKCf5Qfs88YAmI5wPKqBtFJwA98SGzz9dl PiU7VnxMy66mPsp8QyuNfd8UWPudBJ/d2Sj1syECbe/GZ986S9P4j7eQrIObxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647735; a=rsa-sha256; cv=none; b=RH5j8HUSNkw3GsJGhStByKWgLXJrwEcLO+K+y5Gs2ExO5yA7rdlGwlqwXKGGB/IRIdFe05 rgno48VdIqAKsx4+pH2t8dg7DKJn/rAHIYzO4jXMiSBGUK/wD2uoJeXVJLtya/d+Mt2pBe jGAkGlEHl9ZtVABZyrNDqVxrluocG2CHYYZCMa62aOIQsWaGTws28XqIhxShBein6cEyV6 2y0UD/PqWTDT+RqRuP3kbDyDyYwVzFqj6Glo1e7t4fUGMwPuDUCvHbotkM9RavY71gY6G3 kOtWcCFsGM8QQaPkqLQrUSSim3hSiHLfKxdz4/q6vvw3omtV5GcpQwFeWS+nbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fW4DfKaS8N28A+eRgZwzoJ8F3LrsIWDh7gg4Qrl4Bm0=; b=PTU9U825ULlylLFjHgXYWpZawIN3ur7xMJssa8lMUSkV4bNW5neFX98nTZ3P4BFAqCz34y 3A4XX+zBjC2IKCUu6ngnpzA+j0c7Oo87WXILCvGynLQVReVa1ZYGpY/ap2JPBU8p53C4Ms kxJ85GCKcnOz0NkVUdAoEbyCuKwDBCTfRGOG9PwmzhTr1EyjvULyITIAmKcxtGNE6DG5S1 N7Vb4IcU59Lqa4lhvMhmqwg047Pna3c92TTtV7UJx/wnhgDGxmYa2B2ZdScuCFC/TQ2Io6 PKbngw65HFnwxpw8D4XVfjkOkBeiucQDpDeP2f9uBdHZ8QHkddG9qJ7TFWuCcA== 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 4X0lKM6L1yz12Z7; Fri, 6 Sep 2024 18:35: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 486IZZoj011813; Fri, 6 Sep 2024 18:35:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZZiC011810; Fri, 6 Sep 2024 18:35:35 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:35 GMT Message-Id: <202409061835.486IZZiC011810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5e6bef460d9d - main - Fix "version introduced" in two manual pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e6bef460d9dc3a1ef567f9602b04a252b554b67 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5e6bef460d9dc3a1ef567f9602b04a252b554b67 commit 5e6bef460d9dc3a1ef567f9602b04a252b554b67 Author: Tom Hukins AuthorDate: 2024-08-17 20:15:50 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:33 +0000 Fix "version introduced" in two manual pages Signed-off-by: Tom Hukins Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1385 --- share/man/man4/acpi_ged.4 | 2 +- share/man/man4/gve.4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/acpi_ged.4 b/share/man/man4/acpi_ged.4 index c87c7b3e97c9..98baabdde796 100644 --- a/share/man/man4/acpi_ged.4 +++ b/share/man/man4/acpi_ged.4 @@ -53,7 +53,7 @@ This may generate optionally ACPI notify for another device. The .Nm device driver first appeared in -.Fx 14.0 . +.Fx 13.3 . .Sh AUTHORS .An -nosplit The diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index 54e59b86108b..95c125507bd5 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -208,7 +208,7 @@ Please email gvnic-drivers@google.com with the specifics of the issue encountere The .Nm device driver first appeared in -.Fx 14.0 . +.Fx 13.3 . .Sh AUTHORS The .Nm From nobody Fri Sep 6 18:35:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKQ31XPz5VSGJ; Fri, 06 Sep 2024 18:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0lKQ1bgbz4WY5; Fri, 6 Sep 2024 18:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KT+HP03IIc7RXBzCLcXA1xCicEiF7XcQs3DTbGurAAg=; b=FBO8iJD5gnCquUnwBiuXdxg8s3RIg/c4QBGt5XlA33Rsm3Fi9jGbXSKLu3+JWAwfGZq7n+ 12jVzEVgM8EzzMMPULquJg3HJT3Yfdq1ZSN2jxmpzFZkmkKtKezkKYTOvvpmCWvNarzFz/ lwnGM23po7HS5xo0Sbb4AfhHzBymE8D6/9ridW9cfsupD7Aadqgms2Igxiw+VEzOtglOie 6WaVECW/q8Y13lFQBf/AMGgsJLoZ2cLi1/BIwKmqYAh9+w854kN8nRkJU4WdK29ZAZkkXh 8vDxQWzDKLZlpZGXzml9ph/Feu0VMkTr8yBiiHqKgbc0tXKjNH6b58/qAKcHBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647738; a=rsa-sha256; cv=none; b=voEnq6KRP3Xpz2n4p05uYnc8umLEeqywMrv+lxzmBEWWhoMWqyTocbotFG2buzwl1LAy06 OJ85Id0eoYi7MxROEHJVp751yXO6gYDz+6HmAPEuAuUPxcAlOcFRzvdu9qiAWXfTJcIbaT lIjWFyDGIPc6JDaEZYClmaYFtobSuNi85ILsi+kZ7nCD82Bf5pd8PqTkmkIqeYXPDEDIPg EDuzG12j9i1iHf762i9aRhqwIf2TnmIim3/oxpRH/PaShK/IwoBLUMdvgMMER291Bu1INv xSCz9EoqP14og7RDoczk0JMmYOFPHWpQiReNt2UffnrThj1YeF44Mv7vl8aPow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KT+HP03IIc7RXBzCLcXA1xCicEiF7XcQs3DTbGurAAg=; b=gofXVymqH0c9UYG7xmUYlOMZVkKXDgIc89hbmwZgleaMyNV82YPrm2kQSRsDggZU/KCpod f2zQ3xgPe/foHWYwr88JqNH6W4ko+WMVA8m0+5+DVFuu1SVy8gMU26QZsJbDLV/v7Z2HQf /D34iFs4D3wHRDRHe1ppX8c1boILvJ2Ot3x7ggKcTSEVn9lbQbg6t7CsOSOPeNzmZSUdRT QC/eBQSXeQ69o8W/N1tSwWnMg980GlWKZGqMdv7TFrYzt8JsSEASGOMFNOtl3qwHPwQRJ+ xJ/a8IkgKB18qmxKuh4UUWr3LGVrzVMWM+gsNebMa2Yg5DZqTuWiAC5Ge1hISw== 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 4X0lKQ1DFzz135J; Fri, 6 Sep 2024 18:35: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 486IZcBB011891; Fri, 6 Sep 2024 18:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZcHT011888; Fri, 6 Sep 2024 18:35:38 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:38 GMT Message-Id: <202409061835.486IZcHT011888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2b7f2890a812 - main - dummynet: fix pie List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b7f2890a812eb09dccaa8069483566a3b292338 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b7f2890a812eb09dccaa8069483566a3b292338 commit 2b7f2890a812eb09dccaa8069483566a3b292338 Author: Franco Fichtner AuthorDate: 2024-07-29 14:38:00 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:33 +0000 dummynet: fix pie Since 26b9e1f07fa codel was fixed but traffic was not flowing for pie too. Apply the same fix. MFC after: 1 week Sponsored by: OPNsense Differential Revision: https://reviews.freebsd.org/D46182 Also see: https://redmine.pfsense.org/issues/13996 Also see: https://forum.opnsense.org/index.php?topic=41827.0 Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1390 --- sys/netpfil/ipfw/dn_sched_fq_pie.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c index 632bfd4b7152..06700b0f93af 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_pie.c +++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -744,6 +744,9 @@ pie_enqueue(struct fq_pie_flow *q, struct mbuf* m, struct fq_pie_si *si) } if (t != DROP) { + if (m->m_pkthdr.rcvif != NULL) + m_rcvif_serialize(m); + mq_append(&q->mq, m); fq_update_stats(q, si, len, 0); return 0; From nobody Fri Sep 6 18:35:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0lKP5ksKz5VSJ7; Fri, 06 Sep 2024 18:35: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 4X0lKP0z5Xz4WSN; Fri, 6 Sep 2024 18:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKCpINCa1gbJbWjJeVDymlhmLpQJxxnYGHL2BTedaRM=; b=Rwl/5H63YQyFm3bQyn0/MHteV9rNiCWntddf7vmhxt+1y42HFsDRMv7bViWGhc8pmd0hEi VMIzQxmOvEf+wnpHEKZXcgC/TP1zr9WOpCNUrUvVL6NghdovVzGwAmKGC3leMpfQQNp+xC KZCxArZiMAOIIolaoxbntUsiebn4TpSKy8nsGL04g/7nf88E+3f5khxpT9HP95E/oeY6eA sZpKDP7WylIL0x5lJ1WZFBrwBIcU57A3c1QnYhRel3ntFFF7yjXoL5tOvbH2C/VHqrEks3 gB1k9s9STG68ivqGuvAeLdnfY6sCnwTGOTDSuShEP6Ul9lGI9PTxgN8qqcwjtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725647737; a=rsa-sha256; cv=none; b=pluukDcGkevs/9v0RM5WXw8JjA1oLT/9IcrOeIbBoYLOnknDjHSpmEA2ZmUD8BFuzikgj6 xNtgX1/vq7r1Azpd8aPp4rLwCLK1rYT/n0iB3t4/+xd7kjVkv9dmP/D56Z6jE3zpUYgeAy u2cGNz7jT0R5ejC0OgUXoQPEJml8DMRWiBhB1pQlTG+4bSLeBREZEy2rwrJpUCj3mzUWoB ELF6Oli60HsmxlCv9bCIvnhMUUNjPoSxrQqpYndoGuQReL1RuArELgnBvn16V99ok9CTj/ 7P9orT7k0ISwoxPNQkkPxp+m48knRsyVDUuPgVY7ej//HGl7YRwSJZreWnmTcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725647737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKCpINCa1gbJbWjJeVDymlhmLpQJxxnYGHL2BTedaRM=; b=W4E+NqojrLheyC8EVybOgpqq8BNYbnzaSlXFsH9JHKXr2Bs/jU6PNpqG+k/qC9y/HOsZGv SWvVq4V6fSnU3GsxeF52EWNStln0rUZi2lhPqAPm1vkkb2X+4ZyTVDJlsZwOQT9jJaYkv/ IWYmCw5tmtvUVxq84gRfzziMGWqpx5kEyOPTnwF1TWVNrxuiL5Fv5kSRTEtLtUyUIdUqeR UK6fZRC25DzSCi/G4szMAE1g5CeA759sd2uDU86ioYVWjTnOS0SBkxMQahrhaZ+WmMNYCH 66P3C4c2iNyb0/uDcR5K7PW9F2Tv+LtUMix89mjQa/uiPPph1Cr1rOz/FAlj1A== 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 4X0lKP0DNnz12nW; Fri, 6 Sep 2024 18:35: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 486IZaOU011855; Fri, 6 Sep 2024 18:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486IZaO0011852; Fri, 6 Sep 2024 18:35:36 GMT (envelope-from git) Date: Fri, 6 Sep 2024 18:35:36 GMT Message-Id: <202409061835.486IZaO0011852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3f0efe05432b - main - libefivar: Fix AcpiEx print logic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f0efe05432b1633991114ca4ca330102a561959 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0efe05432b1633991114ca4ca330102a561959 commit 3f0efe05432b1633991114ca4ca330102a561959 Author: Jose Luis Duran AuthorDate: 2024-08-20 11:58:00 +0000 Commit: Warner Losh CommitDate: 2024-09-06 18:34:33 +0000 libefivar: Fix AcpiEx print logic Add logic that checks if the code doesn't overflow ACPI_EXTENDED_HID_DEVICE_PATH node when searching for optional strings. If the string is not provided in the device path node default value of "\0" is used. Upstream PR: https://bugzilla.tianocore.org/show_bug.cgi?id=4555 Obtained from: https://github.com/tianocore/edk2/commit/96ed60dfd7d4818a532216d64ee87b13fae5c726 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1388 --- lib/libefivar/efivar-dp-format.c | 72 +++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index d97603c41dcb..72e024470a11 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -478,23 +478,41 @@ DevPathToTextAcpiEx ( ) { ACPI_EXTENDED_HID_DEVICE_PATH *AcpiEx; - CHAR8 *HIDStr; - CHAR8 *UIDStr; - CHAR8 *CIDStr; char HIDText[11]; char CIDText[11]; - - AcpiEx = DevPath; - HIDStr = (CHAR8 *)(((UINT8 *)AcpiEx) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); - UIDStr = HIDStr + AsciiStrLen (HIDStr) + 1; - CIDStr = UIDStr + AsciiStrLen (UIDStr) + 1; + UINTN CurrentLength; + CHAR8 *CurrentPos; + UINTN NextStringOffset; + CHAR8 *Strings[3]; + UINT8 HidStrIndex; + UINT8 UidStrIndex; + UINT8 CidStrIndex; + UINT8 StrIndex; + + HidStrIndex = 0; + UidStrIndex = 1; + CidStrIndex = 2; + AcpiEx = DevPath; + Strings[HidStrIndex] = NULL; + Strings[UidStrIndex] = NULL; + Strings[CidStrIndex] = NULL; + CurrentLength = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH); + CurrentPos = (CHAR8 *)(((UINT8 *)AcpiEx) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); + StrIndex = 0; + while (CurrentLength < AcpiEx->Header.Length[0] && StrIndex < ARRAY_SIZE (Strings)) { + Strings[StrIndex] = CurrentPos; + NextStringOffset = AsciiStrLen (CurrentPos) + 1; + CurrentLength += NextStringOffset; + CurrentPos += NextStringOffset; + StrIndex++; + } if (DisplayOnly) { if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A03) || ((EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A03) && (EISA_ID_TO_NUM (AcpiEx->HID) != 0x0A08))) { - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "PciRoot(%s)", UIDStr); + if (Strings[UidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "PciRoot(%s)", Strings[UidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "PciRoot(0x%x)", AcpiEx->UID); } @@ -503,8 +521,8 @@ DevPathToTextAcpiEx ( } if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A08) || (EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A08)) { - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "PcieRoot(%s)", UIDStr); + if (Strings[UidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "PcieRoot(%s)", Strings[UidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "PcieRoot(0x%x)", AcpiEx->UID); } @@ -535,7 +553,10 @@ DevPathToTextAcpiEx ( (AcpiEx->CID >> 16) & 0xFFFF ); - if ((*HIDStr == '\0') && (*CIDStr == '\0') && (*UIDStr != '\0')) { + if (((Strings[HidStrIndex] != NULL) && (*Strings[HidStrIndex] == '\0')) && + ((Strings[CidStrIndex] != NULL) && (*Strings[CidStrIndex] == '\0')) && + ((Strings[UidStrIndex] != NULL) && (*Strings[UidStrIndex] != '\0'))) + { // // use AcpiExp() // @@ -544,7 +565,7 @@ DevPathToTextAcpiEx ( Str, "AcpiExp(%s,0,%s)", HIDText, - UIDStr + Strings[UidStrIndex] ); } else { UefiDevicePathLibCatPrint ( @@ -552,28 +573,25 @@ DevPathToTextAcpiEx ( "AcpiExp(%s,%s,%s)", HIDText, CIDText, - UIDStr + Strings[UidStrIndex] ); } } else { if (DisplayOnly) { - // - // display only - // - if (AcpiEx->HID == 0) { - UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", HIDStr); + if (Strings[HidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", Strings[HidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", HIDText); } - if (AcpiEx->CID == 0) { - UefiDevicePathLibCatPrint (Str, "%s,", CIDStr); + if (Strings[CidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "%s,", Strings[CidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "%s,", CIDText); } - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "%s)", UIDStr); + if (Strings[UidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "%s)", Strings[UidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "0x%x)", AcpiEx->UID); } @@ -584,9 +602,9 @@ DevPathToTextAcpiEx ( HIDText, CIDText, AcpiEx->UID, - HIDStr, - CIDStr, - UIDStr + Strings[HidStrIndex] != NULL ? Strings[HidStrIndex] : '\0', + Strings[CidStrIndex] != NULL ? Strings[CidStrIndex] : '\0', + Strings[UidStrIndex] != NULL ? Strings[UidStrIndex] : '\0' ); } } From nobody Fri Sep 6 20:53:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0pNr53qSz5Vy1b; Fri, 06 Sep 2024 20:53:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0pNr32b8z43vb; Fri, 6 Sep 2024 20:53:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 486KrfSp014035; Fri, 6 Sep 2024 23:53:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 486KrfSp014035 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 486KrfOI014034; Fri, 6 Sep 2024 23:53:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Sep 2024 23:53:41 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling Message-ID: References: <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4X0pNr32b8z43vb On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad > Author: Sebastian Huber > AuthorDate: 2024-06-14 07:30:28 +0000 > Commit: Warner Losh > CommitDate: 2024-09-06 18:34:30 +0000 > > kvprintf(): Fix '+' conversion handling > > For example, printf("%+i", 1) prints "+1". However, kvprintf() did > print just "1" for this example. According to PRINTF(3): > > A sign must always be placed before a number produced by a signed > conversion. > > For "%+r" radix conversions, keep the "+" handling as it is, since this > is a non-standard conversion. For "%+p" pointer conversions, continue > to ignore the sign modifier to be in line with libc. > > This change allows to support the ' conversion modifier in the future. > > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/1310 > --- > sys/kern/subr_prf.c | 27 +++++++++++++-------------- > 1 file changed, 13 insertions(+), 14 deletions(-) Again, isn't rtld_printf needs the same change? From nobody Fri Sep 6 20:55:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0pQn42z6z5VyGt; Fri, 06 Sep 2024 20:55:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0pQn0Stjz44Xl; Fri, 6 Sep 2024 20:55:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 486KtLwx014113; Fri, 6 Sep 2024 23:55:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 486KtLwx014113 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 486KtLI3014112; Fri, 6 Sep 2024 23:55:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Sep 2024 23:55:21 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5d889e60c15c - main - amd64: move the right parenthesis to the right place Message-ID: References: <202409061835.486IZJxv011127@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409061835.486IZJxv011127@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4X0pQn0Stjz44Xl On Fri, Sep 06, 2024 at 06:35:19PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=5d889e60c15ce7856cb9a9bc258dab8aaeb94efe > > commit 5d889e60c15ce7856cb9a9bc258dab8aaeb94efe > Author: Wuyang Chung > AuthorDate: 2024-08-02 06:44:38 +0000 > Commit: Warner Losh > CommitDate: 2024-09-06 18:34:31 +0000 > > amd64: move the right parenthesis to the right place > > Reviewed by: imp, emaste > Pull Request: https://github.com/freebsd/freebsd-src/pull/1356 > --- > sys/amd64/amd64/machdep.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c > index 025c3c365de5..f4b3b9702e00 100644 > --- a/sys/amd64/amd64/machdep.c > +++ b/sys/amd64/amd64/machdep.c > @@ -1382,7 +1382,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) > */ > for (x = 0; x < NGDT; x++) { > if (x != GPROC0_SEL && x != (GPROC0_SEL + 1) && > - x != GUSERLDT_SEL && x != (GUSERLDT_SEL) + 1) > + x != GUSERLDT_SEL && x != (GUSERLDT_SEL + 1)) > ssdtosd(&gdt_segs[x], &gdt[x]); > } > gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&pc->pc_common_tss; The moved parenthesis are not needed at all, and should be removed according to style. Same for the () in the previous line. From nobody Fri Sep 6 21:14:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0psM0mDhz5W0VX for ; Fri, 06 Sep 2024 21:15:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0psL483Cz46R3 for ; Fri, 6 Sep 2024 21:15:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-20570b42f24so32718345ad.1 for ; Fri, 06 Sep 2024 14:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1725657301; x=1726262101; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HzIzFTq9mDk4msVPgceO6acp7BBqMvQFAOj2TI3rMm0=; b=TWPd0OjnaczrjLuae4AMRU4kBkDiGI5kv9Gtapdvz1bl0Kpp1PdPvbyVw2K//lrlLA Gf+uFyelbjWPXaVwk2oUuzOeo0jkBH4h3uIxCyQaIZq2S1X1U8qWTqioH1ex9m7nNMuJ ef3q5r35fAnsdvctZyekVg8HTzChVZiMkFmMInK7WhLJlKyJQDZ6sfQcDldBWkO/lpCT NHibZWLPkXlXRVHOpD+ofQuQaOMeEc0O6SxJ+/H/SIZefY7pY7wrbvqZQ5w0RO8jWKy5 NtYrq+vdnYNk/QeXlWTdooeW+Cbm8LbfWpu4trXGi6Bl4IXUjMDYpSfNJZu0n9Iq7GZo Ha5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725657301; x=1726262101; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HzIzFTq9mDk4msVPgceO6acp7BBqMvQFAOj2TI3rMm0=; b=eQjdtsj6mS7wOJK0Rl76+iCx0YQqBzxltULl1h7cY9dnqGuROXXw8JFYGutwfU/Fqv MBKNoLha7NQm6FsI3m2c31Fq1tXeAZOhoFh3xdG56MjDyD8u+t2qW2hq8g9L0oVfCxRB eiRNPLSB+NgIjTlxe+D7+hy1mpdSQgZGJ5MhHPHVvlxk9nYpL/kotx3fHbVxh6SaL37z b7COaS6QFRr55648bHhIdhBnHAIDVVnUMF/0hZhofArNrXnYtiGs+/5Aa2/6JwLRp13x D8ME0FvbQpuJVRy9+cUnj/2cYO1iVyhlrxaiCnIcAIp7Z7OJjc3n09faxm5+aJVKDE+y RGRw== X-Forwarded-Encrypted: i=1; AJvYcCV9kG4VvdA7aeIfbArdg6B/TFgqxzqEMQb+wgNNfD0u9Asn3OIQ7m9OHQkmUN4pUu6tuY2QNia86ekEulLFFA+KwCZd@freebsd.org X-Gm-Message-State: AOJu0YzCJMzfOjpgyem0MMv35WDF1jdKh5c/xrgd++V2j0EByWp+e6BO PJXkL+NiXWAWdkOrJ6CsqamhuT8JqVacfat6O0XR7RQXlQXA5yoFqy1cYMC8vACSlC1au2btIdg XgWUogQLznMu+owsLQXceRvHFYcaEMFORh0paCQ== X-Google-Smtp-Source: AGHT+IFUiiYiCI0xQiZJqVT65qJSjrYo4TD99r6QWO2KbKHq3W6i/wFkkHuOSRStiYFwyPTNkWdwOe5F3oXq+v71Ih0= X-Received: by 2002:a17:90a:f493:b0:2da:5edd:c165 with SMTP id 98e67ed59e1d1-2dad50e8866mr4731925a91.30.1725657301017; Fri, 06 Sep 2024 14:15:01 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 6 Sep 2024 15:14:49 -0600 Message-ID: Subject: Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000006e8382062179e610" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X0psL483Cz46R3 --0000000000006e8382062179e610 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 6, 2024 at 2:53=E2=80=AFPM Konstantin Belousov wrote: > On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D07d90ee0a62110e5161bb0b8a3a0b1b= 9d2beabad > > > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad > > Author: Sebastian Huber > > AuthorDate: 2024-06-14 07:30:28 +0000 > > Commit: Warner Losh > > CommitDate: 2024-09-06 18:34:30 +0000 > > > > kvprintf(): Fix '+' conversion handling > > > > For example, printf("%+i", 1) prints "+1". However, kvprintf() did > > print just "1" for this example. According to PRINTF(3): > > > > A sign must always be placed before a number produced by a signed > > conversion. > > > > For "%+r" radix conversions, keep the "+" handling as it is, since > this > > is a non-standard conversion. For "%+p" pointer conversions, > continue > > to ignore the sign modifier to be in line with libc. > > > > This change allows to support the ' conversion modifier in the > future. > > > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1310 > > --- > > sys/kern/subr_prf.c | 27 +++++++++++++-------------- > > 1 file changed, 13 insertions(+), 14 deletions(-) > Again, isn't rtld_printf needs the same change? > This time I don't think so. I'll double check though. I'd checked when this came in. Thanks for the reminder. --0000000000006e8382062179e610 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Sep 6, 2024 at 2:53=E2=80=AFP= M Konstantin Belousov <kostikbel@= gmail.com> wrote:
On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad<= /a>
>
> commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad
> Author:=C2=A0 =C2=A0 =C2=A0Sebastian Huber <
sebastian.huber@embedded-b= rains.de>
> AuthorDate: 2024-06-14 07:30:28 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-09-06 18:34:30 +0000
>
>=C2=A0 =C2=A0 =C2=A0kvprintf(): Fix '+' conversion handling
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0For example, printf("%+i", 1) prints &quo= t;+1".=C2=A0 However, kvprintf() did
>=C2=A0 =C2=A0 =C2=A0print just "1" for this example.=C2=A0 Ac= cording to PRINTF(3):
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0A sign must always be placed before a number= produced by a signed
>=C2=A0 =C2=A0 =C2=A0 =C2=A0conversion.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0For "%+r" radix conversions, keep the &qu= ot;+" handling as it is, since this
>=C2=A0 =C2=A0 =C2=A0is a non-standard conversion.=C2=A0 For "%+p&q= uot; pointer conversions, continue
>=C2=A0 =C2=A0 =C2=A0to ignore the sign modifier to be in line with libc= .
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0This change allows to support the ' conversion = modifier in the future.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Reviewed by: imp
>=C2=A0 =C2=A0 =C2=A0Pull Request: https://github= .com/freebsd/freebsd-src/pull/1310
> ---
>=C2=A0 sys/kern/subr_prf.c | 27 +++++++++++++--------------
>=C2=A0 1 file changed, 13 insertions(+), 14 deletions(-)
Again, isn't rtld_printf needs the same change?
This time I don't think so. I'll double check though. = I'd checked when this came in. Thanks for the reminder.=C2=A0
--0000000000006e8382062179e610-- From nobody Fri Sep 6 21:47:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0qZb3Gm2z5W3mt; Fri, 06 Sep 2024 21:47:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0qZZ0zlZz4CmM; Fri, 6 Sep 2024 21:47:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 486Ll8BI016346; Sat, 7 Sep 2024 00:47:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 486Ll8BI016346 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 486Ll80R016345; Sat, 7 Sep 2024 00:47:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 7 Sep 2024 00:47:08 +0300 From: Konstantin Belousov To: Warner Losh Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling Message-ID: References: <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4X0qZZ0zlZz4CmM On Fri, Sep 06, 2024 at 03:14:49PM -0600, Warner Losh wrote: > On Fri, Sep 6, 2024 at 2:53 PM Konstantin Belousov > wrote: > > > On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote: > > > The branch main has been updated by imp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad > > > > > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad > > > Author: Sebastian Huber > > > AuthorDate: 2024-06-14 07:30:28 +0000 > > > Commit: Warner Losh > > > CommitDate: 2024-09-06 18:34:30 +0000 > > > > > > kvprintf(): Fix '+' conversion handling > > > > > > For example, printf("%+i", 1) prints "+1". However, kvprintf() did > > > print just "1" for this example. According to PRINTF(3): > > > > > > A sign must always be placed before a number produced by a signed > > > conversion. > > > > > > For "%+r" radix conversions, keep the "+" handling as it is, since > > this > > > is a non-standard conversion. For "%+p" pointer conversions, > > continue > > > to ignore the sign modifier to be in line with libc. > > > > > > This change allows to support the ' conversion modifier in the > > future. > > > > > > Reviewed by: imp > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1310 > > > --- > > > sys/kern/subr_prf.c | 27 +++++++++++++-------------- > > > 1 file changed, 13 insertions(+), 14 deletions(-) > > Again, isn't rtld_printf needs the same change? > > > > This time I don't think so. I'll double check though. I'd checked when this > came in. Thanks for the reminder. It would be weird if not needed, rtld_printf.c was a copy of subr_prf.c. From nobody Fri Sep 6 23:42:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0t7R64fqz5WFlT; Fri, 06 Sep 2024 23:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0t7R3sJJz4X4S; Fri, 6 Sep 2024 23:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725666147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+W1sd+I0yn8+4KMARD5e1WUk5tS3lJao6YLTdQ8RDks=; b=HJlMbJv/ljXg1Brh3hVMbARv5vbpH4aU2mBXOLRm/NVVR6rcdHL/QMxquaUjySDXF9QE3C HOscxlbusF/zqKCIttZvAgAeX/9j2LYIrVu/rjToAwISvlJamwRs9kvphUnb9kS+VoX5A5 1FVdn5/RG24IAQOvVT4H+sAP4jOyEAqOhGsj0j3yR2ZePQRdggyA1ICm3waGKSm7VhpNdu ZVDeQS0jUJ0IaGx/31eNcOQ8m1VwDPtXrlxNZz1T8434NimkmCKD3/15CTARmZZd/L4AhL TnG7IIQUV+54RqEDdsjgAM/SzXJXpbyGXAT3vWBmC5X2nz69jhGCbeMrXIg6bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725666147; a=rsa-sha256; cv=none; b=Ol5BHV1SquhT2xloWK1zGK9F4U2prkjCSxWIOqmblX/q18guQ+0e2Bzmzv3SpMkoyL8Mxp C4jcm9mrs2Cc0qklnRpZq1TGH1tEjF2kGHHNJqj2JnKaau1MGjxbc7xRFdk9P7WRuI+8lb jBc52k8q4/4h9OScZWvAGXGePLd7FDFsw9Azvlik7sZe3wD9QuMk29SL61APjUfE8s3V40 JtrwIk+VeJHd0tn9Vz/a7UU2Ag1aZGMxZq0q9gOOslOgRBymQ+9gF9nunuNOxvWbXLC5UQ U3nh8VMnfyQSSEQFzKzP9rygYtzAT8zVfh2MydpOg/QtoyeEnqyX8fMQJ8g1Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725666147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+W1sd+I0yn8+4KMARD5e1WUk5tS3lJao6YLTdQ8RDks=; b=kMHIYPYYbghsbae9ruotJYaoabPsevdht7dxnPQ30TXGkuDxGmq92qhg4bK7Paz1HiB4Vk woozmcKwtfF+uJ8mECKf6hlyKvog14fKW68EAzJd4VB0xkrXEp3Z9OU8E3DuKdCxN4575f FtkjIkMZMyQSLACFU0xnVrqhGxhvKnmO+M9GIu/XfMqvLYRZJX16JEVMOrfnylzy0UxuAd JopliyGGTXXYR0+Ll4yMicqOYP1H7AQcgb+L8+JsaRe927xkoc7jk9bFqnhljUqRkfBLCg oj9gHGUkqhvkJXvjbbupnlh2njBTxgplcb0L8U+9DGaHqP46kYyVrtNDng9VfQ== 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 4X0t7R3TJZz1BWm; Fri, 6 Sep 2024 23:42:27 +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 486NgR3F038266; Fri, 6 Sep 2024 23:42:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 486NgR7O038243; Fri, 6 Sep 2024 23:42:27 GMT (envelope-from git) Date: Fri, 6 Sep 2024 23:42:27 GMT Message-Id: <202409062342.486NgR7O038243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 3df987c99d11 - main - mountd: Add check for "=" after exports(5) options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3df987c99d1194a0e43a84853e934aa0c0ab09db Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3df987c99d1194a0e43a84853e934aa0c0ab09db commit 3df987c99d1194a0e43a84853e934aa0c0ab09db Author: Rick Macklem AuthorDate: 2024-09-06 23:41:12 +0000 Commit: Rick Macklem CommitDate: 2024-09-06 23:41:12 +0000 mountd: Add check for "=" after exports(5) options Some exports(5) options take a "=arg" component that provides an argument value for the option. Others do not. Without this patch, if "=arg" was provided for an option that did not take an argument value, the "=arg" was simply ignored. This could result in confusion w.r.t. what was being exported, as noted by the Problem Report. This patch adds a check for "=arg" for the options that do not take an argument value and fails the exports line if one is found. PR: 281003 MFC after: 2 weeks --- usr.sbin/mountd/mountd.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 00293909614e..00309ed58136 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -2825,7 +2825,7 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, { char *cpoptarg, *cpoptend; char *cp, *endcp, *cpopt, savedc, savedc2; - int allflag, usedarg; + int allflag, usedarg, fnd_equal; savedc2 = '\0'; cpopt = *cpp; @@ -2836,14 +2836,18 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, while (cpopt && *cpopt) { allflag = 1; usedarg = -2; + fnd_equal = 0; if ((cpoptend = strchr(cpopt, ','))) { *cpoptend++ = '\0'; - if ((cpoptarg = strchr(cpopt, '='))) + if ((cpoptarg = strchr(cpopt, '='))) { *cpoptarg++ = '\0'; + fnd_equal = 1; + } } else { - if ((cpoptarg = strchr(cpopt, '='))) + if ((cpoptarg = strchr(cpopt, '='))) { *cpoptarg++ = '\0'; - else { + fnd_equal = 1; + } else { *cp = savedc; nextfield(&cp, &endcp); **endcpp = '\0'; @@ -2856,6 +2860,10 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, } } if (!strcmp(cpopt, "ro") || !strcmp(cpopt, "o")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } *exflagsp |= MNT_EXRDONLY; } else if (cpoptarg && (!strcmp(cpopt, "maproot") || !(allflag = strcmp(cpopt, "mapall")) || @@ -2894,15 +2902,31 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, usedarg++; opt_flags |= OP_NET; } else if (!strcmp(cpopt, "alldirs")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } opt_flags |= OP_ALLDIRS; } else if (!strcmp(cpopt, "public")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } *exflagsp |= MNT_EXPUBLIC; } else if (!strcmp(cpopt, "webnfs")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } *exflagsp |= (MNT_EXPUBLIC|MNT_EXRDONLY|MNT_EXPORTANON); opt_flags |= OP_MAPALL; } else if (cpoptarg && !strcmp(cpopt, "index")) { ep->ex_indexfile = strdup(cpoptarg); } else if (!strcmp(cpopt, "quiet")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } opt_flags |= OP_QUIET; } else if (cpoptarg && !strcmp(cpopt, "sec")) { if (parsesec(cpoptarg, ep)) @@ -2910,10 +2934,22 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, opt_flags |= OP_SEC; usedarg++; } else if (!strcmp(cpopt, "tls")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } *exflagsp |= MNT_EXTLS; } else if (!strcmp(cpopt, "tlscert")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } *exflagsp |= (MNT_EXTLS | MNT_EXTLSCERT); } else if (!strcmp(cpopt, "tlscertuser")) { + if (fnd_equal == 1) { + syslog(LOG_ERR, "= after op: %s", cpopt); + return (1); + } *exflagsp |= (MNT_EXTLS | MNT_EXTLSCERT | MNT_EXTLSCERTUSER); } else { From nobody Sat Sep 7 01:47:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0ww807Tjz5WSNk; Sat, 07 Sep 2024 01:47: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 4X0ww755Q8z4jqR; Sat, 7 Sep 2024 01:47:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/VJM4AXltIUMBn/NxUbTkqANo/lLWCITnZcPMxDBsQ=; b=lPjnZi1rhqzpGHexuAwzIHgm90cbz0lKDLq7clnhQb2rsNvj+m04ah2zhAD9Yt2GRrqImB d5e4S9VcGG+I6hDL4ic8soxhhfoI32satb7kDaf7gxxQ9JOCfpdtAFZyt21yIWroO6hq4U 7LYClylKTWUH7Y0k2FQDpmHA4m3VIa/b0z+7Hi/4GYiuwBrrkWtlwxZfRjKdqdH/TwPdIR 2FyClP5+lvhTLyG3wTv/hUcLPNUymQwaYRszFm5ED+uoyFt4B6jT8eypTA2RSIsT1C+6du TLBbZWWUM5Z8CHIqHiuQwImvxAgpzFBjaKnu0OaiE0f1f39khZwGGcRNWuRo1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673671; a=rsa-sha256; cv=none; b=YsvQ0n86l7e+91rnolTqPjh4GdnpUaTRieT3CYDkKz8RIi6GGLQH+pIFXBXdYEULmRGu/n C3Ul0FatwihBpGdKu9a1NBjD+//jW+1pO1uAF4i4tmoDK/lgjF5INbksDkFA/a1aCmK/Jq l67r6Vub8FL4e0cqf90Mn3DS1GGU1rNO0OOnLHJrjPoXUsttdDiswzSi6w5Kuna+mYgHXg cSXj9QA27H6vOkwAz9AhyRmSFFK/WSHub5hc7FBASYZMAszFDc7WlczVo0vuAKO/gvN3Fy x7uEKl+6HXihO/Ty+J970d1i2aNLzpPsamhdHYvD96CDRT4pdGetL2YM9kViOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/VJM4AXltIUMBn/NxUbTkqANo/lLWCITnZcPMxDBsQ=; b=W0vhGJGZkqUYEmC5ytK2pTCwp/NYy2ZjAwtL6aMkCXMOUv/G3LqSd9lYT6GRMIzKbXklT+ RsJaXfvWrdC8Y46ZY97TxRCyVm0bG83dv3WUYDqXlYxtL2eGkZsTeX2vd4z1OrNpb6h3Db muk+p6MfxqsBNARzVtldGmb9tIVqiktEaDF/6WIT7gFue54gRwhk0axz57EoWDPc7TXe7g p8qaPIu8vSv7uuqgLEH92qeCCryMg0kbZeAg5j7NLfyMBw1djTsKWInR8a5a5QXDh8k1n4 +PpZqggArwFKjjq7ZqTtqN8tNhgRYA6veHFAjmzDP7H5xBxEBVO/QqbBfM/Q2Q== 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 4X0ww74b7FzGPY; Sat, 7 Sep 2024 01:47: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 4871lpBl041317; Sat, 7 Sep 2024 01:47:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lpfC041314; Sat, 7 Sep 2024 01:47:51 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:51 GMT Message-Id: <202409070147.4871lpfC041314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 6f242c69b604 - stable/14 - arm/mpic: remove empty pic_init_secondary() hook List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f242c69b6049f4c319c1948da99472a53500c3f Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6f242c69b6049f4c319c1948da99472a53500c3f commit 6f242c69b6049f4c319c1948da99472a53500c3f Author: Elliott Mitchell AuthorDate: 2024-01-23 02:52:37 +0000 Commit: Jessica Clarke CommitDate: 2024-09-06 23:52:27 +0000 arm/mpic: remove empty pic_init_secondary() hook The default hook does nothing, so having an empty handler is pointless. Simple cleanup. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40475 (cherry picked from commit a8b2189c90c52e43e27614b2cca6b753a70da0ca) --- sys/arm/mv/mpic.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/arm/mv/mpic.c b/sys/arm/mv/mpic.c index 15574e409001..232eb8556948 100644 --- a/sys/arm/mv/mpic.c +++ b/sys/arm/mv/mpic.c @@ -149,7 +149,6 @@ static void mpic_unmask_irq_err(uintptr_t nb); static boolean_t mpic_irq_is_percpu(uintptr_t); static int mpic_intr(void *arg); static void mpic_unmask_msi(void); -void mpic_init_secondary(device_t); void mpic_ipi_send(device_t, struct intr_irqsrc*, cpuset_t, u_int); int mpic_ipi_read(int); void mpic_ipi_clear(int); @@ -384,7 +383,6 @@ static device_method_t mv_mpic_methods[] = { DEVMETHOD(pic_post_filter, mpic_post_filter), DEVMETHOD(pic_post_ithread, mpic_post_ithread), DEVMETHOD(pic_pre_ithread, mpic_pre_ithread), - DEVMETHOD(pic_init_secondary, mpic_init_secondary), DEVMETHOD(pic_ipi_send, mpic_ipi_send), { 0, 0 } }; @@ -565,11 +563,6 @@ mv_msi_data(int irq, uint64_t *addr, uint32_t *data) return (0); } -void -mpic_init_secondary(device_t dev) -{ -} - void mpic_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus, u_int ipi) { From nobody Sat Sep 7 01:47:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0ww86r1pz5WSX3; Sat, 07 Sep 2024 01:47: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 4X0ww861SBz4jfH; Sat, 7 Sep 2024 01:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hr3tKb4xLdGSen7w5SeSdCAD4pV2aUc6PZBw5FXorRw=; b=atDBR8/NNVLZjmJ7XibbyYCT/9zQNuV4tDdntcosReHExcfXdVc73KSCR6O1KoLRNe1bqd 8J9LQc7CJjA9m9JYYfJSZ0ObAfgsV3HfQ0u0XtK4wElUVml7uZ0lLsWrGPbk3wqFcDA9X7 ooM4tNjkG3nKifFeCZIM3wjlw6RKT/daGo0VjueFjPDdK8fT1qkbCAAiV7aVQf5eWtS8aX XBVHsqOhO1fD/WR+rehHFgkBCCS3WUN5G7MFN66UMnIMlbKtey7Pv17mtOhKEMVX01dYx6 0bz3yrTJtKio0LuB9hKYnIhzaGPHvtE/q0SKY8+kH03waUZujMQdAh1n53WFkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673672; a=rsa-sha256; cv=none; b=djuezzhphTLE/U5+cVzsMHARmWVBOz6NK/4dcTQB9BJaafzY4lNB0JImY6kivlquYAnUJe gna0SS8kumIT9TobOvqIwjkICAAJaLd7hj2pH3nEI4MhR+wD+7nyTNGZWeyEtQWAoav2PS hwzI26cz0VlKH+xOr1T8dah5ozKxcU7OU6xoRr5bcSVdFQzKUfP4RNAh8WjNrcna5c7ItA wCFbK3kDvSebLoytKaxeayam7Dz8UNHeuzFyGIWMYjj+bI1wGWFnCuUb8ACWPzmDgocCUv d5+s3H7kUq/UhJ23gM7MPUoKSFiGCfE73/8VMZ0ykRp+XM6OEKG6/T/15OXyqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hr3tKb4xLdGSen7w5SeSdCAD4pV2aUc6PZBw5FXorRw=; b=aVz2sRzaQZ9wCU4K9pu/OavBdD7hfNyMTrQQEdHP/iOFnbb6RQRjO21RlyDoYQly7eUzf6 cImaqvokTbG40yVVyQI/BkRGXF+JyapW/EBtEh7P6GwoSlgHdxpRMw01yFb80QH4Sy6Qie EwSQ3hH5AKTY3TtClMe/bx5KYYyIqR1BfI7oMLJ/fkQI8zYkGJT4IItfKmUAO57GWxp2Pv NmqoRLsOplKfvAMXYaXO7HS5f7kx7+8foRGGwo8bLkanEcKb6mFDYX7G8pwxEtongtJuSO EGH5SEGAC9itRLzaTJBNXK+KSIPRkPKTT8I9ea1ft/2LIcIsNcW4yEIWBLTgrQ== 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 4X0ww85cpMzGPZ; Sat, 7 Sep 2024 01:47: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 4871lq7H041365; Sat, 7 Sep 2024 01:47:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lqQt041362; Sat, 7 Sep 2024 01:47:52 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:52 GMT Message-Id: <202409070147.4871lqQt041362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a73592e0d013 - stable/14 - intrng: Remove irq_root_ipicount and corresponding intr_pic_claim_root arg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a73592e0d013275bd97d09d9cf168279688f7238 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a73592e0d013275bd97d09d9cf168279688f7238 commit a73592e0d013275bd97d09d9cf168279688f7238 Author: Jessica Clarke AuthorDate: 2024-01-24 23:49:53 +0000 Commit: Jessica Clarke CommitDate: 2024-09-06 23:52:47 +0000 intrng: Remove irq_root_ipicount and corresponding intr_pic_claim_root arg The static irq_root_ipicount variable is only ever written to (with the value passed to irq_root_ipicount), never read. Moreover, the bcm2836 driver, as used by the Raspberry Pi 2B and 3A/B (but not 4, which uses a GIC-400, though does have the legacy interrupt controller present too) passes 0 as ipicount, despite implementing IPIs. It's thus inaccurate and serves no purpose, so should be removed. Reviewed by: mmel, imp, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D35897 (cherry picked from commit e06afdb2856944d6db4e33d4bbe0e2dbbd057eb4) --- sys/arm/allwinner/a10/a10_intc.c | 2 +- sys/arm/arm/gic_acpi.c | 3 +-- sys/arm/arm/gic_fdt.c | 3 +-- sys/arm/broadcom/bcm2835/bcm2835_intr.c | 2 +- sys/arm/broadcom/bcm2835/bcm2836.c | 2 +- sys/arm/ti/aintc.c | 2 +- sys/arm64/arm64/gic_v3_acpi.c | 4 ++-- sys/arm64/arm64/gic_v3_fdt.c | 3 +-- sys/kern/subr_intr.c | 4 +--- sys/riscv/riscv/plic.c | 2 +- sys/sys/intr.h | 2 +- 11 files changed, 12 insertions(+), 17 deletions(-) diff --git a/sys/arm/allwinner/a10/a10_intc.c b/sys/arm/allwinner/a10/a10_intc.c index 22b29ececac5..410fba4b4728 100644 --- a/sys/arm/allwinner/a10/a10_intc.c +++ b/sys/arm/allwinner/a10/a10_intc.c @@ -236,7 +236,7 @@ a10_intr_pic_attach(struct a10_aintc_softc *sc) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, 0)); + return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc)); } static void diff --git a/sys/arm/arm/gic_acpi.c b/sys/arm/arm/gic_acpi.c index 56ff78f9b685..67297f9879ca 100644 --- a/sys/arm/arm/gic_acpi.c +++ b/sys/arm/arm/gic_acpi.c @@ -228,8 +228,7 @@ gic_acpi_attach(device_t dev) /* * Controller is root: */ - if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc, - GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc) != 0) { device_printf(dev, "could not set PIC as a root\n"); intr_pic_deregister(dev, xref); goto cleanup; diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c index d6c657250ba3..e7fe503bf426 100644 --- a/sys/arm/arm/gic_fdt.c +++ b/sys/arm/arm/gic_fdt.c @@ -154,8 +154,7 @@ gic_fdt_attach(device_t dev) */ pxref = ofw_bus_find_iparent(ofw_bus_get_node(dev)); if (pxref == 0 || xref == pxref) { - if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc, - GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc) != 0) { device_printf(dev, "could not set PIC as a root\n"); intr_pic_deregister(dev, xref); goto cleanup; diff --git a/sys/arm/broadcom/bcm2835/bcm2835_intr.c b/sys/arm/broadcom/bcm2835/bcm2835_intr.c index b49c9041810d..5a8457bc4b67 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_intr.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_intr.c @@ -405,7 +405,7 @@ bcm_intc_attach(device_t dev) sc->intc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intc_irq_res == NULL) { - if (intr_pic_claim_root(dev, xref, bcm2835_intc_intr, sc, 0) != 0) { + if (intr_pic_claim_root(dev, xref, bcm2835_intc_intr, sc) != 0) { /* XXX clean up */ device_printf(dev, "could not set PIC as a root\n"); return (ENXIO); diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c index 60734abb40e3..f72bd9075982 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -646,7 +646,7 @@ bcm_lintc_pic_attach(struct bcm_lintc_softc *sc) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc, 0)); + return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc)); } static int diff --git a/sys/arm/ti/aintc.c b/sys/arm/ti/aintc.c index ce986b2d38bc..776d231c3c48 100644 --- a/sys/arm/ti/aintc.c +++ b/sys/arm/ti/aintc.c @@ -230,7 +230,7 @@ ti_aintc_pic_attach(struct ti_aintc_softc *sc) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, 0)); + return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc)); } static int diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index fe13b9f15f71..199fddcbc20c 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -346,8 +346,8 @@ gic_v3_acpi_attach(device_t dev) } } - if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc, - GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc) + != 0) { err = ENXIO; goto error; } diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index 9ca10167588a..f094bc6eb1fe 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -162,8 +162,7 @@ gic_v3_fdt_attach(device_t dev) /* Register xref */ OF_device_register_xref(xref, dev); - if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc, - GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc) != 0) { err = ENXIO; goto error; } diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 6535c42f2404..e3ef2caf2291 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -100,7 +100,6 @@ void intr_irq_handler(struct trapframe *tf); device_t intr_irq_root_dev; static intr_irq_filter_t *irq_root_filter; static void *irq_root_arg; -static u_int irq_root_ipicount; struct intr_pic_child { SLIST_ENTRY(intr_pic_child) pc_next; @@ -884,7 +883,7 @@ intr_pic_deregister(device_t dev, intptr_t xref) */ int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, - void *arg, u_int ipicount) + void *arg) { struct intr_pic *pic; @@ -916,7 +915,6 @@ intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, intr_irq_root_dev = dev; irq_root_filter = filter; irq_root_arg = arg; - irq_root_ipicount = ipicount; debugf("irq root set to %s\n", device_get_nameunit(dev)); return (0); diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index 27c8f59b1a87..c7d9249b2231 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -369,7 +369,7 @@ plic_attach(device_t dev) csr_set(sie, SIE_SEIE); - return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc, 0)); + return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc)); } static void diff --git a/sys/sys/intr.h b/sys/sys/intr.h index e91a661673d0..bdc693e6cb60 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -110,7 +110,7 @@ u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); -int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); +int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *); int intr_pic_add_handler(device_t, struct intr_pic *, intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); bool intr_is_per_cpu(struct resource *); From nobody Sat Sep 7 01:47:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwB06qLz5WSLJ; Sat, 07 Sep 2024 01:47: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 4X0ww96cvfz4jy3; Sat, 7 Sep 2024 01:47:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c49Qg4PcjUrpDY46+DfFdp2mF4QNZkkS6saee6ORZNk=; b=qBOBx3zqktuRkewi1CYTP2DWovI2UNBme6qInca391xdooLKyz/5R79AESnxrADc89v5ve GXDuoHAmaAgyrRLT38Di0VnUDgKEc/9Wn/VBPHVU+7356zcBpbtnFsuImEYbiOqMdQIpJp E5WaoAGU+lTdacUke+oCY3pVHT3kTy5eHbE27gXp4bsTQ+lPyKgoFdaFvr5MdyDuzLQfvd pWlTOga6A0AVN1SbuJ3Sq9B3dP2oQ3hgtD+Sxlr4hLeoy7/a8uzLtEdny7XzxGqYVrF8km uBAYRZfCLPS3tUZesfFPW9kppgsvEbne+WI9gsz726q87RBuVqrPglYmjpAUUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673673; a=rsa-sha256; cv=none; b=u6tGSRtNaBDb2r+6cPlP3ntiwY8TRZmp7ERxtz8uxbEPevTTPBAiNdB3GqRSTs9CUVhgTb isAngLjdWkhL84bHPqDNKb75OY37NywwW0eEeqiFucciuFYujKuYuSxaGkoyfxiw4RnBzJ ebxJe6PdNAqsuflKXeUFuBOTceW94qUxDcMel2rII4XReqCT/H6v3CFADrR24y++oTpBlK cKNdyvgJEhY9uMiTENllbGBBFSp6T8iyrFqW7XxQzNoGuD216chk8WulYZcwhpC0yVvH01 6L9pHSyVsj2FN0pqo/b8twn1t5FUCIrFa0dkP/Jni2x8CtdAn1vMy7f4GQClQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c49Qg4PcjUrpDY46+DfFdp2mF4QNZkkS6saee6ORZNk=; b=KRCsH7Q/Rm+pZs3ZeFfAoIfhYXZ+l8/arrPW3g7PCql12V1vZE4M1H3ITN+9gX1GeMaofb fCtEMeo56+eYIT0LDpPdZzxla7MRibEZgFjeoU27eUJFi9pPW6QkbVUhiMxOh0xd1Khzdz RCug45zup/PGEr0xR8UycTNPXq663bDnGjgMN+Vi6lBCMQiu5PaPo98+p36iuo97B1AKir ouDnMkX6Wn5Z9Ku4pKZijFceu/O2MfS2M+Z5K3xKkjs9AxF2LybarIkw0JObAeTKarpAo+ l97YikmiHgQW+D4EZ8CEi1yPeKXKHU6F3x1IgBW8IDxqLwrpRAelkb6FoW7vjg== 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 4X0ww96D9gzG31; Sat, 7 Sep 2024 01:47: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 4871lrBw041415; Sat, 7 Sep 2024 01:47:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lrNu041412; Sat, 7 Sep 2024 01:47:53 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:53 GMT Message-Id: <202409070147.4871lrNu041412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 5e822432f030 - stable/14 - intrng: Extract arm/arm64 IPI->PIC glue code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5e822432f03014c4fec03d6234886febf5fb5ce8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=5e822432f03014c4fec03d6234886febf5fb5ce8 commit 5e822432f03014c4fec03d6234886febf5fb5ce8 Author: Jessica Clarke AuthorDate: 2024-01-24 23:49:53 +0000 Commit: Jessica Clarke CommitDate: 2024-09-06 23:58:28 +0000 intrng: Extract arm/arm64 IPI->PIC glue code The arm and arm64 implementations of dispatching IPIs via PIC_IPI_SEND are almost identical, and entirely MI with the lone exception of a single store barrier on arm64 (that is likely either redundant or needed on arm too). Thus, de-duplicate this code by moving it to INTRNG as a generic IPI glue framework. The ipi_* functions remain declared in MD smp.h headers and implemented in MD code, but are trivial wrappers around intr_ipi_send that could be made MI, at least for INTRNG ports, at a later date. Note that, whilst both arm and arm64 had an ii_send member in intr_ipi to abstract over how to send interrupts,, they were always ultimately using PIC_IPI_SEND, and so this complexity has been removed. A follow-up commit will re-introduce the same flexibility by instead allowing a device other than the root PIC to be registered as the IPI sender. As part of this, strengthen a MAXCPU assertion that was missed in commit 2f0b059eeafc ("intrng: switch from MAXCPU to mp_ncpus") (which itself is mis-titled). Reviewed by: mmel, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D35898 (cherry picked from commit fae8755f16ff5b9bdc32df046e0f16c0cbb48a29) --- sys/arm/arm/machdep_intr.c | 126 +------------------------- sys/arm/arm/mp_machdep.c | 10 +-- sys/arm/include/intr.h | 13 --- sys/arm64/arm64/mp_machdep.c | 204 ++----------------------------------------- sys/arm64/include/intr.h | 4 - sys/kern/subr_intr.c | 188 ++++++++++++++++++++++++++++++++------- sys/sys/intr.h | 21 ++--- 7 files changed, 177 insertions(+), 389 deletions(-) diff --git a/sys/arm/arm/machdep_intr.c b/sys/arm/arm/machdep_intr.c index 60acf7c9bc7f..46f6d7e6c95d 100644 --- a/sys/arm/arm/machdep_intr.c +++ b/sys/arm/arm/machdep_intr.c @@ -30,39 +30,10 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include - -#include "pic_if.h" - -#ifdef SMP -#define INTR_IPI_NAMELEN (MAXCOMLEN + 1) - -struct intr_ipi { - intr_ipi_handler_t * ii_handler; - void * ii_handler_arg; - intr_ipi_send_t * ii_send; - void * ii_send_arg; - char ii_name[INTR_IPI_NAMELEN]; - u_long * ii_count; -}; - -static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; -#endif +#include +#include /* * arm_irq_memory_barrier() @@ -126,96 +97,3 @@ arm_irq_memory_barrier(uintptr_t irq) dsb(); cpu_l2cache_drain_writebuf(); } - -#ifdef SMP -static inline struct intr_ipi * -intr_ipi_lookup(u_int ipi) -{ - - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); - - return (&ipi_sources[ipi]); -} - -void -intr_ipi_dispatch(u_int ipi) -{ - struct intr_ipi *ii; - - ii = intr_ipi_lookup(ipi); - if (ii->ii_count == NULL) - panic("%s: not setup IPI %u", __func__, ipi); - - intr_ipi_increment_count(ii->ii_count, PCPU_GET(cpuid)); - - ii->ii_handler(ii->ii_handler_arg); -} - -void -intr_ipi_send(cpuset_t cpus, u_int ipi) -{ - struct intr_ipi *ii; - - ii = intr_ipi_lookup(ipi); - if (ii->ii_count == NULL) - panic("%s: not setup IPI %u", __func__, ipi); - - ii->ii_send(ii->ii_send_arg, cpus, ipi); -} - -void -intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, - void *h_arg, intr_ipi_send_t *send, void *s_arg) -{ - struct intr_ipi *ii; - - ii = intr_ipi_lookup(ipi); - - KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); - KASSERT(send != NULL, ("%s: ipi %u no sender", __func__, ipi)); - KASSERT(ii->ii_count == NULL, ("%s: ipi %u reused", __func__, ipi)); - - ii->ii_handler = hand; - ii->ii_handler_arg = h_arg; - ii->ii_send = send; - ii->ii_send_arg = s_arg; - strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); - ii->ii_count = intr_ipi_setup_counters(name); -} - -/* - * Send IPI thru interrupt controller. - */ -static void -pic_ipi_send(void *arg, cpuset_t cpus, u_int ipi) -{ - - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - PIC_IPI_SEND(intr_irq_root_dev, arg, cpus, ipi); -} - -/* - * Setup IPI handler on interrupt controller. - * - * Not SMP coherent. - */ -int -intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, - void *arg) -{ - int error; - struct intr_irqsrc *isrc; - - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - - error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, &isrc); - if (error != 0) - return (error); - - isrc->isrc_handlers++; - intr_ipi_setup(ipi, name, hand, arg, pic_ipi_send, isrc); - PIC_ENABLE_INTR(intr_irq_root_dev, isrc); - return (0); -} -#endif diff --git a/sys/arm/arm/mp_machdep.c b/sys/arm/arm/mp_machdep.c index 7debabf432d9..a204c81f0ae3 100644 --- a/sys/arm/arm/mp_machdep.c +++ b/sys/arm/arm/mp_machdep.c @@ -301,11 +301,11 @@ release_aps(void *dummy __unused) if (mp_ncpus == 1) return; - intr_pic_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); - intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); - intr_pic_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); - intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); - intr_pic_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); + intr_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); + intr_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); + intr_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); + intr_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); + intr_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); atomic_store_rel_int(&aps_ready, 1); /* Wake the other threads up */ diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h index 21829c5782bc..d0d0ff9fc32a 100644 --- a/sys/arm/include/intr.h +++ b/sys/arm/include/intr.h @@ -49,19 +49,6 @@ #include -#ifdef SMP -typedef void intr_ipi_send_t(void *, cpuset_t, u_int); -typedef void intr_ipi_handler_t(void *); - -void intr_ipi_dispatch(u_int); -void intr_ipi_send(cpuset_t, u_int); - -void intr_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *, - intr_ipi_send_t *, void *); - -int intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *); -#endif - void arm_irq_memory_barrier(uintptr_t); #endif /* _MACHINE_INTR_H */ diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 5d598b4189a9..8dc967b0ccb3 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -78,8 +78,6 @@ #include -#include "pic_if.h" - #define MP_BOOTSTACK_SIZE (kstack_pages * PAGE_SIZE) #define MP_QUIRK_CPULIST 0x01 /* The list of cpus may be wrong, */ @@ -99,25 +97,6 @@ static struct { }; #endif -typedef void intr_ipi_send_t(void *, cpuset_t, u_int); -typedef void intr_ipi_handler_t(void *); - -#define INTR_IPI_NAMELEN (MAXCOMLEN + 1) -struct intr_ipi { - intr_ipi_handler_t * ii_handler; - void * ii_handler_arg; - intr_ipi_send_t * ii_send; - void * ii_send_arg; - char ii_name[INTR_IPI_NAMELEN]; - u_long * ii_count; -}; - -static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; - -static struct intr_ipi *intr_ipi_lookup(u_int); -static void intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, - void *); - static void ipi_ast(void *); static void ipi_hardclock(void *); static void ipi_preempt(void *); @@ -166,12 +145,12 @@ release_aps(void *dummy __unused) if (mp_ncpus == 1) return; - intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); - intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); - intr_pic_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); - intr_pic_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); - intr_pic_ipi_setup(IPI_STOP_HARD, "stop hard", ipi_stop, NULL); - intr_pic_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); + intr_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); + intr_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); + intr_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); + intr_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); + intr_ipi_setup(IPI_STOP_HARD, "stop hard", ipi_stop, NULL); + intr_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); atomic_store_rel_int(&aps_ready, 1); /* Wake up the other CPUs */ @@ -316,71 +295,6 @@ smp_after_idle_runnable(void *arg __unused) SYSINIT(smp_after_idle_runnable, SI_SUB_SMP, SI_ORDER_ANY, smp_after_idle_runnable, NULL); -/* - * Send IPI thru interrupt controller. - */ -static void -pic_ipi_send(void *arg, cpuset_t cpus, u_int ipi) -{ - - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - - /* - * Ensure that this CPU's stores will be visible to IPI - * recipients before starting to send the interrupts. - */ - dsb(ishst); - - PIC_IPI_SEND(intr_irq_root_dev, arg, cpus, ipi); -} - -/* - * Setup IPI handler on interrupt controller. - * - * Not SMP coherent. - */ -static void -intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, - void *arg) -{ - struct intr_irqsrc *isrc; - struct intr_ipi *ii; - int error; - - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); - - error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, &isrc); - if (error != 0) - return; - - isrc->isrc_handlers++; - - ii = intr_ipi_lookup(ipi); - KASSERT(ii->ii_count == NULL, ("%s: ipi %u reused", __func__, ipi)); - - ii->ii_handler = hand; - ii->ii_handler_arg = arg; - ii->ii_send = pic_ipi_send; - ii->ii_send_arg = isrc; - strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); - ii->ii_count = intr_ipi_setup_counters(name); - - PIC_ENABLE_INTR(intr_irq_root_dev, isrc); -} - -static void -intr_ipi_send(cpuset_t cpus, u_int ipi) -{ - struct intr_ipi *ii; - - ii = intr_ipi_lookup(ipi); - if (ii->ii_count == NULL) - panic("%s: not setup IPI %u", __func__, ipi); - - ii->ii_send(ii->ii_send_arg, cpus, ipi); -} - static void ipi_ast(void *dummy __unused) { @@ -889,112 +803,6 @@ cpu_mp_setmaxid(void) } } -/* - * Lookup IPI source. - */ -static struct intr_ipi * -intr_ipi_lookup(u_int ipi) -{ - - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); - - return (&ipi_sources[ipi]); -} - -/* - * interrupt controller dispatch function for IPIs. It should - * be called straight from the interrupt controller, when associated - * interrupt source is learned. Or from anybody who has an interrupt - * source mapped. - */ -void -intr_ipi_dispatch(u_int ipi) -{ - struct intr_ipi *ii; - - ii = intr_ipi_lookup(ipi); - if (ii->ii_count == NULL) - panic("%s: not setup IPI %u", __func__, ipi); - - intr_ipi_increment_count(ii->ii_count, PCPU_GET(cpuid)); - - ii->ii_handler(ii->ii_handler_arg); -} - -#ifdef notyet -/* - * Map IPI into interrupt controller. - * - * Not SMP coherent. - */ -static int -ipi_map(struct intr_irqsrc *isrc, u_int ipi) -{ - boolean_t is_percpu; - int error; - - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); - - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - - isrc->isrc_type = INTR_ISRCT_NAMESPACE; - isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; - isrc->isrc_nspc_num = ipi_next_num; - - error = PIC_REGISTER(intr_irq_root_dev, isrc, &is_percpu); - if (error == 0) { - isrc->isrc_dev = intr_irq_root_dev; - ipi_next_num++; - } - return (error); -} - -/* - * Setup IPI handler to interrupt source. - * - * Note that there could be more ways how to send and receive IPIs - * on a platform like fast interrupts for example. In that case, - * one can call this function with ASIF_NOALLOC flag set and then - * call intr_ipi_dispatch() when appropriate. - * - * Not SMP coherent. - */ -int -intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags) -{ - struct intr_irqsrc *isrc; - int error; - - if (filter == NULL) - return(EINVAL); - - isrc = intr_ipi_lookup(ipi); - if (isrc->isrc_ipifilter != NULL) - return (EEXIST); - - if ((flags & AISHF_NOALLOC) == 0) { - error = ipi_map(isrc, ipi); - if (error != 0) - return (error); - } - - isrc->isrc_ipifilter = filter; - isrc->isrc_arg = arg; - isrc->isrc_handlers = 1; - isrc->isrc_count = intr_ipi_setup_counters(name); - isrc->isrc_index = 0; /* it should not be used in IPI case */ - - if (isrc->isrc_dev != NULL) { - PIC_ENABLE_INTR(isrc->isrc_dev, isrc); - PIC_ENABLE_SOURCE(isrc->isrc_dev, isrc); - } - return (0); -} -#endif - /* Sending IPI */ void ipi_all_but_self(u_int ipi) diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h index 8d9c35e81cd7..3cdbc83ff109 100644 --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -42,10 +42,6 @@ arm_irq_memory_barrier(uintptr_t irq) { } -#ifdef SMP -void intr_ipi_dispatch(u_int); -#endif - #ifdef DEV_ACPI #define ACPI_INTR_XREF 1 #define ACPI_MSI_XREF 2 diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index e3ef2caf2291..b9022f44b880 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -2,6 +2,11 @@ * Copyright (c) 2015-2016 Svatopluk Kraus * Copyright (c) 2015-2016 Michal Meloun * All rights reserved. + * Copyright (c) 2015-2016 The FreeBSD Foundation + * Copyright (c) 2021 Jessica Clarke + * + * Portions of this software were developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -124,6 +129,18 @@ struct intr_pic { SLIST_HEAD(, intr_pic_child) pic_children; }; +#ifdef SMP +#define INTR_IPI_NAMELEN (MAXCOMLEN + 1) + +struct intr_ipi { + intr_ipi_handler_t *ii_handler; + void *ii_handler_arg; + struct intr_irqsrc *ii_isrc; + char ii_name[INTR_IPI_NAMELEN]; + u_long *ii_count; +}; +#endif + static struct mtx pic_list_lock; static SLIST_HEAD(, intr_pic) pic_list; @@ -140,6 +157,8 @@ static bool irq_assign_cpu = true; #else static bool irq_assign_cpu = false; #endif + +static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; #endif u_int intr_nirq = NIRQ; @@ -298,39 +317,6 @@ isrc_release_counters(struct intr_irqsrc *isrc) bit_nclear(intrcnt_bitmap, idx, idx + 1); } -#ifdef SMP -/* - * Virtualization for interrupt source IPI counters setup. - */ -u_long * -intr_ipi_setup_counters(const char *name) -{ - u_int index, i; - char str[INTRNAME_LEN]; - - mtx_lock(&isrc_table_lock); - - /* - * We should never have a problem finding MAXCPU contiguous counters, - * in practice. Interrupts will be allocated sequentially during boot, - * so the array should fill from low to high index. Once reserved, the - * IPI counters will never be released. Similarly, we will not need to - * allocate more IPIs once the system is running. - */ - bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); - if (index == -1) - panic("Failed to allocate %d counters. Array exhausted?", - MAXCPU); - bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); - for (i = 0; i < MAXCPU; i++) { - snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); - intrcnt_setname(str, index + i); - } - mtx_unlock(&isrc_table_lock); - return (&intrcnt[index]); -} -#endif - /* * Main interrupt dispatch handler. It's called straight * from the assembler, where CPU interrupt is served. @@ -1774,3 +1760,139 @@ intr_map_init(void *dummy __unused) M_INTRNG, M_WAITOK | M_ZERO); } SYSINIT(intr_map_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_map_init, NULL); + +#ifdef SMP +/* Virtualization for interrupt source IPI counter increment. */ +static inline void +intr_ipi_increment_count(u_long *counter, u_int cpu) +{ + + KASSERT(cpu < MAXCPU + 1, ("%s: too big cpu %u", __func__, cpu)); + counter[cpu]++; +} + +/* + * Virtualization for interrupt source IPI counters setup. + */ +static u_long * +intr_ipi_setup_counters(const char *name) +{ + u_int index, i; + char str[INTRNAME_LEN]; + + mtx_lock(&isrc_table_lock); + + /* + * We should never have a problem finding MAXCPU contiguous counters, + * in practice. Interrupts will be allocated sequentially during boot, + * so the array should fill from low to high index. Once reserved, the + * IPI counters will never be released. Similarly, we will not need to + * allocate more IPIs once the system is running. + */ + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); + if (index == -1) + panic("Failed to allocate %d counters. Array exhausted?", + MAXCPU); + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); + for (i = 0; i < MAXCPU; i++) { + snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); + intrcnt_setname(str, index + i); + } + mtx_unlock(&isrc_table_lock); + return (&intrcnt[index]); +} + +/* + * Lookup IPI source. + */ +static struct intr_ipi * +intr_ipi_lookup(u_int ipi) +{ + + if (ipi >= INTR_IPI_COUNT) + panic("%s: no such IPI %u", __func__, ipi); + + return (&ipi_sources[ipi]); +} + +/* + * Setup IPI handler on interrupt controller. + * + * Not SMP coherent. + */ +void +intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *arg) +{ + struct intr_irqsrc *isrc; + struct intr_ipi *ii; + int error; + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); + + error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, &isrc); + if (error != 0) + return; + + isrc->isrc_handlers++; + + ii = intr_ipi_lookup(ipi); + KASSERT(ii->ii_count == NULL, ("%s: ipi %u reused", __func__, ipi)); + + ii->ii_handler = hand; + ii->ii_handler_arg = arg; + ii->ii_isrc = isrc; + strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); + ii->ii_count = intr_ipi_setup_counters(name); + + PIC_ENABLE_INTR(intr_irq_root_dev, isrc); +} + +void +intr_ipi_send(cpuset_t cpus, u_int ipi) +{ + struct intr_ipi *ii; + + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); + + /* + * XXX: Surely needed on other architectures too? Either way should be + * some kind of MI hook defined in an MD header, or the responsibility + * of the MD caller if not widespread. + */ +#ifdef __aarch64__ + /* + * Ensure that this CPU's stores will be visible to IPI + * recipients before starting to send the interrupts. + */ + dsb(ishst); +#endif + + PIC_IPI_SEND(intr_irq_root_dev, ii->ii_isrc, cpus, ipi); +} + +/* + * interrupt controller dispatch function for IPIs. It should + * be called straight from the interrupt controller, when associated + * interrupt source is learned. Or from anybody who has an interrupt + * source mapped. + */ +void +intr_ipi_dispatch(u_int ipi) +{ + struct intr_ipi *ii; + + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); + + intr_ipi_increment_count(ii->ii_count, PCPU_GET(cpuid)); + + ii->ii_handler(ii->ii_handler_arg); +} +#endif diff --git a/sys/sys/intr.h b/sys/sys/intr.h index bdc693e6cb60..57b0ca393912 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -148,21 +148,18 @@ int intr_release_msix(device_t, device_t, intptr_t, int); int intr_bind_irq(device_t, struct resource *, int); void intr_pic_init_secondary(void); +#endif -/* Virtualization for interrupt source IPI counter increment. */ -static inline void -intr_ipi_increment_count(u_long *counter, u_int cpu) -{ - - KASSERT(cpu < MAXCPU, ("%s: too big cpu %u", __func__, cpu)); - counter[cpu]++; -} +extern u_int intr_nirq; /* number of IRQs on intrng platforms */ -/* Virtualization for interrupt source IPI counters setup. */ -u_long * intr_ipi_setup_counters(const char *name); +/* Intr interface for IPIs. */ +#ifdef SMP +typedef void intr_ipi_handler_t(void *); +void intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *arg); +void intr_ipi_send(cpuset_t cpus, u_int ipi); +void intr_ipi_dispatch(u_int ipi); #endif -extern u_int intr_nirq; /* number of IRQs on intrng platforms */ - #endif /* _SYS_INTR_H */ From nobody Sat Sep 7 01:47:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwC46nMz5WSfs; Sat, 07 Sep 2024 01:47: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 4X0wwC0HVCz4jj0; Sat, 7 Sep 2024 01:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCwBOjJWwbw3Vn+YqYsGgmq8zd2jrwAgL/HjspBNrQE=; b=GAM7T9Fh7xUZO0u7lpsJVw9vzLL6jeJ9PPpFrDoB6h2Rn0BUgfcUo+WhCiHP9RNJaKF+XR 1NqqLJhCX94ri3c8Jo+4jI4kIY/YgI0A0d7iWyWtn89MRbB3r06V91IY/S80hivC8KISbs SM5VydsMCIOyAN3Mo+9fRO4Z6TrOubo5ZUxDMtBiKaGllgSUSkDdv867mY+XcjlIbEg0Oo 6K470xPj2llyPv0rgCDMSrHeffNewXB7vhhsMWWDQvqlFLxTr6Pgzl5rpsLC1DCwA72gkg JEHMGiLIgz6/clvXzKYEYMniXHRdVwWbvIO5siL/r0rTL39Dsr8G9kubXOopig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673675; a=rsa-sha256; cv=none; b=XmqnGdnX0zz2xUTJsp4xe2dgXO4bZ6gx+pMYQa8PONlVskd5YkZVrWSqKBUMIKcc01mGpp 4RW+n+a4KTS3t0G4Tzv+Me3v8DF8o8m++u9JeIGY085390xOhG3p1EeNnEpfPZyedgoQ3Z Pnr/rrusukM6l3cjOhuMNQV8H2Koj4xIJexARNR5C5hOpCZXoFvpTo59OF5ZNO97/GPFSt S9bnMBCzTL/bm02ToLIXtD6OvGKVbMJBCsKjyg7nxauOdKte8Wxiz5uhkP43QHh4dSC17M FVc4ziFAtewYQyhWZQp+7Kx9VfTZO8E8rpohRk09JTb3p0p1KeD/FXVinmoZjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCwBOjJWwbw3Vn+YqYsGgmq8zd2jrwAgL/HjspBNrQE=; b=HYsldBKZ3Xf0IBrj6OOaHnwCEPP92z/Dwxc155fUctG8Za4hR/aYXJKYmhgziJyef0JNSs f/WQGPDByGeQY7wGqNDV0b1wTkliKilmUW+eIewHsk4UZDNEI5QhxuSuzmJNR364JyBuPn SAsqqNyFj1y78cKBOT7s3F4HP3YBfglIY20ujLtpMm7XLUF7fxhUre8TFQB4ppw4t+tBkV 67YXnNlXTMLQXG3IlCcjYRgFiP4cVC2nuudmxW2sxaTrL2aNkkG4viOVw7Tib1g0MnMci/ WNWUnkAVaMKwrapZozAbBbJ8X4aa9qi47YnjehE9oXhJk2cPCqkEK9X0p+xQZQ== 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 4X0wwB70nvzGPb; Sat, 7 Sep 2024 01:47: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 4871lsVH041480; Sat, 7 Sep 2024 01:47:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871ls6q041477; Sat, 7 Sep 2024 01:47:54 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:54 GMT Message-Id: <202409070147.4871ls6q041477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 7604062517ec - stable/14 - intrng: Allow alternative IPI PICs to be registered and used List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7604062517ec25ac0412f258b36f58774bd234ce Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7604062517ec25ac0412f258b36f58774bd234ce commit 7604062517ec25ac0412f258b36f58774bd234ce Author: Jessica Clarke AuthorDate: 2024-01-24 23:49:54 +0000 Commit: Jessica Clarke CommitDate: 2024-09-06 23:59:02 +0000 intrng: Allow alternative IPI PICs to be registered and used On RISC-V, the root PIC (whether the PLIC or, as will be the case in future, the local interrupt controller) cannot send IPIs, relying on another means to trigger the necessary software interrupts (firmware calls), but there are upcoming standard devices that will be able to inject them, so we can't just put the firmware calls in the root PIC driver. Thus, split out a new intr_ipi_dev from intr_irq_root_dev to use for sending IPIs. New devices can be registered with a given priority up until the first IPI is set up, when the best device seen so far gets frozen as the IPI device to use. Reviewed by: mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D35899 (cherry picked from commit 103d39efe0c68cb2a808c306b14c3f473a02535d) --- sys/arm/arm/gic_acpi.c | 8 ++++++++ sys/arm/arm/gic_fdt.c | 7 +++++++ sys/arm/broadcom/bcm2835/bcm2836.c | 12 ++++++++++- sys/arm64/arm64/gic_v3_acpi.c | 8 ++++++++ sys/arm64/arm64/gic_v3_fdt.c | 8 ++++++++ sys/kern/subr_intr.c | 42 +++++++++++++++++++++++++++++++------- sys/sys/intr.h | 1 + 7 files changed, 78 insertions(+), 8 deletions(-) diff --git a/sys/arm/arm/gic_acpi.c b/sys/arm/arm/gic_acpi.c index 67297f9879ca..bc03bf742798 100644 --- a/sys/arm/arm/gic_acpi.c +++ b/sys/arm/arm/gic_acpi.c @@ -233,6 +233,14 @@ gic_acpi_attach(device_t dev) intr_pic_deregister(dev, xref); goto cleanup; } + +#ifdef SMP + if (intr_ipi_pic_register(dev, 0) != 0) { + device_printf(dev, "could not register for IPIs\n"); + goto cleanup; + } +#endif + /* If we have children probe and attach them */ if (arm_gic_add_children(dev)) { bus_generic_probe(dev); diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c index e7fe503bf426..4a83610d3418 100644 --- a/sys/arm/arm/gic_fdt.c +++ b/sys/arm/arm/gic_fdt.c @@ -159,6 +159,13 @@ gic_fdt_attach(device_t dev) intr_pic_deregister(dev, xref); goto cleanup; } + +#ifdef SMP + if (intr_ipi_pic_register(dev, 0) != 0) { + device_printf(dev, "could not register for IPIs\n"); + goto cleanup; + } +#endif } else { if (sc->base.gic_res[2] == NULL) { device_printf(dev, diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c index f72bd9075982..8ff824d34521 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -646,7 +646,17 @@ bcm_lintc_pic_attach(struct bcm_lintc_softc *sc) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc)); + error = intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc); + if (error != 0) + return (error); + +#ifdef SMP + error = intr_ipi_pic_register(sc->bls_dev, 0); + if (error != 0) + return (error); +#endif + + return (0); } static int diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index 199fddcbc20c..fca73010759d 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -352,6 +352,14 @@ gic_v3_acpi_attach(device_t dev) goto error; } +#ifdef SMP + err = intr_ipi_pic_register(dev, 0); + if (err != 0) { + device_printf(dev, "could not register for IPIs\n"); + goto error; + } +#endif + /* * Try to register the ITS driver to this GIC. The GIC will act as * a bus in that case. Failure here will not affect the main GIC diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index f094bc6eb1fe..ad27e395ad98 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -167,6 +167,14 @@ gic_v3_fdt_attach(device_t dev) goto error; } +#ifdef SMP + err = intr_ipi_pic_register(dev, 0); + if (err != 0) { + device_printf(dev, "could not register for IPIs\n"); + goto error; + } +#endif + /* * Try to register ITS to this GIC. * GIC will act as a bus in that case. diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index b9022f44b880..6198603adfe8 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -139,6 +139,10 @@ struct intr_ipi { char ii_name[INTR_IPI_NAMELEN]; u_long *ii_count; }; + +static device_t intr_ipi_dev; +static u_int intr_ipi_dev_priority; +static bool intr_ipi_dev_frozen; #endif static struct mtx pic_list_lock; @@ -380,7 +384,8 @@ intr_isrc_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf) KASSERT(isrc != NULL, ("%s: no source", __func__)); - isrc_increment_count(isrc); + if ((isrc->isrc_flags & INTR_ISRCF_IPI) == 0) + isrc_increment_count(isrc); #ifdef INTR_SOLO if (isrc->isrc_filter != NULL) { @@ -396,7 +401,8 @@ intr_isrc_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf) return (0); } - isrc_increment_straycount(isrc); + if ((isrc->isrc_flags & INTR_ISRCF_IPI) == 0) + isrc_increment_straycount(isrc); return (EINVAL); } @@ -1815,6 +1821,20 @@ intr_ipi_lookup(u_int ipi) return (&ipi_sources[ipi]); } +int +intr_ipi_pic_register(device_t dev, u_int priority) +{ + if (intr_ipi_dev_frozen) { + device_printf(dev, "IPI device already frozen"); + return (EBUSY); + } + + if (intr_ipi_dev == NULL || priority > intr_ipi_dev_priority) + intr_ipi_dev = dev; + + return (0); +} + /* * Setup IPI handler on interrupt controller. * @@ -1828,10 +1848,17 @@ intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, struct intr_ipi *ii; int error; - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + if (!intr_ipi_dev_frozen) { + if (intr_ipi_dev == NULL) + panic("%s: no IPI PIC attached", __func__); + + intr_ipi_dev_frozen = true; + device_printf(intr_ipi_dev, "using for IPIs\n"); + } + KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); - error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, &isrc); + error = PIC_IPI_SETUP(intr_ipi_dev, ipi, &isrc); if (error != 0) return; @@ -1846,7 +1873,7 @@ intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); ii->ii_count = intr_ipi_setup_counters(name); - PIC_ENABLE_INTR(intr_irq_root_dev, isrc); + PIC_ENABLE_INTR(intr_ipi_dev, isrc); } void @@ -1854,7 +1881,8 @@ intr_ipi_send(cpuset_t cpus, u_int ipi) { struct intr_ipi *ii; - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + KASSERT(intr_ipi_dev_frozen, + ("%s: IPI device not yet frozen", __func__)); ii = intr_ipi_lookup(ipi); if (ii->ii_count == NULL) @@ -1873,7 +1901,7 @@ intr_ipi_send(cpuset_t cpus, u_int ipi) dsb(ishst); #endif - PIC_IPI_SEND(intr_irq_root_dev, ii->ii_isrc, cpus, ipi); + PIC_IPI_SEND(intr_ipi_dev, ii->ii_isrc, cpus, ipi); } /* diff --git a/sys/sys/intr.h b/sys/sys/intr.h index 57b0ca393912..f6957864c639 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -156,6 +156,7 @@ extern u_int intr_nirq; /* number of IRQs on intrng platforms */ #ifdef SMP typedef void intr_ipi_handler_t(void *); +int intr_ipi_pic_register(device_t dev, u_int priority); void intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, void *arg); void intr_ipi_send(cpuset_t cpus, u_int ipi); From nobody Sat Sep 7 01:47:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwD4CgZz5WSR3; Sat, 07 Sep 2024 01:47: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 4X0wwD0vVRz4jw6; Sat, 7 Sep 2024 01:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d84Xq1UBbXZw3OzgFI9xFWYz/lOfAD1/7/T3lfIv5KQ=; b=ZRcx70qWT2KOoIA5qXedrEJ4uDcGZrrWD02OwCPyGKzhP9oiNTyI9qs7CEPkmPadleK9Uu /P4D4XG7/QrsmFVgWmeaGxIkfsazpL5r/qEXYhYdiGEkZKKwS1omdT6xLxMVTVeCW8U0gN Zmh1RLqOAcgXImeW/cEcOwhqbgsoSjmcIp0ltOI1dtj/MtVM3iLEE8vKo9IQeM6ODe1JeE rqBIz+4b84EHpAlfcKufyYwjb2XEFw9f8yyVz2UnbCPUQN/ZvAMzJ0+3ewEsCg6ZKsw2ty /qegYwD0mtvislHLtaQB3uhD3Z9bexMsMSlEQmB57CyYVLI+mYtqzt8ZtIyfSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673676; a=rsa-sha256; cv=none; b=QYcfqv1j35wQ3vKyGWfgi/OS6kFb9jNba2ZdbcwPgihCKB9GgTTEFxN6IXNvkju8uNPFs6 NBlstgnPp2EvCI+gDdDgUbuj2dpWMghlt9Dm12ZW1KWYbYLuh7ODdSXJJp1Dqxl43TiccT E5Pm5U1dTs74HoqmpG/KlL1NiUX54Wil3HcTouwAiDqISDh8NOS6TQ5rieHFGmxCBjgQUY cGCwnQsVFkwf1HGqrZTB1GZ/znk0YyVIIND3SGik98w+nBtuY0+SDUbf8RVtjxozKup7Aw T+xobLg9j5t5vq4cptibDWC8AIQgEUn+9LpczRpXPVRrqJ5WNGtfIRkGaEJ3Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d84Xq1UBbXZw3OzgFI9xFWYz/lOfAD1/7/T3lfIv5KQ=; b=iFnROYUfjnnNa4PRfgjX48blE/7XN0yUXthkILDInzDarvtlXOEKAIDl8wDVS5OTQ+0M8X cZI0DHgTSoZxry/vQh+Vyt1JokRuIyFB5a12d41OLAKQSqLDlb9G9coa916RZPvF1yD1do uwlUJgubHm7r0YwXfCJ2evevH4z6CySaMuPeZ0vW1B9ue4C3FVRn1Ggy4HKrjot6ciSwuf wmT9yZSKxtMAFnSV41D0nyngXwKp1X4yWvQCfNcVO5wm1mwb3/ioZDS5q0DKRp+UbcXsCV Mt1sgGSfNEYpV4hQufPXMcj8kNOjw9r7FSh10nzkXYzoVwUgm80up7l2kzHJmQ== 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 4X0wwD0WhhzGJh; Sat, 7 Sep 2024 01:47: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 4871ludW041535; Sat, 7 Sep 2024 01:47:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lu2G041532; Sat, 7 Sep 2024 01:47:56 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:56 GMT Message-Id: <202409070147.4871lu2G041532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 601baffb0b54 - stable/14 - riscv: Create a newbus device for the SBI driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 601baffb0b54b8fe70ad1dd9fd923fe38d08337e Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=601baffb0b54b8fe70ad1dd9fd923fe38d08337e commit 601baffb0b54b8fe70ad1dd9fd923fe38d08337e Author: Jessica Clarke AuthorDate: 2024-01-24 23:49:54 +0000 Commit: Jessica Clarke CommitDate: 2024-09-06 23:59:12 +0000 riscv: Create a newbus device for the SBI driver This approach is based on the Arm PSCI driver, though that makes more extensive use of its softc than we do here. This will be used to extract the SBI IPI code as a real PIC. Reviewed by: mhorne, imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D35900 (cherry picked from commit c55272fdf8570b4e15112009ad0066ed156f21a7) --- sys/riscv/include/sbi.h | 6 +---- sys/riscv/riscv/sbi.c | 65 +++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/sys/riscv/include/sbi.h b/sys/riscv/include/sbi.h index 4fbdd598ec4d..bd3991e0a89f 100644 --- a/sys/riscv/include/sbi.h +++ b/sys/riscv/include/sbi.h @@ -159,11 +159,7 @@ sbi_call(uint64_t arg7, uint64_t arg6, uint64_t arg0, uint64_t arg1, return (ret); } -/* Base extension functions and variables. */ -extern u_long sbi_spec_version; -extern u_long sbi_impl_id; -extern u_long sbi_impl_version; - +/* Base extension functions. */ static __inline long sbi_probe_extension(long id) { diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c index 36aaa8a6ffed..284b29af77df 100644 --- a/sys/riscv/riscv/sbi.c +++ b/sys/riscv/riscv/sbi.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Mitchell Horne + * Copyright (c) 2021 Jessica Clarke * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,10 +28,11 @@ #include #include -#include #include -#include +#include #include +#include +#include #include #include @@ -40,9 +42,15 @@ #define OPENSBI_VERSION_MAJOR_OFFSET 16 #define OPENSBI_VERSION_MINOR_MASK 0xFFFF -u_long sbi_spec_version; -u_long sbi_impl_id; -u_long sbi_impl_version; +struct sbi_softc { + device_t dev; +}; + +static struct sbi_softc *sbi_softc = NULL; + +static u_long sbi_spec_version; +static u_long sbi_impl_id; +static u_long sbi_impl_version; static bool has_time_extension = false; static bool has_ipi_extension = false; @@ -316,10 +324,53 @@ sbi_init(void) } static void -sbi_late_init(void *dummy __unused) +sbi_identify(driver_t *driver, device_t parent) +{ + device_t dev; + + if (device_find_child(parent, "sbi", -1) != NULL) + return; + + dev = BUS_ADD_CHILD(parent, 0, "sbi", -1); + if (dev == NULL) + device_printf(parent, "Can't add sbi child\n"); +} + +static int +sbi_probe(device_t dev) { + device_set_desc(dev, "RISC-V Supervisor Binary Interface"); + + return (BUS_PROBE_NOWILDCARD); +} + +static int +sbi_attach(device_t dev) +{ + struct sbi_softc *sc; + + if (sbi_softc != NULL) + return (ENXIO); + + sc = device_get_softc(dev); + sc->dev = dev; + sbi_softc = sc; + EVENTHANDLER_REGISTER(shutdown_final, sbi_shutdown_final, NULL, SHUTDOWN_PRI_LAST); + + return (0); } -SYSINIT(sbi, SI_SUB_KLD, SI_ORDER_ANY, sbi_late_init, NULL); +static device_method_t sbi_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, sbi_identify), + DEVMETHOD(device_probe, sbi_probe), + DEVMETHOD(device_attach, sbi_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(sbi, sbi_driver, sbi_methods, sizeof(struct sbi_softc)); +EARLY_DRIVER_MODULE(sbi, nexus, sbi_driver, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); From nobody Sat Sep 7 01:47:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwF3DgLz5WSZk; Sat, 07 Sep 2024 01:47: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 4X0wwF24sdz4k49; Sat, 7 Sep 2024 01:47:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=28qmFLCUj2yJwYLfaS15wZbSDAyw1Mbr0QilnIhNqhQ=; b=HKWPCJsipPnRCIIhV8NAkLvkmcgTdNDunBwcCYwxC8YlrKcKvBbREAKr+RjjpVW9aQoVsb unr1TaqWX2siDLN+zSy5MpfWQEtjTk8TA/U7UpqMm1QtUJcs70yE0y4yR0gQdtdhb2zQQQ M0orlT1MJ7xGH3Uz3ROFVVWWpb0ckn9JP2Je+6pzzSZecI46FTtoJF0LInuKmcGvO6xHey Sg5Z7MBb/8F99DBop4ovc/hjztNTWTfVZzFXru/51nsDu8nR5hibc7HlAUFOYTIi4o5/UT R5G0VU9bcMmP8Km7rB9+zzU2khT+SL7Eh2hafZ0a5oxfM0T5rfArdxDCcXF3lA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673677; a=rsa-sha256; cv=none; b=uwdWU6ERB3RviAz0+U62r6VbPJUlqPk0RJXSWjXww2y022hwBrM4BTvx66Ukw7DJzeIyH9 yjTEFWHLuDwowet340bJ2XmGQ5UaFKjjPnf2OwzDS/7ESaJeRL0ezDKMdz4Ackj30Js7rP OqFfL4kxDha0uvpOAeEUOKBK3pcAJNR6FPsmgMJY+FcBTsMwldgK8q5hTXy/k/hMs5haO/ RK5Fvd2m6rrRP4psevFC2e7dns8BO4gLGMbT6RMdbgZzK0n1QLUDfcd1qsbe7THzJhqTWR 6MdQ5crHV3yoRXZaXZMeOuwSdMtUWzmmWTZZ7zHPHf4C0NmVl2XNcczot19YKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=28qmFLCUj2yJwYLfaS15wZbSDAyw1Mbr0QilnIhNqhQ=; b=hJaUG1gHDGh6Yyr5Dqp2YQh96Rb2ghFjqTs3tARJ/JHO4SnzLWI74TgKYuWlKShmSmh3mN Kpkr0Ra6shXjpvDANVTASNxFgSgFahBY7AWhjCpWIKId856OzLPlysccuEOihArM7NUUCp BGX6N2NcQOgwda1fJRGJ0CN3JQWrTzRtJA4NFlKIOCUWGOUyKX1P6xnkXC7nYKz6a3md3Y MvA25rJOUMu4KwU3c75o889zaLITXGLzSxnP/uoeDMUI7Zawl7Vt26L0Oz3qdjAdiGE1fF tsis5kEUqmPcRQpm9wRysqyu/ZQsNsr1DaDnwBZ0s3wkRQwJbNUe9Y7QyrDxJA== 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 4X0wwF1f0QzGDM; Sat, 7 Sep 2024 01:47: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 4871lvXC041589; Sat, 7 Sep 2024 01:47:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lvHB041586; Sat, 7 Sep 2024 01:47:57 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:57 GMT Message-Id: <202409070147.4871lvHB041586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 5985c87b9630 - stable/14 - riscv: Convert local interrupt controller to a newbus PIC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5985c87b963064ba36146504e5265561e083205f Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=5985c87b963064ba36146504e5265561e083205f commit 5985c87b963064ba36146504e5265561e083205f Author: Jessica Clarke AuthorDate: 2024-01-24 23:49:54 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:00:28 +0000 riscv: Convert local interrupt controller to a newbus PIC Currently the local interrupt controller implementation is based on pre-INTRNG arm/arm64 code, using hand-rolled event code rather than INTRNG. This then interacts weirdly with the PLIC, and other future interrupt controllers like the APLIC and IMSICs in the upcoming AIA specification, since they become the root PIC despite not being the logical root. Instead, use a real newbus device for it and register it as the root PIC. This also adapts the IPI code to make use of the newly-added INTRNG generic IPI handling framework, adding a new sbi_ipi as the PIC. In future there will be alternative devices for sending IPIs that will register with higher priorities, such as the proposed AIA IMSIC and ACLINT SSWI. Reviewed by: mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D35901 (cherry picked from commit 6ec8bf9f3d17b712d657c42f74fba936dd284d04) --- sys/conf/files.riscv | 3 +- sys/riscv/include/intr.h | 24 +--- sys/riscv/include/smp.h | 17 +-- sys/riscv/riscv/intc.c | 311 ++++++++++++++++++++++++++++++++++++++++ sys/riscv/riscv/intr_machdep.c | 275 ----------------------------------- sys/riscv/riscv/mp_machdep.c | 162 ++++++++++++--------- sys/riscv/riscv/plic.c | 49 +++++-- sys/riscv/riscv/riscv_console.c | 2 - sys/riscv/riscv/sbi.c | 43 ++++++ sys/riscv/riscv/sbi_ipi.c | 208 +++++++++++++++++++++++++++ sys/riscv/riscv/timer.c | 33 ++++- sys/riscv/riscv/trap.c | 6 +- 12 files changed, 735 insertions(+), 398 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 42f1787489ac..c01e41325759 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -45,7 +45,7 @@ riscv/riscv/elf_machdep.c standard riscv/riscv/exception.S standard riscv/riscv/exec_machdep.c standard riscv/riscv/gdb_machdep.c optional gdb -riscv/riscv/intr_machdep.c standard +riscv/riscv/intc.c standard riscv/riscv/identcpu.c standard riscv/riscv/locore.S standard no-obj riscv/riscv/machdep.c standard @@ -60,6 +60,7 @@ riscv/riscv/ptrace_machdep.c standard riscv/riscv/riscv_console.c optional rcons riscv/riscv/riscv_syscon.c optional syscon riscv_syscon fdt riscv/riscv/sbi.c standard +riscv/riscv/sbi_ipi.c optional smp riscv/riscv/stack_machdep.c optional ddb | stack riscv/riscv/support.S standard riscv/riscv/swtch.S standard diff --git a/sys/riscv/include/intr.h b/sys/riscv/include/intr.h index a4e3a7093492..ad811dcbc449 100644 --- a/sys/riscv/include/intr.h +++ b/sys/riscv/include/intr.h @@ -35,32 +35,11 @@ #ifndef _MACHINE_INTR_MACHDEP_H_ #define _MACHINE_INTR_MACHDEP_H_ -#define RISCV_NIRQ 1024 - #ifndef NIRQ -#define NIRQ RISCV_NIRQ +#define NIRQ 1024 #endif -#ifdef INTRNG #include -#endif - -struct trapframe; - -int riscv_teardown_intr(void *); -int riscv_setup_intr(const char *, driver_filter_t *, driver_intr_t *, - void *, int, int, void **); -void riscv_cpu_intr(struct trapframe *); - -typedef unsigned long * riscv_intrcnt_t; - -riscv_intrcnt_t riscv_intrcnt_create(const char *); -void riscv_intrcnt_setname(riscv_intrcnt_t, const char *); - -#ifdef SMP -void riscv_setup_ipihandler(driver_filter_t *); -void riscv_unmask_ipi(void); -#endif enum { IRQ_SOFTWARE_USER, @@ -75,7 +54,6 @@ enum { IRQ_EXTERNAL_SUPERVISOR, IRQ_EXTERNAL_HYPERVISOR, IRQ_EXTERNAL_MACHINE, - INTC_NIRQS }; #endif /* !_MACHINE_INTR_MACHDEP_H_ */ diff --git a/sys/riscv/include/smp.h b/sys/riscv/include/smp.h index 8bafc1ac6a3a..863f0bbd6d21 100644 --- a/sys/riscv/include/smp.h +++ b/sys/riscv/include/smp.h @@ -37,14 +37,15 @@ #include -#define IPI_AST (1 << 0) -#define IPI_PREEMPT (1 << 1) -#define IPI_RENDEZVOUS (1 << 2) -#define IPI_STOP (1 << 3) -#define IPI_STOP_HARD (1 << 4) -#define IPI_HARDCLOCK (1 << 5) - -#define INTR_IPI_COUNT 1 +enum { + IPI_AST, + IPI_PREEMPT, + IPI_RENDEZVOUS, + IPI_STOP, + IPI_STOP_HARD, + IPI_HARDCLOCK, + INTR_IPI_COUNT +}; void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); diff --git a/sys/riscv/riscv/intc.c b/sys/riscv/riscv/intc.c new file mode 100644 index 000000000000..399bb05bbcfe --- /dev/null +++ b/sys/riscv/riscv/intc.c @@ -0,0 +1,311 @@ +/*- + * Copyright (c) 2015-2017 Ruslan Bukin + * All rights reserved. + * Copyright (c) 2021 Jessica Clarke + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "pic_if.h" + +#define INTC_NIRQS 16 + +struct intc_irqsrc { + struct intr_irqsrc isrc; + u_int irq; +}; + +struct intc_softc { + device_t dev; + struct intc_irqsrc isrcs[INTC_NIRQS]; +}; + +static int intc_intr(void *arg); + +static phandle_t +intc_ofw_find(device_t dev, uint32_t hartid) +{ + phandle_t node; + pcell_t reg; + + node = OF_finddevice("/cpus"); + if (node == -1) { + device_printf(dev, "Can't find cpus node\n"); + return ((phandle_t)-1); + } + + for (node = OF_child(node); node != 0; node = OF_peer(node)) { + if (!ofw_bus_node_status_okay(node)) + continue; + + if (!ofw_bus_node_is_compatible(node, "riscv")) + continue; + + if (OF_searchencprop(node, "reg", ®, sizeof(reg)) == -1) + continue; + + if (reg == hartid) + break; + } + + if (node == 0) { + device_printf(dev, "Can't find boot cpu node\n"); + return ((phandle_t)-1); + } + + for (node = OF_child(node); node != 0; node = OF_peer(node)) { + if (!ofw_bus_node_status_okay(node)) + continue; + + if (ofw_bus_node_is_compatible(node, "riscv,cpu-intc")) + break; + } + + if (node == 0) { + device_printf(dev, + "Can't find boot cpu local interrupt controller\n"); + return ((phandle_t)-1); + } + + return (node); +} + +static void +intc_identify(driver_t *driver, device_t parent) +{ + device_t dev; + phandle_t node; + + if (device_find_child(parent, "intc", -1) != NULL) + return; + + node = intc_ofw_find(parent, PCPU_GET(hart)); + if (node == -1) + return; + + dev = simplebus_add_device(parent, node, 0, "intc", -1, NULL); + if (dev == NULL) + device_printf(parent, "Can't add intc child\n"); +} + +static int +intc_probe(device_t dev) +{ + device_set_desc(dev, "RISC-V Local Interrupt Controller"); + + return (BUS_PROBE_NOWILDCARD); +} + +static int +intc_attach(device_t dev) +{ + struct intc_irqsrc *isrcs; + struct intc_softc *sc; + struct intr_pic *pic; + const char *name; + phandle_t xref; + u_int flags; + int i, error; + + sc = device_get_softc(dev); + sc->dev = dev; + + name = device_get_nameunit(dev); + xref = OF_xref_from_node(ofw_bus_get_node(dev)); + + isrcs = sc->isrcs; + for (i = 0; i < INTC_NIRQS; i++) { + isrcs[i].irq = i; + flags = i == IRQ_SOFTWARE_SUPERVISOR + ? INTR_ISRCF_IPI : INTR_ISRCF_PPI; + error = intr_isrc_register(&isrcs[i].isrc, sc->dev, flags, + "%s,%u", name, i); + if (error != 0) { + device_printf(dev, "Can't register interrupt %d\n", i); + return (error); + } + } + + pic = intr_pic_register(sc->dev, xref); + if (pic == NULL) + return (ENXIO); + + return (intr_pic_claim_root(sc->dev, xref, intc_intr, sc)); +} + +static void +intc_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + u_int irq; + + irq = ((struct intc_irqsrc *)isrc)->irq; + if (irq >= INTC_NIRQS) + panic("%s: Unsupported IRQ %u", __func__, irq); + + csr_clear(sie, 1ul << irq); +} + +static void +intc_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + u_int irq; + + irq = ((struct intc_irqsrc *)isrc)->irq; + if (irq >= INTC_NIRQS) + panic("%s: Unsupported IRQ %u", __func__, irq); + + csr_set(sie, 1ul << irq); +} + +static int +intc_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct intr_map_data_fdt *daf; + struct intc_softc *sc; + + sc = device_get_softc(dev); + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 1 || daf->cells[0] >= INTC_NIRQS) + return (EINVAL); + + *isrcp = &sc->isrcs[daf->cells[0]].isrc; + + return (0); +} + +static int +intc_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + if (isrc->isrc_flags & INTR_ISRCF_PPI) + CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); + + return (0); +} + +#ifdef SMP +static void +intc_init_secondary(device_t dev) +{ + struct intc_softc *sc; + struct intr_irqsrc *isrc; + u_int cpu, irq; + + sc = device_get_softc(dev); + cpu = PCPU_GET(cpuid); + + /* Unmask attached interrupts */ + for (irq = 0; irq < INTC_NIRQS; irq++) { + isrc = &sc->isrcs[irq].isrc; + if (intr_isrc_init_on_cpu(isrc, cpu)) + intc_enable_intr(dev, isrc); + } +} +#endif + +static int +intc_intr(void *arg) +{ + struct trapframe *frame; + struct intc_softc *sc; + uint64_t active_irq; + struct intc_irqsrc *src; + + sc = arg; + frame = curthread->td_intr_frame; + + KASSERT((frame->tf_scause & SCAUSE_INTR) != 0, + ("%s: not an interrupt frame", __func__)); + + active_irq = frame->tf_scause & SCAUSE_CODE; + + if (active_irq >= INTC_NIRQS) + return (FILTER_HANDLED); + + src = &sc->isrcs[active_irq]; + if (intr_isrc_dispatch(&src->isrc, frame) != 0) { + intc_disable_intr(sc->dev, &src->isrc); + device_printf(sc->dev, "Stray irq %lu disabled\n", + active_irq); + } + + return (FILTER_HANDLED); +} + +static device_method_t intc_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, intc_identify), + DEVMETHOD(device_probe, intc_probe), + DEVMETHOD(device_attach, intc_attach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, intc_disable_intr), + DEVMETHOD(pic_enable_intr, intc_enable_intr), + DEVMETHOD(pic_map_intr, intc_map_intr), + DEVMETHOD(pic_setup_intr, intc_setup_intr), +#ifdef SMP + DEVMETHOD(pic_init_secondary, intc_init_secondary), +#endif + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(intc, intc_driver, intc_methods, sizeof(struct intc_softc)); +EARLY_DRIVER_MODULE(intc, ofwbus, intc_driver, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST); diff --git a/sys/riscv/riscv/intr_machdep.c b/sys/riscv/riscv/intr_machdep.c deleted file mode 100644 index d2a454175059..000000000000 --- a/sys/riscv/riscv/intr_machdep.c +++ /dev/null @@ -1,275 +0,0 @@ -/*- - * Copyright (c) 2015-2017 Ruslan Bukin - * All rights reserved. - * - * Portions of this software were developed by SRI International and the - * University of Cambridge Computer Laboratory under DARPA/AFRL contract - * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Portions of this software were developed by the University of Cambridge - * Computer Laboratory as part of the CTSRD Project, with support from the - * UK Higher Education Innovation Fund (HEIF). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#ifdef SMP -#include -#endif - -void intr_irq_handler(struct trapframe *tf); - -struct intc_irqsrc { - struct intr_irqsrc isrc; - u_int irq; -}; - -struct intc_irqsrc isrcs[INTC_NIRQS]; - -static void -riscv_mask_irq(void *source) -{ - int irq; - - irq = (int)(uintptr_t)source; - - switch (irq) { - case IRQ_TIMER_SUPERVISOR: - csr_clear(sie, SIE_STIE); - break; - case IRQ_SOFTWARE_USER: - csr_clear(sie, SIE_USIE); - break; - case IRQ_SOFTWARE_SUPERVISOR: - csr_clear(sie, SIE_SSIE); - break; - default: - panic("Unknown irq %d\n", irq); - } -} - -static void -riscv_unmask_irq(void *source) -{ - int irq; - - irq = (int)(uintptr_t)source; - - switch (irq) { - case IRQ_TIMER_SUPERVISOR: - csr_set(sie, SIE_STIE); - break; - case IRQ_SOFTWARE_USER: - csr_set(sie, SIE_USIE); - break; - case IRQ_SOFTWARE_SUPERVISOR: - csr_set(sie, SIE_SSIE); - break; - default: - panic("Unknown irq %d\n", irq); - } -} - -int -riscv_setup_intr(const char *name, driver_filter_t *filt, - void (*handler)(void*), void *arg, int irq, int flags, void **cookiep) -{ - struct intr_irqsrc *isrc; - int error; - - if (irq < 0 || irq >= INTC_NIRQS) - panic("%s: unknown intr %d", __func__, irq); - - isrc = &isrcs[irq].isrc; - if (isrc->isrc_event == NULL) { - error = intr_event_create(&isrc->isrc_event, isrc, 0, irq, - riscv_mask_irq, riscv_unmask_irq, NULL, NULL, "int%d", irq); - if (error) - return (error); - riscv_unmask_irq((void*)(uintptr_t)irq); - } - - error = intr_event_add_handler(isrc->isrc_event, name, - filt, handler, arg, intr_priority(flags), flags, cookiep); - if (error) { - printf("Failed to setup intr: %d\n", irq); - return (error); - } - - return (0); -} - -int -riscv_teardown_intr(void *ih) -{ - - /* TODO */ - - return (0); -} - -void -riscv_cpu_intr(struct trapframe *frame) -{ - struct intr_irqsrc *isrc; - int active_irq; - - KASSERT((frame->tf_scause & SCAUSE_INTR) != 0, - ("riscv_cpu_intr: wrong frame passed")); - - active_irq = frame->tf_scause & SCAUSE_CODE; - - CTR3(KTR_TRAP, "%s: irq=%d, umode=%d", __func__, active_irq, - TRAPF_USERMODE(frame)); - - switch (active_irq) { - case IRQ_SOFTWARE_USER: - case IRQ_SOFTWARE_SUPERVISOR: - case IRQ_TIMER_SUPERVISOR: - critical_enter(); - isrc = &isrcs[active_irq].isrc; - if (intr_isrc_dispatch(isrc, frame) != 0) - printf("stray interrupt %d\n", active_irq); - critical_exit(); - break; - case IRQ_EXTERNAL_SUPERVISOR: - intr_irq_handler(frame); - break; - } -} - -#ifdef SMP -void -riscv_setup_ipihandler(driver_filter_t *filt) -{ - - riscv_setup_intr("ipi", filt, NULL, NULL, IRQ_SOFTWARE_SUPERVISOR, - INTR_TYPE_MISC, NULL); -} - -void -riscv_unmask_ipi(void) -{ - - csr_set(sie, SIE_SSIE); -} - -/* Sending IPI */ -static void -ipi_send(struct pcpu *pc, int ipi) -{ - u_long mask; - - CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, pc->pc_cpuid, ipi); - - atomic_set_32(&pc->pc_pending_ipis, ipi); - mask = (1 << pc->pc_hart); - - sbi_send_ipi(&mask); - - CTR1(KTR_SMP, "%s: sent", __func__); -} - -void -ipi_all_but_self(u_int ipi) -{ - cpuset_t other_cpus; - - other_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &other_cpus); - - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - ipi_selected(other_cpus, ipi); -} - -void -ipi_cpu(int cpu, u_int ipi) -{ - cpuset_t cpus; - - CPU_ZERO(&cpus); - CPU_SET(cpu, &cpus); - - ipi_send(cpuid_to_pcpu[cpu], ipi); -} - -void -ipi_selected(cpuset_t cpus, u_int ipi) -{ - struct pcpu *pc; - u_long mask; - - CTR1(KTR_SMP, "ipi_selected: ipi: %x", ipi); - - mask = 0; - STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { - if (CPU_ISSET(pc->pc_cpuid, &cpus)) { - CTR3(KTR_SMP, "%s: pc: %p, ipi: %x\n", __func__, pc, - ipi); - atomic_set_32(&pc->pc_pending_ipis, ipi); - mask |= (1 << pc->pc_hart); - } - } - sbi_send_ipi(&mask); -} -#endif - -/* Interrupt machdep initialization routine. */ -static void -intc_init(void *dummy __unused) -{ - int error; - int i; - - for (i = 0; i < INTC_NIRQS; i++) { - isrcs[i].irq = i; - error = intr_isrc_register(&isrcs[i].isrc, NULL, - 0, "intc,%u", i); - if (error != 0) - printf("Can't register interrupt %d\n", i); - } -} - -SYSINIT(intc_init, SI_SUB_INTR, SI_ORDER_MIDDLE, intc_init, NULL); diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index 95fe59519bba..2d68675f21aa 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -84,7 +84,11 @@ static device_identify_t riscv64_cpu_identify; static device_probe_t riscv64_cpu_probe; static device_attach_t riscv64_cpu_attach; -static int ipi_handler(void *); +static void ipi_ast(void *); +static void ipi_hardclock(void *); +static void ipi_preempt(void *); +static void ipi_rendezvous(void *); +static void ipi_stop(void *); extern uint32_t boot_hart; extern cpuset_t all_harts; @@ -192,8 +196,13 @@ release_aps(void *dummy __unused) if (mp_ncpus == 1) return; - /* Setup the IPI handler */ - riscv_setup_ipihandler(ipi_handler); + /* Setup the IPI handlers */ + intr_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); + intr_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); + intr_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); + intr_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); + intr_ipi_setup(IPI_STOP_HARD, "stop hard", ipi_stop, NULL); + intr_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); atomic_store_rel_int(&aps_ready, 1); @@ -245,17 +254,14 @@ init_secondary(uint64_t hart) pcpup->pc_curthread = pcpup->pc_idlethread; schedinit_ap(); - /* Enable software interrupts */ - riscv_unmask_ipi(); + /* Setup and enable interrupts */ + intr_pic_init_secondary(); #ifndef EARLY_AP_STARTUP /* Start per-CPU event timers. */ cpu_initclocks_ap(); #endif - /* Enable external (PLIC) interrupts */ - csr_set(sie, SIE_SEIE); - /* Activate this hart in the kernel pmap. */ CPU_SET_ATOMIC(hart, &kernel_pmap->pm_active); @@ -309,74 +315,59 @@ smp_after_idle_runnable(void *arg __unused) SYSINIT(smp_after_idle_runnable, SI_SUB_SMP, SI_ORDER_ANY, smp_after_idle_runnable, NULL); -static int -ipi_handler(void *arg) +static void +ipi_ast(void *dummy __unused) +{ + CTR0(KTR_SMP, "IPI_AST"); +} + +static void +ipi_preempt(void *dummy __unused) +{ + CTR1(KTR_SMP, "%s: IPI_PREEMPT", __func__); + sched_preempt(curthread); +} + +static void +ipi_rendezvous(void *dummy __unused) { - u_int ipi_bitmap; - u_int cpu, ipi; - int bit; + CTR0(KTR_SMP, "IPI_RENDEZVOUS"); + smp_rendezvous_action(); +} + +static void +ipi_stop(void *dummy __unused) +{ + u_int cpu; - csr_clear(sip, SIP_SSIP); + CTR0(KTR_SMP, "IPI_STOP"); cpu = PCPU_GET(cpuid); + savectx(&stoppcbs[cpu]); - mb(); - - ipi_bitmap = atomic_readandclear_int(PCPU_PTR(pending_ipis)); - if (ipi_bitmap == 0) - return (FILTER_HANDLED); - - while ((bit = ffs(ipi_bitmap))) { - bit = (bit - 1); - ipi = (1 << bit); - ipi_bitmap &= ~ipi; - - mb(); - - switch (ipi) { - case IPI_AST: - CTR0(KTR_SMP, "IPI_AST"); - break; - case IPI_PREEMPT: - CTR1(KTR_SMP, "%s: IPI_PREEMPT", __func__); - sched_preempt(curthread); - break; - case IPI_RENDEZVOUS: - CTR0(KTR_SMP, "IPI_RENDEZVOUS"); - smp_rendezvous_action(); - break; - case IPI_STOP: - case IPI_STOP_HARD: - CTR0(KTR_SMP, (ipi == IPI_STOP) ? "IPI_STOP" : "IPI_STOP_HARD"); - savectx(&stoppcbs[cpu]); - - /* Indicate we are stopped */ - CPU_SET_ATOMIC(cpu, &stopped_cpus); - - /* Wait for restart */ - while (!CPU_ISSET(cpu, &started_cpus)) - cpu_spinwait(); - - CPU_CLR_ATOMIC(cpu, &started_cpus); - CPU_CLR_ATOMIC(cpu, &stopped_cpus); - CTR0(KTR_SMP, "IPI_STOP (restart)"); - - /* - * The kernel debugger might have set a breakpoint, - * so flush the instruction cache. - */ - fence_i(); - break; - case IPI_HARDCLOCK: - CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); - hardclockintr(); - break; - default: - panic("Unknown IPI %#0x on cpu %d", ipi, curcpu); - } - } + /* Indicate we are stopped */ + CPU_SET_ATOMIC(cpu, &stopped_cpus); + + /* Wait for restart */ + while (!CPU_ISSET(cpu, &started_cpus)) + cpu_spinwait(); - return (FILTER_HANDLED); + CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &stopped_cpus); + CTR0(KTR_SMP, "IPI_STOP (restart)"); + + /* + * The kernel debugger might have set a breakpoint, + * so flush the instruction cache. + */ + fence_i(); +} + +static void +ipi_hardclock(void *dummy __unused) +{ + CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); + hardclockintr(); } struct cpu_group * @@ -575,3 +566,34 @@ cpu_mp_setmaxid(void) } } } + +void +ipi_all_but_self(u_int ipi) +{ + cpuset_t other_cpus; + + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + + CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); + intr_ipi_send(other_cpus, ipi); +} + +void +ipi_cpu(int cpu, u_int ipi) +{ + cpuset_t cpus; + + CPU_ZERO(&cpus); + CPU_SET(cpu, &cpus); + + CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, cpu, ipi); + intr_ipi_send(cpus, ipi); +} + +void +ipi_selected(cpuset_t cpus, u_int ipi) +{ + CTR1(KTR_SMP, "ipi_selected: ipi: %x", ipi); + intr_ipi_send(cpus, ipi); +} diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index c7d9249b2231..a73419930e88 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -92,16 +92,18 @@ struct plic_context { struct plic_softc { device_t dev; - struct resource * intc_res; + struct resource *mem_res; + struct resource *irq_res; + void *ih; struct plic_irqsrc isrcs[PLIC_MAX_IRQS]; struct plic_context contexts[MAXCPU]; int ndev; }; #define RD4(sc, reg) \ - bus_read_4(sc->intc_res, (reg)) + bus_read_4(sc->mem_res, (reg)) #define WR4(sc, reg, val) \ - bus_write_4(sc->intc_res, (reg), (val)) + bus_write_4(sc->mem_res, (reg), (val)) static u_int plic_irq_cpu; @@ -277,9 +279,9 @@ plic_attach(device_t dev) /* Request memory resources */ rid = 0; - sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (sc->intc_res == NULL) { + if (sc->mem_res == NULL) { device_printf(dev, "Error: could not allocate memory resources\n"); *** 506 LINES SKIPPED *** From nobody Sat Sep 7 01:47:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwG5Rvhz5WSdK; Sat, 07 Sep 2024 01:47: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 4X0wwG31sPz4k21; Sat, 7 Sep 2024 01:47:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vhj0bfgoFeq88GTrGWKRJZWKEzIkBEGjO8WaDZdhjr8=; b=un/twUGZy7DhJpenPQ52TppT9HbPaoQqMC+Tinvd7rriBiyV3h3lS6xJ6+ThF9jTrCC4Vm o+RxLZvZws/XecV657njKm/GMQKOKLkB1SBzeAGkkmzQWYDSAZ0kxdVRYjrmCH8NYNkSCE awWyuRdziUnlnuGocACTdm9pgRTC/a4POZ9Ei6nQrz3siK3Ls0kKKx1gmvoQOlFENzCQ15 ZQrpTDdQCoDTFuI57re7pPA61u65eVNBnM0h5JNbqz/fpLN3QfRBEPemk4TiL20RQ63GjU MejLbo21sbd8kxN+mxwHQLVsSSm52+r3ZBnNV2cwYSrJ9+n5gfC0BTFOuvnBUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673678; a=rsa-sha256; cv=none; b=YMhN3INDEGT2jit5VcnWTSCwbX+B6Vnn+HyxYSYX66DDb63UGLrotZ/xtbR8oSsMftzSWF khbJcQaL7N8/DKEFhLnxuHp0oT3AeOnVyN5OGIGCZnObNkS/wA7X+RxvvJ7BqTAqWZ3/gS RucB8SMZgW1lBklJ3jzhwvJ+Rw9TG4dCjifkur4vbttHySeYPSIiYIbaqlRdqyOJtvzTs1 A9EqLTZI2ZI+zoDfdfn3ebbLgBEG1Yxy9Em1Gh9ENAU1VwZuYohP/EdNE3cu/ex++iwnD2 8fIRtNMgs09QrJLG7TZu2ilR77/N1PgJka0ZI+zgSRd2H4QFpUEM/m4GvnGoXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vhj0bfgoFeq88GTrGWKRJZWKEzIkBEGjO8WaDZdhjr8=; b=vsdYSaF5LipmKgXAK+Z+OFR4peADvd7Xk11emnDcvMkxenb8KJ7o3cAaIcF6iUk9W/kBqz Ep7T6UwW6Ryyock+kZ9cKEshsaRzjzfBY1Nu8QeSRhArf9OOQqYuSPm1tsOjPZmrL1XwCI r/43vwm4YkdMJ9k5cWfluimV4smOt/EUPpo6Un6Heq8bjSmlYTUFsDHP5h/a5lRE5RVwVe 4L7mEmZbBhjn3LwuDk9E7SkmhAmD41kTbOXxmpC4+FbaRUCsr8HvuaKccjZ/acuyzimGeQ Spdxa+MtGQQklLkqlo7CsQ70L32VYBe0PIrk4sJMrv7xrguhXEYWer8Ik7lQAg== 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 4X0wwG2dRszGM7; Sat, 7 Sep 2024 01:47: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 4871lwNJ041634; Sat, 7 Sep 2024 01:47:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lw8V041631; Sat, 7 Sep 2024 01:47:58 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:58 GMT Message-Id: <202409070147.4871lw8V041631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 9f224d3ec46e - stable/14 - riscv: Remove the unused riscv64_cpu driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f224d3ec46ef822165df35990f96c6e7c6b67c8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9f224d3ec46ef822165df35990f96c6e7c6b67c8 commit 9f224d3ec46ef822165df35990f96c6e7c6b67c8 Author: Jessica Clarke AuthorDate: 2024-01-30 20:33:30 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:00:40 +0000 riscv: Remove the unused riscv64_cpu driver This is a repeat of 63bf2d735ca3 ("Remove the unused arm64_cpu driver.") for RISC-V, which copied the defunct code from arm64 with no changes beyond substituting riscv64 for arm64, and made no use of it elsewhere. It has thus always been entirely superfluous. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43672 (cherry picked from commit 722b40377198e384a808f9561ae7262767068ab2) --- sys/riscv/riscv/mp_machdep.c | 76 -------------------------------------------- 1 file changed, 76 deletions(-) diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index 2d68675f21aa..641288e0b235 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -80,10 +80,6 @@ static enum { #endif } cpu_enum_method; -static device_identify_t riscv64_cpu_identify; -static device_probe_t riscv64_cpu_probe; -static device_attach_t riscv64_cpu_attach; - static void ipi_ast(void *); static void ipi_hardclock(void *); static void ipi_preempt(void *); @@ -96,7 +92,6 @@ extern cpuset_t all_harts; #ifdef INVARIANTS static uint32_t cpu_reg[MAXCPU][2]; #endif -static device_t cpu_list[MAXCPU]; void mpentry(u_long hartid); void init_secondary(uint64_t); @@ -116,77 +111,6 @@ static volatile int aps_ready; /* Temporary variables for init_secondary() */ void *dpcpu[MAXCPU - 1]; -static device_method_t riscv64_cpu_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, riscv64_cpu_identify), - DEVMETHOD(device_probe, riscv64_cpu_probe), - DEVMETHOD(device_attach, riscv64_cpu_attach), - - DEVMETHOD_END -}; - -static driver_t riscv64_cpu_driver = { - "riscv64_cpu", - riscv64_cpu_methods, - 0 -}; - -DRIVER_MODULE(riscv64_cpu, cpu, riscv64_cpu_driver, 0, 0); - -static void -riscv64_cpu_identify(driver_t *driver, device_t parent) -{ - - if (device_find_child(parent, "riscv64_cpu", -1) != NULL) - return; - if (BUS_ADD_CHILD(parent, 0, "riscv64_cpu", -1) == NULL) - device_printf(parent, "add child failed\n"); -} - -static int -riscv64_cpu_probe(device_t dev) -{ - u_int cpuid; - - cpuid = device_get_unit(dev); - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - - device_quiet(dev); - return (0); -} - -static int -riscv64_cpu_attach(device_t dev) -{ - const uint32_t *reg; - size_t reg_size; - u_int cpuid; - int i; - - cpuid = device_get_unit(dev); - - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - KASSERT(cpu_list[cpuid] == NULL, ("Already have cpu %u", cpuid)); - - reg = cpu_get_cpuid(dev, ®_size); - if (reg == NULL) - return (EINVAL); - - if (bootverbose) { - device_printf(dev, "register <"); - for (i = 0; i < reg_size; i++) - printf("%s%x", (i == 0) ? "" : " ", reg[i]); - printf(">\n"); - } - - /* Set the device to start it later */ - cpu_list[cpuid] = dev; - - return (0); -} - static void release_aps(void *dummy __unused) { From nobody Sat Sep 7 01:47:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwH5KTKz5WSTT; Sat, 07 Sep 2024 01:47: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 4X0wwH3bxyz4k94; Sat, 7 Sep 2024 01:47:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wy1BgNx+sLOT8gTC2NcTkskje+v/for/z5oKA9nSEIg=; b=o7zOjpverSwOpQU+LAsd7y99Irnz+JTCyZpgIja2+4xCerMapPf58hhmrz1+SBlj5HJM4l n8fmzrADRb0eXXrHd/jx60peKs9V5SY8bB4IhBqJF7j8Dy6BzI75bFLpET2HynG+NDLquj Ue+kgtqJ0FqFcT9YeazD9H3knWl3ZvIuBK6mx7UlMv9+p+ortmo2iytZXsGw5tnrrZf4q4 OuXzsRoZJHInfGQr0Z0BthtfkO6mRr5AbDHNDAdGKothfXawqlV2STM7Vgul1yIqMfdvBd MgXi2LoyDPWFYpzN/fITtmcXlQpTvlVZeQOKaSLX3wRfjOp8uVtIUr15gpt8Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673679; a=rsa-sha256; cv=none; b=iPUv3EEGAkLnZIb7OCyjtjl/0bMI1ogmgOWUkhrHq8mvYbSVQ7QCujJ3BpFso4/FpwtVqj 3mO378brReRs0kwcludqMdJ2Nd5kFtBvym4XZUVUrX9VD+pa9DvHr/ZG0pGfMVArS27EUx OfL8F/UAFlPkeQn5q6r6w7kbi6iMSvTBbDh9aiz7yOIhYdzzjqquW45MVFH//Z9PYenfhE b0gH2rny5Jc+fn9d5o+Gv9GqVvKTQxetlAR2pDRgm7W+P/wqsVfJTuoD7e6GekKM9WEy2s xiwKEKce6r47fV7cRchrzQb1VNef9afjikT7FRId5uuGA7rmnYnt0Bc9kegQ5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wy1BgNx+sLOT8gTC2NcTkskje+v/for/z5oKA9nSEIg=; b=MMGJQZ+kFtCpkDcPp87D7uhXYTONyBaVtcB3K82rZwid6u7w5mcMv4DakvZEX+XYJBu2Qf tZyltmlKr1NCLCNiOJ48KyKN0/RexyaEZ6sACIqEXQ1SriCq7mGoATfbq7gm6JeG54EdUD Mb0+B+BxiobRRE0BQN84sCcapzYM4IWhaI2YBuTaj76dOpx12jRXYgkHfZzX8CmnYzcLew HAOt2wpKYIGUc2VmPiLIQkG74F74ALzZe5V69cJjIv9oQRdtV69OoN/wnB5dOx+QLV/GuZ 7pFS4lZYHCaS6Nbui3qfB6QAl4F36iItF1GQIuE89rfI5pCGQtlGiPVocXM1Sw== 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 4X0wwH3D4wzG32; Sat, 7 Sep 2024 01:47: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 4871lxiq041689; Sat, 7 Sep 2024 01:47:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lxuF041686; Sat, 7 Sep 2024 01:47:59 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:59 GMT Message-Id: <202409070147.4871lxuF041686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: aaf4d3f3d194 - stable/14 - bsdinstall: Fix netconfig script when no interfaces are present List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaf4d3f3d1947531cc81f90ea5af522c719857ff Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf4d3f3d1947531cc81f90ea5af522c719857ff commit aaf4d3f3d1947531cc81f90ea5af522c719857ff Author: Jessica Clarke AuthorDate: 2024-02-03 01:52:37 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:00:46 +0000 bsdinstall: Fix netconfig script when no interfaces are present The script uses [ -z "$INTERFACES" ] to check if the list of interfaces is empty and will exit early if so, but INTERFACES always contains at least a space due to the way it appends the list of wireless devices. Fix this by only adding the space when there are devices to append, mirroring the behaviour for non-wireless devices above (both will result in a redundant leading space when the list is non-empty, but that one is harmless). Fixes: 159ca5c844cd ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.") MFC after: 1 week (cherry picked from commit b809c7d6a26924ac351e49a15011da718cc3feec) --- usr.sbin/bsdinstall/scripts/netconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index bdbbd42b3328..300dcc6f5e5e 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -49,7 +49,8 @@ for IF in `ifconfig -l`; do INTERFACES="$INTERFACES $IF" done -INTERFACES="$INTERFACES $(sysctl -in net.wlan.devices)" +WIRELESS_INTERFACES="$(sysctl -in net.wlan.devices)" +INTERFACES="$INTERFACES${WIRELESS_INTERFACES:+ }$WIRELESS_INTERFACES" is_wireless_if() { for IF in $(sysctl -in net.wlan.devices); do if [ $IF = $1 ]; then From nobody Sat Sep 7 01:48:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwK0vMkz5WSLV; Sat, 07 Sep 2024 01:48: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 4X0wwJ4wRPz4jxJ; Sat, 7 Sep 2024 01:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9tWVrCCdej88Jl2I1AsZG1HQnNlSmQzsE/8BuuZTmPI=; b=Iv7q44ka+In22s2qHv4OEZqOsiugTETcc31F3FQkQ3Bos+z0EGwkq2dfMvIFXdLLhgjFWu 5gTD+JueTRBIVywiCp1BYqQgeSUnzdsFUcuibOvwawJ5hzHCR4UYsadRjIGd8WMqukA5Be 3Gz+8W3SVJLbCwxonfMxcHMg9hXUecjy4qlFfD/NLBcEpySGwaYJXD6fUT2cAPJLvQcFVw x370G5+UG4mF5N/1AD21B9zeqix+ydcOuTnsuCYRgJC1ZBVxF4vh2JGyhxcBLsm6cKxHcG eSEbgM4HGnCzfvin8E01SqG2DZsrw0uBvIyzZr++Fc9kzLQV9tNfJk0tOi6+Hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673680; a=rsa-sha256; cv=none; b=ug95HGdD6E90WeRZ9oVL8lYHI6CnMKk7fBhmtCq1W2kjNvzIJ3a53ex+zBKtMBcQQsnxB5 Vrn/+rYCUjSxINLXpmiT5mSkuQQZAlKUHITn1eGR+FWgq+U8p+H2oKNYueXGejPZLLR501 APGFEBUIDsJwUtx7NXE7EOA0laJTGw6zNZrj1MHRg01e5CuzmmshAjvZwLaJSnuHBiop88 EEfWIFfIXWsqm3g1jLascfqjOGHXg0zlR/hH6F0U6i43n2Suoj7yCWz7I9AIJHDgrIJ6hb nznBsabN8Ic2/jBWSxIYx/z0VM4nYV0+G61zyJKTACovmog3vjXtHXzUgkIaiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9tWVrCCdej88Jl2I1AsZG1HQnNlSmQzsE/8BuuZTmPI=; b=UEDj7SQ7YL64VmrOgf7TdXjFFNUQ26cWS9XdTmJEIs/vTqg+pnScOKCTDS8iGhYYG1Z+Yi sX/srEWli31J40wrnORgnBeJ9h4XeTdp3JtdXVclyCqHNcCC5bAYo2A7Y94uKHC8cJj/Qj 4FmZKcneqafX+8VDHMRLV5GCcKDD03bHlNRVMIuAT6QpPOvy+KCZN3tIFkKt+48q8ydsvt rsCVUv4s8ey29oZng6N9BawcC+AeOEs/yjGRmRjyABkfLx9mZ2OnF29J6vZ8qGEWnHjNvN SdWx2C2YKbzeVDSA5PhYd5TiAhjELTCnDptY6phOWEHJd2w/ACk/8rJkhQn2bQ== 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 4X0wwJ4VcdzGM8; Sat, 7 Sep 2024 01:48: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 4871m0Ee041758; Sat, 7 Sep 2024 01:48:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m0xb041755; Sat, 7 Sep 2024 01:48:00 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:00 GMT Message-Id: <202409070148.4871m0xb041755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 6368aa66f8a7 - stable/14 - bsdinstall: Drop Error from title in netconfig no interfaces dialog List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6368aa66f8a7c5f1ac322575e4ce4ee4d196b4d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6368aa66f8a7c5f1ac322575e4ce4ee4d196b4d8 commit 6368aa66f8a7c5f1ac322575e4ce4ee4d196b4d8 Author: Jessica Clarke AuthorDate: 2024-02-03 01:52:53 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:00:51 +0000 bsdinstall: Drop Error from title in netconfig no interfaces dialog This isn't inherently an error. It is if you're attempting to download dist tarballs or later install packages, but a FreeBSD system with no NIC is a reasonable setup to have, especially in a throwaway VM setting, so we shouldn't say it is one. Leaving the exit code as 1 is still fine, since auto will ignore it, and avoids breaking other uses. MFC after: 1 week (cherry picked from commit 7414d14bd51d8378057bbe952c2715b9f32d1d3e) --- usr.sbin/bsdinstall/scripts/netconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index 300dcc6f5e5e..19644898a66a 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -67,7 +67,7 @@ done if [ -z "$INTERFACES" ]; then bsddialog --backtitle "$OSNAME Installer" \ - --title 'Network Configuration Error' \ + --title 'Network Configuration' \ --msgbox 'No network interfaces present to configure.' 0 0 exit 1 fi From nobody Sat Sep 7 01:48:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwL0DK0z5WSLY; Sat, 07 Sep 2024 01:48: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 4X0wwK6Bvtz4k9X; Sat, 7 Sep 2024 01:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1rX/6T0sUsw4OzHOBRRpi63HW4vMM4jG8fQQCKWathw=; b=Z8w0xHtmgHHLbVFPVkADwtHzC1B4I/jlpI7aNVrMPV7jOGErRXNAJlu+LQV8dFHFMwI4j1 KWpQ7KqQ3b7kNB80xauur31LVSO2SXNVr7NJQzZZuywzbYRibcr/i/lh3hr/agB0xl4D25 vpiXXRntspOkiKBrSVxzM8Hr+sPNJy3XnFrzAYmT53ePE4xrq6Jl+E0q1i5N6og906+JDH Wg2LGOgI9IuYOXiO23BYNTsBXClJe5CIdeffsrNk0Js1wLVh7gk2/3LqcjEJOeQ0s5S9QX fZDxZfxnFiFUeoPiHzgZtKmvM5gdYowrJyhnT6bmzdoygtrvJ+bIVaxFzfwjOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673681; a=rsa-sha256; cv=none; b=dgE2c9g68PKRRevUrxC+/cWB1wBH38ft9dsHbjtnG9CHtP27AS2fuohkj/wirR7Uv/69aj dHwofJ2wthNzX3gixbsu7Jf8a06rDtkWk7Kn5zRlUpgmxjIS4krPhNU6hfy9dHXp/qPRII 5NGGpGwHZ84LjXj1ugV1/GnsuR6f03WA9CI2NlqAFh7lAa0VYokl/voFttQ7iHYmBkdSFc 2QZO4cVw4vMh2y2TbQJO/onEju86F80yan4hzEgHI6iTqg0fjh0vUbu3N35qOcCJ5IfyWw G0/YwwxjKNpaESEv9pQsJurDHRuoh0wS6H4MJiyHDTxx1Ecytl3RddZaGT3K4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1rX/6T0sUsw4OzHOBRRpi63HW4vMM4jG8fQQCKWathw=; b=rK0+SvSxE37TLL5CIVu2bc23hLX21qz5b7tqL4i25VIJKKMqx3TYynEglogD+5TKsmrhd6 524Sr1EjZBdMtOcJvk1iYpjV3WbJJ79Jq4pzmKQZQYOplLE/u106/vkRa7VBodv9aVUkC2 CauTztnL5pTzdgAhgvXjqNs0PkAw0mk5F1jNgWaXg7Ky6JVJhhNKnnl37NJPV5WLuIyPeg MlJLbivULlMhEE9G4WXeAyD/vrTLI/ELc6yswkF7VvDUnIaVj7qDPrUOdxWullzbQb/ZOh 0PzvnoS61jg1509MtZW9Zd4ZJGgOg34/1lMWvpVt+Rsm6cm+UVx7TmBj2j2aQA== 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 4X0wwK5X9nzG33; Sat, 7 Sep 2024 01:48: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 4871m1sM041821; Sat, 7 Sep 2024 01:48:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m1BF041818; Sat, 7 Sep 2024 01:48:01 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:01 GMT Message-Id: <202409070148.4871m1BF041818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d861861462d2 - stable/14 - arm: Set NEW_PCIB in DEFAULTS rather than a subset of kernel configs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d861861462d2b9157a6b938c2b4832d6589264a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d861861462d2b9157a6b938c2b4832d6589264a0 commit d861861462d2b9157a6b938c2b4832d6589264a0 Author: Jessica Clarke AuthorDate: 2024-02-22 18:27:45 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:00:56 +0000 arm: Set NEW_PCIB in DEFAULTS rather than a subset of kernel configs All other architectures set NEW_PCIB in DEFAULTS, with arm being the one remaining straggler that only sets it for GENERIC and TEGRA124. ARMADA38X and ARMADAXP contain device pci but don't set NEW_PCIB, however GENERIC claims to support them and as part of that NEW_PCIB support was added to mv_pci, so these configs are most likely just stale. Other than NOTES that just leaves ALPINE as the one kernel with PCI support not covered by GENERIC, but al_pci is supported by arm64 which enables NEW_PCIB, and it's just a generic_pcie_fdt_driver with some fixup code to deal with quirks so should support PCI_RES_BUS just fine. Therefore it is believed that all in-tree kernel configs support NEW_PCIB in reality, and so let's take a step towards removing all the non-NEW_PCIB code by having it always-on everywhere. Reviewed by: emaste, jhb, manu MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D43806 (cherry picked from commit 121be555997b3d7727e50d15acabd0ffbf4a4247) --- sys/arm/conf/DEFAULTS | 2 ++ sys/arm/conf/GENERIC | 1 - sys/arm/conf/TEGRA124 | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/conf/DEFAULTS b/sys/arm/conf/DEFAULTS index d28e7b6302f9..85d090dfa782 100644 --- a/sys/arm/conf/DEFAULTS +++ b/sys/arm/conf/DEFAULTS @@ -6,4 +6,6 @@ device mem # Default congestion control algorithm options CC_CUBIC # include CUBIC congestion control + +options NEW_PCIB options INTRNG # All arm systems use INTRNG these days diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 05bbf6526b34..baaba0880705 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -98,7 +98,6 @@ device ahci # AHCI-compatible SATA controllers #device ata # Legacy ATA/SATA controllers # PCI -options NEW_PCIB device pci device pci_host_generic diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124 index b1c5be8af587..058a85955a04 100644 --- a/sys/arm/conf/TEGRA124 +++ b/sys/arm/conf/TEGRA124 @@ -112,7 +112,6 @@ device ums # USB mouse #device wlan_amrr # AMRR transmit rate control algorithm # PCI -options NEW_PCIB device pci # PCI Ethernet NICs that use the common MII bus controller code. From nobody Sat Sep 7 01:48:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwM26nZz5WSZs; Sat, 07 Sep 2024 01:48: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 4X0wwL6vmcz4k3K; Sat, 7 Sep 2024 01:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8mIVFlTY/Aub38UsF2dckIiBth5boDuv/05x1gbl8og=; b=PcbupAI4X3xAYgNKrzIJOOovydg6C3ma4m7PbviunueZJm6uFpxqxajh4F66j386QDJZJD 5G/tnJsbEx3a8Zz7h8gW1bSm+Iypa5U954tDhaD6ZScFPcAzcx/E513lpm5P9bxaDDST+d tPmXu3lCrK8c1KqFV7B5NjnxM/ACYiJCPqgoGa6B7pOg7y8silXYJ+eWRA+fuXYfxRn+8y OGMFWmzejAGG4A0zX24JT9oHv/CTkByKS2t0TTMBATMKTfn/kFymD2Kq4YOeULDyea/APC nc/GJ2fknaDqozb1mR8+y/405lCdnzFatlBpb6tqRO/OCtY0jx6+h+/Asi9vHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673683; a=rsa-sha256; cv=none; b=mPabs59gNZtCpiRdEOE+DmN8Ov82XBf9BQ9pIMbyHlqEa839aoia4C85wM3Gz3UUsWvnqH Ju3Tumy/66SP7WJo3rdG0UzBFvqqHIUusqkKLPFiq45HwkiKdTGLF5t0Clhae6VjM7sCgH jKi9V8NZ+RVHjlcBkEfllSEd/okWgdBg24s4RAO8ayvh558mHSBr/gp4kImHRJ9jzr2KC4 0DgpeiMqwXukWoAbylUWiTwaHhnp1xYrTsHi7odL1TZJFcP+qGSIRsFKESdmYioo1Phmjb HGv/WhtpUW9QUG6/XrDAFW0f1sXduYbuHAhuOxO73D7hKgeu0DD4ZDKSWVCsrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8mIVFlTY/Aub38UsF2dckIiBth5boDuv/05x1gbl8og=; b=Ja5NZpSD1NSjk3qO5SklxtR/AxdPF1uA2Zh2JSkUKTodaG7OFTAqN6yPeIoIJVnDeYBYEo 8DwkdbwIzSAnV4519jI9uVK/jRar92XXSPpNjQ0cINd7NDlFlb/cGnXXxC9usMzbfaiAMJ t4X3HQSG0OOI3fY/P7rrW8OUes3K5O4ldPaITguUOOHbBbK/hiSxwkMWFXXqk0bu7K7TAo YfdBCmztwAQV4h7bcGnLyqDw+COsWX3VigAUbXl2dH5Yd+fH+P/2pEAjpTeon+FUvHFuzI 7I8g+DsHPdFM9MqMcrxj5QUiF2ZtBsn0xQDy9zLu8DouX5eSgKuUS/Fwb8dm8w== 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 4X0wwL6SMDzGPc; Sat, 7 Sep 2024 01:48: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 4871m2XA041875; Sat, 7 Sep 2024 01:48:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m29O041872; Sat, 7 Sep 2024 01:48:02 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:02 GMT Message-Id: <202409070148.4871m29O041872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 17c0e73b1d60 - stable/14 - efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 17c0e73b1d60c4544fad4667c8d45d588fe664cf Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=17c0e73b1d60c4544fad4667c8d45d588fe664cf commit 17c0e73b1d60c4544fad4667c8d45d588fe664cf Author: Jessica Clarke AuthorDate: 2024-02-23 02:36:21 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:01:01 +0000 efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 case If cnt == 0 we access element 0 unconditionally, which is out of bounds, and then if that doesn't crash and happens to be 0 we will access element - 1, also out of bounds, and then if that doesn't crash will add 1 to whatever junk is there and use that for the variable. On CHERI, though, this does crash. This code is also overly complicated, with unnecessary special cases and tracking more state than needed. Rewrite it in a more general manner that doesn't need those special cases and naturally works for cnt == 0. Found by: CHERI Reviewed by: imp Fixes: 1285bcc833a3 ("Import Netflix's efibootmgr to help manage UEFI boot variables") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44029 (cherry picked from commit 09cb8031b43c8e98abb5ff9b43ff649031d1e808) --- usr.sbin/efibootmgr/efibootmgr.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index dfe8bfb1c145..74b59863d6c5 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -555,7 +555,7 @@ static char * make_next_boot_var_name(void) { struct entry *v; - uint16_t *vals, next_free = 0; + uint16_t *vals; char *name; int cnt = 0; int i; @@ -573,21 +573,14 @@ make_next_boot_var_name(void) vals[i++] = v->idx; } qsort(vals, cnt, sizeof(uint16_t), compare); - /* if the hole is at the beginning, just return zero */ - if (vals[0] > 0) { - next_free = 0; - } else { - /* now just run the list looking for the first hole */ - for (i = 0; i < cnt - 1 && next_free == 0; i++) - if (vals[i] + 1 != vals[i + 1]) - next_free = vals[i] + 1; - if (next_free == 0) - next_free = vals[cnt - 1] + 1; - /* In theory we could have used all 65k slots -- what to do? */ - } + /* Find the first hole (could be at start or end) */ + for (i = 0; i < cnt; ++i) + if (vals[i] != i) + break; free(vals); + /* In theory we could have used all 65k slots -- what to do? */ - asprintf(&name, "%s%04X", "Boot", next_free); + asprintf(&name, "%s%04X", "Boot", i); if (name == NULL) err(1, "asprintf"); return name; From nobody Sat Sep 7 01:48:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwN354kz5WSRL; Sat, 07 Sep 2024 01:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwN27wFz4kLt; Sat, 7 Sep 2024 01:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zYLBVCaf8xIDoOMpr2lNMvWzZQvfmpJ+hEDeKDWQLzY=; b=bxKfG3bbap6b5F38+oK7MjGIYDlIFXcwwrMZOJEhdSGX+0RZ1hdKc7r3avwGpUGgG/SASy JyRhaniuYNXeK+2ggdSz2u8a2qvVOfXkCH6tDBoOYgSowThQhMPZGKBOvp7PRX6L61HpQ0 AhGaDO8RHh+XwrW8hbS5B9RPjQkl0V3wX0Av6P5Qe6eFSM8vTPKuWiyhNE3XDec9n4B/QV 2ffmUp0QDyrYduLfNLVfevyZKb2RKLTcJ7StpZ/n87RPS7WuKvOj7V3o38i/cXQgUDQlJM rERygii9wFhGy94aciCqYlQyj7kmYSXgYw14xHKJ5vHsEW/hyJwwvmh+w6KqMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673684; a=rsa-sha256; cv=none; b=uWU5Q9ahKr9kYY4GtQoSI5FPv4YXL9wLDgJOU250fJq2hOAUSsyzZ7vmVWnQkArV4io/yi YaUVRrwfloiODdx71nVHSLhfb0xjXj64TOUXakbdZRpKfpCs9OWsvpCJH7QSrbTd1Vy/dz WBhmJHrm7AwsbY7ZYcxQrEt5cMFwFrcxZ5xX1b5yH4B+zMuNu2f+pB5X0d0A7uzsE8jaVP /3ravIn5uwkK/Is653r2LAtvSyEcgyH3k+D6xgpOlMgUgfBTRRQD1w04CyA9GKCS/xgWya C+Cs2PxsAD0Hes9i+0J8i/z/1hJd9fFi2x6Ohdf4K1JS/p860Vh5vfHcvhQMjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zYLBVCaf8xIDoOMpr2lNMvWzZQvfmpJ+hEDeKDWQLzY=; b=ssCwq1le3Q6GHj/CAv8/oTFrpmwTUfma967Yy3lGdZU3i5K7zzwJhYatznXTr+ObdcwA0R 5GG6jBYPHpmpeWsFMPc3Hl3NafiLZFlLv8wi9NBlhW1WdCd4tmktqxjjNPzWqbf67Olg8Q YjEI2blEu/pTMj/UoYkLb4RE2G+mJRDPQ0noxKlEEh0YR13SvBzmBYc2wO3tgUhjm1/uXk n+KEL7ULa7C47XAwG9qZ8OdmucY3BYIbvNiS/hMkCx9MZXkbAi5QE3/LUTkmje7+zTMOGt JOnDgFsLeEfwZUDfn/PI540QaHJ/UrI9W9gt65JMtDJRfNzNFBbvgQKMwwI2nA== 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 4X0wwN02wrzGPd; Sat, 7 Sep 2024 01:48: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 4871m33m041927; Sat, 7 Sep 2024 01:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m3Rp041924; Sat, 7 Sep 2024 01:48:03 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:03 GMT Message-Id: <202409070148.4871m3Rp041924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 10e602164f02 - stable/14 - ee: Fix use of uninitialised pointer in ispell_op List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 10e602164f0281d5f5dfea9ebf2b29fba4a716bc Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=10e602164f0281d5f5dfea9ebf2b29fba4a716bc commit 10e602164f0281d5f5dfea9ebf2b29fba4a716bc Author: Jessica Clarke AuthorDate: 2024-06-02 22:53:09 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:01:06 +0000 ee: Fix use of uninitialised pointer in ispell_op This used to be name = mktemp followed by fd = open downstream, replacing upstream's crude PID-based sprintf, but in 1.4.7 this was changed upstream to this buggy code, which we then picked up in the 1.5.0 import. Presumably nobody's actually used ee's ispell function in the past 15 years; that or it's just ended up using junk file names as temporary files if name's happened to be a valid address to something that can be interpreted as a string. Reported by: Dapeng Gao Fixes: 96b676e99984 ("Update ee(1) in the base system to version 1.5.0.") MFC after: 1 week (cherry picked from commit 25a33bfe9ce2b55812201f475e9d3e64009b40dc) --- contrib/ee/ee.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/ee/ee.c b/contrib/ee/ee.c index 2f122981dbe7..a14f9c0ead13 100644 --- a/contrib/ee/ee.c +++ b/contrib/ee/ee.c @@ -4431,6 +4431,7 @@ ispell_op(void) } (void)sprintf(template, "/tmp/ee.XXXXXXXX"); fd = mkstemp(template); + name = template; if (fd < 0) { wmove(com_win, 0, 0); wprintw(com_win, create_file_fail_msg, name); From nobody Sat Sep 7 01:48:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwP2Nkrz5WSP1; Sat, 07 Sep 2024 01:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwP1jLZz4k88; Sat, 7 Sep 2024 01:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVQmx1+PGLbhHZpk0hZd6ht3vxIeO3i7zaSpRM4tPWM=; b=Rm9BgeK31eFfr4ukRsmsbE/vA+n/kFb43INJufZexYMdoKXxMXJJnFEJMZzlT+PScpI3bC ODNBzn18yDCpQ0pz5XL+pJB1qM9dDLJtfkyPwEpFdSc3KALIiIdsrO2iJgbwJESIbe1DV9 Jd5JH4nlKGRLyoeLRaVoVyQsf/H58q2fnidNyknaHbZR+xoU/qtyHEzek4vrsyJSuj8Xgp vXXqKsTSpCNHNQAC4xp9LQlhHcVCK/cYG1ha8e113Mi0LxK8nzhLSY1FRm4GnUTvRhllHY Qqum9brdWC6Dm40LSoA25En32iXTjeGI+8QlXhb79/Df3UACgm8brIFng/bu5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673685; a=rsa-sha256; cv=none; b=d6c2tzysIp7tQrAAmnbLEGbcXPQeBkW4Bv4EG0O/RTnQGhdLfYAV8Tmv10Zb6mRzqIdqJO 0TDi2tR/iCC9EbbQA34ykurcr/W9/IE64bVhgsC848y2ZTxnlHSb9MYPIgfLz5ntmWSPLX E4daNhFwqie1kHjn46/85tp6XpvRsaxAVm6yrsjjuRSh9btzetMOMhObXooWR//wNE/pBD Xy37DqoPmY1bYUOJMViI7iwWaJs3PJZnaS7/IwFFNgTFfFe6JIUlc5j8xm3AS6bJqf28Fd 2LJ7molZc23kIZ0pK8cSEGl+DtrynSeqOZ6l2MqibUrJmHBgp1RO9qpCRHMNDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVQmx1+PGLbhHZpk0hZd6ht3vxIeO3i7zaSpRM4tPWM=; b=cDljiYi/7X6sMKNOBDAlPraFT6ktVfxE23KnutE5cRFyMQpd4EcKsOAgndsfms4GgN7BqJ fBaJq6vV/Z+f+GFUAMTwfOmEkgx9kFnNkw2Dtr2rbZGhT2RrfHtG/af9HYLBVb+84EsBJ+ GTcMUxZCQnQb2OPuYWvL0yUT1zHJBgGb5kJsOsMvJctXkJKhFm79z0W0MI+c4wLIu/fXeR gkT4DAb61+KYWcdmhZWoVqmTpU6EnvVl9lMTp6wBG6FZp+9m0bs6En0d3i9TZKpoD9HH6o tRJNj8orZ9p9AMbHn9EzdQGjmWDoyRklQWTJyUu8Z99ldexo7VCEBnksQLi0Cw== 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 4X0wwP1JWxzGPf; Sat, 7 Sep 2024 01:48:05 +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 4871m5b6041975; Sat, 7 Sep 2024 01:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m5vn041972; Sat, 7 Sep 2024 01:48:05 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:05 GMT Message-Id: <202409070148.4871m5vn041972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: ebdd179d759f - stable/14 - Fix off-by-one bug in btpand List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ebdd179d759f29354a0998c0308721a551a08cac Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ebdd179d759f29354a0998c0308721a551a08cac commit ebdd179d759f29354a0998c0308721a551a08cac Author: Dapeng Gao AuthorDate: 2024-06-03 19:30:36 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:01:11 +0000 Fix off-by-one bug in btpand `ul` reaches `__arraycount(services)` before the bound-check happens, causing undefined behaviour. Reviewed by: imp, jrtc27 Fixes: 7718ced0ea98 ("Add btpand(8) daemon from NetBSD.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45463 (cherry picked from commit fbfdf57d65bedfab28f9debc8a4a8d6802f9338a) --- usr.sbin/bluetooth/btpand/btpand.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bluetooth/btpand/btpand.c b/usr.sbin/bluetooth/btpand/btpand.c index 0d2eece68747..b8f6a1d4c8d1 100644 --- a/usr.sbin/bluetooth/btpand/btpand.c +++ b/usr.sbin/bluetooth/btpand/btpand.c @@ -147,11 +147,14 @@ main(int argc, char *argv[]) case 's': /* service */ case 'S': /* service (no SDP) */ - for (ul = 0; strcasecmp(optarg, services[ul].name); ul++) { - if (ul == __arraycount(services)) - errx(EXIT_FAILURE, "%s: unknown service", optarg); + for (ul = 0; ul < __arraycount(services); ul++) { + if (strcasecmp(optarg, services[ul].name) == 0) + break; } + if (ul == __arraycount(services)) + errx(EXIT_FAILURE, "%s: unknown service", optarg); + if (ch == 's') service_name = services[ul].name; From nobody Sat Sep 7 01:48:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwQ4YN0z5WSRR; Sat, 07 Sep 2024 01:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwQ2n3Sz4kJn; Sat, 7 Sep 2024 01:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wEEqLQhHilRYEybwZvw0wETjQVLeHcbFA+MY7Ajl0Hw=; b=e8ltEk0w0l3Dvrp3GuvHCEVGbjvN8/uZwA12oja9Eck1mxJ10YE8Nr6XAmAzfFXJjKKqBw M1X9jyBNOP57+Kk4hJpLXYmlCG2tuc8FfYLoQE/IxYTQMzwR2V7uD/fezoISl7nEIkxcz2 5i54kw+EjukE6zkvAesnaBcvjfr5Km0j67QgxZBdGOqG0HlvM9OvB5j//QRDexJXYt4zC3 EbqnxKqTot07MxjRgtsGW4LVUoajxQQSV5s74JZAB6LogZg5LmJcd0Moa7n4w+CjuywbzY cXw6Tq5DuKRxbtQv8O5paamRhiGL1DwlWrBTgryjiA6NHwhGjwkmcb7+cFAIdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673686; a=rsa-sha256; cv=none; b=i77mN1Ta1NbUoyDLKE6vN673GAWknLDUiZALzRDTLD3kyaeVzV9s0ktRhE54NPrGU3rCne D2irYHjpv9XMcnVPNPXpTy6EbpABOGaiTHP0Jb8Ufl98hpZSQUrdNMkc8D9e8TgSso4Cqy UI+yKrzFUvqkM2YCl/Ok5xbTvfnAlQrkdlCkPliVvpIZl7mzpV3/pgPHx0dlns1ROpR6sn kXX0KDiJ9rbo1uC/TwQRYDlAa9mksRBxelouQEc4TuJrUWxAiI8j2OgkMu9dUd5HzTTFvx iUiqc/t5rF4PX+NaPSmgTHLyy5K6xdng6YC+cgJMsDxNbHZFCyTawVnroliwOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wEEqLQhHilRYEybwZvw0wETjQVLeHcbFA+MY7Ajl0Hw=; b=k9Oh0Dcfce3oT0doGPYUhhaeYd1U8uJaX2fHJ/dY7/84n+QtJWdl/XExIQoZAS5h1U0aLi C4J30mXFgEK2XMZywZbtYraBj7TfWqJazIbvOKM2Jej56DNmxHhwFTDhXiUu/RhJPJ/Szz cS61LnLmBSyoTC0xfSXdh5iZdzfpF1fCaJ3Qfp4hwNoxVeNFcFKC5Q/3r5QUhJd8EuURfO tIwREKHSHkThH4bZVCrdBmEOYu1s27sf1VcvUwAxZUR4Q62zi51CuAIh30isqBcnRR0g3p BnPuxaL1x/UE0iTh5wwRfBaVQdqfWyu3aenAtR2VeNvTsqSLtTLxFWwaI4ijSA== 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 4X0wwQ2LqYzGPg; Sat, 7 Sep 2024 01:48: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 4871m6aL042029; Sat, 7 Sep 2024 01:48:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m6hq042026; Sat, 7 Sep 2024 01:48:06 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:06 GMT Message-Id: <202409070148.4871m6hq042026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: fd45162d1139 - stable/14 - mx25l.4: Document the correct disk device path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fd45162d11392cb5081654f11b9285a04bbad67a Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=fd45162d11392cb5081654f11b9285a04bbad67a commit fd45162d11392cb5081654f11b9285a04bbad67a Author: Jessica Clarke AuthorDate: 2024-06-11 16:43:18 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:01:17 +0000 mx25l.4: Document the correct disk device path This was true at time of commit, but the path was changed 2 weeks later to just be the /dev/flash/spiN name, without updating the manpage. Reported by: David Gilbert Fixes: 68dd77957786 ("Give the mx25l device sole ownership of the name /dev/flash/spi* ...") MFC after: 1 week (cherry picked from commit 703768a23590d8faf65b0f16dd395248ff7273f6) --- share/man/man4/mx25l.4 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/share/man/man4/mx25l.4 b/share/man/man4/mx25l.4 index ff2e78a8c5aa..5dffdebcf43e 100644 --- a/share/man/man4/mx25l.4 +++ b/share/man/man4/mx25l.4 @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 26, 2019 +.Dd June 11, 2024 .Dt MX25L 4 .Os .Sh NAME @@ -60,7 +60,7 @@ such as block size, sector size, and device capacity. When a supported device is found, the .Nm driver creates a disk device and makes it accessible at -.Pa /dev/flash/mx25l? . +.Pa /dev/flash/spi? . The new disk device is then tasted by the available .Xr geom 4 modules as with any disk device. @@ -189,13 +189,9 @@ Set the high bit (1 << 31) to invert the logic level of the chip select line. The SPI mode (0-3) to use when communicating with this device. .El .Sh FILES -.Bl -tag -width /dev/flash/mx25l? -.It Pa /dev/flash/mx25l? -Provides read/write access to the storage device. +.Bl -tag -width /dev/flash/spi? .It Pa /dev/flash/spi? -An alias for the -.Pa /dev/mx25l? -device, for backwards compatibility with older versions of the driver. +Provides read/write access to the storage device. .El .Sh SEE ALSO .Xr fdt 4 , From nobody Sat Sep 7 01:48:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwR4vJTz5WSP7; Sat, 07 Sep 2024 01:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwR3R80z4kS8; Sat, 7 Sep 2024 01:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TiOyh+tGmTuGW3T2l0F7F3bIzwEiazCB6sdKkDZiTd8=; b=PVYgWkYdeU5YSux2y61j6xyxOi2V/fCNvm056CHpr94AsHhJr8g5hwM9gZHVJrvNAUrtNB 0hf7zxjgHRLYX5wW4IcYLGBShIuGtkm1cvSOfCdDJdr0r2LslzZS8T5S0yhfkDqEGGHf03 oI5QincQW6WvxFdzDX71BrkBU2Kd5WrEBrfHPAUgmpvYAEn1IGoaCwjdrcTf5d3k1TrRfF vX9J9Z6BcvtuMXkTefjCr9eiPv2UZIEv1HXtycoqDDjTe08G0moBIt/4iGY64KVISp6Xrn ZpG5ZMr3QW78vRyz+znWC+CthcIk86Y+CKZdEmFjQHoncqYCe+pNLhLenKyoMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673687; a=rsa-sha256; cv=none; b=bgxIkNbhnAH/IxgllpjwW2BnsOY4wExhmM02eFk/qTiGKaQ0JsF1KchRjHwZ50NbrN0sLr N/6kMhNXxsHmnKDXO5mEIw6sbIWX9IEPw9JqYf57GCxqbO3fjgRWbZ0u1UOUkuBTJJ6jbO ClTIqsw/tdvN7YhcZyGt7IyKnwYlcrTtKflyGqP1I9fmTl0WAPZStu0/zbQuqAEzRZ94wJ 7CW+IuFA3jSKTnD+kkNQ66ukleI1tPOnLYZ3OWo0uLhLcC4igueHAbJheTNkv5XhyejP61 tvwsD+AWJemBHAf3rYYij4UVOX7on3HN15C1WzWy5j/ZRsW4OJuVHMBEg9wMkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TiOyh+tGmTuGW3T2l0F7F3bIzwEiazCB6sdKkDZiTd8=; b=RNDfY1/wgGdU379JWvZUmYhLUe9bm/6W/mdIU/ncLQ7niglM05f0UfRcecLcORccYMhYNg 8Od3JFcUMdrw5OxSCBn/X3LsBXNhj2Oa5t/6vuSKwZaQQumYJ5nHh2BVi9dK6uD9UXPhb9 Vutt0WGh6j8UXcweloW25ebVk+UC3LolOY26h+QbgWNagqKZWmBm78ln+16wsgnaTGYGGB QJRFt/yVH1U0Zg8S27BreovohRCnrs6mhBqVucqt3RZtm9/hIRCoVgI1VVwLNzAUxLTYnb g8m8Cv8175ME8bEUGf2TGEIyVfkjyKDdsTvJdDI+b6y7oA5M4GOHkBEvs0qRGA== 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 4X0wwR33XczFfV; Sat, 7 Sep 2024 01:48: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 4871m7hZ042071; Sat, 7 Sep 2024 01:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m7cL042068; Sat, 7 Sep 2024 01:48:07 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:07 GMT Message-Id: <202409070148.4871m7cL042068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 0abe896f1921 - stable/14 - beinstall: Pass -B to etcupdate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0abe896f1921979d801daeebf1ae829678d3dd12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=0abe896f1921979d801daeebf1ae829678d3dd12 commit 0abe896f1921979d801daeebf1ae829678d3dd12 Author: Jessica Clarke AuthorDate: 2024-08-28 22:36:56 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:03:14 +0000 beinstall: Pass -B to etcupdate Since commit 246364454fc1 ("etcupdate: Use new buildetc and installetc targets when available"), beinstall has been much slower for the etcupdate step, as it's been doing a kernel-toolchain (admittedly without LLVM itself being built). Given beinstall requires an object tree to already have been built and just installs it, we can pass -B to beinstall to reuse that tree rather than build kernel-toolchain in another one. Reported by: olivier Tested by: olivier MFC after: 1 week (cherry picked from commit 18aef07cfac41fde763e1328366cc6e334bb9254) --- tools/build/beinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/beinstall.sh b/tools/build/beinstall.sh index 766a3a03739f..988414744d13 100755 --- a/tools/build/beinstall.sh +++ b/tools/build/beinstall.sh @@ -49,7 +49,7 @@ NO_PKG_UPGRADE="${NO_PKG_UPGRADE:-""}" # empty string to skip. CONFIG_UPDATER="${CONFIG_UPDATER:-"etcupdate"}" # Flags for etcupdate if used. -ETCUPDATE_FLAGS="${ETCUPDATE_FLAGS:-"-F"}" +ETCUPDATE_FLAGS="${ETCUPDATE_FLAGS:-"-BF"}" # Flags for mergemaster if used. MERGEMASTER_FLAGS="${MERGEMASTER_FLAGS:-"-iFU"}" From nobody Sat Sep 7 01:48:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwS67HXz5WSLn; Sat, 07 Sep 2024 01:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwS4dcZz4kQ6; Sat, 7 Sep 2024 01:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BeTREvhFrFnubpop+5O3isGzvWu4pwu2wohdV3i/AMc=; b=Ozldmxux4ESgztDDm5zD76QpNqEpG1/ALEnAgLScTSu9ZgtOXncq8QqSGkZ2dqYKffIblw FiHuuX8a6H9y1yXukDDOuCEgSGwM/iRbzQtusKeSBrmbqYlBbkUlC3MCAF/7OApHEqRwAJ 5VJ7CdjM3bZxXTUHbep8I4SRgKhkj+t/SqsQETbk8chsvvJxpIdkEb7dAxPOs9aTnbFgr6 MPR5KWQoAneSgf6etC6dJbhzNQI93evE8cJoErRWrRXYeLE7RECpFdY5BUIGTLLvdcekLq +el7KCElI4IJTgd6niYONVSHClieemwGk6ljOnoERDeWBAVbpRluNIyM3hEBzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673688; a=rsa-sha256; cv=none; b=CinKPcVnbGE8V/A7Ta3XqkByZIwxqfdQDS/6sFYeDVBjT7mEjCCOUVODwcNfDG+l4rOGY+ pXvfSeXQsynzGQakjEVt17cL+Ct4wZ3ZZAuHwqbhVdHBr8PXji4by15Ac/RyrmuioqOti3 7+boU9xDoDSLEE3k9V1F+Yt+kp/i4dMFPlEedxBOOsVWgmi4qLhQ314r2kTH7Xp/7efgB9 FDtwwb3wIC/6VQ6WGAEoKUAeUIXvxznxV+6AzM2nECQu+7z7xLoWl3Ppg639SZ5K6R0is9 vIWhcfdHV2RPmKIPu4q/8L+ZRdetjHEGY+CFACNDmQM1ZwP20/lmuGBOPyqD3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BeTREvhFrFnubpop+5O3isGzvWu4pwu2wohdV3i/AMc=; b=MCz4H/CXXM1c/RQpEDHH5DBZBcIwJPSBpz7N/L4HGwfdzn+AhYPecCcZj3GLLScAbqrkEC /ko31hohv/3gvQ5inqB7Fkuoafl5xEQGlGUjhlADOqT1O9VqytwpvQNtFm1nlVjnZcpfMQ 2pEWcavfpmokj+hIPsFmkFbGdHt3sHC4Gp4AFlaBCa6fAwIWBWup1OuEEQzQDwuznz6O49 bYwbQk3ElkZ/8cBoYmtbQVPfa8Uqy/VoxrBnIoXNixTWvA0lnYNx21IGyFfw0LPPDwpS3T I+XhShSp4TagPkCgdRYfuhU5RNvU2yt58PKdoShVvBNz5JuDndBTLbFwbXhIWw== 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 4X0wwS48KGzG34; Sat, 7 Sep 2024 01:48: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 4871m888042111; Sat, 7 Sep 2024 01:48:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m8gf042108; Sat, 7 Sep 2024 01:48:08 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:08 GMT Message-Id: <202409070148.4871m8gf042108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 11d7aa07eb31 - stable/14 - rc.d/devmatch: Silence sysctl hw.bus.devctl_nomatch_enabled=1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 11d7aa07eb31d94cd72044f5108b2335d46db44e Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=11d7aa07eb31d94cd72044f5108b2335d46db44e commit 11d7aa07eb31d94cd72044f5108b2335d46db44e Author: Jessica Clarke AuthorDate: 2024-08-28 23:26:26 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:03:16 +0000 rc.d/devmatch: Silence sysctl hw.bus.devctl_nomatch_enabled=1 As with various other rc scripts, we don't want the output from this being visible in the boot log. Fixes: 6437872c1d66 ("New sysctl to disable NOMATCH until devmatch runs") MFC after: 1 week (cherry picked from commit 62775aebf725a79703592f3276118245a74afdac) --- libexec/rc/rc.d/devmatch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch index 67bb14761614..37c4772cfcb7 100755 --- a/libexec/rc/rc.d/devmatch +++ b/libexec/rc/rc.d/devmatch @@ -46,7 +46,7 @@ devmatch_start() if [ -n "$one_nomatch" ]; then list=$(devmatch -p "${one_nomatch}" | sort -u) else - sysctl hw.bus.devctl_nomatch_enabled=1 + sysctl hw.bus.devctl_nomatch_enabled=1 > /dev/null list=$(devmatch | sort -u) fi From nobody Sat Sep 7 01:48:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwV0N4Nz5WSdX; Sat, 07 Sep 2024 01:48: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 4X0wwT5MWkz4kQG; Sat, 7 Sep 2024 01:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84yx0tdrz3HY4GHGnXxjwhUmGd3KDBl3I1Z7t/NjYmg=; b=mDVqssxu4O4pRgUO/hJ0Xq0urmUwJ8TUWMUoNtO3du3eKHxMA4BpK+z+JeluX+yFic5Oqv +jxQSdSfHExT9+ZilmDEn5yv2d00v8S8qM0yhzs/cBHrXqDLcKDR6tRqnBZgNXVTiG4kJS MCto/N/5Tf9bkTRBaJHRI5fgwGmP4AAgZT1GWHds9accLapxm7YJ0zjsZx3dFqQicqbORi 1QLKvyNXrMW18Rgm9gchO1H3UbpKojbn/joNk2HzQvjH4eC2lKfWb/KanGjs73bZ26II1k h6SYIrtROb3TB5mxkTgmvDUxXxo/u94h9paRhyNFuxwtzWvVBACwXgAp/djEEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673689; a=rsa-sha256; cv=none; b=hc791+R6kZ4qCrQIpP/tycFs7ziueKECcjbaobloxOyVraJQKlzYPEHA7O+3l5AogdBF4D 59TSCJaNhFRRTJZw+YhlBT9NiRd9bgw9jlVcVXgGkwXHtGOf4T59cwQGcpq8j7LtZi9rqx dc+EOAPnAaI7agIyXz+zaSmmQypVhlX93PcmONuiADLsjnSTPKQ2Kcm6DnED3PHCTzDb9X Ci7VcsRN2vtVQ96+yPKgzmFDZMCJo826vJOPHteDe6ggZmkOhsVes0aGM7AowG6Uq5Y/yZ HIiI2nEquzXEXPgBHQiXocL+XJKr7t34rr0Vk42sTUi3Kuzyesu0K/El/5Mo7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84yx0tdrz3HY4GHGnXxjwhUmGd3KDBl3I1Z7t/NjYmg=; b=G6zM9ccOBak4x1wZVS6ybWUdAAJacNDPsglOvVselRgcTfcwdEy1MyRroLThxMVuM9cd9q rD+kmv0j+OvhyMZ50CmkhXYjexRv8OpiYOY9KuTfrupA1iZUoSDD7iYfSP67JyOmtN6DP3 3Kkxwbj35XAxINIiw16ShviBwohZLVdhrflqWmIm2FX4IkvL6MavvJZaWupvSktlaOV8LJ e0tajk4Qg6t0t/yUEfqbPXq00wnamys/36TApUcixwjhQW6nSQXb3WqMaUx5E45xFk1nRz HtBCg5JraZqFb6tHjH+ykRKg3BYgR6vbgwPb1pkaxetIr3o3vmwTTX3ETpmBsg== 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 4X0wwT4z6dzGGT; Sat, 7 Sep 2024 01:48: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 4871m9od042165; Sat, 7 Sep 2024 01:48:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871m963042162; Sat, 7 Sep 2024 01:48:09 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:09 GMT Message-Id: <202409070148.4871m963042162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 8161eb6182a8 - stable/14 - tools/build/make.py: Add missing comma to fix tinderbox and worlds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8161eb6182a8d999e5b2ad2dde9310f8cb09c26e Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8161eb6182a8d999e5b2ad2dde9310f8cb09c26e commit 8161eb6182a8d999e5b2ad2dde9310f8cb09c26e Author: Jessica Clarke AuthorDate: 2024-01-20 22:07:48 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:20:36 +0000 tools/build/make.py: Add missing comma to fix tinderbox and worlds The missing comma meant this was interpreted as a single target called "tinderboxworlds", and so neither tinderbox nor worlds were recognised as being MI targets (i.e. still required TARGET(_ARCH) to be given). Fixes: 5157b451c654 ("tools/build/make.py: Grow the list of MI targets") (cherry picked from commit edec803c5b72681b39ce969cc16d634e08bb3ac2) --- tools/build/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/make.py b/tools/build/make.py index 5ac99ddb2ee5..a602cc22072c 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -55,7 +55,7 @@ mach_indep_targets = [ "cleanuniverse", "universe", "universe-toolchain", - "tinderbox" + "tinderbox", "worlds", "kernels", "kernel-toolchains", From nobody Sat Sep 7 01:48:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwW1ZxSz5WSLs; Sat, 07 Sep 2024 01:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0wwV6KNGz4kSl; Sat, 7 Sep 2024 01:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wpfu7XygRxTF9Iz9MZmdC/VnDVWOpwe6CEBzeMHAOY0=; b=qNpPgJaoZ2VqmEhyoBs1+4QF92eEHPJdZE9W62y+r2uGNz01pZkrRrxxXB7flkI9wBa6a0 sLhgBdrp1P/ZK9FPMJLq/mqI65+FeNS6Fgb1h5A6s2geQLyFMNxypE5TG2EbiNKXgpYlAh 3akI0fB/GCJwZkRgULRjO3/i+fCSJ+qv4ZgaVSf/CZhciK9wv+f17VtWzKOI2SCzl8wbFM ivxiTf0TrOIbmpC08nhSGZi7SuE7lZagUspm4pQksIu0JaRybguGHt49/vWV1BJYCENT6Y CqvnmmIu7NE66o4/w3qrStgtYVor+M/0xZdZ0J6Zy5WADIdG9RCqGaUHlTj2BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673690; a=rsa-sha256; cv=none; b=KGrL021fZMn2qxVz4Mm9mRsqBxUVv7jz5EsEWDNhhWlJGoWsZRgw9/Xpn0J6e0wH62grga EZPHJTxac10FHfDIQNJacOIB/AZYAkTBch/xoQT9si5UzRzhhHRcwRtuYueUMQrsIwhKjv lRlIdMziP0wB13onRw0Voc2hN8zcSd5NYdhfIyu8FlUiDuDLfDhp3kQ7fUj3PfvNb1h1F+ KJYiySlih24zYIZZv+XI4Yw82cgKRKUucZweM70yJYLuQfTGsj2NH4YyEAZVold3/V5sLr U7xv7q2MJphxGhHh/460paf2ybw5jKcD5FEboyVDWlBJxLnDHE0/rNJEFFk6WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wpfu7XygRxTF9Iz9MZmdC/VnDVWOpwe6CEBzeMHAOY0=; b=xYjhPu0ZzVW6Ga8fJdL9azQgrlpIJwmrnEeHtBURUW9BbXFg1FCxiDAbpkaMVZHeJQ8Rqj FWlvoadNGDdSRQb5u1K9Bq387Gnci4X37gbLUDnUeTA4/APzv5mx2PetbaC2bL/CcnmhTq aG1hoKxbZXXGcnzhSFeSgVRl2JANgG92t0OyCZU8gSCtKzZwg7sdSQWCvzilFPpBse1ms3 5o2X5OKO1gEdWnRwLkZYAb5npDo/U8OfbYlq4aBPwCJso79PzsQvfIJwpuxPj4JrvpIcGk ChSWNs0CFkKK5XKy2GVaHofF4JQn3q5+3y53bKp6+Eji3F3baciv2NhNAclroQ== 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 4X0wwV5cjfzGDN; Sat, 7 Sep 2024 01:48: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 4871mAgn042210; Sat, 7 Sep 2024 01:48:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871mA0C042207; Sat, 7 Sep 2024 01:48:10 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:10 GMT Message-Id: <202409070148.4871mA0C042207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: c3d7b96df0ac - stable/14 - tools/build/make.py: Avoid Python 3.7+ subprocess.run capture_output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3d7b96df0acd640a538c493ec03d5452fac216f Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c3d7b96df0acd640a538c493ec03d5452fac216f commit c3d7b96df0acd640a538c493ec03d5452fac216f Author: Jessica Clarke AuthorDate: 2024-01-31 19:45:59 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:20:39 +0000 tools/build/make.py: Avoid Python 3.7+ subprocess.run capture_output This is just a convenient alias for setting stdout and stderr to PIPE, so substitute it for that to be compatible with Python 3.6. Fixes: 69cfdc81ea7b ("tools/build/make.py: Keep bootstrapped bmake binary up-to-date") (cherry picked from commit b771d5705fc95445d4d81e054be664b7842156ff) --- tools/build/make.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/build/make.py b/tools/build/make.py index a602cc22072c..ec42cb70dd21 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -81,8 +81,8 @@ def bootstrap_bmake(source_root, objdir_prefix): bmake_config = bmake_install_dir / ".make-py-config" bmake_source_version = subprocess.run([ - "sh", "-c", ". \"$0\"/VERSION; echo $_MAKE_VERSION", - bmake_source_dir], capture_output=True).stdout.strip() + "sh", "-c", ". \"$0\"/VERSION; echo $_MAKE_VERSION", bmake_source_dir], + stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.strip() try: bmake_source_version = int(bmake_source_version) except ValueError: @@ -92,7 +92,7 @@ def bootstrap_bmake(source_root, objdir_prefix): if bmake_binary.exists(): bmake_installed_version = subprocess.run([ bmake_binary, "-r", "-f", "/dev/null", "-V", "MAKE_VERSION"], - capture_output=True).stdout.strip() + stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.strip() try: bmake_installed_version = int(bmake_installed_version.strip()) except ValueError: @@ -187,8 +187,9 @@ def default_cross_toolchain(): # default to homebrew-installed clang on MacOS if available if sys.platform.startswith("darwin"): if shutil.which("brew"): - llvm_dir = subprocess.run(["brew", "--prefix", "llvm"], - capture_output=True).stdout.strip() + llvm_dir = subprocess.run([ + "brew", "--prefix", "llvm"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.strip() debug("Inferred LLVM dir as", llvm_dir) try: if llvm_dir and Path(llvm_dir.decode("utf-8"), "bin").exists(): From nobody Sat Sep 7 01:48:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwX33ypz5WSPF; Sat, 07 Sep 2024 01:48: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 4X0wwX0PyDz4kbP; Sat, 7 Sep 2024 01:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MNVBiGCFCJzi0sBvf+1iE8GkTw/zCAKgIzd8hX/da1U=; b=BG6xBMQt5/+HjcXfyUUDSISgXHzG8v/vzm4OB+FvPk6/1b/YWwefGlG+xXvcz+V8/EDRdV N4FoOJtEgqzE2bAMJOPoMdGZGGCfWGUpSYYzJIstcxLVcCnPFSPxwv6n+gD6YD82OZ72CU IC/9aB/hEDi5+zGpvNex83y4ihFTx3RJQF6bnMBYOTBDtuXAvjflUR9VX/b5pa+pH8DMZh cO25/gpaxnkMgnlNulhB1it7zxm/e0ArHb8/FJIFd4htoI7Bqd7vY+R1RL6/h2TL6zBB3K O9PMi3cPXoj5LfEPj3aSWcPvGB6CfeKfYs/hfex2D1Y/aHbwhS8LnSAEFkowZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673692; a=rsa-sha256; cv=none; b=Rw7EgVLQZY1vo/zFq0kavYew8RtaTLBuVXzhATY1DQgMhDRJ82VlX4N4p/FARJr8VLarA5 0wWlqeMeT8FiY00HXPnbG3x6zOEmbRr4yvuT3q9jpHA1gf8TZ20D7Ddz1inAvYEUPx7h/y A0DPz/tfPCQZebeTl32JWC8Pa8yDFwp3DcCoO0kdsk/93uRS7G+/ez7Uhik9memqL/Q02b IallErWYlnJeNalf1teYn0x/WAc/6OUaHr3YWXv3NhMvtA7/54PHf7kfDPE8bZu5hs02jj C4OGQwukFulXDFiGNeb14YNcWvGlCa14yM/yI6CcZQU4/R2mcsqdNNxay4CJKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MNVBiGCFCJzi0sBvf+1iE8GkTw/zCAKgIzd8hX/da1U=; b=hrkNNdvD/5EJ2T0Dy8RB3OPmjZouU3ZiIZfjiuT4ZLjLO+TFC8cqFEIZEWxYLXq1Qr0s4q ic8QJ0nL2v7qcyGvUQpvYivo6Y5upFPlRKLgioFJUOdeNiX8cckfji8Mtdkp4BhmcLX5bG P9bWR6xnFlZOGI2rDFoIayMi3Obw4r9DiZ+8pEPo7WWzyNP5uY8kBOburxY3uOdK4b0MGa qzEI5gdSWUWgYs2Yl5ybzX2ND9BZZzZPYRfHUHhEIMJT/NZY92BXNw6Xe0f1H20mbt3sbB qVkr8ksaPuFctdcrspk951F9Os2qKKOY85kNsKLw9U2sPw4cPMYMA43w6TIh1A== 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 4X0wwW6mjzzGPh; Sat, 7 Sep 2024 01:48:11 +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 4871mBNc042258; Sat, 7 Sep 2024 01:48:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871mBiT042255; Sat, 7 Sep 2024 01:48:11 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:11 GMT Message-Id: <202409070148.4871mBiT042255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 4acf9ba16de3 - stable/14 - netinet: fix LINT-NOINET build failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4acf9ba16de3ed0e1157539fbb59b138a49ee77d Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4acf9ba16de3ed0e1157539fbb59b138a49ee77d commit 4acf9ba16de3ed0e1157539fbb59b138a49ee77d Author: Kristof Provost AuthorDate: 2024-08-26 20:02:25 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 00:52:31 +0000 netinet: fix LINT-NOINET build failure Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3b62f3350017ab6722ebe8e4fccd9ba76acbb214) --- sys/netinet/in_pcb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 897a3ef991d5..28cd64ccbde6 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -236,11 +236,13 @@ in_pcbhashseed_init(void) VNET_SYSINIT(in_pcbhashseed_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, in_pcbhashseed_init, 0); +#ifdef INET VNET_DEFINE_STATIC(int, connect_inaddr_wild) = 1; #define V_connect_inaddr_wild VNET(connect_inaddr_wild) SYSCTL_INT(_net_inet_ip, OID_AUTO, connect_inaddr_wild, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_inaddr_wild), 0, "Allow connecting to INADDR_ANY or INADDR_BROADCAST for connect(2)"); +#endif static void in_pcbremhash(struct inpcb *); From nobody Sat Sep 7 01:48:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0wwY2rcmz5WSTh; Sat, 07 Sep 2024 01: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 4X0wwY1MSsz4kNW; Sat, 7 Sep 2024 01: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=1725673693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqelDlpvxqVeN/k14Czmwh7+8im5a8EPo0j3eN8R1kQ=; b=Ljiv7wjotO+JedP7AAuEWH1exh2Vtevwpxb7YKL/k8biDVAvfZSU2pTBkwkZAog81s+z8b fDlZqGW5uhWYFpsaQpklCqu2qToIYT4+mLk/uk7PDoDmOgVxevOY6iH144bdpdmMKxxsZE nXGdiqfSJuGJSORO+mpRHMXUJKvhBcJgqAnU2uuhAQoAypVdzq2of/AoESPxu7WqoSAWER npQnm/QvsOHQ8Fh7i7UMgNOORKeZT6183dUJ2lVgP9KcDLEv2BSE4tBnGsdsw+a/TC5KWy ZktuPRsxD5RZfq/pByLvVRUMh4wWmbecb/e3+7QD5nSEXOD2HbakAjmhnOyOoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673693; a=rsa-sha256; cv=none; b=Ke/hraYrW5PCpfbZirUVeHbjCIU0ZCI38vgxqp0AilIkxwQONLq8SUnB/E11V2tc/B+2hF 8aeu+Cfa83vyFTia3X+ABP9O9gW7xJ8iIeVu+NRAyO0idyhxXoTA3BtMgDGoCWoSTfGaIu OrqQTL/OTjK0AoW4nx0I19MEDL7yIEOKIsGJVlOVsV89KFun/teHk/oCj7NbDuGW/L/GRm Gk1eBlyJbacn/8AjJMQz0z4Q5OsIlWDfoKgiSySZIjicwhdMa0LiP+B01jGDG0nGyhGhHG BOHEKzCSv8MFLP8OHtmHR52wPktw1W8degJBqCKs6L/KMX3ugK0kJ88mJdRQSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqelDlpvxqVeN/k14Czmwh7+8im5a8EPo0j3eN8R1kQ=; b=xeYiYJn9PXe5+MVL4WhuDCxKbXM8dn+sj07g27PgkRkIWkHujWmWs0eUZlfrwpydF8wj96 sNEwphg4/cw3YFmJ+ZNEZhRw4EVxrYaOkUVHS64EWT6X+FktqYsyeIaKugITpkeHhJzUTL JEGD6KFQtyDlRFMFQ2O7EkyYzCYzwEARlzMx59V2YyBaUhtj3SaN9TS4wTK2GMLqRPhbHw fDIitvL9pXlqld8BwvkZTWQRIz1ID6te8a9/dPI4JSMlxSFML63OVaK/XCNg8SD9x/mLcZ fwh9dmf48gKmMX6+1Fqr6T8DmbhRaEgwe/mHa3X2Kdu5UiG1tGRNHgrhf8TmXg== 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 4X0wwY0kkLzGJj; Sat, 7 Sep 2024 01: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 4871mCtT042321; Sat, 7 Sep 2024 01:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871mChf042318; Sat, 7 Sep 2024 01:48:12 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:48:12 GMT Message-Id: <202409070148.4871mChf042318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 9ae4c66bff69 - stable/14 - fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9ae4c66bff6927dc6fcc855f1aa539a2115b21bd Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9ae4c66bff6927dc6fcc855f1aa539a2115b21bd commit 9ae4c66bff6927dc6fcc855f1aa539a2115b21bd Author: Jessica Clarke AuthorDate: 2024-06-02 20:42:18 +0000 Commit: Jessica Clarke CommitDate: 2024-09-07 01:47:00 +0000 fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence DELAY takes microseconds not milliseconds, so 100 was too low. Moreover, when enabling hw.pci.clear_pcib, PCI emeration would still stop at one of the first bridges, but by asserting PERST for the rest of the reset sequence that appears to be reliably addressed. Fixes: 896e217a0eae ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver") (cherry picked from commit 28aaa58fa64ecb89d47f0a8396954ad8ca82d8ef) --- sys/riscv/sifive/fu740_pci_dw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/riscv/sifive/fu740_pci_dw.c b/sys/riscv/sifive/fu740_pci_dw.c index fe741f4bb6e6..eff23a294985 100644 --- a/sys/riscv/sifive/fu740_pci_dw.c +++ b/sys/riscv/sifive/fu740_pci_dw.c @@ -216,12 +216,6 @@ fupci_phy_init(struct fupci_softc *sc) return (error); } - /* Hold PERST for 100ms as per the PCIe spec */ - DELAY(100); - - /* Deassert PERST_N */ - FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); - /* Deassert core power-on reset (active low) */ error = gpio_pin_set_active(sc->porst_pin, true); if (error != 0) { @@ -281,6 +275,12 @@ fupci_phy_init(struct fupci_softc *sc) /* Put the controller in Root Complex mode */ FUDW_MGMT_WRITE(sc, FUDW_MGMT_DEVICE_TYPE, FUDW_MGMT_DEVICE_TYPE_RC); + /* Hold PERST for 100ms as per the PCIe spec */ + DELAY(100000); + + /* Deassert PERST_N */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); + return (0); } From nobody Sat Sep 7 02:18:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0xb60wY2z5WW8L; Sat, 07 Sep 2024 02:18: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 4X0xb60MR0z4rfx; Sat, 7 Sep 2024 02:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725675490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMbaUpBtGj1vVhAwTL6Al6g9yLAbsTdW26RDO5W5dXk=; b=iBR8iZImNIQ4Zj5mE5I0xF2pwdbOps7GWKOSWMtgijaVvP7Jtj2EfG0QtcWw6RVNLlS+bL J91brFzJgFkTmGd9SssMKiji9cZi4Gmxrr2LI+01EQBysRfKZ2n9y8+8gBPTu9Zc0+qwEQ XxfOumnVMJi5f7KUk2rVUZCuDcAe/q1SCqskfQPkmc8t9PJTWg5Jli84dPk7bcc1VGpTGw MOKRgAhjKiqKE9jdXYSBgCnbXXSMFQwBW+6b4CjS87SVh4GE/FLUe5qHy0mZW22/6S+sJD 0qtDvsB6S70L4pwPVzfxxpohZGmF7c0xUW8MgJfoAXMYuA24pEbBrA4p1aXuaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725675490; a=rsa-sha256; cv=none; b=vTLlhojPuQEKHuRxaARtfzydoa1c9GENwoZMGKNlEuO5+b7pK6cGFKvdP2QudaCr0z//qB zrQdUqDyxl2/APzXz41X53zmSmjND/hb0WhaTezj605Xp0egfqnsMpbjqFsXYE14Ja/Y5u cT2o43MTJMWHFnWBCpolYmQBsFxZhkXVHgikdbAacemn5wgSJAzcEl2oiNq1yyIoDeQRcp SMMN33FV5qg4ht2WmsCn1+0VhQmFPF62gXBiyEF9SaRq9o53sdlWAY1N3nJ0CakAxIKMib cXzZjCFrxTheoy7j8e7scJVxuWz9IrZQcGvZoxwlExhF5zJvjyy9rRORebYUGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725675490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMbaUpBtGj1vVhAwTL6Al6g9yLAbsTdW26RDO5W5dXk=; b=MYlbMYH0DnQYsD3gr4M2DWKmlmwyOwpzM7+PZcvHW1tBRlN4Keq6BtbOLdaGSMhGnIppse T7to2r0b1MLgwhKFRejV1S8nOeZLmXG9+qGB+im992boCml0gsF9FLQa4WU7cDaLhoKBm5 1fyKfa5UClkcbf7GZFXcds1EkPMjyxj6iyLyFDlqbZcJH+4e98MpA3wQ4pTRdDJ8zNLUnZ gsYQVGfQpk+tpQQ9xTS2dbQeN8ebAdar3E8Rr7MVjR6UmK6dDPd3f+04h4VEyuh8nOAfn2 hpZdhm5q0NVZ/3iYXrIa2gL7UENWQaqKfDMAk3FThGKxElalG8ou/QaEdxoxjw== 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 4X0xb5725gzGkJ; Sat, 7 Sep 2024 02:18: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 4872I9B1093829; Sat, 7 Sep 2024 02:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4872I9nh093826; Sat, 7 Sep 2024 02:18:09 GMT (envelope-from git) Date: Sat, 7 Sep 2024 02:18:09 GMT Message-Id: <202409070218.4872I9nh093826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 7a6309fdc794 - main - fetch(1): suppress "Not Modified" in quiet mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a6309fdc79427b0a7a5c3876daba150d946ae22 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=7a6309fdc79427b0a7a5c3876daba150d946ae22 commit 7a6309fdc79427b0a7a5c3876daba150d946ae22 Author: Eugene Grosbein AuthorDate: 2024-09-07 02:14:23 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-07 02:14:23 +0000 fetch(1): suppress "Not Modified" in quiet mode "fetch -qi" should skip printing "Not Modified" for successful http(s) request. Still print it by default (v_level == 1). MFC after: 1 week --- usr.bin/fetch/fetch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 05c0211ead49..8b3ccbd3ab98 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -582,16 +582,17 @@ again: if (sigalrm || sigint) goto signal; if (f == NULL) { - warnx("%s: %s", URL, fetchLastErrString); - if (i_flag && (strcmp(url->scheme, SCHEME_HTTP) == 0 || - strcmp(url->scheme, SCHEME_HTTPS) == 0) && - fetchLastErrCode == FETCH_OK && + if (i_flag && *is_http && fetchLastErrCode == FETCH_OK && strcmp(fetchLastErrString, "Not Modified") == 0) { /* HTTP Not Modified Response, return OK. */ + if (v_level > 0) + warnx("%s: %s", URL, fetchLastErrString); r = 0; goto done; - } else + } else { + warnx("%s: %s", URL, fetchLastErrString); goto failure; + } } if (sigint) goto signal; From nobody Sat Sep 7 04:18:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X10FZ5zdbz5Whhr; Sat, 07 Sep 2024 04:18: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 4X10FZ5Q1Zz51tK; Sat, 7 Sep 2024 04:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725682690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFJn3X2bTIfYw8t3V3u3atQ25EuudAmDTMfe9Q2lLRI=; b=eysJx78gRzI2CzUzSYhkbX+NS5sJlNeuURq/Wcv9e/b0cysYYIeR8f5tbYpd08qbtO505L pEzphO/LvdNEkoDWiuSWBrTpWfoNHPiiC1Cf89kuaLnHgCiSQlebw+mEC8MzWZAYqxtMRM 7dQAFjqwKE7yUmAn1TxBtcrcyRWzDHbu8IKOF4/lhSa4/jclvU06mfAAEv/ERLzAgO5Wkf 2yJq7YRGSsk0MlwPvpKFq9WSsj7+lokAR8AgDEvCHwha/5SBD1VRfcgJ+AjNP46yh4k540 ctUA+b+q9Q2KdI2mLU8/e77OPB5NS2k04/2/cCSsCQwPTMOAqqibMpSXjrMRGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725682690; a=rsa-sha256; cv=none; b=BQzN1ANzuzX8Qqq3oetsK2tjWuzedM3doS7k/OCx3PbBYxRcunJ0slNndwy4YzpJwwZJV1 uvYtAYKvt2yZxvkMl1fyTBy6H3lXcycHdwUThDEDeWpYGsNc6oZ59NKPGYdJNPvXfN2TLS lakSHNijswpNfKAgdJQabGt++BN72s/K5eT+Hk9kDO9ITelo1k8/3kVQe7tG3I7qqk9H82 VqU8Epjq8S5V1ccSWUajU6tkKMn4AhN97xUjKmU56H6V5iplv+g8AXyDQAk54I/yDH0wrU L+GiWpMGxdVvMYwjpuEoB4aC+XHh99ChwTlF0g8SIO5hfZB6hGhShAQ4d/8knA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725682690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFJn3X2bTIfYw8t3V3u3atQ25EuudAmDTMfe9Q2lLRI=; b=iM+huMva3AQJvSfe6NmwBQYetyLUYJzJC12OA7s1ktXS3Opy5Gah41bjsWkwmfN2Zx5trE 8Q68ejFNe3fMFUfQ6es49ze3hTVZnX29TZ8bmjF89VR/UsO5eey4MDSYS9ca6AS6vwqyaD fu200/S5pFOT4Pv9YxwGYw60tz5K7sBMwjCdHVDPwBYMEPTe3wCMx8iXPIwGyaMgoJKftp Cb4iIPHy8YtQZEOLvPZtle4vb9eSgEzRga5jHiMilC6zAHeAITYZlR7z3A58AQYJFDec/S fm+jNanGmoFTxVjKL8Xwg8wHvQU3Q1Wy9jXQN0z2dz4h90pZ8IlLVyTM98nbZQ== 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 4X10FZ51dzzK8P; Sat, 7 Sep 2024 04:18: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 4874IArT098930; Sat, 7 Sep 2024 04:18:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4874IAiW098926; Sat, 7 Sep 2024 04:18:10 GMT (envelope-from git) Date: Sat, 7 Sep 2024 04:18:10 GMT Message-Id: <202409070418.4874IAiW098926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 3d8501d90e24 - stable/14 - openssl: Remove fips module from base system. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d8501d90e246602a6343a760f6ac8d9e2730306 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3d8501d90e246602a6343a760f6ac8d9e2730306 commit 3d8501d90e246602a6343a760f6ac8d9e2730306 Author: Gordon Tetlow AuthorDate: 2024-08-04 21:10:46 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-07 04:17:19 +0000 openssl: Remove fips module from base system. To comply with FIPS 140 guidance, you must be using a specifically validated and approved version of the fips module. Currently, only OpenSSL 3.0.8 and 3.0.9 have been approved by NIST for FIPS 140 validation. As such, we need to stop shipping later versions of the module in the base system. Differential Revision: https://reviews.freebsd.org/D46223 (cherry picked from commit 86dd740dd73aa88477ff450b2359abda1ad68534) --- ObsoleteFiles.inc | 3 + secure/lib/libcrypto/modules/Makefile | 3 +- secure/lib/libcrypto/modules/fips/Makefile | 341 ----------------------------- 3 files changed, 4 insertions(+), 343 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f74ace221420..1a7441b80158 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240827: retire fips.so +OLD_LIBS+=usr/lib/ossl-modules/fips.so + # 20240824: sound examples: midi.c moved out of oss/ OLD_FILES+=share/examples/sound/oss/midi.c diff --git a/secure/lib/libcrypto/modules/Makefile b/secure/lib/libcrypto/modules/Makefile index 2f9e5b40fe3e..69a8470ff20b 100644 --- a/secure/lib/libcrypto/modules/Makefile +++ b/secure/lib/libcrypto/modules/Makefile @@ -1,5 +1,4 @@ - -SUBDIR= fips legacy +SUBDIR= legacy SUBDIR_PARALLEL= .include diff --git a/secure/lib/libcrypto/modules/fips/Makefile b/secure/lib/libcrypto/modules/fips/Makefile deleted file mode 100644 index 8843cb9717c9..000000000000 --- a/secure/lib/libcrypto/modules/fips/Makefile +++ /dev/null @@ -1,341 +0,0 @@ - -SHLIB_NAME?= fips.so - -CFLAGS+= -DFIPS_MODULE - -SRCS+= fips_entry.c fipsprov.c self_test.c self_test_kats.c - -.include "../../Makefile.common" - -# crypto -SRCS+= provider_core.c provider_predefined.c \ - core_fetch.c core_algorithm.c core_namemap.c self_test_core.c - -SRCS+= cpuid.c ctype.c -.if defined(ASM_aarch64) -SRCS+= arm64cpuid.S armcap.c -ACFLAGS.arm64cpuid.S= -march=armv8-a+crypto -.elif defined(ASM_amd64) -SRCS+= x86_64cpuid.S -.elif defined(ASM_arm) -SRCS+= armv4cpuid.S armcap.c -.elif defined(ASM_i386) -SRCS+= x86cpuid.S -.elif defined(ASM_powerpc) -SRCS+= ppccpuid.S ppccap.c -.elif defined(ASM_powerpc64) -SRCS+= ppccpuid.S ppccap.c -.elif defined(ASM_powerpc64le) -SRCS+= ppccpuid.S ppccap.c -.else -SRCS+= mem_clr.c -.endif - -# crypto/aes -SRCS+= aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c -.if defined(ASM_aarch64) -SRCS+= aes_cbc.c aes_core.c aesv8-armx.S vpaes-armv8.S -ACFLAGS.aesv8-armx.S= -march=armv8-a+crypto -.elif defined(ASM_amd64) -SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S -SRCS+= aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S -.elif defined(ASM_arm) -SRCS+= aes_cbc.c aes-armv4.S aesv8-armx.S bsaes-armv7.S -.elif defined(ASM_i386) -SRCS+= aes-586.S aesni-x86.S vpaes-x86.S -.elif defined(ASM_powerpc) -SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S -.elif defined(ASM_powerpc64) -SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S -.elif defined(ASM_powerpc64le) -SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S -.else -SRCS+= aes_cbc.c aes_core.c -.endif - -# crypto/bn -SRCS+= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \ - bn_mod.c bn_conv.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ - bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_sqr.c \ - bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ - bn_intern.c bn_dh.c bn_rsa_fips186_4.c bn_const.c -.if defined(ASM_aarch64) -SRCS+= armv8-mont.S bn_asm.c -.elif defined(ASM_amd64) -SRCS+= rsaz-avx2.S rsaz-avx512.S rsaz-x86_64.S rsaz_exp.c rsaz_exp_x2.c -SRCS+= x86_64-gcc.c x86_64-gf2m.S x86_64-mont.S x86_64-mont5.S -.elif defined(ASM_arm) -SRCS+= armv4-gf2m.S armv4-mont.S bn_asm.c -.elif defined(ASM_i386) -SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S -.elif defined(ASM_powerpc) -SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S -.elif defined(ASM_powerpc64) -SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S -.elif defined(ASM_powerpc64le) -SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S -.else -SRCS+= bn_asm.c -.endif - -# crypto/buffer -SRCS+= buffer.c - -# crypto/cmac -SRCS+= cmac.c - -# crypto/des -SRCS+= set_key.c ecb3_enc.c -.if defined(ASM_i386) -SRCS+= crypt586.S des-586.S -.else -SRCS+= des_enc.c fcrypt_b.c -.endif - -# crypto/dh -SRCS+= dh_lib.c dh_key.c dh_group_params.c dh_check.c dh_backend.c dh_gen.c \ - dh_kdf.c - -# crypto/dsa -SRCS+= dsa_sign.c dsa_vrf.c dsa_lib.c dsa_ossl.c dsa_check.c \ - dsa_key.c dsa_backend.c dsa_gen.c - -# crypto/ec -SRCS+= ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c \ - ec_curve.c ec_check.c ec_key.c ec_kmeth.c ecx_key.c ec_asn1.c \ - ec2_smpl.c \ - ecp_oct.c ec2_oct.c ec_oct.c ecdh_ossl.c \ - ecdsa_ossl.c ecdsa_sign.c ecdsa_vrf.c curve25519.c \ - curve448/f_generic.c curve448/scalar.c \ - curve448/curve448_tables.c curve448/eddsa.c curve448/curve448.c \ - ec_backend.c ecx_backend.c ecdh_kdf.c curve448/arch_64/f_impl64.c \ - curve448/arch_32/f_impl32.c -SRCS+= cryptlib.c params.c params_from_text.c bsearch.c ex_data.c o_str.c \ - threads_pthread.c threads_none.c initthread.c \ - context.c sparse_array.c asn1_dsa.c packet.c param_build.c \ - param_build_set.c der_writer.c threads_lib.c params_dup.c - -.include -.if ${MACHINE_ABI:Mlittle-endian} && ${MACHINE_ABI:Mlong64} -SRCS+= ecp_nistp224.c ecp_nistp256.c ecp_nistp521.c ecp_nistputil.c -.endif -.if defined(ASM_aarch64) -SRCS+= ecp_nistz256-armv8.S ecp_nistz256.c -.elif defined(ASM_amd64) -SRCS+= ecp_nistz256-x86_64.S ecp_nistz256.c x25519-x86_64.S -.elif defined(ASM_arm) -SRCS+= ecp_nistz256-armv4.S ecp_nistz256.c -.elif defined(ASM_i386) -SRCS+= ecp_nistz256-x86.S ecp_nistz256.c -.elif defined(ASM_powerpc64) -SRCS+= ecp_nistp521-ppc64.S ecp_nistz256-ppc64.S ecp_nistz256.c ecp_ppc.c x25519-ppc64.S -.elif defined(ASM_powerpc64le) -SRCS+= ecp_nistp521-ppc64.S ecp_nistz256-ppc64.S ecp_nistz256.c ecp_ppc.c x25519-ppc64.S -.endif - -# crypto/evp -SRCS+= digest.c evp_enc.c evp_lib.c evp_fetch.c evp_utils.c \ - mac_lib.c mac_meth.c keymgmt_meth.c keymgmt_lib.c kdf_lib.c kdf_meth.c \ - m_sigver.c pmeth_lib.c signature.c p_lib.c pmeth_gn.c exchange.c \ - evp_rand.c asymcipher.c kem.c dh_support.c ec_support.c pmeth_check.c - -# crypto/ffc -SRCS+= ffc_params.c ffc_params_generate.c ffc_key_generate.c \ - ffc_params_validate.c ffc_key_validate.c ffc_backend.c \ - ffc_dh.c - -# crypto/hmac -SRCS+= hmac.c - -# crypto/lhash -SRCS+= lhash.c - -# crypto/modes -SRCS+= cbc128.c ctr128.c cfb128.c ofb128.c gcm128.c ccm128.c xts128.c -SRCS+= wrap128.c -.if defined(ASM_aarch64) -SRCS+= ghashv8-armx.S aes-gcm-armv8_64.S -ACFLAGS.ghashv8-armx.S= -march=armv8-a+crypto -.elif defined(ASM_amd64) -SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S -.elif defined(ASM_arm) -SRCS+= ghash-armv4.S ghashv8-armx.S -.elif defined(ASM_i386) -SRCS+= ghash-x86.S -.elif defined(ASM_powerpc) -SRCS+= ghashp8-ppc.S -.elif defined(ASM_powerpc64) -SRCS+= ghashp8-ppc.S -.elif defined(ASM_powerpc64le) -SRCS+= ghashp8-ppc.S -.endif - -# crypto/property -SRCS+= property_string.c property_parse.c property_query.c property.c defn_cache.c - -# crypto/rand -SRCS+= rand_lib.c - -# crypto/rsa -SRCS+= rsa_ossl.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_pk1.c \ - rsa_none.c rsa_oaep.c rsa_chk.c rsa_pss.c rsa_x931.c rsa_crpt.c \ - rsa_sp800_56b_gen.c rsa_sp800_56b_check.c rsa_backend.c \ - rsa_mp_names.c rsa_schemes.c -SRCS+= rsa_acvp_test_params.c - -# crypto/sha -SRCS+= sha1dgst.c sha256.c sha512.c sha3.c -.if defined(ASM_aarch64) -SRCS+= keccak1600-armv8.S sha1-armv8.S sha256-armv8.S sha512-armv8.S -.elif defined(ASM_amd64) -SRCS+= keccak1600-x86_64.S sha1-mb-x86_64.S sha1-x86_64.S -SRCS+= sha256-mb-x86_64.S sha256-x86_64.S sha512-x86_64.S -.elif defined(ASM_arm) -SRCS+= keccak1600-armv4.S sha1-armv4-large.S sha256-armv4.S sha512-armv4.S -.elif defined(ASM_i386) -SRCS+= keccak1600.c sha1-586.S sha256-586.S sha512-586.S -.elif defined(ASM_powerpc) -SRCS+= keccak1600.c sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S -.elif defined(ASM_powerpc64) -SRCS+= keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S -.elif defined(ASM_powerpc64le) -SRCS+= keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S -.else -SRCS+= keccak1600.c -.endif - -# crypto/stack -SRCS+= stack.c - -# common -SRCS+= capabilities.c bio_prov.c digest_to_nid.c \ - securitycheck.c provider_seeding.c -SRCS+= securitycheck_fips.c - -# common/der -SRCS+= der_rsa_gen.c der_rsa_key.c -SRCS+= der_rsa_sig.c - -SRCS+= der_dsa_gen.c der_dsa_key.c -SRCS+= der_dsa_sig.c - -SRCS+= der_ec_gen.c der_ec_key.c -SRCS+= der_ec_sig.c - -SRCS+= der_ecx_gen.c der_ecx_key.c - -SRCS+= der_wrap_gen.c - -# asymciphers -SRCS+= rsa_enc.c - -# ciphers -SRCS+= ciphercommon.c ciphercommon_hw.c ciphercommon_block.c \ - ciphercommon_gcm.c ciphercommon_gcm_hw.c \ - ciphercommon_ccm.c ciphercommon_ccm_hw.c -SRCS+= cipher_aes.c cipher_aes_hw.c \ - cipher_aes_xts.c cipher_aes_xts_hw.c \ - cipher_aes_gcm.c cipher_aes_gcm_hw.c \ - cipher_aes_ccm.c cipher_aes_ccm_hw.c \ - cipher_aes_wrp.c \ - cipher_aes_cbc_hmac_sha.c \ - cipher_aes_cbc_hmac_sha256_hw.c cipher_aes_cbc_hmac_sha1_hw.c \ - cipher_cts.c -SRCS+= cipher_aes_xts_fips.c -SRCS+= cipher_tdes.c cipher_tdes_common.c cipher_tdes_hw.c - -# digests -SRCS+= digestcommon.c -SRCS+= sha2_prov.c -SRCS+= sha3_prov.c - -# exchange -SRCS+= dh_exch.c -SRCS+= ecx_exch.c -SRCS+= ecdh_exch.c -SRCS+= kdf_exch.c - -# kdfs -SRCS+= tls1_prf.c -SRCS+= hkdf.c -SRCS+= kbkdf.c -SRCS+= pbkdf2.c -SRCS+= pbkdf2_fips.c -SRCS+= sskdf.c -SRCS+= sshkdf.c -SRCS+= x942kdf.c - -# kem -SRCS+= rsa_kem.c - -# keymgmt -SRCS+= dh_kmgmt.c -SRCS+= dsa_kmgmt.c -SRCS+= ec_kmgmt.c -SRCS+= ecx_kmgmt.c -SRCS+= kdf_legacy_kmgmt.c -SRCS+= mac_legacy_kmgmt.c -SRCS+= rsa_kmgmt.c - -# macs -SRCS+= gmac_prov.c -SRCS+= hmac_prov.c -SRCS+= kmac_prov.c -SRCS+= cmac_prov.c - -# rands -SRCS+= drbg.c test_rng.c drbg_ctr.c drbg_hash.c drbg_hmac.c crngt.c - -# signature -SRCS+= dsa_sig.c -SRCS+= eddsa_sig.c ecdsa_sig.c -SRCS+= mac_legacy_sig.c -SRCS+= rsa_sig.c - -# ssl -SRCS+= record/tls_pad.c s3_cbc.c - -.include - -.if defined(ASM_${MACHINE_CPUARCH}) -.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} -.if defined(ASM_amd64) -.PATH: ${LCRYPTO_SRC}/crypto/bn/asm -.endif -.elif defined(ASM_${MACHINE_ARCH}) -.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_ARCH} -.endif - -.PATH: ${LCRYPTO_SRC}/crypto \ - ${LCRYPTO_SRC}/crypto/aes \ - ${LCRYPTO_SRC}/crypto/bio \ - ${LCRYPTO_SRC}/crypto/bn \ - ${LCRYPTO_SRC}/crypto/buffer \ - ${LCRYPTO_SRC}/crypto/cmac \ - ${LCRYPTO_SRC}/crypto/des \ - ${LCRYPTO_SRC}/crypto/dh \ - ${LCRYPTO_SRC}/crypto/dsa \ - ${LCRYPTO_SRC}/crypto/ec \ - ${LCRYPTO_SRC}/crypto/evp \ - ${LCRYPTO_SRC}/crypto/ffc \ - ${LCRYPTO_SRC}/crypto/hmac \ - ${LCRYPTO_SRC}/crypto/lhash \ - ${LCRYPTO_SRC}/crypto/modes \ - ${LCRYPTO_SRC}/crypto/property \ - ${LCRYPTO_SRC}/crypto/rand \ - ${LCRYPTO_SRC}/crypto/rsa \ - ${LCRYPTO_SRC}/crypto/sha \ - ${LCRYPTO_SRC}/crypto/stack \ - ${LCRYPTO_SRC}/providers/fips \ - ${LCRYPTO_SRC}/providers/common/der \ - ${LCRYPTO_SRC}/providers/implementations/asymciphers \ - ${LCRYPTO_SRC}/providers/implementations/ciphers \ - ${LCRYPTO_SRC}/providers/implementations/digests \ - ${LCRYPTO_SRC}/providers/implementations/exchange \ - ${LCRYPTO_SRC}/providers/implementations/kdfs \ - ${LCRYPTO_SRC}/providers/implementations/kem \ - ${LCRYPTO_SRC}/providers/implementations/keymgmt \ - ${LCRYPTO_SRC}/providers/implementations/macs \ - ${LCRYPTO_SRC}/providers/implementations/rands \ - ${LCRYPTO_SRC}/providers/implementations/signature \ - ${LCRYPTO_SRC}/ssl From nobody Sat Sep 7 05:13:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X11Td0MHmz5WnRS; Sat, 07 Sep 2024 05:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X11Tc6vw9z57p8; Sat, 7 Sep 2024 05:13:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725686021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nPd404c0x0/uq6THyguf76t3LPdLvEuujYVl+uVAK7k=; b=SB8ajcMzmtXEw8/vLeaqzPGBppoXVfN6LD5xvt2AE0DSxPiv6IgRwS7g3JuzdaLfV1M5nW l5GF/fnukBQ7BydH0zGTqc9YeCA2eO9abnDKz431EXu1CJgrmZ56hiRzvriem2rOhNcixu DfcqdmlJWcdtQRjAZQ3nEb3K2DSmoJm8XcRIfse1L6+/hp5QMcP+yBhS4KGHxc4r/WKW6O PH2mm+Qu8fdI0H7UNTgT4kMZI7oh00r+b6bJdpW1AH451vaPjezcLgTh1DIihASPkxypgn 7+dg/alOS4Ypjth6+egzBlJuNwut/yZqMElgS4cz3MgPdun3dwkISUAqFwfQNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725686021; a=rsa-sha256; cv=none; b=usbs6APo490+CoJWobzpSbIKPSgd/Jzcy0tCo0l38Erdc3UrqvnKq9mOE02BzsYF6D1z17 hA09BLHOuuhkvyxR28YrKiK+0laV+cDeZskrGeFHqlvhmMsqsKxCgl1X/FjQW5tOvmfzim /OhPBE9LY626w2Rb488XcJAAQjuZ/CxBrWRDRNmwYspEKBesiVgMEdPpAKnA7Tf0RlyEsB Cd5jRIw6DI/ajbFSIJnFuvUmnIOVQBkxJKD/1cW1gLFUHg8tbpRkeuxEhFLMTYGIXXlJq9 Uv+n3hekIVI3qqyjJgCGn5kes/5js/ZRbTBHcg0nwH7xyWg2cHtA21OGeK/Vgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725686021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nPd404c0x0/uq6THyguf76t3LPdLvEuujYVl+uVAK7k=; b=aBnWj1vH3ntdtKZtt3jM/oIFB5z4DmukW6RDGEjaUHiAdF3PU5RXkYpJYUvrbslWT8ow5E GE6VqP+wg55ijozz6jwrt378s+dnhe+cpQpZMyBcC9yb9VVRurK0xLK4lJ0kOF/bTf3LIC l8CRs0QCPUWabx7Alc511AIOOL5UGeQT4Rk3422gEbu53ZRau7VowGtHNBiWkN4c1pEYz6 bDLvsrbc+/BoUKxoCvV2EbvRz+rgfoYCK1s0U6j88SEAumTzEYhqK2SxAgQwDeZVFUQc7/ 1ZrXhziTARrC2gTh8fIAqNeM5ntMpRRbXSRw9oDDHQ1zXxXMPexWSQT+X+nHWQ== 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 4X11Tc6WC0zMr2; Sat, 7 Sep 2024 05:13: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 4875DeAf099528; Sat, 7 Sep 2024 05:13:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4875Dekl099525; Sat, 7 Sep 2024 05:13:40 GMT (envelope-from git) Date: Sat, 7 Sep 2024 05:13:40 GMT Message-Id: <202409070513.4875Dekl099525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0b683336b211 - stable/14 - tpm: Register TPM as entropy source List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0b683336b211e74b6d7f21ecf517c6591370b793 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=0b683336b211e74b6d7f21ecf517c6591370b793 commit 0b683336b211e74b6d7f21ecf517c6591370b793 Author: Jean-François Hren AuthorDate: 2024-08-31 17:53:02 +0000 Commit: Kevin Bowling CommitDate: 2024-09-07 05:13:14 +0000 tpm: Register TPM as entropy source TPM is defined as an entropy and is called every 10 seconds. However it was not registered and calls were discarded. Signed-off-by: Jean-François Hren Pull Request: https://github.com/freebsd/freebsd-src/pull/1398 (cherry picked from commit d7c87526b1c3d32d3ac3fee8c59d92405b7621b9) --- sys/dev/tpm/tpm20.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c index da090bc068c9..393552172656 100644 --- a/sys/dev/tpm/tpm20.c +++ b/sys/dev/tpm/tpm20.c @@ -203,6 +203,7 @@ tpm20_init(struct tpm_sc *sc) tpm20_release(sc); #ifdef TPM_HARVEST + random_harvest_register_source(RANDOM_PURE_TPM); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->harvest_task, 0, tpm20_harvest, sc); taskqueue_enqueue_timeout(taskqueue_thread, &sc->harvest_task, 0); @@ -219,6 +220,7 @@ tpm20_release(struct tpm_sc *sc) #ifdef TPM_HARVEST if (device_is_attached(sc->dev)) taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task); + random_harvest_deregister_source(RANDOM_PURE_TPM); #endif if (sc->buf != NULL) From nobody Sat Sep 7 05:14:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X11VR41ZCz5WnRW; Sat, 07 Sep 2024 05:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X11VR130tz58Ds; Sat, 7 Sep 2024 05:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725686063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aiD4/o31Fu8RxByRkfEWCUtfhA0raGkiX+6phDGIMQ8=; b=AJJjVzPjhXARyJf+1XwVEI0GnD+1BUDD8I7HVgDc8ZMrPMFQURYSGAC7hsljoXkL/jh868 GnGzo76lgaHAhqh0X127TuYzUoSggP7saI1cS4FRvZNiH+v5c9egsMrtjE/EQSajyQfUJl Hgh5CNkLl2XBxpo/fsrbcKHI8dj/U2ITmcM/G+ILR+nTr//WxS63dePSkHqQmT8dMkYIvn jmt0oBoqIaW5UDnsVsylT4yO11Hrtdoyad74MjDauJ0nzvfKpokCVKpQuxEi/Ou/+2zxf1 03Ss2Yn/xeqk5u1CqE6mqhHsh7as+PMBAgQBjo01NjgoXDVbi8rbbvdyvIdK8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725686063; a=rsa-sha256; cv=none; b=oSoZRujrDa0WFOFurjTe8mfQAP7yEi0+xm50m64sUp+z8zzFIz/t8yYoZm8PfsOumGcqV+ 639To08QlFMQzaqcKwiq2y8YnxxnFL2PzrlyvX8vi0GCp/QSZ+7NKaq5NRCvKACtUVTPMG 0dLnZc4fK3wkViel1gvkUrGojByhEbCdP4gV6FynVLB9rGtj0ae7Ixta2wSplzHw+uXTxA KxoHPo1i3WhmvOtRx4IW5Z1bOxamjQdMEWIA86kSxO9fNvJbWo/7ES0fMJGBV343oafwCJ DTPFfQRpJlTw+xb9BHQ1L/kwVwjiZp1tprWhXEUD+szYgKmhfv12PFFXQ8DR8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725686063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aiD4/o31Fu8RxByRkfEWCUtfhA0raGkiX+6phDGIMQ8=; b=GY6L+UT4Fdl5y+c9JCcBuLYV0DvKmt0h5V78zpwk2Ws7w83dgbicnKA9TU+8Tn5SJBosWO SQ/C7TPQwosxH9r1MNe9mnSsrY2SQiPmbYA4H2b5OcuGB0IREG7myYsm39DVrHWA36jKJL EuK42b/bQ1zfG/R03xRmYkR9ku3+n2QTiHqhkXZf8MzwI4w8ebfbHKfITnve/JcSW7yggD 3JHK1Ojih4/wRl4QcsXaPi6xJTpMzxKaCAut3KURnvuzNlwwuh68n0jF68Vlw9MxGRidtV ngGyi4ZWsEa3Qxv7u7A2Ofk9h+84nFXe+e3RcsAPg6YfMeEPgBagmvzgf0+Ejg== 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 4X11VR0fCxzN0S; Sat, 7 Sep 2024 05:14: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 4875EMkK099755; Sat, 7 Sep 2024 05:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4875EMLo099752; Sat, 7 Sep 2024 05:14:22 GMT (envelope-from git) Date: Sat, 7 Sep 2024 05:14:22 GMT Message-Id: <202409070514.4875EMLo099752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 4ba372dbc105 - stable/13 - tpm: Register TPM as entropy source List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ba372dbc1057ef080bcf9353cdebd3958c33b9c Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=4ba372dbc1057ef080bcf9353cdebd3958c33b9c commit 4ba372dbc1057ef080bcf9353cdebd3958c33b9c Author: Jean-François Hren AuthorDate: 2024-08-31 17:53:02 +0000 Commit: Kevin Bowling CommitDate: 2024-09-07 05:14:06 +0000 tpm: Register TPM as entropy source TPM is defined as an entropy and is called every 10 seconds. However it was not registered and calls were discarded. Signed-off-by: Jean-François Hren Pull Request: https://github.com/freebsd/freebsd-src/pull/1398 (cherry picked from commit d7c87526b1c3d32d3ac3fee8c59d92405b7621b9) --- sys/dev/tpm/tpm20.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c index dc483ba9d4fc..6865403960b3 100644 --- a/sys/dev/tpm/tpm20.c +++ b/sys/dev/tpm/tpm20.c @@ -206,6 +206,7 @@ tpm20_init(struct tpm_sc *sc) tpm20_release(sc); #ifdef TPM_HARVEST + random_harvest_register_source(RANDOM_PURE_TPM); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->harvest_task, 0, tpm20_harvest, sc); taskqueue_enqueue_timeout(taskqueue_thread, &sc->harvest_task, 0); @@ -222,6 +223,7 @@ tpm20_release(struct tpm_sc *sc) #ifdef TPM_HARVEST if (device_is_attached(sc->dev)) taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task); + random_harvest_deregister_source(RANDOM_PURE_TPM); #endif if (sc->buf != NULL) From nobody Sat Sep 7 11:31:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X19sh5rh9z5VXCm; Sat, 07 Sep 2024 11:31: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 4X19sh5MnJz4l3h; Sat, 7 Sep 2024 11:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725708696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dtBkrMKcKPNanB5NobYpyiLnf5bLlnqsRChUVWv4riU=; b=Wm/XBBsnYx9wSj/uHFMgJSR+ljzoFr/oa4SBDseqp/NCnyYHWbZ7ZdOnsCEmHP9Kyl9Okg i+onOtnvQ6mdrqhkU673/VTFDCTywEKCkHBeNz0NnLZ/x3+HrgMqARU8Vyph/AMuF+O5co sBK/vMj98PCJprZ18/82JBnTPdVPGUnFVRkJufCpUYtP5Gry9zY85dn/nXGNxcPk8Lf7VE lVSjpCbcYg5YYorvnl2n4vGcDA+pWdvaLHd3qjJibeG/PGXWJjHoOJBZQxyettVrIj26zY CzGvzmdAOJN6c3D93O6u6KGREMzr+Amje/PyKDkSyLECKTUGf4bWJz4712MgHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725708696; a=rsa-sha256; cv=none; b=f7KNigi0ISE/P6W9lCcq324XSCQpw+4g4Qm/tY28yNnqCXffoWE/+BRG4em2XV87boMWJe k6aok8OHDUcSayCuNGqUvtVaLi/LdoQat2VHhJUrgT5CCTBq/tLc3FQpV3jZZIf5maQBO5 5DHno/PPRiI8TnaAmY1Ph+YZkHA5lXq96bdxxZ1QFZQXEbPhpMqLN90M3FQGjlgmZ9SO/E UR1lesF/Qs+SSPxT1nJa+NNtYc6tiqSJQqSMBsrvVvLjDK1Kie/sHagIB+2jmNtc/2pe7R aidWEggqhd/fSV6vmpmZZqORnMy2GIMCzAI6xxzm6gq0pC7zo6771IQwZOi6bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725708696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dtBkrMKcKPNanB5NobYpyiLnf5bLlnqsRChUVWv4riU=; b=kdvsAondYFnfUUH74F0vBZw8gkFOoE/6D1HnQlBevVbhBcnZyRFCanzC9OwI+/GKkjOW6z v0/U04GPmKfjgRSK0Eg+crvlITpSblUphsTqdMsuQ4CxHmIBoj2qSG5ogfeN2PN+HOKoF9 dQmsTaqrDJDG6OgFl3DK3VIgTupJ1cZ+EjABUfJj4UBf1INDGAWUXr4s1MiCYfwtActfSQ GqN9EMGtNHf0csYn4eY2Slca8l7dxlT9QV0AckPXg698iWI5efu2Mq9BesZqwGbSNIYK7a I9h08k9x7Gykfs3b3qF+1K/qk35eW3oGLqJvXpfcKIKYGqBmo0epqwWl13ly8Q== 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 4X19sh4zQnzZM6; Sat, 7 Sep 2024 11:31: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 487BVaK8042104; Sat, 7 Sep 2024 11:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487BVaDL042101; Sat, 7 Sep 2024 11:31:36 GMT (envelope-from git) Date: Sat, 7 Sep 2024 11:31:36 GMT Message-Id: <202409071131.487BVaDL042101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 5daafa2c2301 - main - flua: fix buildworld from a clean room List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5daafa2c2301ad6d5ee0ade9a31ac2c463694a21 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5daafa2c2301ad6d5ee0ade9a31ac2c463694a21 commit 5daafa2c2301ad6d5ee0ade9a31ac2c463694a21 Author: Baptiste Daroussin AuthorDate: 2024-09-07 11:25:43 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-07 11:25:43 +0000 flua: fix buildworld from a clean room now that the flua ucl module is built the lib directory, it is being build at a moment where it cannot link yet to libucl, push libucl in the _prebuild_libs to ensure it is present in a path to be linked against at the time the lua ucl module is being built. While here, remove libucl from boostrap as a dependence of flua as it is not needed anymore now that flua ucl module is dynamically loadable. --- Makefile.inc1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index a4e2889004b7..edff60cc17ac 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2513,8 +2513,8 @@ ${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend} # 13.0-CURRENT cycle, thus needs to be built on -older releases and stable # branches. .if ${BOOTSTRAPPING} < 1300059 -${_bt}-libexec/flua: ${_bt}-lib/liblua ${_bt}-lib/libucl -_flua= lib/liblua lib/libucl libexec/flua +${_bt}-libexec/flua: ${_bt}-lib/liblua +_flua= lib/liblua libexec/flua .endif # r245440 mtree -N support added @@ -3236,7 +3236,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ lib/libxo \ ${_secure_lib_libcrypto} ${_secure_lib_libssl} \ - ${_lib_libldns} ${_secure_lib_libssh} + ${_lib_libldns} ${_secure_lib_libssh} \ + lib/libucl .if ${MK_DIALOG} != "no" _prebuild_libs+= gnu/lib/libdialog From nobody Sat Sep 7 12:24:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1C2949rtz5V9M1; Sat, 07 Sep 2024 12:24: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 4X1C293gL1z4r0m; Sat, 7 Sep 2024 12:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725711841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ISXM6/CCqypMTmzfqQ+tqTDNsYPuFa3/QHcB9MTz4E4=; b=pY16KuMBtitsDKWOf7jmK67NTHZJbM80h3WSfOqC04wl9dgeouS0hCi1EkdwADSY/gEjaR dH+RelaJJQBklZ3//6ZsrFr5XEHWxA7OojVdffdBgDfajomOjXQWP9nxyJ4ptc/PiMkyOk 3DVU+ydeN3nr/OapcxehqPV1Knox1Ec4PIEo66/05WZducBdsOK0sY1u15HgYLsEyZQWk/ ZwmMiKf4Huxj1OmCiix1CG5wh2aVcSKT87GbyOoIlp8vLrQdYzRyGyxBFPVfR3nR5U5Ab7 gHyF0RuYh+DM7FH0HBo+y8zNj/mNOhxipHC61sgtHCuC27pwq6sPIiEjmvQfMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725711841; a=rsa-sha256; cv=none; b=HLJJyCqIpRRLeOnAXWr4GkbwdCWY/4qE+cqmXa2RkEW5C7E8VGqhEJDz+pSVrCzJY/pbzi 2ffFmVd4AAPu8Q53mm0hYy2BQ5OqyDbcRs5gPntnYmNlr9RMrAJxRdy+Hx+gfODx9Zevm3 iwwtOqe1cQzcQ9qM+XLR5iHaDf/35xcSFzZwcPLStenf5jsII1QCBP7m8hFaeElmFv28Ie v5ZSgzxJ4DBL0okFUjmWmvqprk3+YtUoFNjAECWQNlLn/6iOYotL59GGChhPGPt7hq3BMT Jv8G2IqfPZcA7S9nFDDx9K6zYcEeREymHiKv4ocHHr8KhYh6+Iyr0BsfPc7ZZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725711841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ISXM6/CCqypMTmzfqQ+tqTDNsYPuFa3/QHcB9MTz4E4=; b=lL/3mGY1e8fTDgPZFk+ZFelsq6aJ80xoqO5Gm6n6qqw4X4qVb/wnI3tg45HETrnAMNvt0w LUTOdPm5ZA31q9Pm0D/bCStKGEO8iOJeyHVVC6DwlIRIVNZ/88palm0hjo1SofmqbDHQDS zrQqibDssc9lJor/6okSnMhz8B8MR7xF/sN/GPJmy2GU+b9fiEqDCGbt99Uav4Sd0qBfiH v48amANVDHVvDTuB261nyK5BJ84Es1avwXzNJqVvxvj8vsRWbLuYI9xe1YSqSE8/DyV7UX XQ2k7xLE7CwxvFYE6b51KroO/c0+zzT0ixnE7Y9xlPHD2EOFIWjIGyZPvdoPvQ== 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 4X1C2930GRzbXb; Sat, 7 Sep 2024 12:24: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 487CO1ih029671; Sat, 7 Sep 2024 12:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487CO19b029668; Sat, 7 Sep 2024 12:24:01 GMT (envelope-from git) Date: Sat, 7 Sep 2024 12:24:01 GMT Message-Id: <202409071224.487CO19b029668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9f0f4e23a584 - main - prebuild_libs: register libucl dependency on libm List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f0f4e23a584b5aa965aae774bb2dc1e5892d24a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9f0f4e23a584b5aa965aae774bb2dc1e5892d24a commit 9f0f4e23a584b5aa965aae774bb2dc1e5892d24a Author: Baptiste Daroussin AuthorDate: 2024-09-07 12:19:33 +0000 Commit: Baptiste Daroussin CommitDate: 2024-09-07 12:20:47 +0000 prebuild_libs: register libucl dependency on libm Reported by: Rainer Hurling --- Makefile.inc1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index edff60cc17ac..ec1db75234b2 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3292,6 +3292,7 @@ _generic_libs+= ${_DIR} lib/libtacplus__L: lib/libmd__L lib/libpam/libpam__L lib/libxo__L: lib/libutil__L +lib/libucl__L: lib/msun__L .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem From nobody Sat Sep 7 13:46:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1DsL3lgQz5VNdR; Sat, 07 Sep 2024 13:46:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X1DsL3XTCz43QZ; Sat, 7 Sep 2024 13:46:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725716790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qtAEj7MGblLhZA3eZ75jqyotl1wuFHYySQJjwR3HbCw=; b=Bwj5YNZ3Syhavxd5YI1FDnVFdrJSsQeCuI41m9BaFeTEaApqQsPsZkeToANEnKeziowtDJ IVP4QAd45FsTpaM/Gj94a3hXWBy5/yd8kjYy6YcXkmWvcv5ihrUNI/wKLvBrkHbPUXTeYB evfoZKAnWhybSqDQCR1sUp+hVchTlKePF3KTisCVhhIcSh19yzCMViDJvYKDcd2kyhS6nr JlObYz0gXc3eNuiIqIxLJyznC2Z/NHosdWSBPS+BSFqzsOgROQj2UdL6wqOG2nv5aqJgS2 OzKhnAWpaVvaYGPMFaENK7F6jmq1YH/dwDJdjtbvG77SXugJsxJnsXWcA9mPVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725716790; a=rsa-sha256; cv=none; b=hTKO9D/IOlebSvwA28t1j0KZTdmWCI4pMUtBBNQ7NH4M5socpN6W0f/beDQIkCpQNNMB4A L3NFDHomJU9q3lFe739NOR2zYv5zeMFsfv4Fojd39BueToh7WRrVH7ksA6jJ69fa21vA8I juJyyTsoTf7JV+cBWjwdbWYZZ4iAtqhUc7pQEbFkoNq2KpitlEJvOGLlDtlBSATxamuF5x XAr+8e2acKMnTQ3wVoIcstRW+O6tmBkZO9xqn6AzQXE/UCfMP6/IiNcvwPX0l3d4fI+2g/ vctESmOTdbecMZ3oi8kCGvkViIEU4tgBwnOksVXY2Da+b9u5Ba2aT7eP5KAzMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725716790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qtAEj7MGblLhZA3eZ75jqyotl1wuFHYySQJjwR3HbCw=; b=YY9ufXVufu5W/9J9JbMdHl7e60tvwCzgc4Ob/3HgUN8b7cE5j46q1On0qHf63IpGpq/Cpe jRBB7jqXcgsnbP6bYA+SlZZZNsHFfW3zPEBlvZ301vIkjk4zKLAyJ8q/JP35ckVeOIKrjC zw94brjAOcYqfoUBEFyVvwwjQp7+rZMtdMhbgE5dY7ER+hRv1orAwJTZC2P74Akw/PTVk+ +7gUSMl1Ufr9fV0UDlVdWJ27Jy5oM1gt8Pr/UVETgj5kAmgr67awCRIrC3woHZvxc1674K uELTpePkq+IZPWDHztZCqUONFT3c1KEQ18oQdXpyg0VP/ijaM5VPeC5UAseGmg== 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 4X1DsL30vjzdGt; Sat, 7 Sep 2024 13:46:30 +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 487DkUJx065146; Sat, 7 Sep 2024 13:46:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487DkUw6065143; Sat, 7 Sep 2024 13:46:30 GMT (envelope-from git) Date: Sat, 7 Sep 2024 13:46:30 GMT Message-Id: <202409071346.487DkUw6065143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a979394afeb5 - main - Update tzcode to 2024b. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a979394afeb5c20fc58c5f5b005d51eb8f92f666 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a979394afeb5c20fc58c5f5b005d51eb8f92f666 commit a979394afeb5c20fc58c5f5b005d51eb8f92f666 Merge: 9f0f4e23a584 e66ca70de4da Author: Dag-Erling Smørgrav AuthorDate: 2024-09-07 13:46:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-07 13:46:13 +0000 Update tzcode to 2024b. MFC after: 3 weeks Sponsored by: Klara, Inc. Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D46565 contrib/tzcode/CONTRIBUTING | 18 +- contrib/tzcode/Makefile | 412 +++++++++++++++++++++++-------------------- contrib/tzcode/NEWS | 124 ++++++++++++- contrib/tzcode/asctime.c | 19 +- contrib/tzcode/localtime.c | 87 ++------- contrib/tzcode/newctime.3 | 102 ++++++----- contrib/tzcode/newstrftime.3 | 30 ++-- contrib/tzcode/newtzset.3 | 66 +++++-- contrib/tzcode/private.h | 114 +++++++----- contrib/tzcode/theory.html | 214 ++++++++++++++-------- contrib/tzcode/tz-art.html | 5 + contrib/tzcode/tz-link.html | 113 +++++++----- contrib/tzcode/tzfile.5 | 38 ++-- contrib/tzcode/tzfile.h | 8 +- contrib/tzcode/tzselect.ksh | 125 ++++++------- contrib/tzcode/version | 2 +- contrib/tzcode/workman.sh | 3 +- contrib/tzcode/zdump.c | 10 +- contrib/tzcode/zic.8 | 52 +++--- contrib/tzcode/zic.c | 31 ++-- 20 files changed, 926 insertions(+), 647 deletions(-) diff --cc contrib/tzcode/Makefile index d48354c72df4,000000000000..0087b4596515 mode 100644,000000..100644 --- a/contrib/tzcode/Makefile +++ b/contrib/tzcode/Makefile @@@ -1,1361 -1,0 +1,1381 @@@ +# Make and install tzdb code and data. +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. +# Request POSIX conformance; this must be the first non-comment line. +.POSIX: - # On older platforms you may need to scrounge for a POSIX-conforming 'make'. - # For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or - # /usr/xpg4/bin/make, not /usr/ccs/bin/make. ++# On older platforms you may need to scrounge for POSIX conformance. ++# For example, on Solaris 10 (2005) with Sun Studio 12 aka Sun C 5.9 (2007), ++# use 'PATH=/usr/xpg4/bin:$PATH make CC=c99'. + +# To affect how this Makefile works, you can run a shell script like this: +# +# #!/bin/sh - # make CC='gcc -std=gnu11' "$@" ++# make CC='gcc -std=gnu23' "$@" +# - # This example script is appropriate for a pre-2017 GNU/Linux system - # where a non-default setting is needed to support this package's use of C99. ++# This example script is appropriate for a circa 2024 GNU/Linux system ++# where a non-default setting enables this package's optional use of C23. +# +# Alternatively, you can simply edit this Makefile to tailor the following +# macro definitions. + +############################################################################### +# Start of macros that one plausibly might want to tailor. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# DATAFORM selects the data format. +# Available formats represent essentially the same data, albeit +# possibly with minor discrepancies that users are not likely to notice. +# To get new features and the best data right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +# Rearguard users might also want "ZFLAGS = -b fat"; see below. +DATAFORM= main + +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= Factory + - # The POSIXRULES macro controls interpretation of POSIX-2017.1-like TZ ++# The POSIXRULES macro controls interpretation of POSIX-like TZ +# settings like TZ='EET-2EEST' that lack DST transition rules. +# If POSIXRULES is '-', no template is installed; this is the default. +# Any other value for POSIXRULES is obsolete and should not be relied on, as: +# * It does not work correctly in popular implementations such as GNU/Linux. +# * It does not work even in tzcode, except for historical timestamps +# that precede the last explicit transition in the POSIXRULES file. +# Hence it typically does not work for current and future timestamps. +# If, despite the above, you want a template for handling these settings, +# you can change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. + +POSIXRULES= - + +# Also see TZDEFRULESTRING below, which takes effect only +# if POSIXRULES is '-' or if the template file cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local timezone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" timezone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) - TIME_T_ALTERNATIVES_HEAD = int_least64_t - TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t ++TIME_T_ALTERNATIVES_HEAD = int_least64_t.ck ++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.) +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and was modified in tzdb 2021b to generate version 4 TZif files. +# EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to pre-2020a zic implementations and so that TZif files +# built by newer zic implementations can be read by pre-2021b libraries. +EXPIRES_LINE= 0 + +# To install data in text form that has all the information of the TZif data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', +# but only for entries listed in the backward-compatibility file zone.tab, use +# PACKRATDATA= backzone +# PACKRATLIST= zone.tab +# If you want all the 'backzone' data, use +# PACKRATDATA= backzone +# PACKRATLIST= +# To omit this data, use +# PACKRATDATA= +# PACKRATLIST= + +PACKRATDATA= +PACKRATLIST= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. +LDLIBS= + +# Add the following to an uncommented "CFLAGS=" line as needed +# to override defaults specified in the source code or by the system. +# "-DFOO" is equivalent to "-DFOO=1". +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r ++# on POSIX platforms predating POSIX.1-2024 +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE__GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares - # ctime_r and asctime_r incompatibly with the POSIX standard ++# ctime_r and asctime_r incompatibly with POSIX.1-2017 and earlier +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H=0 if does not work*+ +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SETENV=0 if your system lacks the setenv function +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work*+ +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if does not work* +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -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 +# -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'. +# Even with -DPORT_TO_C89, the code needs at least one C99 +# 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 - # -DSUPPORT_C89 if the tzcode library should support C89 callers+ - # However, this might trigger latent bugs in C99-or-later callers. ++# -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. ++# -DSUPPORT_POSIX2008 if the library should support older POSIX callers+ ++# However, this might cause problems in POSIX.1-2024-or-later callers. +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified - # DST transitions for POSIX.1-2017-style TZ strings lacking them, ++# DST transitions for proleptic format TZ strings lacking them, +# in the usual case where POSIXRULES is '-'. If not specified, +# TZDEFRULESTRING defaults to US rules for future DST transitions. +# 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) +# -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 +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably older ones that +# ignore or otherwise mishandle 64-bit data in TZif files; +# however, fat TZif files may trigger bugs in newer TZif readers. +# Slim TZif files are more efficient, and are the default. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# -g to generate symbolic debugging info +# -Idir to include from directory 'dir' +# -O0 to disable optimization; other -O options to enable more optimization +# -Uname to remove any definition of the macro 'name' +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# +# * Options marked "*" can be omitted if your compiler is C23 compatible. +# * Options marked "+" are obsolescent and are planned to be removed - # once the code assumes C99 or later, say in the year 2029. ++# once the code assumes C99 or later (say in the year 2029) ++# and POSIX.1-2024 or later (say in the year 2034). +# +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. - GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ ++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 \ + -Wdeclaration-after-statement -Wdouble-promotion \ - -Wduplicated-branches -Wduplicated-cond \ ++ -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ - -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ ++ -Wmissing-declarations -Wmissing-prototypes \ ++ -Wmissing-variable-declarations -Wnested-externs \ + -Wnull-dereference \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ + -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ - -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ ++ -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ + -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ - -Wno-type-limits ++ -Wno-format-nonliteral -Wno-sign-compare +# +# 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), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. - # Although these two fields are not required by POSIX.1-2017, - # POSIX 202x/D4 requires them and they are widely available - # on GNU/Linux and BSD systems. ++# Although POSIX.1-2024 requires these fields and they are widely available ++# on GNU/Linux and BSD systems, some older systems lack them. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" - # # to the "CFLAGS=" line. "tzname" is required by POSIX.1-1988 and later. ++# # to the "CFLAGS=" line. Although "tzname" is required by POSIX.1-1988 ++# # and later, its contents are unspecified if you use a geographical TZ ++# # and the variable is planned to be removed in a future POSIX edition. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 # do not support +# # -DUSG_COMPAT=1 # support, and variables are defined by system library +# # -DUSG_COMPAT=2 # support and define variables +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix - # # Systems Group code and are required by POSIX.1-2008 and later (with XSI). ++# # Systems Group code and are required by POSIX.1-2008 and later (with XSI), ++# # although their contents are unspecified if you use a geographical TZ ++# # and the variables are planned to be removed in a future edition of POSIX. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE=0 # do not support +# # -DALTZONE=1 # support "altzone", which is defined by system library +# # -DALTZONE=2 # support and define "altzone" +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# # If not defined, the code attempts to guess ALTZONE from other macros. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the following +# functions to be added to the time conversion library. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone. +# "timelocal" is nearly equivalent to "mktime". +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined to nonzero the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the timezone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and POSIX conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. +# +# POSIX says CFLAGS defaults to "-O 1". +# Uncomment the following line and edit its contents as needed. + +#CFLAGS= -O 1 + + +# The name of a POSIX-like library archiver, its flags, C compiler, +# linker flags, and 'make' utility. Ordinarily the defaults suffice. - # The commented-out values are the defaults specified by POSIX.1-202x/D4. ++# The commented-out values are the defaults specified by POSIX.1-2024. +#AR = ar +#ARFLAGS = -rv +#CC = c17 +#LDFLAGS = +#MAKE = make + - # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in - # submake command lines. The default is no leap seconds. - - LEAPSECONDS= - +# Where to fetch leap-seconds.list from. +leaplist_URI = \ + https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list +# The file is generated by the IERS Earth Orientation Centre, in Paris. +leaplist_TZ = Europe/Paris + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +# To shrink the size of installed TZif files, +# append "-r @N" to omit data before N-seconds-after-the-Epoch. +# To grow the files and work around bugs in older applications, +# possibly at the expense of introducing bugs in newer ones, +# append "-b fat"; see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. +ZFLAGS= + +# How to use zic to install TZif files. + - ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) ++ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' + +# The name of a POSIX-compliant 'awk' on your system. +# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. +# Also, it is better (though not essential) if 'awk' supports UTF-8, +# and unfortunately mawk and busybox awk do not support UTF-8. +# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. +AWK= awk + +# The full path name of a POSIX-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# Name of curl , used for HTML validation +# and to fetch leap-seconds.list from upstream. ++# Set CURL=: to disable use of the Internet. +CURL= curl + +# Name of GNU Privacy Guard , used to sign distributions. +GPG= gpg + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# These non-alphabetic, non-ASCII printable characters are Latin-1, +# and so are likely displayable even in editors like XEmacs 21 +# that have limited display capabilities. +UNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷ +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1) + +# Put this in a bracket expression to match spaces. +s = [:space:] + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. - GNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \ ++GNUTARFLAGS= --format=pax --pax-option=delete=atime,delete=ctime \ + --numeric-owner --owner=0 --group=0 \ + --mode=go+u,go-w --sort=name - TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ - then echo $(GNUTARFLAGS); \ - else :; \ - fi` ++SETUP_TAR= \ ++ export LC_ALL=C && \ ++ if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; then \ ++ TAR='tar $(GNUTARFLAGS)'; \ ++ else \ ++ TAR=tar; \ ++ fi + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. - DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ - || echo ' -F^TZ=') ++SETUP_DIFF_TZS = \ ++ if diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1; then \ ++ DIFF_TZS='diff -u -F^TZ='; \ ++ else \ ++ DIFF_TZS='diff -u'; \ ++ fi + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +# POSIX prohibits defining or using SHELL. However, csh users on systems +# that use the user shell for Makefile commands may need to define SHELL. +#SHELL= /bin/sh + +# End of macros that one plausibly might want to tailor. +############################################################################### + + +TZCOBJS= zic.o - TZDOBJS= zdump.o localtime.o asctime.o strftime.o - DATEOBJS= date.o localtime.o strftime.o asctime.o ++TZDOBJS= zdump.o localtime.o strftime.o ++DATEOBJS= date.o localtime.o strftime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README SECURITY theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html - CHECK_WEB_PAGES=check_theory.html check_tz-art.html \ - check_tz-how-to.html check_tz-link.html ++CHECK_WEB_PAGES=theory.ck tz-art.ck tz-how-to.ck tz-link.ck +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone.tab zone1970.tab zonenow.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ + $(PACKRATDATA) $(PACKRATLIST) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) +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 +TZDATA_DIST = $(COMMON) $(DATA) $(MISC) +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checknow.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + private.h southamerica strftime.c theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zonenow.tab + +all: tzselect zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) \ - `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ - ` $(POSIXRULES) \ ++ -p $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +# Calculate version number from git, if available. +# Otherwise, use $(VERSION) unless it is "unknown" and there is already +# a 'version' file, in which case reuse the existing 'version' contents +# and append "-dirty" if the contents do not already end in "-dirty". +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ - V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ - --abbrev=7 --dirty` || \ - if test '$(VERSION)' = unknown && V=`cat $@`; then \ - case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ ++ V=$$(git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ ++ --abbrev=7 --dirty) || \ ++ if test '$(VERSION)' = unknown && read -r V <$@; then \ ++ V=$${V%-dirty}-dirty; \ + else \ + V='$(VERSION)'; \ + fi; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) \ - -v DATAFORM=`expr $@ : '\(.*\).zi'` \ ++ -v DATAFORM=$(@:.zi=) \ + -v PACKRATDATA='$(PACKRATDATA)' \ + -v PACKRATLIST='$(PACKRATLIST)' \ + -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk - version=`sed 1q version` && \ ++ read -r version $@.out + mv $@.out $@ + +tzdir.h: + printf '%s\n' >$@.out \ + '#ifndef TZDEFAULT' \ + '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ + '#endif' \ + '#ifndef TZDIR' \ + '# define TZDIR "$(TZDIR)" /* TZif directory */' \ + '#endif' + mv $@.out $@ + +version.h: version - VERSION=`cat version` && printf '%s\n' \ ++ read -r VERSION $@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +leapseconds: $(LEAP_DEPS) + $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ + -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Awk script to extract a Git-style author from leap-seconds.list comments. +EXTRACT_AUTHOR = \ + author_line { sub(/^.[[:space:]]*/, ""); \ + sub(/:[[:space:]]*/, " <"); \ + printf "%s>\n", $$0; \ + success = 1; \ + exit \ + } \ + /Questions or comments to:/ { author_line = 1 } \ + END { exit !success } + +# Fetch leap-seconds.list from upstream. +fetch-leap-seconds.list: + $(CURL) -OR $(leaplist_URI) + +# Fetch leap-seconds.list from upstream and commit it to the local repository. +commit-leap-seconds.list: fetch-leap-seconds.list + author=$$($(AWK) '$(EXTRACT_AUTHOR)' leap-seconds.list) && \ + date=$$(TZ=$(leaplist_TZ) stat -c%y leap-seconds.list) && \ + git commit --author="$$author" --date="$$date" -m'make $@' \ + leap-seconds.list + - # Arguments to pass to submakes of install_data. ++# Arguments to pass to submakes. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ - LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + PACKRATLIST='$(PACKRATLIST)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + ZIC='$(ZIC)' + +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi + - # 'make install_data' installs one set of TZif files. - install_data: $(INSTALL_DATA_DEPS) - $(ZIC_INSTALL) tzdata.zi - +posix_only: $(INSTALL_DATA_DEPS) - $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data ++ $(ZIC_INSTALL) tzdata.zi + +right_only: $(INSTALL_DATA_DEPS) - $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ - install_data ++ $(ZIC_INSTALL) -L leapseconds tzdata.zi + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump - ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ - >$@ ++ ./zdump -i $(TZS_CUTOFF_FLAG) "$$PWD/$(@:.zd=)" >$@ + +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out - wd=`pwd` && \ - x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ ++ x=$$($(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ - | LC_ALL=C sort -t . -k 2,2` && \ ++ | LC_ALL=C sort -t . -k 2,2) && \ + set x $$x && \ + shift && \ + ZDS=$$* && \ - $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ ++ $(MAKE) TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir + mv $@.out $@ + - # If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the ++# If $(TZS) exists but 'make tzs.ck' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + touch $@ + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version - VERSION=`cat version` && sed \ ++ read -r VERSION $@.out + chmod +x $@.out + mv $@.out $@ + - check: check_back check_mild - check_mild: check_character_set check_white_space check_links \ - check_name_lengths check_now \ - check_slashed_abbrs check_sorted \ - check_tables check_web check_ziguard check_zishrink check_tzs ++check: check_mild back.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 \ ++ tables.ck ziguard.ck tzs.ck + +# True if UTF8_LOCALE does not work; +# otherwise, false but with LC_ALL set to $(UTF8_LOCALE). +UTF8_LOCALE_MISSING = \ + { test ! '$(UTF8_LOCALE)' \ *** 2742 LINES SKIPPED *** From nobody Sat Sep 7 14:45:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1G9m4bMNz5VXBn; Sat, 07 Sep 2024 14:45: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 4X1G9m3fZDz49k6; Sat, 7 Sep 2024 14:45:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725720348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ANvF4wOLL5DUa5Dob/CinO0PflXai3kYrR+kP9QFWLY=; b=vNcxDUHozm+o2zos70SmMZJudc5YI/vE3RlLhYr96lWeh5b3O3e8ZzrCK2w3f4kYK9WVna 11zcCP8WxyN7DITfkiKrS3+9tOa5DfiukNrhon6wk3axTeDCVUPC16EbyrfiMFuQzowmOC zbwDhy2j+rs8WUEas0SzIfYPBSGqo9zOVQzHJk4Au/a5iFVEe4mPslKWSaiSShJsf7TCHz jsVDrj+K/iL95NikmPJmNDoom2cbhnh1Ao9exO5Hgd7pbyP+lu3v9I9Jaf8jEPwELtBX9P TDY0NsRSu9adFCtWdial7I67tkypiDayf4FPC/ohotw93RxGxlCKp8uCCNF7Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725720348; a=rsa-sha256; cv=none; b=kBWc+nQfqCaoc2EoNnvdGniQZBoNjO9zDhwHIZHTFDC94eitZX5HVrkTpG3wSlCLOUp0b4 ZJsksHzRis8dCTZu3PtJmBMikRJFOPtsPwsC33z2lh3mDrO8gfAMc3O5IkhNgq96Hn9GrV LHDsM4/o9xDfalf6M8m/gx3TgfbYg3PD4EV6Y7IIOulp3NBZ0qu9Zebduoy+Y7BgrwSGPX 3viTL4vq/8qtBaCF7MdEGgXB6DecWGSqrQaD+cGDw8EwovSy/DcstWSYDzbOseHLbeIH5G Sx7rQ06SfEKLZ2xrB/++yFTM5IYWRLnj7fwdhFFZD7IQChMD2FkyHAvt1r6e0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725720348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ANvF4wOLL5DUa5Dob/CinO0PflXai3kYrR+kP9QFWLY=; b=qlvVjmmJ5uczbtplkRMX5H4eyc8x2ZLHVRiB+tphrNAnJW4oE/xOHeYRHzWEJPh/CjqKN/ wQl0CkAXZma3yBi+WHJSxiuNIKuJkEmFEd+iu9FBxLsjTlDjTvHmrydgw19ZSNtjCtRgz6 fF8YuyvvVjAjWMl8Ggp3sUYvQktEIlT/3ggiTom1exU5sP246VtD+mciZrlPQyto+pj1K3 gl/yUeePzGnCSu88teuAuZIcFLgv4Q+mRvqdqP/OoJu6xnY168Molg6VfIMRTC3XWyVSBa AsUJO650on8IHi6V+wJrFjXvXvVgJhnDRC9TTOR7vEsYZab4Yc3Y6HwyfKWPqg== 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 4X1G9m3GWDzfB6; Sat, 7 Sep 2024 14:45: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 487EjmdV068399; Sat, 7 Sep 2024 14:45:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487EjmVC068396; Sat, 7 Sep 2024 14:45:48 GMT (envelope-from git) Date: Sat, 7 Sep 2024 14:45:48 GMT Message-Id: <202409071445.487EjmVC068396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 24affded3d4e - main - src.conf: Add a MK_ZFS_TESTS knob List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24affded3d4ec5fafb6b22f773ec1e20d73b9b03 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=24affded3d4ec5fafb6b22f773ec1e20d73b9b03 commit 24affded3d4ec5fafb6b22f773ec1e20d73b9b03 Author: Mark Johnston AuthorDate: 2024-09-07 14:36:28 +0000 Commit: Mark Johnston CommitDate: 2024-09-07 14:36:28 +0000 src.conf: Add a MK_ZFS_TESTS knob The in-tree ZFS test suite is somewhat outdated and I see a number of failures there. I tend to think that we want to integrate the OpenZFS test suite somehow, replacing the legacy one, though it's also possible to run that as a separate test suite. In any case, if one wants to run the OpenZFS test suite separately, it's useful to be able to disable installation of the legacy ZFS test suite, so let's provide a src.conf option to do that. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46476 --- share/mk/src.opts.mk | 6 ++++++ tests/sys/cddl/Makefile | 2 +- tools/build/options/WITHOUT_ZFS_TESTS | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index c10598246639..179b444a8ec7 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -187,6 +187,7 @@ __DEFAULT_YES_OPTIONS = \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ + ZFS_TESTS \ LOADER_ZFS \ ZONEINFO @@ -444,6 +445,11 @@ MK_OFED_EXTRA:= no .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no +MK_ZFS_TESTS:= no +.endif + +.if ${MK_ZFS} == "no" +MK_ZFS_TESTS:= no .endif .if ${MK_TESTS_SUPPORT} == "no" diff --git a/tests/sys/cddl/Makefile b/tests/sys/cddl/Makefile index 6049a70fc613..66377e1e3bfd 100644 --- a/tests/sys/cddl/Makefile +++ b/tests/sys/cddl/Makefile @@ -4,7 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/cddl TESTS_SUBDIRS+= ${_zfs} -.if ${MK_ZFS} != "no" +.if ${MK_ZFS_TESTS} != "no" _zfs= zfs .endif diff --git a/tools/build/options/WITHOUT_ZFS_TESTS b/tools/build/options/WITHOUT_ZFS_TESTS new file mode 100644 index 000000000000..ae2ac45ca0f3 --- /dev/null +++ b/tools/build/options/WITHOUT_ZFS_TESTS @@ -0,0 +1 @@ +Do not build and install the legacy ZFS test suite. From nobody Sat Sep 7 16:30:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1JVY6Tm1z5W1SH; Sat, 07 Sep 2024 16:30:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X1JVY5F2gz4NQq; Sat, 7 Sep 2024 16:30:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725726629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yYx3r8y/bPFT+mr61X6x6ydXoC3Fcdfrk+KNQcnPtSg=; b=Cy3hbLn+5nNm+QTaI/qp8CZwp+0k5AgsHFOdkz7pMT16VOM91tuiSR8on8wtnw/e98fWfZ znpxBToeOsYBzZTLrB/rtLjWtZI56uOqsqU+bTh0zGTWZ+wkU6MeRhoMIo7Bdm3BYzoG/H mK7E0Bu0Q68rU3MUF/e2ThNprpeIkoQeZP7ePC24AK8gxlit/qWG8c+/AeqNVky9Ea/KSz L+z6vvzATC0+TDZx0v/gU/oSRwZkhNEghRYP9L0G/4N/SUx048KUmgNFkrDjk91oceGpG4 xo/fRgFbwghzKb2Zc66FEdRf49PLZYdhTPnL1gO8Y24bxO6TZtVEo0ynOn6rqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725726629; a=rsa-sha256; cv=none; b=SpzSp9S2JF4jpPcfeOi1p/KVfmYh0nRiriOG/D22p64Xxr5HaJOhwmcxcvK0nf7BOOmY9c RcChP60ne0zmtmSW2/MYABoYry5JigAvIH9xiXQIkdenu+hogdY+Rpt7oShE38CGsuo2PM fc7JvyrzyOO11oWM9lCBQeL6tk90K1Vmfy5Avis1uUwGCxEAuzgK6/IL0ru+GlCRykjem/ wjiM+jN/SfzLeroP6E1/aqomw66dnxuSnZs6Gy6QFZHfDatEKyJGzfYJTcjbnFXgYJAAo7 0ueZKEQGw1IzQhyrKUgpj7PrloPtSKKH1tUy0xRacLvXwuydBtCisFRT93HD8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725726629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yYx3r8y/bPFT+mr61X6x6ydXoC3Fcdfrk+KNQcnPtSg=; b=h9pO0aqO/HEPFlIf9EJo8W+upC1GN9Gg28UM1KCj/2ky/uUqK9m2ii1EIPZjpuP5aMIYOt +KpfL84ks1YIviW6yWe0lexlxxKdPqsphwS5BwX0dr7iW4tLvQ5h4ARuF32ryiMQld77oc SdMOw0eCwotpxZXCp/i0/QLY9HwbXf010g+SdYjitt8GuagZC6su8ydW7lBFJIsgosdbpa EHGBRY77L/wvgZSajChy/zhzhsnw/YtbHxMhEZXblwLGosIPVBJq6hy84J83kRk9wH0C9y UoDAN2CvpUvw3cJMzLd/2SlDFJY1KwnZWbbkvNtN5US6plcwLK0NhhB4amzWGw== 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 4X1JVY4rdGzjmX; Sat, 7 Sep 2024 16:30:29 +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 487GUToi050254; Sat, 7 Sep 2024 16:30:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487GUTMg050251; Sat, 7 Sep 2024 16:30:29 GMT (envelope-from git) Date: Sat, 7 Sep 2024 16:30:29 GMT Message-Id: <202409071630.487GUTMg050251@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: 6b9c7f29b0cd - stable/13 - Remove "All Rights Reserved" from FreeBSD Foundation copyrights List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b9c7f29b0cdf0da752927ca173f590cdf385c89 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6b9c7f29b0cdf0da752927ca173f590cdf385c89 commit 6b9c7f29b0cdf0da752927ca173f590cdf385c89 Author: Ed Maste AuthorDate: 2024-07-30 16:02:17 +0000 Commit: Ed Maste CommitDate: 2024-09-07 16:30:19 +0000 Remove "All Rights Reserved" from FreeBSD Foundation copyrights These ones were unambiguous cases where the Foundation was the only listed copyright holder. Sponsored by: The FreeBSD Foundation (cherry picked from commit 5c2bc3db201a4fe8d7911cf816bea104d5dc2138) (cherry picked from commit f06d322e9d925ab56a4aa8210a67637d4d341ab6) --- include/xlocale.h | 1 - lib/libcasper/services/cap_dns/cap_dns.c | 1 - lib/libcasper/services/cap_dns/cap_dns.h | 1 - lib/libcasper/services/cap_dns/tests/dns_test.c | 1 - lib/libcasper/services/cap_grp/cap_grp.c | 1 - lib/libcasper/services/cap_grp/cap_grp.h | 1 - lib/libcasper/services/cap_grp/tests/grp_test.c | 1 - lib/libcasper/services/cap_pwd/cap_pwd.c | 1 - lib/libcasper/services/cap_pwd/cap_pwd.h | 1 - lib/libcasper/services/cap_pwd/tests/pwd_test.c | 1 - lib/libcasper/services/cap_sysctl/cap_sysctl.c | 1 - lib/libcasper/services/cap_sysctl/cap_sysctl.h | 1 - lib/libcasper/services/cap_sysctl/tests/sysctl_test.c | 1 - lib/libnv/common_impl.h | 1 - lib/libnv/tests/nvlist_add_test.c | 1 - lib/libnv/tests/nvlist_exists_test.c | 1 - lib/libnv/tests/nvlist_free_test.c | 1 - lib/libnv/tests/nvlist_get_test.c | 1 - lib/libnv/tests/nvlist_move_test.c | 1 - lib/libnv/tests/nvlist_send_recv_test.c | 1 - lib/libproc/proc_bkpt.c | 1 - lib/libproc/proc_regs.c | 1 - lib/libproc/proc_rtld.c | 1 - lib/librtld_db/librtld_db.3 | 1 - lib/librtld_db/rtld_db.c | 1 - lib/librtld_db/rtld_db.h | 1 - lib/libthr/plockstat.d | 1 - lib/libthr/thread/thr_malloc.c | 1 - lib/libthread_db/arch/aarch64/libpthread_md.c | 1 - libexec/ftpd/blacklist.c | 1 - libexec/ftpd/blacklist_client.h | 1 - libexec/rc/rc.d/blacklistd | 1 - libexec/rtld-elf/aarch64/reloc.c | 1 - libexec/rtld-elf/aarch64/rtld_start.S | 1 - libexec/rtld-elf/rtld_malloc.h | 1 - sbin/hastctl/hastctl.8 | 1 - sbin/hastctl/hastctl.c | 1 - sbin/hastd/activemap.c | 1 - sbin/hastd/activemap.h | 1 - sbin/hastd/control.c | 1 - sbin/hastd/control.h | 1 - sbin/hastd/ebuf.c | 1 - sbin/hastd/ebuf.h | 1 - sbin/hastd/hast_proto.h | 1 - sbin/hastd/hastd.8 | 1 - sbin/hastd/hastd.h | 1 - sbin/hastd/metadata.c | 1 - sbin/hastd/metadata.h | 1 - sbin/hastd/nv.c | 1 - sbin/hastd/nv.h | 1 - sbin/hastd/proto.c | 1 - sbin/hastd/proto.h | 1 - sbin/hastd/proto_impl.h | 1 - sbin/hastd/proto_socketpair.c | 1 - sbin/hastd/proto_uds.c | 1 - sbin/hastd/rangelock.c | 1 - sbin/hastd/rangelock.h | 1 - sbin/hastd/synch.h | 1 - share/examples/hast/ucarp.sh | 1 - share/examples/hast/ucarp_down.sh | 1 - share/examples/hast/ucarp_up.sh | 1 - share/examples/kld/khelp/h_example.c | 1 - tests/sys/fs/fusefs/unlink.cc | 1 - tests/sys/kern/kern_copyin.c | 1 - tools/regression/capsicum/syscalls/cap_fcntls_limit.c | 1 - tools/regression/capsicum/syscalls/cap_getmode.c | 1 - tools/regression/capsicum/syscalls/cap_ioctls_limit.c | 1 - tools/regression/capsicum/syscalls/misc.c | 1 - tools/regression/capsicum/syscalls/misc.h | 1 - tools/test/popss/popss.c | 1 - tools/test/vm86/vm86_test.c | 1 - tools/test/vm86/vm86_test_asm.s | 1 - tools/tools/vt/mkkfont/mkkfont.c | 1 - usr.bin/proccontrol/proccontrol.1 | 1 - usr.bin/proccontrol/proccontrol.c | 1 - 75 files changed, 75 deletions(-) diff --git a/include/xlocale.h b/include/xlocale.h index f39000d6b373..cc2fc0839593 100644 --- a/include/xlocale.h +++ b/include/xlocale.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2011, 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by David Chisnall under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_dns/cap_dns.c b/lib/libcasper/services/cap_dns/cap_dns.c index 4d0a3bb222ac..1e552d2dc252 100644 --- a/lib/libcasper/services/cap_dns/cap_dns.c +++ b/lib/libcasper/services/cap_dns/cap_dns.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_dns/cap_dns.h b/lib/libcasper/services/cap_dns/cap_dns.h index 4bf8e3648a2d..556cac1158d2 100644 --- a/lib/libcasper/services/cap_dns/cap_dns.h +++ b/lib/libcasper/services/cap_dns/cap_dns.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_dns/tests/dns_test.c b/lib/libcasper/services/cap_dns/tests/dns_test.c index 3786414053ad..fda2dcf44062 100644 --- a/lib/libcasper/services/cap_dns/tests/dns_test.c +++ b/lib/libcasper/services/cap_dns/tests/dns_test.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_grp/cap_grp.c b/lib/libcasper/services/cap_grp/cap_grp.c index 6a5ad84fcd22..025ce00adf56 100644 --- a/lib/libcasper/services/cap_grp/cap_grp.c +++ b/lib/libcasper/services/cap_grp/cap_grp.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_grp/cap_grp.h b/lib/libcasper/services/cap_grp/cap_grp.h index a478a91cf760..9be2e7a78dd5 100644 --- a/lib/libcasper/services/cap_grp/cap_grp.h +++ b/lib/libcasper/services/cap_grp/cap_grp.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_grp/tests/grp_test.c b/lib/libcasper/services/cap_grp/tests/grp_test.c index c120c61e0cf1..18c11746d3a4 100644 --- a/lib/libcasper/services/cap_grp/tests/grp_test.c +++ b/lib/libcasper/services/cap_grp/tests/grp_test.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_pwd/cap_pwd.c b/lib/libcasper/services/cap_pwd/cap_pwd.c index 263bc4cfd582..6550c35d1592 100644 --- a/lib/libcasper/services/cap_pwd/cap_pwd.c +++ b/lib/libcasper/services/cap_pwd/cap_pwd.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_pwd/cap_pwd.h b/lib/libcasper/services/cap_pwd/cap_pwd.h index 35e0e177bc62..496beea26392 100644 --- a/lib/libcasper/services/cap_pwd/cap_pwd.h +++ b/lib/libcasper/services/cap_pwd/cap_pwd.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_pwd/tests/pwd_test.c b/lib/libcasper/services/cap_pwd/tests/pwd_test.c index e56c037536e2..20c76102847a 100644 --- a/lib/libcasper/services/cap_pwd/tests/pwd_test.c +++ b/lib/libcasper/services/cap_pwd/tests/pwd_test.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_sysctl/cap_sysctl.c b/lib/libcasper/services/cap_sysctl/cap_sysctl.c index 7d7f280fd00b..25793bd3c41d 100644 --- a/lib/libcasper/services/cap_sysctl/cap_sysctl.c +++ b/lib/libcasper/services/cap_sysctl/cap_sysctl.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013, 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_sysctl/cap_sysctl.h b/lib/libcasper/services/cap_sysctl/cap_sysctl.h index fd7d051f21c8..51243128a683 100644 --- a/lib/libcasper/services/cap_sysctl/cap_sysctl.h +++ b/lib/libcasper/services/cap_sysctl/cap_sysctl.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c b/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c index 2e5ec83e1c82..41c49bdbeba2 100644 --- a/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c +++ b/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013, 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/common_impl.h b/lib/libnv/common_impl.h index 03de9749aaf6..27af1710540a 100644 --- a/lib/libnv/common_impl.h +++ b/lib/libnv/common_impl.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/tests/nvlist_add_test.c b/lib/libnv/tests/nvlist_add_test.c index 4478efadf4e0..28f2b6f45446 100644 --- a/lib/libnv/tests/nvlist_add_test.c +++ b/lib/libnv/tests/nvlist_add_test.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/tests/nvlist_exists_test.c b/lib/libnv/tests/nvlist_exists_test.c index 7450256ab760..808692feb85b 100644 --- a/lib/libnv/tests/nvlist_exists_test.c +++ b/lib/libnv/tests/nvlist_exists_test.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/tests/nvlist_free_test.c b/lib/libnv/tests/nvlist_free_test.c index c715aef6657b..bb5eeaf7d04c 100644 --- a/lib/libnv/tests/nvlist_free_test.c +++ b/lib/libnv/tests/nvlist_free_test.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/tests/nvlist_get_test.c b/lib/libnv/tests/nvlist_get_test.c index d6e4a9b4d65a..f06be569c90d 100644 --- a/lib/libnv/tests/nvlist_get_test.c +++ b/lib/libnv/tests/nvlist_get_test.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/tests/nvlist_move_test.c b/lib/libnv/tests/nvlist_move_test.c index 3c99f4582c5e..2ef7ca4de384 100644 --- a/lib/libnv/tests/nvlist_move_test.c +++ b/lib/libnv/tests/nvlist_move_test.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libnv/tests/nvlist_send_recv_test.c b/lib/libnv/tests/nvlist_send_recv_test.c index ce3c682a8c7f..8db4f20a70b1 100644 --- a/lib/libnv/tests/nvlist_send_recv_test.c +++ b/lib/libnv/tests/nvlist_send_recv_test.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/lib/libproc/proc_bkpt.c b/lib/libproc/proc_bkpt.c index 9b81c410def7..c79d6be9828e 100644 --- a/lib/libproc/proc_bkpt.c +++ b/lib/libproc/proc_bkpt.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. diff --git a/lib/libproc/proc_regs.c b/lib/libproc/proc_regs.c index c5844f368d13..738c297d11ff 100644 --- a/lib/libproc/proc_regs.c +++ b/lib/libproc/proc_regs.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. diff --git a/lib/libproc/proc_rtld.c b/lib/libproc/proc_rtld.c index db17c2b02b95..1d6fc732933a 100644 --- a/lib/libproc/proc_rtld.c +++ b/lib/libproc/proc_rtld.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. diff --git a/lib/librtld_db/librtld_db.3 b/lib/librtld_db/librtld_db.3 index 041cc2cfa67b..07e1b67c096b 100644 --- a/lib/librtld_db/librtld_db.3 +++ b/lib/librtld_db/librtld_db.3 @@ -1,6 +1,5 @@ .\"- .\" Copyright (c) 2010 The FreeBSD Foundation -.\" All rights reserved. .\" .\" This software was developed by Rui Paulo under sponsorship from .\" the FreeBSD Foundation. diff --git a/lib/librtld_db/rtld_db.c b/lib/librtld_db/rtld_db.c index 2546f572780d..5d88089289bf 100644 --- a/lib/librtld_db/rtld_db.c +++ b/lib/librtld_db/rtld_db.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. diff --git a/lib/librtld_db/rtld_db.h b/lib/librtld_db/rtld_db.h index 24dc18a9a0ba..41aa7409fbf3 100644 --- a/lib/librtld_db/rtld_db.h +++ b/lib/librtld_db/rtld_db.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. diff --git a/lib/libthr/plockstat.d b/lib/libthr/plockstat.d index de620d893651..39d8946f33d3 100644 --- a/lib/libthr/plockstat.d +++ b/lib/libthr/plockstat.d @@ -1,6 +1,5 @@ /* * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. diff --git a/lib/libthr/thread/thr_malloc.c b/lib/libthr/thread/thr_malloc.c index d60fbc1b1fe8..dbc9e39e3c28 100644 --- a/lib/libthr/thread/thr_malloc.c +++ b/lib/libthr/thread/thr_malloc.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/lib/libthread_db/arch/aarch64/libpthread_md.c b/lib/libthread_db/arch/aarch64/libpthread_md.c index 17f8345e596b..93c7330baa1a 100644 --- a/lib/libthread_db/arch/aarch64/libpthread_md.c +++ b/lib/libthread_db/arch/aarch64/libpthread_md.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2014-2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/libexec/ftpd/blacklist.c b/libexec/ftpd/blacklist.c index e8954f11bbe7..0a45f9369074 100644 --- a/libexec/ftpd/blacklist.c +++ b/libexec/ftpd/blacklist.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Kurt Lidl under sponsorship from the * FreeBSD Foundation. diff --git a/libexec/ftpd/blacklist_client.h b/libexec/ftpd/blacklist_client.h index 94ecc66c17ce..0b6805dc218e 100644 --- a/libexec/ftpd/blacklist_client.h +++ b/libexec/ftpd/blacklist_client.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Kurt Lidl under sponsorship from the * FreeBSD Foundation. diff --git a/libexec/rc/rc.d/blacklistd b/libexec/rc/rc.d/blacklistd index b58c7c8a76b6..44a97ad4b3b0 100755 --- a/libexec/rc/rc.d/blacklistd +++ b/libexec/rc/rc.d/blacklistd @@ -1,7 +1,6 @@ #!/bin/sh # # Copyright (c) 2016 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Kurt Lidl under sponsorship from the # FreeBSD Foundation. diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index 907377f2619a..828686af8b98 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2014-2015 The FreeBSD Foundation - * All rights reserved. * * Portions of this software were developed by Andrew Turner * under sponsorship from the FreeBSD Foundation. diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S index 36dc87d54118..50ce7249eb3e 100644 --- a/libexec/rtld-elf/aarch64/rtld_start.S +++ b/libexec/rtld-elf/aarch64/rtld_start.S @@ -1,6 +1,5 @@ /*- * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/libexec/rtld-elf/rtld_malloc.h b/libexec/rtld-elf/rtld_malloc.h index 247726b9f470..408cdc84d45e 100644 --- a/libexec/rtld-elf/rtld_malloc.h +++ b/libexec/rtld-elf/rtld_malloc.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sbin/hastctl/hastctl.8 b/sbin/hastctl/hastctl.8 index a0a1e1f22634..f696858a8071 100644 --- a/sbin/hastctl/hastctl.8 +++ b/sbin/hastctl/hastctl.8 @@ -1,5 +1,4 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" All rights reserved. .\" .\" This software was developed by Pawel Jakub Dawidek under sponsorship from .\" the FreeBSD Foundation. diff --git a/sbin/hastctl/hastctl.c b/sbin/hastctl/hastctl.c index ab2d618c698c..3375723b40fd 100644 --- a/sbin/hastctl/hastctl.c +++ b/sbin/hastctl/hastctl.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/activemap.c b/sbin/hastd/activemap.c index f5e3c60fd0a0..58fad137e5ae 100644 --- a/sbin/hastd/activemap.c +++ b/sbin/hastd/activemap.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/activemap.h b/sbin/hastd/activemap.h index a1dbf70e51af..ff598f841909 100644 --- a/sbin/hastd/activemap.h +++ b/sbin/hastd/activemap.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/control.c b/sbin/hastd/control.c index f6f937d3b180..48171fde9053 100644 --- a/sbin/hastd/control.c +++ b/sbin/hastd/control.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/control.h b/sbin/hastd/control.h index 4e16334dc824..ad7fb7978597 100644 --- a/sbin/hastd/control.h +++ b/sbin/hastd/control.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/ebuf.c b/sbin/hastd/ebuf.c index 522e4e821b11..8f58493270af 100644 --- a/sbin/hastd/ebuf.c +++ b/sbin/hastd/ebuf.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/ebuf.h b/sbin/hastd/ebuf.h index a79821735539..a4a2b30f4cb4 100644 --- a/sbin/hastd/ebuf.h +++ b/sbin/hastd/ebuf.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/hast_proto.h b/sbin/hastd/hast_proto.h index ab0a46494b45..0158aa4ccee6 100644 --- a/sbin/hastd/hast_proto.h +++ b/sbin/hastd/hast_proto.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/hastd.8 b/sbin/hastd/hastd.8 index fefd03f7dbe0..05a2d9b5e4e9 100644 --- a/sbin/hastd/hastd.8 +++ b/sbin/hastd/hastd.8 @@ -1,5 +1,4 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" All rights reserved. .\" .\" This software was developed by Pawel Jakub Dawidek under sponsorship from .\" the FreeBSD Foundation. diff --git a/sbin/hastd/hastd.h b/sbin/hastd/hastd.h index 15ad243adf7c..a54ef316f37a 100644 --- a/sbin/hastd/hastd.h +++ b/sbin/hastd/hastd.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/metadata.c b/sbin/hastd/metadata.c index 2f9cbc5e0971..5318d9f6aee5 100644 --- a/sbin/hastd/metadata.c +++ b/sbin/hastd/metadata.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/metadata.h b/sbin/hastd/metadata.h index b5215c1a85c9..6d8c593f0a46 100644 --- a/sbin/hastd/metadata.h +++ b/sbin/hastd/metadata.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/nv.c b/sbin/hastd/nv.c index 5f50ae349023..fd6b56c1148d 100644 --- a/sbin/hastd/nv.c +++ b/sbin/hastd/nv.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/nv.h b/sbin/hastd/nv.h index d1214f2b29ec..657a66fe38eb 100644 --- a/sbin/hastd/nv.h +++ b/sbin/hastd/nv.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/proto.c b/sbin/hastd/proto.c index 56ff4933c9b8..35f73bb8d0bf 100644 --- a/sbin/hastd/proto.c +++ b/sbin/hastd/proto.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/proto.h b/sbin/hastd/proto.h index a7cecbe67479..729daa518d9d 100644 --- a/sbin/hastd/proto.h +++ b/sbin/hastd/proto.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/proto_impl.h b/sbin/hastd/proto_impl.h index 4f84f90c6f23..0a0074545f38 100644 --- a/sbin/hastd/proto_impl.h +++ b/sbin/hastd/proto_impl.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/proto_socketpair.c b/sbin/hastd/proto_socketpair.c index ab30a6a27263..9608eb13afff 100644 --- a/sbin/hastd/proto_socketpair.c +++ b/sbin/hastd/proto_socketpair.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/proto_uds.c b/sbin/hastd/proto_uds.c index 5bf4c64fe5f6..acb61a360180 100644 --- a/sbin/hastd/proto_uds.c +++ b/sbin/hastd/proto_uds.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/rangelock.c b/sbin/hastd/rangelock.c index 33aee39651a4..26025d1169ac 100644 --- a/sbin/hastd/rangelock.c +++ b/sbin/hastd/rangelock.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/rangelock.h b/sbin/hastd/rangelock.h index d01dbd755b40..4847887b6b7a 100644 --- a/sbin/hastd/rangelock.h +++ b/sbin/hastd/rangelock.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sbin/hastd/synch.h b/sbin/hastd/synch.h index 9e03fcb8ca74..32463f836bd0 100644 --- a/sbin/hastd/synch.h +++ b/sbin/hastd/synch.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/share/examples/hast/ucarp.sh b/share/examples/hast/ucarp.sh index 73253a295f53..67c7aecea44f 100755 --- a/share/examples/hast/ucarp.sh +++ b/share/examples/hast/ucarp.sh @@ -3,7 +3,6 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2010 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Pawel Jakub Dawidek under sponsorship from # the FreeBSD Foundation. diff --git a/share/examples/hast/ucarp_down.sh b/share/examples/hast/ucarp_down.sh index 133d35c59d5b..df78de156b1e 100755 --- a/share/examples/hast/ucarp_down.sh +++ b/share/examples/hast/ucarp_down.sh @@ -3,7 +3,6 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2010 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Pawel Jakub Dawidek under sponsorship from # the FreeBSD Foundation. diff --git a/share/examples/hast/ucarp_up.sh b/share/examples/hast/ucarp_up.sh index 9f22b4205909..62dee23c12c7 100755 --- a/share/examples/hast/ucarp_up.sh +++ b/share/examples/hast/ucarp_up.sh @@ -3,7 +3,6 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2010 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Pawel Jakub Dawidek under sponsorship from # the FreeBSD Foundation. diff --git a/share/examples/kld/khelp/h_example.c b/share/examples/kld/khelp/h_example.c index 5bca2b36af50..431ed5a090b4 100644 --- a/share/examples/kld/khelp/h_example.c +++ b/share/examples/kld/khelp/h_example.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010-2011 The FreeBSD Foundation - * All rights reserved. * * This software was developed at the Centre for Advanced Internet * Architectures, Swinburne University of Technology, Melbourne, Australia by diff --git a/tests/sys/fs/fusefs/unlink.cc b/tests/sys/fs/fusefs/unlink.cc index db54e286d85d..1d8a371649ee 100644 --- a/tests/sys/fs/fusefs/unlink.cc +++ b/tests/sys/fs/fusefs/unlink.cc @@ -1,6 +1,5 @@ /*- * Copyright (c) 2019 The FreeBSD Foundation - * All rights reserved. * * This software was developed by BFF Storage Systems, LLC under sponsorship * from the FreeBSD Foundation. diff --git a/tests/sys/kern/kern_copyin.c b/tests/sys/kern/kern_copyin.c index d7894dfa7296..5ddedce9d699 100644 --- a/tests/sys/kern/kern_copyin.c +++ b/tests/sys/kern/kern_copyin.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015, 2020 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/tools/regression/capsicum/syscalls/cap_fcntls_limit.c b/tools/regression/capsicum/syscalls/cap_fcntls_limit.c index 55627579963b..48b7968b959e 100644 --- a/tools/regression/capsicum/syscalls/cap_fcntls_limit.c +++ b/tools/regression/capsicum/syscalls/cap_fcntls_limit.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/tools/regression/capsicum/syscalls/cap_getmode.c b/tools/regression/capsicum/syscalls/cap_getmode.c index a2584895b179..3818e7b32caf 100644 --- a/tools/regression/capsicum/syscalls/cap_getmode.c +++ b/tools/regression/capsicum/syscalls/cap_getmode.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/tools/regression/capsicum/syscalls/cap_ioctls_limit.c b/tools/regression/capsicum/syscalls/cap_ioctls_limit.c index b0d392c8f0c0..01bc60a71514 100644 --- a/tools/regression/capsicum/syscalls/cap_ioctls_limit.c +++ b/tools/regression/capsicum/syscalls/cap_ioctls_limit.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/tools/regression/capsicum/syscalls/misc.c b/tools/regression/capsicum/syscalls/misc.c index 914c606ac904..c88f2f625c97 100644 --- a/tools/regression/capsicum/syscalls/misc.c +++ b/tools/regression/capsicum/syscalls/misc.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/tools/regression/capsicum/syscalls/misc.h b/tools/regression/capsicum/syscalls/misc.h index 842500aff14d..22a0ab8094db 100644 --- a/tools/regression/capsicum/syscalls/misc.h +++ b/tools/regression/capsicum/syscalls/misc.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/tools/test/popss/popss.c b/tools/test/popss/popss.c index 004ccb29c546..bb66f050beb1 100644 --- a/tools/test/popss/popss.c +++ b/tools/test/popss/popss.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/tools/test/vm86/vm86_test.c b/tools/test/vm86/vm86_test.c index 1057fc5c83d6..cbdb2c68a6df 100644 --- a/tools/test/vm86/vm86_test.c +++ b/tools/test/vm86/vm86_test.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/tools/test/vm86/vm86_test_asm.s b/tools/test/vm86/vm86_test_asm.s index 22e5cf70b7f7..0d76d2e77b1e 100644 --- a/tools/test/vm86/vm86_test_asm.s +++ b/tools/test/vm86/vm86_test_asm.s @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/tools/tools/vt/mkkfont/mkkfont.c b/tools/tools/vt/mkkfont/mkkfont.c index 3f92f926c029..ec4675cfcf1b 100644 --- a/tools/tools/vt/mkkfont/mkkfont.c +++ b/tools/tools/vt/mkkfont/mkkfont.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2009 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Ed Schouten under sponsorship from the * FreeBSD Foundation. diff --git a/usr.bin/proccontrol/proccontrol.1 b/usr.bin/proccontrol/proccontrol.1 index 6bef355a54c9..8ab63d079bbe 100644 --- a/usr.bin/proccontrol/proccontrol.1 +++ b/usr.bin/proccontrol/proccontrol.1 @@ -1,5 +1,4 @@ .\" Copyright (c) 2019 The FreeBSD Foundation, Inc. -.\" All rights reserved. .\" .\" This documentation was written by .\" Konstantin Belousov under sponsorship diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index 5b48ef2916f8..4b7543d63793 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. From nobody Sat Sep 7 19:40:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1Njb2mDWz5WQcX; Sat, 07 Sep 2024 19:40: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 4X1Njb0mC9z4qMX; Sat, 7 Sep 2024 19:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725738019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cma5EbQpnKK4H3I1RM3W5uzmr3ld/EU2ug4OwhonNkU=; b=hKHlbnO/m/VcCj6pPmtMNFNzZ+7XpKlwI//NL2XLqSD97/MPlY7NcORLRHpovMIYCB7I1I +8ASsXfNAbIH8B21TYCvUw0m319qzl3MBNXiis0EKmeIOnQ68CWPUjxXiql9g7u3TVC0kH 360IdXC4y0LeMTvz4U+f0rNJithizbwzkDvej7xZy77MvADoFzXkJo+Gg1ZianAxNudjlQ ab96cNEi07vJeu8CGE338T84ACkt9bFYYi6d7ONZWmVxSctdmo0L8WhU9k7eNegLbIPxpr qxKm0YTowN15gmeoZmJ2QjqsztRTod9KCR8zhHeo6CQApADOI6A8CYEWFa32IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725738019; a=rsa-sha256; cv=none; b=MetAYvfs4ngku5ea1EJjfJGNqXxrr8VOb7O7MXBnLyi0q4CEvySRCGb1j6anlYs/qjxFTc 0gik0KVGniJERNoDeLHrUbBV45ouHLe73aiR67wrx+W5rN6MBl1qlHKK9JFcpLeDUMfPQ8 H5tR1bpoye2Brx8hDb81rfW19VXPo8/vVm4dL/2U6kkaXqjwwg/a1+2TLEEpKHe2P3Fau5 6tcD+t4vZxgjdU8GghhFr0kNHJOB7mA1iiZKgygM9pRhZnS2/0IJ6UMDFSpKOruh7077ln rbjkhqg29gCvK147kBAM/Sw/FQNd1IGzqWRp3g356v0ObMYZW4ybqT8k7iVpuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725738019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cma5EbQpnKK4H3I1RM3W5uzmr3ld/EU2ug4OwhonNkU=; b=nBSfCvMI1v31G97Y8WIlCvu7yOoTbUFoQxJzpG/kJykjb7HMaUzUqDn+vjBexJE4egcYTZ 3J0K3OpiF2obGlN4o1EcABo6kD3lwW6PMnMjOlqv3GGcmXRyaaHkIhLkHI2zHTYXcF1Hef tXLlpN4eaVoFJMizcZhkc4g8yaOPuvY+UahbBmjhxHbkLWD8buUV7DobJrlutyU+CpliLy fugFYqXhpgVRYpe6K+jB7sjyI6/2tMSnVwgoWQXFCVMdA6B2JL7rwZOvtwehV6WEicppay riWV9wGm7OY79CLTn9asoIsox7jTHFJIi3omYRbHVGo8bv+L4F8U4vljjqPNhA== 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 4X1Njb09JQzpMl; Sat, 7 Sep 2024 19:40:19 +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 487JeIrY080743; Sat, 7 Sep 2024 19:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487JeIlX080740; Sat, 7 Sep 2024 19:40:18 GMT (envelope-from git) Date: Sat, 7 Sep 2024 19:40:18 GMT Message-Id: <202409071940.487JeIlX080740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a700bef1e4ee - main - netbsd-tests: Update a test case to chase grep symlink handling changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70 commit a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70 Author: Mark Johnston AuthorDate: 2024-09-07 19:39:49 +0000 Commit: Mark Johnston CommitDate: 2024-09-07 19:39:49 +0000 netbsd-tests: Update a test case to chase grep symlink handling changes This test case verifies that grep detects symlink loops when traversing a directory hierarchy. Fixes: fc12c191c087 ("grep: Default to -p instead of -S.") Reviewed by: ngie, jhb Reported by: Jenkins MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46544 --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index d2539a8250de..b1412a7a0715 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -81,7 +81,7 @@ recurse_symlink_body() atf_check -o file:"$(atf_get_srcdir)/d_recurse_symlink.out" \ -e file:"$(atf_get_srcdir)/d_recurse_symlink.err" \ - grep -r string test + grep -rS string test } atf_test_case word_regexps From nobody Sat Sep 7 23:45:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1V8K1Jckz5V4wY; Sat, 07 Sep 2024 23:45: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 4X1V8K0nSLz4P5X; Sat, 7 Sep 2024 23:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725752721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MYCp34HEFux4vsV5H44OrEbvDAXU813a4c1WszQXWsM=; b=jTGoU03qXX1zDDWviN432fXOBidlz/gwIkoV/0FjJIHhvhpuTF4tARbP+fWL3xkiBhrcZD 2N/GGwrPNbAFOnYN6yc+pEf1qS2goPvpjhSGnujFv/SHpL1omWAu8Y32cV8PmIuh+2GDeo EL7yJyYWdsIw44ljTbMxY37cuAegMhsu3NTgMb0IVOJPF8idgsY4whPeZvdN/6Nmxazsyo IudZC16yBOOzw7kP7wrXym1L1pRcHZzjQW61wq1kigxPQPxe0+rjpr+IEmQy/suxw4Dg0t N2C3TCIZnXZ0RZqVkFxlpViAli0Ecfs/TpTrq3hGWR6rN4dM6Jmsue7zSjYyJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725752721; a=rsa-sha256; cv=none; b=JheKyHLXg5MPx2QK/0PnOL3+2QM7/MiZP/c+u/Yp+z1ghJN38kRmKDStXS6Ktk2h0ub5wE ne7Y+07LlIf0B221f6EEK46ZSNsMc3shupgueyLFvJLKemmjcOSuiBSVCXDIdcp4Q1N1ss 2207IP4C6Cft9GTrJ7Fn3UrtgFdU3NYcSrebLq9k+MkU20W5Ss+t/XHFCeg+RPNFhjJO/s 7JMwibWMThRY9ObjeiRSuJF4ZtV/MV6V9nyytGcdEiU9WXYS31jvrSk99qQEIY85121cE+ wF30HLQiBCNt26HJURQGFhgWihthz0ks6Ds+CJlw2J/wJFcnAhMfAsGSC99gzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725752721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MYCp34HEFux4vsV5H44OrEbvDAXU813a4c1WszQXWsM=; b=bHav+dRN7QFMyl22vWPPghts3c71bBL0wKNcXrIsJkTYlbELHihzmUBapyKz/Y7beec1k3 MdQkq4NTdGRoixZBzQ1b5NFVxIMIc7nbCb7Ynr3dr4J/Frmdc+tZpFLF0rt6tyMKuQfP7j GLIyLBl3nJpEwFlhzDI3YDwFWWOX/14A9WyxgdzDLeUOEv6p1FlM+LltcMR7v/NqfnJCHF Tj1wv03YHvvvTkeR7UsTFaqKgSYxGTlLCkKLA96NUIDoE3nUDmBjw0TZC/FeQ0zvL0ijyR VK3avh44nxn4OEbj64LeieIpOrex1ryuMWjsV2gWdRvnvlBeCKI231w1c0tzAg== 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 4X1V8K0Nmpzwnl; Sat, 7 Sep 2024 23:45: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 487NjK4Z094605; Sat, 7 Sep 2024 23:45:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 487NjKt0094602; Sat, 7 Sep 2024 23:45:20 GMT (envelope-from git) Date: Sat, 7 Sep 2024 23:45:20 GMT Message-Id: <202409072345.487NjKt0094602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: 4086a0635d38 - main - openssl: Update upgrade instructions. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4086a0635d38d5e6ca29684c2ea2e927f8866e32 Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=4086a0635d38d5e6ca29684c2ea2e927f8866e32 commit 4086a0635d38d5e6ca29684c2ea2e927f8866e32 Author: Gordon Tetlow AuthorDate: 2024-09-07 23:45:05 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-07 23:45:05 +0000 openssl: Update upgrade instructions. Update download locations. Remove references to FREEBSD-Xlist. Remove reference to the fips module that has been removed. --- crypto/openssl/FREEBSD-upgrade | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/crypto/openssl/FREEBSD-upgrade b/crypto/openssl/FREEBSD-upgrade index 76943efdbde6..ebe2d85bd8f7 100644 --- a/crypto/openssl/FREEBSD-upgrade +++ b/crypto/openssl/FREEBSD-upgrade @@ -9,14 +9,14 @@ 01) Switch to the vendor branch: $ cd src/freebsd/main - $ git worktree add ../vendor/openssl-X.Y freebsd/vendor/openssl-X.Y + $ git worktree add -b vendor/openssl-X.Y ../vendor/openssl-X.Y freebsd/vendor/openssl-X.Y $ cd ../vendor/openssl-X.Y 02) Download the latest OpenSSL tarball and signature from the official website (https://www.openssl.org/source/). - $ (cd .. && fetch https://openssl.org/source/openssl-X.Y.Z.tar.gz) - $ (cd .. && fetch https://openssl.org/source/openssl-X.Y.Z.tar.gz.asc) + $ (cd .. && fetch https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz) + $ (cd .. && fetch https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz.asc) 03) Verify the signature: @@ -24,11 +24,11 @@ 04) Unpack the OpenSSL tarball to the parent directory: - $ tar -x -X FREEBSD-Xlist -f ../openssl-X.Y.Z.tar.gz -C .. + $ tar xf ../openssl-X.Y.Z.tar.gz -C .. 05) Copy to the vendor branch: - $ rsync --exclude FREEBSD.* --delete -av ../openssl-X.Y.Z/* . + $ rsync --exclude .git --delete -av ../openssl-X.Y.Z/ . 06) Take care of added / deleted files: @@ -112,19 +112,11 @@ 16) Build and install world, reboot, test. -17) Test the legacy and fips providers as well: (here with "test" as the password) +17) Test the legacy provider as well: (here with "test" as the password) $ echo test | openssl rc4 -provider legacy -e -a -pbkdf2 enter RC4 encryption password: Verifying - enter RC4 encryption password: U2FsdGVkX1+JvhqxLMOvlxvTi1/h - # openssl fipsinstall -out /etc/ssl/fipsmodule.cnf -module /usr/lib/ossl-modules/fips.so - INSTALL PASSED - # vi /etc/ssl/openssl.cnf - [enable the FIPS module] - # echo test | openssl aes-256-cbc -provider fips -e -a -pbkdf2 - U2FsdGVkX19lTexiYsnMX83ZLSojBOFwv7GB0Plhgmw= - 18) Commit and hope you did not miss anything. - From nobody Sun Sep 8 04:32:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1cWW25Smz5VqdJ; Sun, 08 Sep 2024 04:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X1cWW1n40z43pv; Sun, 8 Sep 2024 04:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725769943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJFtF5NxhztgC7sHQGXK9VUl6QTGwc+rk6zKdpFCSu0=; b=K0S4bcupKqOZkhaC8cVT52W024Z0H0G3wL7ZktTi++J6FFSiXa+hBctnY6NSHKZrzutr56 L3DOcNZtHqTXe6wxBXpo9Y+r9pXVVnld2nlzxMoWhkys2HCUmgOjCzCw28ZWhB1BT2WRfK 3SFn1QrkxrL4zLXBTgBfiHI485QGJuBOQjXT7dYL6Wu+K5bxuiQ15xcpiFpdRrQur64ZEm N0Q/ULWyOYC1D3QAFrvWMtgHjRvUK2Kc5BmovTHJyKw1PxfR05W3binyKrH8hIBarAAUH7 NitlHt/tZVCxzNrYos124wzemorl+uCqqBMKuCPPFPpwWt+Dt4I4wFcoGaXTTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725769943; a=rsa-sha256; cv=none; b=JJO4wrwKoOcQoQprFHRrAKs7oPZ7qTrNHjsHk819xJCkxCc20lwbDLL4mGP3VFGOif1Li8 GwgzSDM+8LwXa6j9t0vkppyg8LMI2dCAeHkrXQ5yu0apG4MVqcNpdyxQvTngvjmbs9AFM1 55mRisMWscX8FVSj/hqMegb1STALBEO+sEan4I2j4zzdNa0fl+YAxPkpWhcySSH1fvU2oN /kpMUh51U/+ccIfTkSIph6QCw+qHjWh2VJwOeyQcRgmpkMVKaTg/QffCiUZ1nKiKDq7FUP y92/GZdVBg7AI1HQfmplApxghRuZyWqaZs3A96Y/9NHoM7S9kEpWnwLV6aY1XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725769943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJFtF5NxhztgC7sHQGXK9VUl6QTGwc+rk6zKdpFCSu0=; b=ySvTb/06sHwHH2JNwLw5wadLIPVkznqgL4rQrJvcomTIgj6Se2vugdQTOorwe/bsQFBwQM Fjfv+fr6KfhBVLNFdechQnz6UDQBj57NdDh8Y3xtLRc9OjEjl9jrSxTLlApSUHYlcfLaDN 4zyiXvxLiUALN4bXNMcgwNOFBtPgaFianXFNfb3ZiJyPdC2Bz4RN1FLnU0HUGd7UAV2emE yiTDii/S+4902Jiotk1DT4Tp92f7+e/Z1zWpSeMK8atcJbVPTx2Kdec8z3QV9+bYF+fMNz t9ov4ByYEshqyqKmZHnLJB/6qViAqjSn4Dx4oVhzZNevngP2Cro1Uft2jG2jIA== 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 4X1cWW1N1Kz147g; Sun, 8 Sep 2024 04:32: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 4884WNoE086326; Sun, 8 Sep 2024 04:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4884WIAX086311; Sun, 8 Sep 2024 04:32:18 GMT (envelope-from git) Date: Sun, 8 Sep 2024 04:32:18 GMT Message-Id: <202409080432.4884WIAX086311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: a7148ab39c03 - main - openssl: Import OpenSSL 3.0.15. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7148ab39c03abd4d1a84997c70bf96f15dd2a09 Auto-Submitted: auto-generated The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=a7148ab39c03abd4d1a84997c70bf96f15dd2a09 commit a7148ab39c03abd4d1a84997c70bf96f15dd2a09 Merge: 4086a0635d38 108164cf95d9 Author: Enji Cooper AuthorDate: 2024-09-08 04:30:17 +0000 Commit: Enji Cooper CommitDate: 2024-09-08 04:31:22 +0000 openssl: Import OpenSSL 3.0.15. This release incorporates the following bug fixes and mitigations: - Fixed possible denial of service in X.509 name checks ([CVE-2024-6119]) - Fixed possible buffer overread in SSL_select_next_proto() ([CVE-2024-5535]) Release notes can be found at: https://openssl-library.org/news/openssl-3.0-notes/index.html Co-authored-by: gordon MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46602 Merge commit '108164cf95d9594884c2dcccba2691335e6f221b' crypto/openssl/CHANGES.md | 34 ++ crypto/openssl/CONTRIBUTING.md | 6 +- crypto/openssl/Configurations/10-main.conf | 36 ++ crypto/openssl/Configurations/15-ios.conf | 2 +- crypto/openssl/Configure | 10 +- crypto/openssl/FAQ.md | 6 - crypto/openssl/INSTALL.md | 4 +- crypto/openssl/NEWS.md | 15 + crypto/openssl/VERSION.dat | 4 +- crypto/openssl/apps/cms.c | 4 +- crypto/openssl/apps/dgst.c | 9 +- crypto/openssl/apps/lib/opt.c | 4 +- crypto/openssl/apps/lib/s_cb.c | 3 +- crypto/openssl/apps/smime.c | 4 +- crypto/openssl/crypto/aes/asm/aesp8-ppc.pl | 147 ++++-- crypto/openssl/crypto/aes/build.info | 4 + crypto/openssl/crypto/asn1/a_d2i_fp.c | 5 +- crypto/openssl/crypto/asn1/a_mbstr.c | 14 +- crypto/openssl/crypto/asn1/a_strex.c | 11 +- crypto/openssl/crypto/asn1/a_verify.c | 4 +- crypto/openssl/crypto/asn1/tasn_fre.c | 8 +- crypto/openssl/crypto/bio/bf_readbuff.c | 7 +- crypto/openssl/crypto/bio/bio_addr.c | 12 +- crypto/openssl/crypto/cmp/cmp_vfy.c | 4 +- crypto/openssl/crypto/conf/conf_def.c | 4 +- crypto/openssl/crypto/conf/conf_lib.c | 5 +- crypto/openssl/crypto/conf/conf_sap.c | 4 +- crypto/openssl/crypto/context.c | 4 +- crypto/openssl/crypto/ec/ecdsa_ossl.c | 12 +- crypto/openssl/crypto/engine/eng_table.c | 8 +- crypto/openssl/crypto/evp/ctrl_params_translate.c | 5 +- crypto/openssl/crypto/evp/digest.c | 4 +- crypto/openssl/crypto/evp/names.c | 36 +- crypto/openssl/crypto/evp/pmeth_lib.c | 11 +- crypto/openssl/crypto/o_str.c | 6 +- crypto/openssl/crypto/pkcs12/p12_crt.c | 17 +- crypto/openssl/crypto/pkcs7/pk7_doit.c | 45 +- crypto/openssl/crypto/property/property.c | 55 +- crypto/openssl/crypto/rand/randfile.c | 13 +- crypto/openssl/crypto/rsa/rsa_oaep.c | 4 +- crypto/openssl/crypto/x509/v3_utl.c | 2 +- crypto/openssl/crypto/x509/x_name.c | 6 +- crypto/openssl/doc/HOWTO/certificates.txt | 2 +- crypto/openssl/doc/fingerprints.txt | 3 - crypto/openssl/doc/man1/openssl-enc.pod.in | 13 +- .../doc/man1/openssl-passphrase-options.pod | 24 +- crypto/openssl/doc/man1/openssl-s_client.pod.in | 8 +- crypto/openssl/doc/man1/openssl-s_server.pod.in | 7 +- .../doc/man1/openssl-verification-options.pod | 4 +- crypto/openssl/doc/man3/ASN1_INTEGER_new.pod | 3 +- crypto/openssl/doc/man3/ASYNC_WAIT_CTX_new.pod | 5 +- crypto/openssl/doc/man3/BIO_ADDR.pod | 3 +- crypto/openssl/doc/man3/BIO_ADDRINFO.pod | 4 +- crypto/openssl/doc/man3/BIO_f_base64.pod | 26 +- crypto/openssl/doc/man3/BIO_meth_new.pod | 4 +- crypto/openssl/doc/man3/BN_add.pod | 22 +- crypto/openssl/doc/man3/BN_generate_prime.pod | 5 +- crypto/openssl/doc/man3/BN_set_bit.pod | 9 +- crypto/openssl/doc/man3/BUF_MEM_new.pod | 3 +- crypto/openssl/doc/man3/CRYPTO_THREAD_run_once.pod | 12 +- crypto/openssl/doc/man3/CTLOG_STORE_new.pod | 4 +- crypto/openssl/doc/man3/CTLOG_new.pod | 4 +- crypto/openssl/doc/man3/CT_POLICY_EVAL_CTX_new.pod | 5 +- crypto/openssl/doc/man3/DH_meth_new.pod | 4 +- crypto/openssl/doc/man3/DSA_SIG_new.pod | 3 +- crypto/openssl/doc/man3/DSA_meth_new.pod | 4 +- crypto/openssl/doc/man3/ECDSA_SIG_new.pod | 3 +- crypto/openssl/doc/man3/ENGINE_add.pod | 5 +- crypto/openssl/doc/man3/EVP_ASYM_CIPHER_free.pod | 4 +- crypto/openssl/doc/man3/EVP_CIPHER_meth_new.pod | 3 +- crypto/openssl/doc/man3/EVP_DigestInit.pod | 10 +- crypto/openssl/doc/man3/EVP_EncodeInit.pod | 4 +- crypto/openssl/doc/man3/EVP_EncryptInit.pod | 19 +- crypto/openssl/doc/man3/EVP_KEM_free.pod | 3 +- crypto/openssl/doc/man3/EVP_KEYEXCH_free.pod | 4 +- crypto/openssl/doc/man3/EVP_KEYMGMT.pod | 3 +- crypto/openssl/doc/man3/EVP_MD_meth_new.pod | 3 +- crypto/openssl/doc/man3/EVP_PKEY_ASN1_METHOD.pod | 4 +- crypto/openssl/doc/man3/EVP_PKEY_meth_new.pod | 4 +- crypto/openssl/doc/man3/EVP_RAND.pod | 4 +- crypto/openssl/doc/man3/EVP_SIGNATURE.pod | 4 +- crypto/openssl/doc/man3/HMAC.pod | 4 +- crypto/openssl/doc/man3/MD5.pod | 15 +- crypto/openssl/doc/man3/NCONF_new_ex.pod | 4 +- crypto/openssl/doc/man3/OCSP_REQUEST_new.pod | 3 +- crypto/openssl/doc/man3/OCSP_cert_to_id.pod | 3 +- crypto/openssl/doc/man3/OCSP_response_status.pod | 3 +- crypto/openssl/doc/man3/OPENSSL_LH_COMPFUNC.pod | 4 +- crypto/openssl/doc/man3/OPENSSL_init_crypto.pod | 3 +- crypto/openssl/doc/man3/OPENSSL_malloc.pod | 5 +- crypto/openssl/doc/man3/OPENSSL_secure_malloc.pod | 8 +- crypto/openssl/doc/man3/OSSL_CMP_CTX_new.pod | 8 +- crypto/openssl/doc/man3/OSSL_CMP_SRV_CTX_new.pod | 3 +- crypto/openssl/doc/man3/OSSL_CMP_validate_msg.pod | 9 +- crypto/openssl/doc/man3/OSSL_DECODER.pod | 3 +- crypto/openssl/doc/man3/OSSL_DECODER_CTX.pod | 3 +- .../doc/man3/OSSL_DECODER_CTX_new_for_pkey.pod | 4 +- crypto/openssl/doc/man3/OSSL_ENCODER.pod | 3 +- crypto/openssl/doc/man3/OSSL_ENCODER_CTX.pod | 3 +- crypto/openssl/doc/man3/OSSL_HTTP_REQ_CTX.pod | 3 +- crypto/openssl/doc/man3/OSSL_LIB_CTX.pod | 4 +- crypto/openssl/doc/man3/OSSL_PARAM_BLD.pod | 3 +- crypto/openssl/doc/man3/OSSL_PARAM_dup.pod | 3 +- crypto/openssl/doc/man3/OSSL_SELF_TEST_new.pod | 3 +- crypto/openssl/doc/man3/OSSL_STORE_INFO.pod | 3 +- crypto/openssl/doc/man3/OSSL_STORE_LOADER.pod | 23 +- crypto/openssl/doc/man3/OSSL_STORE_SEARCH.pod | 3 +- .../openssl/doc/man3/PEM_read_bio_PrivateKey.pod | 6 +- crypto/openssl/doc/man3/RAND_set_DRBG_type.pod | 4 +- crypto/openssl/doc/man3/RSA_meth_new.pod | 4 +- crypto/openssl/doc/man3/SCT_new.pod | 8 +- .../doc/man3/SSL_CTX_set_alpn_select_cb.pod | 28 +- .../openssl/doc/man3/SSL_CTX_set_cipher_list.pod | 4 +- .../doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod | 8 +- crypto/openssl/doc/man3/TS_RESP_CTX_new.pod | 3 +- crypto/openssl/doc/man3/X509V3_get_d2i.pod | 3 +- crypto/openssl/doc/man3/X509_LOOKUP.pod | 3 +- crypto/openssl/doc/man3/X509_LOOKUP_meth_new.pod | 3 +- crypto/openssl/doc/man3/X509_STORE_new.pod | 3 +- crypto/openssl/doc/man3/X509_dup.pod | 2 +- crypto/openssl/doc/man3/X509_new.pod | 7 +- crypto/openssl/doc/man3/d2i_X509.pod | 6 +- crypto/openssl/doc/man7/EVP_KEYEXCH-DH.pod | 11 +- crypto/openssl/doc/man7/EVP_PKEY-DH.pod | 62 +-- crypto/openssl/doc/man7/ossl_store.pod | 9 +- crypto/openssl/fuzz/bignum.c | 9 +- crypto/openssl/include/crypto/aes_platform.h | 4 +- crypto/openssl/include/crypto/bn.h | 2 +- crypto/openssl/include/openssl/tls1.h | 4 +- crypto/openssl/providers/fips-sources.checksums | 18 +- crypto/openssl/providers/fips.checksum | 2 +- .../implementations/encode_decode/decode_der2key.c | 35 +- .../openssl/providers/implementations/rands/drbg.c | 5 + crypto/openssl/ssl/bio_ssl.c | 4 +- crypto/openssl/ssl/ssl_lib.c | 63 ++- crypto/openssl/ssl/ssl_sess.c | 34 +- crypto/openssl/ssl/statem/extensions.c | 14 +- crypto/openssl/ssl/statem/extensions_clnt.c | 29 +- crypto/openssl/ssl/statem/extensions_srvr.c | 34 +- crypto/openssl/ssl/statem/statem_lib.c | 6 +- crypto/openssl/ssl/t1_lib.c | 2 + crypto/openssl/test/build.info | 6 +- crypto/openssl/test/crltest.c | 65 ++- crypto/openssl/test/endecode_test.c | 22 +- crypto/openssl/test/evp_byname_test.c | 40 ++ crypto/openssl/test/evp_extra_test.c | 21 + crypto/openssl/test/helpers/handshake.c | 8 +- crypto/openssl/test/hexstr_test.c | 11 +- crypto/openssl/test/prov_config_test.c | 9 +- crypto/openssl/test/provider_fallback_test.c | 14 +- crypto/openssl/test/provider_internal_test.c | 4 +- crypto/openssl/test/provider_test.c | 3 +- crypto/openssl/test/recipes/03-test_fipsinstall.t | 44 +- crypto/openssl/test/recipes/04-test_conf.t | 3 +- .../recipes/04-test_conf_data/oversized_line.cnf | 3 + .../recipes/04-test_conf_data/oversized_line.txt | 4 + crypto/openssl/test/recipes/25-test_eai_data.t | 2 +- crypto/openssl/test/recipes/30-test_evp_byname.t | 16 + .../test/recipes/30-test_evp_data/evppkey_dsa.txt | 6 +- .../recipes/30-test_evp_data/evppkey_ecdsa.txt | 3 +- .../30-test_evp_data/evppkey_rsa_common.txt | 3 +- crypto/openssl/test/recipes/70-test_npn.t | 73 +++ crypto/openssl/test/ssl-tests/08-npn.cnf | 553 ++++++++++++--------- crypto/openssl/test/ssl-tests/08-npn.cnf.in | 37 +- crypto/openssl/test/ssl-tests/09-alpn.cnf | 66 ++- crypto/openssl/test/ssl-tests/09-alpn.cnf.in | 35 +- crypto/openssl/test/sslapitest.c | 370 +++++++++++++- crypto/openssl/util/check-format-commit.sh | 171 +++++++ crypto/openssl/util/check-format-test-negatives.c | 5 +- crypto/openssl/util/check-format.pl | 13 +- crypto/openssl/util/perl/OpenSSL/Test/Utils.pm | 18 +- crypto/openssl/util/perl/TLSProxy/Message.pm | 11 +- crypto/openssl/util/perl/TLSProxy/NextProto.pm | 54 ++ crypto/openssl/util/perl/TLSProxy/Proxy.pm | 3 +- 174 files changed, 2312 insertions(+), 812 deletions(-) diff --cc crypto/openssl/CONTRIBUTING.md index fec6616e21fe,000000000000..cced15347d05 mode 100644,000000..100644 --- a/crypto/openssl/CONTRIBUTING.md +++ b/crypto/openssl/CONTRIBUTING.md @@@ -1,112 -1,0 +1,112 @@@ +HOW TO CONTRIBUTE TO OpenSSL +============================ + +Please visit our [Getting Started] page for other ideas about how to contribute. + - [Getting Started]: ++ [Getting Started]: + +Development is done on GitHub in the [openssl/openssl] repository. + + [openssl/openssl]: + +To request a new feature, ask a question, or report a bug, +please open an [issue on GitHub](https://github.com/openssl/openssl/issues). + +To submit a patch or implement a new feature, please open a +[pull request on GitHub](https://github.com/openssl/openssl/pulls). +If you are thinking of making a large contribution, +open an issue for it before starting work, to get comments from the community. +Someone may be already working on the same thing, +or there may be special reasons why a feature is not implemented. + +To make it easier to review and accept your pull request, please follow these +guidelines: + + 1. Anything other than a trivial contribution requires a [Contributor + License Agreement] (CLA), giving us permission to use your code. + If your contribution is too small to require a CLA (e.g., fixing a spelling + mistake), then place the text "`CLA: trivial`" on a line by itself below + the rest of your commit message separated by an empty line, like this: + + ``` + One-line summary of trivial change + + Optional main body of commit message. It might contain a sentence + or two explaining the trivial change. + + CLA: trivial + ``` + + It is not sufficient to only place the text "`CLA: trivial`" in the GitHub + pull request description. + + [Contributor License Agreement]: + + To amend a missing "`CLA: trivial`" line after submission, do the following: + + ``` + git commit --amend + # add the line, save and quit the editor + git push -f [ []] + ``` + + 2. All source files should start with the following text (with + appropriate comment characters at the start of each line and the + year(s) updated): + + ``` + Copyright 20xx-20yy The OpenSSL Project Authors. All Rights Reserved. + + Licensed under the Apache License 2.0 (the "License"). You may not use + this file except in compliance with the License. You can obtain a copy + in the file LICENSE in the source distribution or at + https://www.openssl.org/source/license.html + ``` + + 3. Patches should be as current as possible; expect to have to rebase + often. We do not accept merge commits, you will have to remove them + (usually by rebasing) before it will be acceptable. + + 4. Code provided should follow our [coding style] and [documentation policy] + and compile without warnings. + There is a [Perl tool](util/check-format.pl) that helps + finding code formatting mistakes and other coding style nits. + Where `gcc` or `clang` is available, you should use the + `--strict-warnings` `Configure` option. OpenSSL compiles on many varied + platforms: try to ensure you only use portable features. + Clean builds via GitHub Actions are required. They are started automatically + whenever a PR is created or updated by committers. + - [coding style]: https://www.openssl.org/policies/technical/coding-style.html - [documentation policy]: https://openssl.org/policies/technical/documentation-policy.html ++ [coding style]: https://openssl-library.org/policies/technical/coding-style/ ++ [documentation policy]: https://openssl-library.org/policies/technical/documentation-policy/ + + 5. When at all possible, code contributions should include tests. These can + either be added to an existing test, or completely new. Please see + [test/README.md](test/README.md) for information on the test framework. + + 6. New features or changed functionality must include + documentation. Please look at the `.pod` files in `doc/man[1357]` for + examples of our style. Run `make doc-nits` to make sure that your + documentation changes are clean. + + 7. For user visible changes (API changes, behaviour changes, ...), + consider adding a note in [CHANGES.md](CHANGES.md). + This could be a summarising description of the change, and could + explain the grander details. + Have a look through existing entries for inspiration. + Please note that this is NOT simply a copy of git-log one-liners. + Also note that security fixes get an entry in [CHANGES.md](CHANGES.md). + This file helps users get more in-depth information of what comes + with a specific release without having to sift through the higher + noise ratio in git-log. + + 8. For larger or more important user visible changes, as well as + security fixes, please add a line in [NEWS.md](NEWS.md). + On exception, it might be worth adding a multi-line entry (such as + the entry that announces all the types that became opaque with + OpenSSL 1.1.0). + This file helps users get a very quick summary of what comes with a + specific release, to see if an upgrade is worth the effort. + + 9. Guidelines how to integrate error output of new crypto library modules + can be found in [crypto/err/README.md](crypto/err/README.md). diff --cc crypto/openssl/test/evp_byname_test.c index 000000000000,e16e27a3a5ec..e16e27a3a5ec mode 000000,100644..100644 --- a/crypto/openssl/test/evp_byname_test.c +++ b/crypto/openssl/test/evp_byname_test.c diff --cc crypto/openssl/test/recipes/04-test_conf_data/oversized_line.cnf index 000000000000,08988a2e0f1d..08988a2e0f1d mode 000000,100644..100644 --- a/crypto/openssl/test/recipes/04-test_conf_data/oversized_line.cnf +++ b/crypto/openssl/test/recipes/04-test_conf_data/oversized_line.cnf diff --cc crypto/openssl/test/recipes/04-test_conf_data/oversized_line.txt index 000000000000,c15b654300c7..c15b654300c7 mode 000000,100644..100644 --- a/crypto/openssl/test/recipes/04-test_conf_data/oversized_line.txt +++ b/crypto/openssl/test/recipes/04-test_conf_data/oversized_line.txt diff --cc crypto/openssl/test/recipes/30-test_evp_byname.t index 000000000000,d06e874fe927..d06e874fe927 mode 000000,100644..100644 --- a/crypto/openssl/test/recipes/30-test_evp_byname.t +++ b/crypto/openssl/test/recipes/30-test_evp_byname.t diff --cc crypto/openssl/test/recipes/70-test_npn.t index 000000000000,f82e71af6aca..f82e71af6aca mode 000000,100644..100644 --- a/crypto/openssl/test/recipes/70-test_npn.t +++ b/crypto/openssl/test/recipes/70-test_npn.t diff --cc crypto/openssl/util/check-format-commit.sh index 000000000000,7e712dc48cf6..7e712dc48cf6 mode 000000,100755..100755 --- a/crypto/openssl/util/check-format-commit.sh +++ b/crypto/openssl/util/check-format-commit.sh diff --cc crypto/openssl/util/perl/TLSProxy/NextProto.pm index 000000000000,0e1834754667..0e1834754667 mode 000000,100644..100644 --- a/crypto/openssl/util/perl/TLSProxy/NextProto.pm +++ b/crypto/openssl/util/perl/TLSProxy/NextProto.pm From nobody Sun Sep 8 04:36:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1cbx0wcGz5Vr0C; Sun, 08 Sep 2024 04:36: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 4X1cbw5DT2z44H1; Sun, 8 Sep 2024 04: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=1725770172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sdkSQf5Sav8RGS7176qX99vNy9oVFSxYkq274vmqv+I=; b=hcu3oR6TuWnW6EpyiQjY+6EWyz84S66JuT3sMgw7iUkxHadQaq1fBJ/XWIUe5xL+wydhgt mIk2xUE8BK+WWRqXeZF8gQZKxsOsZa+eAlqJCUakqyGbkE+5cDP3rk3Aol29Vr/xjqeoUY 6lbqRO0hjJOiW9V+oGujRoxLrUGWMLgqZD02h5Riekyzi4hLBvL+/y7vvIzkMt4krBMNzQ iYeWYeGSqePCFprZUpi9UG5kzpPKLsDgrfuXJAF+eMFBs7FZMVuxLjdYnw3u/CgUPgp1Je tVk+k2SeQpUrKJFGLf18TgY9ifMNqPq5G6iPRzq5TZ2tBtdE4AEGFAIGbA6Orw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725770172; a=rsa-sha256; cv=none; b=PRcNHu6CkFrgZj0w2AC6y2cICForaHeV7865yoh85k2wjMq1KdB3rSGzsQUNnZGKc+16XD w6ZeWuEvytcJZVvGmB64sMbaYrazvF2EeaOTP97pcCQ3U9hOjRLSIUEY5IhnfC4T0bT6Ee 9saltWU3mGNGbJLC1HqnvgKXTqWlGb4tGC7Qs0QZI75ezYDKdSqoM8ejhDRcB8/5yZf78c ttH0PZT7xekz+ZSXt6HHvPCkzUiibIA5OGwLTEoy1YkeMzQPHncoiIA7kM5oaxpLVRh+zr 8Ya2N0BA+VlulK+68bAKXTCiRWunyQxCZCE310AJL3NergMR+/IbECJxQ1w8sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725770172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sdkSQf5Sav8RGS7176qX99vNy9oVFSxYkq274vmqv+I=; b=aoZooQptU+oZcINt8BSfpftvZirc0F0vaCGJI6C1+sBNBubbZ9bum5dkyeYyXzeVn9ieSl /ecg9UXdFSbiDt/rw/iQpcjdTnxYDXM3LNtr2GDirnEQsvQ7Ei/RNra53jkN1Crt7QwJzs nHvehLOf3mDxIno5cvf7OlVnKblZTUxjZR65dG0u9T/cWbRRY8ATVGgboz6RdOB8U+YSJQ TtwlPmuge/+THmZ/UfoyDq7eKjIlNUWzXznNbNd3PIdERd4jdQ9BIHzbYVElFN0E0ZQyEC 7hCLD77zQ4INyyI+IPQUcq/Ucro+RRFeF6nCOLtdwzhowY84DNNy8Lkgj+meRQ== 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 4X1cbw4XsSz14g1; Sun, 8 Sep 2024 04: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 4884aCEl087013; Sun, 8 Sep 2024 04: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 4884aCF7087010; Sun, 8 Sep 2024 04:36:12 GMT (envelope-from git) Date: Sun, 8 Sep 2024 04:36:12 GMT Message-Id: <202409080436.4884aCF7087010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: cc717b574d7f - main - Update config/build info for OpenSSL 3.0.15 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc717b574d7faa2e0b2de1a985076286cef74187 Auto-Submitted: auto-generated The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=cc717b574d7faa2e0b2de1a985076286cef74187 commit cc717b574d7faa2e0b2de1a985076286cef74187 Author: Enji Cooper AuthorDate: 2024-09-08 04:34:18 +0000 Commit: Enji Cooper CommitDate: 2024-09-08 04:34:18 +0000 Update config/build info for OpenSSL 3.0.15 This is a companion commit to the OpenSSL 3.0.15 update. `opensslv.h` was regenerated via the following process: ``` cd crypto/openssl ./config git reset --hard gmake include/openssl/opensslv.h ``` `Makefile.inc` has been updated to match. MFC after: 1 week MFC with: a7148ab39c03abd4d1a84997c70bf96f15dd2a09 Differential Revision: https://reviews.freebsd.org/D46603 --- crypto/openssl/include/openssl/opensslv.h | 10 +++++----- secure/lib/libcrypto/Makefile.inc | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crypto/openssl/include/openssl/opensslv.h b/crypto/openssl/include/openssl/opensslv.h index 537144b32e97..dd0aece423cd 100644 --- a/crypto/openssl/include/openssl/opensslv.h +++ b/crypto/openssl/include/openssl/opensslv.h @@ -29,7 +29,7 @@ extern "C" { */ # define OPENSSL_VERSION_MAJOR 3 # define OPENSSL_VERSION_MINOR 0 -# define OPENSSL_VERSION_PATCH 14 +# define OPENSSL_VERSION_PATCH 15 /* * Additional version information @@ -74,21 +74,21 @@ extern "C" { * longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ -# define OPENSSL_VERSION_STR "3.0.14" -# define OPENSSL_FULL_VERSION_STR "3.0.14" +# define OPENSSL_VERSION_STR "3.0.15" +# define OPENSSL_FULL_VERSION_STR "3.0.15" /* * SECTION 3: ADDITIONAL METADATA * * These strings are defined separately to allow them to be parsable. */ -# define OPENSSL_RELEASE_DATE "4 Jun 2024" +# define OPENSSL_RELEASE_DATE "3 Sep 2024" /* * SECTION 4: BACKWARD COMPATIBILITY */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.14 4 Jun 2024" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.15 3 Sep 2024" /* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */ # ifdef OPENSSL_VERSION_PRE_RELEASE diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc index 16a2c15bc962..e7072213d509 100644 --- a/secure/lib/libcrypto/Makefile.inc +++ b/secure/lib/libcrypto/Makefile.inc @@ -1,8 +1,8 @@ .include # OpenSSL version used for manual page generation -OPENSSL_VER= 3.0.14 -OPENSSL_DATE= 2024-06-04 +OPENSSL_VER= 3.0.15 +OPENSSL_DATE= 2024-09-03 LCRYPTO_SRC= ${SRCTOP}/crypto/openssl LCRYPTO_DOC= ${LCRYPTO_SRC}/doc From nobody Sun Sep 8 07:54:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1j0W5D4nz5WHtb; Sun, 08 Sep 2024 07:54: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 4X1j0W3yK6z4QSh; Sun, 8 Sep 2024 07:54:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Pf5EeLHcw0N41n2EvapfnmGf1Zau1cP+ADzagubWKo=; b=pqyoiGqZO89e9ZdE7PpeBy02Fcj83iMqQPjcZpfvd9dZWwx5CPRkvkBQDcl/+V/eecIUUj vQzU4RB8zG3iY42bw05aPTmyNolKvVR+QmR0EW5vbaWU8ZbG+AyguvBWuy+jYDakxdT1jD ouwultmloymkr6TuHdzbK1xzlx5UXOSn5uJe4BUMqMTCRj3zFLtWThOjQXf+PisgMOeCWn 0DaCv9B+PiAjRMOtdMapEioH8wOatb3vEBtxa+g8IHgEwQoSOWHAE3o7XjTYLbs4ek0t4C wNnhN4qYlkb/X1aiIIYLROJ5uJHyCIGGv2pkRElVOalgoc8lBal8MRdMf40rbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725782059; a=rsa-sha256; cv=none; b=K0+D3Cfy3wFCHByRkQU0eOtzoynZaU4XGzO0d629w38aTP0RgHxy5qbeE7kUyn2wYDU/bZ 3nxyCwBeuTDBx8WoflUmXWOz8yl/GgHbBhGjOO4NK/fzKIHMok6Dcb4VntpYHvhWH2QmFQ 2jGZzKdNogWhe2U+qKqlk7duphY+zh5a9FL/4BZNHmtc95wN2r0YhupWJx/I0SO2DEfGVP Yni6qbE74IjXKV66fHYwmd1sAyF0R7PqBa0tLUooXjmmz56unmMVccBQbEWot8v4qydmgI An/MX6W2PIz6bIitmAHlEB0HVRvlzvZsm0BGxAR/YOph+9Rd38L/Mhy9ck5Twg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Pf5EeLHcw0N41n2EvapfnmGf1Zau1cP+ADzagubWKo=; b=XXRf1Of9xlhqqlKOVswGpaXeEhBYl363rIY+puVX0QkW6MfXsK7T31JLf5PejdJyvqjQlS 7lxMrNiUcVhJXu+9N9JSldBtScQEXNxm4PIbBIED0gYEpvsipQpx25/RAWwzgo6Fdmc11B K6E3ReX6QOCzdC/fALMXolGb22ZFRK/XAbmgYW/0V4/y/9vMJuUBpHZp556TJLvuPucv6v PPSTy/h2hm7ZKxEhdVC/ReoJhUjOtDZx1+bgbTRtbOhwab1abmG5XdZqbZraSZaDZhl0Om zEcXqVVHqCWHEbE9uH5H9ossYQFmYbmWImwVVtyWhWVOf4oQab0Ezw9waaOjXA== 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 4X1j0W3Fqhz19fP; Sun, 8 Sep 2024 07:54:19 +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 4887sJSf023989; Sun, 8 Sep 2024 07:54:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4887sJhU023986; Sun, 8 Sep 2024 07:54:19 GMT (envelope-from git) Date: Sun, 8 Sep 2024 07:54:19 GMT Message-Id: <202409080754.4887sJhU023986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 33c82f11c267 - stable/14 - Improve accuracy of asinf(3) and acosf(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 33c82f11c2674beb50304b14248ff46372def520 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=33c82f11c2674beb50304b14248ff46372def520 commit 33c82f11c2674beb50304b14248ff46372def520 Author: Steve Kargl AuthorDate: 2024-08-29 19:44:48 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 07:37:52 +0000 Improve accuracy of asinf(3) and acosf(3) This uses a better rational approximation to improve the accuracy of both functions. For exhaustive testing of asinf(3) in the interval, the current libm gives: % ./tlibm asin -fPED -x 0x1p-12f -X 1 Interval tested for asinf: [0.000244141,1] ulp <= 0.5: 97.916% 98564994 | 97.916% 98564994 0.5 < ulp < 0.6: 2.038% 2051023 | 99.953% 100616017 0.6 < ulp < 0.7: 0.047% 47254 | 100.000% 100663271 0.7 < ulp < 0.8: 0.000% 25 | 100.000% 100663296 Max ulp: 0.729891 at 5.00732839e-01 which isn't too bad given that much of the computation is actually done in double floating point. With the new rational approximation, exhaustive testing yields: % ./tlibm asin -fPED -x 0x1p-12f -X 1 Interval tested for asinf: [0.000244141,1] ulp <= 0.5: 99.711% 100372643 | 99.711% 100372643 0.5 < ulp < 0.6: 0.288% 290357 | 100.000% 100663000 0.6 < ulp < 0.7: 0.000% 296 | 100.000% 100663296 Max ulp: 0.636344 at 5.09706438e-01 Similarly, for exhaustive testing of asinf(3) in the interval, the current libm gives: % ./tlibm acos -fPED -x -1 -X -0x1p-12f Interval tested for acosf: [-1,-0.000244141] ulp <= 0.5: 97.008% 97651921 | 97.008% 97651921 0.5 < ulp < 0.6: 2.441% 2457242 | 99.450% 100109163 0.6 < ulp < 0.7: 0.472% 475503 | 99.922% 100584666 0.7 < ulp < 0.8: 0.071% 71309 | 99.993% 100655975 0.8 < ulp < 0.9: 0.007% 7319 | 100.000% 100663294 0.9 < ulp < 1.0: 0.000% 2 | 100.000% 100663296 Max ulp: 0.914007 at -5.01484931e-01 % ./tlibm acos -fPED -x 0x1p-12f -X 1 Interval tested for acosf: [0.000244141,1] ulp <= 0.5: 97.317% 97962530 | 97.317% 97962530 0.5 < ulp < 0.6: 2.340% 2355182 | 99.657% 100317712 0.6 < ulp < 0.7: 0.314% 316134 | 99.971% 100633846 0.7 < ulp < 0.8: 0.029% 29450 | 100.000% 100663296 Max ulp: 0.796035 at 4.99814630e-01 With the new rational approximation, exhaustive testing yields: % ./tlibm acos -fPED -x -1 -X -0x1p-12f Interval tested for acosf: [-1,-0.000244141] ulp <= 0.5: 97.010% 97653245 | 97.010% 97653245 0.5 < ulp < 0.6: 2.442% 2458373 | 99.452% 100111618 0.6 < ulp < 0.7: 0.473% 476012 | 99.925% 100587630 0.7 < ulp < 0.8: 0.068% 68603 | 99.993% 100656233 0.8 < ulp < 0.9: 0.007% 7063 | 100.000% 100663296 Max ulp: 0.896189 at -5.04511118e-01 % ./tlibm acos -fPED -x 0x1p-12f -X 1 Interval tested for acosf: [0.000244141,1] ulp <= 0.5: 97.650% 98298175 | 97.650% 98298175 0.5 < ulp < 0.6: 2.028% 2041709 | 99.679% 100339884 0.6 < ulp < 0.7: 0.292% 293555 | 99.970% 100633439 0.7 < ulp < 0.8: 0.030% 29857 | 100.000% 100663296 Max ulp: 0.775875 at 4.91849005e-01 PR: 281001 MFC after: 1 week (cherry picked from commit 41e016289f77deb88b0ef1ec3f7b2ab3515ac7c8) --- lib/msun/src/e_acosf.c | 20 +++++++++++++------- lib/msun/src/e_asinf.c | 22 ++++++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/lib/msun/src/e_acosf.c b/lib/msun/src/e_acosf.c index 42ba126d1baa..ede552e7055a 100644 --- a/lib/msun/src/e_acosf.c +++ b/lib/msun/src/e_acosf.c @@ -22,11 +22,17 @@ pi = 3.1415925026e+00, /* 0x40490fda */ pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */ static volatile float pio2_lo = 7.5497894159e-08; /* 0x33a22168 */ + +/* + * The coefficients for the rational approximation were generated over + * 0x1p-12f <= x <= 0.5f. The maximum error satisfies log2(e) < -30.084. + */ static const float -pS0 = 1.6666586697e-01, -pS1 = -4.2743422091e-02, -pS2 = -8.6563630030e-03, -qS1 = -7.0662963390e-01; +pS0 = 1.66666672e-01f, /* 0x3e2aaaab */ +pS1 = -1.19510300e-01f, /* 0xbdf4c1d1 */ +pS2 = 5.47002675e-03f, /* 0x3bb33de9 */ +qS1 = -1.16706085e+00f, /* 0xbf956240 */ +qS2 = 2.90115148e-01f; /* 0x3e9489f9 */ float acosf(float x) @@ -46,13 +52,13 @@ acosf(float x) if(ix<=0x32800000) return pio2_hi+pio2_lo;/*if|x|<2**-26*/ z = x*x; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); r = p/q; return pio2_hi - (x - (pio2_lo-x*r)); } else if (hx<0) { /* x < -0.5 */ z = (one+x)*(float)0.5; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); s = sqrtf(z); r = p/q; w = r*s-pio2_lo; @@ -66,7 +72,7 @@ acosf(float x) SET_FLOAT_WORD(df,idf&0xfffff000); c = (z-df*df)/(s+df); p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); r = p/q; w = r*s+c; return (float)2.0*(df+w); diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c index a2ee1a166f03..8d1aca27df83 100644 --- a/lib/msun/src/e_asinf.c +++ b/lib/msun/src/e_asinf.c @@ -18,12 +18,18 @@ static const float one = 1.0000000000e+00, /* 0x3F800000 */ -huge = 1.000e+30, - /* coefficient for R(x^2) */ -pS0 = 1.6666586697e-01, -pS1 = -4.2743422091e-02, -pS2 = -8.6563630030e-03, -qS1 = -7.0662963390e-01; +huge = 1.000e+30; + +/* + * The coefficients for the rational approximation were generated over + * 0x1p-12f <= x <= 0.5f. The maximum error satisfies log2(e) < -30.084. + */ +static const float +pS0 = 1.66666672e-01f, /* 0x3e2aaaab */ +pS1 = -1.19510300e-01f, /* 0xbdf4c1d1 */ +pS2 = 5.47002675e-03f, /* 0x3bb33de9 */ +qS1 = -1.16706085e+00f, /* 0xbf956240 */ +qS2 = 2.90115148e-01f; /* 0x3e9489f9 */ static const double pio2 = 1.570796326794896558e+00; @@ -46,7 +52,7 @@ asinf(float x) } t = x*x; p = t*(pS0+t*(pS1+t*pS2)); - q = one+t*qS1; + q = one+t*(qS1+t*qS2); w = p/q; return x+x*w; } @@ -54,7 +60,7 @@ asinf(float x) w = one-fabsf(x); t = w*(float)0.5; p = t*(pS0+t*(pS1+t*pS2)); - q = one+t*qS1; + q = one+t*(qS1+t*qS2); s = sqrt(t); w = p/q; t = pio2-2.0*(s+s*w); From nobody Sun Sep 8 07:54:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1j0X5C4Dz5WHnh; Sun, 08 Sep 2024 07:54: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 4X1j0X4SbQz4QBy; Sun, 8 Sep 2024 07:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1iPHrA3irqp3WMiJ1ATdolaCf/2hHTjS8bDue2Sbaw0=; b=Yt5EF4o/WIVyAWXCbO+QRDQQ6JXzFxuTuLrxSQHiFU7jQ1V3RCMA333j7qQwIexkBiRObR iDl4hGDpMmAVQauRZzPKhtiTwkJJsHCpAXrfijWS/0CEBwg7fFcWdZLTBKxJyulA3b59gF vgL37ZbRope+BN5yVyhgYDlarg60c4myZfmXuZ5AXjxd2qJ6Mv0c0Vmqs6r/WIR1JTL0Tp GNX114ankYmnyKdTFtvlhlVcXlvlFGj0bwNd4RsNgU/BzoB4Crrmze0dy0vvnF91EQiHUm 3dKMt6bFsmT42Sb3DnxizlUzxHgFpX2PD/Vqi4mzL/PzvW8kZwi8IRozFZb+SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725782060; a=rsa-sha256; cv=none; b=hIffG8Gy0IGfX9JTl7UXqO+XGJaNpw9+MgfrGw5S7WLkqj7DhLpMa7eiA7ROLmcuhtC1Pu +3T8T7mxowbCxFTJ5GILpJM/ByPuowm7T8rY6aqRuBYYbK07hJQF6GsfOV+lXgZOZAgk6l rRkhnS9i7mPxkNP8dq2tiw3hWPWOBi/iB30b01dEmv9D0cA9jgzoqd9POw0FbeGiU0fv07 ko9RVygiqUhhKkl/JGt+wgWZ7A/Ig/uvOg5ZhI5hwzo8Y3gDtUtNqp6hDdiT0AnYxNV25x KxqrjMYi+4uXnggHocXuzzOdaoVU4lnNXh2s99noTytGzmn35p5hFFa1N30gmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1iPHrA3irqp3WMiJ1ATdolaCf/2hHTjS8bDue2Sbaw0=; b=LcW9vjQjWkjJIxzrW+fHw4LDfTyTo1K8iNKkO2iEmJVQad03+o+1Rfk5ReshCoPfyYM3QB 6T+XdoTp4gLfrCY1WpBo3Py3miSVbfgabnN/Wv2F6DwSCGxClJtqrSg6d9G5nkRrdYO0ZI hkQvEL6TYO1u7rIS9pRAoF430HGPcyNrIULCTsKXy83tKnisDOQQGKleUtNTGfDKYFZCCi CsnozWFaXdvga5NsWYWSIvVBM6UqYOHGAQz+D8GBCAQQ4tSsMR5LtQghF0vLKBuCM/BcUs l+NgXxpGFBQCyYyeXCSQ5eEc+8xMj6+j7Rn+Gn0qAvkxRCF7qGkBAWvKz6WutQ== 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 4X1j0X43jlz19s3; Sun, 8 Sep 2024 07:54: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 4887sKh0024034; Sun, 8 Sep 2024 07:54:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4887sKoJ024031; Sun, 8 Sep 2024 07:54:20 GMT (envelope-from git) Date: Sun, 8 Sep 2024 07:54:20 GMT Message-Id: <202409080754.4887sKoJ024031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: cc32cfab5c0d - stable/14 - UPDATING: keep sorted by date. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cc32cfab5c0dc07d124fa6df942f76adbc15f8ef Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=cc32cfab5c0dc07d124fa6df942f76adbc15f8ef commit cc32cfab5c0dc07d124fa6df942f76adbc15f8ef Author: Dimitry Andric AuthorDate: 2024-09-08 07:47:32 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 07:47:32 +0000 UPDATING: keep sorted by date. --- UPDATING | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/UPDATING b/UPDATING index 83b0d8b27cda..d6c2a930255a 100644 --- a/UPDATING +++ b/UPDATING @@ -12,27 +12,6 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. -20240202: - Loader now also read configuration files listed in local_loader_conf_files. - Files listed here are the last ones read. And /boot/loader.conf.local was - moved from loader_conf_files to local_loader_conf_files leaving only - loader.conf and device.hints in loader_conf_files by default. - - The following sequencing is applied: - - 1. Bootstrap: - /boot/defaults/loader.conf - - 2. Read loader_conf_files files: - /boot/device.hints - /boot/loader.conf - - 3. Read loader_conf_dirs files: - /boot/loader.conf.d/*.conf - - 4. And finally, rread local_loader_conf_files files: - /boot/loader.conf.local - 20240415: MFC e0f3dc82727f: If you have an arm64 system that uses ACPI, you will need to update your loader.efi in the ESP when you update past this @@ -53,9 +32,26 @@ and/or ports. non-compliant MTAs; please see the first 8.18.1 release note in contrib/sendmail/RELEASE_NOTES for mitigations. -20231113: - The WITHOUT_LLD_IS_LD option has been removed. When LLD is enabled - it is always installed as /usr/bin/ld. +20240202: + Loader now also read configuration files listed in local_loader_conf_files. + Files listed here are the last ones read. And /boot/loader.conf.local was + moved from loader_conf_files to local_loader_conf_files leaving only + loader.conf and device.hints in loader_conf_files by default. + + The following sequencing is applied: + + 1. Bootstrap: + /boot/defaults/loader.conf + + 2. Read loader_conf_files files: + /boot/device.hints + /boot/loader.conf + + 3. Read loader_conf_dirs files: + /boot/loader.conf.d/*.conf + + 4. And finally, rread local_loader_conf_files files: + /boot/loader.conf.local 20240119: Commit d34f4baaf138 changed the internal interface between @@ -77,6 +73,10 @@ and/or ports. sources. As such, __FreeBSD_version has been bumped to 1400502. +20231113: + The WITHOUT_LLD_IS_LD option has been removed. When LLD is enabled + it is always installed as /usr/bin/ld. + 20230924: Enable splitting out pkgbase manpages into separate packages by default. To disable this, set WITHOUT_MANSPLITPKG=yes in src.conf. @@ -311,6 +311,10 @@ and/or ports. belongs. Consequently, users may experience surprising results with such names when roaming to different homenets. +20211118: + Mips has been removed from universe builds. It will be removed from the + tree shortly. + 20211110: Commit b8d60729deef changed the TCP congestion control framework so that any of the included congestion control modules could be @@ -324,10 +328,6 @@ and/or ports. kernel and you are including networking, the kernel compile will fail. Also if no default is declared the kernel compile will fail. -20211118: - Mips has been removed from universe builds. It will be removed from the - tree shortly. - 20211106: Commit f0c9847a6c47 changed the arguments for VOP_ALLOCATE. The NFS modules must be rebuilt from sources and any out From nobody Sun Sep 8 07:54:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1j0Y5zJkz5WHT8; Sun, 08 Sep 2024 07:54: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 4X1j0Y57Ljz4Q8P; Sun, 8 Sep 2024 07:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IkE53rlfMUqFb4g7eW6NIsYdVzyV5sBUa4Vv+JsyMw8=; b=fWcP2WYPHFfQDKFyPXIWQQoXVMTtPTibwxv1yyprDZpYGnNSJ+a5BaSY2qGcvfGO/7bfoX AvOMoBwEAuZYyt0QdJv2i5NHwnuS2rt/XrCDtLD9PnPZF4BMdPcYk4Rm1IJdI6OaJSso40 qSrRNm4l90f2mYNkhJ4KP0NqdWBx2z7Ojnc49SFA9ICSANPfBL5P6wt6syYtWvcgJdkcaw vh9oSgxwyYZJ2irR0RxBZgmQeO5QBtuls5W2OYOyyF3RQNFaL1V2qtntHxxGb2QMfpM3WM VAlIo8xmq63rSyG49w0AoR4kKnRpAg8ttVlCUFJiiAAPN1bkS2IwK7X8oaZ+0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725782061; a=rsa-sha256; cv=none; b=VvfOvk6de2Oj6+Wj+kXeUwidaVdujlT8OWxoN8s6WFMx9k1eRJ4dQK2dxupA7CNr8tZTpW VdPMtQvMLzeW7AwC4iM5eEw7ICNIEYiKOcENBXb1GoDbFUG6rk4GGIdxaemmTMf1Qmradw a89qpfyBgX/EaczuIIVmdhcR43eFRW2sJePXOsWpl8hymkPMd/2x8U9GjbMD6XvA+3BAs6 iFQrxicI3ameeRGRf5OpNRbVP8aKUhP+Udz5dswwxK+PXkYklVnHL1G1iAQbZ37iyecdqK LY+pM01/wbHxzQdc8dfsatLEvIy5z7T/S3hEvk2NqRKhXw2vaEM3s7ZeayU/6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IkE53rlfMUqFb4g7eW6NIsYdVzyV5sBUa4Vv+JsyMw8=; b=DmXeh7umvnHvk1q9delsaG7uI1YdM5AVBNXTMDeoFyzKS9jLEz8GheMugM6bj43p6D3ogS M1JsmiQYCGnCJ0UJLM0U4YnFrvaWWLKklUog1KgLg1a7ebqbtu8WMhKoKA+JfwyZflJKW5 jGJobcYq5R6Jo9EQ6WLKB07LtppY4vHutatdsj2fPqwfq/2uD1pABLT/aVk1rqYIlXVNz0 f+NfamgiXMcE0X4DmKoO6LGQV8gr+7vK44zWp3XmCPTr57gEYpx3Tqu/V+8HaTaLi4gJn+ +hVa+Up71aWf6IC+SnOXyEQxeiTQLXe24CLOFbFAnETVhnQ1k+AHV/aTGrUGrQ== 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 4X1j0Y4j7Xz19xd; Sun, 8 Sep 2024 07:54: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 4887sL0h024099; Sun, 8 Sep 2024 07:54:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4887sLjk024096; Sun, 8 Sep 2024 07:54:21 GMT (envelope-from git) Date: Sun, 8 Sep 2024 07:54:21 GMT Message-Id: <202409080754.4887sLjk024096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 28ff3ab2ab06 - stable/14 - Add UPDATING note about running make delete-old after libc++ 18 upgrade List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 28ff3ab2ab064224cd1fc0885040c3c47ed5ef4d Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=28ff3ab2ab064224cd1fc0885040c3c47ed5ef4d commit 28ff3ab2ab064224cd1fc0885040c3c47ed5ef4d Author: Dimitry Andric AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 07:48:57 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days (cherry picked from commit 157802238b5aa7722aff40317fe6d05f5c975d71) --- UPDATING | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPDATING b/UPDATING index d6c2a930255a..d9804dce33e1 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,13 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240419: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 18.1.6. It is important that you run `make delete-old` + as described in the COMMON ITEMS section, otherwise several libc++ + headers that are obsolete and need to be removed can cause compilation + errors in C++ programs. + 20240415: MFC e0f3dc82727f: If you have an arm64 system that uses ACPI, you will need to update your loader.efi in the ESP when you update past this From nobody Sun Sep 8 07:55:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1j2D5hcFz5WHyW; Sun, 08 Sep 2024 07:55: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 4X1j2D4tZNz4RZq; Sun, 8 Sep 2024 07:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4+i9m4mi3OLoDSM8N/7lIXluP8/NQyXcos8ldF2doE=; b=tDD2MroQ0rD8uMehRN+GAN20j1xdrDxiKvGK1unVWD4utsZQjJNMPN6K/MMWW57yjnpDy4 adZ0rOEWOkKvlH5H01Rm7CpOAQChMrAdE+34CYmXto2nNZ89xdKYHWK9V8iwMnksbeekah RcPGtc3yMPKpCcqAXEnSMjG6h5tgpkQIGCF2OcbCZfHXa48fHF9HTPlJG8ASJ4WpELLJcO ScLhi8bai4tU1nhZiWPv9imdRxvego4/KLw+/B1aNjTlNQCNkCLJu010YMv9sTzrvZYEta xgrhVrgAJ5VzKW6Eu5/BKcZjJHeJMoVtPvnc3bIXYxp7Zz6Vqn553fiQY2RoIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725782148; a=rsa-sha256; cv=none; b=cgIciXNZqfcE4Y8UgLoLVWgpobiPB1rTVUWdfv/kddI7po2rOZV4fiblQgrvnZv1iPtoEw Vp8vILWkOLgM+uhPvjeF7j8ZQFAoiyv/JhWJMIPRUgR8CE734MvxCmJMBdK4kZkFVi/Dsn qVCfqQdAIGemz9678wcZFK3x2eGbJMX0dgGebFCH7AC1Ywqw87Z2lJbX/GgIwrOZXNKrLP q1gSOD7CFhWQkXvqcvVASPJlRxosKBRzZFyH0sHltLHPkdFJ0Vf8dyNrZ8nJ9C7ib56hj5 TDDwUxkUcglSgdAts2oUjl4epRYE7V+jds+PTVkpGs9Xe7bZYjLp9YDeEXlMRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4+i9m4mi3OLoDSM8N/7lIXluP8/NQyXcos8ldF2doE=; b=OXz960dVi07SzZLR/CCe9+0YUhFwX1vahHF5jOx6h0so4DcxjmQxNvb1Wb0CvMOXdzA2oT Ws/ybwdAS6o9rWvannTQktyHLX+q8e2cYWOB7Fi9n6v8XDnyvQmvmJGgJyaTBwonJ8bG0e QPJjjhPSAAa0MICkF8KUWdsnEWvVseTP9Im2H+1sJZxJZqBAQOmSrpJi7mzw3Qj5y44Jip 5MZAznZd7iGkK9YRoPGFXA6+z3HQS3CF5M2fEegiY0utUIz+17cbImkKfic57d3w4XFfgO 93tK6bD6wntJ1at2Gb8C6oXTkUhjNkM2SUf7HWfs5XVYJJ0ax76iHRwE1Yhz0Q== 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 4X1j2D4KV3z1914; Sun, 8 Sep 2024 07:55: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 4887tmpL024638; Sun, 8 Sep 2024 07:55:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4887tmHM024635; Sun, 8 Sep 2024 07:55:48 GMT (envelope-from git) Date: Sun, 8 Sep 2024 07:55:48 GMT Message-Id: <202409080755.4887tmHM024635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 75bca9e7553c - stable/13 - Improve accuracy of asinf(3) and acosf(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75bca9e7553c70d97b36df30ab05bbbbacb8a499 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=75bca9e7553c70d97b36df30ab05bbbbacb8a499 commit 75bca9e7553c70d97b36df30ab05bbbbacb8a499 Author: Steve Kargl AuthorDate: 2024-08-29 19:44:48 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 07:37:57 +0000 Improve accuracy of asinf(3) and acosf(3) This uses a better rational approximation to improve the accuracy of both functions. For exhaustive testing of asinf(3) in the interval, the current libm gives: % ./tlibm asin -fPED -x 0x1p-12f -X 1 Interval tested for asinf: [0.000244141,1] ulp <= 0.5: 97.916% 98564994 | 97.916% 98564994 0.5 < ulp < 0.6: 2.038% 2051023 | 99.953% 100616017 0.6 < ulp < 0.7: 0.047% 47254 | 100.000% 100663271 0.7 < ulp < 0.8: 0.000% 25 | 100.000% 100663296 Max ulp: 0.729891 at 5.00732839e-01 which isn't too bad given that much of the computation is actually done in double floating point. With the new rational approximation, exhaustive testing yields: % ./tlibm asin -fPED -x 0x1p-12f -X 1 Interval tested for asinf: [0.000244141,1] ulp <= 0.5: 99.711% 100372643 | 99.711% 100372643 0.5 < ulp < 0.6: 0.288% 290357 | 100.000% 100663000 0.6 < ulp < 0.7: 0.000% 296 | 100.000% 100663296 Max ulp: 0.636344 at 5.09706438e-01 Similarly, for exhaustive testing of asinf(3) in the interval, the current libm gives: % ./tlibm acos -fPED -x -1 -X -0x1p-12f Interval tested for acosf: [-1,-0.000244141] ulp <= 0.5: 97.008% 97651921 | 97.008% 97651921 0.5 < ulp < 0.6: 2.441% 2457242 | 99.450% 100109163 0.6 < ulp < 0.7: 0.472% 475503 | 99.922% 100584666 0.7 < ulp < 0.8: 0.071% 71309 | 99.993% 100655975 0.8 < ulp < 0.9: 0.007% 7319 | 100.000% 100663294 0.9 < ulp < 1.0: 0.000% 2 | 100.000% 100663296 Max ulp: 0.914007 at -5.01484931e-01 % ./tlibm acos -fPED -x 0x1p-12f -X 1 Interval tested for acosf: [0.000244141,1] ulp <= 0.5: 97.317% 97962530 | 97.317% 97962530 0.5 < ulp < 0.6: 2.340% 2355182 | 99.657% 100317712 0.6 < ulp < 0.7: 0.314% 316134 | 99.971% 100633846 0.7 < ulp < 0.8: 0.029% 29450 | 100.000% 100663296 Max ulp: 0.796035 at 4.99814630e-01 With the new rational approximation, exhaustive testing yields: % ./tlibm acos -fPED -x -1 -X -0x1p-12f Interval tested for acosf: [-1,-0.000244141] ulp <= 0.5: 97.010% 97653245 | 97.010% 97653245 0.5 < ulp < 0.6: 2.442% 2458373 | 99.452% 100111618 0.6 < ulp < 0.7: 0.473% 476012 | 99.925% 100587630 0.7 < ulp < 0.8: 0.068% 68603 | 99.993% 100656233 0.8 < ulp < 0.9: 0.007% 7063 | 100.000% 100663296 Max ulp: 0.896189 at -5.04511118e-01 % ./tlibm acos -fPED -x 0x1p-12f -X 1 Interval tested for acosf: [0.000244141,1] ulp <= 0.5: 97.650% 98298175 | 97.650% 98298175 0.5 < ulp < 0.6: 2.028% 2041709 | 99.679% 100339884 0.6 < ulp < 0.7: 0.292% 293555 | 99.970% 100633439 0.7 < ulp < 0.8: 0.030% 29857 | 100.000% 100663296 Max ulp: 0.775875 at 4.91849005e-01 PR: 281001 MFC after: 1 week (cherry picked from commit 41e016289f77deb88b0ef1ec3f7b2ab3515ac7c8) --- lib/msun/src/e_acosf.c | 20 +++++++++++++------- lib/msun/src/e_asinf.c | 22 ++++++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/lib/msun/src/e_acosf.c b/lib/msun/src/e_acosf.c index 29f6d4a78495..4c8bb05ef0a5 100644 --- a/lib/msun/src/e_acosf.c +++ b/lib/msun/src/e_acosf.c @@ -23,11 +23,17 @@ pi = 3.1415925026e+00, /* 0x40490fda */ pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */ static volatile float pio2_lo = 7.5497894159e-08; /* 0x33a22168 */ + +/* + * The coefficients for the rational approximation were generated over + * 0x1p-12f <= x <= 0.5f. The maximum error satisfies log2(e) < -30.084. + */ static const float -pS0 = 1.6666586697e-01, -pS1 = -4.2743422091e-02, -pS2 = -8.6563630030e-03, -qS1 = -7.0662963390e-01; +pS0 = 1.66666672e-01f, /* 0x3e2aaaab */ +pS1 = -1.19510300e-01f, /* 0xbdf4c1d1 */ +pS2 = 5.47002675e-03f, /* 0x3bb33de9 */ +qS1 = -1.16706085e+00f, /* 0xbf956240 */ +qS2 = 2.90115148e-01f; /* 0x3e9489f9 */ float acosf(float x) @@ -47,13 +53,13 @@ acosf(float x) if(ix<=0x32800000) return pio2_hi+pio2_lo;/*if|x|<2**-26*/ z = x*x; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); r = p/q; return pio2_hi - (x - (pio2_lo-x*r)); } else if (hx<0) { /* x < -0.5 */ z = (one+x)*(float)0.5; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); s = sqrtf(z); r = p/q; w = r*s-pio2_lo; @@ -67,7 +73,7 @@ acosf(float x) SET_FLOAT_WORD(df,idf&0xfffff000); c = (z-df*df)/(s+df); p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); r = p/q; w = r*s+c; return (float)2.0*(df+w); diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c index 391c15870f84..c8b0eb68c744 100644 --- a/lib/msun/src/e_asinf.c +++ b/lib/msun/src/e_asinf.c @@ -19,12 +19,18 @@ static const float one = 1.0000000000e+00, /* 0x3F800000 */ -huge = 1.000e+30, - /* coefficient for R(x^2) */ -pS0 = 1.6666586697e-01, -pS1 = -4.2743422091e-02, -pS2 = -8.6563630030e-03, -qS1 = -7.0662963390e-01; +huge = 1.000e+30; + +/* + * The coefficients for the rational approximation were generated over + * 0x1p-12f <= x <= 0.5f. The maximum error satisfies log2(e) < -30.084. + */ +static const float +pS0 = 1.66666672e-01f, /* 0x3e2aaaab */ +pS1 = -1.19510300e-01f, /* 0xbdf4c1d1 */ +pS2 = 5.47002675e-03f, /* 0x3bb33de9 */ +qS1 = -1.16706085e+00f, /* 0xbf956240 */ +qS2 = 2.90115148e-01f; /* 0x3e9489f9 */ static const double pio2 = 1.570796326794896558e+00; @@ -47,7 +53,7 @@ asinf(float x) } t = x*x; p = t*(pS0+t*(pS1+t*pS2)); - q = one+t*qS1; + q = one+t*(qS1+t*qS2); w = p/q; return x+x*w; } @@ -55,7 +61,7 @@ asinf(float x) w = one-fabsf(x); t = w*(float)0.5; p = t*(pS0+t*(pS1+t*pS2)); - q = one+t*qS1; + q = one+t*(qS1+t*qS2); s = sqrt(t); w = p/q; t = pio2-2.0*(s+s*w); From nobody Sun Sep 8 07:55:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1j2F5bc8z5WJBv; Sun, 08 Sep 2024 07:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X1j2F59S2z4RXT; Sun, 8 Sep 2024 07:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jzv80dq1oArdIHgcZDR1oKteUPuyOjB1ZiMtbrJENwI=; b=werqT8yyJ6JmvQWEPvJLh1RhKSesSSZHNUQzntGbF1F1wiarDoMAQOZGMGCWHu8K3uUZ00 DXgxBj+IShOTFomcRWC3Yja9dPHA8kkVEmQkfOEyu4ilMijTWd/BtblMkeAYcTh+Qo29DB YkkRZnI8A2JRZiQ41or1L2S1N26JiKtSCGnK8kTKl84w09aUGGHjIzPm4U+arIG50GPho3 DG5VtNlq1IXEj/kCoLDv1HmZk6T5gY5t6p4EyX/ZHQVd483X/SivwT4wRvyShoyKlQj/d6 MxNObiU3YMMUSp4TZQ0Kx8uXstUuxxCh+DgOvwUtwzTp09gBxGyC9f+BR9n1kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725782149; a=rsa-sha256; cv=none; b=oF6dQNES5Ph5mrzY7u90YmdOSUr3iDLcO1rVnjyOXxm8R40KeTKte4X4X+r80I8QwnI9DG VkP4eI4lL405qRyp4MPShDULEZp6Kn+6ANg0A3mnvirUXvGYU8E+d/eRK2fLewV1NcR0LI 3DAsEzACag01Dual39LwAFx1QI2EhVhEW35j96hG2bwjB+IUEgwEY67TDQetewhmgLu3nx YwYZsfDjZ9nUUhM2Wm8PTVohVRLT+tdNWknlzo9qiorT45NGuqZ14Jz4TbaGCnC18P+P3V tLo/bFoICQ0mQy/H8md2bBxV+3xmDxR60CbwBTf4Pa5hmNwKIwGeZcHkJp10RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jzv80dq1oArdIHgcZDR1oKteUPuyOjB1ZiMtbrJENwI=; b=gsXR/r6k59HTztI/7LheYOJkb+rVB3KaSXzVOn9AOiXLeMBnzi9bfcxwMxMtx8g61d+M+8 udxJbxWOtK+iGl9U2JFbN5JsJqXhg9BllFbX+J10YwoN43QrY0lvbsoZNMKFYPGh+UOCtv 96OixYzkB99nRUKSCHyXnWzLZN3hKtAj2zmHiclUtYZVuspYHTzXq2c8Bv5dZlMYkRv+1R hVYMC5NpBSlkntwGHiGGPUM2J8g0KrvabCS05RZyXz8o3UbY3ZCpftJuKk9hgzNzlNbOpf CzhxEfwG3f9iPmN/pmr8jGJtZlc4y0Wo5y+GDPPrnmI388e3uUrbbRaF41Peqg== 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 4X1j2F4mZ8z19k4; Sun, 8 Sep 2024 07:55:49 +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 4887tnEr024684; Sun, 8 Sep 2024 07:55:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4887tnqf024681; Sun, 8 Sep 2024 07:55:49 GMT (envelope-from git) Date: Sun, 8 Sep 2024 07:55:49 GMT Message-Id: <202409080755.4887tnqf024681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 837d998a6024 - stable/13 - UPDATING: keep sorted by date. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 837d998a602452ce9dc0b5b08f124c5e65bef4b0 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=837d998a602452ce9dc0b5b08f124c5e65bef4b0 commit 837d998a602452ce9dc0b5b08f124c5e65bef4b0 Author: Dimitry Andric AuthorDate: 2024-09-08 07:49:43 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 07:49:43 +0000 UPDATING: keep sorted by date. --- UPDATING | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UPDATING b/UPDATING index 974b0dbd30c2..75f04569de82 100644 --- a/UPDATING +++ b/UPDATING @@ -1952,15 +1952,15 @@ and/or ports. chmod, chflags, chown and chgrp now affect symlinks in -R mode as defined in symlink(7); previously symlinks were silently ignored. -20150415: - The const qualifier has been removed from iconv(3) to comply with - POSIX. The ports tree is aware of this from r384038 onwards. - 20150416: Libraries specified by LIBADD in Makefiles must have a corresponding DPADD_ variable to ensure correct dependencies. This is now enforced in src.libnames.mk. +20150415: + The const qualifier has been removed from iconv(3) to comply with + POSIX. The ports tree is aware of this from r384038 onwards. + 20150324: From legacy ata(4) driver was removed support for SATA controllers supported by more functional drivers ahci(4), siis(4) and mvs(4). From nobody Sun Sep 8 07:55:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1j2H2BWZz5WJ7S; Sun, 08 Sep 2024 07:55: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 4X1j2H0J9Bz4RHX; Sun, 8 Sep 2024 07:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pJAdRsJXLR9xpROFm92zq3bZ5jtxQhzKomajqicL2ec=; b=bBUgSfAphfo/1HcS5NRCotTyC8k2UYoA0QFIRt0ucEN9cIwTv1IFgAbvruziqiwAxgjEIK 682JNWqkHgzUaC/38Oz8vgdYcFsPlN+iLrnNFbL+xJFvKGAU2TSkSLGa0dBwBmn98nizVh Ya6+nRh2g6NdeH/57IYm6uFRnaJTWkgiNYIp5SgdCOPsPz2pNx1ZwDIg4u86bwKucKSeTe TVnh+9b3EhBPjh+PlQzliIZ9HrUFOlQlzSiG2i3E1lz1437nYc494gOj1wAMdbrlGpJ3Q+ mONISWugzKoipFILQwsdnOJpx55iwYUfQrucQVkTNxmSRtkJ5PcFlANsuKBZXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725782151; a=rsa-sha256; cv=none; b=mfW0DeHk6AFIWxngk95wBLaHtC8dzGusYwO+yZTn7QG/7jbHjlTNUDzxnNiqS2Py4PFDJ9 1ZufuUNr5/nglJ821yM6529JqkmkiHmkLFv6N4o+WtGwNhcrXewCxlTdyN/GsnWnDKdvi9 jmo9O/QejMmmgRZBEZefWL6ov6sBNAiwpWYxNLgDanlQT+uOW9KIJmV1zWKpHiwnhpTNgl c/wBZgFTiEF0gy9hsD61OY7Tc0/DPD2G45OiEsobzODkii3WjCwHMrgY0A/3uF5eZTv9HN e4b4WDQQJ3M8631MAXNWtnt+oF5IqwuGycalbyYc/lIXV3ilzaI530nJArWVYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725782151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pJAdRsJXLR9xpROFm92zq3bZ5jtxQhzKomajqicL2ec=; b=dhQ7fgJsPTEfV46bHYk2err9nOWq/fyVzpUf2pmqxcQc/jgqxcD/eksES5FQIB/dmq3iTS 5pYrm0XhzdQ7uQQn3UvsvoQCnQDr352FcW6idvFx87yWwcmK0advLzMKdsVeM7rUgmt2/D CXKCRMi6uPiPZM1Bmg3vah1mRdmhiBM+O+CmxSUG/uY1xWDh7SPMqhSgxAxVm4GqTtcfXJ ayLCNwnBhqr3Vvudba33/DK/yA9zQyPo0HfDR43m4A55Xay/KYKnpQsuKQ/DevMrXVLTbN Z02lq3SzyTgPJVdPUFKEY5xsXaImowhs6BDSMJCrsMtSWHbGDvYs1+umd/GU7w== 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 4X1j2G6p0tz19k5; Sun, 8 Sep 2024 07:55:50 +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 4887toOD024744; Sun, 8 Sep 2024 07:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4887toiD024741; Sun, 8 Sep 2024 07:55:50 GMT (envelope-from git) Date: Sun, 8 Sep 2024 07:55:50 GMT Message-Id: <202409080755.4887toiD024741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 6b147f693b91 - stable/13 - Add UPDATING note about running make delete-old after libc++ 18 upgrade List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b147f693b91f16db7ba6193611f6f4d2ed762a5 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6b147f693b91f16db7ba6193611f6f4d2ed762a5 commit 6b147f693b91f16db7ba6193611f6f4d2ed762a5 Author: Dimitry Andric AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 07:51:37 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days (cherry picked from commit 157802238b5aa7722aff40317fe6d05f5c975d71) --- UPDATING | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPDATING b/UPDATING index 75f04569de82..6331b1bb0da8 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,13 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240419: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 18.1.6. It is important that you run `make delete-old` + as described in the COMMON ITEMS section, otherwise several libc++ + headers that are obsolete and need to be removed can cause compilation + errors in C++ programs. + 20240218: MFC of 713db49d06de changed 'struct ieee80211vap' internals in net80211. Given we do not have enough spares and the struct is allocated by From nobody Sun Sep 8 12:05:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1pYp6t2nz5TfCc; Sun, 08 Sep 2024 12:05: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 4X1pYp55b2z4yx2; Sun, 8 Sep 2024 12:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725797102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djplIO87MtsGF9e+Gex2nyEagtQIuzt8w2Qzx+bvgQM=; b=p828z0XXfF7Z7XM36HK1WriflEe15jCFVRYdshZXQ6JimJoMp3MALTr+QpBgW8CZd3R0iZ jvoJ93lUhaCIj92R7yOIM29UazQCARsiWLeOIINcUmdbbdKUDhi7auwhPdtBdeV9UO39Vn 9rRNanccAg3vVWYfaHmYqHYWHpFsN+w2I0Ysnx+5V4suPSXRWEA3i4dlkv4jylDMB7mVE/ U2p25vXnId3gjExH1fmogWnhoUU+Idn9gBzPn5ks86iU0DdRl6dBsdZhZMZxnRswRMIQZL AvemZu25YTMyDz8sEfXUlKj17ISpfKTmrUWAYOvTiwGLHzp50AmXzJSEmf6mqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725797102; a=rsa-sha256; cv=none; b=q5xyzCXuVvalK9vieP4CTxWYnXQIOgkA8eDA8JuALiaoAWUdqmRC/HIxneYeZsw69mLVoX HavIP9ocWeKjim+8opjzq0YRglom7PHV9hL5R6hRfp6qF1zu1+RKUk9DcNmXsL5LpagFg2 Bi9jm58Rp/+TQCi8wy690I7e0ATDQSiYWwCXch0OWB2x6/dx2Oe5r9EUz+DkozPCaFJrD6 //fEzKN/r5oRlYZEzsWGQX5x+L3fQ+Is4GqPqpObMU7X09KmSFzDZ4lHHCubQ/BWytkOC+ K869saEX8rBIbguQYn/qyxmnMjdBLObpKE8XKTMe3aVPILHLqI00O9rMFS6fMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725797102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djplIO87MtsGF9e+Gex2nyEagtQIuzt8w2Qzx+bvgQM=; b=ctkJmtGW5ktwTU4UsNJWBMa1YgX+VSTQGlUEe0oheDvCQrH8pQQk/4rSczTmoOXDnm5FkF jO7xEbfNV8QHUePWK8tVdVbn/i2FfHKXM/Oxm6KS/jKhk+dz/6oDIXCGqdweT60BVF2FeT wL6DHtSrXmadzakAckF69m+DE6afhtGqLIB1lpm6G1uv6qCKXlgEGvKX94TZGTO7/BLru4 zx9uqEMUyEBbBEloT0RSVnhX8j+Uo6O13XogBaehqIClgZ9aF4PQY+i3wmvB3nhlxfM+mD wNcROJjGLA5HLObQiUMkWvUU3BGBCODINEQ5CTbb1cbJh+RdoGVL4hCgVcCN/A== 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 4X1pYp3xf5zJJn; Sun, 8 Sep 2024 12:05: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 488C52VL047753; Sun, 8 Sep 2024 12:05:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488C52mW047750; Sun, 8 Sep 2024 12:05:02 GMT (envelope-from git) Date: Sun, 8 Sep 2024 12:05:02 GMT Message-Id: <202409081205.488C52mW047750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1dfb2690ccee - stable/14 - libcbor: Ignore errors for unknown #pragmas List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1dfb2690ccee42c6af6320a2eb10875ae1c4bb0d Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1dfb2690ccee42c6af6320a2eb10875ae1c4bb0d commit 1dfb2690ccee42c6af6320a2eb10875ae1c4bb0d Author: John Baldwin AuthorDate: 2024-05-07 18:44:52 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 12:03:17 +0000 libcbor: Ignore errors for unknown #pragmas libcbor embeds clang-specific #pragmas that GCC then warns about. Reviewed by: emaste (cherry picked from commit 6ca0468a2f23c82d6cdde2af1a42b62af3664766) --- lib/libcbor/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libcbor/Makefile b/lib/libcbor/Makefile index 5ae2c34a5963..c9d86c0b95ad 100644 --- a/lib/libcbor/Makefile +++ b/lib/libcbor/Makefile @@ -30,6 +30,7 @@ SRCS+= cbor/internal/unicode.c CFLAGS+= -I${DIST}/src -I${.CURDIR} WARNS?= 2 +IGNORE_PRAGMA= MAN= .include From nobody Sun Sep 8 12:05:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1pZg0WMMz5Tdx7; Sun, 08 Sep 2024 12:05: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 4X1pZg012gz50Qq; Sun, 8 Sep 2024 12:05:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725797147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kECdeh9bQC5BxV6l4WIl29jss2iJ0vbFEm/Z8xnLigg=; b=fBPGax5EGkDwI10z6hCNS6Xoug/hkgpU2UmwjCVO+rcbDJfEopO27f6f0L0uaffeHz5WKv 5QFu+UvlZAZDWzjyDGjib/BzxejWrFxlsHFDIEdDAvxBmjwDHMdSyD0Z4YXIgUfr7hSOBK NYKhn+sbsM8cEw8wbKO4sxQDdlIGGZiGoceXX+Gcc5fvUNRkNaClMjQkVlE2chfwSGnrLo +JUE6BIHMK4FEVFqnKiiS5FOk6paezN6Mn7psL6iyRzGBsGdQ52JsSncqZOX+wKFj2+EGv msCqAwBA974gW6zDwgr2q8e5IvDpgtfuVq8LJKVeS13VTEWgLk2a+t1gZ/FEWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725797147; a=rsa-sha256; cv=none; b=lw/q1TIXCkDImCiaIYhtngc7+lFVWHMxOPVGffbzs2SH9flqIH+BrdVPBHsIyP1BvinG0O M5PJRESs+IX/dpj7BqEarRR3AKCzgPRm8Ew6nbDvMlvcHaJEN4YnsY6PZQVBDtAyxFWSn6 HqYbP/24jdaTljpqNWp+0TLFCap0HGUojXmpP5Uv9YJhXmyBTpG27T96p5ypNFuSyWmiKd ttJBEmAyVVUhH8+JD0va4G5LwXgfvtwG7TG7ghAoGx2RDAWVw2JOnFVPBphC9WisXaHHvf Szx8zvSeA6hIRJR2aQFkek9zgxQZVLHBxU4ghimcYyJnSuYWQDzrr1041z03Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725797147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kECdeh9bQC5BxV6l4WIl29jss2iJ0vbFEm/Z8xnLigg=; b=utigZ1kD81vFpyioucbje7AYa3hcZxCgVPWQGQ5S6yJDSmCw+vYIah70WI4IlPZKjlJTLc gq/LoywP5UvNnnEfAGgkGuBytllnyklAZhMxSsE281UPLJdvI7QmEw1uC/BqUJ/z9Z5gDr zwWi9CHw7F3GqVq9SddwtzmhrtPzFYaR/V8xIIJtwh5fbyFnnCw/l3aVx7/RRvKLG6SXPU x5no/kmHoHQOcZvknt2vgTJ4yX/7HJp+L4MYAKCoX6O26nE+iL/anH9O95gCH7h+SNVU9+ f6uAhXXJWn0Pr906dwNlVuNHOOYpYgegMz/b4apUEDusVUXoyssuycXq9eq9kw== 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 4X1pZf6dS7zJRX; Sun, 8 Sep 2024 12:05: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 488C5kpP048006; Sun, 8 Sep 2024 12:05:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488C5kDf048003; Sun, 8 Sep 2024 12:05:46 GMT (envelope-from git) Date: Sun, 8 Sep 2024 12:05:46 GMT Message-Id: <202409081205.488C5kDf048003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: b07e847dd98f - stable/13 - libcbor: Ignore errors for unknown #pragmas List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b07e847dd98f60433310a2380d6be2e7b23c42ae Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b07e847dd98f60433310a2380d6be2e7b23c42ae commit b07e847dd98f60433310a2380d6be2e7b23c42ae Author: John Baldwin AuthorDate: 2024-05-07 18:44:52 +0000 Commit: Dimitry Andric CommitDate: 2024-09-08 12:04:02 +0000 libcbor: Ignore errors for unknown #pragmas libcbor embeds clang-specific #pragmas that GCC then warns about. Reviewed by: emaste (cherry picked from commit 6ca0468a2f23c82d6cdde2af1a42b62af3664766) --- lib/libcbor/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libcbor/Makefile b/lib/libcbor/Makefile index 5ae2c34a5963..c9d86c0b95ad 100644 --- a/lib/libcbor/Makefile +++ b/lib/libcbor/Makefile @@ -30,6 +30,7 @@ SRCS+= cbor/internal/unicode.c CFLAGS+= -I${DIST}/src -I${.CURDIR} WARNS?= 2 +IGNORE_PRAGMA= MAN= .include From nobody Sun Sep 8 16:45:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1wnz5X07z5VPNK; Sun, 08 Sep 2024 16:45: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 4X1wnz4zBBz4SSF; Sun, 8 Sep 2024 16:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725813959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FQcXruEPDwdyYgeCA9VtFdILtqu0E+vp1XD3CBtFVrM=; b=cWdc0FoCxVoOxH0Gxyup8Br6azTINmD5ZrpYJLnmCnubgdqbW47mDNbK4omCjGEEPNZGDn c+lV5gAejQZE2UlBgeBOD470HyroREQZQ0cq4FcEoT88crYB4AqL4K6cdHqjakQ3Uyc8jn q+f6Fak7HVb85RY+ySx9fG3U6f63FK8KSUYtDKY+Fll7N24o5pW8ZAbaT0pCR7NVfZMzse Wf/aXoT0mDH2aveink8GPvtq8HOOZCq5vRUF8uxz/aXbwbQhcQjxpY4zlCsJmcsB99xBzI 3mAVxxVMe94I7NkL9ufTizqzmlWAwfkc+pJ59yMOqy1/up8j7WzF6e2YJD+0LQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725813959; a=rsa-sha256; cv=none; b=GrpZbpyXKyP4g8t6zno5JHa97FzKitBo4zky6kM16E7DFVjsG28ZjK3RQD1fxMtNnn1dCk ujSnHgeq0fBi7s7MfhkaSEmXjWaUULxyhmfWeN0hgW/w/ZG2wjM4/Z3xhoGNP+iEY89tQB OQAUuCkS221Jof+5OeNzXQ2RU1cqGVV1eu/KMNRZc2Re5viQ3QWLEOqBN50LVGN0e7jm7J 6qjW4+dA0nB3J02n5fE+S+SfoN5JKcAlDrHtzJuAmOHzr/GBDwc+UlRwY5ulAaip2yohvN xCPWBgxUC4e1zMz0YigWV+TIeNmJ7vgYIuhgWPuz8z8WG3jR+GgNmSTofIxuKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725813959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FQcXruEPDwdyYgeCA9VtFdILtqu0E+vp1XD3CBtFVrM=; b=C5lMzsdkFa4E1/RPGxipwKuDHk1NiXW+y2eyq6fitP/61+Hh6kgsIIWodudZmPCcqPUs5l BsRLp2XktuSvs+jJ2oGsr3NPFctw0AKmGtcI2wOhqwgOw/06owuYGIEsRwZOp28SCwR/Gf wfId3IW90NVZuLoRZwwHKNBlrYHqQ/d0kDbQXzehmZuTSlSuIp/+l7fxs4/lxePj5FOzU8 fgKEBh2SbTijO+UzzLKiwf8BhjSUvJZKZnN6VAGPk/Czaxu1LDYOqqK/80HybOmPtucsqh GsbZBmGeHqSyPtqM+lYgd0eCYJG4bdPpIx86JSs9D4g8IEpMyVKj/zMDCSnyFw== 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 4X1wnz4ZVWzRdR; Sun, 8 Sep 2024 16:45: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 488GjxSI022913; Sun, 8 Sep 2024 16:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488Gjxun022911; Sun, 8 Sep 2024 16:45:59 GMT (envelope-from git) Date: Sun, 8 Sep 2024 16:45:59 GMT Message-Id: <202409081645.488Gjxun022911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: cab90be6a580 - main - openssl: Remove the specific version numbers from the instructions. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cab90be6a580a23351d46324550a0323dc9cf7de Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=cab90be6a580a23351d46324550a0323dc9cf7de commit cab90be6a580a23351d46324550a0323dc9cf7de Author: Gordon Tetlow AuthorDate: 2024-09-08 16:45:31 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-08 16:45:31 +0000 openssl: Remove the specific version numbers from the instructions. --- crypto/openssl/FREEBSD-upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/openssl/FREEBSD-upgrade b/crypto/openssl/FREEBSD-upgrade index ebe2d85bd8f7..86e65e8e07dd 100644 --- a/crypto/openssl/FREEBSD-upgrade +++ b/crypto/openssl/FREEBSD-upgrade @@ -15,8 +15,8 @@ 02) Download the latest OpenSSL tarball and signature from the official website (https://www.openssl.org/source/). - $ (cd .. && fetch https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz) - $ (cd .. && fetch https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz.asc) + $ (cd .. && fetch https://github.com/openssl/openssl/releases/download/openssl-X.Y.Z/openssl-X.Y.Z.tar.gz) + $ (cd .. && fetch https://github.com/openssl/openssl/releases/download/openssl-X.Y.Z/openssl-X.Y.Z.tar.gz.asc) 03) Verify the signature: From nobody Sun Sep 8 17:59:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1yR60Ymcz5VZrj; Sun, 08 Sep 2024 17:59: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 4X1yR56rk5z4jFP; Sun, 8 Sep 2024 17:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725818386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z0kIndkGz/WdDW7FVrDcmo/VI9TdB2UwGVUkZYFqKoE=; b=b49F2PUtfE7buWXips4CPi9B8xdE4BmFS4PnmXpUJckZ7XTaOrCw3y0OwWGL8vJVVfMFyE 3hGsYcFg7br/9dghURLhbkMz68LeYvt1o+JeLNbE87qH25S5V2Vu38FUybS85BkbWoG9C8 KVpZxFz0cFvMxKqdZCxUL2s0A8NV78LaFHDj8CZPnIeTcVjP02YMdvkE0FJpxn58PYPIHt rVrrarovHcxgDmeOgCo5gEPx5NLjXYo4lwLQCx8FLKIODas9YMysYg4qbeo/HVRWrjo7D4 V8RoH1lDLgKhO/knIedmcY5lt84mfKjMSxHOjZntLmhQWwa4zdhkCjJTI5zT3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725818386; a=rsa-sha256; cv=none; b=G8q7PUtkdu7p3imzw5tn/sUiHLbA5qwALjqSP6dSmU3VEjuM8tIbPWs9D7rkyWqT8462mz IpBDcPQpuvvgM+LfeGBP0I/bMND7m4xfGUaXsBGeWnQMaeokL3AlbO/YrjdAeMlPReCQvz fMh6cNMqKqSdAmZ7twF5se7U8dY9+uH9nlOb0AcTKtWoLAOkCoZPlHky5iVsqGC49zxhoV wxS8KKqNnycNsbo7lbcjZ1kzB2mzp6OPzst65r3ti5p1sQmmtfX1n11fcrFaqTsmoSBK9g 7Be3Ou9oyncYURKBpkQ4MI4mRVyV/sA1d9k9kQrqD5klcSxDojZGwvdaAw80+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725818386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z0kIndkGz/WdDW7FVrDcmo/VI9TdB2UwGVUkZYFqKoE=; b=PC5R8ydu59vsD3/slPMXtOyxpC6IC66LMt4Y/UBgVDyuSTvdE3WvjfuCrbBUFV4hloK5sw Aq4d2N808wsdHHXIoKNbYZxX0vPwY6HC82EUvkbUwDhIhMXyKFeT85YSPVWGNymVPQZ1sd prvuF7yze+czu8biCJtbizzk+ovYKW04eIJBYOzpkML7IirJJITnR3ZXeBZ5Uv7eAqVsEG qSvNpR0del0eRMn3fa5hQ3p2LiEePQqq4kYJKPZvqXBsmdbeZ/ExCPqCoWKMWxgFqDKPs6 T/mt9uCTq3T6iLftwnOcAFPTLzY2GH/QYNUhVZxYQZ33yEEPiEI70kkmjWUnyQ== 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 4X1yR56RrnzTPm; Sun, 8 Sep 2024 17:59: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 488Hxjup043798; Sun, 8 Sep 2024 17:59:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488HxjIQ043795; Sun, 8 Sep 2024 17:59:45 GMT (envelope-from git) Date: Sun, 8 Sep 2024 17:59:45 GMT Message-Id: <202409081759.488HxjIQ043795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a05decec2d19 - main - if_ovpn tests: allow these tests to run in parallel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a05decec2d194821f8bf5c8f2ae72063de0c87a8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a05decec2d194821f8bf5c8f2ae72063de0c87a8 commit a05decec2d194821f8bf5c8f2ae72063de0c87a8 Author: Kristof Provost AuthorDate: 2024-09-06 16:47:06 +0000 Commit: Kristof Provost CommitDate: 2024-09-08 17:56:20 +0000 if_ovpn tests: allow these tests to run in parallel Now that kyua can isolate tests in their own vnets we can run these tests in parallel. Reviewed by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46600 --- tests/sys/net/if_ovpn/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/net/if_ovpn/Makefile b/tests/sys/net/if_ovpn/Makefile index 823ad06e76ee..85746226e122 100644 --- a/tests/sys/net/if_ovpn/Makefile +++ b/tests/sys/net/if_ovpn/Makefile @@ -6,8 +6,8 @@ TESTSDIR= ${TESTSBASE}/sys/net/if_ovpn .if ${MK_PF} != "no" ATF_TESTS_SH+= if_ovpn -# Tests reuse jail names and so cannot run in parallel. -TEST_METADATA.if_ovpn+= is_exclusive=true +TEST_METADATA.if_ovpn+= execenv="jail" +TEST_METADATA.if_ovpn+= execenv_jail_params="vnet allow.raw_sockets" .endif ATF_TESTS_C+= if_ovpn_c From nobody Sun Sep 8 17:59:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X1yR72zjSz5VZxc; Sun, 08 Sep 2024 17:59: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 4X1yR713HLz4jTC; Sun, 8 Sep 2024 17:59:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725818387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hYz4rO6RnE84q3LMh/LWHyqwalT8KQr/SgWoZNaiTlU=; b=TxL5fH0buddw0P6jzRNa1u6e6sazdFoHnG7Q2nfhOtxOlFWR9JOJAhFzpLeR6ru26YKT5A ib2wxhthyea31jXmfiuLPI6Ubo28u2U7U5HDVI07iv2nZXy9reB9EnXAllKSkoNI72YZAF KFWCzoFBP9Jfatwx0MVONiY02sLtLt0r9zYFjy3w0LXDk7fVB+oQY9qij/I8cK6K0LYBvp FX+5WKI0Rt9eSMlMoruq4eUBS3gM8t2iW9cdQsjcUDlvyuPg7k8E0vfs51lZ7xzuC6c+9Q VI6iNaTE9pt/T8Ur9GIPy+Q8+DFhLdmqU6qib5Ir3C4MQDYD9Cgor/x7a47kHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725818387; a=rsa-sha256; cv=none; b=gYzFx51X4NHLV9T8EkEtF1P3RepMvyjRUW4HtIEeEJDxz3UwmnTtSrkx27OLRsHl9Z2XRd QQX0GlVszMqFq+3pmIOGzOx4Esq6DM0Myda6KRxbLPXRBL1CiaH7FMucml1Zfq0ZFsBqWk a9YFPXJn+Jj2vnaeu0eWv0hJzRgLczi5DbJv3S8IFa26pX68r/8qnCeyRIzL/6ADVPY+dY j4Llyjy/GHYgyU1PVK2sffG8GXEE2bRQW7HA/ATevOHYkKEHfLfM5Oj62/sLUkKe2v2ILz 3/466pGFmBE66uFSw+AChrwrA/b1Yzfuk+gpS1scyxOdp4ibKs8t5cX/B30EQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725818387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hYz4rO6RnE84q3LMh/LWHyqwalT8KQr/SgWoZNaiTlU=; b=GIdLQq+hR+vJe7uNJlehB8lASJIMvuGODDLURhmtpEDMUMWD7qv9SSmOycDClYm69Z7Wqq xO+2zoEZGAtNXLKuGNYU3VXobKAfY86H9nuJ1x4I99F+qOlxD6Wkr3MY8s98LXBMu+dmTk z3Y8q8IZlw1rrng93/yvwt8m2fvh7u4Go1dPQp2nq5HqgBVjOAV9drRMLHbvnvHTPwhAB0 dBUT6PC+WUnHeayn9/5PZPUmW53BdC3rhnZAO4/U+7z2uR8joe0pEUQVFaJbCU3l0nJ7ZW QJcLEvxQYGvlyZgsVj2Vpgbp/b+4ojP5B63y1dmPzcLddvxHSbhtwCPpm45VDw== 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 4X1yR70fT6zTcH; Sun, 8 Sep 2024 17:59: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 488HxksX043849; Sun, 8 Sep 2024 17:59:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488Hxk9h043846; Sun, 8 Sep 2024 17:59:46 GMT (envelope-from git) Date: Sun, 8 Sep 2024 17:59:46 GMT Message-Id: <202409081759.488Hxk9h043846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 550133f1d488 - main - pf: ensure we exit net_epoch if pf_keth_anchor_nvcopyout() fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 550133f1d48882418d4ef6205020b8e06cfd23ec Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=550133f1d48882418d4ef6205020b8e06cfd23ec commit 550133f1d48882418d4ef6205020b8e06cfd23ec Author: Kristof Provost AuthorDate: 2024-09-06 14:47:27 +0000 Commit: Kristof Provost CommitDate: 2024-09-08 17:56:20 +0000 pf: ensure we exit net_epoch if pf_keth_anchor_nvcopyout() fails Reviewed by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46599 --- sys/netpfil/pf/pf_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 64086bf08871..8d18da6cf0db 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2951,8 +2951,10 @@ DIOCGETETHRULES_error: NET_EPOCH_ENTER(et); PF_RULES_RUNLOCK(); nvl = pf_keth_rule_to_nveth_rule(rule); - if (pf_keth_anchor_nvcopyout(rs, rule, nvl)) + if (pf_keth_anchor_nvcopyout(rs, rule, nvl)) { + NET_EPOCH_EXIT(et); ERROUT(EBUSY); + } NET_EPOCH_EXIT(et); if (nvl == NULL) ERROUT(ENOMEM); From nobody Sun Sep 8 19:43:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X20l041BSz5Vx0P for ; Sun, 08 Sep 2024 19:43:40 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X20kz2tcpz4Cr1 for ; Sun, 8 Sep 2024 19:43:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=F7PXuGIp; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::d41 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org Received: by mail-io1-xd41.google.com with SMTP id ca18e2360f4ac-82aab679b7bso41744239f.0 for ; Sun, 08 Sep 2024 12:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1725824618; x=1726429418; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=J6KwfeD0oXaojneNKnuqFwywfEpZ/gp5d+aMWVjj8IU=; b=F7PXuGIpn5OwWmZTfYw3WQceU8VYgCLfudKuMW66ueWaa5+QdcxsWioBp+z/eWyqrx 7g4S/aVaMb5x4i3mlgGy9bCnjAdtUwSfDYDyf+SukBv8chhhkN1t8GFcEpWVkDVpjEpc 8IcePvmCQWmfTOqh+CJ/80BNw4utZNVzk+4nbkPVRkoy0PtZyS3tHEqKaHZyvQcrCM6B hfAMu8dRm3qFBy3pJRL8FRYGqO1IHibXIqZdVOLhjYO6X8MdDxUPp/ru5zMr4j181qSa rVZdXyqNkfRY0ZYLdRjkhQMaCfNZheYxpTXK1wYLwRYT0sQftTcAsFARUuz04OZFfOMY wolg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725824618; x=1726429418; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=J6KwfeD0oXaojneNKnuqFwywfEpZ/gp5d+aMWVjj8IU=; b=f7ZbnvzPz8LqLUjI6lk/UaJHyRnJFMT97455MIxNr+UXf/pSS730FgnLVjW1Tq0DSI 7xLe8NhDRQq0S88afIT2wy9Nxf5dJlNZQn4MpR4UBv0nMQiDP3i0taF3PSMzTrYzwF4K CVFmUIVPUW1aRxLF4GXk5ZRhikZiq9i5vr2XnztdWP5FMNfWalW9PERPhQ58eQ+p8ZqS 2w7umeUTDIwDU7ivz+FniiRnBMEPpu47gk2B9saQzYvYyGSvDXaXAbsbfMqUedjSh1xo X7S0Sp7b45DNyu+57Ox2YQJm6eh9TcMsm2byrAHsziJHDu6zmRmH349dU8I6Y9S9s8HU tKJA== X-Forwarded-Encrypted: i=1; AJvYcCXuG39GsJwfgzbG66BCm1Eo9fRj0w4a6MBhAlA/0mjlPUMBO/gO3WaWQWvk/HZfuO63XNAsJMs1GdUzTBF5XjibGZHr@freebsd.org X-Gm-Message-State: AOJu0Yy4ME8RD/SV0nlLFehoCIoaPr+7tyh4Dhc6PFgjPfxEtL0/4VNR ZPX5HN+YiHZgti9LEQNyITmHD/JKFSizFHQUcjNU64/9FC0h4/4BbELQ5BTIxsc= X-Google-Smtp-Source: AGHT+IGSpn8o1k9NfZH7WInrlyPvcn3YcUUmDvUhdq1QtqlXUtfoRn2xWizdOzuOw91rlfRxLercDg== X-Received: by 2002:a05:6602:1607:b0:82a:309c:488f with SMTP id ca18e2360f4ac-82a962131b6mr660144439f.12.1725824617743; Sun, 08 Sep 2024 12:43:37 -0700 (PDT) Received: from mutt-hbsd (174-24-73-190.clsp.qwest.net. [174.24.73.190]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d094562512sm763555173.60.2024.09.08.12.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 12:43:37 -0700 (PDT) Date: Sun, 8 Sep 2024 19:43:36 +0000 From: Shawn Webb To: John Baldwin Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e962b37bf0ff - main - bhyve: Do not enable PCI BAR decoding if a boot ROM is present Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> <7213e551-6be2-44b1-a8b6-55645c593c12@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d3c3vavkuh42wyjl" Content-Disposition: inline In-Reply-To: X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.08 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.977]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d41:from]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[hardenedbsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DKIM_TRACE(0.00)[hardenedbsd.org:+] X-Rspamd-Queue-Id: 4X20kz2tcpz4Cr1 --d3c3vavkuh42wyjl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 06, 2024 at 04:30:07PM UTC, Shawn Webb wrote: > On Fri, Sep 06, 2024 at 09:37:45AM UTC, John Baldwin wrote: > > On 9/5/24 22:10, Shawn Webb wrote: > > > Hey Mark, > > >=20 > > > This commit seems to force me to now pass "-o pci.enable_bars=3Dtrue"= to > > > all my VMs on amd64. I wonder if that might be a POLA violation. I > > > didn't realize that I needed to set that until I bisected the src > > > tree, looking for the commit that broke bhyve for me. > > >=20 > > > Is changing the default here really worth it for amd64? If so, I'm > > > thinking this should be in both RELNOTES and UPDATING. I now have to > > > propigate re-enabling this across my entire infrastructure. > > >=20 > > > Thanks, > >=20 > > That should only be true if you are using an older UEFI firmware that d= id > > not program BARs. Are you seeing this on stock FreeBSD, and which vers= ion > > of the UEFI ROM are you using? >=20 > Ah, thanks for the hint, John! My UEFI edk2 bhyve package is years out > of date. I guess I need to pay more attention to what `pkg upgrade` > does NOT upgrade: >=20 > hbsd-laptop-02[shawn]:/home/shawn $ pkg info | grep bhyve > uefi-edk2-bhyve-g20210226_1,2 UEFI EDK2 firmware for bhyve > uefi-edk2-bhyve-devel-g20190424_1 UEFI-EDK2 firmware for bhyve >=20 > hbsd-laptop-02[shawn]:/home/shawn $ pkg search bhyve > edk2-bhyve-g202308_5 EDK2 Firmware for bhyve >=20 > I'm building some packages on my laptop right now. Once that finishes, > I'll go ahead and upgrade to the new package, retest, and report. >=20 > If this is indeed the problem (I suspect it is), I apologize for the > noise. Thanks, though, for the hint and the help. :-) The issue was indeed the out-of-date EDK2 UEFI firmware. Sorry for the noise, but thank you very much for the hint! --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --d3c3vavkuh42wyjl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmbd/mAACgkQ/y5nonf4 4fq+Sg//eq8ePmxbzQh8ANFUeX6/XdsLYeorRytMRaoea0ZnKfey+H0X+/pRDTkz NLbfmwKDf2PmpLCVODwPpP4b8D+yhTlV87eTqFfb32xa+uptTXHeXnFkb7JTy3wm GqJHOPAcI033voDo9ch7hFVxPOpGaBIMVjUXlsJz/u+8M3JPTWWIM+LBz1+O6mQB L/jE2NcbVdwoocljz+mlAwK7mfaQPcckAWHf5Sy/eP55cMyKdH1glfhcRRW90HRS U/E0+dLD5bwbsSpHj4yArp/7nYwcMjqbB5FZX7hloTpvRq1XLxFkTxKP0SUZwWtA r0pAg9LxSVOPar3hchPpg8Wbvs+0FxE0CnaE2mVmD99VxAaUQFuKmPYhij6xvWlo WL9ifridoKKQePczhFUW+dLXG3ev56bFDzGIjIlWbeusPGjI0Z1POa5YV8LYE/q+ ltKFVwyHDIGUJFB1HJIc6QAshExp8tYoBG1jxR4n8zDUBLR2ETuFAZF6dc4fZ/LA p5G8HuiEOQJgzHzb6zKlOwE2jsc9W/yTBU42ng4OUdAgaL7+/YhfZdEUk7g/Y48P DYLAcOPWYnah53HF2QnJ8Z96jyXdjorJtdkOpUHCYpEk0mLWeL92WxBe2A+HSSJz Z/BAttQC84RGi3EBru5iiA8vs/u/kgszdRaHFJtxH8k0nnj9bPs= =sUwR -----END PGP SIGNATURE----- --d3c3vavkuh42wyjl-- From nobody Sun Sep 8 20:50:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X22DY0vKmz5W5Qs; Sun, 08 Sep 2024 20:50: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 4X22DY0Q5vz4LXh; Sun, 8 Sep 2024 20:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725828653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w9eYiLxI+yHEeY+7gY2/YVuRk24NR6StRmD4F5I5Nps=; b=Z2Hi9PnT6Ep9XdIBbcIortX2AVZKxWQVThI/7vI3UIa23pnoUCnsxbtIDYITvG+DIj3f69 BNaQxAa8yfpuZFVu59lDPk4wR6l1lbjUpJXRH73lIS8LQVmZYHQNJatxz11B7vaReIL06S l4k6FL/c+BHyUztDvoMP4mbd0GtZJCGOQrFNXLDjfvPJ3I4hBa018tMPoSCIXpoo8euVOr ZddhSkEEYS8v2dBfZotHfccR4Yt+37p9y9p6khDUlDeOAcPCy8fdTr1oMbWcPrz6X1ZzXL 1kwXUlBpaiNW18DdCp8M/cCTWNA6Cqe/j7HpQKdHk8zx7A3gKNdML9BxybNlGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725828653; a=rsa-sha256; cv=none; b=Xtqkc5YM0Afx9ZExTF9gMcHesoIfbrXpcfQabV7VS2pCGvDWqK6MBfY8+KAhBZ6vGiPuTH 9Drjs5nGzV/Ohlge9KGYBQbrL/srLeWyIF8hjTNRgp3Mn0Zr7zop2kntuxq3sc1J95VsZ4 bdGeu+nQma1YCsHov2Ch2K+uTZEJXHVy0pMEFd84/ICrrLEF+UvA9t0AarScAnBL+qEuvJ Oi1khGvV3tfILzjKoJvy3QXubE9b6WsfaP3WoAwbOcJmsQlfvVDscOMhGCI5A78ts9issz /Ig/G9cRt6V++K+m3/24R3000k42BFkohfjmaJqpOyKFiXrRrQMCfkIk+R26XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725828653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w9eYiLxI+yHEeY+7gY2/YVuRk24NR6StRmD4F5I5Nps=; b=Kfq4o/Ze28IQfm7Ud0qCn0lQ4007QDn5Nz8tRnPZbVhXdgvVZ9hVAR4ERxMJNC0/d/WZGe vS4SabJaTDM1AVZE670YW5iCh+dEeohgOdu/VEm/rkXU+yURrvl6OeNWlyZdIR6bP+stJR Xv8ubzKFX/iuZXJiA+RBM/MAP9m9GY9bkc5ZTqhVrW7aMnk8+ElywOc/jbSCNe84xR4WRk kG2PTWnsuEU8Ek6KjqZU8vyUZHMRX65TIxTyFv5LDwDK4WNErRkj4NsE7xXYvx94Uscvb+ zhXNgS4HgEpm5Z/m9pEy1f879HtqKd3xR2RthA1XNxk/0TUhertnJXWqj5gk9A== 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 4X22DX75C9zZXP; Sun, 8 Sep 2024 20: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 488Koqh8079351; Sun, 8 Sep 2024 20: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 488Koqi4079348; Sun, 8 Sep 2024 20:50:52 GMT (envelope-from git) Date: Sun, 8 Sep 2024 20:50:52 GMT Message-Id: <202409082050.488Koqi4079348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 967b3685a44e - main - nfs: spellcheck a comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 967b3685a44e6a6b0d154c0954d48c6a117e91e6 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=967b3685a44e6a6b0d154c0954d48c6a117e91e6 commit 967b3685a44e6a6b0d154c0954d48c6a117e91e6 Author: Alan Somers AuthorDate: 2024-09-08 20:47:52 +0000 Commit: Alan Somers CommitDate: 2024-09-08 20:50:27 +0000 nfs: spellcheck a comment [skip ci] --- sys/fs/nfs/nfs_commonsubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index f0469958a43f..47ab4958f9c5 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -3437,7 +3437,7 @@ tryagain: /* * If an '@' is found and the domain name matches, search for * the name with dns stripped off. - * Mixed case alpahbetics will match for the domain name, but + * Mixed case alphabetics will match for the domain name, but * all upper case will not. */ if (cnt == 0 && i < len && i > 0 && From nobody Sun Sep 8 21:34:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X23Bj6DWjz5WCcG for ; Sun, 08 Sep 2024 21:34: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 4X23Bj5T22z4XVm; Sun, 8 Sep 2024 21:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725831261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9En5xFPhTjDg5CE73OVoJ2irBDRR6SGP93kLMDfLvYk=; b=lMo/Lj3lm2p4e5eBsIHKVCkaIWwvlMQ6qM3c+Tot2I50p25nfu7S9dx8PyN7s6gBI57zQZ JYqTgNsfC7NunH8pOphpNY2Mls9vZkk6VvL9eQo5BUUHPuhOUcBLIy8Ol3fMnhb8KLEeyI +igfx+T7yFg1oaQLPK8fYXliLxLqEjHjZineVMMSNE10s1mMWLbmmFDqmpAb2+QsSPlMjO saiYUQ0+e5n3z6tgA5NfRWX4kbqNGDSyg47SLKRSBPZg7UE5LNF401ifGZV/sac8zWm8Ib KYuKgkFNQWCj3HTyfl8DPktxdytDcqKqqcunUevnlqPyLNuMHTbyKOcfff4Dgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725831261; a=rsa-sha256; cv=none; b=HVWY9PDxWoJ+pvM7QIO84hhQJh/S0OPbVSYUoZaMqONV75NnsKcQEX6bwlplXfquFjIfQi U0fkP/x+nsUGlQGubqLWHX5UE6TJ9cTmjtR2A1ysPa5h/F3EN5RkSia4nq+R6QI3GP6igh DmaUDtO5q1CmHSWLaHIkMuvwp/2FVgKV10iF+5K9R3r91/rJMcRW8GTT4xHuCCbzW5B9da VfIOKFypG8oiuFat43i7C7ag7pP3HGb1HYC0Mo0bwhQpJOgP36NyLPtzu1FdBny+/Ybhi9 tbd83IN5wzrM3IFYnwZ2aVh8+/15zj2/qZ0Gv+Lc3rz7hEe4jUxJEj1a08+Wuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725831261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9En5xFPhTjDg5CE73OVoJ2irBDRR6SGP93kLMDfLvYk=; b=L0MS/0UIsXgOccMgz2eVHbkvZm/X0sf5HUgyj8Sp3UCI24CzbBnDWeuZZc+3VJOvN8NkMX 2voJL2DK+31WAgOa5Dx6jT1FUMIPaW1RpM+fGjz2eenbKvqoJwoaUxJSVZBSwVhb+KvirG A8DT9EFPWYXCweJQIzIytT1T2bKZ3qupsW7T7EcvDw95BZxPmXUJ+V3K1LeyMRlyk4Bd7f 7bkclu7/wxTTVWTQToziiy++x4GvYiogh1cYEolaDR7y9T1/tsdN3kQfS0iBRebkZLvZvj XGn4DsCF/nvBF0dAmVd2Kku5g3yc98nUbQtwxavSnx8FQwFIcakSjqKEWR2eIg== 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 4X23Bj54F8zbxr; Sun, 8 Sep 2024 21:34: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 488LYL1M055377; Sun, 8 Sep 2024 21:34:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488LYL6Q055376; Sun, 8 Sep 2024 21:34:21 GMT (envelope-from git) Date: Sun, 8 Sep 2024 21:34:21 GMT Message-Id: <202409082134.488LYL6Q055376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: d2ccc2155217..b109925820fb - vendor/openzfs/master - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: b109925820fb79db3e37670c159977f03edd950f X-Git-Oldrev: d2ccc2155217bfdd7e19db4480d981a8f3fad46f X-Git-Newrev: b109925820fb79db3e37670c159977f03edd950f Auto-Submitted: auto-generated The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=d2ccc2155217..b109925820fb 83f359245adc FreeBSD: fix build without kernel option MAC 963e6c9f3ffc Fix incorrect error report on vdev attach/replace f2f4ada240e3 Linux 6.10 compat: fix rpm-kmod and builtin fb432660c369 Linux 6.10 compat: Fix zvol NULL pointer deference 5807de90a141 Fix null ptr deref when renaming a zvol with snaps and snapdev=visible (#16316) bdf4d6be1de8 linux/zvol_os: fix zvol queue limits initialization db2b1fdb7966 ddt: add FDT feature and support for legacy and new on-disk formats 2b131d734577 ZTS: tests for dedup legacy/FDT tables d63f5d7e50b6 zdb: rework DDT block count and leak check to just count the blocks d17ab631a914 ddt: rework access to phys array slots 4d686c3da53d ddt: introduce lightweight entry 0ba5f503c5d6 ddt: slim down ddt_entry_t f4aeb23f521c ddt: add "flat phys" feature 27e9cb5f8022 ddt: cleanup the stats & histogram code 592f38900dc2 ddt: compare keys 64-bits at a time, trying to match ZAP order cbb9ef0a4c8e ddt: tuneable to override copies= on dedup metadata objects cd69ba3d49cd ddt: dedup log a1902f49509b ddt: block scan until log is flushed, and flush aggressively 0d2707815d34 ddt: lookup and log stats a60e15d6b980 Man page updates for dmu_ddt_copies 77a797a3823c Enable L2 cache of all (MRU+MFU) metadata but MFU data only 06a7b123acaa Skip ro check for snaps when multi-mount f0ad031cd923 spl-generic: bring up kstats subsystem before taskq db40fe4cf625 spl-taskq: per-taskq kstats 3f8fd3cae081 spl-taskq: summary stats for all taskqs 816d2b2bfc25 spl-proc: remove old taskq stats 8e6a9aabb1e4 linux/zvol_os.c: Fix max_discard_sectors limit for 6.8+ kernel a2c4e95cfdf6 linux/zvol_os.c: cleanup limits for non-blk mq case bbe8512a93b0 Ignore zfs_arc_shrinker_limit in direct reclaim mode b3f4e4e1ec93 abd: remove ABD_FLAG_ZEROS 2b7d9a786346 zio: no alloc canary in userspace 7a5b4355e2e3 abd_os: split userspace and Linux kernel code 5b9e69539249 abd_os: break out platform-specific header parts b69bebb53557 libzpool/abd_os: iovec-based scatter abd 9e15877dfb3e Linux 6.10 compat: META ba2209ec9e21 abd_get_from_buf_struct: wrap existing buf with ABD stored on stack 5eede0d5fde5 compress: rework callers to always use the zio_compress calls b4d81b1a6a8c zstream: use zio_compress calls for compression e119483a95e8 compress: remove zio_decompress_data_buf dd0c08f9c65c compress: remove unused abd compress prototype 522816498c0e compress: standardise names of compression functions d3c12383c95c compress: change compression providers API to use ABDs f62e6e1f985b compress: change zio_compress API to use ABDs a9c94bea9fb3 zio_compress_data: limit dest length to ABD size a537d90734a1 zstream decompress: fix decompress size and output cb36f4f35294 zstream recompress: fix zero recompressed buffer and output 34118eac06fb Make mount.zfs(8) calling zfs_mount_at for legacy mounts as well 2420ee6e12cb spl-taskq: fix task counts for delayed and cancelled tasks 6be8bf5552b1 zpool: Provide GUID to zpool-reguid(8) with -g (#16239) 73866cf3468f Fix issig() to check signal_pending after dequeue SIGSTOP/SIGTSTP 50b32cb925f2 fm: pass io_flags through events & zed as uint64_t 92fca1c2d0ea zstream: build with debug to fix stack overruns b3b749161530 build: rename FORCEDEBUG_CPPFLAGS to LIBZPOOL_CPPFLAGS bf8c61f489e0 Remove unused sysctl node 4a4f7b019fa5 zdb: rework dedup accounting for log, quota and prune d4d79451cb87 Add DDT prune command 82ff9aafd687 value strings: pretty printers for flags and enums 17dd66dedab9 zpool events: expand value strings for ZIO error values b109925820fb spa_prop_get: require caller to supply output nvlist From nobody Sun Sep 8 21:57:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X23jH1qW9z5WFvC; Sun, 08 Sep 2024 21:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X23jH0tTbz4b32; Sun, 8 Sep 2024 21:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725832643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C8cjnwXGWa23WGbMtJx/wHPJzAeoJOaxxF3ozGa6SeY=; b=EcxJpFagiYrHhrZfSNi7R2QHrTARO/35RJGLoZMBdjMShmN7YB5stR5SAwUIqtMLLwkTmv IbaaDyuCx1wKio/GVErXcwcpwvLij1PXvtCsZ09pRlwd+FPcCs2XAsXnRzyww53Jx/5sZt YewLvSNjEZ9ISN4q6Cpnsy/OEoj4pHobdOow+VyUC9CDGIqwgSiZ5hTmQ8+Oe+hqKlfiys kw3TIj5gZ/LTwRoWz4R88cfxAKmZmbkjJQAY73TxEE/yMn5tME1Dz+KGbGsIjBiC1yuixp oUWrLw7KuV4OsoKm8/v0ZHgEDU7IKV93ihXEHWVloSsBNndNIbLPm2BOxQUqbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725832643; a=rsa-sha256; cv=none; b=KebE3cGkXHODAzaWIJlemVlsExk9zXqcdZ38b6H9PtwLzPnRzqgaM7vP1aNay13XbqTp4K NgheHLLE6RTCSOhqPIU+9yw/jGS3QiEUC9Kxan4YEQTSZa7YtIJPfynN09tSrasFyWxEkx iXKkCwNMUy6WvyFKEIGNh3abTsS2Oo+gqzDZUuxaBpKodwfLJb4ZXAgvFjdHpjE5d0bnz0 B7u3bmnN2HDND+s2qxjD4YA1J5gwIu5yF0I4rAODa7ecPFMjuuPIIcBGCZyOHscrddTgjw KAjc531DxUoYqb6ve69r/HV89Q+YvGUkJ4zpnEjesKwM1gP79GO1wXbRQET5QQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725832643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C8cjnwXGWa23WGbMtJx/wHPJzAeoJOaxxF3ozGa6SeY=; b=cEGVnQ3Txnpf6xcaU4qih2/VuO9EYTwwjn87dCJxXq/oGuBW08rPHAaBdiAX2qC25nq3cN 8ETWisc2+gbHUOsTbGby/ZgWSJPw30KNb90dtf7QDtby7mWkPZjXHGhn/noniHrr18/jmD TswcyQRFnBiHIPDGHAJExQJHZL0wM2UqAlpFV9psS5RcFtSlgA7ca+t2PFtFH8tC0cqEvx V7svcUPnnWTPplmX4/A3eODc/oZJGjN7qS62fs2/vQkHSqUNitzc7+2vI6ggi+wHJJ25dx c6EIZ/1rDZ+yVIqTi3DAxaQ87LzGgWPOukQTNhpOEGS9eETBItBNsW0S6yOp6Q== 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 4X23jH0TQSzcRb; Sun, 8 Sep 2024 21:57: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 488LvMGZ089422; Sun, 8 Sep 2024 21:57:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488LvMne089419; Sun, 8 Sep 2024 21:57:22 GMT (envelope-from git) Date: Sun, 8 Sep 2024 21:57:22 GMT Message-Id: <202409082157.488LvMne089419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: f93a50d69df2 - main - fusefs: fix an uninitialized memory access in fuse_vnop_deallocate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f93a50d69df2e996ff1d4f793d0dcb9de655ebdc Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f93a50d69df2e996ff1d4f793d0dcb9de655ebdc commit f93a50d69df2e996ff1d4f793d0dcb9de655ebdc Author: Alan Somers AuthorDate: 2024-09-08 21:50:40 +0000 Commit: Alan Somers CommitDate: 2024-09-08 21:50:40 +0000 fusefs: fix an uninitialized memory access in fuse_vnop_deallocate If the FUSE_GETATTR issued to query a file's size during fuse_vnop_deallocate failed for any reason, then fuse_vnop_deallocate would attempt to destroy an uninitialized fuse_dispatcher struct, with a crash the likely result. This bug only affects FUSE file systems that implement FUSE_FALLOCATE, and is unlikely to be seen on those that don't disable attribute caching. Reported by: Coverity Scan CID: 1505308 MFC after: 2 weeks --- sys/fs/fuse/fuse_vnops.c | 2 +- tests/sys/fs/fusefs/fallocate.cc | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index bf272ab706da..30993441bd72 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -3075,8 +3075,8 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) false); } -out: fdisp_destroy(&fdi); +out: if (closefufh) fuse_filehandle_close(vp, fufh, curthread, cred); diff --git a/tests/sys/fs/fusefs/fallocate.cc b/tests/sys/fs/fusefs/fallocate.cc index ff5e3eb4f4bb..a05760207648 100644 --- a/tests/sys/fs/fusefs/fallocate.cc +++ b/tests/sys/fs/fusefs/fallocate.cc @@ -310,6 +310,57 @@ TEST_F(Fspacectl, erofs) leak(fd); } +/* + * If FUSE_GETATTR fails when determining the size of the file, fspacectl + * should fail gracefully. This failure mode is easiest to trigger when + * attribute caching is disabled. + */ +TEST_F(Fspacectl, getattr_fails) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + Sequence seq; + struct spacectl_range rqsr; + const uint64_t ino = 42; + const uint64_t fsize = 2000; + int fd; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1, 0); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(1) + .InSequence(seq) + .WillOnce(Invoke(ReturnImmediate([](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; + out.body.attr.attr.mode = S_IFREG | 0644; + out.body.attr.attr.size = fsize; + out.body.attr.attr_valid = 0; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(ReturnErrno(EIO)); + + fd = open(FULLPATH, O_RDWR); + ASSERT_LE(0, fd) << strerror(errno); + rqsr.r_offset = 500; + rqsr.r_len = 1000; + EXPECT_EQ(-1, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL)); + EXPECT_EQ(EIO, errno); + + leak(fd); +} + TEST_F(Fspacectl, ok) { const char FULLPATH[] = "mountpoint/some_file.txt"; From nobody Sun Sep 8 23:29:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X25lM1Zxcz5WTpx; Sun, 08 Sep 2024 23:29: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 4X25lM0x23z4m45; Sun, 8 Sep 2024 23:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725838159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8OOqOlbdFlU0q1nHqfT/YtgGk/It2DxdPVTwFIcnIw=; b=ce7P4HVmyZbiWMsH8Jyp5wOJcby93Shp2VvzR7/xBznzQ2Ia7UTQ7wuhcDHDk+gmOH3ApB xse8ltG+rAM59QVVpiPdDMv+7zp7gKflLnj1KuAb00gs51+/Rx/NR/8IcZkleS24oQWYJs zcGlCgUUzx4r6M4T1LBIcBh7fKzRDufXeQEw/AhA1S4iDK2GW6Q0SfvliAJIAYiSB6MmUU 2Hi8VliTxeD7xWpRrA/bZLbrize7WDQb+GHc4KHIhk9BD0dgXbeGfecPDgIvMEU55zfZUL 3mUebOLdLj5fiOtbdVamKpmJ1FkONWZewEzIjBd/ltR/F0o9fm082lpMCdbs4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725838159; a=rsa-sha256; cv=none; b=KlVJxR1FGdg1JJBHUbvRLxfufbDV7DF378vsZ406WOdKq7XGskNuJ8bN7Lv7qa/PTrDb/o 0WNFTtT3e3rHJ9SYxlwm8Vq2+lqQKCLhXclVe4Y9s+0pDbXzoeSPFjD7U8gc9FejzdVPDz lfWYwffhZnnA6lA1GpAcuAJ1FQiUI9pjl7IxSs/JbPgpVoieNR7hUv7OlgELEGattObnQx ML9+4/FV38bipqXwVD9CsIEAy7vio1+HvyBL2/RDekQibRXSGOsivGyPCyk3+8NeYpIa9m 4V0xd4GD2bDynkDnBCUaCr6qQJDbusiKL+KQOEtJYu9UpVDlbMKmcFIDXtGJlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725838159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8OOqOlbdFlU0q1nHqfT/YtgGk/It2DxdPVTwFIcnIw=; b=DbOYKlbU5G5utCMw3VDZKElPoNAKmApiMt/CnNQuFNqZylNUDa4vZ7Bavq9tc2NO4BT1dB /AhYSjIohfDe/6ryKtg7g1M6GvmB9cvGi64W2juepa2BgTtkrK011dGQaM95kc5YI/h0Cf /uwMj9BxC7Ej4g7bnxH7pqHUW2NJ89tAgr1/xgW1LHtj36sCuPqGZ2YOe4/khspeCLuRUY d4eotMq3w6cI6Lo+bpZzI3vBCkINsLyYFB2a75Cs5tLsnqBnCy3Ha/5f19eR3jqzV1PFgp xx4IDJkS7elF8TBYdxAzgBg28GzFvQt+khZzV5rBB0tj2aMeJzgylmpEpiYWMQ== 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 4X25lM0Vl9zfwQ; Sun, 8 Sep 2024 23:29:19 +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 488NTIYn042470; Sun, 8 Sep 2024 23:29:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 488NTIxr042467; Sun, 8 Sep 2024 23:29:18 GMT (envelope-from git) Date: Sun, 8 Sep 2024 23:29:18 GMT Message-Id: <202409082329.488NTIxr042467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 44328abfb7ac - main - nfscl: fix uninitialized memory in nfsv4_loadattr List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44328abfb7aca8150b07b83ff502c9185677e3fb Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=44328abfb7aca8150b07b83ff502c9185677e3fb commit 44328abfb7aca8150b07b83ff502c9185677e3fb Author: Alan Somers AuthorDate: 2024-09-08 20:42:38 +0000 Commit: Alan Somers CommitDate: 2024-09-08 23:28:33 +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 MFC after: 2 weeks Reviewed by: rmacklem Sponsored by: Axcient --- 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 47ab4958f9c5..90b30f462106 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -1322,6 +1322,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;