From nobody Mon Jul 7 00:06:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bb4KB1VwLz60hrf; Mon, 07 Jul 2025 00:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bb4KB0jG5z43yd; Mon, 07 Jul 2025 00:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751846782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzpUpKjXngahm3dHptPK4XUnmKz6cYX1QB2v8+VEWGI=; b=F3werYCWYuAYAFkyNCr5AYAE9aYtOrW9mEdSYK3dty2F/K+b5TOL9/1Clsh9kWHZFQD6qy Dm7GSZ1rL2T3j4eCEvkA5oPb+MysJ3lIdm2BN2xOyOiIKW6EECTu3Ki2079aIWASj9Htkx GtpvZd/HHNIeGgRiHCZLXeeDRfFkglZVw6H4yAMkNmjuZ8xWkQK9Qcz+5swdZbOS2ipzel 6qvfjUxA3rdyUI8FMr8h981ShW0tq1mXm6QGdryRejkUHYdmvgfvJygxLqxJk7yiDEz9qI lzQGI5QwPKgtgV8yqPu8WI/i8UF8EUqnLpaeRzgL/VJI9WFsEHvPAIvfZdai5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751846782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzpUpKjXngahm3dHptPK4XUnmKz6cYX1QB2v8+VEWGI=; b=DpdaEF28nFQIjYm48fkNIP4KBQHtLMBTfWhW/r8s2ysxoEFh0ljdmSZMokK2zjF4z5pe8I 8XHfJ6Iqq4IzOJLDvyqxRPtD7rwDKc79+XHMPc0PwZ5J+brV+eBBRZPGHGbsJmi0BgADsR 98yuklqyMHyAV7ATnlAMAaQs5t4/Hv+nfvsGh40kuzq+trl+g3IgfzykQIP2j3C+pkOTxU brFgVHJ+EERbqZFDRpIvBmj8C2cqZU9j3g9L1v9EfplynJdUDjE0Q0i895WtQhmmrK7Cvz mBRhcEtANAwvoVgrPXHD27P2RwqRpnY+PGHZecaEFzFDlk4LRmHI0rENAdOe9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751846782; a=rsa-sha256; cv=none; b=snqD1fC6XMy9sbF52ZMkPBP3d1MJzhH2fNIJV1TP+EgRPbnk0dxNq1NMQ7mWJgB8tzZZpW medQsjVsFMNZv9AATKGmArJkDqkBmThCda0cemCfN+UAwVfnE9ONNKkzEkwLm+e9rJSfyp ux9F98RH0nM7k99SqpAqOiL1HwYc4kcbJe3MqtMz+v8G3+6TODv/Y2eAz7SmYCYszugEsv hozhjkk3TlrCba6Tt/tJNE/ToiZ0lyqdJawDLT5ox9IG5BHhflOgTVPh7DelAc0ibCs4w0 bKy8UDgIrfdZ3/SCfwwqfrW9kdXi7RGcpD0aBhgjVuMnqGRtM+EJMwbjdqlNYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bb4KB0FTszBXg; Mon, 07 Jul 2025 00:06: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 56706LIi024195; Mon, 7 Jul 2025 00:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56706Ln5024192; Mon, 7 Jul 2025 00:06:21 GMT (envelope-from git) Date: Mon, 7 Jul 2025 00:06:21 GMT Message-Id: <202507070006.56706Ln5024192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 6a7761b4d27c - main - amd64 pmap: convert panics to KASSERTs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a7761b4d27c99b3b548f2d948b88bf1430ee636 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7761b4d27c99b3b548f2d948b88bf1430ee636 commit 6a7761b4d27c99b3b548f2d948b88bf1430ee636 Author: Alan Cox AuthorDate: 2025-07-06 17:42:08 +0000 Commit: Alan Cox CommitDate: 2025-07-07 00:03:28 +0000 amd64 pmap: convert panics to KASSERTs With the recent changes to pmap_demote_DMAP(), the calls to pmap_demote_pdpe() and pmap_demote_pde_mpte() should never fail, so we change the associated panics to KASSERTs. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51180 --- sys/amd64/amd64/pmap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index cae5436a1ff2..9c985df13ddf 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9991,7 +9991,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) pd_entry_t *pde; vm_offset_t va; vm_page_t m, mpte; - bool changed; + bool changed, rv __diagused; if (len == 0) return; @@ -10021,8 +10021,8 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) if ((*pdpe & X86_PG_V) == 0) panic("pmap_demote_DMAP: invalid PDPE"); if ((*pdpe & PG_PS) != 0) { - if (!pmap_demote_pdpe(kernel_pmap, pdpe, va, m)) - panic("pmap_demote_DMAP: PDPE failed"); + rv = pmap_demote_pdpe(kernel_pmap, pdpe, va, m); + KASSERT(rv, ("pmap_demote_DMAP: PDPE failed")); changed = true; m = NULL; } @@ -10033,9 +10033,9 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) if ((*pde & PG_PS) != 0) { mpte->pindex = pmap_pde_pindex(va); pmap_pt_page_count_adj(kernel_pmap, 1); - if (!pmap_demote_pde_mpte(kernel_pmap, pde, va, - NULL, mpte)) - panic("pmap_demote_DMAP: PDE failed"); + rv = pmap_demote_pde_mpte(kernel_pmap, pde, va, + NULL, mpte); + KASSERT(rv, ("pmap_demote_DMAP: PDE failed")); changed = true; mpte = NULL; } From nobody Mon Jul 7 04:09:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bb9kG5X21z61DcS; Mon, 07 Jul 2025 04:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bb9kG4Yjbz3TLm; Mon, 07 Jul 2025 04:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751861398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4RNH2yP8VDzXrbxrGF85XFa1W6b32zu14nbae0xOhtE=; b=uEi5Wy86IeX7jG8G99mQYy/EU4PtzTkz/TjILdEJ4B8QJPK3KiejYsUYgTsdo1ngJXpCzB DuhlnPY6fJTJHtUG+d2U2yzpyEXsUcuY4pw8AnbnHNkXDpjvC8yRC22MZ23DYp6/myLvju lzrN9JZ9nJcSmSgA3BqueGQRSHUZ060CpcuRhkn1qne26HKDrVVGJN3/rRzLNtxMAY7cU5 Uy0/4E/ESXEaeZEjeUrA8YCS5HjYhe3TuARrs6APhwDLUlEHdIIZE7r5+eqXMtEomokt34 BCUU12xwAJN1B2K+Q6CE0oZq6/y5+bIudImfoG5HlfG/8nGj4ILwqmJf5UF74Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751861398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4RNH2yP8VDzXrbxrGF85XFa1W6b32zu14nbae0xOhtE=; b=jZcp/0lxbJeyCNJm6W19f46pyYmknuHvpl689T/tfJGB5NAzDNJlDUwjP9Xyh3V4CHy3lN p4KCkT8kH6UGGef5YbH5vPqs/bB/khcpWRsQDiRNJMiMIBBlVl4CsuUDok9ktECXcBSNfy ATK9oU5E4ztlBL+COxj8VwyhTJmVFBiyJD5GIxQnfIhOhmoeN6y0KWraKVYZOebO5f3R3M Q2rXsC89S0w9rSwbu/lccfWUP73VPdKoAyFW/EsyQ7VLimxkoaPSWgbj0HOFVHUoP4VWZJ mfURnoOGaieo8MiBOlMMd1Fqzs2FCr4Qte2KWRqhQmzCLXZMmAxof7oIb6C8JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751861398; a=rsa-sha256; cv=none; b=aT1Rzn89hBJ5F0KoxVoMbxdNqjFTNvTIy48Kce5gBDEu56Vb0ZwX2v1QiBWmDvkHGjkinM teF1gbklQI5cAAz9aFy0Mbarhq1zeYqs9h6ECd+027aMYl2tG5K83+BQm/DQIHu79RSfsS 3Yy6XHNw/EyEpyBgsAFtBlXViTzIpcwCaiA8hplnzxpbo647PuI63ENsUPhT6ktMhZ8fo7 jx6yy0mVPXrHoEZNT4Et+gUys2if58xYLV9vtbpFqADeLZpfb006d20N12tLemrf1q5vFZ 9biYvvuCoA0IixkNuwQST+x0g/weId4590Y8eej4OaK77MQau4fgpUGQzcNkNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bb9kG49JNzbvx; Mon, 07 Jul 2025 04:09: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 56749wrw075883; Mon, 7 Jul 2025 04:09:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56749waZ075880; Mon, 7 Jul 2025 04:09:58 GMT (envelope-from git) Date: Mon, 7 Jul 2025 04:09:58 GMT Message-Id: <202507070409.56749waZ075880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: e05999a8c5a9 - main - amd64: move efi_map_regs definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e05999a8c5a9bfb2f5c91fbc1dc397d46eed5bbb Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=e05999a8c5a9bfb2f5c91fbc1dc397d46eed5bbb commit e05999a8c5a9bfb2f5c91fbc1dc397d46eed5bbb Author: Ahmad Khalifa AuthorDate: 2025-07-07 04:07:15 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-07 04:07:15 +0000 amd64: move efi_map_regs definition Since efi_map_regs is used in machdep.c, efirt being compiled as a module causes it to be left undefined. Fixes: 85dcdb7aad85498b3f497b8752e69b8612b27cb7 Noticed by: kib Reviewed by: kib, markj Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51183 --- sys/amd64/amd64/efirt_machdep.c | 2 -- sys/amd64/amd64/machdep.c | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c index f70e235a0150..fe5d60c978dd 100644 --- a/sys/amd64/amd64/efirt_machdep.c +++ b/sys/amd64/amd64/efirt_machdep.c @@ -63,8 +63,6 @@ 1u << EFI_MD_TYPE_FIRMWARE \ ) -uint32_t efi_map_regs; - static pml5_entry_t *efi_pml5; static pml4_entry_t *efi_pml4; static vm_object_t obj_1t1_pt; diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 1e8f9b22bd19..f46462b39fa3 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -188,6 +188,12 @@ struct init_ops init_ops = { */ vm_paddr_t efi_systbl_phys; +/* + * Bitmap of extra EFI memory region types that should be preserved and mapped + * during runtime services calls. + */ +uint32_t efi_map_regs; + /* Intel ICH registers */ #define ICH_PMBASE 0x400 #define ICH_SMI_EN ICH_PMBASE + 0x30 From nobody Mon Jul 7 06:50:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbFJ06xk3z60rCp; Mon, 07 Jul 2025 06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbFJ05dl0z3T7d; Mon, 07 Jul 2025 06: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=1751871056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1koXvX2Vj38o4zmz4H7Bpq+pl5yp2k2oahJ6QwnGRAA=; b=uUw1/bODnlfFASszvKxCIwvd0Zsvm8WJXKyjIqJkInhMj5xknxbXutvn4dwc21LtSaxefz NmTZqaeJH5kkrKWJxzag2/DGt04tmESnsrD+gatmtZ0AfCesGvYBh2oQmLltO0boYy2FY4 Eu/m0w0kV1iPeqfoZVQGVXhvxKELmdCjopQP5C1VOC+VQyrAmkCwkIs6xUXexav1FO55f8 oWlCCA470gu2yD3b4j+SPFGAAd6G7v/VW6X3CfBzBgKLyEyvbpf4kSbj5/OzGFyLyxp1J7 biV8YJzkukaf536l4ERjkeX1tanAC/oantczqCD/o8tPpkekIi3v+lu8vYFk/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751871056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1koXvX2Vj38o4zmz4H7Bpq+pl5yp2k2oahJ6QwnGRAA=; b=d46Dqwkm8/0LnmWpJyff1l7KUNrZ+LyG4dyOX7qiij2VL8rjrUX4xiJZ4WtpFT106saV5t 0sfJDlKi3xUH+7ACP+7ojfVtO+fRS0boDWu2IHBoeAqiNN1kd8quTqLMgYpQpLm82Rfebl o++yF2i5h94TC8iE8ohhHzOvDkryT1IFeE+xzLZXPqAwMVuP1di/PA2s9yAXrTuQvkZvlA /R/2AL8hZNLohwkh2vDUomvNW5jBY3MIb3XR3pdDJiP07gNuhex/IiSoW8/Cwwgc/HDUQB svkWeFRWXgZTpkvw1x+4gqNHTloM8uh8zVwvNP2csCxMdDV2ML/9JnXaud9gvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751871056; a=rsa-sha256; cv=none; b=f6Q2Cpm0KdTRyKYy2AUyA2g99Bmjs23vp4LHQSSB97HSPqbslhp8BDu+cneO66J8si0+V9 zWfpQv7p90eIJdro6My+rLRfK1LNotD1Eas9H1VkBqtOwOSD22B7wS3Uwj2pgfsvV8MyjX MIi8ogEK5GihWAmZrFE8DM1aiH6HWo/8lsfc5Yg2A/a+v6KLukF61hEXmuuT6ifCFJkXP0 zpc0UUHPcgXnCEZzvjPIf68yQXg1cPTZ5hD585ruytVsSzamSOhV22PB+70BNbWhmO6Br+ 6daywMUP7xi+l/Ta4IhXZsxFCqG8Zl1HWxK9NEdlP0exBCOcek5l4NoMQPgaRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbFJ05FDwzgy1; Mon, 07 Jul 2025 06: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 5676ouaG089016; Mon, 7 Jul 2025 06: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 5676oudE089013; Mon, 7 Jul 2025 06:50:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 06:50:56 GMT Message-Id: <202507070650.5676oudE089013@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: 07948e050808 - main - net80211: regdomain: ETSI: add missing 11a and 11na entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 07948e050808158567c0ca7d345ad035115c0d88 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=07948e050808158567c0ca7d345ad035115c0d88 commit 07948e050808158567c0ca7d345ad035115c0d88 Author: Bjoern A. Zeeb AuthorDate: 2025-07-05 01:47:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-07 06:49:02 +0000 net80211: regdomain: ETSI: add missing 11a and 11na entries The frequency range 5745-5865 (channels 149-173) wrongly has a VHT160 channel listed (going up to 5885/177 which is not avail in ETSI) but no 11a, 11na listed. Add the 11a and 11na in addition to the 11ac 20/40 and 80. Turns out the VHT40 entry for 5805-5845 was also missing. We already had the neccessary setting for taiwan, so just adjust the freqband ref. The problem is that without the 11a base channel ieee80211_find_channel() in ieee80211_lookup_channel_rxstatus() will fail and sta_recv_mgmt() will not get the correct channel but will use ic->ic_curchan (which is not updated on scan offloading) and the scan result entry will be added as channel 1. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian (previous version) Differential Revision: https://reviews.freebsd.org/D51163 --- lib/lib80211/regdomain.xml | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/lib/lib80211/regdomain.xml b/lib/lib80211/regdomain.xml index 9116e54c31cf..16b74445f429 100644 --- a/lib/lib80211/regdomain.xml +++ b/lib/lib80211/regdomain.xml @@ -494,6 +494,10 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 13 + @@ -548,6 +552,14 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 13 + + + + 13 + @@ -645,7 +657,7 @@ IEEE80211_CHAN_DFS - + 13 IEEE80211_CHAN_HT40 IEEE80211_CHAN_VHT40 @@ -658,13 +670,6 @@ IEEE80211_CHAN_VHT80 IEEE80211_CHAN_DFS - - - 13 - IEEE80211_CHAN_HT40 - IEEE80211_CHAN_VHT160 - IEEE80211_CHAN_DFS - @@ -2304,6 +2309,29 @@ 20 20 IEEE80211_CHAN_A + + 5745 + 5865 + 20 + 20 + IEEE80211_CHAN_A + + + 5745 + 5865 + 20 + 20 + IEEE80211_CHAN_A + IEEE80211_CHAN_HT20 + + + 5745 + 5845 + 40 + 20 + IEEE80211_CHAN_A + IEEE80211_CHAN_HT40 + 5660 5700 20 20 From nobody Mon Jul 7 13:45:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbQV04vfcz61mNJ; Mon, 07 Jul 2025 13:45: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQV02xt4z3KFS; Mon, 07 Jul 2025 13:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751895912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HfaMnr/jCFriFMHsjKoz/vjj0169SPa3Wqlk3+/rSRY=; b=atu9pD46U/vjV4rjFzSC3Dqq4G853b6DMOB0ZkHaqRm2OX2opBi6wzNR+S49xzlcelUlHQ IUi3zCYyoUGfaptgWWmROU/GZuMXjvtB6UnSv8KjjPVdlbcU9l8sXTT0ZcwyOg1oGKprhp jafGn8MaosMvjHUeLxVmKuFZ3ts77eoooIC7cWKSNam1JZ/hc12u6QN0glj2i74E6B7G4F pSXZCI9wAzq00uk0gvxyT3C64bEQJdYKyAFXOIIIdmv74Cjaao7V+gwVg06V3CByDU+3vj PnIpRpn1dvfOw/eXLGtHZK4L5rUKb4YyYkXKX41zvqve79Yr/ZI2vX9qWCEriQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751895912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HfaMnr/jCFriFMHsjKoz/vjj0169SPa3Wqlk3+/rSRY=; b=eouE2Ukjo2rmrl/a6Qeojdy6FuVX96Yz8XOWBuCBqucUKvOl8pFaSF0dX48td0p4L+/FRN i33yVu06TBOD6HYH3hSOVXz2086xEwJNGfPu8BGPEVfAI+ahmYygYP4WuiGIhRPPN/EMQl IS7Ogv7SZbl9TuMG9fnKXQQFBUxXF5I44iThQ0P/DdeoBQ2wXYTofEiKWAB8/GB4jEEQBO b5xv8dAmeGOgnEenbmdg565qHbsd1yTMluI2CDNVcPgjmxMrmcFW47Pe52VNXZvmbKhEtq minBCN64ZaoAB9Fbsv9WBkTs/CjSkyJWaSp71nYagOuXgZG1Uu75imJRKgU54A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751895912; a=rsa-sha256; cv=none; b=KQ+C/hjl0LYKsoDaYaaFZfqjHZaTk3tpQmeWQwYWHSF9ly9Sti23XyP5C+25BlQY5k1jZG FdD2pQCFGi8z3xfBluTCyTSL9xi4N1WxjBV+KJ+l+w/KdvoULbbReAYc4ufXhTD5igZrZ+ vRYUtYJkWBCzML7jf4+WLe86u7tGLjzRQr+gAD7MBfNRGGUBCUmdmxBXFV7/oD9MvIW6IY hOv1c6EpugfoWPdUpcCJ03YNiESqvfg1KXPFWb8kjQhIJ2km3XlPYqXb+g/ewsiUybO8gY 2UdVcPSiOT0vB59+vNzw0BRBz5Bn1eEMmezib0v9kO7JHsxw/nPFfBnQZHfgEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbQV02Ff1zt4J; Mon, 07 Jul 2025 13:45: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 567DjClj064716; Mon, 7 Jul 2025 13:45:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567DjCWl064713; Mon, 7 Jul 2025 13:45:12 GMT (envelope-from git) Date: Mon, 7 Jul 2025 13:45:12 GMT Message-Id: <202507071345.567DjCWl064713@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: 13a21c0c0e3d - main - VOP_WRITE_POST(): correct condition for knote activation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 13a21c0c0e3db6e2c1a317031c7d1bf4651bec3d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=13a21c0c0e3db6e2c1a317031c7d1bf4651bec3d commit 13a21c0c0e3db6e2c1a317031c7d1bf4651bec3d Author: Konstantin Belousov AuthorDate: 2025-07-07 12:51:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 13:44:21 +0000 VOP_WRITE_POST(): correct condition for knote activation Fixes: bc4430dc203ed7b6765fb5df041bf545c50f859b Reported by: dhw, Oleg Nauman Sponsored by: The FreeBSD Foundation --- sys/sys/vnode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 3ed469bdce6d..2c6947103c94 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1032,7 +1032,7 @@ void vop_rename_fail(struct vop_rename_args *ap); #define VOP_WRITE_POST(ap, ret) \ noffset = (ap)->a_uio->uio_offset; \ if (noffset > ooffset) { \ - if (VN_KNLIST_EMPTY((ap)->a_vp)) { \ + if (!VN_KNLIST_EMPTY((ap)->a_vp)) { \ VFS_KNOTE_LOCKED((ap)->a_vp, NOTE_WRITE | \ (noffset > osize ? NOTE_EXTEND : 0)); \ } \ From nobody Mon Jul 7 14:00:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbQqV5dsMz61ncw; Mon, 07 Jul 2025 14:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQqV3zJVz3RHb; Mon, 07 Jul 2025 14:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8VNXGUnyLmGVteuWMI/wzatIovbQ/qi1y2GSy+Uc+ls=; b=mPFm6zYhNf8pJyQ1aaZEbBHcn5HxDf9J5S3Z/AUN5dqeSrWoEdyVUBOkAJct+bnpX3uynW x/jqhp+YCBHYY5iO5A2qQ6Pyhu09e+XG8Lsrpr8Yxdbwfib6Uw+Td+KaijHUVFHGVcHWFZ IiCkZMqgbY6WWpCjt8ZAPbh3fGYDuVeG5/UzqmDhA8UGcN325X9z2DNXSmwSseu3LPywmy +W2/l6KJ+3Nll1086qSdjRU8jvQWF1eRJOWUTHDa1GBoPpIgO7ujJ2ajipQI+k3uHMsR71 Dvl7P8e23+t7zief3SkoslrEnuQYsTqZNrD7l21xNK/tAynurho30vyWeeyysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8VNXGUnyLmGVteuWMI/wzatIovbQ/qi1y2GSy+Uc+ls=; b=WcFmE+XvES3q8pQ9WlXTQ6Dhs8Wr9qVGj79oy3gXeNus/iMu7NTJ/GkePVlVk6+5zJhJyl q7fhTxvabJTAubx/LXvwGrD+P5481TrRgb8uwTxSrOsZoJj/cHAP8NSHAb8hbn+O3/KAnZ qTmtxIA1gKkt3yb/Cbg6oEHv4vc5qmA6edBAPUiiOy1hQ01QOsrbJhJcdypn5b0f410dRN Dbny4Q8NkKy743nZNGGLXLGCSXK4T6TFVYOEiq6BgjBaPP8a8P08XHfB5JmASFwY+sz5v0 m3t1cfcLETWZ8tQimoMGFzlcHXeIDhno/O9e4z8T0mtRA2tNlA0WmZoHQJjDBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751896822; a=rsa-sha256; cv=none; b=v9a7qT2JxLzR1iYxvKKORcWEXBMOoUjcgzZa+Ig6W2fI79pJrjq74m9Xr1/S5MhiO7g2PO sbb2/NfPMxT2Bi2H5vNwQJAMQdqLlk2L8pInmn+MSZ/Kyk8INnZg101MaktHAApMKoancy bm6ebIVvl4bTq064i5MPd2McESbEe5d2uq/iM5mG1UizH8q/JcMX7TooA7C6VzpM84W9kq xJqQastbs1fs6oeONBu2ET/ff1FwX7HfZGG5lkI1qx8Oeu36OWjWV8gxNL9+TV2uvvUvp9 B4Y/MNumhF+IZ5QPnSiICxEtfw8PwPfSOfTprPyUw1jgNSqaQdTnMoRo9dICuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbQqV3ZhhztVg; Mon, 07 Jul 2025 14:00: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 567E0Mwm094403; Mon, 7 Jul 2025 14:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567E0MFO094401; Mon, 7 Jul 2025 14:00:22 GMT (envelope-from git) Date: Mon, 7 Jul 2025 14:00:22 GMT Message-Id: <202507071400.567E0MFO094401@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: 97452b097a4a - main - examples/inotify: Handle a zero-length name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 97452b097a4a35df8ce8cbd44786fb7d95db2a92 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97452b097a4a35df8ce8cbd44786fb7d95db2a92 commit 97452b097a4a35df8ce8cbd44786fb7d95db2a92 Author: Mark Johnston AuthorDate: 2025-07-07 13:51:41 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 13:51:41 +0000 examples/inotify: Handle a zero-length name Reported by: jlduran Fixes: 1d8664d69041 ("examples: Add a demo program for inotify") --- share/examples/inotify/inotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/examples/inotify/inotify.c b/share/examples/inotify/inotify.c index b8e300bc992c..ea63ccd1f337 100644 --- a/share/examples/inotify/inotify.c +++ b/share/examples/inotify/inotify.c @@ -154,7 +154,7 @@ main(int argc, char **argv) ev = ev2str(iev1->mask); xo_open_instance("event"); xo_emit("{:wd/%3d} {:event/%16s} {:name/%s}\n", - iev1->wd, ev, iev1->name); + iev1->wd, ev, iev1->len > 0 ? iev1->name : ""); xo_close_instance("event"); n -= sizeof(*iev1) + iev1->len; From nobody Mon Jul 7 14:22:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbRKy5RT0z61qnB for ; Mon, 07 Jul 2025 14:23:18 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-23.consmr.mail.gq1.yahoo.com (sonic311-23.consmr.mail.gq1.yahoo.com [98.137.65.204]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbRKw23ryz3bBV for ; Mon, 07 Jul 2025 14:23:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=JfRSVRfH; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.204 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1751898192; bh=WtJ3R08/n//iL0KQyRBgraFqgci2ZX7lOfXaHDLajWM=; h=From:Subject:Date:Cc:To:References:From:Subject:Reply-To; b=JfRSVRfH5zeZbrmT3MBgLWt/RYqA6WieItdv5jbxR9GVdQYdwTerhLu88rgQUoRuyPRRhofAZWeX+gv1erOIutsXH3DfpPXluI63PclIo3w3VPuqrzP+G2NI4uPLONXtoAx5tCVsxHDfddOsUvBhZnQb8NPkBJVvMfOGE/Prjh/1PYOqG2P/rEWcC+ulyKJ7/g/akx/8Yrq5f4dGI5UplBZ8VPY/ZvOfxokgHI3xWchdwhEbTTERmUlXmazVTPsmoQz12ZiLIE6l0GogD4KsNH06opEWHcpd7Ybefv8K5ENqzkD4wKReKry4pXlG269xpMjwqbsxp1lzXRKJlYjlIQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1751898192; bh=cCqfBfmGCyAmcx/7gAQSZezICZGzp+QHM6M/EqNoxmq=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=L0JqWf5G6AUOFKdm2+heIJE0bp3qo+uonFect/rUBgIKHRsxlHRpLoaredyuXXiunKdphpWJ8oKW1stFlVfRfUVb+UrCWYb3oYsuTHcq4dHWeeg6l3zBGmyDa+VnbhxcA2kIOxNJTJpOA9IPek0lwXiC2z6kGtSwmhR30mlI3oGMBMa3cQRH9NE6jxJ+AHjQ/y/sUvCcimYXuGtZzY92Uyj7sVP3gp6Sj3d7whS16hA2UsePhSZA+lPOFaTQgvev56OqJ7z2mZ+E0HrnieJL5VpM1EQndQ3oMP+DAX53+g7xziZ4IFVSJj83h7feXj6tp14bL88AElisWeckd6huGA== X-YMail-OSG: FITXnIYVM1m4pOmmuHOrYniKU_BPe2cYp2wCq5R_lBbdTiXgMZ24xRLz4339UaG 6faM6IhxRSwHVzIcO7iFyOtbH18Esjc8LszJ6TSx9SySQ1ccHLiRSeW8fNrsX1tkJ31GvQInYdl_ nHMqtr47AUbWf1VzYdda0CnBLHBe5ZPyrlMRugP0fuGz_3em98eTTLgvRQNYf9I5HZh0wJ5.XbNK jPeKT9d_FIzfyQfza1EzUWZF0Eyh5Cnd4Dxlm4CRLsRzqqnYeYyk8vWIYlydS7NKExm1WFPksBfL 6cpLcJf0KqhRQs77Q9HAKGvDcEinWE0EZGyWCz1YFUUoE92yVGrKbFfqIi7EadjM57DzHQobo_3E 1.BUjBUN4z7FloYlAdc_K59ENaYX8udSm1x00eoHF_OhV6fGmDtARDjIbW.7oOm9fUGzXA1FWuVO vNa9qYWJptIL5IO6CznobSaI7vFn.7mpCzHDT_LmDT80.IQGIqmWVnQb.B.mV54LKX651AxKULpq FsVeqPncJg.8UfVXWYZNpyzfHYQHJ2qIx.bpbQ54vsVoxibWpsO23.LkdlW7ahs28Yrq6dgcb6I2 3iZwtOtOKIgs7oPI5Smiiqpb3RUHNazCjbuD2tztlhKfzuyK8nQo0x.GwTYQaxIanpEFAvzZYJou SyQJtDLQ4GAxbfrjlBliB.MKH81lsWYQm3tNjgrQx2FHi7uNYHRgkKfHSEEyb9xziQT0FdcvGNKF KPuePlIEA1cOGrThwnPLaa7AoZrRvoWtpIjSwwGfxLInpH0PlZFjphyyMc2d.oTr2nfgRRgbdnJ5 uBdVXfmOEEIBFs3fbJWXZP_9YiPecWEbjtKyKv.PVHF9EyavuAWgcT43.zXGMuRt1rETsDH3KdbX Ocm7A20NvTpX2iO_UwUFB2qTIZ3C1smCTccUNAxZLiRtceGJ4P5UP4wkKuf5NIjNAS9UqtNjlqht O.U3.lbjfwHN5CKagIymJhQne4S8uGhZ9QbZkOIffKQbmER2K7vpyMVUyOYipl8_APZc6.U16WTT 3H8FI0.8vM4JhNKGOTrWnwsF9pRxKCFRThL5M5Q9PbqXCOwFlDrg6UU0MCDLfdTsm0cIHcxt0qoj 0N4nvytTsfiGIU3ce.5JlFNmdT0tG8bvMLirlsorEXS7TiC0ut0hui92vwwXgii7I4YPEERbLWY. IQLtuQRa4y2wvZAht2_7u4heISOmwMyCWUdIDOMj504LvR1QWxwHudMcYOoKhct1UTHHRODZxKwH VJwBPiNDqr.vXPHXpZiaiALZiUsRSIBZK85PxPMca8D76mKSDGpx0_pQe3pBGUnhhjbQvfl7kOjh 653OpcdjHcyMYaG0JZ0Qsyt_4Q3gK9N5Px2Mr9lb27ZLpAC6mgimcSe0Mx4Deo12WLOHCBtDvTfD lF_68OW7thwZNnTmFFfogukSKF2t59vJo_JfddUTYkwA0GW51_qn44csCSCOP.IHSLN44bHAoKZT UUpFrkqzBdj6sanulv3y0TVkh4SdDnvyKQTCMTShSiXJe.1gXy.FYMibT038q8lCE6YYRW7ubUrk 3jY12T.qVW8gGnBSC5SO87t2egAMmm4HWf.Cd3pjlKLJmFIuuGWVnAewtMb9NfLNbIZ00F9YDU4w i7Sctmi.SthFDoFse_5arDrr37ZT1s8r_7iXre2Ms.mrJlkOw7_umWR7wKJosuhCpRd.0efd8h8T UKgoZWLoK0GK.GA_5SQlHdumESL1SpT3b7Xib2iNrVyQ.93t_RV.yZ7azBZaG6VjTYkhfh3y70J3 8BrImdwArZYwv9ZwCQjQThQOgWTUA2Me2gQPVg6XocGoJkPE6JNv9lFk6A8di4BGJDWOsJ7LFpmn 54yt9EjtbKxYEJf10n2CDSeSTVvS5JCXaCApo9gFV_.jL7o7sNMKSBJgi4XxJAHB9BZQQB0hbYDc 8nxu3U0s2427b.TxfbCw0VSXqPqNITmK.NqAYf9x.lC8M3Wil1bL0GlCPDawZFOKW9S.oaHvvhIG 3IStoTybH7X33N0IyLGzYBEcAj2CtK0vBNNX4_bGiMvYe5ZqRw3meayhcJG2UzZ7COgkkPFhrGBj ZB7_TXGJaoySjGzkl8DZrVNjrreW0YrDwZuQhh_G4OFr8Y8tyhvFuw2Day1r.XiWkchAQ3wj.clu AE4wSCCjoXZBETPQQpbFYTLZqnxRGHhtj66iwSgnUgN_8BsdwrNF4d32d1O_36PWGeZUDRIZQ_bl c5jSfeTEgxME.tfavW9e9.f1FBKrw.s1pEVNVBGUBVZqEmBTdurD1XQ-- X-Sonic-MF: X-Sonic-ID: e82f84f3-e16b-448f-8c5e-6f0a78255b28 Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Mon, 7 Jul 2025 14:23:12 +0000 Received: by hermes--production-gq1-74d64bb7d7-4ndhm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1b3ffc324e0a7c35a98d7094d4ff7adc; Mon, 07 Jul 2025 14:23:07 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: RE: git: d3c06bed2c16 - main - clang: install clang-scan-deps (enable generation of std*.cppm and such too?) Message-Id: Date: Mon, 7 Jul 2025 07:22:56 -0700 Cc: Dimitry Andric , Kyle Evans To: ivy@freebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: X-Spamd-Result: default: False [-2.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; NEURAL_HAM_LONG(-0.95)[-0.952]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.45)[-0.455]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; DKIM_TRACE(0.00)[yahoo.com:+]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.204:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.204:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[] X-Rspamd-Queue-Id: 4bbRKw23ryz3bBV X-Spamd-Bar: -- Lexi Winter wrote on Date: Sun, 06 Jul 2025 21:02:58 UTC : > The branch main has been updated by ivy: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd3c06bed2c16b434dd49958dee5de8c5= 5ad00b85 >=20 > commit d3c06bed2c16b434dd49958dee5de8c55ad00b85 > Author: Lexi Winter > AuthorDate: 2025-07-06 20:42:58 +0000 > Commit: Lexi Winter > CommitDate: 2025-07-06 21:02:52 +0000 >=20 > clang: install clang-scan-deps >=20 > clang-scan-deps is used to generate dependency information from C++20 > modules according to proposed standard ISO/IEC WG21 P1689R5[0]. It is > required by common build tools (e.g., CMake) to build C++ sources > that use modules. >=20 > Since this is a core build tool, install it by default, not gated > behind MK_CLANG_EXTRAS. >=20 > [0] = https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p1689r5.html >=20 > MFC after: 3 days > Reviewed by: kevans, dim > Approved by: kevans (mentor) > Requested by: jbo > Differential Revision: https://reviews.freebsd.org/D51044 Would it be reasonable to also enable generation/installation of, say (picking one example set of placements for illustration): /usr/lib/libc++.module.json (a guess about where it goes) /usr/include/c++/v1/std.cppm /usr/include/c++/v1/v1/std.compat.cppm to enable use of "import std;" and "import std.compat;" in c++23 baesd projects (and clang's c++20 as it turns out)? There likely would also be: /usr/include/c++/v1/std/*.inc /usr/include/c++/v1/v1/std.compat/*.inc An alternate might set of placements might be: /usr/lib/libc++.module.json /usr/share/libc++/v1/std.cppm /usr/share/libc++/v1/std.compat.cppm /usr/share/libc++/v1/std/*.inc /usr/share/libc++/v1/v1/std.compat/*.inc Both styles would allow for alternate paths involving, say something like: /usr/local/llvm20/lib/libc++.module.json /usr/local/llvm20/include/c++/v1/std* vs.: /usr/local/share/llvm20/libc++/v1/std* (where the * may expand to more path components). Precompiling, say, a std module with the compiler options matching a project could look like: # clang++ -std=3Dc++23 -precompile -o std.pcm \ /usr/local/llvm20/include/c++/v1/std.cppm vs. # clang++ -std=3Dc++23 -precompile -o std.pcm \ /usr/local/share/llvm20/libc++/v1/std.cppm then, say: # clang++ -O3 -std=3Dc++23 -fmodule-file=3Dstd.pcm -o teststd = teststd.cpp (My understanding is that clang++ 19.1.7 fixed the problem it previously had with finding libc++.module.json when it is part of the installed materials. But I'm not familiar with the details.) =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Mon Jul 7 14:29:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbRSf4swQz61r6H for ; Mon, 07 Jul 2025 14:29:06 +0000 (UTC) (envelope-from ivy@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbRSf4Bx8z3dlK; Mon, 07 Jul 2025 14:29:06 +0000 (UTC) (envelope-from ivy@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751898546; 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: in-reply-to:in-reply-to:references:references; bh=lPiyjXEZteKeTTAactAbXQ3I51ITIisg9ZPtKnWRqzY=; b=OAbG0EOc1kbFnVdHVeUvxOrrGbtadmxjfEHYovQn9BqI2ECv+KquLOF8t5W4RwUQdR48Y9 w1uiGfKB5bpvSddNzTm51X0GyhNY3SCu1gy79d7lCR1IiI2Zvng5wNhv6Oazq1Q55btnsJ fn7RbU/eCaZXE3c8DRH/8lM7VL+TmVSmk8cMGqziUtglzbFFsYy95+l8r0Y20HHg6vACg+ c73gTShE3vtbhweGDw7yA+G7fJreCQSY/fu4fEKXNLklbWVWytwiqHa8iDvnrN/GAd1f0c 760PiOep85ETcpJZyC2X0dAJ0Zdm8aMttQU1hRRZrgT7tmPx6CDT4nh/TwIaDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751898546; 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: in-reply-to:in-reply-to:references:references; bh=lPiyjXEZteKeTTAactAbXQ3I51ITIisg9ZPtKnWRqzY=; b=KaUGNl/fjxHvbH35l+a3E8ErO2SR4aQeaPt9WgpHA5cpQPrVCwiatG/r0XT/TOCKq2iI1U gJrVdWyTixukvpV+s4tvdzqF9zljjgp7Wm/f7DfPaSpBGlCEZVsJjGBYMWX3ZhCMpgJrC4 LFoJqn4lzha9RzIVJK/C0Nhs1Uoxf3x9oQxKf9RMOgaUReSPNYu/4RbEzyKSlBPVggdPVy j04LhYSqp5Skhs+VOW0wIN3a65KXzA2a8F9VJhs8QQlPdimyCTz5d9PWz30eFMjoCWuQsz ZpSNzkOYdbdNT2ZeUCRxnBy6H9PP5c+GH43asnlbdM0iJGUV1GDUwuB9t4Wn2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751898546; a=rsa-sha256; cv=none; b=w8i9dRZqsc1UAtMOi1P/SUr0ebtM52MjPeY+vm10C+KHgD3IHVJ4+0gSdRPXymZqLjhFOj X53y2iAzKEU3R3pYxQzaKZ85RxWedMKNTjqkpHm9548jLLmysEM2fvGuToeXfgerK8E/xX CBxWTN0SGzfoaRoLXGiRxNSnsredCgclKjwBQDMW0PFVT+bm7dOSF6WweK6wWc+gXlo6Zw cf91Ax8DSfyjSnmVWIrZ6QIGCUpjBSvRHjLgmS2bBa/hcA0iIkp3LWaq2a72GOHt2frAWP M03JKn5sfDvhdaY6mLxO5KPr1M8hq9c7l9dvuovrhrFBbC4zD4M/VQUOzx34Tg== Received: by freefall.freebsd.org (Postfix, from userid 1532) id 86268C307; Mon, 07 Jul 2025 14:29:06 +0000 (UTC) Date: Mon, 7 Jul 2025 15:29:06 +0100 From: Lexi Winter To: Mark Millard Cc: dev-commits-src-main@freebsd.org, Dimitry Andric , Kyle Evans Subject: Re: git: d3c06bed2c16 - main - clang: install clang-scan-deps (enable generation of std*.cppm and such too?) Message-ID: Mail-Followup-To: Mark Millard , dev-commits-src-main@freebsd.org, Dimitry Andric , Kyle Evans References: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CT7llbUUw/lTz6P3" Content-Disposition: inline In-Reply-To: --CT7llbUUw/lTz6P3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Mark Millard: > Lexi Winter wrote on > > clang: install clang-scan-deps =20 > Would it be reasonable to also enable generation/installation of, >=20 > /usr/lib/libc++.module.json (a guess about where it goes) >=20 > /usr/include/c++/v1/std.cppm > /usr/include/c++/v1/v1/std.compat.cppm i am not familiar with libc++.module.json, but yes, i was intending to look at whether we can ship std.cppm and related files for import std. are you aware of any build system which is capable of consuming these, for testing? i believe, at least the last time i looked, CMake did not have support for this. --CT7llbUUw/lTz6P3 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHQEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaGvZrgAKCRD1nT63mIK/ YFgxAQCkPU7JnzxGjuHO3UEXYCc0F2rmcZ4f0y1FADyACj1wxAD4itbG1SBLLzCQ 2lHCUHYvO8I+DPb9pcqc0i5oWxqZDQ== =pmMz -----END PGP SIGNATURE----- --CT7llbUUw/lTz6P3-- From nobody Mon Jul 7 15:07:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKJ4SLlz61w7V; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKJ16nJz3wPm; Mon, 07 Jul 2025 15:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Za52I7S9gJ36yteNGyb+i/aQNeoO4hQ44QKPYQpMGTQ=; b=YwCi3WxLGJmcn1Kgv7fL8qlZL28KmTCkC6oxUHiHrtjJD1E9EWdQcQX3povFaNfquPq5d2 9xCktHGCDg5q0PmjZvdlckRIQQkV0baiUbVs7sZ5JfumsGlV/LMiw9lC1FDIFo/OL07ekp Qnns19c1lAwDUVrg6gqdly2moIAYO+dOfsSetPYS3UFX3VsDONK4wbwLb8eFrIJttIstKV s8SjYT8d7l70DJxwxlsZpRul8k+vQuPkXXyOXtrv88ecOp+UfmmtqdVOa1d4XV/l1lqCPq b+X3e7JIzVKWyDYe2/zBNuYkRaKOP6Z7JtRyNIpwGhyXUcZMZwyNe3FS2d5ufA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Za52I7S9gJ36yteNGyb+i/aQNeoO4hQ44QKPYQpMGTQ=; b=gCWMQAnSkCG7dhuYw4zZGG9xOrtLrr9LAMVTEQXV8p+YmZiGpGvW8layFxhENyrUf00Tlj nZ3tGyB+ZmtH8iRC/PLMutn0c+2S+VVcuR3y3pviLGt1NzDeXCfdkJ3RmhLHVzigCEZDcS JzBKFcz9kPCSOcwXF+gwaEKP763p2wypNaKx/T93qF6degF0C2JOQoHTWGwNHtjov6braS lCZ827jhhJ+SiJ+HGgwmIBw8CHnBMqJFBlLiZXUR+hbE5qGKkkZ6F7h8OiT6WdgdDcE7aX Q4WQL7PlDkkFkEgHqSkAJkJhuXPHtgFHyb1+cFMftbm2RCHCh8SxfDSTeTserg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900868; a=rsa-sha256; cv=none; b=LU6l9E4lrclPQK+ZbJhCY5kWR/QQfPy1TN4kpaLU7iFIqvRSGJlNHxZo/MfKmc9chFPLkq lsWC+HszZn/rcP94KVbpqSMEDzJcwDt4bJEOXWnmvlYRYN34uvb74NclDrkPViVj/4Ca8n 6Xggu1x8OjUVkiMp5kK8/P0gtTmoPJherO1kwT/aAErBjHhkMTUhtnGfJxqItGJJZ5rAC9 uOSH2O8UaUcoO+2mMUucPJ4O7oemzgUAbnY/xTCd2pdIEVL/W4/p0HXTzdhrORB8bunT7G P4PozH2O0TJ5FsfJzmExsmNHd2ffDhUtOfaN/+OlLyELlw7Ap5oes6MkKx1NhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKJ0k64zwF1; Mon, 07 Jul 2025 15:07: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 567F7mY7016369; Mon, 7 Jul 2025 15:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7lqs016366; Mon, 7 Jul 2025 15:07:47 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:47 GMT Message-Id: <202507071507.567F7lqs016366@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: 82e1b49d7571 - main - pfctl: Zap unnused iface function parameter from pfctl_kill_src_nodes() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 82e1b49d75714b91052dfeaf9a8f5f94d03f77ec Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=82e1b49d75714b91052dfeaf9a8f5f94d03f77ec commit 82e1b49d75714b91052dfeaf9a8f5f94d03f77ec Author: Kristof Provost AuthorDate: 2025-07-01 09:50:17 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:48 +0000 pfctl: Zap unnused iface function parameter from pfctl_kill_src_nodes() Killing source tracking entries per interface does not make sense and `-i interface' along with `-K key' is completely ignored anyway. There since import in 2006, probably just copy/pasta. OK sashan Obtained from: OpenBSD, kn , 28535c0a36 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 38d74aceba80..88123b17f1b3 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -78,7 +78,7 @@ int pfctl_clear_altq(int, int); void pfctl_clear_src_nodes(int, int); void pfctl_clear_iface_states(int, const char *, int); void pfctl_addrprefix(char *, struct pf_addr *); -void pfctl_kill_src_nodes(int, const char *, int); +void pfctl_kill_src_nodes(int, int); void pfctl_net_kill_states(int, const char *, int); void pfctl_gateway_kill_states(int, const char *, int); void pfctl_label_kill_states(int, const char *, int); @@ -590,7 +590,7 @@ pfctl_addrprefix(char *addr, struct pf_addr *mask) } void -pfctl_kill_src_nodes(int dev, const char *iface, int opts) +pfctl_kill_src_nodes(int dev, int opts) { struct pfioc_src_node_kill psnk; struct addrinfo *res[2], *resp[2]; @@ -3400,7 +3400,7 @@ main(int argc, char *argv[]) } if (src_node_killers) - pfctl_kill_src_nodes(dev, ifaceopt, opts); + pfctl_kill_src_nodes(dev, opts); if (tblcmdopt != NULL) { error = pfctl_table(argc, argv, tableopt, From nobody Mon Jul 7 15:07:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKK5csjz61wGL; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKK2Vdvz3wPt; Mon, 07 Jul 2025 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lmeo06521rLcCvGoD21XFljP0uQ7xuWv07bVrnxtZUU=; b=jO7gyNmTUKcFCCGfIPnG75u7p38TCvtDUDoOv7wR1zVw3ZpQHO+zqEbAzXHfYayqqyg514 JmESoLl2qJwIkuP7nMUaZVGqlv+++dR6H6EO6efQFxFNUYT5+DIsb/aODtGkXK1kC+/lWK 3LzXvLMXlAsXcg2tBNNJYkm/Z2dMr4+c1ABiXzYuWMfRSj+IHkl9XIkhfpTCGdRkpnn6Ge iNxuBjCv0VHG4UIDm3Sup/jzhOWrzNj3HUlbcH8rvV9mZ+EeTGTfQUxYar89foy76S0zL6 S4gJPlJbmTrIzzStCCofVom18rVUWE4Vcjvb4kOH33aOjbMUzEeQOIaMSFWc2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lmeo06521rLcCvGoD21XFljP0uQ7xuWv07bVrnxtZUU=; b=MJRRM6CUT5E1lnXW9EB4xkF3GIvisxa3wcxP+lAFm7LvUibqtLBPMwKMlialLzDFpEGJ17 lcEGOzrYYdZ6T0BvO/dFIq2oS/cJJlQqT2ew6negJmT+L0FzjToUkikwnggD8u19SSnRcV h8zhnNXkOsYoT/8OQ8WEP1zps92JaNDoIjqwpEpzWtajRGmYMvhr36+tnRflPxfzUfBQ/x m1dqc7HqeesmcaPQeaYTg2ezxb09wovdGD/NE0KvJDapbSlYisSTyx3FjlXrsQryGxBb6F Ogvc525PDok8ApfHdFwEnMT0lMma6HV5ElU/08lUqWkiX4al3kcbn1ISf3ZcFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900869; a=rsa-sha256; cv=none; b=Pa5JBa2IlIkgeZ19/7FWQ97NFh7iMql4vDvgXzzJyJMVhLva8D16hKtvTRogw30ZjHPv6b 0iH1ycGLW9/QzSYJJ+8x2d/QRZkhVE2QMpXrfV4WvMqu26SSj5WLhVJOEP05+u3pYD08fo jO6CoycMpDrkzPDBeTl4xMFIcs/LjTw//Q2NHtFspx73dcLgRypdhqU5ZiiTk5zNM1DgHE vH+0EX9SRPSLzvp5hsWGbVU86xoxvU0cxvZVN79Cs86dezAv2qQgSon72NCcN/DLaKpqBT HR8prODmcZLCiyjPimsFJmgAa20XzsW9XigQcNHGKJXTmdWrezO5RJU4TvNxEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKK1fGHzwF2; Mon, 07 Jul 2025 15:07: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 567F7nG1016406; Mon, 7 Jul 2025 15:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7n8Q016403; Mon, 7 Jul 2025 15:07:49 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:49 GMT Message-Id: <202507071507.567F7n8Q016403@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: f8a8bb7bade9 - main - pfctl: Improve duplicate table name warning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f8a8bb7bade9575c549cbc94500ba706b712c650 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8a8bb7bade9575c549cbc94500ba706b712c650 commit f8a8bb7bade9575c549cbc94500ba706b712c650 Author: Kristof Provost AuthorDate: 2025-07-01 10:02:03 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:48 +0000 pfctl: Improve duplicate table name warning When creating tables inside anchors, pfctl warned about namespace collisions with global tables, but only in certain cases and with limited information sometimes leaving users clueless. Deferring the check to process_tabledefs() where tables are eventually created, both anchor and table name are known which allows for checking all existing anchors. With this, warn on all duplicates even in dry-runs (`-n') and print quoted names so they can be copied to fix configurations right away. No functional change in parsing or ruleset production. Discussed with and OK sashan Obtained from: OpenBSD, kn , 0de3a0c9ad Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 1 + sbin/pfctl/pfctl.c | 3 --- sbin/pfctl/pfctl.h | 2 +- sbin/pfctl/pfctl_table.c | 26 ++++++++------------------ 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index c59204d3d5a4..0b98bd357a37 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5424,6 +5424,7 @@ process_tabledef(char *name, struct table_opts *opts, int popts) if (pf->opts & PF_OPT_VERBOSE) print_tabledef(name, opts->flags, opts->init_addr, &opts->init_nodes); + warn_duplicate_tables(name, pf->anchor->path); if (!(pf->opts & PF_OPT_NOACTION) && pfctl_define_table(name, opts->flags, opts->init_addr, pf->anchor->path, &ab, pf->anchor->ruleset.tticket)) { diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 88123b17f1b3..b4732d178cbb 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3435,9 +3435,6 @@ main(int argc, char *argv[]) if (pfctl_rules(dev, rulesopt, opts, optimize, anchorname, NULL)) error = 1; - else if (!(opts & PF_OPT_NOACTION) && - (loadopt & PFCTL_FLAG_TABLE)) - warn_namespace_collision(NULL); } if (opts & PF_OPT_ENABLE) diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index 08d48695709e..d8196c129187 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -86,7 +86,7 @@ void pfctl_show_tables(const char *, int); int pfctl_table(int, char *[], char *, const char *, char *, const char *, int); int pfctl_show_altq(int, const char *, int, int); -void warn_namespace_collision(const char *); +void warn_duplicate_tables(const char *, const char *); void pfctl_show_ifaces(const char *, int); void pfctl_show_creators(int); FILE *pfctl_fopen(const char *, const char *); diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 53abea3e1ae1..d1f20761a4f4 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -94,7 +94,8 @@ static const char *istats_text[2][2][2] = { goto _error; \ } \ if (nadd) { \ - warn_namespace_collision(table.pfrt_name); \ + warn_duplicate_tables(table.pfrt_name, \ + table.pfrt_anchor); \ xprintf(opts, "%d table created", nadd); \ if (opts & PF_OPT_NOACTION) \ return (0); \ @@ -576,12 +577,10 @@ pfctl_define_table(char *name, int flags, int addrs, const char *anchor, } void -warn_namespace_collision(const char *filter) +warn_duplicate_tables(const char *tablename, const char *anchorname) { struct pfr_buffer b; struct pfr_table *t; - const char *name = NULL, *lastcoll; - int coll = 0; bzero(&b, sizeof(b)); b.pfrb_type = PFRB_TABLES; @@ -597,22 +596,13 @@ warn_namespace_collision(const char *filter) PFRB_FOREACH(t, &b) { if (!(t->pfrt_flags & PFR_TFLAG_ACTIVE)) continue; - if (filter != NULL && strcmp(filter, t->pfrt_name)) + if (!strcmp(anchorname, t->pfrt_anchor)) continue; - if (!t->pfrt_anchor[0]) - name = t->pfrt_name; - else if (name != NULL && !strcmp(name, t->pfrt_name)) { - coll++; - lastcoll = name; - name = NULL; - } + if (!strcmp(tablename, t->pfrt_name)) + warnx("warning: table <%s> already defined" + " in anchor \"%s\"", tablename, + t->pfrt_anchor[0] ? t->pfrt_anchor : "/"); } - if (coll == 1) - warnx("warning: namespace collision with <%s> global table.", - lastcoll); - else if (coll > 1) - warnx("warning: namespace collisions with %d global tables.", - coll); pfr_buf_clear(&b); } From nobody Mon Jul 7 15:07:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKL719xz61wCy; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKL3bcdz3wQC; Mon, 07 Jul 2025 15:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IDR3N6Zvgn3U+Zz+rMk3L9cHXRDO+dZVeHgWfXDsQEk=; b=D4H8TtitD2Gv8j4IUBQTh/CDo1Z7mMMDST+ukRaGwwhaxKg0+CysyBx37tml72yMpmYapZ Me9m8nIGOAv25hxm8EngJXabq0YB8uq7otmN8Bi/c9HOu3Y3n7uqWmNc0qF5wsszOJCmcE 054T3F8G16mT5a9q8chAGHGamQi2rj8GDS08RQJKVu+LeqTFD+1AQoD5JxvL9tQzIDiMMW DZMG+X6zKrijrDr2gsx9Apna5p5m9TxbZdI/SHzBnvioMyTWWD1cvTJ2iTJibx+i3izihi xDcr04IJU6I+b5vpjRyr3eO3s/toYuA+QlMQfGonH4QDHDUMxUFpPSU6bHKiRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IDR3N6Zvgn3U+Zz+rMk3L9cHXRDO+dZVeHgWfXDsQEk=; b=BhQF14WVIH4ODx1nMtcOG7fSJZwc1GDKZ2Z8iaVaZs4mxiC4XpO5XweuLhlLxVpUSUvT1Z OQ9YmXNQuPK4GkJPw5tXd9teFb1JOCIq7rzlmeafgQ9tGtV1Ecoy6XbAz/ZqvmavsO0V/d 6T0l5bY/tfwOOwBEsH9B1a4F9uba2F98eOOpiCPFt1QVrFrWi9OWfMzAGnuS1GeiH1J+wM L/sFXlRhgHTq7s4AOuvZ1T5HMO6Ueo/tuntUdEaPBBY3fm3TB1AcnX6yanIQrCjxbMtPUp iq8fID01t5Gufs7i4gxhCuH0Zu8Kn2VIix8Uf3JMfRqE8DIAEoRJw/kksSk9ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900870; a=rsa-sha256; cv=none; b=DesjC2JrkTAqgI68Du3shcp1t2v8FCYCttoTT2FpKjSUzNOqY8vZ1VQdmhBMPf3aMs/UiQ sTKmCf0zBvKA2TWinL9m0PfivQ5IwwQaQdvoiBFOyAZdGMOG1g5pA6biGyNbSx1iVtZixK AXSTZC7u+fjQOdmhpdekVwbkOqHR+tQ3NGR6yTI6T6VP3ruf3Im7LdBTPhomA0bkMqWCPD 2xhS1AM/58lhzcQsK5KZesYYvQlovXEUntVjsKxE/8a+2TVmk+jRT/LdI3c5+6moC1zIsd uvi0s6mUgbdwYTeusWUNCgQR0CxaqSgymDz2xsWiJ25zi0Yljc1WHRwPwhLzkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKL2b2YzwF3; Mon, 07 Jul 2025 15:07: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 567F7oWZ016441; Mon, 7 Jul 2025 15:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7oWq016438; Mon, 7 Jul 2025 15:07:50 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:50 GMT Message-Id: <202507071507.567F7oWq016438@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: 714be446a925 - main - pfctl: Defuse `-F all -i interface' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 714be446a92555911b8cbd0f0f480f0dea617fa6 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=714be446a92555911b8cbd0f0f480f0dea617fa6 commit 714be446a92555911b8cbd0f0f480f0dea617fa6 Author: Kristof Provost AuthorDate: 2025-07-01 10:10:00 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:48 +0000 pfctl: Defuse `-F all -i interface' Flushing all filter parameters does not make sense on one specific interface only as already noted. However, the main ruleset as well as all tables were still cleared on such invalid usage. Furthermore, an empty interface name was treated like no interface at all, hence source tracking entries, statistics and interface flags were cleared also. Immediately error out if `-i' is given regardless of its argument before flushing anything. OK sashan Obtained from: OpenBSD, kn , 7863d3574f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index b4732d178cbb..169b75f202d1 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3365,6 +3365,11 @@ main(int argc, char *argv[]) pfctl_clear_stats(pfh, opts); break; case 'a': + if (ifaceopt) { + warnx("don't specify an interface with -Fall"); + usage(); + /* NOTREACHED */ + } pfctl_flush_eth_rules(dev, opts, anchorname); pfctl_flush_rules(dev, opts, anchorname); pfctl_flush_nat(dev, opts, anchorname); From nobody Mon Jul 7 15:07:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKM6xvvz61w2p; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKM4ZZVz3wHV; Mon, 07 Jul 2025 15:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMzdRdJZk64YxwkBXCn8MFATazsQBb5sDUoW5sy+O08=; b=hSbeGGQN9m3PL+HDTz/BYVDn40MKKeu5Q7bobebLMZ1LFyLRXocFDzPr+cdsqjlUph4uL2 hwZyy2hJD2N7fpTYXakIcHMcAjJyeNkuMOp2y/PcKBtuy60C8pXsXHrXb0Rj/rQsS5Ra2Y RgrEptFiHXDoxpmQjinm6MfzVBgM4IudLlKIZEzFYLuer+Rrjpc9WsQ3lpqW2o7QcM2ns2 e/ifAop6catEip/HcsAKXn5pmaacHAzkAiLU0Od3sR0lNz+Z4qkQ4xcswKddNuBQDRZmab HD+dEkKeJMLnt4NZFFJW5eX0sg3F5zsWulUn48QwAjPftYS8ATOto4B0zF5j1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMzdRdJZk64YxwkBXCn8MFATazsQBb5sDUoW5sy+O08=; b=mfkWD6b0Ia/Ep+eDhf5PYDvY+aA7QKs+/BFXV4BiO5uUM/mg7u5l8jsUbbFECPJjyw1hY6 +THn7Kgh0FqA+FUJcbLuvFAbCmEsFmQYdWZEaxUtPKIyHjihQBt8N+GfrQF3/9mv7qWhZX kPPSUA1hlvPNCBJhB5JZp2GLFh03NmRsomnawTMPods2Xp9Cgvq+nNz74Zz8Ey5D4RiaKf QTOQ8upvPNhyh8tU4YHTzCtMARRuXHQC1iisFxGfS3cp7Oh/GIBJwyc8/Y0DHd9qcK60TK QieLIOYneWZXwMGbF8GZJB6nThLDXpou93MAzH674fUCl8m1bcTJ2kiTTH7yvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900871; a=rsa-sha256; cv=none; b=fsihws7rdqUxYhMxKlN+poFbqrSvX9AKpaVzNeyVwsVWpnyDYX12xNz8TVVUIHnFP+I+Le QkXd7B8aK6GFkgQv2xzsK1xXBCgTcV3JaE08nzDWLSSXWR0l998IYtBXBHRMRhXTbcsDlJ 54ajtMY2XdZvlzV/fCNSaEngpG9P/kqjxra1VUuceSKVPrttofkpHcu/0KrmoKKz6wC3ds KbSUVgx5AsTKF6TJFTQAuZxzKziiVD+bzZKe7WOmqzOSaO0meyB1Gxkj50s95CgvoxZKXZ AxZeUS6fMzFYQQV/B1VE9wZl/8BF/yii/BaaFLbzaiD5BsHV8AJhlDNEOcX8vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKM3DZxzwKH; Mon, 07 Jul 2025 15:07: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 567F7pRY016476; Mon, 7 Jul 2025 15:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7pQv016473; Mon, 7 Jul 2025 15:07:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:51 GMT Message-Id: <202507071507.567F7pQv016473@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: b38e96f0232e - main - pfctl: Use mnemonic PFCTL_SHOW_* macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b38e96f0232e1bb353ca556ace6c1885db879289 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b38e96f0232e1bb353ca556ace6c1885db879289 commit b38e96f0232e1bb353ca556ace6c1885db879289 Author: Kristof Provost AuthorDate: 2025-07-01 10:12:34 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Use mnemonic PFCTL_SHOW_* macros Terminate string with null character. Tweak spacing while here, no object change. Feedback and OK procter, OK sceloha Obtained from: OpenBSD, kn , 2706705609 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 169b75f202d1..f133a106c69c 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2115,7 +2115,6 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs, } } else if (pf->opts & PF_OPT_VERBOSE) printf("\n"); - } if (pf->optimize && rs_num == PF_RULESET_FILTER) @@ -2958,7 +2957,7 @@ pfctl_show_anchors(int dev, int opts, char *anchorname) errc(1, ret, "DIOCGETRULESET"); if (!strcmp(pr.name, PF_RESERVED_ANCHOR)) continue; - sub[0] = 0; + sub[0] = '\0'; if (pr.path[0]) { strlcat(sub, pr.path, sizeof(sub)); strlcat(sub, "/", sizeof(sub)); @@ -3307,12 +3306,14 @@ main(int argc, char *argv[]) 0); pfctl_show_nat(dev, path, opts, anchorname, 0, 0); - pfctl_show_rules(dev, path, opts, 0, anchorname, 0, 0); + pfctl_show_rules(dev, path, opts, PFCTL_SHOW_RULES, + anchorname, 0, 0); pfctl_show_altq(dev, ifaceopt, opts, 0); pfctl_show_states(dev, ifaceopt, opts); pfctl_show_src_nodes(dev, opts); pfctl_show_status(dev, opts); - pfctl_show_rules(dev, path, opts, 1, anchorname, 0, 0); + pfctl_show_rules(dev, path, opts, PFCTL_SHOW_LABELS, + anchorname, 0, 0); pfctl_show_timeouts(dev, opts); pfctl_show_limits(dev, opts); pfctl_show_tables(anchorname, opts); From nobody Mon Jul 7 15:07:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKP3hwzz61w9t; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKN5dmkz3wHh; Mon, 07 Jul 2025 15:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s4MnF8N1J0jXmUPWkN/JYtx5/C3hmn8l0Bwl5ae6A94=; b=xzM2VrRqC34J1rWPeSOHcTSUna243HIo9yveK/7CEi+kzHjnn+AihvBvz5gp4r5NB+AFbK Pn9PCQxX9PKAWTF3SCL8uBlY4Z+gLVCPglK56kwyRpNbOWTSkpLc0QLM6GY7Zr5YIPld7Y G3Q+Me3N7E1hkNUwIrVZDIfDKpOA7msOyf85aKgR+kCMJGKEi6e419pKXoPjJ33fN+XyHD WizwsKypFG1n29OfVW/gAWjjiaH8gENnjm9PZuhmD1y1wCVk2mifqm0T6RvlLHLrmyN84+ YAo/zW7dpYgplGfzBvPHKlCu9koWxeb19ATma6SFYytTdwaYqI50efyTe6RSMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s4MnF8N1J0jXmUPWkN/JYtx5/C3hmn8l0Bwl5ae6A94=; b=u5V7IkgwVW3AMKivnGEu5yDzMcuSB0I28hJuKF7zKQi/lTubF31vWQPAFEOWByYJJ4k/UR z9D/9VyX7banaPYUHOodkTetv7vR/udC0Z/yMWttgIFTpDFt1kTsUXA6cNSFBdOtZGG/w4 uvRm30+cySb555d4ggVjw4nvv1MUiFZnKK2SM/AvnkYlwfLf5TzXcKaScY55C64D7ek0b1 9wLHZjfQ57gHl5YBHY8fA+DJZgNcZkAtLy3EM7vZpaUcHr9KeCEan/9FlHwGSL91f9d1Zt +Snpop+W2ey1qUSxZqlmjDREcAweYIzvWCQztxSQ9KMkBHZE8oMoUs3VHZiAAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900872; a=rsa-sha256; cv=none; b=IaZOtYXBFhyVJxsaPfNpl1mJnV8ItOE46g4xCWJfRp+brHKRXG6i1dIEo87WljrTVMIIPd ik/aUjL8y/WYwsgU2zP5ZKd4+fCELBeN5Juaz/ynIrU6j+02BB6mDSU+Wjy6Wz8gTDQdzP zZ5xVJuaPWrTzCprRPm7O9Vbsqn9AUkOPbuOaI3oTnt38OuMUg1xOokkDi3PeIZtity7xq gGGV7sb4Dh6sfLkb+OkvyTBoDseew1fh/e68ql80xh2eh2xVnfLpRATVgMA5yPUs8ns6h8 hv9pxbwK3vv3Edv1noLxruEzz0CZY0OarkKCxOoNU9Jr8tBNw6vY8fBFGNkJhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKN4TKpzwGx; Mon, 07 Jul 2025 15:07: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 567F7qUk016512; Mon, 7 Jul 2025 15:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7qKU016509; Mon, 7 Jul 2025 15:07:52 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:52 GMT Message-Id: <202507071507.567F7qKU016509@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: 9bf3979d1b17 - main - pfctl.8: Mention that -r does reverse DNS lookups for tables as well List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9bf3979d1b17a2b019ed35ab661e44cc8a0f88ce Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf3979d1b17a2b019ed35ab661e44cc8a0f88ce commit 9bf3979d1b17a2b019ed35ab661e44cc8a0f88ce Author: Kristof Provost AuthorDate: 2025-07-01 10:15:36 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl.8: Mention that -r does reverse DNS lookups for tables as well OK benno Obtained from: OpenBSD, kn , 3ba17eef64 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index c7fad58262dc..85294dda949f 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,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 June 30, 2025 +.Dd July 1, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -401,7 +401,7 @@ Only print errors and warnings. Load only the filter rules present in the rule file. Other rules and options are ignored. .It Fl r -Perform reverse DNS lookups on states when displaying them. +Perform reverse DNS lookups on states and tables when displaying them. .It Fl s Ar modifier Show the filter parameters specified by .Ar modifier From nobody Mon Jul 7 15:07:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKQ1sDcz61w9v; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKP5CkZz3w8L; Mon, 07 Jul 2025 15:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSWrJ2pDzGoefLNHjJBQ8D8i7YHjVK+R6TQ19OD8fbU=; b=cL6+M+zteeOIp4a59KE6/yZzb8lgGv/CMyk3pCL7R/13oAHi8Rh6XNZkh6VUd5hMkGACtW 0DxX9k/B1XElRtQaVHMnQZmpcKfBuGdI95nziuW3ztGulFlejDYhy3AVGy6nakAWs/QbEq NkQts3kCyqoQLd4lzqPSAyW6qf2hqC/0tBSLGqpL3t9pQWFbN3BfPomUGqiagcC9AZo/35 Vh8aqvdbWy4iKrBcwFs8isxIK/FxUnuDSOLyFpL+BfdDRpT2P8/o8qb7TT6pxWduNKiHbp AMg/dXw/ladzBZjiCVaRhynS5ko4ETjNT5CM2pMIQn1F/9dzFtYaKVFNw57rBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSWrJ2pDzGoefLNHjJBQ8D8i7YHjVK+R6TQ19OD8fbU=; b=NuEACjibVjI7IBXOC0vaIqkzS70owar/ldkdcQso8LGkfjiohtwcZcHe+u0sAbTMWuR6Ie wtlouEoVfH2Gn9pPlHjr5PA0FGol8e0eqeNjzqliE4kI5D7CBg/EUUO8vgAOdz0+3/UHrI 1b5rbpOT8vFOkWvDgd+7zINzGkGqlthEh4m8t8Qk1aoyn+1e9iT+0kbsres5dfInftEWuN dz52LwObqnC01psJoH4+TEfKexEOZPTpT8aHQNhIaqp/QA3F34FE5hmO/10kigC6HbH7+v U2AL3ncXaBZd2hzsSxu8af/8LXsQDdrIRsL3NF9TtbF1rUlbDdyNGtFhfxO6Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900873; a=rsa-sha256; cv=none; b=Ct1Q+IrjuKV7twGXtMPOXSylpcmpDlv6hqWKNeBLvjHAigWK6yKeOK+6DWL2SQ//AGqX9P yvUddiAiacPuIQp58FIDnC06JhWmdjNLFythgRCu7uSZXEZzg/OGBsFJOO97seoAFt+Fvg FH77aue1dlmu0qoPxpfsbyLrLsjfFPqWM+6teSGxQFuDy6SKOzzaOqzxq+iw68AcQgIhXE /4ch1ZYbCGFqFsoSchWUAKe3+zS/I+Gv/yRjg4532JZONjoX4PC5zQM8IG/CnC+kLfamOg MYuEP1qv3M4I75kFS+qjoyNG41B1x6YYb+hFCk5Mz9Kx5SazRgIvre4pD9LDdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKP4llZzwGy; Mon, 07 Jul 2025 15:07: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 567F7rgD016552; Mon, 7 Jul 2025 15:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7rPh016547; Mon, 7 Jul 2025 15:07:53 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:53 GMT Message-Id: <202507071507.567F7rPh016547@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: 058422752727 - main - pfctl: Simplify lookups when killing entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 0584227527271b18fb3164522c0362a5df2f3732 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0584227527271b18fb3164522c0362a5df2f3732 commit 0584227527271b18fb3164522c0362a5df2f3732 Author: Kristof Provost AuthorDate: 2025-07-02 09:41:58 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Simplify lookups when killing entries Killing source tracking or state entries by hostname or CIDR would pass given keys twice to getaddrinfo(3): once to resolve/parse and again to parse the numerical address in case a prefix was specified. Avoid this overhead by making pfctl_addrprefix() resolve, pass and mask in one go and return the list of IPs to the callers. This notably simplifies both logic and sanity checks around prefix length and address family. While here, also pass -N along such that -k and -K can be restricted to not use DNS. Discussed with procter sashan, OK sashan Obtained from: OpenBSD, kn , 4a32e6d5fb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 86 +++++++++++++++++++++--------------------------------- 1 file changed, 34 insertions(+), 52 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index f133a106c69c..10183084ceec 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -77,7 +77,8 @@ void pfctl_flush_nat(int, int, char *); int pfctl_clear_altq(int, int); void pfctl_clear_src_nodes(int, int); void pfctl_clear_iface_states(int, const char *, int); -void pfctl_addrprefix(char *, struct pf_addr *); +struct addrinfo * + pfctl_addrprefix(char *, struct pf_addr *, int); void pfctl_kill_src_nodes(int, int); void pfctl_net_kill_states(int, const char *, int); void pfctl_gateway_kill_states(int, const char *, int); @@ -539,35 +540,36 @@ pfctl_clear_iface_states(int dev, const char *iface, int opts) fprintf(stderr, "%d states cleared\n", killed); } -void -pfctl_addrprefix(char *addr, struct pf_addr *mask) +struct addrinfo * +pfctl_addrprefix(char *addr, struct pf_addr *mask, int numeric) { char *p; const char *errstr; int prefix, ret_ga, q, r; struct addrinfo hints, *res; - if ((p = strchr(addr, '/')) == NULL) - return; - - *p++ = '\0'; - prefix = strtonum(p, 0, 128, &errstr); - if (errstr) - errx(1, "prefix is %s: %s", errstr, p); - bzero(&hints, sizeof(hints)); - /* prefix only with numeric addresses */ - hints.ai_flags |= AI_NUMERICHOST; + hints.ai_socktype = SOCK_DGRAM; /* dummy */ + if (numeric) + hints.ai_flags = AI_NUMERICHOST; + + if ((p = strchr(addr, '/')) != NULL) { + *p++ = '\0'; + /* prefix only with numeric addresses */ + hints.ai_flags |= AI_NUMERICHOST; + } if ((ret_ga = getaddrinfo(addr, NULL, &hints, &res))) { errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); /* NOTREACHED */ } - if (res->ai_family == AF_INET && prefix > 32) - errx(1, "prefix too long for AF_INET"); - else if (res->ai_family == AF_INET6 && prefix > 128) - errx(1, "prefix too long for AF_INET6"); + if (p == NULL) + return (res); + + prefix = strtonum(p, 0, res->ai_family == AF_INET6 ? 128 : 32, &errstr); + if (errstr) + errx(1, "prefix is %s: %s", errstr, p); q = prefix >> 3; r = prefix & 7; @@ -586,7 +588,8 @@ pfctl_addrprefix(char *addr, struct pf_addr *mask) (0xff00 >> r) & 0xff; break; } - freeaddrinfo(res); + + return (res); } void @@ -596,7 +599,6 @@ pfctl_kill_src_nodes(int dev, int opts) struct addrinfo *res[2], *resp[2]; struct sockaddr last_src, last_dst; int killed, sources, dests; - int ret_ga; killed = sources = dests = 0; @@ -606,12 +608,9 @@ pfctl_kill_src_nodes(int dev, int opts) memset(&last_src, 0xff, sizeof(last_src)); memset(&last_dst, 0xff, sizeof(last_dst)); - pfctl_addrprefix(src_node_kill[0], &psnk.psnk_src.addr.v.a.mask); + res[0] = pfctl_addrprefix(src_node_kill[0], + &psnk.psnk_src.addr.v.a.mask, (opts & PF_OPT_NODNS)); - if ((ret_ga = getaddrinfo(src_node_kill[0], NULL, NULL, &res[0]))) { - errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); - /* NOTREACHED */ - } for (resp[0] = res[0]; resp[0]; resp[0] = resp[0]->ai_next) { if (resp[0]->ai_addr == NULL) continue; @@ -638,14 +637,9 @@ pfctl_kill_src_nodes(int dev, int opts) memset(&psnk.psnk_dst.addr.v.a.mask, 0xff, sizeof(psnk.psnk_dst.addr.v.a.mask)); memset(&last_dst, 0xff, sizeof(last_dst)); - pfctl_addrprefix(src_node_kill[1], - &psnk.psnk_dst.addr.v.a.mask); - if ((ret_ga = getaddrinfo(src_node_kill[1], NULL, NULL, - &res[1]))) { - errx(1, "getaddrinfo: %s", - gai_strerror(ret_ga)); - /* NOTREACHED */ - } + res[1] = pfctl_addrprefix(src_node_kill[1], + &psnk.psnk_dst.addr.v.a.mask, + (opts & PF_OPT_NODNS)); for (resp[1] = res[1]; resp[1]; resp[1] = resp[1]->ai_next) { if (resp[1]->ai_addr == NULL) @@ -699,7 +693,7 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) struct sockaddr last_src, last_dst; unsigned int newkilled; int killed, sources, dests; - int ret_ga, ret; + int ret; killed = sources = dests = 0; @@ -718,15 +712,12 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) state_killers = 1; } - pfctl_addrprefix(state_kill[0], &kill.src.addr.v.a.mask); + res[0] = pfctl_addrprefix(state_kill[0], + &kill.src.addr.v.a.mask, (opts & PF_OPT_NODNS)); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; - if ((ret_ga = getaddrinfo(state_kill[0], NULL, NULL, &res[0]))) { - errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); - /* NOTREACHED */ - } for (resp[0] = res[0]; resp[0]; resp[0] = resp[0]->ai_next) { if (resp[0]->ai_addr == NULL) continue; @@ -753,14 +744,9 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) memset(&kill.dst.addr.v.a.mask, 0xff, sizeof(kill.dst.addr.v.a.mask)); memset(&last_dst, 0xff, sizeof(last_dst)); - pfctl_addrprefix(state_kill[1], - &kill.dst.addr.v.a.mask); - if ((ret_ga = getaddrinfo(state_kill[1], NULL, NULL, - &res[1]))) { - errx(1, "getaddrinfo: %s", - gai_strerror(ret_ga)); - /* NOTREACHED */ - } + res[1] = pfctl_addrprefix(state_kill[1], + &kill.dst.addr.v.a.mask, + (opts & PF_OPT_NODNS)); for (resp[1] = res[1]; resp[1]; resp[1] = resp[1]->ai_next) { if (resp[1]->ai_addr == NULL) @@ -814,7 +800,6 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) struct sockaddr last_src; unsigned int newkilled; int killed = 0; - int ret_ga; if (state_killers != 2 || (strlen(state_kill[1]) == 0)) { warnx("no gateway specified"); @@ -832,12 +817,9 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; - pfctl_addrprefix(state_kill[1], &kill.rt_addr.addr.v.a.mask); + res = pfctl_addrprefix(state_kill[1], &kill.rt_addr.addr.v.a.mask, + (opts & PF_OPT_NODNS)); - if ((ret_ga = getaddrinfo(state_kill[1], NULL, NULL, &res))) { - errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); - /* NOTREACHED */ - } for (resp = res; resp; resp = resp->ai_next) { if (resp->ai_addr == NULL) continue; From nobody Mon Jul 7 15:07:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKR1pZwz61w7Z; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKQ6Cfxz3wC0; Mon, 07 Jul 2025 15:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gzXcuzRfhbhH9BvcIguQeGCVK+LnOPgNZbKSA/rCJ5A=; b=B3Qk0c7FhVuYZRVtrTA1WycrrmGCt1FBR3Exz+fbCm6dCM6CKGZONQVNKBhy1wfwDJLq8B rKITrqsU784l04d2lCu31qnRgaJIa5U6M8SBMXMW2MUjKXbSq/YGO+aeHFaZTOgTT+XfSF ehPbwORMMRUKrVIcwWv409TrJ6nxKY7VidiuqcqjV/5jqWloS2bscHj/CRraRS4vQg8Jo4 IxmpTDdCv3C0+fHHwT9vau4bWeM/O4KVqNbpOWsUPxVCbkuT92StNx7c137TKhGuTK777Y /RVQh/OkZwvHU3VqKzy9seuH5n3UeY77/ESeEsct/aCfzhvVGdix8/p2Vg5tiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gzXcuzRfhbhH9BvcIguQeGCVK+LnOPgNZbKSA/rCJ5A=; b=b+fopA34VGv1Rr6e6Bo92cG8RuB7NlNmvDROjuYqUPWYxGt8zGryry+Y/hczylFBVk4b0X FFBf3Fqr20wpM6P6GL26vHh2VJRJBha+xvfQIDLmOO4H9Yxd4oelfDgHy9muaCIcUorWo3 FRD5c+AQ+BfkQKfgEE5gYNZU+NdMRn5ydh/2RKCKhxxsKa06cAWarbmfGs/r2Q+R59wLWe 96Iraq/09NIPQeWyvqz5whH6sK21cMixIqO7QeC5hDYbeJ6KNzvkj2t41oWc6EpLtA5JNy 3ve4UIMpHoSKZAvfdiPNKEiumIEQbezNz2O0YhcCyP59PlWwthz3eeBf/EVekQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900874; a=rsa-sha256; cv=none; b=emKVlQRJlkKCLQ5TbE4reME0lcpXj2KKGtwkzfFkBAHqFtx0ZUmJXa3nh3X1dYn/01H38k c0tBkB9NJtoLFdd9bDNPzZQbtWLL3PvY4UhHGQv9L0HvcZVFmG/SBDk4QT9dACBeO0Kq92 //FJCfV819SJZcwQNMqfAN9/gd/anmVcR5mIjEK45StNS+wjupZeLM4VE9WFzmml83F3Ha y3onM3ROKWlvpZzE2XWFyZi0pkbd3ZyhRuO0Bz8upzE9y9jaBNtTiCRAd6Aom2xHy6V8me Qq9wKaFBulWV1VFlZpP8h97RN5cmVueXy4hwrJ30kd7LN1Flh4YUjH2dAxbs0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKQ5q2YzvGV; Mon, 07 Jul 2025 15:07: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 567F7s5R016586; Mon, 7 Jul 2025 15:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7s2f016583; Mon, 7 Jul 2025 15:07:54 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:54 GMT Message-Id: <202507071507.567F7s2f016583@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: 9d74a1b5d6cf - main - pfctl: Make -N and -r mutually exclusive List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9d74a1b5d6cfde02d27786c59ccafafdf6d6fe63 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d74a1b5d6cfde02d27786c59ccafafdf6d6fe63 commit 9d74a1b5d6cfde02d27786c59ccafafdf6d6fe63 Author: Kristof Provost AuthorDate: 2025-07-02 09:43:43 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Make -N and -r mutually exclusive Either disable DNS or enable additional reverse lookups, but not both. OK benno Obtained from: OpenBSD, kn , b294e41e93 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 6 +++++- sbin/pfctl/pfctl.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 85294dda949f..0c4a7b519bf6 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,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 July 1, 2025 +.Dd July 2, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -402,6 +402,10 @@ Load only the filter rules present in the rule file. Other rules and options are ignored. .It Fl r Perform reverse DNS lookups on states and tables when displaying them. +.Fl N +and +.Fl r +are mutually exclusive. .It Fl s Ar modifier Show the filter parameters specified by .Ar modifier diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 10183084ceec..d3614f5f7c59 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3156,6 +3156,9 @@ main(int argc, char *argv[]) } } + if ((opts & PF_OPT_NODNS) && (opts & PF_OPT_USEDNS)) + errx(1, "-N and -r are mutually exclusive"); + if (tblcmdopt == NULL ^ tableopt == NULL) usage(); From nobody Mon Jul 7 15:07:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKT2t4Bz61w2w; Mon, 07 Jul 2025 15:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKT10rpz3wRD; Mon, 07 Jul 2025 15:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z5bWVioByw1YT4oHJkU0BxiqCnbFKg3G5hanlGCh0uI=; b=sC0RGJboGrR71ZeeF5MglwTws8c52bUqU8JtIv0uyPtSrv0AlFx9F9yIFlWwHK1gkjehF7 dT0KUF6JcUyKWaBrQxR+yafosp4Rrz/GYZXB5FAcH36YA/PwBPNz0nt964iO4BUnS+NM7A v3s8gR9aL2jUj9D+XfOk27TeGXoHL2e+9yUUNf/mhqcQqem1Pv2jIVYbc9foEH+OSFheDR R3xfAHwMSTED2uX5W2io3/MbutN0RK7oUvJqGLiJ+6jPmEbCT0edUJKNycEs2+HT5mRIFt EdU9GutRnCEu0ChpVieIeiM99+VSZrXg72KRFCTDTIY8U0S6xqIm6sRXKnB75A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z5bWVioByw1YT4oHJkU0BxiqCnbFKg3G5hanlGCh0uI=; b=btt5pgMREkYAZ+qyZHToug9umKPy8/AFKRLL/kcC+23PGf0XPQ1Sh2jsP9udCPEJm8zx9Y EkZ/ShWmr/WqzSZPpD+GFhIf/aTnW6CovXmeV8Miy/QFN9prxHN36VTO/ABy9bkN538Lqv /pfRoBRTwkNQcRiyj8XpnapqZsUuIQxDtqiRG5JnqHwPUOD8FWtvxMS7PNcFLtbqfUivEK X/XMrHk+caDEpitjWEUgp+f+MlZ7Af6BJJnaCufdyhyes7YiLrZpyu7meSqpqt0Qup0o3d zF0XgRVgZo9r9dWYlAycYnPyAKVEt7gy3lmJ+XARZjxOEuTaX/1GR0FFEPD1bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900877; a=rsa-sha256; cv=none; b=VQ0q8C8dj4tx8ognvcZYl9Rclie9CFUq0qiS8sz8UCMl7hRfeHBEx06GTQWc1htmpCShGb 8MEZIttLFfS0EydbPKEoz9yvJwbSNi1lnPuXTgR8J/L1OTjuWCZdST+ZZwBAKvUn7/KE1j bClcZjaJuMT794gYGDL7JNEwlIwE5hRhi8sl5VFH/Uf5qjKuRZzPqRX3S3w6ixvje2/TRN tk4SBN7anpcS7TCLBloGjDy6gw5qHgrwsOcs1ENa8HdDDz1SE0T20CcsWZ4aq/c0QWl3GB aYWwNOd7Z3JydEu29eqGhKLpKUAHspwsY+UAiDRu/lxBEfbynwjssUrS3LyDCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKT0ZxqzwF4; Mon, 07 Jul 2025 15:07: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 567F7usL016662; Mon, 7 Jul 2025 15:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7uri016659; Mon, 7 Jul 2025 15:07:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:56 GMT Message-Id: <202507071507.567F7uri016659@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: 7ea14ad4db6b - main - pfctl: Unify anchor name sanity checks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 7ea14ad4db6bd840c05eaa8b4ebb941c983a9424 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7ea14ad4db6bd840c05eaa8b4ebb941c983a9424 commit 7ea14ad4db6bd840c05eaa8b4ebb941c983a9424 Author: Kristof Provost AuthorDate: 2025-07-02 12:46:51 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Unify anchor name sanity checks For anchor names, make `load anchor' use the same grammar as `anchor' and merge unique checks from both places so that anchor names are validated regardless of the specific rule at hand. OK sashan Obtained from: OpenBSD, kn , 0f06db3497 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 0b98bd357a37..2ebd528443fe 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -921,7 +921,22 @@ varset : STRING '=' varstring { } ; -anchorname : STRING { $$ = $1; } +anchorname : STRING { + if (strlen(pf->anchor->path) + 1 + + strlen($1) >= PATH_MAX) { + free($1); + yyerror("anchor name is longer than %u", + PATH_MAX - 1); + YYERROR; + } + if ($1[0] == '_' || strstr($1, "/_") != NULL) { + free($1); + yyerror("anchor names beginning with '_' " + "are reserved for internal use"); + YYERROR; + } + $$ = $1; + } | /* empty */ { $$ = NULL; } ; @@ -974,13 +989,6 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto YYERROR; } - if ($2 && ($2[0] == '_' || strstr($2, "/_") != NULL)) { - free($2); - yyerror("anchor names beginning with '_' " - "are reserved for internal use"); - YYERROR; - } - pfctl_init_rule(&r); if (pf->astack[pf->asd + 1]) { @@ -1162,14 +1170,11 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto } ; -loadrule : LOAD ANCHOR string FROM string { +loadrule : LOAD ANCHOR anchorname FROM string { struct loadanchors *loadanchor; - if (strlen(pf->anchor->path) + 1 + - strlen($3) >= MAXPATHLEN) { - yyerror("anchorname %s too long, max %u\n", - $3, MAXPATHLEN - 1); - free($3); + if ($3 == NULL) { + yyerror("anchor name is missing"); YYERROR; } loadanchor = calloc(1, sizeof(struct loadanchors)); From nobody Mon Jul 7 15:07:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKS2KvCz61w5x; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKS0fRWz3wR0; Mon, 07 Jul 2025 15:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCeH2rB1lxSL0Tvk+IyRNfoIcNM4/zWe9wpetafpS2g=; b=LGaoeOycFIJhpfLTmSNnBGba/TFdJKjpX0clirzhNG7VCAnSybY7M8kPlJdQ1YeBOGvQfn HVyku0JJmfgc/+L6G2qKvTBeBSyig7iC9whAhuOQYF/7VhpH1YYkooBcVChKsJ3iYs829z EKNsupG89AxRsWqJJym7Yixcxnlvf8CDzx9wADCrV1yQtkQg6mLA/eKpB0Kfalcuck7+ok ujGTKTuyoPhtbkiH0+2A+j0FYwGvYvRtTEYsVWrfzNy1h0IqP3V3KQOazxs2Ivefcy5a6G cC7BOdfN477VBrKP2lbyXCr5UpzaKdnNRzdP0qrXSc0gMEwZR3Qyb0OA1IvNVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCeH2rB1lxSL0Tvk+IyRNfoIcNM4/zWe9wpetafpS2g=; b=AllRrQU4sga/KTlHSnOWdu0I1W0r16+LnXCL3WzLyl1j4AGFmC20YQeexUo7STcgdUZCQP zD1MtrA8givHVCWQIxcicqyc602AEhouwFijdT+LStg8k/Xc9+rKlF/UQmsS41IOHDS0dg hs9BRrGFMFUa73sRwULa9qB57G6z47ZLtXXOvnoQDWPtziTnEfKdQmwa6oew8AozDyPRoU MnsHKsU/3stz72pAEQK/O0oXtDMiI5HrfacvHU3cUdujmO4MWZ9MjHLdCBb5jdWK1CRVNu r6Lfm9tpA0WFmB5U63xLTLUfFwLwaUxM7Ef8KHOiAG1wqt5z/SNuhQc6USkkJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900876; a=rsa-sha256; cv=none; b=kkbrgHhJtGiX4C/N5BXYh/TVS3jbQcNZdNBNg6Q7rz9cC2FanfaCqQjAgfg+eX2K/kIZKi 9ADmR211pYD4hVqeqO0MJV/mnnsbZIQp2m/d2qog/fNdS1IEgh79Sv5VINReyQCIgRM2ke XxRkA83Fd8dDdGK2doeS311YtxpKdJ8+Skq7iHRDjZ8juFnyC6UsIVEVYYI+RNvzVWTXtY RR/tl+h57ngx8xL0THWlRkYBOSxrfZCrX9ATYrP7T/it4HVWQAKlqGLKNl+Q2T0zDbYRnt bJfT6CEqfmH0Y8ZdDbBggrj8umYFAxF0BzTWhcHQLdShrNHreCpOIvVfUYS7sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKR6T66zwC2; Mon, 07 Jul 2025 15:07: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 567F7tia016627; Mon, 7 Jul 2025 15:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7thv016624; Mon, 7 Jul 2025 15:07:55 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:55 GMT Message-Id: <202507071507.567F7thv016624@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: ada0846f9303 - main - pfctl: Reuse copy_satopfaddr() when killing entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: ada0846f9303a69f6844f54467189c9d2e8d80d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ada0846f9303a69f6844f54467189c9d2e8d80d5 commit ada0846f9303a69f6844f54467189c9d2e8d80d5 Author: Kristof Provost AuthorDate: 2025-07-02 09:52:10 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Reuse copy_satopfaddr() when killing entries Recently introduced in pfctl_parser.c r1.333, this helper nicely simplifies code when copying IPs based on their address family, so use it in five other places when killing state or source node entries. All addresses copied in these code paths result from either pfctl_parse_host() or pfctl_addrprefix() which guarantee the address family set to AF_INET or AF_INET6. Therefore, effectively relaxing the case of unhandled families from errx(3) in callers to warnx(3) in copy_satopfaddr() is safe since it's never reached. OK sashan Obtained from: OpenBSD, kn , 0ff82421d8 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 78 ++++++++--------------------------------------- sbin/pfctl/pfctl_parser.c | 1 - sbin/pfctl/pfctl_parser.h | 2 ++ 3 files changed, 14 insertions(+), 67 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index d3614f5f7c59..e490e933db5f 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -622,15 +622,7 @@ pfctl_kill_src_nodes(int dev, int opts) psnk.psnk_af = resp[0]->ai_family; sources++; - if (psnk.psnk_af == AF_INET) - psnk.psnk_src.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[0]->ai_addr)->sin_addr; - else if (psnk.psnk_af == AF_INET6) - psnk.psnk_src.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[0]->ai_addr)-> - sin6_addr; - else - errx(1, "Unknown address family %d", psnk.psnk_af); + copy_satopfaddr(&psnk.psnk_src.addr.v.a.addr, resp[0]->ai_addr); if (src_node_killers > 1) { dests = 0; @@ -654,18 +646,8 @@ pfctl_kill_src_nodes(int dev, int opts) dests++; - if (psnk.psnk_af == AF_INET) - psnk.psnk_dst.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[1]-> - ai_addr)->sin_addr; - else if (psnk.psnk_af == AF_INET6) - psnk.psnk_dst.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[1]-> - ai_addr)->sin6_addr; - else - errx(1, "Unknown address family %d", - psnk.psnk_af); - + copy_satopfaddr(&psnk.psnk_src.addr.v.a.addr, + resp[1]->ai_addr); if (ioctl(dev, DIOCKILLSRCNODES, &psnk)) err(1, "DIOCKILLSRCNODES"); killed += psnk.psnk_killed; @@ -729,15 +711,7 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) kill.af = resp[0]->ai_family; sources++; - if (kill.af == AF_INET) - kill.src.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[0]->ai_addr)->sin_addr; - else if (kill.af == AF_INET6) - kill.src.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[0]->ai_addr)-> - sin6_addr; - else - errx(1, "Unknown address family %d", kill.af); + copy_satopfaddr(&kill.src.addr.v.a.addr, resp[0]->ai_addr); if (state_killers > 1) { dests = 0; @@ -761,17 +735,8 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) dests++; - if (kill.af == AF_INET) - kill.dst.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[1]-> - ai_addr)->sin_addr; - else if (kill.af == AF_INET6) - kill.dst.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[1]-> - ai_addr)->sin6_addr; - else - errx(1, "Unknown address family %d", - kill.af); + copy_satopfaddr(&kill.src.addr.v.a.addr, + resp[1]->ai_addr); if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) errc(1, ret, "DIOCKILLSTATES"); @@ -830,16 +795,8 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) kill.af = resp->ai_family; - if (kill.af == AF_INET) - kill.rt_addr.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp->ai_addr)->sin_addr; - else if (kill.af == AF_INET6) - kill.rt_addr.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp->ai_addr)-> - sin6_addr; - else - errx(1, "Unknown address family %d", kill.af); - + copy_satopfaddr(&kill.rt_addr.addr.v.a.addr, + resp->ai_addr); if (pfctl_kill_states_h(pfh, &kill, &newkilled)) err(1, "DIOCKILLSTATES"); killed += newkilled; @@ -984,8 +941,6 @@ pfctl_parse_host(char *str, struct pf_rule_addr *addr) { char *s = NULL, *sbs, *sbe; struct addrinfo hints, *ai; - struct sockaddr_in *sin4; - struct sockaddr_in6 *sin6; s = strdup(str); if (!s) @@ -1008,19 +963,10 @@ pfctl_parse_host(char *str, struct pf_rule_addr *addr) if (getaddrinfo(s, sbs, &hints, &ai) != 0) goto error; - switch (ai->ai_family) { - case AF_INET: - sin4 = (struct sockaddr_in *)ai->ai_addr; - addr->addr.v.a.addr.v4 = sin4->sin_addr; - addr->port[0] = sin4->sin_port; - break; - - case AF_INET6: - sin6 = (struct sockaddr_in6 *)ai->ai_addr; - addr->addr.v.a.addr.v6 = sin6->sin6_addr; - addr->port[0] = sin6->sin6_port; - break; - } + copy_satopfaddr(&addr->addr.v.a.addr, ai->ai_addr); + addr->port[0] = ai->ai_family == AF_INET6 ? + ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port : + ((struct sockaddr_in *)ai->ai_addr)->sin_port; freeaddrinfo(ai); free(s); diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 1db98c6103d4..a213487fb648 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -66,7 +66,6 @@ #include "pfctl_parser.h" #include "pfctl.h" -void copy_satopfaddr(struct pf_addr *, struct sockaddr *); void print_op (u_int8_t, const char *, const char *); void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 91c0f655e008..b91d37c791ae 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -276,6 +276,8 @@ struct pf_opt_rule { TAILQ_HEAD(pf_opt_queue, pf_opt_rule); +void copy_satopfaddr(struct pf_addr *, struct sockaddr *); + int pfctl_rules(int, char *, int, int, char *, struct pfr_buffer *); int pfctl_optimize_ruleset(struct pfctl *, struct pfctl_ruleset *); From nobody Mon Jul 7 15:07:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKV5FkWz61w7p; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKV2JZPz3wSZ; Mon, 07 Jul 2025 15:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=El/r1HmkFS79yioilUWO/nZfmF1H7hrfSwegbcPDQWY=; b=Xkk7YCNyPENfifTqBGhgFTPDXxaM/4uxVzBVZPR8jN7PcifPDSHJon1vcYtvPoroNe1aO4 rY+XTTZt9db9HwDj2MtQVhYjW1VVLCf4hWyrhROoRBRgdLIs0y7iI/4zpuIOjc6X/HH7qr vOB/q59knkcGwTTvd7gtOvE5HP4xEfRGvYTGYoBic1o0yDJ+qPG2f9uhCWo8OYpJ9GzGH6 36bxFv5KNua3UPRR+YByZxe2fJqY63qDWEzP1PqYuMRazJ7RN5z+vxSm0qusc9cOf7PiBX LT5i5PI45+hADUfG7jx71MLfkOJjCGZ0ab1FVCj3ceMO14vGTNvWem/tx2mqWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=El/r1HmkFS79yioilUWO/nZfmF1H7hrfSwegbcPDQWY=; b=mHEIAbK+H7L79w7i0KWps37dGYOJq1IOkvE4WJ2Ba+K7KIn7Y7lGVU5IkPZ9nLq4aCfBc3 DJawTPIFtFed+Wgjv+j+TOuILdOSm39YNPQ4tdev7K7+PHNqyMzRrvshDl0Kl11CJ0erRt frxC1JYQLzxzG7Tq90wKDgZ4mr9f6pG/M6eimOaZbDNTDbBz0wZyU2/DxwfbK/n5WKXE+Z wb7xFBbnk3YG46qzPWIRfsY8mTi84tws6qqkVFq5feF+5lK2qjiMvwwOGZmYRUiyZMD3MB InsRNKIS/qkll92npZskw8dxHWdkO5dGVbViD0EyrLK1RwG9MmUc2OolhW1zXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900878; a=rsa-sha256; cv=none; b=gvefMn831HNp/4Xe+30jbb5wf+RYG1u0x6j/TI50NImq7B1BaKzzGFmO4TeeCy5HX8ivUP YK6xHWNVGrdzA12959dN/mY/in4DoOdm2gjmt8+nbNI07spBLOm4Gv0M157HlBld2cdlcv hycYqS3FbipyqVgASsQqRPFxlTXlMWRdjh8vo6HXPbCyHHx6BgUwIlIDT13T76iZeLs13a gbakIcyhv7QnLmaHIxn8OobLzVuv3LruECpavwKuEEP+ofcXA0JigY0AQEmbzfJ6uId+ZU /2EQD/Dp26PNv6Bz4IqccI6pI1dVu91G/sYEoKFQP6YT98FGbUVDY+lAe7aCRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKV1WWszwF5; Mon, 07 Jul 2025 15:07: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 567F7wPZ016696; Mon, 7 Jul 2025 15:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7wJm016693; Mon, 7 Jul 2025 15:07:58 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:58 GMT Message-Id: <202507071507.567F7wJm016693@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: f33973f53607 - main - pfctl: Anchor names must not be empty List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f33973f5360792835c82b3a164e0d043e8656a4a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f33973f5360792835c82b3a164e0d043e8656a4a commit f33973f5360792835c82b3a164e0d043e8656a4a Author: Kristof Provost AuthorDate: 2025-07-02 13:00:49 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Anchor names must not be empty The parser would allow bogus input and sometimes even produce invalid rules on empty anchor names, so error out immediately. OK sashan Obtained from: OpenBSD, kn , 85af6f4b29 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 5 +++++ sbin/pfctl/pfctl.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2ebd528443fe..5c6102db3b55 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -922,6 +922,11 @@ varset : STRING '=' varstring { ; anchorname : STRING { + if ($1[0] == '\0') { + free($1); + yyerror("anchor name must not be empty"); + YYERROR; + } if (strlen(pf->anchor->path) + 1 + strlen($1) >= PATH_MAX) { free($1); diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index e490e933db5f..0fb0602eb04f 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3129,6 +3129,8 @@ main(int argc, char *argv[]) if (anchoropt != NULL) { int len = strlen(anchoropt); + if (anchoropt[0] == '\0') + errx(1, "anchor name must not be empty"); if (mode == O_RDONLY && showopt == NULL && tblcmdopt == NULL) { warnx("anchors apply to -f, -F, -s, and -T only"); usage(); From nobody Mon Jul 7 15:08:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKY2HqRz61w7r; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKX4C09z3wRk; Mon, 07 Jul 2025 15:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EnFP5OEFUt7YkhZO1P/b7Qa3J0jpxaxVrFYQLuux/Q=; b=wR9/u04XL7YhnSf/naNmcAaeDVuWTRqcu7Ay0KNAS5AuZjSGWbfAZNRVqQVqzJFEy9Xzqi bjjCRumTrKid11zq51QE8rGlgOpbdkk4GuEfQPUhOaAep8tUUcbRXqeQeTE6meVvjrG2wu 7axvzIQ/6YFcuu1WXU/PhkX9sLexYO/spdkMP73GPJ0FutioSDb57pXeoGHTo8emK+BKBs nfR5pic9/no3A1TRjsS+AdDe42Yw6gFGQGTP8favYFgR7hLWYtpRz7tdx18HH+4g6s22nW jEfqOrctDIicRwXEYS3Q87kVyehKOe5faZSS0Q9MGtRqHoNlD4bTdY0uoNOTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0EnFP5OEFUt7YkhZO1P/b7Qa3J0jpxaxVrFYQLuux/Q=; b=dB9UV7A2fZLOTpCNDh4y35sefWiDB30dgU4mq+dCzFDyWGtbu06p4l8R5jx+GeMOQdtpfl jTNV4eJU03DHQy4c1boztxZPx6QLQh3CTeLx8xXTguh84JZol5TmsjkVpI6w8MmSmtWSNb x0vmKyCkKqsXQ2BKwRQJ0g3yn4IvkL8/5GXu2IeqjxzMf17ojTM7Dw2NhZRKlSjgOh2+WJ 9YjkR6aZgAiE2bNaanf1NqRVFsXRdHCK3JUabiVQnPVOCDkwXGOGoj7vcxXbuhc73Brlf5 nEp1q6L6Kp9YVU8MYB5cZhT8y3zKI3k3pY/VPrBVeNiX/QxtZzoJQUuTocssBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900880; a=rsa-sha256; cv=none; b=l6Wki9LzQt9DGIfJY5jTQYlQ89WrH388d+Zm1mUTuH4oTyaJQx9SlLfSyBH4fUZGqpZHlV TGO5tdG4uxBv9Z5I9rDHQEfgnKlNk4gIWzHMh/FNdT09d8DQ1+2wsGLFAvv/Vfn7btCuZN my8GYEG8mMLrgX4oXxpcYorRsJerPdbkz4GvrvEp9nH8BK1IFGvbgAU6y2tro7tjeJx17q 1EdJsnqOZIFqlDGqNWoNe8tuN7IEWqkUqq1IPXyJ4OB2AgH8D/mZqKxKFr93TUeOC0AzK/ 0ehLKhg/a1EPh+AQCkA05fPlAyI5DUynM7Tr8/zfVoIkIqjUzpgXilsWyAjwRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKX37PjzwNy; Mon, 07 Jul 2025 15:08: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 567F80KP016771; Mon, 7 Jul 2025 15:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F80uM016768; Mon, 7 Jul 2025 15:08:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:00 GMT Message-Id: <202507071508.567F80uM016768@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: beb3c25d42a8 - main - pfctl: Fail on invalid netmasks when filling tables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: beb3c25d42a885f58f77dd36e1a31199c79fbd82 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=beb3c25d42a885f58f77dd36e1a31199c79fbd82 commit beb3c25d42a885f58f77dd36e1a31199c79fbd82 Author: Kristof Provost AuthorDate: 2025-07-02 13:18:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Fail on invalid netmasks when filling tables Fix a regression of revision 1.326 "Zap v4mask and v6mask in host()" which allowed CIDR networks with more than one "/" to be loaded into tables. I took care of this code path with regard to rules coming the ruleset parser, which aborts earlier on such invalid specifications, but missed `-T add 1/2/3' and the like. Analyzed and fixed by Petr Hoffmann , thanks! OK deraadt Obtained from: OpenBSD, kn , dfaca1426d Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index a213487fb648..26a213c3ffd9 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1794,7 +1794,7 @@ host(const char *s, int opts) char *p, *ps; const char *errstr; - if ((p = strrchr(s, '/')) != NULL) { + if ((p = strchr(s, '/')) != NULL) { mask = strtonum(p+1, 0, 128, &errstr); if (errstr) { fprintf(stderr, "netmask is %s: %s\n", errstr, p); From nobody Mon Jul 7 15:07:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKW5cQ7z61wB2; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKW37mfz3wYS; Mon, 07 Jul 2025 15:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LuZDUmFocXmvScTnCq26kzQESGMJQDJT1zrHOxhC/E8=; b=xwlhgyM0ouMDbUVa2FvrQGQmh4muQ/aEYBQqXq90lkr7/7sinARgRuPd1CEkNajLRUKMRy +nOK/wzQY6bZ+3JBQkcV04Jd8WvrnzzheMflc+GKv+B94aERqITPTOR9eR0jIFKkYfBscf HsFQv7QhSdI1UN6D6b5Y3Q0299ftuIciDkEF9ebgNEhfR3l4f3jR27gc2otJ9RSlONzccZ 3atZZ2MRR+ieIuORHBd1XTCkInC2fgNMGrS+lLzX8aj+K+X6rVGs591nWvZbq3m4DGHve8 unS+T4V1fKgf7ov81FaNF9OaEC0HF9LLE6EByZq/bFGw8XNH96T3amv3uT+TiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LuZDUmFocXmvScTnCq26kzQESGMJQDJT1zrHOxhC/E8=; b=NYk5Ses3CF7plrLZlGABe0PfqH6oPcF8oKyVYLsxNdvnJqCa7nrL37Mt41A2Q0PEYoG/g0 dxxeKEdx77+IMRBKhpDJEt+6nG06HIVm5dtWy8riIFnqs+fO9lwp9OF1ZbuH+gImR3tnA4 YX40XB+TGYPQI9BSmgtoaCRPckuIi8L8IOjA6sKg0z4Hd6+BJX1u4ZB9FlJ0Elq65HiGx1 bDZa6J5YSW8PBa0Ipk0EKe33NWzJH9iVn9i6y6r2P7IAAONU+l9pM7jnJWvYyjKY5UqhyQ fmOqQhBkf3Qz4gGpOIvi9aljXmSg+bGIrfWRrG0ghDKApWPKwRkHonTp2zJ1rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900879; a=rsa-sha256; cv=none; b=W42Q3S4BPJKIqGbMXlA51/XyCCmdp+YWv9X5XMnLPfxpBMSQiWNjWx0Pf6AKbmpkLRtszq 3EIaUf128SUTzQG062HY5QqxNWiz931A8QLpvedwNXyrPVxL3G/w3G+eM9oHnzlRJhTffb xxPcvrl5t+4skAvRXrrHtr+cW9JD5o/cfmMtGHDHUaKyj2EXCcNdv5+vSoVemKgQ4iGDpd Ceufb9YWXmvP6CROURxTL6LTLaJmDW+OBF3Dosq7JC8pVORJvA5PtTv2v0mxeoTAqntVH5 0e/RoNu7il8+l7hqXM214uvwR1JDTC7EN69v7uG+rXfk6H/+esjKSAW3APsbFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKW2C0czwNx; Mon, 07 Jul 2025 15:07: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 567F7xrc016731; Mon, 7 Jul 2025 15:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7xP6016728; Mon, 7 Jul 2025 15:07:59 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:59 GMT Message-Id: <202507071507.567F7xP6016728@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: 6bbee85e48f6 - main - pfctl: Don't use unsigned for ptrdiff_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6bbee85e48f6829e23cbb85b3de385244c6f0df0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6bbee85e48f6829e23cbb85b3de385244c6f0df0 commit 6bbee85e48f6829e23cbb85b3de385244c6f0df0 Author: Kristof Provost AuthorDate: 2025-07-02 13:02:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Don't use unsigned for ptrdiff_t (unsigned) means (unsigned int) which on ptrdiff_t or size_t or other larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno Obtained from: OpenBSD, deraadt , 915c3f33d3 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 5c6102db3b55..ca3ca28475d7 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -6929,7 +6929,7 @@ top: if (c == '-' || isdigit(c)) { do { *p++ = c; - if ((unsigned)(p-buf) >= sizeof(buf)) { + if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } @@ -6968,7 +6968,7 @@ nodigits: if (isalnum(c) || c == ':' || c == '_') { do { *p++ = c; - if ((unsigned)(p-buf) >= sizeof(buf)) { + if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } From nobody Mon Jul 7 15:08:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKZ0jL0z61w7w; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKY4p5Qz3wS1; Mon, 07 Jul 2025 15:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i/7GYpb18p1tzEcfSX4ujATb1DFRV/IBmGtCBfiFg28=; b=dgmPcoiSobJ5ulajWQAxrBXSGpp4Qof4u7D98gNayMLCesw8bKlyCLjeTwCS0iElbTqWGA yCMDr8IIF89EFQT8iuhcxe3DlwYm5ZR8VK5IAbmeFrUif4pfJ7bDgJHqj1GExU3nHMVpzC xty57V/D3I6DLkhSijgi61JrjB6QD8Tpdi6sTudbD8FVmKtpm3pJ2d7BWriDhQe9RsKiGf N0UJh5ePl/frqhGe2ZNYByVWubo0bzF3/ELKSmS7To0ythEyhLXY9SK9sPuyMhu3TbWG7m ZGYuOj4H+VuOzTV96bi5OnfKVcicll1ExvRXtelGT8cmFghs9oa/no+Cs3Q86Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i/7GYpb18p1tzEcfSX4ujATb1DFRV/IBmGtCBfiFg28=; b=SapDwsuRrYA22fUdsquJOg0mETo5pXb9ICToPJgZ0UrvPReS6AidecuIkcomP2x5PlegIl McIBIQY3n1OL2B5sn6JvLiM5gsiF9P1Mc5fRPVI2b/OWQPJdS6vzEz59K9wLRllMfj4CWv MFmBz11zvQxnDxq+WvpD1wL7S6UKflJSvnhBKLZG5F+LQ4p5xvcvMLeOB1pz1usyFSHmDX th13QzNFuEr7V3EeNtamb5xzjSk1wwwSuuZ9b26FBm6TlpviCqbFcp+DTdsZWRwFMTdl/y zr5w48v2k15bPzSDeKovWzun+76R2qWl1QHSRy0DJPJfsRZJ8ON7dceDwdnS3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900881; a=rsa-sha256; cv=none; b=o5d31ucFfU5FXejhHNf+a3bHklBceQ77vln7ix3kYhJWv9oV0Mal1ksLGJsx2hbsS0tazV 23YudwMg/nBlf7b7lCv+E5UEeg6zUBpMppKBSDNLum6wOZhkj9DfMNYBbO+UuzqYhGNQOK 7FxhhdhbaQ7JdeHD15Sv+C4nhcAbqfS4mna9yypd+06oEK3XqeGjqXoyYu0BDliQm55IHM SJA0mNRJRQ6exv7rTs5l8QZzddhXdzgHSTik90+1MLwQbOb46neqQ8TK3kpddnCwPkhyi8 HtwisBSGrOrlHdIWfcsipNqUtYrTNLkYVOUWcjHmP/HkQgmI80aYz3ihCYFw1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKY4PdkzwH0; Mon, 07 Jul 2025 15:08: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 567F81DK016813; Mon, 7 Jul 2025 15:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F81NN016810; Mon, 7 Jul 2025 15:08:01 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:01 GMT Message-Id: <202507071508.567F81NN016810@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: 613a144a4b78 - main - pfctl: introduce 'pfctl -FR' to reset settings to defaults List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 613a144a4b7819f2ac9619d3ae85dd4db08aac59 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=613a144a4b7819f2ac9619d3ae85dd4db08aac59 commit 613a144a4b7819f2ac9619d3ae85dd4db08aac59 Author: Kristof Provost AuthorDate: 2025-07-02 14:47:43 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pfctl: introduce 'pfctl -FR' to reset settings to defaults (discussed with many at tech@) OK deraadt@, kn@, sthen@, tedu@ Obtained from: OpenBSD, sashan , 22f3d0383c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 2 ++ sbin/pfctl/pfctl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 0c4a7b519bf6..2391c1d1cd12 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -223,6 +223,8 @@ Flush the filter information (statistics that are not bound to rules). Flush the tables. .It Fl F Cm osfp Flush the passive operating system fingerprints. +.It Fl F Cm Reset +Reset limits, timeouts and options back to default settings. .It Fl F Cm all Flush all of the above. .El diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 0fb0602eb04f..8c20c8250ed1 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -123,6 +123,7 @@ int pfctl_load_ruleset(struct pfctl *, char *, struct pfctl_ruleset *, int, int); int pfctl_load_rule(struct pfctl *, char *, struct pfctl_rule *, int); const char *pfctl_lookup_option(char *, const char * const *); +void pfctl_reset(int, int); static struct pfctl_anchor_global pf_anchors; struct pfctl_anchor pf_main_anchor; @@ -231,7 +232,7 @@ static const struct { static const char * const clearopt_list[] = { "nat", "queue", "rules", "Sources", "states", "info", "Tables", "osfp", "all", - "ethernet", NULL + "ethernet", "Reset", NULL }; static const char * const showopt_list[] = { @@ -2947,6 +2948,45 @@ pfctl_lookup_option(char *cmd, const char * const *list) return (NULL); } +void +pfctl_reset(int dev, int opts) +{ + struct pfctl pf; + struct pfr_buffer t; + int i; + + pf.dev = dev; + pf.h = pfh; + pfctl_init_options(&pf); + + /* Force reset upon pfctl_load_options() */ + pf.debug_set = 1; + pf.reass_set = 1; + pf.syncookieswat_set = 1; + pf.ifname = strdup("none"); + if (pf.ifname == NULL) + err(1, "%s: strdup", __func__); + pf.ifname_set = 1; + + memset(&t, 0, sizeof(t)); + t.pfrb_type = PFRB_TRANS; + if (pfctl_trans(dev, &t, DIOCXBEGIN, 0)) + err(1, "%s: DIOCXBEGIN", __func__); + + for (i = 0; pf_limits[i].name; i++) + pf.limit_set[pf_limits[i].index] = 1; + + for (i = 0; pf_timeouts[i].name; i++) + pf.timeout_set[pf_timeouts[i].timeout] = 1; + + pfctl_load_options(&pf); + + if (pfctl_trans(dev, &t, DIOCXCOMMIT, 0)) + err(1, "%s: DIOCXCOMMIT", __func__); + + pfctl_clear_interface_flags(dev, opts); +} + int main(int argc, char *argv[]) { @@ -3314,7 +3354,7 @@ main(int argc, char *argv[]) pfctl_clear_src_nodes(dev, opts); pfctl_clear_stats(pfh, opts); pfctl_clear_fingerprints(dev, opts); - pfctl_clear_interface_flags(dev, opts); + pfctl_reset(dev, opts); } break; case 'o': @@ -3323,6 +3363,9 @@ main(int argc, char *argv[]) case 'T': pfctl_do_clear_tables(anchorname, opts); break; + case 'R': + pfctl_reset(dev, opts); + break; } } if (state_killers) { From nobody Mon Jul 7 15:08:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKc47dVz61w6C; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKb6JZqz3wcS; Mon, 07 Jul 2025 15:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EtI4rkoJDkFzQx2ztLlxN7tpSprf69SjBCWEa/g7yzU=; b=haI2wqmMi2cyMKOTnVj+p/vWqqieZh0wOpDGKKaKh9uo25t1m6Iri678gR8IrCYWKXO/Fy 2KtsgYQr2sUmNMUJW8Uu1ihSsVKf/IOB/BEOb8ZewChJR72YhZblf78NEyVbi1coLTuDaS SMOfkyI5KLxqgcrY9qUkbvHhx5WUhsXphXA9rvprjbK2xAjQqpPcNv+ro227I2051WjBrN OhigSvPoyB3pd8sTI/zmi/a3479vE2NI4GukO+iZJn5la0I2voZS9DWdAXofOpjHo84dWk ae8HRxNbNIGvWL3a88xGQvxa71u+XAqw2/qcD6NZ6OFGakhwEE5brwL8uYAGdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EtI4rkoJDkFzQx2ztLlxN7tpSprf69SjBCWEa/g7yzU=; b=nmxI0xe6YcsKd6aWXvBxX3pQ29MOoLp/gYjyTN0FuhZDsMHykgKIRClwA9wmQwZ52MQ4bk MgahlsXw2krihhcmyVEdsEgeO7zWG9Ffkafy7AjQGPD9Mgk9yBxpBW1ifBmA/bbf3DHYm3 K5ZF1H+15ct80IyuzipYL3YvAnjJPgJ5CLi7Nxr/TrD+z7lH3rbx55DeDaUdcWA15NYITC 9EQRINwEYJBUUXOURvZlzi/NyKiWJYFMfaCymewAigNPRMdENh8qCAca9H8brRIB3U1j5B O0nHaHHmvlevVPz/h594hzYbOfc9U1l/9seogXhnYkGTthgYyhGOyh0ycSbGWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900883; a=rsa-sha256; cv=none; b=Ho8GBJbW4r2fT58I84lVcM8Jop9u+gtHRVniv5cLRgqLclAQqdX/nhFvuFUuWQlgYSFVdn Kq5qd1ssP6WJXTsZsnnG6NHb0srERiATZ5uSVTzsp+oDPp7LA5JahHDOxYFkO1Sy+UhCg1 mGSAO1wDhjxjsPio7CJUIOZOh7H55aAA1Um1+b65QaooQEiqOBfrkWORTSOT6yUH6A/0Cq 7S7XOEFlU0PeQo8X+DK5hYDgYCY16p5HCG27OAssdiN/6SoMKSYfmEWtEq64xIq01crvw1 TuUT3934DUYJs9nFbfggo6QFSW2J6QO+rpkmPRdjnEmDoMYrC1Zut0UlxBJnpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKb5p1QzwKJ; Mon, 07 Jul 2025 15:08: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 567F83lM016893; Mon, 7 Jul 2025 15:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F83nE016890; Mon, 7 Jul 2025 15:08:03 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:03 GMT Message-Id: <202507071508.567F83nE016890@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: ea0ca279edc2 - main - pfctl: Fix table definition parsing as unprivileged user List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: ea0ca279edc2683e79a203df22b7ac02cfd48e39 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea0ca279edc2683e79a203df22b7ac02cfd48e39 commit ea0ca279edc2683e79a203df22b7ac02cfd48e39 Author: Kristof Provost AuthorDate: 2025-07-02 15:07:23 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pfctl: Fix table definition parsing as unprivileged user revision 1.689 introduced warn_duplicate_tables() unconditionally, breaking the parser on tables withs insufficient permissions to open pf(4): $ echo 'table ' | pfctl -nf- pfctl: pfr_get_tables: Bad file descriptor So simply check whether pfctl is able to get the table list first. If not, instead of silently avoiding namespace collision checks, print a brief notice iff `-v' is given to help finding duplicate definitions by hand: $ echo 'table ' | ./obj/pfctl -vnf- table stdin:1: skipping duplicate table checks for Reported by Rivo Nurges, thanks! OK benno sashan Obtained from: OpenBSD, kn , 4650ad2af4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ca3ca28475d7..d465599e1738 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5434,7 +5434,12 @@ process_tabledef(char *name, struct table_opts *opts, int popts) if (pf->opts & PF_OPT_VERBOSE) print_tabledef(name, opts->flags, opts->init_addr, &opts->init_nodes); - warn_duplicate_tables(name, pf->anchor->path); + if (!(pf->opts & PF_OPT_NOACTION) || + (pf->opts & PF_OPT_DUMMYACTION)) + warn_duplicate_tables(name, pf->anchor->path); + else if (pf->opts & PF_OPT_VERBOSE) + fprintf(stderr, "%s:%d: skipping duplicate table checks" + " for <%s>\n", file->name, yylval.lineno, name); if (!(pf->opts & PF_OPT_NOACTION) && pfctl_define_table(name, opts->flags, opts->init_addr, pf->anchor->path, &ab, pf->anchor->ruleset.tticket)) { From nobody Mon Jul 7 15:08:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKb5cWNz61wLn; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKZ5cBRz3wfj; Mon, 07 Jul 2025 15:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EvjGQMKSjvVaqUf3MDIifr2EfwFi+wuQWKuEflmFx3k=; b=huVuN/I5LRFI6FILceTE1BXbrZfmofYC5u+z4ZDZkr70vjNd7sP4Q/qzEvS/fR8NlfKW6t AcM+sqVwa/BW4dsMyri6h9wjJ5HwkeYzx5vUxNlVq26MBNTpfGQ9F5vd4jgnYBMe3NWBdn Yt8zsa0P1f6ws9NG4JomMjETAcDse1WmJMVLqq7BrTJNE/fZvi0eQZFAt5Vy4DovBvXU7w yhz7SDNkXmr0rIposGm8Ym55xo9AeE7SdnYynDfdDT1RRYWxcY4/KdQjRaH+pCmLKe90Tu vWBd39rmB7hif8c/l/6rltcKP2LBTm4RbargDYvz2mGIpeetu7Vwdc7U3wY42g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EvjGQMKSjvVaqUf3MDIifr2EfwFi+wuQWKuEflmFx3k=; b=ppwBI8oWFSzN2TTTA5ExLvehH8/BSRCWslixP5rVnw8hKnXd3tL7q4z3c7+7fS40s6+yxx GAJ2CKa1xD/clj3NryDUJleEOonTzv0HgO833FFlPsyGE436a8boLsTVPDVLRz0ppNGPjq swX+avNCbNTrV4yyDzG13uma9Ow8V24uYnPrYleIB63gRUGLKY1NUw+5tRl2PzsH/Y0Ktl v5ECYkLQXVjl7nUqcPDMaaf8fyaNsmz58qoeXEBDXeVUVC4kCHYgSjPbvT5UWnn793CdYu epLBxp6fGE8/pQ+7umJMWVJ8dvrp98qp3Lr8MCoZ6pwFyAMPPwmoSTcuXbXhqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900882; a=rsa-sha256; cv=none; b=m/ZzIDTMKls58SjCeNodpzdvFMPjnW37QiciuIVnKfZKj75l7N7BRghaTYc0C6u3db1aws QTLNTnxkjal1Ox2XvGk77uaW35AoCPn3qLncImwuvlJzdeMBTPEhGOy8E3xbYo9AKbd2Hl 644J7fmqHEKMQBRDBa/lHYX8h1y8hds8vPczHgaL1Ktt9vlOo6nW+Kd8cgQREQXgKD/RC4 h7UBUDSpS21qQxw1yVyBJOuMFTKLthw1YOLX64InbaLUEahs20YvirjxDT/b1TTncLO+cD 318eKc4JNW8/u+7nVoBku1DH4zbocmIO7USe0CD2Vy7Y+YPNwf4rDhgW+xU7jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKZ58VRzvGW; Mon, 07 Jul 2025 15:08: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 567F82Mq016848; Mon, 7 Jul 2025 15:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F82SD016845; Mon, 7 Jul 2025 15:08:02 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:02 GMT Message-Id: <202507071508.567F82SD016845@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: 95d1b98db164 - main - pf tests: verify the new reset functionality List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 95d1b98db164f1e99622b2425cf39d96ddab44bc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=95d1b98db164f1e99622b2425cf39d96ddab44bc commit 95d1b98db164f1e99622b2425cf39d96ddab44bc Author: Kristof Provost AuthorDate: 2025-07-02 15:00:16 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pf tests: verify the new reset functionality We can now reset state limit, debug level and others. Verify reset for at least some of these. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/debug.sh | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/sys/netpfil/pf/debug.sh b/tests/sys/netpfil/pf/debug.sh index 18a7febfbb5b..404d37ab8932 100644 --- a/tests/sys/netpfil/pf/debug.sh +++ b/tests/sys/netpfil/pf/debug.sh @@ -50,7 +50,57 @@ basic_cleanup() pft_cleanup } +atf_test_case "reset" "cleanup" +reset_head() +{ + atf_set descr 'Test resetting debug level' + atf_set require.user root +} + +reset_body() +{ + pft_init + + vnet_mkjail debug + + # Default is Urgent + atf_check -s exit:0 -o match:'Debug: Urgent' \ + jexec debug pfctl -sa + state_limit=$(jexec debug pfctl -sa | grep 'states.*hard limit' | awk '{ print $4; }') + + # Change defaults + pft_set_rules debug \ + "set limit states 42" + atf_check -s exit:0 -e ignore \ + jexec debug pfctl -x loud + + atf_check -s exit:0 -o match:'Debug: Loud' \ + jexec debug pfctl -sa + new_state_limit=$(jexec debug pfctl -sa | grep 'states.*hard limit' | awk '{ print $4; }') + if [ $state_limit -eq $new_state_limit ]; then + jexec debug pfctl -sa + atf_fail "Failed to change state limit" + fi + + # Reset + atf_check -s exit:0 -o ignore -e ignore \ + jexec debug pfctl -FR + atf_check -s exit:0 -o match:'Debug: Urgent' \ + jexec debug pfctl -sa + new_state_limit=$(jexec debug pfctl -sa | grep 'states.*hard limit' | awk '{ print $4; }') + if [ $state_limit -ne $new_state_limit ]; then + jexec debug pfctl -sa + atf_fail "Failed to reset state limit" + fi +} + +reset_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" + atf_add_test_case "reset" } From nobody Mon Jul 7 15:08:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKf4Xl2z61wPP; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKf1B8Wz3wgW; Mon, 07 Jul 2025 15:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMflI7HlVTzUVDJTvh/K5EXOiPK+t5h3EHMLqNgjBBQ=; b=g5mZduvxXpeh18A2thmqDW5zn0bnmIm5zhnAAzCsMUnXjzg1L6lEXOIFZp/Zulizyywbwj MbGULytRzWpBBWFqJaCmetsgnpC7ANriRM2kh0HbanTXtzCxidN4kmN/DPfUQOSP5RA2br wT5jfK9Pa5I0jUa5JZQ3LVwnIP+3BsMgR69A3iAv3RCr8A/Tj0odsgglZu4dIBxTKCjE4S ikAaMvBHmSJzMR5L2e4ht3tqVyKep3xVRTJ7AgVpwhrgVkuA6l5Od0J1RWhHmQY3KX3yv4 gqd4g+MMhHQMZz+SQN6CVYlIjydTnhluXa5TRIiudwYkIFF2SRrURGv5KaoLrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMflI7HlVTzUVDJTvh/K5EXOiPK+t5h3EHMLqNgjBBQ=; b=EE4m24NrpvKfciGF5mIYsk3LLru1xIa1W4xI87UCDspIoiqsJrGfp1rnO11h2omv2OJFEB tlIg6ek7vDDSp42u2PzxE1Xa0pGQpWVqZX6BlMEMNuCQocY5tklcDmBBFVH57uN1nA69uM uijQW7IhJoWqi1VC4qTfvjUPyEX4nvz0IYBG+CRfFHwmNiHpnghHjn7ajHoaWFacwNXhJh 5LGMYjiQUsXEW3xBx4/8xr/3MYBZ4a70bXMZxiZFO0M8/IR+s21pcs/TI5mHUTWqxSAGA5 RYzna6FMuOSTDlztoCbeGRr9soEDaDTRpROqzr0C4t7BiS04KdcWBbjOv0vfxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900886; a=rsa-sha256; cv=none; b=P2pXt5k5O25E8crjYoUWaTgtQHjDr4AxAU3eVGeIKYqA5rxSDFgSBjiT+/dxVobndPtFoG 6GR9X1AL4XbZGAriEe8A5pDbg4VpNZ+4Dly0bOkrjHBeUFJVVAaQwNwYCF/9obq62RmTdm 5RlVVkXs+XcB7T3dFjsS+2M1CFa8mgSqx3zfEbOQc8BcQq0itoH93FDWfOJQLa1789v5QX keaP5F2YC4ErLQHa5DU7pitFHR76h7O/K765UQbFvhW8dizErQE2kUMSokSujhBT0hum7y uc5tEOSRB1G4Z+L4BQepE6WRqz/+pQ8OyUzAZW3ibTB6dSVqQ/Mr1TpyU0TLkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKf0gYWzwP0; Mon, 07 Jul 2025 15:08: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 567F85Cf016966; Mon, 7 Jul 2025 15:08:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F85Ft016963; Mon, 7 Jul 2025 15:08:05 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:05 GMT Message-Id: <202507071508.567F85Ft016963@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: 5606ac2fcadf - main - pf.conf.5, pfctl.8: update to PF pfctl(8) and pf.conf(5) manpages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5606ac2fcadf801fc5485c3326fc678e77eab377 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5606ac2fcadf801fc5485c3326fc678e77eab377 commit 5606ac2fcadf801fc5485c3326fc678e77eab377 Author: Kristof Provost AuthorDate: 2025-07-02 16:25:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pf.conf.5, pfctl.8: update to PF pfctl(8) and pf.conf(5) manpages great input by Ingo, Jason and Klemens OK schwarze@, OK kn@, OK jmc@ Obtained from: OpenBSD, sashan , acd7255d6a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 5 ++++- share/man/man5/pf.conf.5 | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 2391c1d1cd12..28efff896956 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -224,7 +224,10 @@ Flush the tables. .It Fl F Cm osfp Flush the passive operating system fingerprints. .It Fl F Cm Reset -Reset limits, timeouts and options back to default settings. +Reset limits, timeouts and other options back to default settings. +See the OPTIONS section in +.Xr pf.conf 5 +for details. .It Fl F Cm all Flush all of the above. .El diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 3c9706063a65..fe848b030484 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 26, 2025 +.Dd July 2, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -542,6 +542,9 @@ an ICMP UNREACHABLE is returned for blocked UDP packets, and all other packets are silently dropped. .El .Pp +The default value is +.Cm drop . +.Pp For example: .Bd -literal -offset indent set block-policy return @@ -666,6 +669,8 @@ but can be overridden via this option. Setting this option may leave a small period of time where the fingerprints referenced by the currently active ruleset are inconsistent until the new ruleset finishes loading. +The default location for fingerprints is +.Pa /etc/pf.os . .Pp For example: .Pp From nobody Mon Jul 7 15:08:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKd53Gmz61wDN; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKc6tP0z3wZH; Mon, 07 Jul 2025 15:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+I1aIeqzcm/FXrUPLA94Hows0SVCTPWLETpIfmNZS68=; b=YJBrffHmIN0CFRQOVAwBW38mhcRj/shEsFC6pOfmM0/CovKsC0ZnbQJJyOpHflu8pFyhpt KNybg+6Ue65hYB+44WhGzOMBJ6ZYBZrxzctVFzzac28OXpnt4G7bkwlJV9fPuNqkYMfptG FC67pFvpu34B/ZXOqZzZ18Ob9EUFsjDS4NBihpun7VLlNZc0W5kxI0FOhLCy4e4iOcPf3e pI0bJda/t/5byGENWP/idzAMji48u2iZubR/D9FzLbLRkTCl8rp6igjWtnm9foNlSGbgwn HuBq5aB+5KXkou5WDSwmgSaIamCrqnu+Obmlf89nJvUo/g+9/XLa3lCAPC7yPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+I1aIeqzcm/FXrUPLA94Hows0SVCTPWLETpIfmNZS68=; b=ph6mY6utSCma8wU0Q7Sc53KUYYKgzIXCMHIBHfHXxWJ6RU6m2AiYau7xo2MzpifIClftEL M45U+5sGh7kmIkPC8pB3yXSG4GFBDl4YuL1oE0ZEe7LCF6wKVuZ+YgnuBBuQqBK0zbFYfo HZmkiFOQcaMe2FJclGwWjG+nX+7UaxmiyH5HpCiN04Pj5Bl0UNwqjYf9mTYOkl8nkOWoUF AtGr+RJHb1h2ZHRFxzkyTxEpn0bVUeC3xV9n/GddGereqqvqyFdj0SeehxitkFEZ0P7anO MamhNs+EAQ/6OtTf9KvsYVRnbREzqCErUaImsQ1Rg1L0Cvyhza/utwd6x1o+IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900885; a=rsa-sha256; cv=none; b=y3IlyqhYGRdnmDZrKo3jF2EY/nb96Eoof4qcZxvzvH5PpFTZsbhve/WPGe4iqrUd5OPHaA eke35/rmmNK+YeegPqKWs3N2bMHqj1NoSedFBDJ/6Q9RJ59hsXqJTRbwqK3e2RfQXjmCGr pMLaV2+dLjG0BYuz2SpfgTmijY3ao/NjAFacWOHLH2xxUYqIZiBl8tLXWR1ArUVkJBIBoF FC1/MjneRbWV8Tff4mNALAQ4OU9RzjeBbs+oEwW2Lu1jVa3LrPlRQ0a3iIxeDRTfwHoKYd 4vX7YdBQVzWfFgsWYK+NR/8XEWmXllL+SiyZmDsgsCL6Ih80IX/Wk6Wettwshw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKc6Tx1zwH1; Mon, 07 Jul 2025 15:08: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 567F84DF016930; Mon, 7 Jul 2025 15:08:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F84OP016926; Mon, 7 Jul 2025 15:08:04 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:04 GMT Message-Id: <202507071508.567F84OP016926@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: 0ccf78da3bd4 - main - pfctl: Always check for namespace collisions on table commands List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 0ccf78da3bd4f273f203deb4c237d1a3c046fac0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0ccf78da3bd4f273f203deb4c237d1a3c046fac0 commit 0ccf78da3bd4f273f203deb4c237d1a3c046fac0 Author: Kristof Provost AuthorDate: 2025-07-02 15:08:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pfctl: Always check for namespace collisions on table commands `-t table -T add|replace ...' would only check for duplicate tables in case addresses where actually to the table. Instead of using a positive number of added addresses as prove for successful table operations, rely on the fact that CREATE_TABLE() is guaranteed to be called only if pf(4) can be accessed, that is warn_duplicate_tables() will return. This improves duplicate detection rate as warnings are now also emitted even when table commands eventually leave tables unchanged. OK benno sashan Obtained from: OpenBSD, kn , 898866c293 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index d1f20761a4f4..0842b042df41 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -85,6 +85,8 @@ static const char *istats_text[2][2][2] = { } while (0) #define CREATE_TABLE do { \ + warn_duplicate_tables(table.pfrt_name, \ + table.pfrt_anchor); \ table.pfrt_flags |= PFR_TFLAG_PERSIST; \ if ((!(opts & PF_OPT_NOACTION) || \ (opts & PF_OPT_DUMMYACTION)) && \ @@ -94,8 +96,6 @@ static const char *istats_text[2][2][2] = { goto _error; \ } \ if (nadd) { \ - warn_duplicate_tables(table.pfrt_name, \ - table.pfrt_anchor); \ xprintf(opts, "%d table created", nadd); \ if (opts & PF_OPT_NOACTION) \ return (0); \ From nobody Mon Jul 7 15:08:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKh1kVSz61w88; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKg1w5Gz3wpW; Mon, 07 Jul 2025 15:08:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xm3RlnHxOxQm20uNMmWEx2vgg2+8VbLGXVqNtU/Ck68=; b=FSpvQeDhipa+SPVhz2lTfaJcaGAUL5DU8yySMD1kbYq2fLFR3xcnmplQToxAu5YWaXatJY gfq1hSf8+EN3YnYjBYme4l+nvO93lUexyiV2kFR0uWcZLBO7MdnG6Y6ViBgb8Likln86TE Dap4GOs2kRQKQefKQDaNMMw4FWqIXJSKHTP9nlaWUkG2NO9SVYba0Klmi2Nlrc1tBO2lqG joQsUznVZSzYgNP4uCoHuBwJQmbyzG4yq7DY0ABY/WuxexsC4ksesmvy4VY0m+zhvcQFBS JGiqSQYV62D/hF/zWBlpLOOSoP0Q7rJHGeNnK9EelT3Zc3Gdxn/pl7scMeln5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xm3RlnHxOxQm20uNMmWEx2vgg2+8VbLGXVqNtU/Ck68=; b=Moq10tVt3dh+aLTTH7d2OTFjeKuWo5T7v0rBjf9Yl77QKM5iv14LNbE0sSjmNWGkX7f+1i 96HQp2BV7wDeo17XqtahHbJGnkIdihsxzPnGcJhsUXgzVJXcLPor4cGIsd44GCMlj8i4PZ 0r0KoJipJQG4gzed+vLkDVYJzcWuJu6ysI8cV67HXXaeEveJlBVlpGfamiIotKGU49dtJb yL+GAZxEpjsQyTFzRaNMToAcdd2eHb54lJgJP9njtIlsc1T97oVuQLE3EaCAIXyRqVXlD7 9G3by+nsW2kxuKXsF80loZ7raN3T1dczpcLMX9TefFQ67CjJ+TnMvys82L4xhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900887; a=rsa-sha256; cv=none; b=KxPVRt9eI0HLr0jZzbDohNeZXwa5N9SFaqpVgW2qE6Qvkctp6i66ypH4yGP8hZFjWWboW2 BBhJR2KN2SqdRmpzxtftGviLSq02NwJs4kOnxm6l/Wgm6XlqsA0CnJVBFYs5eiJ0RX9L9g umTwka1LSAVq5ZOOCGDH+EERvAOJlWmUkbvpmU6qpeNvDQ6BmofPYb2UBHqbb9JOxGX81L G20XMeggcUbLH3gbyMSfWx98mHCsNIUqQjGHPYIizEkCG9FJmHUu+9GjN8RAAWyTiAmWll 2OpjmH76uODrT7a8S1e4cXlwr1euMCOPtyT2Y3Aw/Kvi1Q2bxX/NHCYmbPv6rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKg1Q9tzwKK; Mon, 07 Jul 2025 15:08: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 567F87QP017008; Mon, 7 Jul 2025 15:08:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F87qb017005; Mon, 7 Jul 2025 15:08:07 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:07 GMT Message-Id: <202507071508.567F87qb017005@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: 8b8fae451c8e - main - pfctl: pfctl should check pfctl.astack is not overrun List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8b8fae451c8ead8af978a4528631ca6b29eff30d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8b8fae451c8ead8af978a4528631ca6b29eff30d commit 8b8fae451c8ead8af978a4528631ca6b29eff30d Author: Kristof Provost AuthorDate: 2025-07-02 16:27:30 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:52 +0000 pfctl: pfctl should check pfctl.astack is not overrun (bug found and fixed by Petr Hoffmann _at_ oracle.com) OK kn@ Obtained from: OpenBSD, sashan , 12ebb2cc68 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index d465599e1738..af1fb95398f8 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -958,6 +958,8 @@ pfa_anchor : '{' struct pfctl_ruleset *rs; /* stepping into a brace anchor */ + if (pf->asd >= PFCTL_ANCHOR_STACK_DEPTH) + errx(1, "pfa_anchor: anchors too deep"); pf->asd++; pf->bn++; @@ -1261,6 +1263,8 @@ etherpfa_anchor : '{' struct pfctl_eth_ruleset *rs; /* steping into a brace anchor */ + if (pf->asd >= PFCTL_ANCHOR_STACK_DEPTH) + errx(1, "pfa_anchor: anchors too deep"); pf->asd++; pf->bn++; From nobody Mon Jul 7 15:08:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKh6bfcz61w3K; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKh2j9Pz3wXB; Mon, 07 Jul 2025 15:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUXy/pKRFYw9Ib7SwcJ3Gj08zkN0jp6/x0aqc4bcwMw=; b=Dc/YrCBVyHakzZdffxeD0eLOKrZHBq8FDXIbDmH2YzsMVcPggOGR/GC5jdi3mJeI8MxGaI v8zQnJl0S/UGFN7cqPVj7i5D/aKXV8oiguhzlNFoIk6l9AHUCi+BnX9mYinweYuM6Z3QNw 25R8NCkc64c9uPS9Rajco92f05dD6UBoZVSAFn4q/WgVhg+V7M1EjdInTtvy5fwCBKB7xC eK6F+IAHmo4s5K54YDBR1sDh9hxLLqANMdOZ+Gjbi0JvUHr+gbSiLYORGdrfOlNRFnGQdE 9piUq4gnM7csNfj+VbJRE36FRM56hVfnDqnTt2Cybmd4srJN6RvAoTkDtlNtSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUXy/pKRFYw9Ib7SwcJ3Gj08zkN0jp6/x0aqc4bcwMw=; b=GTmoTd186R5jpZqq9eZz/FWRpA/4jUsbGrAGehAoaI8aMVIN8jD9ZfEjsG4SrK7MDynfdg 0tGW+PobDcAHRZsEijHXbh7jO8mS3giLgk4VKfiuCgTM3JP1WZ6ut4voi5YPk+vsAwrIu2 Yz2Bzk39QjyyQHhqqK+L6ugDHhXZ5NVil9y1cIJgktVT5pXiB6kNaFEUgqFp8jb350brP6 SqGl/qM8mkuFXSWvN8Hv3DfjMDUuXG8VWpNZOoXUtWgNzuA5H4VLcYKTdMvZYVngzWO/mZ ukikaCWugS2Bzv3XKbBPJBlRUeg3t+LFC3t4+L4UGsOsZsLXz8rO5+WMheaoyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900888; a=rsa-sha256; cv=none; b=Puo3owIaDAXjeyNIwU4xIOVi/7upQPA0LxjcIfqJm/QiBIz+oXlPPiDW9JxUVfwkj+b9HF FR5+lmMMy6gjIe8OSoTYqeTfatcJteppTVCj907Dh5bDG8ArEAlNkztMo8njIsweGMeXmE mLLPWyVXN3iDRCaNq9JICqShcUhJ69RljHhuDM3Ap5MRwbIpYSi+BZSipc2MLLXD5EPjn2 1CwXMcCJb7ooIxNkas/nwj4sOJ6sU+Bvu/jzPwltB+sf/fwOveOfhhCZt73UnCLyO76R4j 9ChYQ0vsgy1k+hVY75f0KlOBShwR5ENTNjDyyxx2Hfwb+nBKSt6++5Qa6JINYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKh2HjQzw4r; Mon, 07 Jul 2025 15:08: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 567F88C4017040; Mon, 7 Jul 2025 15:08:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F88kZ017037; Mon, 7 Jul 2025 15:08:08 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:08 GMT Message-Id: <202507071508.567F88kZ017037@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: 27626ff49ada - main - pfctl: Add parentheses for readability List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 27626ff49ada57f1978c893f21743e312dd40106 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27626ff49ada57f1978c893f21743e312dd40106 commit 27626ff49ada57f1978c893f21743e312dd40106 Author: Kristof Provost AuthorDate: 2025-07-03 08:51:43 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:52 +0000 pfctl: Add parentheses for readability Prompted by and OK deraadt Obtained from: OpenBSD, kn , ff93619fa5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8c20c8250ed1..738c89069383 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3145,7 +3145,7 @@ main(int argc, char *argv[]) if ((opts & PF_OPT_NODNS) && (opts & PF_OPT_USEDNS)) errx(1, "-N and -r are mutually exclusive"); - if (tblcmdopt == NULL ^ tableopt == NULL) + if ((tblcmdopt == NULL) ^ (tableopt == NULL)) usage(); if (tblcmdopt != NULL) { From nobody Mon Jul 7 15:08:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSKk1ggvz61w8C; Mon, 07 Jul 2025 15:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKj3FgJz3wZy; Mon, 07 Jul 2025 15:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=obWQFKavpNjaNAZJo0WNmLyTholbQi6YYp4JkhbcFKQ=; b=h5Yy3FINgQ5HDRSTmryGbq8lOr3wJoR/GIhqKDADElb76d0ZrMGDlTYvG0QHSgIb4FTDYi 2PbT4mbb3z11ZXafS7d9q8+fgvVxKET7gTSYriVNL5JsoGyTq5y+eyZGp4JLtIQ5KAoEBm S21hhdtVdeoP19mhXbw7FhbdgYGYX8INzekyOI8qaeD8PpEj13QaJFQLTLXnEQL3Yj2RDr mLhOj7xWtQCMQPJ/kHkb05rXzR3BV29p7LbOXriOnrfFadgWg39p2gjpiu64NRB0OoaIIv DtlhV6Hw4wvN/YX9K2tqVvexTtSrp0NDlEvjyyVVDtS01stiqZ9Xn2Eu7DEVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=obWQFKavpNjaNAZJo0WNmLyTholbQi6YYp4JkhbcFKQ=; b=F6moKYHFmqHOEFK2vcq7DTq4OibcqoXicToD11Y6UHHmJ9IX639VheSR27HYbMb8wr7v1a pBQnc0b5ajpEGGA0LganfRit3JgJ+ex2DK0Ybxt6tHFsF/hFlu16fCuffUp2lTOY8MGuDs 2p43Oq+rsFp7HlpuyqTUDlJ8hyYbiACnm9hD+OjU1Xrlga+EkaASObBm2KppJ7U0T71vfc jfWvRxmw2Y2pzkV1yKRYbY/hXye+qsHM1DJXCDPjJiauJr8fqhu3CTHLqENKwEtFHusFGP MnbxQhay91x+csfr3kYhPZQY1ZyyLADOx3DwL/elSn4smiZv3f5a7K5BqKM5Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900889; a=rsa-sha256; cv=none; b=oMet2IdBxBlnPV3UrLL1FCbWwnuNiyfcOJ6Ah6PR3+z07wAQO11V/TjHmu9YzrjTfjHAqm ACGJRqlwv2vBBuXPOCeheTvKooPOPdKLC69lTXr0VXQ8Tp4shrsesvODIIQgLDHwTi6rrS OD9FoQj3EfxZyrVWZcKFHWhdlXPycEd5B8K42hA45j1DnHWhFgrie3Egqyw2VUXtJmCsiV LaiETF1+k+JUECgz9AszPNMXc9bYO92zVk66W3aTVUI9Pd/m1VhjDyLwB02DuKliDAET2/ l1ruxetn5oeVlYk+KDq9fhXqu5d09Uqg3aTTXboDgdxw7ldAnmxL4bBewv/2Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbSKj2qsfzwH2; Mon, 07 Jul 2025 15:08: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 567F89Ci017072; Mon, 7 Jul 2025 15:08:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F89N4017069; Mon, 7 Jul 2025 15:08:09 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:09 GMT Message-Id: <202507071508.567F89N4017069@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: b3902af408a9 - main - pfctl: use str*l*cpy() to copy strings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b3902af408a98ff5520d50e6af69652d9b2984d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b3902af408a98ff5520d50e6af69652d9b2984d5 commit b3902af408a98ff5520d50e6af69652d9b2984d5 Author: Kristof Provost AuthorDate: 2025-07-07 08:49:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:52 +0000 pfctl: use str*l*cpy() to copy strings Ensure it's always '\0'-terminated. Reported by: ivy@ Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 738c89069383..defba3b56c44 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1632,7 +1632,7 @@ pfctl_show_states(int dev, const char *iface, int opts) struct pfctl_state_filter filter = {}; if (iface != NULL) - strncpy(filter.ifname, iface, IFNAMSIZ); + strlcpy(filter.ifname, iface, IFNAMSIZ); arg.opts = opts; arg.dotitle = opts & PF_OPT_SHOWALL; From nobody Mon Jul 7 15:13:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSRw6Gwfz61wjh for ; Mon, 07 Jul 2025 15:13:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 4bbSRw45WMz44gg for ; Mon, 07 Jul 2025 15:13:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-87640a9e237so308052139f.2 for ; Mon, 07 Jul 2025 08:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1751901210; x=1752506010; 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=DrjXVPAYiG4dEDtPQcMwkFAgllrlk/VnjjURv9/yLMA=; b=gj6NJZnb7mnqadvps3cHaKkW2DN2+lMG3n5DVrWJYy+tiavaEYzlLB3WpHygYCJ0pK 9QF1gEk/rm3COASATi70okwq3vuw61IJeYvf/tuesjAUimntcoiOY02NMYL1E/WrOqPJ UqzEsyANDsk5+sSMuvdURALB22IjCCw0auNgGs5s612MQY49TUAE08VnEl74slZQiG1X 8GMULwq7kdUEVZL9H7r5FtjiPY17RDNFHkMjgaiiwRyaMBDsnkxCfJnQ/Da8oNhOq2AM 7fTdPFnzjuTY+73gEwAKCwEYZriX/fMK1+PNWjXkKy153U7SJV30++dmOsdaBPliXQZK hoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751901210; x=1752506010; 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=DrjXVPAYiG4dEDtPQcMwkFAgllrlk/VnjjURv9/yLMA=; b=qJeFyv/NMIt4AeC41FHOjO1oxtYmVORDcPsHDs5Vg2ybROfmwWiBnlw/j1u1999pYZ pJUeocYauaz6Lbf76ImEIx2nDi1p0kSKPFJ8/tW84HrPCCLlQ5puFUi80eB7k8eTmPfY 7lIZ1xAOuoXV/YhsmIo8E6g5MRnTOBoeJR7wilsmHQbAb7+i5XRb3jfodxNJMioHK+mO Whf2VyAaoXj93JQ6hlUgYcSKgNSC/s2y51aIOLasCnzfcm6GwJFu1YZu402AWJZRhpSR 2lcqoSEimvOcCbAsSGnIIkT7LnFQc5kuf1aAYuTpYqJ6ZP8EHJ8q8TYq4RY+LFXB0FhP N7zg== X-Forwarded-Encrypted: i=1; AJvYcCVWyup2dtf1VM+57AJpp05GnUi54fHnQpoiIHSOyccrtkiqG3/owDqiWWIRxf+MSyWd7f/qbdJFpqPUj2xOk0RndeHXMw==@freebsd.org X-Gm-Message-State: AOJu0YxuMgFetmwd+mTg1hSW8c3rRdeY5x9rhPMmTaUP8TXqMOVNF7xM 4Wbnz2hLKJBGGLwWcVMqjUgjwVgqdXJwY93hX4WzF1QhtwtDOsrI6rdNbmDqZYOBWSLeyBEI9uc 0Q6HWw/0= X-Gm-Gg: ASbGncubMIclMjKO8KAnnw4BR0D9bFlG2wslT8NBoqNgNrhvkRKvMV/IIM7YMxuTtjo YxycaSrKJbZOg+9+MoFdNr5e2EMMMAFO52gFwuhwU8UakxJsUA/Nm0aiIGmcEZygP3HMWzMiVBE JWt5PsB90YgCW63MzckEbXC0m5mblBeQG3AVZrXess8GzXGmXfkSVHYWPix6oMg5OfggW+ss/2q ef1slN3krkhLGTje9i1T4j923GrV4e+DuCcD4wDYOMl8T3gWHoTET74uGdaO7zQbR0VNLm/S9CS X2J3WDHEHfMGnROdNWZpCxDqv/1rPWkeLkjAyFbRkRps X-Google-Smtp-Source: AGHT+IFN3qWreoUrvtquSiDuV5Kofk8e7Dy1dJJvaMO3Ce78ZI78JDyTwS+jReVPi5n0xgW/FESVKg== X-Received: by 2002:a05:6602:1512:b0:864:a228:92b4 with SMTP id ca18e2360f4ac-876e15d75a0mr1191900139f.7.1751901210417; Mon, 07 Jul 2025 08:13:30 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-503b5bdf9e2sm1751268173.67.2025.07.07.08.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jul 2025 08:13:29 -0700 (PDT) Date: Mon, 7 Jul 2025 15:13:29 +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: 71a0af25a535 - main - libopenbsd: Add recallocarray() Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.3-STABLE-HBSD FreeBSD 14.3-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202507062318.566NIhSM031303@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vp7vzkwe5dfjx2hk" Content-Disposition: inline In-Reply-To: <202507062318.566NIhSM031303@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bbSRw45WMz44gg 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] --vp7vzkwe5dfjx2hk Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() MIME-Version: 1.0 Hey Mark, I've noted a couple things. On Sun, Jul 06, 2025 at 11:18:43PM +0000, Mark Johnston wrote: > The branch main has been updated by markj: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D71a0af25a5353f929521cb04c7= 3a7266ac5b7b61 >=20 > commit 71a0af25a5353f929521cb04c73a7266ac5b7b61 > Author: Ricardo Branco > AuthorDate: 2025-06-16 21:41:48 +0000 > Commit: Mark Johnston > CommitDate: 2025-07-06 23:09:00 +0000 >=20 > libopenbsd: Add recallocarray() > =20 > Reviewed by: kib > MFC after: 1 month > Pull Request: https://github.com/freebsd/freebsd-src/pull/1698 That appears to be the PR for POSIX O_CLOFORK. > --- > lib/libopenbsd/Makefile | 3 +- > lib/libopenbsd/recallocarray.c | 82 ++++++++++++++++++++++++++++++++++++= ++++++ > 2 files changed, 84 insertions(+), 1 deletion(-) FreeBSD commit 450dfafb1519ae7bb0615368ba45813bcabb9b35 back in 2015 imported a different version of OpenBSD's reallocarray into libc. Would it make sense to have only one reallocarray implementation? Or what's the justification for having two implementations of the same function? What might happen if someone links against both libc and libopenbsd? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 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 --vp7vzkwe5dfjx2hk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhr5AoACgkQ/y5nonf4 4fptkQ//VdK4aVAvdiUF7Wz8vU/z94+hRCkw14wtth+fK7C1z2k8I7ObS/NaMI5H 7EvtopnIxsY94V85rsSpfGPgUoNfpmkYqjv9q4AuZa3IyV5ZOU1/MM+xn8w9I1jT +oipmMEFBd199Pjpo5AD1zLRHDcAW2GYWjsxngTTBAGftQHmC1fyKDUCf7l7zV+Y ymM9CtSpWG/7dIB8XhxuRUKEgySv5VG5FDUnjB7cL7B+KmJkVD0PtyLWwiFWLamV kZiYyWA0XhR2c8VRzrPzBIDMWWQhw1ZKRnNfFCFmhgHr1JPhj5M/Ke6N5qPUT71X hmCASx1w6y6osUFki3kPNhPNuauw+gVxV2rOR3TfKxTlfZ3BhDlWAcd/XCLfVGJz hHDTMm3JIZJDocyuL7Uvx3kxsiMI7zOxJngacTMsWk0aQU804IiEs1BtDE7SIil1 SYvJh0kYcEnsvIVXQ6v7ZZfK1ltK3Q71pynx9Q/QyRnJAPyfZMzqsBekrP5J8W1N UkQdMW2ObXBiZGTU6k76DoGwPziZNEWsEeEoAylb/W+nb4u9OYhMqnbNhW3uLM8v 5u1Rqkmz0iiQoOY7Y1ry9ro0lLZRXu08u9GjahDOJCBvlc4i0xD8CDCp9lNCIxcs M1HhrK7CSzWFjJduEg8eraWPjELSfdk8js0abFFPA1t2jKAUaB4= =xbJK -----END PGP SIGNATURE----- --vp7vzkwe5dfjx2hk-- From nobody Mon Jul 7 15:20:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbSc12Hmyz61xGX; Mon, 07 Jul 2025 15:20:33 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 4bbSc10DSRz462S; Mon, 07 Jul 2025 15:20:33 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7d219896edeso394641285a.1; Mon, 07 Jul 2025 08:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751901631; x=1752506431; 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=9fhIJyo7yvxDdwkSTIFbZXyr6FGbnoq3MgkAw8KKwKs=; b=bNNW/WfhCpi0QfrqwBAKZxfubvAwsSnMy1kJtP6b+YyFN/3+OrvJM8927YbYEedYFX sxo+FSBUL7sqGxNP5yijvZWf3YJeh6NxajlmeVSa43yycmigdCoPIfPCNuCfEcuD9GFc ovj2zjfOq03ybfWIeptMj3OhDzpJ63z8nc9yufUdpYXHR6hKMl2p6J94b2ROuaPTMtlj 37+ncJ0YzKc9LctGA/bVp7JqceVhubjXNmTklkxROJe/eLklf/Xb7KzNi4HHuAlUILzy WTbfmBjvW87MdQvHQiaZKW1p4xxdAjJWagtOphZ8cvMANEG9/nU8JG6rEdY37jPu+cHK 0emQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751901631; x=1752506431; 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=9fhIJyo7yvxDdwkSTIFbZXyr6FGbnoq3MgkAw8KKwKs=; b=SWRuxs/xzl360w9AhQbkYuF2GJG/ID+R3eZeLRJTlz1QZKIZr4DzCdXr9WBujorubl QBhib6KnbN6q6+IszPtZ/Kv/93CpWTNWlRWhSblo2+wwaZ8cWiD0WWqfXkBKz9XfDcC1 U7sWpXFXCAn7Pspy93C6Q93nLCqcF3fxF6umrd1vVyp50WDO3uFzlMC3gwUnQsOS+76Y m+ew9j1EAXOmExihbi6LVeMaSXbYr8Cd1OvRqZL3j4PC64l29yX8rmFJ5kl8N2Rwqet/ T+vWs/appcuacype/sjsTlTCTKIRvoWsXUj0Gzfl24jN0qO3Nv4Vizlpo51h7KF9QnHB 5pQw== X-Forwarded-Encrypted: i=1; AJvYcCVbaHLO32QlZK0a1pStNYJ4RTwtLI9Nd92CqdTKdfqvi33bRmn/oz/4OV8zwKm6YxKhds5S/GxNe5C5DZTU+daEaW1+@freebsd.org, AJvYcCViso2m3BTyapem8FNKscM/oFw54HlPKFiPgADrHYdIOXEdcMZ8D5+/nyPBhuSUgUXxyQ4EAOs18mtFLIMwAlu15Rk3Mg4=@freebsd.org X-Gm-Message-State: AOJu0YwzELA6lLBWRzd1+Cf3WRZg1K8q1BvElzpUSD6FIEt8SSfYsyVc LLo1rzpX1KmT+INg9gzR8NqJf4AUABcURLquSeHfkplTU0QaCGooCKcYe9cHS5yP X-Gm-Gg: ASbGncs/hlmmvFAJBC8H/HC3YT85lEKNVgSbJlVMr9IzVewjQVbM0UiyMFCLZURlfcx lhBzLUE0DWKto1jI4sleM6lQpFPyFP/Om+z2vLXvZEg/1ZoOAwYi5GET62UvJAfNaVjtif+BYe1 xXe4q+u4FWX9dsxTX0ehuevdqDBJCqSj0o1fFKNC8NvABEBZHYU2fkYMl0RB2Z+PdU0s8EtWUKw NLwfEZrQih0ZMHOmCYNXX/w++nW68iXCb34N50AKgz12PLteKVYrh4fAblpBI4NJuKUuxnAxsE8 0Y0s0JAzd9H0ucPcI+eaGxT1mAVwTAGfCVkyJVbzqd9q5S1o81NJQC3ofViOQQrQTZxK7M03lj4 U X-Google-Smtp-Source: AGHT+IF/lCkB7cQJ6SHtt2roUZjLPflfYlrq/kE4djsNc1zZ3imfcz9atP3tk9Q8UgOr9n1Cg+zPsA== X-Received: by 2002:a05:6214:f65:b0:702:bf0a:b9d8 with SMTP id 6a1803df08f44-702d169572emr132313176d6.13.1751901631096; Mon, 07 Jul 2025 08:20:31 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-702d5e53246sm35623116d6.1.2025.07.07.08.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jul 2025 08:20:30 -0700 (PDT) Date: Mon, 7 Jul 2025 11:20:27 -0400 From: Mark Johnston To: Shawn Webb Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() Message-ID: References: <202507062318.566NIhSM031303@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bbSc10DSRz462S 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] On Mon, Jul 07, 2025 at 03:13:29PM +0000, Shawn Webb wrote: > Hey Mark, > > I've noted a couple things. > > On Sun, Jul 06, 2025 at 11:18:43PM +0000, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=71a0af25a5353f929521cb04c73a7266ac5b7b61 > > > > commit 71a0af25a5353f929521cb04c73a7266ac5b7b61 > > Author: Ricardo Branco > > AuthorDate: 2025-06-16 21:41:48 +0000 > > Commit: Mark Johnston > > CommitDate: 2025-07-06 23:09:00 +0000 > > > > libopenbsd: Add recallocarray() > > > > Reviewed by: kib > > MFC after: 1 month > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1698 > > That appears to be the PR for POSIX O_CLOFORK. Correct. > > --- > > lib/libopenbsd/Makefile | 3 +- > > lib/libopenbsd/recallocarray.c | 82 ++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 84 insertions(+), 1 deletion(-) > > FreeBSD commit 450dfafb1519ae7bb0615368ba45813bcabb9b35 back in 2015 > imported a different version of OpenBSD's reallocarray into libc. > Would it make sense to have only one reallocarray implementation? Or > what's the justification for having two implementations of the same > function? What might happen if someone links against both libc and > libopenbsd? Note, this is recallocarray(), not reallocarray(). libc has the latter, this commit added an implementation of the former to libopenbsd. From nobody Mon Jul 7 15:24:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbShc2Crzz61xrS for ; Mon, 07 Jul 2025 15:24:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 4bbShb4Q9dz46hg for ; Mon, 07 Jul 2025 15:24:31 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-8760d31bd35so110616639f.2 for ; Mon, 07 Jul 2025 08:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1751901865; x=1752506665; 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=7Oj4zufyOU55CCDmncF6ZMzitjRYF3wUKgc1KUZ/rzw=; b=YYZv5Rqym1SndPjfD1w6TDGrMkROoNgXM27xwpgQ2SrLFnu3ejuiYPBpnXLJsqfEn2 uoRWTyoIR5tbUBcBVmVTviniYArchZX+muubSlLDUoU0m4qG/vc2zKvr93i8EXl+T0RU jp0arB6CcRWGfR41EzQ6jIKsuUq/qPRNR93nBrIDyVdYOIkvEPD0avbwTP8HePhZVSyK ++FTiVNMDXNWZMSc/6rIq/+brmTeRZvqqqAbZhYZFcZpS58n86gOnrbsz3k7eBYvbWpp QRVPNFdwriqyTwHLGn4ulSLW0J3Ir1zHvJsXpLE5HXRrUzP1kcw/M9TtWNLO9aJUGMAc dlcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751901865; x=1752506665; 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=7Oj4zufyOU55CCDmncF6ZMzitjRYF3wUKgc1KUZ/rzw=; b=TJ4G8HMADe2d7dZFeNVzAOnp92h9Sp2NKVV3NKGZJyNZ3b4sv9nXP7C441xiAq6kER EPI0d21AMN5/TVOugfk1qNExykE8e8Pd1mhYhanyjMGMcnl2RRbgMKjSvocMU7jR+RG3 ZdCotArAJaaIyclLcpm+fhVATAtfWWAXrQljEKeWKWkdBvQzIRmzLScvCXzud7Y64fAR /cRAPeRMchMLgG+4EO/KADlmhsmW3A4nnM5gDDIW5EJPBr2U53a/Prb9HGoZlB8OLWwV bfu4XvzKQfBBbPlzIEc75lB7x4zM14EQj0Z+DybDAGNsdSnyiMS0X2/1uoNVwsD1Dype AXCg== X-Forwarded-Encrypted: i=1; AJvYcCXhuSaD3PtikVTD2ny+JNrzjjseVKpJ1hq/4TMRVUZ8CggBL5xsCaPOX7fORvQi062Y8fZLj2ZBV+JTifUEsnHMECFwUg==@freebsd.org X-Gm-Message-State: AOJu0YwogKlcri6cGzsCLAzRph18slEqfunjJKSliSb1F5HQn/Bpgwi1 nRWjgsc2rvL7hq3aabe14TnVPYxUB5WXbhXMY8tmSGAT58Vxwo9APOTIjBKQr/nPyzM= X-Gm-Gg: ASbGncsFq33GrgfOWl7JrS4FIUJ/G3s+KBihGv4pxychgqOEC+mjb8NJDe4Wu3Mrg/G Mpbe5PKc95mgo/4JH/ZY/wT5vHUa9AsIjr4SmSAGBI0s1NrjLd0kQ3Hao/KAqy/O7r0EDVXrHzW pRGPHOTeNUcnVMWwbhbl8MqGNRFRUHkCKxKC/yTakGkoWTrlsehRQQ/1aU1D14skYL7QL9p803I ZzDNGB1g1xxIt8upUnCosLd/VLGiASLYftNNaSram90JUk9SPsLYAeI0lV7jqE1dFEjqczCdLPq ciZ4Dyn+XIPoUPIvmjN2jlsoS/FrN5/bNRv82UCRhnG6pZ1zCM2Pc7I= X-Google-Smtp-Source: AGHT+IG9fOArTxOHDazxQj7+1r9f03uMaABuN/4AkS/Ryd4Y/uQqTG+hW9Ts7VzaiNqRUdbpYifAiw== X-Received: by 2002:a05:6602:2b93:b0:876:a951:b272 with SMTP id ca18e2360f4ac-8794a3b2afbmr3406239f.3.1751901864652; Mon, 07 Jul 2025 08:24:24 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-876e0858ac8sm219549839f.32.2025.07.07.08.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jul 2025 08:24:24 -0700 (PDT) Date: Mon, 7 Jul 2025 15:24:23 +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: 71a0af25a535 - main - libopenbsd: Add recallocarray() Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.3-STABLE-HBSD FreeBSD 14.3-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202507062318.566NIhSM031303@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wpjsuxfexknztctl" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bbShb4Q9dz46hg 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] --wpjsuxfexknztctl Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() MIME-Version: 1.0 On Mon, Jul 07, 2025 at 11:20:27AM -0400, Mark Johnston wrote: > On Mon, Jul 07, 2025 at 03:13:29PM +0000, Shawn Webb wrote: > > Hey Mark, > >=20 > > I've noted a couple things. > >=20 > > On Sun, Jul 06, 2025 at 11:18:43PM +0000, Mark Johnston wrote: > > > The branch main has been updated by markj: > > >=20 > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D71a0af25a5353f929521cb= 04c73a7266ac5b7b61 > > >=20 > > > commit 71a0af25a5353f929521cb04c73a7266ac5b7b61 > > > Author: Ricardo Branco > > > AuthorDate: 2025-06-16 21:41:48 +0000 > > > Commit: Mark Johnston > > > CommitDate: 2025-07-06 23:09:00 +0000 > > >=20 > > > libopenbsd: Add recallocarray() > > > =20 > > > Reviewed by: kib > > > MFC after: 1 month > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1698 > >=20 > > That appears to be the PR for POSIX O_CLOFORK. >=20 > Correct. >=20 > > > --- > > > lib/libopenbsd/Makefile | 3 +- > > > lib/libopenbsd/recallocarray.c | 82 ++++++++++++++++++++++++++++++++= ++++++++++ > > > 2 files changed, 84 insertions(+), 1 deletion(-) > >=20 > > FreeBSD commit 450dfafb1519ae7bb0615368ba45813bcabb9b35 back in 2015 > > imported a different version of OpenBSD's reallocarray into libc. > > Would it make sense to have only one reallocarray implementation? Or > > what's the justification for having two implementations of the same > > function? What might happen if someone links against both libc and > > libopenbsd? >=20 > Note, this is recallocarray(), not reallocarray(). libc has the latter, > this commit added an implementation of the former to libopenbsd. What a difference one letter can make, haha. I certainly missed the extra "c". Sorry for the noise and thanks for the clarification. --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 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 --wpjsuxfexknztctl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhr5pcACgkQ/y5nonf4 4fqJfA/8C0ihGJmFHiLheWZdWZPWlOMcCeMTL7qIs44GYpyN0i3w9Ie6d/sGSnbS N7FNFtx9LzKAo+Q6pyfgU852LvwCLHdTqYgY/McIfkPT7v2OJdPl7v0SS0fG6u5j TUVsH3Sjiaao/ESdTkoehNPRZbOYz0t81SIpb5RBDKhr2fLnTpWdZsGJQp3tXzY4 7fZXzR6e3hPQTgnQYidPkmEu2Q8JrwlZsKQPOO/z2c9tZwLFhwa3yelduffj3bm4 AldyT0tNFr0HE1PlhdYawkDYrZQ8z0XS4pxM/Z3U1HjaCk5Ok0ti0GhFWBau+Kue GHpRJTkQObVJ7Mrq+S52TU9p0qmKSEnBZw4vLhYBGGaNsBW7SelT5PqdvL3bg0Di NBb+lsUkCGmLSxGJmpFow4bAhQ9pzBxhiIQ2s2vZEmW0tsRvOgn52Rtn6P287Qo+ LzSo49+jWE40EUt4bzPUo+n8+NCHXaCeIJTcEkeorrcb5ypU9YkpFtcnJWL2iu74 YJTTDnmqKK2jU78JVmkP1ZRP0aA+/yHpcJXpRzjIbblCMASdzhbCF8Oq1Jf0mMVY HgJ298WOBf2lJdXtS5snQk3TIUhaVGioDJH75w0p8lQ0lPb8HeK+e/1AXROTLwK8 UK15Iiirhm1tReHCN9KWFL4Nixj4Cvsr3blaigJXtD7G+tnQs1o= =8Mz7 -----END PGP SIGNATURE----- --wpjsuxfexknztctl-- From nobody Mon Jul 7 15:42:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbT5m0jhCz62115; Mon, 07 Jul 2025 15:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbT5l6mgrz4FcC; Mon, 07 Jul 2025 15:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751902972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZF0AExwoeRVqPVaeAFKOCiPV8g4m82BUTAMENtqvyVk=; b=Lu75YU76IE4cF6UHjkFmLZWVeExzaRxQy5oPuanWKFrG4zWSn9/8+GGCAlW1xNVxru37vQ ph8yE5i8IvphaRLomTA8nF/6v/motkKMXXmWNtKR+cvnYOU+Yy06S0W2JtNgIlCLENWmss VvfI3yff7w4S+14tz8vVBBNcbJq5Xiz8iXBdV+2lnOH0uBa5m58VoyMayi+B1HCMtBRNFp EqdTdBH5h53zF81Vqcr/kI/9cePD7vQZcSO68r0Ulyc2EZLiPkDAYB5UkaxIE4d/9gmwNc vEoX693MxY8U1B+zTMUApsupbsEsoSXU8ebUS2IQKlE/AwweFSUB1nOHKoNaeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751902972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZF0AExwoeRVqPVaeAFKOCiPV8g4m82BUTAMENtqvyVk=; b=vqeX0Q6Btp8czjlPFln8eUb/AQfIX+m+TkS1bh2qZOFKZXDbstvhi/hSP2Gk/7I8TCBMnC O2uZzo5flMFH00vII4io2BgH6Qyr+rCFSPXWXV1BDtpXGo+6+d2zO4OCZkxYSVcq8n1jzD AHxDogmz2brc5RHV6F4avGBNVBAYoApY9gCItgWETwl0JlAP7PA/BrBDIiJc9WaYptxSu2 DqhBWfy1X5irnAKFNPhQKklSB+K0dmhowJ3wtWmetdzZ28LrubAnozO5ZWb91Qv54KAYLa RlHW+aXmzaEdzreY4T34hYlN8nQa84R8vzkA79MAtzuX9UcFGezvGY1Q5a7z9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751902972; a=rsa-sha256; cv=none; b=AMdZrUGDeKohx9W75fPoY+RRmc0DuD/1s1Z8y9l94rXkFxBiuQoQD16V9vbjmA9Xwebiee FLm1/UsJcg5e3ZbqnpkOmZq3sXpMxEg2WoP2P4Iahwx+s5t76cTWtLssYDziw4D3wr8/XQ 8pKv3CDILbsFAoYbgputANBNys1+23E8TCCqq1YOiDA94ToYWZ7BWoJ2Y5x+ovR3wFEC7d Rnb1sewZ9qH+50ZNbMNkimzRvRMMFQwhaLVDVHwMTDajPw4IIZ9bmA/J8SdeSuEH51t+Nz N4ZD2fSdkEuvVrqq+K1ylUn9pvzBbYXvubHwVeC/ncdBOoR18zWh8dpGgOAPLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbT5l644Fzx4k; Mon, 07 Jul 2025 15:42: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 567Fgpaf091925; Mon, 7 Jul 2025 15:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Fgpee091922; Mon, 7 Jul 2025 15:42:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:42:51 GMT Message-Id: <202507071542.567Fgpee091922@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: 9940c974029b - main - random: Change the entropy harvest event queuing scheme List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9940c974029ba53fc00696b3fa1784725c48a9e9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9940c974029ba53fc00696b3fa1784725c48a9e9 commit 9940c974029ba53fc00696b3fa1784725c48a9e9 Author: Mark Johnston AuthorDate: 2025-07-07 15:02:36 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 15:41:57 +0000 random: Change the entropy harvest event queuing scheme The entropy queue stores entropy gathered from environmental sources. Periodically (every 100ms currently), the random kthread will drain this queue and mix it into the CSPRNG's entropy pool(s). The old scheme uses a ring buffer with a mutex to serialize producers, while the sole consumer, the random kthread, avoids using a mutex on the basis that no serialization is needed since nothing else is updating the consumer index. On platforms without total store ordering, however, this isn't sufficient: when a producer inserts a queue entry and updates `ring.in`, there is no guarantee that the consumer will see the updated queue entry upon observing the updated producer index. That is, the update to `ring.in` may be visible before the updated queue entry is visible. As a result, we could end up mixing in zero'ed queue entries, though this race is fairly unlikely in practice given how infrequently the kthread runs. The easiest way to fix this is to make the kthread acquire the mutex as well, and hold it while processing queue entries. However, this might result in a long hold time if there are many queue entries, and we really want the hold times to be short, e.g., to avoid delaying interrupt processing. We could introduce a proper MPSC queue, but this is probably overcomplicated for a consumer which runs at 10Hz. Instead, define two buffers, always with one designated as the "active" buffer. Producers queue entries in the active buffer, and the kthread uses the mutex to atomically flip the two buffers, so it can process entries from the inactive buffer without holding the mutex. This requires more memory, but keeps mutex hold times short and lets us keep the queue implementation very simple. Reviewed by: cem MFC after: 1 month Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51112 --- sys/dev/random/random_harvestq.c | 103 +++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 57 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index ee37bda36496..395310b115fb 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -131,30 +131,14 @@ static struct harvest_context { /* The context of the kernel thread processing harvested entropy */ struct proc *hc_kthread_proc; /* - * Lockless ring buffer holding entropy events - * If ring.in == ring.out, - * the buffer is empty. - * If ring.in != ring.out, - * the buffer contains harvested entropy. - * If (ring.in + 1) == ring.out (mod RANDOM_RING_MAX), - * the buffer is full. - * - * NOTE: ring.in points to the last added element, - * and ring.out points to the last consumed element. - * - * The ring.in variable needs locking as there are multiple - * sources to the ring. Only the sources may change ring.in, - * but the consumer may examine it. - * - * The ring.out variable does not need locking as there is - * only one consumer. Only the consumer may change ring.out, - * but the sources may examine it. + * A pair of buffers for queued events. New events are added to the + * active queue while the kthread processes the other one in parallel. */ - struct entropy_ring { + struct entropy_buffer { struct harvest_event ring[RANDOM_RING_MAX]; - volatile u_int in; - volatile u_int out; - } hc_entropy_ring; + u_int pos; + } hc_entropy_buf[2]; + u_int hc_active_buf; struct fast_entropy_accumulator { volatile u_int pos; uint32_t buf[RANDOM_ACCUM_MAX]; @@ -183,37 +167,41 @@ random_harvestq_fast_process_event(struct harvest_event *event) static void random_kthread(void) { - u_int maxloop, ring_out, i; + struct harvest_context *hc; - /* - * Locking is not needed as this is the only place we modify ring.out, and - * we only examine ring.in without changing it. Both of these are volatile, - * and this is a unique thread. - */ + hc = &harvest_context; for (random_kthread_control = 1; random_kthread_control;) { - /* Deal with events, if any. Restrict the number we do in one go. */ - maxloop = RANDOM_RING_MAX; - while (harvest_context.hc_entropy_ring.out != harvest_context.hc_entropy_ring.in) { - ring_out = (harvest_context.hc_entropy_ring.out + 1)%RANDOM_RING_MAX; - random_harvestq_fast_process_event(harvest_context.hc_entropy_ring.ring + ring_out); - harvest_context.hc_entropy_ring.out = ring_out; - if (!--maxloop) - break; - } + struct entropy_buffer *buf; + u_int entries; + + /* Deal with queued events. */ + RANDOM_HARVEST_LOCK(); + buf = &hc->hc_entropy_buf[hc->hc_active_buf]; + entries = buf->pos; + buf->pos = 0; + hc->hc_active_buf = (hc->hc_active_buf + 1) % + nitems(hc->hc_entropy_buf); + RANDOM_HARVEST_UNLOCK(); + for (u_int i = 0; i < entries; i++) + random_harvestq_fast_process_event(&buf->ring[i]); + + /* Poll sources of noise. */ random_sources_feed(); + /* XXX: FIX!! Increase the high-performance data rate? Need some measurements first. */ - for (i = 0; i < RANDOM_ACCUM_MAX; i++) { - if (harvest_context.hc_entropy_fast_accumulator.buf[i]) { - random_harvest_direct(harvest_context.hc_entropy_fast_accumulator.buf + i, sizeof(harvest_context.hc_entropy_fast_accumulator.buf[0]), RANDOM_UMA); - harvest_context.hc_entropy_fast_accumulator.buf[i] = 0; + for (u_int i = 0; i < RANDOM_ACCUM_MAX; i++) { + if (hc->hc_entropy_fast_accumulator.buf[i]) { + random_harvest_direct(&hc->hc_entropy_fast_accumulator.buf[i], + sizeof(hc->hc_entropy_fast_accumulator.buf[0]), RANDOM_UMA); + hc->hc_entropy_fast_accumulator.buf[i] = 0; } } /* XXX: FIX!! This is a *great* place to pass hardware/live entropy to random(9) */ - tsleep_sbt(&harvest_context.hc_kthread_proc, 0, "-", + tsleep_sbt(&hc->hc_kthread_proc, 0, "-", SBT_1S/RANDOM_KTHREAD_HZ, 0, C_PREL(1)); } random_kthread_control = -1; - wakeup(&harvest_context.hc_kthread_proc); + wakeup(&hc->hc_kthread_proc); kproc_exit(0); /* NOTREACHED */ } @@ -435,7 +423,7 @@ random_harvestq_init(void *unused __unused) hc_source_mask = almost_everything_mask; RANDOM_HARVEST_INIT_LOCK(); - harvest_context.hc_entropy_ring.in = harvest_context.hc_entropy_ring.out = 0; + harvest_context.hc_active_buf = 0; } SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_init, NULL); @@ -540,9 +528,9 @@ SYSUNINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_d * This is supposed to be fast; do not do anything slow in here! * It is also illegal (and morally reprehensible) to insert any * high-rate data here. "High-rate" is defined as a data source - * that will usually cause lots of failures of the "Lockless read" - * check a few lines below. This includes the "always-on" sources - * like the Intel "rdrand" or the VIA Nehamiah "xstore" sources. + * that is likely to fill up the buffer in much less than 100ms. + * This includes the "always-on" sources like the Intel "rdrand" + * or the VIA Nehamiah "xstore" sources. */ /* XXXRW: get_cyclecount() is cheap on most modern hardware, where cycle * counters are built in, but on older hardware it will do a real time clock @@ -551,28 +539,29 @@ SYSUNINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_d void random_harvest_queue_(const void *entropy, u_int size, enum random_entropy_source origin) { + struct harvest_context *hc; + struct entropy_buffer *buf; struct harvest_event *event; - u_int ring_in; - KASSERT(origin >= RANDOM_START && origin < ENTROPYSOURCE, ("%s: origin %d invalid\n", __func__, origin)); + KASSERT(origin >= RANDOM_START && origin < ENTROPYSOURCE, + ("%s: origin %d invalid", __func__, origin)); + + hc = &harvest_context; RANDOM_HARVEST_LOCK(); - ring_in = (harvest_context.hc_entropy_ring.in + 1)%RANDOM_RING_MAX; - if (ring_in != harvest_context.hc_entropy_ring.out) { - /* The ring is not full */ - event = harvest_context.hc_entropy_ring.ring + ring_in; + buf = &hc->hc_entropy_buf[hc->hc_active_buf]; + if (buf->pos < RANDOM_RING_MAX) { + event = &buf->ring[buf->pos++]; event->he_somecounter = random_get_cyclecount(); event->he_source = origin; - event->he_destination = harvest_context.hc_destination[origin]++; + event->he_destination = hc->hc_destination[origin]++; if (size <= sizeof(event->he_entropy)) { event->he_size = size; memcpy(event->he_entropy, entropy, size); - } - else { + } else { /* Big event, so squash it */ event->he_size = sizeof(event->he_entropy[0]); event->he_entropy[0] = jenkins_hash(entropy, size, (uint32_t)(uintptr_t)event); } - harvest_context.hc_entropy_ring.in = ring_in; } RANDOM_HARVEST_UNLOCK(); } From nobody Mon Jul 7 15:44:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbT745b46z6211k; Mon, 07 Jul 2025 15:44: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbT744s5Zz4G6h; Mon, 07 Jul 2025 15:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751903040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hl09G+V9B5axLtWjIG/NV0Rhcwh2iIgYqGorQUORNi0=; b=V8dh714hQIvN4xMy+ONbQuzlrC8cKqjwFDyLWrR3UQ0sZWoYOBUKJlE6E7m8Tjqh4YCC20 OILQFPCHjj4PhmgqmGjZDBki3siAbkoJfkGqn1PaaA23PUHaGWtC5mBq28oQrW2uLYSjDx 8rR6er7UbYm43E1noHbIJk4FeoawVw+AAMv24a0WZV0zFJNsqHN5OPUfnELgI7xafk4+q0 GZridzOcz1jY/ZFO14JbzH1uu9w1+dLpp29NM8GSnaUXAjjUzdnOTjybtUYKO/ftjWO/Ko jRm3gEBeY06ANnYGVnOSIztKuOQMIUyiGENF/yYu6KfTOVFTQlfYMol1yyJ6Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751903040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hl09G+V9B5axLtWjIG/NV0Rhcwh2iIgYqGorQUORNi0=; b=YOWPo0MH6wAOTOCPCMGgTr5IRwn9cKJKP/xcbxr9NfG4nFofHROlM76KxDG0Hh6apDtku7 ydbx6G7cvyGaOkLpYtf3wDMH/iSlY8tNnP/hzbM2CBYenlPAnuvsurxV0Sf0W0IyAU92KF pE+LyZDXhNBGVW/TfEHNOR5aIhWnpJsYsok2vM8wCsJYx6TowTmd7Re7GXZqcHXyMujsmq ViyEvfcqkFGeG4jt9arWXlVes+PCZIiT8iguesWSs4pS5MR8qrxnrbfLAPWChlT/Y0+200 D8Jjtkbxf0ysFvnj7MNKxlpmbwuEGHuhpAjVLHV6uRvq8/9pJPF1B7CDM9hS9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751903040; a=rsa-sha256; cv=none; b=S5mlqqTayWVe2ZX6+nfElH5RMK0VGLVWlOuXWU5FhMNmXYsKqiaRPlmXeXygIzEwB7Auqh aRvL9atCV9SfQ3efXEqu21AhE6T3aO7YoppCs8e3fNVnp95esaxY6xpN275VGHFioPyzEH 7arWUddsXMEszJtJ7XiijlMXVDeNcPNym8GlwK9JykKnJPjGY/kZdYB7JtixdNH4xfhAg/ e7YVhqXcvkP4Tj2u53kekVmCzkd2QjPDS/XXTb3fsbijvkuPjQ1yRXhzDjg7E/8kQND+Ps HpRNmW1O9t78oZdJIyiaDyXvfM5TQXMsvzdZa/yk+XcFThuChoh1NL9if76lQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbT744RGYzxCl; Mon, 07 Jul 2025 15:44: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 567Fi0EY092404; Mon, 7 Jul 2025 15:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Fi0ZJ092401; Mon, 7 Jul 2025 15:44:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:44:00 GMT Message-Id: <202507071544.567Fi0ZJ092401@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: eda96744b434 - main - lposix: Clean up the posix namespace definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: eda96744b434325c475dce449744f2268f1033e8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=eda96744b434325c475dce449744f2268f1033e8 commit eda96744b434325c475dce449744f2268f1033e8 Author: Mark Johnston AuthorDate: 2025-07-07 15:43:27 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 15:43:27 +0000 lposix: Clean up the posix namespace definitions The posix module is subdivided according to C headers; for instance, posix.unistd contains routines available from unistd.h, such as chown(2). A quirk of our implementation is that each of the modules is a direct entry in the global table. That is, there is no "posix" table. Instead, "posix.foo" and "posix.bar.baz" are both top-level tables. This is surprising and goes against Lua's shorthand of using "." to access keys in a table. lua-posix also doesn't work this way. Rework things so that "posix" and "posix.sys" are proper tables. Existing flua code which uses require() to bind posix submodules to a name will be unaffected. Code which accesses them directly using something like _G["posix.sys.utsname"].uname() will be broken, but I don't think anything like that exists. In particular, it is now possible to call posix.sys.utsname.uname() without any require statements. Reviewed by: imp, bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51158 --- libexec/flua/linit_flua.c | 10 +-------- libexec/flua/modules/lposix.c | 51 +++++++++++++++++++++++++++++++++---------- libexec/flua/modules/lposix.h | 8 +------ 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 8eaa4af1ffca..b466b7872158 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -57,18 +57,11 @@ static const luaL_Reg loadedlibs[] = { #endif /* FreeBSD Extensions */ {"lfs", luaopen_lfs}, - {"posix.fnmatch", luaopen_posix_fnmatch}, - {"posix.libgen", luaopen_posix_libgen}, - {"posix.stdlib", luaopen_posix_stdlib}, - {"posix.sys.stat", luaopen_posix_sys_stat}, - {"posix.sys.utsname", luaopen_posix_sys_utsname}, - {"posix.sys.wait", luaopen_posix_sys_wait}, - {"posix.unistd", luaopen_posix_unistd}, + {"posix", luaopen_posix}, {"fbsd", luaopen_fbsd}, {NULL, NULL} }; - LUALIB_API void luaL_openlibs (lua_State *L) { const luaL_Reg *lib; /* "require" functions from 'loadedlibs' and set results to global table */ @@ -77,4 +70,3 @@ LUALIB_API void luaL_openlibs (lua_State *L) { lua_pop(L, 1); /* remove lib */ } } - diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c index 9edc7e687786..75cdd345aeaa 100644 --- a/libexec/flua/modules/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -590,21 +590,21 @@ static const struct luaL_Reg unistdlib[] = { #undef REG_SIMPLE #undef REG_DEF -int +static int luaopen_posix_libgen(lua_State *L) { luaL_newlib(L, libgenlib); return (1); } -int +static int luaopen_posix_stdlib(lua_State *L) { luaL_newlib(L, stdliblib); return (1); } -int +static int luaopen_posix_fnmatch(lua_State *L) { luaL_newlib(L, fnmatchlib); @@ -622,14 +622,21 @@ luaopen_posix_fnmatch(lua_State *L) return 1; } -int +static int luaopen_posix_sys_stat(lua_State *L) { luaL_newlib(L, sys_statlib); return (1); } -int +static int +luaopen_posix_sys_utsname(lua_State *L) +{ + luaL_newlib(L, sys_utsnamelib); + return 1; +} + +static int luaopen_posix_sys_wait(lua_State *L) { luaL_newlib(L, sys_waitlib); @@ -655,16 +662,38 @@ luaopen_posix_sys_wait(lua_State *L) return (1); } -int -luaopen_posix_sys_utsname(lua_State *L) +static int +luaopen_posix_unistd(lua_State *L) { - luaL_newlib(L, sys_utsnamelib); - return 1; + luaL_newlib(L, unistdlib); + return (1); } int -luaopen_posix_unistd(lua_State *L) +luaopen_posix(lua_State *L) { - luaL_newlib(L, unistdlib); + lua_newtable(L); /* posix */ + + luaL_requiref(L, "posix.fnmatch", luaopen_posix_fnmatch, 0); + lua_setfield(L, -2, "fnmatch"); + + luaL_requiref(L, "posix.libgen", luaopen_posix_libgen, 0); + lua_setfield(L, -2, "libgen"); + + luaL_requiref(L, "posix.stdlib", luaopen_posix_stdlib, 0); + lua_setfield(L, -2, "stdlib"); + + lua_newtable(L); /* posix.sys */ + luaL_requiref(L, "posix.sys.stat", luaopen_posix_sys_stat, 0); + lua_setfield(L, -2, "stat"); + luaL_requiref(L, "posix.sys.utsname", luaopen_posix_sys_utsname, 0); + lua_setfield(L, -2, "utsname"); + luaL_requiref(L, "posix.sys.wait", luaopen_posix_sys_wait, 0); + lua_setfield(L, -2, "wait"); + lua_setfield(L, -2, "sys"); + + luaL_requiref(L, "posix.unistd", luaopen_posix_unistd, 0); + lua_setfield(L, -2, "unistd"); + return (1); } diff --git a/libexec/flua/modules/lposix.h b/libexec/flua/modules/lposix.h index da7079056826..1aa33f042571 100644 --- a/libexec/flua/modules/lposix.h +++ b/libexec/flua/modules/lposix.h @@ -7,10 +7,4 @@ #include -int luaopen_posix_fnmatch(lua_State *L); -int luaopen_posix_libgen(lua_State *L); -int luaopen_posix_stdlib(lua_State *L); -int luaopen_posix_sys_stat(lua_State *L); -int luaopen_posix_sys_utsname(lua_State *L); -int luaopen_posix_sys_wait(lua_State *L); -int luaopen_posix_unistd(lua_State *L); +int luaopen_posix(lua_State *L); From nobody Mon Jul 7 16:34:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbVFV354hz60d9m; Mon, 07 Jul 2025 16:34: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbVFT5J5vz3JCd; Mon, 07 Jul 2025 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751906077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KDdGNI9K9+BXr1BMx4g3R+kzp7CgtCr1yPKW0cpmgRY=; b=f5YcfyVONmLTnnXvH1MqtehM89Qo4tWsK2aJMR+a+e50CcWUVdHX3LM05kM45+a0cppMpt bO+KLQrqBHJAqmkFT3o2YZ32WrMNRO8YQDXUgB0aCtI5CHguPp+of2PYQiNr1Kpk+W0dCP UF2/lPeMvTS+s+Y+iNz71tddXB4txsFndaFbmPqvzou/vC65lc6gKzl6ySjaMJj04mhJai o63FotZ7OwfFcHZVmGxuwwDp2oQwmqhivuh5TY1IR1FpO1Og7fUN6naOmpray/ash6dz/9 5pmTA9sN68M5PdJgdpacMVpa8IlHzgec1M3woi95eKvfIyNwsfJmD5jTBK0dtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751906077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KDdGNI9K9+BXr1BMx4g3R+kzp7CgtCr1yPKW0cpmgRY=; b=x3F5JuihtwaAQI0HlJBeXv43S8r1EpaaWVPYxVWkI9dqslhaINuUfZ+CuyYdDN/Y0YAzih nP2NnBdXBwsHkeZCXUKWx6nb1Cw/fUZIqPQ7T0PNqkjFO/B1QGqIhxk/E06IrxYEAtFBQX OL6LiQo54DQ5Yo2EtgF/t8a7LzqLMmHNtiH2zDhu9NLuTEZQA8av1W7Ks4ZMhlwOLiQOUp BkC2diGt05OOP5DMIaHCMjyIKgPsx06sfLsg775hXnRw89U7deYfy5JnkkE6STvzHPuiVW rU+B53TiwRypi4o/V5mejJXtBbJeKPffY4Ba4zb+SO1cxdUBIt+lcPZ+6c8YPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751906077; a=rsa-sha256; cv=none; b=sJmghjF5PyMmsja7u3iqvYXiQuVKGJA5SoPaULY1HSRWAo2w5d7N9O2Jc29XBkBfm9lBW/ Bb2sjkrBYCdc40fd4TZcghAw82nom73QkQsfOxdbKCmA9k/gEZHJLkpsUq6Wq8ncNDTofU h7bqFsOCgGq7djQHb35ctfmLamd9y/Un7gTR/SVKCIu7DL8VPet/FHSIzyYumj43ObGXME ncFeZwfcYkrHnJMqikxcC7TGbmdIBgu/a2CUHvNyfjEeRGF3fRNEumOnYYWJ6jHB2+wFsW 4x3pK/vPlvrXayc0FPSOPnpvSoTfWrenAH5lMs7hxdPRAHh+TdYb04+0WKFZFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbVFT30bMzym7; Mon, 07 Jul 2025 16:34: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 567GYb5h086857; Mon, 7 Jul 2025 16:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567GYbQt086854; Mon, 7 Jul 2025 16:34:37 GMT (envelope-from git) Date: Mon, 7 Jul 2025 16:34:37 GMT Message-Id: <202507071634.567GYbQt086854@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: 96f544bcc1cb - main - tcp: don't allow to connect a TCP/IPv6 endpoint in TIME WAIT state List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 96f544bcc1cb641ab096812c168ebe9136e78c15 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=96f544bcc1cb641ab096812c168ebe9136e78c15 commit 96f544bcc1cb641ab096812c168ebe9136e78c15 Author: Michael Tuexen AuthorDate: 2025-07-07 16:29:35 +0000 Commit: Michael Tuexen CommitDate: 2025-07-07 16:29:35 +0000 tcp: don't allow to connect a TCP/IPv6 endpoint in TIME WAIT state This ensures the TCP/IPv4 and TCP/IPv6 behave the same. Reported by: syzbot+4de353ba85dac4dcb1ab@syzkaller.appspotmail.com Reviewed by: Peter Lei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51125 --- sys/netinet/tcp_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 3ea561e63503..687b0d538666 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1520,7 +1520,8 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td) INP_WLOCK_ASSERT(inp); if (__predict_false((so->so_state & - (SS_ISCONNECTING | SS_ISCONNECTED)) != 0)) + (SS_ISCONNECTING | SS_ISCONNECTED | SS_ISDISCONNECTING | + SS_ISDISCONNECTED)) != 0)) return (EISCONN); if (__predict_false((so->so_options & SO_REUSEPORT_LB) != 0)) return (EOPNOTSUPP); From nobody Mon Jul 7 16:55:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbVk01spZz60ggZ for ; Mon, 07 Jul 2025 16:55:52 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-19.consmr.mail.gq1.yahoo.com (sonic313-19.consmr.mail.gq1.yahoo.com [98.137.65.82]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbVjz064gz3SYS for ; Mon, 07 Jul 2025 16:55:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1751907348; bh=2dZY8A//+bNAj2vCulMQ057Yp31Tor/7tjJNyPDZWjw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=o2tmHXMQ9VOQ20/53ciVQ5FBOtBPPD4sniTu99b6/WwGfeMAZjTz6g8FofPnTw54ETQ003PCDIqF+vgn2LS5t6KeKOsnjfBfk30VYe7VR2OaShUze0QaGY8ieZIWeQvnKCNwDVyXxl/m3uVwxYoWM5sWBop7jptm7gbBBHKX4HIn72KooKKSed39xhF51GNNP3aexUqAjgmfIZqv9dD1la1Y2cAfwqsSqFPIjEpgyHGpN3Dz+a0TCsbpfN2D9h63HvZSDxY8X4tSNxIaAAZC6WoE7CM8iXWyXsZjqgso0G2CGLcD9gP1gvXH71ZAulpNIvyJjyTJjbX4HQBat/QmTw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1751907348; bh=W7H7w1AJpJZc9Gvyfa132rwsJizD3JhnuBZGfhD6STJ=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=OFYRo5wqj26zGGJz6tH3tqODXftOpD05N68tzKJDUJlNEAOUegC6imNjYlPeGXm3BJIs2gnZGylb7hpVfS+3aErOFFHaj9U/pezxqFd+gXgHCNwDBaJVcL5MRxRjX/GGUj6uZOk08UlcyJNkY6Fr9oAAKBDPQIT0JImrFncj+QOE4n0typyCUiWsdyQIjvg4c19Mve7FM1GI8AmNksV/cf9ar9q30obphJcYanUULtPZUUjEqE8hvxZjLJyKPfk0H7XlPQj/m3tyEr6vmmN8Fc6ZMPsRC+YFHXYD4NBUJtUTy6EU/IRKPAbHc8aI86XX1kAiiGL84uQHeInWf1QCyg== X-YMail-OSG: 6WX5vOkVM1kLukXmMPY.wcV9orfyxFv_uNPwfIXiHp_BGqC0wmSKvaHMEEreAf. tKpCLL45LpnAJRbeCKnez_JTPYdOp8Cg.x4ZDRLvLtoXK_7N3vkMnTkMkQap1.qen4qmItrfOAy0 qF_tcRxkGNq99gNTl_E4Ig1yWnTiaAi6mtNrT_3S47yTbJV5VbEI1OVb81K.iQMM5JrHw79NScWi IrflICPmZ7eoWq8eCZRveaIIS2eXYueRXcH_0BaixlPitRWPGvaggntUpYfPISYcP6Okory4oecw 7ogfGcV54fehaNcGoggHf9iHll9ROo1ZfqEEizEQwhwEpBK7hrsBRNgGVoNnquvbDgQePQ9gIwpS YmSAqc_0JmBsRBoB87zc0B6Dv565QdrQ8PW0oyeTcY6W3kyXlB3t1oWb_SnvWl1sejlrQLcAmIOC y478U6iqfsaNbFMqBZzWJ0lta_dvkGfr1XnXi7awDlbe4GabKuGKs4ESkIkyWwKy3DImOP2yfKDe 8Rio2gbPuPeKsvsxcVBlHvWlRQ_D4IMSVnZQMrzitUj.SB3t8bJnLA5gyBt2jlsXZFBzF3OKGyr5 Se_OweMhFYq85EPmjvPz1qslIBrTTUL8zqa2GLdDwtOGBLDT1LJzES4SVIhe3f.Pv9yT2AAiitRz T2LImWDKOHIc__QIQluHE5Ox92WZs_PwdZx8WX8sN532v7jmJZBbt1dSHZMvHYhC4Alo1yZqV.8O jubN9dqz1kLzsm_5isGy3ffFTl4vCloW.CZC9jv2K0PIV8a7L6Sr2aySCOpKoOCtzcJdahxi89tz iAwSDPWrUmt2K3biJiFEWvkUzfrS.Uz5cv9adNU51fJnrOErb9hksdwPqOV7f.XfNcdKaLAk5FRR BBXxCJgulu1xZxBrFq7LIqsd8vf08MYywYjnSSpdN8rkZPXokd8PiIV.FMC0yeIqnee0BNvHLhni 794yCLd0MVH8ZNVug.VdnxjE4yu.K._m.ERqsir9TMq8PBucjkHLqfak8QDf0wXdWEBI8UZ0Imcu rGrNkHXPfxXeaobN0G9zI95jpAOS2WdsI9wogYCJ1WTbyCh5WvWVnIIV.Jy.yU28gsW7eAfl8BFR 72HHMpm8bSdFUFo7lgyk6gw2wiHD1W6cnD4T4rTlcGhRngbkMWXVNKpOmBwuEmlZcz5FxefZTNnQ fV0eUybEen5WS7swCgS9bdC4DeU7m7HwLjbikrHGGcK67uMIMj4xAQvkdTlBOUROHlvKv_fOhq1f 7o7vNXbwVOjEFHHcOkIEG2xNPi6ytwX8.R6LoFMStx89UY2IdULjsWJ0WxM9mMNqXSe_CYgZ2IRN lrGSGMUXeil0RvhKKQ9YSnxw_GsyNzfQw54I8d0PJsDJvlrRFPF7cNS0.apLXqdXIZ4bMaRYWCcm tp_AzFFn8pm90heryqROUJqeA0fxoxTo3JALmJdVG_Oj2NUbZbwHfgyTnMprz5iaXsDMqBJFW1pU n3k_N7I5ZLzQhpMMzhOKPz7ux.041KU1TJ8zyGDFfBJyIj7.X6gqQ.bydZJp_fSFh4eTU8ns7Njd eANY326OJwTBiUc7DxG5Z.LXQf36MwktDmlXAM.kzCOqjFLQx44MDO9cTFEjOSranmgVeLclXyK1 817KDlwMrJc9rxrAW5pDcDjF.5XdLNHgxmR.XBvumXkNWvhNRCHh6b6ojK8iYwlUxBX.U0NPVEPt .6osF5c1uIAZ4utUoFJnfeBIR_ZIDAxQxaJ5panfK8IQ1.EgA_LeaES4ookdspthKM07iDgHzSiY mtaXadtPoPuJx1OJQZ89ZTOfjaI.J7JvvQLZXs3KKr4yjzGLTApMOp6To4lLA8ee4wPS11flqwjB uuUbnnVw1fl3fmv4Z.uD3PlghQUhdMi1_gx5RIZepCh27ebdB8PVo2YMprN0u.9VOVlW5kQlLCsC aJgrRpVhTDiqHOohjhZayMluxhOcRAmao1lYTZDxpULZdVwNhnuD4NRppqw1N1vuQqh7PiqdOr7q 9X8Rttmu_TVq_A0s9dl4peuhJeHojN.mWknglknwuo0KO1swJ.xBwQzQLuWBlb3l5vkio02LAYdp QY93tOrDQm0Qe0t1OrUKTWmyPydl3qdD.aBaH1tZby5uZCP6cAXOjG1PeScwrZKlBnfmIj18mx.R GrOhJ8xcIcgTi1FNilOSQKKYQ5tRsGDiji2BW4EwYkYasH2Zo4w6XFTC48NPPO_v4.ZhWC3JEP6E NNhCtS2GUgV99vz_7j8TPC7Kw35UMKDU- X-Sonic-MF: X-Sonic-ID: 96cb7a9e-40f0-4485-9e57-d08c141fa168 Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Mon, 7 Jul 2025 16:55:48 +0000 Received: by hermes--production-gq1-74d64bb7d7-2dlqg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 99197a6348d77db9f8dfe444b74c1850; Mon, 07 Jul 2025 16:55:46 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: d3c06bed2c16 - main - clang: install clang-scan-deps (enable generation of std*.cppm and such too?) From: Mark Millard In-Reply-To: Date: Mon, 7 Jul 2025 09:55:35 -0700 Cc: dev-commits-src-main@freebsd.org, Dimitry Andric , Kyle Evans Content-Transfer-Encoding: quoted-printable Message-Id: <644F460A-8395-4B94-8AF8-85427580E2FF@yahoo.com> References: To: Lexi Winter X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Rspamd-Queue-Id: 4bbVjz064gz3SYS 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:36647, ipnet:98.137.64.0/20, country:US] On Jul 7, 2025, at 07:29, Lexi Winter wrote: > Mark Millard: >> Lexi Winter wrote on >>> clang: install clang-scan-deps >=20 >> Would it be reasonable to also enable generation/installation of, >>=20 >> /usr/lib/libc++.module.json (a guess about where it goes) >>=20 >> /usr/include/c++/v1/std.cppm >> /usr/include/c++/v1/v1/std.compat.cppm >=20 > i am not familiar with libc++.module.json, but yes, i was intending to > look at whether we can ship std.cppm and related files for import std. >=20 > are you aware of any build system which is capable of consuming these, > for testing? i believe, at least the last time i looked, CMake did = not > have support for this. It has been available since at least cmake 3.30 but involves use of CMAKE_EXPERIMENTAL_CXX_IMPORT_STD . But pure command line use is also possible without cmake as well. For example usage see: = https://igormcoelho.medium.com/its-time-to-use-cxx-modules-on-modern-c-41a= 574b77e83 for recent basic notes about both gcc15 and llvm19 in a linux context, for example. It includes material about using cmake. That involved: set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD = "a9e1cf81-9932-4810-974b-6eccaf14e457") The quoted string changes sometimes with cmake version changes. See: https://github.com/Kitware/CMake/blob/master/Help/dev/experimental.rst and its "C++ import std support" section. Select which vintage to look at based on Tags, matching the cmake version one is going to use. (Looking around, the value can change and then in a later version change back to a prior value.) The notation used as an example is (cmake 4.0.0 is used, as is clang++ 19.1.7 if the comment status vs. gcc15 is changed): QUOTE cmake_minimum_required(VERSION 4.0.0) set(CMAKE_CXX_COMPILER /usr/bin/g++-15) # set(CMAKE_CXX_COMPILER /usr/bin/clang++-19) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=3Dlibc++") set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD = "a9e1cf81-9932-4810-974b-6eccaf14e457") set(CMAKE_CXX_MODULE_STD 1) project(example2 VERSION 0.1.0 LANGUAGES CXX) add_library(demo) target_sources(demo PUBLIC FILE_SET CXX_MODULES FILES demo.cppm) add_executable(example2 main2.cpp) target_link_libraries(example2 PRIVATE demo) END QUOTE As FreeBSD does not support use of -stdlib=3Dlibstdc++ via any clang++* , It may be that explicit -stdlib=3Dlibc++ use is not required for any clang++ . But lang/gcc15 and the like do support both -stdlib=3Dlibstdc++ and -stdlib=3Dlibc++ . But I do not know if the likes of gcc15 are set up to allow "import std;" or "import std.compat;" for either or both of those. The old, original cmake material about "import std;" support is at: https://www.kitware.com/import-std-in-cmake-3-30/ It actually used: cmake 3.29.20240416 and a patched llvm18.1.1 . It seem far enough along at this point to experiment with if things were enabled to allow such. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Mon Jul 7 17:23:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbWKK22SWz60kZn; Mon, 07 Jul 2025 17:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWKK1Wytz3dQj; Mon, 07 Jul 2025 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r236bkBBXQUJ2801xKVFWANPKGfcRHX7GzwE68BQE3M=; b=M3BmzKKReVlOXQto2X61BudBGgmAJ9s4LV8QJVAKs6ELYK1YVFngvZ8r8WG3CyCG/L7oaE TmizblPoztE3iOqAYHypNWTv9Pt0Mxw8TvLKLZvR4cNJD/O9YXmfZ6Z9nhLsMegzvQ+gRf cgHMP3itmC3BZc5R8ADYm0jFm60LbUlTtkXIR+J+isaIUjRCBQN5FOYa69PeU4uUa9jwi8 ioB9jeSpEEBZuCfTB1MdYCL9Bj1bJs55Rkj9xX1pvauTSeAWuDAFP5DbGAy2ZfFpL9FP9+ +n6cOI1uzUA98X4ufrHsymnxAW4Tpf8i33uF+wdMS99eQdORZMKxMKjD/nyeSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r236bkBBXQUJ2801xKVFWANPKGfcRHX7GzwE68BQE3M=; b=hXWqpF0ftCkgcPHXtHgnpvGHHyFMIH6Cq1llrvfcys9Q+8pupnmDBPE1WMNn2dI1lH4LMj WFfRqB5+NDN68MClFXrmP0sGR8OEWc2WRQ6QLZL4QWKGwgGto8nPx4yFoVJV7VymOwJN+F fdYsKGme3sydnrfOV6jJ9RTpo0djRhHq/lmCPVpnpmM9tPUMaAqfd3ZTV4mfpkWyFRCj0w eUzH2mFpaWjpr2TnJJPjc22ReDlHS6adt8VjsZaG6Jo6aUJu3PseoqL7sGpl/mCCToYJGT 3biZauJSOYZ6ysx5p9p56764ToaPHTSPCcx/pVR777IzvXvmYnEU8nM9PePmUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751908981; a=rsa-sha256; cv=none; b=CD4dq28vAd886M69TUmBLfMVLImK+wqDQw5U2PzOKghytZrB6uo3gW7WnVqkW6Ua55Rsxc c+B7r2M7SyoL9fc+KzSm4zTdWQmmlxomkBlZ0SHWF+NXykUt5Cg9g0OcXFNQAR1wKTb7il Du+W1XKKLF1P9ZEeCMYEMiyNj2UDrQjXmSJ8sccXYmLb/Gu8plVSWEanB1PmK+87l9qxUq 0wIfRQf6mjK+J7ktuKRBn2tdn9cYwu1wrn48vltSBwKXnMfIgmQdoVTZQy5cz6iPoJ/N5q rKLd3MGx7jitXeplaEcgFowxO70KEZVFUdZM2yrQjXyVZDWt0Crm/FbUxkEqeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbWKK1717z10Zy; Mon, 07 Jul 2025 17:23: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 567HN0Dw080597; Mon, 7 Jul 2025 17:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HN09V080594; Mon, 7 Jul 2025 17:23:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:23:00 GMT Message-Id: <202507071723.567HN09V080594@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: fe1cd734a176 - main - mfiutil: Change mfi_autolearn_(period|mode) to write to a FILE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: fe1cd734a17603f9b237c5bb08a9e29f2b4898ee Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fe1cd734a17603f9b237c5bb08a9e29f2b4898ee commit fe1cd734a17603f9b237c5bb08a9e29f2b4898ee Author: John Baldwin AuthorDate: 2025-07-07 16:36:47 +0000 Commit: John Baldwin CommitDate: 2025-07-07 16:36:47 +0000 mfiutil: Change mfi_autolearn_(period|mode) to write to a FILE This avoids using fragile logic with snprintf() to build strings. For the calling code in mfi_show.c, I chose to pass stdout directly instead of using fmemopen() to write to the temporary buffer since that is simpler and avoids having to deal with output truncation. Differential Revision: https://reviews.freebsd.org/D50881 --- usr.sbin/mfiutil/mfi_bbu.c | 40 +++++++++++----------------------------- usr.sbin/mfiutil/mfi_show.c | 10 ++++++---- usr.sbin/mfiutil/mfiutil.h | 4 ++-- 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/usr.sbin/mfiutil/mfi_bbu.c b/usr.sbin/mfiutil/mfi_bbu.c index e97227d47c70..aa685e438453 100644 --- a/usr.sbin/mfiutil/mfi_bbu.c +++ b/usr.sbin/mfiutil/mfi_bbu.c @@ -40,41 +40,23 @@ /* The autolearn period is given in seconds. */ void -mfi_autolearn_period(uint32_t period, char *buf, size_t sz) +mfi_autolearn_period(FILE *fp, uint32_t period) { unsigned int d, h; - char *tmp; d = period / (24 * 3600); h = (period % (24 * 3600)) / 3600; - tmp = buf; if (d != 0) { - int fmt_len; - fmt_len = snprintf(buf, sz, "%u day%s", d, d == 1 ? "" : "s"); - if (fmt_len < 0) { - *buf = 0; - return; - } - if ((size_t)fmt_len >= sz) { - return; - } - tmp += fmt_len; - sz -= tmp - buf; - if (h != 0) { - fmt_len = snprintf(tmp, sz, ", "); - if (fmt_len < 0 || (size_t)fmt_len >= sz) { - return; - } - tmp += fmt_len; - sz -= 2; - } + fprintf(fp, "%u day%s", d, d == 1 ? "" : "s"); + if (h != 0) + fprintf(fp, ", "); } if (h != 0) - snprintf(tmp, sz, "%u hour%s", h, h == 1 ? "" : "s"); + fprintf(fp, "%u hour%s", h, h == 1 ? "" : "s"); if (d == 0 && h == 0) - snprintf(tmp, sz, "less than 1 hour"); + fprintf(fp, "less than 1 hour"); } /* The time to the next relearn is given in seconds since 1/1/2000. */ @@ -96,21 +78,21 @@ mfi_next_learn_time(uint32_t next_learn_time, char *buf, size_t sz) } void -mfi_autolearn_mode(uint8_t mode, char *buf, size_t sz) +mfi_autolearn_mode(FILE *fp, uint8_t mode) { switch (mode) { case 0: - snprintf(buf, sz, "enabled"); + fprintf(fp, "enabled"); break; case 1: - snprintf(buf, sz, "disabled"); + fprintf(fp, "disabled"); break; case 2: - snprintf(buf, sz, "warn via event"); + fprintf(fp, "warn via event"); break; default: - snprintf(buf, sz, "mode 0x%02x", mode); + fprintf(fp, "mode 0x%02x", mode); break; } } diff --git a/usr.sbin/mfiutil/mfi_show.c b/usr.sbin/mfiutil/mfi_show.c index bf85c8b82d69..2d413f2a46b4 100644 --- a/usr.sbin/mfiutil/mfi_show.c +++ b/usr.sbin/mfiutil/mfi_show.c @@ -218,8 +218,9 @@ show_battery(int ac, char **av __unused) printf(" Current Voltage: %d mV\n", stat.voltage); printf(" Temperature: %d C\n", stat.temperature); if (show_props) { - mfi_autolearn_period(props.auto_learn_period, buf, sizeof(buf)); - printf(" Autolearn period: %s\n", buf); + printf(" Autolearn period: "); + mfi_autolearn_period(stdout, props.auto_learn_period); + printf("\n"); if (props.auto_learn_mode != 0) snprintf(buf, sizeof(buf), "never"); else @@ -229,8 +230,9 @@ show_battery(int ac, char **av __unused) printf(" Learn delay interval: %u hour%s\n", props.learn_delay_interval, props.learn_delay_interval != 1 ? "s" : ""); - mfi_autolearn_mode(props.auto_learn_mode, buf, sizeof(buf)); - printf(" Autolearn mode: %s\n", buf); + printf(" Autolearn mode: "); + mfi_autolearn_mode(stdout, props.auto_learn_mode); + printf("\n"); if (props.bbu_mode != 0) printf(" BBU Mode: %d\n", props.bbu_mode); } diff --git a/usr.sbin/mfiutil/mfiutil.h b/usr.sbin/mfiutil/mfiutil.h index 34b423098862..86b03998163c 100644 --- a/usr.sbin/mfiutil/mfiutil.h +++ b/usr.sbin/mfiutil/mfiutil.h @@ -175,9 +175,9 @@ int mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp); int mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp); -void mfi_autolearn_period(uint32_t, char *, size_t); +void mfi_autolearn_period(FILE *, uint32_t); void mfi_next_learn_time(uint32_t, char *, size_t); -void mfi_autolearn_mode(uint8_t, char *, size_t); +void mfi_autolearn_mode(FILE *, uint8_t); int get_mfi_unit(const char *dev); char *get_mfi_type(const char *dev); From nobody Mon Jul 7 17:23:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbWKL6RMMz60kqZ; Mon, 07 Jul 2025 17:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWKL4DwDz3dJv; Mon, 07 Jul 2025 17:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WUH7CrmpQGitXyfkhMpTF0xyjNwPmKZAFatBJobGNcA=; b=ZWXGenFPU35Ubcr7YAZ/hD2l9k/Bz+wYsstSo08zqY/Eij3um2kbzUG1ycn9p3qu6C4jJG Q2bfuTutpc7+9dN2cNyg/c3ZP0tFI7KzYTxpfMaKKI65WrrPWkPt7G1kyZjjNkWx0/eVRB YvlnDoLJofHHyl7YdnQVnA0kqsMWiLpzk0jWeEim2MO8ZbQWzRkydgUZDVRRljjESM2l/w i+c2bJm5WXyDrk1OUeC/pbwohz2indI2a/TUxboLuJ14bWnJBFPlSDFUIas2hhH77ok09e LyPmhafWnocGBJAmPJ6uihJJRcrLoxSX22SwwvCntqQVQuXuVYK8NptVJDY7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WUH7CrmpQGitXyfkhMpTF0xyjNwPmKZAFatBJobGNcA=; b=B1DCDqbwBnQOzoMbTTduGu31K+4Xok5lyfBhVaQ1YIPQG2qKnNAIYMXRVSWFGzwgibQeJH hZfD5oq74yCNE6Zguezp1YDkW2TxV/0vT7AP/rwmiDr1BrRLulBv83G/ukSCRt3Rz49RVm SqAW27/vF7DXysITMSTuDVwXvOBM+uA0sL9o6cjZ3S+ZF5TooQWbc+Lg0ghnJ1hoI0LPGu kdSHxTeb9g2QgEKvDy1rob/917RVUrL2LwBOG4bKfUS7mWtzBpjrGP/2UpnhcS916PZJNY rjPmBci7Pw8brGj5tA453wVkugp/RzOGPe+Hfa9GgK0O1Wf0heZ76q88ygFjOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751908982; a=rsa-sha256; cv=none; b=xgSoWvj42tRFSlYFuxk1ywTVAYeuguPv8nbThlOU/DOcGOtHs+hOBGwJD0NjDHB+63I4ie hO7XtB8y5T6AbylQu9VgpVQPjI7VGevjB7RN1ezWClHkI9h8yqnShe1VCN9a6EvJOX2FLs Se9eRBoKOKukbkpneg9vNAdos7IIN8qXV2ni3QokaTb6ImMSfV6FBZX1gRtCZt+tcNpEPz R8qQjANgoaOFCjiKckURnNtbUvZ539wZYj5vJcBvwcMxRXGeJqYZFwUIIDrxLQ5UgJOk/3 FtRLxeNLkn9V0MMwlFVAGkGT6lK8jwbp+4pXH3EFbBGeFPj6H13MRUrFruTIGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbWKL3hNKz10XC; Mon, 07 Jul 2025 17:23: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 567HN2V9080665; Mon, 7 Jul 2025 17:23:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HN2Qr080662; Mon, 7 Jul 2025 17:23:02 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:23:02 GMT Message-Id: <202507071723.567HN2Qr080662@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: 6b7b8575e979 - main - mfiutil: Use sbuf(3) to construct drive names in mfi_drive_name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6b7b8575e97980166416886935e8cf376e50d88d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6b7b8575e97980166416886935e8cf376e50d88d commit 6b7b8575e97980166416886935e8cf376e50d88d Author: John Baldwin AuthorDate: 2025-07-07 16:37:28 +0000 Commit: John Baldwin CommitDate: 2025-07-07 16:37:28 +0000 mfiutil: Use sbuf(3) to construct drive names in mfi_drive_name This replaces fragile uses of snprintf(). Note that I did not keep the truncation check for the space separator in the middle of the drive name since the same check was not applied to the second part, so the name was truncated anyway. Just truncate the entire result if it doesn't fit. Differential Revision: https://reviews.freebsd.org/D50883 --- usr.sbin/mfiutil/Makefile | 2 +- usr.sbin/mfiutil/mfi_drive.c | 34 ++++++++++++---------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/usr.sbin/mfiutil/Makefile b/usr.sbin/mfiutil/Makefile index da1c9249f8cd..85b66d4b6f49 100644 --- a/usr.sbin/mfiutil/Makefile +++ b/usr.sbin/mfiutil/Makefile @@ -9,7 +9,7 @@ MLINKS= mfiutil.8 mrsasutil.8 CFLAGS.gcc+= -fno-builtin-strftime -LIBADD= util +LIBADD= sbuf util # Here be dragons .ifdef DEBUG diff --git a/usr.sbin/mfiutil/mfi_drive.c b/usr.sbin/mfiutil/mfi_drive.c index e8e945c566c4..c7c5aeb02f14 100644 --- a/usr.sbin/mfiutil/mfi_drive.c +++ b/usr.sbin/mfiutil/mfi_drive.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -56,9 +57,9 @@ const char * mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) { struct mfi_pd_info info; + struct sbuf sb; static char buf[16]; - char *p; - int error, fd, len; + int fd; if ((def & MFI_DNAME_HONOR_OPTS) != 0 && (mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) != 0) @@ -89,40 +90,29 @@ mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) pinfo = &info; } - p = buf; - len = sizeof(buf); + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); if (def & MFI_DNAME_DEVICE_ID) { if (device_id == 0xffff) - error = snprintf(p, len, "MISSING"); + sbuf_printf(&sb, "MISSING"); else - error = snprintf(p, len, "%2u", device_id); - if (error >= 0) { - p += error; - len -= error; - } + sbuf_printf(&sb, "%2u", device_id); } if ((def & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) == - (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID) && len >= 2) { - *p++ = ' '; - len--; - *p = '\0'; - len--; + (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) { + sbuf_cat(&sb, " "); } if (def & MFI_DNAME_ES) { if (pinfo->encl_device_id == 0xffff) - error = snprintf(p, len, "S%u", + sbuf_printf(&sb, "S%u", pinfo->slot_number); else if (pinfo->encl_device_id == pinfo->ref.v.device_id) - error = snprintf(p, len, "E%u", + sbuf_printf(&sb, "E%u", pinfo->encl_index); else - error = snprintf(p, len, "E%u:S%u", + sbuf_printf(&sb, "E%u:S%u", pinfo->encl_index, pinfo->slot_number); - if (error >= 0) { - p += error; - len -= error; - } } + sbuf_finish(&sb); return (buf); } From nobody Mon Jul 7 17:23:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbWKL2jPXz60kVM; Mon, 07 Jul 2025 17:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWKK59Jqz3dQk; Mon, 07 Jul 2025 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pRVeQkYsmiWTkLQ/D+RukGryFJ6jk2U2HlFI1GXVFKo=; b=YzO7IfJbleH3vnrMytYpEIO0ThidC76KiivA8Z8tA8BwrqeZdp8WdyrGLtvc7uJ7x/JWw9 SBWVSyDC3193uUaNhh+MOgMCJALD5v/9KzGgI7r73pzTvn4Ibl8DuPVfLkR6HsSSkXJfws BDwV/46glNMpX/OQw8o5OdgeFEIsddSs/T7zKsaw/jX0p5e6XVCLAXEi9dcx1BxbivWAUE jSR1Ei8mH8ytzKGzxdqn+CRy+/qro1jGm+Q3Dx50vPUwFFXcXCAsmiNGuVK1RMWl7R09V5 TGiDSl5BxVTWxna/QfCWVtFqLZbtI6cNOoCnevyhSAZ2kOsjdF2KJg2IjLW5YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pRVeQkYsmiWTkLQ/D+RukGryFJ6jk2U2HlFI1GXVFKo=; b=WW9We64EYFglr3P0vl2NkKbDsT/xfDJwkhkUwoucjkVgajH3LJvddy7kAZ00T8dBWLa+Hn 2/dZ9qo1AqOlr3tEHdyBhvOVYXz3Ntlu85zwg45GMZJuvkUNNsAbk04Kk2SSHykT8indi9 MmPJu0SHsoGRcfzfkRJJzBEDlyqH0cBqhGtU9UoSQbVtjvq/+Bq1D/vhQPNjNlrDfGq9dT N2QGpJJU2syXN12TolbnaRrkthUQSFuSKUn56VbwCvA56VUbMm+aNBbe+8eYhXq0dGEjw5 fh/wR2q/E3RvD3d855Fxwu3SHBvo/0ZEWAFlXiFEsKHruVO1Ul2WZ1BZSBMQWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751908981; a=rsa-sha256; cv=none; b=cjsWfh59TGdrKk2aIoP620lrLqT5fI6Hh1RiLIyamMSmyzsf3Uy9SXTmXtTQeSjE3vZ3S9 AyAwe3JW6LJmaiCdsY3E9uRmtw35KjZ7Erd/+eJlqxh6EmxHQ1XtQotoO3JC3jXXDDuAft XmgffipI5aMrnxcFir+OPP3A9uLjIVEW3uxJBRzdBZQCMFAdJKHgCkBa2N+zZAefRzzxre fi7t4t6PHmu7Fn2G+E+LThivOLdfEEG81p9weAh8rG2qNtyUwoAAcNDG2bG4fPidQyf/1G PlesIM9eOigh3uEOXacrlzWny9dE3w/AjwgJsKj9LEadIzJrS0A9rjGBO4zlcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbWKK30bcz10b0; Mon, 07 Jul 2025 17:23: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 567HN1QO080631; Mon, 7 Jul 2025 17:23:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HN1uk080628; Mon, 7 Jul 2025 17:23:01 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:23:01 GMT Message-Id: <202507071723.567HN1uk080628@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: 10ed5b90e46f - main - mfiutil: Handle truncation in mfi_next_learn_time List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 10ed5b90e46f5df329f511c08bd55458f95f1b6c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=10ed5b90e46f5df329f511c08bd55458f95f1b6c commit 10ed5b90e46f5df329f511c08bd55458f95f1b6c Author: John Baldwin AuthorDate: 2025-07-07 16:37:09 +0000 Commit: John Baldwin CommitDate: 2025-07-07 16:37:09 +0000 mfiutil: Handle truncation in mfi_next_learn_time Only trim the trailing newline if the output from ctime() was not truncated. To simplify the code, use strlcpy() instead of snprintf() since strlcpy() can't fail with a negative size (and the previous code probably didn't handle those errors properly given the int -> size_t conversion). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50882 --- usr.sbin/mfiutil/mfi_bbu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mfiutil/mfi_bbu.c b/usr.sbin/mfiutil/mfi_bbu.c index aa685e438453..3e78e791dfc2 100644 --- a/usr.sbin/mfiutil/mfi_bbu.c +++ b/usr.sbin/mfiutil/mfi_bbu.c @@ -71,8 +71,8 @@ mfi_next_learn_time(uint32_t next_learn_time, char *buf, size_t sz) tm.tm_year = 100; basetime = timegm(&tm); basetime += (time_t)next_learn_time; - len = snprintf(buf, sz, "%s", ctime(&basetime)); - if (len > 0) + len = strlcpy(buf, ctime(&basetime), sz); + if (len < sz) /* Get rid of the newline added by ctime(3). */ buf[len - 1] = '\0'; } From nobody Mon Jul 7 17:26:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbWPV5FHKz60lBd; Mon, 07 Jul 2025 17:26:38 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 4bbWPV34VTz3gDq; Mon, 07 Jul 2025 17:26:38 +0000 (UTC) (envelope-from rionda@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7d7f2600c17so217451885a.0; Mon, 07 Jul 2025 10:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751909197; x=1752513997; darn=freebsd.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=Pb4yEwnT4g5FCnSOXIP8RjpIViJLGGLdBKeIpY9MVo8=; b=Ubqf4S46MK39SMecRhFI46Ghx9MiZPdfKvKd9MpfSVAcfCKFoonG9dUD2sdFhXp9nW 8ZfYQ17Zn07Ly7DTkqbVstolHDLDJXXe3fKgAFSZpJWv5Hg6zEstaodBk4Ojk0917syo eUJOhYluQhAYCCkMrlrvqPgjcKxAqhj1Q5wklpcBlU2kc2+PztPGS5eyxTCWYV8BpoBD xqN9ICkcVNkaKqLhckEmFZ6QutlRdKfs8yUqQdOPkj/HZdRvT0JjzH9M/qTHc/IHb4/r fm9rBf28ZfOMcmJ/Pj5Te0RNua0FnSp/q7+RxQFB+34omVHLdazFIjr3FUQ7Dy9UCJPg QcvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751909197; x=1752513997; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Pb4yEwnT4g5FCnSOXIP8RjpIViJLGGLdBKeIpY9MVo8=; b=Y1xMVNImZQ1mjv6/hmQ1llReMgeFVaoRwu8Mp08AgpsLDNLADTPDe+lsBNTf74DMjt qd+T6m3Y7LkMDNWUhOnACD1XuBjgi4uOW2m6qBhZH4AXfDBp21FWQGVGDPqe2Em2j7qP AKEhK+k8nHSlL+t6+FaM/7LBxNH5TkmwQ1rwlIcy/69iG26hbxSa1GHWdNb5sTOgueGp woFKk8OpuKOCYNz+vwUTE5edXDcb3H2/UwcCV2xAn7gEbAL6wZJ3H5W4WF/iZAwUdrid HAWive+BaCT5H3kNKr1zPIOOlHcXXCOqRxKFXWxEGUxcYBhvIhXYelr0cBqIQYBnoIOD ZAvw== X-Forwarded-Encrypted: i=1; AJvYcCUZ4NU2I9UfzOc/c4pTHV/JLuaMFVXNZfzrBCnRdN/EYk46ct85zpC/oANsvGyAgs8I5JTiMCIcFUnRsU92nUTVRaxjqLE=@freebsd.org, AJvYcCVrKl3PIZrauVP9nlNW+pzoXmb+CaN3kG+C1yizzY9aceQv/PlmIqSSI+O++sQIbt3KFiaERB6KIY3D8F5Cs69U76Uv@freebsd.org X-Gm-Message-State: AOJu0YwjO4VX8mQGKen6Je0AHPSwIvaE9KpKyNrXBYADhAFsdMplBj/D h4r3kFSZ4AS0PRWHn544o4xDb3/DdrkOn4k3kvom4VdANg3Sbfl70H/oEHHT7Q== X-Gm-Gg: ASbGncspBgmEPLcIaZ2y1QNr8eRQ71zTF3knVbS452uKgWYttvyhkS7Tq/PN2RenVcN t3c3nC6GXymcmEa7ZPn2npyksmWvWsJxbJxo81L8Iz5dkd0Zg8ctHI6rq0E/e44TEgpCT1nITZM 0IZssted/eysbzhkM/XL+PUuczSv6+QsBCORAhqsFKh1bDOlSmr6OklDpSlW6A/+Uas+r1FP35Y 5e7uSf0JCK2zHsXW3MntkRuC1wzpuBIVlLwoQZkdv5WFzlm9Dveu+oprTtjZZggONO9dHQn7IwE 5rAkbvtMf7KcrIQCwryIZfHVCKkhfy3ku863iJaC7YL5RaxbETCz5OAE8IQV6F+CLPmGHcg+9bs oUpacAjQ9PNWEhw1tfl+ysg== X-Google-Smtp-Source: AGHT+IEjde+iIoRzeS61V2219AArRqdEj+uQPpRAiIiyNAabuiiC2PD+J/WVNZy38QpVvgnYw2+lvw== X-Received: by 2002:a05:620a:444c:b0:7d4:219:50d4 with SMTP id af79cd13be357-7d9ebaa4c91mr28818185a.34.1751909196517; Mon, 07 Jul 2025 10:26:36 -0700 (PDT) Received: from smtpclient.apple ([2607:fb91:daf:87b6:c1f9:c0be:2d0d:a56f]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d5dbe8f87fsm630718385a.80.2025.07.07.10.26.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jul 2025 10:26:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.11\)) Subject: Re: git: f8a8bb7bade9 - main - pfctl: Improve duplicate table name warning From: Matteo Riondato In-Reply-To: <202507071507.567F7n8Q016403@gitrepo.freebsd.org> Date: Mon, 7 Jul 2025 13:26:22 -0400 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <81D328A4-8A6C-44DA-861B-D3C067986CBE@FreeBSD.org> References: <202507071507.567F7n8Q016403@gitrepo.freebsd.org> To: Kristof Provost X-Mailer: Apple Mail (2.3731.700.6.1.11) X-Rspamd-Queue-Id: 4bbWPV34VTz3gDq 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] > On Jul 7, 2025, at 11:07 AM, Kristof Provost wrote: >=20 > The branch main has been updated by kp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df8a8bb7bade9575c549cbc94500ba706= b712c650 >=20 > commit f8a8bb7bade9575c549cbc94500ba706b712c650 > Author: Kristof Provost > AuthorDate: 2025-07-01 10:02:03 +0000 > Commit: Kristof Provost > CommitDate: 2025-07-07 15:06:48 +0000 >=20 > pfctl: Improve duplicate table name warning >=20 > When creating tables inside anchors, pfctl warned about namespace > collisions with global tables, but only in certain cases and with > limited information sometimes leaving users clueless. >=20 > Deferring the check to process_tabledefs() where tables are = eventually > created, both anchor and table name are known which allows for = checking > all existing anchors. >=20 > With this, warn on all duplicates even in dry-runs (`-n') and print > quoted names so they can be copied to fix configurations right = away. >=20 > No functional change in parsing or ruleset production. Based only on the commit message, this may fix PR #262295. Thanks, Matteo From nobody Mon Jul 7 17:52:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbWzr50Wcz60pP9; Mon, 07 Jul 2025 17:52: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWzr3Ynrz3sl8; Mon, 07 Jul 2025 17:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IeCCFOoszEe7FhExO8Jemv6Qo0dw5BpHdfa5HidIu8=; b=cbn5f6YO198gkRHnBnjslNDdyZ0VvmIukx/T+2C3DmW+uO9d/gLwBl8PXAku57jkIa29ha 92jVJfukO3bOFzw7JzQKmhLcUEGBndqdPsEPd87b5e62nXaQ0qRqSOOuSGRiGfsnTJDVi4 Zf96Fg+dFr3CnovHDYssXOLRjMjteMQghwMfL036HK+sxWt1rEgHEGri4r9DJnh/hVuvTz PqkOjIBSGAjzypwW6Lfqt1+HgOEINzqmUna2AtBAWjRT9hw7DZtE4F+5yHJI79tPrsOY/e bdTiGfLB0w90ixRpZiY+1vj1MFDZpc2DH3afyYm7fFU3Fwmlbsj4kkkCqg68mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IeCCFOoszEe7FhExO8Jemv6Qo0dw5BpHdfa5HidIu8=; b=cOlW2nIIbT9v5zQGUCPfZVjb/Sz29O30h/RBAqwfCg0jrlhGvzR2uJdMX91hl9bse74tJc JjkMiZvKAzLpubEb+PC7LMoeTGXg8x33bzyDc2cSC+vWU5MyBrGEBHJM3f5qyBw5M1OYZD /lswucHIyOC1m8wl3DJL24rDVjbAOCb2e4jSCkIU0wkmJoY4MdIGLU9MxDQBX8gbjk3uzk 0wVOsUmOJBe5z78G2t/D5pf3WOPXdXzVCkJMFlN+YWqrn/C30aWcwocoq3BqPntvjoiFBy oUztn1TTULUcS+P270RrjuvG5JsAyeVNbLMlVELZjIGFMOlWn3w4qy2Gep8uEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751910776; a=rsa-sha256; cv=none; b=NlgZ/M9h6X0uGsaECOMFYm0rwYEjrrHpzlwGBRz6Tlmkvcm7bet8JW/jyXORc29ooudaSe U16GCqQOMT1UruqhHfZkwUqGMDMRQJYOEOb/UFXoe67Oxp9kGfYq1uMuvutrcyGshRnBUP tTsAD4c4fx9UA8wnZ+nxX5k3mhR8luVDn6hwrAsdMDqNFRBZf69WYPuhdQtjUmo+Wp2sjF +nHqa5QSaFrDZegIg4OJhnfuitms6h2i3qAk9lpDR0pdbpa3KibPKy5fwkNwwmOcL6zQwg KYOe8ywmgfHy7Ed08vc4lCbU8040BdJDA9jNm6V/JDz1vGtNw1AFFsGz0kogww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbWzr35YFz11ks; Mon, 07 Jul 2025 17:52: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 567HqufS036996; Mon, 7 Jul 2025 17:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HquuM036993; Mon, 7 Jul 2025 17:52:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:52:56 GMT Message-Id: <202507071752.567HquuM036993@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: 0c38e3dbbf6e - main - aio: if there is at least one aio thread, hide an error from aio_init_aioinfo() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 0c38e3dbbf6eaa2755d34189149c9140cacd4bb1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0c38e3dbbf6eaa2755d34189149c9140cacd4bb1 commit 0c38e3dbbf6eaa2755d34189149c9140cacd4bb1 Author: Konstantin Belousov AuthorDate: 2025-07-07 14:35:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 17:52:20 +0000 aio: if there is at least one aio thread, hide an error from aio_init_aioinfo() Noted and reviewed by: jhb Fixes: 4685fa8e4bef169e6a1ceaf07f149232326de805 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51191 --- sys/kern/vfs_aio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 66ea50eee77b..02973146068d 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -455,8 +455,15 @@ aio_init_aioinfo(struct proc *p) error = 0; while (num_aio_procs < MIN(target_aio_procs, max_aio_procs)) { error = aio_newproc(NULL); - if (error != 0) + if (error != 0) { + /* + * At least one worker is enough to have AIO + * functional. Clear error in that case. + */ + if (num_aio_procs > 0) + error = 0; break; + } } return (error); } From nobody Mon Jul 7 17:55:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbX375JY3z60pc0; Mon, 07 Jul 2025 17:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbX374lrKz3tjB; Mon, 07 Jul 2025 17:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dW9oXXh+Y25A/PTf67DjPMnx6r5FgfkkCwbMvqbrURA=; b=bo1BpnSlQzS/kyXgYKndtPHkSPLM63abzUCRV2yWkqebh6sQ7q+Um0g22rN8O1ei8TCo6R 7LEnvSaWRGjgjfYPdAXbfzIxto2VoRX+UneOTraiDmvGY6S6y/qpNglSZH0VCri1O0BoHW ClcvwQbDlfNIG5XcIQezRLFxAGWE0/NDDfeiEyAwHIspdJ3+9ze+nILsSHPoVle6kh9f5K Mbl7/MW1hAVLk9XlZT9kMaB4r/JJtexuK67lctoUlNampboH+TyOt8JXSXDeD1p+YcLQze vYMbZDPBspztNdBHWOg73oERR2e8Mi/0r/j77xRiuTELmckQJ8STcVCpg/xpDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dW9oXXh+Y25A/PTf67DjPMnx6r5FgfkkCwbMvqbrURA=; b=xDtxDNWaPmuGCnFS5jUTh+ZB6e9B1iOP8Zpvy0e1FiwRvxHdn90wHTK4I7eH+b9Xo9F0MW c1ROh/ggP8+3WVTV/vo+1thjUHPw7tO0KhSq3vGLGCNGWSQ+S2wLTLkFweESUJWhdb+IJd mhLs9OJWDO9sHABcIm/xeTbJhm1nFCPFq/IBnzUrH7BStDAjkhBiGVGrfPiO2yDzGdZCCJ F3hEEdydxjDmk6eHM786AK6iYu8jzbac8faeWm3bIjx7HtkDXB9mMDit3I0xBTtDrA7Jvu 0K/UbC0PbmXSTWqJ2Wec2wCH3GqN2YwjADnuVZFlttT7tp6Y4dbsKM1i9ftm2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751910947; a=rsa-sha256; cv=none; b=cTP3PRSpGPKahNtrfrBiPS53Y/uObnEUKuIY+DAjzNdPUbHWMjtQTKm7yd1hCLGMiOMvop h2q0lApFGdy90OeplQN3jhuxSlLnIFQe22La8EbLEBGOnVUE1Rpvzu69kAjbwV0y5C+1aw dyBEPS7XBoU1mtgTdkqAK/eOIIvVhJQBJhhjgiA7QysLU1P6qarRveV1wN2+wgL30y2+yv +RgWlBKBR14h6KyISEavS/3wisqk+l7DcMr8eoVgmSOx1CzB9wb0Xsxe/9czBNwu5Y8TJQ Ik6jP8tfZlDTpdeL+58jqclUPp/dZ5sKn8Rj1GT4Gu/gNLhowyuAzLZsgY2JUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbX3743QDz11QW; Mon, 07 Jul 2025 17:55: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 567HtlKu038030; Mon, 7 Jul 2025 17:55:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HtltK038027; Mon, 7 Jul 2025 17:55:47 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:55:47 GMT Message-Id: <202507071755.567HtltK038027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Antoine Brodin Subject: git: a38eb8d4282d - main - ObsoleteFiles.inc: fix a typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: antoine X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a38eb8d4282d2126896da35f0742fd5e84ffac49 Auto-Submitted: auto-generated The branch main has been updated by antoine: URL: https://cgit.FreeBSD.org/src/commit/?id=a38eb8d4282d2126896da35f0742fd5e84ffac49 commit a38eb8d4282d2126896da35f0742fd5e84ffac49 Author: Antoine Brodin AuthorDate: 2025-07-07 17:54:17 +0000 Commit: Antoine Brodin CommitDate: 2025-07-07 17:55:07 +0000 ObsoleteFiles.inc: fix a typo --- ObsoleteFiles.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index dcda9a035b44..61f948a2c970 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2481,7 +2481,7 @@ OLD_FILES+=usr/share/man/man4/ng_uni.4.gz OLD_FILES+=usr/share/man/man4/ngatmbase.4.gz # 20230308: machine-id merged into hostid_save -OLD_FILES+=etc/rc.d/machine-id +OLD_FILES+=etc/rc.d/machine_id # 20230306: remove tzsetwall(3) OLD_FILES+=usr/share/man/man3/tzsetwall.3.gz From nobody Mon Jul 7 19:28:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbZ6Q1LY9z611gl; Mon, 07 Jul 2025 19:28: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbZ6Q0Gd0z3pt2; Mon, 07 Jul 2025 19:28:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0u5QIhM56uSZPcOYEf+QsbdsDIWvjDZszOMxydVT72Q=; b=wsI7ixkoE+3R5WsB2cnl4J03oy8PpVjHfUNI/TsVOvZyKC6LfblAIl3lJbSSIOy+Ae55u7 xgRgwkWK4mIqPX5X5oVM0FMaAP/MbgMOO7l4l/GScU7Rvm1SflHzdrHiBMGrXMoc2BBiuQ 3A1rXV6mTz2oT6LjsSJecJ/Nh4+nOusvGzv1SgfjoWwfxJQ6PNoGXdaBNvTyr2VzqX8cVE FwCKMCbrfhnsrf2cbIjZw5UdlKplgKoKf/7xg3DFoxDM2S1Ihe1+sXU1+6xw9uaVBKJbvO zcEqXYRlMeNNN6lQ/Uhxb9xeOmc//CSIQn66y8twmKS5r1k1AwjDj7Gzp1RKuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0u5QIhM56uSZPcOYEf+QsbdsDIWvjDZszOMxydVT72Q=; b=hpS6MlorDg2GPvnNsw419XO1lAPBifjIIz8+TX3G2Wl5F8NSeYutX1Aq0CFvxcYsUTu3pv EQY2h1h+wl+GsK6+NyKN7kzgfUlbos8t1+Iw0Kx//hBUVfqSZ11oEoFnmM5flyrMESb7oH T/DF5kJVs665KZQ/w9nf8MwetBHvANlS+wVSKYSL5PCTZMkqZfdiEWrmcIk8JgoQJ986sh uB7ykDRQo/EUnYfTW0x/eRhq5L67mvpBxb5jJU4AlbFI3B1ZYVcZ+TcGJ24f232cmPBvka ctwTg731WsW00OufxyIYwy8jHXCAgT1dI+KTRSIBRxN6UIryeOyg3sD/dyeLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916526; a=rsa-sha256; cv=none; b=H8rkyEB2sXfJPyIR37gU92dBVgJhF4EEZyvuhPFu12gUI7Y2E7/WXg5N80yHxhnRxMTMyL j+Dt+KESjQGf08cf4RFggO0O/VFOKa8h1y9/G8j+g2jiX+eCS2yMgE8x9VnJiSQTsEqpK8 pgUIwLgqbv+XQMNLh9PVB550dInlzTshjJlRIVP0lM6ZqhtMQM041l00kN8T9pWZRqpqGA Bo6iackaScfCMT7qLYgsx/ORPhL6B6yIRZ+UvnT0ZI0osYyRJiW1kP35AXqbQgi2phc7du Pi7m3mL0Jd+Z6DYJsH8PN3DT0tH4IWUvVAz/AJvQlzeGtc/+grX3o7vKQVsDXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbZ6P6vBDz141V; Mon, 07 Jul 2025 19:28: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 567JSjA8012601; Mon, 7 Jul 2025 19:28:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JSj0r012598; Mon, 7 Jul 2025 19:28:45 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:28:45 GMT Message-Id: <202507071928.567JSj0r012598@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: 283c1bd8ceb0 - main - uexterr_format(): simplify output when ext error string is available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 283c1bd8ceb07cbbc5fa3f3034b2e2d9ee53d981 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=283c1bd8ceb07cbbc5fa3f3034b2e2d9ee53d981 commit 283c1bd8ceb07cbbc5fa3f3034b2e2d9ee53d981 Author: Konstantin Belousov AuthorDate: 2025-07-03 03:04:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 18:44:14 +0000 uexterr_format(): simplify output when ext error string is available If the extended error string is provided by kernel, return only the string, which is supposedly enough to identify exact cause of the error. If the string is not provided, print the technically looking gibberish which still allows to identify location with kernel sources. Reviewed by: asomers, brooks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51141 --- lib/libc/gen/uexterr_format.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c index 32b57ffb6e1a..86ba40234ae4 100644 --- a/lib/libc/gen/uexterr_format.c +++ b/lib/libc/gen/uexterr_format.c @@ -23,9 +23,13 @@ __uexterr_format(const struct uexterror *ue, char *buf, size_t bufsz) strlcpy(buf, "No error", bufsz); return (0); } - snprintf(buf, bufsz, - "errno %d category %u (src line %u) p1 %#jx p2 %#jx %s", - ue->error, ue->cat, ue->src_line, - (uintmax_t)ue->p1, (uintmax_t)ue->p2, ue->msg); + if (ue->msg[0] == '\0') { + snprintf(buf, bufsz, + "errno %d category %u (src line %u) p1 %#jx p2 %#jx", + ue->error, ue->cat, ue->src_line, + (uintmax_t)ue->p1, (uintmax_t)ue->p2); + } else { + strlcpy(buf, ue->msg, bufsz); + } return (0); } From nobody Mon Jul 7 19:28:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbZ6R3RGHz611gm; Mon, 07 Jul 2025 19:28: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbZ6R15RZz3ph5; Mon, 07 Jul 2025 19:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U95Z+LJjRtY78ixdlhb0ZMhT81M/0hFUrHQPVJ0RlsM=; b=bZUuZpxF0h88c2qDe91iVk+kPYbvL6+zeT+pehKFxVPOu7hSK8AL+3GIq/VO7xi5o+hfxP qB/7/eeFuD2mObqd3kE0Do4gpIC4pYa3oNlXxF6SAj3MgR+bozcBLViLlDApSaRukfvHIV i6qNK1ApIgXN+sn4MPCZfGi5e3kArtRhjxPgBD6speF6wb1WSLWA8r6kABQ9UEalquZyZM 0POTj2yXXao03rfayaz5xbUOmUNw9cX1Wi0RjmKLhOEcCA/DnD1Ww6zlqNy9Z9L0h1kE/E 48xk3yWT+MjFrjuTI+velpoPYhzYGUxwfQkuk0R3DYT2vyo6WW1WXHnHgvOiuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U95Z+LJjRtY78ixdlhb0ZMhT81M/0hFUrHQPVJ0RlsM=; b=mbeJB2hu/4eHXZAOH4FUKpfn7OMC6oB038xoN7WgCxYI1P80Hg4cQbIBVlrfVo217xpsDQ 23cTmBiDg3p34KTXgJLWU3vl2VEYyu9DzEm48WB0rkS3ekk0JZz6ZOX9WFp60gWskn90qp eZIMqHOnWbfqCLHK8NOgtwh57mttPaZ0KJ62Dn/o92WuXkjdc2ZQ1y84JtFRqmKmMJEatv 8GWFuxlxZ8FMNnkKwasjFhGz9LKXyxzij13N4Z28/ni6RX7v1tbQayHCLNtIWewGIzPLca 0sM5iHv8gH6w7M41YLqCj5PZvmsf8WDhbQO793W1yZLHAackJq98tIgqXRErSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916527; a=rsa-sha256; cv=none; b=edtyWdaMh55zrpimhJR8U7+3q2X1V/tkcwaURYkvuS1blFaZBFYjrQ4RWwiBK4O8w35ana G5x96WmllaU8u60dvmUB7ZLTHqOmVuM3/asWQ/MFXHHKDwRkRntJ/bd/EhYj8CnitLjiey QM7AAA2jESonYFpH4/8qrwlL/KPz4CjASI9DNpQxunaeSqpfYOJCEoPFMzOpeC+Pqs+/st lt7NoMX8QWCjPhl9/V2+1ZlFAOK2ofkDgATHYplVofWFfQ55kt0/mlIjjMpSiBHGMfMNeS oLCyLxKy5n74mN3aFSFjY3nmdgaOpt10+1GBDbDQGek4GASA5wJFUH5ItKd3aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbZ6R0dtjz140T; Mon, 07 Jul 2025 19:28: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 567JSkDQ012642; Mon, 7 Jul 2025 19:28:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JSk8Y012639; Mon, 7 Jul 2025 19:28:46 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:28:46 GMT Message-Id: <202507071928.567JSk8Y012639@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: 01a679715f68 - main - err(3): print extended error if available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 01a679715f68d5e32efecafc1f158eecec3f781b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b commit 01a679715f68d5e32efecafc1f158eecec3f781b Author: Konstantin Belousov AuthorDate: 2025-06-16 21:26:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 18:44:22 +0000 err(3): print extended error if available Reviewed by: asomers, brooks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51141 --- lib/libc/gen/err.c | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index 24ea242560b8..cdce20af5a91 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -30,9 +30,12 @@ */ #include "namespace.h" +#include #include #include +#include #include +#include #include #include #include @@ -43,6 +46,11 @@ static FILE *err_file; /* file to use for error output */ static void (*err_exit)(int); +static void verrci(bool doexterr, int eval, int code, const char *fmt, + va_list ap) __printf0like(4, 0) __dead2; +static void vwarnci(bool doexterr, int code, const char *fmt, va_list ap) + __printf0like(3, 0); + /* * This is declared to take a `void *' so that the caller is not required * to include first. However, it is really a `FILE *', and the @@ -70,14 +78,14 @@ _err(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - verrc(eval, errno, fmt, ap); + verrci(true, eval, errno, fmt, ap); va_end(ap); } void verr(int eval, const char *fmt, va_list ap) { - verrc(eval, errno, fmt, ap); + verrci(true, eval, errno, fmt, ap); } void @@ -85,13 +93,24 @@ errc(int eval, int code, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - verrc(eval, code, fmt, ap); + verrci(false, eval, code, fmt, ap); va_end(ap); } void verrc(int eval, int code, const char *fmt, va_list ap) { + verrci(false, eval, code, fmt, ap); +} + +static void +vexterr(bool doexterr, int code, const char *fmt, va_list ap) +{ + char exterr[UEXTERROR_MAXLEN]; /* libc knows the buffer size */ + int extstatus; + + if (doexterr) + extstatus = uexterr_gettext(exterr, sizeof(exterr)); if (err_file == NULL) err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); @@ -99,7 +118,16 @@ verrc(int eval, int code, const char *fmt, va_list ap) vfprintf(err_file, fmt, ap); fprintf(err_file, ": "); } - fprintf(err_file, "%s\n", strerror(code)); + fprintf(err_file, "%s", strerror(code)); + if (doexterr && extstatus == 0) + fprintf(err_file, " (extended error %s)", exterr); + fprintf(err_file, "\n"); +} + +static void +verrci(bool doexterr, int eval, int code, const char *fmt, va_list ap) +{ + vexterr(doexterr, code, fmt, ap); if (err_exit) err_exit(eval); exit(eval); @@ -156,18 +184,17 @@ warnc(int code, const char *fmt, ...) void vwarnc(int code, const char *fmt, va_list ap) +{ + vwarnci(false, code, fmt, ap); +} + +static void +vwarnci(bool doexterr, int code, const char *fmt, va_list ap) { int saved_errno; saved_errno = errno; - if (err_file == NULL) - err_set_file(NULL); - fprintf(err_file, "%s: ", _getprogname()); - if (fmt != NULL) { - vfprintf(err_file, fmt, ap); - fprintf(err_file, ": "); - } - fprintf(err_file, "%s\n", strerror(code)); + vexterr(doexterr, code, fmt, ap); errno = saved_errno; } From nobody Mon Jul 7 19:36:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbZHW5pdKz612tj; Mon, 07 Jul 2025 19:36:39 +0000 (UTC) (envelope-from fluffy@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbZHW10Ytz3tT4; Mon, 07 Jul 2025 19:36:39 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916999; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Rlg966qaydoyKHp/jG+F6aKfgykVvEQeWQChe686PAc=; b=SGhGo7q65WzGzsDpzzpdpHpL/i3CNLB3GPeHby85VBDfqAscsTn95bHs+PebbF7/oaw9GA 0S0NOJXSgzfxMaZV3RxJxsqkvxx3C7hs0fopfZtO3e6Td2n/gddWv1cD/Jdyym+PPuFEGv yBGMI+RoQFEbShZ9yxKLAq6URwPaFMlIpj7iWQOozT2jUvuOCZDxsfcxRVwD7z2oyrIRG7 ES1KKiJ/WkIrMtRtgESI84pj5O9dId0w4gUjdA3vBtUQV7wHQC56BenBGmCBJKV55IjBQC tHmJSVlDyah5/WXopRyI4Ilv9Y31GP7C9uSven1mcdxi2ygNyKRQ7HGdpeN94Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916999; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Rlg966qaydoyKHp/jG+F6aKfgykVvEQeWQChe686PAc=; b=p7WvheAzPumL0//fGngHkbQiAxfbdP/bRaSU5+5rL2hjQRXUWLyyC4Qdar+yrlkx9404O5 ncys8FMe/G0QpAm6VXkW/ftculGhCRbiVTgHFJH68LU2TJ6ZeCZ7Vge9Bet/vx4xPXKRHR 07NA19K+UnxKmmg/MMZzugwNN9N0yz3fnH+bzI244foRzmO0Tv7Ak2n+UBKeq8gHB97sAx u0R/jcQTpXztNyOsDY8K2ftcftAg+P+cbN7x/m3Qyzc+NFv4GV5oMVmxfgFpMlHhZ7zf1F DWYj+bpnq9VJNyrMeTc69zYrpjzsp03Ux3KofA34qYocOSHfJt7zxfpclu7h9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916999; a=rsa-sha256; cv=none; b=WWJEzqwmbJbj3FyzYtNAEbSuwbwyBKJBxMn7JrztATFkviNWQ4XbtTK1nuKtbxCD4qBQtH QMZue1a6d17WHTgz0riZIQLWrgcyj0uEM3Vk7OCKSWIRdV+LerMVGsfdDK+JRKKQYkLLlz wPc5lV7Nn5yBVF4Vu3X4aW2nSd8CbGFTFTVGRsg7pULwh20vNcOS2HJPyZIee/+kc0xakL y2PrhrvlKwFIOZtc3hOa9E+jVJxulpIqV29idHVSzhFkSAx5lwmVJHPIaCmcm6LiX3Fm09 GGUYfZEJPKr36F6uOImyBlaquP7osMxPghtCj9VApAXReXbO8VUeodAn4IGUPA== Received: from [10.80.0.22] (unknown [89.150.40.109]) (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: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bbZHS6jdfz4CF; Mon, 07 Jul 2025 19:36:36 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: Date: Mon, 7 Jul 2025 22:36:31 +0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250620073050.7f03f74e@slippy> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------HFQRNXg78vu0UjJcJYr70J0P" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------HFQRNXg78vu0UjJcJYr70J0P Content-Type: multipart/mixed; boundary="------------dGEJHv5hY0rfzj00d7E0LOSD"; protected-headers="v1" From: Dima Panov To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> In-Reply-To: <20250620073050.7f03f74e@slippy> --------------dGEJHv5hY0rfzj00d7E0LOSD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCg0KQlRXLCBpdCBsb29rcyBsaWtlIHN5bWxpbmsgZm9yIGxpYmthZG01Y2xu dC5zbyBpcyBicm9rZW4gYW5kIHByb2R1Y2VkIGEgYmFkIGZpbGUNCiQgbHMgLWxhIGxpYmth ZG01Y2xudA0KbHJ3eHIteHIteCAgMSByb290IHdoZWVsIDEzICA3IEp1bCAyMDo0MCBsaWJr YWRtNWNsbnQgLT4ga2FkbTVjbG50X21pdA0KDQppbnN0ZWFkIG9mIGFzc3VtZWQgbGlia2Fk bTVjbG50LnNvIC0+IGthZG01Y2xudF9taXQuc28NCg0KDQpQbGVhc2UgcmV2aWV3Og0KDQpk aWZmIC0tZ2l0IGEva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxlIGIva3JiNS9saWIva2Fk bTVjbG50L01ha2VmaWxlDQppbmRleCBlMzc3Zjk1ZjViNmUuLmJlMDlkZDNlMjEwZSAxMDA2 NDQNCi0tLSBhL2tyYjUvbGliL2thZG01Y2xudC9NYWtlZmlsZQ0KKysrIGIva3JiNS9saWIv a2FkbTVjbG50L01ha2VmaWxlDQpAQCAtODgsNyArODgsNyBAQCAke0NIUEFTU19VVElMX1NU UklOR1NfRVJSX0N9OiAke0NIUEFTU19VVElMX1NUUklOR1NfRVJSfQ0KICAgICAgICAgcm0g LWYgZXQtYy0key5QUkVGSVh9LmV0IGV0LWMtJHsuUFJFRklYfS5jDQoNCiAgYWZ0ZXJpbnN0 YWxsOg0KLSAgICAgICAke0lOU1RBTExfTElCU1lNTElOS30gJHtTSExJQn0gJHtERVNURElS fSR7TElCRElSfS9saWJrYWRtNWNsbnQNCisgICAgICAgJHtJTlNUQUxMX0xJQlNZTUxJTkt9 ICR7U0hMSUJfTkFNRX0gJHtERVNURElSfSR7TElCRElSfS9saWJrYWRtNWNsbnQuc28NCg0K ICAuaW5jbHVkZSA8YnNkLmxpYi5taz4NCg0KDQpPbiAyMC4wNi4yMDI1IDE3OjMwLCBDeSBT Y2h1YmVydCB3cm90ZToNCj4gT24gRnJpLCAyMCBKdW4gMjAyNSAxMjoyNzowOSArMDMwMA0K PiBEaW1hIFBhbm92IDxmbHVmZnlARnJlZUJTRC5vcmc+IHdyb3RlOg0KPiANCj4+IEhlbGxv IQ0KPj4NCj4+DQo+PiBMb29rcyBsaWtlIHNvbWV0aGluZyBtaXNzaW5nIGFmdGVyIHRoZSBi dWlsZCB3aXRoIE1JVCBLZXJiZXJvcy4NCj4+DQo+PiBnb3QgdGhpcyB3aXRoIGRldmVsL2d2 ZnMgYnVpbGQ6DQo+Pg0KPj4gPT0NCj4+IEluIGZpbGUgaW5jbHVkZWQgZnJvbSAuLi9kYWVt b24vcHR5X29wZW4uYzo3MDoNCj4+IC91c3IvaW5jbHVkZS91dGlsLmg6MzY6MTA6IGZhdGFs IGVycm9yOiAnazUtaW50LmgnIGZpbGUgbm90IGZvdW5kDQo+PiAgICAgIDM2IHwgI2luY2x1 ZGUgIms1LWludC5oIg0KPj4gICAgICAgICB8ICAgICAgICAgIF5+fn5+fn5+fn4NCj4+IDEg ZXJyb3IgZ2VuZXJhdGVkLg0KPj4gPT0NCj4+DQo+PiBJbmRlZWQsIGs1LWludC5oIGlzIG1p c3NpbmcgaW4gL3Vzci9pbmNsdWRlIDooDQo+Pg0KPj4gT24gMTYuMDYuMjAyNSAwNTo1MSwg Q3kgU2NodWJlcnQgd3JvdGU6DQo+Pj4gVGhlIGJyYW5jaCBtYWluIGhhcyBiZWVuIHVwZGF0 ZWQgYnkgY3k6DQo+Pj4NCj4+PiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMv Y29tbWl0Lz9pZD03ZTM1MTE3ZWIwN2Y4NmMzODU2NTZlY2M2YTJhOTIwOTNiZTk4MTMxDQo+ Pj4NCj4+PiBjb21taXQgN2UzNTExN2ViMDdmODZjMzg1NjU2ZWNjNmEyYTkyMDkzYmU5ODEz MQ0KPj4+IEF1dGhvcjogICAgIEN5IFNjaHViZXJ0IDxjeUBGcmVlQlNELm9yZz4NCj4+PiBB dXRob3JEYXRlOiAyMDI1LTA2LTExIDAyOjU3OjU0ICswMDAwDQo+Pj4gQ29tbWl0OiAgICAg Q3kgU2NodWJlcnQgPGN5QEZyZWVCU0Qub3JnPg0KPj4+IENvbW1pdERhdGU6IDIwMjUtMDYt MTYgMDI6NDk6MzcgKzAwMDANCj4+Pg0KPj4+ICAgICAgIE1ha2VmaWxlOiBIb29rIE1JVCBL UkI1IGludG8gdGhlIGJ1aWxkDQo+Pj4gICAgICAgDQo+Pj4gICAgICAgQWRkIHRlc3RzIGZv ciBNS19NSVRLUkI1LiBJZiAieWVzIiBidWlsZCBNSVQgS1JCNS4gSWYgIm5vIiBidWlsZCBI ZWltZGFsLg0KPj4+ICAgICAgIFRoZSBkZWZhdWx0IGlzIE1LX01JVEtSQjUgPSBubywgYWRk ZWQgYnkgImtyYjU6IEFkZCBidWlsZCBwbHVtYmluZyIuDQo+Pj4gICAgICAgDQo+Pj4gICAg ICAgQXQgc29tZSBwb2ludCB3ZSB3aWxsIGNoYW5nZSB0aGUgZGVmYXVsdCB0byBNS19NSVRL UkI1ID0geWVzLiBBIHBvcnRzDQo+Pj4gICAgICAgZXhwLXJ1biB3aWxsIG5lZWQgdG8gYmUg c3VjY2Vzc2Z1bGx5IHJ1biBmaXJzdC4NCj4+PiAgICAgICANCj4+PiAgICAgICBTcG9uc29y ZWQgYnk6ICAgICAgICAgICBUaGUgRnJlZUJTRCBGb3VuZGF0aW9uDQo+Pj4gICAgICAgRGlm ZmVyZW50aWFsIHJldmlzaW9uOiAgaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0Q1MDgx NQ0KPj4+IC0tLQ0KPj4+ICAgIE1ha2VmaWxlLmluYzEgICAgICAgIHwgODkgKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKw0KPj4+ICAgIE1h a2VmaWxlLmxpYmNvbXBhdCAgIHwgIDQgKysrDQo+Pj4gICAgdG9vbHMvYnVpbGQvTWFrZWZp bGUgfCA2NCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+Pj4gICAg MyBmaWxlcyBjaGFuZ2VkLCAxNTcgaW5zZXJ0aW9ucygrKQ0KPj4+DQo+IFsuLi5dDQo+IA0K PiBUaGUgYXR0YWNoZWQgcGF0Y2ggd2lsbCBmaXggdGhlIHByb2JsZW0uIEl0IGNvbnRhaW5z IHR3byBwYXJ0cy4NCj4gDQo+IDEuICBEb24ndCBpbnN0YWxsIHRoZSBvZmZlbmRpbmcgaGVh ZGVyIGZpbGVzLiBUaGV5IHdlcmUgaW4gbXkgZmlyc3QgY3V0DQo+ICAgICAgb2YgdGhlIHBs dWdpbnMgYnVpbGQgYW5kIHdlcmUgbm90IHJlbW92ZWQgYXMgSSBjbGVhbmVkIHVwIHdoaWxl DQo+ICAgICAgcmF0aW9uYWxpemluZyB0aGUgaW5zdGFsbGVkIGZpbGVzIHdpdGggdGhlIHBv cnQuDQo+IA0KPiAyLiAgT3B0aW9uYWxPYnNvbGV0ZUZpbGVzLmluYyByZW1vdmVzIHRoZSBm aWxlcyB0aGF0IHdlcmUgZXJyb25lb3VzbHkNCj4gICAgICBpbnN0YWxsZWQuDQo+IA0KPiBJ dCBpcyBlbm91Z2ggdG8gcnVuIG1ha2UgZGVsZXRlLW9sZCB0byBmaXggdGhlIHByb2JsZW0u IFRoZSBNYWVmaWxlDQo+IHBhdGNoIGVuc3VyZXMgdGhleSdyZSBub3QgaW5zdGFsbGVkIGFn YWluLg0KPiANCj4gTXkgYnVpbGR3b3JsZC9pbnN0YWxsd29ybGQgdGVzdCBpcyBzdGlsbCBy dW5uaW5nIHRvIHZlcmlmeSBub3RoaW5nIGVsc2UNCj4gaXMgYnJva2VuLg0KPiANCj4gU29y cnkgZm9yIHRoZSBicmVha2FnZS4NCj4gDQoNCi0tIA0KU2luY2VyZWx5LA0KRGltYSAoZmx1 ZmZ5QEZyZWVCU0Qub3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJp eC1kZXYuZnJlZWJzZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmljZSwgcG9ydHMt c2VjdGVhbSlARnJlZUJTRCB0ZWFtDQoNCg== --------------dGEJHv5hY0rfzj00d7E0LOSD-- --------------HFQRNXg78vu0UjJcJYr70J0P Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhsIb8FAwAAAAAACgkQ+4ugndU5jyli RhAAy4NzRCXSP0vnsWdfeOT863FAPBhiDErZGN+W0y7yb+LcdnawU3HZldE3rbZClJ4NQhyVHD6S X8joh1irLRxdaoMwg3hDUTi/O9quxT1P67itKT634LT48TCo0/SGHlHVx92dzKKv258dRkPv7uIv LWqfllLNnmuYOgT+Tx3b21aM1lcfHhYiGSLad9nsjOeO0g8mXUcdmK071BnNNURTMOHYDURxxw77 ox74Btuc5mRbT1o/nUPMogBRfDG3OwW9828mfoTwaaJVkW2ihPorTojwEhC1VaK1b6ebCDiED6oQ 1wJC8ISuzPB+zparBenTsTNWm6jbBKgjqbDUnBUoisUwARCugmm1C+C8pfQ5lH3f8rAYoSCbL3JR 1hvJE9RY31aJX85O13qIh8eeBSkKIRfPlf3pE06JFJ2V7nMkGhfVk7axviNfLU8mOGRxFGdnT03k ryOogwKkz3cQYne8bLPQJAhmdeBnVkWe2S0gEaHBgPsWRvqcKM99mBDSoDX6zmGZ0R/XfSuuFc1+ lnS1n3WzVzIgy7rC2nH+pJz8zcpTe8+foJMv8uqjz+N+TLxCRQHxtiuAphonqmTcXzHPbJm24BCj 1GohCuNyPvJmbL49M0bOp3NATnqpw8Wub9XYleoGUJ9ya8K7qlA31xx9bTEs5Gk582zFUnx4X9db eRc= =Kne2 -----END PGP SIGNATURE----- --------------HFQRNXg78vu0UjJcJYr70J0P-- From nobody Mon Jul 7 20:16:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbb9s2C59z616pC; Mon, 07 Jul 2025 20:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9s0L3kz3KZj; Mon, 07 Jul 2025 20:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=92QWW0SnrLMLNC1om3T1gSP8fjkcWFb7uRjvfgwWviQ=; b=eOnhT22jj5A+Gv/ibC0GTV5tpSpAecuegon8iTHbtGXHPTUh/XpJLVNQrIVw3n7yLurE1l G3mfTRuvQfwGhGdBKeM2sFlNj/1X3Z8EW4NBSun8xEEFnD7whsDup3u7SSH2Oj1Fbn4o7l uagxh7DlGFOpfSl07i/vnCqTXHXLY2zI0X7VzOM5YUgWc5jIBg5pQMAoR8pPUpgHBhcact HTV68F0KwjdDhDCWy3P4wbN6BpMB9ekBP3RrI1ArSMd+qw8nyhpa5fREBU8SEck+i2reZJ EvSZ7aBkQjB+SG3ZnJttwqfyEIi0gjfgBU7O012nbHe6ryZCKVANgumKZViyLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=92QWW0SnrLMLNC1om3T1gSP8fjkcWFb7uRjvfgwWviQ=; b=rUgAWr9M/M2mWVnWktQerX2B5ee1IU4wlRW/uZJGimvOH5Wq/hv2u9mKv3XO6TsAxgRssd P77G8HNLd+FylwB1EXHbS0tSm2y0vdkwxMHOw2Y7DR1WiQD0lS0jY5e212PkPggv0Z0wnh Hp6pjHHu0LqaDpmhYK6RBfD9HK7MfEQ/MYP+1exmdJAwhB9DioQTTThZAxhA0bIM3hk96Y K0yUo88KW+EowMr4AaWt1tDThHrG7QSXxbskFJXoPSBcsth5AbV6RajpsQnt5BdbJ+nVhy VbEe5eVfDJBQFKorzuRUF2cvfBR8iZlQlkZXAoUweE6AZLnRIKhhXANWmlRD7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919409; a=rsa-sha256; cv=none; b=bT06FCR9WlAK0bw8bEwi3NaakIwzXk7aF+U230b6x/KZNamrKWur+3Dd0KInz2uc+AmBCl KCT1y/C1/CXwoaIYfcyst4xMoxVCRJDz5IINOJW7ZmRnyWe+wwr4io61xmSOvSEA5ythUu snIos+Vfv1qDhk6VXo3+TYvtAdK0F8A8+6qMhpplSFwMvuVllbYaX+hO43a+6rsqg2x4ML oGyPot6ogEyGra9JSqTBmFxxPTBp2RJSELRptjPqcDlpHgaB6bJpV+W2Nse606+BEV1Ulz 1SW8n5tuCtPDKEdpGbyIKmS58n0wCkc4FjV0Aq8hb3IVLCx10dNdVymx0S+wuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbb9r64SJz154F; Mon, 07 Jul 2025 20:16: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 567KGmrN006480; Mon, 7 Jul 2025 20:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGmQr006477; Mon, 7 Jul 2025 20:16:48 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:48 GMT Message-Id: <202507072016.567KGmQr006477@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: 3a20f630a9fc - main - git-arc: Fix handling of author names when we have to make a guess List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3a20f630a9fcf6a1267cd527464edf71d01c8771 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3a20f630a9fcf6a1267cd527464edf71d01c8771 commit 3a20f630a9fcf6a1267cd527464edf71d01c8771 Author: Mark Johnston AuthorDate: 2025-07-07 16:50:10 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:30 +0000 git-arc: Fix handling of author names when we have to make a guess The output printed by this function is used as the author name, so we don't want to print informational messages to stdout. --- tools/tools/git/git-arc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index d953a30cb90d..22df0c61293a 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -545,7 +545,7 @@ find_author() # don't know if the prior _ are _ or + or any number of other characters. # Since there's issues here, prompt a=$(printf "%s <%s>\n" "${name}" $(echo "$addr" | sed -e 's/\(.*\)_/\1@/')) - echo "Making best guess: Turning ${addr} to ${a}" + echo "Making best guess: Turning ${addr} to ${a}" >&2 if ! prompt; then echo "ABORT" return From nobody Mon Jul 7 20:16:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbb9t1CVnz616lf; Mon, 07 Jul 2025 20:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9s6byCz3Knm; Mon, 07 Jul 2025 20:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PiUFKIMUehkC0pmasbQCzElEnuE+kkWaSXDIP5wo+uY=; b=M0EnRAZ4VqlNZie673mgutJ2fr6v6kZxtAWiqOQInS4yOy8voT1w/A4eNi1zSkDXT/Wt2q nYaw04bDkalAJwNjB0LWUo7fCN9jDZn5/p5z1U7/VfN2c4hcOuQjaXrd/GQ85jNza4g7Bn 7j2zg53gKTPaIEuhiiv/uk/LF5pzX+gYFDVvPnDNEu3q0vGaRql9LnTiVv1Q7K4g1b3ZM6 NGoqcFDYwujrKAGiFbCTXUhCB+rrPhRcR16Xm48b/82a/syOGuJDlONszlwhQUbCX7wkIK s4LVlKxHZuMTnMYHffhtmCwY8obDX4CWMf9/pR4QPpVefhJY0kzZt0iaP4BxDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PiUFKIMUehkC0pmasbQCzElEnuE+kkWaSXDIP5wo+uY=; b=c1QEyUA16jOKAsTVhN1C4qqEwbjVaEIQz+Ukbx2qUT4DoiSVBNaXtWPkflPl2qqvmPJnWa S8tJyHbLIMV7zOJy4r+Oh7a6nIdgzsbqlmFOv+3px4J/DTk+LtGkcIv6OZYLBmL/r8duKi iKosvaHS4uHjcbDj9zVHlxwm3VxA/wdRBPRWrCostzsF9dobhsf6sfuLO+JYp9zwGgUcAk sr2q89PIFbgtNIwrrXQqejVfp3PcEehSRsl3aHTJutJhgiIybVjsFluwcQ5+sVv5Z4luCr BMF+/4Zx3LnJcrKD8nAYE9qJtqFhZcH59nIDngbzXJ4IKp0kvx3GztFFZX6KtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919409; a=rsa-sha256; cv=none; b=kAa9gpteT2sNjTIKKSYiMcbgFrOqOxuY+pXUhyL//gILtPhu/qF6FMN4bRxoPk/SmSY/A/ SJlkSL5fff8ND8baLiqG2R7tHo3lVnoqyz6FR87E9H8NqqmL/tJHr6XSomutriP8xj9lGn tb+QYPvt1lQdJEbV57yLfy+dE9UCczExJGkavG9zUW7axTboOS/8z70xpWsAAH/E+avER9 qY6Mr5QE8jtAR+nZ+IjqGTKcN8lkpBs3cbAUYt8PmdkwW061qpzvrAXDHSD7Olg7U4b9Kr zOTUc+ZRkj8dS+zdEav00XlNKghQrlG7KWaHOcB9czLuSgUTQHF4P5EXoaPlQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbb9s69DXz155x; Mon, 07 Jul 2025 20:16: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 567KGnkE006513; Mon, 7 Jul 2025 20:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGnfd006510; Mon, 7 Jul 2025 20:16:49 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:49 GMT Message-Id: <202507072016.567KGnfd006510@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: 12bef37a824c - main - dtrace: fix symbol address resolution List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 12bef37a824c52582ee8f38699b8ae4fde17068d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=12bef37a824c52582ee8f38699b8ae4fde17068d commit 12bef37a824c52582ee8f38699b8ae4fde17068d Author: Jiacong Fang AuthorDate: 2025-07-07 18:51:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:31 +0000 dtrace: fix symbol address resolution Dtrace assumes only ELF sections of type SHT_PROGBITS or SHT_NOBITS occupy memory space. However, sections with SHF_ALLOC flag also consume memory space. Moreover, the symbol address initialization skips symbols at the very beginning of a section in ET_REL KLDs. Fix: Check section flag for calculating section offset, and disable the skipping at the beginning of a section. PR: 288000 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51188 --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 2a0386c33124..f6a328bb9b39 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -109,8 +109,7 @@ dt_module_syminit32(dt_module_t *dmp) if (sym->st_name == 0 || sym->st_name >= ss_size) continue; /* skip null or invalid names */ - if (sym->st_value != 0 && - (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) { + if (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) { asrsv++; /* reserve space in the address map */ #if defined(__FreeBSD__) @@ -159,8 +158,7 @@ dt_module_syminit64(dt_module_t *dmp) if (sym->st_name == 0 || sym->st_name >= ss_size) continue; /* skip null or invalid names */ - if (sym->st_value != 0 && - (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) { + if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) { asrsv++; /* reserve space in the address map */ #if defined(__FreeBSD__) sym->st_value += (Elf_Addr) dmp->dm_reloc_offset; @@ -245,8 +243,7 @@ dt_module_symsort32(dt_module_t *dmp) for (i = 1; i < n; i++, dsp++) { Elf32_Sym *sym = symtab + dsp->ds_symid; - if (sym->st_value != 0 && - (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) + if (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) *sympp++ = sym; } @@ -269,8 +266,7 @@ dt_module_symsort64(dt_module_t *dmp) for (i = 1; i < n; i++, dsp++) { Elf64_Sym *sym = symtab + dsp->ds_symid; - if (sym->st_value != 0 && - (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) + if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) *sympp++ = sym; } @@ -1218,7 +1214,7 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) continue; /* skip any malformed sections */ if (sh.sh_size == 0) continue; - if (sh.sh_type == SHT_PROGBITS || sh.sh_type == SHT_NOBITS) { + if (sh.sh_flags & SHF_ALLOC) { alignmask = sh.sh_addralign - 1; mapbase += alignmask; mapbase &= ~alignmask; From nobody Mon Jul 7 20:16:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbb9v3dLNz616rD; Mon, 07 Jul 2025 20:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9v0Nx1z3KRb; Mon, 07 Jul 2025 20:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2yRiu4H8n7UyhoB9XkgduSSVMy0hn65l1NcBJyDWp+0=; b=X/r29HTItomMvbNWmiyhQDlTQ/IIGh+BOv5g1zvwH0dmyBqBrfdLEleP8ByhcoiIwpSiFd 3g4jmPgtbnQ/8omAuJ+UVdUpm2SEZRLnuO5NCiD6lPcRaBV0NHTcUpYrDAv+nc6BAgJRkd 4SDnMdw8gxMVV9AyRYuSpdgi1QxuUNNG5QQ/v3rxGA67XAcX7IKu7R2WQgCayEbyR2qW4u Y++EtfMrL+fiFNJu+/a8eabV4m/c1PqVbRc1zhzZOswPCH6DzvJkqgxifXjjTtMzbYrp+6 U1orCpidQtzenwlCjiABCPsNONCZi20lbQurPGwq5LB8sOfwy5e23ZmiBvYAkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2yRiu4H8n7UyhoB9XkgduSSVMy0hn65l1NcBJyDWp+0=; b=O5aXNcUeZyvfOMz92jCvroFt06radUcC8yqBRqmHjdkUxVlFOIBEDYMUh3ekBmwuAbiH5w xmHorocvsgy4XLqf5NS6z+Ln0iH1ITokOYHXxkWEB5dL3zI70xOgukCp1nl3MXR6bRr4td 1YB0mPlBeTMXYaqT7J5A3SOzUW4mQVbAQtFwselaMXsiZIvwnkFI1H6Q0ZZTnx7thVDVuw Jb0kQG7YayxjsHB/q7ALIpuHBGPtJdyuw8RSAsQNG0ohrVYjUjERRY4ZuFwOml5drsofLQ h1FxEPKjwWzhZE/ZtFtQSxVaF62e6vD+hUhAPt7mIRlEnAN9OboNZgZ2RN19+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919411; a=rsa-sha256; cv=none; b=oIfFLUM+dnVspcd2I5gaqtwBl+zdXtIW24UlsqxhZjKrNpN0YmDXTZjedsfHQV1HRcGcrH M0ReJ9QcSMiUmfyUPKmpSFItWnhrHwjWYmHDeluZq8945SK+KOLEv4LMFaTHeAT2C6QUKg Vz51MZmHqxjfkNSPe3fWZkuamsmUEiJ5Y6xgvspTR/Fm2qDW9PSN1IgEpkEWIrjTSQUEiY S0ig+CZFpv5I2NSqeC7/23V1kHgnH+8XCgbdRa9raNTiP0uD0Cl8kKq1l6b7R/ngjjxlX+ DSMfTtVd6qGWeYfeB5fyvxNyBFO0a6nPXvidZ7cQI8uHzAvDg2HeJZyyl9xfQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbb9t6qKNz154G; Mon, 07 Jul 2025 20:16: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 567KGolv006554; Mon, 7 Jul 2025 20:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGoES006549; Mon, 7 Jul 2025 20:16:50 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:50 GMT Message-Id: <202507072016.567KGoES006549@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: 4ea7a920de22 - main - inotify tests: Use unsigned integers for event masks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4ea7a920de22d283dd801a38588f35f56cdddcb6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea7a920de22d283dd801a38588f35f56cdddcb6 commit 4ea7a920de22d283dd801a38588f35f56cdddcb6 Author: Mark Johnston AuthorDate: 2025-07-07 19:14:41 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:31 +0000 inotify tests: Use unsigned integers for event masks Reported by: gcc Fixes: 739fc14938d5 ("tests: Add some regression tests for inotify") --- tests/sys/kern/inotify_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/inotify_test.c b/tests/sys/kern/inotify_test.c index ed7cef5d148c..713db55afc22 100644 --- a/tests/sys/kern/inotify_test.c +++ b/tests/sys/kern/inotify_test.c @@ -79,7 +79,8 @@ close_inotify(int fd) } static uint32_t -consume_event_cookie(int ifd, int wd, int event, int flags, const char *name) +consume_event_cookie(int ifd, int wd, unsigned int event, unsigned int flags, + const char *name) { struct inotify_event *ev; size_t evsz, namelen; @@ -118,7 +119,8 @@ consume_event_cookie(int ifd, int wd, int event, int flags, const char *name) * matches the expected values. */ static void -consume_event(int ifd, int wd, int event, int flags, const char *name) +consume_event(int ifd, int wd, unsigned int event, unsigned int flags, + const char *name) { (void)consume_event_cookie(ifd, wd, event, flags, name); } From nobody Mon Jul 7 20:16:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbb9w4rzKz616ys; Mon, 07 Jul 2025 20:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9w1K4rz3Khy; Mon, 07 Jul 2025 20:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClpeLU8M7C4k4OvF2fAFTNssyL+GAUl2SDMvhzqrwdw=; b=IAaZb0VGmbNfc7BMoLpmQaC9djZV/sm3BSrkFLfVKq4qImv68wCzAxJCDb/2YbnkMLOfcc Qsru/9i7WpbKNuds+EKGiPyhUwtZdG9GDeKI4Ha33yKcE2BHHvj119ed2KGO79mHFHZl6F SVdP2XXYoCsI4HkPpBpbcI+/NHI+uZv/0hqXCJtorVsNn1u7iboWXEgBFYbtnOhImCcU1z mtEX4p9refAGN9pFuJvqpWn2jJfX0DWbyCl5937dnO7imiAvF8HqY6UOtLIJVrPDT2/Nnd iJ3nY1WMgFgTBBjBYp0HZUOjcPoMPjXrlfyAFSfqbhSRm/pLRo+vBh+3o8mO7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClpeLU8M7C4k4OvF2fAFTNssyL+GAUl2SDMvhzqrwdw=; b=p0fxbTVe++HCBhGLahtI++VM26IKXALTAPn2qrW7tPQ4nsg2MMCc3ggDfo0ER6Is9LRvPc ZULy/d4LHQZx+07zIfEO3MH0UU/qyrfeg922lz5tLhFiUZKNRN2ypXNI2wQtLO0IMsPp3v evM63RJ2S3FGM231gdd1JErkiqzHl2qgJsDT/DgxlnZvO4MEUGNn3JcJOjIXrdvedlG2/n Rz/cU8eW67ttuEIS9ZibLMOQ/nOCqRDA+9xgNlId/cjTdLT6/RWTrm+p9kyViZPOcJaxMj 7viEM/7davgpJAhfH2DYJgdg/H4+GwcRilk4DP5PtDsNB8gUVmR9+yhXdbztbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919412; a=rsa-sha256; cv=none; b=UROKgp9X9M+JzqKb9Rgd2aIMn/HNXj5KOoIMBI0HWFiLETosNSJcE5EdkfyICVwW3WElJD QSvQprDW5xJ0gBadP9WvwtpgxEYub4HvEewln/Igc3K1kStikCaLTQlXdsrlvxFaz0YfDY 151Ap8mnPG8NWBuXVgepVclV0yQN52hS4qhsE1M/7erd/aPTqbqWAdAw0I+EhZcMeiN1Ox tDlPVN0P/CgBhQCwT+6bheJw+5zIcal1hvgmXUu7nzA9E4ceh+5w/HXtCcSqfhydv5L1oe I0UjehNaZqgX/7AVDdHf/1fDNXTedCjRGGDzqXrfLFUBqv6kGbDtqag0NFbv1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbb9w0gjSz14cg; Mon, 07 Jul 2025 20:16: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 567KGpcf006596; Mon, 7 Jul 2025 20:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGpNl006593; Mon, 7 Jul 2025 20:16:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:51 GMT Message-Id: <202507072016.567KGpNl006593@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: bc6b526e2b71 - main - inotify: Use memcmp() to compare embedded file names List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: bc6b526e2b71cf7e07806db5bc77926ed5c874f7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bc6b526e2b71cf7e07806db5bc77926ed5c874f7 commit bc6b526e2b71cf7e07806db5bc77926ed5c874f7 Author: Mark Johnston AuthorDate: 2025-07-07 19:30:35 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:31 +0000 inotify: Use memcmp() to compare embedded file names Otherwise gcc warns that strcmp() will read a byte from a zero-length array, though in practice we exclude that case with an explicit length check. Fixes: f1f230439fa4 ("vfs: Initial revision of inotify") --- sys/kern/vfs_inotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index 9562350c897f..41e73bb41a49 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -503,7 +503,7 @@ inotify_can_coalesce(struct inotify_softc *sc, struct inotify_event *evp) return (prev != NULL && prev->ev.mask == evp->mask && prev->ev.wd == evp->wd && prev->ev.cookie == evp->cookie && prev->ev.len == evp->len && - (evp->len == 0 || strcmp(prev->ev.name, evp->name) == 0)); + memcmp(prev->ev.name, evp->name, evp->len) == 0); } static void From nobody Mon Jul 7 20:26:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbbNf4grKz617tM; Mon, 07 Jul 2025 20:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbbNf3LYvz3S1k; Mon, 07 Jul 2025 20:26:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3aOzc+UCeZoNwzvqEagWsii6WTefBkWVjS1y9q4m3I8=; b=Td2pB5hmwEMy0Aj/xeRkyKiPCZPKaRbrVScTkaAZZPkBifYeQ/yRRIUWGSKuf/UeIuA3wW d7cEG1kczfv0r1S2P/rxQAJzyEceB8k8t9m1m2YNabusOyeHAa/9eGrHRf0qJoGigNmzgw zoZvI7H5hH3hgyTohejhwV5NFuSLXpy2cu2vw50NcL6C2u8glFxb4J4v477p5Pofubuy/X A3GJYmfet2eboJG1wJT//dXjzDO2AZMqUp8Ax4WuV/Gg2G3/rWVJQfnjKTD3XopRJr1NXK WztT+v+7rVFVFWwdLx9XGkJMyOyY1UPLTDfxC/c8Mf1fFNpUS3ZcuGqsz/oMXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3aOzc+UCeZoNwzvqEagWsii6WTefBkWVjS1y9q4m3I8=; b=pUv/H3Hx9Nnx2F6gkCgVcMWYL4nRacaEMcIx64Zll70/0xq+KhO1IykX0FbbVwnO+yf7qA KRYftt4qkhDMcNhUr2tu2hi9s6OHkCxW3QQ3m7oKo8ZgeXeUyOHZF9PAMpfFbIFTePapp8 6lWY33nYmzJnNMye4aOQGo3jtbedB0RGORJrPIhjtxH5Cy7g5fhco0do7Eo71klO/+2R47 K0P6IiKBT7bpPrl1Zkx36N5GGnyYCRE7vnwBxjoIlV76+3cmo97w3fkxb2saIKOG8QKXHt fExG7/VSj7ZuqUPikLdZcDBGp+oKS9MzNSagfs0fVg7ihFRFWqoKOv8jkmE05g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919970; a=rsa-sha256; cv=none; b=tn3Itpfj9g09OG7TJXXwkdTxio2g9KsWpCWFtQgzCLYUQSfvOQRm12sECJ6OM7GvKCJ/Ur KoGOQ2gHkna1iHgLD1uBs3UDiN3Foj7RffXgyi4DwsFSZcs8HaJn9ChhpglhwirJT3pX07 ccEV/zhzxvjxuOkujL3M129yJH7/Fe0WQhTOqN0OplD3Yb0raEgv1uwn0HbVzYKPtV0W5h eA3uytzphB1Wg1XXcg/2Z4NM7OXJQk6gaNsbAuagmUt32e/KILYg9L9GCX6OBIT8eyKshJ sXVyCud0uYcIFpxOFMyMeQi6omZhbQifwYxTVGWMKCx+HbwN6k0UQN0sMGpOiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbbNf2k0Hz14dQ; Mon, 07 Jul 2025 20:26: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 567KQAwl024746; Mon, 7 Jul 2025 20:26:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KQAFa024743; Mon, 7 Jul 2025 20:26:10 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:26:10 GMT Message-Id: <202507072026.567KQAFa024743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: ed4c64bc792f - main - tests/ci: Use suitable variable for qemu-user-static existence check List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed4c64bc792fd2509d8fd6805f8e174c2db62338 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=ed4c64bc792fd2509d8fd6805f8e174c2db62338 commit ed4c64bc792fd2509d8fd6805f8e174c2db62338 Author: Siva Mahadevan AuthorDate: 2025-07-02 19:00:06 +0000 Commit: Li-Wen Hsu CommitDate: 2025-07-07 20:25:20 +0000 tests/ci: Use suitable variable for qemu-user-static existence check And simplify a qemu-system existence check. Signed-off-by: Siva Mahadevan Reviewed by: imp Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1751 --- tests/ci/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ci/Makefile b/tests/ci/Makefile index b57de345f852..271fc377619b 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -144,10 +144,10 @@ portinstall-pkg: .PHONY .endif portinstall-qemu: portinstall-pkg .PHONY -.if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static) +.if !exists(/usr/local/bin/qemu-${QEMU_ARCH}-static) env ASSUME_ALWAYS_YES=yes pkg install emulators/qemu-user-static .endif -.if !exists(/usr/local/bin/qemu-system-${QEMU_ARCH}) +.if !exists(${QEMUBIN}) env ASSUME_ALWAYS_YES=yes pkg install emulators/qemu@nox11 .endif From nobody Mon Jul 7 20:28:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbbRw4RNKz618KZ; Mon, 07 Jul 2025 20:29: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbbRw0rDHz3VCr; Mon, 07 Jul 2025 20: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=1751920140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqKVqnnV2L0xvqDWvS+uRZSSGbC1iLt6PEGqdD84dQ8=; b=ABmOmiQV/gO5OE/NEcaj6XQcV73+CrCgWrBT01rk+cOxJ1RJHezTRsvlgxVuiw90fLoL4G +JQf1cWANxz+/BtZYmgpZpDpdCj10VEujyGj6vjcvPH89kU4KWn4jZtDiSd/nFrBHOBYwn ZflLg1RuJk7sSPyelmhqS1rzbKL6fe/c71F1uWQu8Y6ZYIOAPB2V9zkm4uGIToEA6eljr6 r4gp605QD86OquKIQZtlN9xB9WJp35WX5mG6nK1d4nZmXMW/QvRdPgqosahO33I5/OzoIT VoRnmVU+dnJjiX8prrzgK9HWv5DlGt50ugIpKLPRLhsUG+rLKWNAGwDqtvmphQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751920140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqKVqnnV2L0xvqDWvS+uRZSSGbC1iLt6PEGqdD84dQ8=; b=QW/o2RgiEdKF3RqSNoN+k1jI2ZJThe3DAz3yazs2lHU6fR9bTeSQK/NRgTcs6IDG3mYSN3 ZIyHMN4OvnFmlgM6Fg/0eTUmTWVHb0JXAMT8zQN1uY3QGW9jNwdLC+JFNm8CocsF7ZaKEc j1+M2msSEXzCBkxK1RORpcwI0J59hLpgOre4tZTmNBTDqkAX9Kd1oSa7yEzggBIoiwdmAz kJWwLtOubHOFax+aot4NXZ3xugLijaKbLicKSk6tVEtr6QxaDtRVajFiToaxJkDgLOtd7x enBA66QW/floSjxtLUhW5D3d5FW/ikhxrS7cXV0W0qLlF+BTijeHJLKJ/GfZsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751920140; a=rsa-sha256; cv=none; b=C4gVD++8e/7KEG5jMhGjZBblw6JTkNLuw6r4yoRKseN2qqeLx8el+p/Bi2KJXDsfkQVdjn SgYEeCgvgoO599RyIxZjTPv2Vlb6njEQr7QHzEF/yodC1yvUXVTHGkDJxorpIaj/F/jUN5 DZuHYzjeRtTNzVaztLzFnxf9HjTGqbVyVuqTE2fldh3KRjd5GpEgH00wCe85GX1LBpToVS lP2pirYqgSO1jR7XSyXAF0w/30DNrKPvfTCdH73ZPDdhAPLJ/d4dR/HFOWn8CI2c0OpW7h P7HEGpycsjfX7ColtnnnxLahI+9BurClb9nH59vl9aTr+UwwK/RAqULBJpwGcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbbRw0Btlz15d3; Mon, 07 Jul 2025 20: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 567KSxVd025673; Mon, 7 Jul 2025 20: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 567KSxfH025670; Mon, 7 Jul 2025 20:28:59 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:28:59 GMT Message-Id: <202507072028.567KSxfH025670@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: 393fefa3d9c7 - main - mkimg: Make output reproducible using a specific timestamp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 393fefa3d9c78948d911e5de0182a9b858b23475 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=393fefa3d9c78948d911e5de0182a9b858b23475 commit 393fefa3d9c78948d911e5de0182a9b858b23475 Author: Mark Johnston AuthorDate: 2025-07-07 20:27:24 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:27:24 +0000 mkimg: Make output reproducible using a specific timestamp In commit 95ac5b0e27e9 ("mkimg: Add a reproducible mode"), I added a -R flag to mkimg, indicating that output should be reproducible. There is one place in the VHD image backend that uses time(3) to populate an image metadata field; this field is visible to tools which know how to process VHD images. Rather than picking an arbitrary value for that timestamp, it seems better to behave like makefs(8) and let the invoker pick a suitable timestamp. So, remove -R and instead add a -t option which lets the timestamp be specified directly. Then, modify the VHD backend to use that timestamp. Fixes: 95ac5b0e27e9 ("mkimg: Add a reproducible mode") Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51077 --- usr.bin/mkimg/mkimg.1 | 8 ++++---- usr.bin/mkimg/mkimg.c | 24 ++++++++++++++++-------- usr.bin/mkimg/mkimg.h | 4 ++-- usr.bin/mkimg/uuid.c | 7 ++++--- usr.bin/mkimg/vhd.c | 2 +- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1 index f6b151d2d5c7..ae48904eb16c 100644 --- a/usr.bin/mkimg/mkimg.1 +++ b/usr.bin/mkimg/mkimg.1 @@ -41,7 +41,7 @@ .Op Fl f Ar format .Op Fl o Ar outfile .Op Fl a Ar active -.Op Fl R +.Op Fl t Ar timestamp .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -139,9 +139,9 @@ option is a shorthand to specify the minimum and maximum capacity at the same time. .Pp The -.Fl R -option enables reproducible mode: any timestamps or random identifiers will -be fixed so as to ensure consistent output. +.Fl t +option causes any timestamps embedded in the output file to be set to the +given time, specified in seconds since the epoch. .Pp The .Fl v diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index c8872ebb1bc6..a7409b686560 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -61,7 +61,8 @@ static struct option longopts[] = { static uint64_t min_capacity = 0; static uint64_t max_capacity = 0; -bool reproducible = false; +/* Fixed timestamp for reproducible builds. */ +time_t timestamp = (time_t)-1; struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -563,7 +564,7 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:RS:T:", + while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:t:vyH:P:S:T:", longopts, NULL)) != -1) { switch (c) { case 'a': /* ACTIVE PARTITION, if supported */ @@ -608,9 +609,6 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "partition"); break; - case 'R': - reproducible = true; - break; case 's': /* SCHEME */ if (scheme_selected() != NULL) usage("multiple schemes given"); @@ -618,6 +616,19 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "scheme"); break; + case 't': { + char *ep; + long long val; + + errno = 0; + val = strtoll(optarg, &ep, 0); + if (ep == optarg || *ep != '\0') + errno = EINVAL; + if (errno != 0) + errc(EX_DATAERR, errno, "timestamp"); + timestamp = (time_t)val; + break; + } case 'y': unit_testing++; break; @@ -680,9 +691,6 @@ main(int argc, char *argv[]) if (max_capacity != 0 && min_capacity > max_capacity) usage("minimum capacity cannot be larger than the maximum one"); - if (reproducible) - srandom(42); - if (secsz > blksz) { if (blksz != 0) errx(EX_DATAERR, "the physical block size cannot " diff --git a/usr.bin/mkimg/mkimg.h b/usr.bin/mkimg/mkimg.h index 608de458e83c..aa0ec2a8d944 100644 --- a/usr.bin/mkimg/mkimg.h +++ b/usr.bin/mkimg/mkimg.h @@ -29,9 +29,9 @@ #include #include -#include +#include -extern bool reproducible; /* Generate reproducible output. */ +extern time_t timestamp; struct part { TAILQ_ENTRY(part) link; diff --git a/usr.bin/mkimg/uuid.c b/usr.bin/mkimg/uuid.c index f3415a8c1111..885a6c36b522 100644 --- a/usr.bin/mkimg/uuid.c +++ b/usr.bin/mkimg/uuid.c @@ -57,9 +57,10 @@ osdep_uuidgen(mkimg_uuid_t *uuid) u_int i; uint16_t seq; - if (reproducible) - memset(&tv, 0, sizeof(tv)); - else if (gettimeofday(&tv, NULL) == -1) + if (timestamp != (time_t)-1) { + tv.tv_sec = timestamp; + tv.tv_usec = 0; + } else if (gettimeofday(&tv, NULL) == -1) abort(); time += (uint64_t)tv.tv_sec * 10000000LL; diff --git a/usr.bin/mkimg/vhd.c b/usr.bin/mkimg/vhd.c index 1e1f1e7f3c3e..c0fe45ab416e 100644 --- a/usr.bin/mkimg/vhd.c +++ b/usr.bin/mkimg/vhd.c @@ -188,7 +188,7 @@ vhd_timestamp(void) time_t t; if (!unit_testing) { - t = time(NULL); + t = timestamp != (time_t)-1 ? timestamp : time(NULL); return (t - 0x386d4380); } From nobody Mon Jul 7 20:36:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbbcr59MYz618sn; Mon, 07 Jul 2025 20:36:44 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (using TLSv1.3 with cipher TLS_AES_256_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 4bbbcr1D0Bz3YPV; Mon, 07 Jul 2025 20:36:43 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Mon, 7 Jul 2025 22:36:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1751920595; bh=jq9onjmCwF3rIg29EN3WTnnijEgtUrqW+Wx2JyeA0uA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=zdqZ0RZwzo8RMmeMtZlYRgyFvyRMoS8uu5frnnRQUtsStgoKKNQouTpRp98L5+Fag Dq0FM/Gm94XboO9a4V/OVJHF/PYqgEsmiPJKC0Zviangf4VrVNoEa6JyB/OIrwu7h0 a7Ln68DmoB2gUYKiibNKXf+3pS6jxt8gYXNHa1YY7e5RWHepdGyJSYY9ZhRFjGS4Yk S1WFsRZ0RiElqwbnemOc1oDPt+4ce7gumWIXQPl7dI7I+NwCiFToFptKanbYTcLXSr e1/ZNJMrfAiP2e15nEODi800pnHzFvzI9na8xx8Q+6kLis88FflNl8uvJW8IbScRPQ D9DCk3GkPzlNA== From: "Herbert J. Skuhra" To: Dima Panov Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bbbcr1D0Bz3YPV 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:24940, ipnet:2a01:4f8::/32, country:DE] On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > Hello! > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a bad file > $ ls -la libkadm5clnt > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > Please review: > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > index e377f95f5b6e..be09dd3e210e 100644 > --- a/krb5/lib/kadm5clnt/Makefile > +++ b/krb5/lib/kadm5clnt/Makefile > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > afterinstall: > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm5clnt.so > > .include This produces a valid symlink that 'make delete-old' wants to remove again: lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> libkadm5clnt_mit.so.121 # make delete-old >>> Removing old files (only deletes safe to delete libs) remove /usr/lib/libkadm5clnt.so? From nobody Mon Jul 7 23:04:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbfv63TRWz61T3w; Mon, 07 Jul 2025 23:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbfv61bJ0z3ptt; Mon, 07 Jul 2025 23:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RbibdRpK/J98X7nmAOYWy4aGSw/yfhu7106SAcM/heo=; b=YbXHzeyLpNZ+STSWFPEQZWHvx6jEAm+E3oVL5WQ7rhtMYMFi832g8nbHMFjedPOUXPSB8Y k6kIQhYickJzn3Uco8tPYxotfZEm0Q+8SFIQOgPc8kYp4pO7sh53A/Uz6HNb19leKir6Yg yzUrrV3s3jl3RMfB2QZBT4pMuHxIGqe2GvnRBAj10Oq/2te6LwrAsFXn1TYiuYoVF4y+Jo TeK105OOTaYmnWiSmAA2a7/6dYpNknnma/wFaIdAXlq5BsdAi950eqUe7LBcEH9UJ77wWT aVtrD1NFN8yPFu651dmmsEpFvUbS+kDGJuh55sB9zZ9RGf3xEjm+lFtgkNdqHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RbibdRpK/J98X7nmAOYWy4aGSw/yfhu7106SAcM/heo=; b=mNc6Z8H+7TSHxOLCWgCtWh49YNDNR5geRu/MdQIxO8xMa1QzQOZdMFC0yQR+t5t/AK+D/O CK8jdi1MtQDGu6qplFkehqHZkaqaU49gphIStgbB7UtA/gykRNv8tqQdzlFxzyd0KLaNKd cEwskhqNmaZw+gvzSgQoJyBp3Wh3G7hOQaGkr6S6BF7FX7R0ybsFFV3hLoyD90pGsLDSAq rp48lFWlzDmFqIYy9nQehTy/1gSr8r9qgs4B/k5wvCfrHoVPVwqgOx8GxibjxH8ON5ig1H XNYIV+3gdeAjUOYGkBnEvDW5gYHbywLSigVEQzrORkBSAiEpkdNuwMq+3PZM5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751929458; a=rsa-sha256; cv=none; b=tmmLxDkL9b1jnBHpMHIT52ahcuLnVCl+3TknnEQm7aOwkEZA/gIpMUoe6WD7LyvUWgbEqL igSmqf8tTljCXNZX7FFMPL12lqLg4CHMG9adQGUUSfdrPvi1+VnuGgjkYG6QGVTAXgGgu9 ApaphF1RzvSa3OMIS7wid2DWSPHj0mG3qOr7c3ZC+26BC3Ewku0qm7DRSfLlphDcggl0Bc bS68gUY+9B13EtDFNeAf0JTW+J6IEzX82konF4x1PJ+0HshfrwcBnfvHFVJlCEFDewSXrC /LfZJfcRSACiFN1nIRq02oY6AKCjRlhAeyCR8BOVk4QpmAtEAHR5sk0bOAsyog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbfv610y5z19Jq; Mon, 07 Jul 2025 23:04: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 567N4IdM025973; Mon, 7 Jul 2025 23:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567N4I9E025970; Mon, 7 Jul 2025 23:04:18 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:04:18 GMT Message-Id: <202507072304.567N4I9E025970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ca4abebcf80e - main - ipfilter: Save unit in hash table entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ca4abebcf80e282b2e5d33556d47ad9a50d13ba0 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ca4abebcf80e282b2e5d33556d47ad9a50d13ba0 commit ca4abebcf80e282b2e5d33556d47ad9a50d13ba0 Author: Cy Schubert AuthorDate: 2025-07-07 17:38:11 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:03:00 +0000 ipfilter: Save unit in hash table entry As with tree tables the unit must also be saved in hash tables. MFC after: 1 week --- sys/netpfil/ipfilter/netinet/ip_htable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index 22d427b87a71..e54b739df361 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -343,6 +343,7 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) iph->iph_ref = 1; iph->iph_list = NULL; iph->iph_tail = &iph->iph_list; + iph->iph_unit = unit; iph->iph_next = softh->ipf_htables[unit + 1]; iph->iph_pnext = &softh->ipf_htables[unit + 1]; if (softh->ipf_htables[unit + 1] != NULL) From nobody Mon Jul 7 23:04:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbfv75SMvz61TKF; Mon, 07 Jul 2025 23:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbfv72d8bz3ppX; Mon, 07 Jul 2025 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pSrPovf5n3JLVb0Nwa+uOy+NdAHBJnDKrr0fdvUtnSw=; b=NW7n5l2+hcXPQJls1OdmhFzeiaUmOsvXCCrEFNxRvWnEeetLGr/BBmbAliGv/O8YSvAR9W SE7CS1R1a5XkEgyu2o0rt4xgl4DYFM645Jffv4cnzmb1lfTE65knHKbk9gwaoCGUqtQcaV KW5j8dIaaxclk5qxwwgKpZQ0dPw3v/Elig+rIdx65cMx/UNJaXi2YdIlNqZsceTEfnUBbm nmo0rsnSomf5uh0jkjbQJZMGcpgwPWUjdbuFsaYfx9EUH3MCvQ2ceOAM9jlyqP2oXo6ro1 CSWdHTUpqvg334RyVLK7O+YhzYM4TpFPtaZp446YIYFEeNLC20yTZtbIzYC0Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pSrPovf5n3JLVb0Nwa+uOy+NdAHBJnDKrr0fdvUtnSw=; b=wBwuVjC/5pUYEZ9HplcaKeyjAgPCdfC6k/zaKTv4mqRmSgTp52YSbK1hbpMe06AU8bkEpk XE+JYYiURXDLZvbRetPtjC+0VDiyHExWxBdcB9CsfJTMkW29RXWRAmxflixJXNY9UZ04pb JvxYeVU2ncFFWIJt2HVGkYA7rltuw+RTajbHkkfM1aGHEXBbT4XyADG0dMvuUqCZVgU5+L dbxPLqq+6cbB/j9vL87WMg8K/st13PYC59Hw4ownhC5DKOsa2EFMKC1GzrmzZfDAicUvFM TLfB8iQZL7oz8o3y/fD3r+c6ZH9Q7jcbpKNy8tEUVzcg3K29bqhc3pc/C4vbuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751929459; a=rsa-sha256; cv=none; b=CpYhjMICYagyAT3JW4oQ+KGwOE+01EOAylwnv96ebrMrqtfphBx7iqDptoy/A+aOyZ7aZ7 vu0kp60T7vrFVPuwDEq4KWr0y/Px88INnVCHeEoMLzfVMTkaTOqyMwB3MYoPCFzWpdDtS6 tdWKDM9UPaEr8bSb3ZB95sQpr/K5BzozrZCmZ7/5S/Q0BP5rA6ihcpf9vkgeuopXeogfQg qafejvH/M/EpbVeVqzpsBn/wq3wLkb/brgOQwZV4BYZJVnm58HR0DsNBzqlfi88cDtyZno /wGL9OXAEkKG16f/FN1SA1d8D8/bur0e2isV2uObpJoiUbqzVddDkmcWRxHsVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbfv720N1z19Xj; Mon, 07 Jul 2025 23:04: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 567N4JRV026006; Mon, 7 Jul 2025 23:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567N4J7w026004; Mon, 7 Jul 2025 23:04:19 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:04:19 GMT Message-Id: <202507072304.567N4J7w026004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: aad5020c709a - main - OptionalObsoleteFiles: libkadm5clnt.so is used by MIT and Heimdal List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: aad5020c709ac4231af88d4b74588a28f87c9497 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=aad5020c709ac4231af88d4b74588a28f87c9497 commit aad5020c709ac4231af88d4b74588a28f87c9497 Author: Cy Schubert AuthorDate: 2025-07-07 23:02:03 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:03:10 +0000 OptionalObsoleteFiles: libkadm5clnt.so is used by MIT and Heimdal Reported by: fluffy, "Herbert J. Skuhra" Fixes: af2593e3212c --- tools/build/mk/OptionalObsoleteFiles.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index eb2713bafac9..e0689b2d811f 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4950,7 +4950,6 @@ OLD_FILES+=usr/lib/libhx509.so OLD_LIBS+=usr/lib/libhx509.so.11 OLD_FILES+=usr/lib/libhx509_p.a OLD_FILES+=usr/lib/libkadm5clnt.a -OLD_FILES+=usr/lib/libkadm5clnt.so OLD_LIBS+=usr/lib/libkadm5clnt.so.11 OLD_FILES+=usr/lib/libkadm5clnt_p.a OLD_FILES+=usr/lib/libkadm5srv.a From nobody Mon Jul 7 23:04:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbfvl0G30z61TBf; Mon, 07 Jul 2025 23:04:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.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 4bbfvk37X2z3qcs; Mon, 07 Jul 2025 23:04:50 +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 YtJluh7YS5MqyYutFuUB73; Mon, 07 Jul 2025 23:04:49 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id YutDulGRiJhBPYutEuL8Ux; Mon, 07 Jul 2025 23:04:49 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=686c5291 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=S-1b6JwnAAAA:8 a=YxBL1-UpAAAA:8 a=fEelrhWR8ugnEJ3nHZQA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=jHPkhvgQCurpnRnmkKlz:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 0861F32B; Mon, 07 Jul 2025 16:04:47 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id F279E3A1; Mon, 07 Jul 2025 16:04:46 -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: "Herbert J. Skuhra" cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> Comments: In-reply-to "Herbert J. Skuhra" message dated "Mon, 07 Jul 2025 22:36:35 +0200." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 07 Jul 2025 16:04:46 -0700 Message-Id: <20250707230446.F279E3A1@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBooDeVQXMPilIRIdo8LdC0uYHMHFzyBufUaRgWxFL97VduHWn+yDGMfypafO5dG+xrD0lkLbv6lMsn4dDKEZxhktrkAQDgH1ZGWkXNmHsAqRqu7Cp8Y GG1KLr74na0TZFVDYCh1DqF4P74J6Z4Vy5g8dwJX9kw96X9Gg0kFV8lbHGxjtoHtk6eMkF8T+BMNNQpqqFd3A1DeTIqwm1t2HsCMIv5qP+aQwoMATGuN7UVM VSyt7x8aNYCB5Fay/udy4Q/VmIHgWDgYRfqb+56Xol/BqUZ22I2uGt7r/Pya5t9FfIXu4hgluzpNHAcwnth9oJkI06xYuAr35Arx2BuvV+PVVZIAv2ZuWInF o29auHzKa+A7WVNzcjv1PpYASdgVHw== X-Rspamd-Queue-Id: 4bbfvk37X2z3qcs 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] In message , "Herbert J. Skuhra" writes: > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > Hello! > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a bad > file > > $ ls -la libkadm5clnt > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > Please review: > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > index e377f95f5b6e..be09dd3e210e 100644 > > --- a/krb5/lib/kadm5clnt/Makefile > > +++ b/krb5/lib/kadm5clnt/Makefile > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > afterinstall: > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm5cln > t.so > > > > .include > > This produces a valid symlink that 'make delete-old' wants to > remove again: > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > libkadm5clnt_mit.so.121 > > # make delete-old > >>> Removing old files (only deletes safe to delete libs) > remove /usr/lib/libkadm5clnt.so? Thanks Dima and Herbert for reporting this. It's been fixed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Mon Jul 7 23:18:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCF6jFZz61VPR; Mon, 07 Jul 2025 23:18: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCF5wKNz41Bb; Mon, 07 Jul 2025 23:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/cr8vf+6rEUwrEY4yXQVq9LHAm2a4i6zR1ai7fG1DxU=; b=r/xEhJ5yXzPM46baC3UNQZ5/+U19BRurCpCdzBbKSr1L0BkxvyyOypqxm8LTinbRQYT8IC mCt9UFJrZxINzVpoyMSXYn7zHPEElnLhHnRuy1sDmtW217KrLIj9Ly5r8lcN99cGJ+4Aj4 y6HGfBHEXbDH26TgfHbR1NDON0cHSaXzlgXBOzaXLH3wnNkt8Vv2jGa/OkJ3CQcbhdrn13 SZIV+7QZj0XvR8PJZj8iHw1xq68qZWL/Xb63xaxuKSsoLHUtvb9SRHHYvXte2cHsjFq/8U iLCIJaAs3fURgfIReNTYIN4Im5yQJpr2r0/HhdxdkZ5VrcMqx/3ZbwXNm/LXcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/cr8vf+6rEUwrEY4yXQVq9LHAm2a4i6zR1ai7fG1DxU=; b=yrhlsITv7qqCH4AY5pi9vpbHWAm1EWdSwuoe4spDmhg+AE4oQaIl0OCW2crYQUMiTBjqUN 1lW7hR8o4TcA8G3UKJCQzObPkjb7FEmtA1sPN3fphzwedpxg5UF8Wjpx/TV5uMUkrqM59m r6BlsXQyPEM8yqKy53NDwfKX7kc3ryep8KHJBqE2cJIXj/smj+AiVprliQJpYjqkQXxUJH uoc1h0A59klyOeVp2lnJDwMkmRjtAI//5sCKUJT7Vi3kM00MLYcaKzj8sXHUlisd5tbeu3 oi5dMz59fnWkg4iLDicjx24+WE9RADa/vMyf5YVBDVwYE61zXCd1ei5lAbpLnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930297; a=rsa-sha256; cv=none; b=nktLfk0inzv8NLmqwD/eZ0vwkBa/ODRCWtW2yN9w05CltMZZ/y1n5nyewiyJAZC1O09ORW KMJlUzOBFH+CvkmJEMIw0vTQCvvRSpxMjJ/sdCJtrUfm8uq5RIen9QPCtg+dB1zOIMjDJC RzKmYs1CfF2S8ynfp6pKrP5Nc7roJsZmeA0MxjwvH0FJU/C17o4IDKY6C9hGarV/eHJZG1 eDcxX9Vwj9Py5SXufWYWasFFYRuylb4vVQ4MUoIEcbXnmPTM0znmXA80WCK08rDyY9rZU1 jh8xLXclrqEZtx8hJfv/UZX1VsaQwSySycM0v2d8fPgPG4M7PjsfpIie3IrIJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCF5D3rz19sd; Mon, 07 Jul 2025 23:18: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 567NIHcR045585; Mon, 7 Jul 2025 23:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIHWS045582; Mon, 7 Jul 2025 23:18:17 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:17 GMT Message-Id: <202507072318.567NIHWS045582@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: 5ac5ebfa7533 - main - cam/scsi: Use xpt_path_inq() instead of hand-rolled expansion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 commit 5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 Author: Warner Losh AuthorDate: 2025-07-07 20:04:24 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/scsi: Use xpt_path_inq() instead of hand-rolled expansion Use xpt_path_inq() for all XPT_PATH_INQ requests. They all should be CAM_PRIORITY_NONE since XPT_PATH_INQ is an unqueued command, so the minor changes here from _NORMAL to _NONE don't matter. And the one place we preseve the priority doesn't matter either: It's an allocated CCB, true, but it only ever stores the CPI from XPT_PATH_INQ. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51121 --- sys/cam/scsi/scsi_xpt.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 439dd2050a95..175716ca6a67 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1945,10 +1945,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) xpt_done(request_ccb); return; } - xpt_setup_ccb(&work_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - work_ccb->ccb_h.func_code = XPT_PATH_INQ; - xpt_action(work_ccb); + xpt_path_inq(&work_ccb->cpi, request_ccb->ccb_h.path); if (work_ccb->ccb_h.status != CAM_REQ_CMP) { request_ccb->ccb_h.status = work_ccb->ccb_h.status; xpt_free_ccb(work_ccb); @@ -2294,10 +2291,7 @@ scsi_scan_lun(struct cam_periph *periph, struct cam_path *path, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("scsi_scan_lun\n")); - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status != CAM_REQ_CMP) { if (request_ccb != NULL) { @@ -2421,10 +2415,7 @@ scsi_devise_transport(struct cam_path *path) struct scsi_inquiry_data *inq_buf; /* Get transport information from the SIM */ - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); inq_buf = NULL; if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) @@ -2732,10 +2723,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path inq_data = &device->inq_data; scsi = &cts->proto_specific.scsi; - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* SCSI specific sanity checking */ if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0 @@ -3046,10 +3034,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int *speed, u_int *freq, stru return; /* Ask the SIM for its base transfer speed */ - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* Report connection speed */ *speed = cpi.base_transfer_speed; From nobody Mon Jul 7 23:18:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCH23Wvz61VMX; Mon, 07 Jul 2025 23:18: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCG65kkz41Bd; Mon, 07 Jul 2025 23:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3aPPtUXBN5wwrkaA8Ef+19UKK1Wtfni1BUuIV+NtRk=; b=t3izSVrA5xfFK6Nsee0OkugNUvkE9fdXvqCk7DHGZeqGu0rcnmWztf6613wPmSWUinvMM6 0sm6ce5jV1FKimoRZjWtySfcTyZvXIjm250ozbbHSnXBlN/mMkjYy+FGfaez6VXgIBMfG0 XgjnULWE1TcfXgzXBlNCsV2BCXTF/4M6MkgeS+nQQKnvqquvg/jn1HNfGgBdNG9kEFjj4h TGzdEe2L8YMpatLze5PSU/GvLtGa20Ew25enDUX1ooDGgtgD4GDfRgpMv9q7fzILst1rEp GhfG9a5OGv1s1UsjIgAhUh7NV+IVQg0mnjnq4k8TTOoQ68vbhUc8i5QuNSEiEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3aPPtUXBN5wwrkaA8Ef+19UKK1Wtfni1BUuIV+NtRk=; b=HfgmNIjc9tiIoIWlm7aI8UatrDNxDirmL6XeURIEbsPHgeQTCvkDeXiu8IJ6pT72ny8HHF 2Mg5tjwwm++bbqo3kkMbRv38Xu4Y6YTuH10Aof+OYyJj0QB0Q76d8a+K9EmyflCpFA4dR9 zJu4qm6tnsICAlvY/CwdHnJa6r9OtYfa9i8z4xS7ykTp/TziTnWDilo8PSi0mX5xJ8D71N NuIoJt8D8ioMTK8yK9q87jCZ45LBqccZvgNno99WX2vcCEIEUdCcWHCkR2RhBaK158fdp+ 1a2cFo5UJcULc93jzeADTRl4UTLQLUZtk3v8dxvTuXnKcqKoVvrw8GA1omNdPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930298; a=rsa-sha256; cv=none; b=xXeOqDth1/VTU5UTIlfvf1QSVevtHdFMg/NwrsnTqSPaWKu2PvRPcUkw4j+ioxYR+7j+8A efb4cDkskePzghtVQS6XW2KRaTYLmqzOlvo2hRjmcP9fBBQ9tM02mRiGP1etoNSI+13yqB gfhFLPDYqQUfln1ESJuBsT0u+cgjrDmUlmNiIU0ppR2IcuESFJi9NjPrx2Z7ohAKdt5UVq 8J7qGozDW6uF7SwvjYGSn3Ka6cAGn5y7N1yT3qzXjXGEc9Alv6jJUUAl5fMD+ijMDWtZiW vlgFrpI5ZDI42imnWoI0qP00gyTF6naoHnJK5+jnvhhCI9jb6izddqgfBixfag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCG5YLcz19m5; Mon, 07 Jul 2025 23:18: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 567NIISD045618; Mon, 7 Jul 2025 23:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIIML045615; Mon, 7 Jul 2025 23:18:18 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:18 GMT Message-Id: <202507072318.567NIIML045615@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: 034b3515ea27 - main - cam/xpt: improve comment on xpt_path_inq List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 034b3515ea274b144eb514e83b2e10be0e5b71a9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=034b3515ea274b144eb514e83b2e10be0e5b71a9 commit 034b3515ea274b144eb514e83b2e10be0e5b71a9 Author: Warner Losh AuthorDate: 2025-07-07 20:04:33 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/xpt: improve comment on xpt_path_inq Fix a comment about bzero maybe unnecessary. It can sometimes be redunant, but a common usage pattern puts the ccb_pathinq structure on the stack since it's small and for that scenario, it's required. It's reundant for the few places the ccb is allocated, and in those cases it does no harm. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51166 --- sys/cam/cam_xpt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 06ef52580120..fa4bee97b8f7 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -145,8 +145,8 @@ uint32_t xpt_poll_setup(union ccb *start_ccb); void xpt_sim_poll(struct cam_sim *sim); /* - * Perform a path inquiry at the request priority. The bzero may be - * unnecessary. + * Perform a path inquiry at the request priority. bzero may be redundant for + * allocated CCBs, but for the on-stack CCBs it's required. */ static inline void xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) From nobody Mon Jul 7 23:18:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCJ38Fzz61VPX; Mon, 07 Jul 2025 23:18: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCH6vryz41MC; Mon, 07 Jul 2025 23:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFQnZXbCTdDLokdaTMwoqsQf5uTN1dCM96u0KJjDMpw=; b=ROhJTWSgMxqtEHZlOUqo/w0xQy0bsUt75dNww7LZB1sKTC7zKIyxd8p2uBVqqzCPFlsjpX Z+sCvvd9UXNWuvN//t8HuKnY312hWs1aVt8WhNeOIpA+lydr0TbNANDco0DUM+57WJNe3F cRVUtInbuXWvmn1X+xl5G883TfI/rwINnhSrIAEL/LIWCgRc8z1g/fSNRQhpMqTuYmm7ki yNCholiZekn+vTZHVtRjnF456Cb3i/4KrwUPgCUKFxGIL57d8ZP8QDvPbjI+vjDTM2LJko QtsbhKplPCNHG/SDfzdVmZ/cj/o4ZovDgXvmdJ6WS2VuOQM4EJhdKqGsPQjAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFQnZXbCTdDLokdaTMwoqsQf5uTN1dCM96u0KJjDMpw=; b=bTUPigR/nvXpeQKGWKjy7lL1ZOOTJ4wQGxzFYEsvN6tvjzK1A3fdu9uvCYuXZi2yAiK6Xo 9o40iDzDLzfwOgL0WVP+gd+47WYabKy8W07yZJTTbRVzUrqnnkX016etgo39SyJhORU6kQ FedTSuX2l+OFhNNFULN2nU/+dxs+/zMzW+WRz3KFxXnThfPmjdu7FOiO5JlRGA+/9k6LyH mo4rin1sGuN/ix662bGmlpc3SexEbQr6AlUjwjnNN1KRF0sHOle7kCxSr5z3rpIhEvZdXp om5NVok2+hsadQTOWRhncQ0NE0l7iOj4XR38vowOdAsnJi/gPCVaErRGDID18A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930300; a=rsa-sha256; cv=none; b=exWfNJhDIqh4j8mxuWg8zgsDo/gIBgYtMwpBTlOJC3FBve4xudnIJgtjW3w24Y4eadbt+Y 2sjuKEtZfw8Cv2CIG0suElWkvPq9bMewNJv09WdHi7TerVwCCggKiROT+yCvuplWPe/DNR Qepaall3+VqVHV5adFMA6DHm+EQVvcMagxah4we+2Mvvw70CgU+j5hQskQPqkr3tmEar0V vklBToNdwW4+2JodzcrdU6AdATeO2uz+OKzRXSAkCdrT8nkrE2Rysjdm4a+W1exsNgJBJC SDUUcWrRqN9qsG/iRHWZkQnbFLk6sUkmk17C4dPfi0c9MuG6jWGO9rql/r1ALg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCH6MQZz19fN; Mon, 07 Jul 2025 23:18: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 567NIJqH045653; Mon, 7 Jul 2025 23:18:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIJXe045650; Mon, 7 Jul 2025 23:18:19 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:19 GMT Message-Id: <202507072318.567NIJXe045650@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: c6dc5d367681 - main - xpt_path_inq: Use CAM_PRIORITY_NONE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c6dc5d3676810d091fbdc26f3217af619d720fc2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c6dc5d3676810d091fbdc26f3217af619d720fc2 commit c6dc5d3676810d091fbdc26f3217af619d720fc2 Author: Warner Losh AuthorDate: 2025-07-07 20:04:42 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 xpt_path_inq: Use CAM_PRIORITY_NONE XPT_PATH_INQ is not a queued request. Therefore, the priority information is not relevant, and so should be marked with CAM_PRIORITY_NONE. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51167 --- sys/cam/cam_xpt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index fa4bee97b8f7..57225a0ae92d 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -153,7 +153,7 @@ xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) { bzero(cpi, sizeof(*cpi)); - xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NONE); cpi->ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)cpi); } From nobody Mon Jul 7 23:18:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCL4YThz61VVW; Mon, 07 Jul 2025 23:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCK4Rt5z41VN; Mon, 07 Jul 2025 23:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5snfnYVx8mMTgIHe2Uw1NvSDf5rBhoCF9gpTDqcplaw=; b=WxrzRblZOEdxJvJeDsVv5SNVhWfgfHr3d+CKXYcMrmT5cAwy7fgOkJ5GxPQKvbwSxf9C5R sluov9LXcKb0nXFTo7NmRdpk+QmsQfLbGyq2vh1Etviz/ghe3Xy5poZkmXgnSXsAhM8hmN tw9u67TP1GFt1YGGSrIvzUaOeE4x3tlod9jXG8eywU9u7H5sPrO0SbFtlZ8Qrm6xQzmOpd PN48L0vBI4LSiRpTY6x6XZURBUA2EwcCsR3IwFN2OqT+qfN45mFYsQgzAto1qddKXP2FvP Dh7rbjdqmGiwkLQdXTJEgOFu+GV5KJaPHrdELBJgCdn2+8F6GoF8ui+lIO+rQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5snfnYVx8mMTgIHe2Uw1NvSDf5rBhoCF9gpTDqcplaw=; b=gCGUDsZil6UT9kVRoJfaxGOM6yTvHpVb1/lmOx9BXAyB8gIvOBzMelo0IbDlPlt0YiKfHz HYY3RhozRlJVOOkBYgO2lCWFlozFZMzIONaErjaLUiEsnZVtLMN603Xb+ZtFvGrwR6EJ8K bI7VktSAzfT8UUdgKmoYyvqsP0Xxd7BYC3y33Ft9+K+1IIq6W/dk3aNr2p71GAvbKY0G3E Mk/rAtAjY098rV66spAaU2H3ttp5tWRj447uYRHsqMOYh6xL+04MTKLca+z5WuMLyxxztv h1msGQ0UwtfZ0UU50qTPnd57lapmc3A2hqQ4gaZ1S71JIJLBxmI1zWpBV3whrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930301; a=rsa-sha256; cv=none; b=BScOgaJvuB0pGd4qJxP0GopT/y7k3If78u5g7b6TpyEtw5HeiwkyxfkpZjKv7SzHa9m4zF giFaQUr8xEHagIuQ9dbeqHTfPNmWu/V4q2X+5fKqqwflh6NfEVFc/Zt9Hxq0XEC3yViI2O 36VRrEvqyMHWS1K1q6iHG+r1lAB9//LL8l7DbojgHBWZcCBa6/0klH0nluhLNc6RhlR6tX d6DWh70l/ytkr4KJzH1OtCW+gdCx3xVuDh93Fey6qQ59yujJ2LqwiWpZM9SmZco7EmWU9Z pEHsRfWC7lnMOh2KN89yRAiQQE7IgoaYYMrx05POzT7S6PpxnqGr/tbEeN2ppQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCJ73ZTz19pR; Mon, 07 Jul 2025 23:18: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 567NIK0W045686; Mon, 7 Jul 2025 23:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIKW3045683; Mon, 7 Jul 2025 23:18:20 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:20 GMT Message-Id: <202507072318.567NIKW3045683@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: a2056e854957 - main - cam/mmc: Use xpt_path_inq instead of hand-rollded equivalent List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: a2056e854957dce7f8a4c1feb7d0220be9697385 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2056e854957dce7f8a4c1feb7d0220be9697385 commit a2056e854957dce7f8a4c1feb7d0220be9697385 Author: Warner Losh AuthorDate: 2025-07-07 20:04:51 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/mmc: Use xpt_path_inq instead of hand-rollded equivalent There's no reason to inline xpt_path_inq here. While there was a mismatch between this use (CAM_PRIORITY_NONE) and the old xpt_path_inq code (which used CAM_PRIORITY_NORMAL), xpt_path_inq has been corrected to use _NONE since this is a non-queued command. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51168 --- sys/cam/mmc/mmc_da.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 9246f95a080e..3815561898bd 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1523,10 +1523,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, bioq_init(&part->bio_queue); - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); /* * Register this media as a disk From nobody Mon Jul 7 23:18:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCM4Ksyz61VL6; Mon, 07 Jul 2025 23:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCL1rgKz41DL; Mon, 07 Jul 2025 23:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LeFCyzXP1XLkOb1eee9Q+59tgjoTJLOdwnxCvWnEsN8=; b=lm8EunjZHQXcToZ9psBrZKBK9AW1YDY25XzTgkdo42QoOUOjEy627RDEBH4u7JCGYvkOU1 uiEAIn/XlXAYhxxp+I0SinJscwjb5J1ExwYnBGmIBIR42ggEgjeM7tS/Hp16AIcmOBwNOO kcLn9tLfyw1Cuaw4Alcl+BOLG5c3YZCo3uPd1RskHN+9Wpp2MYNIC7tiw+S1sltzrQSdcQ rNO7U3FYp+yHXsNxdYbbfr91Ck3OXAQrbjC6a4wUI/VDvpR7PPBqKZHrHrHpMYcDZ1As2p L27rBVYmaTK4loC7UzdCFbDRg/qAJr3RSOH1RGKKQ188kSGAR0ji59RdlRBUCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LeFCyzXP1XLkOb1eee9Q+59tgjoTJLOdwnxCvWnEsN8=; b=P+u8e/9LXfStBReBflclCsXBhqSnlDdZXsDJb1wZOEC+f3Vl9TsCvpP/9Q+cD9l96vs0Gz +njKWZe15OEV3bNLKpVT6+RxVKqq3bUisSUga7ok/VqVjyFwKfmjNNIqW6hXnMURFYZMZU 1D4svuNJwFJuX3K483vehagMiECe4cH4HF/XFD0m4Gbo9rfotKmZ9HyCFO5+t1bIpB+yGn mX1OMYY6kl4pZGNPtLOZnU6Kse6cuTqRU7+d2GicAnlvyoFjL6NLrhq1izi4T4maQIMTyw YouWjj3xeAGXispPs0DTBekiFe/c+3CjCx4+36WHCk5vSrRsMhNV1u49SLYJeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930302; a=rsa-sha256; cv=none; b=o86cGhuFKOM6ZhN4LEBcpNP8wzWEz6SnGwwCBu2oJIAEKl9V1Kg4sjlJ1bsajQdM3xhB+P 1oCUgSl7QOveFDxIWapXZwil+lQ+NPbqE8I543/SJMPXYTQQO2u+10945uaQEK+SUZ82ol 4uT5SkgpYrtl1foGBx7KwaNb3wAsnWR7+g/zxKklkEsOsNrT1RiyvV8Hl3DyXewsISv8oT VG8Vg5V4JbxZHc6xznDpX9m51D9W8teuKmF9MIVty5bvOL/uJIdiiz/BdKkVkyK11VBuie rpMLx17je3m9UqGHx0VzFZ1s7yhZU8nd+pR9MMLQ4jEAvW5O2mdAYFsH5G5ECA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCL18S4z19pS; Mon, 07 Jul 2025 23:18: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 567NIM14045719; Mon, 7 Jul 2025 23:18:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIMmv045716; Mon, 7 Jul 2025 23:18:22 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:22 GMT Message-Id: <202507072318.567NIMmv045716@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: 3b3591d3e1ac - main - cam: In scsi_scan_bus, fix an error case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3b3591d3e1ac6423570201da0b23ab3d087816a9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b3591d3e1ac6423570201da0b23ab3d087816a9 commit 3b3591d3e1ac6423570201da0b23ab3d087816a9 Author: Warner Losh AuthorDate: 2025-07-07 20:05:02 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam: In scsi_scan_bus, fix an error case If we can't allocate the new path when loopoing over the target range, then we have to free the scan_info->cpi CCB, not the work_ccb. This was accidentally correct for the first iteration (because work_ccb == scan_info->cpi), but incorrect after that since we'll be freeing the CCB for XPT_SCAN_LUN for the prior LUN we kicked off. Reorder the free so we free it before we free scan_info so the pointer is still valid. I do not have a test case for this since it requires that we fail in the second or later iteration of the loop due to low memory, and only fuzzing would catch that. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51169 --- sys/cam/scsi/scsi_xpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 175716ca6a67..2506a9fba799 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2034,9 +2034,9 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) printf( "scsi_scan_bus: xpt_create_path failed with status %#x, bus scan halted\n", status); + xpt_free_ccb((union ccb *)scan_info->cpi); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = status; - xpt_free_ccb(work_ccb); xpt_done(request_ccb); break; } From nobody Mon Jul 7 23:18:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCN27MZz61VDy; Mon, 07 Jul 2025 23:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCM2qtJz41KR; Mon, 07 Jul 2025 23:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yPzzeUzw4qFF0qMDDwFBAm1cmxb4gVTfBYJE347W7cU=; b=CIuiBVlLooFHSkDwwfZ8IhSGm2Djmpjf/RJjrUCEiNuUV1DcU9hcV/Ej8Nx1//HDCZIbhE ZHsKAKDQPbjZyfXhZ9+SsRUiZQUqpAK7f2+KjQKE14Ff6VD4yy7asxbBM7OEVFu3ErirkH GK4aJlGpsXlr5hBdQoCBoJo8IPLXvLQWw430GxRkRXWRK1PUtssrLMShZe3ogpuIBFy09U 31xmehVyTNUosxAL7Gc6KhP/al5BVddjVOXDGPPvmd9fvfIDUaCJUsJB6TiVcKwxzKXdek EAyaiWgHUbxN79DLHHURD+bA8LvdwJORxDa0WvafhIb3hCoo6/mX5hg6dlT2QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yPzzeUzw4qFF0qMDDwFBAm1cmxb4gVTfBYJE347W7cU=; b=MY8X4tmCoOStEyQy917hMecWBGHbh7z7SEYJGGfBY806peDOMXPiRLgOIHOZAuhFulWf85 tg5+NVXQMSSaUt18OYgWtw4XtF0Az4XA8uowL3JBwuR8KJt9z22cmWFcvcGSGNjgTvHcim RwhEdlnplEKBlsTxBtjVfDLwRQatQrW92+UExeqKDnlG454zsMTV1CpNZFagYrEaKdD7uB eTIcIxcuJXxt/VjTVMwRZ8rvyT98B4oSYiGZZITzn3B/df6AGroVExYaaBGqy+YkITMDlP BXUL50D2kr90ngOtaBVZaNR/m5JFcVAUlpICg+6Zf1sdABLxb+PGhNxqGKxarA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930303; a=rsa-sha256; cv=none; b=iepS4Z8xHlnKdIlG5GMnRmykyrn832NC5wav85jZv/1vvtb+nqN2BwSUF35kvMrKsASnqN G+xFoHKKKWniMUw7Mg7dVQXN6C/Wk6thP2JUINz3VdBtc2xj4EC/UGchnJ4p60iOmiDISz gOPuL8GawzXzdlnWJdyDOVYjHQvt6RZHLXuyvuYr3Gh2COgK8jg4284qsx6KGuyLSwt5w3 RauOUYhRM6DHdxaNjpSwgU2N/ZlVv60ISmOO7c3Ky0P549a8HpVK3oWzwtVsI6nowGO+Qy UYrSjIRrZiI4f8g8Q1UHkQafMErAG2hZZwTWQ0tbiMcE1fRVvr//SX9sLPMLdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCM1kx2z19sf; Mon, 07 Jul 2025 23:18: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 567NINrp045760; Mon, 7 Jul 2025 23:18:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NINWt045757; Mon, 7 Jul 2025 23:18:23 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:23 GMT Message-Id: <202507072318.567NINWt045757@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: 5102c5f11342 - main - cam: Create free_scan_info helper function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5102c5f1134281aadea878a61cfe4967cab0eb9e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5102c5f1134281aadea878a61cfe4967cab0eb9e commit 5102c5f1134281aadea878a61cfe4967cab0eb9e Author: Warner Losh AuthorDate: 2025-07-07 20:05:10 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam: Create free_scan_info helper function We free the scsi bug scan info in 4 places. 1 was wrong until I fixed a bug there in a recent commit. Introduce a helper function that will free the cpi always (it must always be valid since we set it right after allocation). Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51170 --- sys/cam/scsi/scsi_xpt.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 2506a9fba799..1dd149b00a87 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1915,6 +1915,15 @@ typedef struct { int lunindex[0]; } scsi_scan_bus_info; +static void +free_scan_info(scsi_scan_bus_info *scan_info) +{ + KASSERT(scan_info->cpi != NULL, + ("scan_info (%p) missing its ccb_pathinq CCB\n", scan_info)); + xpt_free_ccb((union ccb *)scan_info->cpi); + free(scan_info, M_CAMXPT); +} + /* * To start a scan, request_ccb is an XPT_SCAN_BUS ccb. * As the scan progresses, scsi_scan_bus is used as the @@ -2034,16 +2043,14 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) printf( "scsi_scan_bus: xpt_create_path failed with status %#x, bus scan halted\n", status); - xpt_free_ccb((union ccb *)scan_info->cpi); - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); request_ccb->ccb_h.status = status; xpt_done(request_ccb); break; } work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { - xpt_free_ccb((union ccb *)scan_info->cpi); - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(request_ccb); @@ -2205,12 +2212,11 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) if (done) { mtx_unlock(mtx); xpt_free_ccb(request_ccb); - xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("SCAN done for %p\n", scan_info)); - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); break; @@ -2230,9 +2236,8 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) "scsi_scan_bus: xpt_create_path failed with status %#x, bus scan halted\n", status); xpt_free_ccb(request_ccb); - xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); request_ccb->ccb_h.status = status; xpt_done(request_ccb); break; From nobody Mon Jul 7 23:18:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbgCQ1fBvz61V8Z; Mon, 07 Jul 2025 23:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCN3Wbvz41Vw; Mon, 07 Jul 2025 23:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cboze8yx5UiCuAVFTWv7urE8uAbkt/+SiFKLflu7KXU=; b=Z0RFKXXJnYGINB5alnpg4Vs/U8XyVvFisyVcz83R4wAcm4Fb9XcCe6FUqYbyEvVeZP4eQP Qt/qMs7DjZcTOkK4WLE1ziv0LDqWg7wxvv/feudAa1C+CpaKggn5dnc7cZ3IrTSIP3Z3tb B/ntjIQBRoSxxwXqr6fyJI7dJJLPM2nhkjYYB36dlbl90kfNkbsQ1xPjaI+vXs+V4EUKNp jQtDwE0ahz6ML1gPI7iJmoPzhXI5MboFi+FMi9ghLyyupzqUPBgvk7h3+QngQgCFXJ0TLP Pv+ke6SbxTTGzLe42TwX7jlvOEEPChYdIVwjRrtatv/FGX7jeiNbh/JhuD6+GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cboze8yx5UiCuAVFTWv7urE8uAbkt/+SiFKLflu7KXU=; b=OI3VdqcSGqnTc42Qra4oZ5paQJghNEVox+jeknqLNTW7Wgr540ZhZ+3Ec7u/WxIfGtQu/7 4zTst/9k+tQarlsO3JFhGTSHCQOpd8T7kizc90fKgE5bASoQO+Z+UiNNrTTBf9haIo3MEk fIOFN1frFmkhhcv5SI78yozGhFoC0i2MOawVN1ceEYWY2D/wFzd56osKLCfzCsy3Gv9PGn ZBjglUM8hSZMpJM9Cxpowveo0EN445/70zVhfNzQxVmz+EO1l9aeN5SIYUEckOqrApgDlh +aiM0lsBjvbPWnHOvRSSAVE692hTWSqgxdy46vQeXqbYScNLhjbja1+l8cZgQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930304; a=rsa-sha256; cv=none; b=TAgralYAAw2S0cs4NFJQEnfELy6aMl7/vVL011IxX8c8vyeYr4pKphUw95DvvD4yYRMRVt j54bkVJKSOxp1RNnci4Uw7s4FdHAvc6TSjs2xX+07hviDvpbrQctRB3LB8jqYR4sZ25Lk3 GcUAjrs2qcEZ0+IDsABPTF12cIhckzlsBDlVo/gVhuwhNLKGsJ16ubwF7dhVqaWWU6E/yw e2wW0J5aFHCND+NH8JJAv9lmnYm5xt8sSIWvScpuDy3qxiKSVP23s6QtkEu4vK95+SdwoE LiAGprJbKTQDv+HIGtYsETzwozt9fpf2BLK/6HLLMVReBQ6yiiFg67P4mtcVig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbgCN2y9Mz19YG; Mon, 07 Jul 2025 23:18: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 567NIOVL045794; Mon, 7 Jul 2025 23:18:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIOHF045791; Mon, 7 Jul 2025 23:18:24 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:24 GMT Message-Id: <202507072318.567NIOHF045791@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: 7462eb81cd5b - main - cam: Use bool for done List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 7462eb81cd5b2ba6b42e13f49c777a474edea308 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7462eb81cd5b2ba6b42e13f49c777a474edea308 commit 7462eb81cd5b2ba6b42e13f49c777a474edea308 Author: Warner Losh AuthorDate: 2025-07-07 20:05:16 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:01 +0000 cam: Use bool for done 'done' is a bool, so declare it like one. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51171 --- sys/cam/scsi/scsi_xpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 1dd149b00a87..bef35243af98 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2183,16 +2183,16 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) * Check to see if we scan any further luns. */ if (next_target) { - int done; + bool done; /* * Free the current request path- we're done with it. */ xpt_free_path(oldpath); hop_again: - done = 0; + done = false; if (scan_info->request_ccb->ccb_h.func_code == XPT_SCAN_TGT) { - done = 1; + done = true; } else if (scan_info->cpi->hba_misc & PIM_SEQSCAN) { scan_info->counter++; if (scan_info->counter == @@ -2201,12 +2201,12 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) } if (scan_info->counter >= scan_info->cpi->max_target+1) { - done = 1; + done = true; } } else { scan_info->counter--; if (scan_info->counter == 0) { - done = 1; + done = true; } } if (done) { From nobody Mon Jul 7 23:58:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbh5p6gF4z60txR; Mon, 07 Jul 2025 23:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbh5p3X59z4Q8S; Mon, 07 Jul 2025 23:58:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4UHNPraJXQAf90dVR86wVnV/USUYnAlyIcRaRWjuOo=; b=yKfDMGy8hB3f2LRilg10SRECrcI28CrGjNbJqfXW3NlZPiYsHGxxrkconRUIZmNWu2z3/U hJL9Ozld7xA0SmAazV+o+XyR7MXunpqhWPpuNAwNlLTWg499emtD8JEJ95+y1QeByUKtCG UFvMHY16KLekNPenAKNyYgLMXhz55YGCPwLHowlx4cnj9bbiaUo3Gn30pWaEDWdlBAi9E2 reoUdVewcSFg6MXWaIHhanVJRgDtMPR3wM1iVe4nESEy12AB0fy4UQlu0Peh6XqVlFdOXF M6v8jhEj6lN4s4TwLNgG1sKR/NQDhY8p4fhoV/Tr6jErTzt3QZ5rz7Us+seR7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4UHNPraJXQAf90dVR86wVnV/USUYnAlyIcRaRWjuOo=; b=Ng+yqpFuTzISZwXHFX2KgXfVeytOpml3G1ZeaFTRskc42mueK6Bfbo4jM0vPVFx9IBzW3a stJdGVEurD7X8b+hWHxRWp7vH4VNScf4pttZo+5LxkRXyBNYmH9gSiHS+nHVcqcWO5daMC kRmY6VaQ+CubffzPr4CjOikx65Mw+AZ/hv41sCiJkx7bqyhManswaxeMVYbeRJx7BJrgc4 KM4Pf/9fXs2U62GoMFHEZh0wQiYGVeCDetMG0BzYctZJBnfouZS3j0xrlQccWRr2kQ1tht YfM98r4KC6c1MfxFVvjHLeZTQ5F3FXiJiOWLDvP9xNeoTPs5iQyVXbPMLYq6Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751932718; a=rsa-sha256; cv=none; b=H6Ru2KDh/nvluvq+95+ID+yQotC989biRZPG9kx3s3zqF4MaOVWYHcsnhDkBNJPkblRDUo QhpSfCUJYpUrHoFJ3KkgLPdk5dLOf9OSZEG9tgvZF3syh0WnW6WlthcfUVjOzMASzHGjY4 zdGDD/U245sjpvWAQ34cGrkTWIIvoIW0TVi64JCZrltsrKj1FfBRaKQCOhGRd0L7ZMsGYF IZnh8vaBR0NN3I8VHym+JH72+ROuxG3TdxVBspWoZX2G65U4T4mY00F/MWYxro7+ZrYAoT mteFAYI1Ry9IFdUve3sR3cst9qKM3mnLEM0+vgRl77SJ5HIGjHkeo/I6IeFv5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbh5p2dbFz1BjR; Mon, 07 Jul 2025 23:58: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 567Nwc3S019953; Mon, 7 Jul 2025 23:58:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NwcLM019950; Mon, 7 Jul 2025 23:58:38 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:58:38 GMT Message-Id: <202507072358.567NwcLM019950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ac2e39b5ddf5 - main - ipfilter: End (cleanup) the iterative search key List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ac2e39b5ddf5d5c6bc3848e392670a00e5834450 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2e39b5ddf5d5c6bc3848e392670a00e5834450 commit ac2e39b5ddf5d5c6bc3848e392670a00e5834450 Author: Cy Schubert AuthorDate: 2025-07-07 23:37:07 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:37:07 +0000 ipfilter: End (cleanup) the iterative search key This results in not finding nodes in subsequent hash table listings. MFC after: 3 days --- sbin/ipf/libipf/printhash_live.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/ipf/libipf/printhash_live.c b/sbin/ipf/libipf/printhash_live.c index 3caaa5e022fe..b8ee31b27597 100644 --- a/sbin/ipf/libipf/printhash_live.c +++ b/sbin/ipf/libipf/printhash_live.c @@ -61,5 +61,8 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) if ((opts & OPT_DEBUG) == 0) PRINTF(" };\n"); + + (void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key); + return (hp->iph_next); } From nobody Mon Jul 7 23:58:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbh5r5lg1z60vGh; Mon, 07 Jul 2025 23:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbh5r4MX8z4QKc; Mon, 07 Jul 2025 23:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEdoo7UjNVqhhTHy0Nq+W5TJmpY9expO6nB4ZiHCO6U=; b=i4NLGGexdXBB5iPdSZHdhaG2vc1FfxJJxHI8nFESBkt3y1zxGNs9sctcgsDXaFBzzGfGe2 YjMwITnGhNg8eyCgifGqmPvZCzzBfBCsWzqIm7wpZeunzV4CRVMWQFczk58A7Oxmh4aj9Z ZE35KY9CFCEhgYep6M5g4zqHEfi8lfiCp1ozRIj+7bWNniyKnge02qHD2GF/WFneF/Ks7e /e3Gfg/CmY96pSf1vVteDuNsNsFaD4JxvNJy1Ed0GHBq+KvY+zqT4XiumPwlwqIMJI+N77 1ADHIYgtEfebos7tXEa56S8U3CtbEFtLf/ABU2+mhRfWafu4VDJyvHynKvO3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEdoo7UjNVqhhTHy0Nq+W5TJmpY9expO6nB4ZiHCO6U=; b=ZNCWl8S3nwIycDnXmE859Y54euvftXtYzdOz6ah5hMqSciL56+yyDRJ7C/yA2zo1OwpIFJ QQ+wSF2PfHPd2aYXgfa8qcRd1RDFtBBh8KuUHSJLkp4UonG5JDjlNGDuo66QVE9i37Jfjv PRn+//KVEILOCBPVZ67MV6PrqrKdHS08HhlU+y97ZA0Y5s/oDjHJpvALxruQp0JF385wYy iMdV3H+JH3a3sqrG9+wMbFn+cC3oPZcXcy9V0j6DRke6RkOApQBxB0EF9UDpUxAVcAaQ2o mEDdWGL/GCsIH+Y5q6ZQQ7y0/+0/+krHIEVnOhpKHZVoLzRX0eEx56TnP4eQwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751932720; a=rsa-sha256; cv=none; b=ylh1gsh3goN3KCI0r1GILd4LXEQ2LIL5r5IfHi8VBeQoqoMzLzpbGx68S9/rvpUNN+oB7Y yaFmki49bgCrdKvX8XXTDNQZRZ0sIl+0VLqz+BY4QsbRhl86ruxpZedswK9GjuVtvi51s7 +i56tlCWmum2sLnUAatR8n/x8J09LYYy26SSUezLq+B9fmarO4c82VwvnX/vYdUSm11w2+ 4gEQ3U4JScyAYWkEbZnNmgqonLhI1W4w55LSijR+zA1YEs1H/BNDkbT9tw1TAtwfcEIN0i zvwXSG4D9LpfvBSEUSjY+DKrahLfg+4m4cSlovnnC1+t3aEV7fIRQUITuGBh9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbh5r3jvBz1BjS; Mon, 07 Jul 2025 23:58: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 567NweAo019991; Mon, 7 Jul 2025 23:58:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NwdpO019989; Mon, 7 Jul 2025 23:58:39 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:58:39 GMT Message-Id: <202507072358.567NwdpO019989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 17f0f75308f2 - main - sqlite3: Vendor import of sqlite3 3.50.2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 17f0f75308f287efea825457364e2a4de2e107d4 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=17f0f75308f287efea825457364e2a4de2e107d4 commit 17f0f75308f287efea825457364e2a4de2e107d4 Merge: ac2e39b5ddf5 89922daaa168 Author: Cy Schubert AuthorDate: 2025-07-07 23:49:17 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:49:17 +0000 sqlite3: Vendor import of sqlite3 3.50.2 Release notes at https://www.sqlite.org/releaselog/3_50_2.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500200.tar.gz MFC after: 1 month Merge commit '89922daaa168292633b1a7a523bcd0559487c6ad' contrib/sqlite3/INSTALL | 370 - contrib/sqlite3/Makefile.am | 19 - contrib/sqlite3/Makefile.in | 1326 +- contrib/sqlite3/Makefile.msc | 50 +- contrib/sqlite3/README.txt | 98 +- contrib/sqlite3/VERSION | 1 + contrib/sqlite3/aclocal.m4 | 10204 -------- contrib/sqlite3/auto.def | 25 + contrib/sqlite3/autosetup/LICENSE | 35 + contrib/sqlite3/autosetup/README.autosetup | 11 + contrib/sqlite3/autosetup/README.md | 453 + contrib/sqlite3/autosetup/autosetup | 2540 ++ .../autosetup-config.guess} | 111 +- .../{config.sub => autosetup/autosetup-config.sub} | 942 +- contrib/sqlite3/autosetup/autosetup-find-tclsh | 16 + contrib/sqlite3/autosetup/autosetup-test-tclsh | 20 + contrib/sqlite3/autosetup/cc-db.tcl | 15 + contrib/sqlite3/autosetup/cc-lib.tcl | 187 + contrib/sqlite3/autosetup/cc-shared.tcl | 113 + contrib/sqlite3/autosetup/cc.tcl | 758 + contrib/sqlite3/autosetup/find_tclconfig.tcl | 24 + contrib/sqlite3/autosetup/jimsh0.c | 24519 +++++++++++++++++++ contrib/sqlite3/autosetup/pkg-config.tcl | 168 + contrib/sqlite3/autosetup/proj.tcl | 2236 ++ contrib/sqlite3/autosetup/sqlite-config.tcl | 2174 ++ contrib/sqlite3/autosetup/system.tcl | 420 + contrib/sqlite3/autosetup/teaish/README.txt | 4 + contrib/sqlite3/autosetup/teaish/core.tcl | 2539 ++ contrib/sqlite3/autosetup/teaish/feature.tcl | 214 + contrib/sqlite3/autosetup/teaish/tester.tcl | 228 + contrib/sqlite3/compile | 348 - contrib/sqlite3/configure | 16891 +------------ contrib/sqlite3/configure.ac | 270 - contrib/sqlite3/depcomp | 791 - contrib/sqlite3/install-sh | 541 - contrib/sqlite3/ltmain.sh | 11251 --------- contrib/sqlite3/missing | 215 - contrib/sqlite3/shell.c | 7696 ++++-- contrib/sqlite3/sqlite3.c | 17725 +++++++++----- contrib/sqlite3/sqlite3.h | 618 +- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3.rc | 2 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/Makefile.in | 1006 +- contrib/sqlite3/tea/README | 36 - contrib/sqlite3/tea/README.txt | 104 + contrib/sqlite3/tea/_teaish.tester.tcl.in | 49 + contrib/sqlite3/tea/aclocal.m4 | 9 - contrib/sqlite3/tea/auto.def | 8 + contrib/sqlite3/tea/configure | 10186 +------- contrib/sqlite3/tea/configure.ac | 227 - contrib/sqlite3/tea/doc/sqlite3.n | 4 +- contrib/sqlite3/tea/generic/tclsqlite3.c | 231 +- contrib/sqlite3/tea/pkgIndex.tcl.in | 40 +- contrib/sqlite3/tea/tclconfig/install-sh | 528 - contrib/sqlite3/tea/tclconfig/tcl.m4 | 4067 --- contrib/sqlite3/tea/teaish.tcl | 565 + contrib/sqlite3/tea/teaish.test.tcl | 14 + contrib/sqlite3/tea/win/makefile.vc | 430 - contrib/sqlite3/tea/win/nmakehlp.c | 815 - contrib/sqlite3/tea/win/rules.vc | 711 - 62 files changed, 56587 insertions(+), 68619 deletions(-) diff --cc contrib/sqlite3/VERSION index 000000000000,18d0478a0414..18d0478a0414 mode 000000,100644..100644 --- a/contrib/sqlite3/VERSION +++ b/contrib/sqlite3/VERSION diff --cc contrib/sqlite3/auto.def index 000000000000,c61d81e506f0..c61d81e506f0 mode 000000,100644..100644 --- a/contrib/sqlite3/auto.def +++ b/contrib/sqlite3/auto.def diff --cc contrib/sqlite3/autosetup/LICENSE index 000000000000,4fe636c9d912..4fe636c9d912 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/LICENSE +++ b/contrib/sqlite3/autosetup/LICENSE diff --cc contrib/sqlite3/autosetup/README.autosetup index 000000000000,395298048038..395298048038 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/README.autosetup +++ b/contrib/sqlite3/autosetup/README.autosetup diff --cc contrib/sqlite3/autosetup/README.md index 000000000000,3301f5739599..3301f5739599 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/README.md +++ b/contrib/sqlite3/autosetup/README.md diff --cc contrib/sqlite3/autosetup/autosetup index 000000000000,239987554ff3..239987554ff3 mode 000000,100755..100755 --- a/contrib/sqlite3/autosetup/autosetup +++ b/contrib/sqlite3/autosetup/autosetup diff --cc contrib/sqlite3/autosetup/autosetup-find-tclsh index 000000000000,9f6d6e9402f4..9f6d6e9402f4 mode 000000,100755..100755 --- a/contrib/sqlite3/autosetup/autosetup-find-tclsh +++ b/contrib/sqlite3/autosetup/autosetup-find-tclsh diff --cc contrib/sqlite3/autosetup/autosetup-test-tclsh index 000000000000,75126d2444b6..75126d2444b6 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/autosetup-test-tclsh +++ b/contrib/sqlite3/autosetup/autosetup-test-tclsh diff --cc contrib/sqlite3/autosetup/cc-db.tcl index 000000000000,12f1aed2c91b..12f1aed2c91b mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc-db.tcl +++ b/contrib/sqlite3/autosetup/cc-db.tcl diff --cc contrib/sqlite3/autosetup/cc-lib.tcl index 000000000000,01a0fb387760..01a0fb387760 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc-lib.tcl +++ b/contrib/sqlite3/autosetup/cc-lib.tcl diff --cc contrib/sqlite3/autosetup/cc-shared.tcl index 000000000000,cbe568018e96..cbe568018e96 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc-shared.tcl +++ b/contrib/sqlite3/autosetup/cc-shared.tcl diff --cc contrib/sqlite3/autosetup/cc.tcl index 000000000000,05c1b1cf4068..05c1b1cf4068 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc.tcl +++ b/contrib/sqlite3/autosetup/cc.tcl diff --cc contrib/sqlite3/autosetup/find_tclconfig.tcl index 000000000000,c3d3df8ec3ab..c3d3df8ec3ab mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/find_tclconfig.tcl +++ b/contrib/sqlite3/autosetup/find_tclconfig.tcl diff --cc contrib/sqlite3/autosetup/jimsh0.c index 000000000000,b035524c9681..b035524c9681 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/jimsh0.c +++ b/contrib/sqlite3/autosetup/jimsh0.c diff --cc contrib/sqlite3/autosetup/pkg-config.tcl index 000000000000,9ce7111f55c1..9ce7111f55c1 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/pkg-config.tcl +++ b/contrib/sqlite3/autosetup/pkg-config.tcl diff --cc contrib/sqlite3/autosetup/proj.tcl index 000000000000,1335567064ee..1335567064ee mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/proj.tcl +++ b/contrib/sqlite3/autosetup/proj.tcl diff --cc contrib/sqlite3/autosetup/sqlite-config.tcl index 000000000000,85fe4143821c..85fe4143821c mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/sqlite-config.tcl +++ b/contrib/sqlite3/autosetup/sqlite-config.tcl diff --cc contrib/sqlite3/autosetup/system.tcl index 000000000000,05d378afdd26..05d378afdd26 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/system.tcl +++ b/contrib/sqlite3/autosetup/system.tcl diff --cc contrib/sqlite3/autosetup/teaish/README.txt index 000000000000,e11519b042bd..e11519b042bd mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/README.txt +++ b/contrib/sqlite3/autosetup/teaish/README.txt diff --cc contrib/sqlite3/autosetup/teaish/core.tcl index 000000000000,09017029d77f..09017029d77f mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/core.tcl +++ b/contrib/sqlite3/autosetup/teaish/core.tcl diff --cc contrib/sqlite3/autosetup/teaish/feature.tcl index 000000000000,6c927d1a77e5..6c927d1a77e5 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/feature.tcl +++ b/contrib/sqlite3/autosetup/teaish/feature.tcl diff --cc contrib/sqlite3/autosetup/teaish/tester.tcl index 000000000000,d8b5f7a0e8c2..d8b5f7a0e8c2 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/tester.tcl +++ b/contrib/sqlite3/autosetup/teaish/tester.tcl diff --cc contrib/sqlite3/tea/README.txt index 000000000000,fb7cb1924854..fb7cb1924854 mode 000000,100644..100644 --- a/contrib/sqlite3/tea/README.txt +++ b/contrib/sqlite3/tea/README.txt diff --cc contrib/sqlite3/tea/_teaish.tester.tcl.in index 000000000000,59d11f0a8f6e..59d11f0a8f6e mode 000000,100644..100644 --- a/contrib/sqlite3/tea/_teaish.tester.tcl.in +++ b/contrib/sqlite3/tea/_teaish.tester.tcl.in diff --cc contrib/sqlite3/tea/auto.def index 000000000000,7170b3d1fe02..7170b3d1fe02 mode 000000,100644..100644 --- a/contrib/sqlite3/tea/auto.def +++ b/contrib/sqlite3/tea/auto.def diff --cc contrib/sqlite3/tea/teaish.tcl index 000000000000,9333495aa3da..9333495aa3da mode 000000,100644..100644 --- a/contrib/sqlite3/tea/teaish.tcl +++ b/contrib/sqlite3/tea/teaish.tcl diff --cc contrib/sqlite3/tea/teaish.test.tcl index 000000000000,b63c9426e395..b63c9426e395 mode 000000,100644..100644 --- a/contrib/sqlite3/tea/teaish.test.tcl +++ b/contrib/sqlite3/tea/teaish.test.tcl From nobody Tue Jul 8 01:18:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbjt53lJ3z6152k; Tue, 08 Jul 2025 01:18:37 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_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 4bbjt46hzJz47Jk; Tue, 08 Jul 2025 01:18:36 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Tue, 8 Jul 2025 03:18:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1751937503; bh=XEbr8OZvAfafMUF1ojyLQazRQxnhbnRTA9BUD/WyIZA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=AjY4XXTmOr3Xp4BOruxsrUwM+857HVJPZblzHeOczo6pM+CV65VWnxlnpqfB4YYwD QPl8mNIsgFoqUDyBNyJWOf6zPK+u0KiTevAtNA/LpbM2d3jHYDTyx0EhcADaix2gAI 3ICiwuVa7c6llrhDi5kwFwRsAtsKz+Bt6lDY6XhStSVACoFLXlfbBp11lMJVtUvz/m BqzxvzwxWsil5sq+SfJqGqxOgCfDHL+beCOuIYt4KtdBXTnUCmNA6SY/xPztZWr2Vq 7iQwuB2/nUMk8NUrYtWig9oLt9r3SHnpkpEyZfA7JS7wiSp8D7tz1fdg6hYh++am3K DwbZUv8EAm/YQ== From: "Herbert J. Skuhra" To: Cy Schubert Cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250707230446.F279E3A1@slippy.cwsent.com> X-Rspamd-Queue-Id: 4bbjt46hzJz47Jk 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:24940, ipnet:94.130.0.0/16, country:DE] On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: > In message , "Herbert J. Skuhra" writes: > > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > > Hello! > > > > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a bad > > file > > > $ ls -la libkadm5clnt > > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > > > > Please review: > > > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > > index e377f95f5b6e..be09dd3e210e 100644 > > > --- a/krb5/lib/kadm5clnt/Makefile > > > +++ b/krb5/lib/kadm5clnt/Makefile > > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > > > afterinstall: > > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm5cln > > t.so > > > > > > .include > > > > This produces a valid symlink that 'make delete-old' wants to > > remove again: > > > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > > libkadm5clnt_mit.so.121 > > > > # make delete-old > > >>> Removing old files (only deletes safe to delete libs) > > remove /usr/lib/libkadm5clnt.so? > > Thanks Dima and Herbert for reporting this. It's been fixed. Cy, I am sorry for not being more precise. Dima's change, which hasn't been commited yet, fixes the real issue of creating a bad symlink. I just wanted to add that his fix also needs removal of usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.inc? From nobody Tue Jul 8 03:04:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbmDB2dVnz61KsR; Tue, 08 Jul 2025 03:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDB19FLz3CFt; Tue, 08 Jul 2025 03:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eic4AsYNh4iPHwk7/gEOsZCR3/sWlJWAumU4ebVT5i4=; b=rlQtb59OXBEUn5S1X0+SjiY8avedgEeKju7gPIjOleTlE+0qbqXoxM4QO3A+z8/LJExdy3 eV3XRSFi2Q7PCcHJd+ZLaVTe3AvF5uRdxs/Jzb2YnBtGhgn5kBsjpth3pdcEevz9NEtOqn npYSaYeEY+XY0YTd4fKC8Io6emB5Dpavy2fq5A2jh6frbNgep8jgSh27h34WojBtC/W+58 SIhpCunLgtIzfgoiLLmf9fAxC9mrQfqRofVhvH8NKD/rBUcsCSE3Inwdi8SVUB03q4cqrR mqI5S9giMhfrn5eOctzmFySYCkA/oVF/tfYXxHNf5J2KRtziFjS6MWNQOEPRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eic4AsYNh4iPHwk7/gEOsZCR3/sWlJWAumU4ebVT5i4=; b=pozEA5HMRYrwF0BrplycCany6d34u7DK3/sOQsATMvY+xvlQEVUSl3fppwafygbqjEhqIa A6q/x1JzNiu4RInHGxlUVA95rAiQbAl1toRxRgrYOYoHCnwn47+0+1J5icRwLOqwaqw3Tr 6r9Jh8ZFfMdBNoQoIias5Y5UcYyRtGLfNR0XnD3/BmMlKI/4rarN93+scNFIfd0vdgL+p0 DytyTh1nwyRGfMuDLox8l5BUp8qTFba3tygVvUTQC+3Xw51i/2AfAGIjL7Ra0E/OTPGnXI AZmJAaeh1u9XXU5olRYcrGFXHvZVg/d5rJi5yO2wz0/AMqM5NDD/bT3hREweCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943866; a=rsa-sha256; cv=none; b=GTC9jMW17Clh6tcZvDgIyxNjotD2Yzj4N82X2UmeqFja+zgFi/Ab1YtYrNiZakLXPPaLBi iGHrLYS9nY1s+meltycLtkc8lPBRUEdUEy4SVLCe5HhhJDDwOXprKOt8zJlvlir+E4Q25N mGpyD/EVN98+z3reUd5T6xUgz+BXNoCRpdBFSVvNwAIWTcZUHJx+eFVVMmx/ZlJHGwscDh ZxaEAzbYJHln9vsSSVjdqRkYurbtX8We4WlN3bPxb+Fdca6zy/qfP/LkCdVCfHfX5P4ywF KtTl1NvICyCWaJM6aXE0nKJvzu3/cAZen1HF11bjR33XZ+Fuj5LT//Um8zBdPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbmDB0jsYz3nt; Tue, 08 Jul 2025 03:04: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 56834QvK078467; Tue, 8 Jul 2025 03:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834Pac078464; Tue, 8 Jul 2025 03:04:25 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:25 GMT Message-Id: <202507080304.56834Pac078464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: e4c864e55505 - main - ip_htable: fix -Wtautological-pointer-compare warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e4c864e5550544e5ff7e395309c5098d84058403 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e4c864e5550544e5ff7e395309c5098d84058403 commit e4c864e5550544e5ff7e395309c5098d84058403 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:02:19 +0000 ip_htable: fix -Wtautological-pointer-compare warnings This also fixes a few other trivial -Wunused-but-set-variable warnings. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/ip_htable.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index e54b739df361..91b375f80db1 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -604,7 +604,7 @@ ipf_htent_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, switch (iph->iph_type & ~IPHASH_ANON) { case IPHASH_GROUPMAP : - if (ipe->ipe_group != NULL) + if (ipe->ipe_ptr != NULL) ipf_group_del(softc, ipe->ipe_ptr, NULL); break; @@ -974,7 +974,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) { iphtent_t ipe, *ent; u_int hv; - int bits; bcopy((char *)ipeo, (char *)&ipe, sizeof(ipe)); ipe.ipe_addr.i6[0] &= ipe.ipe_mask.i6[0]; @@ -982,7 +981,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) ipe.ipe_addr.i6[2] &= ipe.ipe_mask.i6[2]; ipe.ipe_addr.i6[3] &= ipe.ipe_mask.i6[3]; if (ipe.ipe_family == AF_INET) { - bits = count4bits(ipe.ipe_mask.in4_addr); ipe.ipe_addr.i6[1] = 0; ipe.ipe_addr.i6[2] = 0; ipe.ipe_addr.i6[3] = 0; @@ -994,7 +992,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) } else #ifdef USE_INET6 if (ipe.ipe_family == AF_INET6) { - bits = count6bits(ipe.ipe_mask.i6); hv = IPE_V6_HASH_FN(ipe.ipe_addr.i6, ipe.ipe_mask.i6, iph->iph_size); } else From nobody Tue Jul 8 03:04:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbmDD0NYvz61KqF; Tue, 08 Jul 2025 03:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDC23DGz3C31; Tue, 08 Jul 2025 03:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WDOcqKcrxxUulvVK3k7ZwRzauonIHcPYgtIoNfixjWY=; b=QBO5057DQ3iQUP52gfhnxzvB/YzFyLX6mtbDQfua+AoNb+axqseYUxLdrVElI0xULD7bwX PcbtQXsuZjpNHWvlwPeLJ6bMLUenlvPD1ZH3TINSItG1vO2LShe6NX6bp7FGj+sqZEU5E9 b9XSXmQ3eGJWgIWD4VxPxt80ijZAzUET50pcI/m6OURZNZcCjk3MPNFyXpw0PTrT+IqAPQ mEq/NexJDiqab9s4RQIeMaf3OLtDeLS7yC9D3s3zu0Q1y6BlsWzLaHohXVJ+vIs3n3Dnt3 6tYkuYHMDJYT6Pwnjy3GPQQ3LIh5vpV79bXRgMe5lLeFNWYW41bbj5fAK8OOEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WDOcqKcrxxUulvVK3k7ZwRzauonIHcPYgtIoNfixjWY=; b=eBAaIii4oJnXAJiZaCyHk/SqSCQ4bnCjBKYIHj6+o13A/1Pa0CYQdHDZjdejbaESKZHQtq JU4lTScP+GY3EgLXIFnk2FKcsMc7t6CKuB6woo/SvI7HujbMZNtxYjIoRaPzjSO3dA4JLx zzPNq2phjyxpyvLso/Kxl5FIMc3XCjZd2Ck0hCHwW7Z01PxKrMsC85GB4vpHPY8SRrgeXd XfQwTtLMqdT6jttJXUboVy9EkpLjoSvoq/H15KOQy95pMHUrPvg7ho7jsaBsf+Vudd7eBu fU0FZFv6shEDahi9Ps4wyhE74/JPAFNT/xWW2ExQ+IgOmT/ywtmMUr8u0CB3qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943867; a=rsa-sha256; cv=none; b=BNsx73yjqynKMO7wsVSWB8pie506ea/J1gTzN7qFMPSM916dT5zXSKD4cOsagKitsWIfNu qZtz6VlN3aCHokfEzcDZ5BhGs+VPbswKBMkslMSg2ysfOBRpLG9aI9vK6rL0Wj8QweIzBX EOI7RzVdm2exADyAE61+PayCyWDSn/nq2hYk5IYLfP7m3cnAMHFdAWf+J0RnOTiHeqTGSY Itk472jvQSZw+8C9/UNZWI64hCXBKT+OZ7Ta4vFmlc6cuORduBSeu5IvuYmzgGbibLZlUC TOO9JHbCqkeASRb9mHJYd6/tcwk3OUE1VroKEBQstZI9Sv5rF7izD1ugDjgFRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbmDC1WPtz3GY; Tue, 08 Jul 2025 03:04: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 56834R8F078500; Tue, 8 Jul 2025 03:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834RS0078497; Tue, 8 Jul 2025 03:04:27 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:27 GMT Message-Id: <202507080304.56834RS0078497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 2bae5cad793b - main - ip_nat.c: fix non-trivial unused variable warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c commit 2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:02:59 +0000 ip_nat.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/ip_nat.c | 43 +++++++++++------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index a13c6129a287..972511f43bd5 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -3224,13 +3224,10 @@ ipf_nat_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; #if SOLARIS && defined(_KERNEL) && defined(ICK_M_CTL_MAGIC) qpktinfo_t *qpi = fin->fin_qpi; #endif - flags = nat->nat_flags; - switch (nat->nat_pr[0]) { case IPPROTO_ICMP : @@ -3538,8 +3535,8 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - int flags = 0, type, minlen; - icmphdr_t *icmp, *orgicmp; + int flags = 0, minlen; + icmphdr_t *orgicmp; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -3547,8 +3544,6 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) ip_t *oip; u_int p; - icmp = fin->fin_dp; - type = icmp->icmp_type; nside = &softn->ipf_nat_stats.ns_side[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -3999,9 +3994,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; ipnat_t *ipn; - u_int sflags; nat_t *nat; int nflags; u_32_t dst; @@ -4009,9 +4002,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, u_int hv, rhv; ifp = fin->fin_ifp; - gre = NULL; dst = mapdst.s_addr; - sflags = flags & NAT_TCPUDPICMP; switch (p) { @@ -4330,14 +4321,12 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; ipnat_t *ipn; nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; switch (p) { @@ -4756,7 +4745,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) struct ifnet *ifp, *sifp; ipf_main_softc_t *softc; ipf_nat_softc_t *softn; - icmphdr_t *icmp = NULL; tcphdr_t *tcp = NULL; int rval, natfailed; u_int nflags = 0; @@ -4802,8 +4790,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) nflags = IPN_UDP; break; case IPPROTO_ICMP : - icmp = fin->fin_dp; - /* * This is an incoming packet, so the destination is * the icmp_id and the source port equals 0 @@ -5463,7 +5449,10 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t sumd, ipsumd, sum1, sum2; + u_32_t sumd, sum1, sum2; +#if !defined(_KERNEL) || SOLARIS + u_32_t ipsumd; +#endif icmphdr_t *icmp; tcphdr_t *tcp; ipnat_t *np; @@ -5499,7 +5488,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) ipf_sync_update(softc, SMC_NAT, fin, nat->nat_sync); +#if !defined(_KERNEL) || SOLARIS ipsumd = nat->nat_ipsumd; +#endif /* * Fix up checksums, not by recalculating them, but * simply computing adjustments. @@ -5521,7 +5512,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_osrcaddr; sum2 = nat->nat_nsrcaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; @@ -5538,7 +5531,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_odstaddr; sum2 = nat->nat_ndstaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; @@ -7352,30 +7347,18 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t amin, amax, new; + u_32_t new; i6addr_t newip; int error; new = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Tue Jul 8 03:04:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbmDD6SX5z61L2y; Tue, 08 Jul 2025 03:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDD4BVpz3C9J; Tue, 08 Jul 2025 03:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VT6Nv5EyoIsiM3RSkzGYUtY84KyqWH8jKt01MGx+80U=; b=MLSkVht1ak7rUqsCTf+9sn8LdENdXgLrJJqWcN76P87Hq8ArjFc6Tw8JqyUZdsg9MvVYXJ huNcx8ohUEk6hkc6By8i+TTDDo6rPh4o/QohdXhZXPNZxXinfpkiJMw+p/SJ/Mvc/ffiy/ RqF2JfqWsOI0NL4DT5znzqnSBANM/0X5kpYL+NgVB+uY4fFbUApj5TDO9PXuFQbDCUBhj9 pd4NVgiH26i28M1Jj9VAuziGyCeZpX2V2hW9B5ZxSzUjxPiSUD6GmN43pz/YjrZVjnPKgN bEAAhCHLTjJ9Zv/jcx5n1CfASqck0i4hs1aUzDdSrKuipb5mgQse1+vkuyLywg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VT6Nv5EyoIsiM3RSkzGYUtY84KyqWH8jKt01MGx+80U=; b=JTE/GeeOVElqCmle5O1vgk7i3oMqkR3IRPJMesSul6CeD7Onx9ZZHr2fIWfv4MJ36Qk79u KdSq6yK2delsQV5CPgbPbqpd2LMkjmckIuxCNDZ9uCRI3ImGnUFd5ji5/tXZvVW1LNom/6 brI8Z6gFv9dWMsYScMV1lwUszGAOrHjdjvNZvI5vkvRB/Xfc1ZTHHTwpxtXjgsTB1p1kox dDI6nfPowIWpCfRIDwdRhQSNehAKObHYj3JDpnjilRUUGiHVsP75Rp/XxMVTknsWbM5MAu j9rJhrT3pQFgUn++pZgkYcKV8LKYn3AYpc9Y4ArY5QqOtHiBqzk7Un8wygvjFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943868; a=rsa-sha256; cv=none; b=RtPp0E4Wab/ddGJUy6y4J3gZpunpXgFIyTd3w6Sp4HxB1LRVJKbAanWEHDZU+5s7TKQMvV 98+TCm0kXCeNZanjnbnKpztRZ8zjOYKXP+Kxu8+Q5/QIz8FHLV1oPjuMQKhfZacLzixall L0IjolR5/nLTc9UUauTTft6FPL05AracO9YK15OjCN9qrXYT9dxd1MkrH8uUzP51Guwf0P 7oTDHP874RIHoPfrnZG06+paksvT0xuSYifbcspQF6H8EPud8TeIJcThhEEUMA4k5VUn8n KBowzQJKlubOjawKz2IVaBq+hYS1LgC+mKcZRyIGQW/nz24r3+m5WFwuTqaqKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbmDD28Wpz3b7; Tue, 08 Jul 2025 03:04: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 56834SuV078533; Tue, 8 Jul 2025 03:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834SEW078530; Tue, 8 Jul 2025 03:04:28 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:28 GMT Message-Id: <202507080304.56834SEW078530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 2bbaeb717b69 - main - ip_nat6.c: fix non-trivial unused variable warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2bbaeb717b690f796e751be63a656fb097ef786d Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2bbaeb717b690f796e751be63a656fb097ef786d commit 2bbaeb717b690f796e751be63a656fb097ef786d Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:03:11 +0000 ip_nat6.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/ip_nat6.c | 52 +++++++++------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat6.c b/sys/netpfil/ipfilter/netinet/ip_nat6.c index dbe19c40c2f2..6d5913177b90 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat6.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat6.c @@ -1130,9 +1130,6 @@ ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; - - flags = nat->nat_flags; switch (fin->fin_p) { @@ -1355,8 +1352,8 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - struct icmp6_hdr *icmp6, *orgicmp; - int flags = 0, type, minlen; + struct icmp6_hdr *orgicmp; + int flags = 0, minlen; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -1365,8 +1362,6 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) u_int p; minlen = 40; - icmp6 = fin->fin_dp; - type = icmp6->icmp6_type; nside = &softn->ipf_nat_stats.ns_side6[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -1500,9 +1495,8 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) i6addr_t l1, l2, d; u_short *s1, *s2, *ds; u_32_t r; - int i, neg; + int i; - neg = 0; l1 = *ip1; l2 = *ip2; s1 = (u_short *)&l1; @@ -1519,7 +1513,6 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) } if (s2[0] > s1[0]) { ds[0] = s2[0] + 0x10000 - s1[0]; - neg = 1; } else { ds[0] = s2[0] - s1[0]; } @@ -1869,9 +1862,9 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; - u_int sflags; +#endif nat_t *nat; int nflags; i6addr_t dst; @@ -1881,10 +1874,7 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ifp = fin->fin_ifp; sport = 0; dport = 0; - gre = NULL; dst.in6 = *mapdst; - sflags = flags & NAT_TCPUDPICMP; - switch (p) { case IPPROTO_TCP : @@ -1962,8 +1952,8 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, if ((nat->nat_flags & IPN_TCPUDP) != 0) { - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2192,14 +2182,14 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; +#endif nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; sport = 0; dport = 0; @@ -2280,8 +2270,8 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, break; } - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2568,7 +2558,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) ipf_nat_softc_t *softn = softc->ipf_nat_soft; struct icmp6_hdr *icmp6 = NULL; struct ifnet *ifp, *sifp; - tcphdr_t *tcp = NULL; int rval, natfailed; ipnat_t *np = NULL; u_int nflags = 0; @@ -2621,9 +2610,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) default : break; } - - if ((nflags & IPN_TCPUDP)) - tcp = fin->fin_dp; } ipa = fin->fin_src6; @@ -2965,7 +2951,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) int rval, natfailed; struct ifnet *ifp; i6addr_t ipa, iph; - tcphdr_t *tcp; +#ifdef IPF_V6_PROXIES + tcphdr_t *tcp = NULL; +#endif u_short dport; ipnat_t *np; nat_t *nat; @@ -2973,7 +2961,6 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0) return (0); - tcp = NULL; icmp6 = NULL; dport = 0; natadd = 1; @@ -3014,7 +3001,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) } if ((nflags & IPN_TCPUDP)) { +#ifdef IPF_V6_PROXIES tcp = fin->fin_dp; +#endif dport = fin->fin_data[1]; } } @@ -3802,32 +3791,19 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; i6addr_t newip, new; - u_32_t amin, amax; int error; new.i6[0] = 0; new.i6[1] = 0; new.i6[2] = 0; new.i6[3] = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Tue Jul 8 03:04:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbmDG0xTkz61KsV; Tue, 08 Jul 2025 03:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDF3dr0z3C0b; Tue, 08 Jul 2025 03:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7539tB2Q2vC29FEXrm93zkWx5GuLjRu6iG8I/Eq2/Yo=; b=iQrjRyQ6HyohspBvfGks/fxGs9/kMgEVuCRPxWydSshh1wBXlNVU1ZZi914dHYGqOma8hz 35dfepd1ckmAj9oPoviQgcXESfOkdG5peTqVzGDLctNpZkUSZfTp+fmFt/m489h6kJir42 pYJ7YRD6wzDPyYuInh8/OkC/pcmemrh3SLbPsjcQIj/a6JDjqvOVU8aMTQ6aTDz9e3LmTJ QyjH6ScG+BGOtPTLGjmOXKzSiNjbLmmwRBxFTPS+OY5eaH3AQIoqR6PfjagXz5b/g+p7rV bIIojYzwfEn41LZk4CbxfqNpFsiH0oqMZF+VX3vDNRFNLTadMPraNA2zIy/TtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7539tB2Q2vC29FEXrm93zkWx5GuLjRu6iG8I/Eq2/Yo=; b=Fzkaij3cHbmeclHbS9R1/zdC/+UJEgPWjQrIeAhaDlW5PAyiTDTPquT+vjnXc+k8ZvipGn 6dn/9kmPOU7ZF8YnkWGDXyilgMvTGRMqz/QO4fvTh10JgMyarjwl6RPzYK/KVT8K9PYzBl So5Ry2et5S5fg6ZZocpyWOB1Fu6Iepz8ECLyjNFmTSkqAmXMQUAq0fOf4OI2TeiVZQroDT 76z7vQ6Yz3w4iAMabhj+Ys3gnYO2BrNcBTcmUXskQ262zhn3K8X49qQprAmplfzJzAA84J BEQ9Y2NMuxwnXitVmgXnJNIMrERc9YXlzb0GeeSLqkMTrTik7OLEDdLpTfeF5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943869; a=rsa-sha256; cv=none; b=O0gj+QJzN5bfAWgcihyekTMQ7CHykC+uQBuV1QMVlR2ID0TgWt2EJG1i2gq9YthXRL7WRj 1S0VSSHJUSHT0eltTnC5WO3KvIUIz7wQf/3iFOWSvO2BnH33C8ceVecgbKdlqsF1VeJbDK pAXxWrQ6J1tmhUvQRU6xvvof0yHXPRMQaxklFmNf3JaR3ggSt0cEu0WZ9nilUTe/c5pVT4 mIlffU8uBsHClklpyez1P+trU0tOkLt21MG/dflKPEZ8lVFLbVQRbMTHtSOTDPkOQV9DRw PeaEBLIfpNM0fho7+zDYeAOhXOCNDOIjdHU1RoRTVLOBSeNXXGX8u3S1J7Be7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbmDF3Dc4z3GZ; Tue, 08 Jul 2025 03:04: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 56834TJS078572; Tue, 8 Jul 2025 03:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834TbQ078570; Tue, 8 Jul 2025 03:04:29 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:29 GMT Message-Id: <202507080304.56834TbQ078570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 79d23845179a - main - netpfil/ipfilter: fix remaining trivial unused variable warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 79d23845179a534f533185763cb92032202729a7 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=79d23845179a534f533185763cb92032202729a7 commit 79d23845179a534f533185763cb92032202729a7 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:03:20 +0000 netpfil/ipfilter: fix remaining trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/fil.c | 16 +++++----------- sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c | 8 ++++---- sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_irc_pxy.c | 7 ++----- sys/netpfil/ipfilter/netinet/ip_lookup.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c | 5 +---- sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c | 5 ----- sys/netpfil/ipfilter/netinet/ip_proxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c | 8 +------- sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_state.c | 22 ++-------------------- sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ipf_rb.h | 2 -- 14 files changed, 23 insertions(+), 82 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 2a4feb17dbd3..2fcea433295f 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -437,7 +437,7 @@ static inline void ipf_pr_ipv6hdr(fr_info_t *fin) { ip6_t *ip6 = (ip6_t *)fin->fin_ip; - int p, go = 1, i, hdrcount; + int p, go = 1, i; fr_ip_t *fi = &fin->fin_fi; fin->fin_off = 0; @@ -464,7 +464,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) if (IN6_IS_ADDR_MULTICAST(&fi->fi_dst.in6)) fin->fin_flx |= FI_MULTICAST|FI_MBCAST; - hdrcount = 0; while (go && !(fin->fin_flx & FI_SHORT)) { switch (p) { @@ -542,7 +541,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) go = 0; break; } - hdrcount++; /* * It is important to note that at this point, for the @@ -2590,14 +2588,13 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) /* functions called from the IPFilter "mainline" in ipf_check(). */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_acctpkt(fr_info_t *fin, u_32_t *passp) +ipf_acctpkt(fr_info_t *fin, u_32_t *passp __unused) { ipf_main_softc_t *softc = fin->fin_main_soft; char group[FR_GROUPLEN]; frentry_t *fr, *frsave; u_32_t pass, rulen; - passp = passp; fr = softc->ipf_acct[fin->fin_out][softc->ipf_active]; if (fr != NULL) { @@ -4200,7 +4197,7 @@ ipf_getstat(ipf_main_softc_t *softc, friostat_t *fiop, int rev) (rev / 10000) % 100, (rev / 100) % 100); #else - rev = rev; + (void)rev; /* UNUSED */ (void) strncpy(fiop->f_version, ipfilter_version, sizeof(fiop->f_version)); #endif @@ -4408,13 +4405,12 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, OP_ZERO /* zero statistics and counters */ } addrem = OP_ADD; frentry_t frd, *fp, *f, **fprev, **ftail; - void *ptr, *uptr, *cptr; + void *ptr, *uptr; u_int *p, *pp; frgroup_t *fg; char *group; ptr = NULL; - cptr = NULL; fg = NULL; fp = &frd; if (makecopy != 0) { @@ -4532,7 +4528,6 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, } ptr = NULL; - cptr = NULL; if (FR_ISACCOUNT(fp->fr_flags)) unit = IPL_LOGCOUNT; @@ -7314,11 +7309,10 @@ ipf_resolvedest(ipf_main_softc_t *softc, char *base, frdest_t *fdp, int v) /* for both IPv4 and IPv6 on the same physical NIC. */ /* ------------------------------------------------------------------------ */ void * -ipf_resolvenic(ipf_main_softc_t *softc, char *name, int v) +ipf_resolvenic(ipf_main_softc_t *softc __unused, char *name, int v) { void *nic; - softc = softc; /* gcc -Wextra */ if (name[0] == '\0') return (NULL); diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c index 482e0b456ae5..8c9317c38326 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -219,7 +219,7 @@ ipf_p_ftp_soft_destroy(ipf_main_softc_t *softc, void *arg) int -ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ftpinfo_t *ftp; ftpside_t *f; @@ -228,8 +228,6 @@ ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (ftp == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = ftp; aps->aps_psiz = sizeof(ftpinfo_t); aps->aps_sport = htons(fin->fin_sport); @@ -1715,7 +1713,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, return (0); if (c != delim) return (0); - addr |= addr; +#if 0 + addr |= (addr << 0); +#endif /* * Get the port number diff --git a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c index c6e4be17e22e..d5103c2944dc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c @@ -341,15 +341,13 @@ ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * UDP/TCP port numbers). */ int -ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ipsec_pxy_t *ipsec; u_32_t cookies[4]; mb_t *m; int off; - nat = nat; /* LINT */ - if ((fin->fin_dlen < sizeof(cookies)) || (fin->fin_flx & FI_FRAG)) return (-1); diff --git a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c index 026459299efd..aa9e84be19ed 100644 --- a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c @@ -221,7 +221,7 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) int -ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ircinfo_t *irc; @@ -232,8 +232,6 @@ ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (irc == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = irc; aps->aps_psiz = sizeof(ircinfo_t); @@ -422,8 +420,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) int -ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat) { - aps = aps; /* LINT */ return (ipf_p_irc_send(fin, nat)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c index b46d1b875003..a52dbef00166 100644 --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -230,13 +230,11 @@ ipf_lookup_soft_destroy(ipf_main_softc_t *softc, void *arg) /* ------------------------------------------------------------------------ */ int ipf_lookup_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, int uid, void *ctx) + int mode __unused, int uid, void *ctx) { int err; SPL_INT(s); - mode = mode; /* LINT */ - SPL_NET(s); switch (cmd) diff --git a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c index 2ad642adfbcd..f9c1ab50b8a2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c @@ -67,7 +67,7 @@ ipf_p_netbios_main_unload(void) int -ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat __unused) { char dgmbuf[6]; int off, dlen; @@ -75,9 +75,6 @@ ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip_t *ip; mb_t *m; - aps = aps; /* LINT */ - nat = nat; /* LINT */ - m = fin->fin_m; dlen = fin->fin_dlen - sizeof(*udp); /* diff --git a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c index 0ac19b067d2d..dc4c67dc14f0 100644 --- a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c @@ -281,7 +281,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) tcphdr_t *tcp; int dlen, off; u_short len; - char *msg; tcp = fin->fin_dp; dlen = fin->fin_dlen - (TCP_OFF(tcp) << 2); @@ -310,8 +309,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) return (-1); } - msg = (char *)fin->fin_dp + (TCP_OFF(tcp) << 2); - while (dlen > 0) { off += pptps->pptps_bytes; if (pptps->pptps_gothdr == 0) { @@ -337,7 +334,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) } } dlen -= len; - msg += len; off += len; pptps->pptps_gothdr = 1; @@ -381,7 +377,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) pptps->pptps_len = 0; start += len; - msg += len; dlen -= len; } diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c index 9785fc37d3da..9fb6dbd2a9e1 100644 --- a/sys/netpfil/ipfilter/netinet/ip_proxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c @@ -679,14 +679,12 @@ ipf_proxy_ok(fr_info_t *fin, tcphdr_t *tcp, ipnat_t *np) /* ------------------------------------------------------------------------ */ int ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, void *ctx) + int mode __unused, void *ctx) { ap_ctl_t ctl; caddr_t ptr; int error; - mode = mode; /* LINT */ - switch (cmd) { case SIOCPROXY : diff --git a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c index 2cfaaa58200f..94f0e3ada707 100644 --- a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c @@ -49,12 +49,10 @@ ipf_p_raudio_main_unload(void) * Setup for a new proxy to handle Real Audio. */ int -ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -72,7 +70,7 @@ ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap = aps->aps_data; unsigned char membuf[512 + 1], *s; @@ -82,8 +80,6 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int len = 0; mb_t *m; - nat = nat; /* LINT */ - /* * If we've already processed the start messages, then nothing left * for the proxy to do. diff --git a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c index 778f14f442de..b85794e75499 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c @@ -63,18 +63,12 @@ ipf_p_rcmd_main_unload(void) * Setup for a new RCMD proxy. */ int -ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rcmd_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { tcphdr_t *tcp = (tcphdr_t *)fin->fin_dp; rcmdinfo_t *rc; ipnat_t *ipn; - ipnat_t *np; - int size; - fin = fin; /* LINT */ - - np = nat->nat_ptr; - size = np->in_size; KMALLOC(rc, rcmdinfo_t *); if (rc == NULL) { #ifdef IP_RCMD_PROXY_DEBUG diff --git a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c index f8f4d2d325e1..c608f84d7b3b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c @@ -144,12 +144,10 @@ ipf_p_rpcb_main_unload(void) /* Allocate resources for per-session proxy structures. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { rpcb_session_t *rs; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -1023,10 +1021,8 @@ ipf_p_rpcb_lookup(rpcb_session_t *rs, u_32_t xid) /* Free the RPCB transaction record rx from the chain of entries. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_deref(rpcb_session_t *rs, rpcb_xact_t *rx) +ipf_p_rpcb_deref(rpcb_session_t *rs __unused, rpcb_xact_t *rx) { - rs = rs; /* LINT */ - if (rx == NULL) return; diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c index 8fe11e3f1215..36fdf23cd062 100644 --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -883,7 +883,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, { ipstate_t *is, *isn; ipstate_save_t ips; - int error, out, i; + int error, i; frentry_t *fr; char *name; @@ -929,7 +929,6 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, return (ENOMEM); } bcopy((char *)&ips.ips_fr, (char *)fr, sizeof(*fr)); - out = fr->fr_flags & FR_OUTQUE ? 1 : 0; isn->is_rule = fr; ips.ips_is.is_rule = fr; MUTEX_NUKE(&fr->fr_lock); @@ -2207,20 +2206,6 @@ ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, (ackskew >= -1) && (ackskew <= 1)) { inseq = 1; } else if (!(flags & IS_TCPFSM)) { - int i; - - i = (fin->fin_rev << 1) + fin->fin_out; - -#if 0 - if (is_pkts[i]0 == 0) { - /* - * Picking up a connection in the middle, the "next" - * packet seen from a direction that is new should be - * accepted, even if it appears out of sequence. - */ - inseq = 1; - } else -#endif if (!(fdata->td_winflags & (TCP_WSCALE_SEEN|TCP_WSCALE_FIRST))) { /* @@ -2616,7 +2601,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) icmphdr_t *icmp; fr_info_t ofin; tcphdr_t *tcp; - int type, len; + int len; u_char pr; ip_t *oip; u_int hv; @@ -2634,7 +2619,6 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) return (NULL); } ic = fin->fin_dp; - type = ic->icmp_type; oip = (ip_t *)((char *)ic + ICMPERR_ICMPHLEN); /* @@ -4362,7 +4346,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) ip6_t *oip6; u_char pr; u_int hv; - int type; /* * Does it at least have the return (basic) IP header ? @@ -4377,7 +4360,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) } ic6 = fin->fin_dp; - type = ic6->icmp6_type; oip6 = (ip6_t *)((char *)ic6 + ICMPERR_ICMPHLEN); if (fin->fin_plen < sizeof(*oip6)) { diff --git a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c index d81de100120b..3c737b38aacc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c @@ -151,7 +151,7 @@ ipf_p_tftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_tftp_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { udphdr_t *udp; tftpinfo_t *ti; @@ -159,8 +159,6 @@ ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipnat_t *np; int size; - fin = fin; /* LINT */ - np = nat->nat_ptr; size = np->in_size; diff --git a/sys/netpfil/ipfilter/netinet/ipf_rb.h b/sys/netpfil/ipfilter/netinet/ipf_rb.h index e047c7f44a4a..334311502aab 100644 --- a/sys/netpfil/ipfilter/netinet/ipf_rb.h +++ b/sys/netpfil/ipfilter/netinet/ipf_rb.h @@ -305,13 +305,11 @@ _n##_rb_walktree(struct _n##_rb_head *head, _n##_rb_walker_t func, void *arg)\ _t *prev; \ _t *next; \ _t *node = head->top._f.right; \ - _t *base; \ \ while (node != &_n##_rb_zero) \ node = node->_f.left; \ \ for (;;) { \ - base = node; \ prev = node; \ while ((node->_f.parent->_f.right == node) && \ (node != &_n##_rb_zero)) { \ From nobody Tue Jul 8 03:04:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbmDH1sLTz61L33; Tue, 08 Jul 2025 03:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDG5QfJz3CG0; Tue, 08 Jul 2025 03:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LRb7sDdiQfiRqcXshI8Ui4gBOKvi0ylSfprDG8XO9/U=; b=K+MgQi5IyQHAjW402/GnwBjKI7ARVdNFyBZ1ksADZbEJr9vxJovM0Ewl6c0pMe+mVoiF/5 LROkp8Yi8Na1OjQGJevcTGqJV0C1/xloBPapl6t66VBMVI9B6AVI6D72YXjbIe+T6pD8u/ VJZlVJfgi0VwFsogguKSu7kekthLTs+Yt1hDmg4NBj/W3ifXtErGh27wslL8hRsUadg0KW pjlCEvi6Lfr3RhJnb7juw02xXpklhJZYLzVqJWRghcypR2EtepBGc7MPJ2DsGLpjeReXAL MASC+slCcWeFB7UQFsadMF9d+ZocUm6hYvcMdGJ1XBnkVxzgxwC5+XbPsuOgVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LRb7sDdiQfiRqcXshI8Ui4gBOKvi0ylSfprDG8XO9/U=; b=lzHImP6ZbB3clRTICAgi4B11rkuy3eBG2MqFskoDZN9CiDQ9KYp3maVGHBRfdWetiPq0Tb BBMXll9ePfoHxNHzlnA/mo00g1h8nZb+ueaEIvzAFHFO5JN6QYS7j7ZP1/gGjbWcb6lUfH CfyH+SdHKBe9V1FCEkUqsbnuV82Ymd9yOSRwHL77gbu5CE7qlbeDR1U4mte+BP9VkXjjS8 ZsN3tPsO0OR8a0RdWRpMxhUNDJ97F1LLbtyaXWvTj8XlHQrypjT9/7nbEFGwZVOG5SzefK pPicqtjrj1sxeItjc2yq9UB2rK/4gS437jKEHwzm4Tk9TnrEHhVhS1vXkpIp4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943870; a=rsa-sha256; cv=none; b=LiNci+QuuahT7fxcDX2eBgJDVk/Bru8dbPh7Edmi3AgG7SVSiDh02XyjcvslBqJdmtMY61 rvBgyT+7yZERCTsv1jV9qCyYIzzFToUwVzDCX9PEavu+cIsjLILABRqm8IL4NieLTf+0Ys fEDAoxYa5oBpzJRGP2XUZbvfBh8QXcwNZjGMyNSTbb4OCq5vxN2nTQ0GHiItYuMEwq+Km3 C47fz9iHqkNk3M51Ou0az5sODX9DMtcMDbL0jA12XgvvLtBzZbjk8z/O5aae8M/3cHj1BB eEwwvQe+1bpftUsy4G7YhOOUZConJsQl9FHzGIqurvGOpgLMhyir/NzEXVruvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbmDG4xpRz3YS; Tue, 08 Jul 2025 03:04: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 56834Uqv078607; Tue, 8 Jul 2025 03:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834Um9078604; Tue, 8 Jul 2025 03:04:30 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:30 GMT Message-Id: <202507080304.56834Um9078604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 45730dd3ed33 - main - files: add new IPFILTER_C rule for netpfil/ipfilter sources List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 45730dd3ed334d265fc77cf6df1f82013fd5bf69 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=45730dd3ed334d265fc77cf6df1f82013fd5bf69 commit 45730dd3ed334d265fc77cf6df1f82013fd5bf69 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:03:33 +0000 files: add new IPFILTER_C rule for netpfil/ipfilter sources This re-enables all compiler warnings for these sources. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/conf/files | 54 ++++++++++++++++++---------------------------------- sys/conf/kern.pre.mk | 4 ++++ 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 866901ba4c51..74d251c2b608 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -598,42 +598,24 @@ contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug -netpfil/ipfilter/netinet/fil.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" -netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/fil.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet compile-with "${IPFILTER_C}" contrib/libfdt/fdt.c optional fdt contrib/libfdt/fdt_ro.c optional fdt contrib/libfdt/fdt_rw.c optional fdt diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index e6e42b33a9b7..78178065e15b 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -290,6 +290,10 @@ BNXT_CFLAGS= -I$S/dev/bnxt/bnxt_en ${OFEDCFLAGS} BNXT_C_NOIMP= ${CC} -c -o ${.TARGET} ${BNXT_CFLAGS} ${WERROR} BNXT_C= ${BNXT_C_NOIMP} ${.IMPSRC} +# IP Filter +IPFILTER_CFLAGS= -I$S/netpfil/ipfilter +IPFILTER_C= ${NORMAL_C} ${IPFILTER_CFLAGS} + GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} From nobody Tue Jul 8 04:28:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbp591NbPz61VDc; Tue, 08 Jul 2025 04:28:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.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 4bbp584B1Pz49LW; Tue, 08 Jul 2025 04:28:28 +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 YygXuhMHY5MqyYzwRuY7pg; Tue, 08 Jul 2025 04:28:27 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id YzwQumImLJhBPYzwQuLY7M; Tue, 08 Jul 2025 04:28:27 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=686c9e6b a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=S-1b6JwnAAAA:8 a=YxBL1-UpAAAA:8 a=Y9XXBGl_wdZf-F10BAYA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=jHPkhvgQCurpnRnmkKlz:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 7103EEC; Mon, 07 Jul 2025 21:28:25 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 669BF20E; Mon, 07 Jul 2025 21:28:25 -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: "Herbert J. Skuhra" cc: Cy Schubert , Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> Comments: In-reply-to "Herbert J. Skuhra" message dated "Tue, 08 Jul 2025 03:18:23 +0200." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 07 Jul 2025 21:28:25 -0700 Message-Id: <20250708042825.669BF20E@slippy.cwsent.com> X-CMAE-Envelope: MS4xfOdx1inv1ZxtqQ869X4bNLJ2ONGr44BoYLBfxgtHgNmP2+s2qFImO+QgGuPzhOqmfCQ9r7nCM+sXW55lN7O1QhU/zTANq0c/L789whyW8e1TYC0tLa3+ OSYwd2gzP1KAC8/ovjMNZL56ybsqoLj6ToJi8z31qzskAWRJpO9FTTK5rgTolvru7CJYJGJfRYYyRKKtbYOQpqGRHe9RBzTWh/5HKYSXi0X0TiwsbE7E6W8I bIxOaxtAj+N1PssgQnxIM5RYh6XzQff70rZt9UpB7o6iJr98hWRz3pvfUuxdmGcrmo91FmH43KDIen7aR+NGghe/z3S2bco3pTEcmpF07vwOadEDfBrQX7Vy lktiW8rLRRnSNDu53DwYapaIuTwS9g== X-Rspamd-Queue-Id: 4bbp584B1Pz49LW 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] In message , "Herbert J. Skuhra" writes: > On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: > > In message , "Herbert J. Skuhra" writes: > > > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > > > Hello! > > > > > > > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a > bad > > > file > > > > $ ls -la libkadm5clnt > > > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > > > > > > > Please review: > > > > > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > > > index e377f95f5b6e..be09dd3e210e 100644 > > > > --- a/krb5/lib/kadm5clnt/Makefile > > > > +++ b/krb5/lib/kadm5clnt/Makefile > > > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_E > RR} > > > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > > > > > afterinstall: > > > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm > 5cln > > > t.so > > > > > > > > .include > > > > > > This produces a valid symlink that 'make delete-old' wants to > > > remove again: > > > > > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > > > libkadm5clnt_mit.so.121 > > > > > > # make delete-old > > > >>> Removing old files (only deletes safe to delete libs) > > > remove /usr/lib/libkadm5clnt.so? > > > > Thanks Dima and Herbert for reporting this. It's been fixed. > > Cy, I am sorry for not being more precise. > > Dima's change, which hasn't been commited yet, fixes the real issue of > creating a bad symlink. > > I just wanted to add that his fix also needs removal of > usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. > > Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.inc? libkadm5clnt.so is a legitimate symlink for both MIT and Heimdal. In the case of Heimdal it points to libkadm5clnt.so.11. Whereas for MIT it points to libkadm5clnt_mit.so.121. There is o libkadm5clnt in MIT. It is libkadm5clnt_mit. You can see this in the port with pkg info -l as follows: slippy$ pkg info -l krb5 | grep libkadm5clnt /usr/local/lib/libkadm5clnt.so /usr/local/lib/libkadm5clnt_mit.so /usr/local/lib/libkadm5clnt_mit.so.12 /usr/local/lib/libkadm5clnt_mit.so.12.0 slippy$ -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Tue Jul 8 06:03:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbrBG5cFdz61h3l; Tue, 08 Jul 2025 06:03:02 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_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 4bbrBG1WFNz3nTn; Tue, 08 Jul 2025 06:03:02 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Tue, 8 Jul 2025 08:03:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1751954580; bh=qLIvuLYlOuv7tFrDyCNfrouZvOi/S0wwd7M6jovdamk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=Q1PLETA0/a/jZb9ctRSIV2lJjluqIZevgd8KriYohYPrgFW7PkNzfI434GkqkXQF+ WR/Yx8dg8Ab81hwv0NiYcI8DkDsLQYCKmMQ9sB3vBF++eCwncrNa76G1fmQiU+TOlP REinvUTM77z2I+18CK03S6sia7Yr1mceurCf/pPuILE5vNxXVSOlqeLKI8x7eyX4ny 6iGQ/GF6AvYFCiE9KQsqtAxC+fAJwphdAreIX0xfmxgIrxvUF5Ec/ycd7pzt1rqJET fP7pIZIRSlaxLVqkm00fLIUkwCZvQhJk/m9wVb555FD5ITTNZPRagEu1LTtLP8/J4c m67y1FMR/pBYg== From: "Herbert J. Skuhra" To: Cy Schubert Cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250708042825.669BF20E@slippy.cwsent.com> X-Rspamd-Queue-Id: 4bbrBG1WFNz3nTn 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:24940, ipnet:94.130.0.0/16, country:DE] On Mon, Jul 07, 2025 at 09:28:25PM -0700, Cy Schubert wrote: > In message , "Herbert J. Skuhra" writes: > > On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: > > > In message , "Herbert J. Skuhra" writes: > > > > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > > > > Hello! > > > > > > > > > > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a > > bad > > > > file > > > > > $ ls -la libkadm5clnt > > > > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > > > > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > > > > > > > > > > Please review: > > > > > > > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > > > > index e377f95f5b6e..be09dd3e210e 100644 > > > > > --- a/krb5/lib/kadm5clnt/Makefile > > > > > +++ b/krb5/lib/kadm5clnt/Makefile > > > > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_E > > RR} > > > > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > > > > > > > afterinstall: > > > > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > > > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm > > 5cln > > > > t.so > > > > > > > > > > .include > > > > > > > > This produces a valid symlink that 'make delete-old' wants to > > > > remove again: > > > > > > > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > > > > libkadm5clnt_mit.so.121 > > > > > > > > # make delete-old > > > > >>> Removing old files (only deletes safe to delete libs) > > > > remove /usr/lib/libkadm5clnt.so? > > > > > > Thanks Dima and Herbert for reporting this. It's been fixed. > > > > Cy, I am sorry for not being more precise. > > > > Dima's change, which hasn't been commited yet, fixes the real issue of > > creating a bad symlink. > > > > I just wanted to add that his fix also needs removal of > > usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. > > > > Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.inc? ^^^ no .so And maybe ObsoleteFiles.inc is the correct file to add this entry to. > libkadm5clnt.so is a legitimate symlink for both MIT and Heimdal. In the > case of Heimdal it points to libkadm5clnt.so.11. Whereas for MIT it points > to libkadm5clnt_mit.so.121. There is o libkadm5clnt in MIT. It is > libkadm5clnt_mit. You can see this in the port with pkg info -l as follows: > > slippy$ pkg info -l krb5 | grep libkadm5clnt > /usr/local/lib/libkadm5clnt.so > /usr/local/lib/libkadm5clnt_mit.so > /usr/local/lib/libkadm5clnt_mit.so.12 > /usr/local/lib/libkadm5clnt_mit.so.12.0 > slippy$ Without Dima's fix the following symlink is created: lrwxr-xr-x 1 root wheel 13 Jul 8 02:51 /usr/lib/libkadm5clnt -> kadm5clnt_mit No .so extension and /usr/lib/kadm5clnt_mit does not exist. $ file /usr/lib/libkadm5clnt /usr/lib/libkadm5clnt: broken symbolic link to kadm5clnt_mit With Dima's fix the following symlink is created: lrwxr-xr-x 1 root wheel 23 Jul 8 03:11 /usr/lib/libkadm5clnt.so -> libkadm5clnt_mit.so.121 This fix hasn't been committed yet. Commit aad5020c709ac4231af88d4b74588a28f87c9497 only removed /usr/lib/libkadm5clnt.so from OptionalObsoleteFiles. In my previous e-mail I was only suggesting to remove the broken symlink: usr/lib/libkadm5clnt. I really hope I don't add more confusion to this issue. From nobody Tue Jul 8 11:09:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbyzQ3HHBz60qM3; Tue, 08 Jul 2025 11:09:06 +0000 (UTC) (envelope-from fluffy@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbyzP6Pxlz3h7Z; Tue, 08 Jul 2025 11:09:05 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751972945; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=+efOgWyg/IE+gkmUpiIYzwuCxbRgdJSn3xrO4dKfP5Y=; b=iH6/fEh0wY1h71TOP7UhvnmqKzVmwSfX3L/yitgAMKg0nkNbKetvTMkAxA7wvb0CQac0NN XhYhWF7PH11esd2+zbSUl/AdPOVKYb4wDHKv0vnG1z9N8J3DsJsO52yY3akuE1GUY+PQB2 yGbTIMOidaRjmaeCW0wtR9gdrJFj/Rj1Q1neNmG4m6p8vKe1PoB2n9KfzTXQpdrSv1BGUV +R8vbUs3KV34iAGg3Mrg8HBLwrv9/2CKNEdr4gSafCjvotN+Wt84ywrUz2EEBGef5nCCPg SuPi/sXtV99360PfccbXBn6oxdzn87zHuQqTabh15IYzdn6uj6AtigNoz/RZNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751972945; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=+efOgWyg/IE+gkmUpiIYzwuCxbRgdJSn3xrO4dKfP5Y=; b=fMdwkiOEdH98wvj2nctL+VaG0LdHEEfcUvZsPCWl57jczWtytMOlc/c7NESWrtw9lJNKlS fBeCgc5PnkGREnGbN6rPAGkUjV0Ywg3PsD0W3XvsHQIhiz8Zp/k1sMoY/oXTx4B5+hQPYx /T8KmNJcT6g21ukf7VDh6hnQReD76Ot9OBtgAQ6y4Ll1WvbRXullrvF+B5cwabPDyfvcW9 OkpiO+b4GOHhkhs4n/UiYJv+0fVxbFcKqu9JDj1OUSXIrM9E1nX7SMXnWezZKd4KT+b+fh Zq7qB9WiaugeQcwUuRy7UIaImdq3ipkUGkkEqyl9DU068pfOF1SHjSsUXRyFPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751972945; a=rsa-sha256; cv=none; b=qr26rHYEHYU/anorjqoIxDSnZrSisFxDnIMCewKg6/KLGTiedH5B1aHK/rP3DB67xuRSKE fpePmeX3p5paaiH0rJ4kTaT20l42Y4eUd87Xo2cLoBrRQQAP26KXDpyzDvUhOgBl6b+8Ih 4cgA96nFd8KLb5tpKFCmXLJkreyptnBB+J6vhJVFI7IayKOh0htrqx/TrnJhI4ljk0aPyS S6UF07/nThrXb8F5T6k0T6nc+3IBxJhvYQCvDuN3ftW/JrkkzB/INVKyszFUOHpHFUGVFi jgpCdl/0TwFsudKgY7o/BwtoclbN1h18AtEUHLwVdRGDs37Ge7Hn1snge2XHqQ== Received: from [10.80.0.22] (unknown [89.150.40.109]) (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: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bbyzN5rJ0zP2G; Tue, 08 Jul 2025 11:09:04 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: Date: Tue, 8 Jul 2025 14:09:02 +0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250708042825.669BF20E@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------7w0oS5TSinnCFhs8yY5J5a0P" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------7w0oS5TSinnCFhs8yY5J5a0P Content-Type: multipart/mixed; boundary="------------QTlriF2LyJq92piMDW0Gp8UF"; protected-headers="v1" From: Dima Panov To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> In-Reply-To: <20250708042825.669BF20E@slippy.cwsent.com> --------------QTlriF2LyJq92piMDW0Gp8UF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCk9uIDA4LjA3LjIwMjUgMDc6MjgsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPiBJ biBtZXNzYWdlIDxhR3h4MzcxLUhWMzg0QTByQG1haWwuYnNkNGFsbC5uZXQ+LCAiSGVyYmVy dCBKLiBTa3VocmEiIHdyaXRlczoNCj4+IE9uIE1vbiwgSnVsIDA3LCAyMDI1IGF0IDA0OjA0 OjQ2UE0gLTA3MDAsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPj4+IEluIG1lc3NhZ2UgPGFHd3Yw NnJHbGdXOHptSklAbWFpbC5ic2Q0YWxsLm5ldD4sICJIZXJiZXJ0IEouIFNrdWhyYSIgd3Jp dGVzOg0KPj4+PiBPbiBNb24sIEp1bCAwNywgMjAyNSBhdCAxMDozNjozMVBNICswMzAwLCBE aW1hIFBhbm92IHdyb3RlOg0KPj4+Pj4gSGVsbG8hDQo+Pj4+Pg0KPj4+Pj4NCj4+Pj4+IEJU VywgaXQgbG9va3MgbGlrZSBzeW1saW5rIGZvciBsaWJrYWRtNWNsbnQuc28gaXMgYnJva2Vu IGFuZCBwcm9kdWNlZCBhDQo+PiAgIGJhZA0KPj4+PiAgIGZpbGUNCj4+Pj4+ICQgbHMgLWxh IGxpYmthZG01Y2xudA0KPj4+Pj4gbHJ3eHIteHIteCAgMSByb290IHdoZWVsIDEzICA3IEp1 bCAyMDo0MCBsaWJrYWRtNWNsbnQgLT4ga2FkbTVjbG50X21pdA0KPj4+Pj4NCj4+Pj4+IGlu c3RlYWQgb2YgYXNzdW1lZCBsaWJrYWRtNWNsbnQuc28gLT4ga2FkbTVjbG50X21pdC5zbw0K Pj4+Pj4NCj4+Pj4+DQo+Pj4+PiBQbGVhc2UgcmV2aWV3Og0KPj4+Pj4NCj4+Pj4+IGRpZmYg LS1naXQgYS9rcmI1L2xpYi9rYWRtNWNsbnQvTWFrZWZpbGUgYi9rcmI1L2xpYi9rYWRtNWNs bnQvTWFrZWZpbGUNCj4+Pj4+IGluZGV4IGUzNzdmOTVmNWI2ZS4uYmUwOWRkM2UyMTBlIDEw MDY0NA0KPj4+Pj4gLS0tIGEva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxlDQo+Pj4+PiAr KysgYi9rcmI1L2xpYi9rYWRtNWNsbnQvTWFrZWZpbGUNCj4+Pj4+IEBAIC04OCw3ICs4OCw3 IEBAICR7Q0hQQVNTX1VUSUxfU1RSSU5HU19FUlJfQ306ICR7Q0hQQVNTX1VUSUxfU1RSSU5H U19FDQo+PiBSUn0NCj4+Pj4+ICAgICAgICAgIHJtIC1mIGV0LWMtJHsuUFJFRklYfS5ldCBl dC1jLSR7LlBSRUZJWH0uYw0KPj4+Pj4NCj4+Pj4+ICAgYWZ0ZXJpbnN0YWxsOg0KPj4+Pj4g LSAgICAgICAke0lOU1RBTExfTElCU1lNTElOS30gJHtTSExJQn0gJHtERVNURElSfSR7TElC RElSfS9saWJrYWRtNWNsbnQNCj4+Pj4+ICsgICAgICAgJHtJTlNUQUxMX0xJQlNZTUxJTkt9 ICR7U0hMSUJfTkFNRX0gJHtERVNURElSfSR7TElCRElSfS9saWJrYWRtDQo+PiA1Y2xuDQo+ Pj4+IHQuc28NCj4+Pj4+DQo+Pj4+PiAgIC5pbmNsdWRlIDxic2QubGliLm1rPg0KPj4+Pg0K Pj4+PiBUaGlzIHByb2R1Y2VzIGEgdmFsaWQgc3ltbGluayB0aGF0ICdtYWtlIGRlbGV0ZS1v bGQnIHdhbnRzIHRvDQo+Pj4+IHJlbW92ZSBhZ2FpbjoNCj4+Pj4NCj4+Pj4gbHJ3eHIteHIt eCAgMSByb290IHdoZWVsICAgICAyMyBKdWwgIDcgMjI6MjYgL3Vzci9saWIvbGlia2FkbTVj bG50LnNvIC0+DQo+Pj4+IGxpYmthZG01Y2xudF9taXQuc28uMTIxDQo+Pj4+DQo+Pj4+ICMg bWFrZSBkZWxldGUtb2xkDQo+Pj4+Pj4+IFJlbW92aW5nIG9sZCBmaWxlcyAob25seSBkZWxl dGVzIHNhZmUgdG8gZGVsZXRlIGxpYnMpDQo+Pj4+IHJlbW92ZSAvdXNyL2xpYi9saWJrYWRt NWNsbnQuc28/DQo+Pj4NCj4+PiBUaGFua3MgRGltYSBhbmQgSGVyYmVydCBmb3IgcmVwb3J0 aW5nIHRoaXMuIEl0J3MgYmVlbiBmaXhlZC4NCj4+DQo+PiBDeSwgSSBhbSBzb3JyeSBmb3Ig bm90IGJlaW5nIG1vcmUgcHJlY2lzZS4NCj4+DQo+PiBEaW1hJ3MgY2hhbmdlLCB3aGljaCBo YXNuJ3QgYmVlbiBjb21taXRlZCB5ZXQsIGZpeGVzIHRoZSByZWFsIGlzc3VlIG9mDQo+PiBj cmVhdGluZyBhIGJhZCBzeW1saW5rLg0KPj4NCj4+IEkganVzdCB3YW50ZWQgdG8gYWRkIHRo YXQgaGlzIGZpeCBhbHNvIG5lZWRzIHJlbW92YWwgb2YNCj4+IHVzci9saWIvbGlia2FkbTVj bG50LnNvIGluIHRvb2xzL2J1aWxkL21rL09wdGlvbmFsT2Jzb2xldGVGaWxlcy5pbmMuDQo+ Pg0KPj4gTWF5YmUgdXNyL2xpYi9saWJrYWRtNWNsbnQgc2hvdWxkIGJlIGFkZGVkIHRvIE9w dGlvbmFsT2Jzb2xldGVGaWxlcy5pbmM/DQo+IA0KPiBsaWJrYWRtNWNsbnQuc28gaXMgYSBs ZWdpdGltYXRlIHN5bWxpbmsgZm9yIGJvdGggTUlUIGFuZCBIZWltZGFsLiBJbiB0aGUNCj4g Y2FzZSBvZiBIZWltZGFsIGl0IHBvaW50cyB0byBsaWJrYWRtNWNsbnQuc28uMTEuIFdoZXJl YXMgZm9yIE1JVCBpdCBwb2ludHMNCj4gdG8gbGlia2FkbTVjbG50X21pdC5zby4xMjEuIFRo ZXJlIGlzIG8gbGlia2FkbTVjbG50IGluIE1JVC4gSXQgaXMNCj4gbGlia2FkbTVjbG50X21p dC4gWW91IGNhbiBzZWUgdGhpcyBpbiB0aGUgcG9ydCB3aXRoIHBrZyBpbmZvIC1sIGFzIGZv bGxvd3M6DQo+IA0KPiBzbGlwcHkkIHBrZyBpbmZvIC1sIGtyYjUgfCBncmVwIGxpYmthZG01 Y2xudA0KPiAgICAgICAgICAvdXNyL2xvY2FsL2xpYi9saWJrYWRtNWNsbnQuc28NCj4gICAg ICAgICAgL3Vzci9sb2NhbC9saWIvbGlia2FkbTVjbG50X21pdC5zbw0KPiAgICAgICAgICAv dXNyL2xvY2FsL2xpYi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyDQo+ICAgICAgICAgIC91c3Iv bG9jYWwvbGliL2xpYmthZG01Y2xudF9taXQuc28uMTIuMA0KPiBzbGlwcHkkDQo+IA0KDQpD eSwgaXQgbG9va3MgeW91IHN0aWxsIGhhdmUgc29tZXRoaW5nIHN0YWxlZCBhdCB5b3VyIG1h Y2hpbmUgOigNCg0KT24gYSBjbGVhbiBidWlsZCBmb3IgcGtnYmFzZSBpbiBwb3VkcmllcmUg d2l0aG91dCBteSBwYXRjaCBpdCBzdGlsbCBwcm9kdWNlcyBhIGJhZCBzeW1saW5rIGFuZCBu byBjb21wYXQgaXMgcGFja2FnZWQgYXMgcmVzdWx0DQoNCnJvb3RAYWFyY2g2NDp+ICMgcGtn IGluZm8gLWwgLXgga3JiNSB8IGdyZXAgbGlia2FkbTVjbG50DQogICAgICAgICAvdXNyL2xp Yi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyMQ0KICAgICAgICAgL3Vzci9saWIvZGVidWcvdXNy L2xpYi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyMS5kZWJ1Zw0KICAgICAgICAgL3Vzci9saWIv ZGVidWcvdXNyL2xpYjMyL2xpYmthZG01Y2xudF9taXQuc28uMTIxLmRlYnVnDQogICAgICAg ICAvdXNyL2xpYi9saWJrYWRtNWNsbnRfbWl0LmENCiAgICAgICAgIC91c3IvbGliL2xpYmth ZG01Y2xudF9taXQuc28NCiAgICAgICAgIC91c3IvbGliMzIvbGlia2FkbTVjbG50X21pdC5h DQogICAgICAgICAvdXNyL2xpYjMyL2xpYmthZG01Y2xudF9taXQuc28NCiAgICAgICAgIC91 c3IvbGliMzIvbGlia2FkbTVjbG50X21pdC5zby4xMjENCg0KDQotLSANClNpbmNlcmVseSwN CkRpbWEgKGZsdWZmeUBGcmVlQlNELm9yZywgaHR0cHM6Ly90Lm1lL0ZsdWZmeUJTRCwgQGZs dWZmeTptYXRyaXgtZGV2LmZyZWVic2Qub3JnKQ0KKGRlc2t0b3AsIGtkZSwgeDExLCBvZmZp Y2UsIHBvcnRzLXNlY3RlYW0pQEZyZWVCU0QgdGVhbQ0KDQo= --------------QTlriF2LyJq92piMDW0Gp8UF-- --------------7w0oS5TSinnCFhs8yY5J5a0P Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhs/E4FAwAAAAAACgkQ+4ugndU5jykY YQ//Vqr0PugTySt6c17vPJKZV39n9jdKElEUvFGglYxNn/To4lA4l9TWssGTpA9LBGW5l2zfUEvL 8egE6jRhH2MGnwwMT73YqVXvGQam6+dsOfA9r7DMvzI8nCyhLiatN9H5C7jKd+QK0f9RD4v5fJUd dbAOrfDb7WBA+M3SFHEoeUFBX8tofAnWAoWq5GcTZlRVlxqmwT8JdwH6dRUZcm2jjke6Kx6yoKnf DGJaR348ATOcW3R/0tFvIJ6YlLMLSojFcHa+bsZywZaXa4fqln2neMk5UJUY3Hi2qh97JN8hp/YY AX27BLL7RmAvMsUqvfKh3DH3DsOgmzdDsPmnKgFQoafscJUJKk8e2W0eLaHRGg7TquASMZCI4ePa PJDqvIHSjRNjsNYPsP9DCfw8tQVdDfSsO8Mg7F5SPmUo7Os9XHJCHvaIflrbL0RrR2OW/24u5IRD xQuB/VrVPBeD62ht8reQ6r3eyqIGg9PQw6v/qObgiTMKUYiGXUrEPACeV6wcIW+cvWPVQ3OTUIRx +iep9eiZ6YllQKqDeynZxX+dDDDzTkxdNvx5qsolrU02rh8ANU+6jgbJdlK+//xAwjmjkChJEIfw +By+IR/CgHkxwGZTklgl/APa1B3VRp5JVW0IXp4sUx16jGJBBC5JVzvS4w6JVo+fip9jMZuooZTT uxc= =VeW3 -----END PGP SIGNATURE----- --------------7w0oS5TSinnCFhs8yY5J5a0P-- From nobody Tue Jul 8 11:38:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bbzdT6hMYz60sYk; Tue, 08 Jul 2025 11:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbzdT5XPdz3thm; Tue, 08 Jul 2025 11:38:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751974717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HLv+WJV9CKrjtLIss+V5OV4UgfYMVtT3NDh4hWxIpqY=; b=RoGKKm3OveVlUFQ7pGzakSnKn671NiV+zWzXRDtJFVYovVX2/9tFm/E5+yoZhzMjO6M+vg zMTE7F9oFxL9Q1iWdary25ARH9uTAi/209eHZFZJ011mgTs9gJakN7uqDTuZ+nmIBYkKUA iNCLj2+zXypoGgB/nrUYlQ6GkypBgiWJCtkRCVPcMnEoqLpR9aTS6LFr8o2ZM4ICXulyTo mL66KVUe0or0Uzvqoj6raINDGckgwjSY/e+zBHJXb9hykgpW9CmZRdQ3urOFIZifFBNptT A7MijT5g4m4WDrNjKpXz4rzJQ+po7q/83fcMFzoaK1uTr9AT/Y52K/jQIGKLQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751974717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HLv+WJV9CKrjtLIss+V5OV4UgfYMVtT3NDh4hWxIpqY=; b=RbPZhe4VB1jW75/1DEmK0HXsNjRkqcovl335SxNaCp07hyF7012lYlWT+S+3ox0Sa3SBR9 4SRdhy9yEP/Ju3JaCiz7iS27wSZ2IOZxlg7nNjfI3pBD/feHozkv77XPKjrtPUGeyKzpi3 CeWeu7ldCHg1+NJH67AqGUAsQySJRAab663l7BSzd1XUAzlP0tYQAvSD1zDDrqwZNFfXXh 1JsWyK2MFWByA5llzOBuEsivwFWwnr6hGrR9XjotYJJYOIOeMnhH02Cr8EVCxiLIjGaeAF eo3ZhpciNHrd+atrI8z4v4H6sn8o3+XlA1a1d3XqmwmyIoNIITTjbruh/gci4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751974717; a=rsa-sha256; cv=none; b=Ihn7I4V1YDK2usNFYdmwZoTI19NXdA+iyMg1zPjhi+sbLs4MFOKL6vxVmpecSl0M7bh3/h agj6Hef7N00HRnGBc5czBoNmY/Y/yeM6hfPoZWzZvbutq92pNc0aS/O5ixJvMrkrhsBnjg uRXAp0Oyl36haNzgk/JxeQ1QprEMvmbocwUcT+dIrP8vDkhb1cf48paAM8DgL00gfwh4pu j4bDZHqxKzhM+ihIaw4IexrzV9PiczH/1OLjKTMm3co2JqLEA6G3PKAQBF7D1P071Kq5Am 5h+Z8AqW7IQFkl6BlCkhLRrWk4pLKSwGm1t18w/6OLOfbfJmlkFIVCpmBCwIzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bbzdT4pHmzbp7; Tue, 08 Jul 2025 11:38: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 568BcbB9036621; Tue, 8 Jul 2025 11:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568BcbgG036618; Tue, 8 Jul 2025 11:38:37 GMT (envelope-from git) Date: Tue, 8 Jul 2025 11:38:37 GMT Message-Id: <202507081138.568BcbgG036618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 2f50ea54c6e3 - main - tests/ci: fix race condition in bhyveload boot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f50ea54c6e3b15f655e800eb680ddcb80e30b4f Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=2f50ea54c6e3b15f655e800eb680ddcb80e30b4f commit 2f50ea54c6e3b15f655e800eb680ddcb80e30b4f Author: Siva Mahadevan AuthorDate: 2025-07-07 17:16:13 +0000 Commit: Li-Wen Hsu CommitDate: 2025-07-08 11:32:17 +0000 tests/ci: fix race condition in bhyveload boot Currently, there is a race condition where the Makefile sh invocation of 'bhyveload -c stdio' exits before receiving any user input in the bootloader (e.g. in the form of a user typically pressing ), causing the 'expect' script to wrongly spawn the 'bhyve' invocation while still in the bootloader. This patch wraps bhyveload in expect(1) to ensure that stdio is correctly consumed before the process exits. Signed-off-by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1757 --- tests/ci/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ci/Makefile b/tests/ci/Makefile index 271fc377619b..44b19663fc49 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -210,7 +210,11 @@ ci-extract-meta: .PHONY ci-runtest: ci-buildimage-${TARGET_ARCH:tl} portinstall .PHONY .if ${MACHINE} == "amd64" && ( ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" ) && ( !defined(USE_QEMU) || empty(USE_QEMU) ) /usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy || true - /usr/sbin/bhyveload -c stdio -m ${VM_MEM_SIZE} -d ${CIDISK} ${TEST_VM_NAME} + expect -c "set timeout ${TIMEOUT_EXPECT}; \ + spawn /usr/bin/timeout -k 5s 30s /usr/sbin/bhyveload \ + -c stdio -m ${VM_MEM_SIZE} -d ${CIDISK} ${TEST_VM_NAME}; \ + expect { eof }; \ + exit [lindex [wait] 3]" expect -c "set timeout ${TIMEOUT_EXPECT}; \ spawn /usr/bin/timeout -k 60 ${TIMEOUT_VM} /usr/sbin/bhyve \ -c ${PARALLEL_JOBS} -m ${VM_MEM_SIZE} -A -H -P \ From nobody Tue Jul 8 12:54:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc1Kb4ft2z60y2G; Tue, 08 Jul 2025 12:54:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (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 4bc1KZ4vm3z3Ql8; Tue, 08 Jul 2025 12:54:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6fad4e6d949so24863596d6.0; Tue, 08 Jul 2025 05:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751979292; x=1752584092; 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=3GtIFfyFoq0fiOuBaPw2Qdeagt03q6Q55OZ0ziNeq7E=; b=PTZ0QWBqky5EuArIq1cYSfPkMBreZo7Wl7YlnRp9uXhO+fERvQa5IOFdI4gqRgO6Ry ol2337k4y3s8s/dIxKKGMx52mxKcxKi+r57mv5KxOyEDmXDLJ2A4LWRjIvHthQ2p59D4 Zcrs/JGeYMn4FSaLBsdt6OTtS5nPKQHEMboyKGfkt8lvnW/RCvG9j9fcMoS3PRQZJG86 wLN7rMOhSat936dhUwobEJw4kBalb9CdfgEjzjcKCvgsXEl4s77eX7i4zH5jqVmWOlOZ aLBW/C1B4yMUXne367cJ1mJch8WOx162lCbGdKkHSEYEBZ6faOv/1mB/BcEZr21KZ2Hy T7ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751979292; x=1752584092; 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=3GtIFfyFoq0fiOuBaPw2Qdeagt03q6Q55OZ0ziNeq7E=; b=dyR1QcFYhhvpU2H+YW82MjRmaAFjLRRcvgTXTMc7Akm+p+Nn+aCBwgMPZpZsfP3Aju fnTPgSAr537X55knmkJ+1YQiRbhhs/sihAyeaDpPKdRkcJH56c+ljnrpeuqt4eg2+Eqg Tq5P4XVNvPCkM9bqwzm11zObF37FAp/gp6978eE1SeBbhDD6OPgbGz6IzTljgVn2inoI xn2E838seRXNHhz5bm3Fa7g3DvBnns4ZabTk91cXJFzeNxTrrwaXwQKPiNUaSvE/TnDe 9HbDGARQr8GSkCoy19igZusNGmRurhj2NOiJqaRbOrtdFm9+ijZYjym7YTq5znSbRLlY Iy/Q== X-Forwarded-Encrypted: i=1; AJvYcCU6uZXeUWgZsC9tdThTVv4As3X5aNedwS7MV4VX8u71MfL1PbSlxP5+beAt+DZpfqNRxsER+ecuUrBFYPuqoYjzKO0E@freebsd.org, AJvYcCWirzTCQBMi2pFwjjCkmyzG1ejPvpegppFZncyOiz0aad4mwwTJmV7s9THE3fIDSKx4SjTa+W/OuxoQk19QTQLz+NCS8ng=@freebsd.org X-Gm-Message-State: AOJu0YxBHnPfhhgUIV6ZYUgrpN2QACP3jVW8vEfq/PVhyNXxZMw4n8lU 2YfBcvyS91Ioph2Ebs9J2802h+tUmrGwU4YVgH/jK7eIB9jbDdK2gT4z9F+J1zrm8yA= X-Gm-Gg: ASbGncvHRD5bJNTqqkvOdxRxcfl9v3xJ9OE36w2X+0Pzx4ZrtHaGURnCq5N5XUHvnz5 BDJLMKCWqKLYRUgUusqnyrLhheFdyzt838f5Pe5A5wFBnmg/dpTSfhUdkG717iwB55OBRn+2/xc fWFWUrwbia58C5rwmPSE/H1YRT+h/uvBCCZks1KhdIKgWj7ZbkSEdGfqLL1XZjtkooxfhfqK7bN 1wAG9J36PedLNTDd1on9NEPZtX21nOHzinVhUdVr2Eci3e30kPTWTbBxZ97SOgoNmLRK90eVi6z urbMcDe/v9X6c5ogVgduOszlgAD6LJK3m5MxBZr/Ohl0akbKp4di6dJavAvCBvxDl08ivEGgRVm H X-Google-Smtp-Source: AGHT+IE6arMyyLvyM1BBJHplldK45/nZnwjdQ6kBKNiNLFehJhBIDjGeFDu0QeS/HebzeWNSofBThA== X-Received: by 2002:a05:6214:5905:b0:6fb:1c3:f527 with SMTP id 6a1803df08f44-702c8ce6b29mr274765996d6.39.1751979292068; Tue, 08 Jul 2025 05:54:52 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-702c4d5ac78sm74945396d6.91.2025.07.08.05.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 05:54:51 -0700 (PDT) Date: Tue, 8 Jul 2025 08:54:49 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 01a679715f68 - main - err(3): print extended error if available Message-ID: References: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bc1KZ4vm3z3Ql8 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] On Mon, Jul 07, 2025 at 07:28:46PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b > > commit 01a679715f68d5e32efecafc1f158eecec3f781b > Author: Konstantin Belousov > AuthorDate: 2025-06-16 21:26:22 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-07 18:44:22 +0000 > > err(3): print extended error if available > > Reviewed by: asomers, brooks > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51141 This seems to cause extended errors to be printed unconditionally: root@freebsd:~ # truncate -r foo bar truncate: foo: No such file or directory (extended error No error) A number of tests fail due to this. Moreover, it doesn't seem useful to print a non-existent extended error. Can the extended error be suppressed in the "no error" case? From nobody Tue Jul 8 12:56:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc1Mk0dvVz60yQv; Tue, 08 Jul 2025 12:56: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1Mj5W7Vz3Rm4; Tue, 08 Jul 2025 12:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KN5MOwNrMPpcUiA5foRhuPr1/XtiaH+g6pw80KFyM1Y=; b=m6aeUQ6hm/h9iZI/j9iaXYWlAb2zsXoKCSbzJ1wNghyJSnSpEchdtWosPj3KSx1WXN3ZrH AR4Z9Em6bD2cSgSemzXtV/kq/WT8kesW+51SecmzlsvepBI6DdcEAyae4xB4/mOV/SZuci b4Ho5Wr+5EE2nA9YVfJKs98u2L+66vKa094lhMOK1xmjKtBdBFQWUYZ4zyZkCm6vEZ3a+g krzujmJfHC5KIk8nAOnwZqEwBYRxOugQ4uRdaBY7U1lw07TwiCVke1zto/xpVu5wJfpllb N0rh2ondQS4yHTpSvV+2SQLDqj17MjxI11K6mTnkpK7Jy4a2luuHImo9gopo7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KN5MOwNrMPpcUiA5foRhuPr1/XtiaH+g6pw80KFyM1Y=; b=LaKDf8u4Hyj+cXV8CGQIDHokLXahn7Kp+lCE8ZqohGDJs918vk+zGA5iDwH/jNQVeIVF8U mgFmK4jaYlJig6WFYI0SM5KZ3PSrw+t0Cqa/F0uO3M/9Vw5lE7ZqKzelgT57EmuXxoSDqj 1XWC+BjJ3OuV92F8+v6VvUD0pb0UJ3vMFCcoN4rxfpjseOMzmnmO7P2l3Fs/KIhMNa6q6m vpL6G6IbkD+Eu9eG5qn6oq1bszV3SwaRNYn0L4y5qD5ArvGimR7FWvCLNGDidjBdT1wqI2 KQ6TNOluDGgMPRNBerwzRw6Gco4pNYoSLYROdkGG+kuDl5c/26STzy2yCRP/xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751979409; a=rsa-sha256; cv=none; b=H9D0oYxi8R7F/u5mSRKBLqu/DmXxoraCRckC+DSx5st7akSrETT69nw5IIU2FPVlXu/+mK MCGfMpaKmFOrUYfn0AO3TndTqOhPap/lqGN3lngrv/S43QWbV+iNFbU3L2zWReeZXZVBL6 OEVZWvFpUD6r1x6+7BY5b6Fy5aL7+qAnxYNw5wMPcAJWSCEBfSKYVOHfoq3zRrcqDim7BG X80HvwJizfNrfnB/AzpoiIncP1UbB9n7Zh/dSRdgu3rLhVymr+KeQiejw+r4NDDbGbRsZg Sr7rDEtzT0fzJHBgGbWQFOO89rxu9VnAtsqglzBJ6m2L+v+xTshRkPigGUd12w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc1Mj4YpvzdHq; Tue, 08 Jul 2025 12:56: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 568Cunmk085963; Tue, 8 Jul 2025 12:56:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568Cun1M085960; Tue, 8 Jul 2025 12:56:49 GMT (envelope-from git) Date: Tue, 8 Jul 2025 12:56:49 GMT Message-Id: <202507081256.568Cun1M085960@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: 1e570722dced - main - cap_dns/tests/dns_test: mark tests as needing network access List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1e570722dced7a3afc0a35b10af047b835e51567 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e570722dced7a3afc0a35b10af047b835e51567 commit 1e570722dced7a3afc0a35b10af047b835e51567 Author: Siva Mahadevan AuthorDate: 2025-06-22 01:02:18 +0000 Commit: Mark Johnston CommitDate: 2025-07-08 12:55:30 +0000 cap_dns/tests/dns_test: mark tests as needing network access Signed-off-by: Siva Mahadevan Reviewed by: markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1738 --- lib/libcasper/services/cap_dns/tests/dns_test.c | 37 ++++++++----------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/lib/libcasper/services/cap_dns/tests/dns_test.c b/lib/libcasper/services/cap_dns/tests/dns_test.c index 76534bbbebad..56d867e474f5 100644 --- a/lib/libcasper/services/cap_dns/tests/dns_test.c +++ b/lib/libcasper/services/cap_dns/tests/dns_test.c @@ -198,18 +198,17 @@ hostent_compare(const struct hostent *hp0, const struct hostent *hp1) static void runtest(cap_channel_t *capdns, unsigned int expected) { - unsigned int result, failure; + unsigned int result; struct addrinfo *ais, *aic, hints, *hintsp; struct hostent *hps, *hpc; struct in_addr ip4; struct in6_addr ip6; int caperr, syserr; - failure = result = 0; + result = 0; hps = gethostbyname("example.com"); if (hps == NULL) { - failure |= GETHOSTBYNAME; fprintf(stderr, "Unable to resolve %s IPv4.\n", "example.com"); } else { hpc = cap_gethostbyname(capdns, "example.com"); @@ -219,7 +218,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hps = gethostbyname2("example.com", AF_INET); if (hps == NULL) { - failure |= GETHOSTBYNAME2_AF_INET; fprintf(stderr, "Unable to resolve %s IPv4.\n", "example.com"); } else { hpc = cap_gethostbyname2(capdns, "example.com", AF_INET); @@ -229,7 +227,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hps = gethostbyname2("example.com", AF_INET6); if (hps == NULL) { - failure |= GETHOSTBYNAME2_AF_INET6; fprintf(stderr, "Unable to resolve %s IPv6.\n", "example.com"); } else { hpc = cap_gethostbyname2(capdns, "example.com", AF_INET6); @@ -250,7 +247,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) syserr = getaddrinfo("freebsd.org", "25", hintsp, &ais); if (syserr != 0) { - failure |= GETADDRINFO_AF_UNSPEC; fprintf(stderr, "Unable to issue [system] getaddrinfo() for AF_UNSPEC: %s\n", gai_strerror(syserr)); @@ -268,7 +264,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hints.ai_family = AF_INET; syserr = getaddrinfo("freebsd.org", "25", hintsp, &ais); if (syserr != 0) { - failure |= GETADDRINFO_AF_INET; fprintf(stderr, "Unable to issue [system] getaddrinfo() for AF_UNSPEC: %s\n", gai_strerror(syserr)); @@ -286,7 +281,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hints.ai_family = AF_INET6; syserr = getaddrinfo("freebsd.org", "25", hintsp, &ais); if (syserr != 0) { - failure |= GETADDRINFO_AF_INET6; fprintf(stderr, "Unable to issue [system] getaddrinfo() for AF_UNSPEC: %s\n", gai_strerror(syserr)); @@ -308,7 +302,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) inet_pton(AF_INET, GOOGLE_DNS_IPV4, &ip4); hps = gethostbyaddr(&ip4, sizeof(ip4), AF_INET); if (hps == NULL) { - failure |= GETHOSTBYADDR_AF_INET; fprintf(stderr, "Unable to resolve %s.\n", GOOGLE_DNS_IPV4); } else { hpc = cap_gethostbyaddr(capdns, &ip4, sizeof(ip4), AF_INET); @@ -319,7 +312,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) inet_pton(AF_INET6, GOOGLE_DNS_IPV6, &ip6); hps = gethostbyaddr(&ip6, sizeof(ip6), AF_INET6); if (hps == NULL) { - failure |= GETHOSTBYADDR_AF_INET6; fprintf(stderr, "Unable to resolve %s.\n", GOOGLE_DNS_IPV6); } else { hpc = cap_gethostbyaddr(capdns, &ip6, sizeof(ip6), AF_INET6); @@ -329,21 +321,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) } } - /* - * If we had any failures, make sure that all lookups failed. If some - * succeeded and some failed, there's a problem with the test or the DNS - * and we should not fail silently. - */ - if (failure != 0) { - ATF_REQUIRE_MSG(failure == (GETHOSTBYNAME | - GETHOSTBYNAME2_AF_INET | GETHOSTBYNAME2_AF_INET6 | - GETADDRINFO_AF_UNSPEC | GETADDRINFO_AF_INET | - GETADDRINFO_AF_INET6 | - GETHOSTBYADDR_AF_INET | GETHOSTBYADDR_AF_INET6), - "expected all tests to fail, got 0x%x", failure); - atf_tc_skip( - "no name lookups succeeded, tests require Internet access"); - } ATF_REQUIRE_MSG(result == expected, "expected 0x%x, got 0x%x", expected, result); } @@ -367,6 +344,7 @@ cap_dns_init(void) ATF_TC(dns_no_limits); ATF_TC_HEAD(dns_no_limits, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_no_limits, tc) { @@ -386,6 +364,7 @@ ATF_TC_BODY(dns_no_limits, tc) ATF_TC(dns_all_limits); ATF_TC_HEAD(dns_all_limits, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_all_limits, tc) { @@ -417,6 +396,7 @@ ATF_TC_BODY(dns_all_limits, tc) ATF_TC(dns_name_limit); ATF_TC_HEAD(dns_name_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_name_limit, tc) { @@ -448,6 +428,7 @@ ATF_TC_BODY(dns_name_limit, tc) ATF_TC(dns_addr_limit); ATF_TC_HEAD(dns_addr_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_addr_limit, tc) { @@ -478,6 +459,7 @@ ATF_TC_BODY(dns_addr_limit, tc) ATF_TC(dns_inet_limit); ATF_TC_HEAD(dns_inet_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_inet_limit, tc) { @@ -509,6 +491,7 @@ ATF_TC_BODY(dns_inet_limit, tc) ATF_TC(dns_inet6_limit); ATF_TC_HEAD(dns_inet6_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_inet6_limit, tc) { @@ -540,6 +523,7 @@ ATF_TC_BODY(dns_inet6_limit, tc) ATF_TC(dns_name_inet_limit); ATF_TC_HEAD(dns_name_inet_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_name_inet_limit, tc) { @@ -581,6 +565,7 @@ ATF_TC_BODY(dns_name_inet_limit, tc) ATF_TC(dns_name_inet6_limit); ATF_TC_HEAD(dns_name_inet6_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_name_inet6_limit, tc) { @@ -622,6 +607,7 @@ ATF_TC_BODY(dns_name_inet6_limit, tc) ATF_TC(dns_addr_inet_limit); ATF_TC_HEAD(dns_addr_inet_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_addr_inet_limit, tc) { @@ -662,6 +648,7 @@ ATF_TC_BODY(dns_addr_inet_limit, tc) ATF_TC(dns_addr_inet6_limit); ATF_TC_HEAD(dns_addr_inet6_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_addr_inet6_limit, tc) { From nobody Tue Jul 8 12:56:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc1Ml3hYjz60ybK; Tue, 08 Jul 2025 12:56: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1Mk6hFHz3Rdh; Tue, 08 Jul 2025 12:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nKxzf8V2+m82F+QPF0+AkjPoNtCk2nTBa9z7xmDQbsc=; b=NH7rOT5ymrfuHQOJxyLmyG6O6F2dRZS06yRBGk0XtIVkf4A7Cu+1u4sjgl+q6pXL+0Aaa1 DnTossEjBIEWqvA/l6L1FEr4kpb2BM28ZES+bwN3omuZyzTjMxtX98ifb5St/QRM0RvXLp gOPMlgcmcYkkpylclGSZyzGOgvZ3mUdVSE33hCbgJLm6ITOOlF4D2IKA4+D20X2EOl4UaN 6JGpk+jxw15nAij/5E27Y4a7yUsEFf14lecvZLSAHhW9In3nlNphKcnOnRMHjs5QdgFQni 7qxddHPOOEUVGpFwzSJYTsFO+mbia6318M+yLwRcnBQ6klzxq3BQx5fcEbkmIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nKxzf8V2+m82F+QPF0+AkjPoNtCk2nTBa9z7xmDQbsc=; b=FCGEJLyvplPfTz23S2MHQ7JeC/IwwnzQ3G0JfANf11wZbX675sdZG0m+m7FX/JOGihLvTG 5+aDQBNQqFo2LM6MhtaZxh5+4axF7kIGJlQxUOBb9kZEJ4zBwzI60sFztWiJjeQTANsbfQ FLhwNzaosj/PJkjdY6hCJZc5nhXl+UfgwB0haCeA+gmqM56Z2+iWOp8nK0ia53jfFN4K3H yPCmGoryg6zLZOORC8+mvI5fuHGaSaezjfoGnLzVREyOJYspq9wKhoa2DNDC81w9e7FiZT YRXIHGGrgLTCiPF7cc2CBwshG38OadjXZs0kMDrvqdRHEmJTpe6ZgEBSc0Nw3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751979411; a=rsa-sha256; cv=none; b=mRSIDCN2kh52cnV+Ac7CBu2HYeTLgz8qokxtVKoYDO6w0PyNSMXQxjA9bfpjjRHI++9OsA QsAQTyNDHVDhNhZ15Zuo5RVr0UbPfbuM9LwVthJ0GyMJAafDbreiZu13HmUQu9x5wSBIX4 Sp/xjx/tE86xEinBx9IY9/6RYSS37h1zgjQMC4zls/6cNWUlF84mGbplKH4/KR1rqYVKBM HBjVRTPzkXQsk7v92X7k2VHimsnfNMVuBFsateErH32qmD+6NsfvOwqLT3kTt+8oVcvf9M UoTzjRG7/JUa4mErSf81u7ddOCzFOvItKpQaT2estSqcjo8JEeL3XkW23vWEGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc1Mk5mpSzdX4; Tue, 08 Jul 2025 12:56: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 568CuomH085998; Tue, 8 Jul 2025 12:56:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568CuoDO085995; Tue, 8 Jul 2025 12:56:50 GMT (envelope-from git) Date: Tue, 8 Jul 2025 12:56:50 GMT Message-Id: <202507081256.568CuoDO085995@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: 26e31700fc7d - main - sysctl_test: Print standard error if sysctl -ao fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 26e31700fc7d9bd033cb157f534c67bf9bc697dd Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=26e31700fc7d9bd033cb157f534c67bf9bc697dd commit 26e31700fc7d9bd033cb157f534c67bf9bc697dd Author: Mark Johnston AuthorDate: 2025-07-08 12:48:40 +0000 Commit: Mark Johnston CommitDate: 2025-07-08 12:56:00 +0000 sysctl_test: Print standard error if sysctl -ao fails MFC after: 1 week --- sbin/sysctl/tests/sysctl_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/sysctl/tests/sysctl_test.sh b/sbin/sysctl/tests/sysctl_test.sh index dfc32a87b212..b4cc7180a0f9 100644 --- a/sbin/sysctl/tests/sysctl_test.sh +++ b/sbin/sysctl/tests/sysctl_test.sh @@ -41,6 +41,7 @@ sysctl_aflag_body() # output and it would all otherwise be saved. sysctl -ao >/dev/null 2>stderr if [ $? -ne 0 ]; then + cat stderr atf_fail "sysctl -ao failed" elif [ -s stderr ]; then cat stderr From nobody Tue Jul 8 13:07:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc1c11K1Cz60ymH; Tue, 08 Jul 2025 13:07:29 +0000 (UTC) (envelope-from fluffy@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1c10Qmhz3X9p; Tue, 08 Jul 2025 13:07:29 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751980049; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Ef5SHuVDjKhtfX+aQlfvkQuMLiWeH0XGFfPcsLEeJ9s=; b=sfspYY6YtHhs6AXWiSGY3TEDxdtTnJ0Jb9USv0ROOkd1k4JWj8veXVY2y9UmFGLBFuT3I1 IBpyQDyBCk6k0NwyuoQseYr3/w7nT4R1HjnoIKXtjTLxXzwCMXmKCJvAvIZSVWDYsEDv7y lqicZNYfuub7mLVhO5oZXjPh6hh+SGR2wz9d45t7tGtqxM2uvYeW8I6uNK8NF1IZn1sl4R fuZTmm7Www2lQXAkFw5gF6ZTiii+NyRVy1tHG3GSDKP2BZAGFrBAX9AKwFSh91tfyfvTEe DiFxeqAXv1HhKWC94n6Y3c4860hLjV7DbTCS89TfpnvAkQ4fzrDBRx4r1ZAgRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751980049; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Ef5SHuVDjKhtfX+aQlfvkQuMLiWeH0XGFfPcsLEeJ9s=; b=mTzjvmvSVB+RFogjdeVmOFLtXCVA3ZXDVl94+m5w9LdyKGszkofjBUnTzJOOa70n2aKaPU CYmtREDqJ4B5rvzXuSprUemhVYnB0FDGRbOFhkgC3cjK+kWLOeYaX/5G5leDM4RvN/iTiK U8wosjXJHMuaywymZoexsi2WydCG6bxKU7s/nZo1xjJwiMqepLbBvRU7IN1nlkbAjP3xCP ihkLVqL4NF1Fcii0ZrVflDYDQr49w7iYoNf2wIyUALXaOzNeKn27+AimkKGyZs+HfSMIGG cxB/uDrRH1Xrh9e4Q5jcPo4GN8/fPUmkLNixAyniURJb4OcAsMQR5hY338syuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751980049; a=rsa-sha256; cv=none; b=dB5lSd86d3qWZWPD7GQkx8Y9oCjqFyplpf0oVblLICNFlJkXO1WrNxniJ5AUmN7Cen3Ki3 Ou+hqZ2rWnqZt+KMx93o1eymeF35KDPllCF/WzUu7kXVkkkVNkygbsX/ifcNvdB0bIJYcB FCVy5N+MmiWW9dI8TclYXU79p8gy65wh5kda8KUlBEV3fzhAiU9AZ7jHzsNP06Cy/zdBOc xyT756FutAZRzyE5Zg2Zg8w96O6xzBWQ7z0hyltauQxbpYXu9vGbaQobTiH+jyLQcOTbiw QAR5jjJZoUeXkdu7gRKLMxAJ9WgtuqBTiwV1AaqjpL4KxpKp6lWKhSvdID4ccw== Received: from [10.80.0.22] (unknown [89.150.40.109]) (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: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bc1bz6bXczRGL; Tue, 08 Jul 2025 13:07:27 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> Date: Tue, 8 Jul 2025 16:07:25 +0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build From: Dima Panov To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> Content-Language: ru, en-GB Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------16CVFKb0TJ65yYUyMSEVpsrr" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------16CVFKb0TJ65yYUyMSEVpsrr Content-Type: multipart/mixed; boundary="------------bcAZu0nbxcrqD15PExq8anzX"; protected-headers="v1" From: Dima Panov To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> In-Reply-To: --------------bcAZu0nbxcrqD15PExq8anzX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQoNCk9uIDA4LjA3LjIwMjUgMTQ6MDksIERpbWEgUGFub3Ygd3JvdGU6DQo+IEhlbGxvIQ0K PiANCj4gT24gMDguMDcuMjAyNSAwNzoyOCwgQ3kgU2NodWJlcnQgd3JvdGU6DQo+PiBJbiBt ZXNzYWdlIDxhR3h4MzcxLUhWMzg0QTByQG1haWwuYnNkNGFsbC5uZXQ+LCAiSGVyYmVydCBK LiBTa3VocmEiIHdyaXRlczoNCj4+PiBPbiBNb24sIEp1bCAwNywgMjAyNSBhdCAwNDowNDo0 NlBNIC0wNzAwLCBDeSBTY2h1YmVydCB3cm90ZToNCj4+Pj4gSW4gbWVzc2FnZSA8YUd3djA2 ckdsZ1c4em1KSUBtYWlsLmJzZDRhbGwubmV0PiwgIkhlcmJlcnQgSi4gU2t1aHJhIiB3cml0 ZXM6DQo+Pj4+PiBPbiBNb24sIEp1bCAwNywgMjAyNSBhdCAxMDozNjozMVBNICswMzAwLCBE aW1hIFBhbm92IHdyb3RlOg0KPj4+Pj4+IEhlbGxvIQ0KPj4+Pj4+DQo+Pj4+Pj4NCj4+Pj4+ PiBCVFcsIGl0IGxvb2tzIGxpa2Ugc3ltbGluayBmb3IgbGlia2FkbTVjbG50LnNvIGlzIGJy b2tlbiBhbmQgcHJvZHVjZWQgYQ0KPj4+IMKgIGJhZA0KPj4+Pj4gwqAgZmlsZQ0KPj4+Pj4+ ICQgbHMgLWxhIGxpYmthZG01Y2xudA0KPj4+Pj4+IGxyd3hyLXhyLXjCoCAxIHJvb3Qgd2hl ZWwgMTPCoCA3IEp1bCAyMDo0MCBsaWJrYWRtNWNsbnQgLT4ga2FkbTVjbG50X21pdA0KPj4+ Pj4+DQo+Pj4+Pj4gaW5zdGVhZCBvZiBhc3N1bWVkIGxpYmthZG01Y2xudC5zbyAtPiBrYWRt NWNsbnRfbWl0LnNvDQo+Pj4+Pj4NCj4+Pj4+Pg0KPj4+Pj4+IFBsZWFzZSByZXZpZXc6DQo+ Pj4+Pj4NCj4+Pj4+PiBkaWZmIC0tZ2l0IGEva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxl IGIva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxlDQo+Pj4+Pj4gaW5kZXggZTM3N2Y5NWY1 YjZlLi5iZTA5ZGQzZTIxMGUgMTAwNjQ0DQo+Pj4+Pj4gLS0tIGEva3JiNS9saWIva2FkbTVj bG50L01ha2VmaWxlDQo+Pj4+Pj4gKysrIGIva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxl DQo+Pj4+Pj4gQEAgLTg4LDcgKzg4LDcgQEAgJHtDSFBBU1NfVVRJTF9TVFJJTkdTX0VSUl9D fTogJHtDSFBBU1NfVVRJTF9TVFJJTkdTX0UNCj4+PiBSUn0NCj4+Pj4+PiDCoMKgwqDCoMKg wqDCoMKgIHJtIC1mIGV0LWMtJHsuUFJFRklYfS5ldCBldC1jLSR7LlBSRUZJWH0uYw0KPj4+ Pj4+DQo+Pj4+Pj4gwqAgYWZ0ZXJpbnN0YWxsOg0KPj4+Pj4+IC3CoMKgwqDCoMKgwqAgJHtJ TlNUQUxMX0xJQlNZTUxJTkt9ICR7U0hMSUJ9ICR7REVTVERJUn0ke0xJQkRJUn0vbGlia2Fk bTVjbG50DQo+Pj4+Pj4gK8KgwqDCoMKgwqDCoCAke0lOU1RBTExfTElCU1lNTElOS30gJHtT SExJQl9OQU1FfSAke0RFU1RESVJ9JHtMSUJESVJ9L2xpYmthZG0NCj4+PiA1Y2xuDQo+Pj4+ PiB0LnNvDQo+Pj4+Pj4NCj4+Pj4+PiDCoCAuaW5jbHVkZSA8YnNkLmxpYi5taz4NCj4+Pj4+ DQo+Pj4+PiBUaGlzIHByb2R1Y2VzIGEgdmFsaWQgc3ltbGluayB0aGF0ICdtYWtlIGRlbGV0 ZS1vbGQnIHdhbnRzIHRvDQo+Pj4+PiByZW1vdmUgYWdhaW46DQo+Pj4+Pg0KPj4+Pj4gbHJ3 eHIteHIteMKgIDEgcm9vdCB3aGVlbMKgwqDCoMKgIDIzIEp1bMKgIDcgMjI6MjYgL3Vzci9s aWIvbGlia2FkbTVjbG50LnNvIC0+DQo+Pj4+PiBsaWJrYWRtNWNsbnRfbWl0LnNvLjEyMQ0K Pj4+Pj4NCj4+Pj4+ICMgbWFrZSBkZWxldGUtb2xkDQo+Pj4+Pj4+PiBSZW1vdmluZyBvbGQg ZmlsZXMgKG9ubHkgZGVsZXRlcyBzYWZlIHRvIGRlbGV0ZSBsaWJzKQ0KPj4+Pj4gcmVtb3Zl IC91c3IvbGliL2xpYmthZG01Y2xudC5zbz8NCj4+Pj4NCj4+Pj4gVGhhbmtzIERpbWEgYW5k IEhlcmJlcnQgZm9yIHJlcG9ydGluZyB0aGlzLiBJdCdzIGJlZW4gZml4ZWQuDQo+Pj4NCj4+ PiBDeSwgSSBhbSBzb3JyeSBmb3Igbm90IGJlaW5nIG1vcmUgcHJlY2lzZS4NCj4+Pg0KPj4+ IERpbWEncyBjaGFuZ2UsIHdoaWNoIGhhc24ndCBiZWVuIGNvbW1pdGVkIHlldCwgZml4ZXMg dGhlIHJlYWwgaXNzdWUgb2YNCj4+PiBjcmVhdGluZyBhIGJhZCBzeW1saW5rLg0KPj4+DQo+ Pj4gSSBqdXN0IHdhbnRlZCB0byBhZGQgdGhhdCBoaXMgZml4IGFsc28gbmVlZHMgcmVtb3Zh bCBvZg0KPj4+IHVzci9saWIvbGlia2FkbTVjbG50LnNvIGluIHRvb2xzL2J1aWxkL21rL09w dGlvbmFsT2Jzb2xldGVGaWxlcy5pbmMuDQo+Pj4NCj4+PiBNYXliZSB1c3IvbGliL2xpYmth ZG01Y2xudCBzaG91bGQgYmUgYWRkZWQgdG8gT3B0aW9uYWxPYnNvbGV0ZUZpbGVzLmluYz8N Cj4+DQo+PiBsaWJrYWRtNWNsbnQuc28gaXMgYSBsZWdpdGltYXRlIHN5bWxpbmsgZm9yIGJv dGggTUlUIGFuZCBIZWltZGFsLiBJbiB0aGUNCj4+IGNhc2Ugb2YgSGVpbWRhbCBpdCBwb2lu dHMgdG8gbGlia2FkbTVjbG50LnNvLjExLiBXaGVyZWFzIGZvciBNSVQgaXQgcG9pbnRzDQo+ PiB0byBsaWJrYWRtNWNsbnRfbWl0LnNvLjEyMS4gVGhlcmUgaXMgbyBsaWJrYWRtNWNsbnQg aW4gTUlULiBJdCBpcw0KPj4gbGlia2FkbTVjbG50X21pdC4gWW91IGNhbiBzZWUgdGhpcyBp biB0aGUgcG9ydCB3aXRoIHBrZyBpbmZvIC1sIGFzIGZvbGxvd3M6DQo+Pg0KPj4gc2xpcHB5 JCBwa2cgaW5mbyAtbCBrcmI1IHwgZ3JlcCBsaWJrYWRtNWNsbnQNCj4+IMKgwqDCoMKgwqDC oMKgwqAgL3Vzci9sb2NhbC9saWIvbGlia2FkbTVjbG50LnNvDQo+PiDCoMKgwqDCoMKgwqDC oMKgIC91c3IvbG9jYWwvbGliL2xpYmthZG01Y2xudF9taXQuc28NCj4+IMKgwqDCoMKgwqDC oMKgwqAgL3Vzci9sb2NhbC9saWIvbGlia2FkbTVjbG50X21pdC5zby4xMg0KPj4gwqDCoMKg wqDCoMKgwqDCoCAvdXNyL2xvY2FsL2xpYi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyLjANCj4+ IHNsaXBweSQNCj4+DQo+IA0KPiBDeSwgaXQgbG9va3MgeW91IHN0aWxsIGhhdmUgc29tZXRo aW5nIHN0YWxlZCBhdCB5b3VyIG1hY2hpbmUgOigNCj4gDQo+IE9uIGEgY2xlYW4gYnVpbGQg Zm9yIHBrZ2Jhc2UgaW4gcG91ZHJpZXJlIHdpdGhvdXQgbXkgcGF0Y2ggaXQgc3RpbGwgcHJv ZHVjZXMgYSBiYWQgc3ltbGluayBhbmQgbm8gY29tcGF0IGlzIHBhY2thZ2VkIGFzIHJlc3Vs dA0KPiANCj4gcm9vdEBhYXJjaDY0On4gIyBwa2cgaW5mbyAtbCAteCBrcmI1IHwgZ3JlcCBs aWJrYWRtNWNsbnQNCj4gIMKgwqDCoMKgwqDCoMKgIC91c3IvbGliL2xpYmthZG01Y2xudF9t aXQuc28uMTIxDQo+ICDCoMKgwqDCoMKgwqDCoCAvdXNyL2xpYi9kZWJ1Zy91c3IvbGliL2xp YmthZG01Y2xudF9taXQuc28uMTIxLmRlYnVnDQo+ICDCoMKgwqDCoMKgwqDCoCAvdXNyL2xp Yi9kZWJ1Zy91c3IvbGliMzIvbGlia2FkbTVjbG50X21pdC5zby4xMjEuZGVidWcNCj4gIMKg wqDCoMKgwqDCoMKgIC91c3IvbGliL2xpYmthZG01Y2xudF9taXQuYQ0KPiAgwqDCoMKgwqDC oMKgwqAgL3Vzci9saWIvbGlia2FkbTVjbG50X21pdC5zbw0KPiAgwqDCoMKgwqDCoMKgwqAg L3Vzci9saWIzMi9saWJrYWRtNWNsbnRfbWl0LmENCj4gIMKgwqDCoMKgwqDCoMKgIC91c3Iv bGliMzIvbGlia2FkbTVjbG50X21pdC5zbw0KPiAgwqDCoMKgwqDCoMKgwqAgL3Vzci9saWIz Mi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyMQ0KPiANCj4gDQoNCiR7U0hMSUJ9IG1hY3JvIGdp dmVzIGEgd3JvbmcgbmFtZSwgY2hlY2sgaXQ6DQoNCiQgbWFrZSAtViBTSExJQg0Ka2FkbTVj bG50X21pdA0KJCBtYWtlIC1WIFNITElCX0xJTksNCmxpYmthZG01Y2xudF9taXQuc28NCiQg cHdkDQovaG9tZS9mbHVmZnkvcmVwby9GcmVlQlNEL0ZyZWVCU0Qtc3JjL2tyYjUvbGliL2th ZG01Y2xudA0KDQoNClNvIHdlIHN0aWxsIG5lZWQgdG8gcGF0Y2ggaXQgOikNCg0KZGlmZiAt LWdpdCBhL2tyYjUvbGliL2thZG01Y2xudC9NYWtlZmlsZSBiL2tyYjUvbGliL2thZG01Y2xu dC9NYWtlZmlsZQ0KaW5kZXggZTM3N2Y5NWY1YjZlLi5kZGI5YjBlOWZlYzUgMTAwNjQ0DQot LS0gYS9rcmI1L2xpYi9rYWRtNWNsbnQvTWFrZWZpbGUNCisrKyBiL2tyYjUvbGliL2thZG01 Y2xudC9NYWtlZmlsZQ0KQEAgLTg4LDcgKzg4LDcgQEAgJHtDSFBBU1NfVVRJTF9TVFJJTkdT X0VSUl9DfTogJHtDSFBBU1NfVVRJTF9TVFJJTkdTX0VSUn0NCiAgICAgICAgIHJtIC1mIGV0 LWMtJHsuUFJFRklYfS5ldCBldC1jLSR7LlBSRUZJWH0uYw0KDQogIGFmdGVyaW5zdGFsbDoN Ci0gICAgICAgJHtJTlNUQUxMX0xJQlNZTUxJTkt9ICR7U0hMSUJ9ICR7REVTVERJUn0ke0xJ QkRJUn0vbGlia2FkbTVjbG50DQorICAgICAgICR7SU5TVEFMTF9MSUJTWU1MSU5LfSAke1NI TElCX0xJTkt9ICR7REVTVERJUn0ke0xJQkRJUn0vbGlia2FkbTVjbG50LnNvDQoNCiAgLmlu Y2x1ZGUgPGJzZC5saWIubWs+DQoNCg0KDQoNCi0tIA0KU2luY2VyZWx5LA0KRGltYSAoZmx1 ZmZ5QEZyZWVCU0Qub3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJp eC1kZXYuZnJlZWJzZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmljZSwgcG9ydHMt c2VjdGVhbSlARnJlZUJTRCB0ZWFtDQoNCg== --------------bcAZu0nbxcrqD15PExq8anzX-- --------------16CVFKb0TJ65yYUyMSEVpsrr Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhtGA0FAwAAAAAACgkQ+4ugndU5jymj OhAAw4y8zKphesPJpdXCYWqvnNblWUfvfzk/FCQ9thMBe4JZzLDIq9a94C09h/+FqNwezCpZYuSB inxdAsAIWYh0c1ba70EnBa3WXTIXolfuUCDw/BS1zPISyqU4zF56DcEyrlQpCcFuYWZUVqcQjxPd SNUUkH/vxDmCNmWPZ6Bo4V1287+TmcmSRe7S14jLzifab+OzUuGr5oRxf1LzVQBIEiOizYgDMJAD +nGKWzoPFCyxxYbKx58KBiQpYmwI8taz6+VDVnKKvHJQYowcYFyanTZ5QW4g/DtF78cU8sMw982o hjW61U5jIUrkrWVtR505HhdXKFYRSblaI0hpkwqb7tricsxXx7PbQKKvSuW6nz1q+lZpjfYc1oik 9S2iKlbAqXuxGgx+Q/XT77R6yuJwbKolVRoUkKuBR7/1PHGzpBfbPyefmgaXEy+XKRAgvDqh8CtO lim7GxVdXctOAr6z1obS0AtBsaKxxkkqXJEOq0KWcb2ct0Dq07JFdSQun7UCyVM0bWa/D65Gf6uR WsUpv2WrOrtAUPHoifkx1WQtCocbcW68hxKGiULN6Xp7U8n5lSjjmS+9f7rAm7mRLdgtVZFXI1k7 IzNbwQHlFshSsjzo2GvpXbsO46A3O9XAGXISugLt/ywOu7Lb4KAQthfCRhSoAmE5DjVX4hcecbJz zmA= =QCTT -----END PGP SIGNATURE----- --------------16CVFKb0TJ65yYUyMSEVpsrr-- From nobody Tue Jul 8 13:54:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc2fK15z0z612fs; Tue, 08 Jul 2025 13:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc2fJ6dr0z3sQj; Tue, 08 Jul 2025 13:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751982873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VrrNHMrOZLwS3arcXYusMOVg/IuLRe3zCrANVGD3Vho=; b=sCtbNrPLDkBisACGXEPiI7PB6BgYhj5pTtYcBRKGE6BKTsU3JK55llC1zwXUmBN16q6m5V TWdHfb5MkVMAJjahmuH1/BqEMO6fEw5JF7blybL4RrNn4f64DBjZO9/ZjnN/gV4n+DCIuB i3+XnrsdjsWvd35xkNJYDZj2nXFtMTKrHrbgU7xUgyOlZGF87DA8pviXGyVC2iia1QalxM IaYYpUUl9D8D9Xop1k3MkhDk4GySslGCAQPGcOlVqlyYyoek7qzEShMBFQ5KSl7dByY/KA VJgLC93lbglS1AgtVl66UKKuJ0d8Qm+QJhcZlD71MVpD4/OBT/G2t9FtFGgIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751982872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VrrNHMrOZLwS3arcXYusMOVg/IuLRe3zCrANVGD3Vho=; b=VN+FZQTRbmiVW+BK/1h4hbyAbRLDkGONVNCfayzsrdtlbYFJIXk+wYpPa71MV8sziZU2xu O2wGrQR9+k0m6qnx9xi/wke8CEQ3T6BsWRm4jMZunmPGmkzhNL1VGDXFyxSauavYfYaZ7d /LUE/V4EcFs7RTpZ2x5fqDPbycJCTChQm7U8FVo2drl/rCQHGOzL2nignXNR5seV7SUZar sWt/efQp4NVMVWWI63yc3F3Xm5aBxh0ZlO21O/26EtMW5LPHCwSHFF8BMmkgxy25xHRcqb c21sg0S3wHEU7e5ueMXi9hjJaECaMJ+sVv76fa7Ko/J2qpFl3nXo4xj+sw9gKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751982873; a=rsa-sha256; cv=none; b=Q1Dlv9WeL/axibbIDDeeZyT/CLfwoiN4KHEXPT9pB7cDCxQP8tRf907MbZv6B3utNo2tHo AHTc56Ds6ZWIsLSTzD/xhFq1aO1Aw13DvfzvrDsVZSh0JdyRPibWyu5yIe8yKTBw0oYs37 6SedTr6PRAEDIssAC+ueny8PqK9o8WNMsaCKh5SJOt+yLWCMPY6t9ySFSO56kgUka2MZWK QIwUKjzlE3R8pgF9l2gKwtnuWfIA5DFaIHDnXCiBL752QgbiDjqgcYdx5fKW1ma5m7TMnh LpQecH0cppj8S/Pv10PtZP/nsUvNwtbl72u7P3B//rYRAFPd4Ts0F8RM6Ye7zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc2fJ6DfVzgH1; Tue, 08 Jul 2025 13:54: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 568DsWOb098025; Tue, 8 Jul 2025 13:54:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568DsWnY098022; Tue, 8 Jul 2025 13:54:32 GMT (envelope-from git) Date: Tue, 8 Jul 2025 13:54:32 GMT Message-Id: <202507081354.568DsWnY098022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0559f30a882d - main - krb5: Install the libkrb5clnt.so symlink with the .so List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0559f30a882d2f606782b68b9432a1e7362486fc Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0559f30a882d2f606782b68b9432a1e7362486fc commit 0559f30a882d2f606782b68b9432a1e7362486fc Author: Cy Schubert AuthorDate: 2025-07-08 13:45:46 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 13:54:27 +0000 krb5: Install the libkrb5clnt.so symlink with the .so For 34 days the libclntkrb5.so symlink was installed as libclntkrb5. Fix this and add the error to ObsoleteFiles.inc. Noted and Makefile patch by fluffy@. Fixes: ee3960cba106 --- ObsoleteFiles.inc | 3 +++ krb5/lib/kadm5clnt/Makefile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 61f948a2c970..faf7c421af80 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250708: For 34 days 15.0-CURRENT installed libkadm5clnt symlink without .so +OLD_FILES+=usr/lib/libkadm5clnt + # 20250626: For 11 days 15.0-CURRENT installed libtpool to the wrong location MOVED_LIBS+=usr/lib/libtpool.so.2 diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile index e377f95f5b6e..ddb9b0e9fec5 100644 --- a/krb5/lib/kadm5clnt/Makefile +++ b/krb5/lib/kadm5clnt/Makefile @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c afterinstall: - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt + ${INSTALL_LIBSYMLINK} ${SHLIB_LINK} ${DESTDIR}${LIBDIR}/libkadm5clnt.so .include From nobody Tue Jul 8 14:21:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc3Ft1Zc6z614Y4; Tue, 08 Jul 2025 14:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Fs74zzz44v8; Tue, 08 Jul 2025 14:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751984514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=46I3BRzgi+IK5IlRs/grw3hr4LHVCSilXO/Fc1+DO7M=; b=XFmStEGhpd+VgEJOX/OxCf2gsU0f9kjJb08HWJnDqX9WnI7C085O3Pcl0KtiVgjLTE5HL2 jH3tNDXXZKsb32fk9L1abz9/HGTiIJwa+9cZu7TFLdHbiJjIF3MQ/Qr6+d3s/5+i+I60iy GFWWibCNJsTgRkkjmBfoMPb+20da/X0X0wdt85/66Ro7NdFeg1SH6nIjdZDXI5GKyV8lJ2 puyQXToTj6/G5+L+T0+/Q5dvOmW1aLWKacq/7DFGs31OeJLC8i5z/eDxeLmMFch1edurDA BezufIjNi2r+pYqu5xYsWg03Crah/ntUoFEvm+E4XGa3IjckMyBFoHhiU9lfXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751984514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=46I3BRzgi+IK5IlRs/grw3hr4LHVCSilXO/Fc1+DO7M=; b=FP2siglz0fliVndZlMweDfirGfww2jqDR4RYGvHGz95HbvRzcUBikjtGMxo8Xkalv2hhMV Q3ct+1oK5bmXMka+jfQv0NBFaSeg6tHFKBuqu5Fl4OPmJy+uzXz/CZ/bP0QFP8nlkFE0dy CIg67vHU34uuo6yHhdRxo64J3UN7PCpmXNM0//jH0EL4XzQG8pRAP6iKwGN2oSnZrVaSeU w8IA5glBHTjzeLtKlz8UjEpz6/Sq2yWqbHEWccCqPo6OD93HEyUskOa7Z5kM7omFxZM3Sx z4gz8Qt0TC9b7LRXLmKXOMu3QOEQ/cQGqZLXZ9vLb2wf1Dl6Wkj3AOC3BViiCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751984514; a=rsa-sha256; cv=none; b=EqaE3NlL4Dq/C8jW/Zk8qzGvkhen+cwHZjynJMELc7k+K4gvpq9FbMOHETbeEHIyBoDeTL yZlVmgG5qcAQ7J95uFVlfXS2C3eNHUKVjVfWwNwx3tUW1bx6uYk1gTmX9BJY8tKhnvvxhw V8vFj7NqvwTXeMD/e2Yuyd99Kc7dfg/i869EdLb9CyCJW/zRjP58tNiMcaFyGCaWnKr/3Q G8Q+BFM2LphCXkM9OGVbNBkdehZK2+80/lvudgiJ4FEa/mb8fbPh0B1yiNnIHxzU9IOTgO aHEOgyWASAx0p11kYyIdyfUneHJZOFxFOz+Iih5zDFMkYsvY+Xctx3zwJQgG3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc3Fs6RKDzgwX; Tue, 08 Jul 2025 14:21: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 568ELrJO052227; Tue, 8 Jul 2025 14:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568ELrEl052224; Tue, 8 Jul 2025 14:21:53 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:21:53 GMT Message-Id: <202507081421.568ELrEl052224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Takanori Watanabe Subject: git: 879944679668 - main - ichiic: Add PCI id for Arrow Lake. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: takawata X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87994467966806ffbd1f500b510858909c736b88 Auto-Submitted: auto-generated The branch main has been updated by takawata: URL: https://cgit.FreeBSD.org/src/commit/?id=87994467966806ffbd1f500b510858909c736b88 commit 87994467966806ffbd1f500b510858909c736b88 Author: Takanori Watanabe AuthorDate: 2025-06-28 02:38:39 +0000 Commit: Takanori Watanabe CommitDate: 2025-07-08 14:21:03 +0000 ichiic: Add PCI id for Arrow Lake. Add PCI id for Arrow Lake to attach iic driver Reviewed by: wulf, mav Differential Revision: https://reviews.freebsd.org/D51107 --- sys/dev/ichiic/ig4_pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index 0195466150eb..3a49e220e335 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -186,6 +186,12 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_METEORLAKE_M_I2C_3 0x7e518086 #define PCI_CHIP_METEORLAKE_M_I2C_4 0x7e7a8086 #define PCI_CHIP_METEORLAKE_M_I2C_5 0x7e7b8086 +#define PCI_CHIP_ARROWLAKE_U_I2C_0 0x77788086 +#define PCI_CHIP_ARROWLAKE_U_I2C_1 0x77798086 +#define PCI_CHIP_ARROWLAKE_U_I2C_2 0x777a8086 +#define PCI_CHIP_ARROWLAKE_U_I2C_3 0x777b8086 +#define PCI_CHIP_ARROWLAKE_U_I2C_4 0x77508086 +#define PCI_CHIP_ARROWLAKE_U_I2C_5 0x77518086 struct ig4iic_pci_device { uint32_t devid; @@ -316,6 +322,12 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_METEORLAKE_M_I2C_3, "Intel Meteor Lake-M I2C Controller-3", IG4_TIGERLAKE}, { PCI_CHIP_METEORLAKE_M_I2C_4, "Intel Meteor Lake-M I2C Controller-4", IG4_TIGERLAKE}, { PCI_CHIP_METEORLAKE_M_I2C_5, "Intel Meteor Lake-M I2C Controller-5", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_0, "Intel Arrow Lake-H/U I2C Controller-0", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_1, "Intel Arrow Lake-H/U I2C Controller-1", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_2, "Intel Arrow Lake-H/U I2C Controller-2", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_3, "Intel Arrow Lake-H/U I2C Controller-3", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_4, "Intel Arrow Lake-H/U I2C Controller-4", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_5, "Intel Arrow Lake-H/U I2C Controller-5", IG4_TIGERLAKE}, }; static int From nobody Tue Jul 8 15:12:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc4NS6nskz6175L; Tue, 08 Jul 2025 15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc4NS54r1z3JTw; Tue, 08 Jul 2025 15:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751987560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vu/IZjMMnpzDYYMqaAHjuV6erZj/FIILVmMjHRYMSoM=; b=qYrUA5lpJljEqmkz1O95cxlodvwKoT7b63ORkxAAcH2InXWAaQfIlAuftzyTX7VQZAD+2B XCzgP58ShaR8GR3vY/HQZEdUFbnfOojmntd5I4BpO8hPhr75lykKckE+x5uo/e5k7obC2t sMHiwHaDOeDRnP3cdjJByd0w2Dx/FJfd+lRqFvLkXJeVlsn4Erv7hGaX+EFZ2O6vyiW0ju 0wbKGoQsuXuank8opqLSCCYcNBkQPX51ureWrtmo3zlzR+J0wvQ3eaZ6RFhbztAY2cCjsR rw5b0FE7Yn6MAlUaX7dc6d3gR8I6t8V4vPokl/fKpK3KOw6IT4ErMdmJDTe+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751987560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vu/IZjMMnpzDYYMqaAHjuV6erZj/FIILVmMjHRYMSoM=; b=WLLztq2hehoSem8Os9WSBgqKsWbuJg7GyLJJecNf2f8WsQy3PFeF0XPoCNTFG3Wqsi2kvq DAMH6H7x5yNxPJzBJ/1jyqgly1JxrgHwAoyOtov68ZkV7Vec0OdgWCUIWnDE+1T9u67lkW G5QgukiWXaQ/qD+VX9KgdYFAoMasu78aRWhLfLlL8hEZ0G9OWR6W1NnK+NN1NBkZk1ElR5 SqZ5hiVDwOkZghMv4aM1o+Bia4BUhW/TsEJg4Ono4S6EpPEyZpxXgJpeLACBmKyT9XrAZw WA9aSzfqsTbZ6x1g5XfHd4gDpD1br2zVVYCE0qPxKaCpnZaCvz84sPQTom2erg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751987560; a=rsa-sha256; cv=none; b=cz5z6a6DTB5HQ3F2oXBFIrw3hVZNJxxbg/tOPLuZlCmOcqSpH8hNZ/09+AYqWJhAtNJaV3 umAfdf7ie8m+KVtaAJtaT6dEaIdXRfhHHjCLyW3XSsNI4PVdCmMAforxvFc6NTu5QYlEDO PeJ07OJocPAjn0ES9CwqMCkW+OTx5fcNZ94zGpxntw9OUWQPsav+thNfaWuMo1rclnHDUZ go3o/EgSdexkanLV9YO+3Ki+WbxhNkm8Op9iapKhzxl+BbQOY7LGS77ChksqiF4MsPE+eq TjqefESFDs6QW3SKnxPuvmH09WAnncXGswFUvi9LpWwb7jizHwWDVb1A7onjAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc4NS4Vrtzj8k; Tue, 08 Jul 2025 15: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 568FCe6g049410; Tue, 8 Jul 2025 15: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 568FCeX8049407; Tue, 8 Jul 2025 15:12:40 GMT (envelope-from git) Date: Tue, 8 Jul 2025 15:12:40 GMT Message-Id: <202507081512.568FCeX8049407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f84a0da4e0608a970c775f3d605f8de2b0b8d322 Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=f84a0da4e0608a970c775f3d605f8de2b0b8d322 commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 Author: ShengYi Hung AuthorDate: 2025-06-07 19:43:15 +0000 Commit: ShengYi Hung CommitDate: 2025-07-08 15:11:41 +0000 libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb THe member bNumDeviceCapabilities is referred to as bNumDeviceCaps in the upstream libusb project. To improve compatibility, we are renaming the member accordingly. For backward compatibility, a mocro will be defined to map bNumDeviceCapabilities to bNumDeviceCaps. See: https://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 Reviewed by: kevans Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50740 --- lib/libusb/libusb.h | 5 ++++- lib/libusb/libusb10_desc.c | 11 ++++++----- lib/libusb/libusb20_desc.h | 6 +++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 0aad29aa4ecc..491af3d0a5ec 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t wTotalLength; - uint8_t bNumDeviceCapabilities; +#ifndef bNumDeviceCapabilities +#define bNumDeviceCapabilities bNumDeviceCaps +#endif + uint8_t bNumDeviceCaps; struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap; struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; struct libusb_bos_dev_capability_descriptor **dev_capability; diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c index 3e36009cbb3a..5f4c46740688 100644 --- a/lib/libusb/libusb10_desc.c +++ b/lib/libusb/libusb10_desc.c @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, int len, ptr->bDescriptorType = dtype; ptr->wTotalLength = ((const uint8_t *)buf)[2] | (((const uint8_t *)buf)[3] << 8); - ptr->bNumDeviceCapabilities = ((const uint8_t *)buf)[4]; + ptr->bNumDeviceCaps = ((const uint8_t *)buf)[4]; ptr->usb_2_0_ext_cap = NULL; ptr->ss_usb_cap = NULL; - ptr->dev_capability = calloc(ptr->bNumDeviceCapabilities, sizeof(void *)); + ptr->dev_capability = calloc(ptr->bNumDeviceCaps, + sizeof(void *)); if (ptr->dev_capability == NULL) { free(ptr); return (LIBUSB_ERROR_NO_MEM); @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, if (dlen >= 3 && ptr != NULL && dtype == LIBUSB_DT_DEVICE_CAPABILITY) { - if (index != ptr->bNumDeviceCapabilities) { + if (index != ptr->bNumDeviceCaps) { ptr->dev_capability[index] = malloc(dlen); if (ptr->dev_capability[index] == NULL) { libusb_free_bos_descriptor(ptr); @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, } if (ptr != NULL) { - ptr->bNumDeviceCapabilities = index; + ptr->bNumDeviceCaps = index; return (0); /* success */ } @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos) if (bos == NULL) return; - for (i = 0; i != bos->bNumDeviceCapabilities; i++) + for (i = 0; i != bos->bNumDeviceCaps; i++) free(bos->dev_capability[i]); free(bos->dev_capability); free(bos); diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h index 017148a34b1c..0f7c9294ebc8 100644 --- a/lib/libusb/libusb20_desc.h +++ b/lib/libusb/libusb20_desc.h @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); +#ifndef bNumDeviceCapabilities +#define bNumDeviceCapabilities bNumDeviceCaps +#endif + #define LIBUSB20_BOS_DESCRIPTOR(m,n) \ m(n, UINT8_T, bLength, ) \ m(n, UINT8_T, bDescriptorType, ) \ m(n, UINT16_T, wTotalLength, ) \ - m(n, UINT8_T, bNumDeviceCapabilities, ) \ + m(n, UINT8_T, bNumDeviceCaps, ) \ LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); From nobody Tue Jul 8 15:20:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc4Yp5D1wz617fh; Tue, 08 Jul 2025 15:20:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.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 4bc4Yp01gzz3LnM; Tue, 08 Jul 2025 15:20:45 +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 Z585uhXCu5MqyZA7huhMSn; Tue, 08 Jul 2025 15:20:45 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id ZA7fulQOXWbOaZA7gu0CHg; Tue, 08 Jul 2025 15:20:45 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=686d374d a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=S-1b6JwnAAAA:8 a=YxBL1-UpAAAA:8 a=x7Y1GQRRBOaA60SGN5cA:9 a=QEXdDO2ut3YA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=jHPkhvgQCurpnRnmkKlz:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id C445E97; Tue, 08 Jul 2025 08:20:42 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (Postfix) with ESMTP id B0B86302; Tue, 08 Jul 2025 08:20:42 -0700 (PDT) Date: Tue, 8 Jul 2025 08:20:42 -0700 From: Cy Schubert To: Dima Panov Cc: "Herbert J. Skuhra" , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: <20250708082036.039eb96f@slippy> In-Reply-To: <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4xfL24ZvSFkXm2w0E3+QIE9lBbf6RpSHIkbFfTcNDbTH07NiIvTRVqbSox2KW+cK0me+s78XhSyeque+2f4gSKn+34p1Z1z9DZf3Hiat1edGlc/vw579xX 3FAdn4k5m/9GDvwasuQeEqP0z6mdAB5Mx4ROb0guSzGIUBplea+sPNAwQLB0QccodefNwIebYtS4ckpPMyZW8qXTCMU7+DbQJMruOSpuim92LIRL8ROSF+2M iGx8w/XzNzbBm4N1SPgIwirUYvT0gaT0ZJNwW4KKQUtahW24wDkQDYkq8LINRXVyaJcEn2lkAlTI2MaRiFR08GAdDHcHVsJZcx1quq2uXYrbBPuelmphS1HB XmVhS4Mqzg5CFARvJe/owjpN8u2DRA== X-Rspamd-Queue-Id: 4bc4Yp01gzz3LnM 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] On Tue, 8 Jul 2025 16:07:25 +0300 Dima Panov wrote: > On 08.07.2025 14:09, Dima Panov wrote: > > Hello! > >=20 > > On 08.07.2025 07:28, Cy Schubert wrote: =20 > >> In message , "Herbert J. Skuhra" wr= ites: =20 > >>> On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: =20 > >>>> In message , "Herbert J. Skuhra" = writes: =20 > >>>>> On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: =20 > >>>>>> Hello! > >>>>>> > >>>>>> > >>>>>> BTW, it looks like symlink for libkadm5clnt.so is broken and produ= ced a =20 > >>> =C2=A0 bad =20 > >>>>> =C2=A0 file =20 > >>>>>> $ ls -la libkadm5clnt > >>>>>> lrwxr-xr-x=C2=A0 1 root wheel 13=C2=A0 7 Jul 20:40 libkadm5clnt ->= kadm5clnt_mit > >>>>>> > >>>>>> instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > >>>>>> > >>>>>> > >>>>>> Please review: > >>>>>> > >>>>>> diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Make= file > >>>>>> index e377f95f5b6e..be09dd3e210e 100644 > >>>>>> --- a/krb5/lib/kadm5clnt/Makefile > >>>>>> +++ b/krb5/lib/kadm5clnt/Makefile > >>>>>> @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRI= NGS_E =20 > >>> RR} =20 > >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rm -f et-c-${.PRE= FIX}.et et-c-${.PREFIX}.c > >>>>>> > >>>>>> =C2=A0 afterinstall: > >>>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${INSTALL_LIBSYMLINK} ${SHLI= B} ${DESTDIR}${LIBDIR}/libkadm5clnt > >>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${INSTALL_LIBSYMLINK} ${SHLI= B_NAME} ${DESTDIR}${LIBDIR}/libkadm =20 > >>> 5cln =20 > >>>>> t.so =20 > >>>>>> > >>>>>> =C2=A0 .include =20 > >>>>> > >>>>> This produces a valid symlink that 'make delete-old' wants to > >>>>> remove again: > >>>>> > >>>>> lrwxr-xr-x=C2=A0 1 root wheel=C2=A0=C2=A0=C2=A0=C2=A0 23 Jul=C2=A0 = 7 22:26 /usr/lib/libkadm5clnt.so -> > >>>>> libkadm5clnt_mit.so.121 > >>>>> > >>>>> # make delete-old =20 > >>>>>>>> Removing old files (only deletes safe to delete libs) =20 > >>>>> remove /usr/lib/libkadm5clnt.so? =20 > >>>> > >>>> Thanks Dima and Herbert for reporting this. It's been fixed. =20 > >>> > >>> Cy, I am sorry for not being more precise. > >>> > >>> Dima's change, which hasn't been commited yet, fixes the real issue of > >>> creating a bad symlink. > >>> > >>> I just wanted to add that his fix also needs removal of > >>> usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. > >>> > >>> Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.i= nc? =20 > >> > >> libkadm5clnt.so is a legitimate symlink for both MIT and Heimdal. In t= he > >> case of Heimdal it points to libkadm5clnt.so.11. Whereas for MIT it po= ints > >> to libkadm5clnt_mit.so.121. There is o libkadm5clnt in MIT. It is > >> libkadm5clnt_mit. You can see this in the port with pkg info -l as fol= lows: > >> > >> slippy$ pkg info -l krb5 | grep libkadm5clnt > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt.so > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt_mit.so > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt_mit.so.12 > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt_mit.so.12.0 > >> slippy$ > >> =20 > >=20 > > Cy, it looks you still have something staled at your machine :( > >=20 > > On a clean build for pkgbase in poudriere without my patch it still pro= duces a bad symlink and no compat is packaged as result > >=20 > > root@aarch64:~ # pkg info -l -x krb5 | grep libkadm5clnt > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/libkadm5clnt_mit.s= o.121 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/debug/usr/lib/libk= adm5clnt_mit.so.121.debug > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/debug/usr/lib32/li= bkadm5clnt_mit.so.121.debug > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/libkadm5clnt_mit.a > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/libkadm5clnt_mit.so > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib32/libkadm5clnt_mit= .a > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib32/libkadm5clnt_mit= .so > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib32/libkadm5clnt_mit= .so.121 > >=20 > > =20 >=20 > ${SHLIB} macro gives a wrong name, check it: >=20 > $ make -V SHLIB > kadm5clnt_mit > $ make -V SHLIB_LINK > libkadm5clnt_mit.so > $ pwd > /home/fluffy/repo/FreeBSD/FreeBSD-src/krb5/lib/kadm5clnt >=20 >=20 > So we still need to patch it :) >=20 > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > index e377f95f5b6e..ddb9b0e9fec5 100644 > --- a/krb5/lib/kadm5clnt/Makefile > +++ b/krb5/lib/kadm5clnt/Makefile > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c >=20 > afterinstall: > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > + ${INSTALL_LIBSYMLINK} ${SHLIB_LINK} ${DESTDIR}${LIBDIR}/libkadm5c= lnt.so >=20 > .include Thanks for the patch. I've pushed this with an ObsoleteFiles.inc change to fix the brokenness. Thanks for pointing this out. --=20 Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=3D0 From nobody Tue Jul 8 15:44:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc54l1q5Jz619CL; Tue, 08 Jul 2025 15:44: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc54k6tBsz3XQS; Tue, 08 Jul 2025 15:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751989447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6IBlw3fcVEurwcHvaG+8xKqjlb/ePpuJuJPIFCh5G4=; b=GVqw9knXE+BY1IfEODMfV5tUwh2WRN89L2ndqzfoQt+EOyUUNBd6SexIeMv8tQy3QRFrk8 wZRCsM3bkYfyv40xd6yywOc8v0HqmrymiSXOhSgdpoU9NC+h3hHPg1n1RbUNdVHA2QdmUe qyrYxw6Imyr54cXXYW/0yjThQDMapMsVaBOSOHvlakHRuR+zRNxQOQEhNmDpnE9Cjj6ItF Ed0v04BxF3kECJF39tbKIcGkaSdkRULXvhDgpb0s3SHYQp4JuSZkwPgt+liJQ1pDzITphp g5NeUjs7guy7/tVWCw24aHs45TlcJE531NYeTTnUZsavEvBgaLDOW6TovvLltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751989447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6IBlw3fcVEurwcHvaG+8xKqjlb/ePpuJuJPIFCh5G4=; b=IgW6YEtyqYLlEuW1QRPW0+UJCAsJj4nnnBb8pT3K3nDvxqz9rIoZGGgTVwt6USmnHU4ioK fVOPW8/JYda2b9l8olS5xNCcSfc7oGCnBGfyZpZ+qq/tQ1tx/G5ySInMKQZrR+Ig4juH24 6jdMozxNf1UD8UUYgwLwqCu0N6hIuK1ekBqt+58RyzkDfdx65FvcxCpVI+XinAJ2/fn0Ih 38rsMNpurqifj/WgcWnNngj67/borfFQdmfW6KVfi9nafqOt5P4ON/c+DuO4ybQn1a2hnG 35T8glHHp22jJ51+PK95uI/pNUkC1SQjb4J0toj+nvz4+q7OHIRQ6LMYgrXzhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751989447; a=rsa-sha256; cv=none; b=GZuCJATlSqdbVLIcAxrfcHy4OP0FKyRdPFKU3VdKp4pIHzZS6b1IXHZ0tLcbpCNVzXXuhT x2R16ZCRRSiPt1tyRa8y+gUW01J6t2r54X+wJPuv49vCiX86nGi4cSwUkbpEEpXkPqi6xn yt9+5XBmlpE/5FGupwz0qBr2kuqcM2gpxHpWRdeEOP3PG352B2nbSHRPP+6CXrwX7i3u6C Bw6+wCGzDWs8gchCV5Ir80JV9gRJ1EwzQMmX4jIbabnohDnI+wytbHXQdIaYwGLD8hzkgw xx690WlOhbc/n63bjmQcsS1mISQFcQjBDSBGFxkdbwJfENbwGKeo8Jto32gw1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc54k6Rsqzk63; Tue, 08 Jul 2025 15:44: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 568Fi68a005532; Tue, 8 Jul 2025 15:44:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568Fi6uN005529; Tue, 8 Jul 2025 15:44:06 GMT (envelope-from git) Date: Tue, 8 Jul 2025 15:44:06 GMT Message-Id: <202507081544.568Fi6uN005529@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: 9911028f53d5 - main - libc: mkostemp(3) should support O_CLOFORK List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9911028f53d5c7504256289d3e56f6592a5a1247 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9911028f53d5c7504256289d3e56f6592a5a1247 commit 9911028f53d5c7504256289d3e56f6592a5a1247 Author: Ricardo Branco AuthorDate: 2025-07-07 16:05:01 +0000 Commit: Mark Johnston CommitDate: 2025-07-08 15:43:39 +0000 libc: mkostemp(3) should support O_CLOFORK Reviewed by: kib, markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/1758 --- lib/libc/stdio/mktemp.3 | 7 ++++--- lib/libc/stdio/mktemp.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdio/mktemp.3 b/lib/libc/stdio/mktemp.3 index 2b8b2d6c9e44..8d38dd2cd57e 100644 --- a/lib/libc/stdio/mktemp.3 +++ b/lib/libc/stdio/mktemp.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2019 +.Dd July 07, 2025 .Dt MKTEMP 3 .Os .Sh NAME @@ -101,9 +101,10 @@ The permitted flags are .Dv O_DIRECT , .Dv O_SHLOCK , .Dv O_EXLOCK , -.Dv O_SYNC +.Dv O_SYNC , +.Dv O_CLOEXEC and -.Dv O_CLOEXEC . +.Dv O_CLOFORK . .Pp The .Fn mkstemps diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 8aff226acf14..a2f80ee7b0dd 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -121,7 +121,7 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) if ((doopen != NULL && domkdir) || slen < 0 || (oflags & ~(O_APPEND | O_DIRECT | O_SHLOCK | O_EXLOCK | O_SYNC | - O_CLOEXEC)) != 0) { + O_CLOEXEC | O_CLOFORK)) != 0) { errno = EINVAL; return (0); } From nobody Tue Jul 8 15:55:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc5LR2kmWz619Xk; Tue, 08 Jul 2025 15:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc5LR20RHz3bZ2; Tue, 08 Jul 2025 15:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751990159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SRxIU92VwywbsA12F4xYbWhk1UWp37GcCpLwPSlGIQI=; b=HW8Cnyz31SIyaBp4hnsKPWKdvbK7gTtQBCOX5iDieZzim8/Ai93iVciZ6E6Ohwj6ZeddJF JtDjgvEcpsRp6SMF0TM+ED+u86rPprPQbaUAZLBJ0X8iHeYT0e04D4DgHGU3VNRLrd0WbM jSL5AwM/o1N2BP4TMmDmdfGbQhxgrNJYMa9wHz0WLstBJ4wk1yefPhAGpvTaT6an84Aypq BGSbFUZTX/IIYFaMi2XddobKc3VhS83NOMxm0maFVCDDXBabuKOIWH3BrsZz4Z9hKJEMgw W2R/AXy702leFNxYxga1pqqEc+42WPFazhbxI0/XK/HiY1CGHoxC4VCUJOEqMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751990159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SRxIU92VwywbsA12F4xYbWhk1UWp37GcCpLwPSlGIQI=; b=SisehNfWtZCDHSs49LqZZoqrjTooFOSnc7tXPwBPFWEJaftTG8oYBUnzRyNMcbV15BcsxY hU/gjILoa0Rl2UcMbxXv8r3bNCPMPH26E1ffnS9DEhmhDo5QsxBeeSRpUnShH+2EIdR7kh 1xt1+bXf8AafDhBXLfJCOlTl7Dra5GU0061QqI0k7lIC4f5mKnVEAmQhl68v2PyDIWk03V dDLeTcxN8rU+NnkUbK2XSU35agQdxWyGBwZ/1QRUXhv7yksu98gT0cbnFc4FjWsSSsCRcN 6nQKVlWFUJXdq9qD42ewarohwSblubLqMxZh++og5B3wOMRlInAr34am/yPQuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751990159; a=rsa-sha256; cv=none; b=aXuGB3DpaZvfq79MUBrnGRL0uWSLhCA12E9EtHvGSEsFRogmJdwztudnpMNoIcmwGS1oX/ ZObUovWian1LVLm91IBizbv0qb3EdKbMWpDPAstMAXgKKJ3RGYhVvNe9iWuAHZDYDrBjF2 bsaf4DFOvMjhP1GJGY4iqrbP4mlGRF4ms9iQUDQxb3NdhjrKgGTDiBgrTatsRkMjnnuP7p eucTyv6yDza2hSEI4NWMWhXLcD/N2Sc8Av+0bOjDGsyY8hr5gKGiV0b1TuV2TEL9B+YXqu O2rJ6oiUenBIVANbRvz1L6cmHQjrJXVEJeHDot0QwuGNINtLxy5Wymnl9aaCdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bc5LR1Jmpzjpg; Tue, 08 Jul 2025 15:55: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 568FtwHa024691; Tue, 8 Jul 2025 15:55:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568FtwIH024688; Tue, 8 Jul 2025 15:55:58 GMT (envelope-from git) Date: Tue, 8 Jul 2025 15:55:58 GMT Message-Id: <202507081555.568FtwIH024688@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: 72c848089f3b - main - libc: only append exterr herald and text if exterr was recorded List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 72c848089f3b03ee31208ca18f652a16d8fb8352 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72c848089f3b03ee31208ca18f652a16d8fb8352 commit 72c848089f3b03ee31208ca18f652a16d8fb8352 Author: Konstantin Belousov AuthorDate: 2025-07-08 14:01:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-08 15:55:54 +0000 libc: only append exterr herald and text if exterr was recorded __uexterr_format: return empty string on no error, instead of "No error" err(): check for the first symbol of the exterr to decide if there is anything to print. Requested and reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51204 --- lib/libc/gen/err.c | 2 +- lib/libc/gen/uexterr_format.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index cdce20af5a91..16cbe27693e7 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -119,7 +119,7 @@ vexterr(bool doexterr, int code, const char *fmt, va_list ap) fprintf(err_file, ": "); } fprintf(err_file, "%s", strerror(code)); - if (doexterr && extstatus == 0) + if (doexterr && extstatus == 0 && exterr[0] != '\0') fprintf(err_file, " (extended error %s)", exterr); fprintf(err_file, "\n"); } diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c index 86ba40234ae4..e8ddfbd578e3 100644 --- a/lib/libc/gen/uexterr_format.c +++ b/lib/libc/gen/uexterr_format.c @@ -20,7 +20,7 @@ __uexterr_format(const struct uexterror *ue, char *buf, size_t bufsz) if (bufsz > UEXTERROR_MAXLEN) bufsz = UEXTERROR_MAXLEN; if (ue->error == 0) { - strlcpy(buf, "No error", bufsz); + strlcpy(buf, "", bufsz); return (0); } if (ue->msg[0] == '\0') { From nobody Tue Jul 8 19:09:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc9dn4k8qz61NXh; Tue, 08 Jul 2025 19:09:33 +0000 (UTC) (envelope-from jhb@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc9dn3Wwtz40Pm; Tue, 08 Jul 2025 19:09:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752001773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=15XHbGCgodpIKypuAMBaBj13ZRLmWPNL2wkTPxBEr08=; b=F3Wv1JiF5pId0TdjHHqsmLkZoMhvwUsUrVMjSU/Y3TUbQEG56bTTRIvZGO1bKRJlxhyycW TwxnG6ohUwokVEvuKL9UGKikLNdTWwVvMHviYbuYmsH8uj6/z8mXfM6n4wegj3Qqk1yLin RQpNHfgkxAlhSLJxGDF0DQ7jywefVGJxkVCy3POdBfT8jNyjjkDv3gyUbLMC3kvUsfvCsO SSP2g/uK05ZISuG/LvEZ/g+Ziz+wnYRaEl+5l7+28TsyRsYZ8TxFlfGpKakPAmRPmhP8D+ wlTuybYtcTy4uhXGWaBGRgNODK6jg0mCkjqNnQ3oS9LR1NJbRQZizwe3lpv0JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752001773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=15XHbGCgodpIKypuAMBaBj13ZRLmWPNL2wkTPxBEr08=; b=mSfVWf+rHDBuGJjc79Bdf5N16namVndqfGKdgAPbiZP0LVUHu3MZ7gsvhPBYjTMoL2HX4T iuAsbvhKODHl5+gVOGEVX/gTGlk7Nu4r36sPlwkQccKJFx5N8naHMm4N8I1IfyGWsMOkcS pfE/E0cEfY5vEYM1SUX7t3U4dumVeJMO8McOzC9yZKYeZS+ttWC6uuh+/QcSCtWsC0F1mc IOnT1Ms/En4daz0m3WelfDsDgNyutSnNP+w2oXTP8mz0lU2D95ItiSbJAHT7DIiyWlbczg HkpXHMvFvPQQy5eZjUQB5SrJbsLyMrpdP2jiYImZ24M+8o2MMV6qRhujMC3fEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752001773; a=rsa-sha256; cv=none; b=YM9nrQVIaYLyvzgLp9Y8AxetjP7GOPkZDd7r4R3Zzh9w6kp99YMd2LMjgnN9jXrycitywS iA3B/v4DZbClR+oRK5QmTc0/5gSCITlc902Bh49bb7dZBgjVdU09P8gbsmMM9CooEunZTK 9NoBfyKOe+ZAxv7tH8OGU+/Uli4pYxuPSGB6Vh3d3fuL/Ef11eSUK5FwA/Z8OkGyJHxAqu /ejDvXf1TztdmuQIJKGpybStL7Z1Zdx4JH1kECKrmMV+XWOXVnC2tWmpH0t9xAAjCIM1r7 euDxiGfxYCH3EVt3paINtcKMsTCI8JHjIopuNyt96WT3XztN6XRTBJyO3trVZg== Received: from [IPV6:2601:5c0:4200:b830:7819:6f52:6cbb:eb54] (unknown [IPv6:2601:5c0:4200:b830:7819:6f52:6cbb:eb54]) (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 4bc9dn1PhZzqQg; Tue, 08 Jul 2025 19:09:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 8 Jul 2025 15:09:32 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 01a679715f68 - main - err(3): print extended error if available Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/7/25 15:28, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b > > commit 01a679715f68d5e32efecafc1f158eecec3f781b > Author: Konstantin Belousov > AuthorDate: 2025-06-16 21:26:22 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-07 18:44:22 +0000 > > err(3): print extended error if available > > Reviewed by: asomers, brooks > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51141 It looks like this broke cross-building as all of the GitHub cross-build actions are failing now after this commit, e.g.: https://github.com/freebsd/freebsd-src/actions/runs/16126095376/job/45503237749 /home/runner/work/freebsd-src/freebsd-src/lib/libc//gen/err.c:33:10: fatal error: sys/exterrvar.h: No such file or directory 33 | #include | ^~~~~~~~~~~~~~~~~ compilation terminated. --- err.o --- *** [err.o] Error code 1 bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build bmake[3]: 1 error bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build --- legacy --- *** [legacy] Error code 2 bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src bmake[2]: 1 error bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src Command exited with non-zero status 2 3.30user 0.79system 0:01.27elapsed 321%CPU (0avgtext+0avgdata 71296maxresident)k 1200inputs+2984outputs (8major+109216minor)pagefaults 0swaps --- _legacy --- bmake[1]: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src --- kernel-toolchain --- bmake: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src Error: Process completed with exit code 2. Presumably we are building a native libegacy on Linux that includes err.c, so we need to either guard the new #include or add a compat header with a stub implementation? -- John Baldwin From nobody Tue Jul 8 19:16:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bc9pb6fjcz61P2X; Tue, 08 Jul 2025 19:17:11 +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 4bc9pb3HGgz43Kv; Tue, 08 Jul 2025 19:17:11 +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 568JGvY7064701; Tue, 8 Jul 2025 22:17:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 568JGvY7064701 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 568JGv6D064700; Tue, 8 Jul 2025 22:16:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 8 Jul 2025 22:16:57 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 01a679715f68 - main - err(3): print extended error if available Message-ID: References: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-Rspamd-Queue-Id: 4bc9pb3HGgz43Kv 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] On Tue, Jul 08, 2025 at 03:09:32PM -0400, John Baldwin wrote: > On 7/7/25 15:28, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b > > > > commit 01a679715f68d5e32efecafc1f158eecec3f781b > > Author: Konstantin Belousov > > AuthorDate: 2025-06-16 21:26:22 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-07 18:44:22 +0000 > > > > err(3): print extended error if available > > Reviewed by: asomers, brooks > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51141 > > It looks like this broke cross-building as all of the GitHub cross-build > actions are failing now after this commit, e.g.: > > https://github.com/freebsd/freebsd-src/actions/runs/16126095376/job/45503237749 > > /home/runner/work/freebsd-src/freebsd-src/lib/libc//gen/err.c:33:10: fatal error: sys/exterrvar.h: No such file or directory > 33 | #include > | ^~~~~~~~~~~~~~~~~ > compilation terminated. > --- err.o --- > *** [err.o] Error code 1 > > bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build > bmake[3]: 1 error > > bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build > --- legacy --- > *** [legacy] Error code 2 > > bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src > bmake[2]: 1 error > > bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src > Command exited with non-zero status 2 > 3.30user 0.79system 0:01.27elapsed 321%CPU (0avgtext+0avgdata 71296maxresident)k > 1200inputs+2984outputs (8major+109216minor)pagefaults 0swaps > --- _legacy --- > > bmake[1]: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src > --- kernel-toolchain --- > > bmake: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src > Error: Process completed with exit code 2. > > Presumably we are building a native libegacy on Linux that includes err.c, so we > need to either guard the new #include or add a compat header with > a stub implementation? I think that the guard would be not enough, the real compat header with some content like #define UEXTERROR_MAXLEN 128 static inline int uexterr_gettext(char *buf, size_t len) { if (len > 0) buf[0] = '\0'; return (0); } should work better. From nobody Tue Jul 8 19:37:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcBFz0kkKz61QJV; Tue, 08 Jul 2025 19:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBFy67gsz4DMv; Tue, 08 Jul 2025 19:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pzeNIXdHLzSnTS3vfqdJJWZy259PHBgvDZkIV2CgpxU=; b=sGWiKDx6sKR7t5CciNvCdCRwUhCb43Eg4LesNCB1S1prNuf30817KKkt9H2VbZ2AA3AOM9 73AGYk4n3zIeMcfrSDtZ7RoDOFABDm+C69odAlEJfMQDOwalRfOjDbC28j3yhoEfPQcSEX YyxzhuAjjyrRZ1PukH0IQH+Nwa/vzj07aTzJQorE7+8qZNk+a3KigTdvRSm55HFXVIMZBg AsC4YeCo4dWNchIiAEwKntcnsF9iWTwaXVuEbJkLGjQnPeeYHpEubGY2exwNkRhtmIVuxq Ly9D54zmOAAk5iHax6QfOYy0FaQYd6yGG1YlR97iy5+k9YtdcvYbS/x+Eok6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pzeNIXdHLzSnTS3vfqdJJWZy259PHBgvDZkIV2CgpxU=; b=kqYJUhcYpnd04XLlClWiuOtYtMDMLlDXrpg6JTEmxmuPaIcA3ePSRyDOOgiPR04aqQy65i jkcduulhoT4xArYo4X05jFNHDckfs3FKvRgYoGna9oalCGWYQWNaNBgzsRQjnPaYLW3jbU RNUyYQj+nh1HX1Z35NhmJZdotEA7xegglfAWdsJiyfSkOjP1XiUMACfvE/PE2uXo69OCHU Ox2rcVWPyHmizJuD10u76MB/EAObU1Mu5SAf/SqDEL8qxeLnID2q9NibqFrzfyhIxANnWY W2HLhyHuWDpWhCBP66q4Py93bb90aqE4mMEnA6Lu62ZGE86TtalU1/9+jJhjkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752003446; a=rsa-sha256; cv=none; b=LFZpAuqxl+EAJz+Ixr+eK2CUhy5mJ5OSCGTQNS36oEmgDd/uMVbOaEPkO0XCbzfPbN+Ka9 hujoL7Rh+6NK7LaQYAFZCFEryx3is3aQcsr8Xe28It6frvhI8YfsO88LgcyN9qCvvIhsVi 1K/Z7MBvM5W4m0Qd3VCdFhp4TtvEstILtunsiUXVC5VlpDd/WGaVA6o5NS4KXVZf/hQDIp 6ezAm3dcTQqVyAhbKtHAdG9oTrh1zeF6Kpy1exV8FNbZYcKWEDXI4KbzuBiC2qM+2p8NPB q4tvpPkf8y01Ugj6ED5rnIGl3CTHHmKm9toIEEp2ez3unxAblcnaflOzl1dqIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcBFy5Hglzr4v; Tue, 08 Jul 2025 19:37: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 568JbQ87040270; Tue, 8 Jul 2025 19:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568JbQN0040267; Tue, 8 Jul 2025 19:37:26 GMT (envelope-from git) Date: Tue, 8 Jul 2025 19:37:26 GMT Message-Id: <202507081937.568JbQN0040267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: dcd47304acb1 - main - net80211: update ieee80211_output_seqno_assign() to 802.11-2020 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcd47304acb1f1713a27f407a153e2bb54c574ba Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=dcd47304acb1f1713a27f407a153e2bb54c574ba commit dcd47304acb1f1713a27f407a153e2bb54c574ba Author: Adrian Chadd AuthorDate: 2025-06-04 21:48:23 +0000 Commit: Adrian Chadd CommitDate: 2025-07-08 19:37:03 +0000 net80211: update ieee80211_output_seqno_assign() to 802.11-2020 Update ieee80211_output_seqno_assign() to support the transmitter sequence number assignment outlined in 802.11-2020 10.3.2.14.2 (Transmitter Requirements). Notably this correctly assigns the QoS NULL frames a seqno outside of the TID seqno space. Leave stub comments for the currently supported sequence number decisions. Add two new functions to access and increment the sequence number space, which will ensure that things wrap correctly. This should simplify drivers needing to constantly invent their own methods of fetching and incrementing the sequence number space. Differential Revision: https://reviews.freebsd.org/D50691 Reviewed by: bz --- sys/net80211/ieee80211_node.c | 30 ++++++++++++++++++++++++++++ sys/net80211/ieee80211_node.h | 6 ++++++ sys/net80211/ieee80211_output.c | 44 ++++++++++++++++++++++++++--------------- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index ad17af6778a1..a201d1b278f0 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3137,6 +3137,36 @@ ieee80211_getsignal(struct ieee80211vap *vap, int8_t *rssi, int8_t *noise) *rssi = ieee80211_getrssi(vap); } +/** + * @brief Increment the given TID TX sequence, return the current one. + * + * @param ni ieee80211_node to operate on + * @param tid TID, or IEEE80211_NONQOS_TID + * @returns sequence number, from 0 .. 4095 inclusive, post increments + */ +ieee80211_seq ieee80211_tx_seqno_fetch_incr(struct ieee80211_node *ni, + uint8_t tid) +{ + ieee80211_seq seq; + + seq = ni->ni_txseqs[tid]; + ni->ni_txseqs[tid] = (ni->ni_txseqs[tid] + 1) % IEEE80211_SEQ_RANGE; + return (seq); +} + +/** + * @brief Return the current sequence number for the given TID + * + * @param ni ieee80211_node to operate on + * @param tid TID, or IEEE80211_NONQOS_TID + * @returns sequence number, from 0 .. 4095 inclusive + */ +ieee80211_seq ieee80211_tx_seqno_fetch(const struct ieee80211_node *ni, + uint8_t tid) +{ + return (ni->ni_txseqs[tid]); +} + /** * @brief return a dot11rate / ratecode representing the current transmit rate * diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index c83eee04a8dc..ef25fa0d7fdd 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -531,6 +531,12 @@ void ieee80211_node_leave(struct ieee80211_node *); int8_t ieee80211_getrssi(struct ieee80211vap *); void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); +/* TX sequence space related routines */ +ieee80211_seq ieee80211_tx_seqno_fetch_incr(struct ieee80211_node *, + uint8_t); +ieee80211_seq ieee80211_tx_seqno_fetch(const struct ieee80211_node *, + uint8_t); + /* * Node transmit rate specific manipulation. * diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index a4151f807882..afe83ea0805c 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -4195,17 +4195,15 @@ ieee80211_tx_complete(struct ieee80211_node *ni, struct mbuf *m, int status) * Check the frame type and TID and assign a suitable sequence number * from the correct sequence number space. * + * This implements the components of 802.11-2020 10.3.2.14.2 + * (Transmitter Requirements) that net80211 currently supports. + * * It assumes the mbuf has been encapsulated, and has the TID assigned * if it is a QoS frame. * * Note this also clears any existing fragment ID in the header, so it * must be called first before assigning fragment IDs. * - * For now this implements parts of 802.11-2012; it doesn't do all of - * the needed checks for full compliance (notably QoS-Data NULL frames). - * - * TODO: update to 802.11-2020 10.3.2.14.2 (Transmitter Requirements) - * * @param ni ieee80211_node this frame will be transmitted to * @param arg_tid A temporary check, existing callers may set * this to a TID variable they were using, and this routine @@ -4239,16 +4237,30 @@ ieee80211_output_seqno_assign(struct ieee80211_node *ni, int arg_tid, "%s: called; TID mismatch; tid=%u, arg_tid=%d\n", __func__, tid, arg_tid); - if (IEEE80211_HAS_SEQ(type, subtype)) { - /* - * 802.11-2012 9.3.2.10 - QoS multicast frames - * come out of a different seqno space. - */ - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) - seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; - else - seqno = ni->ni_txseqs[tid]++; - } else + + /* 802.11-2020 10.3.2.14.2 (Transmitter Requirements) sections */ + + /* SNS7 - unicast PV1 management frame */ + + /* SNS6 - unicast PV1 data frame */ + + /* SNS5 - QoS NULL frames */ + if (IEEE80211_QOS_HAS_SEQ(wh) && IEEE80211_IS_QOS_NULL(wh)) + seqno = ieee80211_tx_seqno_fetch_incr(ni, IEEE80211_NONQOS_TID); + + /* SNS4 - QMF STA transmitting a QMF */ + + /* SNS3 - QoS STA; Time Priority Management frame */ + + /* SNS2 - unicast QoS STA, data frame, excluding SNS5 */ + else if (IEEE80211_QOS_HAS_SEQ(wh) && + !IEEE80211_IS_MULTICAST(wh->i_addr1)) + seqno = ieee80211_tx_seqno_fetch_incr(ni, tid); + + /* SNS1 - Baseline (everything else) */ + else if (IEEE80211_HAS_SEQ(type, subtype)) + seqno = ieee80211_tx_seqno_fetch_incr(ni, IEEE80211_NONQOS_TID); + else seqno = 0; /* @@ -4276,7 +4288,7 @@ ieee80211_output_beacon_seqno_assign(struct ieee80211_node *ni, struct mbuf *m) wh = mtod(m, struct ieee80211_frame *); - seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; + seqno = ieee80211_tx_seqno_fetch_incr(ni, IEEE80211_NONQOS_TID); *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); From nobody Tue Jul 8 19:40:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcBKw1my8z61QgP; Tue, 08 Jul 2025 19:40:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (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 4bcBKv5wqtz4FmD; Tue, 08 Jul 2025 19:40:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-553dceb342aso4236751e87.1; Tue, 08 Jul 2025 12:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752003648; x=1752608448; 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=kMVWtV2ayEpCQniX8zi68QIJNpwLxwXYVfVdTz3WxGo=; b=eRVxdbhvUI3yP1URYwOHHpN3uPp3hFg8klGAuhr+Ll7Q+6uXTp446ih7yPm9BrrkGv Dflxd4aaQZqlH/r+NnGK7SwbwTDNkzt5LnpEFdwZ/V8VM0pEsnOQnVjV0wQh9mhDlwjM 7nQnHVCBGv7hOR5IejZyzgQY+YqkiHybxqC8zqmzFYOeZ7u3zbRGuxyt5bnSzeYtar5F 7m6LroQVyQLWs52DaPFhKMsagTnSM3G4sv0ZMxrr5g4AifCmyaxu4jNn9ZZJIb/SmRv4 txYiJcctLPcMlkT04HgiTWSMQx1GgM36MXTMun3LtFn0NMGv03AfR6EA4zrgbGzQxX3q 0nHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752003648; x=1752608448; 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=kMVWtV2ayEpCQniX8zi68QIJNpwLxwXYVfVdTz3WxGo=; b=TfqOU99cBeA09APhz2C3Jn7UyCCgudFYl/LrlfQrxC9szM+bLoK3eqIGM1R1XnZwAg +uQ3cFGI6ngOoiXyiA8UHyqGsAJBQPj+lwy7jwpRl4DhlfDhwJxeyGFr3guDk0dAdOo9 nbDOyyYFv0Zeu9uYeP9Sls+hwVst8BCnUNxd3xc3MGT+CBRJ5O3Feyhw3KlTArHkwDay H6+0N4NOBJi2UUDb0j16jebc0sDi84icbE8A43biAgykZy3G7XDn605pf8/+3h5uMXYR 7Y8ElYl3jBCMs9qiAiOGLEkrS8iEvnlPydSh+CfigPM2OdcmsPcknKcVlwH4m6UXv9ZD x5ug== X-Forwarded-Encrypted: i=1; AJvYcCW6tVRlHmCoeeWYb4LfFq53E6IlJ43wUaathwXxbd1nFit16xrMdNPDssM/E0FVzpldkbxOxOfNAnqfd2leaJOZsTqxe9Y=@freebsd.org, AJvYcCWYXJbGEeLohaHunVclY3yNx1WcehtmMxH/0/5wFSisZp7yNXx/35/T10Iq55+lBPJVfnYtiGeOGwjUXmGfDVbHDQYe@freebsd.org X-Gm-Message-State: AOJu0Yx76ZsKkfrMaD72O1/4j+e2/+PSWKfllTEAHcP3Y6270FFLFaNY yXoumI7b+qQn1e1Qmr6/kKrZSrdpYviZ1qy8lAiy7k5vOVkyGdnk7EJgUnWS+jEtbLq0Re/2f8h Fh09KrRkREGI2oehgqUQjwWjsSEoUTK1/rA== X-Gm-Gg: ASbGncsy+mACLhPr9wE8W6JEZ39wIS+b6PC2HefHeeGAQc+sP0fcJswgDg2QJn3uFx4 Vp65mW2uDj5hZFE7VtfamIgw8c4aLtsDJlsqUrqqS8OD2tVBe2UKVIBii6yLgCHnKOjhps90jTZ Kiond2m9O4T2XI+XsTjL80ppqo2B0D+4XoH92FCbN/nx7U X-Google-Smtp-Source: AGHT+IFXal+DSVIuEpmq4UHXxvQikF8KPzpaNT3LLZlRUa3CBlFKR027vU+BbQLMWphXQ/8LFo88sFGhk+ZFg2KQfq8= X-Received: by 2002:a05:6512:ac4:b0:553:3486:1d9b with SMTP id 2adb3069b0e04-558f9aaa4d1mr133734e87.30.1752003647785; Tue, 08 Jul 2025 12:40:47 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507081512.568FCeX8049407@gitrepo.freebsd.org> In-Reply-To: <202507081512.568FCeX8049407@gitrepo.freebsd.org> From: Adrian Chadd Date: Tue, 8 Jul 2025 12:40:33 -0700 X-Gm-Features: Ac12FXzWx1bL8fUVCoSJX8g970XvaLugGgAQbKpcWSOVSwSttwhHq-fuI0riwKQ Message-ID: Subject: Re: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb To: ShengYi Hung Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000124ea00639702305" X-Rspamd-Queue-Id: 4bcBKv5wqtz4FmD 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)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000124ea00639702305 Content-Type: text/plain; charset="UTF-8" hi! Thanks for this! Could we possibly wrap stuff like these compat macros in a #define that we can undefine? So we can make sure no new code shows up that uses the "old" paths? eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB20_NO_BACKWARDS_COMPAT ? Thanks! -adrian On Tue, 8 Jul 2025 at 08:12, ShengYi Hung wrote: > The branch main has been updated by aokblast: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=f84a0da4e0608a970c775f3d605f8de2b0b8d322 > > commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 > Author: ShengYi Hung > AuthorDate: 2025-06-07 19:43:15 +0000 > Commit: ShengYi Hung > CommitDate: 2025-07-08 15:11:41 +0000 > > libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for > compatibility with libusb > > THe member bNumDeviceCapabilities is referred to as bNumDeviceCaps in > the upstream libusb project. > > To improve compatibility, we are renaming the member accordingly. > > For backward compatibility, a mocro will be defined to map > bNumDeviceCapabilities to bNumDeviceCaps. > > See: > https://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 > > Reviewed by: kevans > Approved by: markj (mentor) > MFC after: 2 weeks > Sponsored by: FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D50740 > --- > lib/libusb/libusb.h | 5 ++++- > lib/libusb/libusb10_desc.c | 11 ++++++----- > lib/libusb/libusb20_desc.h | 6 +++++- > 3 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h > index 0aad29aa4ecc..491af3d0a5ec 100644 > --- a/lib/libusb/libusb.h > +++ b/lib/libusb/libusb.h > @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { > uint8_t bLength; > uint8_t bDescriptorType; > uint16_t wTotalLength; > - uint8_t bNumDeviceCapabilities; > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > + uint8_t bNumDeviceCaps; > struct libusb_usb_2_0_device_capability_descriptor > *usb_2_0_ext_cap; > struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; > struct libusb_bos_dev_capability_descriptor **dev_capability; > diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c > index 3e36009cbb3a..5f4c46740688 100644 > --- a/lib/libusb/libusb10_desc.c > +++ b/lib/libusb/libusb10_desc.c > @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, int len, > ptr->bDescriptorType = dtype; > ptr->wTotalLength = ((const uint8_t *)buf)[2] | > (((const uint8_t *)buf)[3] << 8); > - ptr->bNumDeviceCapabilities = ((const uint8_t > *)buf)[4]; > + ptr->bNumDeviceCaps = ((const uint8_t *)buf)[4]; > ptr->usb_2_0_ext_cap = NULL; > ptr->ss_usb_cap = NULL; > - ptr->dev_capability = > calloc(ptr->bNumDeviceCapabilities, sizeof(void *)); > + ptr->dev_capability = calloc(ptr->bNumDeviceCaps, > + sizeof(void *)); > if (ptr->dev_capability == NULL) { > free(ptr); > return (LIBUSB_ERROR_NO_MEM); > @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, > if (dlen >= 3 && > ptr != NULL && > dtype == LIBUSB_DT_DEVICE_CAPABILITY) { > - if (index != ptr->bNumDeviceCapabilities) { > + if (index != ptr->bNumDeviceCaps) { > ptr->dev_capability[index] = malloc(dlen); > if (ptr->dev_capability[index] == NULL) { > libusb_free_bos_descriptor(ptr); > @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, > } > > if (ptr != NULL) { > - ptr->bNumDeviceCapabilities = index; > + ptr->bNumDeviceCaps = index; > return (0); /* success */ > } > > @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct > libusb_bos_descriptor *bos) > if (bos == NULL) > return; > > - for (i = 0; i != bos->bNumDeviceCapabilities; i++) > + for (i = 0; i != bos->bNumDeviceCaps; i++) > free(bos->dev_capability[i]); > free(bos->dev_capability); > free(bos); > diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h > index 017148a34b1c..0f7c9294ebc8 100644 > --- a/lib/libusb/libusb20_desc.h > +++ b/lib/libusb/libusb20_desc.h > @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); > > LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); > > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > + > #define LIBUSB20_BOS_DESCRIPTOR(m,n) \ > m(n, UINT8_T, bLength, ) \ > m(n, UINT8_T, bDescriptorType, ) \ > m(n, UINT16_T, wTotalLength, ) \ > - m(n, UINT8_T, bNumDeviceCapabilities, ) \ > + m(n, UINT8_T, bNumDeviceCaps, ) \ > > LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); > > --000000000000124ea00639702305 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
hi! Thanks for this!

Could w= e possibly wrap stuff like these compat macros in a #define that we can und= efine? So we can make sure no new code shows up that uses the "old&quo= t; paths?

eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB= 20_NO_BACKWARDS_COMPAT ?

Thanks!



-adrian

On Tue, 8 Jul 2025 at 08:12, ShengYi Hung <aokblast@freebsd.org> wrote:
The branch main has been update= d by aokblast:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3Df84a0da4e0608a970c775f3d605f8de2b0b8d322
commit f84a0da4e0608a970c775f3d605f8de2b0b8d322
Author:=C2=A0 =C2=A0 =C2=A0ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2025-06-07 19:43:15 +0000
Commit:=C2=A0 =C2=A0 =C2=A0ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2025-07-08 15:11:41 +0000

=C2=A0 =C2=A0 libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for c= ompatibility with libusb

=C2=A0 =C2=A0 THe member bNumDeviceCapabilities is referred to as bNumDevic= eCaps in
=C2=A0 =C2=A0 the upstream libusb project.

=C2=A0 =C2=A0 To improve compatibility, we are renaming the member accordin= gly.

=C2=A0 =C2=A0 For backward compatibility, a mocro will be defined to map =C2=A0 =C2=A0 bNumDeviceCapabilities to bNumDeviceCaps.

=C2=A0 =C2=A0 See: h= ttps://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b66= 56e5

=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kevans
=C2=A0 =C2=A0 Approved by:=C2=A0 =C2=A0 markj (mentor)
=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0FreeBSD Foundation
=C2=A0 =C2=A0 Differential Revision: https://reviews.freebsd.org/D= 50740
---
=C2=A0lib/libusb/libusb.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5 ++++-
=C2=A0lib/libusb/libusb10_desc.c | 11 ++++++-----
=C2=A0lib/libusb/libusb20_desc.h |=C2=A0 6 +++++-
=C2=A03 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h
index 0aad29aa4ecc..491af3d0a5ec 100644
--- a/lib/libusb/libusb.h
+++ b/lib/libusb/libusb.h
@@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bLength;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bDescriptorType;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t wTotalLength;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCapabilities;
+#ifndef bNumDeviceCapabilities
+#define bNumDeviceCapabilities bNumDeviceCaps
+#endif
+=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCaps;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_usb_2_0_device_capability_descrip= tor *usb_2_0_ext_cap;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_ss_usb_device_capability_descript= or *ss_usb_cap;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_bos_dev_capability_descriptor **d= ev_capability;
diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c
index 3e36009cbb3a..5f4c46740688 100644
--- a/lib/libusb/libusb10_desc.c
+++ b/lib/libusb/libusb10_desc.c
@@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, int len,=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->bDescriptorType =3D dtype;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->wTotalLength =3D ((const uint8_t *)buf)[2] |
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (((const uint8_t *)buf)[3] << 8);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->bNumDeviceCapabilities =3D ((const uint8_t *)buf)[4];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->bNumDeviceCaps =3D ((const uint8_t *)buf)[4];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->usb_2_0_ext_cap =3D NULL;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->ss_usb_cap =3D NULL;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->dev_capability =3D calloc(ptr->bNumDeviceCapabilities,= sizeof(void *));
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->dev_capability =3D calloc(ptr->bNumDeviceCaps,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0sizeof(void *));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 if (ptr->dev_capability =3D=3D NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(ptr);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (LIBUSB_ERROR_NO_MEM);
@@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dlen >=3D 3 = &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr != =3D NULL &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dtype= =3D=3D LIBUSB_DT_DEVICE_CAPABILITY) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (index !=3D ptr->bNumDeviceCapabilities) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (index !=3D ptr->bNumDeviceCaps) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr->dev_capability[index] =3D ma= lloc(dlen);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr->dev_capability[index] = =3D=3D NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 libusb_f= ree_bos_descriptor(ptr);
@@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, =C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr !=3D NULL) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDeviceC= apabilities =3D index;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDeviceC= aps =3D index;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* success */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

@@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct libusb_bos_descriptor= *bos)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (bos =3D=3D NULL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;

-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCapabili= ties; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCaps; i+= +)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->dev_ca= pability[i]);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->dev_capability);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos);
diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h
index 017148a34b1c..0f7c9294ebc8 100644
--- a/lib/libusb/libusb20_desc.h
+++ b/lib/libusb/libusb20_desc.h
@@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC);
=C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC);

+#ifndef bNumDeviceCapabilities
+#define bNumDeviceCapabilities bNumDeviceCaps
+#endif
+
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 LIBUSB20_BOS_DESCRIPTOR(m,n) \
=C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bLength, ) \
=C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bDescriptorType, ) \
=C2=A0 =C2=A0m(n, UINT16_T, wTotalLength, ) \
-=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCapabilities, ) \
+=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCaps, ) \

=C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR);

--000000000000124ea00639702305-- From nobody Tue Jul 8 19:44:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcBQN3rxzz61R55; Tue, 08 Jul 2025 19:44:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBQN37BBz4K7j; Tue, 08 Jul 2025 19:44:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003884; 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=UyZGMx9sMYvh8EidQA15n0pe/82w3Q8s4ip+z4hP7/c=; b=nk5E61xeSn63Ewc1fAGzXUd/iLC95N1HvQPulaHPm4K1h9YsBM27fINc+WSxXU46JyTlLD Kx9j6skk/rhCx5L/Ev01Zhmq0/byjQpWAi9HDzDFfT+C2E9hA2Si9wRxgWqoO+CYeGdD/g iZs3e0K3qMoI6mv1eWfhS8M7F6v6eRCwvQQDu5syYVzyRUy+518+QkQQpiJTlgz05R6I3x N7ibHVv43ecyj7TcQYsmmqz1Wv+tbyZ8qw9lbHCW8KlYSRdM1wkiTSYH8+q7t3MVLd2rgr bVW7gd+KnH4n7/Yt1VdiQ75Ne68+mxMF9Uz2T60cuf1YwTCtVmgOJMkqYHBmZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003884; 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=UyZGMx9sMYvh8EidQA15n0pe/82w3Q8s4ip+z4hP7/c=; b=HqZc4f4pB5lOO20JIA0oSx6MpxLUy7DVREnMm8BswE40Un+nfnSUZurtaYRcnKNITXV12h LVFmnCq1H/+WC3DNnHDMmn1AdlsyQuh7wtd+tdj0Gr96ZN1imKseGBJ98UrRTRd9uU/Ws2 kp8dHz4eScg6aJT1XqgsHKlLGh2f33oEDhrELH8+URtQkeveWtZ1w95DBh47z9bLfjYJz4 /Dw8rnGjKDNhb0/Y9wtFR2JEtj+8dUjPAKcYJvgPGuFTpAUh2cWGWyjbu85fZdx/Is80FT 9HluDwzu2K/uV9DMOH3v4LZohUnRkxVnDawvGoLOPTEErMWto74H3Xp4J7G5JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752003884; a=rsa-sha256; cv=none; b=M2eskOFW64rq3kWAAuJCZfHdrVBQc2crSOd6Wd06vup/Dyx1k0VpPDfuk4qfzhVRKwCPpg /8gecosaLel2EmdE4hucU1KeiaiUNFx96UXsCP9eKwIZ2LVUYbpndTIs4UgOrbVg64zvHL DyoYo+g4KDuhlk11G3mYxOK/c3u7KDeWBH7P6stXTfb2lRi9sC5QO7x7pnab0CZucLfMPK qHZCKe95GFYPfIVpkK0sLgbOz+NRw0PA0Uxx28mwVOTlnQViE2d2t/hdxpWn4vldYXyYRF Vttc9W7bf2hNP8q9DN7InZAAV+awU7j2RAWY6XtnC45hI85WpgQfD+qCJ+wLVw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bcBQM6RKGzrsn; Tue, 08 Jul 2025 19:44:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Tue, 8 Jul 2025 14:44:42 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb To: Adrian Chadd , ShengYi Hung Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507081512.568FCeX8049407@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/8/25 14:40, Adrian Chadd wrote: > hi! Thanks for this! > > Could we possibly wrap stuff like these compat macros in a #define that > we can undefine? So we can make sure no new code shows up that uses the > "old" paths? > > eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB20_NO_BACKWARDS_COMPAT ? > > Thanks! > The latter, please. +1 Thanks, Kyle Evans > > > -adrian > > > On Tue, 8 Jul 2025 at 08:12, ShengYi Hung > wrote: > > The branch main has been updated by aokblast: > > URL: https://cgit.FreeBSD.org/src/commit/? > id=f84a0da4e0608a970c775f3d605f8de2b0b8d322 cgit.FreeBSD.org/src/commit/? > id=f84a0da4e0608a970c775f3d605f8de2b0b8d322> > > commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 > Author:ย  ย  ย ShengYi Hung > AuthorDate: 2025-06-07 19:43:15 +0000 > Commit:ย  ย  ย ShengYi Hung > CommitDate: 2025-07-08 15:11:41 +0000 > > ย  ย  libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for > compatibility with libusb > > ย  ย  THe member bNumDeviceCapabilities is referred to as > bNumDeviceCaps in > ย  ย  the upstream libusb project. > > ย  ย  To improve compatibility, we are renaming the member accordingly. > > ย  ย  For backward compatibility, a mocro will be defined to map > ย  ย  bNumDeviceCapabilities to bNumDeviceCaps. > > ย  ย  See: https://github.com/libusb/libusb/ > commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5> > > ย  ย  Reviewed by:ย  ย  kevans > ย  ย  Approved by:ย  ย  markj (mentor) > ย  ย  MFC after:ย  ย  ย  2 weeks > ย  ย  Sponsored by:ย  ย FreeBSD Foundation > ย  ย  Differential Revision: https://reviews.freebsd.org/D50740 > > --- > ย lib/libusb/libusb.hย  ย  ย  ย  |ย  5 ++++- > ย lib/libusb/libusb10_desc.c | 11 ++++++----- > ย lib/libusb/libusb20_desc.h |ย  6 +++++- > ย 3 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h > index 0aad29aa4ecc..491af3d0a5ec 100644 > --- a/lib/libusb/libusb.h > +++ b/lib/libusb/libusb.h > @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { > ย  ย  ย  ย  uint8_t bLength; > ย  ย  ย  ย  uint8_t bDescriptorType; > ย  ย  ย  ย  uint16_t wTotalLength; > -ย  ย  ย  ย uint8_t bNumDeviceCapabilities; > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > +ย  ย  ย  ย uint8_t bNumDeviceCaps; > ย  ย  ย  ย  struct libusb_usb_2_0_device_capability_descriptor > *usb_2_0_ext_cap; > ย  ย  ย  ย  struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; > ย  ย  ย  ย  struct libusb_bos_dev_capability_descriptor **dev_capability; > diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c > index 3e36009cbb3a..5f4c46740688 100644 > --- a/lib/libusb/libusb10_desc.c > +++ b/lib/libusb/libusb10_desc.c > @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, > int len, > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ptr->bDescriptorType = dtype; > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ptr->wTotalLength = ((const uint8_t *)buf)[2] | > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  (((const uint8_t *)buf)[3] << 8); > -ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย ptr->bNumDeviceCapabilities = ((const > uint8_t *)buf)[4]; > +ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย ptr->bNumDeviceCaps = ((const uint8_t *)buf)[4]; > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ptr->usb_2_0_ext_cap = NULL; > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ptr->ss_usb_cap = NULL; > -ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย ptr->dev_capability = calloc(ptr- > >bNumDeviceCapabilities, sizeof(void *)); > +ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย ptr->dev_capability = calloc(ptr- > >bNumDeviceCaps, > +ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย sizeof(void *)); > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  if (ptr->dev_capability == NULL) { > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  free(ptr); > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  return (LIBUSB_ERROR_NO_MEM); > @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int > len, > ย  ย  ย  ย  ย  ย  ย  ย  if (dlen >= 3 && > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ptr != NULL && > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  dtype == LIBUSB_DT_DEVICE_CAPABILITY) { > -ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย if (index != ptr->bNumDeviceCapabilities) { > +ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย if (index != ptr->bNumDeviceCaps) { > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ptr->dev_capability[index] = > malloc(dlen); > ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  if (ptr->dev_capability[index] == > NULL) { > > libusb_free_bos_descriptor(ptr); > @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int > len, > ย  ย  ย  ย  } > > ย  ย  ย  ย  if (ptr != NULL) { > -ย  ย  ย  ย  ย  ย  ย  ย ptr->bNumDeviceCapabilities = index; > +ย  ย  ย  ย  ย  ย  ย  ย ptr->bNumDeviceCaps = index; > ย  ย  ย  ย  ย  ย  ย  ย  return (0);ย  ย  ย  ย  ย  ย  ย /* success */ > ย  ย  ย  ย  } > > @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct > libusb_bos_descriptor *bos) > ย  ย  ย  ย  if (bos == NULL) > ย  ย  ย  ย  ย  ย  ย  ย  return; > > -ย  ย  ย  ย for (i = 0; i != bos->bNumDeviceCapabilities; i++) > +ย  ย  ย  ย for (i = 0; i != bos->bNumDeviceCaps; i++) > ย  ย  ย  ย  ย  ย  ย  ย  free(bos->dev_capability[i]); > ย  ย  ย  ย  free(bos->dev_capability); > ย  ย  ย  ย  free(bos); > diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h > index 017148a34b1c..0f7c9294ebc8 100644 > --- a/lib/libusb/libusb20_desc.h > +++ b/lib/libusb/libusb20_desc.h > @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); > > ย LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); > > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > + > ย #defineย  ย  ย  ย  LIBUSB20_BOS_DESCRIPTOR(m,n) \ > ย  ย m(n, UINT8_T,ย  bLength, ) \ > ย  ย m(n, UINT8_T,ย  bDescriptorType, ) \ > ย  ย m(n, UINT16_T, wTotalLength, ) \ > -ย  m(n, UINT8_T,ย  bNumDeviceCapabilities, ) \ > +ย  m(n, UINT8_T,ย  bNumDeviceCaps, ) \ > > ย LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); > From nobody Tue Jul 8 19:49:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcBXL6dKgz61RPZ; Tue, 08 Jul 2025 19:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBXL5cnyz4MQF; Tue, 08 Jul 2025 19:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752004194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSNcIDHevSJppgeQkwVi/9MEMKgwVzpfgYg4XMcFfjA=; b=vtM3wP0kVV9AVrlWObje22s8xmh1u1REfcRh/RGTm79ThyQT3ZgKZPpQdsRRuJ1cHpaWJ4 uTuGI4mU3Ury8SQSSx/Dr/k85S17wN0DUwOYa3DXkMppTS8Ie21qD9fpzk4n79CWf5XmT4 BCdvH/Gl42V3fxCjBqWKg+4N5T1z50x7jG5Y9ZM6OlY+4wWHPey+bIbRWwF2IXToHkNZwd NhdzizOqpBUgl3on2AiReZJ/OzYqly8IlEtNI+ipoRif3lSg4xVKIfR+7/MvQjC4E0gI4t WXJKqeHgB6RmklomqRkvDVkd8S6/ihwVCxhkDmtk1lvAbtqZpSSSffjRGS/Chw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752004194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSNcIDHevSJppgeQkwVi/9MEMKgwVzpfgYg4XMcFfjA=; b=Dg2KesvGGB0KHW5OER8cdR0BfvXkqqexwed0+Qtit90RzzIjCynzJ7WbCRLYcASoJd3LFS 4KP9CFvk3NQntljUJmnfEkBM0mdpZgTCiaAyul0Xt5WGW+U4nDALqs8f/8uPC9i48yg1r/ RN+lfkvxxEU/HG06uYxlYFqpEz0kFOWiY+v/5tHfuWDGsH+dJi7X0RVGe6Ukarbv9SEoNe LiYNVypTXtx2nYCF8aHWzPpDYz10wRrV9vYGdh/3fjo4qyB/n0oLqnJn37Zn2IOWIVjNcd bkCM9zfZIGjoNEI5yPHmU3LbpC30ZRo5jV9uTQH+UUCbi5B13w/h3/jj8i7qpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752004194; a=rsa-sha256; cv=none; b=GPGtuEh4svmFp3pg2+3Qs2/wr1Kn7OQSTbHO/jinebIJ1+DjgYQrGC//rsQKiGjCgx2x2Q +eHrojE1lMBV/bBqKp7UVh/8uTTrLEIAdG2pUgww5bvVrCnqnttgY7b3PsEkrEeJgeSlGI zXdFfVoyiU6IKDGYH3ml9eLCryutmdmlSE5pWteg/1HAI63cj0lPaWZCGjtsvizRt9/Ci5 Q2VEGIx0hYumrB/qBi/y+4URvyJ7ie4F+ESe7vPGsiTxXidiuvk7K0nL1s4ggWvdhGSLcA ynL0l1f2EonqQVCBy5u+Q2st4yIdGPiNACFFhVIsGcPnhT2UPCwnrNe+CJ7ECQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcBXL4dV0zqrs; Tue, 08 Jul 2025 19:49: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 568Jns67060162; Tue, 8 Jul 2025 19:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568JnsfN060159; Tue, 8 Jul 2025 19:49:54 GMT (envelope-from git) Date: Tue, 8 Jul 2025 19:49:54 GMT Message-Id: <202507081949.568JnsfN060159@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: c08e019c6ce4 - main - opendir, fdopendir: Add tests, clean up. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c08e019c6ce4fc637b195f1bb0878763c3fefe9e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c08e019c6ce4fc637b195f1bb0878763c3fefe9e commit c08e019c6ce4fc637b195f1bb0878763c3fefe9e Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-08 19:40:55 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-08 19:41:21 +0000 opendir, fdopendir: Add tests, clean up. * Add test cases for opendir() and fdopendir(). * Drop O_NONBLOCK from opendir(); it was added a long time ago to avoid blocking if given a closed named pipe, but now we use O_DIRECTORY, which ensures that we get ENOTDIR in that case. * While here, remove unused #includes left over from the split. Sponsored by: Klara, Inc. Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D51126 --- lib/libc/gen/fdopendir.c | 7 +- lib/libc/gen/opendir.c | 7 -- lib/libc/gen/opendir2.c | 6 +- lib/libc/tests/gen/Makefile | 1 + lib/libc/tests/gen/opendir_test.c | 144 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 151 insertions(+), 14 deletions(-) diff --git a/lib/libc/gen/fdopendir.c b/lib/libc/gen/fdopendir.c index 67c0766b6d83..df6709fbcb85 100644 --- a/lib/libc/gen/fdopendir.c +++ b/lib/libc/gen/fdopendir.c @@ -30,14 +30,13 @@ */ #include "namespace.h" -#include +#include +#include #include #include #include -#include -#include -#include +#include #include "un-namespace.h" #include "gen-private.h" diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index 956c92c321e8..08d9eb10eaa2 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -30,14 +30,7 @@ */ #include "namespace.h" -#include - #include -#include -#include -#include -#include -#include #include "un-namespace.h" #include "gen-private.h" diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c index b9ac23e6d9fd..928145b468c1 100644 --- a/lib/libc/gen/opendir2.c +++ b/lib/libc/gen/opendir2.c @@ -30,11 +30,12 @@ */ #include "namespace.h" -#include +#include #include #include #include +#include #include #include #include @@ -52,8 +53,7 @@ __opendir2(const char *name, int flags) if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) return (NULL); - if ((fd = _open(name, - O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) + if ((fd = _open(name, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) == -1) return (NULL); dir = __opendir_common(fd, flags, false); diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile index a967ad5ddf91..8c2151105209 100644 --- a/lib/libc/tests/gen/Makefile +++ b/lib/libc/tests/gen/Makefile @@ -20,6 +20,7 @@ ATF_TESTS_C+= glob2_test ATF_TESTS_C+= glob_blocks_test .endif ATF_TESTS_C+= makecontext_test +ATF_TESTS_C+= opendir_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= realpath2_test diff --git a/lib/libc/tests/gen/opendir_test.c b/lib/libc/tests/gen/opendir_test.c new file mode 100644 index 000000000000..89be2becc607 --- /dev/null +++ b/lib/libc/tests/gen/opendir_test.c @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include +#include +#include +#include +#include + +#include + +/* + * Create a directory with a single subdirectory. + */ +static void +opendir_prepare(const struct atf_tc *tc) +{ + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE_EQ(0, mkdir("dir/subdir", 0755)); +} + +/* + * Assuming dirp represents the directory created by opendir_prepare(), + * verify that readdir() returns what we expected to see there. + */ +static void +opendir_check(const struct atf_tc *tc, DIR *dirp) +{ + struct dirent *ent; + + ATF_REQUIRE((ent = readdir(dirp)) != NULL); + ATF_CHECK_EQ(1, ent->d_namlen); + ATF_CHECK_STREQ(".", ent->d_name); + ATF_CHECK_EQ(DT_DIR, ent->d_type); + ATF_REQUIRE((ent = readdir(dirp)) != NULL); + ATF_CHECK_EQ(2, ent->d_namlen); + ATF_CHECK_STREQ("..", ent->d_name); + ATF_CHECK_EQ(DT_DIR, ent->d_type); + ATF_REQUIRE((ent = readdir(dirp)) != NULL); + ATF_CHECK_EQ(sizeof("subdir") - 1, ent->d_namlen); + ATF_CHECK_STREQ("subdir", ent->d_name); + ATF_CHECK_EQ(DT_DIR, ent->d_type); + ATF_CHECK(readdir(dirp) == NULL); +} + +ATF_TC(opendir_ok); +ATF_TC_HEAD(opendir_ok, tc) +{ + atf_tc_set_md_var(tc, "descr", "Open a directory."); +} +ATF_TC_BODY(opendir_ok, tc) +{ + DIR *dirp; + + opendir_prepare(tc); + ATF_REQUIRE((dirp = opendir("dir")) != NULL); + opendir_check(tc, dirp); + ATF_CHECK_EQ(0, closedir(dirp)); +} + +ATF_TC(opendir_fifo); +ATF_TC_HEAD(opendir_fifo, tc) +{ + atf_tc_set_md_var(tc, "descr", "Do not hang if given a named pipe."); +} +ATF_TC_BODY(opendir_fifo, tc) +{ + DIR *dirp; + int fd; + + ATF_REQUIRE((fd = mkfifo("fifo", 0644)) >= 0); + ATF_REQUIRE_EQ(0, close(fd)); + ATF_REQUIRE((dirp = opendir("fifo")) == NULL); + ATF_CHECK_EQ(ENOTDIR, errno); +} + +ATF_TC(fdopendir_ok); +ATF_TC_HEAD(fdopendir_ok, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Open a directory from a directory descriptor."); +} +ATF_TC_BODY(fdopendir_ok, tc) +{ + DIR *dirp; + int dd; + + opendir_prepare(tc); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE((dirp = fdopendir(dd)) != NULL); + opendir_check(tc, dirp); + ATF_CHECK_EQ(dd, fdclosedir(dirp)); + ATF_CHECK_EQ(0, close(dd)); +} + +ATF_TC(fdopendir_ebadf); +ATF_TC_HEAD(fdopendir_ebadf, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Open a directory from an invalid descriptor."); +} +ATF_TC_BODY(fdopendir_ebadf, tc) +{ + DIR *dirp; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_CHECK_EQ(0, close(dd)); + ATF_REQUIRE((dirp = fdopendir(dd)) == NULL); + ATF_CHECK_EQ(EBADF, errno); +} + +ATF_TC(fdopendir_enotdir); +ATF_TC_HEAD(fdopendir_enotdir, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Open a directory from a non-directory descriptor."); +} +ATF_TC_BODY(fdopendir_enotdir, tc) +{ + DIR *dirp; + int fd; + + ATF_REQUIRE((fd = open("file", O_CREAT | O_RDWR, 0644)) >= 0); + ATF_REQUIRE((dirp = fdopendir(fd)) == NULL); + ATF_CHECK_EQ(ENOTDIR, errno); + ATF_CHECK_EQ(0, close(fd)); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, opendir_ok); + ATF_TP_ADD_TC(tp, fdopendir_ok); + ATF_TP_ADD_TC(tp, fdopendir_ebadf); + ATF_TP_ADD_TC(tp, fdopendir_enotdir); + ATF_TP_ADD_TC(tp, opendir_fifo); + return (atf_no_error()); +} From nobody Tue Jul 8 21:22:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcDbN5rNxz60YC9; Tue, 08 Jul 2025 21:22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbN3Dcbz43KJ; Tue, 08 Jul 2025 21:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yLv37XZG3uBxfHmCyWoCbww+NghSQvtwX8M60x5huGg=; b=aMJ7vTHGSmws0gjOBvaagf+yVaARzpBtlbsbF3NjYmkZGTdEk5rswx9Cb7QRmBm7uZJvwb UmT0FfO/0QBwK1hYkcNCzlCGT6sw4PxAXWZoM2j9uJ8mLs8oNH/l5n3nG93QWFcc6csY6B Gn8B69y8YkfEXtXFBhN6K668000ijiv7nacploaGdpEnMv96NgXP9w48/mrqCYqExrbfcs g/uvLPgf0XZC2CrONHJhyKJ0gRUZJStSLehUOP+yc9ONtnsOhhSEdGd29dLbM8CBtLlckb UXcBy6XXHxBKXSBHJjloDPbUfl++9XDCCX0itgWvnxjhgjqlFKm6iRFEfonKWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yLv37XZG3uBxfHmCyWoCbww+NghSQvtwX8M60x5huGg=; b=NeUDKbR3J05Xh9Ztw5B8LycvC1KU2qYDB52DI8cAWj/Pvl1t5zG/FmlsXai8h34LxPlC7d 2R3dn1+pF6tm8/LVGToo1CE+/4yGS3tACgDvK7VPdL1T+JLdApij/eGxazpmk00kshfT4S FA+84m+sXHVQT5YxtxJtSxtrYokag28WRayVfyfzCe5G1TWPeId7QddhIWPJLZKjNlsG/K WRaJh0X+DK06dVuZC/RMFc7IWVuWwNV8YccAF2y9zTvljR82M8rajs6MGKyXBj6FZRNAcM //FEtC10vkfTTDznCeRLQoocR/LWWKVkVNrUeIkpM6WEoGK8Z2N9Zp2iSlVjfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009760; a=rsa-sha256; cv=none; b=EWoTB236CsQm16cTTUF0dD2Xd7Txr+8uBY0AdEDAB0SGomtj/tNeHMxe3WPFsVnoOKuzfD rvemrNu1uhCOwC0j4rHSDQSIGuKhLsD1uADcFuGoO7/vQPQy7q2l6fE1E88m/ZVxN7cF3h /fMvMR5Q/fWPSTAhUnH8XCGUvpBhcd5zObGrhj7MYn0ulbJJAociPLohcGRwhZhq0BUXYk 9ie43ZOOkMiyB7IJWPuW67KcwanSKQrkAyniyWEkGygDfVz9BPGhfEWYsjxJdJKEPxdnhM 71AhkdYJDmfJ/H/ps3vV2UIE+SRy3S5b6BS7L1vCZuhKs+k5xWTPhER22ohIlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcDbN2Zc4ztb8; Tue, 08 Jul 2025 21:22: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 568LMeaO046441; Tue, 8 Jul 2025 21:22:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMe2Z046438; Tue, 8 Jul 2025 21:22:40 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:40 GMT Message-Id: <202507082122.568LMe2Z046438@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: 4b472968f8ee - main - devd.conf.5: Consistently use Li to markup literal strings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4b472968f8ee9efcf58d70e45da923d3bb77bcee Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4b472968f8ee9efcf58d70e45da923d3bb77bcee commit 4b472968f8ee9efcf58d70e45da923d3bb77bcee Author: John Baldwin AuthorDate: 2025-07-08 21:22:07 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:07 +0000 devd.conf.5: Consistently use Li to markup literal strings This doesn't affect terminal output but does affect the fonts used in other formats such as postscript and HTML. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index adeeec7fd611..44667858ed13 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -38,7 +38,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd April 29, 2025 +.Dd July 8, 2025 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -372,14 +372,14 @@ Command timeouts. Events related to the .Xr carp 4 protocol. -.It CARP Ta Ar vhid@inet Ta Ta +.It Li CARP Ta Ar vhid@inet Ta Ta The .Dq subsystem contains the actual CARP vhid and the name of the network interface on which the event took place. -.It CARP Ta Ar vhid@inet Ta MASTER Ta +.It Li CARP Ta Ar vhid@inet Ta Li MASTER Ta Node become the master for a virtual host. -.It CARP Ta Ar vhid@inet Ta BACKUP Ta +.It Li CARP Ta Ar vhid@inet Ta Li BACKUP Ta Node become the backup for a virtual host. .El .Pp @@ -520,25 +520,25 @@ Power has been applied to the AC power line. .It Li PMU Ta Li "AC" Ta Li unplugged Ta Power has been removed from the AC power line. .It Li PMU Ta Li Battery Ta Ta -.It Li PMU Ta Li Battery Ta absent Ta +.It Li PMU Ta Li Battery Ta Li absent Ta Battery is no longer absent. -.It Li PMU Ta Li Battery Ta charged Ta +.It Li PMU Ta Li Battery Ta Li charged Ta The battery has become charged. -.It Li PMU Ta Li Battery Ta charging Ta +.It Li PMU Ta Li Battery Ta Li charging Ta The battery has started charging. -.It Li PMU Ta Li Battery Ta disconnected Ta +.It Li PMU Ta Li Battery Ta Li disconnected Ta The battery has been disconnected. -.It Li PMU Ta Li Battery Ta high-temp Ta +.It Li PMU Ta Li Battery Ta Li high-temp Ta The battery reported a temperature over the limit. -.It Li PMU Ta Li Battery Ta low-temp Ta +.It Li PMU Ta Li Battery Ta Li low-temp Ta The battery reported a temperature under the limit. -.It Li PMU Ta Li Battery Ta plugged Ta +.It Li PMU Ta Li Battery Ta Li plugged Ta The battery has become plugged (eg connected). -.It Li PMU Ta Li Battery Ta shutdown-threshold Ta +.It Li PMU Ta Li Battery Ta Li shutdown-threshold Ta The power in the battery has fallen below the shutdown threshold. -.It Li PMU Ta Li Battery Ta warning-threshold Ta +.It Li PMU Ta Li Battery Ta Li warning-threshold Ta The power in the battery has fallen below the warn the user threshold. -.It Li PMU Ta Li Button Ta pressed Ta +.It Li PMU Ta Li Button Ta Li pressed Ta A button on a .Xr adb 4 or @@ -548,35 +548,35 @@ has been pressed. One of the keys on the .Xr adb 4 keyboard has been pressed. -.It Li PMU Ta Li keys Ta brightness Ta +.It Li PMU Ta Li keys Ta Li brightness Ta A brightness level change has been requested. Direction is in the $notify variable. -.It Li PMU Ta Li keys Ta mute Ta +.It Li PMU Ta Li keys Ta Li mute Ta The mute key -.It Li PMU Ta Li keys Ta volume Ta +.It Li PMU Ta Li keys Ta Li volume Ta A volume level change has been requested. Direction is in the $notify variable. -.It Li PMU Ta Li keys Ta eject Ta +.It Li PMU Ta Li keys Ta Li eject Ta An ejection has been requested. -.It Li PMU Ta Li lid Ta close Ta +.It Li PMU Ta Li lid Ta Li close Ta The .Xr pmc 4 device has detected the lid closing. -.It Li PMU Ta Li lid Ta open Ta +.It Li PMU Ta Li lid Ta Li open Ta The .Xr pmc 4 device has detected the lid openinging. -.It Li PMU Ta Li POWER Ta ACLINE Ta +.It Li PMU Ta Li POWER Ta Li ACLINE Ta The .Xr pmc 4 device has detected an AC line state ($notify=0x00 is offline, 0x01 is online). -.It Li PMU Ta Li USB Ta overvoltage Ta +.It Li PMU Ta Li USB Ta Li overvoltage Ta An over-voltage condition on the power lines for the USB power pins. -.It Li PMU Ta Li USB Ta plugged Ta +.It Li PMU Ta Li USB Ta Li plugged Ta A device has been plugged into a USB device. -.It Li PMU Ta Li USB Ta undervoltage Ta +.It Li PMU Ta Li USB Ta Li undervoltage Ta An under-voltage condition on the power lines for the USB power pins. -.It Li PMU Ta Li USB Ta unplugged Ta +.It Li PMU Ta Li USB Ta Li unplugged Ta A device has been unplugged into a USB device. .El .Pp @@ -620,7 +620,7 @@ Notification of a filesystem being unmounted. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" -.It Li VT Ta BELL Ta RING Ta +.It Li VT Ta Li BELL Ta Li RING Ta Notification that the console bell has rung. See .Xr vt 4 @@ -629,7 +629,7 @@ for details. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" -.It Li ZFS Ta ZFS Ta Ta +.It Li ZFS Ta Li ZFS Ta Ta Events about the ZFS subsystem. See .Xr zfsd 8 From nobody Tue Jul 8 21:22:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcDbR1fljz60YZG; Tue, 08 Jul 2025 21:22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbQ4S3Nz43H7; Tue, 08 Jul 2025 21:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S+gQWIveYESWVxaVjPhSK7aTRQXze0K41M9WN6HqsGs=; b=Nom3dIrVMVEd5E777q1s92GvIIzkw+LCJ0piPacsQMAH0o82DH5Cm58tXeFCIPLfWjRxRE qtjk11eZj615fnG9gEm1tu9gs4kvz7f8Ju4Vxih0vjS6qWZM0SzNP9GErXyBPavop1oOvB BafuUOBBMF5oKOgwhYZJOKsaQB+wUwpjl0+aLSwxv41m9mHUM84IEl74CQZCAtSShD6uLG o30sVaTroYIIZnxObvUJ32g4Fppwi1+znX4joFx7UFwThuo+DoHPKyQhLvxMxVutYUmgp+ zLec/8/Q9EWJfe+inz5lMytbOWHIvxhg7WDnEq3K6yI+ERNBvcnTQ7zub5lZSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S+gQWIveYESWVxaVjPhSK7aTRQXze0K41M9WN6HqsGs=; b=nX8FZLznIF7/e6qIy53O4/8XAJ2E22sLNShFvRuiP8MaFX3guWWsB8NeeM/E1F9pYiUq17 9L5ca29HNSRm3TfBEbG35zCfrm6tU6I+w8uZWy4HaIvqLGSD/fyBaaOnFiEXO9csfTyxTd a3hzD/I8FUFZxcr7hLWpHcF0UGLfYOHgU4T064ODW7t7P7DE7Lnu9YsOWGTAQva6Ak9V3O uVrRFPfrvhY1NMm7ng+pufnW/3Mh+JIBrMGEP5qDgxGyZcKpbC9BTkifYcPfOiroLMHVQD w+ML08Nz2PGBX+6Qdl8+ilFiLAQ/z+dt/cHg/3OInA/tW+KFXrOzbNyc4yXteg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009762; a=rsa-sha256; cv=none; b=C0M+1o0+mANYs5kTV0PERGz3nEdQ2FlVKW4FnuL8R53ATP+sl73RQ6EHW3kJzdu2cy0y7E OhjsjaE/Cwouq7aXveoWlzHssCzzqy6k+lH+z/x1ikS/uhKX0rQtcPl82ULFC7hBj3/tX7 MnC7aygkjFQSJcz6a3fnoW1C/Q1v1b661B7txcDq+uJgTHez4S1anTNuhs8Iih0ICPCAJ/ EfKqv3I1Rbv7gNrl4yJcEuJ442H9aLC0K28FT46leUAq14u6Bi1zqll4LVBfwqrEJRgfoK hrsOqwai6zttkZGyz54SDA0cGBYbTY6pTWg4xq9zOP1462d6pmP6t6JH9DN24A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcDbQ40rLztYZ; Tue, 08 Jul 2025 21:22: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 568LMgxj046516; Tue, 8 Jul 2025 21:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMgWG046513; Tue, 8 Jul 2025 21:22:42 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:42 GMT Message-Id: <202507082122.568LMgWG046513@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: 6aca71321b95 - main - devd.conf.5: Describe $name used with nvme events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6aca71321b9541c44d007d3f1a9d42e1b77736d5 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6aca71321b9541c44d007d3f1a9d42e1b77736d5 commit 6aca71321b9541c44d007d3f1a9d42e1b77736d5 Author: John Baldwin AuthorDate: 2025-07-08 21:22:23 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:23 +0000 devd.conf.5: Describe $name used with nvme events While here, fix a couple of nearby nits. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 188bd90d1c9f..f038efc5fdd6 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -481,11 +481,16 @@ Notification that the system has woken from the suspended state. .Pp .Bl -column "SYSTEM" "SUBSYSTEM" "SMART_ERROR" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li nvme Ta Li controller Ta Ta +Controller events provide the controller name +.Pq for example, Li nvme0 +in $name. .It Li nvme Ta Li controller Ta Li SMART_ERROR Ta A SMART Critical Warning State change has happened. $state has a hex bitmask of the bits that changed, as defined in the NVMe Standard for Critical Warning field of log page 2 .Dq SMART / Health Information Log : +.Pp .Bl -column "Bit Value" "Meaning" -compact .Sy "Bit Value" Ta Sy "Meaning" .It 0x1 Ta Spare capacity below threshold @@ -503,7 +508,7 @@ $event is one of and .Dq timed_out representing the start of a controller reset, the successful completion of a -controller reset, and a timeout while waiting for the controller to reset +controller reset, or a timeout while waiting for the controller to reset, respectively. .El .Pp @@ -577,7 +582,7 @@ A device has been plugged into a USB device. .It Li PMU Ta Li USB Ta Li undervoltage Ta An under-voltage condition on the power lines for the USB power pins. .It Li PMU Ta Li USB Ta Li unplugged Ta -A device has been unplugged into a USB device. +A device has been unplugged from a USB device. .El .Pp .Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact From nobody Tue Jul 8 21:22:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcDbS0Xf0z60YZP; Tue, 08 Jul 2025 21:22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbR5L71z43Dt; Tue, 08 Jul 2025 21:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YbEEPF2PeiaZkCnkQqC5nOqxLZ0Gqxh45qOoz2ejcmc=; b=qx531BmuNlUeZCu2cdt9+/zRcPdwzC/oBnJ0i8waTTwvF+Ydh241Humq1fLs406sTbZWYE e6wWYqGr4hoMvKBTSnEDBL8C+xzb7ngFkvC3e+SP9qVFQzw9hGqUAiwfGntbbWfo/B89rw foRwgGUo2oL4eb4IwKk5J2W2S85I0pFm1nfKVk77HGAj/nsGoQq4WXnWKCVHr0IhDjjqho zr0kFYmurEFs3xCKiJ5ENgQnWkxxmdNhS2EBHZ///R6XmGr/7Mm7nBQqplUPxyneNSdm4o mAWX1li/U3V8P90AJ5aX/SdcyrQRDnwZDXkhS9A496dAh+SOKPUvkcx1P+Exew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YbEEPF2PeiaZkCnkQqC5nOqxLZ0Gqxh45qOoz2ejcmc=; b=yWohYpu3g/zJQSlhcWbe48I5EnyzUiCymf2HsUH2NNf4msu7vNgfNWjmUxpoZKn6fSbe/C BKU9qoBOhx+osnkEozQeK55IRLSlh4x7QBAQYOtBde1zamKOFQ9/uz6gg8Zn+Zl9mullvy la6N3VbuDQx4hBBJi/XIFrmt58hEpVfRi1pMJr1h+cBoSY9y/92NITbKxgIPqZlk+6wG2j 5LradpCEExSwZZynFioPhiLq4wyFVkuJmWa+tQe1aCgX/NiJSxIGHywHKtzAzZNKp1lg7C 0o/vQM6UGY2d48dnP23+7ATt3wszMvkBxhFtJpB9ze6iHSUvw+J+peBHp03wYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009763; a=rsa-sha256; cv=none; b=YD6E9D0CidKl5YMC2X0vwOubeYi2pNNUY9GigmO+foGrd4rwF8wzrFnfDXPubg5+pnjoCb KJ1uWx+7R5A05Yw4lklKZ99e0ua7nQnBcVJUYOi1afdboJWebijElH3w1soe4cJgFUF4UH ToXNaJGX9q+2MLcBdKY6guA+s8cIpmhVS4tw6bFFXtyKno8q2rkZqtr6PUxter0dpWOrDQ Jx30htr3isRNNKNAaAAnr6XsqCc8aAsD3vAXtgQreA4fFElF2Xp3vDRrkdQ76r/m0QkadK nLxqlOgGjT9MAADXTnJUQku01YUaOKKIX5FlcAHDvAh42I1EPTRfSGvretZjMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcDbR4xmhztsT; Tue, 08 Jul 2025 21:22: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 568LMhG9046549; Tue, 8 Jul 2025 21:22:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMhPM046546; Tue, 8 Jul 2025 21:22:43 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:43 GMT Message-Id: <202507082122.568LMhPM046546@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: 9ad1589c7334 - main - devd.conf.5: Use a tag list block for NVMe SMART errors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9ad1589c733434e695f1a0954d428725a5339893 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad1589c733434e695f1a0954d428725a5339893 commit 9ad1589c733434e695f1a0954d428725a5339893 Author: John Baldwin AuthorDate: 2025-07-08 21:22:30 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:30 +0000 devd.conf.5: Use a tag list block for NVMe SMART errors groff doesn't seem to handle nested column list blocks correctly for postscript and HTML output causing the subsequent nvme event to be indented incorrectly. Using a tag list block works around this. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index f038efc5fdd6..4dbd7338edb1 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -491,14 +491,21 @@ $state has a hex bitmask of the bits that changed, as defined in the NVMe Standard for Critical Warning field of log page 2 .Dq SMART / Health Information Log : .Pp -.Bl -column "Bit Value" "Meaning" -compact -.Sy "Bit Value" Ta Sy "Meaning" -.It 0x1 Ta Spare capacity below threshold -.It 0x2 Ta Temperature outside acceptable range -.It 0x4 Ta Reliability of media degraded -.It 0x8 Ta Media placed into read-only mode -.It 0x10 Ta Volatime memory backup failure -.It 0x20 Ta Persistent memory read-only or degraded +.Bl -tag -width "Bit Value" -compact +.It Sy "Bit Value" +.Sy Meaning +.It 0x1 +Spare capacity below threshold +.It 0x2 +Temperature outside acceptable range +.It 0x4 +Reliability of media degraded +.It 0x8 +Media placed into read-only mode +.It 0x10 +Volatime memory backup failure +.It 0x20 +Persistent memory read-only or degraded .El .It Li nvme Ta Li controller Ta Li RESET Ta A controller reset event has happened. From nobody Tue Jul 8 21:22:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcDbQ0Mxnz60Y4g; Tue, 08 Jul 2025 21:22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbP3wDwz43BC; Tue, 08 Jul 2025 21:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J8F4Ql1y+ZYQQ5y0U65jtQper6rvULEV9mAsaACyndM=; b=GVZQt0rjPN74B3jpmo/ll7Hz90//aySUrxsEAWPgzWeEUwSr91s5kLSJkYaRGrW0isjOHE Uyy4biGO6hsFACwil8cOcLqIg6/Fs2I25hexgKvZMmUmDD2SJiPuv/mQS3GRpsIALOnFH9 5orPj9CIur2V2nVBe9gNuUCBmiefzduiGO/EgxpaF2LM0lFHUNUzTI5+bVdh6F3JYiQfV0 MwRv7NfX2lqUK/L6riEg8MLqrCKSNELh5ZH9lMCCYIbnxWb+zATtBbeczA+ocWkNBMjnyD rQr3IzRXTd0G+QaMNa43+oCw1O55rwHpqczh3jtcepSuWXcMh160cc16ZXht2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J8F4Ql1y+ZYQQ5y0U65jtQper6rvULEV9mAsaACyndM=; b=hK95ob7NWyx0LIGOFPEkWrVFaqXj6vNjP1eZqQmaZRo6l/y3dQcmB+u7loy0VCFU5fSF5S NjDWk1Xq57+5RHqHs+BQ6oLcc3AKOiVRJ5jxJQUraqaQgrK9O58LA9DDiPlwm/e2vaXSkg xVeT3o4qSHBspPMUiFvYNylO/HqbOXs7paL6+uoj7DrYQpO7nDnQR68AEPvMbR8PTK6oJ9 l6RfOj4yOIR+vt+Ue9LW5S7LiTaJHuoLdfuZAytXoSXSOxKlf77PgyKLRQbOP9cqEfqjpH kKn+Hj7ktVXwoOXgwhI/D64zEGbIWtnsKVV//6KjUr4u/OK3b/2q+GrstmVW6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009761; a=rsa-sha256; cv=none; b=bSnmR4LJacsbgqoInx6Ipz1TadPEZHhn9laV/37ojxI5O3nwzJuPKhr3etTQI7Tsi+Z/tf ipxGuaL6Er93fIpnTe303MWdPAwg5slUvcTitGBysnAFQoT0sToPuWKAtrc1dOATJGyTVd IwTWSZXGsmUGxi5PLKbkj72k2bDnWWEhTW/NJxd4wAMZoW5wkihxJzu7TF9uVW3GZ3y7An TyeT9A0puEcaP2dbXHccdsYmIs8bP9x0aq/1s0KP/tXilLjBMVGVx+Z3V/8QF0uT/Z/qsi NyLl8jLnYgJ/6gNJhlWphgn1i5zcPn5ePTzbQiNRabFQNvu6bUX48b5iaItGSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcDbP3V3tztt3; Tue, 08 Jul 2025 21:22: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 568LMfr1046475; Tue, 8 Jul 2025 21:22:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMfus046472; Tue, 8 Jul 2025 21:22:41 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:41 GMT Message-Id: <202507082122.568LMfus046472@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: b00d9fa1dd7c - main - devd.conf.5: Expand the width of various columns List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b00d9fa1dd7cc3d8022388f667d4b53f4d5e263c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b00d9fa1dd7cc3d8022388f667d4b53f4d5e263c commit b00d9fa1dd7cc3d8022388f667d4b53f4d5e263c Author: John Baldwin AuthorDate: 2025-07-08 21:22:16 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:16 +0000 devd.conf.5: Expand the width of various columns Using upper case for column width templates avoids overfull columns when using groff to generate a postscript version of the manpage but doesn't affect the terminal version. Use a wider default column (8 characters) for the "Type" column and use wider widths for tables with longer event types. In the terminal, man(1) forces a line break after overfull column items, but in the postscript and HTML versions the column just overflows into the adjacent column without any separation. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 44667858ed13..188bd90d1c9f 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -322,7 +322,7 @@ mechanism. .\" for each of the tables so that things line up in columns nicely. .\" Please do not omit the type column for notifiers that omit it. .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ACPI Ta Ta Ta Events related to the ACPI Subsystem. @@ -346,13 +346,13 @@ Suspend notification. Thermal zone events. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li AEON Ta Li power Ta Li press Ta The power button on an Amiga has been pressed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li CAM Ta Ta Ta Events related to the @@ -366,7 +366,7 @@ Generic errors. Command timeouts. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li CARP Ta Ta Ta Events related to the @@ -383,7 +383,7 @@ Node become the master for a virtual host. Node become the backup for a virtual host. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "CORETEMP" "SUBSYSTEM" "TEMPERATURE" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li coretemp Ta Ta Ta Events related to the @@ -395,7 +395,7 @@ Notification that the CPU core has reached critical temperature. String containing the temperature of the core that has become too hot. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li DEVFS .It Li DEVFS Ta Li CDEV Ta Li CREATE Ta @@ -408,7 +408,7 @@ The node is destroyed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ETHERNET Ta Ar inet Ta IFATTACH Ta Notification when the default VNET instance of the @@ -416,7 +416,7 @@ Notification when the default VNET instance of the interface is attached. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "GEOM::ROTATION_RATE" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li GEOM Ta Ta Ta Events related to the @@ -447,7 +447,7 @@ A provider size has changed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "LINK_DOWN" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li IFNET .It Li IFNET Ta Em inet Ta Ta @@ -471,7 +471,7 @@ The network interface address added. The network interface address removed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kernel Ta Li signal Ta Li coredump Ta Notification that a process has crashed and dumped core. @@ -479,7 +479,7 @@ Notification that a process has crashed and dumped core. Notification that the system has woken from the suspended state. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "SMART_ERROR" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li nvme Ta Li controller Ta Li SMART_ERROR Ta A SMART Critical Warning State change has happened. @@ -507,7 +507,7 @@ controller reset, and a timeout while waiting for the controller to reset respectively. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "SHUTDOWN-THRESHOLD" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li PMU Ta Ta Ta Notification of events from various types of Power Management Units. @@ -580,7 +580,7 @@ An under-voltage condition on the power lines for the USB power pins. A device has been unplugged into a USB device. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li RCTL Ta Ta Ta Events related to the @@ -590,7 +590,7 @@ framework. A rule with action specified as "devctl" was triggered. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li USB Ta Ta Ta Events related to the USB subsystem. @@ -604,7 +604,7 @@ USB interface is attached to a device. USB interface is detached from a device. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VFS Ta Ta Ta Events from the vfs system. @@ -618,7 +618,7 @@ Notification of a filesystem is remounted (whether or not the options actually c Notification of a filesystem being unmounted. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta Li BELL Ta Li RING Ta Notification that the console bell has rung. @@ -627,7 +627,7 @@ See for details. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ZFS Ta Li ZFS Ta Ta Events about the ZFS subsystem. From nobody Tue Jul 8 21:39:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcDyg3ZYzz60ZVt; Tue, 08 Jul 2025 21:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDyg0ZkXz3GYc; Tue, 08 Jul 2025 21:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752010763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6xBwA9FzQm702+Ld2EvaKENmyyCiopsxWpeP4QGudNQ=; b=J7U16WYvQWvGkrrrmuCs6QNK76sukNwUDTay9aMemCWnEHa6QS3r7h0kdpkwQmXj4eJy47 LEuM1uBP0vWF0d+r5KZGW2YyyQhVluA8QQCCi+B95zaiGKRPJG9D8N4ue4Y/v+miMA31p6 +QmIAcHsNXiVyPSMNpNgb5aCe1hdHv08TgshPT/iFcu1b4kC7JXTRGOGCVY0SJgzU3vR0X 8CaEZb2c83qUw2NmtiN82y/poQSZhjheJjdvcdq4SZdqoEcEE/7cncKGf8HbybSosPCYeR 1P+Q9aQHTF7RXOdHHavJDYi/zqZwMgibDJ0UNnIrBI7jC/VI0K/u/zNZLcAXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752010763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6xBwA9FzQm702+Ld2EvaKENmyyCiopsxWpeP4QGudNQ=; b=Ot/7XLx3WAjBJRSF+kSNmMM31U/0R4/ceyr/fA4RLpAgV5tbnDAlTqW/B8TZEg3sEbM4zR wLDj7S31ag45JXURQWEMZH2rX9b+5tjsRvy0RfLpEXTdpEg++/kKgQcr8qBpVNvhZM1ZXb p8hfnuK9tZS2zesuYkvLnruaOzW1GsnEUO02ahMmPKvMP8n4e4vzm5mDgZ37bWm8gZ0GGe dqUG0nBBuB+0ltyj0e1ZfSTnNP3HTzVGeZkMtoKKNkqAUZrdmiOoAuVDXLNLpa8rsVah22 Z18sMBCwxBKCwb732pUiWtq7zX8q8SmC9JSNLpTeRZ/lH2975BdhpNajB/BGDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752010763; a=rsa-sha256; cv=none; b=PrdnGaT4k5YJK2gQXhukLDsO7VW9J9b+XxyvoulUQFADEzOFp7j7AofdSd62aLxf+8kKAP WJmdPCJPUDZQOcaOsB/oyhX2Nsybqih26YN4NKa+g6c6NvZipmxaBPOSGU40dwUhgnyRby 2uBe42MW28KjvDOUEZM2zB2hAv2t3uv5KNgHG7LOcB8Jcy4H9Q0BYMswPNn7KTXb0EhnH4 hCI7HkFCM6Mku+3c3SaYUueatuAII1GYZV/dgLhuGN8xuVdXwlFmDVGi0yzC/raRNpSvFK Uic7t9iL62G52UFJLjQFmEaCPlRfLopZV17sq5BDh0565/pBMIpy0VhK+z4agA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcDyf70f2zv43; Tue, 08 Jul 2025 21:39: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 568LdMhr067625; Tue, 8 Jul 2025 21:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LdMaW067622; Tue, 8 Jul 2025 21:39:22 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:39:22 GMT Message-Id: <202507082139.568LdMaW067622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jilles Tjoelker Subject: git: da9e73e5d483 - main - wordexp(3): Handle ECHILD from waitpid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da9e73e5d483c47e67b3094356dd4b640749849e Auto-Submitted: auto-generated The branch main has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=da9e73e5d483c47e67b3094356dd4b640749849e commit da9e73e5d483c47e67b3094356dd4b640749849e Author: Kenny Levinsen AuthorDate: 2025-04-21 12:13:43 +0000 Commit: Jilles Tjoelker CommitDate: 2025-07-08 21:27:33 +0000 wordexp(3): Handle ECHILD from waitpid If the calling process has used SIG_IGN as handler or set the SA_NOCLDWAIT flag for SIGCHLD, processes will be automatically reaped on exit and calls to waitpid(3) will therefore fail with ECHILD. We waitpid primarily to reap our child so that the caller does not have to worry about it. ECHILD indicates that there is no child to reap, so we can just treat that as a success and move on. Signed-off-by: Kenny Levinsen Tested by: Jan Beich Pull Request: https://github.com/freebsd/freebsd-src/pull/1675 --- lib/libc/gen/wordexp.c | 10 +++++++++- lib/libc/tests/gen/wordexp_test.c | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index f1437e30bbe2..f8080c20d121 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -265,7 +265,15 @@ cleanup: errno = serrno; return (error); } - if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) + /* + * Check process exit status, but ignore ECHILD as the child may have + * been automatically reaped if the process had set SIG_IGN or + * SA_NOCLDWAIT for SIGCHLD, and our reason for waitpid was just to + * reap our own child on behalf of the calling process. + */ + if (wpid < 0 && errno != ECHILD) + return (WRDE_NOSPACE); /* abort for unknown reason */ + if (wpid >= 0 && (!WIFEXITED(status) || WEXITSTATUS(status) != 0)) return (WRDE_NOSPACE); /* abort for unknown reason */ /* diff --git a/lib/libc/tests/gen/wordexp_test.c b/lib/libc/tests/gen/wordexp_test.c index 909097fbf51e..a8b9d5509633 100644 --- a/lib/libc/tests/gen/wordexp_test.c +++ b/lib/libc/tests/gen/wordexp_test.c @@ -292,6 +292,31 @@ ATF_TC_BODY(with_SIGCHILD_handler_test, tc) ATF_REQUIRE(r == 0); } +ATF_TC_WITHOUT_HEAD(with_SIGCHILD_ignore_test); +ATF_TC_BODY(with_SIGCHILD_ignore_test, tc) +{ + struct sigaction sa; + wordexp_t we; + int r; + + /* With SIGCHLD set to ignore so that the kernel auto-reaps zombies. */ + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sa.sa_handler = SIG_IGN; + r = sigaction(SIGCHLD, &sa, NULL); + ATF_REQUIRE(r == 0); + r = wordexp("hello world", &we, 0); + ATF_REQUIRE(r == 0); + ATF_REQUIRE(we.we_wordc == 2); + ATF_REQUIRE(strcmp(we.we_wordv[0], "hello") == 0); + ATF_REQUIRE(strcmp(we.we_wordv[1], "world") == 0); + ATF_REQUIRE(we.we_wordv[2] == NULL); + wordfree(&we); + sa.sa_handler = SIG_DFL; + r = sigaction(SIGCHLD, &sa, NULL); + ATF_REQUIRE(r == 0); +} + ATF_TC_WITHOUT_HEAD(with_unused_non_default_IFS_test); ATF_TC_BODY(with_unused_non_default_IFS_test, tc) { @@ -350,6 +375,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, WRDE_BADCHAR_test); ATF_TP_ADD_TC(tp, WRDE_SYNTAX_test); ATF_TP_ADD_TC(tp, with_SIGCHILD_handler_test); + ATF_TP_ADD_TC(tp, with_SIGCHILD_ignore_test); ATF_TP_ADD_TC(tp, with_unused_non_default_IFS_test); ATF_TP_ADD_TC(tp, with_used_non_default_IFS_test); From nobody Tue Jul 8 21:49:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcFB360DKz60bBq; Tue, 08 Jul 2025 21:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcFB34YBZz3NPZ; Tue, 08 Jul 2025 21:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752011355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lzwKKpqE4wN9NbP+7we0+0Sgdub7WmWK3lXtZfT+PB4=; b=gsoYL1aw4aU/QSjORRA//rSY2oZvQQf7NgpcKllyKYTm2EnUaq//DGhjBRtj/mLFbPrwJr pOd3rR5+tIK/XLkL/8Cuzd2ffHs7ifimlMsR9Ylp6t8d3sQFEB4Vim/lurH8SpwuLha5Gt FGp/ksIyMEOzfzJpwKYTqMy2670v0sY6EP+chgWYXPIYcaBfv5jAxvMc+mVX0C+LmYblDF LqxpISICRNaPSI2jo8WpAI786EvV6P8Rj5QolMY/uWUqxEBILECiOgXe9Lj5rMFk0CK2eE oHO3XfJ7t92ip+CatrUA7k3mqKV+5gGfdWPYnAO8641tP9Alt56v2HlhECVXMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752011355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lzwKKpqE4wN9NbP+7we0+0Sgdub7WmWK3lXtZfT+PB4=; b=EoCmr0/pdHKNCSnadyNiJUNpop3tbQ7Mk/Y8CnRueh7FQ2YaT2DaQKQMKQEhr3zASDrwQZ g3OBersvYfOkLzW+kQlYI0s17+Ha5wQ7TaiJxAdQXVjwpgnCpvewTGKceNjFNFvqkBCZxz 3IFMmhIPPz0J+d0a/KRvOlIKQUz7uQvZnQiRWsMYYHi8NK00nCpYo8AQPj/gDafYYK9dr9 zVbYx0uoa2Al+IucLn57ewUMVw2sshAMTjwPNoPobuXPv3Fxk2BntdlZOM97yNo2UaDlF4 OSvP345PQVm7+o8ErAZzZ0vpskpeTS4ZSniZkX0btdSA3KTrGwD7BuAzDHztrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752011355; a=rsa-sha256; cv=none; b=eSuADV7MoopTAEN7XgGW9/IyJJc3XSCOk3QLYTmHv9NdqLeWx2ayj+ZEjAvNE5QkwzPmlc ed7ryoJ3mLXp5C4JkrnDjklHdBWgNp7lVVHcJrY6hEWA91Y7yx8Q9WEyob2bXLU/Uwl3jk YFyqWGYNP/U5cUQYhbSIJ2XhPy5S+JUjNsYZsez0KLTBEhPUNX3ygzfVd/EI/A39erDEfi uxEyWcKpV6DqP8xJccL6yW5GKIT5Cky11DYszo0KBYHkMh5C8wIj++QBzH+IU6pwaiq+9l MLAORjgiaDMiNImf0KRNOEArc0JwTlc+dO74AsEyvg1O2m0KqNJxi3S17JYdmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcFB3422pzvBh; Tue, 08 Jul 2025 21:49: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 568LnFqG086274; Tue, 8 Jul 2025 21:49:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LnFXX086271; Tue, 8 Jul 2025 21:49:15 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:49:15 GMT Message-Id: <202507082149.568LnFXX086271@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: 8cc93cd668a6 - main - fcntl.2: fix description of F_GETFD return value List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8cc93cd668a69b3c6bf0da769486cb4a43e67d6d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8cc93cd668a69b3c6bf0da769486cb4a43e67d6d commit 8cc93cd668a69b3c6bf0da769486cb4a43e67d6d Author: Konstantin Belousov AuthorDate: 2025-07-08 20:05:26 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-08 21:48:58 +0000 fcntl.2: fix description of F_GETFD return value Now we have three flags provided. Sponsored by: The FreeBSD Foundation --- lib/libsys/fcntl.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsys/fcntl.2 b/lib/libsys/fcntl.2 index 3cf8adc29f88..d67c38cfbc6c 100644 --- a/lib/libsys/fcntl.2 +++ b/lib/libsys/fcntl.2 @@ -577,7 +577,7 @@ A new file descriptor. A file descriptor equal to .Fa arg . .It Dv F_GETFD -Value of flag (only the low-order bit is defined). +Value of flags. .It Dv F_GETFL Value of flags. .It Dv F_GETOWN From nobody Tue Jul 8 23:04:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcGsC6JVDz60hH0; Tue, 08 Jul 2025 23:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcGsC5MGjz49Lf; Tue, 08 Jul 2025 23:04:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752015887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fn9u3oyJAi59g1fwTTP3fXWgjEbuYAyvGIw1DAqUJZo=; b=jJ7xDhG2ObQwBhNtYh8Lu/jx/1ilRoFQ1pZ2L18s+y65ONe0zDGCddxWbSFD5A1TYxPdMY f+C0NdbG+zj2ObKPp2XHR9YeQau12Y+Nju4vZA2oXo0uv/I/By2eugV/3t9vQUBNm6mNsa sQD7lWKSY+sa+ot/j/fb5nPFkk3CZSrGFO+M8O2wNaph/hri5L54bcIarN2C4rcQfTfa7y 9T3jTaFjezZZ+eF9q+uZEFjiHlz9OGPo6HGfeW69yRUme9auk0J/3CkTA0EIO1KiRyVTOq QdUnvq7IhWSriVNlbQWp5xUyGVjrC0/6q0pIHisLghgLW2+wlwXRYSt6LcUtGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752015887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fn9u3oyJAi59g1fwTTP3fXWgjEbuYAyvGIw1DAqUJZo=; b=Dt4GcOw7dgTg+TSH4V4OY0sdaAlwTqfk/il6U3PUP6RZVuppJG2rv5kd7/bmYDRea9CuU9 OLSEEHbxcOP6fdpHp0kQB+Sx6w/Ki0VsOKKo85RAYU/o5h+UkLIQiq77P3DLf7JhDoL2xR NAcE4qk5JP/UYXw/3nbYwzU7PilJH13QSNUsjkVx1whDXRMnLQuvPc/j8q0/SC2xNA7h0R LmphPxsR6I/gvIXu81DUotLySyY7/EkNDEEwJ6KTyvSJFbjZqKlGW8mBAPBjNefvU+6UnF 7trKU8i0KFaL7XjD6+e4HuwbJcdNknqXWWPsFoUxs3p+4NbQSlS0H6XU799EGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752015887; a=rsa-sha256; cv=none; b=Uwof5j44ldHu7Uo/AfOd08vyIfDpXAaAVVkDwvF96OmPCYbCqNH8pXdt1det1f7eVK9GvN owIPTmxxkkLxByno+Qvz4LEt0TVdPsLxaMUr9Hu2KZ2Ci2iQrE8ZLVbId7N444bfMuPwvb GnYMcPY2AqIVPlopIUF2G2CMGRGsRog/3lghE7moRu+xsUXWsjwYehZJBJuyZnlph8f6v9 IG4W2bdTDb+heCl9V3kjg3X3DdD0cWvTL4mfGouozzjOGhB9hNUsz4UGPi0GlsbLGVu9ku N7msnKzAxEC+xwkz5T7fVwdR4I+FZYeHpUKV5Xe3cSUWWqHJ37THot8gKBdARA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcGsC3t8szx8l; Tue, 08 Jul 2025 23:04: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 568N4ldq035556; Tue, 8 Jul 2025 23:04:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568N4lii035553; Tue, 8 Jul 2025 23:04:47 GMT (envelope-from git) Date: Tue, 8 Jul 2025 23:04:47 GMT Message-Id: <202507082304.568N4lii035553@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: 0849d876b1ac - main - cam/mmc: style(9) pass: put { starting functions on its own line List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 0849d876b1ac414e55643e408464be63bc9b1a71 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0849d876b1ac414e55643e408464be63bc9b1a71 commit 0849d876b1ac414e55643e408464be63bc9b1a71 Author: Warner Losh AuthorDate: 2025-07-08 16:01:56 +0000 Commit: Warner Losh CommitDate: 2025-07-08 22:52:04 +0000 cam/mmc: style(9) pass: put { starting functions on its own line Sponsored by: Netflix --- sys/cam/mmc/mmc_da.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 3815561898bd..f7c478076144 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -789,7 +789,8 @@ sddaregister(struct cam_periph *periph, void *arg) static int mmc_exec_app_cmd(struct cam_periph *periph, union ccb *ccb, - struct mmc_command *cmd) { + struct mmc_command *cmd) +{ int err; /* Send APP_CMD first */ @@ -843,7 +844,8 @@ mmc_exec_app_cmd(struct cam_periph *periph, union ccb *ccb, } static int -mmc_app_get_scr(struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr) { +mmc_app_get_scr(struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr) +{ int err; struct mmc_command cmd; struct mmc_data d; @@ -869,7 +871,8 @@ mmc_app_get_scr(struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr) { static int mmc_send_ext_csd(struct cam_periph *periph, union ccb *ccb, - uint8_t *rawextcsd, size_t buf_len) { + uint8_t *rawextcsd, size_t buf_len) +{ int err; struct mmc_data d; @@ -966,14 +969,16 @@ mmc_switch(struct cam_periph *periph, union ccb *ccb, } static uint32_t -mmc_get_spec_vers(struct cam_periph *periph) { +mmc_get_spec_vers(struct cam_periph *periph) +{ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; return (softc->csd.spec_vers); } static uint64_t -mmc_get_media_size(struct cam_periph *periph) { +mmc_get_media_size(struct cam_periph *periph) +{ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; return (softc->mediasize); @@ -992,7 +997,8 @@ mmc_get_cmd6_timeout(struct cam_periph *periph) static int mmc_sd_switch(struct cam_periph *periph, union ccb *ccb, uint8_t mode, uint8_t grp, uint8_t value, - uint8_t *res) { + uint8_t *res) +{ struct mmc_data mmc_d; uint32_t arg; int err; @@ -1069,7 +1075,8 @@ mmc_set_timing(struct cam_periph *periph, } static void -sdda_start_init_task(void *context, int pending) { +sdda_start_init_task(void *context, int pending) +{ union ccb *new_ccb; struct cam_periph *periph; @@ -1088,7 +1095,8 @@ sdda_start_init_task(void *context, int pending) { } static void -sdda_set_bus_width(struct cam_periph *periph, union ccb *ccb, int width) { +sdda_set_bus_width(struct cam_periph *periph, union ccb *ccb, int width) +{ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; struct mmc_params *mmcp = &periph->path->device->mmc_ident_data; int err; From nobody Wed Jul 9 01:08:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcKbq5h5Jz60qF3; Wed, 09 Jul 2025 01:08:23 +0000 (UTC) (envelope-from aokblast@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcKbq2lxMz3Fyv; Wed, 09 Jul 2025 01:08:23 +0000 (UTC) (envelope-from aokblast@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752023303; 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=BcZWbELluYIHLqrB69V4J1CbHOEN82mmMdc05P/senY=; b=lf/zbavMIC1hulIVwBGfE7Yk5eKbBM7NgKJcqu7aMPzzQoqNkcASjSHDQsVeNOXf5f5ZCT IX/Y6cJumHFr+9Iv8Cb7AGpHWcC5fWffnI9cy2iTKjW/BBlfEcgqQ0lx7FVjGHSEJHZGPH 7TulgQA6EIxKYJgc0sE6UlG+FiB1ocEkm2pQ2lQDvGfiWftZO5eYoZEs6EC7BB0j8WY7cZ 5Mv4tk91tVwKmJKvNXb0px4EUrzQRtjRHUzXzCbAsyPfRn93iH+SfSrsoVtTFT0SjybkHd VBztz4gvwRwRAfmLVN6RLFKBr5MW0/nrcvjISELpOl7DYZIIRcluXHTXKh/9Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752023303; 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=BcZWbELluYIHLqrB69V4J1CbHOEN82mmMdc05P/senY=; b=cOhZp3IJCqhLX/vNh9oUnHWXp9o+XUlZHcmq4ULeihW7uXvr7rtHTmMXBuK7uqKqoBy6vZ Nlc3mHH4/C3jMXju3i8Xv4AC4x4JRKFQ7wnbrsvOaA0JRtRjamXsPmPE/Aya6XgtmGySqc /xCm0iDrIMqBXeBjEqIhT8gbyBco+d5kgz1s6sD6/Cg9xDhSnxJPmDR06jD3LgxSW1nKI9 gYetBkwmkK+tGkR1Q4foAwIXw30j8ocmwUoQt5FRINNluSUPxQwT9XwuEpNTT09r0ksmPm s81Qq5lTkK7hKaIZ1pZoOhuuNKsOk8qs0jWyO92UbKSWUfynf+hTU8YpXbXX8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752023303; a=rsa-sha256; cv=none; b=s4vmDumocnqBvHwiZHLVscjeRhdy6cnip+rlVwIMff7adGvlKGo2PZYibjVAmfYKzMvGwT oL50I+zk1tqHhVHsgfHjwZzjljpLkNCFUCgSNU8kjEKpR1Y3ncI2jU7jwqwFsLt4LXXdrR M+Ido3D+9VDjv7ukxO9ZUEfD3TaTwENAzppEBpATj/2ho/TRExgmtZ09zR4vJ6gVfN+g9e gCCxKvMTL0u4puYfClpCQ5gkutvF39L+ULhqou9m8tIps9T9DCwG+TnHIgRiaS27bslAvS jYyHBLrJYx1Ce9FcydSpssV7LJYUGNlB3MNJU1CaDMYShel3Ig+qc+pKL7jH1Q== Received: from aokblastdeMacBook-Pro.local (118-232-110-206.dynamic.kbronet.com.tw [118.232.110.206]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: aokblast) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bcKbm6f97zyMw; Wed, 09 Jul 2025 01:08:20 +0000 (UTC) (envelope-from aokblast@freebsd.org) From: ShengYi Hung To: Kyle Evans Cc: Adrian Chadd , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb In-Reply-To: (Kyle Evans's message of "Tue, 8 Jul 2025 14:44:42 -0500") References: <202507081512.568FCeX8049407@gitrepo.freebsd.org> User-Agent: mu4e 1.12.11; emacs 30.1 Date: Wed, 09 Jul 2025 09:08:17 +0800 Message-ID: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello. Do you mean LIBUSB20_NO_BACKWARDS_COMPAT applies only to libusb20, or to both libusb10 and libusb20. Since I don't think there is a= nyone use libusb20 directly and the structure in libusb20 is for decoding only. > On 7/8/25 14:40, Adrian Chadd wrote: >> hi! Thanks for this! >> Could we possibly wrap stuff like these compat macros in a #define >> that we can undefine? So we can make sure no new code shows up that >> uses the "old" paths? >> eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB20_NO_BACKWARDS_COMPAT ? >> Thanks! >>=20 > > The latter, please. +1 > > Thanks, > > Kyle Evans > >> -adrian >> On Tue, 8 Jul 2025 at 08:12, ShengYi Hung > > wrote: >> The branch main has been updated by aokblast: >> URL: https://cgit.FreeBSD.org/src/commit/? >> id=3Df84a0da4e0608a970c775f3d605f8de2b0b8d322 > cgit.FreeBSD.org/src/commit/? >> id=3Df84a0da4e0608a970c775f3d605f8de2b0b8d322> >> commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 >> Author:=C2=A0 =C2=A0 =C2=A0ShengYi Hung >> AuthorDate: 2025-06-07 19:43:15 +0000 >> Commit:=C2=A0 =C2=A0 =C2=A0ShengYi Hung >> CommitDate: 2025-07-08 15:11:41 +0000 >> =C2=A0 =C2=A0 libusb: rename bNumDeviceCapabilities to bNumDeviceCa= ps for >> compatibility with libusb >> =C2=A0 =C2=A0 THe member bNumDeviceCapabilities is referred to as >> bNumDeviceCaps in >> =C2=A0 =C2=A0 the upstream libusb project. >> =C2=A0 =C2=A0 To improve compatibility, we are renaming the member >> accordingly. >> =C2=A0 =C2=A0 For backward compatibility, a mocro will be defined t= o map >> =C2=A0 =C2=A0 bNumDeviceCapabilities to bNumDeviceCaps. >> =C2=A0 =C2=A0 See: https://github.com/libusb/libusb/ >> commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 > libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5> >> =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kevans >> =C2=A0 =C2=A0 Approved by:=C2=A0 =C2=A0 markj (mentor) >> =C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks >> =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0FreeBSD Foundation >> =C2=A0 =C2=A0 Differential Revision: https://reviews.freebsd.org/D5= 0740 >> >> --- >> =C2=A0lib/libusb/libusb.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5 ++++- >> =C2=A0lib/libusb/libusb10_desc.c | 11 ++++++----- >> =C2=A0lib/libusb/libusb20_desc.h |=C2=A0 6 +++++- >> =C2=A03 files changed, 15 insertions(+), 7 deletions(-) >> diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h >> index 0aad29aa4ecc..491af3d0a5ec 100644 >> --- a/lib/libusb/libusb.h >> +++ b/lib/libusb/libusb.h >> @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bLength; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bDescriptorType; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t wTotalLength; >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCapabilities; >> +#ifndef bNumDeviceCapabilities >> +#define bNumDeviceCapabilities bNumDeviceCaps >> +#endif >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCaps; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_usb_2_0_device_capability= _descriptor >> *usb_2_0_ext_cap; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_ss_usb_device_capability_= descriptor *ss_usb_cap; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_bos_dev_capability_descri= ptor **dev_capability; >> diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c >> index 3e36009cbb3a..5f4c46740688 100644 >> --- a/lib/libusb/libusb10_desc.c >> +++ b/lib/libusb/libusb10_desc.c >> @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, >> int len, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->bDescriptorType =3D dtype; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->wTotalLength =3D ((const uint8_t *)buf)[2] | >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (((const uint8_t *)buf)[3] << 8); >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->bNumDeviceCapabilities =3D ((const >> uint8_t *)buf)[4]; >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->bNumDeviceCaps =3D ((const uint8_t *)buf)[4]; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->usb_2_0_ext_cap =3D NULL; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->ss_usb_cap =3D NULL; >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->dev_capability =3D calloc(ptr- >> >bNumDeviceCapabilities, sizeof(void *)); >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->dev_capability =3D calloc(ptr- >> >bNumDeviceCaps, >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof(void *)); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 if (ptr->dev_capability =3D=3D NULL) { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(ptr); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (LIBUSB_ERROR_NO_MEM); >> @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int >> len, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dlen >= =3D 3 && >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ptr !=3D NULL && >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 dtype =3D=3D LIBUSB_DT_DEVICE_CAPABILITY) { >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if (index !=3D ptr->bNumDeviceCapabilities) { >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if (index !=3D ptr->bNumDeviceCaps) { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr->dev_capability[index] =3D >> malloc(dlen); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr->dev_capability[index= ] =3D=3D >> NULL) { >> libusb_free_bos_descript= or(ptr); >> @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int >> len, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr !=3D NULL) { >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDev= iceCapabilities =3D index; >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDev= iceCaps =3D index; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* success */ >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >> @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct >> libusb_bos_descriptor *bos) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (bos =3D=3D NULL) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return; >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCapa= bilities; i++) >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCaps= ; i++) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->d= ev_capability[i]); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->dev_capability); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos); >> diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h >> index 017148a34b1c..0f7c9294ebc8 100644 >> --- a/lib/libusb/libusb20_desc.h >> +++ b/lib/libusb/libusb20_desc.h >> @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DE= SC); >> =C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); >> +#ifndef bNumDeviceCapabilities >> +#define bNumDeviceCapabilities bNumDeviceCaps >> +#endif >> + >> =C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 LIBUSB20_BOS_DESCRIPTOR(m,= n) \ >> =C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bLength, ) \ >> =C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bDescriptorType, ) \ >> =C2=A0 =C2=A0m(n, UINT16_T, wTotalLength, ) \ >> -=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCapabilities, ) \ >> +=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCaps, ) \ >> =C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); >>=20 --=20 Best Regards. ShengYi Hung. From nobody Wed Jul 9 02:21:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcMCd0zw1z60w0M; Wed, 09 Jul 2025 02:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcMCc5TVHz3v3N; Wed, 09 Jul 2025 02:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752027660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UaZwqQEtSAvX3P2D/nC6sK7tIHi1N8qmdGEHuDOmok=; b=mDriVXYAoNsRWf1zDOQQykSh58zQsGi16D46/H2l4Ow1f8GzdRBMfcvmq6VOegfx740rN/ 5IY1xQg6X6QfMYIqngsZURR7kE8HwH174zUNl+9Pol1nXXKNu0G5EJwWx2ndqbN3iCxpIQ uYcj3NUJpJqBbmmxhzPqXYHn1cfesnJFGZb9kiII6arDDfXH9YsAIMBeEMWrRpP2i+C/6R XhCZrfaM+D/GaoDHbkk3Iy8Bxy9AJeho42Rjhs0z4hqU2ZEGILnnLaTkdgoEtME06IFvit qMbSjrVmAzu4kaZF65mUHstNGN/pknJMA6mlRPd/QvPk519ZNaWrkSPybsvpCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752027660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UaZwqQEtSAvX3P2D/nC6sK7tIHi1N8qmdGEHuDOmok=; b=ABuMuTfePVwee4vnUP7y/cCoM3i2Eqib1ppLUvjiBJ6zc0zfFF+oNgBviA58aSutj+kPUh MdSQdiwH74u4OfI0IrVTA90rRLLr0w9eSsOaZszDMnGDLMP+ghyTF7CwQ57htSPmOGQl90 dIpv59snjlFk0fufW+xGQ1IHcj/osXpxSOCdW2eQvpcG4bQoOaIUQ+5+NPPGvPIZNuBJQK +7Aqs2alPCuUm9kjqd90pt94Xv5A5LjSQIRwPUZd8nIAmoguRLcCEW7QzzNX5cD+eEXn0/ Z9t/3LDgRmU25aXMm21fc4WKob3480LZBTVXaFtavFRllWz3lNwq12xGCn38Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752027660; a=rsa-sha256; cv=none; b=r6ncNa19Z+8ERiHKy2C9H+b8eC8voLw6rjBkLGirGmOy1VjmVD+jFTSNy2XirXEvQGu95V +mOQBf/TpJsO7QHSB1PduHN8H5tZkMEG8z4Cp+aZYAVFJuXFQUIUNwuhENx13FrIK4qT32 iHivle/zBGgFmM3t5NqWvn3Lh5DobPTGPiecOUvibCjOEKcXs9IvuG9RDbLP9KeCl8Vxo8 9fjJjqcfVA89g/eD7Thl2vnErNObjAhT2vPPmr0cGJlsh2S+757QEwbVOkrF/zwxxnOn4l QSQrmxXmM6VoWxpECIid00uqGXzD8hiLsW8lA3rqNIF65PTquXEN463dgMD3Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcMCc4pFpz12hq; Wed, 09 Jul 2025 02:21: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 5692L0wr002779; Wed, 9 Jul 2025 02:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5692L0ia002776; Wed, 9 Jul 2025 02:21:00 GMT (envelope-from git) Date: Wed, 9 Jul 2025 02:21:00 GMT Message-Id: <202507090221.5692L0ia002776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: bca5df45652a - main - libusb: replace LOG_LEVEL with DEBUG_LEVEL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bca5df45652ae4edd14fa032be8f271e044d32b2 Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=bca5df45652ae4edd14fa032be8f271e044d32b2 commit bca5df45652ae4edd14fa032be8f271e044d32b2 Author: ShengYi Hung AuthorDate: 2025-06-04 09:57:30 +0000 Commit: ShengYi Hung CommitDate: 2025-07-09 02:19:47 +0000 libusb: replace LOG_LEVEL with DEBUG_LEVEL The libusb set debug level by libusb_log_level instead of libusb_debug_level. We switch to libusb_log_level for better compatibility with the upstream libusb. Additionally, The upstream libusb has an option allows user to override the log function with a user-defined callback. To support the callback function with a single string without va_arg, we refactor the log facility as a function instead of a macro and parse all va_args inside. The legacy debug_level enum has been removed to enforce maintainer migrate from their deprecated source code. Reviewed by: kevans Approved by: markj (mentor), lwhsu (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50680 --- lib/libusb/libusb.h | 11 ----------- lib/libusb/libusb10.c | 47 +++++++++++++++++++++++++++++++++++++++-------- lib/libusb/libusb10.h | 24 ++++++------------------ lib/libusb/libusb10_io.c | 20 ++++++++++---------- 4 files changed, 55 insertions(+), 47 deletions(-) diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 491af3d0a5ec..17d341d1b91c 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -243,17 +243,6 @@ enum libusb_log_level { LIBUSB_LOG_LEVEL_DEBUG }; -/* XXX */ -/* libusb_set_debug should take parameters from libusb_log_level - * above according to - * https://libusb.sourceforge.io/api-1.0/group__libusb__lib.html - */ -enum libusb_debug_level { - LIBUSB_DEBUG_NO=0, - LIBUSB_DEBUG_FUNCTION=1, - LIBUSB_DEBUG_TRANSFER=2, -}; - #define LIBUSB_HOTPLUG_MATCH_ANY -1 typedef enum { diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 3e81f234a735..173f51aa88b3 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #endif #define libusb_device_handle libusb20_device +#define LIBUSB_LOG_BUFFER_SIZE 1024 #include "libusb20.h" #include "libusb20_desc.h" @@ -128,7 +130,7 @@ libusb_interrupt_event_handler(libusb_context *ctx) err = eventfd_write(ctx->event, 1); if (err < 0) { /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "Waking up event loop failed!"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_ERROR, "Waking up event loop failed!"); } } @@ -253,7 +255,7 @@ libusb_init_context(libusb_context **context, if (context) *context = ctx; - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_init complete"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_INFO, "libusb_init complete"); signal(SIGPIPE, SIG_IGN); @@ -625,7 +627,7 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, if (ctx == NULL) return (NULL); /* be NULL safe */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_with_vid_pid enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_open_device_with_vid_pid enter"); if ((i = libusb_get_device_list(ctx, &devs)) < 0) return (NULL); @@ -649,7 +651,7 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, } libusb_free_device_list(devs, 1); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_with_vid_pid leave"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_open_device_with_vid_pid leave"); return (pdev); } @@ -1536,7 +1538,7 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) dev = libusb_get_device(uxfer->dev_handle); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_submit_transfer enter"); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_submit_transfer enter"); sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); @@ -1571,7 +1573,7 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) CTX_UNLOCK(dev->ctx); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_submit_transfer leave %d", err); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_submit_transfer leave %d", err); return (err); } @@ -1600,7 +1602,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) dev = libusb_get_device(devh); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer enter"); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_cancel_transfer enter"); sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); @@ -1661,7 +1663,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) CTX_UNLOCK(dev->ctx); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer leave"); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_cancel_transfer leave"); return (retval); } @@ -1811,3 +1813,32 @@ libusb_has_capability(uint32_t capability) return (0); } } + +void +libusb_log_va_args(struct libusb_context *ctx, enum libusb_log_level level, + const char *fmt, ...) +{ + static const char *log_prefix[5] = { + [LIBUSB_LOG_LEVEL_ERROR] = "LIBUSB_ERROR", + [LIBUSB_LOG_LEVEL_WARNING] = "LIBUSB_WARN", + [LIBUSB_LOG_LEVEL_INFO] = "LIBUSB_INFO", + [LIBUSB_LOG_LEVEL_DEBUG] = "LIBUSB_DEBUG", + }; + + char buffer[LIBUSB_LOG_BUFFER_SIZE]; + char new_fmt[LIBUSB_LOG_BUFFER_SIZE]; + va_list args; + + ctx = GET_CONTEXT(ctx); + + if (ctx->debug < level) + return; + + va_start(args, fmt); + + snprintf(new_fmt, sizeof(new_fmt), "%s: %s\n", log_prefix[level], fmt); + vsnprintf(buffer, sizeof(buffer), new_fmt, args); + fputs(buffer, stdout); + + va_end(args); +} diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index 70b5525df537..9ad08edf075b 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -29,6 +29,7 @@ #define __LIBUSB10_H__ #ifndef LIBUSB_GLOBAL_INCLUDE_FILE +#include #include #include #include @@ -46,24 +47,11 @@ #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) -#define DPRINTF(ctx, dbg, format, ...) do { \ - switch (dbg) { \ - case LIBUSB_DEBUG_FUNCTION: \ - if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ - printf("LIBUSB_FUNCTION: " \ - format "\n", ## __VA_ARGS__); \ - } \ - break; \ - case LIBUSB_DEBUG_TRANSFER: \ - if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ - printf("LIBUSB_TRANSFER: " \ - format "\n", ## __VA_ARGS__); \ - } \ - break; \ - default: \ - break; \ - } \ -} while (0) +void libusb_log_va_args(struct libusb_context *ctx, enum libusb_log_level level, + const char *fmt, ...) __printflike(3, 4); + +#define DPRINTF(ctx, dbg, format, ...) \ + libusb_log_va_args(ctx, dbg, format, ##__VA_ARGS__) /* internal structures */ diff --git a/lib/libusb/libusb10_io.c b/lib/libusb/libusb10_io.c index f1e31c2a7416..dd541b09caa6 100644 --- a/lib/libusb/libusb10_io.c +++ b/lib/libusb/libusb10_io.c @@ -108,7 +108,7 @@ libusb10_handle_events_sub(struct libusb_context *ctx, struct timeval *tv) int i; int err; - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb10_handle_events_sub enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb10_handle_events_sub enter"); nfds = 0; i = 0; @@ -230,7 +230,7 @@ do_done: /* Wakeup other waiters */ pthread_cond_broadcast(&ctx->ctx_cond); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb10_handle_events_sub complete"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb10_handle_events_sub complete"); return (err); } @@ -314,7 +314,7 @@ libusb_wait_for_event(libusb_context *ctx, struct timeval *tv) int err; ctx = GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_wait_for_event enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_wait_for_event enter"); if (tv == NULL) { pthread_cond_wait(&ctx->ctx_cond, @@ -358,7 +358,7 @@ libusb_handle_events_timeout_completed(libusb_context *ctx, ctx = GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_handle_events_timeout_completed enter"); libusb_lock_events(ctx); @@ -374,7 +374,7 @@ libusb_handle_events_timeout_completed(libusb_context *ctx, libusb_unlock_events(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed exit"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_handle_events_timeout_completed exit"); return (err); } @@ -523,7 +523,7 @@ libusb10_do_transfer_cb(struct libusb_transfer *transfer) ctx = libusb10_get_context_by_device_handle(transfer->dev_handle); - DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "sync I/O done"); pdone = transfer->user_data; *pdone = 1; @@ -613,12 +613,12 @@ libusb_bulk_transfer(libusb_device_handle *devh, ctx = libusb10_get_context_by_device_handle(devh); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_bulk_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, timeout, LIBUSB_TRANSFER_TYPE_BULK); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer leave"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_bulk_transfer leave"); return (ret); } @@ -632,12 +632,12 @@ libusb_interrupt_transfer(libusb_device_handle *devh, ctx = libusb10_get_context_by_device_handle(devh); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_interrupt_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer leave"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_interrupt_transfer leave"); return (ret); } From nobody Wed Jul 9 03:44:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcP4K6CNTz611sl; Wed, 09 Jul 2025 03:44: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcP4K54nMz3lLW; Wed, 09 Jul 2025 03:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752032689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7jyYLSL3fY/2IluHz9RV4sGDwkasJ+jbRXJCE5pQY5Y=; b=q9nL1PfhYP5Zy2OlQiQ1hrmRE8u9Suqwz6Q0rY0LijGW5XVpRCEiQ90idK5q3idgIogCn9 IUhQ2jrSV+MOb/mDeouY6h7plFuj3vXlxr1q4vmhpes7T71al0TK8BCiZYKZQ7uLFrlI19 opXjidUDmwoNTgFgUtzh5H7lJC8wX4VxWsov2U9NQFp90UmMKM5E/BeuSLUguOL6Ug+vkc 83mybUSVFGtPOo8eWrMJHdYlzB3LHrzNtJ6ML/mMYOse4TSOdx1676JR29BvbWxqASCRoF Ak6UIoqeqqa8VGk2mF5vl2zu5exBkX5mJFhLU2r1qVznXjZdIcuy4s/JPnIGeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752032689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7jyYLSL3fY/2IluHz9RV4sGDwkasJ+jbRXJCE5pQY5Y=; b=gp8WxaqGFGDtzjgzmAqnBMvVB+beldSqeJCpvsKbQMTvkyIaf+2DJZnDo1s3nt5m0DuXRX YtIZbrC3kxyEGBC1OtD1stkdlKGIv3ZNlA9TOE0zlQRUVApkOwPAG9JNGim/FBOoFkoJmd 5CguqQL6OLs9IVV0c/tcJHxxSGCJsm5GVN9Wmac9HR7eYd0njSreWo0Ehj2z0hifArca8L lQOLP8FhhpLrgjMneMFC82Q/Is224caTgafIlMtL5ZIxw0cTl/vpjdUUH0rXFxk+dq5ej8 fS+L6eV/YOK8xAE5XuSNGrX1Dk6p1rM+oqDus0EVIVR5XxkK122vpuIDVq2h2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752032689; a=rsa-sha256; cv=none; b=JV6sVwc6szauwXP1dUXu9Yfun4jyGDHXl8XX84qDQGuj5ueI5VJdC25jp84icAvUZNoM+0 HwXdjLaKnBu6IwGuqVpdcLe9yjYMPWR9cbstDc+X4P4nirHk4S/4oT3mALfbiwR8/uh6Mt 7LGQsZwV18JY8ETg+EVwkCc4AADMA+LGSNWrrXLeCvNKhKOYbJWvmWBKiiH3lbhcEAfpLL 6XpSEMw9dbVPiu/FjpYbWMos3TjydjG9bV0upNtQzRfC1q35A9NFx1gSrxXQExV6guC6Nj wiim77Qs8X2scokIctzTTcKynkO3EN9RwAwyWYbjsGzWRzyRlV04Riy5wmdXSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcP4K4Th7z159B; Wed, 09 Jul 2025 03:44: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 5693inrQ061619; Wed, 9 Jul 2025 03:44:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5693inx0061616; Wed, 9 Jul 2025 03:44:49 GMT (envelope-from git) Date: Wed, 9 Jul 2025 03:44:49 GMT Message-Id: <202507090344.5693inx0061616@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: d9cc5dd87b50 - main - fcntl(F_SETFD): make FD_CLOFORK non-sticky List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c commit d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c Author: Konstantin Belousov AuthorDate: 2025-07-08 21:53:08 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 03:44:28 +0000 fcntl(F_SETFD): make FD_CLOFORK non-sticky There is no reason for it to be non-modifing by F_SETFD. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51212 --- sys/kern/kern_descrip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 2e1da2fdee29..93bdd41d1515 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -632,8 +632,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) /* * UF_RESOLVE_BENEATH is sticky and cannot be cleared. */ - fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | - fd_to_fde_flags(arg); + fde->fde_flags = (fde->fde_flags & + ~(UF_EXCLOSE | UF_FOCLOSE)) | fd_to_fde_flags(arg); error = 0; } FILEDESC_XUNLOCK(fdp); From nobody Wed Jul 9 05:12:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcR1x36gBz6172T; Wed, 09 Jul 2025 05:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcR1x1z8xz3LQ9; Wed, 09 Jul 2025 05:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y15FpRDnDqExAD4Oro7aCjPc3cPmv7ntDFrdomXqCmo=; b=s5ts5r6jyvrNzlJZfCHFLvDTRPzdja0u+D4xdbAkuUdGfzJ0ekqT/o6gbea4aZCF5NK+7L 1K30TTE9j8uB61WHCGlKwB2WREQqmd+2QRL/nsTqmzpb0kdQL9gK5u7OS/P5LRYEKCq7+8 xJMKJYz3fVG5A9aD3hFQcwW8shMHELb8kveYpN7jiqCgCul+CjqDNfLPpnoQSFeMnclUPK 9lXYobQwCk8VKa+h+uKz9lVlJ4Bjs81j+Q3MN9nq0X+cNUbbfm8kAi18N0iMbY5gi3a5zK ozSWRiDe8O6D9+VwXdFYF/p22Dz3oCOcM9m6cwYGgBTBuqR5FhA4O1SEC+sg/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y15FpRDnDqExAD4Oro7aCjPc3cPmv7ntDFrdomXqCmo=; b=x0tEvRjULKi/HHSdxwJCrluNtVg8EPW5Wug9vADoiSo221LPwkyEW2p9TcDfUO0xwpSGZx R8sNqSWJu22z6RaYXVSg6enpaREP6r+Wo9iXdlKpyN5+n7nKzn3J5Pdy2EIR61KO13tblF TfOYp+yhI7kpIezmmBK8ZJXkT80aiVXmBFaNC9udyl4XmPtMBmvYtK1m2hVORvB2giwghN z6chlQE2afZz2JinQGjyI9At8uo4R4Q0WAEZx3dsgWGu8urvC3J08YCM1mXhS3wAX7k1bu pIeYKjrg2+hH601HT6lYoMSIrtQcaX3XihbIXZFEg/ipr78+jYU78quVVuGRMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752037973; a=rsa-sha256; cv=none; b=Z/K/BYmfY1458EvM1nb7TI7yu1keW25lU2Rid9OZhCUdxiYKkq2jjdo7mqTn2nw/EyWx2g gxdPuwpWf+ybwgWx7TnuhyxUGloV9gYnQiayAcsSKwJC6A8R/0V4IUzWdVHwBmjQDvBr9G SktBSf9rTPL/QPfc9zjrud1h8VAXJnUca2s6H+FF2etkTZ/YE8H4UsrHZFq2VX84QC9maf M+UpVLigeFJy64tLTaDdubqNVwD3XoVQLFhoMLw2kEXgSRuUNa5Ynq+auo0VmufvdoTQQO kfazKIqwQc45opUB8BrZrJV+ICsggJIX/LUMo5pnk+Eq12c/FNSD5u6BRTRKRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcR1x1RD0z17KQ; Wed, 09 Jul 2025 05:12: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 5695CrFN030455; Wed, 9 Jul 2025 05:12:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5695Crp0030452; Wed, 9 Jul 2025 05:12:53 GMT (envelope-from git) Date: Wed, 9 Jul 2025 05:12:53 GMT Message-Id: <202507090512.5695Crp0030452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 0610ba6cdbf2 - main - flua: fbsd: avoid leaking stdin pipes on error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94 commit 0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94 Author: Kyle Evans AuthorDate: 2025-07-09 05:12:31 +0000 Commit: Kyle Evans CommitDate: 2025-07-09 05:12:31 +0000 flua: fbsd: avoid leaking stdin pipes on error Additionally, there's no way to get to the end without a valid stdin_pipe[1] at the moment, so don't check for it. stdin_pipe[0] is closed earlier, as the parent shouldn't need the read-side of the pipe. While we're here, also free the file actions earlier and on error -- they're not necessary once posix_spawnp() has returned. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50537 --- libexec/flua/modules/lfbsd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c index 30cafcc7309e..6279474f8388 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/modules/lfbsd.c @@ -88,13 +88,22 @@ lua_exec(lua_State *L) argv = luaL_checkarraystrings(L, 1); if (0 != (r = posix_spawnp(&pid, argv[0], &action, NULL, (char*const*)argv, environ))) { + close(stdin_pipe[0]); + close(stdin_pipe[1]); + posix_spawn_file_actions_destroy(&action); + lua_pushnil(L); lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); return (3); } + + close(stdin_pipe[0]); + posix_spawn_file_actions_destroy(&action); + while (waitpid(pid, &pstat, 0) == -1) { if (errno != EINTR) { + close(stdin_pipe[1]); lua_pushnil(L); lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); @@ -109,12 +118,7 @@ lua_exec(lua_State *L) return (3); } - posix_spawn_file_actions_destroy(&action); - - if (stdin_pipe[0] != -1) - close(stdin_pipe[0]); - if (stdin_pipe[1] != -1) - close(stdin_pipe[1]); + close(stdin_pipe[1]); lua_pushinteger(L, pid); return 1; } From nobody Wed Jul 9 05:12:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcR1y60FNz61770; Wed, 09 Jul 2025 05:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcR1y3C22z3LVb; Wed, 09 Jul 2025 05:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MUBKf2uf4OFy+KgjfM8lvY5TwJvkRbUM0kDrZDhrng4=; b=Ek1o9kctWv+G6lDH41XZOs00/wTpNlNtGAzkJ1RKmxKC4xVM5javdukQtg4Ohn0jh8YAAa tseUWkuZkH3vI7l+e5EKWAIqsH5JuLzC/hJZZW9UA1uQH8SGScSIiDGd7cjRrqZDnB+fHo evIVypJUxygMlK11kUIyb+MtdXES+GIbd0PXrHlOUizUgiXqlhcd9ttfoznhrkO1YJ0oUj oCQn/r7AXVd1ToANJz8xIsWlexpnRsORbBOjs8xK1Eq7aCI4Xk2lDQABVYzfI+jvU/zgoh 2mzoUdFopKBWIIrG2gXLJJ3doh9pvoNoSU24ncBZbd6sGzVMAWeT4GINRq6VEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MUBKf2uf4OFy+KgjfM8lvY5TwJvkRbUM0kDrZDhrng4=; b=NNXLbwi6Nut9/vJ/sQuW3uD0yZYeMdjeGx7Ck7tfLsYKrBmE1uPt82pZD3auH2pUpRqJbE DbQJU2BWAc522gUakU/BPAgtiJWW1KElQP7lfwnQy69FsSSK/IrmN/U7HBpBw/NIDl0+GY KUQHgiGyPp0n8FpENA2zphNlAaayy2hY3AgwTXNhc+aaODZpd718Z2UhyrBZiRneO2u00K Id7A7t2ocn130QycHCCSYtPPMMkMXznGne1fPwa0uZG/6R7IVV3Db28BlL3KHRFdMjQQZf /8z3wDjKSoFQUBvYGbULyDQ+U3qD3C0QCp3P5+qfbCJ2/eMTiWCi4t6ONF4wNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752037974; a=rsa-sha256; cv=none; b=sl01I39sVPzm8Cj5eayRDQ8epsHSqVBiP2INiaEYNc0OdgEtaZmeYiWmzC1RZCTBI+M/AW kTqMr0FAvP9ih+DubWp0yfbZJSb/NMKXZKOQPVR0usoYTUoGY2+qXZSuWpyITjTrLg/MFH leMFIrMtqmIjzFpKkFPmnszbLNsKnjJFnCRJBGbKUzGK26cEgFNUMNLYtYV5nm9a8NIcIO WB+cn4aBFUsOOjbUvp0GKmPe1egeirHtu8HBPOpPZkPw3jbxvYj8Cy0m1xrF8X7hxaG6WG mEmpmkSXYzaVCk6wkVpT4VpLHViDtPk32u1uRhISZqgpi1T03XqGXULPh2AZyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcR1y2fvMz17KR; Wed, 09 Jul 2025 05:12: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 5695CsWm030490; Wed, 9 Jul 2025 05:12:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5695CsMC030487; Wed, 9 Jul 2025 05:12:54 GMT (envelope-from git) Date: Wed, 9 Jul 2025 05:12:54 GMT Message-Id: <202507090512.5695CsMC030487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6a2c624b35a0 - main - flua: fbsd: return a process handle to operate on when we exec() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a2c624b35a0c760b00b9a34c10b7ea0c240c677 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6a2c624b35a0c760b00b9a34c10b7ea0c240c677 commit 6a2c624b35a0c760b00b9a34c10b7ea0c240c677 Author: Kyle Evans AuthorDate: 2025-07-09 05:12:31 +0000 Commit: Kyle Evans CommitDate: 2025-07-09 05:12:31 +0000 flua: fbsd: return a process handle to operate on when we exec() This gives us some way to be able to write to stdin if we want to, or as a future improvement, will allow us to extract stdout from the process. The handle is setup to close and waitpid() on close/gc so that existing users wouldn't necessarily leak for the lifetime of the script if they weren't adopted to the new model. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50538 --- libexec/flua/modules/lfbsd.c | 94 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 8 deletions(-) diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c index 6279474f8388..a361fa25601b 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/modules/lfbsd.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright 2023 Baptiste Daroussin + * Copyright (C) 2025 Kyle Evans * * Redistribution and use in source and binary forms, with or without * modification, are permitted providing that the following conditions~ @@ -38,6 +39,13 @@ #include "lauxlib.h" #include "lfbsd.h" +#define FBSD_PROCESSHANDLE "fbsd_process_t*" + +struct fbsd_process { + int pid; + int stdin_fileno; +}; + extern char **environ; static const char** @@ -65,7 +73,8 @@ luaL_checkarraystrings(lua_State *L, int arg) static int lua_exec(lua_State *L) { - int r, pstat; + struct fbsd_process *proc; + int r; posix_spawn_file_actions_t action; int stdin_pipe[2] = {-1, -1}; pid_t pid; @@ -81,6 +90,9 @@ lua_exec(lua_State *L) return (3); } + proc = lua_newuserdata(L, sizeof(*proc)); + proc->stdin_fileno = stdin_pipe[1]; + posix_spawn_file_actions_init(&action); posix_spawn_file_actions_adddup2(&action, stdin_pipe[0], STDIN_FILENO); posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); @@ -91,6 +103,7 @@ lua_exec(lua_State *L) close(stdin_pipe[0]); close(stdin_pipe[1]); posix_spawn_file_actions_destroy(&action); + lua_pop(L, 2); /* Pop off the process handle and args. */ lua_pushnil(L); lua_pushstring(L, strerror(r)); @@ -98,12 +111,26 @@ lua_exec(lua_State *L) return (3); } + lua_pop(L, 1); + close(stdin_pipe[0]); posix_spawn_file_actions_destroy(&action); - while (waitpid(pid, &pstat, 0) == -1) { - if (errno != EINTR) { - close(stdin_pipe[1]); + proc->pid = pid; + luaL_setmetatable(L, FBSD_PROCESSHANDLE); + + return 1; +} + +static int +lua_process_close(lua_State *L) +{ + struct fbsd_process *proc; + int pstat, r; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + while (waitpid(proc->pid, &pstat, 0) == -1) { + if ((r = errno) != EINTR) { lua_pushnil(L); lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); @@ -111,18 +138,60 @@ lua_exec(lua_State *L) } } - if (WEXITSTATUS(pstat) != 0) { + if (!WIFEXITED(pstat) || WEXITSTATUS(pstat) != 0) { lua_pushnil(L); lua_pushstring(L, "Abnormal termination"); + return (2); + } + + if (proc->stdin_fileno >= 0) + close(proc->stdin_fileno); + proc->stdin_fileno = -1; + + lua_pushboolean(L, 1); + return 1; +} + +static int +lua_process_stdin(lua_State *L) +{ + struct fbsd_process *proc; + luaL_Stream *p; + FILE *fp; + int r; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + fp = fdopen(proc->stdin_fileno, "w"); + if (fp == NULL) { + r = errno; + + lua_pushnil(L); + lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); return (3); } - close(stdin_pipe[1]); - lua_pushinteger(L, pid); - return 1; + p = lua_newuserdata(L, sizeof(*p)); + p->closef = &lua_process_close; + p->f = fp; + luaL_setmetatable(L, LUA_FILEHANDLE); + return (1); } +#define PROCESS_SIMPLE(n) { #n, lua_process_ ## n } +static const struct luaL_Reg fbsd_process[] = { + PROCESS_SIMPLE(close), + PROCESS_SIMPLE(stdin), + { NULL, NULL }, +}; + +static const struct luaL_Reg fbsd_process_meta[] = { + { "__index", NULL }, + { "__gc", lua_process_close }, + { "__close", lua_process_close }, + { NULL, NULL }, +}; + #define REG_SIMPLE(n) { #n, lua_ ## n } static const struct luaL_Reg fbsd_lib[] = { REG_SIMPLE(exec), @@ -134,5 +203,14 @@ int luaopen_fbsd(lua_State *L) { luaL_newlib(L, fbsd_lib); + + luaL_newmetatable(L, FBSD_PROCESSHANDLE); + luaL_setfuncs(L, fbsd_process_meta, 0); + + luaL_newlibtable(L, fbsd_process); + luaL_setfuncs(L, fbsd_process, 0); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + return (1); } From nobody Wed Jul 9 05:12:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcR2011HHz616rX; Wed, 09 Jul 2025 05:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcR1z4fRwz3LhR; Wed, 09 Jul 2025 05:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cu+KDEtxfrEKyWM0gvbmOErnacktkTnzy+hxfdY8x0E=; b=rIDLZ5DfgLE2sEbzU5riksl48r3alPcGvgeoUOHoS4Bnhx7ehprExHb22obs+yQ+exxI04 SXd9Ds0mp2268b3BhH03wHZgMcN5KyCQzzpRIUHOZCzgI05ZUx3CNaKsvrmpDxWqQFsAvs UAQ2kdFeL8P7pBNgC20/JPW4OzV/8YerjusjEHZHThIqlMtb1sxDo3lhJ5nFqgX7MVlQr3 Dm9LdHqrANDcK+cO/zft5oGEgW7reZjhfx0h8joLEOmPxILnZobEL4RkEsC7/sM0xMAMq7 VVe+SDKCYmgmWTKBY3L+BOZMZgKlBWWIkrsa3Gx28jI/gNSbzWTBJ5vk05UMdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cu+KDEtxfrEKyWM0gvbmOErnacktkTnzy+hxfdY8x0E=; b=AyJRwlknxueKgImIyCtkoDY1YG89V57YNYCFE1KaCycyJuztKygKHdqxULuQESAKlMDcyP Ouq7K/ymtQJuyquZZpv3dPQ+tE4beJkU52H9hAbjUl0WBRbL0oAbuI/vhwCALs+o8vuRVe WPyPSkUZVwMWUwJjoBoBCOqt4ZeyWrSG/kLCszUX+fOWUqquomcqHaZp3bHk2ID+VypM1G 5W2u5jAvgStGNy5MePce+yPDWTC8jVmZ92+SaF9fk0ScMbOmVdw3OvbN8LNAOrr6cIRNx2 4IPVMAxM+59qsT60qp0o//uOpaMOXq9p76aDzVzT0i+mbMXYp1keCOW55wQ7Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752037975; a=rsa-sha256; cv=none; b=wCLdzYKIp+v0T0SBe3esX2NqeRzQ/p5wrE2Vmi0DumgHsVloBrvZfrggVP+i9mL7USK+x1 Q/I01vial6vjzSKtrrAwZnNBGPz1lA28BXQqjBMk+/mw+g1heQpRBMO3RnqzmglVkN7DXX NLRYEqfF7t58Nn4RPtNt7ymcbzN6DcI498b5sdvU60IywM+X48zFA4r+DNVAIxrnvHfgC1 vGONNFrG6eZ/633MyZ7bD9EpdyVB8s5A3YojtHDJ7WTkkQpP2Nq++rqwcv8omNRUCQuf58 4pkI77gM7d+L4dBRAg71uyloeOf0CQ0gjRwXf0bvL3tdVmqd9PSB/EyeOMZ7yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcR1z3dTMz17gC; Wed, 09 Jul 2025 05:12: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 5695Ctdc030527; Wed, 9 Jul 2025 05:12:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5695CtTH030524; Wed, 9 Jul 2025 05:12:55 GMT (envelope-from git) Date: Wed, 9 Jul 2025 05:12:55 GMT Message-Id: <202507090512.5695CtTH030524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 3f0e1092097e - main - flua: fbsd: allow stdout to be captured for exec() processes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f0e1092097ed63b83a02518395e370c3cac01be Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0e1092097ed63b83a02518395e370c3cac01be commit 3f0e1092097ed63b83a02518395e370c3cac01be Author: Kyle Evans AuthorDate: 2025-07-09 05:12:32 +0000 Commit: Kyle Evans CommitDate: 2025-07-09 05:12:32 +0000 flua: fbsd: allow stdout to be captured for exec() processes This allows us to do things like: ``` local fp = assert(fbsd.exec({"ls", "-l"}, true)) local fpout = assert(fp:stdout()) while true do local line = fpout:read("l") if not line then break end print("Read: " .. line) end fp:close() ``` The makeman lua rewrite will use it to capture `make showconfig` output for processing. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50539 --- libexec/flua/modules/lfbsd.c | 95 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c index a361fa25601b..ef660ba9fd77 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/modules/lfbsd.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ struct fbsd_process { int pid; int stdin_fileno; + int stdout_fileno; }; extern char **environ; @@ -70,6 +72,16 @@ luaL_checkarraystrings(lua_State *L, int arg) return ret; } +static void +close_pipes(int pipes[2]) +{ + + if (pipes[0] != -1) + close(pipes[0]); + if (pipes[1] != -1) + close(pipes[1]); +} + static int lua_exec(lua_State *L) { @@ -77,31 +89,57 @@ lua_exec(lua_State *L) int r; posix_spawn_file_actions_t action; int stdin_pipe[2] = {-1, -1}; + int stdout_pipe[2] = {-1, -1}; pid_t pid; const char **argv; int n = lua_gettop(L); - luaL_argcheck(L, n == 1, n > 1 ? 2 : n, - "fbsd.exec takes exactly one argument"); + bool capture_stdout; + luaL_argcheck(L, n > 0 && n <= 2, n >= 2 ? 2 : n, + "fbsd.exec takes exactly one or two arguments"); + capture_stdout = lua_toboolean(L, 2); if (pipe(stdin_pipe) < 0) { lua_pushnil(L); lua_pushstring(L, strerror(errno)); lua_pushinteger(L, errno); return (3); } + if (capture_stdout && pipe(stdout_pipe) < 0) { + close_pipes(stdin_pipe); + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } proc = lua_newuserdata(L, sizeof(*proc)); proc->stdin_fileno = stdin_pipe[1]; - + proc->stdout_fileno = stdout_pipe[1]; posix_spawn_file_actions_init(&action); posix_spawn_file_actions_adddup2(&action, stdin_pipe[0], STDIN_FILENO); posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); + if (stdin_pipe[0] != STDIN_FILENO) + posix_spawn_file_actions_addclose(&action, stdin_pipe[0]); + + /* + * Setup stdout to be captured if requested. Otherwise, we just let it + * go to our own stdout. + */ + if (stdout_pipe[0] != -1) { + posix_spawn_file_actions_adddup2(&action, stdout_pipe[0], + STDOUT_FILENO); + posix_spawn_file_actions_addclose(&action, stdout_pipe[1]); + if (stdout_pipe[0] != STDOUT_FILENO) { + posix_spawn_file_actions_addclose(&action, + stdout_pipe[0]); + } + } argv = luaL_checkarraystrings(L, 1); if (0 != (r = posix_spawnp(&pid, argv[0], &action, NULL, (char*const*)argv, environ))) { - close(stdin_pipe[0]); - close(stdin_pipe[1]); + close_pipes(stdin_pipe); + close_pipes(stdout_pipe); posix_spawn_file_actions_destroy(&action); lua_pop(L, 2); /* Pop off the process handle and args. */ @@ -114,12 +152,14 @@ lua_exec(lua_State *L) lua_pop(L, 1); close(stdin_pipe[0]); + if (stdout_pipe[0] != -1) + close(stdout_pipe[0]); posix_spawn_file_actions_destroy(&action); proc->pid = pid; luaL_setmetatable(L, FBSD_PROCESSHANDLE); - return 1; + return (1); } static int @@ -144,24 +184,34 @@ lua_process_close(lua_State *L) return (2); } - if (proc->stdin_fileno >= 0) + if (proc->stdin_fileno >= 0) { close(proc->stdin_fileno); - proc->stdin_fileno = -1; + proc->stdin_fileno = -1; + } + + if (proc->stdout_fileno >= 0) { + close(proc->stdout_fileno); + proc->stdout_fileno = -1; + } lua_pushboolean(L, 1); - return 1; + return (1); } static int -lua_process_stdin(lua_State *L) +lua_process_makestdio(lua_State *L, int fd, const char *mode) { - struct fbsd_process *proc; luaL_Stream *p; FILE *fp; int r; - proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); - fp = fdopen(proc->stdin_fileno, "w"); + if (fd == -1) { + lua_pushnil(L); + lua_pushstring(L, "Stream not captured"); + return (2); + } + + fp = fdopen(fd, mode); if (fp == NULL) { r = errno; @@ -178,10 +228,29 @@ lua_process_stdin(lua_State *L) return (1); } +static int +lua_process_stdin(lua_State *L) +{ + struct fbsd_process *proc; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + return (lua_process_makestdio(L, proc->stdin_fileno, "w")); +} + +static int +lua_process_stdout(lua_State *L) +{ + struct fbsd_process *proc; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + return (lua_process_makestdio(L, proc->stdout_fileno, "r")); +} + #define PROCESS_SIMPLE(n) { #n, lua_process_ ## n } static const struct luaL_Reg fbsd_process[] = { PROCESS_SIMPLE(close), PROCESS_SIMPLE(stdin), + PROCESS_SIMPLE(stdout), { NULL, NULL }, }; From nobody Wed Jul 9 08:58:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2q72kpz61NKW; Wed, 09 Jul 2025 08:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2q6Hf7z3bvT; Wed, 09 Jul 2025 08:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q6qkcO+ZWqcyBU87VofTkMAR+O0UEO8Xs9h8B6eQvVs=; b=QfSPTqqrTr52sIdPwlz+9iHdthDrc86KDaN0Nf9QmHimwUzY0A0bFY5uRv5TPQSqP/Yt48 PqSPu/61IWiBYX8ZM9R3qwwHgegMiJ3DQ7V5Ga9kJkpfflvwvlCFEREbFxujHcRrLW01zF a4fJFf/j4MM6QtROuJ+bW+Z/QyLMxQMuLZ7Kiec2/T8E/OAKyTJ5Escf0D7fJvWBXhAhBd B0xKS+81QUVPswEzbaJ572I5clQSlh8MTD9wRW/TktIFftiCv6o8Uk9wikbbLcNk0cw8ec ZP0qKDygdqSnYJsuH5SNNkDyZGgdbu9SIlVhkvOf56kcKas80OXdvhGFoRaZtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q6qkcO+ZWqcyBU87VofTkMAR+O0UEO8Xs9h8B6eQvVs=; b=iX25Ds2uj/YtmHXEPm4xJk+l6Vk+HrIMpzGwepyK5Jw/erpwtdOfylnLI/U0ZJ4sHtd9Sg AcV1ryXFh/2P2MkP7t+/WMawxsIM41yKlpcphGrS4AOh44mcQwIjYOF/6ZJYG8V1nOLi8i pS6R9n0XiyUpda0Llsjy+gzcyDDy1q51Bf6eMhigoFlmVWxf3vPj11lFzgrGwUI7DPp+Gk EIh2lwxbA7TDZAM1GZqXFqPzPeDD8vTQYVndOfwQQI+XNv6ipZARb9NE7ioNQU75HMZpz9 P+XvlgIwf1YbIMh22s/RraHGeMDmUpmGeU0Oylv3JV9k7V7Dp/caLo3o3bVTHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051539; a=rsa-sha256; cv=none; b=vsVpZhoQvqs5N5jM450OkYiUdpO8TV51XfcNUObQf0LRVR6LUuLu0ZVa2BfIkwmjqD1YPY hwXrrxjE2Oz1mxdvY5OJgrGdG8SxqQiDWKgJliojm/VbpfDG/4mv9nsqGC6TOSwOYn7wm0 WYLFzSBBMWlNXvw7z5iGXVtGHiUJTNiUg4TyQ9stxw4Asi/EwUT7kkQuXpGyJpjfzB+OSV HJYn4PBtDPmZFR3StTNes55P5j+l7Aeyxwdg+tDB0O+oS3nT7Ta8Ap3UPlM3QCnGwJxV+3 xpTdliWlaqNelGgUFfE8Cwn/I4i8RFF34mSSLNwwIazLRuHBwVXW8MGDVh7pFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2q5sZJz19Q; Wed, 09 Jul 2025 08:58: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 5698wx2o044742; Wed, 9 Jul 2025 08:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698wxMF044739; Wed, 9 Jul 2025 08:58:59 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:58:59 GMT Message-Id: <202507090858.5698wxMF044739@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: 2811ec176c40 - main - pfctl: Fix file descriptor leak due to popfile() never closing the main config file. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2811ec176c402ab007ce1897f4c1a344cdb02723 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2811ec176c402ab007ce1897f4c1a344cdb02723 commit 2811ec176c402ab007ce1897f4c1a344cdb02723 Author: Kristof Provost AuthorDate: 2025-07-03 09:13:41 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pfctl: Fix file descriptor leak due to popfile() never closing the main config file. The fix is the same as for other parse.y files in the tree (see bgpd(8) or unwind(8)) ok bluhm@ Obtained from: OpenBSD, tobhe , da1e1ceac5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index af1fb95398f8..dd6fb0116aea 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -95,7 +95,7 @@ static struct file { int eof_reached; int lineno; int errors; -} *file; +} *file, *topfile; struct file *pushfile(const char *, int); int popfile(void); int check_file_secrecy(int, const char *); @@ -6743,7 +6743,7 @@ lgetc(int quotec) if (quotec) { if ((c = igetc()) == EOF) { yyerror("reached end of file while parsing quoted string"); - if (popfile() == EOF) + if (file == topfile || popfile() == EOF) return (EOF); return (quotec); } @@ -6771,7 +6771,7 @@ lgetc(int quotec) return ('\n'); } while (c == EOF) { - if (popfile() == EOF) + if (file == topfile || popfile() == EOF) return (EOF); c = igetc(); } @@ -7069,17 +7069,17 @@ popfile(void) { struct file *prev; - if ((prev = TAILQ_PREV(file, files, entry)) != NULL) { + if ((prev = TAILQ_PREV(file, files, entry)) != NULL) prev->errors += file->errors; - TAILQ_REMOVE(&files, file, entry); - fclose(file->stream); - free(file->name); - free(file->ungetbuf); - free(file); - file = prev; - return (0); - } - return (EOF); + + TAILQ_REMOVE(&files, file, entry); + fclose(file->stream); + free(file->name); + free(file->ungetbuf); + free(file); + file = prev; + + return (file ? 0 : EOF); } int @@ -7102,6 +7102,7 @@ parse_config(char *filename, struct pfctl *xpf) warn("cannot open the main config file!"); return (-1); } + topfile = file; yyparse(); errors = file->errors; From nobody Wed Jul 9 08:59:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2s16cWz61NHV; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2s0L9tz3cQd; Wed, 09 Jul 2025 08:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q/xv5Dp+IIA/O8wOq4dDfbtXfx4Q00PvSA0FFKCzAUc=; b=YKjvaXKHLwkR6ZKzel00tIFUQalOwTY0ZpujT5jFdiMnp6gtVkjgs+Rc1jwUrETnSD60nG 7SQ/RVz8Ij20e2d49Aa7s2wKg52868txyL6VG1qyM6Y8KUV1smyYZ79+mbotxp/k7Em2HW +fFMoKMyu2jvXTl9BNELpXBcy0rCHxj0hD6lfHPkhU7Wa6xx8oG75SaTCT1xlwzKy36+8h AD5IDD+Ep2NNRGOa2JTC/6uGyyDdiWcpzpqJyFRbXa5r/ZbqagD9hBH142kzGSWzuh+6Uv m2TYMRNc59UebSGAFl6UfNvoihTjIdQvqqP1pvL63ohrmLluxgKlzEUWgsGJ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q/xv5Dp+IIA/O8wOq4dDfbtXfx4Q00PvSA0FFKCzAUc=; b=IRFrRd1RquXpenjTUcNhrvdilh4ok0Eu0jucmZlLy63L8yyG0K+DDMNB+1gOzjdcXEtay2 hjkdYumwndiHES+PRpQXHs1djF1GQbvB8K5h1dMoUlUqjDm9On8nrNtmoAOaPcbrN8Ewb+ m2+xid/AfOAXo+xFxbj1GkNBxZ3JklBAMzo6iVJGlWuMZsFqsA+SrgCn+jfN0ex3HhRd8g aq6Uf007fSv/pyFqhzKdekp3cbcbFNU6Gqx2ybyXsZznFVkHw0AQFoXuTMcdI60g4aerAt M4ShVjtsfOWfyXna3ZjYtriMEc/3w8EN3CfLOYkWzLSr4+zLcAwJdXX5vwJneQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051541; a=rsa-sha256; cv=none; b=kIlR6bW1w5Oe8esRjSaGlFFwZwkOyDijAm/XCkjKUD/1sQq21FII4VxErvcWViKXtAJbUT NhbA6odfuJS6mAXiJmxTe1o4It/rHMPAoj99CVtbe0lU5NckUdlKt8bHOxmDJ3OFFfqz/Y L01XSp/eUZz25FNh2MfF9rwDQxrtkUSiIIkfdp1lbLBVydozKBaIrklxfkMDjpMd0kpL10 7hHFJcRQLVO8Ko+u2PIol02NiYbVJ7Pzu+oWKGL6/f1BDvHCJUP+KkqEeRGfSx/gQgJuXJ HyozSZhTyH/+hvFz/AGO0m5RCFeufx3ECZ9gMFLNG5WoG0+ejDZvCUo/UIrIiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2r6pMhz19R; Wed, 09 Jul 2025 08:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x0YC044782; Wed, 9 Jul 2025 08:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x0Sv044780; Wed, 9 Jul 2025 08:59:00 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:00 GMT Message-Id: <202507090859.5698x0Sv044780@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: cface4d97af3 - main - pf: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: cface4d97af3a84b7c4caa1ccd9090afcafe4a66 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cface4d97af3a84b7c4caa1ccd9090afcafe4a66 commit cface4d97af3a84b7c4caa1ccd9090afcafe4a66 Author: Kristof Provost AuthorDate: 2025-07-03 09:26:37 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pf: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. This is clearer and more consistent with the rest of the kernel. OK deraadt@ sashan@ Obtained from: OpenBSD, millert , d04cdf616e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pflog.c | 2 +- sys/netpfil/pf/pf.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 6a87ea2471cb..0a84f9d680ac 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -289,7 +289,7 @@ pflog_packet(uint8_t action, u_int8_t reason, if (pd->lookup.done > 0) hdr.uid = pd->lookup.uid; else - hdr.uid = UID_MAX; + hdr.uid = -1; hdr.pid = NO_PID; hdr.rule_uid = rm->cuid; hdr.rule_pid = rm->cpid; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 127b29320acb..d5f01e5c4956 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4579,7 +4579,7 @@ pf_match_port(u_int8_t op, u_int16_t a1, u_int16_t a2, u_int16_t p) static int pf_match_uid(u_int8_t op, uid_t a1, uid_t a2, uid_t u) { - if (u == UID_MAX && op != PF_OP_EQ && op != PF_OP_NE) + if (u == -1 && op != PF_OP_EQ && op != PF_OP_NE) return (0); return (pf_match(op, a1, a2, u)); } @@ -4587,7 +4587,7 @@ pf_match_uid(u_int8_t op, uid_t a1, uid_t a2, uid_t u) static int pf_match_gid(u_int8_t op, gid_t a1, gid_t a2, gid_t g) { - if (g == GID_MAX && op != PF_OP_EQ && op != PF_OP_NE) + if (g == -1 && op != PF_OP_EQ && op != PF_OP_NE) return (0); return (pf_match(op, a1, a2, g)); } @@ -4914,8 +4914,8 @@ pf_socket_lookup(struct pf_pdesc *pd) struct inpcbinfo *pi; struct inpcb *inp; - pd->lookup.uid = UID_MAX; - pd->lookup.gid = GID_MAX; + pd->lookup.uid = -1; + pd->lookup.gid = -1; switch (pd->proto) { case IPPROTO_TCP: From nobody Wed Jul 9 08:59:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2t2xQdz61N2W; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2t1NBjz3cQn; Wed, 09 Jul 2025 08:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HiwRI8ova0KrSJbbOwY1rhUn7cMZhlkcBx72NIJ2nsE=; b=tkTMZTWJyn6GMUaC3hU8wwe8npK7F1fOuvAX86/a+48FFGNuXW4IMsACSm+1a6iErunuYd eLu4o1GM06XrcBcPXgk1WDBmkBL4tysx+G+rSJnguNJ+vCHy1TzPaN9kYvmnaxoO2TQyjV RCNKTiIK2WLQPeF3uttzCFEmXhDWFhD77KdTyTBuoCYJM9j3po/eEIQ5xFu3q+S9cyagoj 8RiRUQO0KkDuXWbeDygZM7iqNRNSKY39HiwQmrEvNg94NfA5aHveb+6EQXqyvywMR1DVtw 8jbV52TWRGAD0T5ZVQKAuFW6R5wdpqAH3HKqS0Z+8bkokPs0qMddEmGyXtgAbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HiwRI8ova0KrSJbbOwY1rhUn7cMZhlkcBx72NIJ2nsE=; b=wARM7sDsNe5G+Ewepvyq4yBJURliBbXs415MGjkpCRgNj0n+cIi9tCSjJB4amh1UQJeOJ+ OmjpdYUommvKRWh71lsHb5bEMxfQitSrHcUcNsJhvDUIC2GEqb8gKHefsE5WaZsFgI+Kur OIwf0DvW0qSMGPQsTVcUeUjIvJ6hpb0/mvJA7/yl2yKEgyLtDzmcSLrWygZtihKRhovCIm dDAFCpq62CjIM/jO6d9HCeY8c5xTEPXYQQ+gCIHGrkC+KutOP/BzRynMOo9SYXOVeWcCif ogcP/Hjd5RLmAk4GqSlqJtJDv9PRrr7ShQmgEG3++878zG3jpthNjuzTEsKjxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051542; a=rsa-sha256; cv=none; b=I4TscnBFq12fPISXn6RvFI0Jt99xqD8iQWANw6etXRaTT8duQQpcyUooxtNAwrFLEyM020 MgdksFS8XXNon/NDtV5lALFZvL8hY4WVymva2IrHkjqqG49nGaK0pkUGKOz6GRsMgTj/vK MMkppnd4G3Lx1f2jtLR82SzTml/JE0j+GPB1udmSpHzNrTgKiguQi80fttimIBly1UHcjt hB74Mq0J04yJwbpD+uAta8etsj8ST+GsYV4jzaVwBzdHs0qKknq7KzGeyWrC4oK6RubAQa itpn6uDIxs1tLnH6xxvlHfHoCp2S9bUF0jtfRRBNHpjvASHB/zb3093Sb5cdMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2t0fQ7z15m; Wed, 09 Jul 2025 08:59: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 5698x1qi044822; Wed, 9 Jul 2025 08:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x1bu044819; Wed, 9 Jul 2025 08:59:01 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:01 GMT Message-Id: <202507090859.5698x1bu044819@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: 19973701098c - main - pfctl: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 19973701098c8fce38a990ee78f66fab4f4f6a5c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=19973701098c8fce38a990ee78f66fab4f4f6a5c commit 19973701098c8fce38a990ee78f66fab4f4f6a5c Author: Kristof Provost AuthorDate: 2025-07-03 12:01:41 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pfctl: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. This is the userland portion. OK deraadt@ sashan@ Obtained from: OpenBSD, millert , b4de054894 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 12 ++++++------ sbin/pfctl/pfctl_parser.c | 16 +++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index dd6fb0116aea..28f461bf715d 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3905,7 +3905,7 @@ uid_item : uid { $$->tail = $$; } | unaryop uid { - if ($2 == UID_MAX && $1 != PF_OP_EQ && $1 != PF_OP_NE) { + if ($2 == -1 && $1 != PF_OP_EQ && $1 != PF_OP_NE) { yyerror("user unknown requires operator = or " "!="); YYERROR; @@ -3920,7 +3920,7 @@ uid_item : uid { $$->tail = $$; } | uid PORTBINARY uid { - if ($1 == UID_MAX || $3 == UID_MAX) { + if ($1 == -1 || $3 == -1) { yyerror("user unknown requires operator = or " "!="); YYERROR; @@ -3938,7 +3938,7 @@ uid_item : uid { uid : STRING { if (!strcmp($1, "unknown")) - $$ = UID_MAX; + $$ = -1; else { uid_t uid; @@ -3983,7 +3983,7 @@ gid_item : gid { $$->tail = $$; } | unaryop gid { - if ($2 == GID_MAX && $1 != PF_OP_EQ && $1 != PF_OP_NE) { + if ($2 == -1 && $1 != PF_OP_EQ && $1 != PF_OP_NE) { yyerror("group unknown requires operator = or " "!="); YYERROR; @@ -3998,7 +3998,7 @@ gid_item : gid { $$->tail = $$; } | gid PORTBINARY gid { - if ($1 == GID_MAX || $3 == GID_MAX) { + if ($1 == -1 || $3 == -1) { yyerror("group unknown requires operator = or " "!="); YYERROR; @@ -4016,7 +4016,7 @@ gid_item : gid { gid : STRING { if (!strcmp($1, "unknown")) - $$ = GID_MAX; + $$ = -1; else { gid_t gid; diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 26a213c3ffd9..29d51214e2e5 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -68,7 +68,7 @@ void print_op (u_int8_t, const char *, const char *); void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); -void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); +void print_ugid (u_int8_t, id_t, id_t, const char *); void print_flags (uint16_t); void print_fromto(struct pf_rule_addr *, pf_osfp_t, struct pf_rule_addr *, sa_family_t, u_int8_t, int, int); @@ -364,14 +364,14 @@ print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto, int numer } void -print_ugid(u_int8_t op, unsigned u1, unsigned u2, const char *t, unsigned umax) +print_ugid(u_int8_t op, id_t i1, id_t i2, const char *t) { char a1[11], a2[11]; - snprintf(a1, sizeof(a1), "%u", u1); - snprintf(a2, sizeof(a2), "%u", u2); + snprintf(a1, sizeof(a1), "%lu", i1); + snprintf(a2, sizeof(a2), "%lu", i2); printf(" %s", t); - if (u1 == umax && (op == PF_OP_EQ || op == PF_OP_NE)) + if (i1 == -1 && (op == PF_OP_EQ || op == PF_OP_NE)) print_op(op, "unknown", a2); else print_op(op, a1, a2); @@ -977,11 +977,9 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" %sreceived-on %s", r->rcvifnot ? "!" : "", r->rcv_ifname); if (r->uid.op) - print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user", - UID_MAX); + print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user"); if (r->gid.op) - print_ugid(r->gid.op, r->gid.gid[0], r->gid.gid[1], "group", - GID_MAX); + print_ugid(r->gid.op, r->gid.gid[0], r->gid.gid[1], "group"); if (r->flags || r->flagset) { printf(" flags "); print_flags(r->flags); From nobody Wed Jul 9 08:59:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2w02Fkz61N2X; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2v2Yb4z3cL9; Wed, 09 Jul 2025 08:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCoEQHr4+pueIBjdMNV1BVCGiJd+iSJNqevsgIjFCjw=; b=H9L0N1mNfpTNVKACKS68qiaxJb4XuhhJDuCmgR61yN5Wrre838ZroEaAN24sxz2ZNX4iqb vLNwi6XfzdhrZ0HuTmLCZbOpSGysr49rjXPPPfKPokj3OYa2RddnX3CzR2GLvbTUu2AnPT TOYHFy6oV8fAUnf0laU7bZYR4BxcWuIE54bkSn9tcCfFt2pIbldARy0j8vrTD826URX/7a bXgRhMlosjiRIeeihaQe+EnDsLJn9ErJRyiq76tnysJ0zNK0XflD5d8nvhqgcC9tPtmfbX VSfu0BBVH3xZ1dyacq/GZg/RQ0+W7mEXTKJQ1FMb/P3+so3uckY58j2csEAbfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCoEQHr4+pueIBjdMNV1BVCGiJd+iSJNqevsgIjFCjw=; b=q9YqcBSllzM8EjHKlUsajU03GDdVduoWJiBtQaDqZO+ZRHsS/v2U0m9f2SURDe4PKKdQYO LeYcKU+15mMIFUky5bd3hf3KnpVwWsWkf5tN8japSMBaV4XriTcmRYMaVAJ63ppd1PuuOr cEbsZjAyyaABANV/A33scOGkorldRi/JWFLE1dsekIVpyDBF7vtiLN8Vc2EsScQYp/ln8f wsTGpPopyhClkeLdSOW4HZ5soKVRQbthb7yZQtFfGxtlPnVPpyvIz+EGQuzRFf4VVgjUvt Foarc3lL1ZSOwh5r6+RrrC8S8uZzPmuWRBKgYs/IW2RBdY4+UGWTutgyr+mW4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051543; a=rsa-sha256; cv=none; b=X9SjEmIOfXocJFxtF9h871otkFhbtaGJzD+ru18jZjQkQtTARwoKAmpDAE3VyuXt4Yo4dN yM0pRXkrcJ6pPuRUeZqpKbyS0qjWqV3cFP8Kb+iJmybkYOyW5X1FhYKanu43rqnUqlJN7h 6nW5wUKetpH6M2WDUnXdWCCciYuW0flPbWmLvwzoUO+zxu2/tXPZH9lNuj/RCbcfxmp/PO UpcuPAxVl5uEn4N28ookmnOiVRx1OAz5tZScrrDWTMZtDKQWvC4LkKyeCQQ/FKrJj8qIXG tRc4jcHikzdRG5fBTgM9zMcJNCwfdX7dwcFPKSTviN2hypc6NjtWqwSmLOqOlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2v1clBz1GH; Wed, 09 Jul 2025 08:59: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 5698x3kn044857; Wed, 9 Jul 2025 08:59:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x3gw044854; Wed, 9 Jul 2025 08:59:03 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:03 GMT Message-Id: <202507090859.5698x3gw044854@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: 4869cc8e545d - main - pf: Use proper NUL byte not zero with strings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4869cc8e545d795fa1274b06aa3bcc43db20ef33 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4869cc8e545d795fa1274b06aa3bcc43db20ef33 commit 4869cc8e545d795fa1274b06aa3bcc43db20ef33 Author: Kristof Provost AuthorDate: 2025-07-03 12:13:08 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pf: Use proper NUL byte not zero with strings No object change OK sashan Obtained from: OpenBSD, kn , ad87be15a4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 357b2be194a5..9cd7cea340a6 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2699,7 +2699,7 @@ pf_ioctl_get_addr(struct pf_nl_pooladdr *pp) PF_RULES_RLOCK_TRACKER; - pp->anchor[sizeof(pp->anchor) - 1] = 0; + pp->anchor[sizeof(pp->anchor) - 1] = '\0'; PF_RULES_RLOCK(); pool = pf_get_kpool(pp->anchor, pp->ticket, pp->r_action, @@ -2732,7 +2732,7 @@ pf_ioctl_get_rulesets(struct pfioc_ruleset *pr) PF_RULES_RLOCK_TRACKER; - pr->path[sizeof(pr->path) - 1] = 0; + pr->path[sizeof(pr->path) - 1] = '\0'; PF_RULES_RLOCK(); if ((ruleset = pf_find_kruleset(pr->path)) == NULL) { @@ -2771,7 +2771,7 @@ pf_ioctl_get_ruleset(struct pfioc_ruleset *pr) return (ENOENT); } - pr->name[0] = 0; + pr->name[0] = '\0'; if (ruleset == &pf_main_ruleset) { /* XXX kludge for pf_main_ruleset */ RB_FOREACH(anchor, pf_kanchor_global, &V_pf_anchors) @@ -3502,7 +3502,7 @@ DIOCADDRULENV_error: break; } - pr->anchor[sizeof(pr->anchor) - 1] = 0; + pr->anchor[sizeof(pr->anchor) - 1] = '\0'; /* Frees rule on error */ error = pf_ioctl_addrule(rule, pr->ticket, pr->pool_ticket, @@ -3514,7 +3514,7 @@ DIOCADDRULENV_error: case DIOCGETRULES: { struct pfioc_rule *pr = (struct pfioc_rule *)addr; - pr->anchor[sizeof(pr->anchor) - 1] = 0; + pr->anchor[sizeof(pr->anchor) - 1] = '\0'; error = pf_ioctl_getrules(pr); @@ -3653,7 +3653,7 @@ DIOCGETRULENV_error: u_int32_t nr = 0; int rs_num; - pcr->anchor[sizeof(pcr->anchor) - 1] = 0; + pcr->anchor[sizeof(pcr->anchor) - 1] = '\0'; if (pcr->action < PF_CHANGE_ADD_HEAD || pcr->action > PF_CHANGE_GET_TICKET) { @@ -4498,7 +4498,7 @@ DIOCGETSTATESV2_full: struct pf_kruleset *ruleset; struct pfi_kkif *kif = NULL; - pca->anchor[sizeof(pca->anchor) - 1] = 0; + pca->anchor[sizeof(pca->anchor) - 1] = '\0'; if (pca->action < PF_CHANGE_ADD_HEAD || pca->action > PF_CHANGE_REMOVE) { @@ -4629,7 +4629,7 @@ DIOCCHANGEADDR_error: case DIOCGETRULESETS: { struct pfioc_ruleset *pr = (struct pfioc_ruleset *)addr; - pr->path[sizeof(pr->path) - 1] = 0; + pr->path[sizeof(pr->path) - 1] = '\0'; error = pf_ioctl_get_rulesets(pr); break; @@ -4638,7 +4638,7 @@ DIOCCHANGEADDR_error: case DIOCGETRULESET: { struct pfioc_ruleset *pr = (struct pfioc_ruleset *)addr; - pr->path[sizeof(pr->path) - 1] = 0; + pr->path[sizeof(pr->path) - 1] = '\0'; error = pf_ioctl_get_ruleset(pr); break; @@ -5362,7 +5362,7 @@ DIOCCHANGEADDR_error: PF_RULES_WLOCK(); /* First makes sure everything will succeed. */ for (i = 0, ioe = ioes; i < io->size; i++, ioe++) { - ioe->anchor[sizeof(ioe->anchor) - 1] = 0; + ioe->anchor[sizeof(ioe->anchor) - 1] = '\0'; switch (ioe->rs_num) { case PF_RULESET_ETH: ers = pf_find_keth_ruleset(ioe->anchor); From nobody Wed Jul 9 08:59:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2w5D72z61NVm; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2w3Fxqz3cRC; Wed, 09 Jul 2025 08:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rA7TMfjk5fTH22fJ2jGkFSSWWURSY6D/G3ZwYNaUh34=; b=DSFgF4SSxWk+472T0ouNjNR3BcP6SzrZcpwcJCVVznI4NIAEut/OsehV8wsvzb0h943cL4 RgX32cDJRKGIcmGSZ3EniaepwcUvB5pPjrOd9YZEdpDOlLNS71wt6ig/EUQEvJkr3zJXXj cL7QkhRBdEYQoS/4iVE1LdicByxd2+go5epvqsHwkB/9mR8swAybAbbtWSozPrkpCU9n0C QIU867zpyhs8YMFO8bM9oArBW/2l8J5ohh4Lva3Ru9fyFU8V3ex9BdKl9MgYg4LoOrBm5e 85CBtbmPD8vib2Qr3ST5Ss1Hv7N+3wnwvrQ/06RBzI8L9FPvEYrGDroUFTL+pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rA7TMfjk5fTH22fJ2jGkFSSWWURSY6D/G3ZwYNaUh34=; b=hhPYOAiBscq4ovH/e0x/h6ggTg+HGA0qA/ySCfWvdicA4AkbPLXoNe+qTGPHU+ZvzAliUz vuwsuxm1cbd/wAK+mHv9OMa+iZRBKr8y3ZgxOMLckBC0taq75aoZlQkS+DFHnVHVkexZn0 U4/oCT97bSyWR5xbSL7DMt9z1nRfto1wtS9FuREs2//epcJHXWZBTZ8ttX77kfeLmgzRm2 eK9/mXz9kCnJHySCTan4a0zQ6HiX12d1bocz7kOpwkkyZB9DX1YX272PcZH+NAaFaK+Y/p gx3YouLjTxHMqnt4CXpp9Q9x6BK027xigRXPMGEbu67PA9fPNZejxcRxQbMX+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051544; a=rsa-sha256; cv=none; b=Z+NVNwKZUBW7whj7nubiYGUs8HmH7q04tsxutu5lKErcj0wrugRYBUUYxBjWpPfgd/eG4v zRqq54Q8lo5TUqBC4iHqfQ8cK5IGaOLsxhpnguneKqRnSKPaJ9oFdONdtL3LxOiyHzeIYt /bVk+3/ldeSNiYJiW7bGBYVt2ddOvIx4j9Gx7GxbneltxHHDvvmjXozv6B5axWVlZy9gDi TsuV6gmZwRkfLxDjDKceijiuEhzKzxFp98ZfB8ammhhfAfzMPw+77Aq3ikKAVENwU/gQ7/ YlIwJxGyZWNtWQFUL7+g0ey0g1IDzn/3Irav+j/CC0ivn60VP+Y1gpgoGeuu3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2w2YCgz13H; Wed, 09 Jul 2025 08:59: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 5698x4Cx044892; Wed, 9 Jul 2025 08:59:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x4Fc044889; Wed, 9 Jul 2025 08:59:04 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:04 GMT Message-Id: <202507090859.5698x4Fc044889@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: 881c36681d9d - main - pfctl: Fix function name in error message (zap trailing s) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 881c36681d9deabd69b87c4d533ec683965e106b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=881c36681d9deabd69b87c4d533ec683965e106b commit 881c36681d9deabd69b87c4d533ec683965e106b Author: Kristof Provost AuthorDate: 2025-07-03 12:48:07 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pfctl: Fix function name in error message (zap trailing s) Obtained from: OpenBSD, kn , 5b2c7c2215 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index defba3b56c44..8c6d6833dd3b 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2038,8 +2038,8 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs, if ((pf->opts & PF_OPT_NOACTION) == 0 && (error = pfctl_ruleset_trans(pf, path, rs->anchor, false))) { - printf("pfctl_load_rulesets: " - "pfctl_ruleset_trans %d\n", error); + printf("%s: " + "pfctl_ruleset_trans %d\n", __func__, error); goto error; } } else if (pf->opts & PF_OPT_VERBOSE) From nobody Wed Jul 9 08:59:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2x5NqGz61NKh; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2x3qjhz3cLl; Wed, 09 Jul 2025 08:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YXjl1onoV/L8Tk2xkKvtXWi1NRkUvgwVUbugoBnlfLk=; b=fMze+y5VVRbtiiAbZ+zTSy1N60BZdNVyHohLZdspDfjHndfSZUTFDC5BKZX7gW/mDVj3Re 9zHKld5/Yx71+zCApdktAFGwIr3JTsZcPRo4Foy/uLCf4qe3ilDhPaef2fV1IkEyS2u2cm rGvBF7jMi5QpQPzxscR1UU2AoN9sXBzNnhfMBu353x1Kujr8ltUZuR35dCXeWNuUz7qPgv Lsl5QCoJZJuaIgRFGNnLixG4cQmhKQ7qhkOxmvMtPXfscgr65ANWPGmsKNcqet+SFVzcFj gtzRVO3aFEtOa2ktBbjNl1eNiaE4ar7IHM3d1iEuhFb8FyZu/bQp8oaD12KNvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YXjl1onoV/L8Tk2xkKvtXWi1NRkUvgwVUbugoBnlfLk=; b=iV2b/rmqA2AkWAqIb/xl6Me7i1yLCIPZ1WhLb7Ef2NEL+mjKJtbDR0WwBOsKzsvwBWwrfW DBh5XQsWwwZj4jMZjPIJBXGH8KVnz/HQK1Y9adv6SfaQw1OZcF9TT0NvOMJRkHjJEUD0DI nlX3hI4o16XPAodULSoqt7S84+8wcxZYBgkscpXe4sm/6AKcoOwswlbM7spqitqWy8ICY1 a2wnKc9oWqFvt7lD2a5noTutMxJupTSTn8CgT6HFtOdGev9oJhpSUmGwr84lWQj3x4i6JA xXiOcgUvM7eJKzBYwVZZAMSiUiSi5fPejV/zDBL+/FjmLiCI/Id/90syhOwy+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051545; a=rsa-sha256; cv=none; b=vqPMi45yfZVdckj5K9Wo2AddeCiFpfRJDt4gacrU9gMAeCD8VMhBbeQ4xJqpyJloQ17WnJ WFKO9H2FHkuOIjbq4XbD1J8d/+ZpP57z86v2uNT3IewWjLjRFW8VqM7GyRvb/uH2vVwhmq hSLoNmV7pMes7dFaLYnLbL+LqukZC/MDytzs3MWR4YfNMdciM0fsQ0cc1G8BflksswOrD/ BD9rPqeN3pK6hsN78wi8872mij4x+eR8Wa7RGG2kN7xnR93AE+sZzdmhhbKuLiqdxXRYB3 LRGhoi9cdQkI8ChUjF35pG5S4i0Swc4VGJ84Ll7WbyB2OD1T/Wj7qDFK7UkuwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2x3Gk4z1D2; Wed, 09 Jul 2025 08:59: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 5698x5fH044925; Wed, 9 Jul 2025 08:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x5gD044922; Wed, 9 Jul 2025 08:59:05 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:05 GMT Message-Id: <202507090859.5698x5gD044922@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: f97839e05c06 - main - pfctl: Avoid optimizing empty rulesets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f97839e05c062a74940b2c501a08b1dd972cdc33 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f97839e05c062a74940b2c501a08b1dd972cdc33 commit f97839e05c062a74940b2c501a08b1dd972cdc33 Author: Kristof Provost AuthorDate: 2025-07-03 12:49:32 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pfctl: Avoid optimizing empty rulesets All optimizations work on actual rules; if there are none, return early. While here, tell which ruleset/anchor is being optimized to make the debug message actually useful. OK mikeb Obtained from: OpenBSD, kn , 757f1589f1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_optimize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index b58bace326c2..e727324bbf40 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -273,7 +273,10 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) struct pfctl_rule *r; struct pfctl_rulequeue *old_rules; - DEBUG("optimizing ruleset"); + if (TAILQ_EMPTY(rs->rules[PF_RULESET_FILTER].active.ptr)) + return (0); + + DEBUG("optimizing ruleset \"%s\"", rs->anchor->path); memset(&table_buffer, 0, sizeof(table_buffer)); skip_init(); TAILQ_INIT(&opt_queue); From nobody Wed Jul 9 08:59:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX2y6yW9z61NSj; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2y4vGKz3cWK; Wed, 09 Jul 2025 08:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XdBAJdIXCdAuiN6O8vGlfsRtxPnG8ZIGsFfLgUo6ls8=; b=RSpoX9Z7tbM9JLnVzD/rsJVkVxODpLHLa5LQ+u8XDnPHEx6uzXJYThqxdCvGDQe5JPk/ep u+mdIJlOeUrY4mI0IdELIO+5TIXfZp1fG50qycdRtXs4oyx087oFpe7lv5LNm9c3HsJOi9 KTI4oR1jxF4SkdhGxtN6iEiv5FC069vUoT/8oIzGiilLQ9cMdiNmZKSf2CXYmlu7+VCExq MlLAuokIZrO59SAA1oqcPMA3vrKbhGA4SwRByutuZAp5RQ4wSZQFrEsyeSUybUgrHEIgNc uX/vhDyJ82bAapAhTvCSUtYRK1dVbPN6A/AuuvgKHdnu/cEG4FQHgziWbCRMEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XdBAJdIXCdAuiN6O8vGlfsRtxPnG8ZIGsFfLgUo6ls8=; b=kKwJ+YsW/8DIL7HRe8dy+8QOWYLhzvx06TenqE2MLF+ATiib+McQrXbNzHjxqJKlz0Deyx RKGVPG5FwhQ4ceJpqXQFjAvRjFXFtQF4FajO9wHrwYd/eskuXrMJnI19dnNsITMaE/t80j m3g1yJQPWoUm99S0XUvjRE5sBPpRiptoPlZvoPF7oUbUaGVn57V04Y4kkDt1+M5pjHi7qq 8/bRuAckFLnWaajvqwK/bhexxFv7MQnOLTSC8BD9nvKmQQWb4mQqgYr69QIXVN9Y+d1kdk s8oEvkf8mUXLb7s9JYq2bPdHh+MWI7Xn15PSUECjoKIoMpaXWGQIX3rvyGm9hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051546; a=rsa-sha256; cv=none; b=O4tytP3FRpIsepaPHehcIKxaxdFSZ+BVew1UNWRS+nK9pm9CEcCBcFor7aUUZoY70tjkbH hvBVW1OJdYuZyaV4sSoAb3YaxQRlpU/uIbWWYnCcSbcJZSzkbQEUoWwhCeyL6JSvAWTX8m xxjIp349lfqhgUpV4YpZn81NPlM6b/jEimksqeb77uLF4U8/691Yimlk9LO5nBd7lVIopx 5xuK61eMHEI51ahCelVnav1hufNoY95VToSzRBKPFV2GKShiS0DbETDb12xT3racCMkfDO 4Ja1v7eZ7ydE72Ymjw6qZxQZH5tcrNg1fDhjJ28NylEqkJRBv/d/daZUHcKhUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2y4V8Vz190; Wed, 09 Jul 2025 08:59: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 5698x6qq044958; Wed, 9 Jul 2025 08:59:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x6Iv044955; Wed, 9 Jul 2025 08:59:06 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:06 GMT Message-Id: <202507090859.5698x6Iv044955@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: e5a99196e269 - main - pf: deduplicate the ioctl and netlink NATLOOK handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: e5a99196e269bd397a0c533dea792eaceb80a2a4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5a99196e269bd397a0c533dea792eaceb80a2a4 commit e5a99196e269bd397a0c533dea792eaceb80a2a4 Author: Kristof Provost AuthorDate: 2025-07-03 15:16:21 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pf: deduplicate the ioctl and netlink NATLOOK handling Factor out handling of NATLOOK to a separate function so we can use it for both the ioctl and netlink implementation. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf_ioctl.c | 97 +++++++++++++++++++++++++---------------------- sys/netpfil/pf/pf_nl.c | 68 +++++++-------------------------- 3 files changed, 66 insertions(+), 100 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1416f0c2cdbe..0970f041cb1b 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2670,6 +2670,7 @@ int pf_ioctl_get_addrs(struct pf_nl_pooladdr *); int pf_ioctl_get_addr(struct pf_nl_pooladdr *); int pf_ioctl_get_rulesets(struct pfioc_ruleset *); int pf_ioctl_get_ruleset(struct pfioc_ruleset *); +int pf_ioctl_natlook(struct pfioc_natlook *); void pf_krule_free(struct pf_krule *); void pf_krule_clear_counters(struct pf_krule *); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 9cd7cea340a6..8a3f311d7d30 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2796,6 +2796,56 @@ pf_ioctl_get_ruleset(struct pfioc_ruleset *pr) return (error); } +int +pf_ioctl_natlook(struct pfioc_natlook *pnl) +{ + struct pf_state_key *sk; + struct pf_kstate *state; + struct pf_state_key_cmp key; + int m = 0, direction = pnl->direction; + int sidx, didx; + + /* NATLOOK src and dst are reversed, so reverse sidx/didx */ + sidx = (direction == PF_IN) ? 1 : 0; + didx = (direction == PF_IN) ? 0 : 1; + + if (!pnl->proto || + PF_AZERO(&pnl->saddr, pnl->af) || + PF_AZERO(&pnl->daddr, pnl->af) || + ((pnl->proto == IPPROTO_TCP || + pnl->proto == IPPROTO_UDP) && + (!pnl->dport || !pnl->sport))) + return (EINVAL); + + bzero(&key, sizeof(key)); + key.af = pnl->af; + key.proto = pnl->proto; + pf_addrcpy(&key.addr[sidx], &pnl->saddr, pnl->af); + key.port[sidx] = pnl->sport; + pf_addrcpy(&key.addr[didx], &pnl->daddr, pnl->af); + key.port[didx] = pnl->dport; + + state = pf_find_state_all(&key, direction, &m); + if (state == NULL) + return (ENOENT); + + if (m > 1) { + PF_STATE_UNLOCK(state); + return (E2BIG); /* more than one state */ + } + + sk = state->key[sidx]; + pf_addrcpy(&pnl->rsaddr, + &sk->addr[sidx], sk->af); + pnl->rsport = sk->port[sidx]; + pf_addrcpy(&pnl->rdaddr, + &sk->addr[didx], sk->af); + pnl->rdport = sk->port[didx]; + PF_STATE_UNLOCK(state); + + return (0); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -4133,51 +4183,8 @@ DIOCGETSTATESV2_full: case DIOCNATLOOK: { struct pfioc_natlook *pnl = (struct pfioc_natlook *)addr; - struct pf_state_key *sk; - struct pf_kstate *state; - struct pf_state_key_cmp key; - int m = 0, direction = pnl->direction; - int sidx, didx; - - /* NATLOOK src and dst are reversed, so reverse sidx/didx */ - sidx = (direction == PF_IN) ? 1 : 0; - didx = (direction == PF_IN) ? 0 : 1; - - if (!pnl->proto || - PF_AZERO(&pnl->saddr, pnl->af) || - PF_AZERO(&pnl->daddr, pnl->af) || - ((pnl->proto == IPPROTO_TCP || - pnl->proto == IPPROTO_UDP) && - (!pnl->dport || !pnl->sport))) - error = EINVAL; - else { - bzero(&key, sizeof(key)); - key.af = pnl->af; - key.proto = pnl->proto; - pf_addrcpy(&key.addr[sidx], &pnl->saddr, pnl->af); - key.port[sidx] = pnl->sport; - pf_addrcpy(&key.addr[didx], &pnl->daddr, pnl->af); - key.port[didx] = pnl->dport; - - state = pf_find_state_all(&key, direction, &m); - if (state == NULL) { - error = ENOENT; - } else { - if (m > 1) { - PF_STATE_UNLOCK(state); - error = E2BIG; /* more than one state */ - } else { - sk = state->key[sidx]; - pf_addrcpy(&pnl->rsaddr, - &sk->addr[sidx], sk->af); - pnl->rsport = sk->port[sidx]; - pf_addrcpy(&pnl->rdaddr, - &sk->addr[didx], sk->af); - pnl->rdport = sk->port[didx]; - PF_STATE_UNLOCK(state); - } - } - } + + error = pf_ioctl_natlook(pnl); break; } diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index d5d6dc70255e..73933c022ca2 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1256,23 +1256,13 @@ pf_handle_clear_status(struct nlmsghdr *hdr, struct nl_pstate *npt) return (0); } -struct pf_nl_natlook { - sa_family_t af; - uint8_t direction; - uint8_t proto; - struct pf_addr src; - struct pf_addr dst; - uint16_t sport; - uint16_t dport; -}; - -#define _OUT(_field) offsetof(struct pf_nl_natlook, _field) +#define _OUT(_field) offsetof(struct pfioc_natlook, _field) static const struct nlattr_parser nla_p_natlook[] = { { .type = PF_NL_AF, .off = _OUT(af), .cb = nlattr_get_uint8 }, { .type = PF_NL_DIRECTION, .off = _OUT(direction), .cb = nlattr_get_uint8 }, { .type = PF_NL_PROTO, .off = _OUT(proto), .cb = nlattr_get_uint8 }, - { .type = PF_NL_SRC_ADDR, .off = _OUT(src), .cb = nlattr_get_in6_addr }, - { .type = PF_NL_DST_ADDR, .off = _OUT(dst), .cb = nlattr_get_in6_addr }, + { .type = PF_NL_SRC_ADDR, .off = _OUT(saddr), .cb = nlattr_get_in6_addr }, + { .type = PF_NL_DST_ADDR, .off = _OUT(daddr), .cb = nlattr_get_in6_addr }, { .type = PF_NL_SRC_PORT, .off = _OUT(sport), .cb = nlattr_get_uint16 }, { .type = PF_NL_DST_PORT, .off = _OUT(dport), .cb = nlattr_get_uint16 }, }; @@ -1282,63 +1272,31 @@ NL_DECLARE_PARSER(natlook_parser, struct genlmsghdr, nlf_p_empty, nla_p_natlook) static int pf_handle_natlook(struct nlmsghdr *hdr, struct nl_pstate *npt) { - struct pf_nl_natlook attrs = {}; - struct pf_state_key_cmp key = {}; + struct pfioc_natlook attrs = {}; struct nl_writer *nw = npt->nw; - struct pf_state_key *sk; - struct pf_kstate *state; struct genlmsghdr *ghdr_new; - int error, m = 0; - int sidx, didx; + int error; error = nl_parse_nlmsg(hdr, &natlook_parser, npt, &attrs); if (error != 0) return (error); - if (attrs.proto == 0 || - PF_AZERO(&attrs.src, attrs.af) || - PF_AZERO(&attrs.dst, attrs.af) || - ((attrs.proto == IPPROTO_TCP || attrs.proto == IPPROTO_UDP) && - (attrs.sport == 0 || attrs.dport == 0))) - return (EINVAL); - - /* NATLOOK src and dst are reversed, so reverse sidx/didx */ - sidx = (attrs.direction == PF_IN) ? 1 : 0; - didx = (attrs.direction == PF_IN) ? 0 : 1; - - key.af = attrs.af; - key.proto = attrs.proto; - pf_addrcpy(&key.addr[sidx], &attrs.src, attrs.af); - key.port[sidx] = attrs.sport; - pf_addrcpy(&key.addr[didx], &attrs.dst, attrs.af); - key.port[didx] = attrs.dport; - - state = pf_find_state_all(&key, attrs.direction, &m); - if (state == NULL) - return (ENOENT); - if (m > 1) { - PF_STATE_UNLOCK(state); - return (E2BIG); - } + error = pf_ioctl_natlook(&attrs); + if (error != 0) + return (error); - if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) { - PF_STATE_UNLOCK(state); + if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) return (ENOMEM); - } ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); ghdr_new->cmd = PFNL_CMD_NATLOOK; ghdr_new->version = 0; ghdr_new->reserved = 0; - sk = state->key[sidx]; - - nlattr_add_in6_addr(nw, PF_NL_SRC_ADDR, &sk->addr[sidx].v6); - nlattr_add_in6_addr(nw, PF_NL_DST_ADDR, &sk->addr[didx].v6); - nlattr_add_u16(nw, PF_NL_SRC_PORT, sk->port[sidx]); - nlattr_add_u16(nw, PF_NL_DST_PORT, sk->port[didx]); - - PF_STATE_UNLOCK(state); + nlattr_add_in6_addr(nw, PF_NL_SRC_ADDR, &attrs.rsaddr.v6); + nlattr_add_in6_addr(nw, PF_NL_DST_ADDR, &attrs.rdaddr.v6); + nlattr_add_u16(nw, PF_NL_SRC_PORT, attrs.rsport); + nlattr_add_u16(nw, PF_NL_DST_PORT, attrs.rdport); if (!nlmsg_end(nw)) { nlmsg_abort(nw); From nobody Wed Jul 9 08:59:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX300yXtz61NQ5; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2z5K5bz3cWb; Wed, 09 Jul 2025 08:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JWC8VkEer5V4/KJii3mwfhvlGP3duq/ZvivWBpGVzaQ=; b=SP94KoAj4IgypnBdsh3hHfJzKuvB5S/1UDdOeRzpFM4GxarCzSWIWakb6WadaEeV14VsPj ao8ID/7zOGhhn4JkF3t8pOSGqqfvWZhnnBYHZBSFxVX1/L3yr/fSO+kTK73ZC2NzL6m9XY rZNLCWPEH+OJ8dal/JyIrLCTPMhTSpxwaeMYrrgv4TDjX7vqitUF4UT6+UPN88gf1swbt6 b3omIVzD3wSGM2zHiUFEAkyt5zTXfObKlJVwFVsP6Z2/QF/ULSflKh2NnoCUfYDHwu8Fx3 n1jOhL+vfEFkKdWhto6CqI2+9KLIJ1sOJA5Z0nEYMcOyD1TnGd0w8PB1DFx2Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JWC8VkEer5V4/KJii3mwfhvlGP3duq/ZvivWBpGVzaQ=; b=Ce0Qx7dw9non2r5eUkTLPV8mY7cyC+RD/oTTT9GYKsxGnY17m5l3vhADvDh0FDz8MTPRLG iTBO1FD99XhWCW4lxLeE6wWWWl+3mpDAEdtJHpdr2UpGUxb3dm5KLJrkk/rPSIuXDdAmT6 VVHZwITnFscEqd6vwSIu37Cm+NQNBSrnX5G5zDGMzgTDiYjFDs9NChlgKfbwjhfBFHAK6v MlNoEHYXEZ14jYzD9R/o7uFZ6k5ODQTXffjQefZ/U2cP3hfpY7ePD0QJXdMkuziV+8a/W/ m59fryvHa4/l8ydGjNVfnIvwJ+O+o7y5s/y5DlHz4Og5M5i+AMU0Ni+ELLswBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051547; a=rsa-sha256; cv=none; b=PBEc7YeONtJUExw7mmlOidmvuK7PK0CL0qZfPMVCxpFFthn5oUw0OOpHBDHNza1jLVKfjP tkc8LnYUvta2KAajccukcTTDRxHbGKrscywQkXtv3VEE8350XXyyfhZCA02sMqtQEuqWkk pwzfnD/DLsLw1b8Ip83liUlicN4dNyv1fWAH6kbLrf2gAXFEebnd81bi1TbZNaS/wADo92 3SJgFzFD1ON6mbcW+J8eJwfm0hY2NVNkWok3K7DKBUGmkAaU8QwfEl/uENCUgIP/CojUOl AnhfR+/nn1lzJHqc9OJBM7jDquIe79rJf0AY9oiI7DqisRWOb8jZ4IGtabFLjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX2z4tm1z1D3; Wed, 09 Jul 2025 08:59: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 5698x7Ac044992; Wed, 9 Jul 2025 08:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x7HA044989; Wed, 9 Jul 2025 08:59:07 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:07 GMT Message-Id: <202507090859.5698x7HA044989@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: e97ce7c66ee0 - main - pf: improve DIOCNATLOOK validation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: e97ce7c66ee0ab0afe58695b6922ff310262d7c5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e97ce7c66ee0ab0afe58695b6922ff310262d7c5 commit e97ce7c66ee0ab0afe58695b6922ff310262d7c5 Author: Kristof Provost AuthorDate: 2025-07-03 15:23:46 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pf: improve DIOCNATLOOK validation Check address family of pf ioctl(2) DIOCNATLOOK parameter at kernel entry instead of calling panic() due to unhandled af. Reported-by: syzbot+92be143c2dd1746cf2af@syzkaller.appspotmail.com from Benjamin Baier Also validate the direction. Obtained from: OpenBSD, bluhm , 4804479228 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 8a3f311d7d30..737f9ca060c5 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2817,6 +2817,28 @@ pf_ioctl_natlook(struct pfioc_natlook *pnl) (!pnl->dport || !pnl->sport))) return (EINVAL); + switch (pnl->direction) { + case PF_IN: + case PF_OUT: + case PF_INOUT: + break; + default: + return (EINVAL); + } + + switch (pnl->af) { +#ifdef INET + case AF_INET: + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + break; +#endif /* INET6 */ + default: + return (EAFNOSUPPORT); + } + bzero(&key, sizeof(key)); key.af = pnl->af; key.proto = pnl->proto; From nobody Wed Jul 9 08:59:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX312CJYz61N2Z; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX306qthz3ccM; Wed, 09 Jul 2025 08:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIisq4u4Qiunf3hEs5i7FrBAw93QTuPEBEXfkhBngZ4=; b=Tc4vpOONNKI5M4rHTExD2+pq0p1Cmo98d/i2AyolOzHLqlJmHXG1imO5aXf4I8NsUAqU3L g7V58pHoK72pNXzFsXfRebyMsODtpEIjUvCXwaYUmckjvwmnGE7a21l4i3FjMhzqyFChhs zHZvfL+kDV7IX2J0zoy3MvOafOLo4yGJch5B8GNBX47cs7SDt9mBydAmdYwFZsPz0HKKOc lMHaNx/lkoTGX6/jGrnNBgv1niBFM3XUKkvC6SBKMGP4G49521VnElOAsOQR/CaFcaXB5T g67QulAbq09lLlgW37LHhQiqRDkcrrIe7wjoOVa0tkECLBxIOsPujH6MURcbqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIisq4u4Qiunf3hEs5i7FrBAw93QTuPEBEXfkhBngZ4=; b=pvvPtlmvHoRH2nrXKZ32mt4iNb/osHSyXPrQsdFvQLwWFye3Kevz3PifTXn3RaRwY7ArN5 b2SbWEGT2CAUSgCt3MxJXeZ8pqcGgec5HhTq9UoNOOm3KOyqwzdOmvJGoi8sLrJj6CeZEl 6odd9NkU/8eit+kyZOPU3M/d4VCAoOjb3q29Yk48lW/b0rSJM8JWOEsq+Jo8kOiClH5hR0 8n99tXkcrzJFtZN/+tbKPqWrOZEgKGibNvf+QkuYTrwe9OIEcNo4uz/a7uef/cWsrzMsa+ boCjp4EA4FqbL99Im8MDUtcfQ1zs3097CNut3/0uFG0zYLRh3W8iLuRvF35JbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051549; a=rsa-sha256; cv=none; b=fLHAEkX5B6uppNJ1MKVxM+Fx8TD/Z1pwremBASQ54wAGCAlsW57RpuWRjf5vcg1S6ur8aY 4QdSSlv2Tm1CTlG+xx+m2IMqhn0p5+LFdXqhOy8zmq/6KgP3P/tKP2DZbWbfr659SiLWtu vSEsiW3JEgSo3Mq1QAOTYAXhsc3WX88w5j0zfAPVGlmNx7qJrRUEuyQS4feanTAtMorxHq hVqu89ycZwELA+VoArwwNXvJC3/UhGGAWWYGnsiI+uRr7lkSXxeWEEdXVzXgzSON6wMFVF TvjOcogBoS/IPcOkqTtAbaeqxKCbGVToFGthWJlp6YK8AoMPHc6LQ4w//mrUag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX3066xXz4v; Wed, 09 Jul 2025 08:59: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 5698x8gA045030; Wed, 9 Jul 2025 08:59:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x8Q8045027; Wed, 9 Jul 2025 08:59:08 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:08 GMT Message-Id: <202507090859.5698x8Q8045027@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: 6b95d258a96b - main - pf tests: test DIOCNATLOOK validation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6b95d258a96b7f3a7d61af5c3fb028194ca8f204 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b95d258a96b7f3a7d61af5c3fb028194ca8f204 commit 6b95d258a96b7f3a7d61af5c3fb028194ca8f204 Author: Kristof Provost AuthorDate: 2025-07-03 15:07:52 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pf tests: test DIOCNATLOOK validation Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/ioctl/validation.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/sys/netpfil/pf/ioctl/validation.c b/tests/sys/netpfil/pf/ioctl/validation.c index 1ce8999dcb91..18fafe11c6ab 100644 --- a/tests/sys/netpfil/pf/ioctl/validation.c +++ b/tests/sys/netpfil/pf/ioctl/validation.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -893,6 +894,39 @@ ATF_TC_CLEANUP(rpool_mtx2, tc) COMMON_CLEANUP(); } +ATF_TC_WITH_CLEANUP(natlook); +ATF_TC_HEAD(natlook, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(natlook, tc) +{ + struct pfioc_natlook nl = { 0 }; + + COMMON_HEAD(); + + nl.af = AF_INET; + nl.proto = IPPROTO_ICMP; + nl.saddr.v4.s_addr = 0x01020304; + nl.daddr.v4.s_addr = 0x05060708; + + /* Invalid direction */ + nl.direction = 42; + + ATF_CHECK_ERRNO(EINVAL, ioctl(dev, DIOCNATLOOK, &nl) == -1); + + /* Invalid af */ + nl.direction = PF_IN; + nl.af = 99; + + ATF_CHECK_ERRNO(EAFNOSUPPORT, ioctl(dev, DIOCNATLOOK, &nl) == -1); +} + +ATF_TC_CLEANUP(natlook, tc) +{ + COMMON_CLEANUP(); +} ATF_TP_ADD_TCS(tp) { @@ -918,6 +952,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, tag); ATF_TP_ADD_TC(tp, rpool_mtx); ATF_TP_ADD_TC(tp, rpool_mtx2); + ATF_TP_ADD_TC(tp, natlook); return (atf_no_error()); } From nobody Wed Jul 9 08:59:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX333x6jz61NQ9; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX331NT1z3cZG; Wed, 09 Jul 2025 08:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6WRYVMccrXdDIVM4tuhi+nnMXXCunxGgEZDUqGEKWE=; b=xxWAOG68YLQWAAx6R41Fu07vOEm5YAzs2to/J+Tt4EedEW3BSIAzfh8hipI+Xlt3JxXozc SsA2Q5nfY4sycr9n/49TNICuGTAXarIr2nYabtxU0Yg4bdACovIOUDuZ8friFXrxsoFR7m gOnFJzR91eej3I9KSrBWzvu8EjD3MqsX30Moo3Q26Os1KDbrjyjm56IHRJL8tW+C6OK/fJ C07sDF4NyRWtaGERdFg3NFW/Ox8rCV7W9gieQocyKlTjnH12Opi2Tr9/uAVx2avWhkNbM1 wk6507XA/iIRZ6Cx/uXUvtlIy8uCXGUNZPM7l8tZPkDpyD1xayvvQ4aqmc299Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6WRYVMccrXdDIVM4tuhi+nnMXXCunxGgEZDUqGEKWE=; b=hfNxv5WWcdRc0lmcFwxYZM9dJdvrp1LVJqbC19AudQ7GfYL2nc9WACqSu7XCFL7ITu63GL 39GK61bpj/Bz9KkHQ20EVWXfbwCSOF06LB/JfJqnoA9qnFP+Hr5KeVn4OroRriXlsUsPXP mX5lcO3gklBkC4BKhmDfP15SjVqO25hP+ubTOEZczNcbU5ZPczuZA7W9KJ9k4ZSLrM2kjn ZqJeOit/XBlsFqPJvJM015pky3o1IU17Ad8RYqOBv0mYdaTSsA4Nwu+j+U+o1gnw1/7+qA SKXqLmuDj8TsPN5G3tM4B+drLi7bYSgznZoJBgrhuLj+Sm6XZF6YX0WCl1Aifw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051551; a=rsa-sha256; cv=none; b=F1D2UBlXCVb2C13x+DnvlLpU0nl4/xtv0YF88AKDGUXh/Nygbl354FtvfrQ5OaHm8zZmCi Pdmh4Mdk3Zq5TGMUYvQdm0qnvOdfUXGIY9QkBd5G3YuS7WDdHkucLg0rPY3PJ/g+oWPElQ Is6IQBE+4uKn+XR/JJsipcbJ9uWPDVoJ2a/xi/0fhYxD4GoE0W/nSZ4uT5R2p4c8j3pTYt j7CyqaU3OVW9mekQeVeVa6f5JF4x/knj+NAA2naFkxxtBDu0wKBHYRuK76BNZvBCsjRxoN vDsCNGxm5cOKss339ffexiMD6IHFZiyDpGisrivJ82oj/1P2ZCprh+528m/eKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX330w52z192; Wed, 09 Jul 2025 08:59: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 5698xBMB045096; Wed, 9 Jul 2025 08:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xBgw045093; Wed, 9 Jul 2025 08:59:11 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:11 GMT Message-Id: <202507090859.5698xBgw045093@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: be763b0e57be - main - pf: clean up pf_ioctl_addrule() error handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: be763b0e57be7de314c543452ef909f0e65a29f0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=be763b0e57be7de314c543452ef909f0e65a29f0 commit be763b0e57be7de314c543452ef909f0e65a29f0 Author: Kristof Provost AuthorDate: 2025-07-04 11:06:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pf: clean up pf_ioctl_addrule() error handling On error immediately stop work rather than continuing and handling the error later. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 737f9ca060c5..c96741023db9 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2155,51 +2155,51 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, rule->rcv_kif = NULL; if (rule->rtableid > 0 && rule->rtableid >= rt_numfibs) - error = EBUSY; + ERROUT(EBUSY); #ifdef ALTQ /* set queue IDs */ if (rule->qname[0] != 0) { if ((rule->qid = pf_qname2qid(rule->qname)) == 0) - error = EBUSY; + ERROUT(EBUSY); else if (rule->pqname[0] != 0) { if ((rule->pqid = pf_qname2qid(rule->pqname)) == 0) - error = EBUSY; + ERROUT(EBUSY); } else rule->pqid = rule->qid; } #endif if (rule->tagname[0]) if ((rule->tag = pf_tagname2tag(rule->tagname)) == 0) - error = EBUSY; + ERROUT(EBUSY); if (rule->match_tagname[0]) if ((rule->match_tag = pf_tagname2tag(rule->match_tagname)) == 0) - error = EBUSY; + ERROUT(EBUSY); if (rule->rt && !rule->direction) - error = EINVAL; + ERROUT(EINVAL); if (!rule->log) rule->logif = 0; if (! pf_init_threshold(&rule->pktrate, rule->pktrate.limit, rule->pktrate.seconds)) - error = ENOMEM; + ERROUT(ENOMEM); if (pf_addr_setup(ruleset, &rule->src.addr, rule->af)) - error = ENOMEM; + ERROUT(ENOMEM); if (pf_addr_setup(ruleset, &rule->dst.addr, rule->af)) - error = ENOMEM; + ERROUT(ENOMEM); if (pf_kanchor_setup(rule, ruleset, anchor_call)) - error = EINVAL; + ERROUT(EINVAL); if (rule->scrub_flags & PFSTATE_SETPRIO && (rule->set_prio[0] > PF_PRIO_MAX || rule->set_prio[1] > PF_PRIO_MAX)) - error = EINVAL; + ERROUT(EINVAL); for (int i = 0; i < 3; i++) { TAILQ_FOREACH(pa, &V_pf_pabuf[i], entries) if (pa->addr.type == PF_ADDR_TABLE) { pa->addr.p.tbl = pfr_attach_table(ruleset, pa->addr.v.tblname); if (pa->addr.p.tbl == NULL) - error = ENOMEM; + ERROUT(ENOMEM); } } @@ -2207,7 +2207,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (rule->overload_tblname[0]) { if ((rule->overload_tbl = pfr_attach_table(ruleset, rule->overload_tblname)) == NULL) - error = EINVAL; + ERROUT(EINVAL); else rule->overload_tbl->pfrkt_flags |= PFR_TFLAG_ACTIVE; @@ -2230,23 +2230,19 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (((rule->action == PF_NAT) || (rule->action == PF_RDR) || (rule->action == PF_BINAT)) && rule->anchor == NULL && TAILQ_FIRST(&rule->rdr.list) == NULL) { - error = EINVAL; + ERROUT(EINVAL); } if (rule->rt > PF_NOPFROUTE && (TAILQ_FIRST(&rule->route.list) == NULL)) { - error = EINVAL; + ERROUT(EINVAL); } if (rule->action == PF_PASS && (rule->rdr.opts & PF_POOL_STICKYADDR || rule->nat.opts & PF_POOL_STICKYADDR) && !rule->keep_state) { - error = EINVAL; + ERROUT(EINVAL); } - if (error) { - pf_free_rule(rule); - rule = NULL; - ERROUT(error); - } + MPASS(error == 0); rule->nat.cur = TAILQ_FIRST(&rule->nat.list); rule->rdr.cur = TAILQ_FIRST(&rule->rdr.list); From nobody Wed Jul 9 08:59:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX322Hrwz61NB4; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX320HYbz3cjC; Wed, 09 Jul 2025 08:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ddpEG+FyyKpWbeBd4buCkd5srtixFTD1HeLt4MmPD2I=; b=EigVDXNQMf/SlS1OEBt9bwRAz44isahgwd1F3QKUtkBm7XZl0mrSztdgri+mqBabYrv4lR 2O18okeQQgHLbK40kJU+Tu6wEAO/7w+R7u/59Cxts41z92Q8XnMhGD7Hu10Q6B7pnMpAUA P8L3tZ/kzugq45NpJwoTwAtvEo4CVSXVPiLVzfQt4IdA0f8yICmfYKmfjMe/FLA13+GPbb l7FqfcSFfeNilr07Uh4PFe6GuE0CMuv/yJ+lsw84n1ZTslK4yzB206YVVUCtm1p2PE1zJI ELUUOsCvM/yXdlbSbXpZRRQXOpdwiWB19jrwOJtaMZh2WpsT8kiZ5KUMuhQ9fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ddpEG+FyyKpWbeBd4buCkd5srtixFTD1HeLt4MmPD2I=; b=IEiFqLyFx9y+PACxGUiemRY11q2OmgycNOTkmy+YZAIAKgjWvhf9JNUUnk+mgfq4H9Zogx eZNjwu6Jll5+F7dvF5TaTgFUQtn85NQ+MmmIKjdjgmFcMQL5/K9qWsjjDW1tXmTtNtlPUs cRsyfuX6A9GbGOmNZhMyh9Qbe1Vg28XsojC1djCYTv0V41Vh/h8ssyFu1KqCUCkg3QbWVn L1O0FdhIQ6lXJLQGHlYt2628dDL4Z6qDnlA5sSOUKIpIpkTt1nlEAvaMQwPMkhWwymm4lw MFZLbmGjqsul42+EsC3LIzQqH9am9Qys1iCjAJdBBpqi2IHcfAV2ciLdf0GERw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051550; a=rsa-sha256; cv=none; b=CIogkSKhsJBabAzC2WKOQnoHZy7htH6l/MMylcHhtVpcwUuvFZNoYmWge+P4IxqkOhKdhY RtaBrk6uV2IZLHureAmf9kDyt5AfBK16zIx0y8ofMCW62Yy5iztbwZvtSuhN2+/lf9jsEY PbTqbOPErphGZYa2QuKA8xAQ6NmgEC250hzgJS0hU/O+cduCvLeY6Cnf+IvoqRheVsjhVf Xye2EKvfgrQJim8N7GAmeLRMjh8mvSCAHJWEn9DjYJ/KuYMtjmOPj7viHKeloIEwvwbrK0 LGT5H1Stf/ZOXibfEaecEGvilL66qP7nG/cWuYZDj/XtPCJVn2qWCng9Ix215A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX316n19z191; Wed, 09 Jul 2025 08:59: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 5698x9Bh045064; Wed, 9 Jul 2025 08:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x9kQ045061; Wed, 9 Jul 2025 08:59:09 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:09 GMT Message-Id: <202507090859.5698x9kQ045061@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: 1f86253fabc8 - main - pf: assert that we call pf_addrcpy() with a valid address family List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1f86253fabc8a2db79e8fe7c43602a4776c1a8b1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1f86253fabc8a2db79e8fe7c43602a4776c1a8b1 commit 1f86253fabc8a2db79e8fe7c43602a4776c1a8b1 Author: Kristof Provost AuthorDate: 2025-07-03 15:08:31 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pf: assert that we call pf_addrcpy() with a valid address family Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 0970f041cb1b..36fab1a03ee6 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -551,6 +551,9 @@ extern struct sx pf_end_lock; #endif /* PF_INET_INET6 */ #ifdef _KERNEL + +void unhandled_af(int) __dead2; + static void inline pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) { @@ -565,6 +568,8 @@ pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) memcpy(&dst->v6, &src->v6, sizeof(dst->v6)); break; #endif /* INET6 */ + default: + unhandled_af(af); } } #endif @@ -2300,7 +2305,6 @@ VNET_DECLARE(struct pf_krule *, pf_rulemarker); #define V_pf_rulemarker VNET(pf_rulemarker) #endif -void unhandled_af(int) __dead2; int pf_start(void); int pf_stop(void); void pf_initialize(void); From nobody Wed Jul 9 08:59:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX343rPLz61NB6; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX341jdlz3cgW; Wed, 09 Jul 2025 08:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMUUWKCglIZD3L1MBRSH1kn64ZUADtbY6Kj5w190W2Y=; b=VOxKt5b39+hrOPRqhiNFceFJLx0HBTNJ13qyWtT378tSel4l3UnkuDiWh4f7ts1hMeiyad QVWcIR0fFNrng63hPMtLIfScAF/iQObf4KNQBA4CgBljOk4bK5lTzXIgee1Z28SXwDniV6 6ul8ZorKhGNNBZ0T1CFgnaK4vqb6psIBb26qnBP/NQ7B5X2i3ageaTBIFuH0mxteFUeyi/ SLqa6tL8PlXRKXogJ7mAFMAOq6KZq0e3DUu86rwSQMYdTDtmfCpLZpzWYf3OLGI5muRZ42 RRkZwYM8RYUOcJCOJRua8wnvCKhFtnisuTv5MMIVmgOLRVZak9RxV9DNgQq++Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMUUWKCglIZD3L1MBRSH1kn64ZUADtbY6Kj5w190W2Y=; b=yMfEXgpr2aFc8PftoDzC+ZuJlfUsTRLUu7W6I95hVYAwopALWBKLd8t/SqRLK/5yNTLPWU h8kFYMsZm/Rlos+98jounlQmYMuDk5LczcwX94pj3PRuOh3E/Y1i/aAV7hONA2Az+8RrV5 QKGupvFbX3LmLUyC97B1DpgmYCNhQYsbmynZ3yYRcAb3ND6SpoC4Ho2fg1tGbXExTn52ew gcp9vsu3AZGP5zjGD7XWtVw2jiIwM3rTUN6To1C8O//VmiLGO1ekavcDn0etHadWxcck2P jrEq6FBcvtaw853R+g3Qfs8cL0DSVHoRzOvKCR41Kl8Fr50DykFX60qI/fPGWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051552; a=rsa-sha256; cv=none; b=kCy380VEPdzTWxRdW/sKylq7zIwdoiaVMTysze4e2adCmf8lQcFioFgCxYqBmSNsxyGFIj ByD3y6sdcHTvqBu+YE7V9qrsbtvpU0uirbMy7lU1g8VEwM7E+229kIgYcrdachREuGzoTb VSFNG4ZzqEZdHN7Qwkbk5Pg18qUhhMIVZ56hzy5a0Y0Jd+xcguE/5w3C/w7ahKC8sKB1C5 QkuqDRxDlVM3bsLpym7WrGfM6axU+86T8EWczaMPbr1ZG6Sk61SVE/5gR286l96qHZ64DA pFyTmC7T/D6A9KNcgyuKGLRijxTid0z/reRaR7YvfjbPOCDLzsroQfWIvE5+7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX341KPhz15n; Wed, 09 Jul 2025 08:59: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 5698xC4k045128; Wed, 9 Jul 2025 08:59:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xCc6045125; Wed, 9 Jul 2025 08:59:12 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:12 GMT Message-Id: <202507090859.5698xCc6045125@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: 041ce1d690f1 - main - pfctl: recursively flush rules and tables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 041ce1d690f1c58bd4a93ab808ded53444af2092 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=041ce1d690f1c58bd4a93ab808ded53444af2092 commit 041ce1d690f1c58bd4a93ab808ded53444af2092 Author: Kristof Provost AuthorDate: 2025-07-04 21:34:48 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pfctl: recursively flush rules and tables The recursive operation ("pfctl -a '*' ...") works for '-s' option already. This change enables the same thing for '-F' option, so "pfctl -a '*' -Fa" will flush everything from PF driver. The idea was discussed with many on tech@ in spring 2019. OK kn@ Obtained from: OpenBSD, sashan , ae711728d4 Obtained from: OpenBSD, sashan , 7abd52e24a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 9 +- sbin/pfctl/pfctl.c | 289 +++++++++++++++++++++++++++++++++++++++------- sbin/pfctl/pfctl.h | 12 +- sbin/pfctl/pfctl_osfp.c | 2 +- sbin/pfctl/pfctl_parser.h | 1 + sbin/pfctl/pfctl_table.c | 15 ++- 6 files changed, 277 insertions(+), 51 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 28efff896956..2566bca57a28 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,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 July 2, 2025 +.Dd July 4, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -186,6 +186,13 @@ as the anchor name: .Bd -literal -offset indent # pfctl -a '*' -sr .Ed +.Pp +To flush all rulesets and tables recursively, specify only +.Sq * +as the anchor name: +.Bd -literal -offset indent +# pfctl -a '*' -Fa +.Ed .It Fl D Ar macro Ns = Ns Ar value Define .Ar macro diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8c6d6833dd3b..254bd054ae4a 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -59,6 +59,8 @@ #include #include #include +#include +#include #include "pfctl_parser.h" #include "pfctl.h" @@ -72,7 +74,7 @@ void pfctl_check_skip_ifaces(char *); void pfctl_adjust_skip_ifaces(struct pfctl *); void pfctl_clear_interface_flags(int, int); void pfctl_flush_eth_rules(int, int, char *); -void pfctl_flush_rules(int, int, char *); +int pfctl_flush_rules(int, int, char *); void pfctl_flush_nat(int, int, char *); int pfctl_clear_altq(int, int); void pfctl_clear_src_nodes(int, int); @@ -124,6 +126,17 @@ int pfctl_load_ruleset(struct pfctl *, char *, int pfctl_load_rule(struct pfctl *, char *, struct pfctl_rule *, int); const char *pfctl_lookup_option(char *, const char * const *); void pfctl_reset(int, int); +int pfctl_walk_show(int, struct pfioc_ruleset *, void *); +int pfctl_walk_get(int, struct pfioc_ruleset *, void *); +int pfctl_walk_anchors(int, int, const char *, + int(*)(int, struct pfioc_ruleset *, void *), void *); +struct pfr_anchors * + pfctl_get_anchors(int, char *, int); +int pfctl_recurse(int, int, char *, + int(*)(int, int, struct pfr_anchoritem *)); +int pfctl_call_clearrules(int, int, struct pfr_anchoritem *); +int pfctl_call_cleartables(int, int, struct pfr_anchoritem *); +int pfctl_call_clearanchors(int, int, struct pfr_anchoritem *); static struct pfctl_anchor_global pf_anchors; struct pfctl_anchor pf_main_anchor; @@ -151,6 +164,7 @@ int dev = -1; struct pfctl_handle *pfh = NULL; static int first_title = 1; static int labels = 0; +static int exit_val = 0; #define INDENT(d, o) do { \ if (o) { \ @@ -269,6 +283,40 @@ usage(void) exit(1); } +void +pfctl_err(int opts, int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if ((opts & PF_OPT_IGNFAIL) == 0) + verr(eval, fmt, ap); + else + vwarn(fmt, ap); + + va_end(ap); + + exit_val = eval; +} + +void +pfctl_errx(int opts, int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if ((opts & PF_OPT_IGNFAIL) == 0) + verrx(eval, fmt, ap); + else + vwarnx(fmt, ap); + + va_end(ap); + + exit_val = eval; +} + /* * Cache protocol number to name translations. * @@ -361,7 +409,7 @@ pfctl_clear_stats(struct pfctl_handle *h, int opts) { int ret; if ((ret = pfctl_clear_status(h)) != 0) - errc(1, ret, "DIOCCLRSTATUS"); + pfctl_err(opts, 1, "DIOCCLRSTATUS"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "pf: statistics cleared\n"); } @@ -469,16 +517,19 @@ pfctl_flush_eth_rules(int dev, int opts, char *anchorname) fprintf(stderr, "Ethernet rules cleared\n"); } -void +int pfctl_flush_rules(int dev, int opts, char *anchorname) { int ret; ret = pfctl_clear_rules(dev, anchorname); - if (ret != 0) - err(1, "pfctl_clear_rules"); - if ((opts & PF_OPT_QUIET) == 0) + if (ret != 0) { + pfctl_err(opts, 1, "%s", __func__); + return (1); + } else if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "rules cleared\n"); + + return (0); } void @@ -515,7 +566,7 @@ void pfctl_clear_src_nodes(int dev, int opts) { if (ioctl(dev, DIOCCLRSRCNODES)) - err(1, "DIOCCLRSRCNODES"); + pfctl_err(opts, 1, "DIOCCLRSRCNODES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "source tracking entries cleared\n"); } @@ -530,13 +581,13 @@ pfctl_clear_iface_states(int dev, const char *iface, int opts) memset(&kill, 0, sizeof(kill)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; if ((ret = pfctl_clear_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCCLRSTATES"); + pfctl_err(opts, 1, "DIOCCLRSTATUS"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "%d states cleared\n", killed); } @@ -687,7 +738,7 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) memset(&last_dst, 0xff, sizeof(last_dst)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (state_killers == 2 && (strcmp(state_kill[0], "nat") == 0)) { kill.nat = true; @@ -740,13 +791,13 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) resp[1]->ai_addr); if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); killed += newkilled; } freeaddrinfo(res[1]); } else { if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); killed += newkilled; } } @@ -778,7 +829,7 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) memset(&last_src, 0xff, sizeof(last_src)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; @@ -799,7 +850,7 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) copy_satopfaddr(&kill.rt_addr.addr.v.a.addr, resp->ai_addr); if (pfctl_kill_states_h(pfh, &kill, &newkilled)) - err(1, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); killed += newkilled; } @@ -823,7 +874,7 @@ pfctl_label_kill_states(int dev, const char *iface, int opts) memset(&kill, 0, sizeof(kill)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; @@ -833,7 +884,7 @@ pfctl_label_kill_states(int dev, const char *iface, int opts) errx(1, "label too long: %s", state_kill[1]); if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "killed %d states\n", killed); @@ -871,7 +922,7 @@ pfctl_id_kill_states(int dev, const char *iface, int opts) } if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "killed %d states\n", killed); @@ -895,7 +946,7 @@ pfctl_key_kill_states(int dev, const char *iface, int opts) if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); s = strdup(state_kill[1]); if (!s) @@ -931,7 +982,7 @@ pfctl_key_kill_states(int dev, const char *iface, int opts) errx(1, "invalid host: %s", tokens[didx]); if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "killed %d states\n", killed); @@ -2805,7 +2856,7 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how) if ((pf->opts & PF_OPT_NOACTION) == 0) { if (how == 0) { if (ioctl(pf->dev, DIOCCLRIFFLAG, &pi)) - err(1, "DIOCCLRIFFLAG"); + pfctl_err(pf->opts, 1, "DIOCCLRIFFLAG"); } else { if (ioctl(pf->dev, DIOCSETIFFLAG, &pi)) err(1, "DIOCSETIFFLAG"); @@ -2864,17 +2915,56 @@ pfctl_test_altqsupport(int dev, int opts) } int -pfctl_show_anchors(int dev, int opts, char *anchorname) +pfctl_walk_show(int opts, struct pfioc_ruleset *pr, void *warg) +{ + if (pr->path[0]) { + if (pr->path[0] != '_' || (opts & PF_OPT_VERBOSE)) + printf(" %s/%s\n", pr->path, pr->name); + } else if (pr->name[0] != '_' || (opts & PF_OPT_VERBOSE)) + printf(" %s\n", pr->name); + + return (0); +} + +int +pfctl_walk_get(int opts, struct pfioc_ruleset *pr, void *warg) +{ + struct pfr_anchoritem *pfra; + struct pfr_anchors *anchors; + int e; + + anchors = (struct pfr_anchors *)warg; + + pfra = malloc(sizeof(*pfra)); + if (pfra == NULL) + err(1, "%s", __func__); + + if (pr->path[0]) + e = asprintf(&pfra->pfra_anchorname, "%s/%s", pr->path, + pr->name); + else + e = asprintf(&pfra->pfra_anchorname, "%s", pr->name); + + if (e == -1) + err(1, "%s", __func__); + + SLIST_INSERT_HEAD(anchors, pfra, pfra_sle); + + return (0); +} + +int +pfctl_walk_anchors(int dev, int opts, const char *anchor, + int(walkf)(int, struct pfioc_ruleset *, void *), void *warg) { struct pfioc_ruleset pr; u_int32_t mnr, nr; int ret; memset(&pr, 0, sizeof(pr)); - if ((ret = pfctl_get_rulesets(pfh, anchorname, &mnr)) != 0) { + if ((ret = pfctl_get_rulesets(pfh, anchor, &mnr)) != 0) { if (ret == EINVAL) - fprintf(stderr, "Anchor '%s' not found.\n", - anchorname); + fprintf(stderr, "Anchor '%s' not found.\n", anchor); else errc(1, ret, "DIOCGETRULESETS"); return (-1); @@ -2882,24 +2972,122 @@ pfctl_show_anchors(int dev, int opts, char *anchorname) for (nr = 0; nr < mnr; ++nr) { char sub[MAXPATHLEN]; - if ((ret = pfctl_get_ruleset(pfh, anchorname, nr, &pr)) != 0) + if ((ret = pfctl_get_ruleset(pfh, anchor, nr, &pr)) != 0) errc(1, ret, "DIOCGETRULESET"); if (!strcmp(pr.name, PF_RESERVED_ANCHOR)) continue; sub[0] = '\0'; - if (pr.path[0]) { - strlcat(sub, pr.path, sizeof(sub)); - strlcat(sub, "/", sizeof(sub)); - } - strlcat(sub, pr.name, sizeof(sub)); - if (sub[0] != '_' || (opts & PF_OPT_VERBOSE)) - printf(" %s\n", sub); - if ((opts & PF_OPT_VERBOSE) && pfctl_show_anchors(dev, opts, sub)) + if (walkf(opts, &pr, warg)) + return (-1); + + if (pr.path[0]) + snprintf(sub, sizeof(sub), "%s/%s", pr.path, pr.name); + else + snprintf(sub, sizeof(sub), "%s", pr.name); + if (pfctl_walk_anchors(dev, opts, sub, walkf, warg)) return (-1); } return (0); } +int +pfctl_show_anchors(int dev, int opts, char *anchor) +{ + return ( + pfctl_walk_anchors(dev, opts, anchor, pfctl_walk_show, NULL)); +} + +struct pfr_anchors * +pfctl_get_anchors(int dev, char *anchor, int opts) +{ + struct pfioc_ruleset pr; + static struct pfr_anchors anchors; + char *n; + + SLIST_INIT(&anchors); + + memset(&pr, 0, sizeof(pr)); + if (*anchor != '\0') { + n = dirname(anchor); + if (n[0] != '.' && n[1] != '\0') + strlcpy(pr.path, n, sizeof(pr.path)); + n = basename(anchor); + if (n != NULL) + strlcpy(pr.name, n, sizeof(pr.name)); + } + + /* insert a root anchor first. */ + pfctl_walk_get(opts, &pr, &anchors); + + if (pfctl_walk_anchors(dev, opts, anchor, pfctl_walk_get, &anchors)) + errx(1, "%s failed to retrieve list of anchors, can't continue", + __func__); + + return (&anchors); +} + +int +pfctl_call_cleartables(int dev, int opts, struct pfr_anchoritem *pfra) +{ + /* + * PF_OPT_QUIET makes pfctl_clear_tables() to stop printing number of + * tables cleared for given anchor. + */ + opts |= PF_OPT_QUIET; + return ((pfctl_do_clear_tables(pfra->pfra_anchorname, opts) == -1) ? + 1 : 0); +} + +int +pfctl_call_clearrules(int dev, int opts, struct pfr_anchoritem *pfra) +{ + /* + * PF_OPT_QUIET makes pfctl_clear_rules() to stop printing a 'rules + * cleared' message for every anchor it deletes. + */ + opts |= PF_OPT_QUIET; + return (pfctl_flush_rules(dev, opts, pfra->pfra_anchorname)); +} + +int +pfctl_call_clearanchors(int dev, int opts, struct pfr_anchoritem *pfra) +{ + int rv = 0; + + rv |= pfctl_call_cleartables(dev, opts, pfra); + rv |= pfctl_call_clearrules(dev, opts, pfra); + + return (rv); +} + +int +pfctl_recurse(int dev, int opts, char *anchorname, + int(*walkf)(int, int, struct pfr_anchoritem *)) +{ + int rv = 0; + struct pfr_anchors *anchors; + struct pfr_anchoritem *pfra, *pfra_save; + + anchors = pfctl_get_anchors(dev, anchorname, opts); + /* + * While traversing the list, pfctl_clear_*() must always return + * so that failures on one anchor do not prevent clearing others. + */ + opts |= PF_OPT_IGNFAIL; + printf("Removing:\n"); + SLIST_FOREACH_SAFE(pfra, anchors, pfra_sle, pfra_save) { + printf(" %s\n", + (*pfra->pfra_anchorname == '\0') ? "" : + pfra->pfra_anchorname); + rv |= walkf(dev, opts, pfra); + SLIST_REMOVE(anchors, pfra, pfr_anchoritem, pfra_sle); + free(pfra->pfra_anchorname); + free(pfra); + } + + return (rv); +} + int pfctl_show_eth_anchors(int dev, int opts, char *anchorname) { @@ -2990,7 +3178,6 @@ pfctl_reset(int dev, int opts) int main(int argc, char *argv[]) { - int error = 0; int ch; int mode = O_RDONLY; int opts = 0; @@ -3218,7 +3405,7 @@ main(int argc, char *argv[]) if (opts & PF_OPT_DISABLE) if (pfctl_disable(dev, opts)) - error = 1; + exit_val = 1; if ((path = calloc(1, MAXPATHLEN)) == NULL) errx(1, "%s: calloc", __func__); @@ -3259,7 +3446,7 @@ main(int argc, char *argv[]) pfctl_show_status(dev, opts); break; case 'R': - error = pfctl_show_running(dev); + exit_val = pfctl_show_running(dev); break; case 't': pfctl_show_timeouts(dev, opts); @@ -3321,7 +3508,11 @@ main(int argc, char *argv[]) pfctl_flush_eth_rules(dev, opts, anchorname); break; case 'r': - pfctl_flush_rules(dev, opts, anchorname); + if (opts & PF_OPT_RECURSE) + pfctl_recurse(dev, opts, anchorname, + pfctl_call_clearrules); + else + pfctl_flush_rules(dev, opts, anchorname); break; case 'n': pfctl_flush_nat(dev, opts, anchorname); @@ -3347,7 +3538,13 @@ main(int argc, char *argv[]) pfctl_flush_eth_rules(dev, opts, anchorname); pfctl_flush_rules(dev, opts, anchorname); pfctl_flush_nat(dev, opts, anchorname); - pfctl_do_clear_tables(anchorname, opts); + if (opts & PF_OPT_RECURSE) + pfctl_recurse(dev, opts, anchorname, + pfctl_call_clearanchors); + else { + pfctl_do_clear_tables(anchorname, opts); + pfctl_flush_rules(dev, opts, anchorname); + } if (!*anchorname) { pfctl_clear_altq(dev, opts); pfctl_clear_iface_states(dev, ifaceopt, opts); @@ -3361,7 +3558,11 @@ main(int argc, char *argv[]) pfctl_clear_fingerprints(dev, opts); break; case 'T': - pfctl_do_clear_tables(anchorname, opts); + if ((opts & PF_OPT_RECURSE) == 0) + pfctl_do_clear_tables(anchorname, opts); + else + pfctl_recurse(dev, opts, anchorname, + pfctl_call_cleartables); break; case 'R': pfctl_reset(dev, opts); @@ -3385,7 +3586,7 @@ main(int argc, char *argv[]) pfctl_kill_src_nodes(dev, opts); if (tblcmdopt != NULL) { - error = pfctl_table(argc, argv, tableopt, + exit_val = pfctl_table(argc, argv, tableopt, tblcmdopt, rulesopt, anchorname, opts); rulesopt = NULL; } @@ -3411,17 +3612,17 @@ main(int argc, char *argv[]) if (rulesopt != NULL && !(opts & PF_OPT_MERGE) && !anchorname[0] && (loadopt & PFCTL_FLAG_OPTION)) if (pfctl_file_fingerprints(dev, opts, PF_OSFP_FILE)) - error = 1; + exit_val = 1; if (rulesopt != NULL) { if (pfctl_rules(dev, rulesopt, opts, optimize, anchorname, NULL)) - error = 1; + exit_val = 1; } if (opts & PF_OPT_ENABLE) if (pfctl_enable(dev, opts)) - error = 1; + exit_val = 1; if (debugopt != NULL) { switch (*debugopt) { @@ -3440,5 +3641,5 @@ main(int argc, char *argv[]) } } - exit(error); + exit(exit_val); } diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index d8196c129187..5b5b3d3e5fff 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -55,6 +55,13 @@ struct pfr_buffer { (var) != NULL; \ (var) = pfr_buf_next((buf), (var))) +struct pfr_anchoritem { + SLIST_ENTRY(pfr_anchoritem) pfra_sle; + char *pfra_anchorname; +}; + +SLIST_HEAD(pfr_anchors, pfr_anchoritem); + int pfr_get_fd(void); int pfr_add_table(struct pfr_table *, int *, int); int pfr_del_table(struct pfr_table *, int *, int); @@ -81,7 +88,7 @@ int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); void pfctl_print_title(char *); -void pfctl_do_clear_tables(const char *, int); +int pfctl_do_clear_tables(const char *, int); void pfctl_show_tables(const char *, int); int pfctl_table(int, char *[], char *, const char *, char *, const char *, int); @@ -150,4 +157,7 @@ void expand_label(char *, size_t, struct pfctl_rule *); const char *pfctl_proto2name(int); +void pfctl_err(int, int, const char *, ...); +void pfctl_errx(int, int, const char *, ...); + #endif /* _PFCTL_H_ */ diff --git a/sbin/pfctl/pfctl_osfp.c b/sbin/pfctl/pfctl_osfp.c index 3a94c2e8c81b..5770c8343a46 100644 --- a/sbin/pfctl/pfctl_osfp.c +++ b/sbin/pfctl/pfctl_osfp.c @@ -264,7 +264,7 @@ void pfctl_clear_fingerprints(int dev, int opts) { if (ioctl(dev, DIOCOSFPFLUSH)) - err(1, "DIOCOSFPFLUSH"); + pfctl_err(opts, 1, "DIOCOSFPFLUSH"); } /* flush pfctl's view of the fingerprints */ diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index b91d37c791ae..778105c2b96d 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -55,6 +55,7 @@ #define PF_OPT_RECURSE 0x04000 #define PF_OPT_KILLMATCH 0x08000 #define PF_OPT_NODNS 0x10000 +#define PF_OPT_IGNFAIL 0x20000 #define PF_NAT_PROXY_PORT_LOW 50001 #define PF_NAT_PROXY_PORT_HIGH 65535 diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 0842b042df41..0b52f88eafbb 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -79,7 +79,8 @@ static const char *istats_text[2][2][2] = { if ((!(opts & PF_OPT_NOACTION) || \ (opts & PF_OPT_DUMMYACTION)) && \ (fct)) { \ - radix_perror(); \ + if ((opts & PF_OPT_RECURSE) == 0) \ + radix_perror(); \ goto _error; \ } \ } while (0) @@ -103,11 +104,17 @@ static const char *istats_text[2][2][2] = { table.pfrt_flags &= ~PFR_TFLAG_PERSIST; \ } while(0) -void +int pfctl_do_clear_tables(const char *anchor, int opts) { - if (pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts)) - exit(1); + int rv; + + if ((rv = pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts)) == -1) { + if ((opts & PF_OPT_IGNFAIL) == 0) + exit(1); + } + + return (rv); } void From nobody Wed Jul 9 08:59:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX366K06z61NW2; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX36435mz3cdb; Wed, 09 Jul 2025 08:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pC3k3TBEbwVZMLTYoAAynkI/2YqGDQQLfcS4lkH/ISY=; b=NLMNhM4kSN+ra8+FZyWS5woadiIq8pOBmwibeye89V0kd85yKx+JvzSB08i1sLSdWOlQga BImJq1tYPhSQP0RYpxUJuhcDpGKFbeACRbqObe7owAs8L45rW5/9cZjJAuX6JsTCJhE2q2 om9RMA7t+gpGK+sIgi5/3G93eUQYHMr7oA3l6/991hgcE3Xa3hKRhi76dygf4Wlh4bGQ1e ooFCQy/NzpQqMdCXcKxKEsCniQM3ytRVOBcGakqHkCp6xYCUlfbhsDCkYWWFaRo4NUBuT+ j8NzWUb5ZvtCW8lvn4NkeirriquPb1RRiNsPBcqdWfYFQwmBLWsQy7iYVGF8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pC3k3TBEbwVZMLTYoAAynkI/2YqGDQQLfcS4lkH/ISY=; b=U4hl6j2nJRAsE89VdLHCONnGZopHg+AfyFr6g7XfINtCTNiIvrjf9YZlhOpaZ4O+S8N3Ix jnF5l4BF/CItkJr8FsXK2DPed+BhMXDwTA2kpMoFmA3BtFp15uQ9XtBXjktxO9f0SNIXLx 4d1INcDVWkS+lLcJUf61d8IyXOByOtshQD9O6MJGWU5QnOqEguItHzZwH08hmKW3wEHcQC T1tTy8cwZyaQGnLD28sLp9THzKWrRCONgmYhkOCQkU+JsVdPLceJXL4yMzokHWeZIVuv8L kJsIloLzpcx6eQF+o39CUTVC1oh5Pkh2bx5hy00eAltfJbC5BwUmib9lj5Zi/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051554; a=rsa-sha256; cv=none; b=XMDQ4DcSHk6OGWFhrKjOW8nFQYWSkXfcsiCcwxUsi1PQBIdpDJmNxMt/Do/8Kz8ncr30v5 W2b767q/GHHaeEXYCrWxz8JkZlAeoAOeDZ470U2b9rK2MN6O6hsX8QOFa3JW5iyBYwcn+T OpdcX03d2DglrIr+inNJIrdKmrciHivXzlrHWLfsfiAtbyrV2XAYMXOxkWZCwYfbaBEKiM ndfuNkUC4J3UAy/cgRhK11E9stk+FqH5svzuCkJ/uS/TPuZaHJXyg7jNAoQg7DEPNXlLif tAXQrDemSB2ZQJI/YJHOnuCMgaQhuM1ZRsYM1d3P8XYdnZLnFPuaB3IcidFkFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX363WyGz1D5; Wed, 09 Jul 2025 08:59: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 5698xEoE045200; Wed, 9 Jul 2025 08:59:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xE5E045197; Wed, 9 Jul 2025 08:59:14 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:14 GMT Message-Id: <202507090859.5698xE5E045197@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: fb0d388e5d53 - main - pfctl: Print the main ruleset/anchor as "/" not "" for consistency List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: fb0d388e5d53db18deb6f2646cd797fcf58cd9bb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fb0d388e5d53db18deb6f2646cd797fcf58cd9bb commit fb0d388e5d53db18deb6f2646cd797fcf58cd9bb Author: Kristof Provost AuthorDate: 2025-07-07 06:17:07 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:51 +0000 pfctl: Print the main ruleset/anchor as "/" not "" for consistency OK sashan Obtained from: OpenBSD, kn , baa66dbe09 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 254bd054ae4a..8d2b556d7085 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3077,8 +3077,8 @@ pfctl_recurse(int dev, int opts, char *anchorname, printf("Removing:\n"); SLIST_FOREACH_SAFE(pfra, anchors, pfra_sle, pfra_save) { printf(" %s\n", - (*pfra->pfra_anchorname == '\0') ? "" : - pfra->pfra_anchorname); + (*pfra->pfra_anchorname == '\0') ? "/" : + pfra->pfra_anchorname); rv |= walkf(dev, opts, pfra); SLIST_REMOVE(anchors, pfra, pfr_anchoritem, pfra_sle); free(pfra->pfra_anchorname); From nobody Wed Jul 9 08:59:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX361vkWz61N2f; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX3533gyz3cZh; Wed, 09 Jul 2025 08:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zAhjHUlnM4o5+7W8Qq1Ozskp1AlBTWWRcj1L3mBmios=; b=ArrByezgcPpcAQHikwGb38sIIc0fb4FOhjBgMz4WbyTDZhlrksHmQoVLtQVL1RznYKMXWJ OVZNhHF6u4PS3UOYHXfm3JH42hKAWuTPjfXoz5GU9/0YY6Vq48mOv5JL0iLrGgCnubrbd9 HyJGVpBg3mNTvXg0Nk5mY7hKxYpQu5HqX5ocjYUUkgRYUsVW7zU3N4r0plFLmbo+QaRUEJ K83V7lmDU6uLGxPM9QN2yiZdnG8McuatPhHtKuBRWaLGhtQf8wsqhFS9DIE453sFcpgllS 7Oa6l8vvUl+oKMBePQUIMS2mX66i9YytKs/vJ1di3EEWsd4UbrIR9YU7jiw5QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zAhjHUlnM4o5+7W8Qq1Ozskp1AlBTWWRcj1L3mBmios=; b=KyfVjTyYHtfkttIxPJKXlmiSsGflN8cKuEpHYYRDz0KzldYIsUT06Ic89BDMTn4IeIamuo FvHoilhGgIF1zoZFY7uSsm4gTBdREeGXdqhraXozNTTRMXRUMP1W7/42SL+CrNWPQhQtxG bUnYklzHphjD5kxTivDOG97ZEFG+2o9xUMzTo5JTTPcTvA3zxmO/zKZqHLKtagxcXmiOJv IyQyykaC6TQ6qzV+jZaoF2IYdZnewjCQj1NUXeQKGw5pr2Q/IwV/22fwMOujycDNup9toj 5xEwRDXyh8roE8QDxy9CC3JhVAF1my2BvTk3h0wAV1v25P0zSxtR9Ae/ZWZvJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051553; a=rsa-sha256; cv=none; b=btVFHQZXopaGjw3wBaaxJltUP/VeF7xEqf2MsBMZTx+vfP2HNtOb+INzTfxockr03PRoNG nvNMrvp3NlvK2f6YgDty5wFZDL0giC+6a+zPqWplM+8ElZ9sm6kT7fw9YrCMnR4vfMJxE8 LPJfzl8mqNiEGZ3URUyW8vcLHpZQrgP6ZnFP7hGBAq+FPltyfz6G54Q/uGnAVCdP0NoyZD qc1JaZmhWV7EXNkBuadFx+l3ptavDB2GhU19gxT57xsgqEB16iI2d4x86TXDTnJ8CA2p+B fu9CVpOfMdFKu+yNkYcvgXmHh0yF2MjE6npGaSVzZlXc+4Luuho1jIuLlSUsvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX352YRyz1D4; Wed, 09 Jul 2025 08:59: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 5698xDhI045161; Wed, 9 Jul 2025 08:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xDwx045159; Wed, 9 Jul 2025 08:59:13 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:13 GMT Message-Id: <202507090859.5698xDwx045159@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: 05c33e5acb67 - main - pfctl tests: recursive flush test case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 05c33e5acb67f1f36feae77b7e400d9a066db441 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=05c33e5acb67f1f36feae77b7e400d9a066db441 commit 05c33e5acb67f1f36feae77b7e400d9a066db441 Author: Kristof Provost AuthorDate: 2025-07-04 21:36:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pfctl tests: recursive flush test case Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/anchor.sh | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index b4b52d7a24d6..4692c06142df 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -437,6 +437,62 @@ quick_cleanup() pft_cleanup } +atf_test_case "recursive_flush" "cleanup" +recursive_flush_head() +{ + atf_set descr 'Test recursive flushing of rules' + atf_set require.user root +} + +recursive_flush_body() +{ + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\" {\n\ + pass\n\ + }" + + # We can ping thanks to the pass rule in foo + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Only reset the main rules. I.e. not a recursive flush + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\"" + + # "foo" still has the pass rule, so this works + jexec alcatraz pfctl -a "*" -sr + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Now do a recursive flush + atf_check -s exit:0 -e ignore -o ignore \ + jexec alcatraz pfctl -a "*" -Fr + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\"" + + # So this fails + jexec alcatraz pfctl -a "*" -sr + atf_check -s exit:2 -o ignore ping -c 1 192.0.2.1 +} + +recursive_flush_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -450,4 +506,5 @@ atf_init_test_cases() atf_add_test_case "nat" atf_add_test_case "include" atf_add_test_case "quick" + atf_add_test_case "recursive_flush" } From nobody Wed Jul 9 08:59:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcX382tlPz61NN5; Wed, 09 Jul 2025 08:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX375Gj4z3cdt; Wed, 09 Jul 2025 08:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WsM5k1/I+idpClNWiDONydOngFS9uIfATQ+rl0+kq9o=; b=MNkonE0gPEGhAB7f8/ZOIXQlcrjS72wp8OU557PsOVUYmDpBWtBuDFiaT6msnk38rCnH5c UTTtH4gikiALrktaBTWRGcp6Va2DbGjJ+N9FPTsVfo7/QK+N27C2om2hfgfkW8tTztz1nz vTdnFCo8nmKWG26RwUeNTeJzChjzBJh1MRxyOn/KPNNgciElJc4USIWt1C5V5r/kHhXYFZ fyxX+iGTEgwD+bfU8Bjz26GQLPn0d9M40nwWPy0A1sT/uqadm20ZxubY+VKY6pPYxK1Obl VIKlUwnBADRwYAbtnxdAnT/pDcJobu6PegL9mpPvF7P9IOcLQaMID9vsZ44anQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WsM5k1/I+idpClNWiDONydOngFS9uIfATQ+rl0+kq9o=; b=lgY8t2JjVB3I2gb7XqkmJ4ozAEQah4TUH7sfzryyCf+TGjsRKeaLDXW2uvRExZ6/2vvraQ uj64QAPWoacvmuPbx5XMpC6cZ/eW1CkMrugtDYLDVYZQVxXGqnCKdHz/chIccPn9E2VqGY 4S0rnk2SftSchOaalDiAOJcmjf0kllOYVOwduT/UHXLjIpuQA6Aw8h40BnIchUUOZ2b3Ry +sd8fi3J267JC974w308vd+6uaD1yM+gzNtDfE+P8O8cVCEu3XYuONMA6NlsaKOloUASjd U7mqUI576AMWU+5PZCBN2NPwfLxEu/CiK5/9UfwrWLi7u8ZNtZreM/4rNcisfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051555; a=rsa-sha256; cv=none; b=XFiMlCG78A3XYoQyNiFkF/E0Sdl9cLfj8mGWq/+yaqAPK2AgJKEoJKhHgBnpmHjUDg9mbh +gGZwSSM1UCce3NNuRqmIT0YLXjAVwIxra00iE1UX+xf7KgJ5+l8LkaaYfwibIhKXO4dSn QdhPijxhB6OYCCGrpe0QgHtIbjxkroqGPul8JQOcm5PiMeBSZTwGck1FXpX6JHmC+BUxNu 6jypMgRZWJJAcfJi9vXYgdgg3y81sxjF7CTb9GeSFN8jJeoThmbFoM1el3wX3yppb666qf tsEjWUHiV9vUdt5o1A9G//86KNs+iqZsrZMi6gab5JTnaH6Yzh4PIw7SLMwEHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcX374RLlz1D6; Wed, 09 Jul 2025 08:59: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 5698xFoY045246; Wed, 9 Jul 2025 08:59:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xFh2045243; Wed, 9 Jul 2025 08:59:15 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:15 GMT Message-Id: <202507090859.5698xFh2045243@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: 3b6bcad34080 - main - pfctl.8: Further document recursive flush behaviour List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3b6bcad3408000de9beca8d3c403f63ac216bd1e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b6bcad3408000de9beca8d3c403f63ac216bd1e commit 3b6bcad3408000de9beca8d3c403f63ac216bd1e Author: Kristof Provost AuthorDate: 2025-07-07 06:18:32 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:51 +0000 pfctl.8: Further document recursive flush behaviour OK sashan Obtained from: OpenBSD, kn , 5bd1c2906f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 2566bca57a28..508dcc6ea8d4 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,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 July 4, 2025 +.Dd July 7, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -238,6 +238,19 @@ for details. .It Fl F Cm all Flush all of the above. .El +.Pp +If +.Fl a +is specified as well and +.Ar anchor +is terminated with a +.Sq * +character, +.Cm rules , +.Cm Tables +and +.Cm all +flush the given anchor recursively. .It Fl f Ar file Load the rules contained in .Ar file . From nobody Wed Jul 9 12:13:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bccLy48Ttz61b9r; Wed, 09 Jul 2025 12:13:14 +0000 (UTC) (envelope-from eduardo@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bccLy2kqmz414h; Wed, 09 Jul 2025 12:13:14 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752063194; 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: in-reply-to:in-reply-to:references:references; bh=WtqFAr96f7StE2XQ3b50Kj8kB6y3biorSpStczmZZis=; b=OTRf/Ml72qTR7C5EWgRy2lDcmSD+YJ/cKkeCZuNuF/DTip8ALsnC/6FPBzYuJu5de4UwY8 fH4oqJhN0Io/2H/Tu1oEddbbJ35mX/wcwUaQ5LoEGyJTmCrFga0rV5ol1vDsQ0UFxPHCJO mlTFJLG/s6WrzLmyl5Zu2kReMc5/9qgM39TTHq8e/+OQX7V2yeV55wfAJjC5z54sdRh9uU uWrV2Rj/AFseJxgz2Cl/I4Nj1WoOTaUifdj05ncRbDBRIQHJQaTzOPwM8ds7i/+fA2GVuI 4XpOeYf5pboosoNn78NdzRa28fv2WkoB1RtSlhuQ9hja83B8n6tENmlVgS6eUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752063194; 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: in-reply-to:in-reply-to:references:references; bh=WtqFAr96f7StE2XQ3b50Kj8kB6y3biorSpStczmZZis=; b=ovh+cqphKphKz6fnu7EVucAF2lAB9E/ThgarAnIYcYX8QMmyOJiQhL1YRUJUsRwnVRczHy 0MVIVqdWeVTNcWuFveN/RJonM54RMuPR4yjCI6spEUmkKPlcbKPcNj4EBVLMY9961E0kAc 76P4oof3HJjWvohjFnVukoH6amsyWB9/JC+Fz6CfSjFv7BST0iO/JNhSFYGS3+aTwBZdsT NmnENx+IXWzq0GHdioKKup3/ybJbYY6cvUzcVHf8CZjmas0/5M3EfUhsGcg5mFX5Bj4xhq MmViWwJKR4vujS4wKNJ7+EIhaZ16/rAiM+V6KdMT/zLRniIZ92+kIhYQpgxy0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752063194; a=rsa-sha256; cv=none; b=bPmVgew8UqJVT8vL0t63+zdWdo/PMx2kznLoBFaGn5MPsLURHg6I67yT6Xy2rhgY6Ddm30 arhHyzhkSoOzHMcBXMe7SSQa24NMuwdxqKtcMTcG5QZwlXpMlNT2noLR2dlrVmsZlw14so rQLuSeKeOgcxe56XRu5HfjiQn3OWL7ztJLkFClYkk1ErGMJaasVOrXuxUrAY1snyKLyzvR tnNBHIclJGlz2tiYTlu7ahkbxdim07pGLC6IK2JLP3nAljitJoe4TvIIMIDcpsfIkKv9Ye bl8GHgqPLOCb1iwqre9bw57hZJjXH4UqXdC2OtBCsOMEAERWQYnuD2ZPkLynGQ== Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bccLy238Xz1BLC; Wed, 09 Jul 2025 12:13:14 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-4a43f17c42bso6555071cf.2; Wed, 09 Jul 2025 05:13:14 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW6jbcmlDorF/aQKYebrlMUdu5ElaCYLHZ3z3QPnhZiy09MccgF5fkoNmOc9qwnijtejgf7ZBLFlkP/X3PI6t6GoTH8@freebsd.org, AJvYcCWYT1Lee6hyP4so5IEWny/ABr5NKlwMBZ/0kByKGUJSyOcRcT6xmJ0nY13kzysbojzp1PnFmJzQo0cs5/hXQIdC032UHWQ=@freebsd.org X-Gm-Message-State: AOJu0YyI692m3DqofOX82H0dLKvgLF6IT61lLzJWs/wQMQsLpHwMbg8O N7jyzxYdz8SbrX0844c1o4OaMGH6C+75ywcVA1ZV5ado2aeAjyKJ7eHSLp6dLw06yutN96TiNH5 fMRgDVBpX2R6k4uIaVimMiGL1bDZ+2Lg= X-Google-Smtp-Source: AGHT+IH7kDn4TEJfSiV55cqotr5Ph6nz2J463w/50hl4LWE+j8K7SxLj/EFMM4IQbU/NbWCalHDBgTc/1zQS3Uf1vIU= X-Received: by 2002:a05:622a:11c1:b0:4a5:aa2a:c78a with SMTP id d75a77b69052e-4a9dec57374mr10876911cf.4.1752063193773; Wed, 09 Jul 2025 05:13:13 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507041513.564FDwxH011496@gitrepo.freebsd.org> In-Reply-To: <202507041513.564FDwxH011496@gitrepo.freebsd.org> From: Nuno Teixeira Date: Wed, 9 Jul 2025 13:13:02 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXxoBKUIlWLp71regOHJSMCynsQdXwPiFIYjOkUJFXRKISlFpE40XlsNfcM Message-ID: Subject: Re: git: f9cf745a5084 - main - RELNOTES: Document the addition of inotify To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000049fd0806397e00f6" --00000000000049fd0806397e00f6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Not sure if related but I see devel/libdev failing on recent main (tested on aarch64): libtool: compile: cc -DHAVE_CONFIG_H -I. -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF .deps/event.Tpo -c event.c -fPIC -DPIC -o .libs/event.o --- ev.lo --- ev.c:510:11: fatal error: 'sys/statfs.h' file not found 510 | # include | ^~~~~~~~~~~~~~ ev.c: (...) #if EV_USE_INOTIFY # include # include /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ # ifndef IN_DONT_FOLLOW # undef EV_USE_INOTIFY # define EV_USE_INOTIFY 0 # endif #endif Thanks, Mark Johnston escreveu (sexta, 4/07/2025 =C3=A0(s) 16:1= 4): > The branch main has been updated by markj: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Df9cf745a5084dc0a38733db8e774252= e4ed2f444 > > commit f9cf745a5084dc0a38733db8e774252e4ed2f444 > Author: Mark Johnston > AuthorDate: 2025-07-04 15:13:43 +0000 > Commit: Mark Johnston > CommitDate: 2025-07-04 15:13:43 +0000 > > RELNOTES: Document the addition of inotify > --- > RELNOTES | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/RELNOTES b/RELNOTES > index 4933c8392552..09696a37998b 100644 > --- a/RELNOTES > +++ b/RELNOTES > @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. > > Changes to this file should not be MFCed. > > +f1f230439fa4: > + FreeBSD now implements the inotify(2) family of system calls. > + > 50e733f19b37, 171f66b0c2ca: > These commits helped improve utilization of NFSv4.1/4.2 > delegations. The changes are only used when the NFSv4 > > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --00000000000049fd0806397e00f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Not sure if related b= ut I see devel/libdev failing on recent main (tested on aarch64):

li= btool: compile: =C2=A0cc -DHAVE_CONFIG_H -I. -O2 -pipe -fstack-protector-st= rong -fno-strict-aliasing -MT event.lo -MD -MP -MF .deps/event.Tpo -c event= .c =C2=A0-fPIC -DPIC -o .libs/event.o
--- ev.lo ---
ev.c:510:11: fata= l error: 'sys/statfs.h' file not found
=C2=A0 510 | # include &l= t;sys/statfs.h>
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ^~~~~~~~~~~~~~

ev.c:
(...)
<= div>#if EV_USE_INOTIFY
# include <sys/statfs.h>
# include <s= ys/inotify.h>
/* some very old inotify.h headers don't have IN_DO= NT_FOLLOW */
# ifndef IN_DONT_FOLLOW
# =C2=A0undef EV_USE_INOTIFY
= # =C2=A0define EV_USE_INOTIFY 0
# endif
#endif

Than= ks,

Mark Johnston <markj@freebsd.org> escreveu (sexta, 4/07/2025 =C3=A0(s) 1= 6:14):
The branc= h main has been updated by markj:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3Df9cf745a5084dc0a38733db8e774252e4ed2f444
commit f9cf745a5084dc0a38733db8e774252e4ed2f444
Author:=C2=A0 =C2=A0 =C2=A0Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-04 15:13:43 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-04 15:13:43 +0000

=C2=A0 =C2=A0 RELNOTES: Document the addition of inotify
---
=C2=A0RELNOTES | 3 +++
=C2=A01 file changed, 3 insertions(+)

diff --git a/RELNOTES b/RELNOTES
index 4933c8392552..09696a37998b 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -10,6 +10,9 @@ newline.=C2=A0 Entries should be separated by a newline.<= br>
=C2=A0Changes to this file should not be MFCed.

+f1f230439fa4:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0FreeBSD now implements the inotify(2) family of= system calls.
+
=C2=A050e733f19b37, 171f66b0c2ca:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 These commits helped improve utilization of NFS= v4.1/4.2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 delegations.=C2=A0 The changes are only used wh= en the NFSv4



--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--00000000000049fd0806397e00f6-- From nobody Wed Jul 9 12:32:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bccnT6YTpz61cHp; Wed, 09 Jul 2025 12:32:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 4bccnT3pcDz42fm; Wed, 09 Jul 2025 12:32:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-4a9e7c12decso763021cf.2; Wed, 09 Jul 2025 05:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752064363; x=1752669163; 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=POhj4R+7+H/bGhTrnjWJ8nkpg2vwRRRfNIyvrMNknxg=; b=QMMADnFxV1LKgPfXyRu0k+WxGYDzP97Le+/TlMjVmKJ5EihLq59n/UwgOezEHpKuHc 1JG6GfU2rt1rnJTpWgJRcDM8WK2z9E+7DvElL+8GeY6x+oazNjydOaUTHvu+ExqyzBov +vRm6Pyz0CLgFXe5/GP58yfE8JIApzKQtJm4QOgph8RLubC/OlRNB/Y5ZjIm7ZMqDsIg iQVU1X8A0dCz6zitXyKdrjJeY5Ds7fuinb6s5sR0zUW1cZA3439CyUEfNQznr7yYouy0 ufImNElNEk+Xzrp2Y0lKF+ZSuP6bvgfNG9zDBjCf/TS1g5oa0xjikr+rkLuZmco1aFQH rKRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752064363; x=1752669163; 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=POhj4R+7+H/bGhTrnjWJ8nkpg2vwRRRfNIyvrMNknxg=; b=BCs57BHYVRn6Vyr6AzQB5vXRkDTMDHoDbAgtybIt861QhHxYSi2UkJqbOc4gqDhekP 5MTlw0CfEWif9EyYL/PQruJUIpZQWG/PO+NRUXlnuJiQp74R96Gi8QKC0ofEseFMdQ2B J4qTHY9hKoUBknLAuJiz0SYtDus8PiwV5BwLupQNnAxGI0CqnNdTZQElEZWF0cpQkIbz YQUaXe7QOHIaKFlrpur7rz++dmwRdx90BV+mXoDNaamLuZCTcfj8mWJhBeNhXmWYUxeH YsjiyiM7bfOTbqbee0QFeuPkUY8Cq64TmaUwo7izquNT04iDp90iIfhs8LJ+NYHxQVG3 j4qQ== X-Forwarded-Encrypted: i=1; AJvYcCUDTgps1vzTUqX5CiVaB8t0GRJCjiTKRLZ+yU9SxLSpiIUg+grcrQgU0ab8Nmq/QTILxRWqi74jZfTJ0PdxCC631oRneVU=@freebsd.org, AJvYcCVkLzufksB/R/HmWTG8aDMRwDu3IMAY8VgnjVlg8ptrFW1RSLs5pDgbf7qEKAU3lbZaxDUN+ywyE8zA1bU4GNdXfwvW@freebsd.org X-Gm-Message-State: AOJu0YxhQprJ5y+n5dVb+AE7tIQZGW605MdOY31BG8QFrkCXbFAJQTic FpZEuZB+WGGTt1AMf9fOImqoqFyQcIC81O8CwrSPNhuV4gADM2/x09ptmig0LDAx X-Gm-Gg: ASbGncv/9HXNedc93qKngldAD921btdUCPVuKG5DVqZ9zy8uWohi12ARETBcV0DYuI9 KMujoLB3krdYPozu5NORF+UeW3EqIbmWOX9fhbzrQdejl7/+z/4iQibX/0FZy6lMbMjimOq0veu lwiBEyzuTSXgzA8aKz7Qs8igvh7pmhHcSj6HX9M+XDufno0DTF1O0igF4qr2Ckn/hLYUh++Ey12 3LcLzuHISrbrgytnXCyhXrV/Ql8xIcL/LkQh7NPtvqsXcUPnixqtoyWCcVEtmZDzrlutA0cUrMg eJ2IAD9Cwyg5pnAvDyD4CgyS1RkKKyzvJhfOz/xWDG5hGmTDPSw7DqKZ8e553suTeSOVPBwi0FZ a X-Google-Smtp-Source: AGHT+IGtbovLXn3ZkaOhKx+/TgawkSvbYhnFXOhu+PxFKuVqvD0b7XRWofAywWf8hoN8E3nWkRQ1MQ== X-Received: by 2002:a05:622a:118b:b0:4a6:f854:8104 with SMTP id d75a77b69052e-4a9deae57b2mr31574441cf.0.1752064362916; Wed, 09 Jul 2025 05:32: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-4a994b73653sm92212201cf.0.2025.07.09.05.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jul 2025 05:32:42 -0700 (PDT) Date: Wed, 9 Jul 2025 08:32:39 -0400 From: Mark Johnston To: Nuno Teixeira Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f9cf745a5084 - main - RELNOTES: Document the addition of inotify Message-ID: References: <202507041513.564FDwxH011496@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bccnT3pcDz42fm 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] On Wed, Jul 09, 2025 at 01:13:02PM +0100, Nuno Teixeira wrote: > Hello, > > Not sure if related but I see devel/libdev failing on recent main (tested > on aarch64): > > libtool: compile: cc -DHAVE_CONFIG_H -I. -O2 -pipe > -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF > .deps/event.Tpo -c event.c -fPIC -DPIC -o .libs/event.o > --- ev.lo --- > ev.c:510:11: fatal error: 'sys/statfs.h' file not found > 510 | # include > | ^~~~~~~~~~~~~~ Are you able to test the patch below? diff --git a/devel/libev/files/patch-Makefile.in b/devel/libev/files/patch-Makefile.in index 5f6ab0fc3b55..509149e2548b 100644 --- a/devel/libev/files/patch-Makefile.in +++ b/devel/libev/files/patch-Makefile.in @@ -1,6 +1,6 @@ ---- Makefile.in.orig 2015-12-20 21:12:45 UTC +--- Makefile.in.orig 2020-03-18 12:27:30 UTC +++ Makefile.in -@@ -343,7 +343,7 @@ EXTRA_DIST = LICENSE Changes libev.m4 au +@@ -357,7 +357,7 @@ man_MANS = ev.3 ev.3 ev.pod Symbols.ev Symbols.event man_MANS = ev.3 diff --git a/devel/libev/files/patch-configure b/devel/libev/files/patch-configure index c92f6cf66003..6e5bf586cf34 100644 --- a/devel/libev/files/patch-configure +++ b/devel/libev/files/patch-configure @@ -1,6 +1,6 @@ ---- configure.orig 2015-12-20 21:12:45 UTC +--- configure.orig 2020-03-18 12:27:26 UTC +++ configure -@@ -3879,14 +3879,6 @@ else +@@ -3954,14 +3954,6 @@ fi fi diff --git a/devel/libev/files/patch-ev.c b/devel/libev/files/patch-ev.c index 28a00f3aaf8b..65b372e5415a 100644 --- a/devel/libev/files/patch-ev.c +++ b/devel/libev/files/patch-ev.c @@ -1,6 +1,15 @@ ---- ev.c.orig 2015-12-20 21:12:53 UTC +--- ev.c.orig 2020-03-18 12:27:32 UTC +++ ev.c -@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW +@@ -507,7 +507,7 @@ + #endif + + #if EV_USE_INOTIFY +-# include ++# include + # include + /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ + # ifndef IN_DONT_FOLLOW +@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT { unsigned int flags = ev_supported_backends (); From nobody Wed Jul 9 13:20:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcdrG3WZTz61f96; Wed, 09 Jul 2025 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcdrG1pdQz47Yy; Wed, 09 Jul 2025 13: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=1752067214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9um1JZXJWYK3A8TKS4rvzS80kHWI60TcmxeE9LpvLs8=; b=U/f/UKuX/2swkF+tBnbH+UpS5LTnqD0w2Vof/mksFOq3IDqhRtFcthgtVfRcTO4AdRDJNh 6dWYUAPJlxD/hZWvqp2mecNVNFrIOYBEdJa19g9LK5C8rTx/10g8zCf5+2ZexDdUG1JBG2 4ORKjrCDUovijSda53lK7rHU/g4rSkt7ez9eQcvi5WQpefTIgkLzfzwoX9e8CFnVUhO+/q sWHGO789KvcN2vKFCS5ZBuMVcIu1uHwzpKXUcLN356t2XSHseQhvZ3mLvYIkcwB9mA/sgw g5Y0Zrai2amCDrza5VYwTCTWhv9lXUAzMyNRsAgZD6WI/5IUxR5MfJhIm7jxiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752067214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9um1JZXJWYK3A8TKS4rvzS80kHWI60TcmxeE9LpvLs8=; b=C2S1q/kDEKqeur9x41o+7vUeg1yRcRkB7Ny6LnoWVgsfP+TKC33SO5bub0PDNLjKfQS14f Ub7Mw6sVay1fkLMZMEZGNHYxSPEVr+y9hFAPVrquQFfHxerBGcUm0CBuSMrFDnm02aXmDn Q+/hTrHJEGE/snIeigX4ql3V3llKOEuOsUzmPZeEx16jQEDpfhxs0HrZBIuA2yHFuGg6Gg 8LNG7ihYBqcoTXBvhGBu93EkavLcKsWXSmMTCWqAjxYWhPFO6q9sQApjnLJBvWjx1Vx1HZ Dc/TjcLxr9fGx6GMPSHeWVbnoYaCKd6mX9i2tVWo0CjyxU+roXPRzuozY/hWKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752067214; a=rsa-sha256; cv=none; b=CKhDu1hPuoqD1P2jStN5yg5OZQMaL4jjNcJy3vZZUNKodkmV9wYY7F07MRtzcdZZ03YKk0 j7Os/SeA7vHpB9jBf6sgEfoYziBvF7sjieQGSFOntOhyl5hB7p66WZnuPpInrTC7UFQbvW zKNxud+xXoxBfQ0hqDd47hiI4RJaXWf5WfrWFnFKelCfIw2h7jn3EvQK6pjH3fnvToqB76 pnIFkvGU7oQBfVB/waawrEVzw35rnhVP/pI8WmRebVgw0EY5r3l3WnL2ID14ZluSdZrSyT V3kTC3YBOOTVzQGD4HmuRwHQPa4WVD1sM6inUbo/vLmbeUpBqS0u7O7pQvFaGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcdrG1QVLz7qw; Wed, 09 Jul 2025 13:20: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 569DKEq1042449; Wed, 9 Jul 2025 13:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569DKE3B042443; Wed, 9 Jul 2025 13:20:14 GMT (envelope-from git) Date: Wed, 9 Jul 2025 13:20:14 GMT Message-Id: <202507091320.569DKE3B042443@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: 21876224361a - main - fts: Fix option list indentation. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 21876224361ad3c01e784d3a7fbe5ad808e00b4c Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=21876224361ad3c01e784d3a7fbe5ad808e00b4c commit 21876224361ad3c01e784d3a7fbe5ad808e00b4c Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 13:19:56 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 13:20:08 +0000 fts: Fix option list indentation. Fixes: da2025a0e894 Sponsored by: Klara, Inc. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D51208 --- lib/libc/gen/fts.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/fts.3 b/lib/libc/gen/fts.3 index 5860d1be1a1e..ee558b892c8c 100644 --- a/lib/libc/gen/fts.3 +++ b/lib/libc/gen/fts.3 @@ -394,7 +394,7 @@ must be specified. The options are selected by .Em or Ns 'ing the following values: -.Bl -tag -width "FTS_PHYSICAL" +.Bl -tag -width "FTS_COMFOLLOWDIR" .It Dv FTS_COMFOLLOW This option causes any symbolic link specified as a root path to be followed immediately whether or not From nobody Wed Jul 9 14:24:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcgGc3rByz61kHd; Wed, 09 Jul 2025 14:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcgGc3cmbz3FdK; Wed, 09 Jul 2025 14:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752071080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JcAhctUfulqt8Jrs4FmPEgH4gRxlxL9JxXXI5iW/EYI=; b=XqVr4VREx+erfRAlhwWZlmu+gcabHobCFuV1wfVjb3P/bGfd+bm595iB4MXrsCJ6FqmWSN FM+VRZWFKDqR2/ZBb8BK74UKMg1whzz/Hl+r1ynd/9Ah0EOsDlGpGmpYMprge/rD65/sjy DuhYF7zxm1Ahb+UY6O9QbuVa+47rEM5M/eULa3sKTAsgyoj8rWBLBs8WKd8mXclVYKCJFS u+hz0YYWvrnrIbuosgk6K7JgXXNPZdo/xhIMQyOBGh/C2j8Z+I/veqRmJ2gy01dBWGeupN 2DjvAwzr0W6aY2NP1PcZCogjm038fEefimxPvWFVpFgnGY0n5cG0OGq9kzLU+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752071080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JcAhctUfulqt8Jrs4FmPEgH4gRxlxL9JxXXI5iW/EYI=; b=o4vkCLSmYp6OuuO4YDqxI0cMa3xmZ0dTf8A9XTTrTUfk9CdD2SgrUY0uhnHh1EtTlWoSnN omm1M19mp9B7fApiZLMRnDr5x6PYHxtxc8UOlrzVYqqkSn32Rj392wLvhmdhx8Rrdy9rz+ s8Bdj1imB+IWES/nZXsG4Se0GANujASZpSNC1wlB1oMI2DYA5NGkzBPYREew3uCK3oQMkg kfil5mJZFsF1QLIEEyN7RuApDTU3VSkpiNfOJTDRn3ICqAJjizLgbLPKiHebartLRXf+k9 AQelkGXlwMjPoDoqR7OSRYdf14DioAj6s8b74Jca9Y1rjEPFEbprntm0I6Qhpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752071080; a=rsa-sha256; cv=none; b=jacgqH2OUt9jFQT7SZLoSGveWLyBoHAWCYsaH8diT+WLDLfKWVaWWZMlIrFqbH45MKCzeq 48B7R432Zfc0GlE8nQBjL6MH6pHU04M4aguC5D+o6RAwZs8/38zrrzY/T7V8jy8x0DO9su fEDAq7xmII0YxYSR6YOggr32LZnWOS2afGqhLsV92MjCsy+yENWny4q6kpD5dTdMojLsCa jJUFk6IAmXA6JKRZznT+mj2RrgtuUErxVb0l5GE+7hFdnOIAoG9VBIGDRztVEA/ekpkXla jo2006Gj59h3wzf8FFY76K0j5dH0+E6+is/bmqN7LTgxPbNsqOdCOf+SVmKrSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcgGc39fcz9Ml; Wed, 09 Jul 2025 14:24: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 569EOeB8065605; Wed, 9 Jul 2025 14:24:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569EOevV065602; Wed, 9 Jul 2025 14:24:40 GMT (envelope-from git) Date: Wed, 9 Jul 2025 14:24:40 GMT Message-Id: <202507091424.569EOevV065602@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: 5c59cec2d5e1 - main - nvmf: Auto-reconnect periodically after a disconnect List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5c59cec2d5e141de54bbc737477a8e498685186a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5c59cec2d5e141de54bbc737477a8e498685186a commit 5c59cec2d5e141de54bbc737477a8e498685186a Author: John Baldwin AuthorDate: 2025-07-09 14:17:41 +0000 Commit: John Baldwin CommitDate: 2025-07-09 14:19:45 +0000 nvmf: Auto-reconnect periodically after a disconnect Use a timer in the nvmf(4) driver to periodically trigger a devctl "RECONNECT" notification. A trigger in the /etc/devd/nvmf.conf file invokes "nvmecontrol reconnect nvmeX" upon each notification. This differs from iSCSI which uses a dedicated daemon (iscsid(8)) to wait inside a custom ioctl for an iSCSI initiator event to occur, but I think this design might be simpler. Similar to nvme-cli, the interval between reconnection attempts is specified in seconds by the --reconnect-delay argument to the connect and reconnect commands. Note that nvme-cli uses -c for short letter of this command, but that was already taken so nvmecontrol uses -r. The default is 10 seconds to match Linux. In addition, a second timeout can be used to force a full detach of a disconnected the nvmeX device after the controller loss timeout expires. The timeout for this is specified in seconds by the --ctrl-loss-tmo/-l options (identical to nvme-cli). The default is 600 seconds. Either of these timers can be disabled by setting the timer to 0. In that case, the associated action (devctl notifications or full detach) will not occur after a disconnect. Note that this adds a dedicated taskqueue for nvmf tasks instead of using taskqueue_thread as the controller loss task could deadlock waiting for the completion of other tasks queued to taskqueue_thread. (Specifically, tearing down the CAM SIM can trigger destroy_dev_sched_cb() and waits for the callback to run, but the callback is scheduled to run in a task on taskqueue_thread. Possibly, destroy_dev_sched should be using a dedicated taskqueue.) Reviewed by: imp (earlier version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50222 --- lib/libnvmf/libnvmf.h | 6 ++- lib/libnvmf/nvmf_host.c | 21 ++++++-- sbin/devd/Makefile | 5 ++ sbin/devd/devd.conf.5 | 4 +- sbin/devd/nvmf.conf | 7 +++ sbin/nvmecontrol/connect.c | 11 +++- sbin/nvmecontrol/nvmecontrol.8 | 31 ++++++++++- sbin/nvmecontrol/reconnect.c | 17 +++++- sys/dev/nvmf/host/nvmf.c | 119 +++++++++++++++++++++++++++++++++++++++-- sys/dev/nvmf/host/nvmf_var.h | 6 +++ sys/dev/nvmf/nvmf.h | 11 ++++ 11 files changed, 221 insertions(+), 17 deletions(-) diff --git a/lib/libnvmf/libnvmf.h b/lib/libnvmf/libnvmf.h index 9840e190a24f..7cdd7e433455 100644 --- a/lib/libnvmf/libnvmf.h +++ b/lib/libnvmf/libnvmf.h @@ -342,7 +342,8 @@ int nvmf_host_request_queues(struct nvmf_qpair *qp, u_int requested, */ int nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout); /* * Disconnect an active host association previously handed off to the @@ -370,7 +371,8 @@ int nvmf_reconnect_params(int fd, nvlist_t **nvlp); */ int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout); /* * Fetch connection status from an existing kernel host. diff --git a/lib/libnvmf/nvmf_host.c b/lib/libnvmf/nvmf_host.c index 89cdd5c6bb70..3266f8898296 100644 --- a/lib/libnvmf/nvmf_host.c +++ b/lib/libnvmf/nvmf_host.c @@ -792,7 +792,8 @@ static int prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout) { const struct nvmf_association *na = admin_qp->nq_association; nvlist_t *nvl, *nvl_qp, *nvl_rparams; @@ -820,6 +821,9 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, nvlist_add_string(nvl_rparams, "hostnqn", hostnqn); nvlist_add_number(nvl_rparams, "num_io_queues", num_queues); nvlist_add_number(nvl_rparams, "kato", admin_qp->nq_kato); + nvlist_add_number(nvl_rparams, "reconnect_delay", reconnect_delay); + nvlist_add_number(nvl_rparams, "controller_loss_timeout", + controller_loss_timeout); nvlist_add_number(nvl_rparams, "io_qsize", io_queues[0]->nq_qsize); nvlist_add_bool(nvl_rparams, "sq_flow_control", na->na_params.sq_flow_control); @@ -842,6 +846,9 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, nvl = nvlist_create(0); nvlist_add_number(nvl, "trtype", na->na_trtype); nvlist_add_number(nvl, "kato", admin_qp->nq_kato); + nvlist_add_number(nvl, "reconnect_delay", reconnect_delay); + nvlist_add_number(nvl, "controller_loss_timeout", + controller_loss_timeout); nvlist_move_nvlist(nvl, "rparams", nvl_rparams); /* First, the admin queue. */ @@ -872,7 +879,8 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, int nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout) { struct nvmf_ioc_nv nv; u_int i; @@ -885,7 +893,8 @@ nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, } error = prepare_queues_for_handoff(&nv, dle, hostnqn, admin_qp, - num_queues, io_queues, cdata); + num_queues, io_queues, cdata, reconnect_delay, + controller_loss_timeout); if (error != 0) goto out; @@ -981,14 +990,16 @@ nvmf_reconnect_params(int fd, nvlist_t **nvlp) int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout) { struct nvmf_ioc_nv nv; u_int i; int error; error = prepare_queues_for_handoff(&nv, dle, hostnqn, admin_qp, - num_queues, io_queues, cdata); + num_queues, io_queues, cdata, reconnect_delay, + controller_loss_timeout); if (error != 0) goto out; diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile index 4ff0187a5a22..5d5721d16884 100644 --- a/sbin/devd/Makefile +++ b/sbin/devd/Makefile @@ -46,6 +46,11 @@ HYPERV+= hyperv.conf HYPERVPACKAGE= hyperv-tools .endif +CONFGROUPS+= NVME +NVMEDIR= ${DEVDDIR} +NVME+= nvmf.conf +NVMEPACKAGE= nvme-tools + .if ${MK_USB} != "no" DEVD+= uath.conf ulpt.conf .endif diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 4dbd7338edb1..baf4b9d3a183 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -38,7 +38,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd July 8, 2025 +.Dd July 9, 2025 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -517,6 +517,8 @@ and representing the start of a controller reset, the successful completion of a controller reset, or a timeout while waiting for the controller to reset, respectively. +.It Li nvme Ta Li controller Ta Li RECONNECT Ta +An NVMe over Fabrics host has disconnected and is requesting a reconnect. .El .Pp .Bl -column "SYSTEM" "SUBSYSTEM" "SHUTDOWN-THRESHOLD" -compact diff --git a/sbin/devd/nvmf.conf b/sbin/devd/nvmf.conf new file mode 100644 index 000000000000..eaf3ebe86cec --- /dev/null +++ b/sbin/devd/nvmf.conf @@ -0,0 +1,7 @@ +# Attempt to reconnect NVMeoF host devices when requested +notify 100 { + match "system" "nvme"; + match "subsystem" "controller"; + match "type" "RECONNECT"; + action "nvmecontrol reconnect $name"; +}; diff --git a/sbin/nvmecontrol/connect.c b/sbin/nvmecontrol/connect.c index c1d5d2cbaf5a..3d6d12bf2c48 100644 --- a/sbin/nvmecontrol/connect.c +++ b/sbin/nvmecontrol/connect.c @@ -31,6 +31,8 @@ static struct options { const char *subnqn; const char *hostnqn; uint32_t kato; + uint32_t reconnect_delay; + uint32_t controller_loss_timeout; uint16_t num_io_queues; uint16_t queue_size; bool data_digests; @@ -43,6 +45,8 @@ static struct options { .subnqn = NULL, .hostnqn = NULL, .kato = NVMF_KATO_DEFAULT / 1000, + .reconnect_delay = NVMF_DEFAULT_RECONNECT_DELAY, + .controller_loss_timeout = NVMF_DEFAULT_CONTROLLER_LOSS, .num_io_queues = 1, .queue_size = 0, .data_digests = false, @@ -107,7 +111,7 @@ connect_nvm_controller(enum nvmf_trtype trtype, int adrfam, const char *address, } error = nvmf_handoff_host(dle, hostnqn, admin, opt.num_io_queues, io, - &cdata); + &cdata, opt.reconnect_delay, opt.controller_loss_timeout); if (error != 0) { warnc(error, "Failed to handoff queues to kernel"); free(io); @@ -259,6 +263,11 @@ static const struct opts connect_opts[] = { "Number of entries in each I/O queue"), OPT("keep-alive-tmo", 'k', arg_uint32, opt, kato, "Keep Alive timeout (in seconds)"), + OPT("reconnect-delay", 'r', arg_uint32, opt, reconnect_delay, + "Delay between reconnect attempts after connection loss " + "(in seconds)"), + OPT("ctrl-loss-tmo", 'l', arg_uint32, opt, controller_loss_timeout, + "Controller loss timeout after connection loss (in seconds)"), OPT("hostnqn", 'q', arg_string, opt, hostnqn, "Host NQN"), OPT("flow_control", 'F', arg_none, opt, flow_control, diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index d886b60a2545..624a0c93719b 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -33,7 +33,7 @@ .\" .\" Author: Jim Harris .\" -.Dd April 29, 2025 +.Dd July 9, 2025 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -216,6 +216,8 @@ .Op Fl c Ar cntl-id .Op Fl i Ar queues .Op Fl k Ar seconds +.Op Fl l Ar seconds +.Op Fl r Ar seconds .Op Fl t Ar transport .Op Fl q Ar HostNQN .Op Fl Q Ar entries @@ -226,6 +228,8 @@ .Op Fl FGg .Op Fl i Ar queues .Op Fl k Ar seconds +.Op Fl l Ar seconds +.Op Fl r Ar seconds .Op Fl t Ar transport .Op Fl q Ar HostNQN .Op Fl Q Ar entries @@ -241,6 +245,8 @@ .Op Fl FGg .Op Fl i Ar queues .Op Fl k Ar seconds +.Op Fl l Ar seconds +.Op Fl r Ar seconds .Op Fl t Ar transport .Op Fl q Ar HostNQN .Op Fl Q Ar entries @@ -786,6 +792,29 @@ The default is 1. .It Fl k Ar seconds Keep Alive timer duration in seconds. The default is 120. +.It Fl l Ar seconds +Controller Loss timer duration in seconds. +The default is 600. +.Pp +This timer starts when an association is lost with a remote I/O controller +and is cancelled when a new association is established. +If the timer expires, the controller device is deleted. +A setting of zero disables this timer. +.It Fl r Ar seconds +Reconnect timer duration in seconds. +The default is 10. +.Pp +When an association is lost with a remote I/O controller, +the controller device will request reconnection via periodic +.Xr devctl 4 +notifications until either a new association is established or the controller +device is deleted. +This timer sets the interval between each +.Xr devctl 4 +notification. +Note that the first notification is triggered immediately after an association +is lost. +A setting of zero disables this timer. .It Fl t Ar transport Transport to use. The default is diff --git a/sbin/nvmecontrol/reconnect.c b/sbin/nvmecontrol/reconnect.c index adf1edac662b..06af40624177 100644 --- a/sbin/nvmecontrol/reconnect.c +++ b/sbin/nvmecontrol/reconnect.c @@ -27,6 +27,8 @@ static struct options { const char *transport; const char *hostnqn; uint32_t kato; + uint32_t reconnect_delay; + uint32_t controller_loss_timeout; uint16_t num_io_queues; uint16_t queue_size; bool data_digests; @@ -37,6 +39,8 @@ static struct options { .transport = "tcp", .hostnqn = NULL, .kato = NVMF_KATO_DEFAULT / 1000, + .reconnect_delay = NVMF_DEFAULT_RECONNECT_DELAY, + .controller_loss_timeout = NVMF_DEFAULT_CONTROLLER_LOSS, .num_io_queues = 1, .queue_size = 0, .data_digests = false, @@ -59,6 +63,7 @@ static int reconnect_nvm_controller(int fd, const struct nvmf_association_params *aparams, enum nvmf_trtype trtype, int adrfam, const char *address, const char *port, uint16_t cntlid, const char *subnqn, const char *hostnqn, uint32_t kato, + uint32_t reconnect_delay, uint32_t controller_loss_timeout, u_int num_io_queues, u_int queue_size, const struct nvme_discovery_log_entry *dle) { @@ -88,7 +93,7 @@ reconnect_nvm_controller(int fd, const struct nvmf_association_params *aparams, } error = nvmf_reconnect_host(fd, dle, hostnqn, admin, num_io_queues, io, - &cdata); + &cdata, reconnect_delay, controller_loss_timeout); if (error != 0) { warnc(error, "Failed to handoff queues to kernel"); free(io); @@ -137,7 +142,8 @@ reconnect_by_address(int fd, const nvlist_t *rparams, const char *addr) error = reconnect_nvm_controller(fd, &aparams, trtype, AF_UNSPEC, address, port, le16toh(dle->cntlid), subnqn, hostnqn, - opt.kato * 1000, opt.num_io_queues, opt.queue_size, NULL); + opt.kato * 1000, opt.reconnect_delay, opt.controller_loss_timeout, + opt.num_io_queues, opt.queue_size, NULL); free(subnqn); free(tofree); return (error); @@ -196,6 +202,8 @@ reconnect_by_params(int fd, const nvlist_t *rparams) address, port, le16toh(dle->cntlid), dle->subnqn, nvlist_get_string(rparams, "hostnqn"), dnvlist_get_number(rparams, "kato", 0), + dnvlist_get_number(rparams, "reconnect_delay", 0), + dnvlist_get_number(rparams, "controller_loss_timeout", 0), nvlist_get_number(rparams, "num_io_queues"), nvlist_get_number(rparams, "io_qsize"), dle); free(subnqn); @@ -291,6 +299,11 @@ static const struct opts reconnect_opts[] = { "Number of entries in each I/O queue"), OPT("keep-alive-tmo", 'k', arg_uint32, opt, kato, "Keep Alive timeout (in seconds)"), + OPT("reconnect-delay", 'r', arg_uint32, opt, reconnect_delay, + "Delay between reconnect attempts after connection loss " + "(in seconds)"), + OPT("ctrl-loss-tmo", 'l', arg_uint32, opt, controller_loss_timeout, + "Controller loss timeout after connection loss (in seconds)"), OPT("hostnqn", 'q', arg_string, opt, hostnqn, "Host NQN"), OPT("flow_control", 'F', arg_none, opt, flow_control, diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index dbdd4568bdf1..1ac0d142443b 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -27,6 +27,7 @@ #include static struct cdevsw nvmf_cdevsw; +static struct taskqueue *nvmf_tq; bool nvmf_fail_disconnect = false; SYSCTL_BOOL(_kern_nvmf, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, @@ -34,7 +35,10 @@ SYSCTL_BOOL(_kern_nvmf, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, MALLOC_DEFINE(M_NVMF, "nvmf", "NVMe over Fabrics host"); +static void nvmf_controller_loss_task(void *arg, int pending); static void nvmf_disconnect_task(void *arg, int pending); +static void nvmf_request_reconnect(struct nvmf_softc *sc); +static void nvmf_request_reconnect_task(void *arg, int pending); static void nvmf_shutdown_pre_sync(void *arg, int howto); static void nvmf_shutdown_post_sync(void *arg, int howto); @@ -294,6 +298,9 @@ nvmf_establish_connection(struct nvmf_softc *sc, nvlist_t *nvl) admin = nvlist_get_nvlist(nvl, "admin"); io = nvlist_get_nvlist_array(nvl, "io", &num_io_queues); kato = dnvlist_get_number(nvl, "kato", 0); + sc->reconnect_delay = dnvlist_get_number(nvl, "reconnect_delay", 0); + sc->controller_loss_timeout = dnvlist_get_number(nvl, + "controller_loss_timeout", 0); /* Setup the admin queue. */ sc->admin = nvmf_init_qp(sc, trtype, admin, "admin queue", 0); @@ -504,6 +511,10 @@ nvmf_attach(device_t dev) callout_init(&sc->ka_tx_timer, 1); sx_init(&sc->connection_lock, "nvmf connection"); TASK_INIT(&sc->disconnect_task, 0, nvmf_disconnect_task, sc); + TIMEOUT_TASK_INIT(nvmf_tq, &sc->controller_loss_task, 0, + nvmf_controller_loss_task, sc); + TIMEOUT_TASK_INIT(nvmf_tq, &sc->request_reconnect_task, 0, + nvmf_request_reconnect_task, sc); oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "ioq", @@ -603,7 +614,9 @@ out: nvmf_destroy_aer(sc); - taskqueue_drain(taskqueue_thread, &sc->disconnect_task); + taskqueue_drain_timeout(nvmf_tq, &sc->request_reconnect_task); + taskqueue_drain_timeout(nvmf_tq, &sc->controller_loss_task); + taskqueue_drain(nvmf_tq, &sc->disconnect_task); sx_destroy(&sc->connection_lock); nvlist_destroy(sc->rparams); free(sc->cdata, M_NVMF); @@ -613,7 +626,7 @@ out: void nvmf_disconnect(struct nvmf_softc *sc) { - taskqueue_enqueue(taskqueue_thread, &sc->disconnect_task); + taskqueue_enqueue(nvmf_tq, &sc->disconnect_task); } static void @@ -676,6 +689,74 @@ nvmf_disconnect_task(void *arg, int pending __unused) nvmf_destroy_qp(sc->admin); sc->admin = NULL; + if (sc->reconnect_delay != 0) + nvmf_request_reconnect(sc); + if (sc->controller_loss_timeout != 0) + taskqueue_enqueue_timeout(nvmf_tq, + &sc->controller_loss_task, sc->controller_loss_timeout * + hz); + + sx_xunlock(&sc->connection_lock); +} + +static void +nvmf_controller_loss_task(void *arg, int pending) +{ + struct nvmf_softc *sc = arg; + device_t dev; + int error; + + bus_topo_lock(); + sx_xlock(&sc->connection_lock); + if (sc->admin != NULL || sc->detaching) { + /* Reconnected or already detaching. */ + sx_xunlock(&sc->connection_lock); + bus_topo_unlock(); + return; + } + + sc->controller_timedout = true; + sx_xunlock(&sc->connection_lock); + + /* + * XXX: Doing this from here is a bit ugly. We don't have an + * extra reference on `dev` but bus_topo_lock should block any + * concurrent device_delete_child invocations. + */ + dev = sc->dev; + error = device_delete_child(root_bus, dev); + if (error != 0) + device_printf(dev, + "failed to detach after controller loss: %d\n", error); + bus_topo_unlock(); +} + +static void +nvmf_request_reconnect(struct nvmf_softc *sc) +{ + char buf[64]; + + sx_assert(&sc->connection_lock, SX_LOCKED); + + snprintf(buf, sizeof(buf), "name=\"%s\"", device_get_nameunit(sc->dev)); + devctl_notify("nvme", "controller", "RECONNECT", buf); + taskqueue_enqueue_timeout(nvmf_tq, &sc->request_reconnect_task, + sc->reconnect_delay * hz); +} + +static void +nvmf_request_reconnect_task(void *arg, int pending) +{ + struct nvmf_softc *sc = arg; + + sx_xlock(&sc->connection_lock); + if (sc->admin != NULL || sc->detaching || sc->controller_timedout) { + /* Reconnected or already detaching. */ + sx_xunlock(&sc->connection_lock); + return; + } + + nvmf_request_reconnect(sc); sx_xunlock(&sc->connection_lock); } @@ -699,7 +780,7 @@ nvmf_reconnect_host(struct nvmf_softc *sc, struct nvmf_ioc_nv *nv) } sx_xlock(&sc->connection_lock); - if (sc->admin != NULL || sc->detaching) { + if (sc->admin != NULL || sc->detaching || sc->controller_timedout) { error = EBUSY; goto out; } @@ -745,6 +826,9 @@ nvmf_reconnect_host(struct nvmf_softc *sc, struct nvmf_ioc_nv *nv) nvmf_reconnect_sim(sc); nvmf_rescan_all_ns(sc); + + taskqueue_cancel_timeout(nvmf_tq, &sc->request_reconnect_task, NULL); + taskqueue_cancel_timeout(nvmf_tq, &sc->controller_loss_task, NULL); out: sx_xunlock(&sc->connection_lock); nvlist_destroy(nvl); @@ -852,7 +936,21 @@ nvmf_detach(device_t dev) } free(sc->io, M_NVMF); - taskqueue_drain(taskqueue_thread, &sc->disconnect_task); + taskqueue_drain(nvmf_tq, &sc->disconnect_task); + if (taskqueue_cancel_timeout(nvmf_tq, &sc->request_reconnect_task, + NULL) != 0) + taskqueue_drain_timeout(nvmf_tq, &sc->request_reconnect_task); + + /* + * Don't cancel/drain the controller loss task if that task + * has fired and is triggering the detach. + */ + if (!sc->controller_timedout) { + if (taskqueue_cancel_timeout(nvmf_tq, &sc->controller_loss_task, + NULL) != 0) + taskqueue_drain_timeout(nvmf_tq, + &sc->controller_loss_task); + } if (sc->admin != NULL) nvmf_destroy_qp(sc->admin); @@ -1154,14 +1252,25 @@ static struct cdevsw nvmf_cdevsw = { static int nvmf_modevent(module_t mod, int what, void *arg) { + int error; + switch (what) { case MOD_LOAD: - return (nvmf_ctl_load()); + error = nvmf_ctl_load(); + if (error != 0) + return (error); + + nvmf_tq = taskqueue_create("nvmf", M_WAITOK | M_ZERO, + taskqueue_thread_enqueue, &nvmf_tq); + taskqueue_start_threads(&nvmf_tq, 1, PWAIT, "nvmf taskq"); + return (0); case MOD_QUIESCE: return (0); case MOD_UNLOAD: nvmf_ctl_unload(); destroy_dev_drain(&nvmf_cdevsw); + if (nvmf_tq != NULL) + taskqueue_free(nvmf_tq); return (0); default: return (EOPNOTSUPP); diff --git a/sys/dev/nvmf/host/nvmf_var.h b/sys/dev/nvmf/host/nvmf_var.h index e45a31f413a4..606245b3969c 100644 --- a/sys/dev/nvmf/host/nvmf_var.h +++ b/sys/dev/nvmf/host/nvmf_var.h @@ -75,9 +75,15 @@ struct nvmf_softc { struct callout ka_rx_timer; sbintime_t ka_rx_sbt; + struct timeout_task request_reconnect_task; + struct timeout_task controller_loss_task; + uint32_t reconnect_delay; + uint32_t controller_loss_timeout; + struct sx connection_lock; struct task disconnect_task; bool detaching; + bool controller_timedout; u_int num_aer; struct nvmf_aer *aer; diff --git a/sys/dev/nvmf/nvmf.h b/sys/dev/nvmf/nvmf.h index d4e7b1511e9d..9b2b4c1dea40 100644 --- a/sys/dev/nvmf/nvmf.h +++ b/sys/dev/nvmf/nvmf.h @@ -26,6 +26,13 @@ #define NVMF_NN (1024) +/* + * Default timeouts for Fabrics hosts. These match values used by + * Linux. + */ +#define NVMF_DEFAULT_RECONNECT_DELAY 10 +#define NVMF_DEFAULT_CONTROLLER_LOSS 600 + /* * (data, size) is the userspace buffer for a packed nvlist. * @@ -68,6 +75,8 @@ struct nvmf_ioc_nv { * * number trtype * number kato (optional) + * number reconnect_delay (optional) + * number controller_loss_timeout (optional) * qpair handoff nvlist admin * qpair handoff nvlist array io * binary cdata struct nvme_controller_data @@ -81,6 +90,8 @@ struct nvmf_ioc_nv { * string hostnqn * number num_io_queues * number kato (optional) + * number reconnect_delay (optional) + * number controller_loss_timeout (optional) * number io_qsize * bool sq_flow_control * From nobody Wed Jul 9 15:40:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy222bHz60Zb6; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy16wLvz3ZVk; Wed, 09 Jul 2025 15:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbuYKtlyItImIcVxJbzIKJRTY42+R5M7kqXNtM/yJ1s=; b=ENTGpwIgXlBbJ76B11L9bNF9TmJEY9cO5MfzYOYGkS+5Kl+ryuLMb22c4kCTauW60SEGak G4JnogQ3yM6zBvqB//wAFWgG4MketfOEvLV9a/NTWPkR4Zj7PfWl5pcW4LMIuMhBVNCT8x Chtt0ZCeaDjBbHwTuFIaEzkGVHIwQ2P61EkueiFEcRfo7coS2IrKz7784AzOUJxwE0zGnf DQDub2EVLnQzZB/ShfMzpFsk2AAcSfaW9jz+LzQMUQgd+hlNc/M44QMLWNn4oNOr8mAQP7 whitWnqiS93PY8zxFqdVoulE8GjNqA/iqDQO83b3zrgMRqGLmKAhDAo1WLkeeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbuYKtlyItImIcVxJbzIKJRTY42+R5M7kqXNtM/yJ1s=; b=DVFmYfSCyi20y/OJ/wj+xU84eGsPJbSKgcV2Zvyf+gZPubDo8NyKhWtUl69zfd8fcfrdjs HYTdbgv4XF+fqwJW2blAgIrnM9hMeksaUra36LVEqYD4AUe0TMF6wNrIz6oJ8tsOHg0qCO ZyKYRId9jKtghtrYGNGuUziBZklvRNvXpdiFhopx+vuhFz8RB70CkxoLbOVyeOeVovMbhz HijhUNaHUyxAJpMTMWEyT9VXkDyF/IgXtp3vmeqxQ/L7JCmywT3jB2xXdHPwZvw59PQyNm w4fjmUUVisdti9z1IyGISsVgxiN3dAVR6DLSzXyRyZT3PZa6+2r4WG8AKxhQtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075626; a=rsa-sha256; cv=none; b=jri2p1E524QDXe3nO1sTHePituHOIXMksuu4E88WO4wxuEzlYasv4r/6Gd6iVCrlAlGyEH oWw4wOLUETfYO4sXBAcPd+Ah44mFtbvt4+6KN4oJQIbP5xO/84C5tZ7+Zbi/eDH9imcLaR YmCtVHu/7vzHSiXeJzVwDq4koWJFcIQrOAdfknCtMHMOxl9KsOH9dpj0+rF+EQnCWDvXFT r4K8AzYEQOXl9tz+6lEgnCTqJ3a3ZUITfanEFEZdTdSnm7KVZF2wNM/FXu79l0Al/ILwJD UDUY9fArV83UDpVRLr6vGJ8kLDrWTieOvLeMLT9A1GSeoAaAA/W/swl2Eky0Xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bchy16J73zCfJ; Wed, 09 Jul 2025 15:40: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 569FePUv008433; Wed, 9 Jul 2025 15:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeP1Y008430; Wed, 9 Jul 2025 15:40:25 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:25 GMT Message-Id: <202507091540.569FeP1Y008430@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: 4af4fefedd1b - main - pf: ignore state update with invalid rtableid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4af4fefedd1bf14b5a27387075edde98744b722e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4af4fefedd1bf14b5a27387075edde98744b722e commit 4af4fefedd1bf14b5a27387075edde98744b722e Author: Kristof Provost AuthorDate: 2025-07-08 11:21:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:07 +0000 pf: ignore state update with invalid rtableid It's possible for a peer to send us a state update with an rtableid we don't support (i.e. >= net.fibs). Drop these updates rather than potentially crashing later by setting an invalid fib number. PR: 287981 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index fdedb9424117..64cc476fb3cb 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -763,6 +763,10 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) __func__, msg_version); } + if (! (st->act.rtableid == -1 || + (st->act.rtableid >= 0 && st->act.rtableid < rt_numfibs))) + goto cleanup; + st->id = sp->pfs_1301.id; st->creatorid = sp->pfs_1301.creatorid; pf_state_peer_ntoh(&sp->pfs_1301.src, &st->src); From nobody Wed Jul 9 15:40:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy33DFmz60ZxM; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy31dlXz3ZHt; Wed, 09 Jul 2025 15:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i1JVXmoukUIxYFi1Bdo3kOSxZ+egSBY3uxPMhcEmLMo=; b=qCZia2qJi52RcCxPWHMbraKfIS8EteoQIY9abknJvB3ZuNM3mhmWxZ4W+rgErUNyDqV/xX u3QStUtqBGWTLDc0JTJ9UVpXo6U0B5wLB3W83oHBaaCR6aZ9svdVuOAvXMfAA4IdHSwfur Hhj8gh1t693jdGAtbjjPBaMgpxclyLKXJJtoKtc1j0I4InXE1RRr7uHU5g1zHIwD+Ar9So nSStGOCdbhGOeimebpmRf3LjlM6WagTA7DwHb3YPKl7TBWdHVkWgqkWNTss3Rlib/QzhCc dhrXGHjybPKTd0E2hDc+BAjCbV0/+ALcTxi9qzo3WA2EmbgPCllNmu3mHeBP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i1JVXmoukUIxYFi1Bdo3kOSxZ+egSBY3uxPMhcEmLMo=; b=sXz22MVGmNaCSZ/Km1pdAFrBIzh7JV/J+zBoHVSALzj1k7OxjcKb8r+oPyEcsAhOl7lxjH SFGX4nPJUjkGsjP0LFHC5SAXEQF5G+r1G7QUbg5S4ZdPx3qzqOYiV4gK3Jm3L+6s1aKi4r IrarNERC6pmdoUAPdh7yq8CAdrgKkzbbEmsQPFJIIQkricBXyPd1F/ou912OxOaCcyRTaV wfwntRUInhyDH0X3j01s+WzZ2zjR2Rlei80WjncXaNri2vgG8hfBryTKAcMgdAQWtRKoVd Qn+H5RPzR+FTkp3BERx6Cx/vsvjze7XCrL2nMfPXWQhyszJPbG2PMFn5CN+TCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075627; a=rsa-sha256; cv=none; b=pOKjsucdggmIrBSg/3+fF+gIpHmI5qUyxS7dVgJIdRYtO8EOGwxn4MC8eeRVkNB7FUJYxN rnPbmen3+DA1klnUloZWKWUNnahmM4l5SIwU20RlI754p3ARdXds0Rc4iO4twmprnvUHz5 K6GMaZd0gNSsss4kauN7pCEw5TvDpoNxmnOqCQVjYc0pRUEoIjtSyLIWEGNGWGeAjr7GOx cOP7PFlVQP2bO1GQx2e2AUeywfIhiKyq6Sqr+aB0X1yI8QoJud+cIBJzhFkPe2JaxVth+8 7F0iZ1450g+b9LQ/4H5Ce0xtmyM5ZjQimdxkpnWKYcfOoDaCEaTX6xvvufatjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bchy26yftzCfK; Wed, 09 Jul 2025 15:40: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 569FeQAr008481; Wed, 9 Jul 2025 15:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeQP5008478; Wed, 9 Jul 2025 15:40:26 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:26 GMT Message-Id: <202507091540.569FeQP5008478@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: f651e87be28d - main - pf tests: sync a state with an rtableid that doesn't exist List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f651e87be28dd6c3f466dc865b1a036089b892ff Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f651e87be28dd6c3f466dc865b1a036089b892ff commit f651e87be28dd6c3f466dc865b1a036089b892ff Author: Kristof Provost AuthorDate: 2025-07-08 15:14:16 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pf tests: sync a state with an rtableid that doesn't exist Create a state with an rtableid (i.e. fib) that doesn't exist on the receiving side. This used to not be handled, and could provoke panics. Create such a situation to ensure we still don't panic. PR: 287981 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/pfsync.sh | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh index 7f545b43a066..3be4a3024393 100644 --- a/tests/sys/netpfil/pf/pfsync.sh +++ b/tests/sys/netpfil/pf/pfsync.sh @@ -835,6 +835,90 @@ basic_ipv6_cleanup() pfsynct_cleanup } +atf_test_case "rtable" "cleanup" +rtable_head() +{ + atf_set descr 'Test handling of invalid rtableid' + atf_set require.user root +} + +rtable_body() +{ + pfsynct_init + + epair_sync=$(vnet_mkepair) + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail one ${epair_one}a ${epair_sync}a + vnet_mkjail two ${epair_two}a ${epair_sync}b + + # pfsync interface + jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up + jexec one ifconfig ${epair_one}a 198.51.100.1/24 up + jexec one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec two ifconfig ${epair_two}a 198.51.100.1/24 up + jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up + jexec two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + + # Make life easy, give ${epair_two}a the same mac addrss as ${epair_one}a + mac=$(jexec one ifconfig ${epair_one}a | awk '/ether/ { print($2); }') + jexec two ifconfig ${epair_two}a ether ${mac} + + # Enable pf! + jexec one /sbin/sysctl net.fibs=8 + jexec one pfctl -e + pft_set_rules one \ + "set skip on ${epair_sync}a" \ + "pass rtable 3 keep state" + # No extra fibs in two + jexec two pfctl -e + pft_set_rules two \ + "set skip on ${epair_sync}b" \ + "pass keep state" + + ifconfig ${epair_one}b 198.51.100.254/24 up + ifconfig ${epair_two}b 198.51.100.253/24 up + + # Create a new state + env PYTHONPATH=${common_dir} \ + ${common_dir}/pft_ping.py \ + --sendif ${epair_one}b \ + --fromaddr 198.51.100.254 \ + --to 198.51.100.1 \ + --recvif ${epair_one}b + + # Now + jexec one pfctl -ss -vv + sleep 2 + + # Now try to use that state on jail two + env PYTHONPATH=${common_dir} \ + ${common_dir}/pft_ping.py \ + --sendif ${epair_two}b \ + --fromaddr 198.51.100.254 \ + --to 198.51.100.1 \ + --recvif ${epair_two}b + + echo one + jexec one pfctl -ss -vv + jexec one pfctl -sr -vv + echo two + jexec two pfctl -ss -vv + jexec two pfctl -sr -vv +} + +rtable_cleanup() +{ + pfsynct_cleanup +} + route_to_common_head() { pfsync_version=$1 @@ -1134,6 +1218,7 @@ atf_init_test_cases() atf_add_test_case "timeout" atf_add_test_case "basic_ipv6_unicast" atf_add_test_case "basic_ipv6" + atf_add_test_case "rtable" atf_add_test_case "route_to_1301" atf_add_test_case "route_to_1301_bad_ruleset" atf_add_test_case "route_to_1301_bad_rpool" From nobody Wed Jul 9 15:40:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy50cnbz60ZxQ; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy41QTXz3ZFP; Wed, 09 Jul 2025 15:40:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3hhDh+gP7qX2X1TGii36UaxNlunHKfy7r3vBfNkDpug=; b=nmd4KRZMuwqHMo/dFAerhPCDOJihNdhJuyJeFoJ9RV392EtiYtwJ0HKE4GAYvqk1brtgAj KkWbMxf/XgaZW36g6GRjzST8U6ihguFeyv0WNl1/2el5eEQzKur3KAjPFpqU0sxngXu8uH QDc6ABsJhHumyXKfWy2hopuMetRfhxUK3oKRnXxKh60uuvlUT9cXyDwjNdn19kY5gd6LtL AxxQKDmX/dX8QZXEw/LC2HZRls42o/JvQTwiK0VbezNBQOHNs2j1qoqPxwJmKxPWSPffKI 427YWqaocWmIluAXuu0q2j40IfJGu8tTfFDMnS84IG832rlCScEtM+Ktp7/aMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3hhDh+gP7qX2X1TGii36UaxNlunHKfy7r3vBfNkDpug=; b=KnVwRRlGzheq7SWS/SxgGXATTcKp99+1z1xBT32K+MgJzemRHsRWgsHzkuBhJ+rkzK+Y29 4nqY3UBSicWmR8s7rI0VhLCitcaPIvAuTz95m3qcgeT/I1HAVAqLuH+eLw/EQcuCWwyHJZ uV9QvNsr4qKeVS3dVboyIJDo0QDo/83LYuGIMlcOYXF34DKBmmtWXcKmJXGgUUSl61hTiP j/sDhmF5mhfNTPrjYCuNX26Bjp4i3zuuVFHeUC1H6LIBpgUyRd8LuIXGsLD16KiTSJecoX 2Uu8f4zYBsXeECssT5Q7uR92IOlezlE+XfDL3O6VAHTj14VGKBeHKlz8WeE84Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075628; a=rsa-sha256; cv=none; b=CsqfQwqXUJgdaeTNi1nOXRrIafl7D+eXkOX8p39OGg0ikb8VNk+VnlbNE39REEnpvXzN0p xXlJHC0uudua3rXHT5Aw214HPNr0yrLhvWasDebOYihcHT2enOwb0B1XWVN0qAaem+1lNX piZGhKSPsqLjAWlpiLae+Xw8VOAf+RN+kRMCdjEvAtkyOqms6VGJOIH7u/E2EEfTKGBIyc Ia8/mxWN+bCBXUfhCp1i2aZzVqCGg4RYMonAV3eQz2daV6IAJn4ex3WexZ1y6fQxf2MsVX T7n4aFDgoDOwi1p5M8VYO1jHp6d8TgjeA5q1Xs+SKqRAGGmVIgV90Tti39sT/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 4bchy40mwCzCfL; Wed, 09 Jul 2025 15:40: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 569FeST0008518; Wed, 9 Jul 2025 15:40:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeSGw008515; Wed, 9 Jul 2025 15:40:28 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:28 GMT Message-Id: <202507091540.569FeSGw008515@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: a4757fbd8cf7 - main - pfsync: log a bad version as a bad version, not a bad action List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: a4757fbd8cf71502b9078b1d8e2a0df34794054f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a4757fbd8cf71502b9078b1d8e2a0df34794054f commit a4757fbd8cf71502b9078b1d8e2a0df34794054f Author: Kristof Provost AuthorDate: 2025-07-08 15:17:39 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pfsync: log a bad version as a bad version, not a bad action Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 64cc476fb3cb..f21bdf15093c 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1087,7 +1087,7 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) msg_version = PFSYNC_MSG_VERSION_1400; break; default: - V_pfsyncstats.pfsyncs_badact++; + V_pfsyncstats.pfsyncs_badver++; return (-1); } From nobody Wed Jul 9 15:40:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy85cH8z60Ztk; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy73ttYz3ZYd; Wed, 09 Jul 2025 15:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uuYnP1QygAP9gYsNpSLA/D0oWpgddNmTEKXMJpLnKS4=; b=q+7q5u6gjEfyask4YPyGtkTUDoT14Qu0kNccewbHbIZUmFsxSIvuhFS6LjSbrRwSRiQwKP A0tMhBtvyJbn3f23htbq6C/SBVoc1IjAwT+m8VloTfl3P2vMKap68TtCAlsQaHSGXhjth3 hkWUYEiAAi9GWh8oJmsPCcgSOJ+E720ygyPjfVu8NZHAnxiExprbG1K5Scigzm4KXUyRan t3oawLllybLloSqyr9sGKPmVgxnwjjZq/bfEa91BgtBkU5V3sEUeddkqj9LqNKTmWyhVuD gkdRAidojByCl+7QsJVv7/rPIu1gR/TDr/4k+2HFhNgn4RQnRCzu1u3AvHCQAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uuYnP1QygAP9gYsNpSLA/D0oWpgddNmTEKXMJpLnKS4=; b=dMd9j/Hfo/E3Utbp4WSQRJuO5aZDn4vMECFsWO9QGGar2CC1Ic2kdNQHAo+LONrfHVWmUj u3l4pf3gTSlV6YEhIm1iwABhbDhy78iNkWdDbPggZAful8N19+uie9pMMf2fkv9YLVP1hH b+MF/Z/O32U+KBrCbvSNOm3rtDxn0c/dsfkqkQTi4HfxHx6UHgiVCUuGIuePxDkf3Hz0mL FnPdteR2DfaRd6zfE1oYmAq3c+AyjAEtDK9G76d/JIUXc05YHnk68yQz5gaV3Q/3KJWoD6 q368xSdIlwDQxOFoQtPZQ/LbD78EhFafZoiRrr7CKCJyEA4YuHLefiXwaQlK0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075631; a=rsa-sha256; cv=none; b=mLMlRzT88Vgnf5FhOp4iCWJQc0erJn8W4usoX4yIUzFrR7uZRew9buGrZmB27ySGzAAx13 8SzjbS88nq51nYeyte95kwILA7IU4vU2gVWk/8xojTDqAmsN9oOCSXQcGa+qSB1OevfUL1 0QGqTPh/+Nh+CA8dd3bsSfdHIH+BqoIcIgyPSK/C1sgw0sO70z19+JvX4lg7hVcdNB//0V IAk3XxfC8E3xtUIfeRwWRD9GPQWBMbyAHhlQSdIdmIwiyvNOacl9iV4g8fczxeBuUTC6hu ILR0KFbmqbWolIJLCQrNQxFw9DWDmpvSvVoP3OtzS4NRRzmUjx6PrSVQlwHzkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bchy735wHzCks; Wed, 09 Jul 2025 15:40: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 569FeV3N008630; Wed, 9 Jul 2025 15:40:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeVFT008626; Wed, 9 Jul 2025 15:40:31 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:31 GMT Message-Id: <202507091540.569FeVFT008626@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: 939aacb60077 - main - pfctl tests: macro test requires pf to be loaded List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 939aacb600776ec11a524c81be85a39527d2d7c8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=939aacb600776ec11a524c81be85a39527d2d7c8 commit 939aacb600776ec11a524c81be85a39527d2d7c8 Author: Kristof Provost AuthorDate: 2025-07-09 14:19:12 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pfctl tests: macro test requires pf to be loaded Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/macro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/pfctl/tests/macro.sh b/sbin/pfctl/tests/macro.sh index 9c48dbbc69f0..071c6cb4f426 100755 --- a/sbin/pfctl/tests/macro.sh +++ b/sbin/pfctl/tests/macro.sh @@ -3,6 +3,7 @@ atf_test_case "space" cleanup space_head() { atf_set descr "Test macros with spaces" + atf_set require.kmods "pf" } space_body() From nobody Wed Jul 9 15:40:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy71HyVz60Zf3; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy56kHGz3ZhC; Wed, 09 Jul 2025 15:40:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fTg04CL1VKAYcgLh1OOI95NXh3Ys6ornKNIMqnpo1vM=; b=LO1901wp4h9YaSoYbNlMgAhmrcaeNXoy8ZuIjpGAvzAjDnZ+DJRUv2FaMyQ0nmiNI+tOiL FNMb4lZ1RCofjxy5nHT1dhdCWWbOfNxx3+pkJRBHNwI4sVNG2s7nneuqX7/lJVPOkztw+7 y2ZyKbcqCuMeGw/h7JvfRe/IWWO7x5TGtx8OQiJlE4O+bu5tII8tOPNfwMRdh+M0OibpM0 322fVvJUYruogZSIKpingewFvhwJxlGQb53H85rfUB6u4jwBvUnXDDrDmg1iwMy4JDAtnx PIUsimBpBGUCbd5lcQtqikzQqDxaeveIDSOzXPW67Glu88YXv0TOsFeOWLJ2rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fTg04CL1VKAYcgLh1OOI95NXh3Ys6ornKNIMqnpo1vM=; b=jb0Jm7BAFwSXwSoylgvIljkkbhcZ/PZq+dO4Owg+YHZPTwS6+mbydUqH3Z65lfcJspxV1f MHZMLkbWGyhJKpZ0EM3EJkuAVBPqXY5xrKgv2QNu2y1NkZaudcfNoVZgIyY9EU5ZEkTuYh OGNyXDCiiV+6Odx6MvQSA0q+MdWsEjwjeN6ZZ0sZnoJcQRgJVibo0AptO3AwGyzo4L+ZMH VpM+qxRInNSMCJYLzZv+A/1PKSRwR912iJdmibxznQlMAjp/WEzHjqnDFc4cjjSHDQQWaT KeKBauZS7koepLukjTh2fdksb4tUiRoLH4r1n+obPEIrt19VSGUn0LHR0ApBTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075630; a=rsa-sha256; cv=none; b=eEvSOtDmWrZCvuamEqIO2VgwmAxCArzaTMO5ADh2ZoG6gedraUHGUZu6qqpwGBOzmtLKbz 7rRM9ERjpNB/D6K9dS9B/+hbKEzWLtcC4KYqMmm+tESF38frH9pJ6xpKMHTWOJLFPakNkB SB594kJWLnTXry41kEOJ8dJM2MRszJo4V9rnsrqz17zyoe5GyMgzpGCmm8XhaZTwPhx3xj QHaV/5J+3ZxmiU360chDE4xc8gpJ5G3hgsHxzybS7zJ7TMKrQICmEyr0OlELiapfxBKtqV /qG7M5jJ46J4BVNmZNc2kGFsQ5Hfw1OCX9OQQrz+xscPG1sZ0Oq6HRWafilZCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bchy514qJzCkr; Wed, 09 Jul 2025 15:40: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 569FeTnI008554; Wed, 9 Jul 2025 15:40:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeTYq008551; Wed, 9 Jul 2025 15:40:29 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:29 GMT Message-Id: <202507091540.569FeTYq008551@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: 4f822ad2854e - main - pfsync: count failed state insertions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4f822ad2854e4434407456757d9c0ba671f120b0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f822ad2854e4434407456757d9c0ba671f120b0 commit 4f822ad2854e4434407456757d9c0ba671f120b0 Author: Kristof Provost AuthorDate: 2025-07-08 15:18:03 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pfsync: count failed state insertions If we fail to import a state, for whatever reason, count this as a bad action. We should not drop states without at least incrementing an error count. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index f21bdf15093c..2391edaf1a5a 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1114,9 +1114,8 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) continue; } - if (pfsync_state_import(sp, flags, msg_version) == ENOMEM) - /* Drop out, but process the rest of the actions. */ - break; + if (pfsync_state_import(sp, flags, msg_version) != 0) + V_pfsyncstats.pfsyncs_badact++; } return (total_len); From nobody Wed Jul 9 15:40:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy76dR0z60ZXN; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy64FfVz3ZWF; Wed, 09 Jul 2025 15:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgXjNIvM81MdEMIiI3cCkd9syHituudFA9R5ZS6ymwI=; b=Nr+S0n7K2bXV4h3GZeYkxokwR0n3F11j7KsUatPjzd2HPnl6s46xA8jcUV6SwifydrSsWm fdS3n+a07Xl6YNemHhf19olUShAYhITviJiUWRFjbj7zxa+jWUMxUtMPSq8YVmYYKCSfAp k/6j2aP4wqWMgr5KJiieOAMSnsOUyEU2iCdeuHhL8zAV0GL0UfijEAdmwPWNEJQToPyonQ hLp5fP5bYHDkA3DkvAqgYedojHHSn1XfjdDkkssP8XhSir129eVFUwW83/5w7vBSb27GC5 yx8zCuYHanSjV+kdMr962w863GB2+6xMH31QL4vUyxF0VSK69MGjq0gcKnnlaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgXjNIvM81MdEMIiI3cCkd9syHituudFA9R5ZS6ymwI=; b=KdUMwRtp3PrNnBbbGUXvNmFeM4G0DBo5tmxN6y8HIX+qlocm23aPRCmKv6nHQjE8STCKks r1/n8bfpPP3puH+Kua4Eqz+v8yzDGJKDCQgeSgHeIw1jyuWp0esfsDXr/GuFqg3O//+OP0 2fl1W9lwKbDBXLKfHQqG2NVRPOqrwvWQw8WDjCVFJMAr/88HxMK18O8ATSZvhggIpsZ4p2 Ta+IyGBjhYJnEblHBvI8MnOqTb/f59Nwaf1FdeGScbk0bdbP2LHRPpOUSzUV81fFvcFmys r2NqC2wb3jEX86VXrdZ9MxsVwHMvCL9R6jWWNS3mfa+i+iUgurJmT4quO1IlRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075630; a=rsa-sha256; cv=none; b=LdRGKDaCfzqYA3+HWC4wTd+CRW8mGjlCAVXyKc/gYgr5rh2GZ8nDlr5B1MGwxuPL3lYTCk xPGEC/h8Kjohp2+BESMPfGyx9j9+mj+v/1V4TQxPbVTObXSfODUY/nCF7WbGEHQ3wsA9xi ugZKyAbLzblwItq0/Jc2HaNSxdQRuQDo4WNVZaExpEqOBFBmtu7uQvDWEt9R4Q/MgSiJ5v CF0Bzvpcle6PDhbIxRwpb1zXrbjPEkqphwnWZUq0wFbAyQkyXNVDPW6Nd6ELUMwpK/TcA2 C+5lkhKCiifTYYk35KfWQMv/zDzdoiqBbh+DCofLNtPYXAOKZCw9r1bK8srsvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bchy62N0hzCfM; Wed, 09 Jul 2025 15:40: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 569FeU4g008590; Wed, 9 Jul 2025 15:40:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeUg7008587; Wed, 9 Jul 2025 15:40:30 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:30 GMT Message-Id: <202507091540.569FeUg7008587@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: 9c95fcb7cd20 - main - tests: Get the MAC from the epairs. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9c95fcb7cd20bdb0e9445ec98a06d24ce0d5d2ac Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9c95fcb7cd20bdb0e9445ec98a06d24ce0d5d2ac commit 9c95fcb7cd20bdb0e9445ec98a06d24ce0d5d2ac Author: Ronald Klop AuthorDate: 2025-07-09 08:00:19 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 tests: Get the MAC from the epairs. This removes knowledge of the implementation of if_epair. Makes it easier to modify if_epair in future commits. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D51205 --- tests/atf_python/sys/net/vnet.py | 8 ++++++-- tests/sys/netpfil/pf/header.py | 23 +++++++++++------------ tests/sys/netpfil/pf/icmp.py | 10 +++++----- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index 68c8ce4e0cba..7afb5c721bf3 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -61,6 +61,7 @@ class VnetInterface(object): self.iftype = self.IFT_LOOP else: self.iftype = self.IFT_ETHER + self.ether = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % iface_name).rstrip() @property def ifindex(self): @@ -99,9 +100,12 @@ class VnetInterface(object): name = run_cmd("/sbin/ifconfig {} create".format(iface_name)).rstrip() if not name: raise Exception("Unable to create iface {}".format(iface_name)) - ret = [cls(alias_name, name)] + if1 = cls(alias_name, name) + ret = [if1] if name.startswith("epair"): - ret.append(cls(alias_name, name[:-1] + "b")) + if2 = cls(alias_name, name[:-1] + "b") + if1.epairb = if2 + ret.append(if2); return ret def setup_addr(self, _addr: str): diff --git a/tests/sys/netpfil/pf/header.py b/tests/sys/netpfil/pf/header.py index 6832cfe6d42b..a5e36bc85d14 100644 --- a/tests/sys/netpfil/pf/header.py +++ b/tests/sys/netpfil/pf/header.py @@ -53,10 +53,9 @@ class TestHeader(VnetTestTemplate): def test_too_many(self): "Verify that we drop packets with silly numbers of headers." - sendif = self.vnet.iface_alias_map["if1"].name + sendif = self.vnet.iface_alias_map["if1"] recvif = self.vnet.iface_alias_map["if2"].name - gw_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) - gw_mac = re.sub("0a$", "0b", gw_mac) + gw_mac = sendif.epairb.ether ToolsHelper.print_output("/sbin/route add default 192.0.2.1") @@ -67,7 +66,7 @@ class TestHeader(VnetTestTemplate): pkt = sp.Ether(dst=gw_mac) \ / sp.IP(dst="198.51.100.3") \ / sp.ICMP(type='echo-request') - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -89,7 +88,7 @@ class TestHeader(VnetTestTemplate): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=1, payloadlen=1) / sp.ICMP(type='echo-request') - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) found = False @@ -109,7 +108,7 @@ class TestHeader(VnetTestTemplate): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=1, payloadlen=1) / sp.ICMP(type='echo-request') - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -148,10 +147,10 @@ class TestHeader6(VnetTestTemplate): "Verify that we drop packets with silly numbers of headers." ToolsHelper.print_output("/sbin/ifconfig") - sendif = self.vnet.iface_alias_map["if1"].name + sendif = self.vnet.iface_alias_map["if1"] recvif = self.vnet.iface_alias_map["if2"].name - our_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) - gw_mac = re.sub("0a$", "0b", our_mac) + our_mac = sendif.ether + gw_mac = sendif.epairb.ether ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") @@ -162,7 +161,7 @@ class TestHeader6(VnetTestTemplate): pkt = sp.Ether(src=our_mac, dst=gw_mac) \ / sp.IPv6(src="2001:db8::2", dst="2001:db8:1::3") \ / sp.ICMPv6EchoRequest() - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -182,7 +181,7 @@ class TestHeader6(VnetTestTemplate): for i in range(0, 18): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=58, payloadlen=1) / sp.ICMPv6EchoRequest() - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -202,7 +201,7 @@ class TestHeader6(VnetTestTemplate): for i in range(0, 19): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=58, payloadlen=1) / sp.ICMPv6EchoRequest() - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) diff --git a/tests/sys/netpfil/pf/icmp.py b/tests/sys/netpfil/pf/icmp.py index 83096886691e..59f2e8190b30 100644 --- a/tests/sys/netpfil/pf/icmp.py +++ b/tests/sys/netpfil/pf/icmp.py @@ -91,10 +91,10 @@ class TestICMP(VnetTestTemplate): def test_inner_match(self): vnet = self.vnet_map["vnet1"] dst_vnet = self.vnet_map["vnet3"] - sendif = vnet.iface_alias_map["if1"].name + sendif = vnet.iface_alias_map["if1"] - our_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) - dst_mac = re.sub("0a$", "0b", our_mac) + our_mac = sendif.ether + dst_mac = sendif.epairb.ether # Import in the correct vnet, so at to not confuse Scapy import scapy.all as sp @@ -111,7 +111,7 @@ class TestICMP(VnetTestTemplate): / sp.IP(src="192.0.2.2", dst="198.51.100.2") \ / sp.ICMP(type='echo-request') \ / "PAYLOAD" - sp.sendp(pkt, sendif, verbose=False) + sp.sendp(pkt, sendif.name, verbose=False) # Now try to pass an ICMP error message piggy-backing on that state, but # use a different source address @@ -120,7 +120,7 @@ class TestICMP(VnetTestTemplate): / sp.ICMP(type='dest-unreach') \ / sp.IP(src="198.51.100.2", dst="192.0.2.2") \ / sp.ICMP(type='echo-reply') - sp.sendp(pkt, sendif, verbose=False) + sp.sendp(pkt, sendif.name, verbose=False) try: rcvd = self.wait_object(dst_vnet.pipe, timeout=1) From nobody Wed Jul 9 15:40:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bchy93cyKz60Ztr; Wed, 09 Jul 2025 15:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy85KZdz3ZfT; Wed, 09 Jul 2025 15:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G6UeIaq0PuqGPoLiNnYNhrtrckgLAjFNwm6RrIhmExg=; b=NalxTuBWn6vS24sfZwBS/9brYOLqXFmTQL7Q10Dr7ZAQlX/J2XlcMwwdouiagvXg1QVR+9 j+FZj2gSCW8y0kbyHaRU/O6KIduzyDYIB8PsPHo8KlslisFY1LY84bcMLWuHDVAOtgr3Ef iBuspTbpwAZJJ5jqndB/5fqPtTUHt/MqE005FTKbHh/jgxlMcdOjvbCyLeo+QOJmhpt+0k Rvdcin/L8q+jLYfRk3OYviKAJsEygfZnFlH49yP+54D8kCXyq3Lqr9ZxsYK40Ig78Rq1At B4oVRUun+F2ZhIzeLgSiCIsaMjnuowow41h3W/umzBg8zys/6nJQl8smn8OlGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G6UeIaq0PuqGPoLiNnYNhrtrckgLAjFNwm6RrIhmExg=; b=F2wwSepRNfI9h50rkN4kr0BY3YV/XIDmVj4pnMxlPBvloEENJ66lZ+4YCuQwhVQCLkuSte QN7Dl07IIi/3GIGSzHLY2MNRUjPB+cpnBXeSHZFslAzi+/BZzc5k8RZjvP8vC+viFHssal xHk/qy6CNR7r4nLpsG6YlfvBHCLjNfq1/ZiM/mrvtimjUfz0YTG8Y4ygOSuBPUCq5u8wdP 8jdFQj4xL6KdeT2hN/dEPApIaJcnGV8Um3gBgOWTl7c70jgnEKVg2YhA6YKcqBc6bLLl54 0ShrlmvHv8/5HYTJFygkkL55+ldgRvWaFgqiVNI7umSLMZsTOPWdN9bSfVE5Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075632; a=rsa-sha256; cv=none; b=w7/5xQ4mOG5Ja8sW8bivfIBujD6/i2WdwW3qQ+TcWnQq87dymIz3Ue9XPJ9VqxerASKfa4 mxK2ll4483FlIvbZxwE+97QpIQBpLMNsqWXgAzD86Eb8ABxYexeFoTAML07nR+ZwgpML5F y9vSraIkX1+L9LTxJ/MLONtQ3INbcD+dVNT1YkVaBZTbDJwyLq6WySgPAWcVDPYc7RdcVX zaxdwWffCj1M9Qgus3NSFDhBLaDY3XgS1AU0EgVYmd0g1oNCw8w2vkVKFGxp4u4V3oZ1jJ t1jQHR3wmHh59ai1ntE5hYM2qeW5DTXcQsBZJV4LdKh2cPOVe1bzbP2kkam3jQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bchy83SSqzCGn; Wed, 09 Jul 2025 15:40: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 569FeWfK008666; Wed, 9 Jul 2025 15:40:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeWtQ008663; Wed, 9 Jul 2025 15:40:32 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:32 GMT Message-Id: <202507091540.569FeWtQ008663@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: 68fe0d9cc03b - main - pfctl tests: use require.kmods instead of manual check for pf List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 68fe0d9cc03bd80f63a5317a633d2426ae286316 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=68fe0d9cc03bd80f63a5317a633d2426ae286316 commit 68fe0d9cc03bd80f63a5317a633d2426ae286316 Author: Siva Mahadevan AuthorDate: 2025-07-08 15:14:48 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:09 +0000 pfctl tests: use require.kmods instead of manual check for pf Reviewed by: kp Signed-off-by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1762 --- sbin/pfctl/tests/pfctl_test.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/sbin/pfctl/tests/pfctl_test.c b/sbin/pfctl/tests/pfctl_test.c index dbdcaa4900ea..5f0aa7826bb4 100644 --- a/sbin/pfctl/tests/pfctl_test.c +++ b/sbin/pfctl/tests/pfctl_test.c @@ -65,24 +65,6 @@ * Copied from OpenBSD. */ -static bool -check_pf_module_available(void) -{ - int modid; - struct module_stat stat; - - if ((modid = modfind("pf")) < 0) { - warn("pf module not found"); - return false; - } - stat.version = sizeof(struct module_stat); - if (modstat(modid, &stat) < 0) { - warn("can't stat pf module id %d", modid); - return false; - } - return (true); -} - extern char **environ; static struct sbuf * @@ -185,9 +167,6 @@ run_pfctl_test(const char *input_path, const char *output_path, struct sbuf *expected_output; struct sbuf *real_output; - if (!check_pf_module_available()) - atf_tc_skip("pf(4) is not loaded"); - /* The test inputs need to be able to use relative includes. */ snprintf(input_files_path, sizeof(input_files_path), "%s/files", atf_tc_get_config_var(tc, "srcdir")); @@ -292,6 +271,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) ATF_TC_HEAD(pf##number, tc) \ { \ atf_tc_set_md_var(tc, "descr", descr); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(pf##number, tc) \ { \ @@ -301,6 +281,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) ATF_TC_HEAD(selfpf##number, tc) \ { \ atf_tc_set_md_var(tc, "descr", "Self " descr); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(selfpf##number, tc) \ { \ @@ -312,6 +293,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) ATF_TC_HEAD(pf##number, tc) \ { \ atf_tc_set_md_var(tc, "descr", descr); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(pf##number, tc) \ { \ @@ -325,6 +307,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) atf_tc_set_md_var(tc, "descr", descr); \ atf_tc_set_md_var(tc, "execenv", "jail"); \ atf_tc_set_md_var(tc, "execenv.jail.params", "vnet"); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(pf##number, tc) \ { \ From nobody Wed Jul 9 16:00:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcjNk5FSCz60c9H; Wed, 09 Jul 2025 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcjNk33Ggz3n39; Wed, 09 Jul 2025 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqy+XS4n6RL7eDR8af6928wUYtRglh8vM+ZBV36a+Qo=; b=NG2fHHPfSakCOVz4BYWU/MgBVgogrwjrqw6oQkJA4Jh7ineMnvofV9tWFw3mfdZnpca3p0 cA5CGRABOX7USRsjs7Tp3xavOa52B+p6JCQGcHL1ag3pxk2ptRuQmGjnP4Fw9IKEerdKVx X+/Q45oBw6S8v76WJyZEt75K/6EXM4A2d2dju0SNdZUNmdb87yVLqcPwUTQ8aoXOt4DmPK c0F3FCKlvP3eTzNLbN2tz0iIqquTRCqUq4HtEfseRKzVMbTjZBcIToWiRwieUSvQrV+S/a b38jyl2qED05/cGvRwfBjBFhNNCxi653/nDiP+hwtTGM8GFwWXfMd8yp5rRisw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqy+XS4n6RL7eDR8af6928wUYtRglh8vM+ZBV36a+Qo=; b=r/tCdSM0eG88Siv6FH0dXKT4C1yt3Kse8RRxGIShxfrDGj5rFdLRv6UvpcTUd5C+tD1kdS 0xya/W5zCZ3hSKy6Qn/WAjqM4GfVrIQurHztHot67vmCjVAkFAAAuevg9MElyOipVttU51 vflHNnVuTI7GK/gEDSbO8feNqkWafRlgifKlZypjeXOptBL6+urb7rOiCqepuOKX3WldOX iC+Gw9TvZAHB3VUxyirB6doEyxN1tH+9fx71jVkTRrMWAvUHyZ7uptdUUdGsiW8eXNYbPF AmTVWePq0C89u/oaeqqB66xy/G0sBca6PCNDecQJA5GliY+2D4oo7Hice56Zkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752076806; a=rsa-sha256; cv=none; b=BRmxHFuYeSfg5Fw65V+DZJGZHJFD0HPdIqLv9n2z+OpakgGV4pNX0mdlCQ1idU0K4iPZtg wGbUUhMZ7sMdCwClHuNZndGf6u8tHLDoMJXNczEJhMS5PWRq0xU1BbqGkHyGc8iYhCXUHZ GPVkL0bf+i1AR5WneafcxEKuXLtvXMScqqrjfmE2naY/MUW4KJDaU1n/oQUqQOz7h3+GSC dnCwQU6x47pwTenii1Tygq35+blbRGOYAOIo2P/JM5Pzfa0agoSXaIHe60UDAFo4mbMWA9 miH5dWV80Nl94DInhrsQrSShe9T4HzqQxZf5puFKHwn0L/mZD43xmYmo07R06Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcjNk225JzCgk; Wed, 09 Jul 2025 16:00: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 569G06tX042242; Wed, 9 Jul 2025 16:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569G06jc042237; Wed, 9 Jul 2025 16:00:06 GMT (envelope-from git) Date: Wed, 9 Jul 2025 16:00:06 GMT Message-Id: <202507091600.569G06jc042237@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: bc2e3360107a - main - hwt(4): Add initial man page. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: bc2e3360107af28fed7157d18605bd038f07e16c Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=bc2e3360107af28fed7157d18605bd038f07e16c commit bc2e3360107af28fed7157d18605bd038f07e16c Author: Ruslan Bukin AuthorDate: 2025-07-09 15:41:51 +0000 Commit: Ruslan Bukin CommitDate: 2025-07-09 15:57:07 +0000 hwt(4): Add initial man page. Reviewed by: ziaee Sponsored by: UKRI Differential Revision: https://reviews.freebsd.org/D51192 --- share/man/man4/Makefile | 12 ++++ share/man/man4/hwt.4 | 142 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4f12e70f2ae4..7c8a8f3afc45 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -213,6 +213,7 @@ MAN= aac.4 \ ${_hv_vmbus.4} \ ${_hv_vss.4} \ hwpmc.4 \ + ${_hwt.4} \ ${_hwpstate_intel.4} \ i2ctinyusb.4 \ iavf.4 \ @@ -926,6 +927,17 @@ _vmm.4= vmm.4 .endif .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +_hwt.4= hwt.4 +.if ${MACHINE_CPUARCH} == "amd64" +MLINKS+=hwt.4 intel_pt.4 +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +MLINKS+=hwt.4 coresight.4 +MLINKS+=hwt.4 spe.4 +.endif +.endif + .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "aarch64" _gve.4= gve.4 diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 new file mode 100644 index 000000000000..7bc8ed4b396d --- /dev/null +++ b/share/man/man4/hwt.4 @@ -0,0 +1,142 @@ +.\" +.\" Copyright (c) 2025 Ruslan Bukin +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd July 7, 2025 +.Dt HWT 4 +.Os +.Sh NAME +.Nm hwt +.Nd Hardware Trace Framework +.Sh SYNOPSIS +.Cd "options HWT_HOOKS" +.Cd "device hwt" +.Pp +At least one of: +.Cd "device intel_pt" +.Pq amd64 +.Cd "device coresight" +.Pq arm64 +.Cd "device spe" +.Pq arm64 +.Pp +In +.Xr rc.conf 5 : +.Cd kld_list="hwt" +.Sh DESCRIPTION +The +.Nm +framework provides infrastructure for hardware-assisted tracing. +It collects detailed information about software execution and stores it as +events in highly compressed format into DRAM. +The events cover information about control flow changes of a program, whether +branches taken or not, exceptions taken, timing information, cycles elapsed and +more. +The information collected allows to reconstruct entire program flow of a given +application without noticeable performance impact. +.Sh HARDWARE +The framework supports several tracing technologies found on +.Cd arm64 +and +.Cd amd64 +systems: +.Pp +.Bl -bullet -compact +.It +ARM Coresight +.It +ARM Statistical Profiling Extension (SPE) +.It +Intel Processor Trace (PT) +.El +.Pp +The +.Nm +framework supports two modes of operation: +.Bl -tag -width "Thread mode" +.It Em CPU mode +Capture CPU activity in kernel mode. +.It Em Thread mode +Capture activity of each of a process's threads in user mode. +.El +.Sh MANAGEMENT +When loaded into kernel, the +.Nm +framework provides +.Pa /dev/hwt +character device. +The only +.Xr ioctl 2 +request it accepts is +.Dv HWT_IOC_ALLOC . +This request allocates kernel tracing context (CTX) based on requested mode of +operation, set of CPUs and/or pid. +.Pp +Upon successfull CTX allocation, the ioctl returns a CTX identification +number (ident). +.Pp +Each CTX is then managed using its own dedicated character device found at +.Pa "/dev/hwt_${ident}_${d}", +where ident is a unique identification number of tracing context, d is either +cpu_id (in HWT CPU mode) or process pid (in HWT Thread mode). +.Sh HOOKS +During tracing of a target process, HWT records runtime events such as threads +creation, exec and mmap system calls. +These events are logged as "records" within a particular CTX associated with +traced process. +.Pp +Additionally, HWT can suspend the target thread upon exec or mmap system calls +if requested by the user. +This pause allows user-space tools to retrieve the records and adjust tracing +settings before execution continues. +This feature is especially useful when address range filtering is enabled, +allowing tracing of specific functions within the target executable or a +dynamic library. +.Sh KERNEL OPTIONS +The following options in the kernel configuration file are mandatory and +related to +.Nm +operation: +.Pp +.Bl -tag -width ".Dv HWT_HOOKS" -compact +.It Dv HWT_HOOKS +Enable kernel hooks. +.El +.Sh IOCTL INTERFACE +Once a CTX is allocated, it's management character device accepts several IOC +requests: +.Bl -tag -width "HWT_IOC_RECORD_GET" +.It Dv HWT_IOC_START +Start tracing. +In HWT CPU mode the tracing does actually start with this +.Xr ioctl 2 +request. +In the Thread mode, the tracing "running" flag set, but tracing begins after +scheduler switches the target thread onto CPU and return to user mode. +.It Dv HWT_IOC_STOP +Stop tracing of the particular CTX. +.It Dv HWT_IOC_RECORD_GET +Copy all or part of records collected during hook invocation and associated +with this CTX to userspace. +.It Dv HWT_IOC_BUFPTR_GET +Get current pointer in buffer that is filled by tracing units in real-time. +.It Dv HWT_IOC_SET_CONFIG +Set achitecture-specific config (optional). +.It Dv HWT_IOC_WAKEUP +Wake up a thread that has been put to sleep by HWT framework hooks. +.It Dv HWT_IOC_SVC_BUF +For SPE-only, the kernel is waiting for userspace to notify that it's copied +out a buffer to avoid data loss/overwriting buffers. +.El +.Sh SEE ALSO +.Xr hwt 8 +.Sh HISTORY +The +.Nm +framework first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An Ruslan Bukin Aq Mt br@FreeBSD.org +.An Bojan Novkoviฤ‡ Aq Mt bnovkov@freebsd.org +.An Zachary Leaf Aq Mt zachary.leaf@arm.com From nobody Wed Jul 9 17:09:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bckxJ1713z60hPZ; Wed, 09 Jul 2025 17:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bckxH5TKSz4HH3; Wed, 09 Jul 2025 17:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lEYsV2Job5WQNm3Q9hGohjEAzWOBGeBx2XkWCBiBlQ=; b=gGdhs8yx/p41G3mijMLdQUxDGFstVUse3bD7mhuJ2ozYzVYmDhFBUpBUIDbNbpdq+2+Hzz HFAZQpgKh5oRu57Dl0eP09x6dERj9XZmqLzx2dBv2qfvY/msZPU90LkmD889LPcMXSLjZz NIwL6gHVkcUHz5gKWClkXStxyeNVn24N/88t/w2F4Le3s9QZ15EGL72g7nmYOK3X5wrwh3 i308qBsYj9gDS1CPs9CS+Jb6wC8YzbPV/DhYNyRv/s4EAk5WGwTzzoIyJHb2zzvPXJTZGF VsX8UbEe0qDx/qBCZWpChfVJ7h55PXgJa6d43hYTxmNt2T/NViD4KpvR4py5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lEYsV2Job5WQNm3Q9hGohjEAzWOBGeBx2XkWCBiBlQ=; b=R0fJwV9yEgh4sYy//ENBVHOCURtrmDQt54PrAQl1NcMu86TE5rXwT3CVRmCPZG5Mqm05Re 0zmOUsq3a3HvtDbYeyc/m7/r78GCgDMUWKNVKlUJDEka08qRjgVYN/iQNxxvgnIAEkefzc mbKYZvGSmWLcckc8QB9BfrOSSokhV1RSXAkfrYMmt17exBCtYPf12JkgStAy65ttMN+bL6 PXU5HWHyRoZAqHJjpBVGw2gXlzhNS6FpMp/SE6Map+EFrUBziMH31ygzJdk8qmyPFrV5GC 2awA+eDWPU8itQ6un7E/RSmxbTrOHyOkJG45GcN5fZKZnOI1IaghCYLM+E37Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752080995; a=rsa-sha256; cv=none; b=IT7jX6M8vKWElLv9EJATlV6/St6vT9zw6armpD89VXNUMelCFRpq2I/IkbKJCibN0siftk W0ACPvl0j71601OS6TfW97I6jiYf7bWbiXLVDPTjZlcgmfu/wWdkY/MZA4EvUcnhs4Rgwj 4KzSKaDQhnepTNED5BZbx+BUIw6wBMrRMqQomp6V1UWqOZBPdtEttVH2C4r7iNLIv+OGx+ iRbdjQyie/ZmKrf6WAKEadtZ6wJWwSCvTF1TH4/0dcHVfwrnHv9ym/jhk7Ej0hJDnkjQj5 lNseUc945UbHZ0UIxQcilRYIplkQ6nOgbg2GE1Q+SkKJKIdt3j1xL1YkiTwlWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bckxH4w3vzWqj; Wed, 09 Jul 2025 17:09: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 569H9tLb072781; Wed, 9 Jul 2025 17:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569H9tFk072778; Wed, 9 Jul 2025 17:09:55 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:09:55 GMT Message-Id: <202507091709.569H9tFk072778@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: 2d6b33f801d5 - main - cp: Add an option to visit sources in order. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2d6b33f801d5352b8e078db83f6c90f6fe8291bb Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2d6b33f801d5352b8e078db83f6c90f6fe8291bb commit 2d6b33f801d5352b8e078db83f6c90f6fe8291bb Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 17:06:07 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 17:07:13 +0000 cp: Add an option to visit sources in order. This adds a --sort option which makes cp pass a comparison function to FTS, ensuring that sources are visited and traversed in a predictable order. This will help make certain test cases more reliable. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51214 --- bin/cp/cp.1 | 12 ++++++++++++ bin/cp/cp.c | 14 ++++++++++++-- bin/cp/tests/cp_test.sh | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 6edc8e403acd..5231fa72621c 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -184,6 +184,18 @@ If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. +.It Fl -sort +Visit and traverse sources in (non-localized) lexicographical order. +Normally, +.Nm +visits the sources in the order they were listed on the command line, +and if recursing, traverses their contents in whichever order they +were returned in by the kernel, which may be the order in which they +were created, lexicographical order, or something else entirely. +With +.Fl -sort , +the sources are both visited and traversed in lexicographical order. +This is mostly useful for testing. .It Fl s , Fl -symbolic-link Create symbolic links to regular files in a hierarchy instead of copying. .It Fl v , Fl -verbose diff --git a/bin/cp/cp.c b/bin/cp/cp.c index a1b62084a790..38fe65399d06 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -71,7 +71,7 @@ static char dot[] = "."; #define END(buf) (buf + sizeof(buf)) PATH_T to = { .dir = -1, .end = to.path }; bool Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; -static bool Hflag, Lflag, Pflag, Rflag, rflag; +static bool Hflag, Lflag, Pflag, Rflag, rflag, Sflag; volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; @@ -96,6 +96,7 @@ static const struct option long_opts[] = { "symbolic-link", no_argument, NULL, 's' }, { "verbose", no_argument, NULL, 'v' }, { "one-file-system", no_argument, NULL, 'x' }, + { "sort", no_argument, NULL, SORT_OPT }, { 0 } }; @@ -167,6 +168,9 @@ main(int argc, char *argv[]) case 'x': fts_options |= FTS_XDEV; break; + case SORT_OPT: + Sflag = true; + break; default: usage(); } @@ -284,6 +288,12 @@ main(int argc, char *argv[]) &to_stat))); } +static int +ftscmp(const FTSENT * const *a, const FTSENT * const *b) +{ + return (strcmp((*a)->fts_name, (*b)->fts_name)); +} + static int copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) { @@ -327,7 +337,7 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) } level = FTS_ROOTLEVEL; - if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL) + if ((ftsp = fts_open(argv, fts_options, Sflag ? ftscmp : NULL)) == NULL) err(1, "fts_open"); for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 6adbc45c5009..3c3dd309b9e4 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -657,7 +657,7 @@ unrdir_body() atf_check \ -s exit:1 \ -e match:"^cp: src/b: Permission denied" \ - cp -R src dst + cp -R --sort src dst atf_check test -d dst/a atf_check cmp src/a/f dst/a/f atf_check test -d dst/b @@ -681,7 +681,7 @@ unrfile_body() atf_check \ -s exit:1 \ -e match:"^cp: src/b: Permission denied" \ - cp -R src dst + cp -R --sort src dst atf_check test -d dst atf_check cmp src/a dst/a atf_check test ! -e dst/b From nobody Wed Jul 9 17:09:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bckxG5dTcz60hYD; Wed, 09 Jul 2025 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bckxG4xvmz4H3t; Wed, 09 Jul 2025 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dB84tqXdgKpwFNZRiRVVWW5thylgmAi5EmhBnQPZnQI=; b=icjhlkctQDOdInwkGUOqXyR6hRDfe3Wtg93rQqjcbQ7KAWNpO4lTe5DlODbQH5udAAdsWV dRHsrmQOvzpnG8EW6sDUyp76gSZh8qalI2x+s/4o+RYiX3JRESEYAfFlY6fUmONzNpgzYY t7sW6KbV1KcuM2JDcgdbIjxjuif5cCOvfNxt6m2PqeschG6w57toYpTOt1AU06/U9Kt4xb 6WrQIIjVKf/CU4TeVId7UGmIzgwFjAnd5zgWRjnwayqNIpU/4zp/sBopVUB0ofaaM4cEJ/ NFl+BesnC8FMx5izKHmg0Fz9K4u9Ktj42UHi6iUuNNweVKaswOONbA/Cvt7HHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dB84tqXdgKpwFNZRiRVVWW5thylgmAi5EmhBnQPZnQI=; b=GPtujN8+t547LC1XVNcioAwcG6jKoUgp7NnQ0w8tk4LFUfaxbUfhIVCt/jrhEQ/8Ifusae /OW44qfaUldYz3e8cItB3m9/FvvtNVYY4Gv8BhWv+khOj2qo2MToXLTcJ4ZGAsgqE9Rc94 SBSGR8l7vAEVJOuWHGrdO5exRc39TWoqF9ipMUjy8bp5JfB1yF+ICVJAZnpbu5SLoWLE2h uFfJeUCB6qcTC4KuSGnUYslUsWCXVpsEsBGB4QE8AKqlQyB2feM/AfR142RPcwFoHwETDh Li2zCrwljbfKaoODl71HFNoCVCFgW2wjR09kL5bI1d7gJ4gGVP6E9EC1kksgsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752080994; a=rsa-sha256; cv=none; b=i/DJEXHRfmSv2A7LsCWnw1NGED2XskzBptRDYJ6VR42svE9NaJ2yQopsuUQV7s9NH0RiWH BRrOrSOXA43dQr4cuf/Y+wGZcoLb0/Lsjce3I8Jv1JKceyiOE10N2y5s6GoO+8CxZU3SIL Rivn2lUqxF5gr0i4AUbAX2e4vyqhXhQeDPxyWbBLfF0fb5qdPI5+aUcNVFNFSV/ztlJpgM 3Awsw4RAciStnSmPmcrBJc/YPN/ah7IN+idDmwFc0AzejfY45Xup0c8yiYFrIMwCdmDOzN 0w8257h3xObyPxzkuwshz4uc+g3zxgIh8w2MHTqwTDGexjWh1R7vwT2ayp0P7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bckxG4L04zWHp; Wed, 09 Jul 2025 17:09: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 569H9sow072737; Wed, 9 Jul 2025 17:09:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569H9sqA072735; Wed, 9 Jul 2025 17:09:54 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:09:54 GMT Message-Id: <202507091709.569H9sqA072735@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: c3efa16dc9bc - main - cp: Add GNU-compatible long options. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c3efa16dc9bcdcbe128c6b3c4b000867bbaf7991 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c3efa16dc9bcdcbe128c6b3c4b000867bbaf7991 commit c3efa16dc9bcdcbe128c6b3c4b000867bbaf7991 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 17:05:54 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 17:07:13 +0000 cp: Add GNU-compatible long options. While here, fully switch boolean variables from int to bool, and clean up the manual page a little. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51213 --- bin/cp/cp.1 | 39 +++++++++++-------------- bin/cp/cp.c | 78 +++++++++++++++++++++++++++++++------------------ bin/cp/extern.h | 2 +- bin/cp/tests/cp_test.sh | 16 ++++++++++ bin/cp/utils.c | 4 +-- 5 files changed, 86 insertions(+), 53 deletions(-) diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 2856391a029e..6edc8e403acd 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 28, 2024 +.Dd July 9, 2025 .Dt CP 1 .Os .Sh NAME @@ -84,16 +84,16 @@ If the .Fl R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.) -.It Fl L +.It Fl L , Fl -dereference If the .Fl R option is specified, all symbolic links are followed. -.It Fl P +.It Fl P , Fl -no-dereference No symbolic links are followed. This is the default if the .Fl R option is specified. -.It Fl R +.It Fl R , Fl -recursive If .Ar source_file designates a directory, @@ -121,11 +121,11 @@ If you need to preserve hard links, consider using or .Xr pax 1 instead. -.It Fl a +.It Fl a , Fl -archive Archive mode. Same as .Fl RpP . -.It Fl f +.It Fl f , Fl -force For each existing destination pathname, remove it and create a new file, without prompting for confirmation regardless of its permissions. @@ -136,10 +136,8 @@ option overrides any previous or .Fl n options.) -.It Fl i -Cause -.Nm -to write a prompt to the standard error output before copying a file +.It Fl i , Fl -interactive +Write a prompt to the standard error output before copying a file that would overwrite an existing file. If the response from the standard input begins with the character .Sq Li y @@ -153,13 +151,13 @@ option overrides any previous or .Fl n options.) -.It Fl l +.It Fl l , Fl -link Create hard links to regular files in a hierarchy instead of copying. .It Fl N When used with .Fl p , suppress copying file flags. -.It Fl n +.It Fl n , Fl -no-clobber Do not overwrite an existing file. (The .Fl n @@ -169,9 +167,7 @@ or .Fl i options.) .It Fl p -Cause -.Nm -to preserve the following attributes of each source +Preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, ACL, user ID, and group ID, as allowed by permissions. .Pp @@ -188,14 +184,13 @@ If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. -.It Fl s +.It Fl s , Fl -symbolic-link Create symbolic links to regular files in a hierarchy instead of copying. -.It Fl v -Cause -.Nm -to be verbose, showing files as they are copied. -.It Fl x -File system mount points are not traversed. +.It Fl v , Fl -verbose +Be verbose, showing both the source and destination path of each file +as is copied. +.It Fl x , Fl -one-file-system +Do not traverse file system mount points. .El .Pp For each destination file that already exists, its contents are diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 7e97715c3ef4..a1b62084a790 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -69,8 +70,8 @@ static char dot[] = "."; #define END(buf) (buf + sizeof(buf)) PATH_T to = { .dir = -1, .end = to.path }; -int Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; -static int Hflag, Lflag, Pflag, Rflag, rflag; +bool Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; +static bool Hflag, Lflag, Pflag, Rflag, rflag; volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; @@ -78,6 +79,26 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int, struct stat *); static void siginfo(int __unused); +enum { + SORT_OPT = CHAR_MAX, +}; + +static const struct option long_opts[] = +{ + { "archive", no_argument, NULL, 'a' }, + { "force", no_argument, NULL, 'f' }, + { "interactive", no_argument, NULL, 'i' }, + { "dereference", no_argument, NULL, 'L' }, + { "link", no_argument, NULL, 'l' }, + { "no-clobber", no_argument, NULL, 'n' }, + { "no-dereference", no_argument, NULL, 'P' }, + { "recursive", no_argument, NULL, 'R' }, + { "symbolic-link", no_argument, NULL, 's' }, + { "verbose", no_argument, NULL, 'v' }, + { "one-file-system", no_argument, NULL, 'x' }, + { 0 } +}; + int main(int argc, char *argv[]) { @@ -88,59 +109,60 @@ main(int argc, char *argv[]) bool have_trailing_slash = false; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - while ((ch = getopt(argc, argv, "HLPRafilNnprsvx")) != -1) + while ((ch = getopt_long(argc, argv, "+HLPRafilNnprsvx", long_opts, + NULL)) != -1) switch (ch) { case 'H': - Hflag = 1; - Lflag = Pflag = 0; + Hflag = true; + Lflag = Pflag = false; break; case 'L': - Lflag = 1; - Hflag = Pflag = 0; + Lflag = true; + Hflag = Pflag = false; break; case 'P': - Pflag = 1; - Hflag = Lflag = 0; + Pflag = true; + Hflag = Lflag = false; break; case 'R': - Rflag = 1; + Rflag = true; break; case 'a': - pflag = 1; - Rflag = 1; - Pflag = 1; - Hflag = Lflag = 0; + pflag = true; + Rflag = true; + Pflag = true; + Hflag = Lflag = false; break; case 'f': - fflag = 1; - iflag = nflag = 0; + fflag = true; + iflag = nflag = false; break; case 'i': - iflag = 1; - fflag = nflag = 0; + iflag = true; + fflag = nflag = false; break; case 'l': - lflag = 1; + lflag = true; break; case 'N': - Nflag = 1; + Nflag = true; break; case 'n': - nflag = 1; - fflag = iflag = 0; + nflag = true; + fflag = iflag = false; break; case 'p': - pflag = 1; + pflag = true; break; case 'r': - rflag = Lflag = 1; - Hflag = Pflag = 0; + rflag = Lflag = true; + Hflag = Pflag = false; break; case 's': - sflag = 1; + sflag = true; break; case 'v': - vflag = 1; + vflag = true; break; case 'x': fts_options |= FTS_XDEV; @@ -159,7 +181,7 @@ main(int argc, char *argv[]) if (lflag && sflag) errx(1, "the -l and -s options may not be specified together"); if (rflag) - Rflag = 1; + Rflag = true; if (Rflag) { if (Hflag) fts_options |= FTS_COMFOLLOW; diff --git a/bin/cp/extern.h b/bin/cp/extern.h index c0c524756980..683e6e5f289f 100644 --- a/bin/cp/extern.h +++ b/bin/cp/extern.h @@ -37,7 +37,7 @@ typedef struct { } PATH_T; extern PATH_T to; -extern int Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; +extern bool Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; extern volatile sig_atomic_t info; __BEGIN_DECLS diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 1d2cd4292459..6adbc45c5009 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -688,6 +688,21 @@ unrfile_body() atf_check cmp src/c dst/c } +atf_test_case nopermute +nopermute_head() +{ + atf_set descr "Check that getopt_long does not permute options" +} +nopermute_body() +{ + mkdir src dst + atf_check \ + -s exit:1 \ + -e match:'cp: -p: No such file' \ + cp -R src -p dst + atf_check test -d dst/src +} + atf_init_test_cases() { atf_add_test_case basic @@ -729,4 +744,5 @@ atf_init_test_cases() atf_add_test_case dirloop atf_add_test_case unrdir atf_add_test_case unrfile + atf_add_test_case nopermute } diff --git a/bin/cp/utils.c b/bin/cp/utils.c index cfc0f0f12603..2036056ada68 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -105,7 +105,7 @@ copy_file(const FTSENT *entp, bool dne, bool beneath) ssize_t wcount; off_t wtotal; int ch, checkch, from_fd, rval, to_fd; - int use_copy_file_range = 1; + bool use_copy_file_range = true; fs = entp->fts_statp; from_fd = to_fd = -1; @@ -210,7 +210,7 @@ copy_file(const FTSENT *entp, bool dne, bool beneath) to_fd, NULL, SSIZE_MAX, 0); if (wcount < 0 && errno == EINVAL) { /* probably a non-seekable descriptor */ - use_copy_file_range = 0; + use_copy_file_range = false; } } if (!use_copy_file_range) { From nobody Wed Jul 9 17:11:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bckys3DjBz60j79; Wed, 09 Jul 2025 17:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bckys2PkFz4J7y; Wed, 09 Jul 2025 17:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752081077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sOoE3qCnazrTYoJsyfaOfdqzmz5mO39WIRaMK96O42c=; b=K5ubXxixUudPLS9OZj3DYKBGjtMdh84HBhhKf/La7I/8uC0p3bQH90b1jTU0LhPu9yOU2F UhwVF/cHAPE1sB8akScK/1ud3gjmaPPiTOy54hMwgcjlb1ps0zQYLMJr+yMTRvVLw2jAb1 Jaqub0Ti4WV/7CdBsiDT3eSMKknppxCZG6yavxXPfmh7LassdCUG8rMhy4e7wq82wl2sOc vNpyZ21/YTggGJdyvVhC+1FgRb+1XnZ3ErFNgt1ZQbk0oKxvpsD/CCqByooy/7WS5PPAp1 k0XcdLmq12ZVURYGe00Oo+W2xRWlEEPzXAWEIbIQhZl/M4gZUoNCfF2+22GzAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752081077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sOoE3qCnazrTYoJsyfaOfdqzmz5mO39WIRaMK96O42c=; b=L2DBvff1HWZyzKrJACWigPvnoAM1+003OCWtGcNEPj6tc+GhrNv60Bct0bQq0125t8j0oZ b3n+FKQJCxGSGO2D/TXfEErwf+Pl7OkymqRnk/jzcQSv5gRiZPTPUECyDEU8RTBcEHlPgS AuoCqaKyLz9kGgS3fbX1NgOHrBOO9N5c0bVliCEYwaztPhEfcse4jW8aVQcI817cDQBspM xOXrXpZPPXhsM3WXfarH1hOWtVuQtfSJ30RguqtTljwqhUNymIXwuAUkLY2nbmt/zgGhd4 mUPkh0SubnjPcywwtGjGAoT6oxFCwJyk4v3BCCV45D/8okeiB0rKA9t2gXzdog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752081077; a=rsa-sha256; cv=none; b=rn2Id9PHBamBijndBhajKMlyjyTCYi/GO7wAxe68yCm4OayKQJbQhNZO1wwO4X4UURYDIU iJQmsh+qbxe60ZHcDnNQGAsPnd4c6UhFA5O6kYMBShdIGBoSU/ZRo0X7OY/OSA+ZOO7OL2 JNeR0fgvNowVJq6edzv94eyJEU0ksrO1WrQ3TZii0VssIezpnt++J6utuWkuOctuOHQEgm bGdh3IElw4Q1fmXwnol9YY/2CVSkIf9NCI1ALPn3ukW8k7RebhN7z7xZWPnfw6Cc+mpRhd cBoJA7fac/GlGv5cX73OqhuXG90p+/HwGxWfnQosK5Z81WF8mIRGk3FJI3EwuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bckys1QMLzWnc; Wed, 09 Jul 2025 17:11: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 569HBHsv084711; Wed, 9 Jul 2025 17:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HBHet084705; Wed, 9 Jul 2025 17:11:17 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:11:17 GMT Message-Id: <202507091711.569HBHet084705@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: 89990e28e6e1 - main - cp: Add descriptions to all test cases. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 89990e28e6e1cae1b3d74d5a06159c1f9e12abc5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=89990e28e6e1cae1b3d74d5a06159c1f9e12abc5 commit 89990e28e6e1cae1b3d74d5a06159c1f9e12abc5 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 17:10:59 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 17:10:59 +0000 cp: Add descriptions to all test cases. While here, touch a few test cases up. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51124 --- bin/cp/tests/cp_test.sh | 175 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 164 insertions(+), 11 deletions(-) diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 3c3dd309b9e4..999993bfad67 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -34,6 +34,10 @@ check_size() } atf_test_case basic +basic_head() +{ + atf_set "descr" "Copy a file" +} basic_body() { echo "foo" > bar @@ -43,18 +47,26 @@ basic_body() } atf_test_case basic_symlink +basic_symlink_head() +{ + atf_set "descr" "Copy a symlink to a file" +} basic_symlink_body() { echo "foo" > bar ln -s bar baz atf_check cp baz foo - atf_check test '!' -L foo + atf_check test ! -L foo atf_check cmp foo bar } atf_test_case chrdev +chrdev_head() +{ + atf_set "descr" "Copy a character device" +} chrdev_body() { echo "foo" > bar @@ -69,6 +81,10 @@ chrdev_body() } atf_test_case hardlink +hardlink_head() +{ + atf_set "descr" "Create a hard link to a file" +} hardlink_body() { echo "foo" >foo @@ -78,6 +94,11 @@ hardlink_body() } atf_test_case hardlink_exists +hardlink_exists_head() +{ + atf_set "descr" "Attempt to create a hard link to a file, " \ + "but the destination already exists" +} hardlink_exists_body() { echo "foo" >foo @@ -88,6 +109,11 @@ hardlink_exists_body() } atf_test_case hardlink_exists_force +hardlink_exists_force_head() +{ + atf_set "descr" "Force creation of a hard link to a file " \ + "when the destination already exists" +} hardlink_exists_force_body() { echo "foo" >foo @@ -98,9 +124,12 @@ hardlink_exists_force_body() } atf_test_case matching_srctgt +matching_srctgt_head() +{ + atf_set "descr" "Avoid infinite loop when copying a directory to itself" +} matching_srctgt_body() { - # PR235438: `cp -R foo foo` would previously infinitely recurse and # eventually error out. mkdir foo @@ -110,13 +139,17 @@ matching_srctgt_body() atf_check cp -R foo foo atf_check -o inline:"qux\n" cat foo/foo/bar atf_check -o inline:"qux\n" cat foo/foo/zoo - atf_check -e not-empty -s not-exit:0 stat foo/foo/foo + atf_check test ! -e foo/foo/foo } atf_test_case matching_srctgt_contained +matching_srctgt_contained_head() +{ + atf_set "descr" "Avoid infinite loop when copying a directory " \ + "into an existing subdirectory of itself" +} matching_srctgt_contained_body() { - # Let's do the same thing, except we'll try to recursively copy foo into # one of its subdirectories. mkdir foo @@ -142,9 +175,13 @@ matching_srctgt_contained_body() } atf_test_case matching_srctgt_link +matching_srctgt_link_head() +{ + atf_set "descr" "Avoid infinite loop when recursively copying a " \ + "symlink to a directory into the directory it links to" +} matching_srctgt_link_body() { - mkdir foo echo "qux" > foo/bar cp foo/bar foo/zoo @@ -156,9 +193,13 @@ matching_srctgt_link_body() } atf_test_case matching_srctgt_nonexistent +matching_srctgt_nonexistent_head() +{ + atf_set "descr" "Avoid infinite loop when recursively copying a " \ + "directory into a new subdirectory of itself" +} matching_srctgt_nonexistent_body() { - # We'll copy foo to a nonexistent subdirectory; ideally, we would # skip just the directory and end up with a layout like; # @@ -180,6 +221,10 @@ matching_srctgt_nonexistent_body() } atf_test_case pflag_acls +pflag_acls_head() +{ + atf_set "descr" "Verify that -p preserves access control lists" +} pflag_acls_body() { mkdir dir @@ -216,6 +261,10 @@ pflag_acls_body() } atf_test_case pflag_flags +pflag_flags_head() +{ + atf_set "descr" "Verify that -p preserves file flags" +} pflag_flags_body() { mkdir dir @@ -263,6 +312,11 @@ recursive_link_setup() } atf_test_case recursive_link_dflt +recursive_link_dflt_head() +{ + atf_set "descr" "Copy a directory containing a subdirectory and a " \ + "symlink to that subdirectory" +} recursive_link_dflt_body() { recursive_link_setup @@ -270,9 +324,15 @@ recursive_link_dflt_body() # -P is the default, so this should work and preserve the link. atf_check cp -R foo foo-mirror atf_check test -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz } atf_test_case recursive_link_Hflag +recursive_link_Hflag_head() +{ + atf_set "descr" "Copy a directory containing a subdirectory and a " \ + "symlink to that subdirectory" +} recursive_link_Hflag_body() { recursive_link_setup @@ -281,22 +341,32 @@ recursive_link_Hflag_body() # link. atf_check cp -RH foo foo-mirror atf_check test -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz } atf_test_case recursive_link_Lflag +recursive_link_Lflag_head() +{ + atf_set "descr" "Copy a directory containing a subdirectory and a " \ + "symlink to that subdirectory" +} recursive_link_Lflag_body() { recursive_link_setup -L # -L will work, but foo/baz ends up expanded to a directory. - atf_check test -d foo-mirror/foo/baz -a \ - '(' ! -L foo-mirror/foo/baz ')' + atf_check test ! -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz atf_check cp -RL foo foo-mirror - atf_check test -d foo-mirror/foo/baz -a \ - '(' ! -L foo-mirror/foo/baz ')' + atf_check test ! -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz } atf_test_case samefile +samefile_head() +{ + atf_set "descr" "Copy a file to itself" +} samefile_body() { echo "foo" >foo @@ -324,6 +394,10 @@ files_are_equal() } atf_test_case sparse_leading_hole +sparse_leading_hole_head() +{ + atf_set "descr" "Copy a sparse file stat starts with a hole" +} sparse_leading_hole_body() { # A 16-megabyte hole followed by one megabyte of data @@ -337,6 +411,10 @@ sparse_leading_hole_body() } atf_test_case sparse_multiple_holes +sparse_multiple_hole_head() +{ + atf_set "descr" "Copy a sparse file with multiple holes" +} sparse_multiple_holes_body() { # Three one-megabyte blocks of data preceded, separated, and @@ -356,6 +434,10 @@ sparse_multiple_holes_body() } atf_test_case sparse_only_hole +sparse_only_hole_head() +{ + atf_set "descr" "Copy a sparse file consisting entirely of a hole" +} sparse_only_hole_body() { # A 16-megabyte hole @@ -368,6 +450,10 @@ sparse_only_hole_body() } atf_test_case sparse_to_dev +sparse_to_dev_head() +{ + atf_set "descr" "Copy a sparse file to a device" +} sparse_to_dev_body() { # Three one-megabyte blocks of data preceded, separated, and @@ -385,6 +471,10 @@ sparse_to_dev_body() } atf_test_case sparse_trailing_hole +sparse_trailing_hole_head() +{ + atf_set "descr" "Copy a sparse file that ends with a hole" +} sparse_trailing_hole_body() { # One megabyte of data followed by a 16-megabyte hole @@ -398,16 +488,24 @@ sparse_trailing_hole_body() } atf_test_case standalone_Pflag +standalone_Pflag_head() +{ + atf_set "descr" "Test -P without -R" +} standalone_Pflag_body() { echo "foo" > bar ln -s bar foo atf_check cp -P foo baz - atf_check -o inline:'Symbolic Link\n' stat -f %SHT baz + atf_check test -L baz } atf_test_case symlink +symlink_head() +{ + atf_set "descr" "Create a symbolic link to a file" +} symlink_body() { echo "foo" >foo @@ -417,6 +515,11 @@ symlink_body() } atf_test_case symlink_exists +symlink_exists_head() +{ + atf_set "descr" "Attempt to create a symbolic link to a file, " \ + "but the destination already exists" +} symlink_exists_body() { echo "foo" >foo @@ -426,6 +529,11 @@ symlink_exists_body() } atf_test_case symlink_exists_force +symlink_exists_force_head() +{ + atf_set "descr" "Force creation of a symbolic link to a file " \ + "when the destination already exists" +} symlink_exists_force_body() { echo "foo" >foo @@ -436,6 +544,10 @@ symlink_exists_force_body() } atf_test_case directory_to_symlink +directory_to_symlink_head() +{ + atf_set "descr" "Attempt to copy a directory to a symlink" +} directory_to_symlink_body() { mkdir -p foo @@ -449,6 +561,10 @@ directory_to_symlink_body() } atf_test_case overwrite_directory +overwrite_directory_head() +{ + atf_set "descr" "Attempt to overwrite a directory with a file" +} overwrite_directory_body() { mkdir -p foo/bar/baz @@ -465,6 +581,10 @@ overwrite_directory_body() } atf_test_case to_dir_dne +to_dir_dne_head() +{ + atf_set "descr" "Copy a directory to a nonexistent directory" +} to_dir_dne_body() { mkdir dir @@ -476,6 +596,10 @@ to_dir_dne_body() } atf_test_case to_nondir +to_dir_dne_head() +{ + atf_set "descr" "Copy one or more files to a non-directory" +} to_nondir_body() { echo "foo" >foo @@ -490,6 +614,10 @@ to_nondir_body() } atf_test_case to_deadlink +to_deadlink_head() +{ + atf_set "descr" "Copy a file to a dead symbolic link" +} to_deadlink_body() { echo "foo" >foo @@ -499,6 +627,10 @@ to_deadlink_body() } atf_test_case to_deadlink_append +to_deadlink_append_head() +{ + atf_set "descr" "Copy multiple files to a dead symbolic link" +} to_deadlink_append_body() { echo "foo" >foo @@ -517,6 +649,10 @@ to_deadlink_append_body() } atf_test_case to_dirlink +to_dirlink_head() +{ + atf_set "descr" "Copy things to a symbolic link to a directory" +} to_dirlink_body() { mkdir src dir @@ -542,6 +678,11 @@ to_dirlink_body() } atf_test_case to_deaddirlink +to_deaddirlink_head() +{ + atf_set "descr" "Copy things to a symbolic link to a nonexistent " \ + "directory" +} to_deaddirlink_body() { mkdir src @@ -572,6 +713,11 @@ to_deaddirlink_body() } atf_test_case to_link_outside +to_link_outside_head() +{ + atf_set "descr" "Recursively copy a directory containing a symbolic " \ + "link that points to somewhere outside the source directory" +} to_link_outside_body() { mkdir dir dst dst/dir @@ -584,6 +730,11 @@ to_link_outside_body() } atf_test_case dstmode +dstmode_head() +{ + atf_set "descr" "Verify that directories are created with the " \ + "correct permissions" +} dstmode_body() { mkdir -m 0755 dir @@ -646,6 +797,7 @@ atf_test_case unrdir unrdir_head() { atf_set "descr" "Test handling of unreadable directories" + atf_set "require.user" "unprivileged" } unrdir_body() { @@ -670,6 +822,7 @@ atf_test_case unrfile unrfile_head() { atf_set "descr" "Test handling of unreadable files" + atf_set "require.user" "unprivileged" } unrfile_body() { From nobody Wed Jul 9 17:38:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bclZ119XRz60khl; Wed, 09 Jul 2025 17:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclZ04cxTz3J40; Wed, 09 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ld7qTkCuG893bmxyBGvxSYug9yM0/L5EyhnGIj+hbVE=; b=dsKxZTrL0re9KQkUC6OOvRWNLcVeT0aKMcLUO8eYa01OPNbAycFhNeclk07UV/0tABUkcl eMioJNqs0w2Flj5Y7F7pLP/MQlle7jIXa7K6ms1+mrgKw43XwoE4xUUU+Do0YCEaTJzRIn V/nyr5dJrCO9uXmuzlcgeK01Cw7gsxImusJAb5/YNIDMjMuK8ZHyU8Gd1RmBn/WYwPhZS9 I3MDr202f4aRAK9E9DAnFI8hcnSnJy0Fe1MGHgFxoaxw6BDMw/kIkhidhqsYL9MrHSltDP uPst9cBHT2rG4qyezPnEU8+FuG/NUD04eynn8oNXO2O1K/MnrssN+sM8LnBZog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ld7qTkCuG893bmxyBGvxSYug9yM0/L5EyhnGIj+hbVE=; b=Sia0YT8qLe7xsNbUB18S20uUXWvz2zXdIA6lh4vTjKPrp+EDm+A3F/h8cn8q0wTpKywTs4 Lf+a1iOFPmJh0r+rffFjtajBoM3RheUxLYCQrBSqhXg2ZJaS3Ucb/VvegiPDKFn8NA+zwX EA22Ds0dSWjjJ+Gg+LGg2y2qXI4l/7C5NFRCKL5kbbYbQl5RZaINCMPLLHr6gV1Q6RPq07 NtfWBCUpe4tTmlPBBoK52I8rUdbYb4TWxu/bk0fJrMKyDwR4Avobb39ok5Suu+LKS98ifq pYKfX2NEVUXLNpvp62s8TRIm90xxTe4uHvmH8uNDjM2k+vk7qfu6sBSZsrTPjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752082696; a=rsa-sha256; cv=none; b=DatNG8EkfKLXYqmIGEVAOL/x4kPBE1zVyaAoXvS/AOlJqDX9qxne21SHT16w71A3+6iUzQ jSbLdIG+KCw5DJrSXOjBY/2ShOjc/xbvZ4PJb2qgwLe/MsC4vwlxPWD6w2tNsiCKnV3uHh JgBdx11oeo3FfGlmJ6RWifTgW/Rpfvr9UcsLJ+IT5pvMrEocUr81x+VGDoeoGD3ebh7pgZ Sc5kvKSAi9u7fqe3KcxfoWA9CP/9Ky7F3TvndxQRZzE0Tnyw/F8Y5f7VZwi1IwXXubrMsk vIYT8T1xmdbw+4y+2hI0mIgf+5IWjLuey20dJrGq96GFV8XIeZ3sQbNBbbT4vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bclZ03vdRzY1n; Wed, 09 Jul 2025 17:38: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 569HcG4j028616; Wed, 9 Jul 2025 17:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HcGof028613; Wed, 9 Jul 2025 17:38:16 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:38:16 GMT Message-Id: <202507091738.569HcGof028613@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: 44e9c9f8f391 - main - nfsvno_rename(): do not use -1 as special error indicator List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 44e9c9f8f3916200292e8191f3534dc7946c5c37 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44e9c9f8f3916200292e8191f3534dc7946c5c37 commit 44e9c9f8f3916200292e8191f3534dc7946c5c37 Author: Konstantin Belousov AuthorDate: 2025-07-08 19:52:44 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 17:38:11 +0000 nfsvno_rename(): do not use -1 as special error indicator it clashes with ERESTART. Use EJUSTRETURN for the case, as it is often done in other places in the kernel. Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51211 --- sys/fs/nfsserver/nfs_nfsdport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index a81f1492ef95..95dc44438acc 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1652,10 +1652,11 @@ nfsvno_rename(struct nameidata *fromndp, struct nameidata *tondp, } if (fvp == tvp) { /* - * If source and destination are the same, there is nothing to - * do. Set error to -1 to indicate this. + * If source and destination are the same, there is + * nothing to do. Set error to EJUSTRETURN to indicate + * this. */ - error = -1; + error = EJUSTRETURN; goto out; } if (nd->nd_flag & ND_NFSV4) { @@ -1710,7 +1711,7 @@ out: vput(tvp); vrele(fromndp->ni_dvp); vrele(fvp); - if (error == -1) + if (error == EJUSTRETURN) error = 0; } From nobody Wed Jul 9 17:38:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bclZ16932z60khm; Wed, 09 Jul 2025 17:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclZ147SBz3J97; Wed, 09 Jul 2025 17:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXG/MtapaYAFJXfBJolAMGxbaUBcWb1CfTijACbOqqk=; b=v1Rv2JQ8JQMKGu4UwPh7eGg0aAixOyi2N74tzqQPvL+KNfxwXufc953TLuADeEEjdl75og UmUG0/aW3DdKUSwytQvLSmiVQ9sw862kylOW1sKmmUa7EWtI7s03iLZw8K6o4lUjKFiSin qijMIXVS17FtzX2bR0nBA7ujDLB8rTH3b7BYG8RKh4Lm63nt3ZFE2RcCiFAsObwV38DLO+ vJujJimowJyBT8EG3j7Q1N9kz0gGxlJDHlGqfTzXjt+4TYbBFfRUAGb6FOErRCMfRexSoN DuM4ygyayoI5AYVb5DewO09k5OLZsMIbiNuen6XzvdEb8IMFooZBYKDK2XJJkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXG/MtapaYAFJXfBJolAMGxbaUBcWb1CfTijACbOqqk=; b=b49Xjrn30pHsD2QJ3Ot8U0AHRDsSSP+YyARWMbkQFM+2SYg7ZV1wjEVcw4kIjr3i9WWKMo aH65WjrcU+JotB19mZGUBNUtPGRftsOh2xQxqZD5w3UD09tlir1Bwbw7jh05S7RYGLPg/+ Zv7fBvEN53l5WCcIdEPC5wnsclFqyz+Azq4rEXxEeG2ajoecI97QncSsPm8iO3J7wFjolO cbRNY2pFlDSBvbHvz1Pvy0nW9vfRq7S1wbg4YQHD8oBx2N/MtLbmU7hcOomtbO2ViqBll7 RwaaFo2t+JnphHlfTBEKHRufpX2d6eeK+40733ownDMUaXCubBR5j5s99zQiTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752082697; a=rsa-sha256; cv=none; b=WykGYxBtyr6il9avExlg0eKEpQFpQlMz9sV7ahExxn1GifghXzWzkG5UjAiGyYsCTPDx+8 12XPbz3ur8SDeop4r6NYVhqXIZlcQIj3GOQVq/BXZPcPgjY6Lm2JePovaWewd/Us4Jmhio 7wriQiuLkJaGTKxfrjbBQMLCeJ9lgEHuuFVnrob4rJzTjniYqVMA/Mj9869TqMkirthP4m dwcz4NLZDhXdRz/OO1F8msV3f20E9uPM2KT7sygMCZV1OZCU9UFO7dyYJ90jNiz3ZDmOw5 W1g5hzVLVumZkov0KkCVMAd9Xr5y7730wj3rdEDy0THhXyOIXi5tptJVpWBVPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bclZ13l2qzXrl; Wed, 09 Jul 2025 17:38: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 569HcHCY028654; Wed, 9 Jul 2025 17:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HcHkL028651; Wed, 9 Jul 2025 17:38:17 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:38:17 GMT Message-Id: <202507091738.569HcHkL028651@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: 6280d03bb5fd - main - nfsserver rename: lock mnt_renamelock as required List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6280d03bb5fda4ba4a33a6e6faff2de34b2eda61 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6280d03bb5fda4ba4a33a6e6faff2de34b2eda61 commit 6280d03bb5fda4ba4a33a6e6faff2de34b2eda61 Author: Konstantin Belousov AuthorDate: 2025-07-08 19:53:55 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 17:38:11 +0000 nfsserver rename: lock mnt_renamelock as required Fixes: ef6ea91593ebff73e2fc201efd9f848b71c5a125 Reported by: des Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51211 --- sys/fs/nfsserver/nfs_nfsdport.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 95dc44438acc..43ee0383669f 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1698,10 +1698,26 @@ nfsvno_rename(struct nameidata *fromndp, struct nameidata *tondp, " dsdvp=%p\n", dsdvp[0]); } out: - if (!error) { + mp = NULL; + if (error == 0) { + error = VOP_GETWRITEMOUNT(tondp->ni_dvp, &mp); + if (error == 0) { + if (mp == NULL) { + error = ENOENT; + } else { + error = lockmgr(&mp->mnt_renamelock, + LK_EXCLUSIVE | LK_NOWAIT, NULL); + if (error != 0) + error = ERELOOKUP; + } + } + } + if (error == 0) { error = VOP_RENAME(fromndp->ni_dvp, fromndp->ni_vp, &fromndp->ni_cnd, tondp->ni_dvp, tondp->ni_vp, &tondp->ni_cnd); + lockmgr(&mp->mnt_renamelock, LK_RELEASE, 0); + vfs_rel(mp); } else { if (tdvp == tvp) vrele(tdvp); @@ -1711,8 +1727,13 @@ out: vput(tvp); vrele(fromndp->ni_dvp); vrele(fvp); - if (error == EJUSTRETURN) + if (error == EJUSTRETURN) { error = 0; + } else if (error == ERELOOKUP && mp != NULL) { + lockmgr(&mp->mnt_renamelock, LK_EXCLUSIVE, 0); + lockmgr(&mp->mnt_renamelock, LK_RELEASE, 0); + vfs_rel(mp); + } } /* From nobody Wed Jul 9 17:53:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bclv21Zssz60lc6; Wed, 09 Jul 2025 17:53: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclv15lTvz3RsT; Wed, 09 Jul 2025 17:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752083581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uo5fqztSN2NAa2rsJrIKUOEh38u03pNxUNcpbhs++34=; b=NJpy7W9mQt1IpZoZP3qBGN2NH5UYlexg/+/Z5J3YWv3cVpNWzu1B050ouaQjWSqA4mdJ0k /zfOisFr63l81Kqh7/RpIXDy/zOeYt6I5OtXc0xueC8YzPXcznfamMiYQwr6VlUBQqDyd5 oC/zNa41zq+VTOEIiZNGswPZDjpJtMrmEZGLmhn+7XGz/7M1xl5JqR4b7eiqBsQeEN3q8W uTV1X7pLSM2AloIpHlYWXbwBpG3+GUBlpiRykYiThyngCJMNrezcA3np/BuJZy9YU8WRAM WnAcktjXkXvF8p9A29dSpCW0fj0IvpwyXpm0ZOE8Kbp8yCV7xKf1d09m4plQ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752083581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uo5fqztSN2NAa2rsJrIKUOEh38u03pNxUNcpbhs++34=; b=hp7/Z53okVtGLg7q4nbZLmSQinocTeZrcS5mjivWZGldJGm00DmUkTAEhaGfdoGgxFm9Se cArKElS5RhD0EqBXNKFQmcBKL0JY2ewTbUo5ya4IDIQUCW8G925xw7Gwa+JqdTFmKh3EcJ jteeO2KHgaFogdQf5zaTC4v3pf8gVPlWzZlsq5ZJBl+V421MxFFOQMI6meMFyHBKY+I8U2 0BQ2NTY13ws8y/BUZc0ngLcVQ5Q9RG1v/TzT4xRRwojYLm9t/MthoywHl01Rf7DRvqLtXX vOUtxEIMvGUyCaxmYLoLH36eROYkUBkkDcSrCZ8OlzBHuk2i5lCjXfSIXGwe+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752083581; a=rsa-sha256; cv=none; b=ccX9kGTJu6XlF1S223oyBjgRp6wdPeNBRFof9/sN78Tey9QfthNjaOXzaj9+RMKql2+efd DIg1U5P7LYRMfXIoWK7psMMcmBaqHF9ufejHmZwI2RfU1Y7KoAMCQ+7JNW6NPfvAvBGMF6 VCYb5TOa4qeY1RhAQoTxKD483S5HuHERSVw9oBsf6L57WuoM9W42g48QBshdi8xudOCTIA AFUKIh1VdYUKmpo1VTT+UUrJyyMcowTAleXscIJ6vX48IzWzj3WCqlRxCPLtg01iPnEp+T 941t2vJvgo6c+s+l/ceaymLkNZTSJUsqGCm8hB/Iht+Tgsg6R76+FPtktbyB4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bclv15LwHzYxd; Wed, 09 Jul 2025 17:53: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 569Hr172063690; Wed, 9 Jul 2025 17:53:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569Hr1Yr063687; Wed, 9 Jul 2025 17:53:01 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:53:01 GMT Message-Id: <202507091753.569Hr1Yr063687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 91ad27bcfc49 - main - truncate.1: Polish title and examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91ad27bcfc496393ba88f39ca13cdf1c59a7f487 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=91ad27bcfc496393ba88f39ca13cdf1c59a7f487 commit 91ad27bcfc496393ba88f39ca13cdf1c59a7f487 Author: Alexander Ziaee AuthorDate: 2024-12-30 06:11:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-09 17:52:01 +0000 truncate.1: Polish title and examples + describe better + switch examples to human readable sizes, with consistent spacing + `Downsize ... in 5 Megabytes` >> `Downsize ... by 5 Megabytes` + remove prompt from lone example with prompt for consistency + remove x permissions from kernel example + examples now fit on standard console without wrapping While here: + fold a line to eliminate linter warning + tag spdx + add -nosplit to AUTHORS to eliminate a rendering glitch MFC after: 3 days Discussed with: asomers, jhb, maxim Reviewed by: imp (previous version) Closes: https://github.com/freebsd/freebsd-src/pull/1568 --- usr.bin/truncate/truncate.1 | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index f6b8b0cc37c9..aa70943b889f 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2000 Sheldon Hearn . .\" All rights reserved. .\" Copyright (c) 2021 The FreeBSD Foundation @@ -27,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 6, 2025 +.Dd July 9, 2025 .Dt TRUNCATE 1 .Os .Sh NAME .Nm truncate -.Nd truncate, extend the length of files, or perform space management in files +.Nd resize files or manage file space .Sh SYNOPSIS .Nm .Op Fl c @@ -132,7 +134,8 @@ file system space deallocation may be performed in the operation region. The space management operation is performed at the given .Ar offset bytes in the file. -If this option is not specified, the operation is performed at the beginning of the file. +If this option is not specified, +the operation is performed at the beginning of the file. .It Fl l Ar length The length of the operation range in bytes. This option must always be specified if option @@ -195,9 +198,9 @@ truncate -c -s 10M test_file .Pp Same as above but create the file if it does not exist: .Bd -literal -offset indent -truncate -s 10M test_file -ls -l test_file --rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file +truncate -s +10M test_file +ls -lh test_file +-rw-r--r-- 1 root wheel 10M Jul 22 18:48 test_file .Ed .Pp Adjust the size of @@ -207,10 +210,10 @@ to the size of the kernel and create another file with the same size: .Bd -literal -offset indent truncate -r /boot/kernel/kernel test_file test_file2 -ls -l /boot/kernel/kernel test_file* --r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel --rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file --rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 +ls -lh /boot/kernel/kernel test_file* +-r--r--r-- 1 root wheel 30M May 15 14:18 /boot/kernel/kernel +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file2 .Ed .Pp Increase the size of the file @@ -228,9 +231,9 @@ Reduce the size of the file by 5 megabytes: .Bd -literal -offset indent truncate -s -5M test_file -ls -l test_file* --rw-r--r-- 1 root wheel 31352552 Jul 22 19:19 test_file --rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 +ls -lh test_file* +-rw-r--r-- 1 root wheel 25M Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file2 .Ed .Sh SEE ALSO .Xr dd 1 , @@ -247,6 +250,7 @@ The utility first appeared in .Fx 4.2 . .Sh AUTHORS +.An -nosplit The .Nm utility was written by From nobody Wed Jul 9 19:17:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcnmf326Tz60rDV; Wed, 09 Jul 2025 19:17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcnmf1xHfz46J7; Wed, 09 Jul 2025 19:17:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752088658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhwGBYba40XtcaY1Y8C8xjF4TA8T3EJZ2WNoF5Fj6uw=; b=H4bKTTb4A1wCTXoHhKCe8wdwzBeqldLtW/YUOsm3zNbXEZF0IyYyAqpls5SM8jGGDWV3YO fVPJ+Ga1i6JryIQzUWZ9RL4CyXBWS7KovpRCfIv65IDURftCoQzEZ78mR5DNGZQ9yo8sYX DzmGLERO8ok/oCmjRBmhxqSyhzil2AMPmcztsiYYyL1wmuQw9g9+Plpl+04gFdkLFAZf/K PIZAL+ekyFS1LjQKfaO/Sranm1Nr8spejvJxP2Eww53JygIB2KGLhYO0Ln0/PM1qnuoUps /Qe//oWG+09R/sZB2IMYVF0PXBnyoy5TMMzSvtfoI8e0wrqAccw42aKtWOQe3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752088658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhwGBYba40XtcaY1Y8C8xjF4TA8T3EJZ2WNoF5Fj6uw=; b=FjELnb21Bbgw24R00j5sze8c8TLJC4AcT9OHJXPs3qWvAeVc4bZ951KmSmcsDvuy+ZYuZR 7CrUZDnQ7kGTID4ehipKA4089HaVzAErRcM4VYDr7dz4nEiX2ZALF7gEw09+Uw7G4mZr5C vnejXQq1SoB5VBfthmMnf94jQqmWIU8CiDLE9D01JQdmLOUxNg65e4t5UiagA6p206Rm91 TRQJRJjCZwzeKUILtzaT0aR1dwsPWC4StfKgGtln+tDvjtyLUVCohttXyTxPOekiG8/skT pUu+pDatgP/3fVSXkt4qsCZb+W1REIxVEC+ccoyjSRewPhnDgMDmJQpIPk0npA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752088658; a=rsa-sha256; cv=none; b=tCkF994mZgOkFg/Wh4Ia/IlsUmo7I9gX9YnCecOAYjbw6TMiZ85/49cW25b3+vQB3M4LsQ lSKZRuxsGwfo+bukK8Nvtox+7di+bTrlVjlPUIWOfIPJobkGP++aWlPPW2xSgwj6Tr1ib9 KyR86F9f62ja8CekT5CW3cJnoajVA8wXMkpiFTQxaUg+gyhvC57aNlWEtx2p5f9CUJ7F57 ZtUzYZ1REEUzG7VDkC8/N+d0UfB0LZN6DDxhU8+S6vDOu8ZZUG2nMgg2qQFaLp7lsz3fTk 3hUasokNUQEQ4Cf0YD3LMsNntyHBI62IRM7sHehnBsSYXViuJv3ltUujypmtuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcnmd6zPDzbtC; Wed, 09 Jul 2025 19:17: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 569JHbml016663; Wed, 9 Jul 2025 19:17:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569JHbhl016660; Wed, 9 Jul 2025 19:17:37 GMT (envelope-from git) Date: Wed, 9 Jul 2025 19:17:37 GMT Message-Id: <202507091917.569JHbhl016660@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: ccf937320a1a - main - libc: Finish removing fscandir{,_b}(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: ccf937320a1a7383a2c33698007b7244f66dc022 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf937320a1a7383a2c33698007b7244f66dc022 commit ccf937320a1a7383a2c33698007b7244f66dc022 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 19:16:40 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 19:17:06 +0000 libc: Finish removing fscandir{,_b}(). These only existed for a few days before being renamed, so there's no reason to continue to carry compatibility shims for them. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50981 --- ObsoleteFiles.inc | 4 ---- lib/libc/gen/Symbol.map | 2 -- lib/libc/gen/scandir.c | 6 ------ 3 files changed, 12 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index faf7c421af80..d1095b57c342 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -60,10 +60,6 @@ MOVED_LIBS+=usr/lib/libtpool.so.2 # 20250626: replace yaml.lua with lyaml OLD_FILES+=usr/share/flua/yaml.lua -# 20250623: fscandir() renamed to fdscandir() -OLD_FILES+=usr/share/man/man3/fscandir.3.gz -OLD_FILES+=usr/share/man/man3/fscandir_b.3.gz - # 20250615: don't install man page for absent function OLD_FILES+=usr/share/man/man9/vm_map_simplify_entry.9.gz diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 50dbf3425964..c2020ac3d8d2 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -458,8 +458,6 @@ FBSD_1.8 { aio_read2; aio_write2; execvpe; - fscandir; - fscandir_b; fdscandir; fdscandir_b; fts_open_b; diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 8e62fe980868..fb589f4b36b6 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -252,9 +252,3 @@ scandir_thunk_cmp(const void *p1, const void *p2, void *thunk) return (dc((const struct dirent **)p1, (const struct dirent **)p2)); } #endif - -#ifdef I_AM_SCANDIR_B -__weak_reference(fdscandir_b, fscandir_b); -#else -__weak_reference(fdscandir, fscandir); -#endif From nobody Wed Jul 9 20:22:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcqCG1zBSz60w45; Wed, 09 Jul 2025 20:22:18 +0000 (UTC) (envelope-from eduardo@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqCG0KhQz3l0x; Wed, 09 Jul 2025 20:22:18 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092538; 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: in-reply-to:in-reply-to:references:references; bh=wEYYMud2/U9fKTDbicXMnDBU7ZPLHzUV4i1NFlKUB+g=; b=uY5ny9xL4/74xMKQQK3e01niX6aRX8IPSHKb0elgubv1puKssgntY4t+ssL7zxqJrhZNGe uGWm0sUEuoE3Qodc0a+m4Mln3CTZm73cw8T5KU/5ZYAzud5Q0OE4dUMXa/LjTjpubQvsv/ 8GW/D5/RVyvOpmCdf8AbqJW1JbwOzVm3P1S3Imd0IkZyPi4tIAiB/20RTpJx70Zr2aJ8FV +1BXRVPjb2MNthSukZORUfF3qSv5CM8enL7f+yD/KrsL6ReCLji2bBI41h+iDEuq6fvqnZ I7wHDwS3gMC0ZhMVvtdoiWkb2nodSOxkJweWTRdQFH3EpS4QeLMmNPkNmHL+TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092538; 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: in-reply-to:in-reply-to:references:references; bh=wEYYMud2/U9fKTDbicXMnDBU7ZPLHzUV4i1NFlKUB+g=; b=MNRUmdX2pKU1Jq/uRc5X3ijHhdiQf/O5Z+o17uN3xb1rU8EbQ2LOoQe2ub+cIzPpApl4Jf +Zn1daBfJhAvVpMF2f4enuxsvWFGcoEKs/bgiiYTvwdnakDlAugB21q6EhCmlXNB9SQzWH F0FhbyJEGU5fEa+CgkevdssKuimBFVqaCPlbhGY4uAR9PAKbQYv7NESRPnPxfW8QbNcbYS BVwImFKry8d9vwgqjO/6iQBJA6R3KqYVtooou1HoB0a4kkrry7QvANYrI3HRYheOept4TU qNT/vZ8pGrfWpwnfskcr2KIJXuzZT0nWCGGEpiscSNCYXsaWUNfNflzRVFdZKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752092538; a=rsa-sha256; cv=none; b=K7H2tzlFkwWpBsdISbXPNGIyLq1H5qCS+T+QXKp+Z50Iu+TbCf4EQSc+ALeKBjepATizhV WMXUz4GNrKFyNMpD9lJF/xvMuFY1behlV+mSjBv4DQh4J8jCPom0q7jb9BIgrl9fnibwTV /zFpNVw1TrQ2hG8PIk+O3vvpQWhuH4Zk5OlezhhE5vFZYJFx4fXPPe3j2X9l+kVNOQJYd4 QJTRM01w65s/gwEDY6ugiausDd7udIMO3jq5s4y/cRI4JosjAji0hpvISjUSKOeXCe9xgc hdTQR5nm/sljA/clTTXjP+tVW8jCaN65tnEfb1ogYOeEj2s8W4kf0z4b9njo+w== Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bcqCF6ySPz8lK; Wed, 09 Jul 2025 20:22:17 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-4a9bcdd43a2so441991cf.1; Wed, 09 Jul 2025 13:22:17 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUtEy6Wm36rc6h6gR6A954lSYmGRVwK3s9Q8xhYlBoIbCwK0HZMjIuwjUVnD9Eeqlth70BmU8MrzNnnCfQx6mVx9WxYyBQ=@freebsd.org, AJvYcCVDOTiiTsJ3nsGyfqbQ13RUWbYJAhcAzAlz7MlnhLw6xDn9LuIMPbyjiwNQJW8lv6pBWACLg2dLoILSwY7aWGGFnNjB@freebsd.org X-Gm-Message-State: AOJu0Yxl8y60hlqV7Wgx9TE+avPKCUf0fFcIjv/KvZhllc0OeLyqd4HN hZgCkgxuAzoXIumMB19bur48WU9kcl9L9AKu6HwUlUG/brxz4MCmF0KfkGfelgDV7bZilNFpByI +ZLSsSIP7EiDtkVcb51RWFEA6ifpYIvo= X-Google-Smtp-Source: AGHT+IErHCU/kF/7tSp6n7s6Huk/E5sNq52bZY0pt7nMqEUMZFS6a72NgfbL9Nn/ekm9UXY4778uGRjd6xxQqKhJ4r0= X-Received: by 2002:ac8:5fc3:0:b0:4a9:94ab:cc77 with SMTP id d75a77b69052e-4a9ded558d0mr18260341cf.14.1752092537414; Wed, 09 Jul 2025 13:22:17 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507041513.564FDwxH011496@gitrepo.freebsd.org> In-Reply-To: From: Nuno Teixeira Date: Wed, 9 Jul 2025 21:22:06 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXwazkVX-bW5WmD0s5txIjQMWMgo4dpepTbDLocs0rdHJYHNPUJ6A_ihXDY Message-ID: Subject: Re: git: f9cf745a5084 - main - RELNOTES: Document the addition of inotify To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000004e6d67063984d501" --0000000000004e6d67063984d501 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Mark! I confirm that it builds OK. i3 wm depends on it, so I will have a run test in the next days. Also I will update my main amd64 soon and test it in there too. Thanks, Mark Johnston escreveu (quarta, 9/07/2025 =C3=A0(s) 13:= 32): > On Wed, Jul 09, 2025 at 01:13:02PM +0100, Nuno Teixeira wrote: > > Hello, > > > > Not sure if related but I see devel/libdev failing on recent main (test= ed > > on aarch64): > > > > libtool: compile: cc -DHAVE_CONFIG_H -I. -O2 -pipe > > -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF > > .deps/event.Tpo -c event.c -fPIC -DPIC -o .libs/event.o > > --- ev.lo --- > > ev.c:510:11: fatal error: 'sys/statfs.h' file not found > > 510 | # include > > | ^~~~~~~~~~~~~~ > > Are you able to test the patch below? > > diff --git a/devel/libev/files/patch-Makefile.in > b/devel/libev/files/patch-Makefile.in > index 5f6ab0fc3b55..509149e2548b 100644 > --- a/devel/libev/files/patch-Makefile.in > +++ b/devel/libev/files/patch-Makefile.in > @@ -1,6 +1,6 @@ > ---- Makefile.in.orig 2015-12-20 21:12:45 UTC > +--- Makefile.in.orig 2020-03-18 12:27:30 UTC > +++ Makefile.in > -@@ -343,7 +343,7 @@ EXTRA_DIST =3D LICENSE Changes libev.m4 au > +@@ -357,7 +357,7 @@ man_MANS =3D ev.3 > ev.3 ev.pod Symbols.ev Symbols.event > > man_MANS =3D ev.3 > diff --git a/devel/libev/files/patch-configure > b/devel/libev/files/patch-configure > index c92f6cf66003..6e5bf586cf34 100644 > --- a/devel/libev/files/patch-configure > +++ b/devel/libev/files/patch-configure > @@ -1,6 +1,6 @@ > ---- configure.orig 2015-12-20 21:12:45 UTC > +--- configure.orig 2020-03-18 12:27:26 UTC > +++ configure > -@@ -3879,14 +3879,6 @@ else > +@@ -3954,14 +3954,6 @@ fi > fi > > > diff --git a/devel/libev/files/patch-ev.c b/devel/libev/files/patch-ev.c > index 28a00f3aaf8b..65b372e5415a 100644 > --- a/devel/libev/files/patch-ev.c > +++ b/devel/libev/files/patch-ev.c > @@ -1,6 +1,15 @@ > ---- ev.c.orig 2015-12-20 21:12:53 UTC > +--- ev.c.orig 2020-03-18 12:27:32 UTC > +++ ev.c > -@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW > +@@ -507,7 +507,7 @@ > + #endif > + > + #if EV_USE_INOTIFY > +-# include > ++# include > + # include > + /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ > + # ifndef IN_DONT_FOLLOW > +@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT > { > unsigned int flags =3D ev_supported_backends (); > > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --0000000000004e6d67063984d501 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Mark!

I confirm tha= t it builds OK.
i3 wm depends on it, so I will have a run test in = the next days.

Also I will update my main amd64 soon and test = it in there too.

Thanks,

Mark Johnston &l= t;markj@freebsd.org> escreveu (= quarta, 9/07/2025 =C3=A0(s) 13:32):
On Wed, Jul 09, 2025 at 01:13:02PM +0100, Nuno Teixeira= wrote:
> Hello,
>
> Not sure if related but I see devel/libdev failing on recent main (tes= ted
> on aarch64):
>
> libtool: compile:=C2=A0 cc -DHAVE_CONFIG_H -I. -O2 -pipe
> -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF=
> .deps/event.Tpo -c event.c=C2=A0 -fPIC -DPIC -o .libs/event.o
> --- ev.lo ---
> ev.c:510:11: fatal error: 'sys/statfs.h' file not found
>=C2=A0 =C2=A0510 | # include <sys/statfs.h>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~= ~~~~~~~~~~~~

Are you able to test the patch below?

diff --git a/devel/libev/files/patch-Makefile.in b/devel/libev/files/patch-= Makefile.in
index 5f6ab0fc3b55..509149e2548b 100644
--- a/devel/libev/files/patch-Makefile.in
+++ b/devel/libev/files/patch-Makefile.in
@@ -1,6 +1,6 @@
---- Makefile.in.orig=C2=A0 =C2=A02015-12-20 21:12:45 UTC
+--- Makefile.in.orig=C2=A0 =C2=A02020-03-18 12:27:30 UTC
=C2=A0+++ Makefile.in
-@@ -343,7 +343,7 @@ EXTRA_DIST =3D LICENSE Changes libev.m4 au
+@@ -357,7 +357,7 @@ man_MANS =3D ev.3
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev.3 ev.pod Symbols.ev Symb= ols.event

=C2=A0 man_MANS =3D ev.3
diff --git a/devel/libev/files/patch-configure b/devel/libev/files/patch-co= nfigure
index c92f6cf66003..6e5bf586cf34 100644
--- a/devel/libev/files/patch-configure
+++ b/devel/libev/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig=C2=A0 =C2=A0 =C2=A02015-12-20 21:12:45 UTC
+--- configure.orig=C2=A0 =C2=A0 =C2=A02020-03-18 12:27:26 UTC
=C2=A0+++ configure
-@@ -3879,14 +3879,6 @@ else
+@@ -3954,14 +3954,6 @@ fi
=C2=A0 fi


diff --git a/devel/libev/files/patch-ev.c b/devel/libev/files/patch-ev.c index 28a00f3aaf8b..65b372e5415a 100644
--- a/devel/libev/files/patch-ev.c
+++ b/devel/libev/files/patch-ev.c
@@ -1,6 +1,15 @@
---- ev.c.orig=C2=A0 2015-12-20 21:12:53 UTC
+--- ev.c.orig=C2=A0 2020-03-18 12:27:32 UTC
=C2=A0+++ ev.c
-@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW
+@@ -507,7 +507,7 @@
+ #endif
+
+ #if EV_USE_INOTIFY
+-# include <sys/statfs.h>
++# include <sys/mount.h>
+ # include <sys/inotify.h>
+ /* some very old inotify.h headers don't have IN_DONT_FOLLOW */
+ # ifndef IN_DONT_FOLLOW
+@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT
=C2=A0 {
=C2=A0 =C2=A0 unsigned int flags =3D ev_supported_backends ();



--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--0000000000004e6d67063984d501-- From nobody Wed Jul 9 20:29:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcqMR3d6Nz60wRV; Wed, 09 Jul 2025 20:29: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqMR22tKz3pvJ; Wed, 09 Jul 2025 20:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4DtOFRAahcW0m/0GS7zDHUpEIOAK9ESmY9lT8dVKaTA=; b=xvSlA31VJXB9J5ADS+1w2N9ABnHhFOXp9VLBaHSuCQg9Do3UddFC0kQNEujxomo1OqVguo WR+oM/SmMOjgelsouwUsxrvD09qNZq5MTh8li7tKejoLMwGmVuIuEOG1lGoMKqPc+ZAI0e oPmq7cfbTvQfBioNguEjVw4G59FpOIWYBGmrU1CBrfVIqfEj0LxgC29sqNNEqRTpc7jHbk N1vwqpL0G+cTW49AbcoeXmdeZzUidlVINLLDz1wyE+7C1jHaYWI54GX4uql1WU6CawB2/J SzqKdTBdwDHd78bSE5CVJKf3PkyF+DhQqoHzOPukzC93JBHO2Sxy7SZISX6CwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4DtOFRAahcW0m/0GS7zDHUpEIOAK9ESmY9lT8dVKaTA=; b=h2bZP0bqcSu59N8JTeeU8CDA4R4UMZJ3wfVm1HLPecVD19w7Q74rCMzbvR9z+VhH/H/IBh Hol6g0jHPCvT0BpjIf5jSBxoaQGC/qGhMbj/MYBrSs+IRT3oFcJoyaX/clyU68Iy/fZTb1 tR7MFNNZX4Ta6FqRwysDZllpFhc0End+KqaNDJzLnlBynHfu+h0uJuhOU8MwStpYJxTozP wzRr1gYA6LGt3aOvl1hCKQUJR14LgFNRq/MtFRFjvyB2X4BJjx8gEiY9VmZ8285ZqllBmw FGWvDXX2Aejg2SozuLoQlMigAaaBYRBFC5FtnXBrmCXSlIKbuWEdmStfHy8nOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752092963; a=rsa-sha256; cv=none; b=pxSVSy0dUPcicTB20syNzpzQmsiYD+nOXYXc2naqGtQkX5k71pr8PI0cNNja5d04hhz8dW ECXDQC2zFhXlaIFGUxYD7SB1r/AGRNj5QpKjZrKA6k9vOYc0dvjYDSwvVF5rUPpuCPhHC8 4Yl019u9Z3X2zXadURBuzAjs2fP2gryaBgk4eypCCcskohISkjXNzWUucqjWC7Ky5rkZ8c VDTeRZtlk+fdEUn0vN68HacNI2z383D2vY6P+sfLIScNpy/WyOEypsz0IOexPybmBHT5wg gbnRunHdF0oQpKiQojscZ4NPpZ9CUcfMRwLpd7km+wnTxQn19vGSphMPKnh4fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcqMR1DdNzdFG; Wed, 09 Jul 2025 20:29: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 569KTNFM047999; Wed, 9 Jul 2025 20:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KTNfe047996; Wed, 9 Jul 2025 20:29:23 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:29:23 GMT Message-Id: <202507092029.569KTNfe047996@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: 9bf14f2a475e - main - kyua: Try harder to delete directories. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9bf14f2a475e221c48488984dc5a02a4608bb877 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf14f2a475e221c48488984dc5a02a4608bb877 commit 9bf14f2a475e221c48488984dc5a02a4608bb877 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 20:28:47 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 20:28:47 +0000 kyua: Try harder to delete directories. When recursing into a directory to delete it, start by chmod'ing it to 0700. This fixes an issue where kyua is able to run, but not debug, a test case that creates unwriteable directories, because when debugging it tries (and fails) to delete the directory after the test completes. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: igoro Differential Revision: https://reviews.freebsd.org/D51229 --- contrib/kyua/utils/fs/operations.cpp | 2 ++ contrib/kyua/utils/fs/operations_test.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/contrib/kyua/utils/fs/operations.cpp b/contrib/kyua/utils/fs/operations.cpp index 7a96d0b2058a..185d164b88d7 100644 --- a/contrib/kyua/utils/fs/operations.cpp +++ b/contrib/kyua/utils/fs/operations.cpp @@ -692,6 +692,7 @@ fs::rm_r(const fs::path& directory) { const fs::directory dir(directory); + ::chmod(directory.c_str(), 0700); for (fs::directory::const_iterator iter = dir.begin(); iter != dir.end(); ++iter) { if (iter->name == "." || iter->name == "..") @@ -701,6 +702,7 @@ fs::rm_r(const fs::path& directory) if (fs::is_directory(entry)) { LD(F("Descending into %s") % entry); + ::chmod(entry.c_str(), 0700); fs::rm_r(entry); } else { LD(F("Removing file %s") % entry); diff --git a/contrib/kyua/utils/fs/operations_test.cpp b/contrib/kyua/utils/fs/operations_test.cpp index f1349351166e..6f0fa52811c9 100644 --- a/contrib/kyua/utils/fs/operations_test.cpp +++ b/contrib/kyua/utils/fs/operations_test.cpp @@ -664,6 +664,19 @@ ATF_TEST_CASE_BODY(rm_r__files_and_directories) } +ATF_TEST_CASE_WITHOUT_HEAD(rm_r__bad_perms); +ATF_TEST_CASE_BODY(rm_r__bad_perms) +{ + fs::mkdir(fs::path("root"), 0755); + fs::mkdir(fs::path("root/dir"), 0755); + atf::utils::create_file("root/dir/file", ""); + ::chmod(fs::path("root/dir").c_str(), 0000); + ATF_REQUIRE(lookup(".", "root", S_IFDIR)); + fs::rm_r(fs::path("root")); + ATF_REQUIRE(!lookup(".", "root", S_IFDIR)); +} + + ATF_TEST_CASE_WITHOUT_HEAD(rmdir__ok) ATF_TEST_CASE_BODY(rmdir__ok) { @@ -811,6 +824,7 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, rm_r__empty); ATF_ADD_TEST_CASE(tcs, rm_r__files_and_directories); + ATF_ADD_TEST_CASE(tcs, rm_r__bad_perms); ATF_ADD_TEST_CASE(tcs, rmdir__ok); ATF_ADD_TEST_CASE(tcs, rmdir__fail); From nobody Wed Jul 9 20:35:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcqVl4qwVz60whB; Wed, 09 Jul 2025 20:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqVl4GNXz3tfD; Wed, 09 Jul 2025 20:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wk/94xi4nfXQryMqG3HpgpsmYMORTgaVTNIJt+SNTl8=; b=AlFaIFJ9PZW0MTMKMkIt8jOUXMAdUmlwH97dbFPDXteaHZ8lTe9PnJo/KduDaYsxX/RROt XdhNvV+6juh8y3KX7m3Hf4mDGcSX9a2cgmJ42saj9b0qKQ9jjPqZqUzSdF5DiudAvCH8AO Jz1lSct5JrXVMujLO8OsD0U3TjnKIqZEhO6vSN8znmXN1+Fz3Tw0BvZoMfu3biR3NgGe4t HN6j8jX1kLxnvtv799n8IppwmaVki8wrYsCktor3k0qWIlKOq9r3VCvhRMWyh6GPdrtNm1 WNtt6CF+uhqx/eovZ1VsfF+t74u7I+zW/hVvDbwNexDv966ve1O0fBtqDx2ILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wk/94xi4nfXQryMqG3HpgpsmYMORTgaVTNIJt+SNTl8=; b=vbTQrOviZilQkBNCFLwH3XOTeiI4sSZvkbXSx6A+TjAWYdVvRIN5W2RAhHdijQvy0DCbg9 /CI6kPTonhVwUhQO1KpEcbBMOpq5sogXSCsXKfzfsszi8P+TXwk0K+3iZapyrenZPzbHRW pLn9oDZ7S+F5l16yDqoXG5T/daqXsb+MassevB62t2uT8UplvVgNvnua6e/2xjRazlBQoZ 3/pTkUrK8AdTGH2CgisgD4GdO9RoBIrDtQMGwtd1czSAOIoBoWs2uTUhXRpewgu2LDWuig zXD3hqyj2cC6Gekl7M7e22UQKLv+EJN/zG9wS6fuN+Ikzjruntu06ctMIwINtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752093343; a=rsa-sha256; cv=none; b=sRYR/osZKImE+L5tJm8DY0X+X/cSN3lRWRBRg2VEvZTsVAKFkygPHEYDpi4UyehZ7vvRSp HKVdKfrk21hSBH8oA1JrhkMju56m+AK713wtxjWakuxZ8OdnbKi6LyU+HjwAEqQc9rki2H YJFK2UQ0PwKBGiul6gVkOB0EgnafAIOVDIv9s7qiJsLNqxkmfHjkhWl8Kz+8cvMZtjnv0i Mw+TSR0L9kVAvb/0uB1ID5Qo1lrYqL+uJfMyZgscCjY2Hwpy4wQG4otiftBnvuH7jrF+ZR mu0W+fIhz2m/M88D2QdzvN/gitaVVc9DUICahA1H2YVKtJ1NjEvRebj4X6KcPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcqVl3sG1zf0R; Wed, 09 Jul 2025 20:35: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 569KZhRu065674; Wed, 9 Jul 2025 20:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KZhYb065671; Wed, 9 Jul 2025 20:35:43 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:35:43 GMT Message-Id: <202507092035.569KZhYb065671@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: dd81cc2bc5f2 - main - getdirentries: Return ENOTDIR if not a directory. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: dd81cc2bc5f25fb2c58bb59bf585deeeae196345 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dd81cc2bc5f25fb2c58bb59bf585deeeae196345 commit dd81cc2bc5f25fb2c58bb59bf585deeeae196345 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 20:34:18 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 20:34:18 +0000 getdirentries: Return ENOTDIR if not a directory. This is both more logical and more useful than EINVAL. While here, also check for VBAD and return EBADF in that case. This can happen if the underlying filesystem got forcibly unmounted after the directory was opened. Previously, this would also have returned EINVAL, which wasn't right but wasn't wrong either; however, ENOTDIR would not be appropriate. MFC after: never Sponsored by: Klara, Inc. Reviewed by: kevans, kib Differential Revision: https://reviews.freebsd.org/D51209 --- lib/libc/gen/opendir2.c | 5 +- lib/libsys/getdirentries.2 | 10 ++- sys/kern/vfs_syscalls.c | 17 +++- tests/sys/kern/Makefile | 1 + tests/sys/kern/getdirentries_test.c | 172 ++++++++++++++++++++++++++++++++++++ 5 files changed, 193 insertions(+), 12 deletions(-) diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c index 928145b468c1..7f207ed73441 100644 --- a/lib/libc/gen/opendir2.c +++ b/lib/libc/gen/opendir2.c @@ -315,11 +315,8 @@ __opendir_common(int fd, int flags, bool use_current_pos) */ dirp->dd_size = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size < 0) { - if (errno == EINVAL) - errno = ENOTDIR; + if (dirp->dd_size < 0) goto fail; - } dirp->dd_flags |= __DTF_SKIPREAD; } else { dirp->dd_size = 0; diff --git a/lib/libsys/getdirentries.2 b/lib/libsys/getdirentries.2 index 0e5840ce25cd..202ae133f548 100644 --- a/lib/libsys/getdirentries.2 +++ b/lib/libsys/getdirentries.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2023 +.Dd July 8, 2025 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -178,9 +178,7 @@ or non-NULL .Fa basep point outside the allocated address space. .It Bq Er EINVAL -The file referenced by -.Fa fd -is not a directory, or +The value of .Fa nbytes is too small for returning a directory entry or block of entries, or the current position pointer is invalid. @@ -192,6 +190,10 @@ error occurred while reading from or writing to the file system. Corrupted data was detected while reading from the file system. .It Bq Er ENOENT Directory unlinked but still open. +.It Bq Er ENOTDIR +The file referenced by +.Fa fd +is not a directory. .El .Sh SEE ALSO .Xr lseek 2 , diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index d880733cbfe7..c71e0d9ee569 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4314,10 +4314,6 @@ kern_getdirentries(struct thread *td, int fd, char *buf, size_t count, vp = fp->f_vnode; foffset = foffset_lock(fp, 0); unionread: - if (vp->v_type != VDIR) { - error = EINVAL; - goto fail; - } if (__predict_false((vp->v_vflag & VV_UNLINKED) != 0)) { error = ENOENT; goto fail; @@ -4330,6 +4326,19 @@ unionread: auio.uio_segflg = bufseg; auio.uio_td = td; vn_lock(vp, LK_SHARED | LK_RETRY); + /* + * We want to return ENOTDIR for anything that is not VDIR, but + * not for VBAD, and we can't check for VBAD while the vnode is + * unlocked. + */ + if (vp->v_type != VDIR) { + if (vp->v_type == VBAD) + error = EBADF; + else + error = ENOTDIR; + VOP_UNLOCK(vp); + goto fail; + } AUDIT_ARG_VNODE1(vp); loff = auio.uio_offset = foffset; #ifdef MAC diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 26c0013696c7..f2c24ad9dec9 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -18,6 +18,7 @@ ATF_TESTS_C+= kern_descrip_test # One test modifies the maxfiles limit, which can cause spurious test failures. TEST_METADATA.kern_descrip_test+= is_exclusive="true" ATF_TESTS_C+= fdgrowtable_test +ATF_TESTS_C+= getdirentries_test ATF_TESTS_C+= jail_lookup_root ATF_TESTS_C+= inotify_test ATF_TESTS_C+= kill_zombie diff --git a/tests/sys/kern/getdirentries_test.c b/tests/sys/kern/getdirentries_test.c new file mode 100644 index 000000000000..e66872ffe5b6 --- /dev/null +++ b/tests/sys/kern/getdirentries_test.c @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include +#include +#include +#include + +#include + +ATF_TC(getdirentries_ok); +ATF_TC_HEAD(getdirentries_ok, tc) +{ + atf_tc_set_md_var(tc, "descr", "Successfully read a directory."); +} +ATF_TC_BODY(getdirentries_ok, tc) +{ + char dbuf[4096]; + struct dirent *d; + off_t base; + ssize_t ret; + int dd, n; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE((ret = getdirentries(dd, dbuf, sizeof(dbuf), &base)) > 0); + ATF_REQUIRE_EQ(0, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_REQUIRE_EQ(base, lseek(dd, 0, SEEK_CUR)); + ATF_CHECK_EQ(0, close(dd)); + for (n = 0, d = (struct dirent *)dbuf; + d < (struct dirent *)(dbuf + ret); + d = (struct dirent *)((char *)d + d->d_reclen), n++) + /* nothing */ ; + ATF_CHECK_EQ((struct dirent *)(dbuf + ret), d); + ATF_CHECK_EQ(2, n); +} + +ATF_TC(getdirentries_ebadf); +ATF_TC_HEAD(getdirentries_ebadf, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "from an invalid descriptor."); +} +ATF_TC_BODY(getdirentries_ebadf, tc) +{ + char dbuf[4096]; + off_t base; + int fd; + + ATF_REQUIRE((fd = open("file", O_CREAT | O_WRONLY, 0644)) >= 0); + ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EBADF, errno); + ATF_REQUIRE_EQ(0, close(fd)); + ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EBADF, errno); +} + +ATF_TC(getdirentries_efault); +ATF_TC_HEAD(getdirentries_efault, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "to an invalid buffer."); +} +ATF_TC_BODY(getdirentries_efault, tc) +{ + char dbuf[4096]; + off_t base, *basep; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE_EQ(-1, getdirentries(dd, NULL, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EFAULT, errno); + basep = NULL; + basep++; + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, sizeof(dbuf), basep)); + ATF_CHECK_EQ(EFAULT, errno); + ATF_CHECK_EQ(0, close(dd)); +} + +ATF_TC(getdirentries_einval); +ATF_TC_HEAD(getdirentries_einval, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "with various invalid parameters."); +} +ATF_TC_BODY(getdirentries_einval, tc) +{ + struct statfs fsb; + char dbuf[4096]; + off_t base; + ssize_t ret; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE_EQ(0, fstatfs(dd, &fsb)); + /* nbytes too small */ + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, 8, &base)); + ATF_CHECK_EQ(EINVAL, errno); + /* nbytes too big */ + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, SIZE_MAX, &base)); + ATF_CHECK_EQ(EINVAL, errno); + /* invalid position */ + ATF_REQUIRE((ret = getdirentries(dd, dbuf, sizeof(dbuf), &base)) > 0); + ATF_REQUIRE_EQ(0, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_REQUIRE(base > 0); + ATF_REQUIRE_EQ(base + 3, lseek(dd, 3, SEEK_CUR)); + /* known to fail on ufs (FFS2) and zfs, and work on tmpfs */ + if (strcmp(fsb.f_fstypename, "ufs") == 0 || + strcmp(fsb.f_fstypename, "zfs") == 0) { + atf_tc_expect_fail("incorrectly returns 0 instead of EINVAL " + "on %s", fsb.f_fstypename); + } + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EINVAL, errno); + ATF_CHECK_EQ(0, close(dd)); +} + +ATF_TC(getdirentries_enoent); +ATF_TC_HEAD(getdirentries_enoent, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "after it is deleted."); +} +ATF_TC_BODY(getdirentries_enoent, tc) +{ + char dbuf[4096]; + off_t base; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE_EQ(0, rmdir("dir")); + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(ENOENT, errno); +} + +ATF_TC(getdirentries_enotdir); +ATF_TC_HEAD(getdirentries_enotdir, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "from a descriptor not associated with a directory."); +} +ATF_TC_BODY(getdirentries_enotdir, tc) +{ + char dbuf[4096]; + off_t base; + int fd; + + ATF_REQUIRE((fd = open("file", O_CREAT | O_RDWR, 0644)) >= 0); + ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(ENOTDIR, errno); + ATF_CHECK_EQ(0, close(fd)); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, getdirentries_ok); + ATF_TP_ADD_TC(tp, getdirentries_ebadf); + ATF_TP_ADD_TC(tp, getdirentries_efault); + ATF_TP_ADD_TC(tp, getdirentries_einval); + ATF_TP_ADD_TC(tp, getdirentries_enoent); + ATF_TP_ADD_TC(tp, getdirentries_enotdir); + return (atf_no_error()); +} From nobody Wed Jul 9 20:42:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcqfT253Wz60xGg; Wed, 09 Jul 2025 20:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqfT1Pw6z40WF; Wed, 09 Jul 2025 20:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/AqNPOrC0i0wdKCDyYrvq/NbQnDHaKXEipOm+eiooY8=; b=ukd5GFx60oA+RvP+EUCFBcrMXiyx4uEEO4LkhJRGK2YG+tkh5xNLviAhZOdxXykEjLInzN 8YnPDs5teQWIdFfq+DGY/B6MpdlwSB5VUbPLx21UUjP6MKatxMN3U+7a9KqtwykpYnhIRx XfccECJ+Oa/HN7uU2I2krzGcswz9DgQDGGoXHu+Xo3FXpuf5fWJNtJPDhPHPDvjQ4u1aJo vWtCTJJTi3JRiyHtdzvpmyjh2E9kwmllY6wc3McDaHt+Oka2xE1qup5VyraOfkE4VqMW0+ D7VTUtYyCpo8PA+xCYzwxs+l8GTkALqO0/tT6z2e3Rm2PpIJOZDU9P6rt3/PbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/AqNPOrC0i0wdKCDyYrvq/NbQnDHaKXEipOm+eiooY8=; b=b84pw0g+ls0AS6qNFvM5XNbZVYGxuVPaluSYvmFdu9mJPz5lJE9jPXEX33ZdPme1NF5EtD xS3iNGcblecZFGv3XO4ZBwrApWQ8YLnqKytTgkijb5Lg03LSPlOLqpaDfHktdi+q9IYiND JIN0a/XO1DP0J0DaRetZiSsWLy1tR3mSnjXECO/c8QvmBRQ+bC73dquZnfG05zYbVtEW5N KIYozz56YcLEbNfBTjXJEQW0kFVp/PwPSbza+6ZhQiv3qBqVLPEMLEdSCZkr/YcWVCA9oF M2o+ljUNHoxJYyAONdKPK7gXY+ppJc0cG2lxxzzVQQLoxr8ItNmJxeI2hdDB8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752093745; a=rsa-sha256; cv=none; b=iI/v9fPu7n7vfV4iYyBmqVdZuoFigjc2LIyDEWCrF/v9ImN+rYd4/hWe01K9iyDhLZj4kM slAdcT9P3z46lr7x2zLUM7+S+vttAqSeRBueyoLIV3b04EfF/AiAlKLFFvAZvOzLgS4qb/ Pt+KusUKiBqfBPnkvqPtwrxEmjCqVpwIIksdKPcnU+oEniUdNnwPFcFTZsmU1iSIwhRDpq TnaedkfgsiMo6mnGhe73o+tSiZS9Ww4IgHGV8EWzlCKqE2VnBkTHYcsVJGu7wd61ojUcCj XbLvsOYeenFdkhHpuII1ff4RmvtFVEinUiVc9ISkXkRESdO5R495sLRvm01+XQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcqfT0pfBzfDp; Wed, 09 Jul 2025 20:42: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 569KgPCq083188; Wed, 9 Jul 2025 20:42:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KgPZH083185; Wed, 9 Jul 2025 20:42:25 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:42:25 GMT Message-Id: <202507092042.569KgPZH083185@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: 4982db387fc8 - main - pfctl: Fix 32-bit build. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4982db387fc85a13f1da39462fe1b83bec0c1248 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4982db387fc85a13f1da39462fe1b83bec0c1248 commit 4982db387fc85a13f1da39462fe1b83bec0c1248 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-09 20:42:10 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-09 20:42:10 +0000 pfctl: Fix 32-bit build. Fixes: 19973701098c8 Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D51230 --- sbin/pfctl/pfctl_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 29d51214e2e5..bd2c10c8080f 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -368,8 +368,8 @@ print_ugid(u_int8_t op, id_t i1, id_t i2, const char *t) { char a1[11], a2[11]; - snprintf(a1, sizeof(a1), "%lu", i1); - snprintf(a2, sizeof(a2), "%lu", i2); + snprintf(a1, sizeof(a1), "%ju", (uintmax_t)i1); + snprintf(a2, sizeof(a2), "%ju", (uintmax_t)i2); printf(" %s", t); if (i1 == -1 && (op == PF_OP_EQ || op == PF_OP_NE)) print_op(op, "unknown", a2); From nobody Wed Jul 9 22:58:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bctgw2Jwcz6163D; Wed, 09 Jul 2025 22:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bctgv3Hz5z4PYZ; Wed, 09 Jul 2025 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752101931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f7FXttJSlaDqu7KI7kcnBDSG6VKcTgrnT6/vrXqrFhY=; b=BZKSVKK+gRIiQgg72a+7kfT5EzEPSnXUC5HySXlcncupSU6ThRr54f93AsgNKIOpMpxOpN ngqPxsloDJO1GDPKrIkksepu1wjZf7M9YI5eZTRXY55fL72q4wm3X9jdRpKnYQgoLrO+6k Xmprd2OBciwu8CMbeqQy0CSgrRU3UwGX161OV3zj3n5qSqYtV2w+bR/856PPLGuQxpFys0 QTZg1LPUXXtcwFL1JDqpuOyqh4Z4BCV+6/MEzaLx/aeNGn12n/WLJ9shXEPALLB5t8WMZ3 L9Kp1WmzVyUQKEUPQmHhsfhDyaeR+vrbg+q226J3ptWm7Z0ACa+ViWArGJ9oaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752101931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f7FXttJSlaDqu7KI7kcnBDSG6VKcTgrnT6/vrXqrFhY=; b=ecmm617w8Fw/JgPUSuUnpeusKskfYREeiGJbV4gn8yE1YAGRozXX2WwW9bhxRVOaV617pt 5rTmOUwPziX41Py/VxzfgX4cDP6vWGFfAt4R6iAst91T9/eZLU8CGqtbwHTJ1kitr0A8js lLq9xrFv/hUVXDX7XchMsXHAYG5BAaKQKjOp7VdKIOoMUcC4nS5luhsTaQT/whjV+aV0CC V7aM3XzUSBUy6U+bvMyDTpWJFYJJchrOJJDnp2+OON5t6UPIeL1Y2abRBLBIiCedfR04mb oSQzELl8qUAyq1LN11c1jmoq1gXJsc+1S6Ve/m+FEaXUlzdJ4cm80sfppOAeyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752101931; a=rsa-sha256; cv=none; b=AMsXVQthiSiwi6nxUW5H8Wve8kvnPNK9qSb9/JeTDcNWtTGU2SdWGHxvm3P0x7I5qvkJML vRljlICNhQEoxdYQPrC3nSdctRaynqVIjZr6GFL1W0UQ7T8J6xJ5/nG94xHoA3hv4HkgBR eDWoU8iMCAPV8iHapOlFyPIP0J9Mmh8p9wbf2pOZZCK4P2Xd3Am0BchqKSmkh+paShPga7 rO1eH4dC9upe4ivRbhbKKm9QjCc+Xt9tPK97CAzcnoEaXV4KevXEV4UXKkLvcEt25RKrv2 NWRsMdgJqYbiD7JOXAqB9XwBg+kxmL0H/nVjn6gFP46ObmaxGqvsbTHSqlnymw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bctgv2VWhzjLB; Wed, 09 Jul 2025 22:58: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 569MwpAj031082; Wed, 9 Jul 2025 22:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569Mwp51031079; Wed, 9 Jul 2025 22:58:51 GMT (envelope-from git) Date: Wed, 9 Jul 2025 22:58:51 GMT Message-Id: <202507092258.569Mwp51031079@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: c130914d2923 - main - named_attribute.7: Document the named attribute mechanism List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c130914d2923db4a31e83abd054a6a455d3226b3 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c130914d2923db4a31e83abd054a6a455d3226b3 commit c130914d2923db4a31e83abd054a6a455d3226b3 Author: Rick Macklem AuthorDate: 2025-07-09 22:55:52 +0000 Commit: Rick Macklem CommitDate: 2025-07-09 22:55:52 +0000 named_attribute.7: Document the named attribute mechanism The named attribute interface is an alternate way to manipulate extended attributes, based on the interface provided by Solaris. This man page documents this interface. Reviewed by: kib, ziaee (manpages), pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D49851 Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes") --- share/man/man7/Makefile | 1 + share/man/man7/named_attribute.7 | 275 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 276 insertions(+) diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 021bf9251bda..7daa0ffed8ea 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -17,6 +17,7 @@ MAN= arch.7 \ intro.7 \ maclabel.7 \ mitigations.7 \ + named_attribute.7 \ operator.7 \ orders.7 \ ports.7 \ diff --git a/share/man/man7/named_attribute.7 b/share/man/man7/named_attribute.7 new file mode 100644 index 000000000000..0c15d8ee91b8 --- /dev/null +++ b/share/man/man7/named_attribute.7 @@ -0,0 +1,275 @@ +.\" +.\" Copyright (c) 2025 Rick Macklem +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd July 3, 2025 +.Dt NAMED_ATTRIBUTE 7 +.Os +.Sh NAME +.Nm named_attribute +.Nd Solaris-like extended attribute system interface +.Sh DESCRIPTION +Description of the system interface for named attributes +(the NFS Version 4 terminology). +.Ss Introduction +This document describes an alternate system interface for extended +attributes as compared to +.Xr extattr 2 . +It is based on the interface provided by Solaris and NFS Version 4. +.Pp +This interface associates a directory, known as a named attribute directory, +to a file system object. +This directory is read in the same manner as a normal directory via the +.Xr getdents 2 +or +.Xr getdirentries 2 +system calls. +The +.Pa .\& +and +.Pa ..\& +entries refer to the directory itself and to the associated file object, +respectively. +The other entries in this directory +are the names of the extended attributes for the associated file object +and are referred to as named attributes. +These named attributes are regular files used to store the attribute's +value. +.Pp +A named attribute directory does not live in the file system's name space. +It is accessed via an +.Xr open 2 +or +.Xr openat 2 +system call done on a file to query the named attributes for the file, +with the +.Dv O_NAMEDATTR +flag specified and a +.Fa path +argument of +.Pa .\& . +This file descriptor can be used as the +.Fa fd +argument for a variety of system calls, such as: +.Xr fchdir 2 , +.Xr unlinkat 2 +and +.Xr renameat 2 . +.Xr renameat 2 +is only permitted to rename a named attribute within the same named +attribute directory. +.Pp +When a file descriptor for a file object in the file system's namespace +is used as the +.Fa fd +argument of an +.Xr openat 2 +along with the +.Fa flag +.Dv O_NAMEDATTR +and a +.Fa path +argument that is the name of a named attribute (not +.Pa .\& +or +.Pa ..\& +), a file descriptor for the named attribute is returned. +If the +.Fa flag +.Dv O_CREAT +is specified, the named attribute will be created if it does not exist. +The +.Fa path +argument must be a single component name, with no embedded +.Dq / +in it. +I/O on these named attribute file descriptors may be performed by +standard I/O system calls +such as: +.Xr read 2 , +.Xr write 2 , +.Xr lseek 2 +and +.Xr ftruncate 2 . +.Pp +The +.Dv _PC_NAMEDATTR_ENABLED +.Fa name +argument to +.Xr pathconf 2 +will return 1 if the file system supports named attributes. +The +.Dv _PC_HAS_NAMEDATTR +.Fa name +argument to +.Xr pathconf 2 +will return 1 if there are one or more named attributes for the file. +If an application does a +.Xr openat 2 +of +.Dq .\& +to open a named attribute directory when no named attribute directory exists, +an empty named attribute directory will be created. +Testing +.Dv _PC_HAS_NAMEDATTR +can be done to avoid creating these named attribute directories unnecessarily. +.Pp +The named attribute interface is a different mechanism/system call interface for +manipulating extended attributes compared with +.Xr extattr 2 . +Although the named attribute machanism might require different internal +implementation +of extended attributes within a file system, both ZFS and NFSv4 provide +both mechanisms, which can be used interchangably to manipulate +extended attributes, but with a couple of limitations. +.Bl -bullet +.It +The +.Xr extattr 2 +interface requires that an extended attribute's value be set or acquired +via a single system call using a single buffer. +This limits the size of the attribute's value. +.It +The named attribute interface does not support system namespace +extended attributes and, +as such, system namespace extended attributes must be manipulated via +.Xr extattr 2 . +.El +.Pp +The named attribute mechanism/system call interface provides certain +advantages over +.Xr extattr 2 . +Since the attribute's value is updated via +.Xr read 2 +and +.Xr write 2 +system calls, the attribute's data may be as large as any regular file +and may be partially updated. +(Note that this interface does not provide the atomicity guarantee that +.Xr extattr 2 +does.) +The permission to access a named attribute directory is determined from +the access control information for the associated file object. +However, access control information can be set on each individual attribute +in a manner similar to a regular file. +This provides +.Dq per attribute +granular control over attribute permissions via +.Xr fchown 2 . +.Pp +At this time, the only local file system which supports this interface +is ZFS and only if the +.Dv xattr +property is set to +.Dq dir . +(Note that, even when +.Dq zfs get xattr +shows +.Dq on +the command +.Dq zfs set xattr=dir +must be done, followed by a remount to make the setting take effect.) +A NFSv4 mount will also support this interface, but only if the NFSv4 +server file system supports named attributes (the openattr operation). +The +.Fx +NFSv4 server supports named attributes only +for ZFS exported file systems where the +.Dq xattr +property is set to +.Dq dir +for the file system. +.Sh EXAMPLES +.Bd -literal +#include +#include +#include +#include + +\&... + +/* For a file called "myfile". Failure checks removed for brevity. */ +int file_fd, nameddir_fd, namedattr_fd; +ssize_t siz; +char buf[DIRBLKSIZ], *cp; +struct dirent *dp; +long named_enabled, has_named_attrs; + +\&... +/* Check to see if named attributes are supported. */ +named_enabled = pathconf("myfile", _PC_NAMEDATTR_ENABLED); +if (named_enabled <= 0) + err(1, "Named attributes not enabled"); +/* Test to see if named attribute(s) exist for the file. */ +has_named_attrs = pathconf("myfile", _PC_HAS_NAMEDATTR); +if (has_named_attrs == 1) + printf("myfile has named attribute(s)\\n"); +else + printf("myfile does not have any named attributes\\n"); +/* Open a named attribute directory. */ +file_fd = open("myfile", O_RDONLY, 0); +nameddir_fd = openat(file_fd, ".", O_NAMEDATTR, 0); +\&... +/* and read it, assuming it all fits in DIRBLKSIZ for simplicity. */ +siz = getdents(fd, buf, sizeof(buf)); +cp = buf; +while (cp < &buf[siz]) { + dp = (struct dirent *)cp; + printf("name=%s\\n", dp->d_name); + cp += dp->d_reclen; +} +\&... +/* Open/create a named attribute called "foo". */ +namedattr_fd = openat(file_fd, "foo", O_CREAT | O_RDWR | + O_TRUNC | O_NAMEDATTR, 0600); +\&... +/* Write foo's attribute value. */ +write(namedattr_fd, "xxxyyy", 6); +\&... +/* Read foo's attribute value. */ +lseek(namedattr_fd, 0, SEEK_SET); +siz = read(namedattr_fd, buf, sizeof(buf)); +\&... +/* And close "foo". */ +close(namedattr_fd); +\&... +/* Rename "foo" to "oldfoo". */ +renameat(nameddir_fd, "foo", nameddir_fd, "oldfoo"); +/* and delete "oldfoo". */ +unlinkat(nameddir_fd, "oldfoo", AT_RESOLVE_BENEATH); +.Ed +.Pp +The +.Xr runat 1 +command may be used to perform shell commands on named attributes. +For example: +.Bd -literal +$ runat myfile cp /etc/hosts attrhosts # creates attrhosts +$ runat myfile cat attrhosts # displays contents of attrhosts +$ runat myfile ls -l # lists the attributes for myfile +.Ed +.Pp +If using the +.Xr bash 1 +shell, the command +.Dq cd -@ foo +enters the named attribute directory for the file object +.Dq foo . +.Sh SEE ALSO +.Xr bash 1 , +.Xr runat 1 , +.Xr chdir 2 , +.Xr extattr 2 , +.Xr lseek 2 , +.Xr open 2 , +.Xr pathconf 2 , +.Xr read 2 , +.Xr rename 2 , +.Xr truncate 2 , +.Xr unlinkat 2 , +.Xr write 2 , +.Xr zfsprops 7 +.Sh HISTORY +This interface first appeared in +.Fx 15.0 . From nobody Wed Jul 9 23:21:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bcvBM61T0z617T0; Wed, 09 Jul 2025 23:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcvBM59BNz3SVy; Wed, 09 Jul 2025 23:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752103307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sd+L8NQYqbGI28hTxXtyIq/2KNeu/9UY9Nvah47OaAs=; b=gGs2qs1c5ZNL/F779yhkgQefo9ra6KFhcEsZ4trDaKKUXtjjIKBluM0lFs5WaUzGCgSVwr 95/aXEJHfltR4e7lnjnwUD5ePKgxcTeV00ot05m73aEdq34UsNlU9kwbtCDEhSGTWo0eax hLguaxZ0Q15c8PyavyMvkgm0G/MDDiQwAJSMd/uFHk7rZgM3m1siqGGmgCjxT9fGrf0Bft +tRR1pFvEvKOru5ucVquwi3aU2rRPzCKUdCJLkxU9X0AywE7jxPttyYW/GLtKYT1XGIWkI X2xiL9PNy6S/Q5T9qAJMzV1WOhQOlG1ZGauXW6lBFPjHVRy/XUh02DwaRwNdrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752103307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sd+L8NQYqbGI28hTxXtyIq/2KNeu/9UY9Nvah47OaAs=; b=M9BJMqDjSC6FhVe8OmUjxm6V3IcldL4lG+Z35SANQi6hBZlPTuR0UpQZCs9uPG/O7ONWK9 glrJuLlzbfHmOaOtLTWJOhD5M4sgJjFZvwxz2W0BVYxEb/fKYrpGlKuq5bdbUtoPsRhAt1 ojnN6/1fMwPGvD2l+LMuuPy5cvP12miQbcq79AHWbdCzeyLWRVohIyidXD24L6GA3ev2PM 2G+mRj4KMvSxdf7CgD3/Nr9D2hyxW4p7XPmYLdH4CUkCsGEL6+pGWAd1UHYN492ucf5xfS SNjGz2QI9Q2lHSYMkp22s5IwQed4OXad8xkXZPw6dDO6tI7LU3/prsBmf/KDEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752103307; a=rsa-sha256; cv=none; b=FgpU7RAPXfYw4VkOq3wPilMNVQVCGtVUCM335G1UCfgT2azXN6sSBPzjBG5GcC/iKncopx GOnua+oIk5iweDVjL/7ESEb9HzPxZ22yyfHQEpuFZ5qYqRBG5meHX5d7ZQcyF5ElQTJMce ezA7hn3OgseC4pENT75uAq8wkilTfNYb3Vo2s+JbHFV5J3iM5eFoMkyIebO6d65PpMg4jg fT8bTaxN15ka1tx7HJe0SpiuyVeI+NtxwOSyXNx4oTgc6v+kNe+SPc07VGx0i+86SjL8iA WfuKzrOBFq38aOvNLQe4ni15fV9t94onsbhYwYXG6HwEyeJRL9fGBqM/4+E7fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bcvBM4Zn7zk7G; Wed, 09 Jul 2025 23:21: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 569NLlWi085627; Wed, 9 Jul 2025 23:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569NLltF085610; Wed, 9 Jul 2025 23:21:47 GMT (envelope-from git) Date: Wed, 9 Jul 2025 23:21:47 GMT Message-Id: <202507092321.569NLltF085610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 78935fa40eee - main - named_attribute.7: typo fix List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78935fa40eee14aab1c6de676a1017bcabdf5fa1 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=78935fa40eee14aab1c6de676a1017bcabdf5fa1 commit 78935fa40eee14aab1c6de676a1017bcabdf5fa1 Author: Maxim Konovalov AuthorDate: 2025-07-09 23:21:03 +0000 Commit: Maxim Konovalov CommitDate: 2025-07-09 23:21:03 +0000 named_attribute.7: typo fix --- share/man/man7/named_attribute.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/named_attribute.7 b/share/man/man7/named_attribute.7 index 0c15d8ee91b8..7cd778620357 100644 --- a/share/man/man7/named_attribute.7 +++ b/share/man/man7/named_attribute.7 @@ -121,7 +121,7 @@ manipulating extended attributes compared with Although the named attribute machanism might require different internal implementation of extended attributes within a file system, both ZFS and NFSv4 provide -both mechanisms, which can be used interchangably to manipulate +both mechanisms, which can be used interchangeably to manipulate extended attributes, but with a couple of limitations. .Bl -bullet .It From nobody Thu Jul 10 08:17:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bd74l74bKz61j32; Thu, 10 Jul 2025 08:17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bd74l5NsGz3rwf; Thu, 10 Jul 2025 08:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752135463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMUmGhNOLHdkipVKt8mGrnNmL7mnzDFYfkZoO2wqDCA=; b=sGi2wIAEib8nKvbVsZJ3UtOXhSLcTunImlcnOi0kot6X84OJBbqcNpKrxwVey8De9Rdo9t 27wD8dBMONx6I9cf83EU4qNxhUQL620jVhV7Xz2bzaDAsbRzJjizMyEGID1s05PMS6fqBa SAxjl8jkIsa2TXNcQFb6qrrRzfl6jNfU49M08+6qEHXoDalqUUr1etd7xblhZzqXGIhn2H esXyJgUMKsuFnSi3tg6nIl0Yg/zkbW8FcnzSDtu2wCCpacbWDD8wqD5UtEN7NCbcbw/wjs MBoFa9KoE6q+ZpJQCKOonISd8CJYA+0FvdDhOa4wJGHwDWqqCx0oRlFBX2aFaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752135463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMUmGhNOLHdkipVKt8mGrnNmL7mnzDFYfkZoO2wqDCA=; b=MeGEJtJi/cprHFH/QUYTKAjeB2a0IwcQp3aZ4Na+gdRjmwRQLgKAMVEoi1s4fC0ELqkDUl FXV952KYxHwKonr86XUmJsPswc3JMWKOkpT0A1NUpEnFTZCNZxH4G3EFsUhJzrsn5Qlp/N QcMFwhJ800HBDpPsp4pJHJm12d9eeirZwiYy0PMVCt2KUYL6EiKl2ETcZvt6ZLz33H2vWr 1Qsq4YOAlIOZQkNL9iOpkbAl38qEdjq6iQe70+3Fkn18YWO4zemDESvw6QRZTGj7Bp5FEE cUWmmWKJ8jvmkBezuttG5MRKhwcOh8KNAJeRujhz9waYPPyE1uunCRxxLBysfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752135463; a=rsa-sha256; cv=none; b=HVnwEHqmEilw0H0IwYw2+3uRH6KndAZYuGDHtofBpPeMMWx3Oomf1/MAjmFleNf4TR9QyR 6VoH3ykLasAujr2HBfn+IZHqeuyD8vMOyleGtWN/jC3s096Q5vO4WLjHqhO1D0euH05kuE z+lmp0zdBj8SehJ/fe+/gxx/3bhsXKwEuPMP50uvNnEv19Vm1x05qLQDSYpyQubjnV1JgG aqlflj0febyv9tmRN3VEvnjugazBUraMEjue7MI8TxsWPborB1ayU0jFWZIo4HJszKzzUK N2ATdBy/5exq6D6CyOCQT0V3icfkF6bAkxlllePam0HjubLDTAJbiuxmIFMZaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bd74l4rQjzyj7; Thu, 10 Jul 2025 08:17: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 56A8HhEo083909; Thu, 10 Jul 2025 08:17:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56A8HhkK083906; Thu, 10 Jul 2025 08:17:43 GMT (envelope-from git) Date: Thu, 10 Jul 2025 08:17:43 GMT Message-Id: <202507100817.56A8HhkK083906@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: 8adb3acb63ee - main - pctrie: leave iter at root after ge_lookup failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8adb3acb63ee8e7c20c3da497a9640c481bc7612 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=8adb3acb63ee8e7c20c3da497a9640c481bc7612 commit 8adb3acb63ee8e7c20c3da497a9640c481bc7612 Author: Doug Moore AuthorDate: 2025-07-10 08:14:07 +0000 Commit: Doug Moore CommitDate: 2025-07-10 08:14:07 +0000 pctrie: leave iter at root after ge_lookup failure If pctrie_lookup_iter_ge fails to return a node, the iterator is left with NULL as the current node. Instead, make the pctrie_root the current node when the pctrie has an internalnode. Do the same thing for lookup_iter_le. If an iterator is reused after a ge/le lookup fails, this will skip the step in _pctrie_lookup_node where a NULL is replaced by the node at the top of the trie. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D51232 --- sys/kern/subr_pctrie.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 3a3548bad52b..bb86c779b936 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -691,21 +691,23 @@ _pctrie_lookup_ge(struct pctrie *ptree, struct pctrie_node *node, */ if (node == PCTRIE_NULL || *pctrie_toval(node) < index) { /* Climb the path to find a node with a descendant > index. */ - for (node = parent; node != NULL; node = pctrie_parent(node)) { - slot = pctrie_slot(node, index) + 1; - if ((node->pn_popmap >> slot) != 0) + node = NULL; + while (parent != NULL) { + slot = pctrie_slot(parent, index) + 1; + if ((parent->pn_popmap >> slot) != 0) break; + node = parent; + parent = pctrie_parent(node); } - if (node == NULL) { + if (parent == NULL) { if (parent_out != NULL) - *parent_out = NULL; + *parent_out = node; return (NULL); } /* Step to the least child with a descendant > index. */ - slot += ffs(node->pn_popmap >> slot) - 1; - parent = node; - node = pctrie_node_load(&node->pn_child[slot], NULL, + slot += ffs(parent->pn_popmap >> slot) - 1; + node = pctrie_node_load(&parent->pn_child[slot], NULL, PCTRIE_LOCKED); } /* Descend to the least leaf of the subtrie. */ @@ -785,21 +787,23 @@ _pctrie_lookup_le(struct pctrie *ptree, struct pctrie_node *node, */ if (node == PCTRIE_NULL || *pctrie_toval(node) > index) { /* Climb the path to find a node with a descendant < index. */ - for (node = parent; node != NULL; node = pctrie_parent(node)) { - slot = pctrie_slot(node, index); - if ((node->pn_popmap & ((1 << slot) - 1)) != 0) + node = NULL; + while (parent != NULL) { + slot = pctrie_slot(parent, index); + if ((parent->pn_popmap & ((1 << slot) - 1)) != 0) break; + node = parent; + parent = pctrie_parent(node); } - if (node == NULL) { + if (parent == NULL) { if (parent_out != NULL) - *parent_out = NULL; + *parent_out = node; return (NULL); } /* Step to the greatest child with a descendant < index. */ - slot = ilog2(node->pn_popmap & ((1 << slot) - 1)); - parent = node; - node = pctrie_node_load(&node->pn_child[slot], NULL, + slot = ilog2(parent->pn_popmap & ((1 << slot) - 1)); + node = pctrie_node_load(&parent->pn_child[slot], NULL, PCTRIE_LOCKED); } /* Descend to the greatest leaf of the subtrie. */ From nobody Thu Jul 10 12:27:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdDd62t0Lz610Qr; Thu, 10 Jul 2025 12:27:38 +0000 (UTC) (envelope-from des@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdDd622ZHz3Qj2; Thu, 10 Jul 2025 12:27:38 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752150458; 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=yMRVUrLADzAa168uFTk5QuYr+zdTM2bolCIvpYYN5ys=; b=GCxI2g7h/LxHKKWcnaXoh9Mb4NQ0xdB0kIUldE4xCrpWZOLzSpZrUCq4v/QhsmwyBEiULS bw0jt5g2gzRcy3fbmi08y8S1LNfwhk+7sGB6DW8bGbOV+VaNduo9dKI+kep2xnrtwf2ZA1 XgyXFxQxvlbZQte0HHpe/A9FdEBqz7qobrVZRDufVFM73GsULnbTaLLQzj0fPIRB3+vGhr iRv8zO74LSX6PQJhz/qOXhlDNC/yXdHCmXwkzp9t5Xtz8xCTmlvRyYhR8GF5IOXgh2ztE8 3gkVmQhiWVC3DkaBhVhRVej1aer3WV9Tp7rOj71Xbffh7G718BWwF3wU5zGYkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752150458; 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=yMRVUrLADzAa168uFTk5QuYr+zdTM2bolCIvpYYN5ys=; b=b+3PeVPuPmqhMdHY3W1cya6nZe0+fwHKgsffezR55h9V+12QddjS4pEz7v9FcjZlXN+fhv Ljn7pkeF4ZCzgrotpTmZ8EWN5NRPJAdxG7LnUgTOprYAvfDEJ50vrPG4/T1egtgYi0ck2v 2Qrhs44rUkCIq0MJOBWG8kbiFp4SCpF6SX4vxjNgKCcuh+kUX/B7W1ww4138rig/fXBjea xO2M+NbRqcqu/vTGzPgP9biXl7nvFmp1ZYT6iC7yc/Kw1f/4Np4TXSih03jfJNQmklh8qb GO1/mJbMXoM7GV5xvKfOM9BbrI97UiuUeI0wxImec1Fi2gEAEe50XPU7U/GZfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752150458; a=rsa-sha256; cv=none; b=BYrYxDPlVGh+js08SOzvrgy8AnrI6UYSYoUgVM5xMHaB2ZHjqm3mLQu2AE3hQ3gnxEqMMf L88UPxSKt2yncBifRGapFfcR8oEORqnYvspr9gsmxgyFgJbbtJxfTZj6w9PqBBDd6ALgLj xWf+3z73O5P+IaelqyKSO2aQew9PIRzXP5WahZd+clqk9/wH062+nph+3oGsZQoZa+X2b3 KSg8hDnYV+xhQI1z3skkWVfAEBSvIAaRO7ADJiOE5E0b5RT5ONcBr5otD8t6b4PwvpcMTF jLtTnTDKFy77M4Fgxlh0zdU3IBRs4EANZb0tl6Sedj96/5BiBwHI+x6Zw4BYRA== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:c54:bed0:922e:16ff:fef1:acef]) (using TLSv1.3 with cipher TLS_AES_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: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bdDd614Zrzltj; Thu, 10 Jul 2025 12:27:38 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id DE295704AA; Thu, 10 Jul 2025 14:27:36 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Rick Macklem Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c5d72d29fe0e - main - nfsv4: Add support for the NFSv4 hidden and system attributes In-Reply-To: <202507062254.566MsbnL090918@gitrepo.freebsd.org> (Rick Macklem's message of "Sun, 6 Jul 2025 22:54:37 GMT") References: <202507062254.566MsbnL090918@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Thu, 10 Jul 2025 14:27:36 +0200 Message-ID: <867c0gcjt3.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rick Macklem writes: > diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnop= s.c > index 0049d7edca33..fbfcdafaa06b 100644 > --- a/sys/fs/nfsclient/nfs_clvnops.c > +++ b/sys/fs/nfsclient/nfs_clvnops.c > [...] > @@ -1092,7 +1100,8 @@ nfs_setattr(struct vop_setattr_args *ap) > vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D VNOVAL = || > vap->va_mtime.tv_sec !=3D VNOVAL || > vap->va_birthtime.tv_sec !=3D VNOVAL || > - vap->va_mode !=3D (mode_t)VNOVAL) && > + vap->va_mode !=3D (mode_t)VNOVAL || > + vap->va_flags !=3D (u_long)VNOVAL) && > (vp->v_mount->mnt_flag & MNT_RDONLY)) > return (EROFS); > if (vap->va_size !=3D VNOVAL) { vap->va_flags was already checked (in the line just before the first line of context), albeit without a cast. Coverity erroneously claims that this causes the entire expression to always be true, because it thinks VNOVAL and (u_long)VNOVAL are two different values. That's not the case, but you probably still want this: diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index fbfcdafaa06b..fa451887e73e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1096,12 +1096,11 @@ nfs_setattr(struct vop_setattr_args *ap) /* * Disallow write attempts if the filesystem is mounted read-only. */ - if ((vap->va_flags !=3D VNOVAL || vap->va_uid !=3D (uid_t)VNOVAL || + if ((vap->va_flags !=3D (u_long)VNOVAL || vap->va_uid !=3D (uid_t)VNOVAL = || vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D VNOVAL || vap->va_mtime.tv_sec !=3D VNOVAL || vap->va_birthtime.tv_sec !=3D VNOVAL || - vap->va_mode !=3D (mode_t)VNOVAL || - vap->va_flags !=3D (u_long)VNOVAL) && + vap->va_mode !=3D (mode_t)VNOVAL) && (vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); if (vap->va_size !=3D VNOVAL) { DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Thu Jul 10 12:53:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdFC01QJ2z611XC; Thu, 10 Jul 2025 12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdFC003bQz3YnL; Thu, 10 Jul 2025 12: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=1752152012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UzUG6imTCmBao230YGx4kJWgLaipQBiz4+EOaQ7YOsk=; b=Rkqp8H9E8f2BCo+zCH3oOT8Lkjq0iF9n/zS6bABb28KdXI/U5Riu1K2a6eXVMtDC7DDaWe 2RFvGw6C9tREbZMe6oHAM17kVKkSDFTHajfoIWJGvxfMahEibAuXGMLI15lVHRM/RiIuMl 5rT+GFLGa+ByE0bDRLvxZ4OagiyC8PqM1Bd5tjXjykpBwMpS/nhjbeHntMS2MQQ899JFb/ Uk2vYtz9/yI/4zIblHwQrTbgEo+btE2mOkBnCKw71nvy4r1etBY4YAZGP+bsgiCfFMA5fY JJS/8wWgRlTN78FvT5fDVCRPb0KCkR2UeBIwnSX2F19mDWoQQMIjwt4Dt0Sz+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752152012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UzUG6imTCmBao230YGx4kJWgLaipQBiz4+EOaQ7YOsk=; b=YQMgk6kU1dvNhKR8XSZG389uQPms6a6F95uRB7k6jdqYQSj/dEqGSc5L38EM8qbjDQLdp+ DDVvUrJQ18Yw71MZVXN9YhmC82o3R3SjemxvjOfHTGJorURPRcoEx6krzAx7ptvljesCFJ hht/kbJy8vwzFVnNN1esOzUEYoOPI2wxy388QXiCxdYAS887SVTq4KaKyRj2PwLSfIe1Mf kaS6pukY1zjB3eKU0UB4vkIw2yZvWWnF0+OvJIJsj8GAnm56/ICIIZ63rfp5nT7KJELolR sgiFJXE+2zx7aP1bZjIA/AzXVaIXPi957JdN71702+QkqRP1PikdKv78ZN8Xtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752152012; a=rsa-sha256; cv=none; b=QGmMxw+CuZbkJHFmFrB2eCwC8c9/Kcbkv/p7TEHqU3HbbT7kr9ZloI7oKNPPCSEhE3Pxt+ Kve6ifrI5063wrF0yGws9A8AIwCvFkIpfYiJyEiOCCJplGq9ovNIE+CPBInWY8msEtg5eg 8908QpCniNj0zrQcST4UXrV/8j0tE+Gmo0duqsPXGldpuGlpCWK54Ci6cIcGahgXgpQPbb OxU5/hkK1uvYsO04XQRb+C0b5qvFJBcBYjYEfuqzQQsfn7MFSFKApZ2RCMLPNx6qtXnwar tCdNNAQi5Y+zNTLPMOHcLHqUQ8gi6KFoDDui/pIxfA0P2tsiUIcu2n2AgX+v7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdFBz6j8Rz17fx; Thu, 10 Jul 2025 12: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 56ACrVZ3007470; Thu, 10 Jul 2025 12: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 56ACrVrQ007467; Thu, 10 Jul 2025 12:53:31 GMT (envelope-from git) Date: Thu, 10 Jul 2025 12:53:31 GMT Message-Id: <202507101253.56ACrVrQ007467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 42df4faf7004 - main - builtin.1: streamlined rewrite + document keybinds List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42df4faf7004aabb4f06acd71f860f12977db3ad Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=42df4faf7004aabb4f06acd71f860f12977db3ad commit 42df4faf7004aabb4f06acd71f860f12977db3ad Author: Alexander Ziaee AuthorDate: 2024-10-17 22:43:14 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-10 12:45:10 +0000 builtin.1: streamlined rewrite + document keybinds + clean title: one line with keywords, builtin's mlinked + additional search terms: FreeBSD, index + synopsis: builtins are documented in your shell's manual + clear/scoped introduction: increase straightforwardness + table alignment fixed, now renders nicely on MANWIDTH=59 + keybindings: fundamentals now documented, more please? + improved structure and flow, and a spdx tag + remove info(1) from SEE ALSO MFC after: 3 days Discussed with: imp,jlduran Reviewed by: imp Closes: https://github.com/freebsd/freebsd-src/pull/1481 --- share/man/man1/Makefile | 1 + share/man/man1/builtin.1 | 269 ++++++++++++++++------------------------------- 2 files changed, 93 insertions(+), 177 deletions(-) diff --git a/share/man/man1/Makefile b/share/man/man1/Makefile index e5ab6597ead2..5b1d3ac1091d 100644 --- a/share/man/man1/Makefile +++ b/share/man/man1/Makefile @@ -55,6 +55,7 @@ MLINKS= builtin.1 alias.1 \ builtin.1 if.1 \ builtin.1 jobid.1 \ builtin.1 jobs.1 \ + builtin.1 keybinds.1 \ builtin.1 limit.1 \ builtin.1 log.1 \ builtin.1 logout.1 \ diff --git a/share/man/man1/builtin.1 b/share/man/man1/builtin.1 index d546548ab4e5..ee89006caea5 100644 --- a/share/man/man1/builtin.1 +++ b/share/man/man1/builtin.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1999 Sheldon Hearn .\" .\" All rights reserved. @@ -24,175 +26,33 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 21, 2010 +.Dd March 29, 2025 .Dt BUILTIN 1 .Os .Sh NAME .Nm builtin , -.Nm \&! , -.Nm % , -.Nm \&. , -.Nm \&: , -.Nm @ , -.Nm \&[ , -.Nm { , -.Nm } , -.Nm alias , -.Nm alloc , -.Nm bg , -.Nm bind , -.Nm bindkey , -.Nm break , -.Nm breaksw , -.Nm builtins , -.Nm case , -.Nm cd , -.Nm chdir , -.Nm command , -.Nm complete , -.Nm continue , -.Nm default , -.Nm dirs , -.Nm do , -.Nm done , -.Nm echo , -.Nm echotc , -.Nm elif , -.Nm else , -.Nm end , -.Nm endif , -.Nm endsw , -.Nm esac , -.Nm eval , -.Nm exec , -.Nm exit , -.Nm export , -.Nm false , -.Nm fc , -.Nm fg , -.Nm filetest , -.Nm fi , -.Nm for , -.Nm foreach , -.Nm getopts , -.Nm glob , -.Nm goto , -.Nm hash , -.Nm hashstat , -.Nm history , -.Nm hup , -.Nm if , -.Nm jobid , -.Nm jobs , -.Nm kill , -.Nm limit , -.Nm local , -.Nm log , -.Nm login , -.Nm logout , -.Nm ls-F , -.Nm nice , -.Nm nohup , -.Nm notify , -.Nm onintr , -.Nm popd , -.Nm printenv , -.Nm printf , -.Nm pushd , -.Nm pwd , -.Nm read , -.Nm readonly , -.Nm rehash , -.Nm repeat , -.Nm return , -.Nm sched , -.Nm set , -.Nm setenv , -.Nm settc , -.Nm setty , -.Nm setvar , -.Nm shift , -.Nm source , -.Nm stop , -.Nm suspend , -.Nm switch , -.Nm telltc , -.Nm test , -.Nm then , -.Nm time , -.Nm times , -.Nm trap , -.Nm true , -.Nm type , -.Nm ulimit , -.Nm umask , -.Nm unalias , -.Nm uncomplete , -.Nm unhash , -.Nm unlimit , -.Nm unset , -.Nm unsetenv , -.Nm until , -.Nm wait , -.Nm where , -.Nm which , -.Nm while -.Nd shell built-in commands +.Nm keybinds +.Nd index of FreeBSD shell built-in commands .Sh SYNOPSIS -See the built-in command description in the appropriate shell manual page. +See the manual for your shell for operation details. .Sh DESCRIPTION -Shell builtin commands are commands that can be executed within the -running shell's process. -Note that, in the case of -.Xr csh 1 -builtin commands, the command is executed in a subshell if it occurs as -any component of a pipeline except the last. -.Pp -If a command specified to the shell contains a slash -.Ql / , -the shell will not execute a builtin command, even if the last component -of the specified command matches the name of a builtin command. -Thus, while specifying -.Dq Li echo -causes a builtin command to be executed under shells that support the -.Nm echo -builtin command, -specifying -.Dq Li /bin/echo -or -.Dq Li ./echo -does not. -.Pp -While some builtin commands may exist in more than one shell, their -operation may be different under each shell which supports them. -Below is a table which lists shell builtin commands, the standard shells -that support them and whether they exist as standalone utilities. -.Pp -Only builtin commands for the +This page provides an index of +.Nm +commands, keywords, and keyboard bindings provided by .Xr csh 1 and -.Xr sh 1 -shells are listed here. -Consult a shell's manual page for -details on the operation its builtin commands. -Beware that the -.Xr sh 1 -manual page, at least, calls some of these commands -.Dq built-in commands -and some of them -.Dq reserved words . -Users of other shells may need to consult an -.Xr info 1 -page or other sources of documentation. -.Pp -Commands marked -.Dq Li No** -under -.Em External -do exist externally, -but are implemented as scripts using a builtin command of the same name. -.Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent -.It Em Command Ta Em External Ta Xr csh 1 Ta Xr sh 1 +.Xr sh 1 , +the command line interpreters which comprise the +.Bx +user environment. +.Ss Commands +Below is a table which lists +.Nm +commands and keywords, +whether they exist as standalone utilities, +and the standard shells that provide them. +.Bl -column "uncomplete" "Standalone" "csh(1)" "sh(1)" -offset indent +.It Em Command Ta Em Standalone Ta Xr csh 1 Ta Xr sh 1 .It Ic \&! Ta \&No Ta \&No Ta Yes .It Ic % Ta \&No Ta Yes Ta \&No .It Ic \&. Ta \&No Ta \&No Ta Yes @@ -201,9 +61,9 @@ but are implemented as scripts using a builtin command of the same name. .It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes .It Ic } Ta \&No Ta \&No Ta Yes -.It Ic alias Ta No** Ta Yes Ta Yes +.It Ic alias Ta No* Ta Yes Ta Yes .It Ic alloc Ta \&No Ta Yes Ta \&No -.It Ic bg Ta No** Ta Yes Ta Yes +.It Ic bg Ta No* Ta Yes Ta Yes .It Ic bind Ta \&No Ta \&No Ta Yes .It Ic bindkey Ta \&No Ta Yes Ta \&No .It Ic break Ta \&No Ta Yes Ta Yes @@ -211,9 +71,9 @@ but are implemented as scripts using a builtin command of the same name. .It Ic builtin Ta \&No Ta \&No Ta Yes .It Ic builtins Ta \&No Ta Yes Ta \&No .It Ic case Ta \&No Ta Yes Ta Yes -.It Ic cd Ta No** Ta Yes Ta Yes +.It Ic cd Ta No* Ta Yes Ta Yes .It Ic chdir Ta \&No Ta Yes Ta Yes -.It Ic command Ta No** Ta \&No Ta Yes +.It Ic command Ta No* Ta \&No Ta Yes .It Ic complete Ta \&No Ta Yes Ta \&No .It Ic continue Ta \&No Ta Yes Ta Yes .It Ic default Ta \&No Ta Yes Ta \&No @@ -233,22 +93,22 @@ but are implemented as scripts using a builtin command of the same name. .It Ic exit Ta \&No Ta Yes Ta Yes .It Ic export Ta \&No Ta \&No Ta Yes .It Ic false Ta Yes Ta \&No Ta Yes -.It Ic fc Ta No** Ta \&No Ta Yes -.It Ic fg Ta No** Ta Yes Ta Yes +.It Ic fc Ta No* Ta \&No Ta Yes +.It Ic fg Ta No* Ta Yes Ta Yes .It Ic filetest Ta \&No Ta Yes Ta \&No .It Ic fi Ta \&No Ta \&No Ta Yes .It Ic for Ta \&No Ta \&No Ta Yes .It Ic foreach Ta \&No Ta Yes Ta \&No -.It Ic getopts Ta No** Ta \&No Ta Yes +.It Ic getopts Ta No* Ta \&No Ta Yes .It Ic glob Ta \&No Ta Yes Ta \&No .It Ic goto Ta \&No Ta Yes Ta \&No -.It Ic hash Ta No** Ta \&No Ta Yes +.It Ic hash Ta No* Ta \&No Ta Yes .It Ic hashstat Ta \&No Ta Yes Ta \&No .It Ic history Ta \&No Ta Yes Ta \&No .It Ic hup Ta \&No Ta Yes Ta \&No .It Ic if Ta \&No Ta Yes Ta Yes .It Ic jobid Ta \&No Ta \&No Ta Yes -.It Ic jobs Ta No** Ta Yes Ta Yes +.It Ic jobs Ta No* Ta Yes Ta Yes .It Ic kill Ta Yes Ta Yes Ta Yes .It Ic limit Ta \&No Ta Yes Ta \&No .It Ic local Ta \&No Ta \&No Ta Yes @@ -265,7 +125,7 @@ but are implemented as scripts using a builtin command of the same name. .It Ic printf Ta Yes Ta \&No Ta Yes .It Ic pushd Ta \&No Ta Yes Ta \&No .It Ic pwd Ta Yes Ta \&No Ta Yes -.It Ic read Ta No** Ta \&No Ta Yes +.It Ic read Ta No* Ta \&No Ta Yes .It Ic readonly Ta \&No Ta \&No Ta Yes .It Ic rehash Ta \&No Ta Yes Ta \&No .It Ic repeat Ta \&No Ta Yes Ta \&No @@ -288,26 +148,68 @@ but are implemented as scripts using a builtin command of the same name. .It Ic times Ta \&No Ta \&No Ta Yes .It Ic trap Ta \&No Ta \&No Ta Yes .It Ic true Ta Yes Ta \&No Ta Yes -.It Ic type Ta No** Ta \&No Ta Yes -.It Ic ulimit Ta No** Ta \&No Ta Yes -.It Ic umask Ta No** Ta Yes Ta Yes -.It Ic unalias Ta No** Ta Yes Ta Yes +.It Ic type Ta No* Ta \&No Ta Yes +.It Ic ulimit Ta No* Ta \&No Ta Yes +.It Ic umask Ta No* Ta Yes Ta Yes +.It Ic unalias Ta No* Ta Yes Ta Yes .It Ic uncomplete Ta \&No Ta Yes Ta \&No .It Ic unhash Ta \&No Ta Yes Ta \&No .It Ic unlimit Ta \&No Ta Yes Ta \&No .It Ic unset Ta \&No Ta Yes Ta Yes .It Ic unsetenv Ta \&No Ta Yes Ta \&No .It Ic until Ta \&No Ta \&No Ta Yes -.It Ic wait Ta No** Ta Yes Ta Yes +.It Ic wait Ta No* Ta Yes Ta Yes .It Ic where Ta \&No Ta Yes Ta \&No .It Ic which Ta Yes Ta Yes Ta \&No .It Ic while Ta \&No Ta Yes Ta Yes .El +.Pp +\&No*: Commands marked +.Ql No* +exist externally, but are implemented as scripts using a +.Nm +command of the same name. +.Ss Keybinds +The command line environment also provides the following +default keyboard bindings: +.Bl -column "Process Info (SIGINFO)" "^M | ^J" "^M | ^J" -offset indent +.It Em Signal Ta Xr csh 1 Ta Xr sh 1 +.It Ic Backspace Ta ^H Ta ^H +.It Ic Carriage Return Ta ^M | ^J Ta ^M | ^J +.It Ic Tab Ta ^I Ta ^I +.It Ic Beginning of Line Ta ^A Ta ^A +.It Ic End of Line Ta ^E Ta ^E +.It Ic Cursor Forward Ta ^F Ta ^F +.It Ic Cursor Backward Ta ^B Ta ^B +.It Ic Clear Screen Ta ^L Ta ^L +.It Ic Cut Line Ta ^U Ta ^U +.It Ic Cut Word Backwards Ta ^W Ta ^W +.It Ic Cut Rest of Line Ta ^K Ta ^K +.It Ic Paste Last Cut Ta ^Y Ta ^Y +.It Ic Typo Ta ^T Ta ^T +.It End of File Po Ic EOF Pc Ta ^D Ta ^D +.It Interupt Po Ic SIGINT Pc Ta ^C Ta ^C +.It Process info Po Ic SIGINFO Pc Ta ^T Ta ^T +.It Ic Search History Ta \&No Ta ^R +.It Ic Exit Search History Ta \&No Ta ^G +.It Ic Previous Command Ta ^P Ta ^P +.It Ic Next Command Ta ^N Ta ^N +.It Ic Print Next Character Ta ^V Ta ^V +.It Ic Pause Job Ta ^S Ta ^S +.It Ic Resume Job Ta ^Q Ta ^Q +.It Suspend Job Ic (SIGTSTP) Ta ^Z Ta ^Z +.It Ic Scrollback Mode Ta ScrLk* Ta ScrLk* +.El +.Pp +\&*: Bindings marked +.Ql * +are provided by +.Xr vt 4 , +the console driver. .Sh SEE ALSO .Xr csh 1 , .Xr echo 1 , .Xr false 1 , -.Xr info 1 , .Xr kill 1 , .Xr login 1 , .Xr nice 1 , @@ -326,5 +228,18 @@ The manual page first appeared in .Fx 3.4 . .Sh AUTHORS +.An -nosplit This manual page was written by +.An Alexander Ziaee Aq Mt ziaee@FreeBSD.org +from an earlier version by .An Sheldon Hearn Aq Mt sheldonh@FreeBSD.org . +.Sh CAVEATS +While +.Nm +commands may exist in more than one shell or standalone, +each may be implemented differently. +.Pp +Standalone utilities and their manuals must be called by their path +from a shell with a +.Nm +command of the same name. From nobody Thu Jul 10 14:09:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdGtZ6cZVz6162y; Thu, 10 Jul 2025 14:09:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 4bdGtZ4NgFz4593; Thu, 10 Jul 2025 14:09:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-607434e1821so1376982a12.0; Thu, 10 Jul 2025 07:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752156564; x=1752761364; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=njZ8ywaZvpoFK3DmoCYhgoTbMlPMXSU4CbxiX+7ipLw=; b=gEwPh127FAyR5DZO64yHWw6RNYE0gFeznhAneGFhLBm3ih3ojfqgS2H18GKpfLYWuT +HKNpJDhh9eoSFxxZvZUDg6cm7eSZiXRpzdx2ENrsfU1GrVvhKhrNfp815v0uqF0FWAu YiLLsQT281uKTP32lTSp+sh6avEff4BdhxB7TPVcayPz1ms3eNiijKze8qWLJbhM/HBU kxyqxVDUpKay9k9zwdsVTiNRj8evkSTrzwETLgkaacUdGtK5T38GqMzRrh4nxbAoKJB5 BYvct8ri7lkvZQN3u7x+nEijmNWcVjkZS75GLB95DO00vea912vrChFAr3ZftG+Ade1o c/0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752156564; x=1752761364; h=content-transfer-encoding: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=njZ8ywaZvpoFK3DmoCYhgoTbMlPMXSU4CbxiX+7ipLw=; b=E/3TycZjO/qWLTLcO+c0EbHVitJQ0Y40R/B2He6RNK4J9V4aizSkdAAAuF6sy2e0k6 QTnn1WwD8P/3YssDRLU2PTEM6Z9NWm/op499R7cTfEojmtF70YhizmwFLRyYUbD+tfuZ ajp3mA5HZB32++EylQ+MMnvpnvGCEBcX8JTg/R17ICxSP8geezjfzmgx3uoT9jCgnaQZ U0t+bOB66o03Q7TiEOUvm2MKswSz8ko3saaxIhMzgracZSLJG0VvAIoXXIxyp7QVcWA8 ETBDy5xriISv6WbDfQ+jbSH+Pz4WjNwSkT924aIHc49ijZzno7VT/4k38Dzva8wbxIMS OLZg== X-Forwarded-Encrypted: i=1; AJvYcCUU4BJfCKudH1SzwgQ0wn/NmTPML2HxUIkSTM+unF5kn2uEuYtSAr54KKYCTAqJ3WTGveck7y0EZXSJNm+WGd3niM0o@freebsd.org, AJvYcCW+sKx8BgClqXZCxOFYR9F/6EbY7/+vVW0dJOmXneIP8Kkf7wSHvukT96kxWpMsQfX/cSbNEEM0EHn5VGsBFCI=@freebsd.org, AJvYcCX/87WE0PpeuDxdP1872p+hH2d3+b0K/snVNsK3D3ldHFmECphoWHM2gntIBDMZhCNXcvwvcOEXPuNdDToIaphWMPcrTjo=@freebsd.org X-Gm-Message-State: AOJu0YzopyPkTMwSSJEfUITmbN75wE5FyW/zswwvlHSsBWUwURpbUrjo PCIbn/xaJyNu3oTrJpENH30oKH6AxSqLdS+qN88RJnK3vq9xl/W8JD/5V4kWkiMUvlO5PoDl+17 BZEnirw2I72yR6KvYP5CnphQLRUfDAIDy X-Gm-Gg: ASbGncsP0PJ/Lzs92IWwv/GZFyk067ugwta+pLuVUvZeD/rN38vgP5V1cZIBqxIsXbR Dw/zfsrph2JJUaF1qc5qKxMyLKQ59x8ukK3oOQcjBgQ6KgF67kd8jurgJNlpsD0GX92JN9gUfYO rtgwi/IrG55Yr7bg2wJbvKVEmcnvhY+U71FAHue54xAA0nPITfmhmuXpSjNry4yBePQps+NZErO 4E= X-Google-Smtp-Source: AGHT+IGdZn0ZuRY7dS7GP5hR4wNEVrz8YnnXvQIWrjHjeoTHsJtsNuronceoBU3sD464cfwh6en/N54EdIWwpg4wlBs= X-Received: by 2002:a05:6402:31e7:b0:607:f61f:cc1d with SMTP id 4fb4d7f45d1cf-611c0d4baafmr3038759a12.11.1752156563589; Thu, 10 Jul 2025 07:09:23 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202507062254.566MsbnL090918@gitrepo.freebsd.org> <867c0gcjt3.fsf@ltc.des.dev> In-Reply-To: <867c0gcjt3.fsf@ltc.des.dev> From: Rick Macklem Date: Thu, 10 Jul 2025 07:09:10 -0700 X-Gm-Features: Ac12FXw7QodpahZPufg93CnJj7ZMn_g-uroSK2cf7NAl7BP_rJPVFGrN6sQZRGQ Message-ID: Subject: Re: git: c5d72d29fe0e - main - nfsv4: Add support for the NFSv4 hidden and system attributes To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Rick Macklem , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bdGtZ4NgFz4593 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)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] Yep. You can commit it or I can? (You can put reviewed by me if you choose to commit it.) Thanks, rick On Thu, Jul 10, 2025 at 5:27=E2=80=AFAM Dag-Erling Sm=C3=B8rgrav wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > Rick Macklem writes: > > diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvn= ops.c > > index 0049d7edca33..fbfcdafaa06b 100644 > > --- a/sys/fs/nfsclient/nfs_clvnops.c > > +++ b/sys/fs/nfsclient/nfs_clvnops.c > > [...] > > @@ -1092,7 +1100,8 @@ nfs_setattr(struct vop_setattr_args *ap) > > vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D V= NOVAL || > > vap->va_mtime.tv_sec !=3D VNOVAL || > > vap->va_birthtime.tv_sec !=3D VNOVAL || > > - vap->va_mode !=3D (mode_t)VNOVAL) && > > + vap->va_mode !=3D (mode_t)VNOVAL || > > + vap->va_flags !=3D (u_long)VNOVAL) && > > (vp->v_mount->mnt_flag & MNT_RDONLY)) > > return (EROFS); > > if (vap->va_size !=3D VNOVAL) { > > vap->va_flags was already checked (in the line just before the first > line of context), albeit without a cast. Coverity erroneously claims > that this causes the entire expression to always be true, because it > thinks VNOVAL and (u_long)VNOVAL are two different values. That's not > the case, but you probably still want this: > > diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnop= s.c > index fbfcdafaa06b..fa451887e73e 100644 > --- a/sys/fs/nfsclient/nfs_clvnops.c > +++ b/sys/fs/nfsclient/nfs_clvnops.c > @@ -1096,12 +1096,11 @@ nfs_setattr(struct vop_setattr_args *ap) > /* > * Disallow write attempts if the filesystem is mounted read-only= . > */ > - if ((vap->va_flags !=3D VNOVAL || vap->va_uid !=3D (uid_t)VNOVAL = || > + if ((vap->va_flags !=3D (u_long)VNOVAL || vap->va_uid !=3D (uid_t= )VNOVAL || > vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D V= NOVAL || > vap->va_mtime.tv_sec !=3D VNOVAL || > vap->va_birthtime.tv_sec !=3D VNOVAL || > - vap->va_mode !=3D (mode_t)VNOVAL || > - vap->va_flags !=3D (u_long)VNOVAL) && > + vap->va_mode !=3D (mode_t)VNOVAL) && > (vp->v_mount->mnt_flag & MNT_RDONLY)) > return (EROFS); > if (vap->va_size !=3D VNOVAL) { > > DES > -- > Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Thu Jul 10 14:35:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHSp6PPQz617L3; Thu, 10 Jul 2025 14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHSp5Q6kz4HPq; Thu, 10 Jul 2025 14: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=1752158138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aB6rXve+wJ1UZ/JO42GFw8zD0QnvzTmKM4C+Z/NIVsA=; b=ZbyN5jsfvTdONUf2wHomynA+s0yZcm3o/piu6Y4vmxQiZnl5mE9k5Q05ZtY+fVK+u8ThrE HsQNKibps0R7twmOXFXj0qeWgPnB1lD2RyJ+Ef2tuZGNDCraIoGEOmkh4MNG+k2MYHz6jw XldnszDxTRdSqi/RSK8o64wp0zqxjGTuZcnYCG/jVu6knR2RqKhIYD+jc1m4fQaXE0jKby ND1tBBhl14HJ2JJqtWM+wQ4EWrnqgp5ozE+9DroYqyTgiMDVo91RHwnN5QjDYvaewplSJf 860X1i4bhLYUZqH7l/bsEkWxc0HPTJIgdgroCb36XAVSNrN1uvADVzLRPHeBVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aB6rXve+wJ1UZ/JO42GFw8zD0QnvzTmKM4C+Z/NIVsA=; b=HafdOqatWJeMDspjw3Gt8yD0rD97ggo28slfm//trN2seHBL0aMbehJMAJdUs2Kasr1g5p vsudgfY+S4H6BLNXaR3Jf4WxLDXmkTp6Lyg9891nXkNhLafMDZkwbRisnIxB7N17viep+k lqrjJfGB3BrdF5Uom9vyJkADUFtP4CT2Vw9ibayWk8HSlz1QGWD4EqCv64ATH6B+ZJ8u0U cmw17qm9V21cxUsS5B9TfjOXpDMOfX/8N1qBFxIEMabknDD3AGvq7+M7IPbdewTMoDoiqa fepoTeM+QuRblrFG4TOhptSTdmWpxSCNQ/8jzsSsotz+ZIlLt3OnrC0sxeZuug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158138; a=rsa-sha256; cv=none; b=chhQ1sdxr1j00SZVwrQA7fkKE5Z8kkVmtCHPrs7denXy1XeVEWcyhmHoiMkYn4dLYXPvtn /J4sn5fsSC5zhgDEm42EES7hm6jmCKkgsYPUrMHOQO5COGMje70LgAnw5bE/Rr/bp3P8Z5 jIUNCi9pZL7gkVUf58evzR9nE0Xxk+S8FNB63aVqKq09mb7fTM3HhbUAV3qqWtf4R2EFIH yqB5zx8pw1nzRW5aO8VpMHE2LUUJxVMtO7k4OGiRc8BNjOynPlO/SpJJ9uxkfzagbscAyL Z5iRUWpWoB4bVDpbmXoIui4q1QkVZns5WBatWh0dMXlPa9scImj8WyfPUK4eHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHSp4w69z19Xs; Thu, 10 Jul 2025 14: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 56AEZc5H096458; Thu, 10 Jul 2025 14: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 56AEZckU096455; Thu, 10 Jul 2025 14:35:38 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:35:38 GMT Message-Id: <202507101435.56AEZckU096455@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: 63389aea24f1 - main - inotify: do not call into namei() with a locked vnode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 63389aea24f15fe823c775960d77017f1a35f54b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=63389aea24f15fe823c775960d77017f1a35f54b commit 63389aea24f15fe823c775960d77017f1a35f54b Author: Konstantin Belousov AuthorDate: 2025-07-10 07:15:13 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:34:45 +0000 inotify: do not call into namei() with a locked vnode PR: 288127 Reviewed by: markj Fixes: f1f230439fa48581f40a57f095627f667a9713c3 Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51233 --- sys/kern/vfs_inotify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index 41e73bb41a49..2b42228465a4 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -760,9 +760,11 @@ vn_inotify_add_watch(struct vnode *vp, struct inotify_softc *sc, uint32_t mask, * directory if it's specified as a vnode. */ vrefact(vp); + VOP_UNLOCK(vp); NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, dp->d_name, vp); error = namei(&nd); + vn_lock(vp, LK_SHARED | LK_RETRY); if (error != 0) break; vn_irflag_set_cond(nd.ni_vp, VIRF_INOTIFY_PARENT); From nobody Thu Jul 10 14:42:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHd253PSz6187R; Thu, 10 Jul 2025 14:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd228RCz4Mb4; Thu, 10 Jul 2025 14:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uTtocf1geyfZmx3n4GSMDlX8PrJf+tI8SggfrzX/az0=; b=mR2KgBgY/xlZQmNaTeV0e4X0H/4ise+RHFp67Z8ovdIn4YM0FdlPfotFhxKFVU5fUcZRHj xJnksG7neGEwujLWnE4K2qOG0KRsQc/ISTL5IBWTZG7T4w8ktfk/zeEfmuszqcmS6iPznX NQNjVN98Jnup18xkH69XwS6O+LsPq3n3wFl1jJzRXHuPGpzvOwpxI0teWAytjXiReHcOzN z+T+Waxizm3TLXt8Bc9NXiT67gcHwxzZkABo5v2Zu5Wix8BDBvVsN1tmsHMY+uGZFdpAcr UIQ7NUT3YFfm1mlKvC4c6MVoA7mkYx0tjrqxElNb5uyAdfpkywI0dDZmaYqtlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uTtocf1geyfZmx3n4GSMDlX8PrJf+tI8SggfrzX/az0=; b=DRfpU22LSjrOfzfIhhW5Gc25y0qcCEgL2PZycA2x6OO78j7DVsEdqsbMB6/61Je1b4nhIW l7Ml5YhpAmiIC2ybI+aIw9JP4nh6xoDDEXjfSGmr5vgAAokExjiVIixH4U+IfMmuRO7UEF 8JxQGxvwp2YLxTptzfM6h3x+0ZCjCgAhe24eGT3rC/1TOyHn1yHr45wyg1WG+dA2ZdcmGs RwSppzJhwcceeK03UN3eIO8yfrelkC3z91wZMCi6mVgDzpddfUKhYoUj6LnrS2FeyF45P5 CXD/WA+S08p/lridv0b94MyPxLCPB5svOlojLf31BJ0lY1fPIZaVX1Ow/PUMWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158566; a=rsa-sha256; cv=none; b=xv/Pc0OQBTPlEd4yB6F6wKM7taCcphhqc+G/cYuNlKNcBgtzfy/Xk1mhvoUTYXwG9fgovQ mbtLF9SRrWyp5OvzZRlaBVG49ivbX6YSBO2HgXMShVIJ2ag79rTGwCZe50Rain+2LAj3E6 hqHblKCVnRhq0qXy191eZQaEyBWBOWs4H7OO9rZfrabClzAHDgK/+NtEjhtEEgeowPKXrj YbmQAx2fnAdNZeVymAGsat0oD3B8UkCDhxLl9vcB3IP2VmS2YfNheJcztHIXdZSS/+dsRI 6Ars9wqpdqfCvGKGqEBrI1WkeV+sO5f2+hecA7uHADzOJOKKtriw4c5xNsOZRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHd21VM1z1BD9; Thu, 10 Jul 2025 14:42: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 56AEgkCt015006; Thu, 10 Jul 2025 14:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgkkG015003; Thu, 10 Jul 2025 14:42:46 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:46 GMT Message-Id: <202507101442.56AEgkkG015003@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: 1b7d0c2ee947 - main - in_pcb: add in_pcbrele_rlock() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1b7d0c2ee94748814a6c7943806ab8160e65a6f5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1b7d0c2ee94748814a6c7943806ab8160e65a6f5 commit 1b7d0c2ee94748814a6c7943806ab8160e65a6f5 Author: Konstantin Belousov AuthorDate: 2025-07-03 10:36:58 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 in_pcb: add in_pcbrele_rlock() The helper that derefs and rlocks the provided inp. Returns false if inp is still usable. Reviewed by: glebius, markj Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D51143 --- sys/netinet/in_pcb.c | 17 +++++++++++++++++ sys/netinet/in_pcb.h | 1 + 2 files changed, 18 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index bccd4b84561a..dbe48242381d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1744,6 +1744,23 @@ in_pcbrele(struct inpcb *inp, const inp_lookup_t lock) in_pcbrele_rlocked(inp) : in_pcbrele_wlocked(inp)); } +/* + * Dereference and rlock inp, for which the caller must own the + * reference. Returns true if inp no longer usable, false otherwise. + */ +bool +in_pcbrele_rlock(struct inpcb *inp) +{ + INP_RLOCK(inp); + if (in_pcbrele_rlocked(inp)) + return (true); + if ((inp->inp_flags & INP_FREED) != 0) { + INP_RUNLOCK(inp); + return (true); + } + return (false); +} + /* * Unconditionally schedule an inpcb to be freed by decrementing its * reference count, which should occur only after the inpcb has been detached diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 57cf15ca37fc..9e0618e87601 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -681,6 +681,7 @@ void in_pcbref(struct inpcb *); bool in_pcbrele(struct inpcb *, inp_lookup_t); bool in_pcbrele_rlocked(struct inpcb *); bool in_pcbrele_wlocked(struct inpcb *); +bool in_pcbrele_rlock(struct inpcb *inp); typedef bool inp_match_t(const struct inpcb *, void *); struct inpcb_iterator { From nobody Thu Jul 10 14:42:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHd50wCTz617hR; Thu, 10 Jul 2025 14:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd431VYz4Mjt; Thu, 10 Jul 2025 14:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjCSPTyagvwzP6Za8MmiS+FjnWYkqKDw+qsZoIw6wEY=; b=dgCW0JZ87D1Azs/UXIHPQyIB3ql8lN8MVSfaBycvmqGABHHthoiNxFe9caxr+taZ3YVsRL t81X3/O2Ot+jNNAJ/v/zEz6GchU3ZL9fNF+InOH5pxO3eXFgdZZA45GR+GGa31ELUBKLJe wpWVYE3/YKcrJUHkxUAL/vXqx5/asLh6P4sWQ/w2RB8Ix8tCsmy6hEWM/EBSbrIplHtdgb HpsRaFGTi1xyKrdECtCjylJ85ztKt9Szg9hsag8wJq71KaoSOwIs3jcqO2/mKb2K5RoAY+ WZTbgp1YPDfkBwfLrUgyefXlkAQ1wH5H6IaTzT1JyTCgLzp6gZldNF7PT5gxbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjCSPTyagvwzP6Za8MmiS+FjnWYkqKDw+qsZoIw6wEY=; b=f2s1KMJP33WqtLIhJURndX1hcrhoZrzc3OQSuhz9eWk5i23glhK/GfzSRF2RGbMDNhJxak slBCravn/KeXOJNoZA1Nmytuh1T9RbuEQHN7lDIDxCCpCkYZcM3l7UW3UgCWBPvjSDl08Y oQZb1j9lX21kvmDmT61Lie2MfFu9ejQTAKBegjQqMydlZondD0SKUEE5/1Mu70EQWmn/Yy yFQDKSuLkSRntMpXBSs8k1blogeu3QnZtPI5vp5F8935qFS7wFjSYsSgsfxThiKzUuicPp lO45Y5gyqBo3sashhApWGb2F/aqtzBoGZU4WkAV5gD/M2JBUF6clC9TUttT/jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158568; a=rsa-sha256; cv=none; b=VPvmMWXkU9CHsJb1L/9MVNyzeS/YGnT9vUW7iGaRq+uSRCnare8xPozAR/kyO3M3oOh/Pg vRLwauThnkNXQJwohavCib9DxMPPgGQfNN8zo7Rk9yMwyRnNMatIKy/Aw+Lzuh+fs8zLPA gXqTaKTbrsr2f5p4AfPb/IZHYWszjS74QPExZzqP2ShuPRPYiVm1Fgra0c70e6T1gpFKvm aJ6tBY4IS0s9IQciKTFvl8EwOu3Zdg8g2IQSpjY1DbH8F1MRaU9+kupbwrMb+FRS1fwouh hiWRaXMpEh+8MG/itzvNK73AcSXIyiEgoB8V0PI+O2e6OawF/iBcAqnJPDWxoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHd42dDBz19xJ; Thu, 10 Jul 2025 14:42: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 56AEgmZE015079; Thu, 10 Jul 2025 14:42:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgmHP015076; Thu, 10 Jul 2025 14:42:48 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:48 GMT Message-Id: <202507101442.56AEgmHP015076@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: 18905fc31b31 - main - sysctl net.inet.tcp.ktcplist: try to handle EDEADLK List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa commit 18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa Author: Konstantin Belousov AuthorDate: 2025-07-03 17:59:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 sysctl net.inet.tcp.ktcplist: try to handle EDEADLK If EDEADLK is returned from the locked handler, restart it. Do it limited number of times. Catch signals between tries. Reviewed by: glebius, markj Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D51143 --- sys/netinet/tcp_subr.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f8811649fe19..45048fb3848d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2869,21 +2869,28 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) zfree(buf, M_TEMP); return (error); - -again_reset: - req->oldidx = 0; - goto again; } static int tcp_ktlslist1(SYSCTL_HANDLER_ARGS, bool export_keys) { - int res; - - sx_xlock(&ktlslist_lock); - res = tcp_ktlslist_locked(oidp, arg1, arg2, req, export_keys); - sx_xunlock(&ktlslist_lock); - return (res); + int repeats, error; + + for (repeats = 0; repeats < 100; repeats++) { + if (sx_xlock_sig(&ktlslist_lock)) + return (EINTR); + error = tcp_ktlslist_locked(oidp, arg1, arg2, req, + export_keys); + sx_xunlock(&ktlslist_lock); + if (error != EDEADLK) + break; + if (sig_intr() != 0) { + error = EINTR; + break; + } + req->oldidx = 0; + } + return (error); } static int From nobody Thu Jul 10 14:42:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHd63Nvvz617q5; Thu, 10 Jul 2025 14:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd53w4lz4MbG; Thu, 10 Jul 2025 14:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rsb/NSuxVEcER7+N4lAPR0xcJ5mEobZxVQeAqJt5yGg=; b=giurE8tsEXE3/e/J7shOHoImL53EaPZlmrPVEgCsYVM4b49U5rJj9KIkiJCesahQXGTyvb EmEKnIZdKsMHdqk570UBi3LVtOzAxKPyUuBVIfL4Gtb0kHKvSywJKDTJT4LxsTNlewFPUj jskJM3lFd/R0VePLF/Z7231Ex5QJ8Wfj67rXKpKoqt594wvN/1N0icEdBAIcydeXpwuClg 39gqspeREksCI5fdbhirY2sYuqXBJbsZD7B9UwwjnsGky3SqiTKpTL1LGIE6SQkXas9pZb JENBpYjLJVo3jWHgauhz81RjsWWDO9K6kHSoWgQBwmPzKmLpodeHHUQGFLYhVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rsb/NSuxVEcER7+N4lAPR0xcJ5mEobZxVQeAqJt5yGg=; b=rvbLnm7UmObrKG+VmbWgJiymipyRoJySHi2t77ndQTVNfvT3OJf3e/KGsTSc+ycqo2b7NL JNyYrJTBAaeG6fYtXlvGDEMDuwYJ40kVfEM6uQ0QLz3npjr9pNwMGuJZC5+vhzr07dCJ7c Go4DEuHrfRCNiufxAycHm0g0uEpYOMLHM3kqH2W+9pgWk1BRWL+e88oVB5QkGQ9B1h4yLb Aebkw8APTzNE/yfOBSMriPwfjdnHljG5s9kCa8VNo3sxIMBSt1FXQVvCG4pDJ+VgjEQeF+ yUS4K279gfPmBeoFp8pfeihb7Q+JQHI8Tycpq40qil7+d9qJ/qLnLxbMVS2UAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158569; a=rsa-sha256; cv=none; b=ssMLd8QOd6TJnGfvRZyFEQDBOfizFyZngqBXWmcH0+hNWcYJMa977QGFCXbGwhKCbuT+gt tbd5fj6VvSOrz+m3t9f7gXW6VzBWhPeLwoE5fyzKQ5e61sIjQ4WgAt7vVE35TMeDBYcMgU PDE2BAG2DDcoTPZwJSuxAwWutNqXbllQj0IS/6Woa25VzlYuoIbx6R5A/nkWCdvmFw1HPd 9zBdsJUOLQIUMjYyhXl8s+Fl/MU6LR/xrm93EZHA+YigCYVkxZauSPUaVgR0czDTRrZ2xN k3/uhVRYSGZpQAqWY8Zlvx8GOyX+ilWjyOJGKoBXYb1vckQaBsJzmEERC5qKyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHd53Vqgz19xK; Thu, 10 Jul 2025 14:42: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 56AEgnEn015112; Thu, 10 Jul 2025 14:42:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgnRL015109; Thu, 10 Jul 2025 14:42:49 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:49 GMT Message-Id: <202507101442.56AEgnRL015109@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: d7c807aa884d - main - sysctl net.inet.tcp.ktcplist: properly fill driver status length field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d7c807aa884d178e9bd17afe7adaccb22b3b0dc3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d7c807aa884d178e9bd17afe7adaccb22b3b0dc3 commit d7c807aa884d178e9bd17afe7adaccb22b3b0dc3 Author: Konstantin Belousov AuthorDate: 2025-07-09 01:41:16 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 sysctl net.inet.tcp.ktcplist: properly fill driver status length field Also ignore errors from drivers. If driver snd_tag status method returned an error, silently ignore the returned string, and not advance the position of the filled buffer. Sponsored by: Nvidia networking --- sys/netinet/tcp_subr.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 45048fb3848d..db415f6bdf03 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2722,11 +2722,13 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - ksr->snd_tag->sw->snd_tag_status_str( + error = ksr->snd_tag->sw-> + snd_tag_status_str( ksr->snd_tag, NULL, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) + len += sz; } } kss = so->so_snd.sb_tls_info; @@ -2745,11 +2747,13 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - kss->snd_tag->sw->snd_tag_status_str( + error = kss->snd_tag->sw-> + snd_tag_status_str( kss->snd_tag, NULL, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) + len += sz; } } if (p) { @@ -2821,11 +2825,14 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - ksr->snd_tag->sw->snd_tag_status_str( + error = ksr->snd_tag->sw->snd_tag_status_str( ksr->snd_tag, buf + len, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) { + xktls->rcv.drv_st_len = sz; + len += sz; + } } } if (kss != NULL && kss->gen == xig.xig_gen) { @@ -2842,11 +2849,14 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - kss->snd_tag->sw->snd_tag_status_str( + error = kss->snd_tag->sw->snd_tag_status_str( kss->snd_tag, buf + len, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) { + xktls->snd.drv_st_len = sz; + len += sz; + } } } len = roundup2(len, __alignof(*xktls)); From nobody Thu Jul 10 14:42:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHd66V8Zz617xP; Thu, 10 Jul 2025 14:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd64yGBz4Mpf; Thu, 10 Jul 2025 14:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G74d6DI6jPykZXdmMHn7PzSxGmCRmlVYgJ+al5avdMU=; b=xdnfs9vPQa2sUOJxyohghrErXn1bKcrF3uEUrP+utSAUk793CKAwSRUBQchWOkdQZGNiKQ ztxhYITxaF5Ua5F1ls2EkPeISvkAEdz3tzU69Z3qHvtKwnnXun2zbjPx0T8HFbRBJ83Vpw D/9q9O6svQrl+9l8UYIVIwstKMKGYHNk4SZziT+XfHHXNGbyMSyV1uP5Po3WQvwTRyENsM zvmaa41UY3ldcOAvfDSKGjXQBUhwSOKHbQG9FbTmVtA7STBqp5bBXDFR1VGiDD6dPd5x7m ARN6F594uARN8cEmRL0du2ftuyq0E1C6iY5xgQenz1PXsdVOUzp0m4LxmfbzhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G74d6DI6jPykZXdmMHn7PzSxGmCRmlVYgJ+al5avdMU=; b=FxEezq7RY1Sh5fUOuna+NdwjpMXQRHgGdVMWjtSn5hhkHFTCL0RMgotuiVMvJGvanTCFi/ wsu3RW6FZHDjYUn7VuwWrAzt6uwDF4sHo3J6flPMRVM2YsaChLSdHnflxK6zd3vjQdGhXA t/THdDFbyEdfOAFg6FMyT1NOmWSoaJJFVFmmWpAzSEaUlOElZJy6AQxerCrmMh4q0v1duB kR4aXMhG/4dsvkp0XP4yGWEFowuWo3mix5DVzg9QGaRIKLF/TqXr+HqEZ/2qZdUYiFplX5 k8FBZojHMJYnwu/mAA3iX8jsh5nwh/GM4PWnBbVJCKIcsz2zIH4HWqiHV5IKkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158570; a=rsa-sha256; cv=none; b=lPd8/wZp2xUhgCAeumGI6y1vKP1l4oL/A1N0s6TTbrD+Exe4lGVclO2yV3vIqPf+TJek7C 8kiwZU3SUWSZDiMNGPYtKDG641UU17cD37Od9c44lkRRFvRVV+5iJ7qSWAms8mQwqOeihV uYq2WNrmjtYzJ1WsMqKs+3q2ZLj2X45r88zcZRI9c595XqUbYvHF9jyGmXC/VNMVCexOF5 YB8WQV2t1gvLUJ7wUUKCH/Y6IIkJ88Qc5zPZQeE1OPo02I76z4/5Fh9psLP1d4jiuVNPY1 ej+6kzilE2FMSU4aXZmcDBnMLeq5HVgF7IrmwC3rX4p9YlUr/GL6+zPlHmsfVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHd64VdQz19xL; Thu, 10 Jul 2025 14:42: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 56AEgoJr015146; Thu, 10 Jul 2025 14:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgoC8015143; Thu, 10 Jul 2025 14:42:50 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:50 GMT Message-Id: <202507101442.56AEgoC8015143@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: cdd812921605 - main - mlx5_en: wait_for_completion_timeout() takes jiffies List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: cdd812921605cf20269ac24faf69750656ec62af Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd812921605cf20269ac24faf69750656ec62af commit cdd812921605cf20269ac24faf69750656ec62af Author: Konstantin Belousov AuthorDate: 2025-07-09 02:35:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 mlx5_en: wait_for_completion_timeout() takes jiffies Sponsored by: Nvidia networking --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c index 8b8f2e570245..5f95a03441f9 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c @@ -250,7 +250,8 @@ mlx5e_tls_rx_send_progress_parameters_sync(struct mlx5e_iq *iq, mtx_unlock(&iq->lock); while (1) { - if (wait_for_completion_timeout(&ptag->progress_complete, hz) != 0) + if (wait_for_completion_timeout(&ptag->progress_complete, + msecs_to_jiffies(1000)) != 0) break; priv = container_of(iq, struct mlx5e_channel, iq)->priv; if (priv->mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR || From nobody Thu Jul 10 14:42:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHd80xQgz617qC; Thu, 10 Jul 2025 14:42: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd75rbvz4Mdg; Thu, 10 Jul 2025 14:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nl4IP9kebxkxw8NlOIrRU4CUU2XDt+5oahbNAX8X1Y0=; b=hmXQWepajpANulmvmzJPadKRZ4PaYLiUsn4cFJCfB1xK/ZmHeWpB/KyIi52IwrDrVwbCJ+ sA2Nn2KnwkbN6Esju0W4R5HN4fZxvrwCqB3dBiDDUfNlUMKLVZn02VWFpsd0ulDkiBJ2Gq qTefR/D84B7Ph3ykPuiWVF1TdWddKLMOa3/2lQju+lVt4twwNjM2I2dSSao95GSBCH6P8v bUiA/ufJHAEDwyMo0v7Ba7OcKXNTnc5Bo6s2G8+CQ1KztqjdqFSQXN/ii2gkJKACir/HIV Co9jdXDuFXoFEuh26E6+EPThws5yq7xDNs1yOWLaw5go3/uFiXHsGug8q5N7zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nl4IP9kebxkxw8NlOIrRU4CUU2XDt+5oahbNAX8X1Y0=; b=ZoOsaW/iFIF65HFjYMvKHBp91ANYR0mMyzQ82SjDFcDGwPn5NVBm/SWbEBRjRwcDRxjX4o Gd/hxfm417kUol02fX/4PlStDR2mb2rWylbYFfR8BNeMVYqBLPCpPJI7CeF1bGcIYUBJ47 daCYlK+lsHMtsHHonXg2+K/zm76JDQ/mSWrwNBzDbfLw2E4K/uEZovfN+nvNtM5Nc7Kd1m uIFSY6gryIRKmkbVfXAOW6ZlJtV8l4PBb8jcsheQSRx2UDp6PjiFOaq2A2nFmeonjRo2c5 1ghOHfkIXMv2Sejpvu5RRlWuoj7I8b+xJ/l5Byl6Tbt+8Gywu4ZrlwOG3rHoXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158571; a=rsa-sha256; cv=none; b=erBnx7Oqa1UB0GVyRlxAvLyG7MCniZuL3gbdHM6cJJe4Dyf55KF7nJ8oxxX6hOqrKRewmP 1WTOgnmh/7xXlmnRrNmMxwxYvBSOGWKqPgdqyy+VvbmJP9DJuNsoBBXljbqY6xQvSvKhph 59lLPsXiyHExeetoei3o8OrkWDuG0mDOmVGSk7X+gK3wB80qsMA+i8rizesspkLgFh2s97 ofE63xevnfrDrrFdLBWC646EQxQjtn3GkJ7IOB7dkNSaOwSIY3e273fkJo3TlX1x0U1Yt4 5QWjnIy9eBZaCbehVMX6M16BRU9eKbOvv/1fWb9iMr0WzPcIVS+NApQjgH3bPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHd75JZwz1B2q; Thu, 10 Jul 2025 14:42: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 56AEgpA5015180; Thu, 10 Jul 2025 14:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgpqq015178; Thu, 10 Jul 2025 14:42:51 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:51 GMT Message-Id: <202507101442.56AEgpqq015178@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: b6b3743fa27d - main - mlx5en: add driver tls status string method for rx sessions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b6b3743fa27dc1d5dc239ea312bec0858b0791fd Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b6b3743fa27dc1d5dc239ea312bec0858b0791fd commit b6b3743fa27dc1d5dc239ea312bec0858b0791fd Author: Ariel Ehrenberg AuthorDate: 2025-07-08 22:22:56 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 mlx5en: add driver tls status string method for rx sessions Upon collecting tls information, kernel calls driver to get driver/hw tls state. Driver calls hw to get its tracking and authentication states, and dump them into the driver state buffer. This requires a sleep to wait for the hw response. Reviewed by: kib Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 94 +++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c index 5f95a03441f9..4de451f1b039 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c @@ -42,13 +42,30 @@ static if_snd_tag_free_t mlx5e_tls_rx_snd_tag_free; static if_snd_tag_modify_t mlx5e_tls_rx_snd_tag_modify; +static if_snd_tag_status_str_t mlx5e_tls_rx_snd_tag_status_str; static const struct if_snd_tag_sw mlx5e_tls_rx_snd_tag_sw = { .snd_tag_modify = mlx5e_tls_rx_snd_tag_modify, .snd_tag_free = mlx5e_tls_rx_snd_tag_free, + .snd_tag_status_str = mlx5e_tls_rx_snd_tag_status_str, .type = IF_SND_TAG_TYPE_TLS_RX }; +static const char *mlx5e_tls_rx_progress_params_auth_state_str[] = { + [MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_NO_OFFLOAD] = "no_offload", + [MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_OFFLOAD] = "offload", + [MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_AUTHENTICATION] = + "authentication", +}; + +static const char *mlx5e_tls_rx_progress_params_record_tracker_state_str[] = { + [MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_START] = "start", + [MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_TRACKING] = + "tracking", + [MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_SEARCHING] = + "searching", +}; + MALLOC_DEFINE(M_MLX5E_TLS_RX, "MLX5E_TLS_RX", "MLX5 ethernet HW TLS RX"); /* software TLS RX context */ @@ -332,7 +349,8 @@ done: * Zero is returned upon success, else some error happened. */ static int -mlx5e_tls_rx_receive_progress_parameters(struct mlx5e_iq *iq, struct mlx5e_tls_rx_tag *ptag) +mlx5e_tls_rx_receive_progress_parameters(struct mlx5e_iq *iq, + struct mlx5e_tls_rx_tag *ptag, mlx5e_iq_callback_t *cb) { struct mlx5e_get_tls_progress_params_wqe *wqe; const u32 ds_cnt = DIV_ROUND_UP(sizeof(*wqe), MLX5_SEND_WQE_DS); @@ -368,7 +386,7 @@ mlx5e_tls_rx_receive_progress_parameters(struct mlx5e_iq *iq, struct mlx5e_tls_r memcpy(iq->doorbell.d32, &wqe->ctrl, sizeof(iq->doorbell.d32)); iq->data[pi].num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS); - iq->data[pi].callback = &mlx5e_tls_rx_receive_progress_parameters_cb; + iq->data[pi].callback = cb; iq->data[pi].arg = ptag; m_snd_tag_ref(&ptag->tag); @@ -820,6 +838,7 @@ mlx5e_tls_rx_snd_tag_alloc(if_t ifp, } ptag->flow_rule = flow_rule; + init_completion(&ptag->progress_complete); return (0); @@ -969,7 +988,8 @@ mlx5e_tls_rx_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_param params->tls_rx.tls_rec_length, params->tls_rx.tls_seq_number) && ptag->tcp_resync_pending == 0) { - err = mlx5e_tls_rx_receive_progress_parameters(iq, ptag); + err = mlx5e_tls_rx_receive_progress_parameters(iq, ptag, + &mlx5e_tls_rx_receive_progress_parameters_cb); if (err != 0) { MLX5E_TLS_RX_STAT_INC(ptag, rx_resync_err, 1); } else { @@ -1002,6 +1022,74 @@ mlx5e_tls_rx_snd_tag_free(struct m_snd_tag *pmt) queue_work(priv->tls_rx.wq, &ptag->work); } +static void +mlx5e_tls_rx_str_status_cb(void *arg) +{ + struct mlx5e_tls_rx_tag *ptag; + + ptag = (struct mlx5e_tls_rx_tag *)arg; + complete_all(&ptag->progress_complete); + m_snd_tag_rele(&ptag->tag); +} + +static int +mlx5e_tls_rx_snd_tag_status_str(struct m_snd_tag *pmt, char *buf, size_t *sz) +{ + int err, out_size; + struct mlx5e_iq *iq; + void *buffer; + uint32_t tracker_state_val; + uint32_t auth_state_val; + struct mlx5e_priv *priv; + struct mlx5e_tls_rx_tag *ptag = + container_of(pmt, struct mlx5e_tls_rx_tag, tag); + + if (buf == NULL) + return (0); + + MLX5E_TLS_RX_TAG_LOCK(ptag); + priv = container_of(ptag->tls_rx, struct mlx5e_priv, tls_rx); + iq = mlx5e_tls_rx_get_iq(priv, ptag->flowid, ptag->flowtype); + reinit_completion(&ptag->progress_complete); + err = mlx5e_tls_rx_receive_progress_parameters(iq, ptag, + &mlx5e_tls_rx_str_status_cb); + MLX5E_TLS_RX_TAG_UNLOCK(ptag); + if (err != 0) + return (err); + + for (;;) { + if (wait_for_completion_timeout(&ptag->progress_complete, + msecs_to_jiffies(1000)) != 0) + break; + if (priv->mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR || + pci_channel_offline(priv->mdev->pdev) != 0) + return (ENXIO); + } + buffer = mlx5e_tls_rx_get_progress_buffer(ptag); + tracker_state_val = MLX5_GET(tls_progress_params, buffer, + record_tracker_state); + auth_state_val = MLX5_GET(tls_progress_params, buffer, auth_state); + + /* Validate tracker state value is in range */ + if (tracker_state_val > + MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_SEARCHING) + return (EINVAL); + + /* Validate auth state value is in range */ + if (auth_state_val > + MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_AUTHENTICATION) + return (EINVAL); + + out_size = snprintf(buf, *sz, "tracker_state: %s, auth_state: %s", + mlx5e_tls_rx_progress_params_record_tracker_state_str[ + tracker_state_val], + mlx5e_tls_rx_progress_params_auth_state_str[auth_state_val]); + + if (out_size <= *sz) + *sz = out_size; + return (0); +} + #else int From nobody Thu Jul 10 14:54:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHts51mkz618W9; Thu, 10 Jul 2025 14:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHts4R6xz3Cj3; Thu, 10 Jul 2025 14:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752159285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXUkQsCGAg1vy9WKv9GCWQk7ul6NNd6eWms1YBMbB5I=; b=geWWKJQyr5DB4ir3fOwVcimMTlKK83BqirjzyInHudeYowg0o98/q1YAW0FkDNk/G893hf dRs7mNQILFylOlZ2ggvt/B2c0G6sFYiMTKl6pJrFF4SA+Un17cW7NlLaxSWWnSpykXla3U PAzWPfDTZDhu8ohCkn6fvAuNYz8U5qJg73cTAmb4kIDqFiXd731hQHhN/vP1UjaLrLXwqY 37DQwU1Oob/XfGkkZHhkxG4OTgofWqEYbkF9Sg1AAlOVzzCukuJ3sG5iEnTGhXHztY96kj WWFJgcmDoFQj0NeQYJFKTbxkMkSNip7QfjVwq/u8IMd2XgzP3tuDW02Ae5uW8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752159285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXUkQsCGAg1vy9WKv9GCWQk7ul6NNd6eWms1YBMbB5I=; b=l/4yjHJiTGMR5AlmFZwjYtJr6fRjpS5nyXa9pBhFtwzehDseep5ub5iK6uH0GPWro6lID8 kT/g5xlFJ6nHQRNORh4LSWvTCebe51EcU70LzpD7ROY72F6iTH0ev+BxaQPuXQ10P7DUF+ YgnEbAhA7xvxn4CzTxv+CK7mvRJ1Zp2vZsQ3yEQBLethVExEYp6VQLeVJSlGWXW3f9G1ws mtGSO5LSkzjp+N8t4yx5514yxbs62J3L/5eQNgO+k8aZFKmX0Ll4ZJC7Drix3h+NreIvwz 5wNES3nYiSOhkUrUERWhk9mFH8U9UbcI1lBxpRQqkkoefqlE3g307hCJaMPEqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752159285; a=rsa-sha256; cv=none; b=AqG7FkroziZoPozdyflmx/lAf3faBzxg1W0qJbZ5lJEmGFpJxsvkIBhsDC8VHV2yBrL8NU mdE5tnTdL8QrCL7mdRoJC63GCoEAnc3+j5m6lZN8spmuU4DyfNfg0ffLbaXopQqqkOAwOP b6uctTi6ANVE6+x+k2GasWZ6y7vA9L3WbYDwOXIyiYZR7gaxj+tCyaancM4a0akCo54Col REWGTZIY3hA5dT75cfOvCHLsredXF6I9W6b+DWG5i0aNnPZCdZptf6KaXI8G9ZIOm1u9y/ tr4B4Icu4J5skSXXK0omw1N2Op01QxSeU7OE9bOckgCsqFYykkICfr3qNBhsrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdHts3xTFz1BDV; Thu, 10 Jul 2025 14:54: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 56AEsjDg034731; Thu, 10 Jul 2025 14:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEsjLT034728; Thu, 10 Jul 2025 14:54:45 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:54:45 GMT Message-Id: <202507101454.56AEsjLT034728@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: 83e351780f63 - main - nfsv4: No need to check va_flags twice. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 83e351780f634657b74405b8059a1683d01baf4a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=83e351780f634657b74405b8059a1683d01baf4a commit 83e351780f634657b74405b8059a1683d01baf4a Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-10 14:53:13 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-10 14:54:41 +0000 nfsv4: No need to check va_flags twice. Fixes: c5d72d29fe0e Reviewed by: rmacklem --- sys/fs/nfsclient/nfs_clvnops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index fbfcdafaa06b..fa451887e73e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1096,12 +1096,11 @@ nfs_setattr(struct vop_setattr_args *ap) /* * Disallow write attempts if the filesystem is mounted read-only. */ - if ((vap->va_flags != VNOVAL || vap->va_uid != (uid_t)VNOVAL || + if ((vap->va_flags != (u_long)VNOVAL || vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL || vap->va_birthtime.tv_sec != VNOVAL || - vap->va_mode != (mode_t)VNOVAL || - vap->va_flags != (u_long)VNOVAL) && + vap->va_mode != (mode_t)VNOVAL) && (vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); if (vap->va_size != VNOVAL) { From nobody Thu Jul 10 17:03:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdLlt0bK3z61HZn; Thu, 10 Jul 2025 17:03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdLls6p9Yz3ss5; Thu, 10 Jul 2025 17:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g81bXJ1UcII7vpfbZ0QoRtwZT0mcl68lmhFr4NBPeIc=; b=YiDSK9kYX3wIyx1b0Pis2NUZ7FQHo7ApxxYsp/5kfTlXIIm3lsOWdZcYopDUbcNXeJlR14 8HsMylqVU2eNqaVXinCNMXD8uOW/OLFU2er5XFDv3YBYM1DDpcGQfaCcWuXQsoC3EKq05q aRZ/moYOWC3PGqjQSZ7EfAGc/vxeShvPtqb+FGwEVYvYA9fOZ31C/fkmVfyTwJnju7+hOC jFfUjeHFg1godrYs2Om/MRmUBmo9fc/b/VFI/bOAwqCZJt9TXusTSO0Wvim4NfLQQu1EXl itbePNVzoHmgcLbzMiDbt+syKrkXdcUN8MHLxIxy6RJtrcRjP2OwaSxjQItXPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g81bXJ1UcII7vpfbZ0QoRtwZT0mcl68lmhFr4NBPeIc=; b=E6oMXyeXDtf2+aCEhRE+kQmBvcRxn9smD0ECpIUx6VGQKhZlqWKTg5esNdXgrWpFb3FfWs rUvw1vkyA4MwK4ynYh3JWo8enIvEKOKrl7fE+oJuozfKHqE51VC+3Wz+XYtRLdeEyP1epl hIuA7qkm+BVprMaznzG8/Bysb+QYn2WRed0iisrvRdNUOlItabIKE10/hRirqvO64EHkth qXP4HUQzTaWBxxjRa8+oPHRYh7RaOT7lNcioBd6dWlT+ioCaOnRkblTGBOK3M9IddarOQY zBOM2wJ4Nog66Qn2HsJqI+WpGwltBLUa0c81ZpXjWDyru8RZLraGxWrEVTeDyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752167034; a=rsa-sha256; cv=none; b=bE4nS8OK03gLfpJYPK+cGTe5U9EH1WxcI0YIFEexTUcZooYiS0NeP2aT/n7vqGpetRmCzH UNKTaKvxkCEAh5TJDtETWHNJkSoKp8wFU7+bjil6tsl/NSBsnYAgfwqPF3MUinsV2atzlj KXptab2KO1o8mRIrE7WQOAlvqO4lfri1tIeQdr1xCXVMut+H/49bWFojFC6w35kqtLpl8H rzKTPAPPHD9ri2iieQ1ZFMynnWC4eTXMGKLxXUcMez403lY0L1jGxFzDOmk51kipw+Jq8s a3YyYCpN4K5XPNAzgv3DoPdOI/ORtjmzJlMbI7FjeQ88gkn/ruVJEOhjl8tVgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdLls6Msmz1FWq; Thu, 10 Jul 2025 17:03: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 56AH3rql078917; Thu, 10 Jul 2025 17:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AH3rQk078914; Thu, 10 Jul 2025 17:03:53 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:03:53 GMT Message-Id: <202507101703.56AH3rQk078914@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: cad5cfe7507e - main - cam: Use less stack space List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: cad5cfe7507e1b63f8898183da057aa1f0240e39 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cad5cfe7507e1b63f8898183da057aa1f0240e39 commit cad5cfe7507e1b63f8898183da057aa1f0240e39 Author: Warner Losh AuthorDate: 2025-07-10 15:56:13 +0000 Commit: Warner Losh CommitDate: 2025-07-10 16:17:00 +0000 cam: Use less stack space Use less stack space by using the specific type of ccb to do the callback. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51215 --- sys/cam/cam_periph.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 833df6cfb99b..2cf1ef5f53ef 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -767,27 +767,31 @@ camperiphfree(struct cam_periph *periph) CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { - union ccb ccb; - void *arg; - - memset(&ccb, 0, sizeof(ccb)); switch (periph->deferred_ac) { - case AC_FOUND_DEVICE: - ccb.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - xpt_action(&ccb); - arg = &ccb; + case AC_FOUND_DEVICE: { + struct ccb_getdev cgd; + + memset(&cgd, 0, sizeof(cgd)); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_action((union ccb *)&cgd); + periph->deferred_callback(NULL, periph->deferred_ac, + periph->path, &cgd); break; - case AC_PATH_REGISTERED: - xpt_path_inq(&ccb.cpi, periph->path); - arg = &ccb; + } + case AC_PATH_REGISTERED: { + struct ccb_pathinq cpi; + + xpt_path_inq(&cpi, periph->path); + periph->deferred_callback(NULL, periph->deferred_ac, + periph->path, &cpi); break; + } default: - arg = NULL; + periph->deferred_callback(NULL, periph->deferred_ac, + periph->path, NULL); break; } - periph->deferred_callback(NULL, periph->deferred_ac, - periph->path, arg); } xpt_free_path(periph->path); free(periph, M_CAMPERIPH); From nobody Thu Jul 10 17:03:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdLlv3B1mz61Hnf; Thu, 10 Jul 2025 17:03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdLlv0wjGz3smn; Thu, 10 Jul 2025 17:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLofmSqM8xj1QPsBTcLvw7KWWILzKApxIymH33H50fw=; b=PWMZaTj82sszV90sgNfOU/9OG+wzsMVHJLx6Z0vPjKl6KlE60XbeDC5SH6GBtchncN6nGe bxJIaDt4yp+Id138ajfER5x3Y1choHglwrjnLFzW9oHlIX3vAZoKV0agZ5/tkOMDDQrPFA oQkQYqgGNnwefcofVqyk7Kj045gBjTcERk2hhUD7eOzIadFi/MMfFp+qVQGNZQGpT3cY4+ KNTk2vGgIZIY4DbeD6H5qCvWftcucev/jxPSpkou3qa/xG8kIRaXfVmcrlSDvTrJQD9zJy Fn6v/lMvMujp3aPrDV48D/BqdnOGVsXEptDE3Z+2WDDkGL2/2Hdj6xws/6Iu5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLofmSqM8xj1QPsBTcLvw7KWWILzKApxIymH33H50fw=; b=KBlxhmsJMMyZZPUkwewbGGHW1gDMq/BtjSzHoL/WFhyQmF/zNAqrBObxlHKDc8OLrvWoMX aDkPufiGB8GegZo0kQ3SPzeHsMA/xBTw52dFF/mh0MDrrrAcpv39Sso0WZQ4rhdldJfhiA /hjB/ym6X1gOI3tbFiHayME5rNPRjQPAVIXuyKlO0YFF56SEjECas61Du1w1HFi0ET+uTx LVo8CfngwAzTG8wsmoumEK/SpEsAavCx/5+PrVy5/ztXxLSXbmOhtlvgr4t2aMp2iehNyD 2AhNgTl7otgbGd9vAnSp6221PhZ6FZm2+4W1t7kOdxRfxVJvvwwFxiPW5e8jqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752167035; a=rsa-sha256; cv=none; b=yB0khSbSyU1KJIBkq2gK3MH/r+sxuwheu3q67MRKNekMh0sxkvtrnO8eqxuRi379c0Qy5c 3MgSWNl4+++ATOqpnoXrMzqxuqbKNEVIYrqSevZV2B1s40vr5lY0ZieAEtld0LR3y+3rjf idvvn0r1W2cfhRcRc5AMuoGgHHmvjHCLg3180P+at1lpQ9+qQOOjjaCk0A8dQ98OrkupUg NlZDXXZnimvMPYWg8JVriq/YNwsuolK57ljqg4+X68/ZsGONPK3+j3Rc4Q45W3BdRGvNOA XuUL3an6QLkAIrnZaFPEZu8AHVjdVtlk9/45+zO4iEbY2pt/mDJtDt1EWLjPGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdLlv0K3Fz1FvD; Thu, 10 Jul 2025 17:03: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 56AH3sTL078953; Thu, 10 Jul 2025 17:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AH3sMV078950; Thu, 10 Jul 2025 17:03:54 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:03:54 GMT Message-Id: <202507101703.56AH3sMV078950@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: 5a656ef632de - main - cam: Add xpt_gdev_type() and use it instead of many copies of same List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5a656ef632de2f363f37484b0128aa60b688bf32 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5a656ef632de2f363f37484b0128aa60b688bf32 commit 5a656ef632de2f363f37484b0128aa60b688bf32 Author: Warner Losh AuthorDate: 2025-07-10 15:56:20 +0000 Commit: Warner Losh CommitDate: 2025-07-10 16:17:00 +0000 cam: Add xpt_gdev_type() and use it instead of many copies of same Add a convenience wrapper to XPT_GDEV_TYPE in the same way we have one for XPT_PATH_INQ. The changes from PRIORITY_NORMAL to PRIORITY_NONE are intentional because this isn't a queued CCB. Please note: we have several places still that construct a XPT_GDEV_TYPE message by overwriting a CCB that happens to be laying around. I've not used this method, by and large, in those places since I didn't want to risk upsetting allocation flags that might be present (since we use a specail allocator for some CCB types in *_da.c). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51216 --- sys/cam/ata/ata_da.c | 5 +---- sys/cam/cam_periph.c | 16 +++------------- sys/cam/cam_xpt.c | 5 +---- sys/cam/cam_xpt.h | 18 ++++++++++++++++-- sys/cam/mmc/mmc_da.c | 5 +---- sys/cam/scsi/scsi_all.c | 12 ++---------- sys/cam/scsi/scsi_cd.c | 8 +------- sys/cam/scsi/scsi_ch.c | 6 +----- sys/cam/scsi/scsi_da.c | 6 +----- sys/cam/scsi/scsi_enc_ses.c | 5 +---- sys/cam/scsi/scsi_sa.c | 7 +------ 11 files changed, 29 insertions(+), 64 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index ae7cf14c8f8e..1facab47473c 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1359,10 +1359,7 @@ adaasync(void *callback_arg, uint32_t code, case AC_GETDEV_CHANGED: { softc = (struct ada_softc *)periph->softc; - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); /* * Update our information based on the new Identify data. diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 2cf1ef5f53ef..730656684e2a 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -771,10 +771,7 @@ camperiphfree(struct cam_periph *periph) case AC_FOUND_DEVICE: { struct ccb_getdev cgd; - memset(&cgd, 0, sizeof(cgd)); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); periph->deferred_callback(NULL, periph->deferred_ac, periph->path, &cgd); break; @@ -1686,10 +1683,7 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **orig, /* * Grab the inquiry data for this device. */ - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, ccb->ccb_h.path); err_action = scsi_error_action(&ccb->csio, &cgd.inq_data, sense_flags); @@ -2137,11 +2131,7 @@ cam_periph_devctl_notify(union ccb *ccb) sbuf_cat(&sb, "serial=\""); if ((cgd = (struct ccb_getdev *)xpt_alloc_ccb_nowait()) != NULL) { - xpt_setup_ccb(&cgd->ccb_h, ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); - + xpt_gdev_type(cgd, ccb->ccb_h.path); if (cgd->ccb_h.status == CAM_REQ_CMP) sbuf_bcat(&sb, cgd->serial_num, cgd->serial_num_len); xpt_free_ccb((union ccb *)cgd); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 38bc82c69aad..2ec736e7f4ac 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2471,15 +2471,12 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) return (1); - memset(&cgd, 0, sizeof(cgd)); xpt_compile_path(&path, NULL, device->target->bus->path_id, device->target->target_id, device->lun_id); - xpt_setup_ccb(&cgd.ccb_h, &path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, &path); csa->callback(csa->callback_arg, AC_FOUND_DEVICE, &path, &cgd); diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 57225a0ae92d..3815f42cba40 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -145,8 +145,8 @@ uint32_t xpt_poll_setup(union ccb *start_ccb); void xpt_sim_poll(struct cam_sim *sim); /* - * Perform a path inquiry at the request priority. bzero may be redundant for - * allocated CCBs, but for the on-stack CCBs it's required. + * Perform a path inquiry. bzero may be redundant for allocated CCBs, but for + * the on-stack CCBs it's required. */ static inline void xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) @@ -158,6 +158,20 @@ xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) xpt_action((union ccb *)cpi); } +/* + * Perform get device type. bzero may be redundant for allocated CCBs, but for + * the on-stack CCBs it's required. + */ +static inline void +xpt_gdev_type(struct ccb_getdev *cgd, struct cam_path *path) +{ + + bzero(cgd, sizeof(*cgd)); + xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NONE); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_XPT_H */ diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index f7c478076144..7f8bf3516804 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -692,10 +692,7 @@ sddaasync(void *callback_arg, uint32_t code, case AC_GETDEV_CHANGED: { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("=> AC_GETDEV_CHANGED\n")); - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); cam_periph_async(periph, code, path, arg); break; } diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 13a376ebb6e3..b518f84454ad 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -3708,11 +3708,7 @@ scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, /* * Get the device information. */ - xpt_setup_ccb(&cgd->ccb_h, - csio->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); + xpt_gdev_type(cgd, csio->ccb_h.path); /* * If the device is unconfigured, just pretend that it is a hard @@ -5144,11 +5140,7 @@ scsi_sense_sbuf(struct cam_device *device, struct ccb_scsiio *csio, /* * Get the device information. */ - xpt_setup_ccb(&cgd->ccb_h, - csio->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); + xpt_gdev_type(cgd, csio->ccb_h.path); /* * If the device is unconfigured, just pretend that it is a hard diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 00a417f65052..e622a96ec77e 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -1240,13 +1240,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) /*getcount_only*/0); status = done_ccb->ccb_h.status; - - bzero(&cgd, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, - done_ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, done_ccb->ccb_h.path); if (scsi_extract_sense_ccb(done_ccb, &error_code, &sense_key, &asc, &ascq)) diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index 89a817c1b488..3da22ba61392 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -1705,11 +1705,7 @@ chscsiversion(struct cam_periph *periph) /* * Get the device information. */ - xpt_setup_ccb(&cgd->ccb_h, - periph->path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); + xpt_gdev_type(cgd, periph->path); if (cgd->ccb_h.status != CAM_REQ_CMP) { xpt_free_ccb((union ccb *)cgd); diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 0a2389cd9b5d..9eda664ee7b0 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -5035,11 +5035,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) /*timeout*/0, /*getcount_only*/0); - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, done_ccb->ccb_h.path); if (scsi_extract_sense_ccb(done_ccb, &error_code, &sense_key, &asc, &ascq)) diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index c429e820a1fd..435874a9874a 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -979,10 +979,7 @@ ses_paths_iter(enc_softc_t *enc, enc_element_t *elm, != CAM_REQ_CMP) return; - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, path); if (cam_ccb_success((union ccb *)&cgd)) callback(enc, elm, path, callback_arg); diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index cfd48c98f30e..88147393192f 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -4731,12 +4731,7 @@ saextget(struct cdev *dev, struct cam_periph *periph, struct sbuf *sb, SASBADDVARSTR(sb, indent, periph->periph_name, %s, periph_name, strlen(periph->periph_name) + 1); SASBADDUINT(sb, indent, periph->unit_number, %u, unit_number); - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, - periph->path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); if ((cgd.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { g->status = MT_EXT_GET_ERROR; snprintf(g->error_str, sizeof(g->error_str), From nobody Thu Jul 10 17:03:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdLlw4MvFz61HhL; Thu, 10 Jul 2025 17:03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdLlw1hsSz3sbT; Thu, 10 Jul 2025 17:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9AvvtslT+j+c8PRCPCJ8XlXqQqGknbzX9yFF6bPrBQ=; b=pjdyG9nsB0v9YBfDX8E5GCDTALwwb8X/06CK6jTdpF/vGYeWayiMYWiqdsdzTYiGZq4HaI 0HoZOY3rP+yeWixjWaadiGINEskI/7c+/vreXCWRaenA0yVChWBWmqVH1RZ/sYKI7rTQcr 9XJDhaqRbKQqnot/WyeIPP6PP8O0+qHDt315GhENrO+LkZzLGQEBRiKngHrb+kjAapl8gw GTFN81d6db6KI2itXtWIy58Ma8bDkpQBThBDuG6IVUCcuPt88Pxe/ga3lXlxuxDrB2x1JI PGteNa6Q6VW+Jtt7tlHqy8RGs8PWs33XUUebbYT2Vny6OcaO+0M458r6Qkoggg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9AvvtslT+j+c8PRCPCJ8XlXqQqGknbzX9yFF6bPrBQ=; b=XqlP4+4UpWiFvz2y5Uh8y82zJyAJIpsBjeutSE6uXbaPBCsiOrsaydUzLYiQJ6pN8EZ/wH 4/p121VEkMtj9/bx4A5eHg24zOCYQCK+GzKQo6ubB8wJmNiz8K5KBiypeav9J9hcqi6Svh nv9KQJXWa62H5LbUr1YY6YF/EQfcDdJ+UYEqWg9y4B6zf8O34jVpdYRkz/m4N/Mky5Nk89 +yoAlJdv+sa4gFNHnEARaIxKm3Ho+oZfhRNgpSdAX83t+0l0KTQJaEvcaTxd9AadYJtXXe Be0San6XKAtZhCXmchJ+0mfGP28w4ewQoQttD8KvOEZr+RbP7QYEthHwq7LXnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752167036; a=rsa-sha256; cv=none; b=uCsQC8vgMuXhhl2ERsdnswNR+sc2m6EMgmCxgLlTjnB1pVBw+1NHjX6mmPeoohSdEdq2/a S9BRWSp20x3V5hBv/CTdsOtNpsh8E4Z2+/v/TFVT0OTUOMsAwyVgJD4kxrRtxK/E+LjE7n 3PLhorGYtw/sI7vpq+gdwuEj7n4fUozDXwofmogK23RjydTiOUPBqJ+Y92TtCYQREn+5EC ZjHv4ozA4ZShmwMUGlp372Dmmo89XObge1XNWOIhNLmFNANmfUyw3AP55nNzaHqJt4/o2c /DkNv91cMiEQRi3UB3gH/ZMisXDkBSCMeS78UHNdrwMeRnofCCMRRNTvBJ34Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdLlw1FfPz1G2x; Thu, 10 Jul 2025 17:03: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 56AH3uE0078988; Thu, 10 Jul 2025 17:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AH3uEj078985; Thu, 10 Jul 2025 17:03:56 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:03:56 GMT Message-Id: <202507101703.56AH3uEj078985@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: d78d04b17cb2 - main - cam: Fail the disk if READ CAPACITY returns 4/2 asc/ascq List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d78d04b17cb2498186e8fd2681f224a760e75b28 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d78d04b17cb2498186e8fd2681f224a760e75b28 commit d78d04b17cb2498186e8fd2681f224a760e75b28 Author: Warner Losh AuthorDate: 2025-07-10 15:56:26 +0000 Commit: Warner Losh CommitDate: 2025-07-10 16:17:01 +0000 cam: Fail the disk if READ CAPACITY returns 4/2 asc/ascq HGST disks that are sick are returning 44/0 for START UNIT (which we ignore) and then 4/2 on READ CAPACITY. START UNIT should be enough for READ CAPACITY to succeed or UNIT ATTENTION. However, we get NOT_READ + 4/2 back. I've seen this on several models of HGST drives. Invalidate the peripheral when we detect this condition. This is likely the least bad thing we can do: It removes access to daX, but leaves passY so logs may be extracted (if awkwardly). Removing daX access removes the disk device that causes problems to geom outlined below. Although the timeout is 5s for READ_CAPACITY, we wait the full 30s for READ_CAPACITY_16. This causes us to stall booting as we start to taste as soon as we release the final hold... but the tasting means g_wait_idle() takes now takes over 5 minutes to clear since we do this for all the opens. Even using a timeout of 3s instead of 30s leads to boot times of almost 5 minutes in these cases, so there are other, downstream operations that are taking a while, so it's not just a matter of adjusting the timeout. Failing the periph early solves the bulk of this problem (the tasting related delays). What the HBA does is HBA specific and some have firmwares that are also confused by this when they enumerate or discover the drive, leading to long (but still shorter than 5 minute) delays. This patch won't solve that aspect of startup delays with sick disks. Perhaps we should fail the periph when START UNIT fails with the same codes we check in the read capacity path. I'm reluctant to do such a global change since it's in cam_periph, and there seems no good way to flag that we want this behavior. It's also a bit magical when it runs (some drive report 44/0 always, and some just report it on START UNIT, and these HGST drive fall into the latter category). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51218 --- sys/cam/scsi/scsi_da.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 9eda664ee7b0..d02750aaacaf 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -5073,6 +5073,18 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) * behind a SATL translation that's fallen into a * terminally fatal state. * + * 4/2 happens on some HGST drives that are quite + * ill. We've already sent the start unit command (for + * which we ignore a 44/0 asc/ascq, which I'm hesitant + * to change since it's so basic and there's other error + * conditions to the START UNIT we should ignore). So to + * require initialization at this point when it should + * be fine implies to me, at least, that we should + * invalidate. Since we do read capacity in geom tasting + * a lot, and since this timeout is long, this leads to + * up to a 10 minute delay in booting. + * + * 4/2: LOGICAL UNIT NOT READY, INITIALIZING COMMAND REQUIRED * 25/0: LOGICAL UNIT NOT SUPPORTED * 44/0: INTERNAL TARGET FAILURE * 44/1: PERSISTENT RESERVATION INFORMATION LOST @@ -5080,6 +5092,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) */ if ((have_sense) && (asc != 0x25) && (asc != 0x44) + && (asc != 0x04 && ascq != 0x02) && (error_code == SSD_CURRENT_ERROR || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; From nobody Thu Jul 10 17:54:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdMtG1mDdz61LGc; Thu, 10 Jul 2025 17:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtG133qz3JnY; Thu, 10 Jul 2025 17:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmcgYoSJKVuxEKhRCsvY6JMTJwYd2DgRjqKn+ED0ewc=; b=mCKDH52yPNlML28Yztt1agfgZAYr2UimMCvoHbg7Phsk0OYJ3gPTtSY8FcMUAC8ix/JL1s SFR+fJWKL9Pb1EDP3vOwdIbPcygZav1eq/Sw3pMG5qHkgYLpfLyjVS0/9yCqwB/Gg29cF2 KckvuKGBvWgPFPzZ3pB6KFpmKDd9oN56XBu6Z1eNJrYMF+IABPxK9pyzSrNxi5cRU9Ofrt P5c48/RwK4/YVcdldg1BS8A2PpG8xAguhijxrrWfCqZb2netPo1qeI77OTorzgbQNqTKAR WrJzcRBGuHP9vmTOu71Qd7zAr0QIEOiZUknim6IVPSc5M4gYNNRKg7vqoPW99A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmcgYoSJKVuxEKhRCsvY6JMTJwYd2DgRjqKn+ED0ewc=; b=iwgwklag3IuEvUW0zwL0tf8PRMKRxcKpPIkej4mh6WvWM6+dJIu5C/sxVarqNNemdphvVo CRIo/Ke0xBuYgoRSfVGaAQSweYnkTXBnYoFlt3H1T44gNSXt5GpmC1qWNfPlHtNrMg2M2u 6UjgIXoZl3hXRYDavixptXUtPPp/k1aV+skwd+czRTrTvSbuCZfrg990nrqX+XiqBsYpai 1r0t4w5BkamlQC3cHm/9BBNBiDDHaxNjwzytYH9p3fI4iCBrT20qCUmscxnfebnx49kbiH D5R+VkKVYn/Z+5dXbHbb6DdgJD37xWHf67o4G0TrbtGNs7AVA055fCHKtOcThA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170070; a=rsa-sha256; cv=none; b=YgGBi2gKz4WIU0jHzqv9ozNouSDGA1Ffl4svJe2iiThOg+zOlNXG53axYGTDKqLXIQBaf1 ntwgXS5BBViLjHfxRDTVGqa1y5FSe0DTEDobRNzJfiClShA0GzNVBgaYlYYDL/sxlH8H1f Xvr9/4OdJTPGQuXRhdIhXSI8Q2OHT0dohtMZbaxsEop1Uvhi+yHHWfG+imVok3zyy50vi2 yO1LdE/wFnXo5U7PmADdlvsRMn7OPm89vgjXIydJ56xpFyEoNDF1nbGx5ehVScwyl6Ssbv Kcw1//Bz7IqLOZ6UyoFuU01MvetO/7Y0fAh4xtn1+U2EAxZ/HrDt0dwSQ1G7zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdMtG06VPz1GKj; Thu, 10 Jul 2025 17:54: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 56AHsTq8072041; Thu, 10 Jul 2025 17:54:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsTqf072038; Thu, 10 Jul 2025 17:54:29 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:29 GMT Message-Id: <202507101754.56AHsTqf072038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: df268d4b03a1 - main - lockf: add a -p mode to write the child's pid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df268d4b03a16869502d6842d40aeb66329db982 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=df268d4b03a16869502d6842d40aeb66329db982 commit df268d4b03a16869502d6842d40aeb66329db982 Author: Kyle Evans AuthorDate: 2025-06-24 15:41:53 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:19 +0000 lockf: add a -p mode to write the child's pid If we're going to hold the lock, it can be useful to scribble down the pid that we spawned off to quickly associate the lock back to the process that's keeping it open. Reviewed by: allanjude (previous version), des Differential Revision: https://reviews.freebsd.org/D51014 --- usr.bin/lockf/lockf.1 | 14 ++++++++++++-- usr.bin/lockf/lockf.c | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index d73033101632..5832903246f1 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 25, 2023 +.Dd June 24, 2025 .Dt LOCKF 1 .Os .Sh NAME @@ -30,7 +30,7 @@ .Nd execute a command while holding a file lock .Sh SYNOPSIS .Nm -.Op Fl knsw +.Op Fl knpsw .Op Fl t Ar seconds .Ar file .Ar command @@ -126,6 +126,16 @@ is not specified, will create .Ar file if necessary. +.It Fl p +Write the pid of the +.Ar command +to +.Ar file . +This option will cause +.Nm +to open +.Ar file +for writing rather than reading. .It Fl t Ar seconds Specifies a timeout for waiting for the lock. By default, diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 7f88753d1743..93164e30762c 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -91,15 +91,15 @@ fdlock_implied(const char *name, long *ofd) int main(int argc, char **argv) { - int ch, flags, silent, status; + int ch, flags, silent, status, writepid; long long waitsec; pid_t child; union lock_subject subj; - silent = keep = 0; + silent = keep = writepid = 0; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "knst:w")) != -1) { + while ((ch = getopt(argc, argv, "knpst:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -120,6 +120,10 @@ main(int argc, char **argv) "invalid timeout \"%s\"", optarg); } break; + case 'p': + writepid = 1; + flags |= O_TRUNC; + /* FALLTHROUGH */ case 'w': flags = (flags & ~O_RDONLY) | O_WRONLY; break; @@ -249,6 +253,11 @@ main(int argc, char **argv) fclose(stdin); fclose(stdout); fclose(stderr); + + /* Write out the pid before we sleep on it. */ + if (writepid) + (void)dprintf(lockfd, "%d\n", child); + if (waitpid(child, &status, 0) == -1) exit(EX_OSERR); return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); From nobody Thu Jul 10 17:54:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdMtH2mpLz61LgT; Thu, 10 Jul 2025 17:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtH1h1Kz3Jnf; Thu, 10 Jul 2025 17:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B75agXJrAyri/9H7FbNtgc90oGSdFuMoa3677MbEcFY=; b=hSS2E+cJaTpSX2tRWfd+jMlUtDsfEXFPHq6pc5iOyqZvYelOvxE3BjQrkGzNJxqrtNEvy/ tzVb6zJR265sWrRxvDmPtuwLhuW43aHbMUEkQoSjXBRd6kQdqBlR/4B2Z6RgO9fGybHHCJ GcEpSGtJ5xbiXISX9HLh77TpSr7IkO2IZg1A9KolzSoSxkFgJmR6m1rFnFa9JLa54DXqkE CTNgSfTjuG6icN3t/CkCnReHIIU93t0+F+wF7axK6aZChNqXyWEzdiyRL0mq60ybskrV2L v8QASZl0EuC0LadbdReTdU413t2cxWu5lO/aE8gsr14Vgqf1kd8oBLtEoqB80Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B75agXJrAyri/9H7FbNtgc90oGSdFuMoa3677MbEcFY=; b=HtqH2rQJPgLgWvZWfOr7bBKmwlUnkNlzEBUs10hFR3Ztseb8JYj7gXZ+wTq2yC0AR9CiFv xzJTVvl1skxlssls87zPySLFg29QqWjmpr0LqeoHh9Apri2SUP781ezk6gJxtTlzlvKg6h f5r2zFF93aTv7yFH20RSQIVgIuV2NYs7U8ZmpGvwfmVHasIbKYSGqpzqLLTM14jFaXWiBa 1UClg7qkownqwEdgXW48Bn9rYlkxzPwNMES9GOLvruGd9wvx7ApDeWRU8CPIJ0zVCGRxTH Yn9qb/BTERH+frrByGhLBq1Txf8RN2XcCnSWAyMkIRgL99yUc8424KIsfOuueQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170071; a=rsa-sha256; cv=none; b=Pdgkah7JqbGHelP+n6br+V5vhmG4V1VnhmYF+bock7C61Y8lAS/9RJgMNbo813yCGzy9M5 zf15GFdyMUTK3RPD8yGs/ThYa3Q/wCaidvBMJOp6U1Ic042EltXWzKHED/mMf1T32TjOSp AGZB49Ul6z0Cu4bGYQhffF3IMV7SRvRzKn6r5GVuGKwAOKtTMtO6SGYeNCl2EEP4ZRSalP SU+WMWYrZR4U2XjP9MeNyYd6V1/DAVFMC6YfcFp++ErUZ/dFkJVi2cpsi9iX6TM+ujJEI3 hBYmfWumG6hvGwiG5Uk4V8DhflGMWJxRvC+zJ8c3Z0Zxm8p1lYfyqZR6wJP1cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdMtH1BNbz1Gvg; Thu, 10 Jul 2025 17:54: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 56AHsVJ1072074; Thu, 10 Jul 2025 17:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsVK4072071; Thu, 10 Jul 2025 17:54:31 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:31 GMT Message-Id: <202507101754.56AHsVK4072071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 7e8afac0cb2d - main - lockf: switch to a SIGCHLD model for reaping child List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d commit 7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d Author: Kyle Evans AuthorDate: 2025-06-24 22:18:27 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:19 +0000 lockf: switch to a SIGCHLD model for reaping child A future change will add a -T flag to forward SIGTERM along to the child before we cleanup and terminate ourselves. Using a SIGCHLD handler to do that with SIGTERM blocked only while the child is actively being collected will enable us to safely do so without having to worry that our pid is potentially invalid. Add a test that concisely checks that the child's error is properly bubbled up to the caller. Reviewed by: des, kib Differential Revision: https://reviews.freebsd.org/D51024 --- usr.bin/lockf/lockf.c | 69 ++++++++++++++++++++++++++++++++++++--- usr.bin/lockf/tests/lockf_test.sh | 8 +++++ 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 93164e30762c..19424418ed68 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -50,14 +51,19 @@ union lock_subject { static int acquire_lock(union lock_subject *subj, int flags, int silent); static void cleanup(void); static void killed(int sig); +static void sigchld(int sig); static void timeout(int sig); static void usage(void) __dead2; static void wait_for_lock(const char *name); static const char *lockname; +_Static_assert(sizeof(sig_atomic_t) >= sizeof(pid_t), + "PIDs cannot be managed safely from a signal handler on this platform."); +static sig_atomic_t child = -1; static int lockfd = -1; static int keep; static int fdlock; +static int status; static volatile sig_atomic_t timed_out; /* @@ -91,10 +97,14 @@ fdlock_implied(const char *name, long *ofd) int main(int argc, char **argv) { - int ch, flags, silent, status, writepid; + struct sigaction sa_chld = { + .sa_handler = sigchld, + .sa_flags = SA_NOCLDSTOP, + }, sa_prev; + sigset_t mask, omask; long long waitsec; - pid_t child; union lock_subject subj; + int ch, flags, silent, writepid; silent = keep = writepid = 0; flags = O_CREAT | O_RDONLY; @@ -238,9 +248,30 @@ main(int argc, char **argv) if (atexit(cleanup) == -1) err(EX_OSERR, "atexit failed"); + + /* + * Block SIGTERM while SIGCHLD is being processed, so that we can safely + * waitpid(2) for the child without a concurrent termination observing + * an invalid pid (i.e., waited-on). If our setup between here and the + * sigsuspend loop gets any more complicated, we should rewrite it to + * just use a pipe to signal the child onto execvp(). + * + * We're blocking SIGCHLD and SIGTERM here so that we don't do any + * cleanup before we're ready to (after the pid is written out). + */ + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + sigaddset(&mask, SIGTERM); + (void)sigprocmask(SIG_BLOCK, &mask, &omask); + + memcpy(&sa_chld.sa_mask, &omask, sizeof(omask)); + sigaddset(&sa_chld.sa_mask, SIGTERM); + (void)sigaction(SIGCHLD, &sa_chld, &sa_prev); + if ((child = fork()) == -1) err(EX_OSERR, "cannot fork"); if (child == 0) { /* The child process. */ + (void)sigprocmask(SIG_SETMASK, &omask, NULL); close(lockfd); execvp(argv[0], argv); warn("%s", argv[0]); @@ -250,16 +281,24 @@ main(int argc, char **argv) signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTERM, killed); + fclose(stdin); fclose(stdout); fclose(stderr); /* Write out the pid before we sleep on it. */ if (writepid) - (void)dprintf(lockfd, "%d\n", child); + (void)dprintf(lockfd, "%d\n", (int)child); + + /* Just in case they were blocked on entry. */ + sigdelset(&omask, SIGCHLD); + sigdelset(&omask, SIGTERM); + while (child >= 0) { + (void)sigsuspend(&omask); + /* child */ + atomic_signal_fence(memory_order_acquire); + } - if (waitpid(child, &status, 0) == -1) - exit(EX_OSERR); return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); } @@ -323,6 +362,26 @@ killed(int sig) _Exit(EX_OSERR); } +/* + * Signal handler for SIGCHLD. Simply waits for the child and ensures that we + * don't end up in a sticky situation if we receive a SIGTERM around the same + * time. + */ +static void +sigchld(int sig __unused) +{ + int ostatus; + + while (waitpid(child, &ostatus, 0) != child) { + if (errno != EINTR) + _exit(EX_OSERR); + } + + status = ostatus; + child = -1; + atomic_signal_fence(memory_order_release); +} + /* * Signal handler for SIGALRM. */ diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index d73c7590653d..0cdf7dae6f57 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -62,6 +62,13 @@ basic_body() atf_check test ! -e "testlock" } +atf_test_case bubble_error +bubble_error_body() +{ + # Ensure that lockf bubbles up the error as expected. + atf_check -s exit:9 lockf testlock sh -c 'exit 9' +} + atf_test_case fdlock fdlock_body() { @@ -233,6 +240,7 @@ atf_init_test_cases() { atf_add_test_case badargs atf_add_test_case basic + atf_add_test_case bubble_error atf_add_test_case fdlock atf_add_test_case keep atf_add_test_case needfile From nobody Thu Jul 10 17:54:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdMtK0td1z61L7l; Thu, 10 Jul 2025 17:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtJ2TMRz3JcB; Thu, 10 Jul 2025 17:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i1OuLSm1Ekz7ue7G2QW84qHU3rhDtIgvH0yDtIfru9w=; b=cMbDR0SAELJCpODRdnZj/cZK3qOy6PgzlBGRYM2CkOYB19XJHK6+jWFdJpeLsCwMciFEOz SNYl/xurU9sYBt7KgP5EMBZsmr21CYMdrA8We0e4E8+8xcpTqHaIYZPu3wEH7Tw036q3TC DvXGzuAgbYKhV/ELmxqvn3CkpqdvZHq+NmI/xjm1K+SXo3ZHbtknJM3J2EQP8Yqk6NgayT /XKnRdbHH9hLELCi2++TnEQWh2xXOVn60qRWnZYk7KV5XBjJVo50n8p2O9677+xwB8PcKJ 6Wf7kOJtzEIGmk+TuRgmpVt7OVtVdoThYvb5Z8UK1/hbiRJNUJXMNtnW7LPcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i1OuLSm1Ekz7ue7G2QW84qHU3rhDtIgvH0yDtIfru9w=; b=I+5cbv1sSP+88wcoWR1rPgQCHhc1F33jfZtda+1xIhQh7nockTHpH96uzujC2xeI9jOHxl f37PiN5egzPpeSs8blTAMnH5GeAE7zeBNM7YL9J+/8r9Kdi71NQLirzOTxQDl5zOMA4OUF r4WTKjwtq0vFvRT0/GSOst0Wt6672t2rnzCw4NIJYmV+up5RbBLps8NwKo361BAz6xR5rq 96Bq8XLp0jntcpkuKZJQUfQEwTtuSgGUvlep2ib4vWb+Eg6ltfdTPW+k0/Ew0xUsRqgV2o wdGi3ipBPzxNPPbyLi8iUbIldBGES1P3cIHwTlsTfe2QvM4+ULgOjICHnBlauQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170072; a=rsa-sha256; cv=none; b=lHjL5Mei5A76cQSlgEpBviin28e6kM/9rxJjtnupTgOuq8MSgBpl+QXnGFNkdDUl1aDqhB m9MMXVpfHnlYAmhD0PjLNEoXK2q1la5rQqpTyGWX/8aN2lw3ICylFEQ480vZ0VJfL/8lRW wWjuH+YyD0/eJU9Lt0oYh9rxuX3n8IqkWKiNUudzqkr1Kf9grgcDdIq/AY2WzWtOX7l8JP y1H2jLbIySPIdS1S4EMPuhaiNhDflWxKkGosIgleyr1lh8SVfc1sS0/0KiGqk7Ez5KHtv+ 9fZ0cjA/2JsBrVQg/GD4QHY3a8pB6aa8zRtRtKvSjFXELKqdZ7vObm9fysIj3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdMtJ21rhz1GHK; Thu, 10 Jul 2025 17:54: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 56AHsWIE072108; Thu, 10 Jul 2025 17:54:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsWPR072105; Thu, 10 Jul 2025 17:54:32 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:32 GMT Message-Id: <202507101754.56AHsWPR072105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 679f619495f6 - main - lockf: add a -T option to terminate the child upon early abort List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 679f619495f67eafc9fdb97d11381b14f2b49ccf Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=679f619495f67eafc9fdb97d11381b14f2b49ccf commit 679f619495f67eafc9fdb97d11381b14f2b49ccf Author: Kyle Evans AuthorDate: 2025-06-24 23:03:14 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:20 +0000 lockf: add a -T option to terminate the child upon early abort This is useful to avoid having the command running twice in the face of the admin terminating the process. Notably, if the -p option is not in use (or can't be used, e.g., because we can't open the file for writing) then this provides a nice alternative where one simply needs to send a SIGTERM to the lockf(1) process associated with the lock file to clean it all up. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D51025 --- usr.bin/lockf/lockf.1 | 18 +++++++++++++++++- usr.bin/lockf/lockf.c | 9 ++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index 5832903246f1..40b4497bc80c 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -30,7 +30,7 @@ .Nd execute a command while holding a file lock .Sh SYNOPSIS .Nm -.Op Fl knpsw +.Op Fl knpsTw .Op Fl t Ar seconds .Ar file .Ar command @@ -136,6 +136,22 @@ This option will cause to open .Ar file for writing rather than reading. +.It Fl T +Upon receipt of a +.Dv SIGTERM , +forward a +.Dv SIGTERM +along to the +.Ar command +before cleaning up the +.Ar file +and exiting. +By default, +.Nm +effectively orphans the +.Ar command +after cleaning up the +.Ar file . .It Fl t Ar seconds Specifies a timeout for waiting for the lock. By default, diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 19424418ed68..b0e16285998a 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +65,7 @@ static int lockfd = -1; static int keep; static int fdlock; static int status; +static bool termchild; static volatile sig_atomic_t timed_out; /* @@ -109,7 +111,7 @@ main(int argc, char **argv) silent = keep = writepid = 0; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "knpst:w")) != -1) { + while ((ch = getopt(argc, argv, "knpsTt:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -120,6 +122,9 @@ main(int argc, char **argv) case 's': silent = 1; break; + case 'T': + termchild = true; + break; case 't': { const char *errstr; @@ -356,6 +361,8 @@ static void killed(int sig) { + if (termchild && child >= 0) + kill(child, sig); cleanup(); signal(sig, SIG_DFL); if (kill(getpid(), sig) == -1) From nobody Thu Jul 10 17:54:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdMtK6CKXz61LZr; Thu, 10 Jul 2025 17:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtK3LQNz3Jp3; Thu, 10 Jul 2025 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RHHVb6UyXOvk88J5+yo0jZ1TmfGbT0Q+B2h6xV/WYto=; b=ajs1MgD22vHdMwrjnHzy3eVdT/WUDM/SfCoJwheJ1orS9Ldmv2Kz9t1crUNtC4Z0/RIVC0 ARmQp1J8CgyYtrf9u5bkZ5qgvGFmnFcy1sOtGj/4gIUZ9nlOIoNDho4tPevYedIE/uAWob z1uuUhR8b9EBlZ8trkvhldPA5IxXzi0jAT6qgd9AVm2tDx8CyDNEp08X+CLZiSK8j9PQZw f9GZRAsPQ0dZy5njmgPSjbv4H9zQ6m7yFZSzK+cKBKPsN+j+T0NgqtKpN1g8GyCiOOOMNb jHxf84GvrpdDJJueDRuuE5TdceP8LCLDNyRA4xbgrtrAbgfZnbV/c0kwsoc+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RHHVb6UyXOvk88J5+yo0jZ1TmfGbT0Q+B2h6xV/WYto=; b=Urtt6bYShRbsNZv9ThApqkt2ULhmsG7XZ9vsGj3opKoMWMwHr8mGYK/hdcvA9syDmNU+3k tS9i7d2FT7LPBtdXNbt8tGBC0qjgoQv4KlrRQ5W4pTnkKsOiqmvp7IY7QFvRWW1ylPIBAV dioJyJ4MUQT1oGIlIm7Au+2hTOKv1Pe/QbKxG9/6smmZ43OUR7zUVqvkKetSHHGXJTJ5pU zRHzJF4soUEOIg0/tOpcDkVawWWL6LtsFT5cip4cGvsfnaVbIw2uCaa5Aix65Zn8WDDi24 Ox6l/Z9U351GDP7HwZs9bTFq72d2fim3g9UmaNNvflzvLDuO5kLqCI9Wfip3Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170073; a=rsa-sha256; cv=none; b=h7LAGem9QoAGffz4vP3BoIwP3toGup+NoammMF+TNAPGLoCqJRK8k4g6tEz7zAM8/aam5B kehI+LFXOwBzp52WRe7Md73mvyg36Sxi7HSh0QQMkS5kVCxdMEM6lbY0QBeUdjZWHSNliz YgLSm1wB/aIG4Hk26GJ4MeY01QPi41OV/yzu+vruwB0VaF7cfRn34gmuSeCt4T9bWuzEAo K2KL3T46hfqwad9t0vRah7rIh+OhBR95eDEL0fmaJcfRXudSw2D3WgngOPDv+ToVx3pOFe ab/+TECfPaTHzvPacDUY92EysHc0iIpmqHGZGWRmX2Gi0ZxXOoN1j8bhVZVxIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdMtK2xzsz1H7x; Thu, 10 Jul 2025 17:54: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 56AHsXF3072142; Thu, 10 Jul 2025 17:54:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsXt4072139; Thu, 10 Jul 2025 17:54:33 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:33 GMT Message-Id: <202507101754.56AHsXt4072139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c82203e65d08 - main - lockf: tests: add tests for the -p and -T features List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c82203e65d08036d25ed117f2617ef4ad07d6f97 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c82203e65d08036d25ed117f2617ef4ad07d6f97 commit c82203e65d08036d25ed117f2617ef4ad07d6f97 Author: Kyle Evans AuthorDate: 2025-06-24 23:04:11 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:20 +0000 lockf: tests: add tests for the -p and -T features Reviewed by: des Differential Revision: https://reviews.freebsd.org/D51026 --- usr.bin/lockf/tests/lockf_test.sh | 95 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index 0cdf7dae6f57..823b5673a176 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -31,6 +31,24 @@ : ${EX_CANTCREAT:=73} : ${EX_TEMPFAIL:=75} +waitlock() +{ + local cur lockfile tmo + + lockfile="$1" + + cur=0 + tmo=20 + + while [ "$cur" -lt "$tmo" -a ! -f "$lockfile" ]; do + sleep 0.1 + cur=$((cur + 1)) + done + + atf_check_not_equal "$cur" "$tmo" +} + + atf_test_case badargs badargs_body() { @@ -196,6 +214,52 @@ needfile_body() atf_check test "$tpass" -lt 10 } +atf_test_case termchild +termchild_body() +{ + lockf -kp testlock sleep 30 & + lpid=$! + + waitlock testlock + + atf_check -o file:testlock pgrep -F testlock + + start=$(date +"%s") + atf_check kill -TERM "$lpid" + wait "$lpid" + end=$(date +"%s") + elapsed=$((end - start)) + + if [ "$elapsed" -gt 5 ]; then + atf_fail "lockf seems to have dodged the SIGTERM ($elapsed passed)" + fi + + # We didn't start lockf with -T this time, so the process should not + # have been terminated. + atf_check -o file:testlock pgrep -F testlock + + lockf -kpT testlock sleep 30 & + lpid=$! + + waitlock testlock + + atf_check -o file:testlock pgrep -F testlock + + start=$(date +"%s") + atf_check kill -TERM "$lpid" + wait "$lpid" + end=$(date +"%s") + elapsed=$((end - start)) + + if [ "$elapsed" -gt 5 ]; then + atf_fail "lockf -T seems to have dodged the SIGTERM ($elapsed passed)" + fi + + # This time, it should have terminated (notably much earlier than our + # 30 second timeout). + atf_check -o empty -e not-empty -s not-exit:0 pgrep -F testlock +} + atf_test_case timeout timeout_body() { @@ -219,6 +283,34 @@ timeout_body() wait "$lpid" || true } +atf_test_case writepid +writepid_body() +{ + lockf -p "testlock" sleep 10 & + lpid=$! + + waitlock "testlock" + + atf_check test -s testlock + atf_check -o file:testlock pgrep -F testlock + atf_check -o file:testlock pgrep -F testlock -fx "sleep 10" + atf_check pkill -TERM -F testlock + + wait + + atf_check test ! -f testlock +} + +atf_test_case writepid_keep +writepid_keep_body() +{ + # Check that we'll clobber any existing contents (a pid, usually) + # once we acquire the lock. + jot -b A -s "" 64 > testlock + atf_check lockf -kp testlock sleep 0 + atf_check -o not-match:"A" cat testlock +} + atf_test_case wrlock wrlock_head() { @@ -244,6 +336,9 @@ atf_init_test_cases() atf_add_test_case fdlock atf_add_test_case keep atf_add_test_case needfile + atf_add_test_case termchild atf_add_test_case timeout + atf_add_test_case writepid + atf_add_test_case writepid_keep atf_add_test_case wrlock } From nobody Thu Jul 10 17:54:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdMtL6M6fz61LQ0; Thu, 10 Jul 2025 17:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtL3ytrz3K4N; Thu, 10 Jul 2025 17:54:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vUPm/NPjZIf8ykT/9ue4cGcSgHt8qSZJUNQzkFEFWlM=; b=HojFXQC+p04cIgaLCyeF6OhU2OOEXkYIwv4+Gj3dsoMON5dmvpgoCZ8qAe/gMlBmUXTqaD vDDm5VaTz24pVtAtafiqHEAp4vtNbR+D0lvzz5QZuiPMtqA5nqu4TME3aHCWMUe2wixT8+ nG+VKCFVAz4A8dVWN3okf+ouBvrhJvOyG9k4zRNdkx1rYRCEry48bRBhoEvWhrWvEBgJAo neKcKPbhgZr0Yx0ygCpJ28wF0mGdfzN/rZJ5/aWoVvjleSupGzJ49au50+yGz1PqLoTwOb kUVRAtpripMtHn0E4E24zZt6WYnei5irNU79/o9FdwdZ0vDRIhhPLP9lr5BGKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vUPm/NPjZIf8ykT/9ue4cGcSgHt8qSZJUNQzkFEFWlM=; b=v3qtY6agbvzGry5iScEL/4mEhy5fdzlJ6IsuTKfO1WIbLEdOvzLqlRkicQnStMKdQD1cuz x3MfRW1oa+VMjAX669H+G9JlzP639bcA1D26Qy/H3fcPNznjbm7EPyS9yEkcUF1PaWESm/ a5Tkw4EEI5SC/uVF3LJ4tSN6ILUpxMRMiTdTQ70lEMqf6jIJWHF0P1d+vYofdLbCojk9+e /qil0TnaTces3cw8uXxh3PIBTkx3IXzPgju2BfDXkjpKioZnUVGyiekzH9Yd/adgcbVS8M To1Xwh3pc5ujNErzvQSzEDBNmoHPTOy9tMVOa8g9BEBeYAG6ratWd/IdqgquUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170074; a=rsa-sha256; cv=none; b=U1Md6OYF0rJ/YXPLa5uCKLNEwLHEoJd3JYIuv37p8SuMCJTtl0Y+M5LlsL6M8Heai2jPNS IWmoEyBnMlbLsFqpi2idHzuYu3Dz6IZit4yG9KNfnfqj+qZjwGhMrZYoqyRJ07xACFpoTy iThC/9eTPLzCszYZb9fiT0y7xOyWUo+r++BCRpwNLUz2a2pAq3CxIRRZdo7tcV93kztYbW Xpx//hA5PCWzuYU4TzljPUvixPT//knZZa51vHK0TmK7EDA/Ri/spjZvvWMU8OtcLy/kAN F60YPZP34u7I8nuAGLakR7B2D1aNpwFMpTEjFAPpcr6cUljueupOCPq9UP0IEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdMtL3ZWwz1H7y; Thu, 10 Jul 2025 17:54: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 56AHsYnU072182; Thu, 10 Jul 2025 17:54:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsYSk072179; Thu, 10 Jul 2025 17:54:34 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:34 GMT Message-Id: <202507101754.56AHsYSk072179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4c8b54f765c7 - main - lockf: minor cosmetic cleanups, no functional change List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c8b54f765c7676b4899b72de928bdb6d056dfb2 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4c8b54f765c7676b4899b72de928bdb6d056dfb2 commit 4c8b54f765c7676b4899b72de928bdb6d056dfb2 Author: Kyle Evans AuthorDate: 2025-06-24 23:08:46 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:20 +0000 lockf: minor cosmetic cleanups, no functional change Switch various flags from int -> bool. kill(getpid(), foo) and raise(foo) are equivalent in this context, so switch to the latter as a minor preference for readability. Use proper signal fences instead of volatile for our SIGALRM handler. Reviewed by: kib (earlier version), des Differential Revision: https://reviews.freebsd.org/D51027 --- usr.bin/lockf/lockf.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index b0e16285998a..16bae36a21e0 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -62,35 +62,35 @@ _Static_assert(sizeof(sig_atomic_t) >= sizeof(pid_t), "PIDs cannot be managed safely from a signal handler on this platform."); static sig_atomic_t child = -1; static int lockfd = -1; -static int keep; -static int fdlock; +static bool keep; +static bool fdlock; static int status; static bool termchild; -static volatile sig_atomic_t timed_out; +static sig_atomic_t timed_out; /* * Check if fdlock is implied by the given `lockname`. We'll write the fd that * is represented by it out to ofd, and the caller is expected to do any * necessary validation on it. */ -static int +static bool fdlock_implied(const char *name, long *ofd) { char *endp; long fd; if (strncmp(name, FDLOCK_PREFIX, sizeof(FDLOCK_PREFIX) - 1) != 0) - return (0); + return (false); /* Skip past the prefix. */ name += sizeof(FDLOCK_PREFIX) - 1; errno = 0; fd = strtol(name, &endp, 10); if (errno != 0 || *endp != '\0') - return (0); + return (false); *ofd = fd; - return (1); + return (true); } /* @@ -105,38 +105,36 @@ main(int argc, char **argv) }, sa_prev; sigset_t mask, omask; long long waitsec; + const char *errstr; union lock_subject subj; - int ch, flags, silent, writepid; + int ch, flags; + bool silent, writepid; - silent = keep = writepid = 0; + silent = writepid = false; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ while ((ch = getopt(argc, argv, "knpsTt:w")) != -1) { switch (ch) { case 'k': - keep = 1; + keep = true; break; case 'n': flags &= ~O_CREAT; break; case 's': - silent = 1; + silent = true; break; case 'T': termchild = true; break; case 't': - { - const char *errstr; - waitsec = strtonum(optarg, 0, UINT_MAX, &errstr); if (errstr != NULL) errx(EX_USAGE, "invalid timeout \"%s\"", optarg); - } break; case 'p': - writepid = 1; + writepid = true; flags |= O_TRUNC; /* FALLTHROUGH */ case 'w': @@ -162,7 +160,7 @@ main(int argc, char **argv) * If there aren't any arguments left, then we must be in fdlock mode. */ if (argc == 0 && *lockname != '/') { - fdlock = 1; + fdlock = true; subj.subj_fd = -1; } else { fdlock = fdlock_implied(lockname, &subj.subj_fd); @@ -227,13 +225,16 @@ main(int argc, char **argv) */ lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); while (lockfd == -1 && !timed_out && waitsec != 0) { - if (keep || fdlock) + if (keep || fdlock) { lockfd = acquire_lock(&subj, flags, silent); - else { + } else { wait_for_lock(lockname); lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); } + + /* timed_out */ + atomic_signal_fence(memory_order_acquire); } if (waitsec > 0) alarm(0); @@ -365,7 +366,7 @@ killed(int sig) kill(child, sig); cleanup(); signal(sig, SIG_DFL); - if (kill(getpid(), sig) == -1) + if (raise(sig) == -1) _Exit(EX_OSERR); } @@ -397,6 +398,7 @@ timeout(int sig __unused) { timed_out = 1; + atomic_signal_fence(memory_order_release); } static void From nobody Thu Jul 10 17:57:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdMxQ6Y6vz61LwM; Thu, 10 Jul 2025 17:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMxQ5YW7z3N3n; Thu, 10 Jul 2025 17:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OoWpkxxosaCiOEsrJ6TMDKuD1s/uLQSCZjWlRVJTQgc=; b=qAu+0aNg+LvYytW5R+xn6zS+FBK9VcmBrJaucEr2mBnrVAMlM/c5ZfbKR3SKePo9UN4oRp X/AoTAL7XiPaDOo82uvDBarBhnEDIxKmvpaar301Cw4o8OWms6/Jc29LZ1SR0l5Awt+RyK XRvNHHzdeemSX6r4PVcBCIS5fcAqfzFJxvWTLWIhYir8Im5xrpiFLFelqCcOK0SrtCrW7i OE2885VYf9ZnsS2UrydCwfu/maGoxahwjyk1wDTEH0+BLxFjf3snrcw2yP7fhnv3qACbyW nRfUojApM8dhebbHqAeh2gtaPXt2HpQGJ+5RXxXDIzcKU9LPmHCX16wzSKqjTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OoWpkxxosaCiOEsrJ6TMDKuD1s/uLQSCZjWlRVJTQgc=; b=BmulFO6C2wD57Zy45+HGb6S6ys86mhDDpJaAaACoVeVkXsUCNo3dybrRGZj0929El1UyLF QoHC4KkEraRyt6HVMlLEF0m1tj/00s8Z6y69ACtLm/5nhq49iuZhdu+HRXi2Dbayqb4Fn2 caW2tiCgslMjGJlKojUC4ZFpH+2A1o+yok/BVTH59wAwoD8QF5/MmdSRuHrGvY3IGfF7l3 a47Gl0L4aI+qLUFgg6stHl+I7SHl/RcjTruT2cihWYSjekxKKNJ+bfny28wIW0YaxTvzf+ BVvPokbPGnwmPsxsb5YZpd1Nvi3xzJdN/3CBDAvt9N0TsbQY28WIQkhmvgSAyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170234; a=rsa-sha256; cv=none; b=tnLC9bCfJMjyBeKP8IhPWGe4rkRQishqyGeQIVfucNi5SxYwH3HE0EZnhadE4LtifxkVEj JdIEZGySZHg+Gn8HDvM8ve7dOAD8VlgkTT2veeCEe1zrg4CKFfvMnwTrFuzKRdHuQaUrai ijDpPzezFX9kkE4iykomOv/6c97ZuC52xB22tko5wDAHrjG2clQpp1hJ0KZ1e8P1sLtsrG Er6/gQL7VFtSDeJPsLgAUpvyYdgvp4kJqqGWfpUTaJpXRX+PK3dqjYgZdjtz9/V/UVlkLZ d30X9ULvK09O9mnr4akYkxXFYg0z4UUk33rh8sjWJF52cxJQKQkvcCNsZOA7XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdMxQ51Wxz1Gvh; Thu, 10 Jul 2025 17:57: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 56AHvEwn073107; Thu, 10 Jul 2025 17:57:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHvEK6073104; Thu, 10 Jul 2025 17:57:14 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:57:14 GMT Message-Id: <202507101757.56AHvEK6073104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 3fde39073c72 - main - shar: remove from the tree well in advance of the 15.0 release List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fde39073c722ba5b1d3aa330ec4dc5e0ecd8495 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3fde39073c722ba5b1d3aa330ec4dc5e0ecd8495 commit 3fde39073c722ba5b1d3aa330ec4dc5e0ecd8495 Author: Kyle Evans AuthorDate: 2025-01-02 02:20:09 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:57:03 +0000 shar: remove from the tree well in advance of the 15.0 release We have had deprecation notice in the manpage for nearly six months, and it is also present both in 13.5 and 14.3. tar(1) can supply this functionality for those that truly need it, and cy@ has also created a sysutils/freebsd-shar port for this version of a frontend to live on in ports -- this port has been available since December 18, 2024. Reviewed by: allanjude, cy, emaste, jrm Differential Revision: https://reviews.freebsd.org/D50925 --- ObsoleteFiles.inc | 3 + UPDATING | 5 ++ usr.bin/Makefile | 1 - usr.bin/shar/Makefile | 4 - usr.bin/shar/Makefile.depend | 10 --- usr.bin/shar/shar.1 | 121 ------------------------------- usr.bin/shar/shar.sh | 78 -------------------- usr.sbin/crunch/examples/really-big.conf | 2 +- 8 files changed, 9 insertions(+), 215 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d1095b57c342..4031478f1db4 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250710: shar(1) removed +OLD_FILES+=usr/bin/shar + # 20250708: For 34 days 15.0-CURRENT installed libkadm5clnt symlink without .so OLD_FILES+=usr/lib/libkadm5clnt diff --git a/UPDATING b/UPDATING index 8205086dbab5..2b8320c1204d 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ 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".) +20250710: + The shar(1) utility has been removed from base. The + sysutils/freebsd-shar port was created to maintain this version of + shar(1) past its removal from base. + 20250704: LinuxKPI device.h and acpi changes effecting drivers and drm-kmod. Bump __FreeBSD_version 1500050 to be able to detect these changes. diff --git a/usr.bin/Makefile b/usr.bin/Makefile index b69d25480479..512f75b5d093 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -133,7 +133,6 @@ SUBDIR= alias \ sdiff \ sed \ seq \ - shar \ showmount \ sockstat \ soelim \ diff --git a/usr.bin/shar/Makefile b/usr.bin/shar/Makefile deleted file mode 100644 index fc940c06d463..000000000000 --- a/usr.bin/shar/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -SCRIPTS=shar.sh -MAN= shar.1 - -.include diff --git a/usr.bin/shar/Makefile.depend b/usr.bin/shar/Makefile.depend deleted file mode 100644 index 11aba52f82cf..000000000000 --- a/usr.bin/shar/Makefile.depend +++ /dev/null @@ -1,10 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/shar/shar.1 b/usr.bin/shar/shar.1 deleted file mode 100644 index 6beb1e84ceab..000000000000 --- a/usr.bin/shar/shar.1 +++ /dev/null @@ -1,121 +0,0 @@ -.\" Copyright (c) 1990, 1993 -.\" The Regents of the University of California. 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. -.\" 3. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" 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. -.\" -.Dd January 1, 2025 -.Dt SHAR 1 -.Os -.Sh NAME -.Nm shar -.Nd create a shell archive of files -.Sh DEPRECATION NOTICE -.Nm -is obsolete and may not be present in -.Fx 15 -and later. -Because shell archives are simultaneously data and code and are typically -interpreted by -.Xr sh 1 , -they can easily be trojan-horsed and pose a significant security risk to users. -The -.Xr tar 1 -utility can still produce shar encodings of files if needed. -The -.Pa sysutils/freebsd-shar -port has been created to maintain this version of -.Nm -past its deprecation in base. -.Sh SYNOPSIS -.Nm -.Ar -.Sh DESCRIPTION -The -.Nm -command writes a -.Xr sh 1 -shell script to the standard output which will recreate the file -hierarchy specified by the command line operands. -Directories will be recreated and must be specified before the -files they contain (the -.Xr find 1 -utility does this correctly). -.Pp -The -.Nm -command is normally used for distributing files by -.Xr ftp 1 -or -.Xr mail 1 . -.Sh EXAMPLES -To create a shell archive of the program -.Xr ls 1 -and mail it to Rick: -.Bd -literal -offset indent -cd ls -shar `find . -print` \&| mail -s "ls source" rick -.Ed -.Pp -To recreate the program directory: -.Bd -literal -offset indent -mkdir ls -cd ls -\&... - -\&... -sh archive -.Ed -.Sh SEE ALSO -.Xr compress 1 , -.Xr mail 1 , -.Xr tar 1 , -.Xr uuencode 1 -.Sh HISTORY -The -.Nm -command appeared in -.Bx 4.4 . -.Sh BUGS -The -.Nm -command makes no provisions for special types of files or files containing -magic characters. -The -.Nm -command cannot handle files without a newline ('\\n') -as the last character. -.Pp -It is easy to insert trojan horses into -.Nm -files. -It is strongly recommended that all shell archive files be examined -before running them through -.Xr sh 1 . -Archives produced using this implementation of -.Nm -may be easily examined with the command: -.Bd -literal -offset indent -egrep -av '^[X#]' shar.file -.Ed diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh deleted file mode 100644 index 52c31b419fc4..000000000000 --- a/usr.bin/shar/shar.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright (c) 1990, 1993 -# The Regents of the University of California. 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. -# 3. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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. - -if [ $# -eq 0 ]; then - echo 'usage: shar file ...' 1>&2 - exit 64 # EX_USAGE -fi - -for i -do - if [ ! \( -d $i -o -r $i \) ]; then - echo "$i inaccessible or not exist" 1>&2 - exit 66 # EX_NOINPUT - fi -done - -cat << EOF -# This is a shell archive. Save it in a file, remove anything before -# this line, and then unpack it by entering "sh file". Note, it may -# create directories; files and directories will be owned by you and -# have default permissions. -# -# This archive contains: -# -EOF - -for i -do - echo "# $i" -done - -echo "#" - -for i -do - if [ -d "$i" ]; then - echo "echo c - '$i'" - echo "mkdir -p '$i' > /dev/null 2>&1" - else - md5sum=`echo -n "$i" | md5` - echo "echo x - '$i'" - echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit 1 - echo "$md5sum" - fi -done -echo exit -echo "" - -exit 0 diff --git a/usr.sbin/crunch/examples/really-big.conf b/usr.sbin/crunch/examples/really-big.conf index 12c08b73936f..9c227a7b8d29 100644 --- a/usr.sbin/crunch/examples/really-big.conf +++ b/usr.sbin/crunch/examples/really-big.conf @@ -52,7 +52,7 @@ progs tty ul uname unexpand unifdef uniq units unvis users uudecode uuencode progs vacation vgrind vi vis vmstat w wall wc what whatis whereis who progs whois window write xargs xinstall xstr yacc yes ypcat ypmatch ypwhich -# shell scripts: lorder mkdep shar which +# shell scripts: lorder mkdep which # problems: rdist uses libcompat.a(regex.o), which conflicts with # libedit(readline.o) over regerror(). From nobody Thu Jul 10 18:15:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdNLr2Rryz61MpK; Thu, 10 Jul 2025 18:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdNLq6wjBz3W24; Thu, 10 Jul 2025 18:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752171348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXIfPP1cZB0M+Q3X7bemR4TpLN/DS0y9xY++T5o49MM=; b=LGGP5bNyWYBms0XnWcQppAdU76aP0O/sPYnB0yECM62rHHF77VwluQGMROeJMfuBoHA2vl N5X7HugWpop4Gmw+YMae3MxJiDGfO9L7zjQqw9v8hb+vAdYqEUZhHsE/OcwT12Gd7hXBrr KEuYsyqjbTQAfN+ETNeWd+b6LDsi560G05RO1uUGqu+TdWrNliMFPwlfLIHXfb5zJ8lU8b zBftQ13pms/K5opDARCeVKhrLPgnl38S40SH8IE7Gjm2/5/4CiNIzEPqesmrQwJjEGIBXJ Cj+GKdj6XPnWFn3s2rIfNjBHqnUaHt019H9xFU+0R954HsNGRqaEJvjwH2zsEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752171348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXIfPP1cZB0M+Q3X7bemR4TpLN/DS0y9xY++T5o49MM=; b=Atx+HW/lY1cpAk6NHXW6NCeE3vUSdDbSBw5tvRiWqf6w8NWFfZyNG1SS+ie1CTVOMYc54c KLW0Gfa15qQENK6RCMZXJAFZspdrtQmgR1k1nYxFHn+3zsKdD/BRiP5helPPDm3hg24yh1 vf7EKslwPPyMAbNmEEMgubpFQsBNos+ZJr8scUIDsK+umOzgWBXVwJ8EZHJp1wxyCQ69cc XWCHBvxY6skJR2p9tDavMFV/RFjqjpre6jsMBbctcXFrH/fyRpqox/gchxNFrr6S0uIV69 D9FPwsxpdbsQEHDIogmwBkeFQVR68D/fFUtSvGWqegx+ROKWlW87bo24Lw9s0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752171348; a=rsa-sha256; cv=none; b=GIGRO1XoiOF7hLwGmZTxerf3XATtMz7akSEMYtuhRogOdCVGx3o4Gn0YTJExjqjv99NX/P Oww0NfiNZP/K7eX3NXQ/ChW1jMp9Lv/tJQ6v/FuJpESqnvhTc7ohASDlzfBLDtfIsDgP29 bx7yRUg2TQf3pImO8gOv05BmPKMQkKbkjAgAw03bBxYNUbp0y8VD4syEaEZdFPXmhbXlVA gmq8RJswgyZXJGmbopZXjgXP5HmowOVxIPnEB5tsF3VlbfZicS0Gfo6wEs/F4dJBvMoBPB Z0oDyne6tDT/73w81MzADKrqPQ4lzAU5Yx+D77YD1J+WttMXcbkYU8v++iWOHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdNLq5MHCz1HWs; Thu, 10 Jul 2025 18:15: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 56AIFleG010439; Thu, 10 Jul 2025 18:15:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AIFlTP010436; Thu, 10 Jul 2025 18:15:47 GMT (envelope-from git) Date: Thu, 10 Jul 2025 18:15:47 GMT Message-Id: <202507101815.56AIFlTP010436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: d1f0ee548c73 - main - Allow net_cleanup for loader.efi List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1f0ee548c73fa4d6e097539b9be01dae683b99b Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d1f0ee548c73fa4d6e097539b9be01dae683b99b commit d1f0ee548c73fa4d6e097539b9be01dae683b99b Author: Simon J. Gerraty AuthorDate: 2025-07-10 18:14:38 +0000 Commit: Simon J. Gerraty CommitDate: 2025-07-10 18:14:38 +0000 Allow net_cleanup for loader.efi While netbooting with loader.efi on at least one arm64 platform which uses u-boot emulating UEFI, the kernel gets corrupted, we suspected the u-boot ethernet driver was still running. Use netdev.dv_cleanup for efinet_dev to address this. This in turn requires calling dev_cleanup() before bi_load() to avoid a loader crash since bi_load() calls ExitBootServices. Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D51186 --- stand/efi/libefi/efinet.c | 2 ++ stand/efi/loader/arch/amd64/elf64_freebsd.c | 8 ++++++-- stand/efi/loader/arch/arm/exec.c | 11 ++++++----- stand/efi/loader/arch/arm64/exec.c | 8 ++++++-- stand/efi/loader/arch/i386/elf64_freebsd.c | 9 +++++++-- stand/efi/loader/arch/riscv/exec.c | 12 ++++++------ 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/stand/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c index 186d816cd323..e872110ef08f 100644 --- a/stand/efi/libefi/efinet.c +++ b/stand/efi/libefi/efinet.c @@ -256,6 +256,7 @@ efi_env_net_params(struct iodesc *desc) rootip.s_addr = rootaddr; #ifdef EFINET_DEBUG + printf("%s: proto=%d\n", __func__, netproto); printf("%s: ip=%s\n", __func__, inet_ntoa(myip)); printf("%s: mask=%s\n", __func__, intoa(netmask)); printf("%s: gateway=%s\n", __func__, inet_ntoa(gateip)); @@ -427,6 +428,7 @@ efinet_dev_init(void) dif->dif_private = handles2[i]; } + efinet_dev.dv_cleanup = netdev.dv_cleanup; efinet_dev.dv_open = netdev.dv_open; efinet_dev.dv_close = netdev.dv_close; efinet_dev.dv_strategy = netdev.dv_strategy; diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c index c4265aca035e..35bd4d6c1419 100644 --- a/stand/efi/loader/arch/amd64/elf64_freebsd.c +++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c @@ -209,6 +209,12 @@ elf64_exec(struct preloaded_file *fp) trampoline, PT4); printf("Start @ 0x%lx ...\n", ehdr->e_entry); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernend, true); if (err != 0) { @@ -218,8 +224,6 @@ elf64_exec(struct preloaded_file *fp) return (err); } - dev_cleanup(); - trampoline(trampstack, copy_staging == COPY_STAGING_ENABLE ? efi_copy_finish : efi_copy_finish_nop, kernend, modulep, PT4, ehdr->e_entry); diff --git a/stand/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c index c2a79523c02a..3963b6c0104b 100644 --- a/stand/efi/loader/arch/arm/exec.c +++ b/stand/efi/loader/arch/arm/exec.c @@ -74,16 +74,17 @@ __elfN(arm_exec)(struct preloaded_file *fp) printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) { efi_time_init(); return (error); } - /* At this point we've called ExitBootServices, so we can't call - * printf or any other function that uses Boot Services */ - - dev_cleanup(); - (*entry)((void *)modulep); panic("exec returned"); } diff --git a/stand/efi/loader/arch/arm64/exec.c b/stand/efi/loader/arch/arm64/exec.c index 91a0503a976f..89e2ad7521a8 100644 --- a/stand/efi/loader/arch/arm64/exec.c +++ b/stand/efi/loader/arch/arm64/exec.c @@ -69,6 +69,12 @@ elf64_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); entry = efi_translate(ehdr->e_entry); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernendp, true); if (err != 0) { @@ -76,8 +82,6 @@ elf64_exec(struct preloaded_file *fp) return (err); } - dev_cleanup(); - /* Clean D-cache under kernel area and invalidate whole I-cache */ clean_addr = (vm_offset_t)efi_translate(fp->f_addr); clean_size = (vm_offset_t)efi_translate(kernendp) - clean_addr; diff --git a/stand/efi/loader/arch/i386/elf64_freebsd.c b/stand/efi/loader/arch/i386/elf64_freebsd.c index b02cda2269bc..22cdd685ea9b 100644 --- a/stand/efi/loader/arch/i386/elf64_freebsd.c +++ b/stand/efi/loader/arch/i386/elf64_freebsd.c @@ -252,6 +252,13 @@ elf64_exec(struct preloaded_file *fp) ehdr->e_entry ); + + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernend, true); if (err != 0) { @@ -259,8 +266,6 @@ elf64_exec(struct preloaded_file *fp) return (err); } - dev_cleanup(); - trampoline(trampstack, type == AllocateMaxAddress ? efi_copy_finish : efi_copy_finish_nop, kernend, modulep, PT4, gdtr, ehdr->e_entry); diff --git a/stand/efi/loader/arch/riscv/exec.c b/stand/efi/loader/arch/riscv/exec.c index 9da61229ef68..a53fbd9442b0 100644 --- a/stand/efi/loader/arch/riscv/exec.c +++ b/stand/efi/loader/arch/riscv/exec.c @@ -86,17 +86,17 @@ __elfN(exec)(struct preloaded_file *fp) printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) { efi_time_init(); return (error); } - /* - * At this point we've called ExitBootServices, so we can't call - * printf or any other function that uses Boot Services - */ - dev_cleanup(); - (*entry)((void *)modulep); panic("exec returned"); } From nobody Thu Jul 10 19:06:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdPSt2FNHz61R4L; Thu, 10 Jul 2025 19:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdPSt1fdmz3vhw; Thu, 10 Jul 2025 19:06:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TwzV7Vrmg47gi1bYRsvZkTx6ydkEuUDnK7S8kFwjFUk=; b=KVt0GuWenwFrdgGs+huO2bbrt1U//AZKT29upFkyoHvdwzfYjDBCwCrtjpRI7G1eD1R50K wW4MnWmLm3/k5aPObev+XXg/9bAT6bM9L6cmaDG6Lly0DFfre52xNES90uoVIDLpNUt1x2 LyGGvYHv5OQQ9QzxzdEzq7OfdEUsFJym8WwDNZtPNeHODaoKExzGd2qbY1oLF1Mgtjj+Xi +DPHtH5cWHbxxFjjtCnd6jie2ucBydRPNY7spsFEGNHcSxoQMHbj/z5s8Fhk0plz1mEYm9 ummyHH6pI3rYiECauuUzi6LysDMKMPZP4NCh5/vTONlQECbT0VDv+cvRb6rDVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TwzV7Vrmg47gi1bYRsvZkTx6ydkEuUDnK7S8kFwjFUk=; b=kD73O1eAhTsLqBOINQt3AZg8jGsx6yVuw+QJJqlHAJnbgrEuYGw3zQAAYSSkG/SmV3iHVE g2AgxbO0Rj4s3QvfVfeDKBx1I3xbQAQi5zMA+RBesNLARb+Qt78S3SOV7ZUS4N6qTpcbrR 3vbr5YaYub9k8zgij7YCbrYlUmAFBojM3w7KJeZMuLmx1wJoda9Z0J4Gry8bprr9sRC+0e 1ZpTtzKTWKex/AUO9e8bWNd7lqhDSHX4oXeZ4SbBY8IeZIfkcWw/+dIs2xK3GoblBehV0v Y/cBE+yHVp7jH3phe7/iqZhJIbzhMxOrCJVsELa3BGATRKDDSWO0l6CNYjhKcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752174366; a=rsa-sha256; cv=none; b=x9qK6VeGWyNxoT8npKYRrapNZIL7rbO7M3HJ2lqBjLQz0DXz1IGOWgGMSfsuAPohurQmgA W+PnuDq8XKAaEF6eQ20AdSxYd75BEKusrYf4f8Zrg9HmkLk2zEjIN/iNwo5AAJnXNEhCxP 1XsBfoydGSudd46wem6msjs5cvGm6mcyONAUQrw0999voRlOS4gCSOODEbcAsVvEsm3HLM GVHHamtCxGoFoJ8Tlb2+pUWAvtbFHmNybLO+MSU8gQRZLqVcp6etmjORAD8UgvusdLhiZf VPq1I+8DRfzaEWgCFx9AnSj4sHKt4lyUfZ9vQSI/0ZCfda6zzz25kSJ/lGQKIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdPSt13scz1Hxc; Thu, 10 Jul 2025 19:06: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 56AJ66ip004636; Thu, 10 Jul 2025 19:06:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJ66FN004631; Thu, 10 Jul 2025 19:06:06 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:06:06 GMT Message-Id: <202507101906.56AJ66FN004631@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: 4d2752925a4f - main - rtld-elf: Extract part of allocate_tls_offset into allocate_tls_offset_common List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4d2752925a4f75547a67f093dfe249da54196803 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2752925a4f75547a67f093dfe249da54196803 commit 4d2752925a4f75547a67f093dfe249da54196803 Author: Jessica Clarke AuthorDate: 2025-07-10 19:00:28 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:00:28 +0000 rtld-elf: Extract part of allocate_tls_offset into allocate_tls_offset_common This will be used to allocate additional space for a TAILQ_ENTRY by rtld at a known offset from the TCB, as if it were TLS data. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51068 --- libexec/rtld-elf/rtld.c | 54 ++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1459b38f3720..7172fbf1d794 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5698,32 +5698,22 @@ allocate_module_tls(struct tcb *tcb, int index) return (p); } -bool -allocate_tls_offset(Obj_Entry *obj) +static bool +allocate_tls_offset_common(size_t *offp, size_t tlssize, size_t tlsalign, + size_t tlspoffset __unused) { size_t off; - if (obj->tls_dynamic) - return (false); - - if (obj->tls_static) - return (true); - - if (obj->tlssize == 0) { - obj->tls_static = true; - return (true); - } - if (tls_last_offset == 0) - off = calculate_first_tls_offset(obj->tlssize, obj->tlsalign, - obj->tlspoffset); + off = calculate_first_tls_offset(tlssize, tlsalign, + tlspoffset); else off = calculate_tls_offset(tls_last_offset, tls_last_size, - obj->tlssize, obj->tlsalign, obj->tlspoffset); + tlssize, tlsalign, tlspoffset); - obj->tlsoffset = off; + *offp = off; #ifdef TLS_VARIANT_I - off += obj->tlssize; + off += tlssize; #endif /* @@ -5735,12 +5725,34 @@ allocate_tls_offset(Obj_Entry *obj) if (tls_static_space != 0) { if (off > tls_static_space) return (false); - } else if (obj->tlsalign > tls_static_max_align) { - tls_static_max_align = obj->tlsalign; + } else if (tlsalign > tls_static_max_align) { + tls_static_max_align = tlsalign; } tls_last_offset = off; - tls_last_size = obj->tlssize; + tls_last_size = tlssize; + + return (true); +} + +bool +allocate_tls_offset(Obj_Entry *obj) +{ + if (obj->tls_dynamic) + return (false); + + if (obj->tls_static) + return (true); + + if (obj->tlssize == 0) { + obj->tls_static = true; + return (true); + } + + if (!allocate_tls_offset_common(&obj->tlsoffset, obj->tlssize, + obj->tlsalign, obj->tlspoffset)) + return (false); + obj->tls_static = true; return (true); From nobody Thu Jul 10 19:06:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdPSv39P2z61R4M; Thu, 10 Jul 2025 19:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdPSv21Wlz3vt8; Thu, 10 Jul 2025 19:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gdIcyLwO809TWPnzVI4lBq+cMCS0GkdSzyWFdTSZW6M=; b=bUTkaiWBgUNCaX12/He07QuWNVRaMCNPS6468ECaAcZAnSd6Ps9yCrOyLTQt8+HRTlIhHz YzZGrFErokaFEg53h9IXOoB+I4sL6rv8G288omD+sntEM9lpPP7Uf0ZA8uPVqQqcO82sUz 0QpTHqcVaFSFC0nJbhyWFlAQX5FX/VerJZjQbOhUulUUqgfjIMvrQhiqWwKXivzvYHax3H RVl9vYGQkR1UQu6xRZIy4dRJfcx0uNh34WoHi34OXi5wDNYuAvYmGJ480pJ/55vn75Eji8 E7EliR+QULhpYPbrh/lzyWEz76/3TI6DGMO6Hds06NfDwRwLuWYV8+BEXQj6tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gdIcyLwO809TWPnzVI4lBq+cMCS0GkdSzyWFdTSZW6M=; b=JkWNrzuWFiVkJlc3s4hKvtJ1TkYfmpUENrFW7xxJPC47WesKKY/QNhvp2DvCTnTjd9EOcY 8vqwbWs3u/ZOaVKYyyddhQ8Ix4+VUHDKS5q5+r/i6Ln6b3KIFu3C0DQS/1mAo7B8gFMLng Ap4cFNzxQq9soBAjXE/B0XGXavWoCajYOBGARWXM4DgAvK9I/+tSSqKNghx6N37wVnYY1F 7zXqKvvMSQOjn2xunSePx7jFVVCGcnvwDcFS+vOE267AjU2y7+Rw8su4smI5nWNqfZXs2w Kqv0f84dR3LbvtMMMO92JAi+tSiMLK13caLAatyeztVHZqixfQuwsXYHEt5tlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752174367; a=rsa-sha256; cv=none; b=EQuvyMpk4tKwQziDlbwMvIOkk9HcPKjuaw3Gd9vF6CjBrJ6nvQCPhwcH1nTDJMW8WU+vgN bGyx4R6BGStNr4trq0PEf6JtmzY3puhivP+sbBtb+H4wucKNrCHJ8CP2rbzSnuzJ2jIO9M mHoCQbWD3WEgYZdhWigYaIZRLC1Or3oPwuDzkjMSu9Ywx8Qd9WfSN6CgqCl+Izd+pGYpGM FfvPgJjCZUEPQq2GUKZPaAxGhgvpW+KwaHFWhQzWyE0nQpDr6oE0gmfFwLEdBI6OiRp4Jd uEPWm9DpVTw9dnOlSejSh+ASlxnchfjv5nStWvbXeAovD+c1kviPiPYrNcz7Tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdPSv1P3dz1JRm; Thu, 10 Jul 2025 19:06: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 56AJ675i004675; Thu, 10 Jul 2025 19:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJ670u004672; Thu, 10 Jul 2025 19:06:07 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:06:07 GMT Message-Id: <202507101906.56AJ670u004672@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: a1d971ad3f82 - main - rtld-elf: Track allocated TCBs internally and use for distribute_static_tls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: a1d971ad3f8216c9b6b651e97dbe3d8177b11825 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a1d971ad3f8216c9b6b651e97dbe3d8177b11825 commit a1d971ad3f8216c9b6b651e97dbe3d8177b11825 Author: Jessica Clarke AuthorDate: 2025-07-10 19:00:28 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:00:28 +0000 rtld-elf: Track allocated TCBs internally and use for distribute_static_tls Currently rtld delegates to libc or libthr to initialise the TCBs for all existing threads when dlopen is called for a library that is using static TLS. This creates an odd split where rtld manages all of TLS for dynamically-linked executables except for this specific case, and is unnecessarily complex, including having to reason about the locking due to dropping the bind lock so libthr can take the thread list lock without deadlocking if any of the code run whilst that lock is held ends up calling back into rtld (such as for lazy PLT resolution). The only real reason we call out into libc / libthr is that we don't have a list of threads in rtld and that's how we find the currently used TCBs to initialise (and at the same time do the copy in the callee rather than adding overhead with some kind of callback that provides the TCB to rtld. If we instead keep a list of allocated TCBs in rtld itself then we no longer need to do this, and can just copy the data in rtld. How these TCBs are mapped to threads is irrelevant, rtld can just treat all TCBs equally and ensure that each TCB's static TLS data block remains in sync with the current set of loaded modules, just as how _rtld_allocate_tls creates a fresh TCB and associated data without any embedded threading model assumptions. As an implementation detail, to avoid a separate allocation for the list entry and having to find that allocation from the TCB to remove and free it on deallocation, we allocate a fake TLS offset for it and embed the list entry there in each TLS block. This will also make it easier to add a new TLS ABI downstream in CheriBSD, especially in the presence of library compartmentalisation. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50920 --- libexec/rtld-elf/rtld.c | 103 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7172fbf1d794..17196f55c271 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -82,9 +82,15 @@ struct dlerror_save { char *msg; }; +struct tcb_list_entry { + TAILQ_ENTRY(tcb_list_entry) next; +}; + /* * Function declarations. */ +static bool allocate_tls_offset_common(size_t *offp, size_t tlssize, + size_t tlsalign, size_t tlspoffset); static const char *basename(const char *); static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, const Elf_Dyn **, const Elf_Dyn **); @@ -92,7 +98,7 @@ static bool digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, const Elf_Dyn *); static bool digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); -static void distribute_static_tls(Objlist *, RtldLockState *); +static void distribute_static_tls(Objlist *); static Obj_Entry *dlcheck(void *); static int dlclose_locked(void *, RtldLockState *); static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, @@ -303,6 +309,10 @@ static size_t tls_static_max_align; Elf_Addr tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ +static TAILQ_HEAD(, tcb_list_entry) tcb_list = + TAILQ_HEAD_INITIALIZER(tcb_list); +static size_t tcb_list_entry_offset; + static bool ld_library_path_rpath = false; bool ld_fast_sigblock = false; @@ -929,6 +939,19 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) allocate_tls_offset(entry->obj); } + if (!allocate_tls_offset_common(&tcb_list_entry_offset, + sizeof(struct tcb_list_entry), _Alignof(struct tcb_list_entry), + 0)) { + /* + * This should be impossible as the static block size is not + * yet fixed, but catch and diagnose it failing if that ever + * changes or somehow turns out to be false. + */ + _rtld_error("Could not allocate offset for tcb_list_entry"); + rtld_die(); + } + dbg("tcb_list_entry_offset %zu", tcb_list_entry_offset); + if (relocate_objects(obj_main, ld_bind_now != NULL && *ld_bind_now != '\0', &obj_rtld, SYMLOOK_EARLY, NULL) == -1) @@ -3973,7 +3996,7 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, if ((lo_flags & RTLD_LO_EARLY) == 0) { map_stacks_exec(lockstate); if (obj != NULL) - distribute_static_tls(&initlist, lockstate); + distribute_static_tls(&initlist); } if (initlist_objects_ifunc(&initlist, (mode & RTLD_MODEMASK) == @@ -5400,6 +5423,44 @@ tls_get_addr_common(struct tcb *tcb, int index, size_t offset) return (tls_get_addr_slow(tcb, index, offset, false)); } +static struct tcb * +tcb_from_tcb_list_entry(struct tcb_list_entry *tcbelm) +{ +#ifdef TLS_VARIANT_I + return ((struct tcb *)((char *)tcbelm - tcb_list_entry_offset)); +#else + return ((struct tcb *)((char *)tcbelm + tcb_list_entry_offset)); +#endif +} + +static struct tcb_list_entry * +tcb_list_entry_from_tcb(struct tcb *tcb) +{ +#ifdef TLS_VARIANT_I + return ((struct tcb_list_entry *)((char *)tcb + tcb_list_entry_offset)); +#else + return ((struct tcb_list_entry *)((char *)tcb - tcb_list_entry_offset)); +#endif +} + +static void +tcb_list_insert(struct tcb *tcb) +{ + struct tcb_list_entry *tcbelm; + + tcbelm = tcb_list_entry_from_tcb(tcb); + TAILQ_INSERT_TAIL(&tcb_list, tcbelm, next); +} + +static void +tcb_list_remove(struct tcb *tcb) +{ + struct tcb_list_entry *tcbelm; + + tcbelm = tcb_list_entry_from_tcb(tcb); + TAILQ_REMOVE(&tcb_list, tcbelm, next); +} + #ifdef TLS_VARIANT_I /* @@ -5513,6 +5574,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) } } + tcb_list_insert(tcb); return (tcb); } @@ -5524,6 +5586,8 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) size_t post_size; size_t i, tls_init_align __unused; + tcb_list_remove(tcb); + assert(tcbsize >= TLS_TCB_SIZE); tls_init_align = MAX(obj_main->tlsalign, 1); @@ -5624,6 +5688,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) } } + tcb_list_insert(tcb); return (tcb); } @@ -5635,6 +5700,8 @@ free_tls(void *tcb, size_t tcbsize __unused, size_t tcbalign) size_t i; uintptr_t tlsstart, tlsend; + tcb_list_remove(tcb); + /* * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. @@ -6136,25 +6203,29 @@ map_stacks_exec(RtldLockState *lockstate) } static void -distribute_static_tls(Objlist *list, RtldLockState *lockstate) +distribute_static_tls(Objlist *list) { - Objlist_Entry *elm; + struct tcb_list_entry *tcbelm; + Objlist_Entry *objelm; + struct tcb *tcb; Obj_Entry *obj; - void (*distrib)(size_t, void *, size_t, size_t); + char *tlsbase; - distrib = (void (*)(size_t, void *, size_t, size_t))( - uintptr_t)get_program_var_addr("__pthread_distribute_static_tls", - lockstate); - if (distrib == NULL) - return; - STAILQ_FOREACH(elm, list, link) { - obj = elm->obj; + STAILQ_FOREACH(objelm, list, link) { + obj = objelm->obj; if (obj->marker || !obj->tls_static || obj->static_tls_copied) continue; - lock_release(rtld_bind_lock, lockstate); - distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize, - obj->tlssize); - wlock_acquire(rtld_bind_lock, lockstate); + TAILQ_FOREACH(tcbelm, &tcb_list, next) { + tcb = tcb_from_tcb_list_entry(tcbelm); +#ifdef TLS_VARIANT_I + tlsbase = (char *)tcb + obj->tlsoffset; +#else + tlsbase = (char *)tcb - obj->tlsoffset; +#endif + memcpy(tlsbase, obj->tlsinit, obj->tlsinitsize); + memset(tlsbase + obj->tlsinitsize, 0, + obj->tlssize - obj->tlsinitsize); + } obj->static_tls_copied = true; } } From nobody Thu Jul 10 19:06:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdPSw4mlRz61R9W; Thu, 10 Jul 2025 19:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdPSw3JkMz3vtB; Thu, 10 Jul 2025 19:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaMCxRPBMfNxkSrdgIPC+Gylzr9NPmHyt+B5HZZgJuk=; b=CFIN6MrDYUypqzEi2eTN/AXSLqTjj9xrBjnp1NBGEA3OTGnVfqf/kMbWa02DwUbdrBqVyN zgFKSVt9Dfb/4AJtbHUfKVJ4m7RsgTV/HNhjYkW2/UATuR9RpPBjoEbGc/0goYuBZeRNvl 2zvNvill6b2Ju6A5JAdIlvq64NycmQ7Oozu5XYYCq3Wl15AKr0gOPab2PlG8faPYqMZGQq DDtbj1RE5EVEQIWnYTU8wFml3sf+g4znHT+QvDi8DUxUgotFp4qmnapv8bb2vg9HZieKL5 tJlgHxqU0qSKIx576v6/t9rM8k4q4hjHdz+JF5KxiNf2KM1YFKQOau2BeKSM3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaMCxRPBMfNxkSrdgIPC+Gylzr9NPmHyt+B5HZZgJuk=; b=hyMbaHEbBwPyBJxsjFtaemMrC88nWvMpMupmtZcL/RIxbwyzoe4B6LoP44n1slFdmFE9YM oFIi+lPKbdnMC5H/EgVOZfIyeL0X+hOJ4MeGjj600cuawUm9rxwc/AheTgM+WO/IDaxfkt MNV6RzhRVgZLtVwmNrEwg0jhBsiTBgHl+SfLSp4XRg0oDO6M9y1kV1mSnyvtNY8cFlNTNU ZyWuYIw/hsy4oceW5oTyi7O51GDqlAGmJAlU8R8PROANDZqRkk9EGDtN5Nh1Kbj73gn92y j9gy3Ab8CvYOSTyS6xpg0IL/6lokRNQufOryqUBuWDuNRGGwe0t3Ug8pC9kbaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752174368; a=rsa-sha256; cv=none; b=NXPWVM8CmjPHj4fxShrz9uq4EV+GioZl5foARs/35VdWWVKLCFVnDuvxEchPMcslN9JBxl dIH3i7DSsnjLdN6PVPUXhkwmb5PRBIscttdUsF3YT6TwEX+PbGLNDja1JpKxZMj7O+JjJb v0xVQrNjA0ECkmGoJUxDVadJp/RtoRIRIBSg6QKEfabPOeQm9eRc9uQW2+7JxKymIhWLp0 SLl1tSO8n4GSdqPt3OAJeyboSGXzrAPZOIBxC0mT1Cs2kkb/wXwpfjIgcUWCmp3hJVKgCZ kI9D5/lKua4YPOrhAR/e9yl0s3sTVD9NMRnL/RWGWkhR3oHlo9dpImTWASKNAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdPSw2kqCz1Hxd; Thu, 10 Jul 2025 19:06: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 56AJ68wV004716; Thu, 10 Jul 2025 19:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJ686f004713; Thu, 10 Jul 2025 19:06:08 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:06:08 GMT Message-Id: <202507101906.56AJ686f004713@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: 2c444fdb0c75 - main - libc,libthr: Remove __pthread_distribute_static_tls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2c444fdb0c75fbc73a0ac78d0ecbaef4e1e8baf8 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=2c444fdb0c75fbc73a0ac78d0ecbaef4e1e8baf8 commit 2c444fdb0c75fbc73a0ac78d0ecbaef4e1e8baf8 Author: Jessica Clarke AuthorDate: 2025-07-10 19:00:28 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:00:28 +0000 libc,libthr: Remove __pthread_distribute_static_tls This private API is no longer used by rtld-elf so can be removed. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50921 --- lib/libc/gen/Symbol.map | 1 - lib/libc/gen/elf_utils.c | 26 ------------------------ lib/libc/gen/libc_interposing_table.c | 1 - lib/libc/include/libc_private.h | 4 +--- lib/libthr/pthread.map | 1 - lib/libthr/thread/thr_list.c | 38 ----------------------------------- lib/libthr/thread/thr_private.h | 2 -- 7 files changed, 1 insertion(+), 72 deletions(-) diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index c2020ac3d8d2..26f638568efc 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -596,7 +596,6 @@ FBSDprivate_1.0 { __libc_tcdrain; - __pthread_distribute_static_tls; __pthread_map_stacks_exec; __fillcontextx; __fillcontextx2; diff --git a/lib/libc/gen/elf_utils.c b/lib/libc/gen/elf_utils.c index 330aa8f17f7e..3714a0dc42b5 100644 --- a/lib/libc/gen/elf_utils.c +++ b/lib/libc/gen/elf_utils.c @@ -41,7 +41,6 @@ #include "libc_private.h" void __pthread_map_stacks_exec(void); -void __pthread_distribute_static_tls(size_t, void *, size_t, size_t); int __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr) @@ -105,28 +104,3 @@ __pthread_map_stacks_exec(void) ((void (*)(void))__libc_interposing[INTERPOS_map_stacks_exec])(); } - -void -__libc_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len) -{ - char *tlsbase; - -#ifdef TLS_VARIANT_I - tlsbase = (char *)_tcb_get() + offset; -#else - tlsbase = (char *)_tcb_get() - offset; -#endif - memcpy(tlsbase, src, len); - memset(tlsbase + len, 0, total_len - len); -} - -#pragma weak __pthread_distribute_static_tls -void -__pthread_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len) -{ - - ((void (*)(size_t, void *, size_t, size_t))__libc_interposing[ - INTERPOS_distribute_static_tls])(offset, src, len, total_len); -} diff --git a/lib/libc/gen/libc_interposing_table.c b/lib/libc/gen/libc_interposing_table.c index 8eae6c7f5d95..025a67ac3eac 100644 --- a/lib/libc/gen/libc_interposing_table.c +++ b/lib/libc/gen/libc_interposing_table.c @@ -42,7 +42,6 @@ interpos_func_t __libc_interposing[INTERPOS_MAX] = { SLOT(spinlock, __libc_spinlock_stub), SLOT(spinunlock, __libc_spinunlock_stub), SLOT(map_stacks_exec, __libc_map_stacks_exec), - SLOT(distribute_static_tls, __libc_distribute_static_tls), SLOT(uexterr_gettext, __libc_uexterr_gettext), }; #undef SLOT diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 1bc22f3931a5..db4cbc32be35 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -249,7 +249,7 @@ enum { INTERPOS_map_stacks_exec, INTERPOS_fdatasync, INTERPOS_clock_nanosleep, - INTERPOS_distribute_static_tls, + INTERPOS__reserved0, /* was distribute_static_tls */ INTERPOS_pdfork, INTERPOS_uexterr_gettext, INTERPOS_MAX @@ -361,8 +361,6 @@ struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __init_elf_aux_vector(void); void __libc_map_stacks_exec(void); -void __libc_distribute_static_tls(__size_t, void *, __size_t, __size_t); -__uintptr_t __libc_static_tls_base(__size_t); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map index 1c8dde03367b..3a5353a32dc3 100644 --- a/lib/libthr/pthread.map +++ b/lib/libthr/pthread.map @@ -136,7 +136,6 @@ FBSDprivate_1.0 { __pthread_mutex_lock; __pthread_mutex_timedlock; __pthread_mutex_trylock; - __pthread_distribute_static_tls; _pthread_atfork; _pthread_barrier_destroy; _pthread_barrier_init; diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index 820766f6f5e0..cbf16179f619 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -363,41 +363,3 @@ _thr_find_thread(struct pthread *curthread, struct pthread *thread, THREAD_LIST_UNLOCK(curthread); return (ret); } - -static void -thr_distribute_static_tls(char *tlsbase, void *src, size_t len, - size_t total_len) -{ - - memcpy(tlsbase, src, len); - memset(tlsbase + len, 0, total_len - len); -} - -void -__pthread_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len) -{ - struct pthread *curthread, *thrd; - char *tlsbase; - - if (!_thr_is_inited()) { -#ifdef TLS_VARIANT_I - tlsbase = (char *)_tcb_get() + offset; -#else - tlsbase = (char *)_tcb_get() - offset; -#endif - thr_distribute_static_tls(tlsbase, src, len, total_len); - return; - } - curthread = _get_curthread(); - THREAD_LIST_RDLOCK(curthread); - TAILQ_FOREACH(thrd, &_thread_list, tle) { -#ifdef TLS_VARIANT_I - tlsbase = (char *)thrd->tcb + offset; -#else - tlsbase = (char *)thrd->tcb - offset; -#endif - thr_distribute_static_tls(tlsbase, src, len, total_len); - } - THREAD_LIST_UNLOCK(curthread); -} diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index bca890829057..d7b889930365 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -986,8 +986,6 @@ void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info); void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __hidden; void _thr_sigact_unload(struct dl_phdr_info *phdr_info) __hidden; void _thr_stack_fix_protection(struct pthread *thrd); -void __pthread_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len); int *__error_threaded(void) __hidden; void __thr_interpose_libc(void) __hidden; From nobody Thu Jul 10 19:33:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdQ4j5xY5z61SSQ; Thu, 10 Jul 2025 19:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQ4j4qx6z3F17; Thu, 10 Jul 2025 19:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y0zVOs9hKnmS4o7DxwQfW8DNQdgAkyVi1gqqRYyHd3Q=; b=pYSH/gLo9OqrjSZtiOaLOgydIUXJ85w1+s5lfrbN1LhyH2+nqzhREAL+5v95RP8Dnnln/3 1rgbpMRhZUK7d2Erbn8NgUCM8S38E5CSVPyIlsPE2B31WcPLoDIE3ADxfC/3uIb2/LfDFE 4ZOgD94BeSVtWLd9GJ/CIu+BKWJgi2rtONeSd36j5gaQc01JNc0trjOHKtbaCCap9nbahN zHMpMRBiYO8540wazhAOB2r7/oOgJ/84mNcqnaxycvg/lItWKeG3xfNlT7Acu3axgEZJJ3 uyuqSMOM+mT/e7wkhK1X3lPnFc3IsilkiQxDazo7OQ2HDb2+NkNOBC4XOHl/rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y0zVOs9hKnmS4o7DxwQfW8DNQdgAkyVi1gqqRYyHd3Q=; b=oGO8xejzdUQR0oqwNTPRqINTJVCyQtFStwsjx06rs/9ycmkeRLPG2MXLK4M2HmXBbZOZni YSpbzuKEE9zlJp9DUej0LRzLDqXQ0z8vKfBNoePUkWPpRImAULn41rmQah7oXjNG/qzHi4 G/xmVYy/RFC2RXbrieQfkTHAvrBT4a4vChA3vCzdaZ/KkSzAn7CcaNIo1Er5fP68ZuUMpV bwZxhSbvJCBvWkBcgSQVNdwY7nOUbKRvNb+tKl/1G6pl6LKkZ0u59Kw317pERZR5fsuWOk rHsJLQ36Ex7/yaq5HdJTtJw+3JToV6u65UtJ5x1ZXN7luvCxqbHNEyyBtfuV+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752176021; a=rsa-sha256; cv=none; b=mdlRLi27e+zifTHJwLV+PzUTj4tVvL6RdGQDp6MOeoFNtJh1tWfjZJfvvdtBe+gAu6KSun MRhIepUIoO4wb+NUDXHf4UMQyBFOFbqCtxuVxGqPs+yv8cpRvhqkvhvX+3uUgXtSZJtxDc wozgi+7Ep2WeAMcryIJNtXLCIgHJ25pplTb+QBMQWUveiXe4bpXQkU5SjqeLn2oAnBnpJZ j0CoE2mTQPTIOZBHGBQu+E1BJtoQiAHlfJtlHetkrjoK3JG9QnXtEn2DES2ZfMXJ8SzFjw cDAcsYFNXkimKzePvf0DnFDcjVcjBoPGesKEyVkG879xOLXrGnOxUIrJZvNy7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdQ4j4QrYz1Kgw; Thu, 10 Jul 2025 19:33: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 56AJXfwA059093; Thu, 10 Jul 2025 19:33:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJXfOn059090; Thu, 10 Jul 2025 19:33:41 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:33:41 GMT Message-Id: <202507101933.56AJXfOn059090@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: cb75bb51261b - main - vmbus: Avoid gratuitous ifdef and use more generic implementation instead List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: cb75bb51261b13a49636befdee1c4a76f2e9013e Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=cb75bb51261b13a49636befdee1c4a76f2e9013e commit cb75bb51261b13a49636befdee1c4a76f2e9013e Author: Jessica Clarke AuthorDate: 2025-07-10 19:33:33 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:33:33 +0000 vmbus: Avoid gratuitous ifdef and use more generic implementation instead Checking for __LP64__ is non-portable as it assumes that ILP32 and LP64 are the only two ABIs that exist, but CheriBSD supports an additional ABI where long is still 64-bit but pointers are 128-bit capabilities, and thus __LP64__ is not defined. We could change this to check the value of __SIZEOF_LONG__, since the code here only cares about that aspect of the ABI, however in this instance, the only real reason an ifdef is used at all is to be able to get log2(sizeof(u_long)), but if we instead multiply and divide rather than shift, and let the compiler optimise that to a shift, we can just use sizeof(u_long) instead. Note also that VMBUS_EVTFLAGS_MAX could always just have been defined as VMBUS_EVTFLAGS_SIZE / sizeof(u_long). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D50630 --- sys/dev/hyperv/vmbus/vmbus_chan.c | 6 +++--- sys/dev/hyperv/vmbus/vmbus_reg.h | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/dev/hyperv/vmbus/vmbus_chan.c b/sys/dev/hyperv/vmbus/vmbus_chan.c index 189a3e66a039..7ea60a499c72 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chan.c +++ b/sys/dev/hyperv/vmbus/vmbus_chan.c @@ -1555,7 +1555,7 @@ vmbus_event_flags_proc(struct vmbus_softc *sc, volatile u_long *event_flags, continue; flags = atomic_swap_long(&event_flags[f], 0); - chid_base = f << VMBUS_EVTFLAG_SHIFT; + chid_base = f * VMBUS_EVTFLAG_LEN; while ((chid_ofs = ffsl(flags)) != 0) { struct vmbus_channel *chan; @@ -1599,7 +1599,7 @@ vmbus_event_proc_compat(struct vmbus_softc *sc, int cpu) eventf = VMBUS_PCPU_GET(sc, event_flags, cpu) + VMBUS_SINT_MESSAGE; if (atomic_testandclear_long(&eventf->evt_flags[0], 0)) { vmbus_event_flags_proc(sc, sc->vmbus_rx_evtflags, - VMBUS_CHAN_MAX_COMPAT >> VMBUS_EVTFLAG_SHIFT); + VMBUS_CHAN_MAX_COMPAT / VMBUS_EVTFLAG_LEN); } } @@ -1903,7 +1903,7 @@ vmbus_chan_msgproc_choffer(struct vmbus_softc *sc, * Setup event flag. */ chan->ch_evtflag = - &sc->vmbus_tx_evtflags[chan->ch_id >> VMBUS_EVTFLAG_SHIFT]; + &sc->vmbus_tx_evtflags[chan->ch_id / VMBUS_EVTFLAG_LEN]; chan->ch_evtflag_mask = 1UL << (chan->ch_id & VMBUS_EVTFLAG_MASK); /* diff --git a/sys/dev/hyperv/vmbus/vmbus_reg.h b/sys/dev/hyperv/vmbus/vmbus_reg.h index 4aa729475b5d..76cdca0ebeb2 100644 --- a/sys/dev/hyperv/vmbus/vmbus_reg.h +++ b/sys/dev/hyperv/vmbus/vmbus_reg.h @@ -60,16 +60,10 @@ CTASSERT(sizeof(struct vmbus_message) == VMBUS_MSG_SIZE); * Hyper-V SynIC event flags */ -#ifdef __LP64__ -#define VMBUS_EVTFLAGS_MAX 32 -#define VMBUS_EVTFLAG_SHIFT 6 -#else -#define VMBUS_EVTFLAGS_MAX 64 -#define VMBUS_EVTFLAG_SHIFT 5 -#endif -#define VMBUS_EVTFLAG_LEN (1 << VMBUS_EVTFLAG_SHIFT) +#define VMBUS_EVTFLAG_LEN (sizeof(u_long) * 8) #define VMBUS_EVTFLAG_MASK (VMBUS_EVTFLAG_LEN - 1) #define VMBUS_EVTFLAGS_SIZE 256 +#define VMBUS_EVTFLAGS_MAX (VMBUS_EVTFLAGS_SIZE / sizeof(u_long)) struct vmbus_evtflags { u_long evt_flags[VMBUS_EVTFLAGS_MAX]; From nobody Thu Jul 10 19:37:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdQ8c31M4z61SFJ; Thu, 10 Jul 2025 19:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQ8c2NbGz3G9B; Thu, 10 Jul 2025 19:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J0QpeH3DIK+ewexUD891hVHMDnThfaSx6Pz1KPAqP2Q=; b=mFW8IxUR53M88yrOFHtql8ilyKIHct5j/VhjkQt1mJBogw27c8L6SvO4marGNvFLkL5XBk OlpPEwrENzB5oyVakDPj7ct0DJP3Y5FFTgaSRzDaget+SqNkSR+rBVTO2kDrGEeX2zIWXK qPABr4pTd3rCAABmwCo1q4gN0kM4VH+dD1qkgwxW57n/+8/J31//pHmNOPvXmh9SPJAQB1 6H9jMJCdLPpHcltwR5c/G8XE/8H4/iKKQD6cu8Ea8YWvmq9PyqkNhcVosysk69Du7hIsFz prATSwGQq2cFGkjAqfvdDlKF/q9nhXEWQUb2P6jkFJTtE+FKbTHMnd/vny7E/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J0QpeH3DIK+ewexUD891hVHMDnThfaSx6Pz1KPAqP2Q=; b=Ax3q2lSREo6hSN+ehojONUtzzmqhpVd62FM45J3XtxBDRcc4eti2j9Ho1ieDmSXZucIaZ5 SfxrWDrz2nDPhMLklVWUh4lKCwbccxv/UiItBjzwW/kQIw8uQg6rcEKvicSh779jxpjqlw 8J3MHLgip8kE71TiBnNAJpvEhOfTO+hucbbWNYcKV+CbyobkWfsndQoXHYIMVrefjYXzZg zooMA54Dfvd6DgfclJMNcx/9mS/3vz6InTcUPisNMjmgV3EaQLQ1KqOHm6MAfC85q26h9c VOM7AE81E5D4lwcPU5v1TjEiaiCEQqXBut8buWifKtmjyRUZgW7B7HDB3y0mkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752176224; a=rsa-sha256; cv=none; b=MVvjRwdoRxaPGDBTPp2547rpXFV5Rtozo/RMGzOYjkLS7VIiAFP9kMC+DRjfpFHTiDh8QR HY0DMHSdFIGy6Kz2NIELX5MTMSAr5u0Y9vhQg1aEWX5u4MBzqQbluolsOZaZUovNHHy+e2 8yz7HieC3NYG9OcXwSg4XGT0HN9JtPsEiWAPFqGavg77mpXfWZH/mC+TDdymDDUegLWyNM faX8bk/mNmLfxJuK7WTZUAUjJPjp8z6aCqlxzb+LNbnJ++1HaNmBRnW4DtfK41pZ3eyuI3 qrTv+I+1ZJT48Woe0U7ooF9J+Gyi5y7BZczFkFEFLDdTB79j5M9vnQpORDH7JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdQ8c1Dyyz1KkD; Thu, 10 Jul 2025 19:37: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 56AJb3Nb060061; Thu, 10 Jul 2025 19:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJb3YD060058; Thu, 10 Jul 2025 19:37:03 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:37:03 GMT Message-Id: <202507101937.56AJb3YD060058@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: 8f0a6a9aadb1 - main - share: Delete bitrotted make_*_driver.sh scripts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf commit 8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf Author: Jessica Clarke AuthorDate: 2025-07-10 19:36:08 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:36:08 +0000 share: Delete bitrotted make_*_driver.sh scripts These scripts have not seen the necessary changes to keep them up to date with current KPIs and coding practices. They use I/O ports directly rather than any bus abstractions, use i386 (which is on the way out for kernel configs) as the architecture of choice for generated kernel configs, use ISA KPIs, use INTR_TYPE_FAST (renamed in 2000 to INTR_FAST and removed in 2011), and likely have other issues too that render them more harm than good for the uninitiated developer looking for a driver template. If anyone wants to invest time in modernising them they can do so and bring them back, but for now delete them. Reviewed by: cperciva, imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50468 --- ObsoleteFiles.inc | 6 + share/examples/Makefile | 7 - share/examples/drivers/README | 42 --- share/examples/drivers/make_pseudo_driver.sh | 435 --------------------------- tools/build/mk/OptionalObsoleteFiles.inc | 4 - 5 files changed, 6 insertions(+), 488 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4031478f1db4..a5e41d9ac6d6 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20250710: share: Delete bitrotted make_*_driver.sh scripts +OLD_FILES+=usr/share/examples/drivers/README +OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh +OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh +OLD_DIRS+=usr/share/examples/drivers + # 20250710: shar(1) removed OLD_FILES+=usr/bin/shar diff --git a/share/examples/Makefile b/share/examples/Makefile index f0c050a36306..0a65b8c40d39 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -10,7 +10,6 @@ LDIRS= BSD_daemon \ FreeBSD_version \ bootforth \ csh \ - drivers \ etc \ find_interface \ flua \ @@ -74,12 +73,6 @@ SE_DIRS+= csh SE_CSHPACKAGE= csh SE_CSH= dot.cshrc -SE_DIRS+= drivers -SE_DRIVERS= \ - README \ - make_device_driver.sh \ - make_pseudo_driver.sh - SE_DIRS+= etc SE_ETC= \ README.examples \ diff --git a/share/examples/drivers/README b/share/examples/drivers/README deleted file mode 100644 index 8628029a62f8..000000000000 --- a/share/examples/drivers/README +++ /dev/null @@ -1,42 +0,0 @@ - -Author: Julian Elischer - -The files in this directory are shell scripts. - -They will, when run, create an example skeleton driver -for you. You can use this driver as a starting point for -writing drivers for your own devices. They have all the hooks needed -for initialization, probing, attaching, as well as DEVFS -node creation. They also create sample ioctl commands and a sample -ioctl definition .h file in /sys/sys. In other words they are fully -functional in a 'skeleton' sort of a way. They support multiple devices -so that you may have several of your 'foobar' devices probed and attached -at once. - -I expect that these scripts will improve with time. - -At present these scripts also link the newly created driver into -the kernel sources in /sys. Possibly a better way would be -to make them interactive. (and ask what kernel tree to use as well as -a name for the driver.). - -There are presently two scripts. -One for making a real device driver for ISA devices, and -one for making a device driver for pseudo devices (e.g. /dev/null). -Hopefully they will be joined by similar scripts for creating -skeletons for PCI devices as well. - -Give them a single argument: the name of the driver. -They will use this given name in many places within the driver, -both in lower and upper case form. (conforming to normal usage). - -The skeleton driver should already link with the kernel -and in fact the shell script will compile a kernel with the new -drive linked in.. The new kernel should still be -runnable and the new driver should be -fully callable (once you get your device to probe). -You should simply edit the driver and continue to use -'make' (as done in the script) until your driver does what you want. - -The driver will end up in /sys/i386/isa for the device driver script, -and in /sys/dev for the pseudo driver script. diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh deleted file mode 100644 index 5d6d09aa9648..000000000000 --- a/share/examples/drivers/make_pseudo_driver.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/sh -# This writes a skeleton driver and puts it into the kernel tree for you -# -# arg1 is lowercase "foo" -# arg2 path to the kernel sources, "/sys" if omitted -# -# Trust me, RUN THIS SCRIPT :) -# -# -#-------cut here------------------ - -if [ "${1}X" = "X" ] -then - echo "Hey , how about some help here.. give me a device name!" - exit 1 -fi -if [ "X${2}" = "X" ]; then - TOP=`cd /sys; pwd -P` - echo "Using ${TOP} as the path to the kernel sources!" -else - TOP=${2} -fi - -for i in "" "conf" "i386" "i386/conf" "dev" "sys" "modules" -do - if [ -d ${TOP}/${i} ] - then - continue - fi - echo "${TOP}/${i}: no such directory." - echo "Please, correct the error and try again." - exit 1 -done - -UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"` - -if [ -d ${TOP}/modules/${1} ]; then - echo "There appears to already be a module called ${1}" - echo -n "Should it be overwritten? [Y]" - read VAL - if [ "-z" "$VAL" ]; then - VAL=YES - fi - case ${VAL} in - [yY]*) - echo "Cleaning up from prior runs" - rm -rf ${TOP}/dev/${1} - rm -rf ${TOP}/modules/${1} - rm ${TOP}/conf/files.${UPPER} - rm ${TOP}/i386/conf/${UPPER} - rm ${TOP}/sys/${1}io.h - ;; - *) - exit 1 - ;; - esac -fi - -echo "The following files will be created:" -echo ${TOP}/modules/${1} -echo ${TOP}/conf/files.${UPPER} -echo ${TOP}/i386/conf/${UPPER} -echo ${TOP}/dev/${1} -echo ${TOP}/dev/${1}/${1}.c -echo ${TOP}/sys/${1}io.h -echo ${TOP}/modules/${1} -echo ${TOP}/modules/${1}/Makefile - -mkdir ${TOP}/modules/${1} - -cat >${TOP}/conf/files.${UPPER} <${TOP}/i386/conf/${UPPER} <${TOP}/dev/${1}/${1}.c < -#include -#include /* SYSINIT stuff */ -#include /* SYSINIT stuff */ -#include /* cdevsw stuff */ -#include /* malloc region definitions */ -#include -#include /* ${1} IOCTL definitions */ - -#include /* DELAY() */ - -#define N${UPPER} 3 /* defines number of instances */ - -/* XXX These should be defined in terms of bus-space ops. */ -#define ${UPPER}_INB(port) inb(port) -#define ${UPPER}_OUTB(port, val) (port, (val)) - -/* Function prototypes (these should all be static) */ -static d_open_t ${1}open; -static d_close_t ${1}close; -static d_read_t ${1}read; -static d_write_t ${1}write; -static d_ioctl_t ${1}ioctl; -static d_mmap_t ${1}mmap; -static d_poll_t ${1}poll; - -#define CDEV_MAJOR 20 -static struct cdevsw ${1}_cdevsw = { - .d_version = D_VERSION, - .d_open = ${1}open, - .d_close = ${1}close, - .d_read = ${1}read, - .d_write = ${1}write, - .d_ioctl = ${1}ioctl, - .d_poll = ${1}poll, - .d_mmap = ${1}mmap, - .d_name = "${1}", -}; - -/* - * device specific Misc defines - */ -#define BUFFERSIZE 1024 -#define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */ - -/* - * One of these per allocated device - */ -struct ${1}_softc { - u_long iobase; - char buffer[BUFFERSIZE]; - struct cdev *dev; -}; - -typedef struct ${1}_softc *sc_p; - -static sc_p sca[N${UPPER}]; - -/* - * Macro to check that the unit number is valid - * Often this isn't needed as once the open() is performed, - * the unit number is pretty much safe.. The exception would be if we - * implemented devices that could "go away". in which case all these routines - * would be wise to check the number, DIAGNOSTIC or not. - */ -#define CHECKUNIT(RETVAL) \ -do { /* the do-while is a safe way to do this grouping */ \ - if (unit > N${UPPER}) { \ - printf("%s: bad unit %d\n", __func__, unit); \ - return (RETVAL); \ - } \ - if (scp == NULL) { \ - printf("%s: unit %d not attached\n", __func__, unit); \ - return (RETVAL); \ - } \ -} while (0) - -#ifdef DIAGNOSTIC -#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL) -#else /* DIAGNOSTIC */ -#define CHECKUNIT_DIAG(RETVAL) -#endif /* DIAGNOSTIC */ - -static int -${1}ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - switch (cmd) { - case DHIOCRESET: - /* whatever resets it */ - (void)scp; /* Delete this line after using scp. */ -#if 0 - ${UPPER}_OUTB(scp->iobase, 0xff); -#endif - break; - default: - return ENXIO; - } - return (0); -} - -/* - * You also need read, write, open, close routines. - * This should get you started - */ -static int -${1}open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}read(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int toread; - - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * read from buffer - */ - toread = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, toread, uio)); -} - -static int -${1}write(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int towrite; - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * write to buffer - */ - towrite = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, towrite, uio)); -} - -static int -${1}mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(-1); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ -#if 0 /* if we had a frame buffer or whatever.. do this */ - if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) { - return (-1); - } - return i386_btop((FRAMEBASE + offset)); -#else - return (-1); -#endif -} - -static int -${1}poll(struct cdev *dev, int which, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); /* this is the wrong value I'm sure */ -} - -/* - * Now for some driver initialisation. - * Occurs ONCE during boot (very early). - */ -static void -${1}_drvinit(void *unused) -{ - int unit; - sc_p scp; - - for (unit = 0; unit < N${UPPER}; unit++) { - /* - * Allocate storage for this instance . - */ - scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT | M_ZERO); - if( scp == NULL) { - printf("${1}%d failed to allocate strorage\n", unit); - return; - } - sca[unit] = scp; - scp->dev = make_dev(&${1}_cdevsw, unit, - UID_ROOT, GID_KMEM, 0640, "${1}%d", unit); - } -} - -SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR, - ${1}_drvinit, NULL); -DONE - -cat >${TOP}/sys/${1}io.h < -#endif -#include - -/* - * define an ioctl here - */ -#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */ -#endif -DONE - -if [ ! -d ${TOP}/modules/${1} ]; then - mkdir -p ${TOP}/modules/${1} -fi - -cat >${TOP}/modules/${1}/Makefile < -DONE - -echo -n "Do you want to build the '${1}' module? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - (cd ${TOP}/modules/${1}; make depend; make ) - ;; -*) -# exit - ;; -esac - -echo "" -echo -n "Do you want to build the '${UPPER}' kernel? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - ( - cd ${TOP}/i386/conf; \ - config ${UPPER}; \ - cd ${TOP}/i386/compile/${UPPER}; \ - make depend; \ - make; \ - ) - ;; -*) -# exit - ;; -esac - -#--------------end of script--------------- -# -#edit to your taste.. -# -# diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index e0689b2d811f..1e63e4616909 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1683,9 +1683,6 @@ OLD_FILES+=usr/share/examples/diskless/README.BOOTP OLD_FILES+=usr/share/examples/diskless/README.TEMPLATING OLD_FILES+=usr/share/examples/diskless/clone_root OLD_FILES+=usr/share/examples/dma/mailer.conf -OLD_FILES+=usr/share/examples/drivers/README -OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh -OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh OLD_FILES+=usr/share/examples/dwatch/profile_template OLD_FILES+=usr/share/examples/etc/README.examples OLD_FILES+=usr/share/examples/etc/bsd-style-copyright @@ -1912,7 +1909,6 @@ OLD_DIRS+=usr/share/examples/bsdconfig OLD_DIRS+=usr/share/examples/csh OLD_DIRS+=usr/share/examples/diskless OLD_DIRS+=usr/share/examples/dma -OLD_DIRS+=usr/share/examples/drivers OLD_DIRS+=usr/share/examples/dwatch OLD_DIRS+=usr/share/examples/etc OLD_DIRS+=usr/share/examples/etc/defaults From nobody Thu Jul 10 20:56:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdRw62VLJz61Xvr; Thu, 10 Jul 2025 20:56: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdRw60tsPz40HF; Thu, 10 Jul 2025 20:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752180982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AoeBq4Kp7Tut4aeHiPpfs8I5KfnV39bBu4LuG09HNs0=; b=I1TdJjy09Uu+2e71mOSGBX4QztXkNTIoMyXeZfwm8dPKPKoL+yvWBEgLAwKutvIE9viisP reGJvi+QTAstyHl0J9sMUomte56kXTEmMOfdTJnz1ofNyGdbzK5tt5VJ6LdMIv3hMFh5Ff PPfOypHgsISrTr0gxt8eg6vRNqe9w7EycHc6xsQjXH2Os7FTAcdaGADVlq8M4FEBMEmF7m rV2XnRvJedLB1byGDmT7qv/7gHzTtFgNa9sq3yr46by95mZjZRgCw6RJAwkrW0IizX1KM1 G7p2WcgcRjPAzGDOMeBrqYKh0KKqcmKCryg+ir0VrtUrbFxCKYr4dHQcDdKNZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752180982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AoeBq4Kp7Tut4aeHiPpfs8I5KfnV39bBu4LuG09HNs0=; b=Yqrbo2K6H4tD1/DP2YYlGC9LZp1t2GVB4iJBEAVFTPQb0Jb7J6GwQKXwokRYrYyci+TMcc j4RBE43BjhXEPR3LiagosxK5POX9cy33zl5/4t1YEH9dAJZp5tslKfPUZZ5efb31C0f38K UMDgzyqrhBz79mrgJ1R516vZUU84pg35OgD654+2afG4EPtzeTrE1ecZ0kbta5EskF63dO GBNsliDt/LZufuvXKJlZ83FjKnOxXJ1N5XTkMnb0xbHGmLryUXOcYtyKbOe1CvFyqJyNmD h5jrQF7RNdfQPyS3myZT6grppqGOUnq2xx3uhk55bkhIGbEbpimdUNuDb+PHnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752180982; a=rsa-sha256; cv=none; b=ah5lEwnBGW3ZRLgVlKdPKOk41q21aMM3687XrnNuRGN31qB8ZFv+c2cUFoLLvP1rVCthid S2G409uLhKKGuqNZbyBFFS0g5J9aYmbDwHPT4o4VKJCRrMy5hNrvpYA58bCMDMlom7b0pt 4035fjvpbe3YoSy9WtHBgZjLqCggrarZSIwZmlRosuUsJgBbhbxpG/IhS6BIVG9amyWI9u tIU6pVZE3mKR3pJctH9JOdmYnYlIA3hAf9LdwMeuNmRFV1LWNhc3ArJw58Qu1ayRDrC7cb d8OHmsflAbk3HqFtP8BWa6QIXintYr9Gsh3k/JzlikAa/eRmaLnQkL2ZrEdK9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdRw60NNtz1MRn; Thu, 10 Jul 2025 20:56: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 56AKuLf1009677; Thu, 10 Jul 2025 20:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AKuLsD009674; Thu, 10 Jul 2025 20:56:21 GMT (envelope-from git) Date: Thu, 10 Jul 2025 20:56:21 GMT Message-Id: <202507102056.56AKuLsD009674@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: e8019a159185 - main - cross-build: provide exterr.h and sys/exterrvar.h for non-FreeBSD hosts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: e8019a15918596d8c5e9d15378edf223caffda58 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e8019a15918596d8c5e9d15378edf223caffda58 commit e8019a15918596d8c5e9d15378edf223caffda58 Author: Konstantin Belousov AuthorDate: 2025-07-08 22:34:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 20:55:41 +0000 cross-build: provide exterr.h and sys/exterrvar.h for non-FreeBSD hosts with enough glue to make libc/gen/err.c compilable. Reported by: jhb Reviewed by: jhb, jrtc27 Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51217 --- tools/build/cross-build/include/common/exterr.h | 14 ++++++++++++++ tools/build/cross-build/include/common/sys/exterrvar.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/tools/build/cross-build/include/common/exterr.h b/tools/build/cross-build/include/common/exterr.h new file mode 100644 index 000000000000..62482841c7b2 --- /dev/null +++ b/tools/build/cross-build/include/common/exterr.h @@ -0,0 +1,14 @@ +#ifndef _EXTERR_H_ +#define _EXTERR_H_ + +#include + +static inline int +uexterr_gettext(char *buf, size_t bufsz) +{ + if (bufsz > 0) + buf[0] = '\0'; + return (0); +} + +#endif diff --git a/tools/build/cross-build/include/common/sys/exterrvar.h b/tools/build/cross-build/include/common/sys/exterrvar.h new file mode 100644 index 000000000000..0ba821aadef2 --- /dev/null +++ b/tools/build/cross-build/include/common/sys/exterrvar.h @@ -0,0 +1,6 @@ +#ifndef _SYS_EXTERRVAR_H_ +#define _SYS_EXTERRVAR_H_ + +#define UEXTERROR_MAXLEN 256 + +#endif From nobody Thu Jul 10 21:31:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdSj43cWrz61ZpD; Thu, 10 Jul 2025 21:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdSj414cFz3Ks8; Thu, 10 Jul 2025 21:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752183112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Xc6RTjL1v62VVJHeS70gILQVY+7u3cRka71GmYdeHM=; b=en5l5wBecyfTjkVNonT6Wlyy1HprT/N4rl7h1JXtd/V2t3zpja7yc6Coxt/yYvCW4HVSvK zmYETh3xZ5k6WYEjIrvK08WwrFKxlIVYxPiN7yx/T9xxU+mK4wf+TQVHbsDrNllQMaeIGW i6mbK9Np55lY9yAJW3utGxttf6cZv+YToobd/AapT3MJ/CPS0pKRJh9VjZiozTzI7Ca0Ew upWQZ7kTFvrl6ytoRWS+9XW5GWUe9JDLygwdAhH/ZT6VyYztBggDLGT0McWzzsdjc/H8by JXYctfzk7K+udskKX8h4TIHwE+h/yukq+MFcWSI0Ttr+WV6zxRFOq1wesXuG6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752183112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Xc6RTjL1v62VVJHeS70gILQVY+7u3cRka71GmYdeHM=; b=EOQxlbW9fdAaRZEzwqg9d66+GyGIBIytV+4qjMCYGWhexO/QgxuCwsq1bNzazpf/+wsxJ6 Sb72kmkkecsj3K9c340zOn4uzwvAn0xR08EMvJt53wqDLqzLkjUSUgOGClWf39vzWv6imR XQiwvo6D/jcP2gqWP1+Y06ldBLtZpyffVWqi57dMFtDVNCNZN5T6JuELvquPqM8BeXzD07 dDamnX9zwYTS6eZYK1CMalSegDpyA9A8jBCiwW0SwmJhN5p18XxgTGKTcEM2QazuEwCSVc HclU3thk/6JgCOXq87b4IF7+vRl/aad0zcjNvg6jtvn7ZkxzhvR+EUiR5wMFGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752183112; a=rsa-sha256; cv=none; b=UmL6V8y1keOyou7qqBVgvGGNb4Y2gcIkb5J7p+T7aZr/JFK+Yrpel6eQBcmuW0VsqrtNFR e4iqTUJF4yuZiFW6S5UB+OCduzzWKBoE8BDrnc/LQFQovV6UNk0UdFLtcH35cyCir/LZuq XkRYAhJwOXvjvVT8TpQ/LuTudQn9kxOpoxCUOqQdQGypb6bTNJKryzfHCCVwDt8ezWy79l kN/sAvQZaoCBE6qkukWbBTQBILRDAtjRDxvwCRulZkzs0BxVWN8ZwARbV2wfdUVWiguMjr hSpJSMsmE8mBRohh2+oOPFg3JvvxI4PWlMbPTYC+05nL9ob2cBNoD/d7Nq1Xjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdSj40frjz1NPb; Thu, 10 Jul 2025 21:31: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 56ALVpuC082102; Thu, 10 Jul 2025 21:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ALVpFl082099; Thu, 10 Jul 2025 21:31:51 GMT (envelope-from git) Date: Thu, 10 Jul 2025 21:31:51 GMT Message-Id: <202507102131.56ALVpFl082099@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: 09d28419c646 - main - cross-build: fix after the recent sqlite3 import List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 09d28419c646650a77721e168ef43bc1bac96b67 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=09d28419c646650a77721e168ef43bc1bac96b67 commit 09d28419c646650a77721e168ef43bc1bac96b67 Author: Konstantin Belousov AuthorDate: 2025-07-10 21:02:37 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 21:31:23 +0000 cross-build: fix after the recent sqlite3 import Stop adding contrib/sqlite3 into the include path for usr.bin/kyua, take headers from the install sysroot env. sqilte3 now has the VERSION file, which clashes with c++ include . Submitted by: jrtc27 (see https://reviews.freebsd.org/D51217) Tested by: kib Fixes: 17f0f75308f2 ("sqlite3: Vendor import of sqlite3 3.50.2") --- usr.bin/kyua/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/kyua/Makefile b/usr.bin/kyua/Makefile index d3a7b9b61f64..a4f95f1106d9 100644 --- a/usr.bin/kyua/Makefile +++ b/usr.bin/kyua/Makefile @@ -32,7 +32,7 @@ MAN= kyua-about.1 \ CFLAGS+= -I${KYUA_SRCDIR} -I${.CURDIR} CFLAGS+= -I${SRCTOP}/contrib/lutok/include -CFLAGS+= -I${SRCTOP}/contrib/sqlite3 +CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/private/sqlite3 CFLAGS+= -DHAVE_CONFIG_H # We compile the kyua libraries as part of the main executable as this saves From nobody Thu Jul 10 22:54:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdVXL1pR7z61fSx; Thu, 10 Jul 2025 22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVXK5BS5z4ML2; Thu, 10 Jul 2025 22: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=1752188065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QaNK79eaTQpJNbrG2o0M6GeaZ9hbf17EXNGJ0wgcO2U=; b=UjTW3vrsSHjXgJe/38ydEcY4ZdLOnK5m29uvnu6aVa79YfYgFShu56LtSOqqbxzeRIJUDj lertHTuKjQQjRY1Y/GRFy2EgU8q02rzRIGrTexmjmetPJsBpATEpd+CNB0I6kIV4OtX+AS hYcY2tj1FVKKa2CLbELhEF6/gaknm3yg9YUYijF45tIFXGMsOWjjolhGVsTC/7udMF5IH9 oQvPnNSnomekYQdH0CZSbxr7Mx6OoC66Z71sLO4RFGkDxQBm6CtGuPd7J61Tfso8p2cpRz M9n0FKD4dZyYOMDBiVAb2jFnVXf9DZRn7PvV9Stjkwfe0S4I62TeReQDYShFFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QaNK79eaTQpJNbrG2o0M6GeaZ9hbf17EXNGJ0wgcO2U=; b=l/eBCrk6Z9tfvH5hF4vl++FMrOavJ55kJEhA4ag+J/47xaDoduXYrAeTo3UNBrp+CPF0tX u7blCqQ+6RE6Bpb0cldr65iaR3PF+gYrkzlbzsZJcnytdLJ/06J1ULVknGiMVTaT0qHM2s Z4oPjaGs0/vkh/tUPu9GiI5lKHSH/K1XZ5m3dsC2H2j+TLi7ZprrC6j0Bycfhz0sYEdtEX mflPqb0e7PJX39t2tkQfX1+u2zrdQkglaSu5aF5D6EKa5fZFGsT8mk5tvmTK5sC4Ix7SD7 nqEAmPlY7QTpvoLoxoQpNp4N8zyazKUH3YLmE4xxk6NNCqr/OdfgQlroONDwRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188065; a=rsa-sha256; cv=none; b=EIwEqC/Pqr+nSJTtlhYMQoDJrExRbkwtJ7m+bNntrhqF+CDvkO2NACfpAH9GtFGWeA/JU3 zzA6/+4QuNnm2cRYyWlfJ+PcjJ5VAHSiXbGOteq2QDVpSEEgkqCbR6YqJEFPqQyMMdtQMh TSWhz19VswcrIPtEZ5VRMhQ3sjPDM4hnUALP4s9/IUJYoHOJIJMXDQeqIWqqlU0mpoeopU 3rxo1KnOsQ4/sPFDNfq/YthiCIe6KbKysHrepixJ6GTcFNZX5mhzg8nx2irZ40tWqG+Rao PKn91K8vJ3LukhqZsu8aA/6k9OE2gEpOGwaA/IzYidKVS9oMsM6wHCoZndsKjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdVXK3d9Zz1QkZ; Thu, 10 Jul 2025 22: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 56AMsPIf033677; Thu, 10 Jul 2025 22:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMsPHd033674; Thu, 10 Jul 2025 22:54:25 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:54:25 GMT Message-Id: <202507102254.56AMsPHd033674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: d7baf5f70802 - main - bectl.8: Describe better List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7baf5f70802a9045f5792a7063b2614bf17356a Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=d7baf5f70802a9045f5792a7063b2614bf17356a commit d7baf5f70802a9045f5792a7063b2614bf17356a Author: Alexander Ziaee AuthorDate: 2025-06-13 19:37:23 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-10 22:35:36 +0000 bectl.8: Describe better + Concise document description for consistency and apropos results + Improve introductory paragraph, mentioning boot loader support + Explain -r in "Supported Subcommands and Flags" + Clarify the purpose of the check subcommand + Add two basic examples, creating and mounting + Fold some long lines, correct a stray capitalization. MFC after: 3 days Co-authored-by: kevans --- sbin/bectl/bectl.8 | 121 ++++++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index cc88c7019d13..0e08b3383e9a 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -3,12 +3,12 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd April 9, 2024 +.Dd June 13, 2025 .Dt BECTL 8 .Os .Sh NAME .Nm bectl -.Nd Utility to manage boot environments on ZFS +.Nd manage ZFS boot environments .Sh SYNOPSIS .Nm .Op Fl h @@ -80,34 +80,31 @@ .Sh DESCRIPTION The .Nm -command is used to setup and interact with ZFS boot environments, which are -bootable clones of datasets. -.Pp -A boot environment allows the system to be upgraded, while preserving the -pre-upgrade system environment. -.Pp -.Nm -itself accepts an -.Fl r -flag specified before the command to indicate the -.Ar beroot -that should be used as the boot environment root, or the dataset whose children -are all boot environments. -Normally this information is derived from the bootfs property of the pool that -is mounted at -.Pa / , -but it is useful when the system has not been booted into a ZFS root or a -different pool should be operated on. -For instance, booting into the recovery media and manually importing a pool from -one of the system's resident disks will require the -.Fl r -flag to work. +utility manages bootable ZFS clones called boot environments. +Boot envionments allow system changes to be tested safely, +as they are selectable directly from the boot +.Xr loader 8 . +This utility can +.Cm create , +.Cm list , +.Cm mount , +or +.Cm jail +boot environments. +Once the changes have been tested, the boot environment can be +.Cm unmount Ns ed , +.Cm activate Ns d , +.Cm rename Ns d , +and +.Cm destroy Ns ed . .Ss Supported Subcommands and Flags -.Bl -tag -width activate -.It Xo -.Fl h -.Xc +.Bl -tag -width indent +.It Fl h Print usage information and exit. +.It Fl r Ar beroot Sy Ar subcommand +Specify a parent dataset for the boot environment to use for +.Ar subcommand +for operation on manually imported pools or unusual layouts. .It Xo .Cm activate .Op Fl t | Fl T @@ -122,19 +119,19 @@ flag is given, this takes effect only for the next boot. Flag .Fl T removes temporary boot once configuration. -Without temporary configuration, the next boot will use zfs dataset specified -in boot pool +Without temporary configuration, +the next boot will use zfs dataset specified in boot pool .Ar bootfs property. .It Xo .Cm check .Xc -Performs a silent sanity check on the current system. +Perform a check to see if the current system can use boot environments. If boot environments are supported and used, .Nm will exit with a status code of 0. -Any other status code is not currently defined and may, in the future, grow -special meaning for different degrees of sanity check failures. +Any other status code is not currently defined and may, in the future, +grow special meaning for different degrees of sanity check failures. .It Xo .Cm create .Op Fl r @@ -162,8 +159,8 @@ environment. .Pp If .Nm -is creating from another boot environment, a snapshot of that boot environment -will be created to clone from. +is creating from another boot environment, +a snapshot of that boot environment will be created to clone from. .It Xo .Cm create .Op Fl r @@ -174,8 +171,10 @@ Create a snapshot of the boot environment named .Pp If the .Fl r -flag is given, a recursive snapshot of the boot environment will be created. -A snapshot is created for each descendant dataset of the boot environment. +flag is given, +a recursive snapshot of the boot environment will be created. +A snapshot is created for each descendant dataset +of the boot environment. See .Sx Boot Environment Structures for a discussion on different layouts. @@ -241,8 +240,8 @@ If .Ar utility is specified, it will be executed instead of .Pa /bin/sh . -The jail will be destroyed and the boot environment unmounted when the command -finishes executing, unless the +The jail will be destroyed and the boot environment unmounted +when the command finishes executing, unless the .Fl U argument is specified. .Pp @@ -269,11 +268,11 @@ The following default parameters are provided: .It Va allow.mount Ta Cm true .It Va allow.mount.devfs Ta Cm true .It Va enforce_statfs Ta Cm 1 -.It Va name Ta Set to jail ID. +.It Va name Ta set to jail ID .It Va host.hostname Ta Va bootenv -.It Va path Ta Set to a path in Pa /tmp +.It Va path Ta set to a path in Pa /tmp generated by -.Xr libbe 3 . +.Xr libbe 3 .El .Pp All default parameters may be overwritten. @@ -298,8 +297,8 @@ or combination of .It Fl a Display all datasets. .It Fl D -Display the full space usage for each boot environment, assuming all -other boot environments were destroyed. +Display the full space usage for each boot environment, +assuming all other boot environments were destroyed. .It Fl H Used for scripting. Do not print headers and separate fields by a single tab instead of @@ -351,8 +350,8 @@ will make a directory such as .Pa be_mount.c6Sf in .Pa /tmp . -Randomness in the last four characters of the directory name will prevent -mount point conflicts. +Randomness in the last four characters of the directory name +will prevent mount point conflicts. Unmount of an environment, followed by mount of the same environment without giving a .Ar mountpoint , @@ -362,7 +361,7 @@ Rename the given .Ar origBeName to the given .Ar newBeName . -The boot environment will not be unmounted in order for this rename to occur. +The boot environment will not be unmounted for this rename to occur. .It Cm ujail Brq Ar jailId | jailName | beName .It Cm unjail Brq Ar jailId | jailName | beName Destroy the jail created from the given boot environment. @@ -390,8 +389,8 @@ boot environment layout, as created by the Auto ZFS option to .Xr bsdinstall 8 , is a .Dq shallow -boot environment structure, where boot environment datasets do not have any -directly subordinate datasets. +boot environment structure, where boot environment datasets +do not have any directly subordinate datasets. Instead, they're organized off in .Pa zroot/ROOT , and they rely on datasets elsewhere in the pool having @@ -419,7 +418,8 @@ set to .Dv off , thus files in .Pa /usr -typically fall into the boot environment because this dataset is not mounted. +typically fall into the boot environment +because this dataset is not mounted. .Pa zroot/usr/src is mounted, thus files in .Pa /usr/src @@ -445,8 +445,8 @@ Note that the subordinate datasets now have .Dv canmount set to .Dv noauto . -These are more obviously a part of the boot environment, as indicated by their -positioning in the layout. +These are more obviously a part of the boot environment, +as indicated by their positioning in the layout. These subordinate datasets will be mounted by the .Dv zfsbe .Xr rc 8 @@ -468,16 +468,25 @@ A future version of may default to handling both styles and deprecate the various .Fl r flags. -.\" .Sh EXAMPLES -.\" .Bl -bullet -.\" .It +.Sh EXAMPLES +Create a boot environment, named with today's date, +containing snapshots of the root dataset and of all child datasets: +.Pp +.Dl bectl create -r `date +%Y%m%d` +.Pp +Mount a previous boot environment, +.Ar yesterdaysbe , +to +.Pa /mnt : +.Pp +.Dl bectl mount yesterdaysbe /mnt .\" To fill in with jail upgrade example when behavior is firm. -.\" .El .Sh SEE ALSO .Xr libbe 3 , .Xr zfsprops 7 , .Xr beinstall.sh 8 , .Xr jail 8 , +.Xr loader 8 , .Xr zfs 8 , .Xr zpool 8 .Sh HISTORY From nobody Thu Jul 10 22:58:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdVdT3Bk8z61gGS; Thu, 10 Jul 2025 22:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdT116bz4PZv; Thu, 10 Jul 2025 22:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Q+o7FvckPxRF+3X3+QyEy9gZk+UQEAdwt5pobM5Sp0=; b=q2qeHauoEpD3v8aKXnwa7NVai9j+ujg3i3u8m5cQQkSh+CCaqlFs5rLS4sl5Ev+mFZTf5N q5CNqI5nGKNIdrLmnF49Ch6HIonwfrjKDGob1fcFg7jxlDbZcWGhIu1sqvyRzi3CtPTez0 Ullr21Czw43dLNbj3TTwkuQgMLI2P20+3yYjkAiovDCXPqlXqRGJX1pa0lT9nea6QNaKex 8Ktvt13TXWoluIYFB1Nz4EIHFks00FBNxE+oaPHSJ2sYwQpv+YYS2YrS+K5s8xyqRSbBMj 3q1dRxbXSooIsHYQWJVr8h7Mc8PSR1kqyFyMewiYB54jUkD1/wZi+AxTWttaLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Q+o7FvckPxRF+3X3+QyEy9gZk+UQEAdwt5pobM5Sp0=; b=qvJrujsgThYSwwYaBcx3o7mMfGiJmToC0twrgCGQbXzssICfAJcM2lKUUlUi9bJiPe+1Jn k2sAN3M4sTr6/ii8722wAQ4l3O8c1b/4tFuuvrYMu968em0FZHP1tVutR9o0P/EDup514R 3FeL/1/2K9LAYo7aBPqwvnF7ORNz+RtdHogbq+e86TNHfraIRyDslhFpQ7w+GfhA4BnSt8 596u65UK0Z3KQPuBDivPR6yGoK9qhV38lY3XqYFDP1BE1eiQf40xOjeFT4mlSf9Ggw5tqp W4A7JlWI29yQYoUkCDEAq2suzhRYItJ3MwIvYPGEyuviNvWH18bKVt8AzbNd+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188333; a=rsa-sha256; cv=none; b=edQ8y0dMpPfh1/jC5BAXyUAYpV79CjJ2+uVgJ9IjSBLO3jJjyzRX5EJ8fKYBAsHceaqFTy 7ZKd97lc0f6iwZ9ul1NmcUaaL/tP1k0PKl2NLeKY9YzuT1lv3dRGWjbc60xHJ7ppByhXH0 g9pIO6272rkiClajjXXhDc58vgQL3CkT0srn2p35vBHcerWooAmbiyo3E3YVJAViywxn/v P0CaZT+n/5eim6fsbBtdaWQ1QnGVkdVw2xDke1XPZl0u32PBAw7ZCRiEsto5quSidsT/Tv BI88ppv+W7p5gN8UCCGu8P1FHMv6dPSv4npRJYjZyrKO7PANcEV0790Kw9ygJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdVdT02xbz1Qm3; Thu, 10 Jul 2025 22:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMwqr4035207; Thu, 10 Jul 2025 22:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwqdq035204; Thu, 10 Jul 2025 22:58:52 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:52 GMT Message-Id: <202507102258.56AMwqdq035204@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: d26f481bcdfe - main - sys: Delete stale comments in sys/elf_common.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c commit d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:06 +0000 sys: Delete stale comments in sys/elf_common.h Originally the relocations for RISC-V were partitioned into dynamic and static (with those that are both being classed as dynamic), but they were packed next to each other, and so as new relocations were added they were allocated sequentially, at the end of the static block, even if really dynamic, R_RISCV_IRELATIVE being the first such case (and only one we currently have a definition for). Delete the misleading comments. Fixes: 4b88ccbc79cc ("Sync relocation definitions") MFC after: 1 week --- sys/sys/elf_common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 87460aae2dd4..61e1afdfe5c4 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1352,7 +1352,6 @@ typedef struct { * RISC-V relocation types. */ -/* Relocation types used by the dynamic linker. */ #define R_RISCV_NONE 0 #define R_RISCV_32 1 #define R_RISCV_64 2 @@ -1365,8 +1364,6 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 - -/* Relocation types not used by the dynamic linker. */ #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 From nobody Thu Jul 10 22:58:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdVdW50nZz61gGY; Thu, 10 Jul 2025 22:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdW2yk3z4PVf; Thu, 10 Jul 2025 22:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60pJx8zZJRJqwv7mkNqwavTa3CxZ+hsD0Kp2nPSoLhA=; b=KsPu4vwKYHSD/TNWXHZUuT1+wNzlVzN1QGmnZimU12cuH9XJm640ioTxFG1UlHTSMEgKDr JGfcQs3IYMWFOmtz49X+u61Tkkg01mZwPEOHMaf3NOH0uedzavaWU2xMo1VkH193Wwwo9o KH448gyDc40evdnr7U+NphOyeyeMGQKNrwjpoqXYTEQeKUGjrW9+oMXus4rkTG1j+e6QlZ nuh+T9TKeguSwdkzor7UcHjf/goeMH2VtjZNGlbLPaGhYIIROikm2HQIkVhnFSTmijVkzb YuemfyoC0Tt5gYb5M5YIG0f+GHhY0H5Qd8PVHvcDils3BtfwY6oDHd8s/Nbcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60pJx8zZJRJqwv7mkNqwavTa3CxZ+hsD0Kp2nPSoLhA=; b=BmY4LOwRYI/jEYy1evxfjw1FAiFZR5L4brO6mtUfjnQQ7gZY5uZ3d7QKGY2o9UGyYxGz1H HbpXtRF9U3TqbSbLbuQZeQAGiqFIuCwjaNLEY9KEfRRRRBgKMtu3VWQYrY1udG7cl/KUm6 BjoMLbdaQ5Oc1iIrXRmss+ieYFhgg3rSw+cinnM6lttAdd5bobUjbuGVQUf3MBbmd8HEVx 7Ez2wucCaKmaCCJWt/1M5BTPDJScb5NOJABD2/4umkI7ebLHVhjhpLJWzh7iQGc582Y95J AWNC6TapPB3IJr/DjUA2Ln7cnRnwCuspx8JFZ4VT7kL4hTLYnPzd2YcCfAr/lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188335; a=rsa-sha256; cv=none; b=gQYGWuUu/eacfBli9JXA+OsBzYgp30LiMFMfQ4rWmJqJ+p6Ccyjaemv6YxFd9qnhfYQO1H sK0jI5OGduBClhytvL7KhutOZpfVUX+wE7uaZU92294HfGuXsoF9P6AcpW2tWz4qvmttzy bYlFVI/lWUiSqMYEVXlUMtqMMRSAx+Dqi87pElpVipS+X2HgxJ30+zWRRAloNwfNLSVx2M sD6Azp4RuWT+Eu9lJ+BxBS3RnLmaCtIaF+ab+GwMb8kles9SCAnVpFn+GiB2GZhIymrurI qX737EHgZH/Sqnmk+FxYb3QqBDBi847OQxGD2KSyCn4jX9WPB5KlsS9IGk98xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdVdW1f0Vz1Qm5; Thu, 10 Jul 2025 22:58: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 56AMwtjO035276; Thu, 10 Jul 2025 22:58:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwtLo035273; Thu, 10 Jul 2025 22:58:55 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:55 GMT Message-Id: <202507102258.56AMwtLo035273@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: e049e2c37309 - main - sys: Fix style(9) for all LoongArch defines in sys/elf_common.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: e049e2c37309af210c606756089b331fbfdda7b9 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e049e2c37309af210c606756089b331fbfdda7b9 commit e049e2c37309af210c606756089b331fbfdda7b9 Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:07 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:07 +0000 sys: Fix style(9) for all LoongArch defines in sys/elf_common.h Every one of them was using spaces rather than tabs after the macro name. Fixes: 2bb61497ca76 ("elf_common.h: Add definitions for LoongArch ELF files") --- sys/sys/elf_common.h | 246 +++++++++++++++++++++++++-------------------------- 1 file changed, 123 insertions(+), 123 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 048550512c85..22495728a764 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -306,7 +306,7 @@ typedef struct { and MPRC of Peking University */ #define EM_AARCH64 183 /* AArch64 (64-bit ARM) */ #define EM_RISCV 243 /* RISC-V */ -#define EM_LOONGARCH 258 /* Loongson LoongArch */ +#define EM_LOONGARCH 258 /* Loongson LoongArch */ /* Non-standard or deprecated. */ #define EM_486 6 /* Intel i486. */ @@ -392,15 +392,15 @@ typedef struct { */ /* LoongArch Base ABI Modifiers */ -#define EF_LOONGARCH_ABI_SOFT_FLOAT 0x00000001 -#define EF_LOONGARCH_ABI_SINGLE_FLOAT 0x00000002 -#define EF_LOONGARCH_ABI_DOUBLE_FLOAT 0x00000003 -#define EF_LOONGARCH_ABI_MODIFIER_MASK 0x00000007 +#define EF_LOONGARCH_ABI_SOFT_FLOAT 0x00000001 +#define EF_LOONGARCH_ABI_SINGLE_FLOAT 0x00000002 +#define EF_LOONGARCH_ABI_DOUBLE_FLOAT 0x00000003 +#define EF_LOONGARCH_ABI_MODIFIER_MASK 0x00000007 /* LoongArch Object file ABI versions */ -#define EF_LOONGARCH_OBJABI_V0 0x00000000 -#define EF_LOONGARCH_OBJABI_V1 0x00000040 -#define EF_LOONGARCH_OBJABI_MASK 0x000000C0 +#define EF_LOONGARCH_OBJABI_V0 0x00000000 +#define EF_LOONGARCH_OBJABI_V1 0x00000040 +#define EF_LOONGARCH_OBJABI_MASK 0x000000C0 #define EF_SPARC_EXT_MASK 0x00ffff00 #define EF_SPARC_32PLUS 0x00000100 @@ -1419,101 +1419,101 @@ typedef struct { */ /* Relocation types used by the dynamic linker */ -#define R_LARCH_NONE 0 -#define R_LARCH_32 1 -#define R_LARCH_64 2 -#define R_LARCH_RELATIVE 3 -#define R_LARCH_COPY 4 -#define R_LARCH_JUMP_SLOT 5 -#define R_LARCH_TLS_DTPMOD32 6 -#define R_LARCH_TLS_DTPMOD64 7 -#define R_LARCH_TLS_DTPREL32 8 -#define R_LARCH_TLS_DTPREL64 9 -#define R_LARCH_TLS_TPREL32 10 -#define R_LARCH_TLS_TPREL64 11 -#define R_LARCH_IRELATIVE 12 -#define R_LARCH_MARK_LA 20 -#define R_LARCH_MARK_PCREL 21 -#define R_LARCH_SOP_PUSH_PCREL 22 -#define R_LARCH_SOP_PUSH_ABSOLUTE 23 -#define R_LARCH_SOP_PUSH_DUP 24 -#define R_LARCH_SOP_PUSH_GPREL 25 -#define R_LARCH_SOP_PUSH_TLS_TPREL 26 -#define R_LARCH_SOP_PUSH_TLS_GOT 27 -#define R_LARCH_SOP_PUSH_TLS_GD 28 -#define R_LARCH_SOP_PUSH_PLT_PCREL 29 -#define R_LARCH_SOP_ASSERT 30 -#define R_LARCH_SOP_NOT 31 -#define R_LARCH_SOP_SUB 32 -#define R_LARCH_SOP_SL 33 -#define R_LARCH_SOP_SR 34 -#define R_LARCH_SOP_ADD 35 -#define R_LARCH_SOP_AND 36 -#define R_LARCH_SOP_IF_ELSE 37 -#define R_LARCH_SOP_POP_32_S_10_5 38 -#define R_LARCH_SOP_POP_32_U_10_12 39 -#define R_LARCH_SOP_POP_32_S_10_12 40 -#define R_LARCH_SOP_POP_32_S_10_16 41 -#define R_LARCH_SOP_POP_32_S_10_16_S2 42 -#define R_LARCH_SOP_POP_32_S_5_20 43 -#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44 -#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45 -#define R_LARCH_SOP_POP_32_U 46 -#define R_LARCH_ADD8 47 -#define R_LARCH_ADD16 48 -#define R_LARCH_ADD24 49 -#define R_LARCH_ADD32 50 -#define R_LARCH_ADD64 51 -#define R_LARCH_SUB8 52 -#define R_LARCH_SUB16 53 -#define R_LARCH_SUB24 54 -#define R_LARCH_SUB32 55 -#define R_LARCH_SUB64 56 -#define R_LARCH_GNU_VTINHERIT 57 -#define R_LARCH_GNU_VTENTRY 58 +#define R_LARCH_NONE 0 +#define R_LARCH_32 1 +#define R_LARCH_64 2 +#define R_LARCH_RELATIVE 3 +#define R_LARCH_COPY 4 +#define R_LARCH_JUMP_SLOT 5 +#define R_LARCH_TLS_DTPMOD32 6 +#define R_LARCH_TLS_DTPMOD64 7 +#define R_LARCH_TLS_DTPREL32 8 +#define R_LARCH_TLS_DTPREL64 9 +#define R_LARCH_TLS_TPREL32 10 +#define R_LARCH_TLS_TPREL64 11 +#define R_LARCH_IRELATIVE 12 +#define R_LARCH_MARK_LA 20 +#define R_LARCH_MARK_PCREL 21 +#define R_LARCH_SOP_PUSH_PCREL 22 +#define R_LARCH_SOP_PUSH_ABSOLUTE 23 +#define R_LARCH_SOP_PUSH_DUP 24 +#define R_LARCH_SOP_PUSH_GPREL 25 +#define R_LARCH_SOP_PUSH_TLS_TPREL 26 +#define R_LARCH_SOP_PUSH_TLS_GOT 27 +#define R_LARCH_SOP_PUSH_TLS_GD 28 +#define R_LARCH_SOP_PUSH_PLT_PCREL 29 +#define R_LARCH_SOP_ASSERT 30 +#define R_LARCH_SOP_NOT 31 +#define R_LARCH_SOP_SUB 32 +#define R_LARCH_SOP_SL 33 +#define R_LARCH_SOP_SR 34 +#define R_LARCH_SOP_ADD 35 +#define R_LARCH_SOP_AND 36 +#define R_LARCH_SOP_IF_ELSE 37 +#define R_LARCH_SOP_POP_32_S_10_5 38 +#define R_LARCH_SOP_POP_32_U_10_12 39 +#define R_LARCH_SOP_POP_32_S_10_12 40 +#define R_LARCH_SOP_POP_32_S_10_16 41 +#define R_LARCH_SOP_POP_32_S_10_16_S2 42 +#define R_LARCH_SOP_POP_32_S_5_20 43 +#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44 +#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45 +#define R_LARCH_SOP_POP_32_U 46 +#define R_LARCH_ADD8 47 +#define R_LARCH_ADD16 48 +#define R_LARCH_ADD24 49 +#define R_LARCH_ADD32 50 +#define R_LARCH_ADD64 51 +#define R_LARCH_SUB8 52 +#define R_LARCH_SUB16 53 +#define R_LARCH_SUB24 54 +#define R_LARCH_SUB32 55 +#define R_LARCH_SUB64 56 +#define R_LARCH_GNU_VTINHERIT 57 +#define R_LARCH_GNU_VTENTRY 58 /* * Relocs whose processing do not require a stack machine. * * Spec addition: https://github.com/loongson/LoongArch-Documentation/pull/57 */ -#define R_LARCH_B16 64 -#define R_LARCH_B21 65 -#define R_LARCH_B26 66 -#define R_LARCH_ABS_HI20 67 -#define R_LARCH_ABS_LO12 68 -#define R_LARCH_ABS64_LO20 69 -#define R_LARCH_ABS64_HI12 70 -#define R_LARCH_PCALA_HI20 71 -#define R_LARCH_PCALA_LO12 72 -#define R_LARCH_PCALA64_LO20 73 -#define R_LARCH_PCALA64_HI12 74 -#define R_LARCH_GOT_PC_HI20 75 -#define R_LARCH_GOT_PC_LO12 76 -#define R_LARCH_GOT64_PC_LO20 77 -#define R_LARCH_GOT64_PC_HI12 78 -#define R_LARCH_GOT_HI20 79 -#define R_LARCH_GOT_LO12 80 -#define R_LARCH_GOT64_LO20 81 -#define R_LARCH_GOT64_HI12 82 -#define R_LARCH_TLS_LE_HI20 83 -#define R_LARCH_TLS_LE_LO12 84 -#define R_LARCH_TLS_LE64_LO20 85 -#define R_LARCH_TLS_LE64_HI12 86 -#define R_LARCH_TLS_IE_PC_HI20 87 -#define R_LARCH_TLS_IE_PC_LO12 88 -#define R_LARCH_TLS_IE64_PC_LO20 89 -#define R_LARCH_TLS_IE64_PC_HI12 90 -#define R_LARCH_TLS_IE_HI20 91 -#define R_LARCH_TLS_IE_LO12 92 -#define R_LARCH_TLS_IE64_LO20 93 -#define R_LARCH_TLS_IE64_HI12 94 -#define R_LARCH_TLS_LD_PC_HI20 95 -#define R_LARCH_TLS_LD_HI20 96 -#define R_LARCH_TLS_GD_PC_HI20 97 -#define R_LARCH_TLS_GD_HI20 98 -#define R_LARCH_32_PCREL 99 -#define R_LARCH_RELAX 100 +#define R_LARCH_B16 64 +#define R_LARCH_B21 65 +#define R_LARCH_B26 66 +#define R_LARCH_ABS_HI20 67 +#define R_LARCH_ABS_LO12 68 +#define R_LARCH_ABS64_LO20 69 +#define R_LARCH_ABS64_HI12 70 +#define R_LARCH_PCALA_HI20 71 +#define R_LARCH_PCALA_LO12 72 +#define R_LARCH_PCALA64_LO20 73 +#define R_LARCH_PCALA64_HI12 74 +#define R_LARCH_GOT_PC_HI20 75 +#define R_LARCH_GOT_PC_LO12 76 +#define R_LARCH_GOT64_PC_LO20 77 +#define R_LARCH_GOT64_PC_HI12 78 +#define R_LARCH_GOT_HI20 79 +#define R_LARCH_GOT_LO12 80 +#define R_LARCH_GOT64_LO20 81 +#define R_LARCH_GOT64_HI12 82 +#define R_LARCH_TLS_LE_HI20 83 +#define R_LARCH_TLS_LE_LO12 84 +#define R_LARCH_TLS_LE64_LO20 85 +#define R_LARCH_TLS_LE64_HI12 86 +#define R_LARCH_TLS_IE_PC_HI20 87 +#define R_LARCH_TLS_IE_PC_LO12 88 +#define R_LARCH_TLS_IE64_PC_LO20 89 +#define R_LARCH_TLS_IE64_PC_HI12 90 +#define R_LARCH_TLS_IE_HI20 91 +#define R_LARCH_TLS_IE_LO12 92 +#define R_LARCH_TLS_IE64_LO20 93 +#define R_LARCH_TLS_IE64_HI12 94 +#define R_LARCH_TLS_LD_PC_HI20 95 +#define R_LARCH_TLS_LD_HI20 96 +#define R_LARCH_TLS_GD_PC_HI20 97 +#define R_LARCH_TLS_GD_HI20 98 +#define R_LARCH_32_PCREL 99 +#define R_LARCH_RELAX 100 /* * Relocs added in ELF for the LoongArchโ„ข Architecture v20230519, part of the @@ -1526,13 +1526,13 @@ typedef struct { * in psABI v2.20 because they were proved not necessary to be exposed outside * of the linker. */ -#define R_LARCH_ALIGN 102 -#define R_LARCH_PCREL20_S2 103 -#define R_LARCH_ADD6 105 -#define R_LARCH_SUB6 106 -#define R_LARCH_ADD_ULEB128 107 -#define R_LARCH_SUB_ULEB128 108 -#define R_LARCH_64_PCREL 109 +#define R_LARCH_ALIGN 102 +#define R_LARCH_PCREL20_S2 103 +#define R_LARCH_ADD6 105 +#define R_LARCH_SUB6 106 +#define R_LARCH_ADD_ULEB128 107 +#define R_LARCH_SUB_ULEB128 108 +#define R_LARCH_64_PCREL 109 /* * Relocs added in ELF for the LoongArchโ„ข Architecture v20231102, part of the @@ -1540,7 +1540,7 @@ typedef struct { * * Spec addition: https://github.com/loongson/la-abi-specs/pull/4 */ -#define R_LARCH_CALL36 110 +#define R_LARCH_CALL36 110 /* * Relocs added in ELF for the LoongArchโ„ข Architecture v20231219, part of the @@ -1548,24 +1548,24 @@ typedef struct { * * Spec addition: https://github.com/loongson/la-abi-specs/pull/5 */ -#define R_LARCH_TLS_DESC32 13 -#define R_LARCH_TLS_DESC64 14 -#define R_LARCH_TLS_DESC_PC_HI20 111 -#define R_LARCH_TLS_DESC_PC_LO12 112 -#define R_LARCH_TLS_DESC64_PC_LO20 113 -#define R_LARCH_TLS_DESC64_PC_HI12 114 -#define R_LARCH_TLS_DESC_HI20 115 -#define R_LARCH_TLS_DESC_LO12 116 -#define R_LARCH_TLS_DESC64_LO20 117 -#define R_LARCH_TLS_DESC64_HI12 118 -#define R_LARCH_TLS_DESC_LD 119 -#define R_LARCH_TLS_DESC_CALL 120 -#define R_LARCH_TLS_LE_HI20_R 121 -#define R_LARCH_TLS_LE_ADD_R 122 -#define R_LARCH_TLS_LE_LO12_R 123 -#define R_LARCH_TLS_LD_PCREL20_S2 124 -#define R_LARCH_TLS_GD_PCREL20_S2 125 -#define R_LARCH_TLS_DESC_PCREL20_S2 126 +#define R_LARCH_TLS_DESC32 13 +#define R_LARCH_TLS_DESC64 14 +#define R_LARCH_TLS_DESC_PC_HI20 111 +#define R_LARCH_TLS_DESC_PC_LO12 112 +#define R_LARCH_TLS_DESC64_PC_LO20 113 +#define R_LARCH_TLS_DESC64_PC_HI12 114 +#define R_LARCH_TLS_DESC_HI20 115 +#define R_LARCH_TLS_DESC_LO12 116 +#define R_LARCH_TLS_DESC64_LO20 117 +#define R_LARCH_TLS_DESC64_HI12 118 +#define R_LARCH_TLS_DESC_LD 119 +#define R_LARCH_TLS_DESC_CALL 120 +#define R_LARCH_TLS_LE_HI20_R 121 +#define R_LARCH_TLS_LE_ADD_R 122 +#define R_LARCH_TLS_LE_LO12_R 123 +#define R_LARCH_TLS_LD_PCREL20_S2 124 +#define R_LARCH_TLS_GD_PCREL20_S2 125 +#define R_LARCH_TLS_DESC_PCREL20_S2 126 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From nobody Thu Jul 10 22:58:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdVdV44TFz61g5r; Thu, 10 Jul 2025 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdV16V1z4PMc; Thu, 10 Jul 2025 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCLLi97gUIvs8Z+GUHoFftSYo9G26QZvKOcn7Anf2Xs=; b=mA3B7tE6XWFVbunbO7rxaitXnm8Rr0Ihln0NUeDE15WonF270AY9YL6SxkToCa3lwCSSII QjMo4IpEYi0aa0EhG1+l4L/UTOcuQPSLkV1NUqa1h4mQBI2zSFsYcmriycbfcWXc6aLcCv fEkzeYPPwvYQQaVxFAhSiuTubycNZS1UrIZZqtbuhZqAzc7FPz3jmHCas0iPLXTFOmPmOh fjbFtfBfwPA+6/aydY7aJSJYpeTeiwurM0594O0Ba0QQKqccYkDucHVk753mBHnWsoA87g lvEtVnyX2Fvr2LJP/3fMN8pH8mrVnmHhQXIy3fdQ9LBWJm5/SEfzuDjNMhfUQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCLLi97gUIvs8Z+GUHoFftSYo9G26QZvKOcn7Anf2Xs=; b=vjh2yT56vzMYGSPNnR9rVS2++/hzw20CIeRZOOWRnPlZkivWusFLn5apNDItxr23quLYXa T48TwsRf76Fu9+DwH5lxzvf26FE0KlCBV93478k114K59OfqmQJUsA6JbcdMcPuUHncQ31 HBsegPxHFD4rQeDbBwQtTInE7pCv1VL1xFTBubfBahTgHx189f5uyrRVRxrFNl8fa5eSFd jJ+bg8vnfeOeSaTNE3guAu4H/4WXL1Cj2V5rJbmUbpvkiq7AUnWUbxc1KFM7XbhK8nX/c1 o7TK1k6SZYOwcN18t0gxLLYoIQ+BLAXQ6RctiKBeMIiZmFrDkuoaV7o6mHw5BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188334; a=rsa-sha256; cv=none; b=h2Fxxxh7SLRIUgQ/VWNtuf/aWDjT13AovvJyuRV/4BWdGicGBGuo25DCI0/ycbJVM/AAIl AugxXwIg9wgu4q0Nnw+ZVcTy4sAcPHF5lbC/w8x+8JEEary/DwmLYV+88tt2KYDJI7VbH3 kS3hM+WALpOgwZ0XMU4ya51jWc5IznNd3RDD6eC7whMsGqwzq4rBkUYIP6i/AuUAi2rRLx c8XMB+ltvCMEqAHFFmXuh1Hzy3lu51KQhWotvAUttp4qJpC/mDKzZfWBnOpxNwcgz+Q7gp dMCa8WGat9pqq0hCdgztCmRbcdLFrNkJUF8qnuMX9ki0QHp7P043bicg2IQM0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdVdV0gghz1Qm4; Thu, 10 Jul 2025 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMwrcj035242; Thu, 10 Jul 2025 22:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwrCX035239; Thu, 10 Jul 2025 22:58:53 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:53 GMT Message-Id: <202507102258.56AMwrCX035239@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: 65bd6c7acd1f - main - sys: Sync RISC-V relocations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 65bd6c7acd1fba38ce0b234d5d777a2ebad7e807 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=65bd6c7acd1fba38ce0b234d5d777a2ebad7e807 commit 65bd6c7acd1fba38ce0b234d5d777a2ebad7e807 Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:06 +0000 sys: Sync RISC-V relocations MFC after: 1 week --- sys/sys/elf_common.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 61e1afdfe5c4..048550512c85 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1364,6 +1364,7 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 +#define R_RISCV_TLSDESC 12 #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 @@ -1389,10 +1390,10 @@ typedef struct { #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 +#define R_RISCV_GOT32_PCREL 41 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 -#define R_RISCV_RVC_LUI 46 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 @@ -1401,6 +1402,14 @@ typedef struct { #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 #define R_RISCV_IRELATIVE 58 +#define R_RISCV_PLT32 59 +#define R_RISCV_SET_ULEB128 60 +#define R_RISCV_SUB_ULEB128 61 +#define R_RISCV_TLSDESC_HI20 62 +#define R_RISCV_TLSDESC_LOAD_LO12 63 +#define R_RISCV_TLSDESC_ADD_LO12 64 +#define R_RISCV_TLSDESC_CALL 65 +#define R_RISCV_VENDOR 191 /* * Loongson LoongArch relocation types. From nobody Thu Jul 10 22:58:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdVdX5yXcz61gGc; Thu, 10 Jul 2025 22:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdX2kLVz4PdM; Thu, 10 Jul 2025 22:58:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/SopBKbJDL1bhy/oU28JhEb+p3JBS69g7yVvDRybjo4=; b=UluqqkJjAPlWG8J6PLnwFieZaJ1RVTP0hsN5dzUwH94WgARW5BUNe9wZW01KbX9bEHXyz1 gqTDUfIqWuVh/XMTNRuIk0tuX8Gw6b9f2Axo5vNvqj4hyBwqby8spFnasJvJvStgcJUVuT xgJ/Os76Ui5N7/XVcflXBRqbWwyc4mIvhWNTF3UvcUC6ZbH5UWxmdZFqYoP8cXwWGYxbzz +6DNEH/gKMC6y0oQysa6HPlIuPr7Tjhv6Xkwb8gxoDCGI0VuRJ7EAEfK5ZCq2CzsCzSgEl +kGXMbmDtcYIoS1VUN53zKhZolTfsx3XbFWXU6M4TDp0JYUCtCR3WMwkbtXD+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/SopBKbJDL1bhy/oU28JhEb+p3JBS69g7yVvDRybjo4=; b=lm1jN3eplUBqQL+pgkzKGC6m3JNL+NDZUM+cucIH3KRu+NbKN3v9B5gU3dqKTDM5NuJ6gJ GibTsXBqE6NijNwX0VEwYLJ7oRTiG/KBQsh/7OLraRFIQDt8jTMp8RvEA3+df37Yku/omw 1S6HfGWMjIxREF+Q/x2gMGJvqK5hG6fFq98ABGBFqoUIwjE0UvHvEx+vUB0SHAnoyqfvnU 5RAyjdXvfFnEVqGM2EBlqXm1lJV0qAklEXbnfGPrfA08pvaffxQ32hshJ0u9PQzKrKJMNy 0ACp2w968B2bHHvd9FI7R2pBaiLva2weJtIsyvVKuB2hMq0ngvaSpIyd74JfXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188336; a=rsa-sha256; cv=none; b=aFsvSHQcQlRfoaOJhvocShZSLhlaG5bF3nU59Soy18pDxJU9nGvlFPZkI7YTKwQvgXrM4K 0X8h2wH15A8DYHoEoc3ZeVTmzMDwkrGjhyOqFGjpWra0ybd4CdcNmVmwsKfRfkO0mIOOfM H1ndGOLVa0xmIygYWGVjwIzewZ+WIg2ck+vSzkZIpohykB9ctLV3bk6ZXXMldvMWoT+BeG dZWHJHAw93qTHUlD7j2e6qyABMuB+Qb4RZIimaz2mIuhtxB3rkBpNVkvVEX1b9Q2SXBbV2 5oAGKHgU88OlOYGJRxGlEFLEXTLhBXEqzb0Hvai1ak+NIbWwLP2md2Nb9k4dZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdVdX2Fsxz1QYS; Thu, 10 Jul 2025 22:58: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 56AMwuXS035315; Thu, 10 Jul 2025 22:58:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwuMM035312; Thu, 10 Jul 2025 22:58:56 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:56 GMT Message-Id: <202507102258.56AMwuMM035312@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: 22ae840b9f0f - main - sys: Various whitespace style(9) fixes for sys/elf_common.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 22ae840b9f0ff290cb08edacf975a99d264d3a0d Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=22ae840b9f0ff290cb08edacf975a99d264d3a0d commit 22ae840b9f0ff290cb08edacf975a99d264d3a0d Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:07 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:07 +0000 sys: Various whitespace style(9) fixes for sys/elf_common.h MFC after: 1 week --- sys/sys/elf_common.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 22495728a764..efda38279848 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -470,12 +470,12 @@ typedef struct { #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_X86_64_UNWIND 0x70000001 /* unwind information */ -#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND +#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND #define SHT_ARM_EXIDX 0x70000001 /* Exception index table. */ -#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking +#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking pre-emption map. */ -#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility +#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility attributes. */ #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details. */ #define SHT_ARM_OVERLAYSECTION 0x70000005 /* See DBGOVL for details. */ @@ -791,7 +791,7 @@ typedef struct { #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_INITFIRST 0x00000020 /* Initialize DSO first at runtime */ -#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ #define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ @@ -908,7 +908,7 @@ typedef struct { #define STV_ELIMINATE 0x6 /* Architecture specific data - st_other */ -#define STO_AARCH64_VARIANT_PCS 0x80 +#define STO_AARCH64_VARIANT_PCS 0x80 /* Special symbol table indexes. */ #define STN_UNDEF 0 /* Undefined symbol index. */ @@ -1084,11 +1084,11 @@ typedef struct { #define R_AARCH64_COPY 1024 /* Copy data from shared object */ #define R_AARCH64_GLOB_DAT 1025 /* Set GOT entry to data address */ #define R_AARCH64_JUMP_SLOT 1026 /* Set GOT entry to code address */ -#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ +#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ #define R_AARCH64_TLS_DTPREL64 1028 #define R_AARCH64_TLS_DTPMOD64 1029 -#define R_AARCH64_TLS_TPREL64 1030 -#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ +#define R_AARCH64_TLS_TPREL64 1030 +#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ #define R_AARCH64_IRELATIVE 1032 #define R_ARM_NONE 0 /* No relocation. */ @@ -1231,8 +1231,8 @@ typedef struct { #define R_MIPS_GOT_HI16 22 /* GOT HI 16 bit */ #define R_MIPS_GOT_LO16 23 /* GOT LO 16 bit */ #define R_MIPS_SUB 24 -#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ -#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ +#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ +#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ #define R_MIPS_JALR 37 #define R_MIPS_TLS_GD 42 #define R_MIPS_COPY 126 From nobody Thu Jul 10 23:05:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdVmf0Pgpz61glQ; Thu, 10 Jul 2025 23:05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVmd5yJQz3DqW; Thu, 10 Jul 2025 23:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ujA/P+npM3NZYojdDeJ9p10CaKSVn5BqI8gjsWFTOUA=; b=Pu9vVIPNdjdnel+A20TBKd7rMcPaxs2pB32WgBJ/Qkfx5wNrzO6la3hQrNZubIcqD+oVSG 9jXN0qqCQHepH3qkWw/iUK0OC4o7X8LVGU96fG5NEawouOZ6ePLSsmI4wWfumW4pRSWHwz I4DQhKK+p/6fZSsMhudZ9hnEG1abF5CQwEryHbJFDY7m+YZH+sfO9xEb2HBdStnjxfNnBx S5Pme598cZl8a1MRYqkvhAgqXGS7KN2VNMZGp30YN+nAHNWcc48FTUySxWbryfLRML2a/n FrMHblGUVZEORj8aTl7JUXBdgV6QZ2LPlIInXmE8MKaIoT/Mh/u0Gc4YQnVwfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ujA/P+npM3NZYojdDeJ9p10CaKSVn5BqI8gjsWFTOUA=; b=vWcya/7zjsj86dWHYpffn5PZgHthSpjSV0es3kbOMK5xiK774ef7P4F3g7fn0zgFMXcFwt uYfcorAaTyqudEXOUPUrgy3weFXU7p8E8ta6UI41q6MHMjTk01kt5OY2u6CIhzDJsQh8RV 5AK7IB8bCXKdtxeE9zYal0Wdkk4C0oOUp38avEz1WywdHaAbhgz8X+pafO18ZmHHJe/eGv n1KD4QwqwLOyvL7qUggEz2DZ8oj93QWRG+Ry2HTTPRojIHViEIm2ivm1jf6Rfi1sDf2Af3 9+PQ/rts54WjEwaMPq9yRq9k2F/WlBEeNNGsD+StNQ9wBLkFmlgH68v8HMjsgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188705; a=rsa-sha256; cv=none; b=hVbpETgQHfLIJKU5aky/T1CxlXR7pFJUcGqvpvxRQ6aZxfTf8uMlfZgHupclWknbHlFiM/ MQIMdJyNKw4D3hLXd/5FA3iPB6RJSQA44EieoCco1yyUwL0xQT3kd5Dq1+T68oudB9j72L CamAugAcKCUFKk7B4ZSIAjkFmnFTAYjufoZOM29LrNU0aAHPb28rZpbHcAl+Sgun47CdTC hdij5RFT9pUCePUiPoBPt8ocH1kxNqw+X2/vNdEkLVha7q+CSUhkFYhne6zq5ySksp9++g SlsVEJDeDbWeAm4GzZzTa9Q2SAm992jQYH8L94PrF3YeB1G6jxCSlpj8smGEMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdVmd3xxKz1R3S; Thu, 10 Jul 2025 23:05: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 56AN55Ja054473; Thu, 10 Jul 2025 23:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AN55qn054470; Thu, 10 Jul 2025 23:05:05 GMT (envelope-from git) Date: Thu, 10 Jul 2025 23:05:05 GMT Message-Id: <202507102305.56AN55qn054470@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: 74b5dc9f3fcd - main - cam/xpt: style(9) no longer recommends blank lines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 74b5dc9f3fcd9eff142c0212dd738c676effdd4b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=74b5dc9f3fcd9eff142c0212dd738c676effdd4b commit 74b5dc9f3fcd9eff142c0212dd738c676effdd4b Author: Warner Losh AuthorDate: 2025-07-10 23:03:41 +0000 Commit: Warner Losh CommitDate: 2025-07-10 23:03:41 +0000 cam/xpt: style(9) no longer recommends blank lines The new xpt_gdev_type() function shouldn't have had a blank line. It was copied from xpt_path_inq(). Remove it from both. Noticed by: jhb Sponsored by: Netflix --- sys/cam/cam_xpt.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 3815f42cba40..efa6c823245a 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -151,7 +151,6 @@ void xpt_sim_poll(struct cam_sim *sim); static inline void xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) { - bzero(cpi, sizeof(*cpi)); xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NONE); cpi->ccb_h.func_code = XPT_PATH_INQ; @@ -165,7 +164,6 @@ xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) static inline void xpt_gdev_type(struct ccb_getdev *cgd, struct cam_path *path) { - bzero(cgd, sizeof(*cgd)); xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NONE); cgd->ccb_h.func_code = XPT_GDEV_TYPE; From nobody Fri Jul 11 01:07:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdYTb2M3Wz61nbL; Fri, 11 Jul 2025 01:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdYTb1Mszz3R9T; Fri, 11 Jul 2025 01:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752196035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jFhoFRnS+1PqiDzSJ7hqzqFi+ioPolDlndraPHkrNWk=; b=V8kAb/vIJQZ5PvJoMl8ub/z/pV9xmfjMF0uKQ6l4C+mu9D1KST/UZij6os33OlmuHf7d9C NTcMB92sTTQeAhfuDyFfjFGbBIs3CJ/DKTqI90gxdngRQlR3FxDD0g51Tz20RYQ0A6XGNi 3AxEQ1/Qc4PvaxifnkZPpZkZiSTPBPLtRJRBgacTfIMZFLjJb1lPRirQ0/P5QM2YqmXtuU N6Y9+k1VCgxtRXmPuCeu6AZPYeq/vhuk0A1QH2C7hvnMgA3ZFsCUfQTVpbW1uupFx/5DE9 9Fkb22OFhE/O4uNrBlHzrTV24K3WvpjLwY1jgJ5Pu02fifmZBDJTiTRyTYX+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752196035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jFhoFRnS+1PqiDzSJ7hqzqFi+ioPolDlndraPHkrNWk=; b=URs6fAuZgg1J49gA2NlfqgkfhmVt8ouCEU5xUnsJyoSGqSlo5wnEvVVqB+8cDlFKYQdFry A7f+zLHb0RjgDtDGfPjvV4qRAftMKa2r149rvz4CgsDT8jTqm9+h4udsl9orb2VjS/CH+P 8tYp1z1jCOvBFM5ur5Wpkm/7ag0dC8x4k5rLNUifalisUFuW8WMctjdlMLxYhJS7JwsgDQ Fdfwy7rtwJysml0/I2J0gc9UuAFZGUVgT2hVUF9fxi2DyIlALJnSuSVzxOvIyNM2oaNubR kThwIZDSw13HZqLS7n42eJ0JR0cASEwghA4g4/4Ot2HfBizwVmEEFkn3MGn4EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752196035; a=rsa-sha256; cv=none; b=Ifm1GTOkpr4mBmUwYicYVqjjIL8YR36N8SLFdG/WwDdd4O6WMCSk4D3HF8xdDbulYDCGvb V4p2tJHp4xGHPrF42sSOIY0/fIcoB2oOjZlIZ+Ii8ucZmqYvb5P45njgAm1zXYJlvDP1kd boxIEIupjBR/s5pnc2yxZqkWjGmCQzOH720rfZcqzQQePLEBErShfl68nBfGbJ2Vfbs0WX 0IVpFBj2SL3e1CxdKMKferjNEGvDGMQP78F5KVLHiAglEzmeD37MPwx7ErTcCnCjWocwy+ /pDiA0Ci83jRuEzgm6RDBOpR+ehHmzzd+yJmSafIt1aTGKFf79oqCdl8FdfPHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdYTb0rmNzx4; Fri, 11 Jul 2025 01:07: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 56B17FKo078590; Fri, 11 Jul 2025 01:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B17FwG078587; Fri, 11 Jul 2025 01:07:15 GMT (envelope-from git) Date: Fri, 11 Jul 2025 01:07:15 GMT Message-Id: <202507110107.56B17FwG078587@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: 02d06043ba88 - main - rtld-elf: Delete unused RELOC_ALIGNED_P copies List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 02d06043ba88f931f9debd5aa519fc303ca70d11 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=02d06043ba88f931f9debd5aa519fc303ca70d11 commit 02d06043ba88f931f9debd5aa519fc303ca70d11 Author: Jessica Clarke AuthorDate: 2025-07-11 01:07:04 +0000 Commit: Jessica Clarke CommitDate: 2025-07-11 01:07:04 +0000 rtld-elf: Delete unused RELOC_ALIGNED_P copies This was copied from arm to aarch64 to riscv, but only arm uses it. MFC after: 1 week --- libexec/rtld-elf/aarch64/reloc.c | 7 ------- libexec/rtld-elf/riscv/reloc.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index 2b64b48585db..62d664f8fb80 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -36,13 +36,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - /* * This is not the correct prototype, but we only need it for * a function pointer to a simple asm function. diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 390e8c458c28..25c0befb774e 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -40,13 +40,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - uint64_t set_gp(Obj_Entry *obj) { From nobody Fri Jul 11 03:05:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdc6P6xXlz61vTg; Fri, 11 Jul 2025 03:05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdc6P4DkJz3d35; Fri, 11 Jul 2025 03:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jfMT3UoE8/l1mMoZjVpx5vtn/tOoj2JM+UbH6Xtk6TI=; b=l0nl5r2m9Lr2ZJjNIvi1wbj6FZQBuhGCCzgMbKZpdrOo+2s/wO8FPV3zkoLdveIqJa0llW 8SjQUBb7RVXi003XDnKZXAMw+e3H6GZheeNQ6M6aVuA++HF7n9LUpWKcrQqdjhxq7zp0RI CWT+nu2Epf/jv4g48tpMFHXvt3Hh/gUKrWURdudiroT3kEg3veF8zmqAZq8ykHw8peZuBB RCtAFNkG/SGKlA63ViPUA+qDIsknQ7xZTsSWZAOTDBuBZJljnXce/W1Rm4pb1uusd5TfvU 5lYmXd5KF3PR7ZQZ9ftomrMXTrAHYJ9lhl4De3RPV2cvEaGdk+XJEKok0UhYbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jfMT3UoE8/l1mMoZjVpx5vtn/tOoj2JM+UbH6Xtk6TI=; b=yxqqH13HXEmg9Tzxi5L67d+c1cFyS3UlqYOj0TszN6DY71N5FqHlfxU2UvsE7i/skJC6pL 2GpXP5a88KBLlYKKd3kwW1QgdJUY7VbbBa642vR2NN1bnkk0E6Dj6AC3dWVoXozPaa25vY vmEHRvNbHkYWLPieRMt3APORRZ8wIgVFDZFkl2dIozx6rneGpxgg+Pqe8XbNxSRlv+n/qd U6JNll9HmH0tPOuEIsC5vNDpyQYdinvPAN4/K2xeBoh5o+XGix/o1KZs6nQQ5tGO+o3fNZ Snszf1QfV74jIMFQJP0YMLPVycRJMFRMFn2yllERH6VJcfEzC9aEBF75RHg9jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752203149; a=rsa-sha256; cv=none; b=XkzRvR5DXnA/pQm4dwjLYvRdoHXgMXrwSi7ZPe1A3luAG0sajMp4wt3y6PyLr7R8eZXG/D K1Z+IOzOZfv1QY0gbzHqdvFwPbafhLiqvnELKzuUI1b0V3CqekKmasGgKW3JSZeP9D49ve t9b/79+KMRw2YF0x9N4WZUnpaKBnbOIqslrIro+0GJqHiB9Fkntf2mYXGul01renRShMQo HN86TapoXwaRof+Y4Ey7oOb/cwacpuL3bVGiagjewmEoTUIKyVRDyJFylV6h2sl6+mTPXU CvkBRiqxR/0w3TUaF4tqQlu3xNKm6Xsqd4leOmI+Ccg6QUTwYgM57k36mH5rEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdc6P3cwnz4QY; Fri, 11 Jul 2025 03:05: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 56B35nvT003868; Fri, 11 Jul 2025 03:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B35ns4003865; Fri, 11 Jul 2025 03:05:49 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:05:49 GMT Message-Id: <202507110305.56B35ns4003865@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: f1eceb963caf - main - libsa/zfs: add error printf() in zfs_spa_init() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f1eceb963cafb2095ce02eea77298370fa2f6fd3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f1eceb963cafb2095ce02eea77298370fa2f6fd3 commit f1eceb963cafb2095ce02eea77298370fa2f6fd3 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:04:50 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:04:50 +0000 libsa/zfs: add error printf() in zfs_spa_init() All other error exits from this function print something. --- stand/libsa/zfs/zfsimpl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 41ef5a46f30e..a3ce003782f8 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -3541,8 +3541,10 @@ zfs_spa_init(spa_t *spa) return (EIO); } rc = load_nvlist(spa, config_object, &nvlist); - if (rc != 0) + if (rc != 0) { + printf("ZFS: failed to load pool %s nvlist\n", spa->spa_name); return (rc); + } rc = zap_lookup(spa, &dir, DMU_POOL_ZPOOL_CHECKPOINT, sizeof(uint64_t), sizeof(checkpoint) / sizeof(uint64_t), From nobody Fri Jul 11 03:20:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdcRS0lN0z61vwZ; Fri, 11 Jul 2025 03:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcRR6HJKz3nmb; Fri, 11 Jul 2025 03:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJwz2v51IIdW5ertgS5lwuaCiZvBpFxpzA9liMh68Zg=; b=c1IeVxpSDfyyXjV9qLbetXfkDjXIENWyUUisYit/Dpusf2K603H9MZYOU99bMvRcLTiitQ qgdFKcmL+DWYyj6lqlVI5acsLfvt0C8eWLGDwYUqLaCzOAUj+fS8lib7En4TsX+vQedYnx WtwPqdhtYP+sq5W4oMMGqoYaLWPyKstOz9Cu5QzDzGa4tzDrkNErhD6617mDhmGBWOBg2r sOZciWT3CLMUstmYpcgJw2MqjtLEi1uoRAMYAdLNAwlB+UfchEjyxfJGg+4iHFI28RLru2 5ctGiVs+7sm7+b7VXx0eGXcmW5g2VMAS787oGBSysqLVi5m/5uui6dJbi/Qeug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJwz2v51IIdW5ertgS5lwuaCiZvBpFxpzA9liMh68Zg=; b=uJD/NdaO81PNleBOTR4X3VIVDrL6BsJmv1X1FQHbxw9dkxqiGQNDCckZhOgyE/H4F17/4j V5kQGc74sVY8KDIhirfOIGnSBJKPJIGgKSAG7dHF+GxRISXzDVRrkyRvUXCMzzU7yxs+Vh HvKejkh/GgbQplPU3dBosC7h5USaglNTkb0Y/IGYpE1yq2TNZAO2UwPR1g2GekWBuVvar5 JHaOcSQsb1XTLtloP/qUUmlGWTlmOfTyU6kgrGVN6QCCL/62h8QRuxAiy6rNcLKl+xbAvr E/4RIpHxETVdzbogne0MfBgtYwt8zukBBPVQGf67KPWjWv3YYK/O1N5MqjAfQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752204035; a=rsa-sha256; cv=none; b=GudXhpaPn5qjT0THpKk48N3ejpSCG5gIzpqLqCdEuCMUu2Ge7fUPeUyxVrgupekeF97ELe 4G9Pz0S3uOxrNWaqr/mpbJ45nPvXZaMaybrEPiIcb3n2c7s2ou5dUUvkfU60moHU1MjfGR 49oVsYj1YP3H2xmo4Ismla8ltXJ3D2jDDmtuEGZf2UbtyWaXZxGk26zMFAwQAFfhCXROIf 3Q5YRcqLBKov9NCpaWsPvhHz5JKs5x5MSMIXcAfnZ4wi2NsLUJRNcJjJG565PuXpVnhhxu 7SY6jbLJx5TNXd9gkVIXzE3dcbmQ091+xrdHk+FrDZcRz5W1WPzs/U+9E65//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 4bdcRR5sCpz4lj; Fri, 11 Jul 2025 03:20: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 56B3KZgE033214; Fri, 11 Jul 2025 03:20:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3KZLq033211; Fri, 11 Jul 2025 03:20:35 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:20:35 GMT Message-Id: <202507110320.56B3KZLq033211@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: 03f3dc3189e5 - main - libsa/zfs: don't hardcode root vdev name, use the real pool name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 03f3dc3189e5abe4d4a56269c107119cc4a07388 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=03f3dc3189e5abe4d4a56269c107119cc4a07388 commit 03f3dc3189e5abe4d4a56269c107119cc4a07388 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:07:39 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:07:39 +0000 libsa/zfs: don't hardcode root vdev name, use the real pool name --- stand/libsa/zfs/zfsimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index a3ce003782f8..058907b1d822 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -1379,7 +1379,7 @@ spa_create(uint64_t guid, const char *name) free(spa); return (NULL); } - spa->spa_root_vdev->v_name = strdup("root"); + spa->spa_root_vdev->v_name = spa->spa_name; STAILQ_INSERT_TAIL(&zfs_pools, spa, spa_link); return (spa); From nobody Fri Jul 11 03:20:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdcRT3Zn8z61w2J; Fri, 11 Jul 2025 03:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcRT08wfz3ndL; Fri, 11 Jul 2025 03:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l1BssYPPDdsIBYFMsBfiicmPgjWdWKw4cRr1rVwv32U=; b=YMZG+ItSU6B3o5Wre1DnoCutDsw3OnT8c25hGy+h9cZauugEPisdJaU93PKDi47xqgHJeG ugZiATFH5gW2RG090NqeB24OzUm2RdtisovvQTgDp1lc4zIwHcGQ8vNQQzhjKOzEun52Pn sgaBdcSv49n98w/wUBMcxKa6J3W78YooMiaFKiUp7/DMzFnxDjZpeyfG3wm0AeLQls3bNr 1lgKP8O6FVeojBgEhr47C122sEpe45GkgeMzFONefqKIz2FqpPns5vroqkgLYlIPbwnNBk LlFTIgAIf+nvKnoUZH49WeVyOY5ILNZAUqA9kx1L1Qy+ZjyVqfksOAXJH46yqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l1BssYPPDdsIBYFMsBfiicmPgjWdWKw4cRr1rVwv32U=; b=VMGmeFXvEVnGreDbJAWhXHBJENlImtBwmxPHs60S71Kj46NxU13xMbxMYqbvIS4745VcOL ggClCU8TQJAO2vEbebrz72u7wqvsrs+XV1krf2HqjVS5N2o0ALuVrfa2yLushp4JL+qBpj ESxXmUf5FGpQMRILRh1b7dVAj7gCtPppit/XaH+maMHbqAidYwhuX06SGC8B7RXrxSEV05 7Us8CYwIgPQdJigAA6YumE+1JKbLdyGqYXWDKvyUjmupsCLq0b65ZXdTQ3OS0lEvPapx1T LKh+mwgkRhuz1zyFGmsAcl5+aRnGQCthU3pVuYWlAYegk+0ZTYXft3JZiZI86A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752204037; a=rsa-sha256; cv=none; b=IQGkHRj7TNYYXTxl6g3yvI+rhDGnvMTucS83yaiozFeM1+zJNbok9YV9LA2WJ/wzmSINay YcL3xp+uaCkflgrQToOPT5FSGNxHNGrGJVd4X4xd1UBUEuTNLpgmobtlvSpuIFTYE2xXXu VWJNDXnVtumJKkSn9N1WuhBg+/BEqIczUXIi6zO+FaRO8tHp2GSK6XT/nQFVeInC92HS9S mSxmiSw2rwyi2GReS/N5f1RQamaZ7PDZlVAxTBPglFSAsobWhlD4nlxRCZVVx078KoeOO+ j/5oY7k9OwmM1F5SrKiyljTQ/+hn6E7uku0iZNYaqzElaGwDAKFGUjJW+4O5mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdcRS6p4Xz4kn; Fri, 11 Jul 2025 03:20: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 56B3KaYB033248; Fri, 11 Jul 2025 03:20:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3KalL033246; Fri, 11 Jul 2025 03:20:36 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:20:36 GMT Message-Id: <202507110320.56B3KalL033246@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: 8949cdd9af53 - main - libsa/zfs: don't read and store ZPOOL_CONFIG_VDEV_CHILDREN in vdev_probe() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8949cdd9af536d3fc4313c057dcb383f474c3f84 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8949cdd9af536d3fc4313c057dcb383f474c3f84 commit 8949cdd9af536d3fc4313c057dcb383f474c3f84 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:18:36 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:18:36 +0000 libsa/zfs: don't read and store ZPOOL_CONFIG_VDEV_CHILDREN in vdev_probe() This is just the value from the current label and it is not used in the function. Later zfs_spa_init() will call vdev_init_from_nvlist() and it will obtain the value. --- stand/libsa/zfs/zfsimpl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 058907b1d822..a31fa24f358e 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -2006,7 +2006,7 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, vdev_t *vdev; nvlist_t *nvl; uint64_t val; - uint64_t guid, vdev_children; + uint64_t guid; uint64_t pool_txg, pool_guid; const char *pool_name; int rc, namelen; @@ -2083,8 +2083,6 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, if (spa == NULL) { char *name; - nvlist_find(nvl, ZPOOL_CONFIG_VDEV_CHILDREN, - DATA_TYPE_UINT64, NULL, &vdev_children, NULL); name = malloc(namelen + 1); if (name == NULL) { nvlist_destroy(nvl); @@ -2098,7 +2096,6 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, nvlist_destroy(nvl); return (ENOMEM); } - spa->spa_root_vdev->v_nchildren = vdev_children; } if (pool_txg > spa->spa_txg) spa->spa_txg = pool_txg; From nobody Fri Jul 11 03:27:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdcbK6pVGz61wVS; Fri, 11 Jul 2025 03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcbJ717Tz3tBg; Fri, 11 Jul 2025 03: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=1752204445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qsE1Yisg78o39mkvv9mU0sbngNGfKtWTAgLKI9olUKw=; b=Tyevm1xUR1FBfOS6W/+TAblEGYfnjMHVN/y8eIunaBb/d6Of45zZIRdhX0oLZiyHnBjGUH weZmApbItGy9t4yB2x+qDTvl7ljrSnIApY5lQyOsi3BrqVxtEYcHseDHwYRr7DY6FFKf0n 4dThD4PyFHsJinFIQ0bKsowBEeEjDTrcyIYRUq3FLab2+y3RiCF11nTnskOMSJc2DHwoWs ykZVT6/mnH5jyfoysOyFxWHAHckJSP58SaRbWHoPCIvIA/0/Gn3rG17TsQPurZqsNsyz4U OFg870cd52LRY9om8EEnnf4kUIRT5zCmm9IHcMpcSjymILvDkp0wiL8vQb9UzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qsE1Yisg78o39mkvv9mU0sbngNGfKtWTAgLKI9olUKw=; b=IaTzczmvWLcCz/iZtfhLtZo7pZV9qFxcG/AqUK89QRWqdd10Q/+eW01S6c0vFUB/75PvqC EqHqoNGXCcbMe8u+/WUFfnQdRKIuswxSn35vQIAd6eTbIhRO3v3nGex+rvt0ATZ4ZHiMDG toQBixStJCUzSu+TRv89kLcsOMldzz13xVbEQFyXZETDIhxpPBYMTHPlBZ6mmP89JQmnj8 dPfgegSPosmnqLzytqRBmcb0NZmvlwUXcU11MT40rKjIRuntjrSHAI+Qw+qGZL+DaUDwIc 2P+ZTPSMfrs9cU7PK9xXsous9OjCXkpZNkJskTvrXRJM/l2e54UBn/nFib8mrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752204445; a=rsa-sha256; cv=none; b=VlEU8wj909hAP4W9/mfP28y7nzUfjeH6APUokWdZou7udC4z0AKLL2lf1Wiih6s+kubIXh kgtE1KVfzKY6RbrbZCZe3xR/RwSz6NKZxS0Fl14UREkV+jbksHhFGY4RNced6Ses/iPr9r cjjrGoA+q+qv9pAk2W+C/4l+DdZiS79dsPdlTfjEgDzA05yACc6qMymeq8cVGr64/8auY0 Pkq4poa0ph3gOVpMihVKESx5s5r2qAnKBrbEP2J7OmYBbF5jyqwbVq6EQPTw8D5wnn9GOD B1D3EzAJaSglpE2DNpvv6UKW//rcQthM0Ej4bxcyZ+EeYSevOX6P3KWzImfVOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdcbJ6C1wz4lM; Fri, 11 Jul 2025 03: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 56B3ROOR042018; Fri, 11 Jul 2025 03: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 56B3ROPg042016; Fri, 11 Jul 2025 03:27:24 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:27:24 GMT Message-Id: <202507110327.56B3ROPg042016@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: 8e8fd66ca06f - main - libsa/zfs: fail earlier in vdev_probe() if can't find ZPOOL_CONFIG_GUID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8e8fd66ca06ff73f3b4bdf3f7735d727a881cf60 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8fd66ca06ff73f3b4bdf3f7735d727a881cf60 commit 8e8fd66ca06ff73f3b4bdf3f7735d727a881cf60 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:26:01 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:26:01 +0000 libsa/zfs: fail earlier in vdev_probe() if can't find ZPOOL_CONFIG_GUID Don't store any configuration in memory from such weird label. --- stand/libsa/zfs/zfsimpl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index a31fa24f358e..c7dc72561eff 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -2067,7 +2067,9 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, nvlist_find(nvl, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, NULL, &pool_guid, NULL) != 0 || nvlist_find(nvl, ZPOOL_CONFIG_POOL_NAME, DATA_TYPE_STRING, - NULL, &pool_name, &namelen) != 0) { + NULL, &pool_name, &namelen) != 0 || + nvlist_find(nvl, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, + NULL, &guid, NULL) != 0) { /* * Cache and spare devices end up here - just ignore * them. @@ -2106,11 +2108,6 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, * be some kind of alias (overlapping slices, dangerously dedicated * disks etc). */ - if (nvlist_find(nvl, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, - NULL, &guid, NULL) != 0) { - nvlist_destroy(nvl); - return (EIO); - } vdev = vdev_find(guid); /* Has this vdev already been inited? */ if (vdev && vdev->v_phys_read) { From nobody Fri Jul 11 04:16:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bddgq2QB3z61yVN; Fri, 11 Jul 2025 04:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bddgq0sQdz4PVt; Fri, 11 Jul 2025 04:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752207383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t3P5zYrBfeSKrOA+6k82qpEimDqh4MNKQ9CjMo203dA=; b=e4zda7fZkdXiQI0pKnbHEg3Vqwwy3W+Z/XeVlVwHNEeQNcjR4TeLefjlyRZjHrRqT21YDD E6svAq++svAPicL7iQ6GdR8P7t0ZW9RuW2YnfyP2JuHJp5e0bWRz8LGR+LQbfHl2symBs6 HwCVRPvCGpIfbghZ+EyyNumGZeFJsuvyZfW32dTKhlrpSsXbMRckZKgFk1AECZC6cUaURO 3wXsmGnG22iG1xuhn6AY4WDemc7psygU4rYyEFajUliyUx57F9slYkuY9SwnifhfLN/x4U Q9ZMCHfZIfWnzr8ewBnSMCLKg3Rtc6XBw9YO05PBmO7FAFykJ6krSPgXedHPgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752207383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t3P5zYrBfeSKrOA+6k82qpEimDqh4MNKQ9CjMo203dA=; b=Y1Fg3YraKPMGuMud0KPmjGOZHxxPxyVhbjnUJppwlqyI7sVWNqJ8CZxPJPpEZPqZpY/2Fl yjI+DH1/1d/vmSrlsqWKUzC9V+501BIiWx7cdfa/GoxA6l/URst6fkhGEiupvhe4XrgZ5O fyzLfummHuF188vGJYFceJy7HWJ6FfWzNpTZLZaHEMbo0G73BErPyXdWRQVHfkNODGHOOH kqKbB2qOJwMDWdqMG8/SeXo4RmjE7oYjNb8/h1tTxoMYaBKWPs7sd5t4ZY+Xu5ufpQH5iW Tchf6ULSJ+fW7TWaU5drdVp8FVBIedy+qYd3vy6VV9MXqub31vEI61UloPxmZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752207383; a=rsa-sha256; cv=none; b=R+rtysBaXgMPLxVqgvuvjxN7bLQE2IwFK+1066a9T+XbXXCVuLhslG3y4V9kMZRVD8mzlu ozN6N8i1pModFco5C0RAIdDMtjaXNquXlTXbp6ccz/XuSvbi4u5x2v6nTSnZqrywAWxMf4 akgrEYrg0awR6D7unUzIx8EvEIIPVWH2WLFsl4Lq3ZINNI5+9xrvsrcNJmDAy9//TuxK+m aOq9QwGKvLLCrR0GPmNiMqbzac3qVjkggDkot7P81XMdMj3uwqPRWQfz4SMrryb2XCW4zO A35zGlB/k7wqouiDI8Mhp86O1Se5DehwYQfqJ66l8Hsd0vWJFXbAAOh7osLucQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bddgq0T40z6LK; Fri, 11 Jul 2025 04:16: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 56B4GMlp035783; Fri, 11 Jul 2025 04:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B4GM84035780; Fri, 11 Jul 2025 04:16:22 GMT (envelope-from git) Date: Fri, 11 Jul 2025 04:16:22 GMT Message-Id: <202507110416.56B4GM84035780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 99d5cf25d7b8 - main - libusb: implement libusb_setlocale to support different locale of error message List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99d5cf25d7b87796f9979df8f2b4021df51c090c Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=99d5cf25d7b87796f9979df8f2b4021df51c090c commit 99d5cf25d7b87796f9979df8f2b4021df51c090c Author: ShengYi Hung AuthorDate: 2025-06-12 18:47:22 +0000 Commit: ShengYi Hung CommitDate: 2025-07-11 04:15:30 +0000 libusb: implement libusb_setlocale to support different locale of error message Upstream libusb identifies languages using only the first two characters of the language code. We adopt the same approach to maintain API compatibility. Currently, only English and Mandarin are supported, as other languages are not yet implemented. Reviewed by: kevans Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50820 --- lib/libusb/libusb.3 | 15 +++++- lib/libusb/libusb.h | 3 ++ lib/libusb/libusb10.c | 126 +++++++++++++++++++++++++++++++++++++------------- lib/libusb/libusb10.h | 6 +++ 4 files changed, 117 insertions(+), 33 deletions(-) diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3 index a9a99f307a86..74b85d4aa17e 100644 --- a/lib/libusb/libusb.3 +++ b/lib/libusb/libusb.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 12, 2025 +.Dd June 13, 2025 .Dt LIBUSB 3 .Os .Sh NAME @@ -106,6 +106,19 @@ Get the ASCII representation of the error given by the argument. This function does not return NULL. .Pp +.Ft int +.Fn libusb_setlocale "const char *locale" +Set locale for the error message when using +.Fn libusb_strerror +to +.Ft locale . +Note other +.Nm +implementations only support the first two bytes, that means +.Ql en-US +is equivalent to +.Ql en-CA . +.Pp .Ft const char * .Fn libusb_error_name "int code" Get the ASCII representation of the error enum given by the diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 17d341d1b91c..6fb1c19fad13 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -210,6 +210,8 @@ enum libusb_error { LIBUSB_ERROR_OTHER = -99, }; +#define LIBUSB_ERROR_COUNT 14 + enum libusb_speed { LIBUSB_SPEED_UNKNOWN = 0, LIBUSB_SPEED_LOW = 1, @@ -475,6 +477,7 @@ int libusb_init(libusb_context ** context); int libusb_init_context(libusb_context **, const struct libusb_init_option [], int num_options); void libusb_exit(struct libusb_context *ctx); int libusb_has_capability(uint32_t capability); +int libusb_setlocale(const char *locale); /* Device handling and enumeration */ diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 173f51aa88b3..6f1ca877fc28 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -4,6 +4,7 @@ * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. * Copyright (c) 2009-2023 Hans Petter Selasky * Copyright (c) 2024 Aymeric Wibo + * Copyright (c) 2025 ShengYi Hung * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +32,7 @@ #include LIBUSB_GLOBAL_INCLUDE_FILE #else #include +#include #include #include #include @@ -84,6 +86,52 @@ static const struct libusb_version libusb_version = { .describe = "https://www.freebsd.org" }; +static const struct libusb_language_context libusb_language_ctx[] = { + { + .lang_name = "en", + .err_strs = { + [-LIBUSB_SUCCESS] = "Success", + [-LIBUSB_ERROR_IO] = "I/O error", + [-LIBUSB_ERROR_INVALID_PARAM] = "Invalid parameter", + [-LIBUSB_ERROR_ACCESS] = "Permissions error", + [-LIBUSB_ERROR_NO_DEVICE] = "No device", + [-LIBUSB_ERROR_NOT_FOUND] = "Not found", + [-LIBUSB_ERROR_BUSY] = "Device busy", + [-LIBUSB_ERROR_TIMEOUT] = "Timeout", + [-LIBUSB_ERROR_OVERFLOW] = "Overflow", + [-LIBUSB_ERROR_PIPE] = "Pipe error", + [-LIBUSB_ERROR_INTERRUPTED] = "Interrupted", + [-LIBUSB_ERROR_NO_MEM] = "Out of memory", + [-LIBUSB_ERROR_NOT_SUPPORTED] ="Not supported", + [LIBUSB_ERROR_COUNT - 1] = "Other error", + [LIBUSB_ERROR_COUNT] = "Unknown error", + } + }, + { + .lang_name = "zh", + .err_strs = { + [-LIBUSB_SUCCESS] = "ๆˆๅŠŸ", + [-LIBUSB_ERROR_IO] = "I/O ้Œฏ่ชค", + [-LIBUSB_ERROR_INVALID_PARAM] = "ไธๅˆๆณ•็š„ๅƒๆ•ธ", + [-LIBUSB_ERROR_ACCESS] = "ๆฌŠ้™้Œฏ่ชค", + [-LIBUSB_ERROR_NO_DEVICE] = "่ฃ็ฝฎไธๅญ˜ๅœจ", + [-LIBUSB_ERROR_NOT_FOUND] = "ไธๅญ˜ๅœจ", + [-LIBUSB_ERROR_BUSY] = "่ฃ็ฝฎๅฟ™็ขŒไธญ", + [-LIBUSB_ERROR_TIMEOUT] = "้€พๆ™‚", + [-LIBUSB_ERROR_OVERFLOW] = "ๆบขไฝ", + [-LIBUSB_ERROR_PIPE] = "็ฎก้“้Œฏ่ชค", + [-LIBUSB_ERROR_INTERRUPTED] = "่ขซไธญๆ–ท", + [-LIBUSB_ERROR_NO_MEM] = "่จ˜ๆ†ถ้ซ”ไธ่ถณ", + [-LIBUSB_ERROR_NOT_SUPPORTED] ="ไธๆ”ฏๆด", + [LIBUSB_ERROR_COUNT - 1] = "ๅ…ถไป–้Œฏ่ชค", + [LIBUSB_ERROR_COUNT] = "ๆœช็Ÿฅ้Œฏ่ชค", + } + }, +}; + +static const struct libusb_language_context *default_language_context = + &libusb_language_ctx[0]; + const struct libusb_version * libusb_get_version(void) { @@ -1728,38 +1776,26 @@ libusb_le16_to_cpu(uint16_t x) const char * libusb_strerror(int code) { - switch (code) { - case LIBUSB_SUCCESS: - return ("Success"); - case LIBUSB_ERROR_IO: - return ("I/O error"); - case LIBUSB_ERROR_INVALID_PARAM: - return ("Invalid parameter"); - case LIBUSB_ERROR_ACCESS: - return ("Permissions error"); - case LIBUSB_ERROR_NO_DEVICE: - return ("No device"); - case LIBUSB_ERROR_NOT_FOUND: - return ("Not found"); - case LIBUSB_ERROR_BUSY: - return ("Device busy"); - case LIBUSB_ERROR_TIMEOUT: - return ("Timeout"); - case LIBUSB_ERROR_OVERFLOW: - return ("Overflow"); - case LIBUSB_ERROR_PIPE: - return ("Pipe error"); - case LIBUSB_ERROR_INTERRUPTED: - return ("Interrupted"); - case LIBUSB_ERROR_NO_MEM: - return ("Out of memory"); - case LIBUSB_ERROR_NOT_SUPPORTED: - return ("Not supported"); - case LIBUSB_ERROR_OTHER: - return ("Other error"); - default: - return ("Unknown error"); - } + int entry = -code; + + if (code == LIBUSB_ERROR_OTHER) + entry = LIBUSB_ERROR_COUNT - 1; + /* + * The libusb upstream considers all code out of range a + * LIBUSB_ERROR_OTHER. In FreeBSD, it is a special unknown error. We + * preserve the FreeBSD implementation as I think it make sense. + */ + if (entry < 0 || entry >= LIBUSB_ERROR_COUNT) + entry = LIBUSB_ERROR_COUNT; + + /* + * Fall back to English one as the translation may be unimplemented + * when adding new error code. + */ + if (default_language_context->err_strs[entry] == NULL) + return (libusb_language_ctx[0].err_strs[entry]); + + return (default_language_context->err_strs[entry]); } const char * @@ -1842,3 +1878,29 @@ libusb_log_va_args(struct libusb_context *ctx, enum libusb_log_level level, va_end(args); } + +/* + * Upstream code actually recognizes the first two characters to identify a + * language. We do so to provide API compatibility with setlocale. + */ +int +libusb_setlocale(const char *locale) +{ + size_t idx; + const char *lang; + + if (locale == NULL || strlen(locale) < 2 || + (locale[2] != '\0' && strchr("-_.", locale[2]) == NULL)) + return (LIBUSB_ERROR_INVALID_PARAM); + + for (idx = 0; idx < nitems(libusb_language_ctx); ++idx) { + lang = libusb_language_ctx[idx].lang_name; + if (tolower(locale[0]) == lang[0] && + tolower(locale[1]) == lang[1]) { + default_language_context = &libusb_language_ctx[idx]; + return (LIBUSB_SUCCESS); + } + } + + return (LIBUSB_ERROR_INVALID_PARAM); +} diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index 9ad08edf075b..eced364ef857 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -139,6 +139,12 @@ struct libusb_device { struct libusb20_device *os_priv; }; +struct libusb_language_context { + const char *lang_name; + /* All error Plus 1 UNKNOWN */ + const char *err_strs[LIBUSB_ERROR_COUNT + 1]; +}; + extern struct libusb_context *usbi_default_context; void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events); From nobody Fri Jul 11 12:12:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdrFT1Sk3z61Fwf; Fri, 11 Jul 2025 12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdrFT0jc2z3x1K; Fri, 11 Jul 2025 12: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=1752235965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m9Jb+PfqH9mBma+0HBNnChdp0zzLtdowDlA/B0lWdiU=; b=LBJWYs5etcOPE8xB1q9QiP22Zp4xVNwsS29jwBPFTNu7uV6Ce3Fc7HinLws//tJT8Aza/2 2ZSQMoASQDyx1KFt9IMud62gJKj6qxVPRZlY+sLDA92YVMEYjGntLZkDlD4elmnktIIr0y ddN0Ru6lTH6Ar8EOr8Hk2qYXcFpFaM2e8wjqRdV+JfVtandjuPpl+jCPkm/wF5XloAu/6C SPQkQz8XF7FPCrkHmk3+EEpi1eeGP/WAVZ9HZEAt4crcCf+cHqpsqZtQCuHYETBASGc7jL /sZ11Ohz2mAslKkFb9uCJiNzJeUc0DKtLgf0UP9gKcey8SXp7bG6PvIbA1GDTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752235965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m9Jb+PfqH9mBma+0HBNnChdp0zzLtdowDlA/B0lWdiU=; b=E42X40P/GKooxPffEyEXNy2+vgn7szuYQHUS9BopgCjLO0oUa1GdgRwyO4UhUavNP25dUj nrFDVegsOE4H+H1tKgx4T/Z6r2bwwPme5xvZj3OA3ohppVuq6GUmcs66nXvw4ZjBSa60fi G+1bwYejaRUPJpGnK54GC7oGzRPaQmqjSIoOh8eDOtJ4EASVNCuFowCeTVphkDtPS9fQ0B PXE3RA5/VE933UYpKR26x6JqDIoSwmCGJB2Vo7gNS2vGSh6Djo+qWFiKnWWPEi9Sz0Sjf1 S3h0t+UCWjhw+ZU5PC3J99PjcJjjBlT9lVfPkXJ/JxprR7J1VmhEOQ77bb9ypg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752235965; a=rsa-sha256; cv=none; b=KdKqGm4+1loeKf/ofVG8BUImz/wR+1j6VJtwv/vapwJSdJeF8NOpTh4tPVu2JX8SwioNL7 t0DQjmMr1raSWnRaqJNetuTH0dVJB2luuu1oys2+55eFZaJKL8CHx2NDoJc68YTBb1/+m7 tlgbOoQYEB6xneMBUqs9PEyDrdL3rHN5DRoyT7y91M7dGyp/Ef4Una4S7B9Cckid/c9nto Fc8PzjJX350Y4I79KragqO9R7HYoIqTT+bspBFYpm3HkuXwEAdvbPJIFHZq/9RTVQnjx91 Z2b1GTAInjo2cjFhffkFXsZh4kdAfVHCBC3OKeUNfjnwfEkHVOqQPFLJPvIH9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdrFT0HNLzdM8; Fri, 11 Jul 2025 12: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 56BCCiaP032359; Fri, 11 Jul 2025 12: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 56BCCiUg032356; Fri, 11 Jul 2025 12:12:44 GMT (envelope-from git) Date: Fri, 11 Jul 2025 12:12:44 GMT Message-Id: <202507111212.56BCCiUg032356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: 3d5ef2982555 - main - acpi_gpiobus: don't print error message if _AEI object doesn't exist List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d5ef29825557bddc08b1171126026b051043194 Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=3d5ef29825557bddc08b1171126026b051043194 commit 3d5ef29825557bddc08b1171126026b051043194 Author: Ahmad Khalifa AuthorDate: 2025-07-11 12:08:54 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-11 12:10:00 +0000 acpi_gpiobus: don't print error message if _AEI object doesn't exist GPIO controllers aren't required to have an _AEI object. Reviewed by: wulf Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51236 --- sys/dev/gpio/acpi_gpiobus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index f9468e0deda0..94f4e5771266 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -357,7 +357,7 @@ acpi_gpiobus_attach(device_t dev) status = AcpiWalkResources(handle, "_AEI", acpi_gpiobus_enumerate_aei, &ctx); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) device_printf(dev, "Failed to enumerate AEI resources\n"); return (0); From nobody Fri Jul 11 14:58:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdvwH4hkCz61RDp; Fri, 11 Jul 2025 14:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdvwH42Syz3rLp; Fri, 11 Jul 2025 14:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752245887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+rfdcPONd7EnVl7+vKGUDJSN065+C2XdCzD0+nca6iA=; b=cD+OVlRbusKk7mSeVebmdMM3VS2Dfzm0jvAupDRjmrK4n171OZcpF/7ydIM25spBfpaL0T W33uQrDmLCOqVDtAJdk/H2VipdDPRtkRK2dktXmK6ej4Pv2GJssBKiR82pJBw8TIezeOeY Z/74jlEb2egiWWOto0VvYbRelwMOEsNBsAUTnvajxC4BmCZS13COU+eQX14nE7FKzersAK uQgUKWtG4OQc5YoqeH/RuJkGykF1elwkPS5Q6YPCod6EkHzihaqZRgKIhmg6nTJnnCD3Vy vcF8QU2nRRd1IKQy20hvXKJ///ilV7IlMwbsYjJp/BdHDjsYFrvq15PDY6UOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752245887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+rfdcPONd7EnVl7+vKGUDJSN065+C2XdCzD0+nca6iA=; b=eIZk+J2ByXS4gfVSvt8KZCch/K5qVh6uXDlYIJBjFfBcCDoYi+qIYmJ83mbS724EW2H6Gr VD44GR4yz+QSR/CBdONuwX3c2ODJTMB1XgtqesHqXRJ5jDFvPx59Un7Gk3cmAJFpiICY6K Id6Dbr7H0AmZEwfs2rcJKctgnYyV/8mk7+x61rS66wbayy1CmzB3DvWEhgoekPwdDk9STq xsgOyRMe30fkqpfQcr6tGdHH7RtEr+bbC1ItsF4VZStdzTHV+Xtxmc0wJLSncByBm0LX20 MUfGi5+wBknxw2siFMhY7ybNVz39TbO/c2bbAPfVF3MIC7q9j0U97S7XXTOHmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752245887; a=rsa-sha256; cv=none; b=fjQHzPki/qW6kVRyayM4ieN5Dq6VEQt4/GLH7a/3CYXbOoXOygrBhTzve3NXwq3vFQOHTm iF8RL60SaQvtWe2ZIRmSiPa8Bxgl9H8at5rgDJC7uqqeSNd2/E5lf7CpJ42m04Xz7IuNAn lBvDasaF0AQVJ4B7KaKW+g8jPF+VMSuQIsmGJW4lewQs6KNiGxs056hPnBG7E++kLD/30p gFJdZEEM4MlfbCjOsWSRnIf3WzGySTA37ZIH1TQ/Ar8aRFSZV69+NnlHDxjAILNOnZMJ0b ltO9RXQJ1yukB0jPaLTgwEfqcYHsuSt6Alara4DwtuB/g4lLnIR0gxP4tJ8Wug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdvwH3KyfzjD2; Fri, 11 Jul 2025 14:58: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 56BEw7gV031870; Fri, 11 Jul 2025 14:58:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BEw7gx031867; Fri, 11 Jul 2025 14:58:07 GMT (envelope-from git) Date: Fri, 11 Jul 2025 14:58:07 GMT Message-Id: <202507111458.56BEw7gx031867@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: 55a25c753100 - main - hwt(4): fix spelling. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 55a25c753100fe7085f6fd7832f0c219ee001a2e Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=55a25c753100fe7085f6fd7832f0c219ee001a2e commit 55a25c753100fe7085f6fd7832f0c219ee001a2e Author: Ruslan Bukin AuthorDate: 2025-07-11 14:52:06 +0000 Commit: Ruslan Bukin CommitDate: 2025-07-11 14:52:06 +0000 hwt(4): fix spelling. Pointed out by: maxim Sponsored by: UKRI --- share/man/man4/hwt.4 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 index 7bc8ed4b396d..df02a4672f36 100644 --- a/share/man/man4/hwt.4 +++ b/share/man/man4/hwt.4 @@ -73,7 +73,7 @@ request it accepts is This request allocates kernel tracing context (CTX) based on requested mode of operation, set of CPUs and/or pid. .Pp -Upon successfull CTX allocation, the ioctl returns a CTX identification +Upon successful CTX allocation, the ioctl returns a CTX identification number (ident). .Pp Each CTX is then managed using its own dedicated character device found at @@ -104,7 +104,8 @@ operation: Enable kernel hooks. .El .Sh IOCTL INTERFACE -Once a CTX is allocated, it's management character device accepts several IOC +Once a CTX is allocated, its management character device accepts several +.Xr ioctl 2 requests: .Bl -tag -width "HWT_IOC_RECORD_GET" .It Dv HWT_IOC_START @@ -122,11 +123,11 @@ with this CTX to userspace. .It Dv HWT_IOC_BUFPTR_GET Get current pointer in buffer that is filled by tracing units in real-time. .It Dv HWT_IOC_SET_CONFIG -Set achitecture-specific config (optional). +Set architecture-specific config (optional). .It Dv HWT_IOC_WAKEUP Wake up a thread that has been put to sleep by HWT framework hooks. .It Dv HWT_IOC_SVC_BUF -For SPE-only, the kernel is waiting for userspace to notify that it's copied +For SPE-only, the kernel is waiting for userspace to notify that it has copied out a buffer to avoid data loss/overwriting buffers. .El .Sh SEE ALSO From nobody Fri Jul 11 15:16:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdwKC12zTz61S7w; Fri, 11 Jul 2025 15:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdwKC0PZyz3x0h; Fri, 11 Jul 2025 15:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752246975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRMh/qiBA0KBWiUDMWfk0FW4k4X71CeYovkNwGhSZVE=; b=i2v30zs40q0LrBUS4aHGvNJiVDhwopI5ZKXalncshF0AuNZb4m/GQLt3pRhdUgmikuH4zs rVQv59yGZLFg3SFVZvB1OvahrSbFvz5rj/tZPiPLQg2auQVOup2bl164TFygPLylzBKqXO GlAuc2QamT6PzmMzC5OPlnvZxk+qJMDh4z986v6kbU3KvXyjdG0gCGmzsykPZ/jEjFCVY8 SfEIcIoapXsb2r5KR4bvlFtZWgILbQSQHj6Yf080zaO4VxmEEzfp3ICtFF+HhZkEfn5Bon qT1A400da040hraFjLY1acMQAgHWsAdzS2qArbxmeEz4+o6tB4xVEc3rX+3Vzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752246975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRMh/qiBA0KBWiUDMWfk0FW4k4X71CeYovkNwGhSZVE=; b=Hqb7wfLvVSPtSYAA+DizqWAq3InWx+rsds82boIGmMufg/GIV/a62Mxrd/Wod/u3pOIYDu fxnkOVS+mI7ipDfOtD++wIBPLEwXVP/0WwpSE8EvQL1+JO0Gatoha56jh5I6ll5nfk4b++ P2wtNWLU0AxYiP9G3GJ6BEIc1d008kAnmn/pjetw4Rjb6lkYm/xqpaKt56Vay6M4zwmeWD 5Yy/QA0hBSWw/TuKv1NK7qbDSkbbtSowrxJqbst1JwbP7RhHRkzVTSmKHadSlapQ0r9out VIV7wp5eqinyNli7Mgv2TSQXDwZuTEm2KjomtyVeuoAcTX5zJm36tdreCZov4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752246975; a=rsa-sha256; cv=none; b=Jn9jQKTRQK5acyhsDjxLy/K5w66DANyuEQZhM9krr9+b6tyMmkVZPs+h8xoMvzmLpK2O6i duCWUBHzLYx1dhfaP2vsXfTUAjoYSW2B+rNU7NWvtkNVr4V9ctUUe3L5cTILolbk8hW8Ag U4TaydtPuIAQc+HktubZ3Lu7mHNM5UdV2iHksK02BcJte4H+0yxXCqSdRpF8+QSUEx2RyY aQfglld2TNpbPzHKzVGlg4j/zAHPAUf5CpHwmUiNkXijMQkSKFzMTGXh2NhKSkxqT8q3Z8 lFrn/aQ61hyLy2BpMJ3CY7fP9kTR7MHkDj+scRumeAVTKWbI2ftL5dtUEzIrMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bdwKB73Qtzjn6; Fri, 11 Jul 2025 15:16: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 56BFGEj2068999; Fri, 11 Jul 2025 15:16:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BFGEcc068996; Fri, 11 Jul 2025 15:16:14 GMT (envelope-from git) Date: Fri, 11 Jul 2025 15:16:14 GMT Message-Id: <202507111516.56BFGEcc068996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 5652050565f7 - main - gstat.8: Add an example of how to filter the results List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5652050565f7595651b33f7e1480b4d717a8a055 Auto-Submitted: auto-generated The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=5652050565f7595651b33f7e1480b4d717a8a055 commit 5652050565f7595651b33f7e1480b4d717a8a055 Author: Brad Davis AuthorDate: 2025-07-11 15:10:56 +0000 Commit: Brad Davis CommitDate: 2025-07-11 15:10:56 +0000 gstat.8: Add an example of how to filter the results Reviewed by: bcr --- usr.sbin/gstat/gstat.8 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8 index 02dbbbc54a3d..2975a93c7fef 100644 --- a/usr.sbin/gstat/gstat.8 +++ b/usr.sbin/gstat/gstat.8 @@ -122,6 +122,9 @@ Quit .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +To filter the output to only physical disks named ada0 through ada4: +.Dl # gstat -f ada0[0-4]$ .Sh SEE ALSO .Xr systat 1 , .Xr geom 4 , From nobody Fri Jul 11 15:46:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdx0C1yYtz61V57; Fri, 11 Jul 2025 15:46:35 +0000 (UTC) (envelope-from jhb@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdx0C1CgSz46kW; Fri, 11 Jul 2025 15:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752248795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=deKf8oDjcb48Z1eZAG0AoOOKowfI2Y3wFaR6Ohf8sWw=; b=NcqH8hgbRblGKL+m9yl8nPRM8RygeWqeFTAwOrXUyrLk1lk0a6zckPNPBvjx9KnLfZ22dy 7XfcNxVCdtKQO8f+rHV4+ps7Iw29NVoC55Be7WrCi5SX0lpGCHYhA8ngiebdbeYRFy0Uzh mRLUkCDG7JX1QpdqoRJP8vRVeTXxiOAkVLzU+Uq7AcgUvt/6DIWP0xUv+Kj5lBbtJZcjaP co++i/4UfVLUn7HH5VDaXReQClPxvBEN6EuTf/FwSQGkiAis5YU4MNr2cGSlRyFaWBm4pI 2TtazO9oJst6k6WaQAmQeI3WYHmKg1SzIyhftWtm1luMp2JZbdoyenFJGUPXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752248795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=deKf8oDjcb48Z1eZAG0AoOOKowfI2Y3wFaR6Ohf8sWw=; b=jrxLpwM3eHsyulWVXH32DTCIOk4tDvsPmeZr9Cek+fN0AzD+UrMmgD+HGIYlJ7UsCuhTOO s/AJa0c3g91K5D1+fmNocsfLlBBW6nLJAfUFB2tjWi47RQlCJ6qYTYB4dJo2xPkLhwLo6V g6o1j4fMIkcZK+CUP7qaYOeuaZpNDWB9eDfMLE56DQCCPFwXo1vJVsW5zsgH+UBoCqIHKA DEI9b85BZNlu5Gog63EIP1Ip9zzvp27fdrTxnn8/iOq0YxQgIoXgO2VtsvVE3SnU2AsM8w /WPvK5B0DBgXnO8mbKVOrQpotAeaCRUZ4X05KvEC9yVbVy0/739d04VIklwu5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752248795; a=rsa-sha256; cv=none; b=d2iFMdTU8JQBCyn/4mxgExX7HZWP9Jr7BPELphqdTot2OocJRbTxxXiXE2QwEW2YAz+ALA NgX7+0zfe5sHyWjLd3gYXKCw+FJfuMcVkBDdq1I3yNaBrZhufM/7rtAe/OEUa+rc8kQHtE o4cn1CKNSWsutZJoG8euKJrM9kpaTO+WHzQAafUDBcLURz3Rw60TrqSmqdZ135emlOX3Nu oWckFw5FeEG9o0Hx1TT73g8apyaL9wW4qKHb3+tVsvZjMg8IiIFL44SU6Y2fQ7zB4ZZNA/ FNmcpEEWg03GiErHmsr4g5E7Zsi3aIHqsdMul64cYig25PQIRnpaE7Sm4pusJw== Received: from [IPV6:2601:5c0:4200:b830:55b6:3b49:2cd9:9d38] (unknown [IPv6:2601:5c0:4200:b830:55b6:3b49:2cd9:9d38]) (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 4bdx0B4XMDz7Lv; Fri, 11 Jul 2025 15:46:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 11 Jul 2025 11:46:33 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507082149.568LnGOU086303@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507082149.568LnGOU086303@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/8/25 17:49, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 > Author: Konstantin Belousov > AuthorDate: 2025-07-08 16:30:29 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-08 21:48:59 +0000 > > kern_descrip.c: provide helpers to translate between fd flags namespace > > Reviewed by: markj > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51206 > --- > sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 90 insertions(+), 20 deletions(-) > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 406236fc2723..2e1da2fdee29 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) > return (error); > } > > +struct flags_trans_elem { > + u_int f; > + u_int t; > +}; > + > +static u_int > +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) > +{ > + u_int res; > + int i; > + > + res = 0; > + for (i = 0; i < nitems; i++) { > + if ((from_flags & ftes[i].f) != 0) > + res |= ftes[i].t; > + } > + return (res); > +} > + > +static uint8_t > +fd_to_fde_flags(int fd_flags) > +{ > + static const struct flags_trans_elem fd_to_fde_flags_s[] = { > + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, > + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > + }; > + > + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), > + fd_flags)); > +} > + > +static int > +fde_to_fd_flags(uint8_t fde_flags) > +{ > + static const struct flags_trans_elem fde_to_fd_flags_s[] = { > + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, > + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, > + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, > + }; > + > + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), > + fde_flags)); > +} > + > +static uint8_t > +fddup_to_fde_flags(int fddup_flags) > +{ > + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { > + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, > + }; > + > + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), > + fddup_flags)); > +} > + > +static uint8_t > +close_range_to_fde_flags(int close_range_flags) > +{ > + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { > + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, > + }; > + > + return (flags_trans(close_range_to_fde_flags_s, > + nitems(close_range_to_fde_flags_s), close_range_flags)); > +} > + > +static uint8_t > +open_to_fde_flags(int open_flags, bool sticky_orb) > +{ > + static const struct flags_trans_elem open_to_fde_flags_s[] = { > + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = O_CLOFORK, .t = UF_FOCLOSE }, > + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > + }; > + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); This broke the GCC builds it seems. GCC doesn't think that it can compute this expression at compile time. From https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function 'open_to_fde_flags': 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: expression in static = 10:32:02 assertion is not constant 10:32:02 560 | _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags= 10:32:02 _s) - 1].f =3D=3D -- John Baldwin From nobody Fri Jul 11 19:00:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bf1J62gd1z61h8h; Fri, 11 Jul 2025 19:00:38 +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 4bf1J55RgJz3Lq6; Fri, 11 Jul 2025 19:00:37 +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 56BJ0JoC085729; Fri, 11 Jul 2025 22:00:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56BJ0JoC085729 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56BJ0I0v085728; Fri, 11 Jul 2025 22:00:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Jul 2025 22:00:18 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Message-ID: References: <202507082149.568LnGOU086303@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-Rspamd-Queue-Id: 4bf1J55RgJz3Lq6 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] On Fri, Jul 11, 2025 at 11:46:33AM -0400, John Baldwin wrote: > On 7/8/25 17:49, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > > > commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > Author: Konstantin Belousov > > AuthorDate: 2025-07-08 16:30:29 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-08 21:48:59 +0000 > > > > kern_descrip.c: provide helpers to translate between fd flags namespace > > Reviewed by: markj > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51206 > > --- > > sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 90 insertions(+), 20 deletions(-) > > > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > > index 406236fc2723..2e1da2fdee29 100644 > > --- a/sys/kern/kern_descrip.c > > +++ b/sys/kern/kern_descrip.c > > @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) > > return (error); > > } > > +struct flags_trans_elem { > > + u_int f; > > + u_int t; > > +}; > > + > > +static u_int > > +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) > > +{ > > + u_int res; > > + int i; > > + > > + res = 0; > > + for (i = 0; i < nitems; i++) { > > + if ((from_flags & ftes[i].f) != 0) > > + res |= ftes[i].t; > > + } > > + return (res); > > +} > > + > > +static uint8_t > > +fd_to_fde_flags(int fd_flags) > > +{ > > + static const struct flags_trans_elem fd_to_fde_flags_s[] = { > > + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, > > + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > > + }; > > + > > + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), > > + fd_flags)); > > +} > > + > > +static int > > +fde_to_fd_flags(uint8_t fde_flags) > > +{ > > + static const struct flags_trans_elem fde_to_fd_flags_s[] = { > > + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, > > + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, > > + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, > > + }; > > + > > + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), > > + fde_flags)); > > +} > > + > > +static uint8_t > > +fddup_to_fde_flags(int fddup_flags) > > +{ > > + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { > > + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, > > + }; > > + > > + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), > > + fddup_flags)); > > +} > > + > > +static uint8_t > > +close_range_to_fde_flags(int close_range_flags) > > +{ > > + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { > > + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, > > + }; > > + > > + return (flags_trans(close_range_to_fde_flags_s, > > + nitems(close_range_to_fde_flags_s), close_range_flags)); > > +} > > + > > +static uint8_t > > +open_to_fde_flags(int open_flags, bool sticky_orb) > > +{ > > + static const struct flags_trans_elem open_to_fde_flags_s[] = { > > + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = O_CLOFORK, .t = UF_FOCLOSE }, > > + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > > + }; > > + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > > + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > > This broke the GCC builds it seems. GCC doesn't think that it can compute this > expression at compile time. > > From https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: > > 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function 'open_to_fde_flags': > 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: expression in static = > 10:32:02 assertion is not constant > 10:32:02 560 | _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags= > 10:32:02 _s) - 1].f =3D=3D > I am unable to propose anything better than the patch below. We have enough #ifdef __clang__ in non-contrib sources already, so this should be not a huge crime? % rg -g '!contrib/*' __clang__ | wc -l 171 commit 96e6b15b0a1407af45ebe1ad38ee53627d09d16b Author: Konstantin Belousov Date: Fri Jul 11 21:57:32 2025 +0300 kern_descrip.c: only allow complex expression in Static_assert() for clang gcc cannot compute the assert expression. Reported by: jhb diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 93bdd41d1515..c4f5e586b0ed 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) { .f = O_CLOFORK, .t = UF_FOCLOSE }, { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, }; +#ifdef __clang__ _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); +#endif return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - (sticky_orb ? 0 : 1), open_flags)); From nobody Fri Jul 11 19:06:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bf1Rf2smCz61hdm for ; Fri, 11 Jul 2025 19:07:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-20.consmr.mail.gq1.yahoo.com (sonic314-20.consmr.mail.gq1.yahoo.com [98.137.69.83]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4bf1Rf0QsQz3PXx for ; Fri, 11 Jul 2025 19:07:09 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b="VY4/dbc2"; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.83 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1752260823; bh=wOi8/F5mOAcj4osliJMJjuWyxOjGe9un+1n+X74GPI0=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=VY4/dbc2ZQ28EL+YW86Df+DmT3y1aaAyZTbHaFh7gWA5767rTuzrNzYBGsLGyCy7Ge66cjGzAg6sQPNda1ds3b/LC06oLNuv7hCrLXRKm90qG8a0kwsYDYsoRkpwmD6s+itsNsXaul18sAg97MUdKzTSiTdZNtwYyckjN4G8y4HVbMJCmdtrYdhavQ5Ib2LCvu/pixlzh64y/Adcey8tLQNddEI2MeHpmxzK+KOfD6e4pti/ZyKx5/73MSzKcuYC0noQUeQyETpIuleCAqleIkBAGKRS1RLflDVblPFE2FxSo9ArOWtvyhAvqpXr43QQM1lK2rR+dd9HiR28awl/LA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1752260823; bh=o13ingWVjhdNOxdTZE9eegumWZyedwksOWJ2TPfxI7F=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=TeyCswhuUq4UTu6dwQ17kE6zvVBdAfdNWkETp9VYcxwBuTzHZgjxX71B4dtkielbyOC/Dj/0kNKW0vBe+96q24c9yRhwkspPoAqpkZEy4l1XVkeaJ09PA7XFnt8GAqIGfe0PGw/aoQ6vKSdd4oXif2RjLOT9KsHwccL1YeLWKQo2wdYQgicfMvBtbWFM5574o4ozewnm+SsjR4IKNZMt8LVN/OwIjfl0AFaYE4CH+OLwp7EYYEtl2zDQnhH1u67IrPE2/ylbXwJ8jFHot+iNmYO6+29ysflZDvR15DipXWWtLPTz9x5NgSzT2mmGJj7fVteRj2iMQpZJYnz8DzjwOQ== X-YMail-OSG: qf.XsA8VM1n6z2qFX5oOdDfKnbzKX6CJePq73J_6RSziRzOhkvEwNEjB6KxfuoE ph6T3OEk.QhpmzjD0gesG9Dpb1pWENgn7fsJjeksjNMUzGn9krrhHxZy7zHr3v1VlB2VlA3sa8jH q9gjh2B3iRTzbqq944Kfrs3.fV4pRy1wljdk5IQrc0strDQYuASnGr0kzPJhSkV2_a_d1ja2EQ7R tq3P0s.3CUS84ihTZ2.GhbCdj7a4c65wYzyL.DXj3gaLX4tvTUyKYIoo40fhFJ1iU6pHHzsNi4Wl sYzFM6vmDwfF.xI1mIx0LLNK2Ulp5szlzBNxRK9ciBipgH_1KZ5zgfd4VsdhBgds21qBmJmWQDj8 yPV_4O6h18WjL4xC9CWRrQm_eRUfoj0NgR6bqVMbWcAEIZwybCDfHFkC3voRtyXzicU3F7GBl3sV 5j9vPWq6rdp5tXOEV83h5i4od2PrSZQm4RfutnWQOhEUFO538WsN5Ao8Ex2JetdRNeiykx.FyzFl s_iJDkyuaQvbnH3DfWIp9KSDolmUK7JJ2gjnHuwzEGKkSeXpjU0AAj80_Bh_58OZZg_Xu5s.lBVX xEiN48cId.DqAk.6vUDJHVdn6lW_X5.v_GPgn8nfS1GobY4qjtO9YhIgOOeKN1SRgEInV3ex9blU 3cBhlgVc2mQBlRrcGvP13tZ6XonaIz5bJKGKZ.BRmghsmPt35SxPzJ9wDZYhGzVYgulA4DDhvh8d x6Pqnr_5Wi7GT6WNrJQJm4jK9eyc8sgWhqFNO5dkqTNvU9hSNegOAzu20cV4WGv_mjb2Et4hnEkN ULWUgNs2h2csVFTjG0KR1RBNkU9XIWwZyrr24LV5bLbEcX24PDkuMltN1tc.v3jjfDprZlHY5oTM mCK7W3PU2viQH3hUqXrMkGplcZ99ubBqmMtjq7oRmB8YXraRxjg.60aSslQLdL_3eHTmd.Ou.07d UPpCBZrAlH2sE9GxbVnkEmSL8R5qymih9Py3gtw3dzRikf3ASZDBjjTyzJ8YQMb3RsFyjfmvKHSI yG1LqZZ3JWtQ4LJdDTUdI4j.txKlHAHURGuEpQ0O7MPMw.8I_U8LGqY8J.aQlA8l2zMvh3p8VmcP p2_sVQVJCfp4PSB75XAeLCoUrPjbFQynfNygtL6frgGzc4KVIJCmV_i62kZY.pO.wwmiuLAJPEfr eLqtuaHUaNl1YG1ECHoF4vFonLLW98rlHumsSKkMarij_zGTP8YeRNMCAYVEm2IdmOzMCe4BvRM2 27HnoowGootdDN5Af5u.FfNVu9XPiG5E4JDQR_yb0RnTx6zpKIbkxaBe3vKydM.6kDXXKKruKTPr KuoKQBruoX9vutMT6G4lHQqC2hrCMsY7IO.Gcc08q5cjEGAHRWXzuimZMxG7krl8lLXNbQZN5msX 8CiPb1JfnaQBzHcZEqMcuz4fyTIxcJximmpXvYTcei.o_kAd3zZAMCuuuuPSYjTSL7kT2XuACSBE 25jcFuE2G8wa2AL6DjB6pO0UGg9uFNWhGdTy6TwA1ytYcJ5eLImAdN_byDyPfAZNzob0DJZQpQ_X cQvhPJIuMh9hSasJJdBvJl7o9xB2LHZn0TBhFF5ff38EuQf8kAL6mR60ZA_zeZLekmOM1jOXYEGe yt4_6NJGhAA_Dbbz.adF17_50IxfK74uYXV0Xxhav3GzBPbovkEy6baw0.B3v3SgaPqBWvJXTrUd e.Gt2t3Gzy5tciCrVJUPtecYf0vjo1OQWPxRP5wkxu_zqzfzg8mayNCwN06aOZMDzmaep2Pta7aM LNW99nMiS43AIvDlf1ZVPDHnV6XOxdiiIyFWsB8Cwyw3gyv5docHN1mWMJLoZKclRSOHODlaFGSe 1BKBEzR2vlWB4UEceE2f1HPXYfqMPgtnWPyzYM3XffvyjUfKKagFRy5PbdPX0UThLrEiuFXa_8F6 gTmrhavn4k6fGtEPvjcuxev6lPfD.1YHt7iokDzpgTG6gGgQoGgvj5EhxOaun8ciX8GAWnxkZqvd sheYHpxrfAP5XiXqYvnfHuj._kSMRaX3LL4RKhxtodDNCbX3hGAF.7TyXHL6RWGSksHDHFq2Id.g dAb4TiGmuGmQ.nI8QCOFZ26sUiAqTIh5IR9hPf6tQe1zZ4NiHCTizomea3kf2W.M9_mj9oy_rg3g uGyEXbznWD.4iGYpdsBiAtthaSsVHt6GVDk1FgbqCeR_5eV7hbW_EwDemPzQu9aFhaerdYJKj6.5 ihtcCdCNKVpdPzop2cCxkb9xTvoAs2mrVzIMp20P5und7jg-- X-Sonic-MF: X-Sonic-ID: 2b04b0f6-694a-45e5-86e9-f7f60afd6ea5 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Fri, 11 Jul 2025 19:07:03 +0000 Received: by hermes--production-gq1-74d64bb7d7-x7xzm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID adcecd013f611c9a737c1afb816e96d0; Fri, 11 Jul 2025 19:07:01 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Message-Id: <3B0EC78E-DD18-4C78-BB72-F86F2E4E2193@yahoo.com> Date: Fri, 11 Jul 2025 12:06:50 -0700 To: John Baldwin , Konstantin Belousov , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: <3B0EC78E-DD18-4C78-BB72-F86F2E4E2193.ref@yahoo.com> X-Spamd-Result: default: False [-0.58 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_SPAM_LONG(0.92)[0.917]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.01)[0.008]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[yahoo.com:+]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.83:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.83:from]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[] X-Rspamd-Queue-Id: 4bf1Rf0QsQz3PXx X-Spamd-Bar: / John Baldwin wrote on Date: Fri, 11 Jul 2025 15:46:33 UTC : > On 7/8/25 17:49, Konstantin Belousov wrote: > > The branch main has been updated by kib: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dba0d9b43e940077f4025e7e4e85d16c8= d525db79 > >=20 > > commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > Author: Konstantin Belousov > > AuthorDate: 2025-07-08 16:30:29 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-08 21:48:59 +0000 > >=20 > > kern_descrip.c: provide helpers to translate between fd flags = namespace > >=20 > > Reviewed by: markj > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51206 > > --- > > sys/kern/kern_descrip.c | 110 = +++++++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 90 insertions(+), 20 deletions(-) > >=20 > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > > index 406236fc2723..2e1da2fdee29 100644 > > --- a/sys/kern/kern_descrip.c > > +++ b/sys/kern/kern_descrip.c > > @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, = int cmd, intptr_t arg) > > return (error); > > } > . . . > > + > > +static uint8_t > > +open_to_fde_flags(int open_flags, bool sticky_orb) > > +{ > > + static const struct flags_trans_elem open_to_fde_flags_s[] =3D { > > + { .f =3D O_CLOEXEC, .t =3D UF_EXCLOSE }, > > + { .f =3D O_CLOFORK, .t =3D UF_FOCLOSE }, > > + { .f =3D O_RESOLVE_BENEATH, .t =3D UF_RESOLVE_BENEATH }, > > + }; > > + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - = 1].f =3D=3D > > + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for = sticky_orb"); >=20 > This broke the GCC builds it seems. GCC doesn't think that it can = compute this > expression at compile time. >=20 > =46rom = https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: >=20 > 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function = 'open_to_fde_flags': > 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: = expression in static =3D > 10:32:02 assertion is not constant > 10:32:02 560 | = _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags=3D > 10:32:02 _s) - 1].f =3D3D=3D3D In trying to figure this out, what I ran into was . . . QUOTE from: 6.6 Constant expressions (N3220 working draft) . . . The array-subscript [] and member-access -> operator, the address & and indirection * unary operators, and pointer casts may be used in the creation of an address constant, but the value of an object shall not be accessed by use of these operators. 119) . . . 119) Named constants or compound literal constants with arithmetic type, including names of constexpr objects, are valid in offset computations such as array subscripts or in points casts, as long as the expressions in which they occur form integer constant expressions. In contrast, names of other objects, even if const-qualified and with static storage duration, are not valid. END QUOTE It looks to me like gcc is avoiding allowing use of an extension to what the language definition provides as guarantees for what is a valid integer constant expression. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Fri Jul 11 20:43:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bf3bC6dgJz60p0T; Fri, 11 Jul 2025 20:43: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bf3bC5rmRz3J95; Fri, 11 Jul 2025 20:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752266631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXVVKRi4nyclW9Tn3jlQHVr8R8iTOL4s2s7IhzC7Jx0=; b=RMTMFKUdBqzTeuzkFqHWMEgAHyhE2pJpNOEQz4ciMqOXOHDq72UkCwOvcqvzRWU3VYl7fG d8s1YjUOQsIo+96F2SuO7KV79wgRoOdba/e5YYz/2lQaIhU68KArSLTwmbRMi4nlt6Z9K2 HCC5bGdGESBCh/SilK+fjjzr8qqtbMl2GsOMMCDLzO3nr+0rbP17NMAQ9SIruZI8qzMj+n W4Si9BQvOa6rcuvX4LiNZRclQxSi5iGOER2G353osf2Pm8XsVwsTTxWossEsfn5LW6tYuL mku4JAM3Ni6zlYHpNhuJpaa/ov8Dehg1Mn6PVMXtFxShzNmGNLGUZyRwnO1fdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752266631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXVVKRi4nyclW9Tn3jlQHVr8R8iTOL4s2s7IhzC7Jx0=; b=i5jaw1VYH/kytKK40EE+ZLA+ZrSsVTIpxPnnOl9NuxzLoULf+iOlTN0Hx9cjcppt39GMR3 5vEvgQFg5M4ikBJUlfL6hIQ3MqH7WWZfX2blTK3nfXYHxYKQy9mkSCmYcX52r/+cODV6MB nE7yOku3bTtdTN2yM6Ky6/c8l97wwhpgBKulOPLAnRv4hblMBe1hvv8FRLKg9eNOlZHUCB pyxosmANE3+/znHPcHuqeustHzU7aP08UvLdM9HqoOy+AmCe7HBjR/9juVT/WDRc79dmWd BotHzdIhoAVSJ/n7uVJNarE2CSXGQsmVTfbExMJWfvRCFNuK/vtkaqM8atIsCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752266631; a=rsa-sha256; cv=none; b=XmD3NXFO5X0UV6OPVlF5cQR8G5gt8BAdeoO3Gc30rn9U1v6gjeYxl1zD5C7Ls6bC9/YPQw QaDwd0Ve9E39H0hqhXwK0MyCyGCdcIsaOCpAofaNnbCYv1Qpmzk4uvOd/oXyDUq9kU+3Y/ xedX7lhhU1XAiceqMx784yNiTVGfIejtRQHzPj4R0wl0RBZttrnQyxesftVGSpdvnNkbXk QZTf4gMjlJDNcaUAWL3alV9noosEZG6frYLuG8Khf5uMNoI3q9eMYNbujYHLoR/tqphB9D aNQBOOjUWvqOiTU0ntdUJmsAaz0YmXSFzrMNCdbhC77tLaFKo+WwaKEqWBlvUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bf3bC5HNLztJ8; Fri, 11 Jul 2025 20:43: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 56BKhpW2086933; Fri, 11 Jul 2025 20:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BKhpGc086930; Fri, 11 Jul 2025 20:43:51 GMT (envelope-from git) Date: Fri, 11 Jul 2025 20:43:51 GMT Message-Id: <202507112043.56BKhpGc086930@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: 920b2183919e - main - readdir: Fix error check. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 920b2183919e430cf85c4aa1fa337bfded12aee5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=920b2183919e430cf85c4aa1fa337bfded12aee5 commit 920b2183919e430cf85c4aa1fa337bfded12aee5 Author: Dag-Erling Smรธrgrav AuthorDate: 2025-07-11 20:43:20 +0000 Commit: Dag-Erling Smรธrgrav CommitDate: 2025-07-11 20:43:32 +0000 readdir: Fix error check. Now that dd_size is unsigned, we need to check if the return value from getdirentries() was negative before assigning it to dd_size. While here, simplify the scandir_error test case slightly, and verify that calling readdir() again after EOF still returns NULL. Fixes: 42e613018da5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51266 --- lib/libc/gen/readdir.c | 7 +++++-- lib/libc/tests/gen/opendir_test.c | 1 + lib/libc/tests/gen/scandir_test.c | 12 +++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 32603c0b4677..b70102954df1 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -50,6 +50,7 @@ _readdir_unlocked(DIR *dirp, int flags) struct dirent *dp; off_t initial_seek; size_t initial_loc = 0; + ssize_t ret; for (;;) { if (dirp->dd_loc >= dirp->dd_size) { @@ -61,11 +62,13 @@ _readdir_unlocked(DIR *dirp, int flags) } if (dirp->dd_loc == 0 && !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { + dirp->dd_size = 0; initial_seek = dirp->dd_seek; - dirp->dd_size = _getdirentries(dirp->dd_fd, + ret = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size <= 0) + if (ret <= 0) return (NULL); + dirp->dd_size = (size_t)ret; _fixtelldir(dirp, initial_seek, initial_loc); } dirp->dd_flags &= ~__DTF_SKIPREAD; diff --git a/lib/libc/tests/gen/opendir_test.c b/lib/libc/tests/gen/opendir_test.c index 89be2becc607..b7481255654f 100644 --- a/lib/libc/tests/gen/opendir_test.c +++ b/lib/libc/tests/gen/opendir_test.c @@ -46,6 +46,7 @@ opendir_check(const struct atf_tc *tc, DIR *dirp) ATF_CHECK_STREQ("subdir", ent->d_name); ATF_CHECK_EQ(DT_DIR, ent->d_type); ATF_CHECK(readdir(dirp) == NULL); + ATF_CHECK(readdir(dirp) == NULL); } ATF_TC(opendir_ok); diff --git a/lib/libc/tests/gen/scandir_test.c b/lib/libc/tests/gen/scandir_test.c index f7b52b5e3616..afd25bf7c0b2 100644 --- a/lib/libc/tests/gen/scandir_test.c +++ b/lib/libc/tests/gen/scandir_test.c @@ -157,7 +157,7 @@ ATF_TC_BODY(scandir_error, tc) { char path[16]; struct dirent **namelist = NULL; - int fd, i, ret; + int fd, i; ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); for (i = 0; i < 1024; i++) { @@ -170,9 +170,8 @@ ATF_TC_BODY(scandir_error, tc) scandir_error_count = 0; scandir_error_fd = fd; scandir_error_select_return = 0; - ret = fdscandir(fd, &namelist, scandir_error_select, NULL); - ATF_CHECK_EQ(-1, ret); - ATF_CHECK_ERRNO(EBADF, ret < 0); + ATF_CHECK_ERRNO(EBADF, + fdscandir(fd, &namelist, scandir_error_select, NULL) < 0); ATF_CHECK_EQ(NULL, namelist); /* second pass, select everything */ @@ -180,9 +179,8 @@ ATF_TC_BODY(scandir_error, tc) scandir_error_count = 0; scandir_error_fd = fd; scandir_error_select_return = 1; - ret = fdscandir(fd, &namelist, scandir_error_select, NULL); - ATF_CHECK_EQ(-1, ret); - ATF_CHECK_ERRNO(EBADF, ret < 0); + ATF_CHECK_ERRNO(EBADF, + fdscandir(fd, &namelist, scandir_error_select, NULL) < 0); ATF_CHECK_EQ(NULL, namelist); } From nobody Fri Jul 11 23:55:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bf7rf1p36z611mY; Fri, 11 Jul 2025 23:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bf7rf0xPjz3shm; Fri, 11 Jul 2025 23:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752278146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r3dZWFGx50liWaEjz4EGdjXPLN8Ew9It7UGeN20oV+A=; b=I1et8Y0tLqSOjNoiht35AudbfyzvBE6fFHGgI2FxdFuzvC/Nc+kOYcbUm9dhUPmx1GStw2 LLiaDL7tt48FnUjXlpfL1LEpcIFVYJM5PbYDnfDcl+/Qih/w46obNQ5teChpCZJUpRvGoj I0T9O+348vV2ovggS+zfYq3CK5J4+Fq99YM9qn0f2puh1mcxs++ABeQPYKXDxoyixtYfcI MogSC/IaRx089JJn1lKxd9VeM9ducP/uiv+AIq5DIDJvcujw/0O7+oMqFM7U/Yqq8DqWhc p//ej8fMUuxOh1CVVb1AgRF4xozYRF42mG2ib87HPrxD2CMj17hd8fKAJH54UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752278146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r3dZWFGx50liWaEjz4EGdjXPLN8Ew9It7UGeN20oV+A=; b=mxZDJnpCbL64QFfdqgciqidGqLbP99X0INitnis+vGhXh4QTZkat8oUUPdwd2u/DccpTRi x3BtSu9BypQc26xKZrRYMMV+cX/l5NWLhWC+lJnqtb9ebQtAuOjbs8Kgbuyl7G7cEDUM8u JFPtHHkW39rV0QkTDCiIWGxlWR3GBmcb9QxfYnOCGysFn6GAz9t9LDYz45Hol8xi56KQEZ YtBYKFJseTEu3dY/z1LTAgAN71QFIxOzXcaNDMYWUmecsZu6DqKECsFurQbgPaHfq/Uou/ 6RWneUWEE+ks0ZiFRF/0RxZQd5vIp6HqHGvnNxmJGz8+iRu5SRVJrsUZ2YrIhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752278146; a=rsa-sha256; cv=none; b=rayDYGLqR865LfoT+ghJcVe/Vzud3z355K0Ux1krNoLC+T12mMOfgUcNYpb57qceoAmGrA u6Np8kvXeyr7111JhtBrfS4aTNlEvWt7TQGEQEWJ0vRBxrqtO5Y0pSaNfSFDgC7p2k5IlY GYhi8KOk7Z/bC7P+m0q2vYCyeEjzEGbeKcGVfwI817MSYaMm4yapvlTBI+FQDrDI6+E8SN +ezYt9jlFYNZ60/2lyhF5JXJzvyIKiC2BbhNKP/WUAVxUBG5Qkad4Sw6G6WTYHxlb7piBz eMCh0ZvhKTaCCAbpiCFrEpEOTs415gTEi9sSIcAtKn5RuJSTEoL+4A2eLijDuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bf7rf02nwzyhN; Fri, 11 Jul 2025 23:55: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 56BNtjkd044769; Fri, 11 Jul 2025 23:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BNtjLF044766; Fri, 11 Jul 2025 23:55:45 GMT (envelope-from git) Date: Fri, 11 Jul 2025 23:55:45 GMT Message-Id: <202507112355.56BNtjLF044766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Koichiro Iwao Subject: git: cca6a72d7f71 - main - ifconfig.8: remove accept_rev_ethip_ver and send_rev_ethip_ver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: meta X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cca6a72d7f7131685a082c123aff17208aa1693f Auto-Submitted: auto-generated The branch main has been updated by meta: URL: https://cgit.FreeBSD.org/src/commit/?id=cca6a72d7f7131685a082c123aff17208aa1693f commit cca6a72d7f7131685a082c123aff17208aa1693f Author: Koichiro Iwao AuthorDate: 2025-07-11 12:06:34 +0000 Commit: Koichiro Iwao CommitDate: 2025-07-11 23:54:40 +0000 ifconfig.8: remove accept_rev_ethip_ver and send_rev_ethip_ver It is removed long ago [1] and unavailable on FreeBSD 11 and later, but the corresponding entries in the man page were not removed accordingly. [1] https://cgit.freebsd.org/src/commit/?id=b1c250ff3ff6af36e95f5cf910973133c3445704 MFH after: 3 days Reviewed by: mhorne Approved by: mhorne Differential Revision: https://reviews.freebsd.org/D51261 --- sbin/ifconfig/ifconfig.8 | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 3fb8b5f02b76..6c61af48abec 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 5, 2025 +.Dd July 11, 2025 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2878,16 +2878,6 @@ interfaces previously configured with Another name for the .Fl tunnel parameter. -.It Cm accept_rev_ethip_ver -Set a flag to accept both correct EtherIP packets and ones -with reversed version field. -Enabled by default. -This is for backward compatibility with -.Fx 6.1 , -6.2, 6.3, 7.0, and 7.1. -.It Cm -accept_rev_ethip_ver -Clear a flag -.Cm accept_rev_ethip_ver . .It Cm ignore_source Set a flag to accept encapsulated packets destined to this host independently from source address. @@ -2896,16 +2886,6 @@ from the load balancers. .It Cm -ignore_source Clear a flag .Cm ignore_source . -.It Cm send_rev_ethip_ver -Set a flag to send EtherIP packets with reversed version -field intentionally. -Disabled by default. -This is for backward compatibility with -.Fx 6.1 , -6.2, 6.3, 7.0, and 7.1. -.It Cm -send_rev_ethip_ver -Clear a flag -.Cm send_rev_ethip_ver . .El .Ss GRE Tunnel Parameters The following parameters apply to GRE tunnel interfaces, From nobody Sat Jul 12 09:36:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfNkK0QrPz61dVm; Sat, 12 Jul 2025 09:36: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfNkJ4T50z3m9T; Sat, 12 Jul 2025 09:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752312968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBJ5w/Vx5LPPKWXOA2OzRdx86AMaxKuwRFWIZlUIQD0=; b=UDUHgjVHPXEKWDBa3k//2UUpwo6tyCc8zYiZQSZ7s3Oz9ySZFF2Rb/H6r9WCl9Ejq7ztDR njEVkKPKqQQ9XfA5MyTVBb7fMouRNmX6G5G+0nV9iKcXkvO1nmi/9Kl4DK5wqWjFKVYwnL 0kfdBk+vNP+VAD6QU3/DZ9eDPEYZe1H+0E9hMCA/lxi8dpyvWj25dj6yMVPOAQdALWj0Dq WSq+i2C5G2ezi56tHY5BCqVva1mNfDQpclQlCDvqw6YGaDsxQ178Q2tnjfRUfq85TjoZ31 0swZIRuv/TXlL7Y8Xvwh6gnkf/xpfoVYWK3rYCLGUrryMDxA3cmkZwILySYNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752312968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBJ5w/Vx5LPPKWXOA2OzRdx86AMaxKuwRFWIZlUIQD0=; b=ZvFElJymGluDjKJBrQ72AHanIcEBZ9SyUFypu5xKRkWoTMrsxkcEC3RMJ8fih7CL6fGZ5h Pvdmdq4b7Kna6rTRPUjQT3hyggLlKa8MAVsbnBGASEcEdRkxWafhe9G38mfRRoH8DZ1csI 9Z7gj2p8hUUEOXBiKx4gtkqtll2MS2fIaylwqzwbfh1LRcUh9lwYLq6I/JfukdR4kdHUDw G5OB5SBeZnGByk1w9iGCqbMSP0nB01fPLL0mH7ZZf8EDN3//SHLAYX+Gqyz8Xn9SErmHkP iCP03id7m5SZ1rakoRsZcF2Vwir3mKwMcI5skuRa+l1MrrTJigsXJOKFIscuwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752312968; a=rsa-sha256; cv=none; b=x19ON7BxJnmEGjEhL5dCmtQ/KKjvyr7XKJTk94julw/G/JVnLsPFqdJZtdzVKgrn8VhGwP cge3pk3db3lt91ZBks0IXDrzjI/HmHAlG7cnvDuBW+mpCyI/oQloc4EVPRazmPJkTn0c6E g2Y2EHDRJays950lryLrPQlw2s4aaKfV5YF0fWFVm6sMdQDbcBTzdSTP6Sc33ABZkhZfFT 7CD+hvYL+LHd5NbDvl4f5eQaGIObZ5i7ov4pFg79+IXhM8hU83BXrRa7JjpF5ETODJuCs6 hEqsEupYmiYtlIEW9EORPSKwvsN/Mo9PeQ9PaajA3NYvXYQDXQzRl2rl1AuE1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfNkJ44nLz2d9; Sat, 12 Jul 2025 09:36: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 56C9a87H036682; Sat, 12 Jul 2025 09:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C9a8oH036679; Sat, 12 Jul 2025 09:36:08 GMT (envelope-from git) Date: Sat, 12 Jul 2025 09:36:08 GMT Message-Id: <202507120936.56C9a8oH036679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 98a1084001d4 - main - dtrace.1: Reference dwatch(1) and tracing(7) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98a1084001d4130e6383c186717bd381b8fda1b8 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=98a1084001d4130e6383c186717bd381b8fda1b8 commit 98a1084001d4130e6383c186717bd381b8fda1b8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 09:32:08 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 09:35:29 +0000 dtrace.1: Reference dwatch(1) and tracing(7) Reviewed by: bcr Event: Berlin 2025 Hackathon --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 1836707d72df..7a98baf39776 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2025 +.Dd July 12, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -1221,6 +1221,7 @@ Invalid command line options or arguments were specified. .El .Sh SEE ALSO .Xr cpp 1 , +.Xr dwatch 1 , .Xr dtrace_audit 4 , .Xr dtrace_io 4 , .Xr dtrace_ip 4 , @@ -1233,6 +1234,7 @@ Invalid command line options or arguments were specified. .Xr dtrace_udp 4 , .Xr dtrace_udplite 4 , .Xr elf 5 , +.Xr tracing 7 , .Xr SDT 9 .Rs .%T Solaris Dynamic Tracing Guide From nobody Sat Jul 12 09:53:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfP6S1nN2z61f7t; Sat, 12 Jul 2025 09:53: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfP6S0l0Mz3sSd; Sat, 12 Jul 2025 09:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752314016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KnUtLbEoaVje9Y3x5yjX/4uyc5EkXR8Nzdo5oL2dyF8=; b=mdXN/mnZsXICnhD/vJ0l2Gdwj14t2Lit5pqxkBfJnGiJq0P49eQVg6rALmy53/D0WTZ8Ft kUzONCfOvGzqsGnj0CwM+S4DXkdvJUKbRmSNGyeoD9hubDphRgze8PPg8rZGxz1I0S/LE5 ym3DbOxq7Ehetqp3ehVNQipvsZcavLf/vGun3U4G0aKXIWj5Qp0Kh2YKhsQz3BdWjJb9cb mxYK+hmhXp8dcXBDa6sqIIpReX/8V4DAF8hyqcTew+F1zkSExGQJ5d//wIinvNExeDk0Mr W+HryijBD3E1iro0/ecHUhfnHDPlNgu2jq680+DcOxswmo4EPlAd9GJbWUKnGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752314016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KnUtLbEoaVje9Y3x5yjX/4uyc5EkXR8Nzdo5oL2dyF8=; b=YfbVGqsIMr3FgeoG0xPIDIUUgcGD5MEgN39Rnk/EoFGWoQYefMMvJiKPrqvzp8OBT2gPO5 7X5gnJzJDvy/+AraSULbAcMRn1ROmljptPH9k7H9BC58pSLbXIhbYWHctT//I2k+j9dQyj fZIvJtQLEQ+lqjpdYluuKk0Utkn4xHDpXylkgTJBivh7zwlr19fvLx9ZIdd2BQbfwb1PNi kUthZUSnqisRVl3+1MxFmeF3Mho+qF+D5kYBHnoRpYfTYlZh2OUm2wcFMeIZ6MFfgPq6Dl qEUCmtELGAxr9I3Xp5Vvs4XXuqhs49MUex+h/Y1w7K/wR9wtwmqhs0IhWYvtnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752314016; a=rsa-sha256; cv=none; b=Gh8WqeU2iKhu2g5J/gNvEAEQBg1eylTvAySoxfri/KEEdNknakR47ZraZYV1OZ/A4eLFge qHR6Pcs6L0T77dhLZvaAr364qmFuZp1BeCl285/Km7hdNZG5BuUf5SwCN7ea+ne6pn6pqt 8YqlkjMn9opfS2QXildKJDIQhaN9FhTwH1jHfxLFs4mekUxhW4ESlTZ/U/rOnSKc77VHAQ RE+qitH2A4VcSqFitEDy6Ek5ViXWdoKICxKut/PkfEsJLynQUEjGP4cjb0EZbdIKeZ1cxI 7z6kxQ06SeUZNFy2aBiYz/cvwc/tWjIo2hr0gjXHWK6sjFxjCjsgsUIl+YUgjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfP6R6PwMz3CK; Sat, 12 Jul 2025 09:53: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 56C9rZxY073778; Sat, 12 Jul 2025 09:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C9rZsk073775; Sat, 12 Jul 2025 09:53:35 GMT (envelope-from git) Date: Sat, 12 Jul 2025 09:53:35 GMT Message-Id: <202507120953.56C9rZsk073775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: c479d2b29fc9 - main - tracing.7: Pet linters List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c479d2b29fc90d8316af2a14290c87feeb046428 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=c479d2b29fc90d8316af2a14290c87feeb046428 commit c479d2b29fc90d8316af2a14290c87feeb046428 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 09:52:26 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 09:52:26 +0000 tracing.7: Pet linters Event: Berlin 2025 Hackathon --- share/man/man7/tracing.7 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index 0bd64f197084..7f21bfbbd2a3 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -3,7 +3,7 @@ .\" .\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> .\" -.Dd June 19, 2025 +.Dd July 12, 2025 .Dt TRACING 7 .Os .Sh NAME @@ -34,7 +34,6 @@ for more details. is a user-friendly wrapper for DTrace. It simplifies common DTrace usage patterns and requires less expert knowledge to operate. -.Pp .Ss Userland Tracing .Xr truss 1 traces system calls. @@ -55,7 +54,8 @@ it asynchronously logs entries to a trace file configured with .Xr ktrace 2 (typically .Pa ktrace.out ) , -and it can log other types of kernel events, such as page faults and name lookups +and it can log other types of kernel events, such as page faults +and name lookups .Po refer to .Fl t in @@ -74,10 +74,9 @@ It lets kernel programmers log events to a global ring buffer, which can later be dumped using .Xr ktrdump 8 . .Ss Hardware Counters -.Pp .Xr pmcstat 8 , and its kernel counterpart, -.Xr hwmpc 4 , +.Xr hwpmc 4 , is the .Fx facility for conducting performance measurements with hardware counters. From nobody Sat Jul 12 13:38:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6J4yS0z61sp1; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6J0pfwz3ChQ; Sat, 12 Jul 2025 13:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pXIVuicZApNLZaAZe8JLR8OXozCF/NTiB3jSvThQ0Hs=; b=pUTfFGipwCJ7YJrTR17ZUdAuGgSYFQKJhSTxgisvmrQizf4GAm+q2pzlB3iLPb9ZLTZF87 KkHcprYbP7QsC5bI8q75+oe4hJw/2Jin8hayZM24u7vZLAXYQW69dRudZ1Q8a4bJ/c4Xxa KhaAPrPrGhWOuSp3M3Gjse1NJ+bFJ6ITXCWLHghapS1zUjfZL+HNKIzp9YnQfbILRXfIHR vdrVNtD+LftScuBW2ruu5hoTunRWTAKXs4DEEtWmNGiSQE0dl0tm0znszpG3MxE0oogw9R xRIzPVzLKA7EhSuQg3bUAgn3yOtjx5pKJsIMvyfVH+qUTuqSFvTjFUF/CGfsWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pXIVuicZApNLZaAZe8JLR8OXozCF/NTiB3jSvThQ0Hs=; b=lOkuUwx3Ybi4ort4vHTGCv4cGg7XErSgWvzPao8dFDTjb6j4BMmNsNRKIdytor3/+3JwCR TRRWuuZjmkd/6BuZgeYQWiIFqNleKEOJfTsfy71ubE3TMbx+al11t1m/oqE3+l0sVBLAI8 LJN/l7FiC180G7Kwxn602VuG8xJMTMGE/4DNMmy4Cc+73Gf1vK02EiCSC3pdxJ+dwHr5MC T3kWw2fxWkjLGa1uoNyxg8+xmh1yufPvolBLoGH0VqAyVOTQHREONyLlXrXKucRy6ibObL 89ZMPUQ8gU5Bpd05v8aH5o2/ndjgM8U6lTuDhQGEACenjpwFEum6W1k4h858IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327528; a=rsa-sha256; cv=none; b=iyqhyxPh/oFDOrrPmfkpswyxKMHVSBOB+xoDsVYg0AhnIkS5zEd7PCQfvduh+Rwgo7ayEO ecC9wjaoJo/sVkR5i96er6mqf7sWA70jxTpu3nYObw/u1TYiEqC1NWwf8FxhiLviIshD+W 447HP/H/NVGtWQV25j8gPw05usXaaClJb8KcbOIgy1QmoXWvtmfQ6SeQcoTEjN1eGAHcw2 Bfwnog+kuLVC+s4ONo0gJe1ZmCTx6EXY+PSXdVjqCLrmA12SPqE9GZM5OLufll1my/AvOt hoF0TbmigLS1vt7D1c4RNtibERkGYFIOl683H3NSGHL4jG3YChI95nkXVcJgGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6J0FK1z8mX; Sat, 12 Jul 2025 13:38: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 56CDclUC088820; Sat, 12 Jul 2025 13:38:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcl4q088817; Sat, 12 Jul 2025 13:38:47 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:47 GMT Message-Id: <202507121338.56CDcl4q088817@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: 8423b27345ce - main - pfctl: Refine error message List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8423b27345ceabc545e664b5e75952bb4bf8362e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8423b27345ceabc545e664b5e75952bb4bf8362e commit 8423b27345ceabc545e664b5e75952bb4bf8362e Author: Kristof Provost AuthorDate: 2025-07-07 06:30:12 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Refine error message While code in pf/pfctl confusingly uses either anchor or ruleset depending on the context, pfctl(8) (both manual and user interface) should be consistent. For users there are basically anchors only, so do not imply any difference between the two terminologies. OK sashan Obtained from: OpenBSD, kn , 910e8feeb5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_radix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 21191259adff..5f9f121bc81c 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -469,7 +469,7 @@ pfr_strerror(int errnum) case ESRCH: return "Table does not exist"; case ENOENT: - return "Anchor or Ruleset does not exist"; + return "Anchor does not exist"; default: return strerror(errnum); } From nobody Sat Jul 12 13:38:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6K5BG9z61sWB; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6K1SG6z3CTS; Sat, 12 Jul 2025 13:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e3iOSoXFmV8W5Lg88hxtRP9e6Kx6EHIIqvR0uDNEZ/0=; b=OH2fX5ufuRsQ276xc5Rupn89nDBmj5PZz0ze7OgPThM19wxe4hVJzMGT04ob3pnTaUhj2a bGHDFKrrtUvJotrBGBd/t6SM2rI2C/guvm9CJwlT0YKZpsIgKM7Z2+dXJedR/gxDAtGPL0 cnyveF036eX0SX7+eKRsUrmzVCJ1mgCL009684T1Q6MzO6rI2aserYJTVHpTDZ20AwFbtc EyMPk76CyU/pnpc4TJ7aROi1Xbr2X4w3zr8t4giATsV5k9uL21y50QplTMGP/mKEnW45LG Y4pC4BCK0RV1RhUvPGmPlH9IlFdTD1zYf7Td5+CXp0bAMyWDf/kXLCWizMylrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e3iOSoXFmV8W5Lg88hxtRP9e6Kx6EHIIqvR0uDNEZ/0=; b=KFYqpUOw3pPSIcWszzOHANul0hglkReX4LkXKrSlmle0mnYKNjZYyA62Swhbfz6YmklFzs onFg+QuUEHGxzTTc5wVPakMYLUvPTLOY+QhQ12vdQJI6RsWHy7OuCkmfmac+yqOHubB1Pr vT3R2SFcjBd0I8JjBliyAeDfm3H5v5/DIISBAfPBR/mIaCCvUxKRw/zo6ZTPcirIECRVIZ 4X5qh1sN/8HAJ3TtCQxAueHpnjH7zTQJpFZdUaWDDLqFd+LN9P8bazrl7N0fhmSt3CZZuF ZG4pjHKSh2+AJb7lVeEI8P+zAy+jydn63MHPymUkXcbwwI66A4Z0YaFPz0F5yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327529; a=rsa-sha256; cv=none; b=c/qdOmOvpqr9+YPwdQLH/uqUMBxEFUO0wuPexRp2iMVxTGbt4+Jf5eHCECBYk7XZfKruMf 5Mbz0VEmCpDtMjQppzoxzoGi4NYCXnPWAefSGzKiwLGPJWZ/O/zDCyo5JuecRolp5qNfy1 4IlpWRMcDuXlS7LDchJDISMu+BTcPFfl+PWmp3hrivIhITXHtW9kI1i2PeaOtwdThXljMQ NDj0ghdD4nNfuRidos2g6qeiKHw5m43PEr/YnzxayT+QROxYbuJlHXe2dAbFdOJKXIt4TM mA2zHnLWCFx0SDBDzzsEXtIJwAoWbJHq6Y8J3mgeSjekd/9gaxVjv+2lDd6pbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6K0n1tz8px; Sat, 12 Jul 2025 13:38: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 56CDcnDP088854; Sat, 12 Jul 2025 13:38:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcnRX088851; Sat, 12 Jul 2025 13:38:49 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:49 GMT Message-Id: <202507121338.56CDcnRX088851@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: 7153a62d2978 - main - pfctl: Unify error message for nonexisting anchors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 7153a62d29784780fdc1d61aebd92c76fb158627 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7153a62d29784780fdc1d61aebd92c76fb158627 commit 7153a62d29784780fdc1d61aebd92c76fb158627 Author: Kristof Provost AuthorDate: 2025-07-07 06:45:04 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Unify error message for nonexisting anchors pf(4) returns EINVAL for DIOCGETRULE, DIOCGETRULES and DIOCGETRULESET if the specified anchor does not exist. Extend and rename {pfr -> pf}_strerror() to make error message more consistent. There are other occasions as well but those need additional tweaks; that's stuff for another diff. OK and rename from sashan Obtained from: OpenBSD, kn , e5c920154c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 24 +++++++++++++++++++----- sbin/pfctl/pfctl_optimize.c | 8 ++++---- sbin/pfctl/pfctl_radix.c | 13 ------------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8d2b556d7085..b4453c850de4 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1350,7 +1350,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errc(1, ret, "DIOCGETRULESET"); + errx(1, "%s", pfr_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("anchor \"%s\" all {\n", prs.name); pfctl_show_rules(dev, npath, opts, @@ -1365,14 +1365,14 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, if (opts & PF_OPT_SHOWALL) { ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { - warnc(ret, "DIOCGETRULES"); + warnx("%s", pfr_strerror(ret)); goto error; } header++; } ret = pfctl_get_rules_info_h(pfh, &ri, PF_SCRUB, path); if (ret != 0) { - warnc(ret, "DIOCGETRULES"); + warnx("%s", pfr_strerror(ret)); goto error; } if (opts & PF_OPT_SHOWALL) { @@ -1565,12 +1565,12 @@ pfctl_show_nat(int dev, const char *path, int opts, char *anchorname, int depth, fprintf(stderr, "NAT anchor '%s' " "not found.\n", anchorname); else - errc(1, ret, "DIOCGETRULESETS"); + errx(1, "%s", pfr_strerror(ret)); } for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errc(1, ret, "DIOCGETRULESET"); + errx(1, "%s", pfr_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("nat-anchor \"%s\" all {\n", prs.name); pfctl_show_nat(dev, npath, opts, @@ -3643,3 +3643,17 @@ main(int argc, char *argv[]) exit(exit_val); } + +char * +pfr_strerror(int errnum) +{ + switch (errnum) { + case ESRCH: + return "Table does not exist"; + case EINVAL: + case ENOENT: + return "Anchor does not exist"; + default: + return strerror(errnum); + } +} diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index e727324bbf40..24b774bc66be 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -903,13 +903,13 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) struct pf_opt_queue queue; struct pfctl_rules_info rules; struct pfctl_rule a, b, rule; - int nr, mnr; + int nr, mnr, ret; TAILQ_INIT(&queue); TAILQ_INIT(&prof_superblocks); - if (pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) { - warn("DIOCGETRULES"); + if ((ret = pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) != 0) { + warnx("%s", pfr_strerror(ret)); return (1); } mnr = rules.nr; @@ -924,7 +924,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) if (pfctl_get_rule_h(pf->h, nr, rules.ticket, "", PF_PASS, &rule, anchor_call)) { - warn("DIOCGETRULENV"); + warnx("%s", pfr_strerror(ret)); free(por); return (1); } diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 5f9f121bc81c..00e4207d377b 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -461,16 +461,3 @@ pfr_next_token(char buf[BUF_SIZE], FILE *fp) buf[i] = '\0'; return (1); } - -char * -pfr_strerror(int errnum) -{ - switch (errnum) { - case ESRCH: - return "Table does not exist"; - case ENOENT: - return "Anchor does not exist"; - default: - return strerror(errnum); - } -} From nobody Sat Jul 12 13:38:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6M1h5dz61sd2; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6L2Gjhz3CYL; Sat, 12 Jul 2025 13:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ka51YlIwpHBu8/RDRMHa4pZQgf6BLPr79ACE7n0R6dQ=; b=wZdtJCtZFEvHyJSd/Y2BhkkJFLOhAEf5wbAq3HH7nTMsH8n23l4+lHe3eH88tLnnd6XP2F +zSr7HG2x7yt4juQaGuXj13UWniDeRu2TO/6nRpEzrT9ILRr5BM8DtTYWeATgKwFuPteIP cuuSvuZcZXzUZ+7J53abAfx4cqXUWG1bxs6LQwpC2hEgXwcKxQdLqRH5HsUaZEz6+8IK6K mWLdyWIpzMtg0WNEBHqkDaC+BY0LmNcRy021USawLxGv++TXemyIpSntHugKgPxRiC3JSy GjeZ9Mf2BT1LKXGCuBWPEH33tJtQSkxFaVcRrthNdFpOOEasYbOapFsjnKxMEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ka51YlIwpHBu8/RDRMHa4pZQgf6BLPr79ACE7n0R6dQ=; b=vH7OJJETelNnYRVcp9A1GWKR70qDcoHSirSRZdV55Kzn8ZxcwJoT+IlsGMZJhzU+CN0hRC A4A7ekYlRjK3vso9o/GlMALoO3+CJftIb4yav2P274XSLrZiBF85dH1w8JCP7aBzQIMT0g eemhkUB9QWlFzgk6nPj8zvtYNKfv5xXwTSPRgGJ4+7gqeeHLAVPlAdsmhuAIvQ9yyVIbEw ta97yqWJhYEbial7j/ct1CS7hw2i9odQZHCkVCLzKCovWKXLmAFfDh4s8Krf5+RYU4wLwU B/JYaibVrG0X0+OW2PJBAV4bsH2X3gR581FYpfvSL3mzWrCugMxTNweOpu2/2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327530; a=rsa-sha256; cv=none; b=oKM9VpcHnn30G1LxArqZkGF1YsPzpX4N72RHmnJvACEqzXX1qJI+FBnt7Z1dWaWNzmx4T7 K+Fu1wtMBEdS96QzP1VnsZt+dygjPazkxGKpHQeVAfHKfdqu0ouRMEFDKh2mllGIwFSn2Q aNT958mLm7nVsxYx2tFbQfuZMxj2OSV3zhtjf8FS3l7VvAhtV5ivM3SclleyKDfXXrX6Q/ 1Ol4kDkGTM/dDroCxLO658PnvNEVE90xax/6s+F5tOHw90r2wRVMVsCosw9EQxTcUCxfvw 0mAY/XeoQtVQOiVis/mcTgfAUFryS9rEFnReWnKgOREI8/LCFYZ7UzulEcLY5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6L1mrPz8sg; Sat, 12 Jul 2025 13:38: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 56CDcowP088889; Sat, 12 Jul 2025 13:38:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcotK088886; Sat, 12 Jul 2025 13:38:50 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:50 GMT Message-Id: <202507121338.56CDcotK088886@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: 004062345bbf - main - pfctl: Do the actual pfr_strerror() to pf_strerror() rename List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 004062345bbfaa191252ac2df15ca151dcfdfc4f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=004062345bbfaa191252ac2df15ca151dcfdfc4f commit 004062345bbfaa191252ac2df15ca151dcfdfc4f Author: Kristof Provost AuthorDate: 2025-07-07 07:07:31 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Do the actual pfr_strerror() to pf_strerror() rename Missed in previous Obtained from: OpenBSD, kn , c802a0d9d6 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 +- sbin/pfctl/pfctl.c | 12 ++++++------ sbin/pfctl/pfctl.h | 2 +- sbin/pfctl/pfctl_optimize.c | 4 ++-- sbin/pfctl/pfctl_table.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 28f461bf715d..2188324c15cb 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5458,7 +5458,7 @@ process_tabledef(char *name, struct table_opts *opts, int popts) name); else yyerror("cannot define table %s: %s", name, - pfr_strerror(errno)); + pf_strerror(errno)); goto _error; } diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index b4453c850de4..10f3ee1f44e9 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1350,7 +1350,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errx(1, "%s", pfr_strerror(ret)); + errx(1, "%s", pf_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("anchor \"%s\" all {\n", prs.name); pfctl_show_rules(dev, npath, opts, @@ -1365,14 +1365,14 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, if (opts & PF_OPT_SHOWALL) { ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); goto error; } header++; } ret = pfctl_get_rules_info_h(pfh, &ri, PF_SCRUB, path); if (ret != 0) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); goto error; } if (opts & PF_OPT_SHOWALL) { @@ -1565,12 +1565,12 @@ pfctl_show_nat(int dev, const char *path, int opts, char *anchorname, int depth, fprintf(stderr, "NAT anchor '%s' " "not found.\n", anchorname); else - errx(1, "%s", pfr_strerror(ret)); + errx(1, "%s", pf_strerror(ret)); } for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errx(1, "%s", pfr_strerror(ret)); + errx(1, "%s", pf_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("nat-anchor \"%s\" all {\n", prs.name); pfctl_show_nat(dev, npath, opts, @@ -3645,7 +3645,7 @@ main(int argc, char *argv[]) } char * -pfr_strerror(int errnum) +pf_strerror(int errnum) { switch (errnum) { case ESRCH: diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index 5b5b3d3e5fff..afecc78086e0 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -83,7 +83,7 @@ void *pfr_buf_next(struct pfr_buffer *, const void *); int pfr_buf_grow(struct pfr_buffer *, int); int pfr_buf_load(struct pfr_buffer *, char *, int, int (*)(struct pfr_buffer *, char *, int, int), int); -char *pfr_strerror(int); +char *pf_strerror(int); int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 24b774bc66be..d65503a3efb3 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -909,7 +909,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) TAILQ_INIT(&prof_superblocks); if ((ret = pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) != 0) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); return (1); } mnr = rules.nr; @@ -924,7 +924,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) if (pfctl_get_rule_h(pf->h, nr, rules.ticket, "", PF_PASS, &rule, anchor_call)) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); free(por); return (1); } diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 8033d3515572..f583f5ef8e79 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -79,7 +79,7 @@ static const char *istats_text[2][2][2] = { (opts & PF_OPT_DUMMYACTION)) && \ (fct)) { \ if ((opts & PF_OPT_RECURSE) == 0) \ - warnx("%s", pfr_strerror(errno)); \ + warnx("%s", pf_strerror(errno)); \ goto _error; \ } \ } while (0) @@ -92,7 +92,7 @@ static const char *istats_text[2][2][2] = { (opts & PF_OPT_DUMMYACTION)) && \ (pfr_add_table(&table, &nadd, flags)) && \ (errno != EPERM)) { \ - warnx("%s", pfr_strerror(errno)); \ + warnx("%s", pf_strerror(errno)); \ goto _error; \ } \ if (nadd) { \ @@ -640,7 +640,7 @@ pfctl_show_ifaces(const char *filter, int opts) pfr_buf_grow(&b, b.pfrb_size); b.pfrb_size = b.pfrb_msize; if (pfi_get_ifaces(filter, b.pfrb_caddr, &b.pfrb_size)) - errx(1, "%s", pfr_strerror(errno)); + errx(1, "%s", pf_strerror(errno)); if (b.pfrb_size <= b.pfrb_msize) break; } From nobody Sat Jul 12 13:38:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6M74lJz61srG; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6M2v9Nz3CfB; Sat, 12 Jul 2025 13:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ei1Tka1kcedDyDgqoE0XSBbD3Z9ETKucbJfS+vVfxKg=; b=UIPP4VJiAWDJdgWI8lE8E2EB1U3+o93s3bzYcFPlwppcjdGIWShrTmfoHLbs2LZyep17YB j2q2UYbZVjs2zEDU3ES06jMEN7ezaR4MpUT2XO2KE9Cm/+ipNTypwKddlkN/KRfc3jVgJS ZPWqjLnJ53feb1NjBcB9oFjVihhywW2R5cdD7xSHXpsIGk6GvAwaxKm4J/gCPeXc1f6zR5 Pu83jGyP2PVbEqZnqBWRqRhrFHqirjVADZjTIq07FJgqwaJ+TwE+SeMO3kwuHqqmYR95fs A9I3gfI7nS9A3WfveLVWmUgUtFqOeF65CmaS+vLyUA1EtGtK7TJt+4M2Yibqzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ei1Tka1kcedDyDgqoE0XSBbD3Z9ETKucbJfS+vVfxKg=; b=LFKK56V5EO+6b//oXNB+2HN5BYsbdBYKvysFNB45adEyTAAGTXq/Ot86fCL4hXVbFYemGW DHOEjOzUeZ3DngkbzrrNyRhyUIQd8l4lNGzZ4LfxRM4BIdVraKQTiOGb+vinRk5IL6nO6+ qoHSxSs3wnkEOr/8yC8EerKDXEFQx3qD/tEgxFQ2JfxmtkcLLaOEDH7VRWIV1qTOOV4tiG Spbij1Yw/vVa8j9e3lgOVqESw/tWGA6uVyKPiSox0IcLdJSge0j92c+/stD7yC4lxnxG2/ RALdIrRwcI6FWrLNkjeE6Krc41Pav8jt0FPAlntzs+jW52xyJEG2j+13hAvPng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327531; a=rsa-sha256; cv=none; b=B3lsHA0fu/bXf9IPCm9Rxy5C7UnW3HMLJP8PNufJV3/icFSyPLNDqCpqdZ+iRhE67KldFi nQ5aqgyW0dw3fpSRwt3H4/5Hxqy3ds9/qMbyqxTau+HWuaaDpa7G9ko+lLXXX6z7S6frtg V0gY4Ga5rAjzSilqb0+t0DcOcHbuwnlN4Xi1lVLpXdWzfZQrgSUUh6hGPgfdtDWcFNd7nw qM/7p8y9t97cP8WeXRoiZdTtlC2dyYAPZ3FZgj6kH7VYqxuTesonmSgDNcoLZ/D6jscPT3 IK5DE7sSiVQQ00xc2eDkCTcrOWk61UmlTIxb6dJWHPAY4xA8rpXuvuiX5ODy0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6M2HXQz8py; Sat, 12 Jul 2025 13:38: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 56CDcpb1088924; Sat, 12 Jul 2025 13:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcp2C088921; Sat, 12 Jul 2025 13:38:51 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:51 GMT Message-Id: <202507121338.56CDcp2C088921@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: c87390026a4e - main - pfctl: Fail on missing anchor List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c87390026a4e11355351d7a22ce456d1ea3cfe06 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c87390026a4e11355351d7a22ce456d1ea3cfe06 commit c87390026a4e11355351d7a22ce456d1ea3cfe06 Author: Kristof Provost AuthorDate: 2025-07-07 07:09:32 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Fail on missing anchor There is no reason to continue on anchor specific paths if the given anchor does not exist. OK sashan Obtained from: OpenBSD, kn , ad846651a1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 10f3ee1f44e9..dca9bba06a3e 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1340,13 +1340,8 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, u_int32_t mnr, nr; memset(&prs, 0, sizeof(prs)); - if ((ret = pfctl_get_rulesets(pfh, npath, &mnr)) != 0) { - if (ret == EINVAL) - fprintf(stderr, "Anchor '%s' " - "not found.\n", anchorname); - else - errc(1, ret, "DIOCGETRULESETS"); - } + if ((ret = pfctl_get_rulesets(pfh, npath, &mnr)) != 0) + errx(1, "%s", pf_strerror(ret)); for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) @@ -2962,13 +2957,8 @@ pfctl_walk_anchors(int dev, int opts, const char *anchor, int ret; memset(&pr, 0, sizeof(pr)); - if ((ret = pfctl_get_rulesets(pfh, anchor, &mnr)) != 0) { - if (ret == EINVAL) - fprintf(stderr, "Anchor '%s' not found.\n", anchor); - else - errc(1, ret, "DIOCGETRULESETS"); - return (-1); - } + if ((ret = pfctl_get_rulesets(pfh, anchor, &mnr)) != 0) + errx(1, "%s", pf_strerror(ret)); for (nr = 0; nr < mnr; ++nr) { char sub[MAXPATHLEN]; From nobody Sat Jul 12 13:38:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6N4wcnz61srK; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6N3dWRz3Cl6; Sat, 12 Jul 2025 13:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iKHM7XRrmseoP3YwVQ+schDtahHKA/pz9Uq0Ex8HINA=; b=gszc80Cl48YFOaP23Twh2itpNzsJYhvL9wW3U1cD3/c5D81aq1sY0s9MsablM2rJkmf1ou 3ySlAjZek+EAz/NPieF9A5aZiwQyBX7YDPvdkU+aCaIBPHvXTKrjXjGfDzMsJ2FriMOB0l +TEQMu4jJ8udokvQGGDsZt+lXGhkM2sqW5a3Rtjk+TqBoISWHOTsxu0kNmC9YkJXFzuUya uK4Of/NKMGd8KsVDmCjajMafNPee3Arx2RfRcSk3AZV2DwCQOmhe12aFKcX+2CO/ZgahFX C9DwqnSrf0rmRiXBJh239o6NsCZOBKNHmiURRoNv3QcPIaMITYx0CPga/2qIoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iKHM7XRrmseoP3YwVQ+schDtahHKA/pz9Uq0Ex8HINA=; b=qzKUZroSpCudIHwfkVAQEDqomeoF034J/7602cea25r7Hfv6vnd4M2LLa+QQh6Lv+Ndj6z KKwcCyH/znh4sOoHkhWJqC7GfZU5vKJ7dP/vtC5bn7jgMzr8IuENb0DSLLNvyphDvtCddi ku6SMHB2iNCSxrm3TwWyDhkyBSSDN1qrWdgSKDsgc9NOba5exiR5FhOHKY3SQThQeQV+75 85P5gPKmCdMXHt7Kxa9VOD7sAPhd47is7NcKkWWbhG2KTBx5jG/qtao4xXjumTcB9khnDy OjVz+vlXLJPx3Yz0YmF9E3TVSEH5QbhYBR5W4fSxDMGEGknl10Fj5c88fmc2rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327532; a=rsa-sha256; cv=none; b=dXGZfrFe//egJLRGrbVnqslTm0xt78ealFVO3LcMels8HntqvwDQD05FbacMbm5RO7aRhR owdjUNO9N1UnSZHeYvYRJr7nr2nTqEJ45NW4twt2lzyvuSi5opa1K3d2RKVSkSNYh75R6o 9sqECHhWlb0lZlZAoKr3s10IS/K1RwewRjSui0ssCKB5y6OPv9RP9sNTr1wvaLM+5gusjy ftcO4kTkDkK62Mm+x0UsWAtL1pWtL69Y/JR+lYRQEy8iv1M6PXCgr4A8KhlMZjSoVQKoH6 l7j0CbFxkEALL4ZQFfXcn+tILLyxpHAc9wBoGuL+qLg00szy0HYM0Ta/ZZ2FmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6N2xnGz95s; Sat, 12 Jul 2025 13:38: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 56CDcqet088960; Sat, 12 Jul 2025 13:38:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcqmn088957; Sat, 12 Jul 2025 13:38:52 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:52 GMT Message-Id: <202507121338.56CDcqmn088957@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: 1ae17b65b676 - main - pf.conf.5: should clearly state range match operator ':' does not work for uid/gid. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1ae17b65b676d0bfa291b193aa4b70ba6f993aaf Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1ae17b65b676d0bfa291b193aa4b70ba6f993aaf commit 1ae17b65b676d0bfa291b193aa4b70ba6f993aaf Author: Kristof Provost AuthorDate: 2025-07-07 07:12:36 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pf.conf.5: should clearly state range match operator ':' does not work for uid/gid. OK @kn, OK @sthen Obtained from: OpenBSD, sashan , 4521e23a38 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index fe848b030484..b5843d67e106 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 July 2, 2025 +.Dd July 7, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -2047,6 +2047,21 @@ connections: block out proto { tcp, udp } all pass out proto { tcp, udp } all user { < 1000, dhartmei } .Ed +.Pp +The example below permits users with uid between 1000 and 1500 +to open connections: +.Bd -literal -offset indent +block out proto tcp all +pass out proto tcp from self user { 999 >< 1501 } +.Ed +.Pp +The +.Sq \&: +operator, which works for port number matching, does not work for +.Cm user +and +.Cm group +match. .It Xo Ar flags Aq Ar a .Pf / Ns Aq Ar b .No \*(Ba / Ns Aq Ar b From nobody Sat Jul 12 13:38:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6Q0Zb6z61sTp; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6P4Vlkz3CX0; Sat, 12 Jul 2025 13:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0GSLK4zHRbKynMxwxhqhX/RF5/suLGOdsqsTnYIrXWs=; b=gJSfPuK7dXcJ3flCkOajpoGk2O94Wsrycmm6gbuQstaVTXjet1zhCiKrjqV3Bf3QWtrKVe C2LHNAKQDOi0SmtRHPoHmE3oqRis3GAUaPnQeYzZJhBWceez17WKJt/Jov3WmGH1leHZzN TXM/ge/te1gA3GS7n+MMg+vL+EAjhNPO7rWC4NH/tVVftfTxA0Web0Z7EE5OXG6u3HFKaf YDhOayovv6hm614Lo9V4fEiv8Vu/D5qcg7PSPRAHVGRMBjUekMj+3rajxM+wR62MIRi4XF 8L6N3qn6BVeBJe2+k1xTaM/Qt4yYYu06qfjs2a/QIVhysOq+LOfWgkfCYDMKqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0GSLK4zHRbKynMxwxhqhX/RF5/suLGOdsqsTnYIrXWs=; b=uuyeHorGQuo1MRW0iipy8Sa2RvBkMY2KfqMXUb6nPDDLu9DaRNWCbq6HEW/cjdi4kTMDOL PA1XkYOt2BvOqQys1B0bHF+mDVgqYAUp8ulNm5PZMzrTy1U/quMfnMV+ZxjeFKN82huKWs Q9hULE+Pjd4TraVGYOGtRqLEYALLcOQ2hO2dEitoiPP1K6Jefc60vj1LuUmHBmgc9/Sp1P WCxB2c3qHlIc2UVdXiK4jGFOaUCkIs9ar7ERltayvakySPEs7JlS28XraqqSOqKn2EUO8X 8cX32aKVDAzWThJUDH2TBwmoOpXxF1Jt8lUoLcN+sTn+7x7I//8CxUCp+RnmWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327533; a=rsa-sha256; cv=none; b=oaPNqWNUsvqLypaXkDtXyKGqvn+nZ3k0EHroY8ziwmDeM8HmjOIejSnd2n6VQV9zdvoUa8 IuI2g3Z3nDF8orhT0ca7QjC3gbVaQk4UG05YCOM8LwTRFKkDkmGWNXZHmi2b2QtfEDaxa+ 7TTOmogCHAWSpaVxgMuqQNU8Ay06BHfucHQBLw8WFIDRC+psbLa40HMCDpQ0w81h4+RwqS HR/2bdPO/wFxQMHBwcC+7X9P8cGrBpS2PjUjZgoOZa/2gYQGJjUMnJYTAnm+Sx32k4/1zb o50OqI0d57yBZF8tIjQe7IhXdt7N3VKpcgeHXG2j1LsOQmibrxSgVKUpCFfy7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6P3x0Gz9H1; Sat, 12 Jul 2025 13:38: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 56CDcrnF088995; Sat, 12 Jul 2025 13:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcrKV088992; Sat, 12 Jul 2025 13:38:53 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:53 GMT Message-Id: <202507121338.56CDcrKV088992@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: a9706d78bddf - main - pfctl: replace TAILQ concatenation loop with TAILQ_CONCAT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: a9706d78bddf3e002d108d7ceb189cf40064fea2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9706d78bddf3e002d108d7ceb189cf40064fea2 commit a9706d78bddf3e002d108d7ceb189cf40064fea2 Author: Kristof Provost AuthorDate: 2025-07-07 07:16:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pfctl: replace TAILQ concatenation loop with TAILQ_CONCAT OK kn@, sashan@, florian@ Obtained from: OpenBSD, bket , c8d5c2349e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 14 +++----------- sbin/pfctl/pfctl_optimize.c | 17 +++-------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2188324c15cb..9a917d1d8464 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7202,19 +7202,11 @@ mv_rules(struct pfctl_ruleset *src, struct pfctl_ruleset *dst) struct pfctl_rule *r; for (i = 0; i < PF_RULESET_MAX; ++i) { - while ((r = TAILQ_FIRST(src->rules[i].active.ptr)) - != NULL) { - TAILQ_REMOVE(src->rules[i].active.ptr, r, entries); - TAILQ_INSERT_TAIL(dst->rules[i].active.ptr, r, entries); + TAILQ_FOREACH(r, src->rules[i].active.ptr, entries) dst->anchor->match++; - } + TAILQ_CONCAT(dst->rules[i].active.ptr, src->rules[i].active.ptr, entries); src->anchor->match = 0; - while ((r = TAILQ_FIRST(src->rules[i].inactive.ptr)) - != NULL) { - TAILQ_REMOVE(src->rules[i].inactive.ptr, r, entries); - TAILQ_INSERT_TAIL(dst->rules[i].inactive.ptr, - r, entries); - } + TAILQ_CONCAT(dst->rules[i].inactive.ptr, src->rules[i].inactive.ptr, entries); } } diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index d65503a3efb3..b82e88652f86 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -723,11 +723,7 @@ reorder_rules(struct pfctl *pf, struct superblock *block, int depth) * it based on a more optimal skipstep order. */ TAILQ_INIT(&head); - while ((por = TAILQ_FIRST(&block->sb_rules))) { - TAILQ_REMOVE(&block->sb_rules, por, por_entry); - TAILQ_INSERT_TAIL(&head, por, por_entry); - } - + TAILQ_CONCAT(&head, &block->sb_rules, por_entry); while (!TAILQ_EMPTY(&head)) { largest = 1; @@ -748,11 +744,7 @@ reorder_rules(struct pfctl *pf, struct superblock *block, int depth) * Nothing useful left. Leave remaining rules in order. */ DEBUG("(%d) no more commonality for skip steps", depth); - while ((por = TAILQ_FIRST(&head))) { - TAILQ_REMOVE(&head, por, por_entry); - TAILQ_INSERT_TAIL(&block->sb_rules, por, - por_entry); - } + TAILQ_CONCAT(&block->sb_rules, &head, por_entry); } else { /* * There is commonality. Extract those common rules @@ -863,10 +855,7 @@ block_feedback(struct pfctl *pf, struct superblock *block) */ TAILQ_INIT(&queue); - while ((por1 = TAILQ_FIRST(&block->sb_rules)) != NULL) { - TAILQ_REMOVE(&block->sb_rules, por1, por_entry); - TAILQ_INSERT_TAIL(&queue, por1, por_entry); - } + TAILQ_CONCAT(&queue, &block->sb_rules, por_entry); while ((por1 = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, por1, por_entry); From nobody Sat Jul 12 13:38:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6S59H9z61stb; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6R6Ks8z3Cfg; Sat, 12 Jul 2025 13:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVC905ryfPPIf6pwb6iejwfneNZj8uygIr1++BjvwVM=; b=A+2wvM+Kgtbwwi66bgUfkJWWG+mK+gMMPsZhHGWBFDfwBigbcKDMUscayEWXzRDrQQC6+N hLWr+xp0wE3cB9KUu/l8Fqpd4JSBvIIdT0nMYLP8dJFmIwChiriUd6k8I6gJKbhlrLE8e7 /FFUPynv0/xLeose5zMx8MwuZWBZSacFfIGwXfg5FLhUrRsEhWHYq1qVQlFuMyqPqCEdn+ 3g0l1IoEEs2uR+3kg+TR1XCCPa9OuW17a3GM+OOpnlsZoPTg2jHc2kchHh05QgLU0Vs+Ck EVIaI+d7qyEUGM/cJQTxXbN42gqLx3K1tg9e9BES9qniZI8F2DNhn9I/IRrjrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVC905ryfPPIf6pwb6iejwfneNZj8uygIr1++BjvwVM=; b=NURzLTWAce988AuYOzghKTQLesac0AIrHjoUZuhXgUIG/Ucz346xo2+PKpGTdW1ZN7p2Kr eq8scXJgl9K/p7orydsfr97fh5ixnwBUKAIQ/mJ6NaIpxGzMxVjXGk8w82gkHdziDA0+b0 Aish3cq+N+TVxCY77ivA8ZieGrVC/oMtBE46adq2iFaKhd5RmBLrPNzQUKeM35WBdLjVDR BkSNhoKO3y49JOehen9m/OTCD+f4yTtpJGI4MAsArnYskJntYoxPdFZynLVZxdmOecef5Z ilhoB/qqSdKH7+pnrZKldJWaALNd3fYjdpryI4vXZC4RqaJ1cJg8GiSJJBMHGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327535; a=rsa-sha256; cv=none; b=smBKv/D/MXhCwK2Tuk/VaC15i6JU0kqbp4FjTDL86st722W7rviXiMlL4YaSwXD9J+aBtS alCbMH1k5WwCzDsY1A2pu4ClUlVDg88ZJNM9GBgWZ+eAyM2WEQ8SFhCPNClcCecMZ8FJWh G/y/xyAPBZnRIyjJZuvdQJqC1tVLkM6Ba5X18UCdQ9QLsclsWDBwtgnynSua2gQY3PUBcm +gE8RzfvMrF/UY/cAAWOaA/BeMY/LoQVtAUp536n7z/ZymMmXCXjx63i+XDLqIQJUTUmD0 MYNII/rfmZ95Yj5GGky6r91yRUrr8kuRhHa2tiPTzKVde1rk8XnrBcYch9l+ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6R5XS8z8q0; Sat, 12 Jul 2025 13:38: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 56CDctdu089075; Sat, 12 Jul 2025 13:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDctLv089070; Sat, 12 Jul 2025 13:38:55 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:55 GMT Message-Id: <202507121338.56CDctLv089070@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: 8bced6260072 - main - pf: Fix pfr_kentry_byaddr() to be used for a rule in an anchor List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8bced626007201293dbbbc217d4a6dd7e8ecc9fc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8bced626007201293dbbbc217d4a6dd7e8ecc9fc commit 8bced626007201293dbbbc217d4a6dd7e8ecc9fc Author: Kristof Provost AuthorDate: 2025-07-07 09:26:06 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pf: Fix pfr_kentry_byaddr() to be used for a rule in an anchor It couldn't find an entry if its table is attached a table on the root. This fixes the problem "route-to least-states" doesn't work. The problem is found by IIJ. OK sashan Obtained from: OpenBSD, yasuoka , a7d8badaea Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_table.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 43e4366845a2..4faf328a2315 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2074,11 +2074,11 @@ pfr_lookup_table(struct pfr_table *tbl) (struct pfr_ktable *)tbl)); } -int -pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) +static struct pfr_kentry * +pfr_kentry_byaddr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, + int exact) { struct pfr_kentry *ke = NULL; - int match; PF_RULES_RASSERT(); @@ -2121,11 +2121,26 @@ pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) default: unhandled_af(af); } + if (exact && ke && KENTRY_NETWORK(ke)) + ke = NULL; + + return (ke); +} + +int +pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) +{ + struct pfr_kentry *ke = NULL; + int match; + + ke = pfr_kentry_byaddr(kt, a, af, 0); + match = (ke && !ke->pfrke_not); if (match) pfr_kstate_counter_add(&kt->pfrkt_match, 1); else pfr_kstate_counter_add(&kt->pfrkt_nomatch, 1); + return (match); } From nobody Sat Jul 12 13:38:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6R2vCmz61sp8; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6Q6tTMz3CfQ; Sat, 12 Jul 2025 13:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WduKrSCntcrs7jNS2g3M/1AMUTE1GNX2nKvlw3VfP74=; b=beVOARJALvSr+t7aHf3jVVcKvw0fhiOEQQ4/Z6Vo+PFdpjYatSrA53A2hHjznH42IMBViI Z78r9e4NNKxnA4uUiYw9uViWHQTYLSn/475e1H5OwDTdnJWBYHYBQKZLWp1diSGP+XkAsm a6drJ+YQNrhRPT5trLuKMuu/gFRdFU+C7b6FnnW9cTMgfmJCsb5LYMYBjFYxtMoylhawX5 3hcoJtwI5wj6ERBZHRul9KJJaAwAHPZgW3E02QQ00Ma90Z18jXgzyUhzeeZaH6U4nHHOJ7 gX6AAAZLThZd/0KMWV2CwSJG0CajayRDymi9lO1fDIF48Y2RNos+BpJV9UWmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WduKrSCntcrs7jNS2g3M/1AMUTE1GNX2nKvlw3VfP74=; b=ZRwPkCO8I0hnvJ8+6hlxSKNV/DswugwxdOMo2fMLgAQZyOIDuqBuQZszjxTb7EOZHWM1w5 Oi84pdNFETwDws76p1L0w9GjFVYrE0ESMC/L/TKVbNGEk4BnTaGMR23IiNGej7FJKwgqHt dxdOwIaHNnj8NDgUjBOzprx5NmVuJkAzsD0LMSgf1hrqeo6BR4r09n/epXiqXoZDmk88Tf +K/lqcZVlj59mYA8i1T8R7eaEA7fKsvoufUVsIwcbIXFASH4i36wD361hzp1ddMI18Tvbj TQXL6tuIC4Ffkbobovyu09Hy7nfV6fSM91/u3aqDX4G3mxrCIJ/cpM8l2NWexw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327535; a=rsa-sha256; cv=none; b=xsEY0La0EDWOTh8/gbYbj40F0GQGlTTiTPEs5U45ueb10y/MGdqb/YM27XKqX6wB36/Z8k Te1qCyWcUhzPUlummXIJx/hv6mHV42Z/qVc8/sXrlFpNbtFRtEpt/mI1E4YsLqTxtMNlfp Kuhzaao4kuhWLyZpdqyIr5wCngMbXEWPO3m1HkcVDELU74Ym1NvRGKSc1315XHdVIJzlLE JNO6j3eJbYhoRGNEJjOnR3lCOugaA9PnWwu2ZtXNb+Pg5f32+2tNccbx/6xPZPCd4hj2QD HhsT3yY7L2hjyjmjB/EpeMpQIxJDleRD8GRPKCs3I6NJXhQ+zeNQawkWybeThQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6Q4t3Fz8mY; Sat, 12 Jul 2025 13:38: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 56CDcs9N089036; Sat, 12 Jul 2025 13:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcsNQ089033; Sat, 12 Jul 2025 13:38:54 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:54 GMT Message-Id: <202507121338.56CDcsNQ089033@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: 3030d29571e5 - main - pfctl: restore '.' at the end of these errors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3030d29571e54b609ce8652a45cdb39e814b4b73 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3030d29571e54b609ce8652a45cdb39e814b4b73 commit 3030d29571e54b609ce8652a45cdb39e814b4b73 Author: Kristof Provost AuthorDate: 2025-07-07 07:55:35 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pfctl: restore '.' at the end of these errors The sys/netpfil/pf/table:reset_nonzero test expects them, and we're better off not modifying errors without good reason. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index dca9bba06a3e..271286deeda7 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3639,10 +3639,10 @@ pf_strerror(int errnum) { switch (errnum) { case ESRCH: - return "Table does not exist"; + return "Table does not exist."; case EINVAL: case ENOENT: - return "Anchor does not exist"; + return "Anchor does not exist."; default: return strerror(errnum); } From nobody Sat Jul 12 13:38:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6T4XSMz61srP; Sat, 12 Jul 2025 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6S752zz3Cjd; Sat, 12 Jul 2025 13:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/I3GsDzxfKgegM+xdMzyvg9iSCcQyibL+qVlxKw2vQ=; b=BSEfvQME40hlO+NHvD6GZ1yr9FhUlBLPKuaYKG902f27WTwtvqJNfyt0H/FNsWhrKSkrQz mBTKwnv2yZcxkJJaM9ETLNiHH6P8ZGMQhzloNG08oQYxFbPo1Un2ykBLoil16z4RoqZDw0 DZe/ZV4FyhSEcUAcQQeAfBi7DvGUiLVDE59NVTV4SZkMRHbBeNHHZRm5fKLTX+45V1w5ax BNPViQD1IeTzCPnp2dLXIqGsdgJwHNohQH7CV4p50WKKGEf3vTTQnBo6DacYGCiewUEOtz HZ+o5zSeYKw/uCYcemW1QeotG1oF5we5zBON7BvgEIrUs/M4RH+UDjv7XzOhuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/I3GsDzxfKgegM+xdMzyvg9iSCcQyibL+qVlxKw2vQ=; b=veJJazHcWeYVRa4sOfXxurcxht4O0FhqdNlD2LLddkGakeb61B4VEYB0HSlGo+P77A9max UxsXjosmAHnP6+fYoE5SRVYPdiN151TibWnSWoUf9Loyai59MDfqnJwLFHT7YLL1lGBbhy tdkCCxBzVUViyIjXlUDwyPpZAo1QkkMa4849qXX/P3IBGqXjdGb+OPpGnK17ZcIEOXiGdt HP+5OZwSIihJoEuKKeWwl5HgXCg/+NPOpIKLq6p/YcLlwKI+CYO7kls9NGwlgDxw75juuJ mV4R3/D/yjNgWyweqDneW+0/8wIBnfHM2aXslWgAuoPas9SzNNomvhU6RMt0DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327537; a=rsa-sha256; cv=none; b=n4OsfBsGMtw7Fs+7rh/CFg+disfjU3tznqxbb1dpCY1j8as5jEwYe0EDV5CVEo9XmI7jg4 67PWoGltxweHkOLfcaXh2eFSrDmpqCTaR4aSUK8gDReAdV5I6j7h0hmB7rssU3aPgKf+mO NJesX47gAl32fXxMiV8BNmFsgLNPe9DtkigBd1+O9GEFdjabXMP0k3kYZpr9+XSG8Pcy7I 4QTCh/RY20+ensZpV4DfFdMTdauOuadZLaU3GJQsaJeUQprMRoX6VNOoALbS2EWU4h2ffP ZOmNun6AQNa8D+0FCxooxsWpYda0EQ5tvPqwLXQHd3PmafoOAIQHt0b1tFFYnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6S6Yw1z8sh; Sat, 12 Jul 2025 13:38: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 56CDcuIh089110; Sat, 12 Jul 2025 13:38:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcuYH089107; Sat, 12 Jul 2025 13:38:56 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:56 GMT Message-Id: <202507121338.56CDcuYH089107@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: a4b7e540009f - main - pfctl.8: Mention hostid and checksum List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: a4b7e540009f7ae5eac07387762d2063cff25369 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a4b7e540009f7ae5eac07387762d2063cff25369 commit a4b7e540009f7ae5eac07387762d2063cff25369 Author: Kristof Provost AuthorDate: 2025-07-07 09:28:36 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pfctl.8: Mention hostid and checksum Complete the description of "-s info -v" such that grepping for them in the manual pager yields something. Feedback jmc OK sashan Obtained from: OpenBSD, kn , 0f5c867d7c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 508dcc6ea8d4..f582c6301124 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -487,7 +487,10 @@ Show the contents of the source tracking table. Show filter information (statistics and counters). When used together with .Fl v , -source tracking statistics are also shown. +source tracking statistics, the firewall's 32-bit hostid number and the +main ruleset's MD5 checksum for use with +.Xr pfsync 4 +are also shown. .It Fl s Cm Running Show the running status and provide a non-zero exit status when disabled. .It Fl s Cm labels From nobody Sat Jul 12 13:38:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6W58whz61stk; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6W1lP7z3CmD; Sat, 12 Jul 2025 13:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wQfmzB2jnVastGX9Kro1/jI2dZ4mmcFEi57YUclnK3U=; b=a3KwwVAkFruhm40Qmq9qGtIHqJmcZJba6dqRwd9BqpIXd7sEqLNuWO6VP+s8F5w1w24S/X hNA9yOLRdIDQnJOmmlgZXqyyEpUm+WdTwaMM9JlWalW4QahNICb8EyTrZlvPC07mRJe8Ko krG//B9s5T9qhHk1DJjVnmgNUCI19+40VQBZHZE4DNwEWtiGcU7O4q0BbdYUmYrho4r2J9 eGWbkBS27WIOwLhQfcfLI4s2sJKAe9NsxHT0EsXgJYLZZj33CT7xgBvi7A1HoUFst1v0CB 3Ahqht9Jio2U5XgJ8JfBnEyGvEJ8k2Z6lLOEsUGjqQxAmpeveOwOrr3fquLdpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wQfmzB2jnVastGX9Kro1/jI2dZ4mmcFEi57YUclnK3U=; b=jV+xDVwTsd/Q12t+PNPFG6mqz2+AuUb4yROuz+TsKh8c1coOsSmT6SHSj8xQe+cWG1WwyZ JuoBiSv4sI6Rhu9LfFp2zD8p3ZDZswY5yKfUTKgEgIeIvJTrF37VF30Lr2dW0SZm5h6Qtf TdRUvmVQEtzc6giBbZM4y+zpzLG5TDP9LU0Hqowb1rkRHKdRoO/UX0LAjT510ZEo19xNPM hA4zmrgFCAbEOz4Ck6pUAxfIC0gIv4IKOtWm48F3fTFc85Xu/0koqCyUKc9ZstQ5rWLQGp WQES2tgmrSVismpl1MS7UbrkjE6dDDkCkwgXF9FpMV3m6iqD/zd1PL0WSMwSUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327539; a=rsa-sha256; cv=none; b=mvYEdvL9rjdXtxNqWFTEniSS1BqY09qt8zzeieS6hlTSxuUG2C35z7qxMH+okojwUATKUf w2+vSzeQIKLegy+Td8UviES5v9P43nz0HlYrjAhwgHpQZ0lDXY4Xd/Mxuqh+PI27XamLuL jBDQ1svnkGTTlMWOChD480IJqSUMwq0x8gAGI0iiDFSpJbAQyxPzsSEjdI3tsQiJriPGkZ y+l23uLGqPsJ7jAAbvKdA1yurDgvnkGA7LnHV9Wh/WWkmCwVVBwbX9G9vxYhE4XlRGEiz/ BNVRUEbp46Ox/ubZRzCSIZZljNpgoTQLC8vij8zRJLIPu9RXhQaiMyY7rlZmjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6W1J8bz9H2; Sat, 12 Jul 2025 13:38: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 56CDcx71089180; Sat, 12 Jul 2025 13:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcxpo089177; Sat, 12 Jul 2025 13:38:59 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:59 GMT Message-Id: <202507121338.56CDcxpo089177@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: 116eabaa0b5d - main - pf: when calculating the ruleset's checksum, skip automatic table names. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 116eabaa0b5df490be19715fc032affbcda3f016 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=116eabaa0b5df490be19715fc032affbcda3f016 commit 116eabaa0b5df490be19715fc032affbcda3f016 Author: Kristof Provost AuthorDate: 2025-07-07 09:40:49 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pf: when calculating the ruleset's checksum, skip automatic table names. the checksum is exclusively used for pfsync to verify rulesets are identical on all nodes. the automatic table names are random and have a near zero chance to match. found at a customer in zurich ok sashan kn Obtained from: OpenBSD, henning , 7f1a6fd2a8 Sponsored by: Rubicon Communications, LLC ("Netgate") --- 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 c96741023db9..c14211edf10f 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1274,7 +1274,9 @@ pf_hash_rule_addr(MD5_CTX *ctx, struct pf_rule_addr *pfr) PF_MD5_UPD(pfr, addr.iflags); break; case PF_ADDR_TABLE: - PF_MD5_UPD(pfr, addr.v.tblname); + if (strncmp(pfr->addr.v.tblname, PF_OPTIMIZER_TABLE_PFX, + strlen(PF_OPTIMIZER_TABLE_PFX))) + PF_MD5_UPD(pfr, addr.v.tblname); break; case PF_ADDR_ADDRMASK: /* XXX ignore af? */ From nobody Sat Jul 12 13:38:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6W0lwLz61stj; Sat, 12 Jul 2025 13:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6V1BF0z3Cg8; Sat, 12 Jul 2025 13:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X2i6EHWhbwt99ssikSZwvUS8Yg8NMvWWowGViNbXpUA=; b=jNIwRZf6m5MnUwPpSsl+6OWHVV2J4irjm5e+ITmsTk9AVupimPrrHAhw+ip50eLLZvJxYN qaBFpITsufG3OXrv2AuAO+kTGDK2Ub9+HTzpop0XI8n84wXEaYXF8ZwS+vK8cGzAWFYyLh DfmS4ljWB8YNknV7DF797LhGzTNa6Xr5LbP1cy0hqIcH9irGdI+Kp7KPnPh6voZi7eqlhs jcSALRubr5NxO89xd0MRmH7vPUUenWlqnKTe/0RZjpWaO8eYsjcuukOhJrd13UmAcZB8Ev pbIOrHsXVLgqnjLWeFrcM+AAvLeBw+6TgzGt+z9uaIotKqYYkUMWcCL3fvDVpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X2i6EHWhbwt99ssikSZwvUS8Yg8NMvWWowGViNbXpUA=; b=jbNgooquh3IgkpEy5JcwHoHIwX0qzb/XNMPC3eFooAUlAZxnLfLgmKL+v6WqEGXocmKrGU m//U1TCcA0D0e1RopIwYFlznybyXAav/h7nVP2/BdVYTIkRdJL0Pb+Y2V5FQ5QbbBgkFZz 2Occnzx+DY9q3geVMEBqM4fHf9UOZZrZJwS8ErCv55pYtzbWSWMdgzBY99BC1VGjXfLAc2 nslr3ESVCjOp5CskgBPh4tE6a6l63etHeRa1cp8DGSnB4RsGxZURYz2nsK6pj2YarFfLfa ObMi3t9Mv/3IytLIeW4eDUPe1eKQEfsN85w9vBSvdNBaXFudu2vfTvX0IDRm2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327538; a=rsa-sha256; cv=none; b=i61qenSYKAzh0QOCDe6Ij6XNY8C5zqr3Y4EB7BXAOAVala333o0n7gWURxE5WOv7uGfmuX TQzDHeisOnFqjBNuypOA0oZjR3ZyQiJmYu84blKGmjPZQf6taFkSF2huR1dwMJdkBJ5VC6 en1kxQlTr5K74Yk+RgRdq5z8LTg2dwuaDSTjqctpQE20KnhbZSFJRjSfJQexZbD2njdY2H ZkNh5Zwvo6XGtjDVBYeb+VoFVzIvAC6VLvGub63563DOmoAN8+nEp2rTCMW6OQadnzM6PC s83PdB8b2AknlWXbJ0duW6ZgdOs1SjbcWVJlvHMQa6pwZioORxMA+s6+Hpdy8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6V0M74z8mZ; Sat, 12 Jul 2025 13:38: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 56CDcvYr089145; Sat, 12 Jul 2025 13: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 56CDcvIl089142; Sat, 12 Jul 2025 13:38:57 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:57 GMT Message-Id: <202507121338.56CDcvIl089142@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: 9f21a946d016 - main - pf: rename PF_OPT_TABLE_PREFIX to PF_OPTIMIZER_TABLE_PFX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9f21a946d01690cdfba43beba60ab04fc884741a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f21a946d01690cdfba43beba60ab04fc884741a commit 9f21a946d01690cdfba43beba60ab04fc884741a Author: Kristof Provost AuthorDate: 2025-07-07 09:39:07 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pf: rename PF_OPT_TABLE_PREFIX to PF_OPTIMIZER_TABLE_PFX Move it to pf.h. OPT is misleading and usually refers to command line arguments to pfctl ok sashan kn Obtained from: OpenBSD, henning , 9c6ad19ba4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_optimize.c | 6 +++--- sbin/pfctl/pfctl_parser.h | 1 - sys/netpfil/pf/pf.h | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index b82e88652f86..1d2a60555f19 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -1248,7 +1248,7 @@ add_opt_table(struct pfctl *pf, struct pf_opt_tbl **tbl, sa_family_t af, /* This is just a temporary table name */ snprintf((*tbl)->pt_name, sizeof((*tbl)->pt_name), "%s%d", - PF_OPT_TABLE_PREFIX, tablenum++); + PF_OPTIMIZER_TABLE_PFX, tablenum++); DEBUG("creating table <%s>", (*tbl)->pt_name); } @@ -1315,9 +1315,9 @@ pf_opt_create_table(struct pfctl *pf, struct pf_opt_tbl *tbl) /* Now we have to pick a table name that isn't used */ again: DEBUG("translating temporary table <%s> to <%s%x_%d>", tbl->pt_name, - PF_OPT_TABLE_PREFIX, table_identifier, tablenum); + PF_OPTIMIZER_TABLE_PFX, table_identifier, tablenum); snprintf(tbl->pt_name, sizeof(tbl->pt_name), "%s%x_%d", - PF_OPT_TABLE_PREFIX, table_identifier, tablenum); + PF_OPTIMIZER_TABLE_PFX, table_identifier, tablenum); PFRB_FOREACH(t, &table_buffer) { if (strcasecmp(t->pfrt_name, tbl->pt_name) == 0) { /* Collision. Try again */ diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 778105c2b96d..7a3c0c2a523f 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -263,7 +263,6 @@ struct pf_opt_tbl { struct node_tinithead pt_nodes; struct pfr_buffer *pt_buf; }; -#define PF_OPT_TABLE_PREFIX "__automatic_" /* optimizer pf_rule container */ struct pf_opt_rule { diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 2009d2907985..db353d185368 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -490,6 +490,7 @@ struct pf_osfp_ioctl { #define PF_ANCHOR_NAME_SIZE 64 #define PF_ANCHOR_MAXPATH (MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 1) +#define PF_OPTIMIZER_TABLE_PFX "__automatic_" struct pf_rule { struct pf_rule_addr src; From nobody Sat Jul 12 13:39:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6X7562z61sWL; Sat, 12 Jul 2025 13:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6X2jvYz3CgZ; Sat, 12 Jul 2025 13:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1N5CqexLM/9QJi0i/1iXj4N/lHZLQMZIvklyHh0/GCk=; b=i9d5NG4/WtWst3inC9lQZEELgC04r2gJ/uenakP3q6lf1o/oWUVScBCiSK+Oh7i42T366G lwYnm4i5TfQn9d1/drPrVlsI4F+bv7rLhfMQ9jm1/xUzrcHhpToicgclpIJv9bUe+vsvVS A9Lt+tbIqTE1iKYaRvDevLsfBz9EUIX+aB1uf75HrrP6miZwgcwG40390cQO3XM3FPxv+z Mtq5XkMDFeMgSj60xqhtAgTVuMGv4uvUBtpdi8+Zj6Qri6bJOIboKfwKbx4+ciUnSmhKgM nconhxt4fzjOtV+zbInEA81QmkOG3FIwDT3N5hQtEIhK9kg/q+NEkGIIu+DVjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1N5CqexLM/9QJi0i/1iXj4N/lHZLQMZIvklyHh0/GCk=; b=wWc6M/R0v5vHfABafr3DU3VlDVbT6h/a1S1YKNml1gDS8Dkf5E6q711erwgTRzZYWYApI/ cnczfbhZRSO8+qny1LsE9g4y+kMOUJZXNsdmNasZ4ey9gWc01cr+O0lpivS8tlj17aoSXP e4yGIiQ00wZ+BpFmA0iJtN0YHuFeTl8GiwWS7lpNb2BoEoebgisEAVW8OTlGHVtiGAxeL3 QaCFkVfU3ggJXPlelT1fSqVSDDyNVLUEN4CtzAYYadRa/j2Uv+b/M7awj8cZDfVCURz1P5 5agqXbrCgtIuKZGXWjIZ/b/mGVTcITVe/rRaZS5gXjITuhjMpcecKpmCY3PiNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327540; a=rsa-sha256; cv=none; b=M0tgDfDhihWvG9qq224do8VjtPtP2f3JNpjnsnC1WypTMJ9xxx8sReABxmY8aK6tNqB3ZZ 1ufYu9VjkSalwkfoBnnaCysoXa8ge8aD2kAgnulnrOxRZEBitH8SelgkVgO0mcYiASljJe 1rkRYB6moFzj5J5sbtPkZ7fby3iZhk5beOH3j0SITOZkRao6a/sYcXoy1piVYjSOaBfQFS vJ9bBWZqq+Pcnsto0BcfTj9hefgfBuyF1iGuMEfG7F7YEdqHM8F5i+rFUcg+R14DZJmpKM 8ElU/rShzovNpl91l3usXVR2P+TQsxNgHPjYlUimO/dB03ldundmlaHxLqTSlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6X2HQ6z8LL; Sat, 12 Jul 2025 13:39: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 56CDd0II089227; Sat, 12 Jul 2025 13:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDd0bK089224; Sat, 12 Jul 2025 13:39:00 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:39:00 GMT Message-Id: <202507121339.56CDd0bK089224@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: 7c5cc952ff73 - main - pf: Use the table on root always if current table is not active. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 7c5cc952ff73f9b70d0f22d6600ddb1885daa784 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7c5cc952ff73f9b70d0f22d6600ddb1885daa784 commit 7c5cc952ff73f9b70d0f22d6600ddb1885daa784 Author: Kristof Provost AuthorDate: 2025-07-07 10:02:58 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pf: Use the table on root always if current table is not active. ok sashan Obtained from: OpenBSD, yasuoka , 26b6297991 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 ++ sys/netpfil/pf/pf_lb.c | 49 ++++++++++++++++++++--------------------------- sys/netpfil/pf/pf_table.c | 26 ++++++++++++++++--------- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 36fab1a03ee6..f915f6d0f8fa 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2534,6 +2534,8 @@ int pfr_ina_rollback(struct pfr_table *, u_int32_t, int *, int); int pfr_ina_commit(struct pfr_table *, u_int32_t, int *, int *, int); int pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *, int *, u_int32_t, int); +struct pfr_ktable + *pfr_ktable_select_active(struct pfr_ktable *); MALLOC_DECLARE(PFI_MTYPE); VNET_DECLARE(struct pfi_kkif *, pfi_all); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 308d76c46e5b..97e69c9d1986 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -545,6 +545,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, { u_short reason = PFRES_MATCH; struct pf_addr *raddr = NULL, *rmask = NULL; + struct pfr_ktable *kt; uint64_t hashidx; int cnt; @@ -600,29 +601,25 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, pf_poolmask(naddr, raddr, rmask, saddr, af); break; case PF_POOL_RANDOM: - if (rpool->cur->addr.type == PF_ADDR_TABLE) { - cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; - if (cnt == 0) - rpool->tblidx = 0; + if (rpool->cur->addr.type == PF_ADDR_TABLE || + rpool->cur->addr.type == PF_ADDR_DYNIFTL) { + if (rpool->cur->addr.type == PF_ADDR_TABLE) + kt = rpool->cur->addr.p.tbl; else - rpool->tblidx = (int)arc4random_uniform(cnt); - memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) { + kt = rpool->cur->addr.p.dyn->pfid_kt; + kt = pfr_ktable_select_active(kt); + if (kt == NULL) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } - pf_addrcpy(naddr, &rpool->counter, af); - } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; + cnt = kt->pfrkt_cnt; if (cnt == 0) rpool->tblidx = 0; else rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, - pf_islinklocal)) { + if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, + af, pf_islinklocal)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -671,29 +668,25 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, hashidx = pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, af); - if (rpool->cur->addr.type == PF_ADDR_TABLE) { - cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; - if (cnt == 0) - rpool->tblidx = 0; + if (rpool->cur->addr.type == PF_ADDR_TABLE || + rpool->cur->addr.type == PF_ADDR_DYNIFTL) { + if (rpool->cur->addr.type == PF_ADDR_TABLE) + kt = rpool->cur->addr.p.tbl; else - rpool->tblidx = (int)(hashidx % cnt); - memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) { + kt = rpool->cur->addr.p.dyn->pfid_kt; + kt = pfr_ktable_select_active(kt); + if (kt == NULL) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } - pf_addrcpy(naddr, &rpool->counter, af); - } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; + cnt = kt->pfrkt_cnt; if (cnt == 0) rpool->tblidx = 0; else rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, - pf_islinklocal)) { + if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, + af, pf_islinklocal)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 4faf328a2315..2034f4422ef1 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2082,9 +2082,8 @@ pfr_kentry_byaddr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, PF_RULES_RASSERT(); - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + kt = pfr_ktable_select_active(kt); + if (kt == NULL) return (0); switch (af) { @@ -2150,9 +2149,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, { struct pfr_kentry *ke = NULL; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + kt = pfr_ktable_select_active(kt); + if (kt == NULL) return; switch (af) { @@ -2321,9 +2319,8 @@ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, unhandled_af(af); } - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + kt = pfr_ktable_select_active(kt); + if (kt == NULL) return (-1); idx = *pidx; @@ -2470,3 +2467,14 @@ pfr_dynaddr_update(struct pfr_ktable *kt, struct pfi_dynaddr *dyn) unhandled_af(dyn->pfid_af); } } + +struct pfr_ktable * +pfr_ktable_select_active(struct pfr_ktable *kt) +{ + if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) + kt = kt->pfrkt_root; + if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + return (NULL); + + return (kt); +} From nobody Sat Jul 12 13:39:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfV6Z0Fnwz61sWM; Sat, 12 Jul 2025 13:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6Y3jp0z3CwW; Sat, 12 Jul 2025 13:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRmkoCQ65C0f1tBHw/V0YU9v1MxSA3t0VyT+j03Art8=; b=AUN6ljxq2vZGUDHBEgocwMjiIBJwuBVAKtUxgKAqc43I9GIHh21Wf5ZwITFJdYlPDZZhyD vQ2OMzBAl7EHokSOYfH0LsXa52Mj676877PEEYN1toCWpHjx/Whsij/WryocRMNHKEOlyW OkTMBw60p1OkZvIeEuu50pBMYWPLaU1zDIRhyu7flHRAvC1I6cNp6Bup5m85G6walqBP/e UaLuVV+MZF4z/Zt9SF5vljd/4CoTdbZfVqqzLP/nGFh6XzZVfTdaUhaErcVUbpQXnc1Ojy KHjsiXlj433xN+AzU6+LABc+LiE9XfJNi7iGXO1e2JX8TwRlzWIHe/D8WvDEBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRmkoCQ65C0f1tBHw/V0YU9v1MxSA3t0VyT+j03Art8=; b=e16iFJVsc9TQLJBM+/v7/NG8isdz/J7zWDOddvDoQGIHzGQi4joy4Pa45eENU+x+jYZLLh SONc8tdaU4rJUAYjsNIUXXtlamrUnWKv/v/wposjqUdNBdSCKuDFaX3IMZ4Rdjjfx3OdKS jvyVnfP4Fx5FI97hglStW8M2o+KTM45+OXiXHTnqZjrqukNnD1Y0f31XGoJSTKpogcHTZo +fkUAoSz5aK66ZiegSMxUAQxQNed7zrFeXmRNG6V84FA3d4g7ME2OQiFY1WgJEXpl91vSL mKtJJ0DE4DNyuMnHaGnWNugeeeZAgcQGBLLMtTYB6dWbE+AYnRJ9EF79iGT6mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327541; a=rsa-sha256; cv=none; b=IHdaCAufDtG+Qx57HjncO21YRdsz5zOAF2DawuOjTx/QQnOJpnO5rn5dSjaKCUuf1ZHvvS 8L89AxW1HeipeFfbYpAjwAOC2Bz47WHpLF/B/UxggIqyOZQFD1hNIBWtPKkAJi42bSjaQ3 xf1sEEsqXlv80tPVgoCDSRDVfx+tCakxWCyvD7P9ILN+MseDIqc4xap8jpE8NSwET/4YNI atbmy2Tk2vcEFr7gJsMSIunWWKyfLL28QYVULw+bM9eVrxC6HBtK3ldXO79FW3TlV1OzYQ CB7HZmKUGKiPD+SIeGHRGjrd+BtDemGvd9VbdeqM6/DIoLRJhEWS9WIzW0nYEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfV6Y33Z8z8LM; Sat, 12 Jul 2025 13:39: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 56CDd126089265; Sat, 12 Jul 2025 13:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDd103089262; Sat, 12 Jul 2025 13:39:01 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:39:01 GMT Message-Id: <202507121339.56CDd103089262@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: 3e827cbaa364 - main - ipfilter: fix LINT-NOINET6 build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3e827cbaa3641d7137d7c7f1af326243bf46ae15 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e827cbaa3641d7137d7c7f1af326243bf46ae15 commit 3e827cbaa3641d7137d7c7f1af326243bf46ae15 Author: Kristof Provost AuthorDate: 2025-07-12 13:00:38 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 13:04:16 +0000 ipfilter: fix LINT-NOINET6 build Event: Berlin 2025 Hackathon Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 04850549db98..6eb6cf2a7a47 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -463,13 +463,14 @@ ipf_send_ip(fr_info_t *fin, mb_t *m) int ipf_send_icmp_err(int type, fr_info_t *fin, int dst) { - int err, hlen, xtra, iclen, ohlen, avail, code; + int err, hlen, xtra, iclen, ohlen, avail; struct in_addr dst4; struct icmp *icmp; struct mbuf *m; i6addr_t dst6; void *ifp; #ifdef USE_INET6 + int code; ip6_t *ip6; #endif ip_t *ip, *ip2; @@ -477,8 +478,8 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) if ((type < 0) || (type >= ICMP_MAXTYPE)) return (-1); - code = fin->fin_icode; #ifdef USE_INET6 + code = fin->fin_icode; /* See NetBSD ip_fil_netbsd.c r1.4: */ if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int))) return (-1); From nobody Sat Jul 12 14:19:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfW1V2Dd4z61vtd; Sat, 12 Jul 2025 14:19: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfW1V0nmJz3Wx2; Sat, 12 Jul 2025 14:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752329982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ok5c5iHxKtk0jEU1lY3orrTzyrKRTremph4Q4RtXxGE=; b=lePKSG1NWkieNsvfLqqaCnA/tmJxklH7QwccEhzW1/9+iinnl+pnzqIpx1pguTDDD0Ivq6 5j6DXTS4fAm4yx+XBUMci9NTzaXCjCyLkU6EROLn/FMBimafLXr94pfG7QiWDrwVLmNjs/ cSjU2u+wgKbufMQXhyOmii9+vlkWq140TZ09gGte/4Ndk9xetMsSSSsv5QumJkf2rd7395 B7NVrqioH2wysziruWDoE55/nBKYmHSvOV7om8qAiBjOgKLEDPy5PBhKjcBcitgE6Lf1/B wjgIM08s4lWFFzak+z6Efyx4ycPemzRUXBw4teGef0plD9WCsWU0eFx+k7l76g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752329982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ok5c5iHxKtk0jEU1lY3orrTzyrKRTremph4Q4RtXxGE=; b=n4sczJxlusAhuS7ZR7xpeDhHT4cO5UX8MrlaDucOmtARuA43EgMCdpb0ZFWb8JIs5tLV8R T5s8IuEH5PE95jQc4wIHBP4axTiKQSUeQWvYXRywiqtTabARYtJgLpr7jGJungDlAZzNhn 8ogGjP36O3JtigdwUK4TQycFSElavkOew57q0eSZNTav0m8490kHdwZLdHnKIZboZpT/qn rU+Tk/pjgSkZwWeIyiwkWlBbw8Gh0lEUMumFi+i4q80LJ8GzNQjIw8v8M+DbDslqQWtTNe 4nEE8MHp9KJ7B4DrtWyCfEXMrCNxtct4DnswlNBYYik0sDt6kVJFNqWfPkBqtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752329982; a=rsa-sha256; cv=none; b=uyVWOAZ1tmdtUJlevFdg8I9ZrtnWTBSNZ4N1QwF1qNutVJQeZVPsn3zPrZw4OjopMJjVL3 ggLv3sw+haHwsqviE4JPO/Irqfq8h83CL1V8dDztW3Y28WiPM9FlJX3+xbTNeLpYZxtQPX 5xk4kxkQ8Ojs4iRRxSUp8S5HO2TbVFRgfs0bQpIpjmk5RouJ5ljxgmjm2RPrpQFQ8dYuwd op9spjpoZV5OCIqRRNz8DEVUXpJmA+bV0mXEvNlYHNS9yvO68YRzFPrXmgnnBe7jXy2Iok EBMGGgYTGxXhSUYD7kE1baK32u6CKex1BqCGRVF0oQ2PT4vRkHqJBDQrTB0cLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfW1T70RdzBGh; Sat, 12 Jul 2025 14:19: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 56CEJfen064970; Sat, 12 Jul 2025 14:19:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CEJf92064967; Sat, 12 Jul 2025 14:19:41 GMT (envelope-from git) Date: Sat, 12 Jul 2025 14:19:41 GMT Message-Id: <202507121419.56CEJf92064967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: dedb4d3597e5 - main - pf: Don't return src node and hash from pf_map_addr_sn List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dedb4d3597e548bf72c380c850b061a8f5bec729 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=dedb4d3597e548bf72c380c850b061a8f5bec729 commit dedb4d3597e548bf72c380c850b061a8f5bec729 Author: Kajetan Staszkiewicz AuthorDate: 2025-05-08 08:28:22 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-12 14:15:10 +0000 pf: Don't return src node and hash from pf_map_addr_sn The function pf_map_addr_sn() already returns naddr and nkif, there is no need to return the source node too, it is redundant. --- sys/net/pfvar.h | 1 - sys/netpfil/pf/pf.c | 4 +-- sys/netpfil/pf/pf_lb.c | 86 ++++++++++++++++++++++---------------------------- 3 files changed, 39 insertions(+), 52 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f915f6d0f8fa..8ee4d00daaff 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2714,7 +2714,6 @@ u_short pf_map_addr(u_int8_t, struct pf_krule *, u_short pf_map_addr_sn(u_int8_t, struct pf_krule *, struct pf_addr *, struct pf_addr *, struct pfi_kkif **nkif, struct pf_addr *, - struct pf_ksrc_node **, struct pf_srchash **, struct pf_kpool *, pf_sn_types_t); int pf_get_transaddr_af(struct pf_krule *, struct pf_pdesc *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index d5f01e5c4956..41658a29014e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5901,8 +5901,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, M_SETFIB(pd->m, pd->act.rtableid); if (r->rt) { - struct pf_ksrc_node *sn = NULL; - struct pf_srchash *snh = NULL; /* * Set act.rt here instead of in pf_rule_to_actions() because * it is applied only from the last pass rule. @@ -5910,7 +5908,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, pd->act.rt = r->rt; /* Don't use REASON_SET, pf_map_addr increases the reason counters */ ctx.reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, - &pd->act.rt_kif, NULL, &sn, &snh, &(r->route), PF_SN_ROUTE); + &pd->act.rt_kif, NULL, &(r->route), PF_SN_ROUTE); if (ctx.reason != 0) goto cleanup; } diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 97e69c9d1986..d4728f61dce8 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -80,7 +80,6 @@ static enum pf_test_status pf_step_into_translation_anchor(int, struct pf_test_c struct pf_krule *); static int pf_get_sport(struct pf_pdesc *, struct pf_krule *, struct pf_addr *, uint16_t *, uint16_t, uint16_t, - struct pf_ksrc_node **, struct pf_srchash **, struct pf_kpool *, struct pf_udp_mapping **, pf_sn_types_t); static bool pf_islinklocal(const sa_family_t, const struct pf_addr *); @@ -291,10 +290,8 @@ pf_match_translation(int rs_num, struct pf_test_ctx *ctx) } static int -pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, - struct pf_addr *naddr, uint16_t *nport, uint16_t low, - uint16_t high, struct pf_ksrc_node **sn, - struct pf_srchash **sh, struct pf_kpool *rpool, +pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, + uint16_t *nport, uint16_t low, uint16_t high, struct pf_kpool *rpool, struct pf_udp_mapping **udp_mapping, pf_sn_types_t sn_type) { struct pf_state_key_cmp key; @@ -322,19 +319,24 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, pf_addrcpy(&udp_source.addr, &pd->nsaddr, pd->af); udp_source.port = pd->nsport; if (udp_mapping) { + struct pf_ksrc_node *sn = NULL; + struct pf_srchash *sh = NULL; *udp_mapping = pf_udp_mapping_find(&udp_source); if (*udp_mapping) { pf_addrcpy(naddr, &(*udp_mapping)->endpoints[1].addr, pd->af); *nport = (*udp_mapping)->endpoints[1].port; - /* Try to find a src_node as per pf_map_addr(). */ - if (*sn == NULL && rpool->opts & PF_POOL_STICKYADDR && + /* + * Try to find a src_node as per pf_map_addr(). + * XXX: Why? This code seems to do nothing. + */ + if (rpool->opts & PF_POOL_STICKYADDR && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) - *sn = pf_find_src_node(&pd->nsaddr, r, - pd->af, sh, sn_type, false); - if (*sn != NULL) - PF_SRC_NODE_UNLOCK(*sn); + sn = pf_find_src_node(&pd->nsaddr, r, + pd->af, &sh, sn_type, false); + if (sn != NULL) + PF_SRC_NODE_UNLOCK(sn); return (0); } else { *udp_mapping = pf_udp_mapping_create(pd->af, &pd->nsaddr, @@ -346,7 +348,7 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, } if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, NULL, &init_addr, - sn, sh, rpool, sn_type)) + rpool, sn_type)) goto failed; if (pd->proto == IPPROTO_ICMP) { @@ -470,9 +472,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, * pick a different source address since we're out * of free port choices for the current one. */ - (*sn) = NULL; if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, NULL, - &init_addr, sn, sh, rpool, sn_type)) + &init_addr, rpool, sn_type)) return (1); break; case PF_POOL_NONE: @@ -503,7 +504,6 @@ pf_islinklocal(const sa_family_t af, const struct pf_addr *addr) static int pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, uint16_t *nport, - struct pf_ksrc_node **sn, struct pf_srchash **sh, struct pf_udp_mapping **udp_mapping, struct pf_kpool *rpool) { uint16_t psmask, low, highmask; @@ -523,16 +523,14 @@ pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r, for (i = cut; i <= ahigh; i++) { low = (i << ashift) | psmask; - if (!pf_get_sport(pd, r, - naddr, nport, low, low | highmask, sn, sh, rpool, - udp_mapping, PF_SN_NAT)) + if (!pf_get_sport(pd, r, naddr, nport, low, low | highmask, + rpool, udp_mapping, PF_SN_NAT)) return (0); } for (i = cut - 1; i > 0; i--) { low = (i << ashift) | psmask; - if (!pf_get_sport(pd, r, - naddr, nport, low, low | highmask, sn, sh, rpool, - udp_mapping, PF_SN_NAT)) + if (!pf_get_sport(pd, r, naddr, nport, low, low | highmask, + rpool, udp_mapping, PF_SN_NAT)) return (0); } return (1); @@ -767,36 +765,33 @@ done_pool_mtx: u_short pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, struct pf_addr *naddr, struct pfi_kkif **nkif, struct pf_addr *init_addr, - struct pf_ksrc_node **sn, struct pf_srchash **sh, struct pf_kpool *rpool, - pf_sn_types_t sn_type) + struct pf_kpool *rpool, pf_sn_types_t sn_type) { + struct pf_ksrc_node *sn = NULL; + struct pf_srchash *sh = NULL; u_short reason = 0; - KASSERT(*sn == NULL, ("*sn not NULL")); - /* * If this is a sticky-address rule, try to find an existing src_node. - * Request the sh to be unlocked if sn was not found, as we never - * insert a new sn when parsing the ruleset. */ if (rpool->opts & PF_POOL_STICKYADDR && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) - *sn = pf_find_src_node(saddr, r, af, sh, sn_type, false); + sn = pf_find_src_node(saddr, r, af, &sh, sn_type, false); - if (*sn != NULL) { - PF_SRC_NODE_LOCK_ASSERT(*sn); + if (sn != NULL) { + PF_SRC_NODE_LOCK_ASSERT(sn); /* If the supplied address is the same as the current one we've * been asked before, so tell the caller that there's no other * address to be had. */ - if (PF_AEQ(naddr, &(*sn)->raddr, af)) { + if (PF_AEQ(naddr, &(sn->raddr), af)) { reason = PFRES_MAPFAILED; goto done; } - pf_addrcpy(naddr, &(*sn)->raddr, af); + pf_addrcpy(naddr, &(sn->raddr), af); if (nkif) - *nkif = (*sn)->rkif; + *nkif = sn->rkif; if (V_pf_status.debug >= PF_DEBUG_NOISY) { printf("pf_map_addr: src tracking maps "); pf_print_host(saddr, 0, af); @@ -828,8 +823,8 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, } done: - if ((*sn) != NULL) - PF_SRC_NODE_UNLOCK(*sn); + if (sn != NULL) + PF_SRC_NODE_UNLOCK(sn); if (reason) { counter_u64_add(V_pf_status.counters[reason], 1); @@ -883,8 +878,6 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, { struct pf_pdesc *pd = ctx->pd; struct pf_addr *naddr; - struct pf_ksrc_node *sn = NULL; - struct pf_srchash *sh = NULL; uint16_t *nportp; uint16_t low, high; u_short reason; @@ -912,8 +905,8 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, high = rpool->proxy_port[1]; } if (rpool->mape.offset > 0) { - if (pf_get_mape_sport(pd, r, naddr, nportp, &sn, - &sh, &ctx->udp_mapping, rpool)) { + if (pf_get_mape_sport(pd, r, naddr, nportp, + &ctx->udp_mapping, rpool)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: MAP-E port allocation (%u/%u/%u)" " failed\n", @@ -923,8 +916,8 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, reason = PFRES_MAPFAILED; goto notrans; } - } else if (pf_get_sport(pd, r, naddr, nportp, low, high, &sn, - &sh, rpool, &ctx->udp_mapping, PF_SN_NAT)) { + } else if (pf_get_sport(pd, r, naddr, nportp, low, high, + rpool, &ctx->udp_mapping, PF_SN_NAT)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation (%u-%u) failed\n", rpool->proxy_port[0], rpool->proxy_port[1])); @@ -1010,7 +1003,7 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, uint16_t cut, low, high, nport; reason = pf_map_addr_sn(pd->af, r, &pd->nsaddr, naddr, NULL, - NULL, &sn, &sh, rpool, PF_SN_NAT); + NULL, rpool, PF_SN_NAT); if (reason != 0) goto notrans; if ((rpool->opts & PF_POOL_TYPEMASK) == PF_POOL_BITMASK) @@ -1127,8 +1120,6 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) struct pf_addr ndaddr, nsaddr, naddr; u_int16_t nport = 0; int prefixlen = 96; - struct pf_srchash *sh = NULL; - struct pf_ksrc_node *sns = NULL; bzero(&nsaddr, sizeof(nsaddr)); bzero(&ndaddr, sizeof(ndaddr)); @@ -1147,9 +1138,8 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) panic("pf_get_transaddr_af: no nat pool for source address"); /* get source address and port */ - if (pf_get_sport(pd, r, &nsaddr, &nport, - r->nat.proxy_port[0], r->nat.proxy_port[1], &sns, &sh, &r->nat, - NULL, PF_SN_NAT)) { + if (pf_get_sport(pd, r, &nsaddr, &nport, r->nat.proxy_port[0], + r->nat.proxy_port[1], &r->nat, NULL, PF_SN_NAT)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: af-to NAT proxy port allocation (%u-%u) failed", r->nat.proxy_port[0], r->nat.proxy_port[1])); @@ -1175,7 +1165,7 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) /* get the destination address and port */ if (! TAILQ_EMPTY(&r->rdr.list)) { if (pf_map_addr_sn(pd->naf, r, &nsaddr, &naddr, NULL, NULL, - &sns, NULL, &r->rdr, PF_SN_NAT)) + &r->rdr, PF_SN_NAT)) return (-1); if (r->rdr.proxy_port[0]) pd->ndport = htons(r->rdr.proxy_port[0]); From nobody Sat Jul 12 14:24:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfW6Y1lNbz61w9j; Sat, 12 Jul 2025 14:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfW6Y19JCz3Zj0; Sat, 12 Jul 2025 14:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hn19xXmm5pt5y1maKimD30RTfrSP0ZSWSQiGou5lw/g=; b=PwGhMN9nXIMPAUoMtkhZLFqEnPpaFQaEywxEGOlqpN5Zou6M+vAbfMt7/GlMGuxn3dW1mU yTUoAH3Z/tqVt4fG+F1wBqS51o3Jn7mU+A9hSubcgrX2CdSEuKNhPQk7vOZWpD+h9Hypht zj6/E9X1ah/pAFhwHtUv8CYnHIQrOe1SAQ9iZ/VFUA+T8HAWSoqnoMTyhvkh4bsjVtm7sQ kfxKBu/Ptk6LUENGda1IEmIa78YO+FHU+QPTUHNTsw+QchMVxU25l01V7ArPbGU0n3ZbvZ X+QwlrFbRr4MO9ovrhUDUsXpU8HReYM2vKG1ElO9Zt/JVDTrhVwd96DMEAQXTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hn19xXmm5pt5y1maKimD30RTfrSP0ZSWSQiGou5lw/g=; b=VO2F3tf2ollq70WBC5brDZR95FJ/HXLR44lvcgbPhrgyLGb9u9LzUgEU0OOT0pSSUeOq7I l6nZ3jOXOKdrhQTq7MdCwwyN0aA/P03XdZEf8cyRmiBPjvz4kwYlO9K0J0VDWKIvJpVkSm mhdCYmmVPmK1i4hxP9JeliV/RxKgDd99yFs2yON+tzWdJ4lJ0KPTY+aLU0jD6rFpZFMTl6 cAC32f9F/tA8C7nekUnVRVgaFZnQJsB3kBvoIPVVInYl/M12mEH5FMlqQAAgjSGOJclC3B /RMjjHFzDKojJT/ydVyjMQTKImNrcW3WilnJuAKj/SYcwxOPjk3wqtqTAqVF1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752330245; a=rsa-sha256; cv=none; b=Ex/yu8jW5Z9DvmoQ+BupBVE69H07TJ2INk3sEseL2du0Q1Us4eBPjiclrsXEkqrcYDvunn 3jqjItLqWafHJ2pmT7qzIyqyw/keeAT4ODl13TmezhSQjskL2mOX+r1fxWBNuQg3yyfhzz LiW3X8L13uVEpEP3yUJ/VC9Hf0xfJkLtYFw80/Wj0mSVbdmj/ZX7kvnGsDqenTuY/N9fdr vu4TNkzx19Df30+cWN7CGPEoVhxg/tXuJ9XP2bv2a/lVIUZxiqocPhW6JWu3gnnA098Rp0 kPqgSM6AvXb/bIVJd7zpIVFRBP6ahPZBtwf/IlVgyqkF8JiseLR+OIObglZndg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfW6Y0gsPzBKl; Sat, 12 Jul 2025 14:24: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 56CEO40T082537; Sat, 12 Jul 2025 14:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CEO4F6082534; Sat, 12 Jul 2025 14:24:04 GMT (envelope-from git) Date: Sat, 12 Jul 2025 14:24:04 GMT Message-Id: <202507121424.56CEO4F6082534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 0430faacb61d - main - gstat(8): Fix typo in example to filter the results List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0430faacb61d83ea6eaf3100b44e95de2b5f83ff Auto-Submitted: auto-generated The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=0430faacb61d83ea6eaf3100b44e95de2b5f83ff commit 0430faacb61d83ea6eaf3100b44e95de2b5f83ff Author: Brad Davis AuthorDate: 2025-07-12 14:20:31 +0000 Commit: Brad Davis CommitDate: 2025-07-12 14:23:48 +0000 gstat(8): Fix typo in example to filter the results Reported by: rpokala Fixes: 5652050565f7 - gstat.8: Add an example of how to filter the results --- usr.sbin/gstat/gstat.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8 index 2975a93c7fef..e882aa75b8d7 100644 --- a/usr.sbin/gstat/gstat.8 +++ b/usr.sbin/gstat/gstat.8 @@ -124,7 +124,7 @@ Quit .Ex -std .Sh EXAMPLES To filter the output to only physical disks named ada0 through ada4: -.Dl # gstat -f ada0[0-4]$ +.Dl # gstat -f ada[0-4]$ .Sh SEE ALSO .Xr systat 1 , .Xr geom 4 , From nobody Sat Jul 12 14:31:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfWHL0tfKz61wlQ; Sat, 12 Jul 2025 14:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfWHL00p1z3dGR; Sat, 12 Jul 2025 14:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQCvv2QYJ0OsKmMdlIQ5MvPfdkSka+5TSxKPjnv8hYo=; b=iBIHYqPpT/4iVE7cYYJlpJwjuFGfCbUg8piqa7+llymYb2ECqHU8BBTD09BsLLlYikq6e5 MyvzMqWHenxJj/E00uqZWfkRkd8SxfD2glhkkCrFb1fS6l56RylxYPkZ7Kdqg+l34x3YeB bWOJJD19Y6lJYx96DMg+HMQXaOBWlagwunlhdXuvc65hbMd+Q98uPaE8C9QspBoR3t+mO/ //ArOhCO5rmyNsR38Uuc5IsFQchYUkrZTOma8SOmGiPYf0PVRW8vd3+D4ydiKyAEFeBvpl 2M79YoMj/mWTHt7BzqWahwgjncO1IHVy7s4MJMgYpRAGzQVsgwjWeact/CeViA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQCvv2QYJ0OsKmMdlIQ5MvPfdkSka+5TSxKPjnv8hYo=; b=IyN/14PDViQ3FYhCal/7rWSLXvDsYQ+MAzgYGEMCtQgYxMKu8wHi0ThlDM9PXfoRmPIcDg zOJZPSM3Murgo/no1MhnqAnLakkKbXdFG5IrMMKrmWldrLtOJleHjWP1pExwiSfqVm1wBS fLJ1pMyzXbEFNhNeVc8+DFyTKIa5r9NsZlNmgSfa1yQj6SLKLxTWjKaEqOCSnF1RPH+JcO VqXW1p+Qc3uZRI6zozBJopPUwcB5kABrOUqf9tDboNYwQ0bk2OQvxs1rEa6MpA1NCTiufG Qej5yq2lffzJY0Qf2NEdgMuPU/kCzrb8j6mdmmcY8gyt+HTBZvs4vCASWvE07w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752330702; a=rsa-sha256; cv=none; b=tonbkbeaquOJcmDS7KZvOnOhpOLL5672ITgwXDPcF40cSiSQdX7mJAYquoqzQ1YW6kav7L XAXfXYvs8B7OOi92kWl3M+Cys+co5rYUmSuciwAI4KW83HUuZ0iD0ysSSS4G5v9qHH9VET vOiVirKswpugUwp37kpqQrWjP4h0OWoRU2UjUbMjkVJTwnBOTg27HrakzGSlCaK0XyI2nu bsKHZfqbh53YyO4gBDaFaXENqm384uN5L6no1MI5Y5gGGlw/6Z3MKe6ptskhAJJ7tD8Y24 ockL29D1a4zLTMuyhVWuK9gaOJpC/0K2TtUAxrbmElgyz64bsNj2AG1JUx3qZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfWHK6jDfzBG1; Sat, 12 Jul 2025 14:31: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 56CEVf4O094759; Sat, 12 Jul 2025 14:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CEVfBi094756; Sat, 12 Jul 2025 14:31:41 GMT (envelope-from git) Date: Sat, 12 Jul 2025 14:31:41 GMT Message-Id: <202507121431.56CEVfBi094756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 16a9f31b8aae - main - pf: Don't access sk and nk before they are allocated List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16a9f31b8aae6cc16baf283183470fc17c9b488e Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=16a9f31b8aae6cc16baf283183470fc17c9b488e commit 16a9f31b8aae6cc16baf283183470fc17c9b488e Author: Kajetan Staszkiewicz AuthorDate: 2025-06-03 14:10:52 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-12 14:27:46 +0000 pf: Don't access sk and nk before they are allocated The NAT addresses are chosen during ruleset parsing. The new afto code stores post-nat addresses in nsaddr. The old nat code (also used for new nat-to rules) creates state keys and stores addresses in them. Ensure proper way of accessing the NAT addresses in case sticky-address is used for af-to rules. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50768 --- sys/netpfil/pf/pf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 41658a29014e..acdeebb85e30 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6054,9 +6054,16 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, /* src node for translation rule */ if (ctx->nr != NULL) { KASSERT(ctx->nat_pool != NULL, ("%s: nat_pool is NULL", __func__)); + /* + * The NAT addresses are chosen during ruleset parsing. + * The new afto code stores post-nat addresses in nsaddr. + * The old nat code (also used for new nat-to rules) creates + * state keys and stores addresses in them. + */ if ((ctx->nat_pool->opts & PF_POOL_STICKYADDR) && (sn_reason = pf_insert_src_node(sns, snhs, ctx->nr, - &ctx->sk->addr[pd->sidx], pd->af, &ctx->nk->addr[1], NULL, + ctx->sk ? &(ctx->sk->addr[pd->sidx]) : pd->src, pd->af, + ctx->nk ? &(ctx->nk->addr[1]) : &(pd->nsaddr), NULL, PF_SN_NAT)) != 0 ) { REASON_SET(&ctx->reason, sn_reason); goto csfailed; From nobody Sat Jul 12 16:02:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfYJ403PJz60nHy; Sat, 12 Jul 2025 16:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYJ33q99z3Kgd; Sat, 12 Jul 2025 16:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752336147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iXgidW5WJK6PICacmB4X6kWjrvyzfB0VLCZYpeZBQMU=; b=Tc6GrP3YaL6DpdLwXXj1pzKDkzztxAw3VETZ4NEezIFjzuTD2UZnzfiXBFPa4dlnPv2QPc i2LiA+u8tnXToly2epLLSoExgLKAmDAvclVHBJjqEU1MRqAKUVdx/97fXqYy/HFAuzT7Er wX+vycM69ekn+VhRXx5/nC8vpJlndOOxr/y5dGjoewbBCylnxO4lDL2GsvA2i3/eskOs+F pkwyKn6fibKEnAqkWN9p63Vi7ZuWnilua5qtk6mXB3Sj2U+3VEFPwj4my6+Wl7uA7qqSqG Q3pf6f32UVnZTGYxQLalClkleRr012AG/w5PExBxdSA9L6SyvkP+NRR73qsJQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752336147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iXgidW5WJK6PICacmB4X6kWjrvyzfB0VLCZYpeZBQMU=; b=kGSEZgukETS80Qg7ok7e77ZQO43YXDt74eWBqjYmLkbONQFJ8MOvMS3V/f4pCEn5SUTfGX tfkJA9FCfBnE7w0rnBQIUAW9We89uHJWxEH2lGG5J263TbQ9tij6ZSG2dbwfX+015+IZtE trzVHH056sq7DqBCA/sc8SjRHRe3yCOWkXRxjeF9qYBU21LrqNdjRkfyfcXAOYK0a0HuPU LD5BmdqYvwEdeD+wXvZvvxP/440gpwJlXQrPDL2QkBrEoGGETn88vl/hUoemqJlOu2QH1S F98V/wj0WiVOGnr+Y9SruaFgOYqKRkpSQR8DLoWqoahKozn+X4Sf+hgXOWwovg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752336147; a=rsa-sha256; cv=none; b=fCqKMW4PQTHuJ0v/p5GIlH4huwvInuJQpyE6LmFmtcoKopveK4w+0MtvhzICVVdilkglVF lwSab97s1Z8/Xmt6mB+v2E44q0rs/xtrEOOmqZtVLEDRpxG0N9/Y5G4drgZUiZ9QLZvEM2 sgMP4s8Se4LeKheHtlOg1z10UxXa+HNVmZyyx/AX2Leih4bVEG973vG8sWArVghLcnoiUM WLel6RBSSlAKQpAuazzY3fFG4Tp71BVAS1ninLJP1izw+oHc2LjAndDvoB/mSPqAzOjsfr MGoLFEeW2MYOvsuB4HScZwbpW6tRHWa71H8+8BJ6JJxzj1Wgb1bGlNoiEimdDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfYJ33KKJzTKB; Sat, 12 Jul 2025 16:02: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 56CG2RQn070875; Sat, 12 Jul 2025 16:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CG2RSu070873; Sat, 12 Jul 2025 16:02:27 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:02:27 GMT Message-Id: <202507121602.56CG2RSu070873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 47ffc24fbb64 - main - tracing.7: Aproposify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47ffc24fbb6476676c0d40b28e43c83dbc8fac9d Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=47ffc24fbb6476676c0d40b28e43c83dbc8fac9d commit 47ffc24fbb6476676c0d40b28e43c83dbc8fac9d Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 15:57:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 16:02:00 +0000 tracing.7: Aproposify By adding "FreeBSD" to Nd we make tracing(7) discoverable when running `apropos freebsd`. Reported by: ziaee Event: Berlin Hackathon 202507 --- share/man/man7/tracing.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index 7f21bfbbd2a3..4c9aee8ce913 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -8,7 +8,7 @@ .Os .Sh NAME .Nm tracing -.Nd introduction to tracing and performance monitoring facilities +.Nd introduction to tracing and performance monitoring facilities on FreeBSD .Sh DESCRIPTION .Fx features a large variety of tracing and performance monitoring facilities. From nobody Sat Jul 12 16:24:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfYnP0X2nz60pNw; Sat, 12 Jul 2025 16:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYnN6kqKz3QDD; Sat, 12 Jul 2025 16:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LnzYbetuIZrN1+DkIJNFeN1t61914soR8okwRzEcDjU=; b=WtrIVzfnee66a2BD6QaXKLrfVRU+O1TKhbpnS3Ybuij+hSiPGxMVYmasZoAdXkYcQDavx2 FsWvt0oIBT+sN8uZ3cp2Iy/MDd9dtakhoBhd1jVTnK1t5xkmh0O7p0fX/i5f7yiiAyQYJG C2vsEP4gseOKK2INXBdxVPjz8afeyo1SzkyGeoozP5+dG6EhX9bl499l4KpOLiMkneGLRn LMKkrYNZC1sYkVHCc5dpUHM9/Uj6WqJtMFQI/+xIty+Z7B3pZzxGkUg0gI6gllxjXz1G5r yg6P2Zsj1OkOu38Sf1nsfPbrYwYc05l84JAmkAMKF3J+m7UK4PyO2thxdw3rJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LnzYbetuIZrN1+DkIJNFeN1t61914soR8okwRzEcDjU=; b=xTKpinKEHqYKE3j4T8EAQxtTY6UInfFi/K0fP9Y8zR7ZbzouvDVhhu3LvadtCkfOPj3i3c 8UADaSdGEKueQxupI0BxNOLn4ixGI2oL3Ovf5ToBmdO0fmjSoRByJnV3b8wv8vKdyQi//R dSGKC3VVGszq/rrns33RiqdMkXvPXRiyZQkR66w2L8W5X1W+i1V6gP6BbJVouc5biKNwrB xQwqBLyH+DAVLdOnfS1B04/fZYv5a/LiUE8rWB5I0b1XIFj6lHzG3LZQ1YYF9lMatT6Dcf dghin6cIJn78D0pvz4QC1R2DzMXdOUwJ9eXpWbqtzsEnjuzQ8zE9t9Xp3y2ajw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752337465; a=rsa-sha256; cv=none; b=R5/1qSdcqr9Dp17Hl02oGfIMbP5k97/MjAgA1+13eY+b7YjzxQFU5UczsinecnjfyGB4p9 fAlLjY+tRPT8vtsdoGvBNTTtw431edqDYnJyH8FJE3TjvEZP3JfLDyLAUmzFnGJWtjhrbu HuSugRFswZRGB1JGnPsfM6RtviOxoXRVYRbwPUQ48KPBlR1lU76mDQlfiZp+kaSk29bpLp Zhiq86DfiYSSx/1mvvsp4WRmsbjKkpPlkrn8e/5x/67uLLcdVCmN5HRXU7mrbSJJUZ+1UA wBwhvd/LeevWenlYmmqEq0NOU8oQ1SuUWH/yxQBjYJ8pOiZXH1UnFltk/ZcLag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfYnN604KzVcb; Sat, 12 Jul 2025 16:24: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 56CGOOXo008094; Sat, 12 Jul 2025 16:24:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CGOOkX008091; Sat, 12 Jul 2025 16:24:24 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:24:24 GMT Message-Id: <202507121624.56CGOOkX008091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 46f18ecf8d3c - main - rc: Use check_jail to check values of security.jail MIBs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46f18ecf8d3cdda1cd433841c44a4c1268ab9721 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=46f18ecf8d3cdda1cd433841c44a4c1268ab9721 commit 46f18ecf8d3cdda1cd433841c44a4c1268ab9721 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 16:20:32 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 16:20:32 +0000 rc: Use check_jail to check values of security.jail MIBs PR: 282404 Reviewed by: markj, netchild Approved by: markj (mentor) MFC after: 2 weeks Event: Berlin Hackathon 202507 Differential Revision: https://reviews.freebsd.org/D47329 --- libexec/rc/rc | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/routing | 2 +- libexec/rc/rc.d/zfs | 8 ++++---- libexec/rc/rc.d/zfsbe | 2 +- libexec/rc/rc.shutdown | 4 ++-- libexec/rc/rc.subr | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 5ed47d6eac20..db3c3e20ab44 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -83,9 +83,9 @@ fi trap "_rc_conf_loaded=false; load_rc_config" ALRM skip="-s nostart" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then skip="$skip -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then skip="$skip -s nojailvnet" fi fi diff --git a/libexec/rc/rc.d/hostname b/libexec/rc/rc.d/hostname index 8b26c4f60633..0bc31ccd787e 100755 --- a/libexec/rc/rc.d/hostname +++ b/libexec/rc/rc.d/hostname @@ -42,8 +42,8 @@ hostname_start() # If we are not inside a jail, set the host name. # If we are inside a jail, set the host name if it is permitted. # - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then - if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then + if check_jail jailed; then + if ! check_jail set_hostname_allowed; then return fi else diff --git a/libexec/rc/rc.d/routing b/libexec/rc/rc.d/routing index 893acb83cf4a..dd75604125a3 100755 --- a/libexec/rc/rc.d/routing +++ b/libexec/rc/rc.d/routing @@ -331,7 +331,7 @@ _check_dynamicrouting() # copied from /etc/rc skip="-s nostart" - if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then skip="$skip -s nojail" fi [ -n "$local_startup" ] && find_local_scripts_new diff --git a/libexec/rc/rc.d/zfs b/libexec/rc/rc.d/zfs index 26bf3046444b..f88f65c2ec18 100755 --- a/libexec/rc/rc.d/zfs +++ b/libexec/rc/rc.d/zfs @@ -18,7 +18,7 @@ required_modules="zfs" zfs_start_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs mount -a fi } @@ -34,7 +34,7 @@ zfs_start_main() zfs_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_start_jail else zfs_start_main @@ -54,7 +54,7 @@ zfs_poststart() zfs_stop_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs unmount -a fi } @@ -67,7 +67,7 @@ zfs_stop_main() zfs_stop() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_stop_jail else zfs_stop_main diff --git a/libexec/rc/rc.d/zfsbe b/libexec/rc/rc.d/zfsbe index f61f3bf097f0..22d53f219679 100755 --- a/libexec/rc/rc.d/zfsbe +++ b/libexec/rc/rc.d/zfsbe @@ -64,7 +64,7 @@ activate_bootonce() be_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then : else mount -p | while read _dev _mp _type _rest; do diff --git a/libexec/rc/rc.shutdown b/libexec/rc/rc.shutdown index 18f67f5ca124..3dfd7a7e0936 100644 --- a/libexec/rc/rc.shutdown +++ b/libexec/rc/rc.shutdown @@ -83,9 +83,9 @@ fi # and perform the operation # rcorder_opts="-k shutdown" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then rcorder_opts="$rcorder_opts -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then rcorder_opts="$rcorder_opts -s nojailvnet" fi fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 2eaf336b5220..e4ed5de6cde6 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1689,7 +1689,7 @@ $_cpusetcmd $command $rc_flags $command_args" start) # We cannot use protect(1) inside jails. if [ -n "$_oomprotect" ] && [ -f "${PROTECT}" ] && - [ "$(sysctl -n security.jail.jailed)" -eq 0 ]; then + ! check_jail jailed; then [ -z "${rc_pid}" ] && eval $_pidcmd case $_oomprotect in [Aa][Ll][Ll]) From nobody Sat Jul 12 16:24:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfYnQ2BSqz60pLf; Sat, 12 Jul 2025 16:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYnP6j5pz3QGd; Sat, 12 Jul 2025 16:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bc8Mig+o01AvF1cfjiAMiEGCjfyrRDGRmWlRXwkkn1E=; b=qOqjqjOPKnjKzvPuCNJXX4dJWS4y8pGgR4mf/Aa7mqoTAD/6WyFOgcM59hSv9y9l4U6Idc iq4JX/Hx1ejF9fnh9U/7fOcv0Pv32lVYJj4Cd0oviPW8tjd9ptUwmbxYV0w1SlBhgKIGRo fnPfzB1iqNnX3Uhp+D6dT+ZjTOVdti/vMf2gfvD3zLqjLpXhAeJ7K25xg9T9zJK49bTpI3 4ckRGH3WVfR0AoVCB8Da8AwA1S4hBVtZVYjiT4t26PzCb6iaHivRW1v8Utc9c07T/70erw H/LXDuYgXIGQvmSsi2HN1p8kXa/YsUbllDMpUnjIujAytRigppJanpXBWR/TgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bc8Mig+o01AvF1cfjiAMiEGCjfyrRDGRmWlRXwkkn1E=; b=opt2QSyj96v07h/FichQDfaVJ2pcqdJOcl+pumXvHnPoX6XjJbeAJ4amEEckFsRx1NCUUp ZhTKZu0cyA1CCO1I8s6Ee0PTfIsb3Co6L7I1sLtRzo2jhu/evMT4x+PLZk33XHjU8p+CJA 89w2z5RGZiI1RZkRaEbK/bElFItUUEoZRC5nxIKfblqatce3OLwoP4Kx4b3V+X6BmS8sDZ vm7kMveQLHM3edRZ3HAYraGLHmVCEoL3+BkZ2EPGOP+n1RhjEQbI3ME7HTsV/bTOSv9pey IIl/qqOXfbsKg0kwS2YYiegOSk5v5r4ShcpE9WhYMUF1CG+6QvEjYKfS+KxfWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752337466; a=rsa-sha256; cv=none; b=KLJ8zL2KOOmg7ealh7psJIx7VOp1nXwOTzLnaPaeJcnq/WkeU9ti8QqX58aB9OtgHyxOOt WSFcIX8zykAnWW6KnQ/QK8Ael8PRGcpjfxrQR5y98MvdUYjWpSGUJzU5az7vhrGeaxIPtA 0ctVWVFLTgX0LUmUwQbP8Y+zLSjww5c6NC+fq99xtb6WQS5G4p/ioqltgAD4WzZxk2I32M 0MhUal3ak4eKXxpjz2D7Savw1sw5uOKhwoJxXmlWWxif7kUvHAEM4r0Ahwy99QeKakND4Z Io7G1qgdBH7PpgMB3Pkk/fgORSYItB6TmQNpPBPF/cTO8Eo7qv+XAhnvzt+VwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfYnP6H5SzW0g; Sat, 12 Jul 2025 16:24: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 56CGOP5v008127; Sat, 12 Jul 2025 16:24:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CGOPV4008124; Sat, 12 Jul 2025 16:24:25 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:24:25 GMT Message-Id: <202507121624.56CGOPV4008124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5d5258653ba4 - main - rc.subr: Fix a typo in check_jail()'s description List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d5258653ba4b37c38e48443f265ee4dcedf9a50 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d5258653ba4b37c38e48443f265ee4dcedf9a50 commit 5d5258653ba4b37c38e48443f265ee4dcedf9a50 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 16:23:03 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 16:23:03 +0000 rc.subr: Fix a typo in check_jail()'s description MFC after: 3 days Event: Berlin Hackathon 202507 --- libexec/rc/rc.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index e4ed5de6cde6..a2e2e98a5087 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -2671,7 +2671,7 @@ check_required_after() } # check_jail mib -# Return true if security.jail.$mib exists and set to 1. +# Return true if security.jail.$mib exists and is set to 1. check_jail() { From nobody Sat Jul 12 16:29:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfYvT13r6z60pm7; Sat, 12 Jul 2025 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYvS6pvTz3T33; Sat, 12 Jul 2025 16: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=1752337781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02TWLk7lFTZArWjXnLtAYeiM0yHS6rxFbGGiarBzLUI=; b=gNzg8HrTop/TXUjuTYmJ4iy09B8MB6P5wOzOUhHAHxhh1YoP80Hjfq46wqAiQHLbcYw7Fm Jerq7PzHZUmmj3PmpLrma2328gsLBJHSVKyUjvku8RmpseBtRhXEvxQjKStPb6GLX87Squ /cZayvfuPba9Lv3FFFbNlCc+Cooa14O7FW1r68B9Kr17hATW7BHJ3GhTsnMbdVkK5xzKak 1MjnCsYPUt4H6wxv9xixSiTRdZSep9u9Cjk27af9KVU30gPOBpb1YACJymFC56elKdbUFG NRWP2XbKE5IMaMD8TRkpc02AOsEfZDh6DNUht9oFEIB91RoBxaWNZkBOWE87ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02TWLk7lFTZArWjXnLtAYeiM0yHS6rxFbGGiarBzLUI=; b=hlpkFX38w4w1vIW2i6FizcnhVHyN/uxJYR0b79RM2JDnobqSVSIYxAfw+nFtpGFsfzil6n wk4npDCtE1B42//vY0zcR9oJh7P2UJms6UVk8ptLGv8etVl7pVmaxFStfLUNGR5ZhWuuVb 1xuYKuUqr3hirB3mOsusAOAFB/JUyM2G/ldfqIeXicH8E5LblpbTogjOY7o2UyOKzR29SS FHvuofktbdVYK6NyzxmjuhXZ2R/yINCLB9UMTiRcUodGF6vE2Y62Gx2y+XM06Jhybf5aCa HC5Pc3y9omuh5dcvqiOFmTfHFEXhjQJQIuToDFp03AyDSXR0c2svCDRv4UD9QQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752337781; a=rsa-sha256; cv=none; b=V2WRpWP8VIcOkKecy5qfB6I7Wf+v3mSaf/jbWOQQHKZsGEYn1bwMjCqTIeb0jSTvWrVq/G BnTCi+SpWMJML5BojGErqz+bYU66P80zyDt+wn5eZV6tyh49DobpU/QDVme7OKMo7Vzg+m klO5no0oA2wkXrTmb9z6AJhyScOfU5bm5a7QTIHJmYgCAE+KWsht2cnD0qDWKrhwmiy1qJ F31WZ1s4ZuoJRBAsBvY8QAQ59ZDSKUD6dTblMk28czhH60CKabVeHhwQV94iAJQsF8Cbee U9+j0f3EGiVnn8PvrnUZLqxr8I7vY4VntXuxLrL+WyS+v+6e1eWIbsOEmN95MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfYvS6Fg3zVfn; Sat, 12 Jul 2025 16: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 56CGTeYJ009782; Sat, 12 Jul 2025 16: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 56CGTewA009779; Sat, 12 Jul 2025 16:29:40 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:29:40 GMT Message-Id: <202507121629.56CGTewA009779@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: f5dba673345e - main - pf tests: fix anchor:nat test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f5dba673345e2bbc63df057976d9296cb735f96f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5dba673345e2bbc63df057976d9296cb735f96f commit f5dba673345e2bbc63df057976d9296cb735f96f Author: Kristof Provost AuthorDate: 2025-07-12 15:41:10 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 16:29:27 +0000 pf tests: fix anchor:nat test Don't assume that the epair we created is epair0. Event: Berlin 2025 Hackathon --- tests/sys/netpfil/pf/anchor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 4692c06142df..64ca84b34c3d 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -350,9 +350,9 @@ nat_body() jexec alcatraz pfctl -sn -a "foo/bar" jexec alcatraz pfctl -sn -a "foo/baz" - atf_check -s exit:0 -o match:"nat log on epair0a inet from 192.0.2.0/24 to any port = domain -> 192.0.2.1" \ + atf_check -s exit:0 -o match:"nat log on ${epair}a inet from 192.0.2.0/24 to any port = domain -> 192.0.2.1" \ jexec alcatraz pfctl -sn -a "*" - atf_check -s exit:0 -o match:"rdr on epair0a inet proto tcp from any to any port = echo -> 127.0.0.1 port 7" \ + atf_check -s exit:0 -o match:"rdr on ${epair}a inet proto tcp from any to any port = echo -> 127.0.0.1 port 7" \ jexec alcatraz pfctl -sn -a "*" } From nobody Sat Jul 12 17:03:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfZfW59gxz60rf2; Sat, 12 Jul 2025 17:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfZfW4R2Qz3lGj; Sat, 12 Jul 2025 17:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752339811; 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=4UcrM1nuvseJk7t4thFpjAOxbCep04jDJKqzM1vgcp4=; b=ZDsKBfQkF08sTmmTsX4URlWJ6wFHwHyEW3t7dp7DeJgZQQrQilKdU9U92WjKNvfivdkMII w/LKOoP75+ZE/oX6yf20pyapEk9TFYoHuRRH5+4CWzs3Ey8PbPecyAWTxRycgDXPQxf6h6 wbe6RmZLchr3pn9n1Ft3ash9ZGULVZkBX8gDnNVhYtd8VXLQ6NaTBeQWuMFsKsziuA3wDW fh79pi5rIrOfC+YYyv3UKNf1EgFi96Deb5sK1yGgos0ZyBGK9qbxjQ+Pjwe1oczB6ht2fO E8ruxeBZSvuC+AH2c2n7CeHruUgQXRXp1qO6yE1KJ0MmAMkmPHuQEnNBSYJU4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752339811; 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=4UcrM1nuvseJk7t4thFpjAOxbCep04jDJKqzM1vgcp4=; b=WS9CANchjLpXZQmML5FftaBvze5o5JN/2ogeNB8qUcY9P9B0FRpx2FQ1PtFh02iZQWzvKE qSshoN9nUyCAAdt1fGfXEyUuTRNGzxBjxjXLK2x8tgnoffXH2X03cacEIDxemPZAp9rfNT z2zVbfw5GCRIclT6aYJE/TvzqQmCXh6+dBJAgKATXHI+FwEM+GXi85wKP1Ex5XaEl7TZgG iaKwS8KFTCDc7PTJIiv47sM+ehf9laKrl4QVrF2tqWMrxcgT166z1p13OWZv8/vJKnJS5f ecyquzVXVb0vhTgPLuhZGeT9GtghxZE3SBK3mpQURdFkWt87UgGikT6ZhGscXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752339811; a=rsa-sha256; cv=none; b=Kx8FrN+uLTBUPhDP1XxlV50CcnWWHrLDlKKn4sEbv5DcByZtRGVf26yN4TXd+fsuD3y0k+ AgfPF1zUb3FnN56XzeEdYK70spN3O4yfVvpuq5xzPceKT1EHDF2GJ3bTCgql2QjVaWpMJj J5KdLR4uq/Mncy4OEWSXi4USQ5H3yGFJzsxqPSe08ftlOyBcU9zx9Jy9yqvyAiBfn/UV55 znxKk73ih9NaNnVc4XUC7z0EpUwWuB0SVO4qsl8g7Y3UsP9/JZrzEjimqEAnEJ9kiewnSj ah8A8fZ4aEtesJTCdmT1oRhfaNX6y59GR+cAnhCe6r+jq1SKe+W68jZ5e/4+aw== Received: from [IPV6:2601:5c0:4200:b830:981d:893e:66ee:6efa] (unknown [IPv6:2601:5c0:4200:b830:981d:893e:66ee:6efa]) (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 4bfZfW2DjTzv4b; Sat, 12 Jul 2025 17:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5906dd0e-9812-449b-af7a-ee64c9a4ab56@FreeBSD.org> Date: Sat, 12 Jul 2025 13:03:30 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 3e827cbaa364 - main - ipfilter: fix LINT-NOINET6 build Content-Language: en-US To: Cy Schubert References: <202507121339.56CDd103089262@gitrepo.freebsd.org> From: John Baldwin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, Kristof Provost In-Reply-To: <202507121339.56CDd103089262@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/12/25 09:39, Kristof Provost wrote: > The branch main has been updated by kp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3e827cbaa3641d7137d7c7f1af326243bf46ae15 > > commit 3e827cbaa3641d7137d7c7f1af326243bf46ae15 > Author: Kristof Provost > AuthorDate: 2025-07-12 13:00:38 +0000 > Commit: Kristof Provost > CommitDate: 2025-07-12 13:04:16 +0000 > > ipfilter: fix LINT-NOINET6 build > > Event: Berlin 2025 Hackathon > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c > index 04850549db98..6eb6cf2a7a47 100644 > --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c > +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c > @@ -463,13 +463,14 @@ ipf_send_ip(fr_info_t *fin, mb_t *m) > int > ipf_send_icmp_err(int type, fr_info_t *fin, int dst) > { > - int err, hlen, xtra, iclen, ohlen, avail, code; > + int err, hlen, xtra, iclen, ohlen, avail; > struct in_addr dst4; > struct icmp *icmp; > struct mbuf *m; > i6addr_t dst6; > void *ifp; > #ifdef USE_INET6 > + int code; > ip6_t *ip6; > #endif > ip_t *ip, *ip2; > @@ -477,8 +478,8 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) > if ((type < 0) || (type >= ICMP_MAXTYPE)) > return (-1); > > - code = fin->fin_icode; > #ifdef USE_INET6 > + code = fin->fin_icode; > /* See NetBSD ip_fil_netbsd.c r1.4: */ > if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int))) > return (-1); I noticed this locally while testing another change, and this is the same build fix I was contemplating. However, I think the check is overly broad as the value of code depends on what type of ICMP error is being sent, and this range check is only valid for destination unreachable errors. That is, I think the check should be moved down to where the code is used which would make the reason for the check more obvious and avoid handling other ICMP packets incorrectly: #ifdef USE_INET6 else if (fin->fin_v == 6) { hlen = sizeof(ip6_t); ohlen = sizeof(ip6_t); iclen = hlen + offsetof(struct icmp, icmp_ip) + ohlen; type = icmptoicmp6types[type]; if (type == ICMP6_DST_UNREACH) code = icmptoicmp6unreach[code]; Here we should probably be doing something like: if (type == ICMP6_DST_UNREACH) { int code; code = fin->fin_code; if (code < 0 || code >= nitems(icmptoicmp6unreach)) { FREE_MB_T(m); return (-1); } code = icmptoicmp6unreach(code); } This would also avoid having the mostly unused `code` variable hanging around for the rest of the function. -- John Baldwin From nobody Sat Jul 12 17:07:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfZl56Bb2z60s4n; Sat, 12 Jul 2025 17:07:29 +0000 (UTC) (envelope-from jhb@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfZl55GdWz3mqm; Sat, 12 Jul 2025 17:07:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752340049; 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=IAwjODVkQtbTfXAaP5fLVk0nw5L+W2b2s/pDribMrCc=; b=vcE+JgNcoolx2RdkSYsj0QQLjdKCUitZE//+M4v+9MFphUIBCmpFJMUNBSptT/+lSqv4C0 SkyYsDPAJO5h7hajSZiOUtzb2B+WtsXjsyrEy7loobgUfKk34putLe8vZMMSd4FWBEeUWb RbktjaqvfaL94NY8fEnnmo1DsjfDyMKIz3r+dpTMJPMlGO1xcKxMsMuT8RcfYBr5YVdQP+ 8+gEVzKsXtyDUokZf/L4kxsLzXkdWtyb5pc0mLORS92E1AJO+GvzwJj1iCx+ZKvCVcY0/C Cqo0tBj0Pv5nXvAfF/PTalkO/ORAmsxx6zfmh+4i8J6KQTYg1egPUDOCkuFa6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752340049; 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=IAwjODVkQtbTfXAaP5fLVk0nw5L+W2b2s/pDribMrCc=; b=GatC8Z1BdjVopGG1GcP35GvLIXtMSVCbCwwUsNPPWWENsR0eTVDRhHqvYy9Z1lN5SY4rkS NH6B4jbHyvlyuVTewrsmGDT/Bz6GBFUefopHHnNmpuoZ+vCSqDxVV763UCa2Zc5FJRW+/8 Ld+xlcigA3b6LqmBHlEjG0YD9HyUGKUwHJc6ETPzX0Q0R5LzOvYnfNiZglO5IW0rDVqmPp C7gBWrnHc9p0Fa5kDPrBzeeow3c25SOE9VvXIRSwZ+/GCxsjNiiiOh8lFznOxBAq8UXyaw 7ar28vXSuMZPBxtcG0WsdjkPLgo7x83fjH5S8zDJjp1VKzbK+ycha5zfXuzegA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752340049; a=rsa-sha256; cv=none; b=NaqvHLBR3FSQrbwuF1e1POtNW0VkqIU9kxNdK4Tr46gCA62Dd3BOZ5vsd+GNH3TdBTeWEL Acbkc8adXIQtDskPq1SmL2fdt53q/vB01r94nMZ/e/l69JNPcgUeNubBPRCm1s8k27v2eu Btg0sZKjwH2QDRrRGy9lLmxnPNBib8VR1wk3IE4O3GaAwgcyhKemlaSZE4AJ1pK53b/GMh xRPU9hfXnkeB/QJYyPxB/rly2IzDqHV0o8uImgj5N4GH1KawzXKelLBxWUUr9X+8qRQHK7 HkoT0Uu0Z2eaO2jKtmd6mwsVc2oogSDIgxdTwG6HAiW95ol0tULJNb4mJZ1vdA== Received: from [IPV6:2601:5c0:4200:b830:d81d:ac36:2f10:9f48] (unknown [IPv6:2601:5c0:4200:b830:d81d:ac36:2f10:9f48]) (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 4bfZl53LkrzwGb; Sat, 12 Jul 2025 17:07:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <85f6ca74-b557-4658-93a0-62774d7da196@FreeBSD.org> Date: Sat, 12 Jul 2025 13:07:28 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507082149.568LnGOU086303@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/11/25 15:00, Konstantin Belousov wrote: > On Fri, Jul 11, 2025 at 11:46:33AM -0400, John Baldwin wrote: >> On 7/8/25 17:49, Konstantin Belousov wrote: >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 >>> >>> commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 >>> Author: Konstantin Belousov >>> AuthorDate: 2025-07-08 16:30:29 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2025-07-08 21:48:59 +0000 >>> >>> kern_descrip.c: provide helpers to translate between fd flags namespace >>> Reviewed by: markj >>> Sponsored by: The FreeBSD Foundation >>> Differential revision: https://reviews.freebsd.org/D51206 >>> --- >>> sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- >>> 1 file changed, 90 insertions(+), 20 deletions(-) >>> >>> diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c >>> index 406236fc2723..2e1da2fdee29 100644 >>> --- a/sys/kern/kern_descrip.c >>> +++ b/sys/kern/kern_descrip.c >>> @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) >>> return (error); >>> } >>> +struct flags_trans_elem { >>> + u_int f; >>> + u_int t; >>> +}; >>> + >>> +static u_int >>> +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) >>> +{ >>> + u_int res; >>> + int i; >>> + >>> + res = 0; >>> + for (i = 0; i < nitems; i++) { >>> + if ((from_flags & ftes[i].f) != 0) >>> + res |= ftes[i].t; >>> + } >>> + return (res); >>> +} >>> + >>> +static uint8_t >>> +fd_to_fde_flags(int fd_flags) >>> +{ >>> + static const struct flags_trans_elem fd_to_fde_flags_s[] = { >>> + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, >>> + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, >>> + }; >>> + >>> + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), >>> + fd_flags)); >>> +} >>> + >>> +static int >>> +fde_to_fd_flags(uint8_t fde_flags) >>> +{ >>> + static const struct flags_trans_elem fde_to_fd_flags_s[] = { >>> + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, >>> + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, >>> + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, >>> + }; >>> + >>> + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), >>> + fde_flags)); >>> +} >>> + >>> +static uint8_t >>> +fddup_to_fde_flags(int fddup_flags) >>> +{ >>> + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { >>> + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, >>> + }; >>> + >>> + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), >>> + fddup_flags)); >>> +} >>> + >>> +static uint8_t >>> +close_range_to_fde_flags(int close_range_flags) >>> +{ >>> + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { >>> + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, >>> + }; >>> + >>> + return (flags_trans(close_range_to_fde_flags_s, >>> + nitems(close_range_to_fde_flags_s), close_range_flags)); >>> +} >>> + >>> +static uint8_t >>> +open_to_fde_flags(int open_flags, bool sticky_orb) >>> +{ >>> + static const struct flags_trans_elem open_to_fde_flags_s[] = { >>> + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = O_CLOFORK, .t = UF_FOCLOSE }, >>> + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, >>> + }; >>> + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == >>> + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); >> >> This broke the GCC builds it seems. GCC doesn't think that it can compute this >> expression at compile time. >> >> From https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: >> >> 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function 'open_to_fde_flags': >> 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: expression in static = >> 10:32:02 assertion is not constant >> 10:32:02 560 | _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags= >> 10:32:02 _s) - 1].f =3D=3D >> > > I am unable to propose anything better than the patch below. We have enough > #ifdef __clang__ in non-contrib sources already, so this should be not a > huge crime? > > % rg -g '!contrib/*' __clang__ | wc -l > 171 > > commit 96e6b15b0a1407af45ebe1ad38ee53627d09d16b > Author: Konstantin Belousov > Date: Fri Jul 11 21:57:32 2025 +0300 > > kern_descrip.c: only allow complex expression in Static_assert() for clang > > gcc cannot compute the assert expression. > > Reported by: jhb > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 93bdd41d1515..c4f5e586b0ed 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) > { .f = O_CLOFORK, .t = UF_FOCLOSE }, > { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > }; > +#ifdef __clang__ > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > +#endif I think this is fine. Mark Millard followed up with me offline and it may be that GCC is technically more correct here with what is allowed to be computed as a static constant at compile time FWIW. C++' constexpr allows for a wider range of compile-time constant values compared to C and this sort of thing feels very constexpr-like. -- John Baldwin From nobody Sat Jul 12 17:57:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfbrH03JTz60vrZ; Sat, 12 Jul 2025 17:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfbrG27lkz483t; Sat, 12 Jul 2025 17:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752343022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P0jisrWxuKuzPWxGxYqvcmuHZMeSzl+C1w4qvPmDZH4=; b=Li+hwPtC547hYfpCrAepy2EbRdmg8QONmaXDw6KTitB3UxaCBL2LtEQzJa3WaPB2epGOnc rHwLY5Wz+yhlAlvawTeA5FHJZ6YNWeDBj8YewwxV9W0YCWhVFlEe9hVbJ0RYCB4jzxOqJh M2qVls44aShQ7nqOtfyAfs6MN7gvNh8C1h1qcdkJbNFKRqe96j5p4jXAdiGxSZloXEoz7D 1mJsHQZ9Vlc+MjxDUSijpQUfv+6L1gqC2Xsy70jz4dV+IkOVKPGvMhi+HJy3tfjd61lLnp HW+kN7YNkOhK+ZTeRcJ0E8f6Gq693sMoOwpDDWQ3PamzHfHFJnBb4nrx69otkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752343022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P0jisrWxuKuzPWxGxYqvcmuHZMeSzl+C1w4qvPmDZH4=; b=O3zJONzactrszHpqMmcsS/v60q9zmRIW176rhv27SgB20Zw8BLSXAPapE+XoARMifBz/4j gc8yRlVRr2o6kH+w3Pc3LM2BE/NnOCFg0D/uMPLcEZ54IU9ya122LSHJwQrsIDgH2GxwGU OpZwB9UTAvrABhS3JpESb76n+Q7uPiav4KonL2IJmpaJKXuL5bybRcXdVb+PLp5voSCC98 B1/ZX3D2Bcyfj7VAgswYlUq3mazSv4IzIXu67ycyoGpIFtqe8WVCXpEB++Do8FqlgDIKsU DsosyV9O0U0cRncVqkRYS5Ik4fBG5IQHDADvut8WvEqp9T0W6atz6zYci2VUYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752343022; a=rsa-sha256; cv=none; b=w+uUAO1vLBsv9XirbZ3KBMpR7WK5L1v0qMef1jYdQSZP89SRp/MSuwUkbRYAEZB94Me+W4 PS7LAE8eVDwpt6G1j+iiGl1b6XgBVZl5HggLGSPdAR2k+rhahtB/XFTmq+o5BF19iWOie2 2z3KQEdXAvia5NXQ5SSqjdmMBEMhzKTbAMPDFaQ4cUb/AiWzLaQPgfURgfiguR6e16fMDm I72oDVuaZPo7yQ/sG/zB7UrxIuZuVgHR3RBLo88Rf8duAWxs5tEu2qQX18FnmMOAucxZXk 38AM7cM9Vt7woddaQasZUO9nQIut+z76uQBPrrwF38HPU09ih2k55UbuWMPPfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfbrG1bwzzYnX; Sat, 12 Jul 2025 17:57: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 56CHv25N075598; Sat, 12 Jul 2025 17:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CHv2Vi075595; Sat, 12 Jul 2025 17:57:02 GMT (envelope-from git) Date: Sat, 12 Jul 2025 17:57:02 GMT Message-Id: <202507121757.56CHv2Vi075595@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: fb84b9f400d2 - main - kern_descrip.c: only allow complex expression in Static_assert() for clang List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b commit fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b Author: Konstantin Belousov AuthorDate: 2025-07-11 18:57:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 17:56:13 +0000 kern_descrip.c: only allow complex expression in Static_assert() for clang gcc cannot compute the assert expression, which is formally not required by a C standard. Reported and reviewed by: jhb Sponsored by: The FreeBSD Foundation --- sys/kern/kern_descrip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 93bdd41d1515..c4f5e586b0ed 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) { .f = O_CLOFORK, .t = UF_FOCLOSE }, { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, }; +#ifdef __clang__ _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); +#endif return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - (sticky_orb ? 0 : 1), open_flags)); From nobody Sat Jul 12 18:33:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfcfD0rckz60xkm for ; Sat, 12 Jul 2025 18:33:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-21.consmr.mail.gq1.yahoo.com (sonic309-21.consmr.mail.gq1.yahoo.com [98.137.65.147]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfcfC4f6Cz3RqC for ; Sat, 12 Jul 2025 18:33:23 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=YNfRYhv6; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.147 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1752345196; bh=9JktYmW0795bJEe/X4/M6lHAXhpKDWF+QgOJFTC6SOQ=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=YNfRYhv6XkECUxEJi75k8KTb3HkIBYXsakKJeijDsELDffW6NdT2cQHU631cfcyWTKangSd2bytg9x8Ahcj8lO/PYgFLNicaAYlwApiBtWOWyA4sKGNmOA5pU57JrUOR2QNuQjqS1ykELdgNtQN+5I1oP6nIk61L8PaYl6caHI2qmUihVPRAz3o5RoPu9hUkPDsmOSoGYhQS+LkQ5VLpZ5PjoP159cnv9u4yJ3DoIyW1hBjWzdtr9ub50/22MvcpAxzdtS2HDapxqaD8J1lHvGW27rgxJEJpaSeXuukkQpCJTR/MLeEiDgr2ms9BQgin152h/2eD0LiQRScywt9qMg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1752345196; bh=w+ft+A+F6W2WLP2UqDTbR0aMo3bX7Z49n+Fp1R2khXb=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=k9L93NMS7VOn/1aLD5r8OZqxdAId/69yMVsCShb8j1Ro4shPDjVztb88QU3NXzaed3AnaiCg7XR8MzZnYmbk3bIoI/9hG2eIjUDs9sqpgXqUlSERpTJ3pIzwl2kYcPQwB5sIdHef8w3U8nX64NTpo+4ftQRw3IG3KltvJC/nmu6ZolESr1AD8m1Cdw4QKYbHYT4fTHyLavgkKy6g77ZBRIfoFOoicVPZ9ecw38QbP2yrzIEUfFMm9+Uhrtt3l3TAIF/wXG5pl7RURhmgiJo5dIBPs87La3cor7l1pvZCkjrWlpDHDwL+rfZ9SUPwrsRnt648xdiw7srTlovBahe7CA== X-YMail-OSG: KDEHo7wVM1n2iJdy0YGLLFq8wNjgzJsc4.gtTFq21itmKnHt0OoxySrseef8xt1 wfRx4cb6HlJ6xNq55zXPGVpU8TTrj2omD0xKdyIn5WaGzVuoQfOPX9BDdMYI9eWEnz0H0zhr2yP4 KneWrwTNph4kLlaS_UARE4EVNVLCmK7B_nJdGKuMv5dLfJlOnFQDYZht65avRWGW6T2AdSiUzvkN r7i26U1R2.X.og_JNmrabwcaNx9sUId3X0EOWHbZtcgku.TCXj1nZmoyuObiqqcAVs7o51a6Mexj sMnuezE3fJ5_NkDAWQkgkGvRVWNCZ4Jn6.2ymsUHMLcDmocz9HhXvKrW0Zy2lmFg4qUd0lHLHTS7 Eb56IyyQxUtVt7QdXIpbvZ1oqxULEUT2BoZNy3v3Y_GTkgY3JCrp4kFKk0Y2mX0Af68ybCa9Qos0 qvIAiFMRMdKhwq2Q1FOfph0d5QrnSm.47PfHg6Qt0IS_atjRvke7dAk.l2fDvzGcUdINVTLS_qUd 6T5aRs80pA2gp1W.aWCc5NkJecf7F4uXHg9ykIhPE2PE_NdKv36XvG40oQagXJO6NdBHyrUbSNHn rJsRcASbVuWgTbffvbK8MVWupfXdiDRGwS4shwF5Fs53B37tNAHuwg338UZ8Ycaiur642sO1C85r P1.1kIRRK3HdStpvANjdTfO5UtpNDD91lC45Gfnsg5QLjNYFFgZCWZ2PMegUOT3TJ.Fa4XjCv2EG QLWoYwhUMVSiTDS3C2jMAoPIWg5nMsHLLq7R46NEW0K6WBS84zb0roarvxvxfCUvfIzeIuI8NXkm MjZ_083g8vl0WlVwkNnjAIirVmUWvInl9VGjAy4Jc2UFmBMWFJxVlAJHhCwr.1xTtKtPt3ED1Mn5 ADwP2xGL1wO2nh9Is0s9uTOU2P8BD_kxYsTjRZQkuhBlG0cbOK2iE6LuCMcmFgsd46f_zalP8OIg xeH.oJDDaAuek0lg5JVauxA4rfIKFoeCvF74J12nGEwyT9RH126JmZycmpV0m2utCQFOn2XV228v nmmwI6_AbHKG.Uga44.CyBBAFb.2_7rCCCfinotze3IA3FRICfh64KXHU2yN4ZS0fZIX0RfmLAXM UOq8Klg.OSZWR0NKLfYEjRpVwWTUCktmnm5kW7mpNte_LXtXsC41clJLCTrj78NHC9kvyhoQfHHN moiiXI7UCogd2_FpuZP8069qhbx.RuhF_NjTafww3OJ.7ppcnSgkt8vQs0_gyVnIYAhkliMqgedx 8mD_GBADn6zvn64qNj5TTRxNDIDrDHuNaYbpYtPys_F8Q7riVlW58tItKrjaudiLVHzRWIQ0vYc1 DBfUSUebXiyqEZa06qKYFwsAzsGY8pN3qqF_xcSgnHUU.e8cbrFo2HvZiz_Qvx2ROHS4TlAVmAvj JiAhpC_.seiL5l_wbF3Jl.8vcMIVIg.Lajsgy8uglv9FfB1Y7UsYZyx4b8Xzuro6V9QxKJLrSH1m k8u126tRGR1ka3yGK2mLPu5wXegy5NZcpibwHm.Nu.g9P1grydMuFPJ5i_1ihH2K1AqevVkJY5wj qOJuyJhXU4PhjfjWflLUfwDW9nkxZ6.aVtD5rhmtLi7PmmTufkTPNKxDKN8DKVouCRsL43DY8aH1 l2uR5ozdbYjcbJtKBVVFcllK3HkFcFHLJOGqJKGg4knnnb_RtujrRjvChgACXa7tTmRDpJn.rROX JIoIbhM3juiMvGlN9D2gDIHSLCzeBAYgSjsqn89haloVrcrEpup1JHK62vzUXmK3F7r97FsHfyeK ONQKaSPM.p27zJmAGx6jK__3MhWuVrh7r4wGWPPjI40bULcA.JxPpLW.E65zN6S2yc6LG8u.wPmg qhOXgPPUp7MFGE3PBDJuYXm_tof_VStEBZo6k88vSpIBMZsdVsIOVCTGW7HDtLes2e26k5pbvLJl wUp1E3M2TqwT6gBdJJeKUL8b.Z7q.45iYOCiP87MJ2bt8MJMbegvrm8NkntjW1J0kSs4RwuvnK2b zaEEbkxL8j_XCAPW1J9oIZ9sihPegJ4rychzjTYCKB5mqyFKa6ehT5r9m.5smRoUILDNDZOPrIY5 JO1geFhGscTyLfeFrwLZKmc6vuOA3MEfXtAsZfKEx3fpevDnbkfOk3HCAhp.pNPEXuBG1s7hyCub w1OXRSWY__WS0gNzTqVHVAhN4bmyz9ApDqUAvqSikOQyUg7gFY5gBUgP_GiGQtAYOAbNvGYZMqOo yhzkLuJspAnYdD6qlx00Odmmw1yIZbmUmR9KD49enuhyU1niSrlAQqR6FxEDNoK0dNbooxsCTNca eS7MxWMVswnVkcrBBT5csHumI X-Sonic-MF: X-Sonic-ID: 5b4ef24b-2083-4823-9173-d27878fbde49 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Sat, 12 Jul 2025 18:33:16 +0000 Received: by hermes--production-gq1-74d64bb7d7-nrjbm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID cacaf27110e431f4d0d995bb61800e58; Sat, 12 Jul 2025 18:33:12 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Message-Id: <5BED6279-4414-45B5-8A2A-8DC42A07C4D9@yahoo.com> Date: Sat, 12 Jul 2025 11:33:01 -0700 To: John Baldwin , Konstantin Belousov , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: <5BED6279-4414-45B5-8A2A-8DC42A07C4D9.ref@yahoo.com> X-Spamd-Result: default: False [2.15 / 15.00]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_SPAM_SHORT(0.65)[0.654]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.147:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.147:from]; FROM_HAS_DN(0.00)[] X-Rspamd-Queue-Id: 4bfcfC4f6Cz3RqC X-Spamd-Bar: ++ John Baldwin wrote on Date: Sat, 12 Jul 2025 17:07:28 UTC : > On 7/11/25 15:00, Konstantin Belousov wrote: > > On Fri, Jul 11, 2025 at 11:46:33AM -0400, John Baldwin wrote: > >> On 7/8/25 17:49, Konstantin Belousov wrote: > >>> The branch main has been updated by kib: > >>> > >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dba0d9b43e940077f4025e7e4e85d16c8= d525db79 > >>> > >>> commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 > >>> Author: Konstantin Belousov > >>> AuthorDate: 2025-07-08 16:30:29 +0000 > >>> Commit: Konstantin Belousov > >>> CommitDate: 2025-07-08 21:48:59 +0000 > >>> > >>> kern_descrip.c: provide helpers to translate between fd flags = namespace > >>> Reviewed by: markj > >>> Sponsored by: The FreeBSD Foundation > >>> Differential revision: https://reviews.freebsd.org/D51206 > >>> --- > >>> sys/kern/kern_descrip.c | 110 = +++++++++++++++++++++++++++++++++++++++--------- > >>> 1 file changed, 90 insertions(+), 20 deletions(-) > >>> > >>> diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > >>> index 406236fc2723..2e1da2fdee29 100644 > >>> --- a/sys/kern/kern_descrip.c > >>> +++ b/sys/kern/kern_descrip.c > >>> @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, = int cmd, intptr_t arg) > >>> return (error); > >>> } > >>> +struct flags_trans_elem { > >>> + u_int f; > >>> + u_int t; > >>> +}; > >>> + > >>> +static u_int > >>> +flags_trans(const struct flags_trans_elem *ftes, int nitems, = u_int from_flags) > >>> +{ > >>> + u_int res; > >>> + int i; > >>> + > >>> + res =3D 0; > >>> + for (i =3D 0; i < nitems; i++) { > >>> + if ((from_flags & ftes[i].f) !=3D 0) > >>> + res |=3D ftes[i].t; > >>> + } > >>> + return (res); > >>> +} > >>> + > >>> +static uint8_t > >>> +fd_to_fde_flags(int fd_flags) > >>> +{ > >>> + static const struct flags_trans_elem fd_to_fde_flags_s[] =3D { > >>> + { .f =3D FD_CLOEXEC, .t =3D UF_EXCLOSE }, > >>> + { .f =3D FD_CLOFORK, .t =3D UF_FOCLOSE }, > >>> + { .f =3D FD_RESOLVE_BENEATH, .t =3D UF_RESOLVE_BENEATH }, > >>> + }; > >>> + > >>> + return (flags_trans(fd_to_fde_flags_s, = nitems(fd_to_fde_flags_s), > >>> + fd_flags)); > >>> +} > >>> + > >>> +static int > >>> +fde_to_fd_flags(uint8_t fde_flags) > >>> +{ > >>> + static const struct flags_trans_elem fde_to_fd_flags_s[] =3D { > >>> + { .f =3D UF_EXCLOSE, .t =3D FD_CLOEXEC }, > >>> + { .f =3D UF_FOCLOSE, .t =3D FD_CLOFORK }, > >>> + { .f =3D UF_RESOLVE_BENEATH, .t =3D FD_RESOLVE_BENEATH }, > >>> + }; > >>> + > >>> + return (flags_trans(fde_to_fd_flags_s, = nitems(fde_to_fd_flags_s), > >>> + fde_flags)); > >>> +} > >>> + > >>> +static uint8_t > >>> +fddup_to_fde_flags(int fddup_flags) > >>> +{ > >>> + static const struct flags_trans_elem fddup_to_fde_flags_s[] =3D = { > >>> + { .f =3D FDDUP_FLAG_CLOEXEC, .t =3D UF_EXCLOSE }, > >>> + { .f =3D FDDUP_FLAG_CLOFORK, .t =3D UF_FOCLOSE }, > >>> + }; > >>> + > >>> + return (flags_trans(fddup_to_fde_flags_s, = nitems(fddup_to_fde_flags_s), > >>> + fddup_flags)); > >>> +} > >>> + > >>> +static uint8_t > >>> +close_range_to_fde_flags(int close_range_flags) > >>> +{ > >>> + static const struct flags_trans_elem = close_range_to_fde_flags_s[] =3D { > >>> + { .f =3D CLOSE_RANGE_CLOEXEC, .t =3D UF_EXCLOSE }, > >>> + { .f =3D CLOSE_RANGE_CLOFORK, .t =3D UF_FOCLOSE }, > >>> + }; > >>> + > >>> + return (flags_trans(close_range_to_fde_flags_s, > >>> + nitems(close_range_to_fde_flags_s), close_range_flags)); > >>> +} > >>> + > >>> +static uint8_t > >>> +open_to_fde_flags(int open_flags, bool sticky_orb) > >>> +{ > >>> + static const struct flags_trans_elem open_to_fde_flags_s[] =3D { > >>> + { .f =3D O_CLOEXEC, .t =3D UF_EXCLOSE }, > >>> + { .f =3D O_CLOFORK, .t =3D UF_FOCLOSE }, > >>> + { .f =3D O_RESOLVE_BENEATH, .t =3D UF_RESOLVE_BENEATH }, > >>> + }; > >>> + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - = 1].f =3D=3D > >>> + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for = sticky_orb"); > >> > >> This broke the GCC builds it seems. GCC doesn't think that it can = compute this > >> expression at compile time. > >> > >> =46rom = https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: > >> > >> 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function = 'open_to_fde_flags': > >> 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: = expression in static =3D > >> 10:32:02 assertion is not constant > >> 10:32:02 560 | = _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags=3D > >> 10:32:02 _s) - 1].f =3D3D=3D3D > >> > >=20 > > I am unable to propose anything better than the patch below. We have = enough > > #ifdef __clang__ in non-contrib sources already, so this should be = not a > > huge crime? > >=20 > > % rg -g '!contrib/*' __clang__ | wc -l > > 171 > >=20 > > commit 96e6b15b0a1407af45ebe1ad38ee53627d09d16b > > Author: Konstantin Belousov > > Date: Fri Jul 11 21:57:32 2025 +0300 > >=20 > > kern_descrip.c: only allow complex expression in Static_assert() for = clang > >=20 > > gcc cannot compute the assert expression. > >=20 > > Reported by: jhb > >=20 > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > > index 93bdd41d1515..c4f5e586b0ed 100644 > > --- a/sys/kern/kern_descrip.c > > +++ b/sys/kern/kern_descrip.c > > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool = sticky_orb) > > { .f =3D O_CLOFORK, .t =3D UF_FOCLOSE }, > > { .f =3D O_RESOLVE_BENEATH, .t =3D UF_RESOLVE_BENEATH }, > > }; > > +#ifdef __clang__ > > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - = 1].f =3D=3D > > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for = sticky_orb"); > > +#endif >=20 > I think this is fine. Mark Millard followed up with me offline and it = may be that > GCC is technically more correct here with what is allowed to be = computed as a static > constant at compile time FWIW. C++' constexpr allows for a wider range = of > compile-time constant values compared to C and this sort of thing = feels very > constexpr-like. gcc for this seems to stick to what is guaranteed by the C standards in this subject area. But the same N3220 text allows implementation-defined (non-portable) contexts as well: QUOTE An implementation may accept other forms of constant expressions; however, it is implementation defined whether they are an integer constant expression. END QUOTE So clang is not wrong to allow it --but it did not have to. The code is more portable without the array-content access where an integer constant expression is required, avoiding implementation defined aspects of the language definition. So testing for --and then usage of-- a known-to-be-implementation-defined context fits. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sat Jul 12 22:39:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfk6M5v93z61F36; Sat, 12 Jul 2025 22:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfk6M5GPhz4NjM; Sat, 12 Jul 2025 22:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752359979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oGO2Kiqqj5Gp8ORhEUH+H50QizgRq+b/R9qgd3gOC5k=; b=q+zajHJI11yA+DOSPMSBc4H3zDpn4B4xI2nXJ1VNzD7mR3hA6EKWu6V0bWPhrDzGTMXSPF V2S6l/tx1OISgnG8ePrCqGIHqufEy8IB9c6U/lsqf/8r21WO/9FWa1S76wHS7z+TWaYmCC CZqHg36Jec1P6q5P/AYcwyjkQLvtiQgPamg66tUSMgSU6nVKosECfDREJEgaLrWXLUJZXP Mk4rVe38k0Hq9fCllQSG8peApmYTimtBxHGN5GNn4B1fpBZp02eaNKl21LMUAz6IMWx2bY mQ2O9pmhBz61cwbuRlswPBV1rvgGe7ZhCv9x/atMqS8fTBaTIVA5yTjPHnUUVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752359979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oGO2Kiqqj5Gp8ORhEUH+H50QizgRq+b/R9qgd3gOC5k=; b=UzgjFckli1BlMyDKTttizQLqDXO8VMqQK+Cu5ivogfaw3DrfgDWnLZ+ouTk9qTzGOIvTat NMAN/0HJ2l98z3Qfk2mjOKHTCtPr8lekZhq8SVoaEVP7MKnxb84L/6iTSstPan102h1VWL OjKz7gk9JmwN83NXy/xPXFYnOzRln5xDIwl3bQrFUgUXEkpfAdL5C8xDvE6VbchvECPQkM 2G7x3HA5iSimQDM3UjRd0mh3k/1UPUPPqf9KU+y9cf8XhHDhZXONSnDF68u1Lo2FtC/7uK 5OxTnGzsTWoPELdoEZMhNLYGnJ6daDPuvh7mLSH6wPAd4k4PANkmAtb9fvDP/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752359979; a=rsa-sha256; cv=none; b=iD4r4ltH8siH97zrjaCGohcm+ijOgGnFeAQ6EZh03tSRkzfhKHEnQJ37ww4QtUuGV2Q6M1 6M+kwQnzlpXKyC+IoE/FaXaSsD2KFdnjcsE7/meM5eovbhuiy6k1McWswvA/cts+4dDCCZ wd6OdVx8M8EUDW25t3PfM3vuIJYMs5RMGeLjglK19fbFOS9auBNkOCrZTzo7mrwjk5omcf Yod8DkXO2A1a92Xe+eKUDeeTLS/MQlhHHA6Z7ejaW0k0ZgfyYHTBNfXYZNJVTlPUact5Og sbkI6S6LHAGvmbB7OtZ6y83pwkBuOpBG//hYmFMWt7f+HIfHbmDu7nVfhZ2KHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfk6M4h50zjDD; Sat, 12 Jul 2025 22:39: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 56CMddnb000272; Sat, 12 Jul 2025 22:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CMddG1000269; Sat, 12 Jul 2025 22:39:39 GMT (envelope-from git) Date: Sat, 12 Jul 2025 22:39:39 GMT Message-Id: <202507122239.56CMddG1000269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 78bdaa57cfba - main - lagg: Fix if_hw_tsomax_update() not being called List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78bdaa57cfbac759a6d79ecad2fae570e294a4b3 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=78bdaa57cfbac759a6d79ecad2fae570e294a4b3 commit 78bdaa57cfbac759a6d79ecad2fae570e294a4b3 Author: Andrew Gallatin AuthorDate: 2025-07-12 22:35:29 +0000 Commit: Andrew Gallatin CommitDate: 2025-07-12 22:35:29 +0000 lagg: Fix if_hw_tsomax_update() not being called In a mixed lagg, its likely that ifcaps or hwassist may not match between members. If this is true, the logical OR will be short-circuited and if_hw_tsomax_update() will not be called. Fix this by calling it inside the body of the if as well Sponsored by: Netflix MFC after: 2 weeks --- sys/net/if_lagg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 9867a718e148..5b52bfa80e3b 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -718,6 +718,7 @@ lagg_capabilities(struct lagg_softc *sc) sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_capenable2 = ena2; sc->sc_ifp->if_hwassist = hwa; + (void)if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax); getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) From nobody Sun Jul 13 00:56:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfn8j6Y09z61PjJ; Sun, 13 Jul 2025 00:56:53 +0000 (UTC) (envelope-from ahmadkhalifa570@gmail.com) Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) (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 4bfn8j44nsz3QsN; Sun, 13 Jul 2025 00:56:53 +0000 (UTC) (envelope-from ahmadkhalifa570@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-710f39f5cb9so28685657b3.3; Sat, 12 Jul 2025 17:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752368211; x=1752973011; darn=freebsd.org; h=cc:to:subject:message-id:date:in-reply-to:references:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=foGUA38DdNrv5h+SBwYtFpCiYdG1chqR/Kv/rGmdyWo=; b=mKoBHe2Nb4vzPaaYFHO+pRG3EAyn+24q7rpWEvABRpksB+l8ym3bUOZVBNGT/C5TpH eQTOabaPPTqZhZoSS8mhFrjTrqJUkqP5pZqus0USMrtAGHFJfEjQ6lQa61AHE0Jwg4N4 HIXiCsw3o2JHyXjSM9eAf/H4Sil6k7DAKUQQY8pD+RoqHYGfIctmeP2mupsKdw0Nkkcx UfD2YUitV4fi08Nv/QoQR0/i44iiKnElkfNHUmp0ChSyf8yoYGQlh8pmr47zxfvGogNZ cHzqPmxo45kBewYjkf6CR5YdBRHOEwDc44kF+ca6fdG1MTZixtANrtp9n8gleGodiJnP 6TYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752368211; x=1752973011; h=cc:to:subject:message-id:date:in-reply-to:references:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=foGUA38DdNrv5h+SBwYtFpCiYdG1chqR/Kv/rGmdyWo=; b=F33SfiT641iyaF2hqX+ukLP1SnJy5k7z4voytCTkZWdeEPxpX5GwhcsqC9L3jvA1XO +YlsywcuL0QpzA/KI8jeLj5pndKdBTl0UbSOFkfDFqwaQMROjcGBLhVZ+UbV6WEPoy0/ v8tRrWwOEOET7dDl2/x2FttxoP4u+tZoU2WgbNlWOKvQ0K3UVYHMjshADj6U3v79/2eA KUYrqRs5NHaTy6YOEjdQbeS8HQgETaQW2rds0uswGM/KI8DF+F8TdPaoZnsqu1RQH/YX nY0/Jt6wanZMu+Mk0ea37c+IoKqvBKYPHhAw0osQukszUacSWWfV1rCdRxMXXIaZkVbb l2/Q== X-Forwarded-Encrypted: i=1; AJvYcCUEPjc1DwKMG+SO+BwJo+7QSNH6QGTG5dlzC7f7jxdwV+s6+3G5F043Qe0wpBWGvuw8rzovLU9AFCXlX7Wv6o7NiAMe@freebsd.org, AJvYcCUz+8grzDDrdY/9b5+DJXuCN233cw3lP7RLDMNnWhiNCvNPCwORxsRlCPziuWoTWn2HGO8jN4njS5egnE/loA0=@freebsd.org, AJvYcCWmBShpI47aZraGYI6XNqY10FK4UbNgbBfx2Uw4+9t4VHYDnNiDhDmue249CUuBLSmnGKERjmUwpij/YFMrRMTC47+9ehU=@freebsd.org X-Gm-Message-State: AOJu0Yw+yhNVYqrlZ3J0lEUBNp9fVenpGxIitnkc1os3+dXwYOiJvd+y /QtTHc9Gi4yZrPgH9JOLpnRz8C90b12gNZvetEVTflVWYv1ATDItq82GWK9InmzOM27vy8J94zs 2kbUKPHTddfwRFta3cRSOKKX/9aQ5mQbqGg== X-Gm-Gg: ASbGncuAtu0yD4sbj1uEClzraGp8VBROITfyJuSu5/armoHveQGP5Cw3mn4k/f8sBHS lyVl5ab0fOkd3qK8dFUWDdu1XJRbh50DcQXM9sI6VozxsyXF4E6GB9rfodI1Gz2vRjdAFZ0eX+v IbQqGC32Yl7vBPHm4PJQeW7DR8RVaN7JvYDt5W0dKBtlNlgrVjSnwOscL0jx+foqRbZ3aVIwxy3 uWRBlBS X-Google-Smtp-Source: AGHT+IHAbVBju5zC97ECCDZfsMSy8sYhYwEu1IOFJ3n7akVqXe6TMyzuJMcSED8kF7Y6zu7EzvMkteTZ7gn/vdtNe5o= X-Received: by 2002:a05:690c:55c3:10b0:714:31:c9c6 with SMTP id 00721157ae682-717db2b04b7mr75488477b3.30.1752368211567; Sat, 12 Jul 2025 17:56:51 -0700 (PDT) Received: from 490177373942 named unknown by gmailapi.google.com with HTTPREST; Sun, 13 Jul 2025 00:56:51 +0000 Received: from 490177373942 named unknown by gmailapi.google.com with HTTPREST; Sun, 13 Jul 2025 00:56:51 +0000 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 From: Ahmad Khalifa X-Mailer: aerc 0.20.1 References: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> In-Reply-To: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> Date: Sun, 13 Jul 2025 00:56:51 +0000 X-Gm-Features: Ac12FXzE203uMRhcsVh7gBMbJY7CmVnb1y5t_lZZUpbv-6SVzZMwwOXMArPy2s8 Message-ID: Subject: Re: git: fb84b9f400d2 - main - kern_descrip.c: only allow complex expression in Static_assert() for clang To: Konstantin Belousov Cc: jhb@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4bfn8j44nsz3QsN 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] On Sat Jul 12, 2025 at 8:57 PM +0300, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > > commit fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > Author: Konstantin Belousov > AuthorDate: 2025-07-11 18:57:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-12 17:56:13 +0000 > > kern_descrip.c: only allow complex expression in Static_assert() for clang > > gcc cannot compute the assert expression, which is formally not required > by a C standard. > > Reported and reviewed by: jhb > Sponsored by: The FreeBSD Foundation > --- > sys/kern/kern_descrip.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 93bdd41d1515..c4f5e586b0ed 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) > { .f = O_CLOFORK, .t = UF_FOCLOSE }, > { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > }; > +#ifdef __clang__ > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > +#endif > > return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - > (sticky_orb ? 0 : 1), open_flags)); This doesn't compile on clang14 when cross-building do we still care about that? See https://github.com/freebsd/freebsd-src/actions/runs/16240751228/job/45856816666 From nobody Sun Jul 13 01:24:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfnmQ4KpCz61S38; Sun, 13 Jul 2025 01:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfnmQ3dqJz3h72; Sun, 13 Jul 2025 01:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752369862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0k8J9kqtcR39C/+IEk7MckcNIkZ0/35VAx6bEgkG4QQ=; b=Au9kwx0EkC4XY/zmZodAMwR6CNxma8Pql+CcM0QVhIBaz4s40xiHxHTiIglPv+oWTuRWrB chVw2pcp94h8HvUw1/OLAr17onZ88QjY53UPnZiql5SzVky8sUE0K894a5X4D6jw1Jllht 0DdsUYmkuDgGFPmHTitWOKpACPFAKij0afN9cZmdijej0Go1UngYm80UprTgLk2kUYw1rL GFMAVLG6WXK4xM1ZzBKT1U5Xf5+ohOEu4bbmp4WWyLXV6hSnR7GW0o0FTDcpjOnMZvEmcE pc5qr5VHgn931FsiFdTr6EQwsv+cVi5Oc/RIRqs9zoanffRnJuVfx8Wkd2zueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752369862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0k8J9kqtcR39C/+IEk7MckcNIkZ0/35VAx6bEgkG4QQ=; b=ihOJqgmmxO3DW3DEJORqs46JFkuUPnXjduV7yurT1p9PyGtM20h1MTNewQz0wToLZvS8xW EAu6a7uW8Z5SC1v8uB2NKxMISiUMtu+v9dUXcluJg92eaYcKbmjHc1VbDHhAnHIDUt6JBe R0s2/iC37+3lCqdyzEqnfXm+S8Ip6VZ9Tp3UVcgZB06qXERDajIabJSlnutjDkc0Vniakp RQ+TcVRCQ7xHJfwhOTfY0tON+AS8UUl+nhXDqx+P7O1yqEBtPZXo2fug3EVhZaVfFzFCFK p5YY/wTbiKdCTBAyTLEtnIWh8UIxOJpbIxuG/LOgtjREZ9zhBAVwJjAA0qSZ9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752369862; a=rsa-sha256; cv=none; b=SAHZJiDmbyxpspWS8sKA97+65p0W1SUHEk7y3c3b6Srp5ZzZqknsQkGHwVQfr83E1PGUnG IDSAPjGGVNSodsqvl3IhmS5Ur4mLZ1iP+nEYrYruXum4+RhheZCMKrUuR4MdSrEP9Rpsbl CJcyfKw7S3fTyJgk8hflmFnqKpf+hqqmD7roK0yyexjefKCf6+nprWy4QPUMZSN+BaDa6L 93DnBy8hNR+h+jM71MeQDcHjAl3rWhQ7W4wYTLa/QpEwdJIV196Z6CtqEU7JYxW/hj1BCQ 0tNtIep2QMdpSgYzYhmNoo1AsNc72+z0tARzIxhQ2iny9V9u+wP3KsPHJCEmUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfnmQ2vhbznFb; Sun, 13 Jul 2025 01:24: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 56D1OM3c017196; Sun, 13 Jul 2025 01:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D1OM9q017193; Sun, 13 Jul 2025 01:24:22 GMT (envelope-from git) Date: Sun, 13 Jul 2025 01:24:22 GMT Message-Id: <202507130124.56D1OM9q017193@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: bf4d2a45b991 - main - kern_descrip.c: further limit expression in Static_assert() to newer clang List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: bf4d2a45b9913bbd4720423288f4bdb2f0afc970 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bf4d2a45b9913bbd4720423288f4bdb2f0afc970 commit bf4d2a45b9913bbd4720423288f4bdb2f0afc970 Author: Konstantin Belousov AuthorDate: 2025-07-13 01:18:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-13 01:24:14 +0000 kern_descrip.c: further limit expression in Static_assert() to newer clang Reported by: vexeduxr Sponsored by: The FreeBSD Foundation --- sys/kern/kern_descrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index c4f5e586b0ed..a27ab33b34da 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -557,7 +557,7 @@ open_to_fde_flags(int open_flags, bool sticky_orb) { .f = O_CLOFORK, .t = UF_FOCLOSE }, { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, }; -#ifdef __clang__ +#if defined(__clang__) && __clang_major__ >= 19 _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); #endif From nobody Sun Jul 13 01:25:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfnnr3vzmz61RXl; Sun, 13 Jul 2025 01:25:36 +0000 (UTC) (envelope-from kib@freebsd.org) 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 4bfnnr0RRFz3hsr; Sun, 13 Jul 2025 01:25:35 +0000 (UTC) (envelope-from kib@freebsd.org) 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 56D1PLUb041310; Sun, 13 Jul 2025 04:25:24 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56D1PLUb041310 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56D1PK55041309; Sun, 13 Jul 2025 04:25:20 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sun, 13 Jul 2025 04:25:20 +0300 From: Konstantin Belousov To: Ahmad Khalifa Cc: jhb@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fb84b9f400d2 - main - kern_descrip.c: only allow complex expression in Static_assert() for clang Message-ID: References: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bfnnr0RRFz3hsr 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] On Sun, Jul 13, 2025 at 12:56:51AM +0000, Ahmad Khalifa wrote: > On Sat Jul 12, 2025 at 8:57 PM +0300, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > > > > commit fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > > Author: Konstantin Belousov > > AuthorDate: 2025-07-11 18:57:32 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-12 17:56:13 +0000 > > > > kern_descrip.c: only allow complex expression in Static_assert() for clang > > > > gcc cannot compute the assert expression, which is formally not required > > by a C standard. > > > > Reported and reviewed by: jhb > > Sponsored by: The FreeBSD Foundation > > --- > > sys/kern/kern_descrip.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > > index 93bdd41d1515..c4f5e586b0ed 100644 > > --- a/sys/kern/kern_descrip.c > > +++ b/sys/kern/kern_descrip.c > > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) > > { .f = O_CLOFORK, .t = UF_FOCLOSE }, > > { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > > }; > > +#ifdef __clang__ > > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > > +#endif > > > > return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - > > (sticky_orb ? 0 : 1), open_flags)); > > This doesn't compile on clang14 when cross-building do we still care > about that? > > See https://github.com/freebsd/freebsd-src/actions/runs/16240751228/job/45856816666 Thank you for the report. I do not that we should care much, but in this case it costs nothing to care. I went ahead with bf4d2a45b991. From nobody Sun Jul 13 07:27:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfxqT4Lsdz61pZF; Sun, 13 Jul 2025 07:27: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqS6v9qz3H32; Sun, 13 Jul 2025 07: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=1752391653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UUZX22YsYTKrtWv7z4EPRWKU6yx9EJv02F0KO2W1F4A=; b=f9AE8cGtK1cUTBBdcTDWq3yh63qu5/zs0nZLY5guxXKSS8BW8fc7PuKMW8XxL4+EyWx4s7 XU0iwUZ4RT2An746LScUWVuDldFS8PFqyDtwzTI9aEYOVJ37c1+hPF+NW3Y7qnzvL3XFyP Lzygc9GKwjxHrTNWsk3D7srhyasHl2p1F7bNX0c8gVsobIuO0LKcdNm6UULCQiNdEbS5n8 NK6b0fiUZplEP78t0VQ2QXvxYE7QGfFhdKjf8qgD99WqBgBTSsIfF/kN9GEBZUJVkInDwN WXbkvzbRWry4cIO/voS7xBH1uf7hm47nLUzrtmdtTxcTvFCUO7Tgqu6BULVqiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UUZX22YsYTKrtWv7z4EPRWKU6yx9EJv02F0KO2W1F4A=; b=MostrwYAuLtRWNATFLA+H0FZo0e0ZMkRniArI3h5nPEeGHetADWOvmB8jf94TtXbfSWYLD C13s5xtZzeewlHa7W3yJFXWKjt249NNM/KA4sJAeAtTtD7NSS8WW7/QibggsxPmQPmXv57 kIpwkiBnAVhPYe7IJTsO0FDznWDd1OOZQ+ajzSt8gBCHN5VLirML+17ejHusgHEHiODI3P sowQUsYKymAcFCeDCxmBQuD442a5qF7NQjkvWjfw5+Z5Fyp78ICYTNDgXKjRt4PEzAj9Pi T0kE/rk0Y2LRUf0Q83KMNEx8HxkxSSktz3xtUz+H1P1z5+sFIBaM46cwSP/2PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391653; a=rsa-sha256; cv=none; b=jNdJeF3Q6D1/45VU9yekL4uIbrs4twWz0oK49yNr8RMHBL0Cxpm5onXQxPbwyhl8MSTc+5 gk7K2MpYBYJYCpki3L4wGexnQv/7SoBSoCXhjenA1uqZFt9SUAfoIj812v1CpKttUPyugY vweMfj4OVTJf2OX0docqYoEZcq7AhUGap/JVDR9JG5dursgOOzvYuP/D0FGP9tyjtU0SeC wO/aeab/QZR7yDpedi6xo2RBmnppRoOuVtWOzhMV0m9a9Qnm0+AAP0k/IqneC63urLOg63 ioaatlFkhide2w6wwnMb0GBwiVZeVMitjaoBYIy50IJWoYeq5dxxPBmO98t9DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfxqS6HYwzyfm; Sun, 13 Jul 2025 07: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 56D7RW9A094700; Sun, 13 Jul 2025 07: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 56D7RW9M094697; Sun, 13 Jul 2025 07:27:32 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:32 GMT Message-Id: <202507130727.56D7RW9M094697@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: 986edb19a49c - main - LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 986edb19a49c7d7d3050c759d9b0826283492ebf Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=986edb19a49c7d7d3050c759d9b0826283492ebf commit 986edb19a49c7d7d3050c759d9b0826283492ebf Author: Olivier Certner AuthorDate: 2025-07-07 13:28:21 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 06:46:49 +0000 LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() Since commit 19df0c5abcb9d4e9 ("LinuxKPI: make __kmalloc() play by the rules"), kmalloc() systematically allocates contiguous physical memory, as it should. However, kvzalloc() was left defined in terms of kmalloc(), which makes it allocate contiguous physical memory too. This is a too stringent restriction, as kvzalloc() is supposed to be a simple page-zeroing wrapper around kvmalloc(). According to Linux's documentation ("memory-allocation.rst"), kvmalloc() first tries to allocate contiguous memory, falling back to non-contiguous one if that fails. Thus, callers are already supposed to deal with the possibility of non-contiguous memory being returned. Reviewed by: bz Fixes: 19df0c5abcb9 ("LinuxKPI: make __kmalloc() play by the rules") MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51247 --- sys/compat/linuxkpi/common/include/linux/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index f3a840d9bf4b..efa5c8cb67b3 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -45,7 +45,7 @@ MALLOC_DECLARE(M_KMALLOC); -#define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) +#define kvzalloc(size, flags) kvmalloc(size, (flags) | __GFP_ZERO) #define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node) From nobody Sun Jul 13 07:27:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfxqV58sKz61pZG; Sun, 13 Jul 2025 07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqV0xkyz3H0f; Sun, 13 Jul 2025 07: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=1752391654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hw6BJSO57fRJgYm0MnroWiwJcruQSlzvzQAZj7gYtU=; b=YOLV2A3+vzrRlBljRhQ9qCVasyzReFH/GhxoJoVFWUVoTGZXBwwHZ79Slk95BK4dCZx+Qd 0jkY/1k0kopmh+XaQXJtY5Hbye45mbY5moaVzzQniLbtbi9cSEM0nMLPAELz0JpEZyWLZe gtFgkQenTJwj+elg3yHXXmaL/JX7iZ/2PY07AvKITNoA9pKrJ7uJaiToMxAzFtFSmv62Mr TBVnehSA1OFrR3l1lVF+nYguauG/NboBW3JT1AIICawyTKkW2oo+it6UFZkEFt6X83/7Vb gIjzdgRUZtJ4K0fdcKqP3PLKmJXY4QirjAo+v7gPZoGPdE+pw9/+a3V+70eWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hw6BJSO57fRJgYm0MnroWiwJcruQSlzvzQAZj7gYtU=; b=GdFHED1S76NS4ZAI6MaVo0jQjGUwseEYKt5XXwlUol8vGiLGw1A60ZcEdJGoXY1p6Tmtrq AlZbkv8SkRCahy5mY9N0GfyFl9/fhV885Xu0ONWcGshz3/NfjzSuWF5kmml4s3SI7jLU2i JSiz9FbzTwpfrpLWHEo92HWwUSVaYFwVq8INBgU3V4WD4Psix3CCh/sYXiRfDQ4jLuj+4v VnivqOAK1k2mWHoaLP5s7ISn+BnizvFpi0rMQygLuouVM2dIQEiJsjGy2dJA0HsNBmsWMv afK/YllZJt9y8Un+Zv7HCI2nv+KYUiPQPPLx6kLmAyT8gHqu9GhAoyVwLZzeLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391654; a=rsa-sha256; cv=none; b=NqeYzXy+/0Q81LwnZ0+ZuKzuSz2Jphpz29R2afNtRBP0JIR+PvnEHsqheSVgZaaxDaUZ2n /LDeMUSdIkNuKqDSDoUk0ORGNfZo8cT9OxHvAg3zG+/Hrx9ycq9nFQo5qBIe5Q6zLDOrlc yMcgdS97GxbX+pbp1zDwCCU2pAxceAf3v6u5OUBHELr6KqHX/UdQU05IsYTSuLOadkwCHJ dbPrFMcfHd341OV0sHXZnwUMsJ1Dupz+SoFu1Fq8N4lTuAPxhAFKc6LntuGnLwn+Wgh/e2 6CRqdYBSxhC9tyURs7CeAQ5viU+bosG91cXbhpdEgIIUhakpqK6ZEG5a5Ko39w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfxqV0MPnz106V; Sun, 13 Jul 2025 07: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 56D7RXH1094741; Sun, 13 Jul 2025 07: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 56D7RX2q094738; Sun, 13 Jul 2025 07:27:33 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:33 GMT Message-Id: <202507130727.56D7RX2q094738@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: 9d1f3ce79d85 - main - pmap: Degrade pmap_page_set_attr*() into a no-op on same attribute List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9d1f3ce79d85855399663e3977766ec46f28cadd Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9d1f3ce79d85855399663e3977766ec46f28cadd commit 9d1f3ce79d85855399663e3977766ec46f28cadd Author: Olivier Certner AuthorDate: 2025-07-08 16:17:30 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 07:13:25 +0000 pmap: Degrade pmap_page_set_attr*() into a no-op on same attribute For 32-bit arm, move the no-op test that was already in place at start of the function so that it stays first even if the '#if 0' block around the call to sf_buf_invalidate_cache() is uncommented at some point (if ever). Reviewed by: jeffpc_josefsipek.net, kib MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51253 --- sys/amd64/amd64/pmap.c | 5 +++++ sys/arm/arm/pmap-v6.c | 32 +++++++++++++++----------------- sys/arm64/arm64/pmap.c | 2 ++ sys/i386/i386/pmap.c | 2 ++ sys/powerpc/aim/mmu_oea.c | 3 +++ sys/powerpc/aim/mmu_oea64.c | 3 +++ sys/powerpc/aim/mmu_radix.c | 4 ++++ sys/riscv/riscv/pmap.c | 2 ++ 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 9c985df13ddf..fd02d1ad6690 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9649,6 +9649,8 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va, vm_page_t m) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pat_mode == ma) + return; m->md.pat_mode = ma; @@ -9668,6 +9670,9 @@ pmap_page_set_memattr_noflush(vm_page_t m, vm_memattr_t ma) { int error; + if (m->md.pat_mode == ma) + return; + m->md.pat_mode = ma; if ((m->flags & PG_FICTITIOUS) != 0) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 92eb0589f80b..78883296c5b7 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -5767,7 +5767,7 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) CTR5(KTR_PMAP, "%s: page %p - 0x%08X oma: %d, ma: %d", __func__, m, VM_PAGE_TO_PHYS(m), oma, ma); - if ((m->flags & PG_FICTITIOUS) != 0) + if (ma == oma || (m->flags & PG_FICTITIOUS) != 0) return; #if 0 /* @@ -5784,22 +5784,20 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) * If page is not mapped by sf buffer, map the page * transient and do invalidation. */ - if (ma != oma) { - pa = VM_PAGE_TO_PHYS(m); - sched_pin(); - pc = get_pcpu(); - cmap2_pte2p = pc->pc_cmap2_pte2p; - mtx_lock(&pc->pc_cmap_lock); - if (pte2_load(cmap2_pte2p) != 0) - panic("%s: CMAP2 busy", __func__); - pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, - vm_memattr_to_pte2(ma))); - dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE); - pte2_clear(cmap2_pte2p); - tlb_flush((vm_offset_t)pc->pc_cmap2_addr); - sched_unpin(); - mtx_unlock(&pc->pc_cmap_lock); - } + pa = VM_PAGE_TO_PHYS(m); + sched_pin(); + pc = get_pcpu(); + cmap2_pte2p = pc->pc_cmap2_pte2p; + mtx_lock(&pc->pc_cmap_lock); + if (pte2_load(cmap2_pte2p) != 0) + panic("%s: CMAP2 busy", __func__); + pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, + vm_memattr_to_pte2(ma))); + dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE); + pte2_clear(cmap2_pte2p); + tlb_flush((vm_offset_t)pc->pc_cmap2_addr); + sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index d2e56a270f54..dbd1ed7b316b 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -8045,6 +8045,8 @@ pmap_unmapbios(void *p, vm_size_t size) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pv_memattr == ma) + return; m->md.pv_memattr = ma; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 465b4d0f365b..5065b7e61ee8 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -5617,6 +5617,8 @@ __CONCAT(PMTYPE, unmapdev)(void *p, vm_size_t size) static void __CONCAT(PMTYPE, page_set_memattr)(vm_page_t m, vm_memattr_t ma) { + if (m->md.pat_mode == ma) + return; m->md.pat_mode = ma; if ((m->flags & PG_FICTITIOUS) != 0) diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 7746b668265d..ae17b3289593 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1469,6 +1469,9 @@ moea_page_set_memattr(vm_page_t m, vm_memattr_t ma) pmap_t pmap; u_int lo; + if (m->md.mdpg_cache_attrs == ma) + return; + if ((m->oflags & VPO_UNMANAGED) != 0) { m->md.mdpg_cache_attrs = ma; return; diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 79cea408bb5f..796b1719b8ba 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -2134,6 +2134,9 @@ moea64_page_set_memattr(vm_page_t m, vm_memattr_t ma) CTR3(KTR_PMAP, "%s: pa=%#jx, ma=%#x", __func__, (uintmax_t)VM_PAGE_TO_PHYS(m), ma); + if (m->md.mdpg_cache_attrs == ma) + return; + if ((m->oflags & VPO_UNMANAGED) != 0) { m->md.mdpg_cache_attrs = ma; return; diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 45f7bef8bcc9..a12142fc2d7b 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -5937,6 +5937,10 @@ mmu_radix_page_set_memattr(vm_page_t m, vm_memattr_t ma) { CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, m, ma); + + if (m->md.mdpg_cache_attrs == ma) + return; + m->md.mdpg_cache_attrs = ma; /* diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 5d15bd671285..26efaecc64d1 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -4838,6 +4838,8 @@ pmap_unmapbios(void *p, vm_size_t size) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pv_memattr == ma) + return; m->md.pv_memattr = ma; From nobody Sun Jul 13 07:27:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfxqX1bssz61pr2; Sun, 13 Jul 2025 07:27: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqW1Z7Vz3GmB; Sun, 13 Jul 2025 07: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=1752391655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x/6CO646iY94Me9r6XY+ahLjG67OE0F0Wv4jw5EbZ2o=; b=A3giQdLl3DPTSB+9kjmdzV49HEU1WgJtR09Pc07TBDTvcUgBR67QFTRSM7F2/A4SgZdk4y DlLZz4CJA9eU3wYJNBCTAE0QqLD07fjn2EYwDgsJ1Zx4380iKYg2plFHtmwdgV3R70nIix lObdOOhEqxhRNdxOQHDVaBto4E/il6IfEr8EW8Btiqkz2wM+3WzJoFqYxO8RSuiTF+XM2W JRy8PXIC4BpO8NlgMpA709ZEo8BYuXZbGJFteZoWiG9/UtRCWKkukz1ROZnBeapcxnkfrF V7kT7Chm8KZvBAoZJJyX3N06qaeP0RJ1Rlg1K4haZQgSVgVrJqJWHvPrC7kXPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x/6CO646iY94Me9r6XY+ahLjG67OE0F0Wv4jw5EbZ2o=; b=LFOf0/ZzWmBgXSBjhUt+m5kSotLm8pzMTuz8LsM+4VcnyXwcHHi7WtV0RZEYyNFhpr2XsB cmarvOR3r3Bww0DUuiichuc4SI4wy1o0djEt1iUX45J88wFmarjbkNBlJ4pUbSzZJu+1jn +2Wr5afirBUsI1nQOw0zdkyth7nSDegw3YQq+J/hBN8AjPY64zUWCw2wrCGz9fsgVDh8H5 tjo3+jWPzETa+Ly0qAsEQ3k8kbtYOR8iNQ+zNSXDjM4aLD5D+1LwcRqAKAtWKpGYsoRYL0 18W6bzc1Y35wshykQwJ+LCBeRC5axT3aOinsppQF1+uNoS2cZ3hT4Zq8UBa+5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391655; a=rsa-sha256; cv=none; b=lnCi5EjDo4O0zQLADxSg+xky++lhZCABekaE0ACpIm61O0nbtVedEp7iHxl4Paev6jRtww ybS7c06pnDerMXk7iY17lUcsm708dxXJO4EXkP+/nR5sZzOBfoy2C7zFKkvqZ4p7F7YIGj h/PPubJ2qsq20gB+MG826BOByIOaDKd+oAgcvj8JiFjiegLhdiq3N3oE9jkLYE/mGxQhw0 UntVeziU9yYDwiDd2d0K5TwkD/UlWUSw+Y2NIb4NCbgPGfr04e+a5R/Wtfz3/yWsNL6zLK H/xbIWLMiK4UiXL8tFT+36YrVszJ0ZrSxLWGWKftYwxRaj+wD9x/bShHQOWeLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfxqW0wjrz1078; Sun, 13 Jul 2025 07: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 56D7RZ9J094781; Sun, 13 Jul 2025 07: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 56D7RZuf094776; Sun, 13 Jul 2025 07:27:35 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:35 GMT Message-Id: <202507130727.56D7RZuf094776@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: 1e78a6a6d857 - main - vm_domainset: Print correct function in KASSERT()/panic() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1e78a6a6d85702b84f679712aac71f91e481e8f9 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1e78a6a6d85702b84f679712aac71f91e481e8f9 commit 1e78a6a6d85702b84f679712aac71f91e481e8f9 Author: Olivier Certner AuthorDate: 2025-07-07 14:14:16 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 07:15:22 +0000 vm_domainset: Print correct function in KASSERT()/panic() Some messages in vm_domainset_iter_next() would wrongly refer to vm_domainset_iter_first(). While here, ensure that all assertion/panic messages use '__func__' to avoid this discrepancy in the future if code is moved/copy-pasted again. Reviewed by: markj, alc, kib MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51248 --- sys/vm/vm_domainset.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/vm/vm_domainset.c b/sys/vm/vm_domainset.c index 7b8bf4c77663..b44bdb96b0d4 100644 --- a/sys/vm/vm_domainset.c +++ b/sys/vm/vm_domainset.c @@ -131,8 +131,7 @@ static void vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) { - KASSERT(di->di_n > 0, - ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(di->di_n > 0, ("%s: Invalid n %d", __func__, di->di_n)); switch (di->di_policy) { case DOMAINSET_POLICY_FIRSTTOUCH: /* @@ -149,11 +148,10 @@ vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) vm_domainset_iter_prefer(di, domain); break; default: - panic("vm_domainset_iter_first: Unknown policy %d", - di->di_policy); + panic("%s: Unknown policy %d", __func__, di->di_policy); } KASSERT(*domain < vm_ndomains, - ("vm_domainset_iter_next: Invalid domain %d", *domain)); + ("%s: Invalid domain %d", __func__, *domain)); } static void @@ -189,13 +187,11 @@ vm_domainset_iter_first(struct vm_domainset_iter *di, int *domain) di->di_n = di->di_domain->ds_cnt; break; default: - panic("vm_domainset_iter_first: Unknown policy %d", - di->di_policy); + panic("%s: Unknown policy %d", __func__, di->di_policy); } - KASSERT(di->di_n > 0, - ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(di->di_n > 0, ("%s: Invalid n %d", __func__, di->di_n)); KASSERT(*domain < vm_ndomains, - ("vm_domainset_iter_first: Invalid domain %d", *domain)); + ("%s: Invalid domain %d", __func__, *domain)); } void From nobody Sun Jul 13 08:08:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bfykY6F9hz61rRm; Sun, 13 Jul 2025 08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfykY3LCkz3cYY; Sun, 13 Jul 2025 08: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=1752394101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EBRmur2ed9l9uQNHvu3A8AiFDGUY0p9ULpp8pHKRxj0=; b=yUoLM02e+eylnxH9xhQY7n/7ec/X3XcMojbDFvirPnKQMhSDM3cMnOcrmJ3AzdVHtWNran rVGEroydmyu6GQD+2Jz6/8jPedeJj7QGubUpWSRlseJkSSNYb/gm+4stbv/4dK9fR71kND cA90y5gbsa0ov9qzTocgAbjN8wS0+KL09fLkNec3rdCIQ7EmVo9YwvcRbFMC15yAgeu25+ CmQmZM2jPV5drEh8CF35dlp+N97XDhz6igk3LQbGr4K7GjWnN8wxDXOgpfGazbq+NeoJAW U4cDIkLxwPB6sOs0JzBql4lRFYvJPTv52T4lUugwdgCIcc65khanfgPFu3c8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752394101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EBRmur2ed9l9uQNHvu3A8AiFDGUY0p9ULpp8pHKRxj0=; b=lu4z8DBIiB8WBLUog+dgtPOEIxgnn9sRodFt5XQqhrO82fJ+TuZ1zLvJmBBP/IpwTFm8ub p7V7oCijyAx0CEmeQXb3o6CYkdgzVgi6olWgLCgzzm2+uBBztpjYqMReGRiMrccM82FyHX vjKtI2twdipams2NVyZHYbJtlQ1D4xWXjftn8P4qZiuBovyP1yWbLjMnec4U/BAPf6iSib BfGtHYUWlq5F6xIWEFZLZdobF6YlT/OuejzgcOp1TOK4NOAt9O5ZYNv65S9zM4H+MhgYiL CPxuojHuQX706E64KXvi1dMcNrND+8//EXju8PFH0lvyQsTti0CQ0ejCtWX/GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752394101; a=rsa-sha256; cv=none; b=OSqeE97/S8vcBknYTrc+VUIxU2WADsyTNYiNhcM2W+qj37CTBobS+FgEqwh3Dlpu1by2WV t2KBa2rpd9bTopr1KfHASyFeK9+q/uI3S09gFJmMKY6KjHFmsnIn0RPMyLZcXmCN69fgIz Fy23hXhOI+LgmHEXcLCORhFS89im+iXhxq+QJl4kKAkKiooaHtuBlR2LK9JaStHX3tBylH VUGt8SFnmSa4W7Ddi0PlvS4XCau2mwy9s7HqksZpAGijlk7spuSzlA9uiIsi5mYVOwh5qm BAKyfnmCqZNXy1HjDYco4g2L5VAUJ2q8vvGAMh160vD3eO0f5a9DoFxJ+tWcMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bfykY2lJ0z10vg; Sun, 13 Jul 2025 08: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 56D88LMp070847; Sun, 13 Jul 2025 08:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D88LF0070844; Sun, 13 Jul 2025 08:08:21 GMT (envelope-from git) Date: Sun, 13 Jul 2025 08:08:21 GMT Message-Id: <202507130808.56D88LF0070844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 76856ead444d - main - netstat.1: Add common example to list listening sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76856ead444ddcbc548308a2b900bb5ae10e8228 Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=76856ead444ddcbc548308a2b900bb5ae10e8228 commit 76856ead444ddcbc548308a2b900bb5ae10e8228 Author: Lukas Engelhardt AuthorDate: 2025-07-13 08:07:00 +0000 Commit: Dave Cottlehuber CommitDate: 2025-07-13 08:07:00 +0000 netstat.1: Add common example to list listening sockets While here, wrap to 80 characters. Approved by: ziaee Differential Revision: https://reviews.freebsd.org/D51280 --- usr.bin/netstat/netstat.1 | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 1a2c786e90aa..cf6a907c6aa4 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -416,7 +416,8 @@ When used with or .Fl 6 , limit the output to IPv4 or IPv6 routes respectively. -This option provides details about individual nexthop addresses used in routing decisions. +This option provides details about individual nexthop addresses +used in routing decisions. .It Xo .Bk -words .Nm netstat @@ -430,7 +431,8 @@ When used with or .Fl 6 , restrict the output to IPv4 or IPv6 nexthop groups respectively. -This option shows grouped nexthop entries for multipath or load-balanced routing setups. +This option shows grouped nexthop entries for multipath or +load-balanced routing setups. .It Xo .Bk -words .Nm @@ -926,25 +928,25 @@ binary is not available in the .Sh EXAMPLES Show packet traffic information (packets, bytes, errors, packet drops, etc) for interface re0 updated every 2 seconds and exit after 5 outputs: -.Bd -literal -offset indent -$ netstat -w 2 -q 5 -I re0 -.Ed +.Pp +.Dl netstat -w 2 -q 5 -I re0 .Pp Show statistics for ICMP on any interface: -.Bd -literal -offset indent -$ netstat -s -p icmp -.Ed +.Pp +.Dl netstat -s -p icmp .Pp Show routing tables: -.Bd -literal -offset indent -$ netstat -r -.Ed +.Pp +.Dl netstat -r .Pp Same as above, but without resolving numeric addresses and port numbers to names: -.Bd -literal -offset indent -$ netstat -rn -.Ed +.Pp +.Dl netstat -rn +.Pp +Show IPv4 listening sockets: +.Pp +.Dl netstat -4l .Sh SEE ALSO .Xr fstat 1 , .Xr nfsstat 1 , From nobody Sun Jul 13 09:37:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg0jc1ZqSz61wXK; Sun, 13 Jul 2025 09:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg0jc0zWZz3HsW; Sun, 13 Jul 2025 09:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752399460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lBNvpJrCewcV0+ugQkNb/PbT6r/89Wxc/zBo+jfw8bg=; b=x7mxK0h/EOw8J7yeJ3Pi6JmH/oa0mDU4KWZcfSzNdB7h64a9EkcpxQp5WSmAveEu6e+t0W MXNFoSnDur0BEtaM1RNUvy3QdTuv3NFL9Me6Okx/2RFksfJ3xwHjnJ7L7S1Subg1UTUrjJ VX0sAwxN81RZAAIIUaJTotmmWuY3xbiP1EeB8QQ74zZ+7G2TkVNSEK18a+/ODt5Ueu53YV p+qnz1omURU91e8kCE0CSPxK1z+CJLOy4tAR4aTPuwnfrYa2Vl45kzKrlQmt8bo5GFQEYY 1AG2+/xQMwGI6IEBPLf2S3TgessYuLe3bxkGPxP8gC37TUNvOcl6xhJb74FSnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752399460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lBNvpJrCewcV0+ugQkNb/PbT6r/89Wxc/zBo+jfw8bg=; b=EzAM3USEVtHkSMN5ohpSZjVwD7VoYz8LfHo5HYEDXXs4gWgSE4Qzr0maagmiJSTEIXhCjn eo1TzVw0CEg12xeilKtT6plwAjpQ/V/7D2GdnM8iC5nlPVn/WZHjlNcXel9XbQ0aYbnode PWUZTIw/YY5WRSgzc7zs86/aLpBvemobx9ZFBXSsBwWBavW2mVSV+EwLB6YBd1zdiIrgvh fWHTgX54bJkDHBMuLOomOCoky0dQwBynQkRxduIpZ6+Ggz0pCRtZVB+JDLUGjv0z2IBWaB oWLe4N+OTkPxcj5xu5h+34PkKG1OfZR+dNC0sWvRZMpmZKkBcbzyvEYVmH7NjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752399460; a=rsa-sha256; cv=none; b=j/kHulKlGW/UGZovh2W4CDARM0gS8lKgVnjcPHFME603ZwoAlaHGtvLidI6b3zBKmMHEn0 8LaUMNzkC+l9VYk2pmArEXk6d771rczPa3FQStUDKswPChs5heHsuab+mDb/0JVunqp02O r9sP7pyosBNdtF9EBMgJw22JbaMAyzv8veAoqIMb4jZ/NNQzekIe4atS7jQZ5K9t5S3ZCf mX1E+gk2qJqx8E2Ql8xLiteQ+JJVTF1/p3wtOZ6rfSKJH/nf/3qxQhapg4G5fCtmbYpXXt 2FN2zCBjCMWhoSnesj8vS7ELHIYZU1YPiNjpdSM/lzgvMXuq4Bu08jvuuHvPNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg0jc0Rq9z13DV; Sun, 13 Jul 2025 09:37: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 56D9bewp040115; Sun, 13 Jul 2025 09:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D9bdsv040112; Sun, 13 Jul 2025 09:37:39 GMT (envelope-from git) Date: Sun, 13 Jul 2025 09:37:39 GMT Message-Id: <202507130937.56D9bdsv040112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lars Engels Subject: git: 5031da20599b - main - bluetooth-config: Fix command line parsing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lme X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5031da20599bb1163f0e8d1c4b415ab3bbebce00 Auto-Submitted: auto-generated The branch main has been updated by lme: URL: https://cgit.FreeBSD.org/src/commit/?id=5031da20599bb1163f0e8d1c4b415ab3bbebce00 commit 5031da20599bb1163f0e8d1c4b415ab3bbebce00 Author: Dirk Engling AuthorDate: 2025-07-13 09:25:24 +0000 Commit: Lars Engels CommitDate: 2025-07-13 09:25:24 +0000 bluetooth-config: Fix command line parsing This addresses the problems encountered when parsing options in bluetooth-config. - the optional parameters were not properly shifted after consumption - the command line parameter count was checked before getopts and not after Reported by: sjg Approved by: kp MFC after: 7 days Event: Berlin Hackathon 202507 Differential Revision: --- usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh b/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh index 48a399a82fc7..148325fcecbc 100755 --- a/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh +++ b/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh @@ -17,7 +17,7 @@ main() { unset node device started bdaddresses retry # Only one command at the moment is scan (+ add) -[ "$#" -eq 1 -a "$1" = "scan" ] || print_syntax +[ "$1" = "scan" ] || print_syntax shift # Get command line options @@ -28,6 +28,12 @@ while getopts :d:n: arg; do ?) print_syntax;; esac done +shift "$((OPTIND-1))" + +# If there's leftover parameters, print usage +[ "$#" -eq 0 ] || print_syntax +shift + # No use running without super user rights if [ $( id -u ) -ne 0 ]; then From nobody Sun Jul 13 11:53:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg3jw3tpyz60r5V; Sun, 13 Jul 2025 11:53: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg3jw1Qlnz3YKk; Sun, 13 Jul 2025 11:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUwpg/Hd1KBBUNkT26H79bb10nKYqnoLA3pa1UDSrB4=; b=DW7wr+sBLyIQTcs5E68xth4flS2pW/tOt5rXFFYTGuN2CNNcomOoa3t1tuqOxKh867vq1g HCfrsxMseXlS7XcJR0t9nViMHv+glULHQypYq5NNVFh+YLlHqymGr8iEg8PmbMyq2yclOh CPBgKto1xS036NY6RzQsAx1339RHo4nbjbog6n3XMvpxvHdC/BX7dHxw5BFc9YT8yvgUeE 4HDrMNMdkHLTNIEtH/hYKL9PiuKGtJQIyHcz7Al1o+dr+wS5mbnXH2dhuBZcl6haJ945m0 o8wnnx15rzg/a8Ymi9dDNhGfYi6q52vdwJrx7cBHof2DLr8F2zvw+AGFteBCow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUwpg/Hd1KBBUNkT26H79bb10nKYqnoLA3pa1UDSrB4=; b=yihPeuzYiHORUzUFNfjtcdbaw2Jk6mz3o4/Qj3QrSKbr0vKS+3rDK8lYlm33S7hA2yeRFz yaCvE1Y2hIL/z+iyt/csOm3RGPCEuL5BBWOosj3B2IybSe9jybljG1B+MPpiZncRcyYMEa sfG8gCKjZBN15qsFRljVDlcUxlODRPle9L7ZJ1fvTVJxqsgbIBT5Jc4sPYNn1eSm+lcnP0 /lCfrB4MI5If9EkSSeMdABLxTxIBIoZyDbHzhrxRyaVt+29TlAfh0C2zzdRMvRjw6hg7ah M4c0EsFWAWFmvVncB7iBbSfQr9fw4I+BhMxbsxMFEJPsnnn91zVAMYWNCkkO4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752407588; a=rsa-sha256; cv=none; b=x14Xuvisg4L4I+qVWPcq0DnpZJkq/RgglQEQPELJWVhAhi6CvPQwq0aKLapvwtkVMmr9i2 5xJKWm97TlmDhUNhiC+2VoNCCcGy5WsNZSlkC1xO3Z3VqonJSfGAHesSDS3S2oPEl+PYED fzL3nL4S5GQcWY9l26Bui3jmFuRjHTR7szcrQ15Pm5xOJmhLBYNuT0k03OZH3L3f6TGEDr BEPnYmzUSmpRmQScISTlkd7wHrCj0lm6n7C99IgkkGomO+nTkdq3WD+bQwZf8JltIrmIgZ R/FcuOjspbCj+10UiafUgmbf3Lxe464YaaOfyZrp+oI6IUNCLUiMWYtZFJN2tA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg3jw0TLGz16VY; Sun, 13 Jul 2025 11:53: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 56DBr8cH001783; Sun, 13 Jul 2025 11:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DBr7mv001780; Sun, 13 Jul 2025 11:53:07 GMT (envelope-from git) Date: Sun, 13 Jul 2025 11:53:07 GMT Message-Id: <202507131153.56DBr7mv001780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: cbd06dd2afd5 - main - pf: Fix error handling when pf_map_addr() fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbd06dd2afd543fc3cb9aa95ab2219a9ec60619d Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=cbd06dd2afd543fc3cb9aa95ab2219a9ec60619d commit cbd06dd2afd543fc3cb9aa95ab2219a9ec60619d Author: Kajetan Staszkiewicz AuthorDate: 2025-06-05 18:40:28 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 11:48:39 +0000 pf: Fix error handling when pf_map_addr() fails When pf_map_addr() fails, for example for a NAT pool, we expect packet will not be forwarded. The error returned by pf_map_addr() has been ignored in pf_map_addr_sn(), though, causing packets being forwarded without NAT applied. Catch the error, return the error to caller, let the caller handle error counters for route-to pools just like it does for NAT pools. Add tests for NAT and route-to rules. Improve logging by not hardcoding function name and use __func__ instead. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50763 --- sys/netpfil/pf/pf.c | 9 +++++---- sys/netpfil/pf/pf_lb.c | 18 ++++++------------ tests/sys/netpfil/pf/nat.sh | 33 +++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/route_to.sh | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 16 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index acdeebb85e30..a410fe570c39 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5906,11 +5906,12 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, * it is applied only from the last pass rule. */ pd->act.rt = r->rt; - /* Don't use REASON_SET, pf_map_addr increases the reason counters */ - ctx.reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, - &pd->act.rt_kif, NULL, &(r->route), PF_SN_ROUTE); - if (ctx.reason != 0) + if ((transerror = pf_map_addr_sn(pd->af, r, pd->src, + &pd->act.rt_addr, &pd->act.rt_kif, NULL, &(r->route), + PF_SN_ROUTE)) != PFRES_MATCH) { + REASON_SET(&ctx.reason, transerror); goto cleanup; + } } if (pd->virtual_proto != PF_VPROTO_FRAGMENT && diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index d4728f61dce8..9db1d88ce52e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -755,10 +755,6 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, done_pool_mtx: mtx_unlock(&rpool->mtx); - if (reason) { - counter_u64_add(V_pf_status.counters[reason], 1); - } - return (reason); } @@ -793,7 +789,7 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (nkif) *nkif = sn->rkif; if (V_pf_status.debug >= PF_DEBUG_NOISY) { - printf("pf_map_addr: src tracking maps "); + printf("%s: src tracking maps ", __func__); pf_print_host(saddr, 0, af); printf(" to "); pf_print_host(naddr, 0, af); @@ -808,14 +804,16 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, * Source node has not been found. Find a new address and store it * in variables given by the caller. */ - if (pf_map_addr(af, r, saddr, naddr, nkif, init_addr, rpool) != 0) { - /* pf_map_addr() sets reason counters on its own */ + if ((reason = pf_map_addr(af, r, saddr, naddr, nkif, init_addr, + rpool)) != 0) { + if (V_pf_status.debug >= PF_DEBUG_MISC) + printf("%s: pf_map_addr has failed\n", __func__); goto done; } if (V_pf_status.debug >= PF_DEBUG_NOISY && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) { - printf("pf_map_addr: selected address "); + printf("%s: selected address ", __func__); pf_print_host(naddr, 0, af); if (nkif) printf("@%s", (*nkif)->pfik_name); @@ -826,10 +824,6 @@ done: if (sn != NULL) PF_SRC_NODE_UNLOCK(sn); - if (reason) { - counter_u64_add(V_pf_status.counters[reason], 1); - } - return (reason); } diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index f1fdf6405d97..16c981f97399 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -777,6 +777,38 @@ binat_match_cleanup() kill $(cat ${PWD}/inetd_tester.pid) } +atf_test_case "empty_pool" "cleanup" +empty_pool_head() +{ + atf_set descr 'NAT with empty pool' + atf_set require.user root +} + +empty_pool_body() +{ + pft_init + setup_router_server_ipv6 + + + pft_set_rules router \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b" \ + "pass out on ${epair_server}a inet6 from any to ${net_server_host_server} nat-to " \ + + # pf_map_addr_sn() won't be able to pick a target address, because + # the table used in redireciton pool is empty. Packet will not be + # forwarded, error counter will be increased. + ping_server_check_reply exit:1 + # Ignore warnings about not-loaded ALTQ + atf_check -o "match:map-failed +1 +" -x "jexec router pfctl -qvvsi 2> /dev/null" +} + +empty_pool_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "exhaust" @@ -794,4 +826,5 @@ atf_init_test_cases() atf_add_test_case "nat_match" atf_add_test_case "binat_compat" atf_add_test_case "binat_match" + atf_add_test_case "empty_pool" } diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 5c0d355b8ea1..91c12c8ce2ae 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -859,6 +859,40 @@ ttl_cleanup() pft_cleanup } + +atf_test_case "empty_pool" "cleanup" +empty_pool_head() +{ + atf_set descr 'Route-to with empty pool' + atf_set require.user root +} + +empty_pool_body() +{ + pft_init + setup_router_server_ipv6 + + + pft_set_rules router \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b route-to (${epair_server}a ) inet6 from any to ${net_server_host_server}" \ + "pass out on ${epair_server}a" + + # pf_map_addr_sn() won't be able to pick a target address, because + # the table used in redireciton pool is empty. Packet will not be + # forwarded, error counter will be increased. + ping_server_check_reply exit:1 + # Ignore warnings about not-loaded ALTQ + atf_check -o "match:map-failed +1 +" -x "jexec router pfctl -qvvsi 2> /dev/null" +} + +empty_pool_cleanup() +{ + pft_cleanup +} + + atf_init_test_cases() { atf_add_test_case "v4" @@ -877,4 +911,5 @@ atf_init_test_cases() atf_add_test_case "dummynet_double" atf_add_test_case "sticky" atf_add_test_case "ttl" + atf_add_test_case "empty_pool" } From nobody Sun Jul 13 12:23:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg4PQ4HDHz60ssN; Sun, 13 Jul 2025 12:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg4PQ3QRzz3rGx; Sun, 13 Jul 2025 12:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMxfTq6qxPD0pOGyg8JnhQGB/s+dKg42rv8icHfR+sI=; b=qndsPgDBC01Kayr+fEuAWetoq0NJaadoxFhPaqZoXqvJzfzSDkyHks29JUKKzg1FRovUgV ax/iNEnH63ZrcUHqzke+8nXCuhnkfwmZSzVPeAeY9v5JUWgEmX3Nyqq1VtXKqDLLRahXXm Jj/cOkZH3Bu6aRa2dA1iopK5Cb8vEQF4QTjUp2Kelqs/fpc0hgPzloFZO6zOUQRtvf0Mqc vdRpkO0t2v/r6Es21+tjtQXa5Mk7IhHtRvTgwQSZgFA2SZfiLnpusXBuQwx5RudUY0k68c WjdOczYQJIa8HyblIgWRDxwz7uCYR8+j4eLQR5FloqZEDoh95qkjJTNlGyrLFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMxfTq6qxPD0pOGyg8JnhQGB/s+dKg42rv8icHfR+sI=; b=hA3WtySflcCpIpENOkBQADu0oh9psB1goerlYrfT76gkWmRAeKz2j83Tv0a5noLbAdcVY8 yHjGDWph2+1HdqVFgoulvxNwCSq9M0x+B1qrsV162Ain7XQpX+X1T6rj3EbU6o67LnJYJP oF6fYx2RvkGcjNY4n5p6t5WJPryu+FD2dRfEYUV1RHMU6p8eMnQ1Y+jByMk9LAAdN0eauA BWPRivD+9r7r2fMXe/GdiQNU9i8zsizqFh3EjAiY/hsbqGw1SQp7qihUo2AnG/+oL+D7Xu kUdzYi30GcXeiOxB8xjoglb9bjpLLKmg/5TBWuXG15sCQlmF+Pe1nTGuzzWTsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752409434; a=rsa-sha256; cv=none; b=fDikk1WY0bn9qFDGw4CoURrfX1pZSMWtb7GjMQ+Yc7+KuZJ+Xx8hctSAaNigK+A92Pwhks jBgF0GPj8kfm7MWylapGg3awTVqUf26zqmxA+ImcWVYETSjGgkxwlOkJB+cmdjvLvjqSpS DtBY0DXY1R4quqT8oJt/J3Q+QbRVW7Ba4TwLvYAQQkZhHjVL0H9snLY0xKU/0o1N8jiB+s kIYcf760a/ayMWe3+St/LmYd6rXcOuKgF++VfRR3y2fEyBxuK0mZbgyElIqZb5czwINCRo ZWOQE7KIh4sK3kgMbrBdg6yP6pMqdJlutWuO/qDav3rEcN+o1tV74LqgHepNqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg4PQ30Z8z17g4; Sun, 13 Jul 2025 12:23: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 56DCNs1M059098; Sun, 13 Jul 2025 12:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DCNsBh059095; Sun, 13 Jul 2025 12:23:54 GMT (envelope-from git) Date: Sun, 13 Jul 2025 12:23:54 GMT Message-Id: <202507131223.56DCNsBh059095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: b98b82a8bff9 - main - share/termcap: ti703 does not actually support tabs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b98b82a8bff951b5c1dc1b3b590a986e027efd84 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=b98b82a8bff951b5c1dc1b3b590a986e027efd84 commit b98b82a8bff951b5c1dc1b3b590a986e027efd84 Author: Robert Clausecker AuthorDate: 2025-07-13 10:29:15 +0000 Commit: Robert Clausecker CommitDate: 2025-07-13 12:23:48 +0000 share/termcap: ti703 does not actually support tabs This is a mistake I made when I originally wrote this entry. Event: Berlin Hackathon 202507 MFC after: 1 week --- share/termcap/termcap | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/termcap/termcap b/share/termcap/termcap index 9704d85c942f..3ec56111ed8e 100644 --- a/share/termcap/termcap +++ b/share/termcap/termcap @@ -3549,8 +3549,7 @@ ti931|ti 931:\ # using \EPC\\ and \EPD\\, but I don't think there is a # capability for that. ti703|ti707|Texas Instruments Silent 703/707, 80 cols:\ - :am:hc:os:xn:\ - :co#80:it#8:\ + :am:hc:os:xn:co#80:\ :do=\n:le=\b:cr=\r:nd= :bl=^G:ta=\t:is=\EPC\\: ti703-w|ti707-w|Texas Instruments Silent 703/707, 132 cols:\ :co#132:is=\EPD\\:tc=ti703: From nobody Sun Jul 13 12:23:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg4PS1VGLz60sg1; Sun, 13 Jul 2025 12:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg4PR6KRnz3r3Q; Sun, 13 Jul 2025 12:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZB3Jg0YVn8c9v1h/sVcMh9niBVHRm07KDdyaa7QzbQU=; b=TT6eSTpusSSsqyY4ap1g7p+6aaPgZeJmVR/V5bnGKhc0p7xUBO4qUlPyAJtiYnf4URDDI2 ycdoIs6V3L/DzyjkHuKzDJtwaWakT6DyM9vWef0fsQ8uOf4KayVxDzkg6Es0OE1PBgxTnT 1gS7iEgor3Sm61mhExZYjQR9+6R5RCpGup/Tcpc25rWpRiCRtPV6jPhRHFoCGzG7E4PxNt 6+uLB2+gDOhP9gKSQweQfnlPKYaLhrNETItLHnShGzInMxhdIpy2lEZuVxHxyOiWE/4GjI RG8ArlpXGLO5y23MylXG8wOOzdeBw354jFSo/ElC0S1HJlGuSmnEgKJUzWsijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZB3Jg0YVn8c9v1h/sVcMh9niBVHRm07KDdyaa7QzbQU=; b=TZpsRIuxOhsw13XdKlLx4qpkhWbh+EtGairkbNrQwIIINPoEX7i0Hx7LdB47MOqRkxjnRW 4WMrxpWZjz6DkII+AtbTrt4Uw+M3gP0n1WD27/8Xoz2id9xY1klNtpuKyId45V36j4J4aq 010fN1BonHbnJJhzeFzOMlTITrSoVNMInMUK5TfmdZY0AhvkDu0WF492J3U3hk4iJlqvi1 AS9oLaYocLOI5JZfrjMqGwJEC+WPT/IJpcT2o9Z9Ps2eq+2O9z78VsXG8nY1g0B20XCpBv dn8FNSN290QZADoU+YqYiaVeifrUTUw0ZHQPqZL8uVC95o6Vb/lIri8N72y1WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752409435; a=rsa-sha256; cv=none; b=eDw+/QYbgpRVaosbZj3LiRUYp5WW/w5kOstDL221Wr6x/zmVgfR/uS9Kew3TebuouioVrw m3Y+ULoRmCztzPbjg9MsgGCmmrtnyvGb94381wbEZvVQnC8TMNXbfkOKo2/3zcyZRwkG0l jIO7w6+T30mNklp2wx038pepEpPD/TKiQNw/L/v0CMxXMoUcdD3agYYCmCLDxSZai4GJ+J btwYy7SccC84/LWXgEMTm1Rf0CWd2pEk4qX/Ar6K0BQBEInOwJfnF6IQns5TPtqdEM0hwP a8hCp5taSOeKpmCx34ZKWoJV73pLp1VUrbuq6xahdy7tzzW7umTv1WrPMkwsiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg4PR4BMRz17g5; Sun, 13 Jul 2025 12:23: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 56DCNtk4059136; Sun, 13 Jul 2025 12:23:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DCNtrr059133; Sun, 13 Jul 2025 12:23:55 GMT (envelope-from git) Date: Sun, 13 Jul 2025 12:23:55 GMT Message-Id: <202507131223.56DCNtrr059133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 804f961c5cdd - main - share/termcap: add xterm-ghostty entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 804f961c5cddcffa950ff7f13025021cdd95ba46 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=804f961c5cddcffa950ff7f13025021cdd95ba46 commit 804f961c5cddcffa950ff7f13025021cdd95ba46 Author: Robert Clausecker AuthorDate: 2025-07-13 12:10:48 +0000 Commit: Robert Clausecker CommitDate: 2025-07-13 12:23:48 +0000 share/termcap: add xterm-ghostty entry As generated by ghostty during the build with some copy-editing. Submitted by: Tim Culverhouse PR: 287642 Event: Berlin Hackathon 202507 MFC after: 1 week --- share/termcap/termcap | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/share/termcap/termcap b/share/termcap/termcap index 3ec56111ed8e..46b89d0b3ddf 100644 --- a/share/termcap/termcap +++ b/share/termcap/termcap @@ -4807,6 +4807,26 @@ alacritty+common|base fragment for alacritty:\ :te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\ :ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: + +# From Tim Culverhouse +xterm-ghostty|ghostty|Ghostty:\ + :am:hs:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ + :LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ + :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ + :ei=\E[4l:fs=^G:ho=\E[H:ic=\E[@:im=\E[4h:k1=\EOP:k2=\EOQ:\ + :k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ + :kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:\ + :ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:\ + :mh=\E[2m:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:\ + :so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:\ + :ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ + :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: + # # END OF TERMCAP # ------------------------ From nobody Sun Jul 13 13:01:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg5Dk26zHz60wgT; Sun, 13 Jul 2025 13:01:26 +0000 (UTC) (envelope-from vishwin@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg5Dj5qcmz3HY4; Sun, 13 Jul 2025 13:01:25 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752411685; 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:autocrypt:autocrypt; bh=hzlIj2joLmP3EJWHyeP11ZMXgWFGig8nT6sll8Op4+k=; b=UTIq1Hl9nT1EAEBT8rXbsh1ndCrb18AFOWzvcZZj8ubzG4bnmi7eG5WExBFOyZ/l4NlzHs Qx6oNYBnitHNQtCl6Z9Orcn7OVCpa60We+kHzcXHrSJRJI944hgHNHjlBMTiINyVWiaZAU aoVNIHQcvN8HVzu7YKzTYOJx+It+n6o5JeIKc7GPkiCMZieUSkkzZ2rDfbgPIIoM3oa2es PaRjVueKY+ajpRrTD5y+SO4EIHjEStgS8TDXckbcMey4c3HxWXPGe4xEi3Fw+A3pg8fyDM xkSRqPdpAyIn1GvSVYBl0iWqMgftT8N363eYWQYYBxJtbkqkK9hpfOHTwQ8CuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752411685; 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:autocrypt:autocrypt; bh=hzlIj2joLmP3EJWHyeP11ZMXgWFGig8nT6sll8Op4+k=; b=Fe04RjEKZYhIx8VgZbvA0ecijFTx+UB2YXibZw0hCjOzVmopXLz1hysX+iJ1psrPa9AB84 KqA7fp+Csvle5yQzQj27yRJrGNenIKiGbV8mEOjdI9VHmhIhuirDMhpo4Z2EXnSVCJ5VS+ GtBLV49gogc6MeBiazdxxpRQ7BFvC+lKY1ytCd411DgZs+wSJq8QPM4+HN903eQ6XqIb85 Yc9l+nwTmdVpkXv8SWXWXsMu9oEDZfIymQQ7zikTWO/dQ2TC1XH0SaYHRT3fw94htLBW9c vCuHzuC/o5hJNpeAInlBNM1UdQc2LVD99MiZa7Vf6ut8vuxbk6tRNKe8TMSnGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752411685; a=rsa-sha256; cv=none; b=imSjRkfNpmofI+05wWSs/icVPGPj+sRWbClrXvJ/4/NZMfTmO4l1gkAdhdFJyXvQLpAx69 BiZEzHzmFua6f2mWir3HiBZFbUxGjJC5DRkaWF3GeQIMHIFdrwMVGmXt05FV1myrFWbbgw xDvK81dUZoSPGVUZysV9HOGFRdlHpTvARg/3ZQtQqxpWrNvy+HV5KphhWVqPSdiheBndIH QHwYWZ05TusY0QzdH04Yz8ZiZcPyELvR4EwkXdlOZONC7jrVyP/CNJq2bdIh7VZxi7zWaM rsoD94+qTV2iNKxTRhOdmGxWFasmnO+4NtKHqsK3m8z6/3RXLkYQ9D63N3j40w== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (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: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg5Dj3kQlz8Cy; Sun, 13 Jul 2025 13:01:25 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: Date: Sun, 13 Jul 2025 09:01:24 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEaEicoBYJKwYBBAHaRw8BAQdAZBuydpjFLGem4uRJPWaYMXX2e+BN1jDhbD3tcqbxhdfN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbAwUJCWYBgAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRDP+1cn7slqBM/bAP9bhA4e0LxJYFYJlftZM5WHrMSPpUe6 G2pVqmQWTQ0EZQEA0PNryfH3qRWWPSI8mFNRnG24hi5/aXFqCnHj1tcJ9Q/OOARoSJygEgor BgEEAZdVAQUBAQdAUT4TzYFmV6ueIGwjX0N+445KZV6ns1Wiw67QMsJZxHkDAQgHwn4EGBYK ACYWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbDAUJCWYBgAAKCRDP+1cn7slqBPO/ AQCPuGiyyfJClICRs/ToG0MsT8YcPdBygzuUIIeGpkjJpgEA7AoFCQ0Y28Y3hIDFn2k9PH3B nGWL3g05W0ds2qoj+gQ= Organization: FreeBSD Project In-Reply-To: <202507041455.564EtqwS073424@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------CWWw7Mfv2fBZ9PfjZZk0Yuj6" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------CWWw7Mfv2fBZ9PfjZZk0Yuj6 Content-Type: multipart/mixed; boundary="------------xUtkXr0K6mUW7RFH7YGv5QTA"; protected-headers="v1" From: Charlie Li To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> In-Reply-To: <202507041455.564EtqwS073424@gitrepo.freebsd.org> --------------xUtkXr0K6mUW7RFH7YGv5QTA Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 TWFyayBKb2huc3RvbiB3cm90ZToNCj4gICBzeXMva2Vybi92ZnNfdm5vcHMuYyAgICAgICB8 ICAgIDMgKy0NCj4gDQo+IA0KQWZ0ZXIgdGhpcyBlbnRpcmUgc2VyaWVzIG9mIGNvbW1pdHMs IHdpdGggYWxsIHBvcnRzIHJlYnVpbHQsIEknbSBnZXR0aW5nIA0KcGFuaWNzIGltbWVkaWF0 ZWx5IHVwb24gc3RhcnRpbmcgYSBkZXNrdG9wLCBmb3VuZCB3aXRoIGJvdGggeGZjZSBhbmQg DQpjaW5uYW1vbjoNCg0KU3VuIEp1bCAxMyAwODozMDozOCBFRFQgMjAyNQ0KDQpGcmVlQlNE IGxlaG1hbiAxNS4wLUNVUlJFTlQgRnJlZUJTRCAxNS4wLUNVUlJFTlQgIzIgDQptYWluLW4y Nzg3MTAtZjVkYmE2NzMzNDVlOiBTYXQgSnVsIDEyIDE5OjE4OjU5IEVEVCAyMDI1IA0Kcm9v dEBsZWhtYW46L3Vzci9vYmovdXNyL3NyYy9hbWQ2NC5hbWQ2NC9zeXMvT0RZU1NFWSAgYW1k NjQNCg0KcGFuaWM6IEFzc2VydGlvbiAqZW9mZmxhZyAhPSAwIGZhaWxlZCBhdCAvdXNyL3Ny Yy9zeXMva2Vybi92ZnNfdm5vcHMuYzo0MDU4DQoNClJlYWRpbmcgc3ltYm9scyBmcm9tIC9i b290L2tlcm5lbC9rZXJuZWwuLi4NClJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3IvbGliL2Rl YnVnLy9ib290L2tlcm5lbC9rZXJuZWwuZGVidWcuLi4NClJlYWRpbmcgc3ltYm9scyBmcm9t IC9ib290L2tlcm5lbC96ZnMua28uLi4NClJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3IvbGli L2RlYnVnLy9ib290L2tlcm5lbC96ZnMua28uZGVidWcuLi4NClJlYWRpbmcgc3ltYm9scyBm cm9tIC9ib290L21vZHVsZXMvaTkxNWttcy5rby4uLg0KKE5vIGRlYnVnZ2luZyBzeW1ib2xz IGZvdW5kIGluIC9ib290L21vZHVsZXMvaTkxNWttcy5rbykNClJlYWRpbmcgc3ltYm9scyBm cm9tIC9ib290L21vZHVsZXMvZHJtLmtvLi4uDQooTm8gZGVidWdnaW5nIHN5bWJvbHMgZm91 bmQgaW4gL2Jvb3QvbW9kdWxlcy9kcm0ua28pDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAvYm9v dC9rZXJuZWwvaWljLmtvLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAvdXNyL2xpYi9kZWJ1 Zy8vYm9vdC9rZXJuZWwvaWljLmtvLmRlYnVnLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAv Ym9vdC9rZXJuZWwvbGludXhrcGlfdmlkZW8ua28uLi4NClJlYWRpbmcgc3ltYm9scyBmcm9t IC91c3IvbGliL2RlYnVnLy9ib290L2tlcm5lbC9saW51eGtwaV92aWRlby5rby5kZWJ1Zy4u Lg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL2Jvb3QvbW9kdWxlcy9kbWFidWYua28uLi4NCihO byBkZWJ1Z2dpbmcgc3ltYm9scyBmb3VuZCBpbiAvYm9vdC9tb2R1bGVzL2RtYWJ1Zi5rbykN ClJlYWRpbmcgc3ltYm9scyBmcm9tIC9ib290L2tlcm5lbC9saW5kZWJ1Z2ZzLmtvLi4uDQpS ZWFkaW5nIHN5bWJvbHMgZnJvbSAvdXNyL2xpYi9kZWJ1Zy8vYm9vdC9rZXJuZWwvbGluZGVi dWdmcy5rby5kZWJ1Zy4uLg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL2Jvb3QvbW9kdWxlcy90 dG0ua28uLi4NCihObyBkZWJ1Z2dpbmcgc3ltYm9scyBmb3VuZCBpbiAvYm9vdC9tb2R1bGVz L3R0bS5rbykNClJlYWRpbmcgc3ltYm9scyBmcm9tIC9ib290L2tlcm5lbC9pZl9pd2x3aWZp LmtvLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAvdXNyL2xpYi9kZWJ1Zy8vYm9vdC9rZXJu ZWwvaWZfaXdsd2lmaS5rby5kZWJ1Zy4uLg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL2Jvb3Qv a2VybmVsL2lmX2l3bS5rby4uLg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL3Vzci9saWIvZGVi dWcvL2Jvb3Qva2VybmVsL2lmX2l3bS5rby5kZWJ1Zy4uLg0KUmVhZGluZyBzeW1ib2xzIGZy b20gL2Jvb3Qva2VybmVsL2N1c2Uua28uLi4NClJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3Iv bGliL2RlYnVnLy9ib290L2tlcm5lbC9jdXNlLmtvLmRlYnVnLi4uDQpSZWFkaW5nIHN5bWJv bHMgZnJvbSAvYm9vdC9rZXJuZWwvdXBsY29tLmtvLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJv bSAvdXNyL2xpYi9kZWJ1Zy8vYm9vdC9rZXJuZWwvdXBsY29tLmtvLmRlYnVnLi4uDQpSZWFk aW5nIHN5bWJvbHMgZnJvbSAvYm9vdC9rZXJuZWwvbmxzeXNldmVudC5rby4uLg0KUmVhZGlu ZyBzeW1ib2xzIGZyb20gL3Vzci9saWIvZGVidWcvL2Jvb3Qva2VybmVsL25sc3lzZXZlbnQu a28uZGVidWcuLi4NCl9fY3VydGhyZWFkICgpIGF0IC91c3Ivc3JjL3N5cy9hbWQ2NC9pbmNs dWRlL3BjcHVfYXV4Lmg6NTcNCjU3ICAgICAgICAgICAgICBfX2FzbSgibW92cSAlJWdzOiVj MSwlMCIgOiAiPXIiICh0ZCkNCihrZ2RiKSAjMCAgX19jdXJ0aHJlYWQgKCkgYXQgL3Vzci9z cmMvc3lzL2FtZDY0L2luY2x1ZGUvcGNwdV9hdXguaDo1Nw0KICAgICAgICAgdGQgPSA8b3B0 aW1pemVkIG91dD4NCiMxICBkb2FkdW1wICh0ZXh0ZHVtcD10ZXh0ZHVtcEBlbnRyeT0xKQ0K ICAgICBhdCAvdXNyL3NyYy9zeXMva2Vybi9rZXJuX3NodXRkb3duLmM6Mzk5DQogICAgICAg ICBlcnJvciA9IDANCiAgICAgICAgIGNvcmVkdW1wID0gPG9wdGltaXplZCBvdXQ+DQojMiAg MHhmZmZmZmZmZjgwYjk4OTgzIGluIGtlcm5fcmVib290IChob3d0bz0yNjApDQogICAgIGF0 IC91c3Ivc3JjL3N5cy9rZXJuL2tlcm5fc2h1dGRvd24uYzo1MTkNCiAgICAgICAgIG9uY2Ug PSAwDQogICAgICAgICBfX3BjID0gMHgwDQojMyAgMHhmZmZmZmZmZjgwYjk4ZWE3IGluIHZw YW5pYyAoDQogICAgIGZtdD0weGZmZmZmZmZmODEzMWU4NTUgIkFzc2VydGlvbiAlcyBmYWls ZWQgYXQgJXM6JWQiLA0KICAgICBhcD1hcEBlbnRyeT0weGZmZmZmZTAwYzQ3OTdhNTApIGF0 IA0KL3Vzci9zcmMvc3lzL2tlcm4va2Vybl9zaHV0ZG93bi5jOjk3NA0KICAgICAgICAgYnVm ID0gIkFzc2VydGlvbiAqZW9mZmxhZyAhPSAwIGZhaWxlZCBhdCANCi91c3Ivc3JjL3N5cy9r ZXJuL3Zmc192bm9wcy5jOjQwNTgiLCAnXDAwMCcgPHJlcGVhdHMgMTg3IHRpbWVzPg0KICAg ICAgICAgX19wYyA9IDB4MA0KICAgICAgICAgX19wYyA9IDB4MA0KICAgICAgICAgX19wYyA9 IDB4MA0KICAgICAgICAgb3RoZXJfY3B1cyA9IHtfX2JpdHMgPSB7MTMsIDAgPHJlcGVhdHMg MTUgdGltZXM+fX0NCiAgICAgICAgIHRkID0gMHhmZmZmZjgwMDM3NWMxNzgwDQogICAgICAg ICBib290b3B0ID0gPHVuYXZhaWxhYmxlPg0KICAgICAgICAgbmV3cGFuaWMgPSA8b3B0aW1p emVkIG91dD4NCiM0ICAweGZmZmZmZmZmODBiOThjZDMgaW4gcGFuaWMgKGZtdD08dW5hdmFp bGFibGU+KQ0KICAgICBhdCAvdXNyL3NyYy9zeXMva2Vybi9rZXJuX3NodXRkb3duLmM6ODg3 DQogICAgICAgICBhcCA9IHt7Z3Bfb2Zmc2V0ID0gMzIsIGZwX29mZnNldCA9IDQ4LA0KICAg ICAgICAgICAgIG92ZXJmbG93X2FyZ19hcmVhID0gMHhmZmZmZmUwMGM0Nzk3YTgwLA0KICAg ICAgICAgICAgIHJlZ19zYXZlX2FyZWEgPSAweGZmZmZmZTAwYzQ3OTdhMjB9fQ0KIzUgIDB4 ZmZmZmZmZmY4MGNiYWViYyBpbiB2bl9kaXJfbmV4dF9kaXJlbnQgKHZwPTB4ZmZmZmY4MDEw NGQzZGRjMCwNCiAgICAgdGQ9PG9wdGltaXplZCBvdXQ+LCBkaXJidWY9MHhmZmZmZmUwMGM0 NWM5MDAwICJcMDAxIiwNCiAgICAgZGlyYnVmbGVuPTxvcHRpbWl6ZWQgb3V0PiwgZHBwPTB4 ZmZmZmZlMDBjNDc5N2M1OCwgDQpsZW49MHhmZmZmZmUwMGM0Nzk3YzQ4LA0KICAgICBvZmY9 MHhmZmZmZmUwMGM0Nzk3YzQwLCBlb2ZmbGFnPTB4ZmZmZmZlMDBjNDc5N2M2MCkNCiAgICAg YXQgL3Vzci9zcmMvc3lzL2tlcm4vdmZzX3Zub3BzLmM6NDA1OA0KICAgICAgICAgdWlvID0g e3Vpb19pb3YgPSAweGZmZmZmZTAwYzQ3OTdhZTgsIHVpb19pb3ZjbnQgPSAxLCB1aW9fb2Zm c2V0IA0KPSAxMjgsDQogICAgICAgICAgIHVpb19yZXNpZCA9IDM1ODQwLCB1aW9fc2VnZmxn ID0gVUlPX1NZU1NQQUNFLCB1aW9fcncgPSBVSU9fUkVBRCwNCiAgICAgICAgICAgdWlvX3Rk ID0gMHhmZmZmZjgwMDM3NWMxNzgwfQ0KICAgICAgICAgaW92ID0ge2lvdl9iYXNlID0gMHhm ZmZmZmUwMGM0NWM5MDAwLCBpb3ZfbGVuID0gMzU4NDB9DQogICAgICAgICBkcCA9IDB4MA0K ICAgICAgICAgcmVjbGVuID0gPG9wdGltaXplZCBvdXQ+DQogICAgICAgICBlcnJvciA9IDxv cHRpbWl6ZWQgb3V0Pg0KICAgICAgICAgc3VjY2VzcyA9IDxvcHRpbWl6ZWQgb3V0Pg0KIzYg IDB4ZmZmZmZmZmY4MGM4OWJhNSBpbiB2bl9pbm90aWZ5X2FkZF93YXRjaCAodnA9MHhmZmZm ZjgwMTA0ZDNkZGMwLA0KICAgICB2cEBlbnRyeT08ZXJyb3IgcmVhZGluZyB2YXJpYWJsZTog dmFsdWUgaXMgbm90IGF2YWlsYWJsZT4sDQogICAgIHNjPTB4ZmZmZmY4MDAwMzExNTYwMCwN CiAgICAgc2NAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVlIGlzIG5vdCBh dmFpbGFibGU+LCANCm1hc2s9MTY3ODk0NTQsDQogICAgIG1hc2tAZW50cnk9PGVycm9yIHJl YWRpbmcgdmFyaWFibGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAgICB3ZHA9MHhm ZmZmZmUwMGM0Nzk3ZGQ0LA0KICAgICB3ZHBAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFi bGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAgICB0ZD0weGZmZmZmODAwMzc1YzE3 ODAsDQogICAgIHRkQGVudHJ5PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBu b3QgYXZhaWxhYmxlPikNCiAgICAgYXQgL3Vzci9zcmMvc3lzL2tlcm4vdmZzX2lub3RpZnku Yzo3NDcNCiAgICAgICAgIG5kID0ge25pX2RpcnAgPSAweGZmZmZmZTAwYzQ1YzkwNTggImVm aSIsIG5pX3NlZ2ZsZyA9IFVJT19TWVNTUEFDRSwNCiAgICAgICAgICAgbmlfcmlnaHRzbmVl ZGVkID0gMHhmZmZmZmZmZjgxNGYyMDEwIDxjYXBfbm9fcmlnaHRzPiwNCiAgICAgICAgICAg bmlfc3RhcnRkaXIgPSAweDAsIG5pX3Jvb3RkaXIgPSAweGZmZmZmODAwMDkzOGE4OTgsIG5p X3RvcGRpciANCj0gMHgwLA0KICAgICAgICAgICBuaV9kaXJmZCA9IC0xMDAsIG5pX2xjZiA9 IDAsIG5pX2ZpbGVjYXBzID0ge2ZjX3JpZ2h0cyA9IHsNCiAgICAgICAgICAgICAgIGNyX3Jp Z2h0cyA9IHswLCAwfX0sIGZjX2lvY3RscyA9IDB4MCwgZmNfbmlvY3RscyA9IC0xLA0KICAg ICAgICAgICAgIGZjX2ZjbnRscyA9IDB9LCBuaV92cCA9IDB4ZmZmZmY4MDEwNGQzZGMwOCwN CiAgICAgICAgICAgbmlfZHZwID0gMHhmZmZmZjgwMTA0ZDNkZGMwLCBuaV9yZXNmbGFncyA9 IDAsIG5pX2RlYnVnZmxhZ3MgPSA3LA0KICAgICAgICAgICBuaV9sb29wY250ID0gMCwgbmlf cGF0aGxlbiA9IDEsIG5pX25leHQgPSAweGZmZmZmODAwNzRjOGE0MDMgIiIsDQogICAgICAg ICAgIG5pX2NuZCA9IHtjbl9mbGFncyA9IDg5MjU0Nzg5MTIsIGNuX2NyZWQgPSAweGZmZmZm ODAwMDMxMDBhMDAsDQogICAgICAgICAgICAgY25fbmFtZWlvcCA9IExPT0tVUCwgY25fbGtm bGFncyA9IDIwOTcxNTIsDQogICAgICAgICAgICAgY25fcG5idWYgPSAweGZmZmZmODAwNzRj OGE0MDAgImVmaSIsDQogICAgICAgICAgICAgY25fbmFtZXB0ciA9IDB4ZmZmZmY4MDA3NGM4 YTQwMCAiZWZpIiwgY25fbmFtZWxlbiA9IDN9LA0KICAgICAgICAgICBuaV9jYXBfdHJhY2tl ciA9IHt0cWhfZmlyc3QgPSAweDAsIHRxaF9sYXN0ID0gDQoweGZmZmZmZTAwYzQ3OTdjMDh9 LA0KICAgICAgICAgICBuaV9yYmVuZWF0aF9kcHAgPSAweDAsIG5pX25jdHJhY2tfbW50ID0g MHgwLCBuaV9kdnBfc2VxYyA9IDQ5MywNCiAgICAgICAgICAgbmlfdnBfc2VxYyA9IDB9DQog ICAgICAgICBkcCA9IDB4ZmZmZmZlMDBjNDVjOTA0MA0KICAgICAgICAgb2ZmID0gMTI4DQog ICAgICAgICBsZW4gPSAwDQogICAgICAgICBidWZsZW4gPSAzNTg0MA0KICAgICAgICAgYnVm ID0gMHhmZmZmZmUwMGM0NWM5MDAwICJcMDAxIg0KICAgICAgICAgZW9mID0gMA0KICAgICAg ICAgZXJyb3IgPSAwDQogICAgICAgICB3YXRjaCA9IDxvcHRpbWl6ZWQgb3V0Pg0KICAgICAg ICAgd2F0Y2gxID0gPG9wdGltaXplZCBvdXQ+DQogICAgICAgICB3ZCA9IDxvcHRpbWl6ZWQg b3V0Pg0KIzcgIDB4ZmZmZmZmZmY4MTIzMjFjOSBpbiBWT1BfSU5PVElGWV9BRERfV0FUQ0hf QVBWICh2b3A9PG9wdGltaXplZCBvdXQ+LA0KICAgICBhPWFAZW50cnk9MHhmZmZmZmUwMGM0 Nzk3ZGEwKSBhdCB2bm9kZV9pZi5jOjQ0MTANCiAgICAgICAgIHJjID0gPG9wdGltaXplZCBv dXQ+DQojOCAgMHhmZmZmZmZmZjgwYzhhNTBhIGluIFZPUF9JTk9USUZZX0FERF9XQVRDSCAo dnA9MHhmZmZmZjgwMTA0ZDNkZGMwLA0KICAgICB2cEBlbnRyeT08ZXJyb3IgcmVhZGluZyB2 YXJpYWJsZTogdmFsdWUgaXMgbm90IGF2YWlsYWJsZT4sDQogICAgIHNjPTB4ZmZmZmY4MDAw MzExNTYwMCwNCiAgICAgc2NAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVl IGlzIG5vdCBhdmFpbGFibGU+LCANCm1hc2s9MTY3ODk0NTQsDQogICAgIG1hc2tAZW50cnk9 PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAg ICB3ZHA9MHhmZmZmZmUwMGM0Nzk3ZGQ0LCB0ZD0weGZmZmZmODAwMzc1YzE3ODAsDQogICAg IHRkQGVudHJ5PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBub3QgYXZhaWxh YmxlPikNCiAgICAgYXQgLi92bm9kZV9pZi5oOjI1NTINCiAgICAgICAgIGEgPSB7YV9nZW4g PSB7DQogICAgICAgICAgICAgYV9kZXNjID0gMHhmZmZmZmZmZjgxYjg2YWQwIDx2b3BfaW5v dGlmeV9hZGRfd2F0Y2hfZGVzYz59LA0KICAgICAgICAgICBhX3ZwID0gMHhmZmZmZjgwMTA0 ZDNkZGMwLCBhX3NjID0gMHhmZmZmZjgwMDAzMTE1NjAwLA0KICAgICAgICAgICBhX21hc2sg PSAxNjc4OTQ1NCwgYV93ZHAgPSAweGZmZmZmZTAwYzQ3OTdkZDQsDQogICAgICAgICAgIGFf dGQgPSAweGZmZmZmODAwMzc1YzE3ODB9DQojOSAga2Vybl9pbm90aWZ5X2FkZF93YXRjaCAo ZmQ9PHVuYXZhaWxhYmxlPiwNCiAgICAgZmRAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFi bGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAgICBkZmQ9PHVuYXZhaWxhYmxlPiwN CiAgICAgZGZkQGVudHJ5PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBub3Qg YXZhaWxhYmxlPiwNCiAgICAgcGF0aD08dW5hdmFpbGFibGU+LA0KICAgICBwYXRoQGVudHJ5 PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBub3QgYXZhaWxhYmxlPiwNCiAg ICAgbWFzaz0xNjc4OTQ1NCwNCiAgICAgbWFza0BlbnRyeT08ZXJyb3IgcmVhZGluZyB2YXJp YWJsZTogdmFsdWUgaXMgbm90IGF2YWlsYWJsZT4sDQogICAgIHRkPTB4ZmZmZmY4MDAzNzVj MTc4MCwNCiAgICAgdGRAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVlIGlz IG5vdCBhdmFpbGFibGU+KQ0KICAgICBhdCAvdXNyL3NyYy9zeXMva2Vybi92ZnNfaW5vdGlm eS5jOjkzNQ0KICAgICAgICAgbmQgPSB7DQogICAgICAgICAgIG5pX2RpcnAgPSAweGM0NWJm ODAwMDkwIDxlcnJvcjogQ2Fubm90IGFjY2VzcyBtZW1vcnkgYXQgDQphZGRyZXNzIDB4YzQ1 YmY4MDAwOTA+LCBuaV9zZWdmbGcgPSBVSU9fVVNFUlNQQUNFLA0KICAgICAgICAgICBuaV9y aWdodHNuZWVkZWQgPSAweGZmZmZmZmZmODE0ZjIwMTAgPGNhcF9ub19yaWdodHM+LA0KICAg ICAgICAgICBuaV9zdGFydGRpciA9IDB4MCwgbmlfcm9vdGRpciA9IDB4ZmZmZmY4MDAwOTM4 YTg5OCwgbmlfdG9wZGlyIA0KPSAweDAsDQogICAgICAgICAgIG5pX2RpcmZkID0gLTEwMCwg bmlfbGNmID0gMCwgbmlfZmlsZWNhcHMgPSB7ZmNfcmlnaHRzID0gew0KICAgICAgICAgICAg ICAgY3JfcmlnaHRzID0gezAsIDB9fSwgZmNfaW9jdGxzID0gMHgwLCBmY19uaW9jdGxzID0g LTEsDQogICAgICAgICAgICAgZmNfZmNudGxzID0gMH0sIG5pX3ZwID0gMHhmZmZmZjgwMTA0 ZDNkZGMwLA0KICAgICAgICAgICBuaV9kdnAgPSAweGZmZmZmODAwMDMxNzkzNzAsIG5pX3Jl c2ZsYWdzID0gMSwgbmlfZGVidWdmbGFncyA9IDMsDQogICAgICAgICAgIG5pX2xvb3BjbnQg PSAwLCBuaV9wYXRobGVuID0gMSwNCiAgICAgICAgICAgbmlfbmV4dCA9IDB4ZmZmZmY4MDA3 NGM4YTQwOSANCiJcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMz NlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZc MzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1 NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZc MzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMw MFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVc MzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMz NlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBc MjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMz NlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZc MzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1 NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZc MzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMw MFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVc MzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2Iiwg DQo8aW5jb21wbGV0ZSBzZXF1ZW5jZSBcMzM2Pi4uLiwNCiAgICAgICAgICAgbmlfY25kID0g e2NuX2ZsYWdzID0gODkyNTc0MTM4MCwgY25fY3JlZCA9IDB4ZmZmZmY4MDAwMzEwMGEwMCwN CiAgICAgICAgICAgICBjbl9uYW1laW9wID0gTE9PS1VQLCBjbl9sa2ZsYWdzID0gMjA5NzE1 MiwgY25fcG5idWYgPSAweDAsDQogICAgICAgICAgICAgY25fbmFtZXB0ciA9IDB4ZmZmZmY4 MDA3NGM4YTQwNiANCiJcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2 XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwz MDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1 XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwz MzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAw XDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwz MzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2 XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwy NTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2 XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwz MDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1 XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwz MzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAw XDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwz MzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2 XDMwMCIuLi4sIA0KY25fbmFtZWxlbiA9IDN9LA0KICAgICAgICAgICBuaV9jYXBfdHJhY2tl ciA9IHt0cWhfZmlyc3QgPSAweDAsIHRxaF9sYXN0ID0gDQoweGZmZmZmZTAwYzQ3OTdkNzB9 LA0KICAgICAgICAgICBuaV9yYmVuZWF0aF9kcHAgPSAweDAsIG5pX25jdHJhY2tfbW50ID0g MHgwLCBuaV9kdnBfc2VxYyA9IDAsDQogICAgICAgICAgIG5pX3ZwX3NlcWMgPSAwfQ0KICAg ICAgICAgd2QgPSAyDQogICAgICAgICBmcCA9IDB4ZmZmZmY4MDAzNzU3ZDIzMA0KICAgICAg ICAgdnAgPSAweGZmZmZmODAxMDRkM2RkYzANCiAgICAgICAgIGVycm9yID0gPG9wdGltaXpl ZCBvdXQ+DQogICAgICAgICBzYyA9IDB4ZmZmZmY4MDAwMzExNTYwMA0KICAgICAgICAgY291 bnQgPSA8b3B0aW1pemVkIG91dD4NCiMxMCAweGZmZmZmZmZmODExNjk5OGUgaW4gc3lzY2Fs bGVudGVyICh0ZD0weGZmZmZmODAwMzc1YzE3ODApDQogICAgIGF0IC91c3Ivc3JjL3N5cy9h bWQ2NC9hbWQ2NC8uLi8uLi9rZXJuL3N1YnJfc3lzY2FsbC5jOjE5Mw0KICAgICAgICAgc2Ug PSAweGZmZmZmZmZmODFhYzgzZjAgPHN5c2VudCsxODk3Nj4NCiAgICAgICAgIHAgPSAweGZm ZmZmZTAwODMxNTE1YzANCiAgICAgICAgIHNhID0gMHhmZmZmZjgwMDM3NWMxYjk4DQogICAg ICAgICBlcnJvciA9IDxvcHRpbWl6ZWQgb3V0Pg0KICAgICAgICAgc3lfdGhyX3N0YXRpYyA9 IHRydWUNCiAgICAgICAgIHRyYWNlZCA9IDxvcHRpbWl6ZWQgb3V0Pg0KICAgICAgICAgX2F1 ZGl0X2VudGVyZWQgPSA8b3B0aW1pemVkIG91dD4NCiMxMSBhbWQ2NF9zeXNjYWxsICh0ZD0w eGZmZmZmODAwMzc1YzE3ODAsIHRyYWNlZD0wKQ0KICAgICBhdCAvdXNyL3NyYy9zeXMvYW1k NjQvYW1kNjQvdHJhcC5jOjEyMTUNCiAgICAgICAgIGtzaSA9IHtrc2lfbGluayA9IHt0cWVf bmV4dCA9IDB4ZmZmZmY4MDAzNzVjMTc4MCwNCiAgICAgICAgICAgICB0cWVfcHJldiA9IDB4 ZmZmZmZmZmY4MzE2ZDQwMH0sIGtzaV9pbmZvID0gew0KICAgICAgICAgICAgIHNpX3NpZ25v ID0gLTIxMjc5Njc3MTUsIHNpX2Vycm5vID0gLTEsIHNpX2NvZGUgPSA5Mjg3ODIyMDgsDQog ICAgICAgICAgICAgc2lfcGlkID0gLTIwNDgsIHNpX3VpZCA9IDIxOTkzMTEzNjAsIHNpX3N0 YXR1cyA9IC0xLA0KICAgICAgICAgICAgIHNpX2FkZHIgPSAweGZmZmZmZmZmMDAwMDAwMDAs IHNpX3ZhbHVlID0ge3NpdmFsX2ludCA9IDAsDQogICAgICAgICAgICAgICBzaXZhbF9wdHIg PSAweDYwMTAwMDAwMDAwLCBzaWd2YWxfaW50ID0gMCwNCiAgICAgICAgICAgICAgIHNpZ3Zh bF9wdHIgPSAweDYwMTAwMDAwMDAwfSwgX3JlYXNvbiA9IHtfZmF1bHQgPSB7DQogICAgICAg ICAgICAgICAgIF90cmFwbm8gPSAxNTM3fSwgX3RpbWVyID0ge190aW1lcmlkID0gMTUzNywg X292ZXJydW4gPSAwfSwNCiAgICAgICAgICAgICAgIF9tZXNncSA9IHtfbXFkID0gMTUzN30s IF9wb2xsID0ge19iYW5kID0gMTUzN30sIF9jYXBzaWN1bSA9IHsNCiAgICAgICAgICAgICAg ICAgX3N5c2NhbGwgPSAxNTM3fSwgX19zcGFyZV9fID0ge19fc3BhcmUxX18gPSAxNTM3LA0K ICAgICAgICAgICAgICAgICBfX3NwYXJlMl9fID0gezAsIDAsIC0xMDgyMTI0NzY4LCAzMTQx LCA5Mjg3ODIyMDgsIC0yMDQ4LA0KICAgICAgICAgICAgICAgICAgIDF9fX19LCBrc2lfZmxh Z3MgPSAtOTk4NjcwNzA0LCBrc2lfc2lncSA9IDB4NDZ9DQojMTIgPHNpZ25hbCBoYW5kbGVy IGNhbGxlZD4NCk5vIGxvY2Fscy4NCiMxMyAweDAwMDAwMDA4MmM0ZDI5YWEgaW4gPz8gKCkN Ck5vIHN5bWJvbCB0YWJsZSBpbmZvIGF2YWlsYWJsZS4NCkJhY2t0cmFjZSBzdG9wcGVkOiBD YW5ub3QgYWNjZXNzIG1lbW9yeSBhdCBhZGRyZXNzIDB4ODMxNzQ2ODE4DQooa2dkYikgL3Vz ci9saWJleGVjL2tnZGIvYWN0dHJhY2UucHk6ODogRXJyb3IgaW4gc291cmNlZCBjb21tYW5k IGZpbGU6DQpVbmRlZmluZWQgY29tbWFuZDogImltcG9ydCIuICBUcnkgImhlbHAiLg0KKGtn ZGIpIFVuZGVmaW5lZCBjb21tYW5kOiAiYWN0dHJhY2UiLiAgVHJ5ICJoZWxwIi4NCihrZ2Ri KQ0KDQpUaGVyZSBpcyBhbHNvIGEgZmxvb2Qgb2YgImZzdGF0OiB6bm9kZV90IHNpemUgbWlz bWF0Y2gsIGRhdGEgY291bGQgYmUgDQp3cm9uZyIgaW4gdGhhdCBwb3J0aW9uIG9mIHRoZSBk dW1wLg0KDQotLSANCkNoYXJsaWUgTGkNCi4uLm5vcGUsIHN0aWxsIGRvbid0IGhhdmUgYW4g ZXhpdCBsaW5lLg0KDQo= --------------xUtkXr0K6mUW7RFH7YGv5QTA-- --------------CWWw7Mfv2fBZ9PfjZZk0Yuj6 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaHOuJAUDAAAAAAAKCRDP+1cn7slqBDGe AQCoVNYrnd7SOAVWSfWkIZhZrNk6qGKRCcOJ87K4CDOtigD/SlxPfxiv8Y4tMfb1XdstnbM2f4OR +WNdZUseQfKkfgk= =wzSH -----END PGP SIGNATURE----- --------------CWWw7Mfv2fBZ9PfjZZk0Yuj6-- From nobody Sun Jul 13 13:11:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg5SX2bKLz60xPq; Sun, 13 Jul 2025 13:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg5SW6sJjz3NJc; Sun, 13 Jul 2025 13:11:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F6b+aD/rVL5gPek3FevQdstL/h2zqSbNQ8y98RXH+Lw=; b=Kz7gs72mEAFxlAEHaR3YwPxA6PC/Mf9VGw6a1vTzXW0KiX1dyjKES40Qf/huQd+PFdNw9N bHiT6xyabzRwR518crJ1AK3UVmZ8wILW7cTk4ZFWsfeEB7lMikfK0riR/Rwf8Uf+tK15Ot RnRUMgLypzWw3PJ/MX/UMu2Ihba1H/jNcJ6PLTY3iz5FONtw3hZpHoWsr2/t+gXOE8TfqN cyKsMoR94EmOgCd/L+xYs1oUR77577wsj33K/D20WIeriuOyWj13HOZrMXqM68qsrS4hYq IWi3rXU585lHTWnah3smDHkcqUttjFBwYs2m5pIfh4Z/rg7e6CKcYXo6eBVEUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F6b+aD/rVL5gPek3FevQdstL/h2zqSbNQ8y98RXH+Lw=; b=fjvpEo8gZ4wtr7qqugxQenWuMPbex+uRshG2vxW/h3zw+ygtDm44iTfdeIh2rcgl9VUIEG tRnPIWfq5b19GuaT9Y9YNLhtGo+GOyKE91cW6fGOEFe4l7+KgpoCfY/1vXPh0UAQYjiKCx fOT9cW/nS/AAd0zkcZbEBn9Rgs75v7PNyXWCG5GaWLvJtJyyjDgySV7/9a5D/HHV7WseXQ WjKos+pYoxaV9EICm+xDFFyDc2hx5Asxg/RcrQodT0OLE6/JamosQTal9mxTAfJmKiV8KS i/Qo3DIcoG1fD3fLGjF2Lp/BbH+u2QIOzD2senB2/Nzn4fOKbjfqTvkENpaSYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752412300; a=rsa-sha256; cv=none; b=wwMeRjUBmPcFN4viqYGi2+58mOK0rONla6D9zNyqZ3rzshiV6roeh6cPHu5VC/iPijM3oD fo64MnXrO8CoXGiT0qLC8D53jSEK6/wNBQP6iRc7BHWuJFn7FuWiZoY3v+NTdPF6ViLzCn lDMyf+NwaAFm5rNdvaTlWs+JtPy/o8gAICoAxAAijZ1i2yTHTN/qJ7aHZIWQLLuR0WQGMh IZG4kLaShX8Lr1EwDFh/YoTKuL8wYXjC8NNxqwPABsY0ZUrg/oJK9zfeJyCCbksqvy4DaV qDzE3VqBA+o0PLiR3Y3FOyRp6tEeV5t0mhwH9CojJ3xr66uJTyO7oZm3xrCuXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg5SW57N1z18bf; Sun, 13 Jul 2025 13:11: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 56DDBdY8056447; Sun, 13 Jul 2025 13:11:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DDBdFX056444; Sun, 13 Jul 2025 13:11:39 GMT (envelope-from git) Date: Sun, 13 Jul 2025 13:11:39 GMT Message-Id: <202507131311.56DDBdFX056444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: c46bf1e3c9c5 - main - pf tests: Add jail configuration for route_to and ipv6-nexthop tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c46bf1e3c9c5bb652f9c23117008f920bfb37b94 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=c46bf1e3c9c5bb652f9c23117008f920bfb37b94 commit c46bf1e3c9c5bb652f9c23117008f920bfb37b94 Author: Kajetan Staszkiewicz AuthorDate: 2025-06-09 15:26:57 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 13:11:18 +0000 pf tests: Add jail configuration for route_to and ipv6-nexthop tests Maybe it could later replace previous IPv4 and IPv6 jail configurations. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50764 --- tests/sys/netpfil/pf/utils.subr | 101 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 6af10e80390d..3f8d437920f9 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -274,6 +274,107 @@ setup_router_server_ipv6() jexec server inetd -p ${PWD}/inetd.pid $inetd_conf } +# Create a router and 2 server jails for nat64 and rfc5549 test cases. +# The router is connected to servers, both are dual-stack, and to the +# tester jail. All links are dual stack. +setup_router_server_nat64() +{ + pft_init + + epair_tester=$(vnet_mkepair) + epair_server1=$(vnet_mkepair) + epair_server2=$(vnet_mkepair) + + # Funny how IPv4 address space is to small to even assign nice /24 + # prefixes on all needed networks. On IPv6 we have a separate /64 for + # each link, loopback server, and client/SNAT pool. On IPv4 we must + # use small /28 prefixes, so even though we define all networks + # as variables we can't easily use them in tests if additional addresses + # are needed. + + # IP addresses which can be used by the tester jail. + # Can be used as SNAT or as source with pft_ping.py. It is up to + # the test code to make them accessible from router. + net_clients_4=203.0.113 + net_clients_4_mask=24 + net_clients_6=2001:db8:44 + net_clients_6_mask=64 + + # IP addresses on loopback interfaces of both servers. They can be + # accessed using the route-to targtet. + host_server_4=192.0.2.100 + host_server_6=2001:db8:4203::100 + + net_tester_4=198.51.100 + net_tester_4_mask=28 + net_tester_4_host_router=198.51.100.1 + net_tester_4_host_tester=198.51.100.2 + + net_tester_6=2001:db8:4200 + net_tester_6_mask=64 + net_tester_6_host_router=2001:db8:4200::1 + net_tester_6_host_tester=2001:db8:4200::2 + + net_server1_4=198.51.100 + net_server1_4_mask=28 + net_server1_4_host_router=198.51.100.17 + net_server1_4_host_server=198.51.100.18 + + net_server1_6=2001:db8:4201 + net_server1_6_mask=64 + net_server1_6_host_router=2001:db8:4201::1 + net_server1_6_host_server=2001:db8:4201::2 + + net_server2_4=198.51.100 + net_server2_4_mask=28 + net_server2_4_host_router=198.51.100.33 + net_server2_4_host_server=198.51.100.34 + + net_server2_6=2001:db8:4202 + net_server2_6_mask=64 + net_server2_6_host_router=2001:db8:4202::1 + net_server2_6_host_server=2001:db8:4202::2 + + vnet_mkjail router ${epair_tester}b ${epair_server1}a ${epair_server2}a + jexec router ifconfig ${epair_tester}b inet ${net_tester_4_host_router}/${net_tester_4_mask} up + jexec router ifconfig ${epair_tester}b inet6 ${net_tester_6_host_router}/${net_tester_6_mask} up no_dad + jexec router ifconfig ${epair_server1}a inet ${net_server1_4_host_router}/${net_server1_4_mask} up + jexec router ifconfig ${epair_server1}a inet6 ${net_server1_6_host_router}/${net_server1_6_mask} up no_dad + jexec router ifconfig ${epair_server2}a inet ${net_server2_4_host_router}/${net_server2_4_mask} up + jexec router ifconfig ${epair_server2}a inet6 ${net_server2_6_host_router}/${net_server2_6_mask} up no_dad + jexec router sysctl net.inet.ip.forwarding=1 + jexec router sysctl net.inet6.ip6.forwarding=1 + jexec router pfctl -e + + ifconfig ${epair_tester}a inet ${net_tester_4_host_tester}/${net_tester_4_mask} up + ifconfig ${epair_tester}a inet6 ${net_tester_6_host_tester}/${net_tester_6_mask} up no_dad + route add 0.0.0.0/0 ${net_tester_4_host_router} + route add -6 ::/0 ${net_tester_6_host_router} + + inetd_conf=$(mktemp) + echo "discard stream tcp46 nowait root internal" >> $inetd_conf + + vnet_mkjail server1 ${epair_server1}b + jexec server1 /etc/rc.d/netif start lo0 + jexec server1 ifconfig ${epair_server1}b inet ${net_server1_4_host_server}/${net_server1_4_mask} up + jexec server1 ifconfig ${epair_server1}b inet6 ${net_server1_6_host_server}/${net_server1_6_mask} up no_dad + jexec server1 ifconfig lo0 ${host_server_4}/32 alias + jexec server1 ifconfig lo0 inet6 ${host_server_6}/128 alias + jexec server1 inetd -p ${PWD}/inetd_1.pid $inetd_conf + jexec server1 route add 0.0.0.0/0 ${net_server1_4_host_router} + + jexec server1 route add -6 ::/0 ${net_server1_6_host_router} + vnet_mkjail server2 ${epair_server2}b + jexec server2 /etc/rc.d/netif start lo0 + jexec server2 ifconfig ${epair_server2}b inet ${net_server2_4_host_server}/${net_server2_4_mask} up + jexec server2 ifconfig ${epair_server2}b inet6 ${net_server2_6_host_server}/${net_server2_6_mask} up no_dad + jexec server2 ifconfig lo0 ${host_server_4}/32 alias + jexec server2 ifconfig lo0 inet6 ${host_server_6}/128 alias + jexec server2 inetd -p ${PWD}/inetd_2.pid $inetd_conf + jexec server2 route add 0.0.0.0/0 ${net_server2_4_host_router} + jexec server2 route add -6 ::/0 ${net_server2_6_host_router} +} + # Ping the dummy static NDP target. # Check for pings being forwarded through the router towards the target. ping_dummy_check_request() From nobody Sun Jul 13 13:11:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg5SY6s5vz60xV2; Sun, 13 Jul 2025 13:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg5SX6D7xz3N0g; Sun, 13 Jul 2025 13:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyVjDyCAgBZrcJYrva5yP16/ICYNO56XKxcNiQ7tlzw=; b=cPFFv6QXXzcSxQkShxckFJu2eXiGM1akanr66+KMZYN1PNhHgu5KVQMD/q3nACFm8rl3nA TyUz/4sCOMCZyuaipnEuCis/w/EAN5oWS1Lz02OiWerxlLie+YMJLLdjJRNoUmXx5dkjFF UOiyHq14YpXbDABVYFDp5YEAL8ids4q7GVW+HNr+McPtRAoZIKeTCBbOogf40nC3ZGEFgH C4sRy1fEWg0rQUwwQ08/BGmF2WRvLL5RhHr2tholAibsVLudFqkE8moqwi77c3eAg7SiM9 cQVlK3Onqmte1wp2K6FwujCFBawJeAL8Z46jKUc0tAsjhboTIDYMa+qygnFo6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyVjDyCAgBZrcJYrva5yP16/ICYNO56XKxcNiQ7tlzw=; b=Ss05zfCJQIn/qbIJAqLhhGTbmpmX1AiAYOaBhuqWTXc7x3rOsQGVWEpNaR9ISlA/PGiR4R B0pYfUq1UYK9+VZ8REeD9Ec0yVqwFndg2ocCbVZSMt5pbJyqG9zrmdfjzqhzUj9BDNZDVJ lyRjFZJ5PBPmpuJQkIFr/6Py6qbTIejk8SPMdIzoV/bdHmNqy9wBj52CHHsSm+ErDqEqTH yMzo9fRvL53bMDkADJlQxvKM2V0V1jA6vI9ox9vXYJU2YMVI8qCu9NGSwZDoiVrCT8a90K 1wF0r28sCDeSkehT18OUpCbW60HG7gPyFSs3RFGL4jXOjtKCzDhh0M+VsaRkRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752412300; a=rsa-sha256; cv=none; b=uapmT2lAi2ksn61UJ3xrSdiCoFWGn0P2J7Y0wl4ZfR/ajoniZAUpjRm83i6wT1GxnOa14K WdkYPYe7uVpy5TlWakr955cbt2HAuzsc6Qbacm59nQhqSLN6cNYOILBafVs9x4CYXfIWyU AdZuV2kgMz79k9BXIWpSwsTlviXe49r48hT7HyXOBn8zsgeLswkjPMVymQMY983DuQCol3 pKGBqvQtKFIJvvBZ+omwV3Xm7eHWzbYCysioPK82D8PuoZB3goE3sgkRIHKpOtMyQ/TM7i rlub4GtUgQBoRvZZkES2ADjNeyOOVgX6J77cthXG4FHHWsSsnDtgrrbE9d5SZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg5SX5plHz18TJ; Sun, 13 Jul 2025 13:11: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 56DDBe9k056481; Sun, 13 Jul 2025 13:11:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DDBeOq056478; Sun, 13 Jul 2025 13:11:40 GMT (envelope-from git) Date: Sun, 13 Jul 2025 13:11:40 GMT Message-Id: <202507131311.56DDBeOq056478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 04dcbb44340f - main - pf: Prevent infinite looping over tables in round-robin pools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04dcbb44340f3e42b130282112e9f741fccffc9f Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=04dcbb44340f3e42b130282112e9f741fccffc9f commit 04dcbb44340f3e42b130282112e9f741fccffc9f Author: Kajetan Staszkiewicz AuthorDate: 2025-06-10 14:22:43 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 13:11:21 +0000 pf: Prevent infinite looping over tables in round-robin pools In FreeBSD each redirection pool (struct pf_kpool) consists of multiple hosts (struct pf_addr_wrap). In OpenBSD that is not the case, and a round-robin pool having a table as a host loops infinitely only over that single table. In FreeBSD once all addresses from a table are returned the pool must iterate to the next host. Add a custom flag to have pfr_pool_get() break its loop once it reaches the last index. Use this flag in round-robin pools. When changing pool's host set index to 0 to always start iterating each table from beginning. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50779 --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf_lb.c | 16 ++++---- sys/netpfil/pf/pf_table.c | 4 +- tests/sys/netpfil/pf/route_to.sh | 82 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 10 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 8ee4d00daaff..1f2011634695 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2500,7 +2500,7 @@ int pfr_match_addr(struct pfr_ktable *, struct pf_addr *, sa_family_t); void pfr_update_stats(struct pfr_ktable *, struct pf_addr *, sa_family_t, u_int64_t, int, int, int); int pfr_pool_get(struct pfr_ktable *, int *, struct pf_addr *, sa_family_t, - pf_addr_filter_func_t); + pf_addr_filter_func_t, bool); void pfr_dynaddr_update(struct pfr_ktable *, struct pfi_dynaddr *); struct pfr_ktable * pfr_attach_table(struct pf_kruleset *, char *); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 9db1d88ce52e..26f7ab41eef4 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -617,7 +617,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, - af, pf_islinklocal)) { + af, pf_islinklocal, false)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -684,7 +684,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, - af, pf_islinklocal)) { + af, pf_islinklocal, false)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -701,11 +701,12 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (!pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) + &rpool->tblidx, &rpool->counter, af, NULL, true)) goto get_addr; } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { if (!pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, pf_islinklocal)) + &rpool->tblidx, &rpool->counter, af, pf_islinklocal, + true)) goto get_addr; } else if (pf_match_addr(0, raddr, rmask, &rpool->counter, af)) goto get_addr; @@ -715,9 +716,10 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->cur = TAILQ_FIRST(&rpool->list); else rpool->cur = TAILQ_NEXT(rpool->cur, entries); + rpool->tblidx = -1; if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) { + &rpool->tblidx, &rpool->counter, af, NULL, true)) { /* table contains no address of type 'af' */ if (rpool->cur != acur) goto try_next; @@ -725,9 +727,9 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, goto done_pool_mtx; } } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - rpool->tblidx = -1; if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, pf_islinklocal)) { + &rpool->tblidx, &rpool->counter, af, pf_islinklocal, + true)) { /* table contains no address of type 'af' */ if (rpool->cur != acur) goto try_next; diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 2034f4422ef1..e3f3ab9025f7 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2294,7 +2294,7 @@ pfr_detach_table(struct pfr_ktable *kt) int pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, - sa_family_t af, pf_addr_filter_func_t filter) + sa_family_t af, pf_addr_filter_func_t filter, bool loop_once) { struct pf_addr *addr, cur, mask, umask_addr; union sockaddr_union uaddr, umask; @@ -2339,7 +2339,7 @@ _next_block: ke = pfr_kentry_byidx(kt, idx, af); if (ke == NULL) { /* we don't have this idx, try looping */ - if (loop || (ke = pfr_kentry_byidx(kt, 0, af)) == NULL) { + if ((loop || loop_once) || (ke = pfr_kentry_byidx(kt, 0, af)) == NULL) { pfr_kstate_counter_add(&kt->pfrkt_nomatch, 1); return (1); } diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 91c12c8ce2ae..fd1653cce311 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -893,6 +893,87 @@ empty_pool_cleanup() } +atf_test_case "table_loop" "cleanup" + +table_loop_head() +{ + atf_set descr 'Check that iterating over tables poperly loops' + atf_set require.user root +} + +table_loop_body() +{ + setup_router_server_nat64 + + # Clients will connect from another network behind the router. + # This allows for using multiple source addresses. + jexec router route add -6 ${net_clients_6}::/${net_clients_6_mask} ${net_tester_6_host_tester} + jexec router route add ${net_clients_4}.0/${net_clients_4_mask} ${net_tester_4_host_tester} + + # The servers are reachable over additional IP addresses for + # testing of tables and subnets. The addresses are noncontinougnus + # for pf_map_addr() counter tests. + for i in 0 1 4 5; do + a1=$((24 + i)) + jexec server1 ifconfig ${epair_server1}b inet ${net_server1_4}.${a1}/32 alias + jexec server1 ifconfig ${epair_server1}b inet6 ${net_server1_6}::42:${i}/128 alias + a2=$((40 + i)) + jexec server2 ifconfig ${epair_server2}b inet ${net_server2_4}.${a2}/32 alias + jexec server2 ifconfig ${epair_server2}b inet6 ${net_server2_6}::42:${i}/128 alias + done + + jexec router pfctl -e + pft_set_rules router \ + "set debug loud" \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "table { ${net_server1_6}::42:4/127 ${net_server1_6}::42:0/127 }" \ + "table { ${net_server2_6}::42:4/127 }" \ + "pass in on ${epair_tester}b \ + route-to { \ + (${epair_server1}a ) \ + (${epair_server2}a ) \ + (${epair_server2}a ) \ + } \ + inet6 proto tcp \ + keep state" + + # Both hosts of the pool are tables. Each table gets iterated over once, + # then the pool iterates to the next host, which is also iterated, + # then the pool loops back to the 1st host. If an empty table is found, + # it is skipped. Unless that's the only table, that is tested by + # the "empty_pool" test. + for port in $(seq 1 7); do + port=$((4200 + port)) + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_tester}a --replyif ${epair_tester}a \ + --fromaddr ${net_clients_6}::1 --to ${host_server_6} \ + --ping-type=tcp3way --send-sport=${port} + done + + states=$(mktemp) || exit 1 + jexec router pfctl -qvvss | normalize_pfctl_s > $states + cat $states + + for state_regexp in \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4201\] .* route-to: ${net_server1_6}::42:0@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4202\] .* route-to: ${net_server1_6}::42:1@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4203\] .* route-to: ${net_server1_6}::42:4@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4204\] .* route-to: ${net_server1_6}::42:5@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4205\] .* route-to: ${net_server2_6}::42:4@${epair_server2}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4206\] .* route-to: ${net_server2_6}::42:5@${epair_server2}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4207\] .* route-to: ${net_server1_6}::42:0@${epair_server1}a" \ + ; do + grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" + done +} + +table_loop_cleanup() +{ + pft_cleanup +} + + atf_init_test_cases() { atf_add_test_case "v4" @@ -912,4 +993,5 @@ atf_init_test_cases() atf_add_test_case "sticky" atf_add_test_case "ttl" atf_add_test_case "empty_pool" + atf_add_test_case "table_loop" } From nobody Sun Jul 13 13:46:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg6FQ6VkRz610SG; Sun, 13 Jul 2025 13:47:06 +0000 (UTC) (envelope-from olce@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg6FQ3vBQz3kHg; Sun, 13 Jul 2025 13:47:06 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752414426; 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: in-reply-to:in-reply-to:references:references; bh=VEKagoPUawdf52LP6cnqf+sfAWhNeZLYjtGK/f7CTyQ=; b=SMNdjMvEa7DSAinw09M0ApnT/A8WsBAHMvrdNOSe+5zriyjmz0Cz5tDfNGs21tV+fCYmqD 6G0pL7HdEcXgSk/MP6XbgssvbculXWayhlb62JEtwtlvamDIHKTb7qo/NrOeI8uKluwzwe jeZjxE3q3YP0KPSAPIfUU1KpTdonWIhDaOz832B6LinWtMfm05N9LtepYIh6giZSMtg2pV glesahPl2iNaq8hvZ9PQGp1j4Ak2bA7UG8O/jLfn0ZsAiEBSN0ERnawYmU0EhP4YH+8Rva TV4rXLvzQ7bMVs57jcU2vISHwoQjls5iGAujkQ64l2m3o0/+C2nUoFFeZtA8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752414426; 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: in-reply-to:in-reply-to:references:references; bh=VEKagoPUawdf52LP6cnqf+sfAWhNeZLYjtGK/f7CTyQ=; b=J4Nede/FoM8wV4qGg8fc3IHUOOg1E/xd7x5IYNW1zr4LWQPjF1kcoRLNt+vC6aQ5AHHIm7 GycSI8Y4GehX1GiT6rsfZOBl/ma+DIVexnJSMrNTwp5h8AiqZjQppZmKeQxAaq4Rd1YvdO p3POBnyuCdlHROViI68ib1xJY8KuCmsIQte6gJoGx+WfJ34DBVsGTirTC7cLfy24sb7RBM 7gkjUex7HoYmtfa85qzpzhYBD3+Czxn44NKc6bCZzuy1cZ/QuOg7CObS2KdE/NINXdHLsa /H3Y+oGzJ1+sICSAfmlIyAARz247Z2saYUiCWZ43SNL7GX2MsXZy27k8o8clew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752414426; a=rsa-sha256; cv=none; b=qnRdOLpRNqBCOQxwQIKXumPqh9BNFcDHhqcuu0rONRoOzCm7GGvGBIR97ekuzw8mcN6330 gzuarqoKjMs0KoCrh67X6X9BN2DP+J7TuuhbqLwFgiwkDEbGG2GX2HPE4OwJb0L2u6C0PE W5fREYYZlQoFENh2FO60cGKM6aOWeTsfR4UbWwEJczc52j9DbUsBSMmsEz89hGw0pWZqsK PAdA2Qk1ZF7iLOog1NivkWXKy1uJwhdAuQ2Xtyfi0QelOo9BhI7Gs/SK42tbxFq0eh8psB LpzX/zrvz600bxxOT3VbEaDdM6/vaD3s0RxGiSGEmbWwcUoyeRape4EZI/LNQw== Received: from francois.localnet (h175-177-044-048.catv02.itscom.jp [175.177.44.48]) (using TLSv1.3 with cipher TLS_AES_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: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg6FN6jhrz8Wb; Sun, 13 Jul 2025 13:47:04 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Charlie Li Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Date: Sun, 13 Jul 2025 22:46:57 +0900 Message-ID: <2937929.UcPf6a0QyJ@francois> Organization: FreeBSD In-Reply-To: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5090732.Cjmsv3J8Qz"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart5090732.Cjmsv3J8Qz Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Olivier Certner To: Charlie Li Date: Sun, 13 Jul 2025 22:46:57 +0900 Message-ID: <2937929.UcPf6a0QyJ@francois> Organization: FreeBSD In-Reply-To: MIME-Version: 1.0 Hi Charlie, The panic you're seeing is caused by 'MPASS(*eofflag != 0);' in vn_dir_next_dirent(). This test is here to check that VOP_READDIR() works properly. In particular, if VOP_READDIR() returned 0 (no error), and the length it filled is 0 (nothing was added), then we must be at EOF, and VOP_READDIR() must have set '*eofflag' to something non-zero. UFS has been verified to abide by this rule (unless the directory being read is malformed). Which filesystem are you using? Shot in the dark & educated guess: You're using ZFS, and you've just stumbled on the following case (lines from 'zfs_vnops_os.c'): /* * Quit if directory has been removed (posix) */ if ((*eofp = zp->z_unlinked) != 0) { zfs_exit(zfsvfs, FTAG); return (0); } which is a corner case that apparently has been missed. Just add some 'if (eofflag != NULL) *eofflag = 1;' inside the "then" block there and retry. It looks like all other cases in this function are handled correctly (but I have not thoroughly verified). I'll be mostly AFK for the next 10 days, so probably won't be able to follow-up, but hope that will help. Thanks and regards. -- Olivier Certner --nextPart5090732.Cjmsv3J8Qz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmhzuNEACgkQjKEwQJce Jicmvw/9ESjkkrFQMefCpoBllHcvrouHPUVDbqBtUvTnCfxoB7vfJyR7EC2iyAKR EbUAZaEGRl7EH37/4859qIFh9NIkTJ6if/KV4rvHkbi7V0h0EHA1oEWA7mjNzAyt aaXodxKb8/t2+hL7zJg+9wi6ELmmJbNZPROgGN5XOCiGhO7Inb/gCruLniJ0pqZq 9/HfXp/u66pk1We3s2J/9fSjGBDn15+OWk667862HoShU18rqNaE3dAg9GMZ/2Ab Gap/EsPN2mA6Xv/sdB3TosNtXrWCS9dk2W7LHxTPLSOlEucGp06ICNDoQ3Gj/V1i ha6PvPEmlxaXBvmH2W9KYOVlF3M90WaallX01oLO5PwRK/bURnmYxoZzNQQeFME6 AbqRXVZlRD7fBw0CyFRMUPWFva4O3pxuTwVjjnrT3y6cxGQ/Bg451kD2d92W0L1t 8wTLKAYRP0RsD+THTpjVtfe00TzIgjYFXnMUuAvU8iihlDaACbIRMaObtVq5LJKj tGCdQ7+qqrUeCIKMCrx+eeRPxmMeZ0bLIaR+SIzQ3TahBdgbEgkJs62vStymXVtz ZlyaZ5CzbzXfqhqEzeSKZ2vALeC02ct4kDw47pFWrPXvKpdFM1Pf5Y4Fq3fDPVEd kU4h1ShThWU4gwrC6VNzbQEj+xY23/vxcSHnHvHYfofaOI7y57g= =g38I -----END PGP SIGNATURE----- --nextPart5090732.Cjmsv3J8Qz-- From nobody Sun Jul 13 14:24:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg74B3c6Kz612NQ; Sun, 13 Jul 2025 14:24:10 +0000 (UTC) (envelope-from vishwin@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg74B2HK2z488k; Sun, 13 Jul 2025 14:24:10 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752416650; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=gUR+T73JzmHDb/uu++NDYZBOtrpEjgD/fFFROrw77JA=; b=I6dRP3nU0YC3kPBAzStgtDuC99k/5CfFSwGpxALHeawNgZOt5X+gHFgMIOtiX23BkQEopt /O8gMjL624GySIqbrl8LqtNpAvl4ub08c8cj8cHAJc0gUW0NG33rH2/Og2Yx0E/aMzhvvx /DwgmRv7J9IjxANH6C7fRIzQqxmQmyaHn5sQCjY7cG+5hdFLNcl5misJTxE5dCg4IU4FsU ILfFXbpc4tURBpCG95UlOvo+nqOI7paZy9Eb5EBKT7iqd5YPKbGgRFXeF1gpC+ZvcoPyO3 n04dKuFC+xcmaKXrpt2GrufL60KVsZFRIqHW7fwhgG7FhQKMucOO8ns4iF1NbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752416650; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=gUR+T73JzmHDb/uu++NDYZBOtrpEjgD/fFFROrw77JA=; b=HFt+WFVQGLI+OEK8VwqhCltXYlwNSO/xrt2zh8bdms9tSeL4i6rVa1JM35KTlTswmvcMpa RCdqt/cfYDmR0tYcwGsKpEUqGPtCyJqqQDYSsJARYl/DMajkFPyCV8qZFafDNJrGro/kyy TEyx9VywIIyRTX3ccZVQnDdxAT5AFD6o7kCs4MBfA9Ft8OPXYOW0hp3OZNCz93T9Cyhc2s MtC8xFqGmk4axicKEBNrNpjZt1tmR8PS/ARU8joIQhxUiiwJxDH+q7ogWZgoZgMYx9Z8iV DJrM9FXjsQ8L080uhJRdMU/suXithpRnlELl5LLd3UVetTq7O59bDcGU6hM7Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752416650; a=rsa-sha256; cv=none; b=JviFni2A9xqG12F6pKFM1oY+JorepW5ZZangDxnBw9Y6gsbzFm7yUjNEBk7yD5O8nd1N8T T7MLWBIDzZszoOBoURQgb4SZvYcgjcIencZ0BS6fMhziR5scY0wmcNPErM87rK8dPFcbXX u2u2nj6CHb4qjqrD757Qd0L8bgBOo2q/rPnEMtHTN0T89EpQCsVEzam1ypWwbLwy0vXtoc p8r2G6cdHmrj6AUNOZvtVvPmb1ubhUT6KXIQ7ezE5OvNum4KQudCCv1O+EX97XTGkxri/C Syl/9TxOkRjm5BrS2b/e82JyDSy9DWOs7ZCKboIC8ZhbNQjBSQiAxxNr0gNKeA== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (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: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg7496vySz9b5; Sun, 13 Jul 2025 14:24:09 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: <03300e95-af5b-4f20-ab52-823c80763dc6@freebsd.org> Date: Sun, 13 Jul 2025 10:24:08 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify To: Olivier Certner Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEaEicoBYJKwYBBAHaRw8BAQdAZBuydpjFLGem4uRJPWaYMXX2e+BN1jDhbD3tcqbxhdfN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbAwUJCWYBgAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRDP+1cn7slqBM/bAP9bhA4e0LxJYFYJlftZM5WHrMSPpUe6 G2pVqmQWTQ0EZQEA0PNryfH3qRWWPSI8mFNRnG24hi5/aXFqCnHj1tcJ9Q/OOARoSJygEgor BgEEAZdVAQUBAQdAUT4TzYFmV6ueIGwjX0N+445KZV6ns1Wiw67QMsJZxHkDAQgHwn4EGBYK ACYWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbDAUJCWYBgAAKCRDP+1cn7slqBPO/ AQCPuGiyyfJClICRs/ToG0MsT8YcPdBygzuUIIeGpkjJpgEA7AoFCQ0Y28Y3hIDFn2k9PH3B nGWL3g05W0ds2qoj+gQ= Organization: FreeBSD Project In-Reply-To: <2937929.UcPf6a0QyJ@francois> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------b74AKVv9eZSSsYnCCSYaNhRJ" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------b74AKVv9eZSSsYnCCSYaNhRJ Content-Type: multipart/mixed; boundary="------------UdCh0UxPth8DOV9XjhrtCHJG"; protected-headers="v1" From: Charlie Li To: Olivier Certner Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <03300e95-af5b-4f20-ab52-823c80763dc6@freebsd.org> Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> In-Reply-To: <2937929.UcPf6a0QyJ@francois> --------------UdCh0UxPth8DOV9XjhrtCHJG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T2xpdmllciBDZXJ0bmVyIHdyb3RlOg0KPiBUaGUgcGFuaWMgeW91J3JlIHNlZWluZyBpcyBj YXVzZWQgYnkgJ01QQVNTKCplb2ZmbGFnICE9IDApOycgaW4gdm5fZGlyX25leHRfZGlyZW50 KCkuICBUaGlzIHRlc3QgaXMgaGVyZSB0byBjaGVjayB0aGF0IFZPUF9SRUFERElSKCkgd29y a3MgcHJvcGVybHkuICBJbiBwYXJ0aWN1bGFyLCBpZiBWT1BfUkVBRERJUigpIHJldHVybmVk IDAgKG5vIGVycm9yKSwgYW5kIHRoZSBsZW5ndGggaXQgZmlsbGVkIGlzIDAgKG5vdGhpbmcg d2FzIGFkZGVkKSwgdGhlbiB3ZSBtdXN0IGJlIGF0IEVPRiwgYW5kIFZPUF9SRUFERElSKCkg bXVzdCBoYXZlIHNldCAnKmVvZmZsYWcnIHRvIHNvbWV0aGluZyBub24temVyby4gIFVGUyBo YXMgYmVlbiB2ZXJpZmllZCB0byBhYmlkZSBieSB0aGlzIHJ1bGUgKHVubGVzcyB0aGUgZGly ZWN0b3J5IGJlaW5nIHJlYWQgaXMgbWFsZm9ybWVkKS4gIFdoaWNoIGZpbGVzeXN0ZW0gYXJl IHlvdSB1c2luZz8NCj4gDQo+IFNob3QgaW4gdGhlIGRhcmsgJiBlZHVjYXRlZCBndWVzczog WW91J3JlIHVzaW5nIFpGUywgYW5kIHlvdSd2ZSBqdXN0IHN0dW1ibGVkIG9uIHRoZSBmb2xs b3dpbmcgY2FzZSAobGluZXMgZnJvbSAnemZzX3Zub3BzX29zLmMnKToNCj4gDQo+ICAgICAg ICAgIC8qDQo+ICAgICAgICAgICAqIFF1aXQgaWYgZGlyZWN0b3J5IGhhcyBiZWVuIHJlbW92 ZWQgKHBvc2l4KQ0KPiAgICAgICAgICAgKi8NCj4gICAgICAgICAgaWYgKCgqZW9mcCA9IHpw LT56X3VubGlua2VkKSAhPSAwKSB7DQo+ICAgICAgICAgICAgICAgICAgemZzX2V4aXQoemZz dmZzLCBGVEFHKTsNCj4gICAgICAgICAgICAgICAgICByZXR1cm4gKDApOw0KPiAgICAgICAg ICB9DQo+IA0KPiB3aGljaCBpcyBhIGNvcm5lciBjYXNlIHRoYXQgYXBwYXJlbnRseSBoYXMg YmVlbiBtaXNzZWQuICBKdXN0IGFkZCBzb21lICdpZiAoZW9mZmxhZyAhPSBOVUxMKSAqZW9m ZmxhZyA9IDE7JyBpbnNpZGUgdGhlICJ0aGVuIiBibG9jayB0aGVyZSBhbmQgcmV0cnkuICBJ dCBsb29rcyBsaWtlIGFsbCBvdGhlciBjYXNlcyBpbiB0aGlzIGZ1bmN0aW9uIGFyZSBoYW5k bGVkIGNvcnJlY3RseSAoYnV0IEkgaGF2ZSBub3QgdGhvcm91Z2hseSB2ZXJpZmllZCkuDQo+ IA0KPiBJJ2xsIGJlIG1vc3RseSBBRksgZm9yIHRoZSBuZXh0IDEwIGRheXMsIHNvIHByb2Jh Ymx5IHdvbid0IGJlIGFibGUgdG8gZm9sbG93LXVwLCBidXQgaG9wZSB0aGF0IHdpbGwgaGVs cC4NCj4gDQpZZXMgdGhpcyBpcyBaRlMsIEkgd2lsbCBnaXZlIHlvdXIgc3VnZ2VzdGlvbiBh IHRyeS4gSSBkbyBoYXZlIG9uZSBVRlMgDQpzeXN0ZW0gYnV0IHNpbmNlIEkgZG9uJ3QgaGF2 ZSBzdXBwb3J0aW5nIGluZnJhc3RydWN0dXJlIGZvciB0aGF0IG1hY2hpbmUgDQp0byBlYXNp bHkgcm9sbCBiYWNrIEkgaGF2ZW4ndCB0ZXN0ZWQgdGhlcmUuDQoNCi0tIA0KQ2hhcmxpZSBM aQ0KLi4ubm9wZSwgc3RpbGwgZG9uJ3QgaGF2ZSBhbiBleGl0IGxpbmUuDQo= --------------UdCh0UxPth8DOV9XjhrtCHJG-- --------------b74AKVv9eZSSsYnCCSYaNhRJ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaHPBiQUDAAAAAAAKCRDP+1cn7slqBJvY AQDDFlX3Od/Fs34DF15mSnz9dGcs65R7hckdIr2EyQngEgEApcQMdtw8NapdrLb8pRfHSVcq5V9a BCyG1HIexSyiOgo= =rWWt -----END PGP SIGNATURE----- --------------b74AKVv9eZSSsYnCCSYaNhRJ-- From nobody Sun Jul 13 14:48:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg7c34mfmz614GR; Sun, 13 Jul 2025 14:48: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg7c32cvGz3QHv; Sun, 13 Jul 2025 14:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752418099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51/V6WbUTtjbzquuriCvKtXGCjHzfIgnAunhJxJAz84=; b=t9MfI27g0uGUq6vTIJKlfyCE19QORmxB5frPEAqBufL08LonzR3h/lY6oWFh9vTJ0OZS7N evpN1fxlIi5ZHVuYP8jj2g/MzQJfR3G9KijuZXURU+nO9nlgrwG40U7W+iY3X1DoS7LCmv IP9zavuHrlJkNorNumKeaFIuMwXA97vfOKWaai71oSOgf9n9oFZcPsWLWqitit2g0WcF25 ptZWoRl6M34nHT1/BJPZu9rJr8q9JXDv+HSEurD4hACwFrEoJpda2CDJGzh5BGFswOwRp0 NXZOyzBzmbY7YrgBIUofsYYnRomazV6HrO8+eKhNTo7fvTNRIhW31N1dG1JQjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752418099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51/V6WbUTtjbzquuriCvKtXGCjHzfIgnAunhJxJAz84=; b=bAOh6SR0GZO97GPBlEIJnzmwZ3vCX3mLbNwmfQ2Peh0CuXi45AHuM0B+Ew0mJjbCMFIblC ioU7ZMqNnenmtVN/vajwnEs+uZr/gblebUMCznc9VogGhnBcBZk8U84Iy8IEn33ihnnnlA Z6RC3+0DCSPU/RluZyB9njcfWei2WbMWpkDTMpHrYoTEb1CvyoB2K2mg5kQyODGZ7f1ZfA cf8mS9g4AGjMCfpvB1H/G/Xz+/QF3i0QIBO6kY2/ZUOidAV9CaY3uOHAZBmujjQtf3cV0i EQEY5LSp4LJKZt6NDSWlNFPs2UA9Pda+/CNosH6BGQ9GX89v6BEMZFQWXZ2hDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752418099; a=rsa-sha256; cv=none; b=ybs+Vjrua8LnfH+cXHAq8UMchEXQACYqEaJBEDsrzpelNWNdbAccW3lGRIiiVIKEYr1BU3 d7q+FszLLKGBg27wwAQoekXG6WBQg8SbpwazRRBPVu4KYjab4tXvJTb3Um0Di49hpfIwvc QIyB2mAM2D6tGWMeiCFuNbpyd+eIsZAX6IPY5j+DVg7d0fB0dvJ23fFji/PQRB0ouli6cQ GaB0/rve5dly6/YIG5qYXGVqnm4ekNt3aiOkBCGS0l/KEY7EK8B1SB8rUD3h0K0oJlfuBg eOOO47TCBFb122vG5oFkWenEHYwUuQmhFoiOCPqon+rqIM4tjAdQvbPTNjt18A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg7c31SC0z1BsZ; Sun, 13 Jul 2025 14:48: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 56DEmIlQ030288; Sun, 13 Jul 2025 14:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DEmIZk030285; Sun, 13 Jul 2025 14:48:18 GMT (envelope-from git) Date: Sun, 13 Jul 2025 14:48:18 GMT Message-Id: <202507131448.56DEmIZk030285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 2b2ac1aa9a34 - main - =?utf-8?Q?pf tests: Fix rdr pass test to really use 'pass =E2=80=A6 rdr-to' syntax?= List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b2ac1aa9a345ce48aa3306e0292f9fde9c82312 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=2b2ac1aa9a345ce48aa3306e0292f9fde9c82312 commit 2b2ac1aa9a345ce48aa3306e0292f9fde9c82312 Author: Kajetan Staszkiewicz AuthorDate: 2025-07-13 13:19:13 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 14:48:01 +0000 pf tests: Fix rdr pass test to really use 'pass โ€ฆ rdr-to' syntax Reviewed by: kp Event: Berlin Hackathon 202507 Sponsored by: InnoGames GmbH --- tests/sys/netpfil/pf/rdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index 4c08b4973891..f7c920bbfa8f 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -142,7 +142,7 @@ tcp_v6_pass_body() { tcp_v6_setup # Sets ${epair_โ€ฆ} variables tcp_v6_common \ - "rdr on ${epair_one}a proto tcp from any to any port 80 -> 2001:db8:b::2 port 8000" + "pass in on ${epair_one}a proto tcp from any to any port 80 rdr-to 2001:db8:b::2 port 8000" } tcp_v6_pass_cleanup() From nobody Sun Jul 13 14:53:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg7kS0CPLz614Z7; Sun, 13 Jul 2025 14:53:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 4bg7kR2CHXz3Vfb; Sun, 13 Jul 2025 14:53:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7dd8773f9d9so279611585a.2; Sun, 13 Jul 2025 07:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752418425; x=1753023225; 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=85jWj4DcWO5TYJGtsaRxJRLJs/KLVFUTWmhtt1h4w8s=; b=m2tDztfqH925q4DgvE3A5aUR6aYN93uwHvbGgtkY0suxxDIozWFo0TwRVza1U/XXH2 WWZFRQxBr9RwCaeW/l5fpNKtz1DXLYGulE/0faBobPf12r4dTbaVLUFh/ffnFTkgMNaS kg0XcIItkgA3+3rZw8HikCSuB45deAyeGm7NP6joWlN3fqP9cn9vzIjSzk55A9fS0FtD 72nTVXIZ9tlIJj2utAMMKBxYFashhQ982o1wnK6pLyMKoCetDuMUxkxjQ3VxWnPf7KEQ Hg8/VyhObcHbASn6OLMsBwcw6mjEJnoQuN6Fzqhv3eiEdkA64BusMAki0bBq8curmIyH CvGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752418425; x=1753023225; 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=85jWj4DcWO5TYJGtsaRxJRLJs/KLVFUTWmhtt1h4w8s=; b=bUI8l+YQfTA9LvsNRQngAeFqOC46+ZyJPJVmwvqpoKdSOiut7kFQIFGJvl6ALp0O8V s2sUcyXC2NTjRxIe7j8t5GVUCBYFmhHNRzRJMwVx+j2rYAB6tZMRhcGC9Z8x+vtFP+JU u8esUfwEZOFEBiADd9W79lJHQMD4frEI1ZLIVkRcgyOoncSOAYoOTyTOTJ8Lcd+umbzM eZNl82BfSrlkjwBWJsiAEfwjZNCi6ovAoU5JPFybFd1SA+VT+pHytRhXx5Zo2Rbu+j3j 4vDCF4mPYnqiKb6bXBeD+EqjnfCdttkuo8lfqydaI9VXv+xUiR0b2rgq1E1JE70G8eLq 37jg== X-Forwarded-Encrypted: i=1; AJvYcCVF0TmCBBSEaJXMbYL2lkO49SZyWYkiH6MiXqwLzwFRn5hsnear8qecuIkJflpAVa1yhWafcI0OpCQ+DSInG+EGomZsJsA=@freebsd.org, AJvYcCXdj2l5GgBILi3Zh7MnN1hLiljF/5K6erUHvWHP1FBhqcs7P5OTyiWZbqhT5OPub4/b+FD6v21M2Bbd/q31KLCWFoUO@freebsd.org, AJvYcCXoyOha/UrGK7FcYthpyF1m3m+gNm5ZenbFjIv5hJ+rgc2YxtbaflhIPP4iYHrnj+0nyv/YrXjGWlK4D0xui58=@freebsd.org X-Gm-Message-State: AOJu0Yy/IEnyIuo3U90af3+vmS46Bo/rBbda8wjUf4EPLUKoEpj49kHx LtRqteIFUUqzQEU0BZRfRs0KqVVh6ZoTM4lSO76f5ocCb5hF9v3aJuOEZZJJnQ== X-Gm-Gg: ASbGncvhOpjcvaCF3yeYL1uflX9p3hBzG7yjCujnGsMAX2Y0xRBjORpt/nMAK/OLK9M p22so1bhpYchae1Ut+wUuucevPSBLx0Mr8+oTm67eGV8T3OUwvixBo5H+/2YC1VYVrOL5oWdka7 yADrg/aZ2iIsUlCk7ImsGzR3foeKsIdAk7Bb6NLzmXtl87wSMrBq78QmriPbUAAHLRTdJmaWtWD KS+kHiBTMiWaCTIbt0FCrBWgByPDINfFd3JlNG2IWMCZmr7YaScaJLO9GlnwJWdv+CSFtBhidTj KV1ccgpC3VRPUWjyFUaKRgv8IvcCjQ2s2zLHb5kVgYOsdxyBkBJ95PNrtIFASkcTowP462MAcBs k4nA9zuZQa7jC4RDUJkZSdPXWQmu4/A28M4Uw X-Google-Smtp-Source: AGHT+IGVzU8bgynvLLKciAu/3SE6v/7/CJmgUE8gjRcFnVuOn4hCJlTNZLmfdcvfAEcCRFR2XAlbdQ== X-Received: by 2002:a05:620a:4416:b0:7d4:635f:3e42 with SMTP id af79cd13be357-7debfcc7a3bmr1177998785a.20.1752418425118; Sun, 13 Jul 2025 07:53:45 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7dcde32bfcasm415715885a.65.2025.07.13.07.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 07:53:44 -0700 (PDT) Date: Sun, 13 Jul 2025 10:53:42 -0400 From: Mark Johnston To: Olivier Certner Cc: Charlie Li , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Message-ID: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2937929.UcPf6a0QyJ@francois> X-Rspamd-Queue-Id: 4bg7kR2CHXz3Vfb 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] On Sun, Jul 13, 2025 at 10:46:57PM +0900, Olivier Certner wrote: > Hi Charlie, > > The panic you're seeing is caused by 'MPASS(*eofflag != 0);' in vn_dir_next_dirent(). This test is here to check that VOP_READDIR() works properly. In particular, if VOP_READDIR() returned 0 (no error), and the length it filled is 0 (nothing was added), then we must be at EOF, and VOP_READDIR() must have set '*eofflag' to something non-zero. UFS has been verified to abide by this rule (unless the directory being read is malformed). Which filesystem are you using? > > Shot in the dark & educated guess: You're using ZFS, and you've just stumbled on the following case (lines from 'zfs_vnops_os.c'): > > /* > * Quit if directory has been removed (posix) > */ > if ((*eofp = zp->z_unlinked) != 0) { > zfs_exit(zfsvfs, FTAG); > return (0); > } > > which is a corner case that apparently has been missed. Just add some 'if (eofflag != NULL) *eofflag = 1;' inside the "then" block there and retry. It looks like all other cases in this function are handled correctly (but I have not thoroughly verified). The store to *eofp sets eofflag, so that is not the problem. Based on the presence of "efi" as a component name in the stack trace that Charlie provided, I suspect the problem is rather in msdosfs, but I don't immediately see what's wrong there. > I'll be mostly AFK for the next 10 days, so probably won't be able to follow-up, but hope that will help. > > Thanks and regards. > > -- > Olivier Certner From nobody Sun Jul 13 15:12:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg87k3YJyz615TY; Sun, 13 Jul 2025 15:12:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 4bg87j74Prz3l6B; Sun, 13 Jul 2025 15:12:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4a9bff7fc6dso30179901cf.1; Sun, 13 Jul 2025 08:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752419532; x=1753024332; 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=OxUBiQ8hu647wvWpeIV8eryA4Of5ok+v772B9eSNCyw=; b=hsSo5V9wxc7Yb+z+4mM74OZaehQu8Eg2UmpAKrc1+04C83h7y1vFZPhf0x61yvN8Db hBwuz/axX60gvfOciZQFOd9Q8Xc+T0ViVzOJFhvG/t5IKbFoy4rjanWWSDLtQ3G+dm0v OM6dAVD81iKw389aVO8hcsoKNM3wXktVLCkIX3nHFSQ/akhQVe4efCR1JxzA5ygAVbvj XIRYoFa/RQApNvR7KVP+us4PrTGu2XJ2n1TBllq7h/ko1jKNtmk6/seMBcHFTS+3jhvq 3PFpukBJtTL4V8EWmweTPOt9dNO8RffDGCzh4EdXAlDbNiYJePdCOC1rQGNpS4bj9ynC C+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752419532; x=1753024332; 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=OxUBiQ8hu647wvWpeIV8eryA4Of5ok+v772B9eSNCyw=; b=A99MruvQzpyi5ymdaYQmj+hxEt7lmPRyO/TgbC57lrHcQP4XxTb6jSnMV7fSZZaatF Lb+37aJOeIgbn/Bi5wghd3tj/9wjQbeV+c79ImMz65zv8U30FDMMVXC1/Ju9Lc3bQPVR b3ZJZaCOyf42cms8wzvpqpdaLt1nk7E3MxgAFqvOZmcwKYvOVKk4JK2MHEOKnKMscwRq 693yQaC6Hi4q6wr9D9c1iluPHWAgl1rJi5l7O7HvLa2YpTAUA6FnfXdAVC0r8Zr9Vo5p FzX88/rhUuHWX0WpSvPWLkBtbHVP5h0gCENWkr404bA9w1AD4yAofm0DbwHd5Wm08WgO T0AQ== X-Forwarded-Encrypted: i=1; AJvYcCUHE9TLm8PPPzlZ7Twi6s0JCBoKrT4ROZg+Hrj79SudF+xeiqcjR5nBUs+KPlg2BVyoZ1yBPAXjrEUClATTA8nBbMPw@freebsd.org, AJvYcCVspY7UlxBBBNYHfxMXG1nd46oO1CAfr1yVMPq+1QldeVf4dqbXmqI/57B9HBVuU+nWaadlxxNSygvyy/xKyKS9UYTQlmQ=@freebsd.org X-Gm-Message-State: AOJu0YxSszYnIovzqxRpWKmxileLjAvR6vgh1+6u4sQuT0qHLkpmSNRi QcKVhhalkCltg8rTwqgQuA3YEr3JGNNjpvuy0YkSb8Dymo+pgH29jUjcmgzozw== X-Gm-Gg: ASbGncvFK1E3YyTplluQMDZTSPSaWJ4l+49fEXmdoXZS9PkG3/KLn6mGa4oKVlkNqFU 7sphH8pZqMzWaSp0SXsh4DcquzVgra5otdDgyp2LvfvZjMERPDx+5uwPg1tBCfGqlM93WpFJxFe u0c6hNz/UZPuKhs++Dy2CYUiRgbNbBmJnCcnnEOO0TYEI8iUk02YOecF4HhoZ9+OjrLM54Cfokg H3Tutl+aF1jaC6tgjeT5ASJ9UQZH5dbE/oYh/xLcGzXn6po78VNg7icVa/mn4mdL1g8mK2NM9br SBQHfdGQgkbsiyKtotKekt5Gu43nFuv+LU7T1bfphIyt5ODlu7JI6c98vafQHkc3H4qApTFlyWD oSTpu0Yn1QPMobDN9a96WZa2KvX4Q/h/Fuin3 X-Google-Smtp-Source: AGHT+IFGbt4b5r5UqGKJXAtaYAkf4PGm1uWG1tjeiles3n9vqdfuPG5lb7uzRf5mstAN62obhLv15Q== X-Received: by 2002:a05:622a:4d8e:b0:4a9:8299:4e00 with SMTP id d75a77b69052e-4a9e9a50750mr229134661cf.0.1752419531340; Sun, 13 Jul 2025 08:12:11 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ab04d910desm25829621cf.9.2025.07.13.08.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 08:12:10 -0700 (PDT) Date: Sun, 13 Jul 2025 11:12:08 -0400 From: Mark Johnston To: Charlie Li Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Message-ID: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bg87j74Prz3l6B 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] On Sun, Jul 13, 2025 at 09:01:24AM -0400, Charlie Li wrote: > Mark Johnston wrote: > > sys/kern/vfs_vnops.c | 3 +- > > > > > After this entire series of commits, with all ports rebuilt, I'm getting > panics immediately upon starting a desktop, found with both xfce and > cinnamon: > > Sun Jul 13 08:30:38 EDT 2025 > > FreeBSD lehman 15.0-CURRENT FreeBSD 15.0-CURRENT #2 > main-n278710-f5dba673345e: Sat Jul 12 19:18:59 EDT 2025 > root@lehman:/usr/obj/usr/src/amd64.amd64/sys/ODYSSEY amd64 > > panic: Assertion *eofflag != 0 failed at /usr/src/sys/kern/vfs_vnops.c:4058 Could you please try this patch? https://reviews.freebsd.org/D51290 From nobody Sun Jul 13 15:21:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg8L20VByz616DW; Sun, 13 Jul 2025 15:21:14 +0000 (UTC) (envelope-from olce@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8L13RR0z3sM8; Sun, 13 Jul 2025 15:21:13 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420073; 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: in-reply-to:in-reply-to:references:references; bh=DoJilKACp29ttkZe+IRyGzmhG+ybtTLn5PpQGLwM8RM=; b=wAhJU20ayUa/NEY2n1VsNJ1+b/Q16HSUeoZuTTlx7H2EroYj3QKG134DjttCk0bHW8knEQ oyxGtfchqFbn1pTC6Ju4q2Z0oaNrOb9RQd51sa8YxXg5C+BxR6Tkvs2qNg4AtMLcztghg6 Hpad6QKM+AJX92kZHlTVT4kzwoZIRrKk6la4mIeoJnyxsJSFZHYKekHGwkJe65G4zXF775 lTTe3LgIf46IdsqpJh10iB93BUMr6NYMGVzHPXtShZZhDN0PpEEBe9IlnYx5odMWecdyge ynCrY3UBS2flWbFr5TCAM46M5cDK7vg6mRNPG7bGe7h2OiPsrknfx7Tw/Ks9xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420073; 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: in-reply-to:in-reply-to:references:references; bh=DoJilKACp29ttkZe+IRyGzmhG+ybtTLn5PpQGLwM8RM=; b=isH4I4pxx1K2sPpcSs6mhza7bvoNnpEvO6NPXOeY9v2JWVrts4kRyNQKQLGyE4Ery08f/k JUsvn0PEzB56tH5jRXGURO0jGU1l2R1v2CuQuM1Jpun3h1qcYtjM9o14cVkrr98ZjKW8W8 JgIvpVa64FlyHuYM5FY8ZWYKdYKcEcETebaRAqVMX6wUWv4K/xLT/S1RGb02xYx2e2HQ+r ptxcJl31TAGxRTkKq9tnJoZF0EL9bTgX2F7k+G4lLM2dHyW9RGoHvDFF0fnusrDj+vAos8 7ALi5stweNL5rlvl7aifpClKvLPJfrOp753s3wu52xCp+gnPDFxphaNceZFL0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752420073; a=rsa-sha256; cv=none; b=T7Ul0f/Ejqm94PDetT7o8txH1O+n3d7KEK+/lNz+kLbc5Ev/60uslocqoxSKqN8ba6gYSL B5BQMEMaOubZ+c5FA0z7CX3SyAcbK+6B6KYbl5+75zqpmrJBXKlAk0hzi+rqBAoSCBxIPl voS68J22HL0uJs1VkK+b82Ks9Pk99M2IivJ1IPtlocQFURDCgmivdknpHK7Jbj5JMK/HFk 17MiI3kGU/1Fd7XM3IQBObwEZCGvg7yA0fUAomikA7c5N8xXKWJnDjFPCtvpTqRL7la8MI 6lm+zvtQVp9eBdk2DH9ZBJxm+eh9DfkNL1gMmPcqlAuxUjQ9btWcoFeSwaRN/g== Received: from francois.localnet (h175-177-044-048.catv02.itscom.jp [175.177.44.48]) (using TLSv1.3 with cipher TLS_AES_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: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg8Kz6SnyzBWg; Sun, 13 Jul 2025 15:21:11 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Mark Johnston Cc: Charlie Li , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Date: Mon, 14 Jul 2025 00:21:04 +0900 Message-ID: <3224371.fEyhCgFcho@francois> Organization: FreeBSD In-Reply-To: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6956069.Qb2xPn7ZBO"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart6956069.Qb2xPn7ZBO Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Olivier Certner To: Mark Johnston Date: Mon, 14 Jul 2025 00:21:04 +0900 Message-ID: <3224371.fEyhCgFcho@francois> Organization: FreeBSD In-Reply-To: MIME-Version: 1.0 > The store to *eofp sets eofflag, so that is not the problem. Indeed, I missed that. Checking the rest of the function, I see no problem here. > Based on the presence of "efi" as a component name in the stack trace > that Charlie provided, I suspect the problem is rather in msdosfs, but I > don't immediately see what's wrong there. Based on that, I've just read msdosfs_readdir(), and the problem could be there: """ if (dep->de_FileSize - (offset - bias) <= 0) """ because dep->de_FileSize is an *unsigned* long, and the test only passes with 'offset - bias' exactly equal to 'de_FileSize'. The assignment to `diff` in the loop above would be wrong as well. -- Olivier Certner --nextPart6956069.Qb2xPn7ZBO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmhzzuAACgkQjKEwQJce Jid25g/6ArOIvsrLTJogChCET+ovk8EsjmnPbnWgxakceyV03KX3rJ0MauoTDV01 BghhwylQolKa5i/wBV89s2p92OMgf4mgP5OqDWUwOFJZDTtNHNvMkCjEs1BVcHcl BB107XkZy4tOba2yM1sWv8GtnRuV0OojK+Myq96iouq3bf1qQKH3Z3T7VDCeo8io 8TC0HzwH1nSyiefVMpJwCSa22FmycemytZhvMjS9TeB6EpaafS8HX/ftenxT683e tWX3sPmkXOeH5Ud9XS4UFTthwVJIRbs/JpziKXkCKS5/n/Xdo6siCdEaoqAVbqCj +DsQa9RLAU2nNOmqqoxmLpkQi7TD8vkjkvrXPgGeBkkh2uoKHbZwkeWeG05Jr4sC voKMzS0+yEbpxJfAo2mMcZLXnj1lu9LE5cKG2Z97E+babtDhwpz59mUg0dvi4Dv2 0//aJC5I+vyYoW9bFmZH2EK6BNGYNkBSRFPctNPywmMcpD5k+ym4PvMFJ+I6+ue8 l3xvdn/Rw67X68l62+lt1t84ttqlVo0Z5jGWmWfjvKH/eQcewsyPJ1mROlJjUoBJ jLHpzGwKpYfaUaLpW6jtsWy5qf5FjBpjaszjHGEUMItExePcwMKWFm+OEPnFcxvs yYMovlW8vrQrhx+awimdYKnIR028g/smNrf6x5vTlPXEcuwpv2A= =96JS -----END PGP SIGNATURE----- --nextPart6956069.Qb2xPn7ZBO-- From nobody Sun Jul 13 15:36:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bg8g511mcz616qN; Sun, 13 Jul 2025 15:36: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8g43PSFz40Hv; Sun, 13 Jul 2025 15:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MjabJL6hnDe/TgMTg0kGsOXXKaYyqiB/kKDMpAEP4PE=; b=fJOx8LuGK38uBNwkM6mM7+tC7IfIzDltP/qWh3MfXRqh6Vb7r2InMsmNBRHAPgJkpMT7C5 koYBZQCkTwNSAh5+qn/1P33/9xeBU1qtFE+otT7Czqnq9JrVTw7OeJwao1Q7FM16WJlE7k Wwl8DQG6wHZax5iqi08UXToAR6CmBpvA0uA19eTFJGYlnk/G9HgUkuO0MnGXHJ+QWrg24W D/vtf22+VBCaXd0v4gmYKN2Jt36RtpP0T8bqjfTW/bhkBrA0Aa+tUODfpS2VjcOWKVQF6v 3+mabOmHuALN9uVOBhuadSdgbi/Gfk2gGx1KWo7CVWa80gRpQk75COE1aOUOGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MjabJL6hnDe/TgMTg0kGsOXXKaYyqiB/kKDMpAEP4PE=; b=Caxp/Qx2ipnMSb0FFbexBw7YrlGT+9UIeW++owK92c+sLndftlWtt/58Kqt1trGN18902q kvDspEQJo6P9+40RnKD0SwDbAhn1/SJvD3ZSOcJ3mG4XUPXHSCdRCQN875L7+TWTSp8VgW rVyrgxBEomQRQbCTDbkhkX3FwYhFY1FzRzBXBbRYBoLXfnR/YgKUVnmQO6rYGKs0cU3Y2+ uDtqlbuVBisy3/Pg5803NlY8F3VxHvYrD96hA5ZM7eJOag7cqILNINb6lCJ02TRhUo6KPK CC+ueFKpLOhyz6cSReTTHzST4nrXoK8bfjrXzK/sgqQLo5cz7COGJ61Z5p+3XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752420960; a=rsa-sha256; cv=none; b=rnwV/KXrzs5KoTzvKx5H/l8UiGmz7TL1Sw4rd26StJ/XUUfyISZpCCAj29I0T9uGzvQz7N GGvRE1HSc/kon+zJKtxY7pruemmLQYJ7+LjsqyqpKK8chInxylvCh/fUoEHgSj94pjbw02 92MNyhlPbx5WsFiyOCK+gIqONiMaIY9LqwclZABmlMvatgsop7Rkow/oK1JAvRBOAiNUor CD5UT2OwiQmgdf6D96BV2yQszyh5Vq0mo3NU2dwAAIByxT+I1r84p6y5A6c364TzBc86bL w/b11kSjdRQrYsc1ZRNBfp31fGSfeUeom+JUKXZx76x+UfD2GkxUOZI+zTNjVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bg8g42y6PzRl; Sun, 13 Jul 2025 15:36: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 56DFa0Ph022741; Sun, 13 Jul 2025 15:36:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DFa0lm022738; Sun, 13 Jul 2025 15:36:00 GMT (envelope-from git) Date: Sun, 13 Jul 2025 15:36:00 GMT Message-Id: <202507131536.56DFa0lm022738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 10d336114d48 - main - tracing(7): Add hwt(4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10d336114d488193d06bffa1755bf61f2a027a8f Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=10d336114d488193d06bffa1755bf61f2a027a8f commit 10d336114d488193d06bffa1755bf61f2a027a8f Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 09:40:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-13 15:32:48 +0000 tracing(7): Add hwt(4) Also, reference tracing(7) from hwt(4). Reviewed by: bnovkov Event: Berlin Hackathon 202507 Differential Revision: https://reviews.freebsd.org/D51276 --- share/man/man4/hwt.4 | 3 ++- share/man/man7/tracing.7 | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 index df02a4672f36..299332c72542 100644 --- a/share/man/man4/hwt.4 +++ b/share/man/man4/hwt.4 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd July 7, 2025 +.Dd July 12, 2025 .Dt HWT 4 .Os .Sh NAME @@ -131,6 +131,7 @@ For SPE-only, the kernel is waiting for userspace to notify that it has copied out a buffer to avoid data loss/overwriting buffers. .El .Sh SEE ALSO +.Xr tracing 7 , .Xr hwt 8 .Sh HISTORY The diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index 4c9aee8ce913..f3e3a5bf98c4 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -73,6 +73,10 @@ It comes in handy for some niche purposes during kernel development. It lets kernel programmers log events to a global ring buffer, which can later be dumped using .Xr ktrdump 8 . +.Ss Hardware-Accelerated Tracing +.Xr hwt 4 +is a kernel trace framework providing infrastructure +for hardware-assisted tracing. .Ss Hardware Counters .Xr pmcstat 8 , and its kernel counterpart, From nobody Sun Jul 13 17:09:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgBkY2yqtz61D6y; Sun, 13 Jul 2025 17:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgBkX6pc0z4C9V; Sun, 13 Jul 2025 17:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752426549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SkeX07Q62cznuLzB26r6xz3kDDQCsuJmrLfh0UhkmD8=; b=Qn6pjKUUd+cB4XSWjhB84ngnhPELMR54Y6eqNIj4mq8O5KguB1wELeHOSuldDiGe+oC8wu Vreje83vyfLwXnyPO4RtF99ljWdShPEKqfpfZZXXw823jcIWnkwkNAafqHupbgI0KtHbTZ 9ruzscF6n3rX7u3azsipGot+3filev0WXaIOToHPBJdK82mPD5+2dnXY6PfuLdcgB12u6J glEUpGcCCTBVBtXiK4jgacYhd1ZucCPaKdKuEdSFLlxp1AN1FvrLypyVOs1dYA51fSjyRL Ocy7yiAItdb5eZxudmwUdjX8gh9GbTEJtuMN+zku+XSHRWh5/i7OTcTAvWaAaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752426549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SkeX07Q62cznuLzB26r6xz3kDDQCsuJmrLfh0UhkmD8=; b=uLc2jozItvkB7HHKWJxAOsN0U9KAoTY80VRw2biqe76+RVSo8KQjFnZiqejp9OTVebkGP1 FuIjWDGRe21GVlLMbsYI7wPIjrbaTEmkJSWJiTdZYY0Z2TeLw7bQC+HeVTcH4SMd0thQcl 5yV0H1gTxiOniMNinBHwtEU5YPlb0s16/FGFn5LcNmr/4bck40jymfe/9kjvCptE2aewLO gNcFiNdd8TCO2N1l5vI1Cvmd2MZmuUoR6jUjNpCMDrTV3ICIx5CfSet/yilhKqq0jeHET/ T8wXg4V18Q3LXy1mBekaU2ueDwgVWwDeHNkMgCAblVEocJsuxR6r+SwMFf69oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752426549; a=rsa-sha256; cv=none; b=xfgF+TYSFUdZRrx071NmLOtws8KQpQTw5enI4I1UurRI4WhieI9L2Cjvgur13v6powgOXS /akVJYDgrAxIfxlrynNa8MjtapUEnL9znQKM1lDaK/rKCBw6NcyQGeoTZ9LDOyOMvFWOq2 zs1pRCnQ6vs9cGZYRE8ftmfcR4xYIW3d0ZtaQBKGqQTqrBUHRqbWpYdeTtVrYZiYIOOwtC bP7wy30G4iy6Jp4h3pI5Ol7bL4Qz59goGU0n7aZiZasDsW6MvuABkiBefdWwW3yAMyXtx6 gfTAY3Si3eNS87/2Wkm5/g2Jb9ANdsPgQ8I8Gb21r3KXaQwmnWjv5e6MwzsX4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgBkX5xb4z2cL; Sun, 13 Jul 2025 17:09: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 56DH98sr094452; Sun, 13 Jul 2025 17:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DH98qO094449; Sun, 13 Jul 2025 17:09:08 GMT (envelope-from git) Date: Sun, 13 Jul 2025 17:09:08 GMT Message-Id: <202507131709.56DH98qO094449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 2cfd6342ac84 - main - arm64 pmap: do not panic when unable to insert PTP into trie List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cfd6342ac84c6915106fbe141795ca23a96cbba Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=2cfd6342ac84c6915106fbe141795ca23a96cbba commit 2cfd6342ac84c6915106fbe141795ca23a96cbba Author: Alan Cox AuthorDate: 2025-07-08 23:31:26 +0000 Commit: Alan Cox CommitDate: 2025-07-13 16:55:47 +0000 arm64 pmap: do not panic when unable to insert PTP into trie When pmap_enter_l2() needs to destroy an existing kernel superpage mapping, do not remove the saved page table page (PTP) from the pm_root trie and remap it into the page table. Instead, simply zero it. Then, later the PTP does not need to be unmapped and reinserted into the trie. If the kernel region is not mapped by a superpage, then try to insert the PTP into the pm_root trie before clearing the PTEs. If the PTP insertion fails, then we can return failure with the old mappings still in place. Convert an assertion from a panic to a KASSERT. Reviewed by: kib, markj (an earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51220 --- sys/arm64/arm64/pmap.c | 84 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 30 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index dbd1ed7b316b..a09da794e77d 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -497,7 +497,8 @@ static bool pmap_pv_insert_l3c(pmap_t pmap, vm_offset_t va, vm_page_t m, struct rwlock **lockp); static void pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va); static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, - pd_entry_t l1e, struct spglist *free, struct rwlock **lockp); + pd_entry_t l1e, bool demote_kl2e, struct spglist *free, + struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp); static bool pmap_remove_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, @@ -3847,8 +3848,7 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) PMAP_LOCK_ASSERT(pmap, MA_OWNED); ml3 = pmap_remove_pt_page(pmap, va); - if (ml3 == NULL) - panic("pmap_remove_kernel_l2: Missing pt page"); + KASSERT(ml3 != NULL, ("pmap_remove_kernel_l2: missing pt page")); ml3pa = VM_PAGE_TO_PHYS(ml3); newl2 = PHYS_TO_PTE(ml3pa) | L2_TABLE; @@ -3873,8 +3873,8 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int -pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, - pd_entry_t l1e, struct spglist *free, struct rwlock **lockp) +pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pd_entry_t l1e, + bool demote_kl2e, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; pt_entry_t old_l2; @@ -3910,9 +3910,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, vm_page_aflag_clear(mt, PGA_WRITEABLE); } } - if (pmap == kernel_pmap) { - pmap_remove_kernel_l2(pmap, l2, sva); - } else { + if (pmap != kernel_pmap) { ml3 = pmap_remove_pt_page(pmap, sva); if (ml3 != NULL) { KASSERT(vm_page_any_valid(ml3), @@ -3923,6 +3921,14 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, ml3->ref_count = 0; pmap_add_delayed_free_list(ml3, free, false); } + } else if (demote_kl2e) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(sva)); + if (vm_page_any_valid(ml3)) { + ml3->valid = 0; + pmap_zero_page(ml3); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } @@ -4232,7 +4238,7 @@ pmap_remove1(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, bool map_delete) if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { if (sva + L2_SIZE == va_next && eva >= va_next) { pmap_remove_l2(pmap, l2, sva, pmap_load(l1), - &free, &lock); + true, &free, &lock); continue; } else if (pmap_demote_l2_locked(pmap, l2, sva, &lock) == NULL) @@ -5747,33 +5753,51 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, } } SLIST_INIT(&free); - if ((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK) + if ((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK) { (void)pmap_remove_l2(pmap, l2, va, - pmap_load(pmap_l1(pmap, va)), &free, lockp); - else + pmap_load(pmap_l1(pmap, va)), false, &free, lockp); + } else { + if (ADDR_IS_KERNEL(va)) { + /* + * Try to save the ptp in the trie + * before any changes to mappings are + * made. Abort on failure. + */ + mt = PTE_TO_VM_PAGE(old_l2); + if (pmap_insert_pt_page(pmap, mt, false, + false)) { + CTR1(KTR_PMAP, + "pmap_enter_l2: cannot ins kern ptp va %#lx", + va); + return (KERN_RESOURCE_SHORTAGE); + } + /* + * Both pmap_remove_l2() and + * pmap_remove_l3_range() will zero fill + * the L3 kernel page table page. + */ + } pmap_remove_l3_range(pmap, old_l2, va, va + L2_SIZE, &free, lockp); + if (ADDR_IS_KERNEL(va)) { + /* + * The TLB could have an intermediate + * entry for the L3 kernel page table + * page, so request an invalidation at + * all levels after clearing the + * L2_TABLE entry. + */ + pmap_clear(l2); + pmap_s1_invalidate_page(pmap, va, false); + } + } + KASSERT(pmap_load(l2) == 0, + ("pmap_enter_l2: non-zero L2 entry %p", l2)); if (!ADDR_IS_KERNEL(va)) { vm_page_free_pages_toq(&free, true); - KASSERT(pmap_load(l2) == 0, - ("pmap_enter_l2: non-zero L2 entry %p", l2)); } else { KASSERT(SLIST_EMPTY(&free), ("pmap_enter_l2: freed kernel page table page")); - - /* - * Both pmap_remove_l2() and pmap_remove_l3_range() - * will leave the kernel page table page zero filled. - * Nonetheless, the TLB could have an intermediate - * entry for the kernel page table page, so request - * an invalidation at all levels after clearing - * the L2_TABLE entry. - */ - mt = PTE_TO_VM_PAGE(pmap_load(l2)); - if (pmap_insert_pt_page(pmap, mt, false, false)) - panic("pmap_enter_l2: trie insert failed"); - pmap_clear(l2); - pmap_s1_invalidate_page(pmap, va, false); } } @@ -8426,8 +8450,8 @@ pmap_demote_l2_abort(pmap_t pmap, vm_offset_t va, pt_entry_t *l2, struct spglist free; SLIST_INIT(&free); - (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), &free, - lockp); + (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), true, + &free, lockp); vm_page_free_pages_toq(&free, true); } From nobody Sun Jul 13 18:01:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgCv65vr1z61H1g; Sun, 13 Jul 2025 18:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgCv63SNhz3ZcH; Sun, 13 Jul 2025 18:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mF6rLAruBZERo5QEaKT5X+ukY6p2A4Oq4AV3k4W11ho=; b=A+V0gH/79Fsq80Bc/t03Od67NUwoJWVoed6pIZRZcjw3MFPNWfk1mu/fJ/bErIKItgSnGa kGSxEVnbZ4vCHhmCjny0u8mQvPmfLu3RdXNe7TERkeHgJfro98gsXKoJPaqygQ4lmuyZDv FnQQ2zoCYsChW7hF8Zuwse+xQwOA77QfZMUdCZQ+AmlGzY8lJhy3aQmRVUCRYxjPJh3Q3v oJ28VfcnuZSuRlkfR9y6auVh3Qgcgr8rSJW3BHZMqWaeLG4RuvCC7hU58T83lubz8CS7y6 +I+jPB3iTWM1oZ4MgCJY2RarVqba0C/8DTZgAQJzcIxGh33VWn5K37Olf/1dKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mF6rLAruBZERo5QEaKT5X+ukY6p2A4Oq4AV3k4W11ho=; b=MyBlLyw5a5fwuqNjIBKuSPNTEYHhB4UZ9buXHyeK6K8F0kdUJdI54QhQMM6WaMwLgX6pFX JSzlFvmHB4WsV18kXUG4tciqgijEf1nt6dl+MnHQHwoG0vmzToVz3p0u4fnN0uAt31c3RL H+bQFNBs+9d7tb6KBDKqvcweh8VLbh2nHXnLkMt5Lc2qgXGNz0L4SK104xInC/kwM2dRx7 DSohsZSEg5I4BQYMrAE6wdRhcy7uO6r3rEyUUFyV6H5tppOprMDzeiM5HiQdWuVicRI3hI enptBsg9LNXyUODTOT5yMzdcevko5GJ1VNFfYpaB9qxBusr0578i3jvDn1QPqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752429698; a=rsa-sha256; cv=none; b=kHfCAtU8HZhlTbhl+YJEXTyKVWHFpSqh5kkbHW6kpRi5+s1P6am2U/KlT2qTGoxXYm6buD 0plE6Y+nkGAgeviWLjgsV+H/saBFxUSydGQpcfr4c56olyXY4RqNBkzUj3Y0zfC/hyILyc SKmlMZUf7+9GhYSE4083Dv5nZBdAFikOoAY1rpu7C7/6oYJeyjClmIY44J3ou1wdDM/GFo 96Lou0FGlMYKTwNA0IH3xPmvIYFTVAMWrntxQF6xN5hWBogDTZd/3Pg+zn3O6nBJj8PefZ pOcbkECOIK7z1+LP4PXenkByPo1NxOQHP3I3XVLBdIemOHUk8f1d+qcEV2l4VQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgCv633j1z4CY; Sun, 13 Jul 2025 18:01: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 56DI1cMw099125; Sun, 13 Jul 2025 18:01:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DI1cD1099122; Sun, 13 Jul 2025 18:01:38 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:01:38 GMT Message-Id: <202507131801.56DI1cD1099122@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: 645bb3efc320 - main - powerpc: Reserve correct scratch region size below stack List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 645bb3efc3209a9ca6dfabb48b1c6475c1d965a9 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=645bb3efc3209a9ca6dfabb48b1c6475c1d965a9 commit 645bb3efc3209a9ca6dfabb48b1c6475c1d965a9 Author: Timothy Pearson AuthorDate: 2025-07-06 19:24:07 +0000 Commit: Justin Hibbits CommitDate: 2025-07-13 18:00:56 +0000 powerpc: Reserve correct scratch region size below stack According to the ELF ABI v2, two scratch regions are reserved below the stack pointer, one 288 byte general region and one 224 byte compiler region. FreeBSD only reserved the 288 byte region. Follow the ELV v2 ABI and reserve the full 512 byte region as specified. Signed-off-by: Timothy Pearson MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1756 --- sys/powerpc/powerpc/exec_machdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 1893d79f29a8..c6b2b01d9d30 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -214,10 +214,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sfpsize = sizeof(sf); #ifdef __powerpc64__ /* - * 64-bit PPC defines a 288 byte scratch region - * below the stack. + * 64-bit PPC defines a 512 byte red zone below + * the existing stack (ELF ABI v2 ยง2.2.2.4) */ - rndfsize = 288 + roundup(sizeof(sf), 48); + rndfsize = 512 + roundup(sizeof(sf), 48); #else rndfsize = roundup(sizeof(sf), 16); #endif From nobody Sun Jul 13 18:01:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgCv81tx1z61H5f; Sun, 13 Jul 2025 18:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgCv75T5Bz3ZZB; Sun, 13 Jul 2025 18:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lw4JCuCIk84wEeml19a1HP9p4KbXZDbfvY2VCpyH1hQ=; b=PwIFIr6idzfK2HofrSPYHv7w25beJDoVqLY1YV9OhhpDx/g9qpn2WPQEg3fq20CuIQAp8T hYlSo64Xm8B+aXqwEtdcGp8FXkdsAH9e3u1nhAZqo0hOjLfhCMulP6hikFKvlF3gKFbJwu gnnsYe1tYZ6evLU2d5yVkHTST4wMX+Ds08AO6eg/cqa7f7dBV98rJ6p4jt3paIkH1bs/oV +5SISMH1dskBbCM0bMosc2W2/MXZjzcrPWP4SsAtJK+HOjOJWJmSjvyOhsO4D26mP4Nvg3 0tFOxi7+a+WdY3IhFttzm+C1KQF7UA5at8LZiLHlVkBTi90nvFOtkEoJv5vxoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lw4JCuCIk84wEeml19a1HP9p4KbXZDbfvY2VCpyH1hQ=; b=jh6ymG+7GR81HiDtnTiZDvLfP/UiygF1tEmS0lFNIV+1q9qLbNRhWCIrze+JuC03Khr6Oh G8pacA06WkayVxt9O9D7FhDl7L3GG1+gK2Za0GZiihg5EPQC0UiGlKle0exMKNGUjpEtMC S3wHIvVat7O4Xjkk7ZgnKk742ftIDFxKCaq3ACn3HsFMwcfubsCw7OpOobSwZAav/x9ans Xfv+RzxD7S0/6PrLYpZG12rrAWNjAjDNr0cArtzRAuWNGpCS9UAcFO7iruhxkp9eAy870o 3JxaHlJqDVNym7AYr8TSD72SJkM8aDeS4zrOUDh7k6BvNsThfMVVngk3FwOSWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752429699; a=rsa-sha256; cv=none; b=s6BQcdNQJmCFFOW76jbIFJgX5TXWwe5g24y4ecXBank7invPa7zTGSFF5RvFFDANdP2RnW fJC/vw6AQm4NmZgizd8fuEgChk0URsLfIGf4lts8YTsZ9E1wvZIK+EXjqouRx7ulDC4Pig 0KwSr77zhREha1Cb/o6ZmgYOBlckC78urC0TbQ87BBa7su3Q223yP3ykO36Cx379mRJ7Iz FfgZx9cNqbyni8SbW5Az0PacInpbFpcZC+ig3TCjTK1j7q0B30oBFjjr2U3KUOprCqsWbU ifFW4s14bJfWUv0qKgpiogF2/D1e+a5eo8x2+zt8avML5vbVwWzs3iW7fUwv2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgCv7400Mz48l; Sun, 13 Jul 2025 18:01: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 56DI1dJA099159; Sun, 13 Jul 2025 18:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DI1doG099156; Sun, 13 Jul 2025 18:01:39 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:01:39 GMT Message-Id: <202507131801.56DI1doG099156@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: 077e30e61d7e - main - powerpc: Fix multiple issues with FP/VSX save/restore List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 077e30e61d7e1c90af7df31989bb976a3ace0c69 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=077e30e61d7e1c90af7df31989bb976a3ace0c69 commit 077e30e61d7e1c90af7df31989bb976a3ace0c69 Author: Timothy Pearson AuthorDate: 2025-07-06 19:28:30 +0000 Commit: Justin Hibbits CommitDate: 2025-07-13 18:00:56 +0000 powerpc: Fix multiple issues with FP/VSX save/restore Multiple issues existed within the powerpc FP/VSX save/restore functionality, leading to register corruption and loss of register contents in specific scenarios involving high signal load and use of both floating point and VSX instructions. Issue #1 On little endian systems the PCB used the wrong location for the shadowed FP register within the larger VSX register. This appears to have been an attempt to correct issue #2 without understanding how the vector load/store instructions actually operate. Issue #2 On little endian systems, the VSX state save/restore routines swapped 32-bit words within the 64-bit aliased double word for the associated floating point register. This was due to the use of a word-oriented load/store vs. doubleword oriented load/store. Issue #3 The FPU was turned off in the PCB but not in hardware, leading to a potential race condition if the same thread was scheduled immediately after sigreturn. The triggering codebase for this is Go, which makes heavy use of signals and and generates an unusual mix of floating point and VSX assembler. As a result, when combined with th powerpc lazy FPU restore, a condition was repeatedly hit whereby the thread was interrupted in FP+VSX mode, then restored in FP only mode, thus reliably triggering the issues above. Also clean up the associated asm() style issue flagged by GitHub Actions. Signed-off-by: Timothy Pearson MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1756 --- sys/powerpc/include/pcb.h | 10 +--------- sys/powerpc/include/ucontext.h | 2 ++ sys/powerpc/powerpc/exec_machdep.c | 33 ++++++++++++++++++++++++--------- sys/powerpc/powerpc/fpu.c | 30 ++++++++++++++++++++++++++---- 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/sys/powerpc/include/pcb.h b/sys/powerpc/include/pcb.h index 050ada6b0f64..0230cf78aba7 100644 --- a/sys/powerpc/include/pcb.h +++ b/sys/powerpc/include/pcb.h @@ -66,16 +66,8 @@ struct pcb { #define PCB_VECREGS 0x200 /* Process had Altivec registers initialized */ struct fpu { union { -#if _BYTE_ORDER == _BIG_ENDIAN - double fpr; - uint32_t vsr[4]; -#else uint32_t vsr[4]; - struct { - double padding; - double fpr; - }; -#endif + double fpr; } fpr[32]; double fpscr; /* FPSCR stored as double for easier access */ } pcb_fpu; /* Floating point processor */ diff --git a/sys/powerpc/include/ucontext.h b/sys/powerpc/include/ucontext.h index d35c6c773fe0..dc87edd578bc 100644 --- a/sys/powerpc/include/ucontext.h +++ b/sys/powerpc/include/ucontext.h @@ -41,6 +41,7 @@ typedef struct __mcontext { int mc_flags; #define _MC_FP_VALID 0x01 #define _MC_AV_VALID 0x02 +#define _MC_VS_VALID 0x04 int mc_onstack; /* saved onstack flag */ int mc_len; /* sizeof(__mcontext) */ __uint64_t mc_avec[32*2]; /* vector register file */ @@ -56,6 +57,7 @@ typedef struct __mcontext32 { int mc_flags; #define _MC_FP_VALID 0x01 #define _MC_AV_VALID 0x02 +#define _MC_VS_VALID 0x04 int mc_onstack; /* saved onstack flag */ int mc_len; /* sizeof(__mcontext) */ uint64_t mc_avec[32*2]; /* vector register file */ diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index c6b2b01d9d30..8a33d0f589a7 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -349,13 +349,6 @@ sys_sigreturn(struct thread *td, struct sigreturn_args *uap) if (error != 0) return (error); - /* - * Save FPU state if needed. User may have changed it on - * signal handler - */ - if (uc.uc_mcontext.mc_srr1 & PSL_FP) - save_fpu(td); - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", @@ -432,6 +425,7 @@ grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) } if (pcb->pcb_flags & PCB_VSX) { + mcp->mc_flags |= _MC_VS_VALID; for (i = 0; i < 32; i++) memcpy(&mcp->mc_vsxfpreg[i], &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double)); @@ -481,6 +475,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp) struct pcb *pcb; struct trapframe *tf; register_t tls; + register_t msr; int i; pcb = td->td_pcb; @@ -531,6 +526,22 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf->srr1 &= ~(PSL_FP | PSL_VSX | PSL_VEC); pcb->pcb_flags &= ~(PCB_FPU | PCB_VSX | PCB_VEC); + /* + * Ensure the FPU is also disabled in hardware. + * + * Without this, it's possible for the register reload to fail if we + * don't switch to a FPU disabled context before resuming the original + * thread. Specifically, if the FPU/VSX unavailable exception is never + * hit, then whatever data is still in the FP/VSX registers when + * sigresume is callled will used by the resumed thread, instead of the + * previously saved data from the mcontext. + */ + critical_enter(); + msr = mfmsr() & ~(PSL_FP | PSL_VSX | PSL_VEC); + isync(); + mtmsr(msr); + critical_exit(); + if (mcp->mc_flags & _MC_FP_VALID) { /* enable_fpu() will happen lazily on a fault */ pcb->pcb_flags |= PCB_FPREGS; @@ -539,8 +550,12 @@ set_mcontext(struct thread *td, mcontext_t *mcp) for (i = 0; i < 32; i++) { memcpy(&pcb->pcb_fpu.fpr[i].fpr, &mcp->mc_fpreg[i], sizeof(double)); - memcpy(&pcb->pcb_fpu.fpr[i].vsr[2], - &mcp->mc_vsxfpreg[i], sizeof(double)); + } + if (mcp->mc_flags & _MC_VS_VALID) { + for (i = 0; i < 32; i++) { + memcpy(&pcb->pcb_fpu.fpr[i].vsr[2], + &mcp->mc_vsxfpreg[i], sizeof(double)); + } } } diff --git a/sys/powerpc/powerpc/fpu.c b/sys/powerpc/powerpc/fpu.c index 0eaff2ea4932..cc8f22f7dda3 100644 --- a/sys/powerpc/powerpc/fpu.c +++ b/sys/powerpc/powerpc/fpu.c @@ -64,8 +64,19 @@ save_fpu_int(struct thread *td) * Save the floating-point registers and FPSCR to the PCB */ if (pcb->pcb_flags & PCB_VSX) { - #define SFP(n) __asm ("stxvw4x " #n ", 0,%0" \ +#if _BYTE_ORDER == _BIG_ENDIAN + #define SFP(n) __asm("stxvw4x " #n ", 0,%0" \ :: "b"(&pcb->pcb_fpu.fpr[n])); +#else + /* + * stxvw2x will swap words within the FP double word on LE systems, + * leading to corruption if VSX is used to store state and FP is + * subsequently used to restore state. + * Use stxvd2x instead. + */ + #define SFP(n) __asm("stxvd2x " #n ", 0,%0" \ + :: "b"(&pcb->pcb_fpu.fpr[n])); +#endif SFP(0); SFP(1); SFP(2); SFP(3); SFP(4); SFP(5); SFP(6); SFP(7); SFP(8); SFP(9); SFP(10); SFP(11); @@ -76,7 +87,7 @@ save_fpu_int(struct thread *td) SFP(28); SFP(29); SFP(30); SFP(31); #undef SFP } else { - #define SFP(n) __asm ("stfd " #n ", 0(%0)" \ + #define SFP(n) __asm("stfd " #n ", 0(%0)" \ :: "b"(&pcb->pcb_fpu.fpr[n].fpr)); SFP(0); SFP(1); SFP(2); SFP(3); SFP(4); SFP(5); SFP(6); SFP(7); @@ -149,8 +160,19 @@ enable_fpu(struct thread *td) :: "b"(&pcb->pcb_fpu.fpscr)); if (pcb->pcb_flags & PCB_VSX) { - #define LFP(n) __asm ("lxvw4x " #n ", 0,%0" \ +#if _BYTE_ORDER == _BIG_ENDIAN + #define LFP(n) __asm("lxvw4x " #n ", 0,%0" \ + :: "b"(&pcb->pcb_fpu.fpr[n])); +#else + /* + * lxvw4x will swap words within the FP double word on LE systems, + * leading to corruption if FP is used to store state and VSX is + * subsequently used to restore state. + * Use lxvd2x instead. + */ + #define LFP(n) __asm("lxvd2x " #n ", 0,%0" \ :: "b"(&pcb->pcb_fpu.fpr[n])); +#endif LFP(0); LFP(1); LFP(2); LFP(3); LFP(4); LFP(5); LFP(6); LFP(7); LFP(8); LFP(9); LFP(10); LFP(11); @@ -161,7 +183,7 @@ enable_fpu(struct thread *td) LFP(28); LFP(29); LFP(30); LFP(31); #undef LFP } else { - #define LFP(n) __asm ("lfd " #n ", 0(%0)" \ + #define LFP(n) __asm("lfd " #n ", 0(%0)" \ :: "b"(&pcb->pcb_fpu.fpr[n].fpr)); LFP(0); LFP(1); LFP(2); LFP(3); LFP(4); LFP(5); LFP(6); LFP(7); From nobody Sun Jul 13 18:01:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgCv91N7Qz61Gsm; Sun, 13 Jul 2025 18:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgCv85Pqdz3Zs1; Sun, 13 Jul 2025 18:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/koMnMwzluD4Yk5TBNK6CPT9JLeGE4mnfXqC1R5GDA=; b=aGVzpvqN8dc+xiBw8nOMYCfp9MN31KFY3H6hN6kbNdOFRL1m3UfmgyCggIzhbjkPC3f5OJ wb19/kXAnymqVB+YHZScA+Ajr4Y+nvEElvjEYp2ihHNLvUr9cr9NuN7glGdIsGta7gGuLQ DST1BZErRJ/P2TXtFurrksNbuIznGYa96ae9tGmpBl3hrS2wdT2pRJNyk8T6TPqUbmI+Jo DoqULT4ck0X5p2Vz+4Fp0WFq+ddy6yEHTdDYI9/IgPv3PGik/eg76ZeuH3C6UrHcikVX4u HvNUUjwEQNRWFJUjQHsPhIyIcoOMzkP2AG1sJ7uj3Nd+yhRy8c2fCt9A64aWiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/koMnMwzluD4Yk5TBNK6CPT9JLeGE4mnfXqC1R5GDA=; b=sD5Wb0B223xmvcPHxSEeqFSk+BVl74qiU59E7WXuMsgSwZpbOsHRPdlYw13/L/XLvgjKHd xL2U3NdONUZMWbp+N+ypimTObZ1nEzJHcWwfXPEMXq6/jos+rRENNZiurgt4+qhr2uuZER cfiYg0Jma2kc+pm9U20pHQjJ3a974r8yDFVQYiEDQbjDmjNsOiuMaBvioyHmtPFNeGpHCp zX8jON8NHIQ9yp4httnbj9KKdZv41sQs8EPekxMPOW9BleJAigHaKr/arzT8kLLq1+Y26o 94p3Z8mFQodARdhyfeJ/x/lGIxhMyt+j9KPS80fCGBOxoQohoIb3ifSWWw0GHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752429700; a=rsa-sha256; cv=none; b=ji8w4rW9cQYkx5J8RzTTmMjRBueF9H/rFJZMdMDXKomxM/43JYS8OqXlDh5kzmokICk4OR gDCCm6ry+v6qM45qgdvEF6PAoIa3LeT2Yh+Jg5nm07HqtkjEeIoHp2PXOt+vnea2pSTPR5 0hoiJIyrKoGO8aMpEFBVsuAi5U8XwTFkt9bsHdBTggagm8a12OC8XWhmli5Kzl77FObzH0 jMVbfCqqrF9+nu0HbDljVdLFdLSdxpoIL/O2Yx0KcrGelcRnmqyX3N1Kfp4klgtbEehErn QQxQLeh/i+GYidGSoCTKsq+YkfdsVnZxZoNAl+JLnGrMKHA+zd1LQFrWhBplhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgCv84y1cz4Cs; Sun, 13 Jul 2025 18:01: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 56DI1e7P099197; Sun, 13 Jul 2025 18:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DI1ewi099194; Sun, 13 Jul 2025 18:01:40 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:01:40 GMT Message-Id: <202507131801.56DI1ewi099194@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: 8efa35fea384 - main - libc/powerpc64: Fix swapcontext(3) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8efa35fea384d209c683dfbae8f49f2737a41941 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=8efa35fea384d209c683dfbae8f49f2737a41941 commit 8efa35fea384d209c683dfbae8f49f2737a41941 Author: Timothy Pearson AuthorDate: 2025-07-08 13:41:15 +0000 Commit: Justin Hibbits CommitDate: 2025-07-13 18:00:56 +0000 libc/powerpc64: Fix swapcontext(3) On PowerPC platforms a valid link to the Table of Contents (TOC) is required for PLT lookups to function. This TOC pointer is stored in a dedicated register, and is used along with the stack pointer by both C prologue and PLT lookup code. When calling swapcontext() with uc_link != NULL, a PLT lookup to setcontext(3) is attempted from within the _ctx_done context. The exiting process has usually trashed both r1 and r2 at this point, leading to a crash within the PLT lookup before setcontext(2) is reached to restore the linked context. Save and restore r2 as in a regular function. This ensures the subsequent PLT lookup to setcontext(3) succeeds. Signed-off-by: Timothy Pearson MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1759 --- lib/libc/powerpc64/gen/_ctx_start.S | 14 ++++++++ lib/libc/powerpc64/gen/makecontext.c | 3 +- lib/libc/tests/sys/Makefile | 4 +-- lib/libc/tests/sys/swapcontext_test.c | 63 +++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/lib/libc/powerpc64/gen/_ctx_start.S b/lib/libc/powerpc64/gen/_ctx_start.S index c2f8abfd6486..98225f9c1138 100644 --- a/lib/libc/powerpc64/gen/_ctx_start.S +++ b/lib/libc/powerpc64/gen/_ctx_start.S @@ -34,6 +34,16 @@ ld %r2,8(%r14) ld %r14,0(%r14) #else + /* + * The stack frame was already set up in makecontext(), + * so we can safely use the guaranteed fields here. + * + * Note we do step on the allocated stack frame's TOC, + * but since we never return from this function (i.e. + * never restore the stack frame) this should be safe. + */ + std %r2,24(%r1) /* save TOC */ + /* Load global entry point */ mr %r12,%r14 #endif @@ -41,6 +51,10 @@ blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ nop +#if defined(_CALL_ELF) && _CALL_ELF != 1 + /* Restore TOC */ + ld %r2,24(%r1) +#endif bl CNAME(_ctx_done) /* branch to ctxt completion func */ /* * we should never return from the diff --git a/lib/libc/powerpc64/gen/makecontext.c b/lib/libc/powerpc64/gen/makecontext.c index 75c2d40bdd60..9e3a976fa1bd 100644 --- a/lib/libc/powerpc64/gen/makecontext.c +++ b/lib/libc/powerpc64/gen/makecontext.c @@ -78,7 +78,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) */ stackargs = (argc > 8) ? argc - 8 : 0; sp = (char *) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size - - sizeof(uintptr_t)*(stackargs + 2); + - sizeof(uintptr_t)*(stackargs + 6); sp = (char *)((uintptr_t)sp & ~0x1f); mc = &ucp->uc_mcontext; @@ -119,6 +119,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) mc->mc_srr0 = *(uintptr_t *)_ctx_start; #else mc->mc_srr0 = (uintptr_t) _ctx_start; + mc->mc_gpr[12] = (uintptr_t) _ctx_start;/* required for prologue */ #endif mc->mc_gpr[1] = (uintptr_t) sp; /* new stack pointer */ mc->mc_gpr[14] = (uintptr_t) start; /* r14 <- start */ diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile index 89d341ff400a..88f8191a16eb 100644 --- a/lib/libc/tests/sys/Makefile +++ b/lib/libc/tests/sys/Makefile @@ -7,11 +7,11 @@ ATF_TESTS_C+= brk_test .endif ATF_TESTS_C+= cpuset_test ATF_TESTS_C+= errno_test +ATF_TESTS_C+= swapcontext_test ATF_TESTS_C+= queue_test ATF_TESTS_C+= sendfile_test -# TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, -# swapcontext +# TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg NETBSD_ATF_TESTS_C+= access_test NETBSD_ATF_TESTS_C+= bind_test NETBSD_ATF_TESTS_C+= chroot_test diff --git a/lib/libc/tests/sys/swapcontext_test.c b/lib/libc/tests/sys/swapcontext_test.c new file mode 100644 index 000000000000..f341a746e515 --- /dev/null +++ b/lib/libc/tests/sys/swapcontext_test.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2025 Raptor Computing Systems, LLC + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +#include + +#define STACK_SIZE (64ull << 10) + +static volatile int callback_reached = 0; + +static ucontext_t uctx_save, uctx_switch; + +static void swapcontext_callback() +{ + // Increment callback reached variable + // If this is called multiple times, we will fail the test + // If this is not called at all, we will fail the test + callback_reached++; +} + +ATF_TC(swapcontext_basic); +ATF_TC_HEAD(swapcontext_basic, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify basic functionality of swapcontext"); +} + +ATF_TC_BODY(swapcontext_basic, tc) +{ + char *stack; + int res; + + stack = malloc(STACK_SIZE); + ATF_REQUIRE_MSG(stack != NULL, "malloc failed: %s", strerror(errno)); + res = getcontext(&uctx_switch); + ATF_REQUIRE_MSG(res == 0, "getcontext failed: %s", strerror(errno)); + + uctx_switch.uc_stack.ss_sp = stack; + uctx_switch.uc_stack.ss_size = STACK_SIZE; + uctx_switch.uc_link = &uctx_save; + makecontext(&uctx_switch, swapcontext_callback, 0); + + res = swapcontext(&uctx_save, &uctx_switch); + + ATF_REQUIRE_MSG(res == 0, "swapcontext failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(callback_reached == 1, + "callback failed, reached %d times", callback_reached); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, swapcontext_basic); + + return (atf_no_error()); +} + From nobody Sun Jul 13 18:24:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgDPv6mB3z61JY6; Sun, 13 Jul 2025 18:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgDPv3f0Sz3tVs; Sun, 13 Jul 2025 18:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yYkkP2RT7hcdjo9XsvcMP1EgPdpPcHyBc6sIPue57DU=; b=R+HTz1lcp5KLcO6pCGEP1rajXUzqB5H66+2Zdt0nTPTr+CpNYD7W5lkJr4LRdg6idZr7ZV ZWsWbdnaITTHciODJfYah8/eOqqJeO53DiKpnfch+ILPjBUDq1pNVJh3yB/UeH8Zkfiesq I5UY6ilm0kh8Dw1W4h/fQgJW5GwjRbQTppcUWoXr0VUNcJOR1fz8dNdBTjn2ZvrdfRFyOQ VIPou1Eubwp8uQcH4fd9pDdi/VhEKTLw50E41wkSD8iCtH9KBvxz65CbtLPTyAR5cTWtIO CBu1g/v3yeHlYsMZVdWa/uoD+PbLPXLX/95QoKykKRSXuBYkewu1uck/N3UQ7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yYkkP2RT7hcdjo9XsvcMP1EgPdpPcHyBc6sIPue57DU=; b=bZWqyIWwOgfk+kFiTuUXlGIPrypXe4BHE9Mv99KCr/g1GcmRVKAhQltF8GufJY4zNTz4Y7 tZTlv10btL2uBRVt5/Cfioo/eG0IFJ7HHSLV9gRkdnImFijKOcimbX0+KnNWTpnsGEbzSH 4x5c/UXfvZvoRbHjmdAoywGjd/eq2KKrjRZHRfbxsIHtqU7+Unquua+JUPX2CkxpxFzuIG MjGbKdsjd4jum2cFqm87Y6gfODuz3ob9Ul2TtebK84LZTAEESfJVEczmQJkNrgwu3t/Tbx 2/JoGcbcEEubGfeHd5gR45BUz2OUipEKXJ8YFUY3omgoeOPUwOQr5UeS0d++mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752431091; a=rsa-sha256; cv=none; b=hJ+1CZAiphPlPGobgRWQL/8xfGFlAyq3A+MHqP8tOeSmFNxp85NRtZejylIii6V0dMiZZA wVs1PuT7cy3m+FKmh/vhXqq0pT3BxE0dhFmPMc1X3YDABvShJNY5DeKX9jIcb7xVlglH3J dM/phf8zNuf9hR1by7WLdw/uJyTkkhfDH3m/U6nzKWMXUrCzNrBJ9Nyst9Wa+UyOMM2X9S wUQHRRBH2KrW1brnP09slcn1vm9DBWLZGiG/1wJU0RP+bZdJCWIPuQB0ShDal3zhkE0YJi GLg4/R78aQzHJbJuYMCTcuEO30ugu3IP1yOyLFG/uQYNYQytCTchaIPbLAe6XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgDPv2pP0z4kP; Sun, 13 Jul 2025 18:24: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 56DIOpxD043826; Sun, 13 Jul 2025 18:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DIOpn0043823; Sun, 13 Jul 2025 18:24:51 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:24:51 GMT Message-Id: <202507131824.56DIOpn0043823@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: da89500adbea - main - rc_subr_test: Bump some sleep timeouts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: da89500adbea360533d2442a674c8af0741b7ff1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=da89500adbea360533d2442a674c8af0741b7ff1 commit da89500adbea360533d2442a674c8af0741b7ff1 Author: Mark Johnston AuthorDate: 2025-07-13 15:08:00 +0000 Commit: Mark Johnston CommitDate: 2025-07-13 18:24:36 +0000 rc_subr_test: Bump some sleep timeouts The test verifies that the rc framework will OOM-protect a process spawned by rc. It just wraps a 5-second /bin/sleep invocation as part of this test. The rc framework uses procctl to set the OOM-protect bit after the process has started, i.e., it uses procctl -p. So, with a 5 second timeout, it's possible for the process to exit before procctl actually runs, if the system is heavily loaded. (I see this failure occasionally with KMSAN configured and many tests running in parallel.) Bump the timeout to reduce the risk of this happening. The timeout value is arbitrary since the test will stop the rc process, i.e., we don't have to wait for 60 seconds to elapse before the test passes. MFC after: 1 week --- libexec/rc/tests/rc_subr_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index 60f77c2c2de3..9931389e7a02 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -52,7 +52,7 @@ oomprotect_all_body() _rc_arg="$4" setvar "${name}_oomprotect" all command="/usr/sbin/daemon" - command_args="-P $pidfile -p $_childpidfile -- /bin/sleep 5" + command_args="-P $pidfile -p $_childpidfile -- /bin/sleep 60" run_rc_command "$_rc_arg" LITERAL @@ -92,7 +92,7 @@ oomprotect_yes_body() setvar "${name}_oomprotect" yes procname="/bin/sleep" command="/usr/sbin/daemon" - command_args="-p $pidfile -- $procname 5" + command_args="-p $pidfile -- $procname 60" run_rc_command "$_rc_arg" LITERAL From nobody Sun Jul 13 18:24:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgDPw6X3wz61JZd; Sun, 13 Jul 2025 18:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgDPw3ynVz3tbK; Sun, 13 Jul 2025 18:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvDq1YgT29nhrJNana5uF3u7lC7RSqkeX2pCpumfsAM=; b=nIBueT2k0y7yGl0N3uEgrhASGIurXPislWVcjhXdU97Bx8WfDIG25snhqfqAyDA97ZsNUM 4zjOxh92tpRkrii/f3e94OJSD4TSU1az2AvGXywbo/15YPfWUdLcEjtcTvpi2WpCV7lZtF +yRhbMMVBov+Btv/PRt7sVzsI0rUbbUVaXKBpGof4SoNcyTYCj6HcJ6VKWVsQnOwHDjIUk ThvfaQ/gVZMdBLyQ3g1LG1PSuJWwDRljT4aLh40PTiy+YlGC1yiLS1/J1YFUFjAsi4aRnT hZmbKuSfFkdhKPa8xbi9ARGJJnD31xEqlwm/qSrtG8BKYbIRk8zjb9wZEPoT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvDq1YgT29nhrJNana5uF3u7lC7RSqkeX2pCpumfsAM=; b=Q/fuH2HExYxPhZbPUv0gOUVzf8lhkltof83fFJlOrlQeY1c1KIauX7GidXerUc4o7UxCC1 lvg31b1laibCa3nvddsl+kUe/Y02265nZd6gfsnJmsCrJAF4gvdX7GrfKm6t9a4iAmm/O8 /qQvhAarPBdq86oSkt81sCynYUg2DM22JCpDxxwMkpQy7ZXEtFh5ftL0gm6gT11pHvslcI w88JEw0bRPjQTzOV/QYybJxK5VrKYoOL9GOFPt5zVu5so/OOGnuFFatqrSOc7WuhLgar/1 AV57umH/f5HVCOz0AEt5vLd93w6ofMIBp6rd2fZTxjRhBi3K9nqeTt9mQFEWgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752431092; a=rsa-sha256; cv=none; b=qLu3aDEc9QywyPmT1hb7m5l8dk+bxCT0QE47PpAAYJpohqD5Ba/1oPdqKlS+UxpTN9Exg0 C8b2aSvCxmL//sqI0lo+Z50hSGXipTuzfu623eREGwD21hirk3btsG6tQBHkLZB6plsyOh 7pQvH6qAi6CY8biBhswAS7JtMOWWtHpGTtdDrYp4fY0RB7VRDtzp6BRy64mKdggxHtRBPq FOn1qGtwjxJtpFbHpuxQvXMj4Wo8AXbuZqtWLDRxxGYwkxwJtSlNJIntnq6Y4yqeYRZwq0 wyK6H1XaTtd+zjIAn4Oh8UbwAPiA/Y+W5bZeQPg8xkbFc8RYrO57k1yd4T7d8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgDPw3R8vz51F; Sun, 13 Jul 2025 18:24: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 56DIOqNf043863; Sun, 13 Jul 2025 18:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DIOqxd043860; Sun, 13 Jul 2025 18:24:52 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:24:52 GMT Message-Id: <202507131824.56DIOqxd043860@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: 9f6718073382 - main - msdosfs: Fix handling of eofflag in VOP_READDIR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9f6718073382608519912e178e4c313dd61246b3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9f6718073382608519912e178e4c313dd61246b3 commit 9f6718073382608519912e178e4c313dd61246b3 Author: Mark Johnston AuthorDate: 2025-07-13 15:05:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-13 18:24:36 +0000 msdosfs: Fix handling of eofflag in VOP_READDIR We also need to set it when an end-of-directory marker is reached. Reported by: vishwin Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51290 --- sys/fs/msdosfs/msdosfs_vnops.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 5db61c8951f6..33e0d94954d7 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1521,6 +1521,9 @@ msdosfs_readdir(struct vop_readdir_args *ap) ap->a_vp, uio, ap->a_cred, ap->a_eofflag); #endif + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; + /* * msdosfs_readdir() won't operate properly on regular files since * it does i/o only with the filesystem vnode, and hence can @@ -1614,8 +1617,11 @@ msdosfs_readdir(struct vop_readdir_args *ap) on = (offset - bias) & pmp->pm_crbomask; n = min(pmp->pm_bpcluster - on, uio->uio_resid); diff = dep->de_FileSize - (offset - bias); - if (diff <= 0) - break; + if (diff <= 0) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + goto out; + } n = min(n, diff); error = pcbmap(dep, lbn, &bn, &cn, &blsize); if (error) @@ -1646,6 +1652,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) */ if (dentp->deName[0] == SLOT_EMPTY) { brelse(bp); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; goto out; } /* @@ -1743,15 +1751,6 @@ out: uio->uio_offset = off; - /* - * Set the eofflag (NFS uses it) - */ - if (ap->a_eofflag) { - if (dep->de_FileSize - (offset - bias) <= 0) - *ap->a_eofflag = 1; - else - *ap->a_eofflag = 0; - } return (error); } From nobody Sun Jul 13 21:26:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgJRR4Sl3z61W6C; Sun, 13 Jul 2025 21:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgJRR36HJz3VQN; Sun, 13 Jul 2025 21:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752441987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WcCPC2fzdTYVewmBdTmIszZX7qHOB5UaWTEotdMbUfE=; b=DdHbfaiKFqmn2VyUpadu4kqDFjdm8FYMOtpglbLiARj0Q06VFmiudqRFJTTXnaG9Q1p9gQ lgrzOBNAeX+saHkSXCHy/Pv++YrTdRG1Kfdkscxl3NYPKtt1uZ/UVakuVHJrRrfbaNzw1z /bidMau4cM3+gYJeaXDOKLvuKprqukQ/VQuNLCDz5hWpM8B4X/CgruQAyWKDb4ZQ4yoTk7 /hXpHvjQfBrPqZ22VXxWu8JW6dHH1WYf44Xj9J4JkSj4VCoBMm1xwGuFEYq2ls3dt/k5bV /6tNPHqHiBSXAdiDW+h32MZ6IKlpka8P1YYdT4mW9ya/Z/f+0Ax1mTMc2G8Mgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752441987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WcCPC2fzdTYVewmBdTmIszZX7qHOB5UaWTEotdMbUfE=; b=hoO/krSeiPpIX/z+GtPLmOKLSkNvRIIFluxg+fdyb5H/0nUd8DzLC2zBAB5Ir4bnkNQcBM kb04TDyJJxnNgRuM1Gp+edltnirOOdCOH1NB5CQZPK24tVev62d6H3uAt1xbGiF5fQnWig UMRkMWxbNgi+cpK4jdLdyI06d2Ztxh505da+9cTcn4JqyecfcDuwhLSsh6yjN/kQPabEve gSutBcJPj2CfvTfKQRgfVXzMwbnHZjbhR1sC7jP1Ji3WDS2QU4Ag3vCFA4Ng/HCcCgXzqf Nfx2LbPNr5KVBvfZWyplE09J5U3J7sl/g6QUWm6JJBF7v9e25jq7HLkMlvKang== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752441987; a=rsa-sha256; cv=none; b=gFRTFSE0yjaotQ1ZDwwetquRx0AFNmu3a4c2bwoOKHmCIW8e+zAfOjHuJXRSDMspSzxC8d oOiHBJbL98b2KBRVJGG6EuGy9UxPpLws7HEy4UJRbruy+TQX7I/wLDoQATONv7HbgDKuD/ AEa3LPBgCEvMJH+gU0wE56JPlYpGm5E8iU0AB+8X7MLfyJ99lWDBIpSX3ruqXqGtnvzTbR i3jN78fNePd3J9vkntVSBH/G9EBpjZfR5svzphDM/dv5CdDKySBbqf1rtgAaLcGkDrktWs +omapbeVD3vqFIUZWcSLjZJCrh62f1namDa1vrRcSqMXQEmaXg5DYboxvXVxWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bgJRR2Qlmz9Wn; Sun, 13 Jul 2025 21:26: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 56DLQRJh084734; Sun, 13 Jul 2025 21:26:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DLQRuS084731; Sun, 13 Jul 2025 21:26:27 GMT (envelope-from git) Date: Sun, 13 Jul 2025 21:26:27 GMT Message-Id: <202507132126.56DLQRuS084731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 697bf0f416e4 - main - fortune: Fix typo in dmesgd.nycbug.org example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 697bf0f416e4fe0fdd974b9eacdaed140fe18061 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=697bf0f416e4fe0fdd974b9eacdaed140fe18061 commit 697bf0f416e4fe0fdd974b9eacdaed140fe18061 Author: Christos Margiolis AuthorDate: 2025-07-13 21:25:07 +0000 Commit: Christos Margiolis CommitDate: 2025-07-13 21:25:58 +0000 fortune: Fix typo in dmesgd.nycbug.org example No functional change, but commit for correctness nonetheless. MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D51293 --- usr.bin/fortune/datfiles/freebsd-tips | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index 1e9501e3a6fb..6a2b59ff5fa7 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -555,7 +555,7 @@ Use "sysrc name=value" to add an entry and "sysrc -x name" to delete an entry. You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. Use the curl package to upload it like this: curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ -$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ +$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=add" \ --data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi % Want to know how much memory (in bytes) your machine has installed? Let